Browse Source

[IPv4] Tidy up some header files.

tags/v0.9.4
Michael Brown 16 years ago
parent
commit
2af6c8d130
6 changed files with 25 additions and 63 deletions
  1. 0
    1
      src/include/gpxe/icmp6.h
  2. 22
    7
      src/include/gpxe/ip.h
  3. 1
    1
      src/include/gpxe/ip6.h
  4. 0
    23
      src/include/ip.h
  5. 0
    29
      src/include/udp.h
  6. 2
    2
      src/proto/igmp.c

+ 0
- 1
src/include/gpxe/icmp6.h View File

7
  *
7
  *
8
  */
8
  */
9
 
9
 
10
-#include <ip.h>
11
 #include <gpxe/ip6.h>
10
 #include <gpxe/ip6.h>
12
 #include <gpxe/ndp.h>
11
 #include <gpxe/ndp.h>
13
 
12
 

+ 22
- 7
src/include/gpxe/ip.h View File

7
  *
7
  *
8
  */
8
  */
9
 
9
 
10
-#include <ip.h>
10
+#include <stdint.h>
11
+#include <gpxe/in.h>
12
+#include <gpxe/list.h>
11
 #include <gpxe/retry.h>
13
 #include <gpxe/retry.h>
12
 
14
 
15
+struct io_buffer;
16
+struct net_device;
17
+struct net_protocol;
18
+
13
 /* IP constants */
19
 /* IP constants */
14
 
20
 
15
 #define IP_VER			0x40U
21
 #define IP_VER			0x40U
27
 #define IP_FRAG_IOB_SIZE	1500
33
 #define IP_FRAG_IOB_SIZE	1500
28
 #define IP_FRAG_TIMEOUT		50
34
 #define IP_FRAG_TIMEOUT		50
29
 
35
 
30
-/* IP4 pseudo header */
36
+/** An IPv4 packet header */
37
+struct iphdr {
38
+	uint8_t  verhdrlen;
39
+	uint8_t  service;
40
+	uint16_t len;
41
+	uint16_t ident;
42
+	uint16_t frags;
43
+	uint8_t  ttl;
44
+	uint8_t  protocol;
45
+	uint16_t chksum;
46
+	struct in_addr src;
47
+	struct in_addr dest;
48
+} __attribute__ (( packed ));
49
+
50
+/** An IPv4 pseudo header */
31
 struct ipv4_pseudo_header {
51
 struct ipv4_pseudo_header {
32
 	struct in_addr src;
52
 	struct in_addr src;
33
 	struct in_addr dest;
53
 	struct in_addr dest;
68
 	struct list_head list;
88
 	struct list_head list;
69
 };
89
 };
70
 
90
 
71
-struct io_buffer;
72
-struct net_device;
73
-struct net_protocol;
74
-struct tcpip_protocol;
75
-
76
 extern struct list_head ipv4_miniroutes;
91
 extern struct list_head ipv4_miniroutes;
77
 
92
 
78
 extern struct net_protocol ipv4_protocol;
93
 extern struct net_protocol ipv4_protocol;

+ 1
- 1
src/include/gpxe/ip6.h View File

7
  *
7
  *
8
  */
8
  */
9
 
9
 
10
-#include <ip.h>
10
+#include <stdint.h>
11
 #include <gpxe/in.h>
11
 #include <gpxe/in.h>
12
 
12
 
13
 /* IP6 constants */
13
 /* IP6 constants */

+ 0
- 23
src/include/ip.h View File

1
-#ifndef	_IP_H
2
-#define	_IP_H
3
-
4
-#include "stddef.h"
5
-#include "stdint.h"
6
-#include <gpxe/in.h>
7
-
8
-struct iphdr {
9
-	uint8_t  verhdrlen;
10
-	uint8_t  service;
11
-	uint16_t len;
12
-	uint16_t ident;
13
-	uint16_t frags;
14
-	uint8_t  ttl;
15
-	uint8_t  protocol;
16
-	uint16_t chksum;
17
-	struct in_addr src;
18
-	struct in_addr dest;
19
-} PACKED;
20
-
21
-extern uint16_t tcpudpchksum(struct iphdr *ip);
22
-
23
-#endif	/* _IP_H */

+ 0
- 29
src/include/udp.h View File

1
-#ifndef	_UDP_H
2
-#define	_UDP_H
3
-
4
-#include "stddef.h"
5
-#include "stdint.h"
6
-#include <gpxe/in.h>
7
-#include "ip.h"
8
-
9
-struct udp_pseudo_hdr {
10
-	struct in_addr  src;
11
-	struct in_addr  dest;
12
-	uint8_t  unused;
13
-	uint8_t  protocol;
14
-	uint16_t len;
15
-} PACKED;
16
-struct udphdr {
17
-	uint16_t src;
18
-	uint16_t dest;
19
-	uint16_t len;
20
-	uint16_t chksum;
21
-	struct {} payload;
22
-} PACKED;
23
-struct udppacket {
24
-	struct iphdr	ip;
25
-	struct udphdr	udp;
26
-	struct {} payload;
27
-} PACKED;
28
-
29
-#endif	/* _UDP_H */

+ 2
- 2
src/proto/igmp.c View File

3
  *
3
  *
4
  */
4
  */
5
 
5
 
6
+#if 0
7
+
6
 #include <ip.h>
8
 #include <ip.h>
7
 #include <igmp.h>
9
 #include <igmp.h>
8
 
10
 
9
-#if 0
10
-
11
 static unsigned long last_igmpv1 = 0;
11
 static unsigned long last_igmpv1 = 0;
12
 static struct igmptable_t igmptable[MAX_IGMP];
12
 static struct igmptable_t igmptable[MAX_IGMP];
13
 
13
 

Loading…
Cancel
Save