williamr@2
|
1 |
// © Portions copyright (c) 2006 Nokia Corporation. All rights reserved.
|
williamr@2
|
2 |
|
williamr@2
|
3 |
/*-
|
williamr@2
|
4 |
* Copyright (c) 1982, 1986, 1990, 1993
|
williamr@2
|
5 |
* The Regents of the University of California. All rights reserved.
|
williamr@2
|
6 |
*
|
williamr@2
|
7 |
* Redistribution and use in source and binary forms, with or without
|
williamr@2
|
8 |
* modification, are permitted provided that the following conditions
|
williamr@2
|
9 |
* are met:
|
williamr@2
|
10 |
* 1. Redistributions of source code must retain the above copyright
|
williamr@2
|
11 |
* notice, this list of conditions and the following disclaimer.
|
williamr@2
|
12 |
* 2. Redistributions in binary form must reproduce the above copyright
|
williamr@2
|
13 |
* notice, this list of conditions and the following disclaimer in the
|
williamr@2
|
14 |
* documentation and/or other materials provided with the distribution.
|
williamr@2
|
15 |
* 4. Neither the name of the University nor the names of its contributors
|
williamr@2
|
16 |
* may be used to endorse or promote products derived from this software
|
williamr@2
|
17 |
* without specific prior written permission.
|
williamr@2
|
18 |
*
|
williamr@2
|
19 |
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
williamr@2
|
20 |
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
williamr@2
|
21 |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
williamr@2
|
22 |
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
williamr@2
|
23 |
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
williamr@2
|
24 |
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
williamr@2
|
25 |
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
williamr@2
|
26 |
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
williamr@2
|
27 |
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
williamr@2
|
28 |
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
williamr@2
|
29 |
* SUCH DAMAGE.
|
williamr@2
|
30 |
*
|
williamr@2
|
31 |
* @(#)in.h 8.3 (Berkeley) 1/3/94
|
williamr@2
|
32 |
* $FreeBSD: src/sys/netinet/in.h,v 1.90.2.3 2005/10/02 15:45:47 andre Exp $
|
williamr@2
|
33 |
*/
|
williamr@2
|
34 |
|
williamr@2
|
35 |
#ifndef _NETINET_IN_H_
|
williamr@2
|
36 |
#define _NETINET_IN_H_
|
williamr@2
|
37 |
|
williamr@2
|
38 |
#include <sys/cdefs.h>
|
williamr@2
|
39 |
#include <sys/_types.h>
|
williamr@4
|
40 |
#include <stdapis/machine/endian.h>
|
williamr@2
|
41 |
|
williamr@2
|
42 |
/* Protocols common to RFC 1700, POSIX, and X/Open. */
|
williamr@2
|
43 |
#ifdef __SYMBIAN32__
|
williamr@2
|
44 |
#define IPPROTO_IP 0x100 /* KProtocolInetIp */
|
williamr@2
|
45 |
#else
|
williamr@2
|
46 |
#define IPPROTO_IP 0 /* dummy for IP */
|
williamr@2
|
47 |
#endif // __SYMBIAN32__
|
williamr@2
|
48 |
#define IPPROTO_ICMP 1 /* control message protocol KProtocolInetIcmp */
|
williamr@2
|
49 |
#define IPPROTO_TCP 6 /* tcp KProtocolInetTcp */
|
williamr@2
|
50 |
#define IPPROTO_UDP 17 /* user datagram protocol KProtocolInetUdp */
|
williamr@2
|
51 |
|
williamr@2
|
52 |
#define INADDR_ANY (u_int32_t)0x00000000
|
williamr@2
|
53 |
#define INADDR_BROADCAST (u_int32_t)0xffffffff /* must be masked */
|
williamr@2
|
54 |
|
williamr@2
|
55 |
#ifndef _UINT8_T_DECLARED
|
williamr@2
|
56 |
typedef __uint8_t uint8_t;
|
williamr@2
|
57 |
#define _UINT8_T_DECLARED
|
williamr@2
|
58 |
#endif
|
williamr@2
|
59 |
|
williamr@2
|
60 |
#ifndef _UINT16_T_DECLARED
|
williamr@2
|
61 |
typedef __uint16_t uint16_t;
|
williamr@2
|
62 |
#define _UINT16_T_DECLARED
|
williamr@2
|
63 |
#endif
|
williamr@2
|
64 |
|
williamr@2
|
65 |
#ifndef _UINT32_T_DECLARED
|
williamr@2
|
66 |
typedef __uint32_t uint32_t;
|
williamr@2
|
67 |
#define _UINT32_T_DECLARED
|
williamr@2
|
68 |
#endif
|
williamr@2
|
69 |
|
williamr@2
|
70 |
#ifndef _IN_ADDR_T_DECLARED
|
williamr@2
|
71 |
typedef uint32_t in_addr_t;
|
williamr@2
|
72 |
#define _IN_ADDR_T_DECLARED
|
williamr@2
|
73 |
#endif
|
williamr@2
|
74 |
|
williamr@2
|
75 |
#ifndef _IN_PORT_T_DECLARED
|
williamr@2
|
76 |
typedef uint16_t in_port_t;
|
williamr@2
|
77 |
#define _IN_PORT_T_DECLARED
|
williamr@2
|
78 |
#endif
|
williamr@2
|
79 |
|
williamr@2
|
80 |
#ifndef _SA_FAMILY_T_DECLARED
|
williamr@2
|
81 |
typedef __sa_family_t sa_family_t;
|
williamr@2
|
82 |
#define _SA_FAMILY_T_DECLARED
|
williamr@2
|
83 |
#endif
|
williamr@2
|
84 |
|
williamr@2
|
85 |
/* Internet address (a structure for historical reasons). */
|
williamr@2
|
86 |
#ifndef _STRUCT_IN_ADDR_DECLARED
|
williamr@2
|
87 |
struct in_addr {
|
williamr@2
|
88 |
in_addr_t s_addr;
|
williamr@2
|
89 |
};
|
williamr@2
|
90 |
#define _STRUCT_IN_ADDR_DECLARED
|
williamr@2
|
91 |
#endif
|
williamr@2
|
92 |
|
williamr@2
|
93 |
/* Socket address, internet style. */
|
williamr@2
|
94 |
#ifdef __SYMBIAN32__
|
williamr@2
|
95 |
struct sockaddr_in {
|
williamr@2
|
96 |
u_short sin_family;
|
williamr@2
|
97 |
u_short sin_port;
|
williamr@2
|
98 |
struct in_addr sin_addr;
|
williamr@2
|
99 |
char sin_zero[20];
|
williamr@2
|
100 |
};
|
williamr@2
|
101 |
#else
|
williamr@2
|
102 |
struct sockaddr_in {
|
williamr@2
|
103 |
uint8_t sin_len;
|
williamr@2
|
104 |
sa_family_t sin_family;
|
williamr@2
|
105 |
in_port_t sin_port;
|
williamr@2
|
106 |
struct in_addr sin_addr;
|
williamr@2
|
107 |
char sin_zero[8];
|
williamr@2
|
108 |
};
|
williamr@2
|
109 |
#endif // __SYMBIAN32__
|
williamr@2
|
110 |
|
williamr@2
|
111 |
#ifdef __SYMBIAN32__
|
williamr@2
|
112 |
#define SOL_IP 0x100 /* options for IP level KSolInetIp */
|
williamr@2
|
113 |
#define SOL_TCP 0x106 /* options for TCP level KSolInetTcp */
|
williamr@2
|
114 |
|
williamr@2
|
115 |
/*
|
williamr@2
|
116 |
* User-settable options (used with setsockopt).
|
williamr@2
|
117 |
*/
|
williamr@2
|
118 |
#define TCP_NODELAY 0x304 /* don't delay send to coalesce packets KSoTcpNoDelay */
|
williamr@2
|
119 |
#define TCP_MAXSEG 0x303 /* set maximum segment size KSoTcpMaxSegSize */
|
williamr@2
|
120 |
|
williamr@2
|
121 |
#endif //__SYMBIAN32__
|
williamr@2
|
122 |
|
williamr@2
|
123 |
#ifndef _KERNEL
|
williamr@2
|
124 |
|
williamr@2
|
125 |
#ifndef _BYTEORDER_PROTOTYPED
|
williamr@2
|
126 |
#define _BYTEORDER_PROTOTYPED
|
williamr@2
|
127 |
__BEGIN_DECLS
|
williamr@2
|
128 |
IMPORT_C uint32_t htonl(uint32_t);
|
williamr@2
|
129 |
IMPORT_C uint16_t htons(uint16_t);
|
williamr@2
|
130 |
uint32_t ntohl(uint32_t);
|
williamr@2
|
131 |
uint16_t ntohs(uint16_t);
|
williamr@2
|
132 |
__END_DECLS
|
williamr@2
|
133 |
#endif
|
williamr@2
|
134 |
|
williamr@2
|
135 |
#ifndef _BYTEORDER_FUNC_DEFINED
|
williamr@2
|
136 |
#define _BYTEORDER_FUNC_DEFINED
|
williamr@2
|
137 |
#define htonl(x) __htonl(x)
|
williamr@2
|
138 |
#define htons(x) __htons(x)
|
williamr@2
|
139 |
#define ntohl(x) __ntohl(x)
|
williamr@2
|
140 |
#define ntohs(x) __ntohs(x)
|
williamr@2
|
141 |
#endif
|
williamr@2
|
142 |
|
williamr@2
|
143 |
#endif /* !_KERNEL */
|
williamr@2
|
144 |
|
williamr@2
|
145 |
#if __POSIX_VISIBLE >= 200112
|
williamr@2
|
146 |
#define IPPROTO_RAW 255 /* raw IP packet */
|
williamr@2
|
147 |
#define INET_ADDRSTRLEN 16
|
williamr@2
|
148 |
#endif
|
williamr@2
|
149 |
|
williamr@2
|
150 |
#if __BSD_VISIBLE
|
williamr@2
|
151 |
/*
|
williamr@2
|
152 |
* Constants and structures defined by the internet system,
|
williamr@2
|
153 |
* Per RFC 790, September 1981, and numerous additions.
|
williamr@2
|
154 |
*/
|
williamr@2
|
155 |
|
williamr@2
|
156 |
/*
|
williamr@2
|
157 |
* Protocols (RFC 1700)
|
williamr@2
|
158 |
*/
|
williamr@2
|
159 |
#define IPPROTO_HOPOPTS 0 /* IP6 hop-by-hop options */
|
williamr@2
|
160 |
#define IPPROTO_IGMP 2 /* group mgmt protocol */
|
williamr@2
|
161 |
#define IPPROTO_GGP 3 /* gateway^2 (deprecated) */
|
williamr@2
|
162 |
#define IPPROTO_IPV4 4 /* IPv4 encapsulation */
|
williamr@2
|
163 |
#define IPPROTO_IPIP IPPROTO_IPV4 /* for compatibility */
|
williamr@2
|
164 |
#define IPPROTO_ST 7 /* Stream protocol II */
|
williamr@2
|
165 |
#define IPPROTO_EGP 8 /* exterior gateway protocol */
|
williamr@2
|
166 |
#define IPPROTO_PIGP 9 /* private interior gateway */
|
williamr@2
|
167 |
#define IPPROTO_RCCMON 10 /* BBN RCC Monitoring */
|
williamr@2
|
168 |
#define IPPROTO_NVPII 11 /* network voice protocol*/
|
williamr@2
|
169 |
#define IPPROTO_PUP 12 /* pup */
|
williamr@2
|
170 |
#define IPPROTO_ARGUS 13 /* Argus */
|
williamr@2
|
171 |
#define IPPROTO_EMCON 14 /* EMCON */
|
williamr@2
|
172 |
#define IPPROTO_XNET 15 /* Cross Net Debugger */
|
williamr@2
|
173 |
#define IPPROTO_CHAOS 16 /* Chaos*/
|
williamr@2
|
174 |
#define IPPROTO_MUX 18 /* Multiplexing */
|
williamr@2
|
175 |
#define IPPROTO_MEAS 19 /* DCN Measurement Subsystems */
|
williamr@2
|
176 |
#define IPPROTO_HMP 20 /* Host Monitoring */
|
williamr@2
|
177 |
#define IPPROTO_PRM 21 /* Packet Radio Measurement */
|
williamr@2
|
178 |
#define IPPROTO_IDP 22 /* xns idp */
|
williamr@2
|
179 |
#define IPPROTO_TRUNK1 23 /* Trunk-1 */
|
williamr@2
|
180 |
#define IPPROTO_TRUNK2 24 /* Trunk-2 */
|
williamr@2
|
181 |
#define IPPROTO_LEAF1 25 /* Leaf-1 */
|
williamr@2
|
182 |
#define IPPROTO_LEAF2 26 /* Leaf-2 */
|
williamr@2
|
183 |
#define IPPROTO_RDP 27 /* Reliable Data */
|
williamr@2
|
184 |
#define IPPROTO_IRTP 28 /* Reliable Transaction */
|
williamr@2
|
185 |
#define IPPROTO_TP 29 /* tp-4 w/ class negotiation */
|
williamr@2
|
186 |
#define IPPROTO_BLT 30 /* Bulk Data Transfer */
|
williamr@2
|
187 |
#define IPPROTO_NSP 31 /* Network Services */
|
williamr@2
|
188 |
#define IPPROTO_INP 32 /* Merit Internodal */
|
williamr@2
|
189 |
#define IPPROTO_SEP 33 /* Sequential Exchange */
|
williamr@2
|
190 |
#define IPPROTO_3PC 34 /* Third Party Connect */
|
williamr@2
|
191 |
#define IPPROTO_IDPR 35 /* InterDomain Policy Routing */
|
williamr@2
|
192 |
#define IPPROTO_XTP 36 /* XTP */
|
williamr@2
|
193 |
#define IPPROTO_DDP 37 /* Datagram Delivery */
|
williamr@2
|
194 |
#define IPPROTO_CMTP 38 /* Control Message Transport */
|
williamr@2
|
195 |
#define IPPROTO_TPXX 39 /* TP++ Transport */
|
williamr@2
|
196 |
#define IPPROTO_IL 40 /* IL transport protocol */
|
williamr@2
|
197 |
#define IPPROTO_IPV6 41 /* IP6 header */
|
williamr@2
|
198 |
#define IPPROTO_SDRP 42 /* Source Demand Routing */
|
williamr@2
|
199 |
#define IPPROTO_ROUTING 43 /* IP6 routing header */
|
williamr@2
|
200 |
#define IPPROTO_FRAGMENT 44 /* IP6 fragmentation header */
|
williamr@2
|
201 |
#define IPPROTO_IDRP 45 /* InterDomain Routing*/
|
williamr@2
|
202 |
#define IPPROTO_RSVP 46 /* resource reservation */
|
williamr@2
|
203 |
#define IPPROTO_GRE 47 /* General Routing Encap. */
|
williamr@2
|
204 |
#define IPPROTO_MHRP 48 /* Mobile Host Routing */
|
williamr@2
|
205 |
#define IPPROTO_BHA 49 /* BHA */
|
williamr@2
|
206 |
#define IPPROTO_ESP 50 /* IP6 Encap Sec. Payload */
|
williamr@2
|
207 |
#define IPPROTO_AH 51 /* IP6 Auth Header */
|
williamr@2
|
208 |
#define IPPROTO_INLSP 52 /* Integ. Net Layer Security */
|
williamr@2
|
209 |
#define IPPROTO_SWIPE 53 /* IP with encryption */
|
williamr@2
|
210 |
#define IPPROTO_NHRP 54 /* Next Hop Resolution */
|
williamr@2
|
211 |
#define IPPROTO_MOBILE 55 /* IP Mobility */
|
williamr@2
|
212 |
#define IPPROTO_TLSP 56 /* Transport Layer Security */
|
williamr@2
|
213 |
#define IPPROTO_SKIP 57 /* SKIP */
|
williamr@2
|
214 |
#define IPPROTO_ICMPV6 58 /* ICMP6 */
|
williamr@2
|
215 |
#define IPPROTO_NONE 59 /* IP6 no next header */
|
williamr@2
|
216 |
#define IPPROTO_DSTOPTS 60 /* IP6 destination option */
|
williamr@2
|
217 |
#define IPPROTO_AHIP 61 /* any host internal protocol */
|
williamr@2
|
218 |
#define IPPROTO_CFTP 62 /* CFTP */
|
williamr@2
|
219 |
#define IPPROTO_HELLO 63 /* "hello" routing protocol */
|
williamr@2
|
220 |
#define IPPROTO_SATEXPAK 64 /* SATNET/Backroom EXPAK */
|
williamr@2
|
221 |
#define IPPROTO_KRYPTOLAN 65 /* Kryptolan */
|
williamr@2
|
222 |
#define IPPROTO_RVD 66 /* Remote Virtual Disk */
|
williamr@2
|
223 |
#define IPPROTO_IPPC 67 /* Pluribus Packet Core */
|
williamr@2
|
224 |
#define IPPROTO_ADFS 68 /* Any distributed FS */
|
williamr@2
|
225 |
#define IPPROTO_SATMON 69 /* Satnet Monitoring */
|
williamr@2
|
226 |
#define IPPROTO_VISA 70 /* VISA Protocol */
|
williamr@2
|
227 |
#define IPPROTO_IPCV 71 /* Packet Core Utility */
|
williamr@2
|
228 |
#define IPPROTO_CPNX 72 /* Comp. Prot. Net. Executive */
|
williamr@2
|
229 |
#define IPPROTO_CPHB 73 /* Comp. Prot. HeartBeat */
|
williamr@2
|
230 |
#define IPPROTO_WSN 74 /* Wang Span Network */
|
williamr@2
|
231 |
#define IPPROTO_PVP 75 /* Packet Video Protocol */
|
williamr@2
|
232 |
#define IPPROTO_BRSATMON 76 /* BackRoom SATNET Monitoring */
|
williamr@2
|
233 |
#define IPPROTO_ND 77 /* Sun net disk proto (temp.) */
|
williamr@2
|
234 |
#define IPPROTO_WBMON 78 /* WIDEBAND Monitoring */
|
williamr@2
|
235 |
#define IPPROTO_WBEXPAK 79 /* WIDEBAND EXPAK */
|
williamr@2
|
236 |
#define IPPROTO_EON 80 /* ISO cnlp */
|
williamr@2
|
237 |
#define IPPROTO_VMTP 81 /* VMTP */
|
williamr@2
|
238 |
#define IPPROTO_SVMTP 82 /* Secure VMTP */
|
williamr@2
|
239 |
#define IPPROTO_VINES 83 /* Banyon VINES */
|
williamr@2
|
240 |
#define IPPROTO_TTP 84 /* TTP */
|
williamr@2
|
241 |
#define IPPROTO_IGP 85 /* NSFNET-IGP */
|
williamr@2
|
242 |
#define IPPROTO_DGP 86 /* dissimilar gateway prot. */
|
williamr@2
|
243 |
#define IPPROTO_TCF 87 /* TCF */
|
williamr@2
|
244 |
#define IPPROTO_IGRP 88 /* Cisco/GXS IGRP */
|
williamr@2
|
245 |
#define IPPROTO_OSPFIGP 89 /* OSPFIGP */
|
williamr@2
|
246 |
#define IPPROTO_SRPC 90 /* Strite RPC protocol */
|
williamr@2
|
247 |
#define IPPROTO_LARP 91 /* Locus Address Resoloution */
|
williamr@2
|
248 |
#define IPPROTO_MTP 92 /* Multicast Transport */
|
williamr@2
|
249 |
#define IPPROTO_AX25 93 /* AX.25 Frames */
|
williamr@2
|
250 |
#define IPPROTO_IPEIP 94 /* IP encapsulated in IP */
|
williamr@2
|
251 |
#define IPPROTO_MICP 95 /* Mobile Int.ing control */
|
williamr@2
|
252 |
#define IPPROTO_SCCSP 96 /* Semaphore Comm. security */
|
williamr@2
|
253 |
#define IPPROTO_ETHERIP 97 /* Ethernet IP encapsulation */
|
williamr@2
|
254 |
#ifdef __SYMBIAN32__
|
williamr@2
|
255 |
#define IPPROTO_ENCAP 4 /* IP in IP encapsulation */
|
williamr@2
|
256 |
#else
|
williamr@2
|
257 |
#define IPPROTO_ENCAP 98 /* encapsulation header */
|
williamr@2
|
258 |
#endif // __SYMBIAN32__
|
williamr@2
|
259 |
#define IPPROTO_APES 99 /* any private encr. scheme */
|
williamr@2
|
260 |
#define IPPROTO_GMTP 100 /* GMTP*/
|
williamr@2
|
261 |
#define IPPROTO_IPCOMP 108 /* payload compression (IPComp) */
|
williamr@2
|
262 |
/* 101-254: Partly Unassigned */
|
williamr@2
|
263 |
#define IPPROTO_PIM 103 /* Protocol Independent Mcast */
|
williamr@2
|
264 |
#define IPPROTO_CARP 112 /* CARP */
|
williamr@2
|
265 |
#define IPPROTO_PGM 113 /* PGM */
|
williamr@2
|
266 |
#define IPPROTO_PFSYNC 240 /* PFSYNC */
|
williamr@2
|
267 |
/* 255: Reserved */
|
williamr@2
|
268 |
/* BSD Private, local use, namespace incursion, no longer used */
|
williamr@2
|
269 |
#define IPPROTO_OLD_DIVERT 254 /* OLD divert pseudo-proto */
|
williamr@2
|
270 |
#ifdef __SYMBIAN32__
|
williamr@2
|
271 |
#define IPPROTO_MAX 0x101
|
williamr@2
|
272 |
#else
|
williamr@2
|
273 |
#define IPPROTO_MAX 256
|
williamr@2
|
274 |
#endif // __SYMBIAN32__
|
williamr@2
|
275 |
|
williamr@2
|
276 |
/* last return value of *_input(), meaning "all job for this pkt is done". */
|
williamr@2
|
277 |
#define IPPROTO_DONE 257
|
williamr@2
|
278 |
|
williamr@2
|
279 |
/* Only used internally, so can be outside the range of valid IP protocols. */
|
williamr@2
|
280 |
#define IPPROTO_DIVERT 258 /* divert pseudo-protocol */
|
williamr@2
|
281 |
|
williamr@2
|
282 |
/*
|
williamr@2
|
283 |
* Defined to avoid confusion. The master value is defined by
|
williamr@2
|
284 |
* PROTO_SPACER in sys/protosw.h.
|
williamr@2
|
285 |
*/
|
williamr@2
|
286 |
#define IPPROTO_SPACER 32767 /* spacer for loadable protos */
|
williamr@2
|
287 |
|
williamr@2
|
288 |
/*
|
williamr@2
|
289 |
* Local port number conventions:
|
williamr@2
|
290 |
*
|
williamr@2
|
291 |
* When a user does a bind(2) or connect(2) with a port number of zero,
|
williamr@2
|
292 |
* a non-conflicting local port address is chosen.
|
williamr@2
|
293 |
* The default range is IPPORT_HIFIRSTAUTO through
|
williamr@2
|
294 |
* IPPORT_HILASTAUTO, although that is settable by sysctl.
|
williamr@2
|
295 |
*
|
williamr@2
|
296 |
* A user may set the IPPROTO_IP option IP_PORTRANGE to change this
|
williamr@2
|
297 |
* default assignment range.
|
williamr@2
|
298 |
*
|
williamr@2
|
299 |
* The value IP_PORTRANGE_DEFAULT causes the default behavior.
|
williamr@2
|
300 |
*
|
williamr@2
|
301 |
* The value IP_PORTRANGE_HIGH changes the range of candidate port numbers
|
williamr@2
|
302 |
* into the "high" range. These are reserved for client outbound connections
|
williamr@2
|
303 |
* which do not want to be filtered by any firewalls. Note that by default
|
williamr@2
|
304 |
* this is the same as IP_PORTRANGE_DEFAULT.
|
williamr@2
|
305 |
*
|
williamr@2
|
306 |
* The value IP_PORTRANGE_LOW changes the range to the "low" are
|
williamr@2
|
307 |
* that is (by convention) restricted to privileged processes. This
|
williamr@2
|
308 |
* convention is based on "vouchsafe" principles only. It is only secure
|
williamr@2
|
309 |
* if you trust the remote host to restrict these ports.
|
williamr@2
|
310 |
*
|
williamr@2
|
311 |
* The default range of ports and the high range can be changed by
|
williamr@2
|
312 |
* sysctl(3). (net.inet.ip.port{hi,low}{first,last}_auto)
|
williamr@2
|
313 |
*
|
williamr@2
|
314 |
* Changing those values has bad security implications if you are
|
williamr@2
|
315 |
* using a stateless firewall that is allowing packets outside of that
|
williamr@2
|
316 |
* range in order to allow transparent outgoing connections.
|
williamr@2
|
317 |
*
|
williamr@2
|
318 |
* Such a firewall configuration will generally depend on the use of these
|
williamr@2
|
319 |
* default values. If you change them, you may find your Security
|
williamr@2
|
320 |
* Administrator looking for you with a heavy object.
|
williamr@2
|
321 |
*
|
williamr@2
|
322 |
* For a slightly more orthodox text view on this:
|
williamr@2
|
323 |
*
|
williamr@2
|
324 |
* ftp://ftp.isi.edu/in-notes/iana/assignments/port-numbers
|
williamr@2
|
325 |
*
|
williamr@2
|
326 |
* port numbers are divided into three ranges:
|
williamr@2
|
327 |
*
|
williamr@2
|
328 |
* 0 - 1023 Well Known Ports
|
williamr@2
|
329 |
* 1024 - 49151 Registered Ports
|
williamr@2
|
330 |
* 49152 - 65535 Dynamic and/or Private Ports
|
williamr@2
|
331 |
*
|
williamr@2
|
332 |
*/
|
williamr@2
|
333 |
|
williamr@2
|
334 |
/*
|
williamr@2
|
335 |
* Ports < IPPORT_RESERVED are reserved for
|
williamr@2
|
336 |
* privileged processes (e.g. root). (IP_PORTRANGE_LOW)
|
williamr@2
|
337 |
*/
|
williamr@2
|
338 |
#define IPPORT_RESERVED 1024
|
williamr@2
|
339 |
|
williamr@2
|
340 |
/*
|
williamr@2
|
341 |
* Default local port range, used by both IP_PORTRANGE_DEFAULT
|
williamr@2
|
342 |
* and IP_PORTRANGE_HIGH.
|
williamr@2
|
343 |
*/
|
williamr@2
|
344 |
#define IPPORT_HIFIRSTAUTO 49152
|
williamr@2
|
345 |
#define IPPORT_HILASTAUTO 65535
|
williamr@2
|
346 |
|
williamr@2
|
347 |
/*
|
williamr@2
|
348 |
* Scanning for a free reserved port return a value below IPPORT_RESERVED,
|
williamr@2
|
349 |
* but higher than IPPORT_RESERVEDSTART. Traditionally the start value was
|
williamr@2
|
350 |
* 512, but that conflicts with some well-known-services that firewalls may
|
williamr@2
|
351 |
* have a fit if we use.
|
williamr@2
|
352 |
*/
|
williamr@2
|
353 |
#define IPPORT_RESERVEDSTART 600
|
williamr@2
|
354 |
|
williamr@2
|
355 |
#define IPPORT_MAX 65535
|
williamr@2
|
356 |
|
williamr@2
|
357 |
/*
|
williamr@2
|
358 |
* Definitions of bits in internet address integers.
|
williamr@2
|
359 |
* On subnets, the decomposition of addresses to host and net parts
|
williamr@2
|
360 |
* is done according to subnet mask, not the masks here.
|
williamr@2
|
361 |
*/
|
williamr@2
|
362 |
#define IN_CLASSA(i) (((u_int32_t)(i) & 0x80000000) == 0)
|
williamr@2
|
363 |
#define IN_CLASSA_NET 0xff000000
|
williamr@2
|
364 |
#define IN_CLASSA_NSHIFT 24
|
williamr@2
|
365 |
#define IN_CLASSA_HOST 0x00ffffff
|
williamr@2
|
366 |
#define IN_CLASSA_MAX 128
|
williamr@2
|
367 |
|
williamr@2
|
368 |
#define IN_CLASSB(i) (((u_int32_t)(i) & 0xc0000000) == 0x80000000)
|
williamr@2
|
369 |
#define IN_CLASSB_NET 0xffff0000
|
williamr@2
|
370 |
#define IN_CLASSB_NSHIFT 16
|
williamr@2
|
371 |
#define IN_CLASSB_HOST 0x0000ffff
|
williamr@2
|
372 |
#define IN_CLASSB_MAX 65536
|
williamr@2
|
373 |
|
williamr@2
|
374 |
#define IN_CLASSC(i) (((u_int32_t)(i) & 0xe0000000) == 0xc0000000)
|
williamr@2
|
375 |
#define IN_CLASSC_NET 0xffffff00
|
williamr@2
|
376 |
#define IN_CLASSC_NSHIFT 8
|
williamr@2
|
377 |
#define IN_CLASSC_HOST 0x000000ff
|
williamr@2
|
378 |
|
williamr@2
|
379 |
#define IN_CLASSD(i) (((u_int32_t)(i) & 0xf0000000) == 0xe0000000)
|
williamr@2
|
380 |
#define IN_CLASSD_NET 0xf0000000 /* These ones aren't really */
|
williamr@2
|
381 |
#define IN_CLASSD_NSHIFT 28 /* net and host fields, but */
|
williamr@2
|
382 |
#define IN_CLASSD_HOST 0x0fffffff /* routing needn't know. */
|
williamr@2
|
383 |
#define IN_MULTICAST(i) IN_CLASSD(i)
|
williamr@2
|
384 |
|
williamr@2
|
385 |
#define IN_EXPERIMENTAL(i) (((u_int32_t)(i) & 0xf0000000) == 0xf0000000)
|
williamr@2
|
386 |
#define IN_BADCLASS(i) (((u_int32_t)(i) & 0xf0000000) == 0xf0000000)
|
williamr@2
|
387 |
|
williamr@2
|
388 |
#define INADDR_LOOPBACK (u_int32_t)0x7f000001
|
williamr@2
|
389 |
#ifndef _KERNEL
|
williamr@2
|
390 |
#define INADDR_NONE 0xffffffff /* -1 return */
|
williamr@2
|
391 |
#endif
|
williamr@2
|
392 |
|
williamr@2
|
393 |
#define INADDR_UNSPEC_GROUP (u_int32_t)0xe0000000 /* 224.0.0.0 */
|
williamr@2
|
394 |
#define INADDR_ALLHOSTS_GROUP (u_int32_t)0xe0000001 /* 224.0.0.1 */
|
williamr@2
|
395 |
#define INADDR_ALLRTRS_GROUP (u_int32_t)0xe0000002 /* 224.0.0.2 */
|
williamr@2
|
396 |
#define INADDR_CARP_GROUP (u_int32_t)0xe0000012 /* 224.0.0.18 */
|
williamr@2
|
397 |
#define INADDR_PFSYNC_GROUP (u_int32_t)0xe00000f0 /* 224.0.0.240 */
|
williamr@2
|
398 |
#define INADDR_ALLMDNS_GROUP (u_int32_t)0xe00000fb /* 224.0.0.251 */
|
williamr@2
|
399 |
#define INADDR_MAX_LOCAL_GROUP (u_int32_t)0xe00000ff /* 224.0.0.255 */
|
williamr@2
|
400 |
|
williamr@2
|
401 |
#define IN_LOOPBACKNET 127 /* official! */
|
williamr@2
|
402 |
|
williamr@2
|
403 |
/*
|
williamr@2
|
404 |
* Options for use with [gs]etsockopt at the IP level.
|
williamr@2
|
405 |
* First word of comment is data type; bool is stored in int.
|
williamr@2
|
406 |
*/
|
williamr@2
|
407 |
#ifdef __SYMBIAN32__
|
williamr@2
|
408 |
#define IP_OPTIONS 0x306 /* buf/ip_opts; set/get IP options */
|
williamr@2
|
409 |
#else
|
williamr@2
|
410 |
#define IP_OPTIONS 1 /* buf/ip_opts; set/get IP options */
|
williamr@2
|
411 |
#endif // __SYMBIAN32__
|
williamr@2
|
412 |
#ifdef __SYMBIAN32__
|
williamr@2
|
413 |
#define IP_HDRINCL 0x308 /* int; header is included with data */
|
williamr@2
|
414 |
#else
|
williamr@2
|
415 |
#define IP_HDRINCL 2 /* int; header is included with data */
|
williamr@2
|
416 |
#endif // __SYMBIAN32__
|
williamr@2
|
417 |
#ifdef __SYMBIAN32__
|
williamr@2
|
418 |
#define IP_TOS 0x309 /* int; IP type of service and preced. */
|
williamr@2
|
419 |
#else
|
williamr@2
|
420 |
#define IP_TOS 3 /* int; IP type of service and preced. */
|
williamr@2
|
421 |
#endif // __SYMBIAN32__
|
williamr@2
|
422 |
#ifdef __SYMBIAN32__
|
williamr@2
|
423 |
#define IP_TTL 0x310 /* int; IP time to live */
|
williamr@2
|
424 |
#else
|
williamr@2
|
425 |
#define IP_TTL 4 /* int; IP time to live */
|
williamr@2
|
426 |
#endif // __SYMBIAN32__
|
williamr@2
|
427 |
#ifdef __SYMBIAN32__
|
williamr@2
|
428 |
#define IP_RECVOPTS -1 /* bool; receive all IP opts w/dgram */
|
williamr@2
|
429 |
#else
|
williamr@2
|
430 |
#define IP_RECVOPTS 5 /* bool; receive all IP opts w/dgram */
|
williamr@2
|
431 |
#endif
|
williamr@2
|
432 |
#ifdef __SYMBIAN32__
|
williamr@2
|
433 |
#define IP_RECVRETOPTS -2 /* bool; receive IP opts for response */
|
williamr@2
|
434 |
#else
|
williamr@2
|
435 |
#define IP_RECVRETOPTS 6 /* bool; receive IP opts for response */
|
williamr@2
|
436 |
#endif
|
williamr@2
|
437 |
#ifdef __SYMBIAN32__
|
williamr@2
|
438 |
#define IP_RECVDSTADDR -3 /* bool; receive IP dst addr w/dgram */
|
williamr@2
|
439 |
#else
|
williamr@2
|
440 |
#define IP_RECVDSTADDR 7 /* bool; receive IP dst addr w/dgram */
|
williamr@2
|
441 |
#endif
|
williamr@2
|
442 |
#define IP_SENDSRCADDR IP_RECVDSTADDR /* cmsg_type to set src addr */
|
williamr@2
|
443 |
#ifdef __SYMBIAN32__
|
williamr@2
|
444 |
#define IP_RETOPTS -4 /* ip_opts; set/get IP options */
|
williamr@2
|
445 |
#else
|
williamr@2
|
446 |
#define IP_RETOPTS 8 /* ip_opts; set/get IP options */
|
williamr@2
|
447 |
#endif // __SYMBIAN32__
|
williamr@2
|
448 |
#ifdef __SYMBIAN32__
|
williamr@2
|
449 |
#define IP_MULTICAST_IF -5 /* set/get IP multicast interface */
|
williamr@2
|
450 |
#else
|
williamr@2
|
451 |
#define IP_MULTICAST_IF 9 /* u_char; set/get IP multicast i/f */
|
williamr@2
|
452 |
#endif // __SYMBIAN32__
|
williamr@2
|
453 |
#ifdef __SYMBIAN32__
|
williamr@2
|
454 |
#define IP_MULTICAST_TTL -6 /* set/get IP multicast timetolive */
|
williamr@2
|
455 |
#else
|
williamr@2
|
456 |
#define IP_MULTICAST_TTL 10 /* u_char; set/get IP multicast ttl */
|
williamr@2
|
457 |
#endif // __SYMBIAN32__
|
williamr@2
|
458 |
#ifdef __SYMBIAN32__
|
williamr@2
|
459 |
#define IP_MULTICAST_LOOP -7 /* u_char; set/get IP multicast loopback */
|
williamr@2
|
460 |
#else
|
williamr@2
|
461 |
#define IP_MULTICAST_LOOP 11 /* u_char; set/get IP multicast loopback */
|
williamr@2
|
462 |
#endif // __SYMBIAN32__
|
williamr@2
|
463 |
#ifdef __SYMBIAN32__
|
williamr@2
|
464 |
#define IP_ADD_MEMBERSHIP 0x46d /* ip_mreq; add an IP group membership */
|
williamr@2
|
465 |
#else
|
williamr@2
|
466 |
#define IP_ADD_MEMBERSHIP 12 /* ip_mreq; add an IP group membership */
|
williamr@2
|
467 |
#endif // __SYMBIAN32__
|
williamr@2
|
468 |
#ifdef __SYMBIAN32__
|
williamr@2
|
469 |
#define IP_DROP_MEMBERSHIP 0x46e /* ip_mreq; drop an IP group membership */
|
williamr@2
|
470 |
#else
|
williamr@2
|
471 |
#define IP_DROP_MEMBERSHIP 13 /* ip_mreq; drop an IP group membership */
|
williamr@2
|
472 |
#endif // __SYMBIAN32__
|
williamr@2
|
473 |
#define IP_MULTICAST_VIF 14 /* set/get IP mcast virt. iface */
|
williamr@2
|
474 |
#define IP_RSVP_ON 15 /* enable RSVP in kernel */
|
williamr@2
|
475 |
#define IP_RSVP_OFF 16 /* disable RSVP in kernel */
|
williamr@2
|
476 |
#define IP_RSVP_VIF_ON 17 /* set RSVP per-vif socket */
|
williamr@2
|
477 |
#define IP_RSVP_VIF_OFF 18 /* unset RSVP per-vif socket */
|
williamr@2
|
478 |
#define IP_PORTRANGE 19 /* int; range to choose for unspec port */
|
williamr@2
|
479 |
#define IP_RECVIF 20 /* bool; receive reception if w/dgram */
|
williamr@2
|
480 |
/* for IPSEC */
|
williamr@2
|
481 |
#define IP_IPSEC_POLICY 21 /* int; set/get security policy */
|
williamr@2
|
482 |
#define IP_FAITH 22 /* bool; accept FAITH'ed connections */
|
williamr@2
|
483 |
|
williamr@2
|
484 |
#define IP_ONESBCAST 23 /* bool: send all-ones broadcast */
|
williamr@2
|
485 |
|
williamr@2
|
486 |
#define IP_FW_TABLE_ADD 40 /* add entry */
|
williamr@2
|
487 |
#define IP_FW_TABLE_DEL 41 /* delete entry */
|
williamr@2
|
488 |
#define IP_FW_TABLE_FLUSH 42 /* flush table */
|
williamr@2
|
489 |
#define IP_FW_TABLE_GETSIZE 43 /* get table size */
|
williamr@2
|
490 |
#define IP_FW_TABLE_LIST 44 /* list table contents */
|
williamr@2
|
491 |
|
williamr@2
|
492 |
#define IP_FW_ADD 50 /* add a firewall rule to chain */
|
williamr@2
|
493 |
#define IP_FW_DEL 51 /* delete a firewall rule from chain */
|
williamr@2
|
494 |
#define IP_FW_FLUSH 52 /* flush firewall rule chain */
|
williamr@2
|
495 |
#define IP_FW_ZERO 53 /* clear single/all firewall counter(s) */
|
williamr@2
|
496 |
#define IP_FW_GET 54 /* get entire firewall rule chain */
|
williamr@2
|
497 |
#define IP_FW_RESETLOG 55 /* reset logging counters */
|
williamr@2
|
498 |
|
williamr@2
|
499 |
#define IP_DUMMYNET_CONFIGURE 60 /* add/configure a dummynet pipe */
|
williamr@2
|
500 |
#define IP_DUMMYNET_DEL 61 /* delete a dummynet pipe from chain */
|
williamr@2
|
501 |
#define IP_DUMMYNET_FLUSH 62 /* flush dummynet */
|
williamr@2
|
502 |
#define IP_DUMMYNET_GET 64 /* get entire dummynet pipes */
|
williamr@2
|
503 |
|
williamr@2
|
504 |
#define IP_RECVTTL 65 /* bool; receive IP TTL w/dgram */
|
williamr@2
|
505 |
#define IP_MINTTL 66 /* minimum TTL for packet or drop */
|
williamr@2
|
506 |
#define IP_DONTFRAG 67 /* don't fragment packet */
|
williamr@2
|
507 |
|
williamr@2
|
508 |
/*
|
williamr@2
|
509 |
* Defaults and limits for options
|
williamr@2
|
510 |
*/
|
williamr@2
|
511 |
#define IP_DEFAULT_MULTICAST_TTL 1 /* normally limit m'casts to 1 hop */
|
williamr@2
|
512 |
#define IP_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */
|
williamr@2
|
513 |
#define IP_MAX_MEMBERSHIPS 20 /* per socket */
|
williamr@2
|
514 |
|
williamr@2
|
515 |
/*
|
williamr@2
|
516 |
* Argument structure for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP.
|
williamr@2
|
517 |
*/
|
williamr@2
|
518 |
struct ip_mreq {
|
williamr@2
|
519 |
struct in_addr imr_multiaddr; /* IP multicast address of group */
|
williamr@2
|
520 |
struct in_addr imr_interface; /* local IP address of interface */
|
williamr@2
|
521 |
};
|
williamr@2
|
522 |
|
williamr@2
|
523 |
/*
|
williamr@2
|
524 |
* Argument for IP_PORTRANGE:
|
williamr@2
|
525 |
* - which range to search when port is unspecified at bind() or connect()
|
williamr@2
|
526 |
*/
|
williamr@2
|
527 |
#define IP_PORTRANGE_DEFAULT 0 /* default range */
|
williamr@2
|
528 |
#define IP_PORTRANGE_HIGH 1 /* "high" - request firewall bypass */
|
williamr@2
|
529 |
#define IP_PORTRANGE_LOW 2 /* "low" - vouchsafe security */
|
williamr@2
|
530 |
|
williamr@2
|
531 |
/*
|
williamr@2
|
532 |
* Definitions for inet sysctl operations.
|
williamr@2
|
533 |
*
|
williamr@2
|
534 |
* Third level is protocol number.
|
williamr@2
|
535 |
* Fourth level is desired variable within that protocol.
|
williamr@2
|
536 |
*/
|
williamr@2
|
537 |
#define IPPROTO_MAXID (IPPROTO_AH + 1) /* don't list to IPPROTO_MAX */
|
williamr@2
|
538 |
|
williamr@2
|
539 |
#define CTL_IPPROTO_NAMES { \
|
williamr@2
|
540 |
{ "ip", CTLTYPE_NODE }, \
|
williamr@2
|
541 |
{ "icmp", CTLTYPE_NODE }, \
|
williamr@2
|
542 |
{ "igmp", CTLTYPE_NODE }, \
|
williamr@2
|
543 |
{ "ggp", CTLTYPE_NODE }, \
|
williamr@2
|
544 |
{ 0, 0 }, \
|
williamr@2
|
545 |
{ 0, 0 }, \
|
williamr@2
|
546 |
{ "tcp", CTLTYPE_NODE }, \
|
williamr@2
|
547 |
{ 0, 0 }, \
|
williamr@2
|
548 |
{ "egp", CTLTYPE_NODE }, \
|
williamr@2
|
549 |
{ 0, 0 }, \
|
williamr@2
|
550 |
{ 0, 0 }, \
|
williamr@2
|
551 |
{ 0, 0 }, \
|
williamr@2
|
552 |
{ "pup", CTLTYPE_NODE }, \
|
williamr@2
|
553 |
{ 0, 0 }, \
|
williamr@2
|
554 |
{ 0, 0 }, \
|
williamr@2
|
555 |
{ 0, 0 }, \
|
williamr@2
|
556 |
{ 0, 0 }, \
|
williamr@2
|
557 |
{ "udp", CTLTYPE_NODE }, \
|
williamr@2
|
558 |
{ 0, 0 }, \
|
williamr@2
|
559 |
{ 0, 0 }, \
|
williamr@2
|
560 |
{ 0, 0 }, \
|
williamr@2
|
561 |
{ 0, 0 }, \
|
williamr@2
|
562 |
{ "idp", CTLTYPE_NODE }, \
|
williamr@2
|
563 |
{ 0, 0 }, \
|
williamr@2
|
564 |
{ 0, 0 }, \
|
williamr@2
|
565 |
{ 0, 0 }, \
|
williamr@2
|
566 |
{ 0, 0 }, \
|
williamr@2
|
567 |
{ 0, 0 }, \
|
williamr@2
|
568 |
{ 0, 0 }, \
|
williamr@2
|
569 |
{ 0, 0 }, \
|
williamr@2
|
570 |
{ 0, 0 }, \
|
williamr@2
|
571 |
{ 0, 0 }, \
|
williamr@2
|
572 |
{ 0, 0 }, \
|
williamr@2
|
573 |
{ 0, 0 }, \
|
williamr@2
|
574 |
{ 0, 0 }, \
|
williamr@2
|
575 |
{ 0, 0 }, \
|
williamr@2
|
576 |
{ 0, 0 }, \
|
williamr@2
|
577 |
{ 0, 0 }, \
|
williamr@2
|
578 |
{ 0, 0 }, \
|
williamr@2
|
579 |
{ 0, 0 }, \
|
williamr@2
|
580 |
{ 0, 0 }, \
|
williamr@2
|
581 |
{ 0, 0 }, \
|
williamr@2
|
582 |
{ 0, 0 }, \
|
williamr@2
|
583 |
{ 0, 0 }, \
|
williamr@2
|
584 |
{ 0, 0 }, \
|
williamr@2
|
585 |
{ 0, 0 }, \
|
williamr@2
|
586 |
{ 0, 0 }, \
|
williamr@2
|
587 |
{ 0, 0 }, \
|
williamr@2
|
588 |
{ 0, 0 }, \
|
williamr@2
|
589 |
{ 0, 0 }, \
|
williamr@2
|
590 |
{ 0, 0 }, \
|
williamr@2
|
591 |
{ "ipsec", CTLTYPE_NODE }, \
|
williamr@2
|
592 |
{ 0, 0 }, \
|
williamr@2
|
593 |
{ 0, 0 }, \
|
williamr@2
|
594 |
{ 0, 0 }, \
|
williamr@2
|
595 |
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
|
williamr@2
|
596 |
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
|
williamr@2
|
597 |
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
|
williamr@2
|
598 |
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
|
williamr@2
|
599 |
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
|
williamr@2
|
600 |
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
|
williamr@2
|
601 |
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
|
williamr@2
|
602 |
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
|
williamr@2
|
603 |
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, \
|
williamr@2
|
604 |
{ 0, 0 }, \
|
williamr@2
|
605 |
{ 0, 0 }, \
|
williamr@2
|
606 |
{ 0, 0 }, \
|
williamr@2
|
607 |
{ "pim", CTLTYPE_NODE }, \
|
williamr@2
|
608 |
}
|
williamr@2
|
609 |
|
williamr@2
|
610 |
/*
|
williamr@2
|
611 |
* Names for IP sysctl objects
|
williamr@2
|
612 |
*/
|
williamr@2
|
613 |
#define IPCTL_FORWARDING 1 /* act as router */
|
williamr@2
|
614 |
#define IPCTL_SENDREDIRECTS 2 /* may send redirects when forwarding */
|
williamr@2
|
615 |
#define IPCTL_DEFTTL 3 /* default TTL */
|
williamr@2
|
616 |
#ifdef notyet
|
williamr@2
|
617 |
#define IPCTL_DEFMTU 4 /* default MTU */
|
williamr@2
|
618 |
#endif
|
williamr@2
|
619 |
#define IPCTL_RTEXPIRE 5 /* cloned route expiration time */
|
williamr@2
|
620 |
#define IPCTL_RTMINEXPIRE 6 /* min value for expiration time */
|
williamr@2
|
621 |
#define IPCTL_RTMAXCACHE 7 /* trigger level for dynamic expire */
|
williamr@2
|
622 |
#define IPCTL_SOURCEROUTE 8 /* may perform source routes */
|
williamr@2
|
623 |
#define IPCTL_DIRECTEDBROADCAST 9 /* may re-broadcast received packets */
|
williamr@2
|
624 |
#define IPCTL_INTRQMAXLEN 10 /* max length of netisr queue */
|
williamr@2
|
625 |
#define IPCTL_INTRQDROPS 11 /* number of netisr q drops */
|
williamr@2
|
626 |
#define IPCTL_STATS 12 /* ipstat structure */
|
williamr@2
|
627 |
#define IPCTL_ACCEPTSOURCEROUTE 13 /* may accept source routed packets */
|
williamr@2
|
628 |
#define IPCTL_FASTFORWARDING 14 /* use fast IP forwarding code */
|
williamr@2
|
629 |
#define IPCTL_KEEPFAITH 15 /* FAITH IPv4->IPv6 translater ctl */
|
williamr@2
|
630 |
#define IPCTL_GIF_TTL 16 /* default TTL for gif encap packet */
|
williamr@2
|
631 |
#define IPCTL_MAXID 17
|
williamr@2
|
632 |
|
williamr@2
|
633 |
#define IPCTL_NAMES { \
|
williamr@2
|
634 |
{ 0, 0 }, \
|
williamr@2
|
635 |
{ "forwarding", CTLTYPE_INT }, \
|
williamr@2
|
636 |
{ "redirect", CTLTYPE_INT }, \
|
williamr@2
|
637 |
{ "ttl", CTLTYPE_INT }, \
|
williamr@2
|
638 |
{ "mtu", CTLTYPE_INT }, \
|
williamr@2
|
639 |
{ "rtexpire", CTLTYPE_INT }, \
|
williamr@2
|
640 |
{ "rtminexpire", CTLTYPE_INT }, \
|
williamr@2
|
641 |
{ "rtmaxcache", CTLTYPE_INT }, \
|
williamr@2
|
642 |
{ "sourceroute", CTLTYPE_INT }, \
|
williamr@2
|
643 |
{ "directed-broadcast", CTLTYPE_INT }, \
|
williamr@2
|
644 |
{ "intr-queue-maxlen", CTLTYPE_INT }, \
|
williamr@2
|
645 |
{ "intr-queue-drops", CTLTYPE_INT }, \
|
williamr@2
|
646 |
{ "stats", CTLTYPE_STRUCT }, \
|
williamr@2
|
647 |
{ "accept_sourceroute", CTLTYPE_INT }, \
|
williamr@2
|
648 |
{ "fastforwarding", CTLTYPE_INT }, \
|
williamr@2
|
649 |
}
|
williamr@2
|
650 |
|
williamr@2
|
651 |
#endif /* __BSD_VISIBLE */
|
williamr@2
|
652 |
|
williamr@2
|
653 |
#ifdef _KERNEL
|
williamr@2
|
654 |
|
williamr@2
|
655 |
struct ifnet; struct mbuf; /* forward declarations for Standard C */
|
williamr@2
|
656 |
|
williamr@2
|
657 |
char *inet_ntoa(struct in_addr); /* in libkern */
|
williamr@2
|
658 |
|
williamr@2
|
659 |
#define in_hosteq(s, t) ((s).s_addr == (t).s_addr)
|
williamr@2
|
660 |
#define in_nullhost(x) ((x).s_addr == INADDR_ANY)
|
williamr@2
|
661 |
|
williamr@2
|
662 |
#define satosin(sa) ((struct sockaddr_in *)(sa))
|
williamr@2
|
663 |
#define sintosa(sin) ((struct sockaddr *)(sin))
|
williamr@2
|
664 |
#define ifatoia(ifa) ((struct in_ifaddr *)(ifa))
|
williamr@2
|
665 |
|
williamr@2
|
666 |
#endif /* _KERNEL */
|
williamr@2
|
667 |
|
williamr@2
|
668 |
/* INET6 stuff */
|
williamr@2
|
669 |
#if __POSIX_VISIBLE >= 200112
|
williamr@2
|
670 |
#define __KAME_NETINET_IN_H_INCLUDED_
|
williamr@4
|
671 |
#include <stdapis/netinet6/in6.h>
|
williamr@2
|
672 |
#undef __KAME_NETINET_IN_H_INCLUDED_
|
williamr@2
|
673 |
#endif
|
williamr@2
|
674 |
|
williamr@2
|
675 |
#ifndef _KERNEL
|
williamr@2
|
676 |
|
williamr@2
|
677 |
__BEGIN_DECLS
|
williamr@2
|
678 |
IMPORT_C int bindresvport (int __sockfd, struct sockaddr_in *__sock_in);
|
williamr@2
|
679 |
__END_DECLS
|
williamr@2
|
680 |
|
williamr@2
|
681 |
#endif /* _KERNEL */
|
williamr@2
|
682 |
|
williamr@2
|
683 |
#endif /* !_NETINET_IN_H_*/
|