浏览代码

[IPv4] Tidy up some header files.

tags/v0.9.4
Michael Brown 16 年前
父节点
当前提交
2af6c8d130
共有 6 个文件被更改,包括 25 次插入63 次删除
  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 查看文件

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

+ 22
- 7
src/include/gpxe/ip.h 查看文件

@@ -7,9 +7,15 @@
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 13
 #include <gpxe/retry.h>
12 14
 
15
+struct io_buffer;
16
+struct net_device;
17
+struct net_protocol;
18
+
13 19
 /* IP constants */
14 20
 
15 21
 #define IP_VER			0x40U
@@ -27,7 +33,21 @@
27 33
 #define IP_FRAG_IOB_SIZE	1500
28 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 51
 struct ipv4_pseudo_header {
32 52
 	struct in_addr src;
33 53
 	struct in_addr dest;
@@ -68,11 +88,6 @@ struct frag_buffer {
68 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 91
 extern struct list_head ipv4_miniroutes;
77 92
 
78 93
 extern struct net_protocol ipv4_protocol;

+ 1
- 1
src/include/gpxe/ip6.h 查看文件

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

+ 0
- 23
src/include/ip.h 查看文件

@@ -1,23 +0,0 @@
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 查看文件

@@ -1,29 +0,0 @@
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 查看文件

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

正在加载...
取消
保存