2 * Copyright (c) 1997-2001 by Sun Microsystems, Inc.
7 * Copyright (c) 1982, 1986 Regents of the University of California.
8 * All rights reserved. The Berkeley software License Agreement
9 * specifies the terms and conditions for redistribution.
13 * Overlay for ip header used by other protocols (tcp, udp).
16 #ifndef _NETINET_IP_VAR_H
17 #define _NETINET_IP_VAR_H
19 #pragma ident "%Z%%M% %I% %E% SMI"
20 /* ip_var.h 1.11 88/08/19 SMI; from UCB 7.1 6/5/86 */
22 #include <sys/isa_defs.h>
30 uint32_t ih_next
, ih_prev
;
32 caddr_t ih_next
, ih_prev
; /* for protocol sequence q's */
34 uchar_t ih_x1
; /* (unused) */
35 uchar_t ih_pr
; /* protocol */
36 short ih_len
; /* protocol length */
37 struct in_addr ih_src
; /* source internet address */
38 struct in_addr ih_dst
; /* destination internet address */
42 * Ip reassembly queue structure. Each fragment
43 * being reassembled is attached to one of these structures.
44 * They are timed out after ipq_ttl drops to 0, and may also
45 * be reclaimed if memory becomes tight.
48 struct ipq
*next
, *prev
; /* to other reass headers */
49 uchar_t ipq_ttl
; /* time for reass q to live */
50 uchar_t ipq_p
; /* protocol of this fragment */
51 ushort_t ipq_id
; /* sequence id for reassembly */
52 struct ipasfrag
*ipq_next
, *ipq_prev
;
53 /* to ip headers of fragments */
54 struct in_addr ipq_src
, ipq_dst
;
58 * Ip header, when holding a fragment.
60 * Note: ipf_next must be at same offset as ipq_next above
63 #ifdef _BIT_FIELDS_LTOH
70 uchar_t ipf_mff
; /* copied from (ip_off&IP_MF) */
77 struct ipasfrag
*ipf_next
; /* next fragment */
78 struct ipasfrag
*ipf_prev
; /* previous fragment */
82 * Structure stored in mbuf in inpcb.ip_options
83 * and passed to ip_output when ip options are in use.
84 * The actual length of the options (including ipopt_dst)
87 #define MAX_IPOPTLEN 40
90 struct in_addr ipopt_dst
; /* first-hop dst if source routed */
91 char ipopt_list
[MAX_IPOPTLEN
]; /* options proper */
95 long ips_total
; /* total packets received */
96 long ips_badsum
; /* checksum bad */
97 long ips_tooshort
; /* packet too short */
98 long ips_toosmall
; /* not enough data */
99 long ips_badhlen
; /* ip header length < data size */
100 long ips_badlen
; /* ip length < ip header length */
101 long ips_fragments
; /* fragments received */
102 long ips_fragdropped
; /* frags dropped (dups, out of space) */
103 long ips_fragtimeout
; /* fragments timed out */
104 long ips_forward
; /* packets forwarded */
105 long ips_cantforward
; /* packets rcvd for unreachable dest */
106 long ips_redirectsent
; /* packets forwarded on same net */
110 /* flags passed to ip_output as last parameter */
111 #define IP_FORWARDING 0x1 /* most of ip header exists */
112 #define IP_ROUTETOIF SO_DONTROUTE /* bypass routing tables */
113 #define IP_ALLOWBROADCAST SO_BROADCAST /* can send broadcast packets */
120 #endif /* _NETINET_IP_VAR_H */