clean up some stuff; map Internet broadcast address to
[unix-history] / usr / src / sys / netinet / ip_var.h
CommitLineData
498aff44 1/* ip_var.h 4.7 82/12/28 */
77e50f35
BJ
2
3/*
4 * Overlay for ip header used by other protocols (tcp, udp).
5 */
6struct ipovly {
eb44bfb2
BJ
7 caddr_t ih_next, ih_prev; /* for protocol sequence q's */
8 u_char ih_x1; /* (unused) */
9 u_char ih_pr; /* protocol */
2b4b57cd
BJ
10 short ih_len; /* protocol length */
11 struct in_addr ih_src; /* source internet address */
12 struct in_addr ih_dst; /* destination internet address */
77e50f35
BJ
13};
14
15/*
16 * Ip reassembly queue structure. Each fragment
17 * being reassembled is attached to one of these structures.
18 * They are timed out after ipq_ttl drops to 0, and may also
19 * be reclaimed if memory becomes tight.
20 */
21struct ipq {
22 struct ipq *next,*prev; /* to other reass headers */
23 u_char ipq_ttl; /* time for reass q to live */
24 u_char ipq_p; /* protocol of this fragment */
25 u_short ipq_id; /* sequence id for reassembly */
26 struct ipasfrag *ipq_next,*ipq_prev;
27 /* to ip headers of fragments */
2b4b57cd 28 struct in_addr ipq_src,ipq_dst;
77e50f35
BJ
29};
30
31/*
32 * Ip header, when holding a fragment.
af8f6a21
SL
33 *
34 * Note: ipf_next must be at same offset as ipq_next above
77e50f35
BJ
35 */
36struct ipasfrag {
498aff44 37#ifdef vax
77e50f35
BJ
38 u_char ip_hl:4,
39 ip_v:4;
498aff44
SL
40#endif
41#ifdef sun
42 u_char ip_v:4,
43 ip_hl:4;
44#endif
77e50f35
BJ
45 u_char ipf_mff; /* copied from (ip_off&IP_MF) */
46 short ip_len;
47 u_short ip_id;
48 short ip_off;
49 u_char ip_ttl;
50 u_char ip_p;
51 u_short ip_sum;
eb44bfb2
BJ
52 struct ipasfrag *ipf_next; /* next fragment */
53 struct ipasfrag *ipf_prev; /* previous fragment */
77e50f35
BJ
54};
55
2b4b57cd 56struct ipstat {
405c9168
BJ
57 int ips_badsum; /* checksum bad */
58 int ips_tooshort; /* packet too short */
2b4b57cd
BJ
59};
60
77e50f35 61#ifdef KERNEL
2b4b57cd 62struct ipstat ipstat;
77e50f35
BJ
63struct ipq ipq; /* ip reass. queue */
64struct ipq *ip_freef();
65u_short ip_id; /* ip packet ctr, for ids */
66#endif