xref: /csrg-svn/sys/netinet/ip_var.h (revision 4899)
1*4899Swnj /*	ip_var.h	4.2	81/11/15	*/
24893Swnj 
34893Swnj /*
44893Swnj  * Overlay for ip header used by other protocols (tcp, udp).
54893Swnj  */
64893Swnj struct ipovly {
7*4899Swnj 	caddr_t	ih_next, ih_prev;	/* for protocol sequence q's */
8*4899Swnj 	u_char	ih_x1;			/* (unused) */
9*4899Swnj 	u_char	ih_pr;			/* protocol */
10*4899Swnj 	short	ih_len;		/* protocol length */
11*4899Swnj 	struct	ip_addr ih_src;		/* source internet address */
12*4899Swnj 	struct	ip_addr ih_dst;		/* destination internet address */
134893Swnj };
144893Swnj 
154893Swnj /*
164893Swnj  * Ip reassembly queue structure.  Each fragment
174893Swnj  * being reassembled is attached to one of these structures.
184893Swnj  * They are timed out after ipq_ttl drops to 0, and may also
194893Swnj  * be reclaimed if memory becomes tight.
204893Swnj  */
214893Swnj struct ipq {
224893Swnj 	struct	ipq *next,*prev;	/* to other reass headers */
234893Swnj 	u_char	ipq_ttl;		/* time for reass q to live */
244893Swnj 	u_char	ipq_p;			/* protocol of this fragment */
254893Swnj 	u_short	ipq_id;			/* sequence id for reassembly */
264893Swnj 	struct	ipasfrag *ipq_next,*ipq_prev;
274893Swnj 					/* to ip headers of fragments */
284893Swnj 	struct	ip_addr ipq_src,ipq_dst;
294893Swnj };
304893Swnj 
314893Swnj /*
324893Swnj  * Ip header, when holding a fragment.
334893Swnj  */
344893Swnj struct	ipasfrag {
354893Swnj 	u_char	ip_hl:4,
364893Swnj 		ip_v:4;
374893Swnj 	u_char	ipf_mff;		/* copied from (ip_off&IP_MF) */
384893Swnj 	short	ip_len;
394893Swnj 	u_short	ip_id;
404893Swnj 	short	ip_off;
414893Swnj 	u_char	ip_ttl;
424893Swnj 	u_char	ip_p;
434893Swnj 	u_short	ip_sum;
44*4899Swnj 	struct	ipasfrag *ipf_next;	/* next fragment */
45*4899Swnj 	struct	ipasfrag *ipf_prev;	/* previous fragment */
464893Swnj };
474893Swnj 
484893Swnj #ifdef KERNEL
494893Swnj struct	ipq	ipq;			/* ip reass. queue */
504893Swnj struct	ipq	*ip_freef();
514893Swnj u_short	ip_id;				/* ip packet ctr, for ids */
524893Swnj #endif
53