]> git.saurik.com Git - apple/xnu.git/blob - bsd/netinet6/in6_proto.c
xnu-1504.3.12.tar.gz
[apple/xnu.git] / bsd / netinet6 / in6_proto.c
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_proto.c,v 1.19 2002/10/16 02:25:05 sam Exp $ */
30 /* $KAME: in6_proto.c,v 1.91 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, 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_proto.c 8.1 (Berkeley) 6/10/93
94 */
95
96
97 #include <sys/param.h>
98 #include <sys/socket.h>
99 #include <sys/socketvar.h>
100 #include <sys/protosw.h>
101 #include <sys/kernel.h>
102 #include <sys/domain.h>
103 #include <sys/mbuf.h>
104 #include <sys/systm.h>
105 #include <sys/sysctl.h>
106
107 #include <net/if.h>
108 #include <net/radix.h>
109 #include <net/route.h>
110
111 #include <netinet/in.h>
112 #include <netinet/in_systm.h>
113 #include <netinet/in_var.h>
114 #include <netinet/ip_encap.h>
115 #include <netinet/ip.h>
116 #include <netinet/ip_var.h>
117 #include <netinet/ip6.h>
118 #include <netinet6/ip6_var.h>
119 #include <netinet/icmp6.h>
120
121 #include <netinet/tcp.h>
122 #include <netinet/tcp_timer.h>
123 #include <netinet/tcp_var.h>
124 #include <netinet/udp.h>
125 #include <netinet/udp_var.h>
126 #include <netinet6/tcp6_var.h>
127 #include <netinet6/raw_ip6.h>
128 #include <netinet6/udp6_var.h>
129 #include <netinet6/pim6_var.h>
130 #include <netinet6/nd6.h>
131 #include <netinet6/in6_prefix.h>
132
133 #include <netinet6/ip6_mroute.h>
134
135 #if IPSEC
136 #include <netinet6/ipsec.h>
137 #if INET6
138 #include <netinet6/ipsec6.h>
139 #endif
140 #include <netinet6/ah.h>
141 #if INET6
142 #include <netinet6/ah6.h>
143 #endif
144 #if IPSEC_ESP
145 #include <netinet6/esp.h>
146 #if INET6
147 #include <netinet6/esp6.h>
148 #endif
149 #endif
150 #include <netinet6/ipcomp.h>
151 #if INET6
152 #include <netinet6/ipcomp6.h>
153 #endif
154 #endif /*IPSEC*/
155
156 #include <netinet6/ip6protosw.h>
157
158 #include <net/net_osdep.h>
159
160 /*
161 * TCP/IP protocol family: IP6, ICMP6, UDP, TCP.
162 */
163
164 extern struct domain inet6domain;
165 static struct pr_usrreqs nousrreqs;
166 lck_mtx_t *inet6_domain_mutex;
167
168 #define PR_LISTEN 0
169 #define PR_ABRTACPTDIS 0
170
171 extern int in6_inithead(void **, int);
172 void in6_dinit(void) __attribute__((section("__TEXT, initcode")));
173
174 static int rip6_pr_output(struct mbuf *m, struct socket *so, struct sockaddr_in6 *, struct mbuf *);
175
176 struct ip6protosw inet6sw[] = {
177 { 0, &inet6domain, IPPROTO_IPV6, 0,
178 0, 0, 0, 0,
179 0,
180 ip6_init, 0, frag6_slowtimo, frag6_drain,
181 0,
182 &nousrreqs,
183 0, 0, 0,
184 { 0, 0 }, NULL, { 0 }
185 },
186 { SOCK_DGRAM, &inet6domain, IPPROTO_UDP, PR_ATOMIC|PR_ADDR|PR_PROTOLOCK|PR_PCBLOCK,
187 udp6_input, 0, udp6_ctlinput, ip6_ctloutput,
188 0,
189 0, 0, 0, 0,
190 0,
191 &udp6_usrreqs,
192 udp_lock, udp_unlock, udp_getlock,
193 { 0, 0 }, NULL, { 0 }
194 },
195 { SOCK_STREAM, &inet6domain, IPPROTO_TCP, PR_CONNREQUIRED|PR_WANTRCVD|PR_LISTEN|PR_PROTOLOCK|PR_PCBLOCK|PR_DISPOSE,
196 tcp6_input, 0, tcp6_ctlinput, tcp_ctloutput,
197 0,
198 #if INET /* don't call initialization and timeout routines twice */
199 0, 0, 0, tcp_drain,
200 #else
201 tcp_init, 0, tcp_slowtimo, tcp_drain,
202 #endif
203 0,
204 &tcp6_usrreqs,
205 tcp_lock, tcp_unlock, tcp_getlock,
206 { 0, 0 }, NULL, { 0 }
207 },
208 { SOCK_RAW, &inet6domain, IPPROTO_RAW, PR_ATOMIC|PR_ADDR,
209 rip6_input, rip6_pr_output, rip6_ctlinput, rip6_ctloutput,
210 0,
211 0, 0, 0, 0,
212 0,
213 &rip6_usrreqs,
214 0, rip_unlock, 0,
215 { 0, 0 }, NULL, { 0 }
216 },
217 { SOCK_RAW, &inet6domain, IPPROTO_ICMPV6, PR_ATOMIC|PR_ADDR|PR_LASTHDR,
218 icmp6_input, rip6_pr_output, rip6_ctlinput, rip6_ctloutput,
219 0,
220 icmp6_init, icmp6_fasttimo, 0, 0,
221 0,
222 &rip6_usrreqs,
223 0, rip_unlock, 0,
224 { 0, 0 }, NULL, { 0 }
225 },
226 { SOCK_DGRAM, &inet6domain, IPPROTO_ICMPV6, PR_ATOMIC|PR_ADDR|PR_LASTHDR,
227 icmp6_input, rip6_pr_output, rip6_ctlinput, icmp6_dgram_ctloutput,
228 0,
229 icmp6_init, icmp6_fasttimo, 0, 0,
230 0,
231 &icmp6_dgram_usrreqs,
232 0, rip_unlock, 0,
233 { 0, 0 }, NULL, { 0 }
234 },
235 { SOCK_RAW, &inet6domain, IPPROTO_DSTOPTS,PR_ATOMIC|PR_ADDR,
236 dest6_input, 0, 0, 0,
237 0,
238 0, 0, 0, 0,
239 0,
240 &nousrreqs,
241 0, 0, 0,
242 { 0, 0 }, NULL, { 0 }
243 },
244 { SOCK_RAW, &inet6domain, IPPROTO_ROUTING,PR_ATOMIC|PR_ADDR,
245 route6_input, 0, 0, 0,
246 0,
247 0, 0, 0, 0,
248 0,
249 &nousrreqs,
250 0, 0, 0,
251 { 0, 0 }, NULL, { 0 }
252 },
253 { SOCK_RAW, &inet6domain, IPPROTO_FRAGMENT,PR_ATOMIC|PR_ADDR,
254 frag6_input, 0, 0, 0,
255 0,
256 0, 0, 0, 0,
257 0,
258 &nousrreqs,
259 0, 0, 0,
260 { 0, 0 }, NULL, { 0 }
261 },
262 #if IPSEC
263 { SOCK_RAW, &inet6domain, IPPROTO_AH, PR_ATOMIC|PR_ADDR|PR_PROTOLOCK,
264 ah6_input, 0, 0, 0,
265 0,
266 0, 0, 0, 0,
267 0,
268 &nousrreqs,
269 0, 0, 0,
270 { 0, 0 }, NULL, { 0 }
271 },
272 #if IPSEC_ESP
273 { SOCK_RAW, &inet6domain, IPPROTO_ESP, PR_ATOMIC|PR_ADDR|PR_PROTOLOCK,
274 esp6_input, 0,
275 esp6_ctlinput,
276 0,
277 0,
278 0, 0, 0, 0,
279 0,
280 &nousrreqs,
281 0, 0, 0,
282 { 0, 0 }, NULL, { 0 }
283 },
284 #endif
285 { SOCK_RAW, &inet6domain, IPPROTO_IPCOMP, PR_ATOMIC|PR_ADDR|PR_PROTOLOCK,
286 ipcomp6_input, 0, 0, 0,
287 0,
288 0, 0, 0, 0,
289 0,
290 &nousrreqs,
291 0, 0, 0,
292 { 0, 0 }, NULL, { 0 }
293 },
294 #endif /* IPSEC */
295 #if INET
296 { SOCK_RAW, &inet6domain, IPPROTO_IPV4, PR_ATOMIC|PR_ADDR|PR_LASTHDR,
297 encap6_input, rip6_pr_output, 0, rip6_ctloutput,
298 0,
299 encap_init, 0, 0, 0,
300 0,
301 &rip6_usrreqs,
302 0, rip_unlock, 0,
303 { 0, 0 }, NULL, { 0 }
304 },
305 #endif /*INET*/
306 { SOCK_RAW, &inet6domain, IPPROTO_IPV6, PR_ATOMIC|PR_ADDR|PR_LASTHDR,
307 encap6_input, rip6_pr_output, 0, rip6_ctloutput,
308 0,
309 encap_init, 0, 0, 0,
310 0,
311 &rip6_usrreqs,
312 0, rip_unlock, 0,
313 { 0, 0 }, NULL, { 0 }
314 },
315 #if MROUTING
316 { SOCK_RAW, &inet6domain, IPPROTO_PIM, PR_ATOMIC|PR_ADDR|PR_LASTHDR,
317 pim6_input, rip6_pr_output, 0, rip6_ctloutput,
318 0,
319 0, 0, 0, 0,
320 0,
321 &rip6_usrreqs,
322 0, rip_unlock, 0,
323 { 0, 0 }, NULL, { 0 }
324 },
325 #else
326 { SOCK_RAW, &inet6domain, IPPROTO_PIM, PR_ATOMIC|PR_ADDR|PR_LASTHDR,
327 0, 0, 0, rip6_ctloutput,
328 0,
329 0, 0, 0, 0,
330 0,
331 &rip6_usrreqs,
332 0, rip_unlock, 0,
333 { 0, 0 }, NULL, { 0 }
334 },
335 #endif
336 /* raw wildcard */
337 { SOCK_RAW, &inet6domain, 0, PR_ATOMIC|PR_ADDR|PR_LASTHDR,
338 rip6_input, rip6_pr_output, 0, rip6_ctloutput,
339 0,
340 0, 0, 0, 0,
341 0,
342 &rip6_usrreqs,
343 0, rip_unlock, 0,
344 { 0, 0 }, NULL, { 0 }
345 },
346 };
347
348
349 int in6_proto_count = (sizeof (inet6sw) / sizeof (struct ip6protosw));
350
351 struct domain inet6domain =
352 { AF_INET6, "internet6", in6_dinit, 0, 0,
353 (struct protosw *)inet6sw, 0,
354 in6_inithead, offsetof(struct sockaddr_in6, sin6_addr) << 3, sizeof(struct sockaddr_in6) ,
355 sizeof(struct sockaddr_in6), 0,
356 NULL, 0, {0,0}
357 };
358
359 DOMAIN_SET(inet6);
360
361 /* Initialize the PF_INET6 domain, and add in the pre-defined protos */
362 void
363 in6_dinit(void)
364 {
365 register int i;
366 register struct ip6protosw *pr;
367 register struct domain *dp;
368 static int inet6domain_initted = 0;
369
370 if (!inet6domain_initted) {
371 dp = &inet6domain;
372
373 for (i=0, pr = &inet6sw[0]; i<in6_proto_count; i++, pr++)
374 net_add_proto((struct protosw*)pr, dp);
375
376 inet6_domain_mutex = dp->dom_mtx;
377 inet6domain_initted = 1;
378 }
379 }
380
381 int rip6_pr_output(__unused struct mbuf *m, __unused struct socket *so,
382 __unused struct sockaddr_in6 *sin6, __unused struct mbuf *m1)
383 {
384 panic("rip6_pr_output\n");
385 return 0;
386 }
387
388 /*
389 * Internet configuration info
390 */
391 #ifndef IPV6FORWARDING
392 #if GATEWAY6
393 #define IPV6FORWARDING 1 /* forward IP6 packets not for us */
394 #else
395 #define IPV6FORWARDING 0 /* don't forward IP6 packets not for us */
396 #endif /* GATEWAY6 */
397 #endif /* !IPV6FORWARDING */
398
399 #ifndef IPV6_SENDREDIRECTS
400 #define IPV6_SENDREDIRECTS 1
401 #endif
402
403 int ip6_forwarding = IPV6FORWARDING; /* act as router? */
404 int ip6_sendredirects = IPV6_SENDREDIRECTS;
405 int ip6_defhlim = IPV6_DEFHLIM;
406 int ip6_defmcasthlim = IPV6_DEFAULT_MULTICAST_HOPS;
407 int ip6_accept_rtadv = 0; /* "IPV6FORWARDING ? 0 : 1" is dangerous */
408 int ip6_maxfragpackets; /* initialized in frag6.c:frag6_init() */
409 int ip6_maxfrags;
410 int ip6_log_interval = 5;
411 int ip6_hdrnestlimit = 50; /* appropriate? */
412 int ip6_dad_count = 1; /* DupAddrDetectionTransmits */
413 u_int32_t ip6_flow_seq;
414 int ip6_auto_flowlabel = 1;
415 int ip6_gif_hlim = 0;
416 int ip6_use_deprecated = 1; /* allow deprecated addr (RFC2462 5.5.4) */
417 int ip6_rr_prune = 5; /* router renumbering prefix
418 * walk list every 5 sec. */
419 int ip6_v6only = 0; /* Mapped addresses on by default - Radar 3347718 */
420
421 int ip6_neighborgcthresh = 1024; /* Threshold # of NDP entries for GC */
422 int ip6_maxifprefixes = 16; /* Max acceptable prefixes via RA per IF */
423 int ip6_maxifdefrouters = 16; /* Max acceptable def routers via RA */
424 int ip6_maxdynroutes = 1024; /* Max # of routes created via redirect */
425
426 u_int32_t ip6_id = 0UL;
427 int ip6_keepfaith = 0;
428 time_t ip6_log_time = (time_t)0L;
429
430 /* icmp6 */
431 /*
432 * BSDI4 defines these variables in in_proto.c...
433 * XXX: what if we don't define INET? Should we define pmtu6_expire
434 * or so? (jinmei@kame.net 19990310)
435 */
436 int pmtu_expire = 60*10;
437 int pmtu_probe = 60*2;
438
439 /* raw IP6 parameters */
440 /*
441 * Nominal space allocated to a raw ip socket.
442 */
443 #define RIPV6SNDQ 8192
444 #define RIPV6RCVQ 8192
445
446 u_int32_t rip6_sendspace = RIPV6SNDQ;
447 u_int32_t rip6_recvspace = RIPV6RCVQ;
448
449 /* ICMPV6 parameters */
450 int icmp6_rediraccept = 1; /* accept and process redirects */
451 int icmp6_redirtimeout = 10 * 60; /* 10 minutes */
452 int icmp6errppslim = 500; /* 500 packets per second */
453 int icmp6_nodeinfo = 3; /* enable/disable NI response */
454
455 /* UDP on IP6 parameters */
456 int udp6_sendspace = 9216; /* really max datagram size */
457 int udp6_recvspace = 40 * (1024 + sizeof(struct sockaddr_in6));
458 /* 40 1K datagrams */
459
460 /*
461 * sysctl related items.
462 */
463 SYSCTL_NODE(_net, PF_INET6, inet6, CTLFLAG_RW, 0,
464 "Internet6 Family");
465
466 /* net.inet6 */
467 SYSCTL_NODE(_net_inet6, IPPROTO_IPV6, ip6, CTLFLAG_RW|CTLFLAG_LOCKED, 0, "IP6");
468 SYSCTL_NODE(_net_inet6, IPPROTO_ICMPV6, icmp6, CTLFLAG_RW|CTLFLAG_LOCKED, 0, "ICMP6");
469 SYSCTL_NODE(_net_inet6, IPPROTO_UDP, udp6, CTLFLAG_RW|CTLFLAG_LOCKED, 0, "UDP6");
470 SYSCTL_NODE(_net_inet6, IPPROTO_TCP, tcp6, CTLFLAG_RW|CTLFLAG_LOCKED, 0, "TCP6");
471 #if IPSEC
472 SYSCTL_NODE(_net_inet6, IPPROTO_ESP, ipsec6, CTLFLAG_RW|CTLFLAG_LOCKED, 0, "IPSEC6");
473 #endif /* IPSEC */
474
475 /* net.inet6.ip6 */
476 static int
477 sysctl_ip6_temppltime SYSCTL_HANDLER_ARGS
478 {
479 #pragma unused(oidp, arg2)
480 int error = 0;
481 int old;
482
483 error = SYSCTL_OUT(req, arg1, sizeof(int));
484 if (error || !req->newptr)
485 return (error);
486 old = ip6_temp_preferred_lifetime;
487 error = SYSCTL_IN(req, arg1, sizeof(int));
488 if (ip6_temp_preferred_lifetime <
489 ip6_desync_factor + ip6_temp_regen_advance) {
490 ip6_temp_preferred_lifetime = old;
491 return(EINVAL);
492 }
493 return(error);
494 }
495
496 static int
497 sysctl_ip6_tempvltime SYSCTL_HANDLER_ARGS
498 {
499 #pragma unused(oidp, arg2)
500 int error = 0;
501 int old;
502
503 error = SYSCTL_OUT(req, arg1, sizeof(int));
504 if (error || !req->newptr)
505 return (error);
506 old = ip6_temp_valid_lifetime;
507 error = SYSCTL_IN(req, arg1, sizeof(int));
508 if (ip6_temp_valid_lifetime < ip6_temp_preferred_lifetime) {
509 ip6_temp_preferred_lifetime = old;
510 return(EINVAL);
511 }
512 return(error);
513 }
514
515 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_FORWARDING,
516 forwarding, CTLFLAG_RW, &ip6_forwarding, 0, "");
517 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_SENDREDIRECTS,
518 redirect, CTLFLAG_RW, &ip6_sendredirects, 0, "");
519 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_DEFHLIM,
520 hlim, CTLFLAG_RW, &ip6_defhlim, 0, "");
521 SYSCTL_STRUCT(_net_inet6_ip6, IPV6CTL_STATS, stats, CTLFLAG_RD,
522 &ip6stat, ip6stat, "");
523 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MAXFRAGPACKETS,
524 maxfragpackets, CTLFLAG_RW, &ip6_maxfragpackets, 0, "");
525 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MAXFRAGS,
526 maxfrags, CTLFLAG_RW, &ip6_maxfrags, 0, "");
527 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_ACCEPT_RTADV,
528 accept_rtadv, CTLFLAG_RW, &ip6_accept_rtadv, 0, "");
529 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_KEEPFAITH,
530 keepfaith, CTLFLAG_RW, &ip6_keepfaith, 0, "");
531 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_LOG_INTERVAL,
532 log_interval, CTLFLAG_RW, &ip6_log_interval, 0, "");
533 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_HDRNESTLIMIT,
534 hdrnestlimit, CTLFLAG_RW, &ip6_hdrnestlimit, 0, "");
535 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_DAD_COUNT,
536 dad_count, CTLFLAG_RW, &ip6_dad_count, 0, "");
537 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_AUTO_FLOWLABEL,
538 auto_flowlabel, CTLFLAG_RW, &ip6_auto_flowlabel, 0, "");
539 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_DEFMCASTHLIM,
540 defmcasthlim, CTLFLAG_RW, &ip6_defmcasthlim, 0, "");
541 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_GIF_HLIM,
542 gifhlim, CTLFLAG_RW, &ip6_gif_hlim, 0, "");
543 SYSCTL_STRING(_net_inet6_ip6, IPV6CTL_KAME_VERSION,
544 kame_version, CTLFLAG_RD, (void *)((uintptr_t)(__KAME_VERSION)), 0, "");
545 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_USE_DEPRECATED,
546 use_deprecated, CTLFLAG_RW, &ip6_use_deprecated, 0, "");
547 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_RR_PRUNE,
548 rr_prune, CTLFLAG_RW, &ip6_rr_prune, 0, "");
549 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_USETEMPADDR,
550 use_tempaddr, CTLFLAG_RW, &ip6_use_tempaddr, 0, "");
551 SYSCTL_OID(_net_inet6_ip6, IPV6CTL_TEMPPLTIME, temppltime,
552 CTLTYPE_INT|CTLFLAG_RW, &ip6_temp_preferred_lifetime, 0,
553 sysctl_ip6_temppltime, "I", "");
554 SYSCTL_OID(_net_inet6_ip6, IPV6CTL_TEMPVLTIME, tempvltime,
555 CTLTYPE_INT|CTLFLAG_RW, &ip6_temp_valid_lifetime, 0,
556 sysctl_ip6_tempvltime, "I", "");
557 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_V6ONLY,
558 v6only, CTLFLAG_RW, &ip6_v6only, 0, "");
559 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_AUTO_LINKLOCAL,
560 auto_linklocal, CTLFLAG_RW, &ip6_auto_linklocal, 0, "");
561 SYSCTL_STRUCT(_net_inet6_ip6, IPV6CTL_RIP6STATS, rip6stats, CTLFLAG_RD,
562 &rip6stat, rip6stat, "");
563 #if MROUTING
564 SYSCTL_STRUCT(_net_inet6_ip6, OID_AUTO, mrt6stat, CTLFLAG_RD,
565 &mrt6stat, mrt6stat, "");
566 #endif
567 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_NEIGHBORGCTHRESH,
568 neighborgcthresh, CTLFLAG_RW, &ip6_neighborgcthresh, 0, "");
569 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MAXIFPREFIXES,
570 maxifprefixes, CTLFLAG_RW, &ip6_maxifprefixes, 0, "");
571 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MAXIFDEFROUTERS,
572 maxifdefrouters, CTLFLAG_RW, &ip6_maxifdefrouters, 0, "");
573 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MAXDYNROUTES,
574 maxdynroutes, CTLFLAG_RW, &ip6_maxdynroutes, 0, "");
575
576
577 /* net.inet6.icmp6 */
578 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_REDIRACCEPT,
579 rediraccept, CTLFLAG_RW, &icmp6_rediraccept, 0, "");
580 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_REDIRTIMEOUT,
581 redirtimeout, CTLFLAG_RW, &icmp6_redirtimeout, 0, "");
582 SYSCTL_STRUCT(_net_inet6_icmp6, ICMPV6CTL_STATS, stats, CTLFLAG_RD,
583 &icmp6stat, icmp6stat, "");
584 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_PRUNE,
585 nd6_prune, CTLFLAG_RW, &nd6_prune, 0, "");
586 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_DELAY,
587 nd6_delay, CTLFLAG_RW, &nd6_delay, 0, "");
588 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_UMAXTRIES,
589 nd6_umaxtries, CTLFLAG_RW, &nd6_umaxtries, 0, "");
590 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_MMAXTRIES,
591 nd6_mmaxtries, CTLFLAG_RW, &nd6_mmaxtries, 0, "");
592 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_USELOOPBACK,
593 nd6_useloopback, CTLFLAG_RW, &nd6_useloopback, 0, "");
594 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_NODEINFO,
595 nodeinfo, CTLFLAG_RW, &icmp6_nodeinfo, 0, "");
596 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ERRPPSLIMIT,
597 errppslimit, CTLFLAG_RW, &icmp6errppslim, 0, "");
598 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_MAXNUDHINT,
599 nd6_maxnudhint, CTLFLAG_RW, &nd6_maxnudhint, 0, "");
600 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_DEBUG,
601 nd6_debug, CTLFLAG_RW, &nd6_debug, 0, "");
602