xref: /csrg-svn/sys/netinet/ip.h (revision 4498)
1 /* ip.h 1.1 81/10/14 */
2 struct ip {                     /* ip leader */
3 	unsigned char ip_hl:4,          /* header length */
4 		ip_v:4;                 /* version */
5 	unsigned char ip_tos;           /* type of service */
6 #define ip_mff ip_tos                   /* more fragments flag (input) */
7 	unsigned short ip_len;          /* total length */
8 	unsigned short ip_id;           /* identification */
9 	unsigned short ip_off;          /* fragment offset field */
10 #define ip_df 0x4000                    /* dont fragment flag */
11 #define ip_mf 0x2000                    /* more fragments flag (output) */
12 	unsigned char ip_ttl;           /* time to live */
13 	unsigned char ip_p;             /* protocol */
14 	unsigned short ip_sum;          /* checksum */
15 #define ip_end ip_sum                   /* fragment end */
16 	union {
17 		struct socket ip_s;     /* source address */
18 		struct ip *ip_nxt;      /* ->next fragment */
19 	} I_sun;
20 #define ip_src  I_sun.ip_s
21 #define ip_next I_sun.ip_nxt
22 	union {
23 		struct socket ip_d;     /* destination address */
24 		struct ip *ip_prv;      /* ->prev fragment */
25 	} I_dun;
26 #define ip_dst  I_dun.ip_d
27 #define ip_prev I_dun.ip_prv
28 };
29 
30 struct ipq {                    /* ip reass.q header */
31 	struct ip iqx;                  /* dummy ip element for top of list */
32 	struct ipq *iq_next;            /* -> next chain on q */
33 	struct ipq *iq_prev;            /* -> prev chain on q */
34 	struct ip iqh;                  /* fragment header */
35 };
36 
37 #define IPVERSION 4             /* internet protocol version number */
38 #define IPLOLINK 155            /* internet link numbers */
39 #define IPHILINK 158
40 #define IPLINK IPLOLINK
41 #define MAXTTL 255              /* maximum time to live (seconds) */
42 
43