1 /* ip_var.h 4.5 81/12/02 */ 2 3 /* 4 * Overlay for ip header used by other protocols (tcp, udp). 5 */ 6 struct ipovly { 7 caddr_t ih_next, ih_prev; /* for protocol sequence q's */ 8 u_char ih_x1; /* (unused) */ 9 u_char ih_pr; /* protocol */ 10 short ih_len; /* protocol length */ 11 struct in_addr ih_src; /* source internet address */ 12 struct in_addr ih_dst; /* destination internet address */ 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 */ 21 struct 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 */ 28 struct in_addr ipq_src,ipq_dst; 29 }; 30 31 /* 32 * Ip header, when holding a fragment. 33 */ 34 struct ipasfrag { 35 u_char ip_hl:4, 36 ip_v:4; 37 u_char ipf_mff; /* copied from (ip_off&IP_MF) */ 38 short ip_len; 39 u_short ip_id; 40 short ip_off; 41 u_char ip_ttl; 42 u_char ip_p; 43 u_short ip_sum; 44 struct ipasfrag *ipf_next; /* next fragment */ 45 struct ipasfrag *ipf_prev; /* previous fragment */ 46 }; 47 48 struct ipstat { 49 int ips_badsum; /* checksum bad */ 50 int ips_tooshort; /* packet too short */ 51 }; 52 53 #ifdef KERNEL 54 struct ipstat ipstat; 55 struct ipq ipq; /* ip reass. queue */ 56 struct ipq *ip_freef(); 57 u_short ip_id; /* ip packet ctr, for ids */ 58 #endif 59