1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 #ifndef _LINUX_IP_H
18 #define _LINUX_IP_H
19 #include <asm/byteorder.h>
20
21 #define IPOPT_END 0
22 #define IPOPT_NOOP 1
23 #define IPOPT_SEC 130
24 #define IPOPT_LSRR 131
25 #define IPOPT_SSRR 137
26 #define IPOPT_RR 7
27 #define IPOPT_SID 136
28 #define IPOPT_TIMESTAMP 68
29
30
31 #define MAXTTL 255
32
33 struct timestamp {
34 __u8 len;
35 __u8 ptr;
36 #if defined(__LITTLE_ENDIAN_BITFIELD)
37 __u8 flags:4,
38 overflow:4;
39 #elif defined(__BIG_ENDIAN_BITFIELD)
40 __u8 overflow:4,
41 flags:4;
42 #else
43 #error "Please fix <asm/byteorder.h>"
44 #endif
45 __u32 data[9];
46 };
47
48
49 #define MAX_ROUTE 16
50
51 struct route {
52 char route_size;
53 char pointer;
54 unsigned long route[MAX_ROUTE];
55 };
56
57 #define IPOPT_OPTVAL 0
58 #define IPOPT_OLEN 1
59 #define IPOPT_OFFSET 2
60 #define IPOPT_MINOFF 4
61 #define MAX_IPOPTLEN 40
62 #define IPOPT_NOP IPOPT_NOOP
63 #define IPOPT_EOL IPOPT_END
64 #define IPOPT_TS IPOPT_TIMESTAMP
65
66 #define IPOPT_TS_TSONLY 0
67 #define IPOPT_TS_TSANDADDR 1
68 #define IPOPT_TS_PRESPEC 2
69
70 struct options {
71 __u32 faddr;
72 unsigned char optlen;
73 unsigned char srr;
74 unsigned char rr;
75 unsigned char ts;
76 unsigned char is_setbyuser:1,
77 is_data:1,
78 is_strictroute:1,
79 srr_is_hit:1,
80 is_changed:1,
81 rr_needaddr:1,
82 ts_needtime:1,
83 ts_needaddr:1;
84 unsigned char __pad1;
85 unsigned char __pad2;
86 unsigned char __pad3;
87 unsigned char __data[0];
88 };
89
90 struct iphdr {
91 #if defined(__LITTLE_ENDIAN_BITFIELD)
92 __u8 ihl:4,
93 version:4;
94 #elif defined (__BIG_ENDIAN_BITFIELD)
95 __u8 version:4,
96 ihl:4;
97 #else
98 #error "Please fix <asm/byteorder.h>"
99 #endif
100 __u8 tos;
101 __u16 tot_len;
102 __u16 id;
103 __u16 frag_off;
104 __u8 ttl;
105 __u8 protocol;
106 __u16 check;
107 __u32 saddr;
108 __u32 daddr;
109
110 };
111
112 #endif