75 |
|
|
76 |
|
/* |
77 |
|
* Structure of an internet header, naked of options. |
78 |
– |
* |
79 |
– |
* We declare ip_len and ip_off to be short, rather than u_short |
80 |
– |
* pragmatically since otherwise unsigned comparisons can result |
81 |
– |
* against negative integers quite easily, and fail in subtle ways. |
78 |
|
*/ |
79 |
|
#ifdef PRAGMA_PACK_SUPPORTED |
80 |
|
#pragma pack(1) |
89 |
|
ip_v:4; /* version */ |
90 |
|
#endif |
91 |
|
u_int8_t ip_tos; /* type of service */ |
92 |
< |
int16_t ip_len; /* total length */ |
92 |
> |
u_int16_t ip_len; /* total length */ |
93 |
|
u_int16_t ip_id; /* identification */ |
94 |
< |
int16_t ip_off; /* fragment offset field */ |
94 |
> |
u_int16_t ip_off; /* fragment offset field */ |
95 |
|
#define IP_DF 0x4000 /* don't fragment flag */ |
96 |
|
#define IP_MF 0x2000 /* more fragments flag */ |
97 |
|
#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */ |
228 |
|
caddr32_t ih_next, ih_prev; /* for protocol sequence q's */ |
229 |
|
u_int8_t ih_x1; /* (unused) */ |
230 |
|
u_int8_t ih_pr; /* protocol */ |
231 |
< |
int16_t ih_len; /* protocol length */ |
231 |
> |
u_int16_t ih_len; /* protocol length */ |
232 |
|
struct in_addr ih_src; /* source internet address */ |
233 |
|
struct in_addr ih_dst; /* destination internet address */ |
234 |
|
} PACKED__; |
273 |
|
u_int8_t ipf_mff; /* XXX overlays ip_tos: use low bit |
274 |
|
* to avoid destroying tos (PPPDTRuu); |
275 |
|
* copied from (ip_off&IP_MF) */ |
276 |
< |
int16_t ip_len; |
276 |
> |
u_int16_t ip_len; |
277 |
|
u_int16_t ip_id; |
278 |
< |
int16_t ip_off; |
278 |
> |
u_int16_t ip_off; |
279 |
|
u_int8_t ip_ttl; |
280 |
|
u_int8_t ip_p; |
281 |
|
u_int16_t ip_sum; |