80 |
|
* pragmatically since otherwise unsigned comparisons can result |
81 |
|
* against negative integers quite easily, and fail in subtle ways. |
82 |
|
*/ |
83 |
+ |
#ifdef PRAGMA_PACK_SUPPORTED |
84 |
+ |
#pragma pack(1) |
85 |
+ |
#endif |
86 |
+ |
|
87 |
|
struct ip { |
88 |
|
#ifdef WORDS_BIGENDIAN |
89 |
< |
u_int ip_v:4, /* version */ |
89 |
> |
u_char ip_v:4, /* version */ |
90 |
|
ip_hl:4; /* header length */ |
91 |
|
#else |
92 |
< |
u_int ip_hl:4, /* header length */ |
92 |
> |
u_char ip_hl:4, /* header length */ |
93 |
|
ip_v:4; /* version */ |
94 |
|
#endif |
95 |
|
u_int8_t ip_tos; /* type of service */ |
103 |
|
u_int8_t ip_p; /* protocol */ |
104 |
|
u_int16_t ip_sum; /* checksum */ |
105 |
|
struct in_addr ip_src,ip_dst; /* source and dest address */ |
106 |
< |
}; |
106 |
> |
} PACKED__; |
107 |
> |
|
108 |
> |
#ifdef PRAGMA_PACK_SUPPORTED |
109 |
> |
#pragma pack(0) |
110 |
> |
#endif |
111 |
|
|
112 |
|
#define IP_MAXPACKET 65535 /* maximum packet size */ |
113 |
|
|
151 |
|
/* |
152 |
|
* Time stamp option structure. |
153 |
|
*/ |
154 |
+ |
#ifdef PRAGMA_PACK_SUPPORTED |
155 |
+ |
#pragma pack(1) |
156 |
+ |
#endif |
157 |
+ |
|
158 |
|
struct ip_timestamp { |
159 |
|
u_int8_t ipt_code; /* IPOPT_TS */ |
160 |
|
u_int8_t ipt_len; /* size of structure (variable) */ |
161 |
|
u_int8_t ipt_ptr; /* index of current entry */ |
162 |
|
#ifdef WORDS_BIGENDIAN |
163 |
< |
u_int ipt_oflw:4, /* overflow counter */ |
163 |
> |
u_char ipt_oflw:4, /* overflow counter */ |
164 |
|
ipt_flg:4; /* flags, see below */ |
165 |
|
#else |
166 |
< |
u_int ipt_flg:4, /* flags, see below */ |
166 |
> |
u_char ipt_flg:4, /* flags, see below */ |
167 |
|
ipt_oflw:4; /* overflow counter */ |
168 |
|
#endif |
169 |
|
union ipt_timestamp { |
173 |
|
n_long ipt_time; |
174 |
|
} ipt_ta[1]; |
175 |
|
} ipt_timestamp; |
176 |
< |
}; |
176 |
> |
} PACKED__; |
177 |
> |
|
178 |
> |
#ifdef PRAGMA_PACK_SUPPORTED |
179 |
> |
#pragma pack(0) |
180 |
> |
#endif |
181 |
|
|
182 |
|
/* flag bits for ipt_flg */ |
183 |
|
#define IPOPT_TS_TSONLY 0 /* timestamps only */ |
224 |
|
/* |
225 |
|
* Overlay for ip header used by other protocols (tcp, udp). |
226 |
|
*/ |
227 |
+ |
#ifdef PRAGMA_PACK_SUPPORTED |
228 |
+ |
#pragma pack(1) |
229 |
+ |
#endif |
230 |
+ |
|
231 |
|
struct ipovly { |
232 |
|
caddr32_t ih_next, ih_prev; /* for protocol sequence q's */ |
233 |
|
u_int8_t ih_x1; /* (unused) */ |
235 |
|
int16_t ih_len; /* protocol length */ |
236 |
|
struct in_addr ih_src; /* source internet address */ |
237 |
|
struct in_addr ih_dst; /* destination internet address */ |
238 |
< |
}; |
238 |
> |
} PACKED__; |
239 |
> |
|
240 |
> |
#ifdef PRAGMA_PACK_SUPPORTED |
241 |
> |
#pragma pack(0) |
242 |
> |
#endif |
243 |
|
|
244 |
|
/* |
245 |
|
* Ip reassembly queue structure. Each fragment |
265 |
|
*/ |
266 |
|
struct ipasfrag { |
267 |
|
#ifdef WORDS_BIGENDIAN |
268 |
< |
u_int ip_v:4, |
268 |
> |
u_char ip_v:4, |
269 |
|
ip_hl:4; |
270 |
|
#else |
271 |
< |
u_int ip_hl:4, |
271 |
> |
u_char ip_hl:4, |
272 |
|
ip_v:4; |
273 |
|
#endif |
274 |
|
/* BUG : u_int changed to u_int8_t. |