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
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 union {
37 #if defined(__i386__)
38 __u8 flags:4,
39 overflow:4;
40 #elif defined(__mc68000__)
41 __u8 overflow:4,
42 flags:4;
43 #elif defined(__MIPSEL__)
44 __u8 flags:4,
45 overflow:4;
46 #elif defined(__MIPSEB__)
47 __u8 overflow:4,
48 flags:4;
49 #elif defined(__alpha__)
50 __u8 flags:4,
51 overflow:4;
52 #elif defined(__sparc__)
53 __u8 overflow:4,
54 flags:4;
55 #else
56 #error "Adjust this structure to match your CPU"
57 #endif
58 __u8 full_char;
59 } x;
60 __u32 data[9];
61 };
62
63
64 #define MAX_ROUTE 16
65
66 struct route {
67 char route_size;
68 char pointer;
69 unsigned long route[MAX_ROUTE];
70 };
71
72
73 struct options {
74 struct route record_route;
75 struct route loose_route;
76 struct route strict_route;
77 struct timestamp tstamp;
78 unsigned short security;
79 unsigned short compartment;
80 unsigned short handling;
81 unsigned short stream;
82 unsigned tcc;
83 };
84
85
86 struct iphdr {
87 #if defined(__i386__)
88 __u8 ihl:4,
89 version:4;
90 #elif defined (__mc68000__)
91 __u8 version:4,
92 ihl:4;
93 #elif defined(__MIPSEL__)
94 __u8 ihl:4,
95 version:4;
96 #elif defined(__MIPSEB__)
97 __u8 version:4,
98 ihl:4;
99 #elif defined(__alpha__)
100 __u8 ihl:4,
101 version:4;
102 #elif defined (__sparc__)
103 __u8 version:4,
104 ihl:4;
105 #else
106 #error "Adjust this structure to match your CPU"
107 #endif
108 __u8 tos;
109 __u16 tot_len;
110 __u16 id;
111 __u16 frag_off;
112 __u8 ttl;
113 __u8 protocol;
114 __u16 check;
115 __u32 saddr;
116 __u32 daddr;
117
118 };
119
120
121 #endif