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