xref: /csrg-svn/sys/netinet/ip_var.h (revision 4924)
1*4924Swnj /*	ip_var.h	4.3	81/11/18	*/
24893Swnj 
34893Swnj /*
44893Swnj  * Overlay for ip header used by other protocols (tcp, udp).
54893Swnj  */
64893Swnj struct ipovly {
74899Swnj 	caddr_t	ih_next, ih_prev;	/* for protocol sequence q's */
84899Swnj 	u_char	ih_x1;			/* (unused) */
94899Swnj 	u_char	ih_pr;			/* protocol */
10*4924Swnj 	short	ih_len;			/* protocol length */
11*4924Swnj 	struct	in_addr ih_src;		/* source internet address */
12*4924Swnj 	struct	in_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 */
28*4924Swnj 	struct	in_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;
444899Swnj 	struct	ipasfrag *ipf_next;	/* next fragment */
454899Swnj 	struct	ipasfrag *ipf_prev;	/* previous fragment */
464893Swnj };
474893Swnj 
48*4924Swnj struct	ipstat {
49*4924Swnj 	int	ips_badsum;
50*4924Swnj };
51*4924Swnj 
524893Swnj #ifdef KERNEL
53*4924Swnj struct	ipstat	ipstat;
544893Swnj struct	ipq	ipq;			/* ip reass. queue */
554893Swnj struct	ipq	*ip_freef();
564893Swnj u_short	ip_id;				/* ip packet ctr, for ids */
574893Swnj #endif
58