9 #include <netinet/in.h>
15 #if __BYTE_ORDER == __LITTLE_ENDIAN
17 unsigned int overflow
:4;
19 unsigned int overflow
:4;
26 #if __BYTE_ORDER == __LITTLE_ENDIAN
28 unsigned int version
:4;
30 unsigned int version
:4;
45 #if __BYTE_ORDER == __LITTLE_ENDIAN
59 struct in_addr ip_src
, ip_dst
;
65 #define IP_OFFMASK 0x1fff
71 #if __BYTE_ORDER == __LITTLE_ENDIAN
72 unsigned int ipt_flg
:4;
73 unsigned int ipt_oflw
:4;
75 unsigned int ipt_oflw
:4;
76 unsigned int ipt_flg
:4;
82 #define IP_MAXPACKET 65535
84 #define IPTOS_ECN_MASK 0x03
85 #define IPTOS_ECN(x) ((x) & IPTOS_ECN_MASK)
86 #define IPTOS_ECN_NOT_ECT 0x00
87 #define IPTOS_ECN_ECT1 0x01
88 #define IPTOS_ECN_ECT0 0x02
89 #define IPTOS_ECN_CE 0x03
91 #define IPTOS_DSCP_MASK 0xfc
92 #define IPTOS_DSCP(x) ((x) & IPTOS_DSCP_MASK)
93 #define IPTOS_DSCP_AF11 0x28
94 #define IPTOS_DSCP_AF12 0x30
95 #define IPTOS_DSCP_AF13 0x38
96 #define IPTOS_DSCP_AF21 0x48
97 #define IPTOS_DSCP_AF22 0x50
98 #define IPTOS_DSCP_AF23 0x58
99 #define IPTOS_DSCP_AF31 0x68
100 #define IPTOS_DSCP_AF32 0x70
101 #define IPTOS_DSCP_AF33 0x78
102 #define IPTOS_DSCP_AF41 0x88
103 #define IPTOS_DSCP_AF42 0x90
104 #define IPTOS_DSCP_AF43 0x98
105 #define IPTOS_DSCP_EF 0xb8
107 #define IPTOS_CLASS_MASK 0xe0
108 #define IPTOS_CLASS(x) ((x) & IPTOS_CLASS_MASK)
109 #define IPTOS_CLASS_CS0 0x00
110 #define IPTOS_CLASS_CS1 0x20
111 #define IPTOS_CLASS_CS2 0x40
112 #define IPTOS_CLASS_CS3 0x60
113 #define IPTOS_CLASS_CS4 0x80
114 #define IPTOS_CLASS_CS5 0xa0
115 #define IPTOS_CLASS_CS6 0xc0
116 #define IPTOS_CLASS_CS7 0xe0
117 #define IPTOS_CLASS_DEFAULT IPTOS_CLASS_CS0
119 #define IPTOS_TOS_MASK 0x1E
120 #define IPTOS_TOS(tos) ((tos) & IPTOS_TOS_MASK)
121 #define IPTOS_LOWDELAY 0x10
122 #define IPTOS_THROUGHPUT 0x08
123 #define IPTOS_RELIABILITY 0x04
124 #define IPTOS_LOWCOST 0x02
125 #define IPTOS_MINCOST IPTOS_LOWCOST
127 #define IPTOS_PREC_MASK 0xe0
128 #define IPTOS_PREC(tos) ((tos) & IPTOS_PREC_MASK)
129 #define IPTOS_PREC_NETCONTROL 0xe0
130 #define IPTOS_PREC_INTERNETCONTROL 0xc0
131 #define IPTOS_PREC_CRITIC_ECP 0xa0
132 #define IPTOS_PREC_FLASHOVERRIDE 0x80
133 #define IPTOS_PREC_FLASH 0x60
134 #define IPTOS_PREC_IMMEDIATE 0x40
135 #define IPTOS_PREC_PRIORITY 0x20
136 #define IPTOS_PREC_ROUTINE 0x00
138 #define IPOPT_COPY 0x80
139 #define IPOPT_CLASS_MASK 0x60
140 #define IPOPT_NUMBER_MASK 0x1f
142 #define IPOPT_COPIED(o) ((o) & IPOPT_COPY)
143 #define IPOPT_CLASS(o) ((o) & IPOPT_CLASS_MASK)
144 #define IPOPT_NUMBER(o) ((o) & IPOPT_NUMBER_MASK)
146 #define IPOPT_CONTROL 0x00
147 #define IPOPT_RESERVED1 0x20
148 #define IPOPT_DEBMEAS 0x40
149 #define IPOPT_MEASUREMENT IPOPT_DEBMEAS
150 #define IPOPT_RESERVED2 0x60
153 #define IPOPT_END IPOPT_EOL
155 #define IPOPT_NOOP IPOPT_NOP
159 #define IPOPT_TIMESTAMP IPOPT_TS
160 #define IPOPT_SECURITY 130
161 #define IPOPT_SEC IPOPT_SECURITY
162 #define IPOPT_LSRR 131
163 #define IPOPT_SATID 136
164 #define IPOPT_SID IPOPT_SATID
165 #define IPOPT_SSRR 137
168 #define IPOPT_OPTVAL 0
170 #define IPOPT_OFFSET 2
171 #define IPOPT_MINOFF 4
173 #define MAX_IPOPTLEN 40
175 #define IPOPT_TS_TSONLY 0
176 #define IPOPT_TS_TSANDADDR 1
177 #define IPOPT_TS_PRESPEC 3
179 #define IPOPT_SECUR_UNCLASS 0x0000
180 #define IPOPT_SECUR_CONFID 0xf135
181 #define IPOPT_SECUR_EFTO 0x789a
182 #define IPOPT_SECUR_MMMM 0xbc4d
183 #define IPOPT_SECUR_RESTR 0xaf13
184 #define IPOPT_SECUR_SECRET 0xd788
185 #define IPOPT_SECUR_TOPSECRET 0x6bc5