1: /*
2: * Copyright (c) 1982, 1986 Regents of the University of California.
3: * All rights reserved. The Berkeley software License Agreement
4: * specifies the terms and conditions for redistribution.
5: *
6: * @(#)ip_var.h 7.1 (Berkeley) 6/5/86
7: */
8:
9: /*
10: * Overlay for ip header used by other protocols (tcp, udp).
11: */
12: struct ipovly {
13: caddr_t ih_next, ih_prev; /* for protocol sequence q's */
14: u_char ih_x1; /* (unused) */
15: u_char ih_pr; /* protocol */
16: short ih_len; /* protocol length */
17: struct in_addr ih_src; /* source internet address */
18: struct in_addr ih_dst; /* destination internet address */
19: };
20:
21: /*
22: * Ip reassembly queue structure. Each fragment
23: * being reassembled is attached to one of these structures.
24: * They are timed out after ipq_ttl drops to 0, and may also
25: * be reclaimed if memory becomes tight.
26: */
27: struct ipq {
28: struct ipq *next,*prev; /* to other reass headers */
29: u_char ipq_ttl; /* time for reass q to live */
30: u_char ipq_p; /* protocol of this fragment */
31: u_short ipq_id; /* sequence id for reassembly */
32: struct ipasfrag *ipq_next,*ipq_prev;
33: /* to ip headers of fragments */
34: struct in_addr ipq_src,ipq_dst;
35: };
36:
37: /*
38: * Ip header, when holding a fragment.
39: *
40: * Note: ipf_next must be at same offset as ipq_next above
41: */
42: struct ipasfrag {
43: #ifdef vax
44: u_char ip_hl:4,
45: ip_v:4;
46: #endif
47: u_char ipf_mff; /* copied from (ip_off&IP_MF) */
48: short ip_len;
49: u_short ip_id;
50: short ip_off;
51: u_char ip_ttl;
52: u_char ip_p;
53: u_short ip_sum;
54: struct ipasfrag *ipf_next; /* next fragment */
55: struct ipasfrag *ipf_prev; /* previous fragment */
56: };
57:
58: /*
59: * Structure stored in mbuf in inpcb.ip_options
60: * and passed to ip_output when ip options are in use.
61: * The actual length of the options (including ipopt_dst)
62: * is in m_len.
63: */
64: #define MAX_IPOPTLEN 40
65:
66: struct ipoption {
67: struct in_addr ipopt_dst; /* first-hop dst if source routed */
68: char ipopt_list[MAX_IPOPTLEN]; /* options proper */
69: };
70:
71: struct ipstat {
72: long ips_total; /* total packets received */
73: long ips_badsum; /* checksum bad */
74: long ips_tooshort; /* packet too short */
75: long ips_toosmall; /* not enough data */
76: long ips_badhlen; /* ip header length < data size */
77: long ips_badlen; /* ip length < ip header length */
78: long ips_fragments; /* fragments received */
79: long ips_fragdropped; /* frags dropped (dups, out of space) */
80: long ips_fragtimeout; /* fragments timed out */
81: long ips_forward; /* packets forwarded */
82: long ips_cantforward; /* packets rcvd for unreachable dest */
83: long ips_redirectsent; /* packets forwarded on same net */
84: };
85:
86: #ifdef KERNEL
87: /* flags passed to ip_output as last parameter */
88: #define IP_FORWARDING 0x1 /* most of ip header exists */
89: #define IP_ROUTETOIF SO_DONTROUTE /* bypass routing tables */
90: #define IP_ALLOWBROADCAST SO_BROADCAST /* can send broadcast packets */
91:
92: struct ipstat ipstat;
93: struct ipq ipq; /* ip reass. queue */
94: u_short ip_id; /* ip packet ctr, for ids */
95:
96: struct mbuf *ip_srcroute();
97: #endif
Defined variables
ipq
defined in line
93; used 11 times
ipstat
defined in line
92; used 15 times
- in /usr/src/sys/netinet/ip_input.c line
110-113(2),
119-124(2),
131,
140,
162,
256,
405,
472,
486,
833,
910-916(3)
Defined struct's
ipasfrag
defined in line
42; used 39 times
- in line 32,
54-55(4)
- in /usr/src/sys/netinet/ip_input.c line
245-247(4),
255-257(4),
283-287(4),
310-313(4),
320(2),
329(2),
344(2),
364(2),
381(2),
417-419(4),
433(2),
446(2)
ipq
defined in line
27; used 14 times
Defined macros
Usage of this include