Root/
Source at commit 1988 created 12 years 1 month ago. By ifabio, Sorry… Forgot... Package: - Update Czech. | |
---|---|
1 | /*␊ |
2 | * Copyright (c) 2008 Apple Inc. All rights reserved.␊ |
3 | *␊ |
4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@␊ |
5 | * ␊ |
6 | * This file contains Original Code and/or Modifications of Original Code␊ |
7 | * as defined in and that are subject to the Apple Public Source License␊ |
8 | * Version 2.0 (the 'License'). You may not use this file except in␊ |
9 | * compliance with the License. The rights granted to you under the License␊ |
10 | * may not be used to create, or enable the creation or redistribution of,␊ |
11 | * unlawful or unlicensed copies of an Apple operating system, or to␊ |
12 | * circumvent, violate, or enable the circumvention or violation of, any␊ |
13 | * terms of an Apple operating system software license agreement.␊ |
14 | * ␊ |
15 | * Please obtain a copy of the License at␊ |
16 | * http://www.opensource.apple.com/apsl/ and read it before using this file.␊ |
17 | * ␊ |
18 | * The Original Code and all software distributed under the License are␊ |
19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER␊ |
20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,␊ |
21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,␊ |
22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.␊ |
23 | * Please see the License for the specific language governing rights and␊ |
24 | * limitations under the License.␊ |
25 | * ␊ |
26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@␊ |
27 | */␊ |
28 | ␊ |
29 | /*␉$FreeBSD: src/sys/netinet6/in6.h,v 1.7.2.4 2001/07/04 09:45:23 ume Exp $␉*/␊ |
30 | /*␉$KAME: in6.h,v 1.89 2001/05/27 13:28:35 itojun Exp $␉*/␊ |
31 | ␊ |
32 | /*␊ |
33 | * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.␊ |
34 | * All rights reserved.␊ |
35 | *␊ |
36 | * Redistribution and use in source and binary forms, with or without␊ |
37 | * modification, are permitted provided that the following conditions␊ |
38 | * are met:␊ |
39 | * 1. Redistributions of source code must retain the above copyright␊ |
40 | * notice, this list of conditions and the following disclaimer.␊ |
41 | * 2. Redistributions in binary form must reproduce the above copyright␊ |
42 | * notice, this list of conditions and the following disclaimer in the␊ |
43 | * documentation and/or other materials provided with the distribution.␊ |
44 | * 3. Neither the name of the project nor the names of its contributors␊ |
45 | * may be used to endorse or promote products derived from this software␊ |
46 | * without specific prior written permission.␊ |
47 | *␊ |
48 | * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND␊ |
49 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE␊ |
50 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE␊ |
51 | * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE␊ |
52 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL␊ |
53 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS␊ |
54 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)␊ |
55 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT␊ |
56 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY␊ |
57 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF␊ |
58 | * SUCH DAMAGE.␊ |
59 | */␊ |
60 | ␊ |
61 | /*␊ |
62 | * Copyright (c) 1982, 1986, 1990, 1993␊ |
63 | *␉The Regents of the University of California. All rights reserved.␊ |
64 | *␊ |
65 | * Redistribution and use in source and binary forms, with or without␊ |
66 | * modification, are permitted provided that the following conditions␊ |
67 | * are met:␊ |
68 | * 1. Redistributions of source code must retain the above copyright␊ |
69 | * notice, this list of conditions and the following disclaimer.␊ |
70 | * 2. Redistributions in binary form must reproduce the above copyright␊ |
71 | * notice, this list of conditions and the following disclaimer in the␊ |
72 | * documentation and/or other materials provided with the distribution.␊ |
73 | * 3. All advertising materials mentioning features or use of this software␊ |
74 | * must display the following acknowledgement:␊ |
75 | *␉This product includes software developed by the University of␊ |
76 | *␉California, Berkeley and its contributors.␊ |
77 | * 4. Neither the name of the University nor the names of its contributors␊ |
78 | * may be used to endorse or promote products derived from this software␊ |
79 | * without specific prior written permission.␊ |
80 | *␊ |
81 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND␊ |
82 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE␊ |
83 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE␊ |
84 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE␊ |
85 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL␊ |
86 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS␊ |
87 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)␊ |
88 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT␊ |
89 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY␊ |
90 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF␊ |
91 | * SUCH DAMAGE.␊ |
92 | *␊ |
93 | *␉@(#)in.h␉8.3 (Berkeley) 1/3/94␊ |
94 | */␊ |
95 | ␊ |
96 | #ifndef __KAME_NETINET_IN_H_INCLUDED_␊ |
97 | #error "do not include netinet6/in6.h directly, include netinet/in.h. see RFC2553"␊ |
98 | #endif␊ |
99 | ␊ |
100 | #ifndef _NETINET6_IN6_H_␊ |
101 | #define _NETINET6_IN6_H_␊ |
102 | #include <sys/appleapiopts.h>␊ |
103 | #include <sys/_types.h>␊ |
104 | ␊ |
105 | ␊ |
106 | #ifndef _SA_FAMILY_T␊ |
107 | #define _SA_FAMILY_T␊ |
108 | typedef __uint8_t␉␉sa_family_t;␊ |
109 | #endif␊ |
110 | ␊ |
111 | /*␊ |
112 | * Identification of the network protocol stack␊ |
113 | * for *BSD-current/release: http://www.kame.net/dev/cvsweb.cgi/kame/COVERAGE␊ |
114 | * has the table of implementation/integration differences.␊ |
115 | */␊ |
116 | #define __KAME__␊ |
117 | #define __KAME_VERSION␉␉"20010528/apple-darwin"␊ |
118 | ␊ |
119 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)␊ |
120 | /*␊ |
121 | * Local port number conventions:␊ |
122 | *␊ |
123 | * Ports < IPPORT_RESERVED are reserved for privileged processes (e.g. root),␊ |
124 | * unless a kernel is compiled with IPNOPRIVPORTS defined.␊ |
125 | *␊ |
126 | * When a user does a bind(2) or connect(2) with a port number of zero,␊ |
127 | * a non-conflicting local port address is chosen.␊ |
128 | *␊ |
129 | * The default range is IPPORT_ANONMIN to IPPORT_ANONMAX, although␊ |
130 | * that is settable by sysctl(3); net.inet.ip.anonportmin and␊ |
131 | * net.inet.ip.anonportmax respectively.␊ |
132 | *␊ |
133 | * A user may set the IPPROTO_IP option IP_PORTRANGE to change this␊ |
134 | * default assignment range.␊ |
135 | *␊ |
136 | * The value IP_PORTRANGE_DEFAULT causes the default behavior.␊ |
137 | *␊ |
138 | * The value IP_PORTRANGE_HIGH is the same as IP_PORTRANGE_DEFAULT,␊ |
139 | * and exists only for FreeBSD compatibility purposes.␊ |
140 | *␊ |
141 | * The value IP_PORTRANGE_LOW changes the range to the "low" are␊ |
142 | * that is (by convention) restricted to privileged processes.␊ |
143 | * This convention is based on "vouchsafe" principles only.␊ |
144 | * It is only secure if you trust the remote host to restrict these ports.␊ |
145 | * The range is IPPORT_RESERVEDMIN to IPPORT_RESERVEDMAX.␊ |
146 | */␊ |
147 | ␊ |
148 | #define␉IPV6PORT_RESERVED␉1024␊ |
149 | #define␉IPV6PORT_ANONMIN␉49152␊ |
150 | #define␉IPV6PORT_ANONMAX␉65535␊ |
151 | #define␉IPV6PORT_RESERVEDMIN␉600␊ |
152 | #define␉IPV6PORT_RESERVEDMAX␉(IPV6PORT_RESERVED-1)␊ |
153 | #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */␊ |
154 | ␊ |
155 | /*␊ |
156 | * IPv6 address␊ |
157 | */␊ |
158 | struct in6_addr {␊ |
159 | ␉union {␊ |
160 | ␉␉__uint8_t __u6_addr8[16];␊ |
161 | ␉␉__uint16_t __u6_addr16[8];␊ |
162 | ␉␉__uint32_t __u6_addr32[4];␊ |
163 | ␉} __u6_addr;␉␉␉/* 128-bit IP6 address */␊ |
164 | };␊ |
165 | ␊ |
166 | #define s6_addr __u6_addr.__u6_addr8␊ |
167 | ␊ |
168 | #define INET6_ADDRSTRLEN␉46␊ |
169 | ␊ |
170 | /*␊ |
171 | * Socket address for IPv6␊ |
172 | */␊ |
173 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)␊ |
174 | #define SIN6_LEN␊ |
175 | #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */␊ |
176 | struct sockaddr_in6 {␊ |
177 | ␉__uint8_t␉sin6_len;␉/* length of this struct(sa_family_t)*/␊ |
178 | ␉sa_family_t␉sin6_family;␉/* AF_INET6 (sa_family_t) */␊ |
179 | ␉in_port_t␉sin6_port;␉/* Transport layer port # (in_port_t)*/␊ |
180 | ␉__uint32_t␉sin6_flowinfo;␉/* IP6 flow information */␊ |
181 | ␉struct in6_addr␉sin6_addr;␉/* IP6 address */␊ |
182 | ␉__uint32_t␉sin6_scope_id;␉/* scope zone index */␊ |
183 | };␊ |
184 | ␊ |
185 | ␊ |
186 | ␊ |
187 | ␊ |
188 | /*␊ |
189 | * Definition of some useful macros to handle IP6 addresses␊ |
190 | */␊ |
191 | #define IN6ADDR_ANY_INIT \␊ |
192 | ␉{{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \␊ |
193 | ␉ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}}␊ |
194 | #define IN6ADDR_LOOPBACK_INIT \␊ |
195 | ␉{{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \␊ |
196 | ␉ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}}␊ |
197 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)␊ |
198 | #define IN6ADDR_NODELOCAL_ALLNODES_INIT \␊ |
199 | ␉{{{ 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \␊ |
200 | ␉ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}}␊ |
201 | #define IN6ADDR_LINKLOCAL_ALLNODES_INIT \␊ |
202 | ␉{{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \␊ |
203 | ␉ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}}␊ |
204 | #define IN6ADDR_LINKLOCAL_ALLROUTERS_INIT \␊ |
205 | ␉{{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \␊ |
206 | ␉ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02 }}}␊ |
207 | #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */␊ |
208 | ␊ |
209 | extern const struct in6_addr in6addr_any;␊ |
210 | extern const struct in6_addr in6addr_loopback;␊ |
211 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)␊ |
212 | extern const struct in6_addr in6addr_nodelocal_allnodes;␊ |
213 | extern const struct in6_addr in6addr_linklocal_allnodes;␊ |
214 | extern const struct in6_addr in6addr_linklocal_allrouters;␊ |
215 | #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */␊ |
216 | ␊ |
217 | /*␊ |
218 | * Equality␊ |
219 | * NOTE: Some of kernel programming environment (for example, openbsd/sparc)␊ |
220 | * does not supply memcmp(). For userland memcmp() is preferred as it is␊ |
221 | * in ANSI standard.␊ |
222 | */␊ |
223 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)␊ |
224 | #define IN6_ARE_ADDR_EQUAL(a, b)␉␉␉\␊ |
225 | (memcmp(&(a)->s6_addr[0], &(b)->s6_addr[0], sizeof(struct in6_addr)) == 0)␊ |
226 | #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */␊ |
227 | ␊ |
228 | ␊ |
229 | /*␊ |
230 | * Unspecified␊ |
231 | */␊ |
232 | #define IN6_IS_ADDR_UNSPECIFIED(a)␉\␊ |
233 | ␉((*(const __uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \␊ |
234 | ␉ (*(const __uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \␊ |
235 | ␉ (*(const __uint32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \␊ |
236 | ␉ (*(const __uint32_t *)(const void *)(&(a)->s6_addr[12]) == 0))␊ |
237 | ␊ |
238 | /*␊ |
239 | * Loopback␊ |
240 | */␊ |
241 | #define IN6_IS_ADDR_LOOPBACK(a)␉␉\␊ |
242 | ␉((*(const __uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \␊ |
243 | ␉ (*(const __uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \␊ |
244 | ␉ (*(const __uint32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \␊ |
245 | ␉ (*(const __uint32_t *)(const void *)(&(a)->s6_addr[12]) == ntohl(1)))␊ |
246 | ␊ |
247 | /*␊ |
248 | * IPv4 compatible␊ |
249 | */␊ |
250 | #define IN6_IS_ADDR_V4COMPAT(a)␉␉\␊ |
251 | ␉((*(const __uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \␊ |
252 | ␉ (*(const __uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \␊ |
253 | ␉ (*(const __uint32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \␊ |
254 | ␉ (*(const __uint32_t *)(const void *)(&(a)->s6_addr[12]) != 0) && \␊ |
255 | ␉ (*(const __uint32_t *)(const void *)(&(a)->s6_addr[12]) != ntohl(1)))␊ |
256 | ␊ |
257 | /*␊ |
258 | * Mapped␊ |
259 | */␊ |
260 | #define IN6_IS_ADDR_V4MAPPED(a)␉␉ \␊ |
261 | ␉((*(const __uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \␊ |
262 | ␉ (*(const __uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \␊ |
263 | ␉ (*(const __uint32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff)))␊ |
264 | ␊ |
265 | /*␊ |
266 | * KAME Scope Values␊ |
267 | */␊ |
268 | ␊ |
269 | #define __IPV6_ADDR_SCOPE_NODELOCAL␉0x01␊ |
270 | #define __IPV6_ADDR_SCOPE_LINKLOCAL␉0x02␊ |
271 | #define __IPV6_ADDR_SCOPE_SITELOCAL␉0x05␊ |
272 | #define __IPV6_ADDR_SCOPE_ORGLOCAL␉0x08␉/* just used in this file */␊ |
273 | #define __IPV6_ADDR_SCOPE_GLOBAL␉0x0e␊ |
274 | ␊ |
275 | /*␊ |
276 | * Unicast Scope␊ |
277 | * Note that we must check topmost 10 bits only, not 16 bits (see RFC2373).␊ |
278 | */␊ |
279 | #define IN6_IS_ADDR_LINKLOCAL(a)␉\␊ |
280 | ␉(((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0x80))␊ |
281 | #define IN6_IS_ADDR_SITELOCAL(a)␉\␊ |
282 | ␉(((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0xc0))␊ |
283 | ␊ |
284 | /*␊ |
285 | * Multicast␊ |
286 | */␊ |
287 | #define IN6_IS_ADDR_MULTICAST(a)␉((a)->s6_addr[0] == 0xff)␊ |
288 | ␊ |
289 | #define __IPV6_ADDR_MC_SCOPE(a)␉␉((a)->s6_addr[1] & 0x0f)␊ |
290 | ␊ |
291 | /*␊ |
292 | * Multicast Scope␊ |
293 | */␊ |
294 | #define IN6_IS_ADDR_MC_NODELOCAL(a)␉\␊ |
295 | ␉(IN6_IS_ADDR_MULTICAST(a) &&␉\␊ |
296 | ␉ (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_NODELOCAL))␊ |
297 | #define IN6_IS_ADDR_MC_LINKLOCAL(a)␉\␊ |
298 | ␉(IN6_IS_ADDR_MULTICAST(a) &&␉\␊ |
299 | ␉ (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_LINKLOCAL))␊ |
300 | #define IN6_IS_ADDR_MC_SITELOCAL(a)␉\␊ |
301 | ␉(IN6_IS_ADDR_MULTICAST(a) && ␉\␊ |
302 | ␉ (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_SITELOCAL))␊ |
303 | #define IN6_IS_ADDR_MC_ORGLOCAL(a)␉\␊ |
304 | ␉(IN6_IS_ADDR_MULTICAST(a) &&␉\␊ |
305 | ␉ (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_ORGLOCAL))␊ |
306 | #define IN6_IS_ADDR_MC_GLOBAL(a)␉\␊ |
307 | ␉(IN6_IS_ADDR_MULTICAST(a) &&␉\␊ |
308 | ␉ (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_GLOBAL))␊ |
309 | ␊ |
310 | ␊ |
311 | /*␊ |
312 | * IP6 route structure␊ |
313 | */␊ |
314 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)␊ |
315 | #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */␊ |
316 | ␊ |
317 | /*␊ |
318 | * Options for use with [gs]etsockopt at the IPV6 level.␊ |
319 | * First word of comment is data type; bool is stored in int.␊ |
320 | */␊ |
321 | /* no hdrincl */␊ |
322 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)␊ |
323 | #if 0 /* the followings are relic in IPv4 and hence are disabled */␊ |
324 | #define IPV6_OPTIONS␉␉1 /* buf/ip6_opts; set/get IP6 options */␊ |
325 | #define IPV6_RECVOPTS␉␉5 /* bool; receive all IP6 opts w/dgram */␊ |
326 | #define IPV6_RECVRETOPTS␉6 /* bool; receive IP6 opts for response */␊ |
327 | #define IPV6_RECVDSTADDR␉7 /* bool; receive IP6 dst addr w/dgram */␊ |
328 | #define IPV6_RETOPTS␉␉8 /* ip6_opts; set/get IP6 options */␊ |
329 | #endif /* 0 */␊ |
330 | #define IPV6_SOCKOPT_RESERVED1␉3 /* reserved for future use */␊ |
331 | #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */␊ |
332 | #define IPV6_UNICAST_HOPS␉4 /* int; IP6 hops */␊ |
333 | #define IPV6_MULTICAST_IF␉9 /* __uint8_t; set/get IP6 multicast i/f */␊ |
334 | #define IPV6_MULTICAST_HOPS␉10 /* __uint8_t; set/get IP6 multicast hops */␊ |
335 | #define IPV6_MULTICAST_LOOP␉11 /* __uint8_t; set/get IP6 mcast loopback */␊ |
336 | #define IPV6_JOIN_GROUP␉␉12 /* ip6_mreq; join a group membership */␊ |
337 | #define IPV6_LEAVE_GROUP␉13 /* ip6_mreq; leave a group membership */␊ |
338 | ␊ |
339 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)␊ |
340 | #define IPV6_PORTRANGE␉␉14 /* int; range to choose for unspec port */␊ |
341 | #define ICMP6_FILTER␉␉18 /* icmp6_filter; icmp6 filter */␊ |
342 | /* RFC2292 options */␊ |
343 | #define IPV6_PKTINFO␉␉19 /* bool; send/recv if, src/dst addr */␊ |
344 | #define IPV6_HOPLIMIT␉␉20 /* bool; hop limit */␊ |
345 | #define IPV6_NEXTHOP␉␉21 /* bool; next hop addr */␊ |
346 | #define IPV6_HOPOPTS␉␉22 /* bool; hop-by-hop option */␊ |
347 | #define IPV6_DSTOPTS␉␉23 /* bool; destination option */␊ |
348 | #define IPV6_RTHDR␉␉24 /* bool; routing header */␊ |
349 | #define IPV6_PKTOPTIONS␉␉25 /* buf/cmsghdr; set/get IPv6 options */␊ |
350 | ␊ |
351 | #define IPV6_CHECKSUM␉␉26 /* int; checksum offset for raw socket */␊ |
352 | #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */␊ |
353 | #define IPV6_V6ONLY␉␉27 /* bool; only bind INET6 at wildcard bind */␊ |
354 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)␊ |
355 | #define IPV6_BINDV6ONLY␉␉IPV6_V6ONLY␊ |
356 | ␊ |
357 | ␊ |
358 | #if 1 /*IPSEC*/␊ |
359 | #define IPV6_IPSEC_POLICY␉28 /* struct; get/set security policy */␊ |
360 | #endif /* 1 */␊ |
361 | #define IPV6_FAITH␉␉29 /* bool; accept FAITH'ed connections */␊ |
362 | ␊ |
363 | #if 1 /*IPV6FIREWALL*/␊ |
364 | #define IPV6_FW_ADD␉␉30 /* add a firewall rule to chain */␊ |
365 | #define IPV6_FW_DEL␉␉31 /* delete a firewall rule from chain */␊ |
366 | #define IPV6_FW_FLUSH␉␉32 /* flush firewall rule chain */␊ |
367 | #define IPV6_FW_ZERO␉␉33 /* clear single/all firewall counter(s) */␊ |
368 | #define IPV6_FW_GET␉␉34 /* get entire firewall rule chain */␊ |
369 | #endif /* 1 */␊ |
370 | ␊ |
371 | #define IPV6_RECVTCLASS 35 /* bool; recv traffic class values */␊ |
372 | #define IPV6_TCLASS 36 /* int; send traffic class value */␊ |
373 | ␊ |
374 | /* to define items, should talk with KAME guys first, for *BSD compatibility */␊ |
375 | ␊ |
376 | #define IPV6_RTHDR_LOOSE 0 /* this hop need not be a neighbor. XXX old spec */␊ |
377 | #define IPV6_RTHDR_STRICT 1 /* this hop must be a neighbor. XXX old spec */␊ |
378 | #define IPV6_RTHDR_TYPE_0 0 /* IPv6 routing header type 0 */␊ |
379 | ␊ |
380 | /*␊ |
381 | * Defaults and limits for options␊ |
382 | */␊ |
383 | #define IPV6_DEFAULT_MULTICAST_HOPS 1␉/* normally limit m'casts to 1 hop */␊ |
384 | #define IPV6_DEFAULT_MULTICAST_LOOP 1␉/* normally hear sends if a member */␊ |
385 | ␊ |
386 | /*␊ |
387 | * Argument structure for IPV6_JOIN_GROUP and IPV6_LEAVE_GROUP.␊ |
388 | */␊ |
389 | struct ipv6_mreq {␊ |
390 | ␉struct in6_addr␉ipv6mr_multiaddr;␊ |
391 | ␉unsigned int␉ipv6mr_interface;␊ |
392 | };␊ |
393 | ␊ |
394 | /*␊ |
395 | * IPV6_PKTINFO: Packet information(RFC2292 sec 5)␊ |
396 | */␊ |
397 | struct in6_pktinfo {␊ |
398 | ␉struct in6_addr␉ipi6_addr;␉/* src/dst IPv6 address */␊ |
399 | ␉unsigned int␉ipi6_ifindex;␉/* send/recv interface index */␊ |
400 | };␊ |
401 | ␊ |
402 | /*␊ |
403 | * Argument for IPV6_PORTRANGE:␊ |
404 | * - which range to search when port is unspecified at bind() or connect()␊ |
405 | */␊ |
406 | #define␉IPV6_PORTRANGE_DEFAULT␉0␉/* default range */␊ |
407 | #define␉IPV6_PORTRANGE_HIGH␉1␉/* "high" - request firewall bypass */␊ |
408 | #define␉IPV6_PORTRANGE_LOW␉2␉/* "low" - vouchsafe security */␊ |
409 | ␊ |
410 | /*␊ |
411 | * Definitions for inet6 sysctl operations.␊ |
412 | *␊ |
413 | * Third level is protocol number.␊ |
414 | * Fourth level is desired variable within that protocol.␊ |
415 | */␊ |
416 | #define IPV6PROTO_MAXID␉(IPPROTO_PIM + 1)␉/* don't list to IPV6PROTO_MAX */␊ |
417 | ␊ |
418 | /*␊ |
419 | * Names for IP sysctl objects␊ |
420 | */␊ |
421 | #define IPV6CTL_FORWARDING␉1␉/* act as router */␊ |
422 | #define IPV6CTL_SENDREDIRECTS␉2␉/* may send redirects when forwarding*/␊ |
423 | #define IPV6CTL_DEFHLIM␉␉3␉/* default Hop-Limit */␊ |
424 | #ifdef notyet␊ |
425 | #define IPV6CTL_DEFMTU␉␉4␉/* default MTU */␊ |
426 | #endif␊ |
427 | #define IPV6CTL_FORWSRCRT␉5␉/* forward source-routed dgrams */␊ |
428 | #define IPV6CTL_STATS␉␉6␉/* stats */␊ |
429 | #define IPV6CTL_MRTSTATS␉7␉/* multicast forwarding stats */␊ |
430 | #define IPV6CTL_MRTPROTO␉8␉/* multicast routing protocol */␊ |
431 | #define IPV6CTL_MAXFRAGPACKETS␉9␉/* max packets reassembly queue */␊ |
432 | #define IPV6CTL_SOURCECHECK␉10␉/* verify source route and intf */␊ |
433 | #define IPV6CTL_SOURCECHECK_LOGINT 11␉/* minimume logging interval */␊ |
434 | #define IPV6CTL_ACCEPT_RTADV␉12␊ |
435 | #define IPV6CTL_KEEPFAITH␉13␊ |
436 | #define IPV6CTL_LOG_INTERVAL␉14␊ |
437 | #define IPV6CTL_HDRNESTLIMIT␉15␊ |
438 | #define IPV6CTL_DAD_COUNT␉16␊ |
439 | #define IPV6CTL_AUTO_FLOWLABEL␉17␊ |
440 | #define IPV6CTL_DEFMCASTHLIM␉18␊ |
441 | #define IPV6CTL_GIF_HLIM␉19␉/* default HLIM for gif encap packet */␊ |
442 | #define IPV6CTL_KAME_VERSION␉20␊ |
443 | #define IPV6CTL_USE_DEPRECATED␉21␉/* use deprecated addr (RFC2462 5.5.4) */␊ |
444 | #define IPV6CTL_RR_PRUNE␉22␉/* walk timer for router renumbering */␊ |
445 | #if 0␉/*obsolete*/␊ |
446 | #define IPV6CTL_MAPPED_ADDR␉23␊ |
447 | #endif␊ |
448 | #define IPV6CTL_V6ONLY␉␉24␊ |
449 | #define IPV6CTL_RTEXPIRE␉25␉/* cloned route expiration time */␊ |
450 | #define IPV6CTL_RTMINEXPIRE␉26␉/* min value for expiration time */␊ |
451 | #define IPV6CTL_RTMAXCACHE␉27␉/* trigger level for dynamic expire */␊ |
452 | ␊ |
453 | #define IPV6CTL_USETEMPADDR␉32␉/* use temporary addresses (RFC3041) */␊ |
454 | #define IPV6CTL_TEMPPLTIME␉33␉/* preferred lifetime for tmpaddrs */␊ |
455 | #define IPV6CTL_TEMPVLTIME␉34␉/* valid lifetime for tmpaddrs */␊ |
456 | #define IPV6CTL_AUTO_LINKLOCAL␉35␉/* automatic link-local addr assign */␊ |
457 | #define IPV6CTL_RIP6STATS␉36␉/* raw_ip6 stats */␊ |
458 | ␊ |
459 | #define IPV6CTL_MAXFRAGS 41 /* max fragments */␊ |
460 | ␊ |
461 | #define IPV6CTL_NEIGHBORGCTHRESH 46␊ |
462 | #define IPV6CTL_MAXIFPREFIXES␉47␊ |
463 | #define IPV6CTL_MAXIFDEFROUTERS 48␊ |
464 | #define IPV6CTL_MAXDYNROUTES␉49␊ |
465 | ␊ |
466 | /* New entries should be added here from current IPV6CTL_MAXID value. */␊ |
467 | /* to define items, should talk with KAME guys first, for *BSD compatibility */␊ |
468 | #define IPV6CTL_MAXID␉␉50␊ |
469 | ␊ |
470 | ␊ |
471 | __BEGIN_DECLS␊ |
472 | struct cmsghdr;␊ |
473 | ␊ |
474 | extern int inet6_option_space(int);␊ |
475 | extern int inet6_option_init(void *, struct cmsghdr **, int);␊ |
476 | extern int inet6_option_append(struct cmsghdr *, const __uint8_t *,␊ |
477 | ␉int, int);␊ |
478 | extern __uint8_t *inet6_option_alloc(struct cmsghdr *, int, int, int);␊ |
479 | extern int inet6_option_next(const struct cmsghdr *, __uint8_t **);␊ |
480 | extern int inet6_option_find(const struct cmsghdr *, __uint8_t **, int);␊ |
481 | ␊ |
482 | extern size_t inet6_rthdr_space(int, int);␊ |
483 | extern struct cmsghdr *inet6_rthdr_init(void *, int);␊ |
484 | extern int inet6_rthdr_add(struct cmsghdr *, const struct in6_addr *,␊ |
485 | ␉␉unsigned int);␊ |
486 | extern int inet6_rthdr_lasthop(struct cmsghdr *, unsigned int);␊ |
487 | #if 0 /* not implemented yet */␊ |
488 | extern int inet6_rthdr_reverse(const struct cmsghdr *, struct cmsghdr *);␊ |
489 | #endif␊ |
490 | extern int inet6_rthdr_segments(const struct cmsghdr *);␊ |
491 | extern struct in6_addr *inet6_rthdr_getaddr(struct cmsghdr *, int);␊ |
492 | extern int inet6_rthdr_getflags(const struct cmsghdr *, int);␊ |
493 | ␊ |
494 | extern int inet6_opt_init(void *, size_t);␊ |
495 | extern int inet6_opt_append(void *, size_t, int, __uint8_t,␊ |
496 | ␉␉␉␉ size_t, __uint8_t, void **);␊ |
497 | extern int inet6_opt_finish(void *, size_t, int);␊ |
498 | extern int inet6_opt_set_val(void *, size_t, void *, int);␊ |
499 | ␊ |
500 | extern int inet6_opt_next(void *, size_t, int, __uint8_t *,␊ |
501 | ␉␉␉ size_t *, void **);␊ |
502 | extern int inet6_opt_find(void *, size_t, int, __uint8_t,␊ |
503 | ␉␉␉ size_t *, void **);␊ |
504 | extern int inet6_opt_get_val(void *, size_t, void *, int);␊ |
505 | extern size_t inet6_rth_space(int, int);␊ |
506 | extern void *inet6_rth_init(void *, int, int, int);␊ |
507 | extern int inet6_rth_add(void *, const struct in6_addr *);␊ |
508 | extern int inet6_rth_reverse(const void *, void *);␊ |
509 | extern int inet6_rth_segments(const void *);␊ |
510 | extern struct in6_addr *inet6_rth_getaddr(const void *, int);␊ |
511 | __END_DECLS␊ |
512 | #endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */␊ |
513 | #endif /* !_NETINET6_IN6_H_ */␊ |
514 |