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.h 7.1 (Berkeley) 6/5/86
7: */
8:
9: /*
10: * Definitions for internet protocol version 4.
11: * Per RFC 791, September 1981.
12: */
13: #define IPVERSION 4
14:
15: /*
16: * Structure of an internet header, naked of options.
17: *
18: * We declare ip_len and ip_off to be short, rather than u_short
19: * pragmatically since otherwise unsigned comparisons can result
20: * against negative integers quite easily, and fail in subtle ways.
21: */
22: struct ip {
23: #ifdef vax
24: u_char ip_hl:4, /* header length */
25: ip_v:4; /* version */
26: #endif
27: u_char ip_tos; /* type of service */
28: short ip_len; /* total length */
29: u_short ip_id; /* identification */
30: short ip_off; /* fragment offset field */
31: #define IP_DF 0x4000 /* dont fragment flag */
32: #define IP_MF 0x2000 /* more fragments flag */
33: u_char ip_ttl; /* time to live */
34: u_char ip_p; /* protocol */
35: u_short ip_sum; /* checksum */
36: struct in_addr ip_src,ip_dst; /* source and dest address */
37: };
38:
39: /*
40: * Definitions for options.
41: */
42: #define IPOPT_COPIED(o) ((o)&0x80)
43: #define IPOPT_CLASS(o) ((o)&0x60)
44: #define IPOPT_NUMBER(o) ((o)&0x1f)
45:
46: #define IPOPT_CONTROL 0x00
47: #define IPOPT_RESERVED1 0x20
48: #define IPOPT_DEBMEAS 0x40
49: #define IPOPT_RESERVED2 0x60
50:
51: #define IPOPT_EOL 0 /* end of option list */
52: #define IPOPT_NOP 1 /* no operation */
53:
54: #define IPOPT_RR 7 /* record packet route */
55: #define IPOPT_TS 68 /* timestamp */
56: #define IPOPT_SECURITY 130 /* provide s,c,h,tcc */
57: #define IPOPT_LSRR 131 /* loose source route */
58: #define IPOPT_SATID 136 /* satnet id */
59: #define IPOPT_SSRR 137 /* strict source route */
60:
61: /*
62: * Offsets to fields in options other than EOL and NOP.
63: */
64: #define IPOPT_OPTVAL 0 /* option ID */
65: #define IPOPT_OLEN 1 /* option length */
66: #define IPOPT_OFFSET 2 /* offset within option */
67: #define IPOPT_MINOFF 4 /* min value of above */
68:
69: /*
70: * Time stamp option structure.
71: */
72: struct ip_timestamp {
73: u_char ipt_code; /* IPOPT_TS */
74: u_char ipt_len; /* size of structure (variable) */
75: u_char ipt_ptr; /* index of current entry */
76: u_char ipt_flg:4, /* flags, see below */
77: ipt_oflw:4; /* overflow counter */
78: union {
79: n_long ipt_time[1];
80: struct ipt_ta {
81: struct in_addr ipt_addr;
82: n_long ipt_time;
83: } ipt_ta[1];
84: }
85: };
86:
87: /* flag bits for ipt_flg */
88: #define IPOPT_TS_TSONLY 0 /* timestamps only */
89: #define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */
90: #define IPOPT_TS_PRESPEC 2 /* specified modules only */
91:
92: /* bits for security (not byte swapped) */
93: #define IPOPT_SECUR_UNCLASS 0x0000
94: #define IPOPT_SECUR_CONFID 0xf135
95: #define IPOPT_SECUR_EFTO 0x789a
96: #define IPOPT_SECUR_MMMM 0xbc4d
97: #define IPOPT_SECUR_RESTR 0xaf13
98: #define IPOPT_SECUR_SECRET 0xd788
99: #define IPOPT_SECUR_TOPSECRET 0x6bc5
100:
101: /*
102: * Internet implementation parameters.
103: */
104: #define MAXTTL 255 /* maximum time to live (seconds) */
105: #define IPFRAGTTL 15 /* time to live for frag chains */
106: #define IPTTLDEC 1 /* subtracted when forwarding */
107:
108: #define IP_MSS 576 /* default maximum segment size */
Defined struct's
ip
defined in line
22; used 236 times
- in /usr/src/sys/netimp/if_imp.c line
485(4)
- in /usr/src/sys/netinet/ip_icmp.c line
42(2),
50(2),
103-108(4),
132(4),
158(2),
332(2),
338(2),
393(2)
- in /usr/src/sys/netinet/ip_input.c line
74(2),
85(2),
111-118(8),
127(2),
180(2),
281(2),
311-312(4),
395-396(4),
402(2),
499(2),
510(2),
765(2),
773(2),
781-784(4),
819(2),
873(2),
921(2)
- in /usr/src/sys/netinet/ip_output.c line
43-45(4),
51(2),
178-182(6),
189-195(8),
205(2),
240(4),
250-264(16),
275(2),
283(2)
- in /usr/src/sys/netinet/raw_ip.c line
40(4),
58(2),
78-85(8)
- in /usr/src/sys/netinet/tcp_input.c line
185-186(6),
198-199(4),
227-228(4)
- in /usr/src/sys/netinet/tcp_output.c line
370-371(4)
- in /usr/src/sys/netinet/tcp_subr.c line
70(2),
145-146(4)
- in /usr/src/sys/netinet/udp_usrreq.c line
57(2),
69-70(6),
77-82(6),
88(2),
97(2),
114-115(4),
232-233(4)
- in /usr/src/sys/netns/ns_ip.c line
123(2),
138(2),
144-145(4),
152(2),
160-161(4),
220(2),
241(2),
247-262(12)
- in /usr/src/sys/vaxif/if_de.c line
605(2)
- in /usr/src/sys/vaxif/if_dmc.c line
735(2)
- in /usr/src/sys/vaxif/if_ec.c line
573(2)
- in /usr/src/sys/vaxif/if_en.c line
544(2)
- in /usr/src/sys/vaxif/if_ex.c line
692(2)
- in /usr/src/sys/vaxif/if_hy.c line
624-626(8),
638(2)
- in /usr/src/sys/vaxif/if_il.c line
555(2)
- in /usr/src/sys/vaxif/if_qe.c line
710(2)
- in /usr/src/sys/vaxif/if_vv.c line
859(2)
Defined macros
IP_DF
defined in line
31; used 3 times
IP_MF
defined in line
32; used 6 times
Usage of this include