in6_proto.c (202469) | in6_proto.c (207369) |
---|---|
1/*- 2 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 47 unchanged lines hidden (view full) --- 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 * @(#)in_proto.c 8.1 (Berkeley) 6/10/93 61 */ 62 63#include <sys/cdefs.h> | 1/*- 2 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 47 unchanged lines hidden (view full) --- 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 * @(#)in_proto.c 8.1 (Berkeley) 6/10/93 61 */ 62 63#include <sys/cdefs.h> |
64__FBSDID("$FreeBSD: head/sys/netinet6/in6_proto.c 202469 2010-01-17 13:07:52Z bz $"); | 64__FBSDID("$FreeBSD: head/sys/netinet6/in6_proto.c 207369 2010-04-29 11:52:42Z bz $"); |
65 66#include "opt_inet.h" 67#include "opt_inet6.h" 68#include "opt_ipsec.h" 69#include "opt_ipstealth.h" 70#include "opt_carp.h" 71#include "opt_sctp.h" 72#include "opt_mpath.h" --- 156 unchanged lines hidden (view full) --- 229 .pr_type = SOCK_RAW, 230 .pr_domain = &inet6domain, 231 .pr_protocol = IPPROTO_ICMPV6, 232 .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, 233 .pr_input = icmp6_input, 234 .pr_output = rip6_output, 235 .pr_ctlinput = rip6_ctlinput, 236 .pr_ctloutput = rip6_ctloutput, | 65 66#include "opt_inet.h" 67#include "opt_inet6.h" 68#include "opt_ipsec.h" 69#include "opt_ipstealth.h" 70#include "opt_carp.h" 71#include "opt_sctp.h" 72#include "opt_mpath.h" --- 156 unchanged lines hidden (view full) --- 229 .pr_type = SOCK_RAW, 230 .pr_domain = &inet6domain, 231 .pr_protocol = IPPROTO_ICMPV6, 232 .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, 233 .pr_input = icmp6_input, 234 .pr_output = rip6_output, 235 .pr_ctlinput = rip6_ctlinput, 236 .pr_ctloutput = rip6_ctloutput, |
237 .pr_init = icmp6_init, | |
238 .pr_fasttimo = icmp6_fasttimo, 239 .pr_slowtimo = icmp6_slowtimo, 240 .pr_usrreqs = &rip6_usrreqs 241}, 242{ 243 .pr_type = SOCK_RAW, 244 .pr_domain = &inet6domain, 245 .pr_protocol = IPPROTO_DSTOPTS, --- 127 unchanged lines hidden (view full) --- 373 .dom_ifdetach = in6_domifdetach 374}; 375 376VNET_DOMAIN_SET(inet6); 377 378/* 379 * Internet configuration info 380 */ | 237 .pr_fasttimo = icmp6_fasttimo, 238 .pr_slowtimo = icmp6_slowtimo, 239 .pr_usrreqs = &rip6_usrreqs 240}, 241{ 242 .pr_type = SOCK_RAW, 243 .pr_domain = &inet6domain, 244 .pr_protocol = IPPROTO_DSTOPTS, --- 127 unchanged lines hidden (view full) --- 372 .dom_ifdetach = in6_domifdetach 373}; 374 375VNET_DOMAIN_SET(inet6); 376 377/* 378 * Internet configuration info 379 */ |
381VNET_DEFINE(int, ip6_forwarding); 382VNET_DEFINE(int, ip6_sendredirects); 383VNET_DEFINE(int, ip6_defhlim); 384VNET_DEFINE(int, ip6_defmcasthlim); 385VNET_DEFINE(int, ip6_accept_rtadv); 386VNET_DEFINE(int, ip6_maxfragpackets); 387VNET_DEFINE(int, ip6_maxfrags); 388VNET_DEFINE(int, ip6_log_interval); 389VNET_DEFINE(int, ip6_hdrnestlimit); 390VNET_DEFINE(int, ip6_dad_count); 391VNET_DEFINE(int, ip6_auto_flowlabel); 392VNET_DEFINE(int, ip6_use_deprecated); 393VNET_DEFINE(int, ip6_rr_prune); 394VNET_DEFINE(int, ip6_mcast_pmtu); 395VNET_DEFINE(int, ip6_v6only); 396VNET_DEFINE(int, ip6_keepfaith); 397VNET_DEFINE(time_t, ip6_log_time); 398VNET_DEFINE(int, ip6stealth); 399VNET_DEFINE(int, nd6_onlink_ns_rfc4861); | 380#ifndef IPV6FORWARDING 381#ifdef GATEWAY6 382#define IPV6FORWARDING 1 /* forward IP6 packets not for us */ 383#else 384#define IPV6FORWARDING 0 /* don't forward IP6 packets not for us */ 385#endif /* GATEWAY6 */ 386#endif /* !IPV6FORWARDING */ |
400 | 387 |
388#ifndef IPV6_SENDREDIRECTS 389#define IPV6_SENDREDIRECTS 1 390#endif 391 392VNET_DEFINE(int, ip6_forwarding) = IPV6FORWARDING; /* act as router? */ 393VNET_DEFINE(int, ip6_sendredirects) = IPV6_SENDREDIRECTS; 394VNET_DEFINE(int, ip6_defhlim) = IPV6_DEFHLIM; 395VNET_DEFINE(int, ip6_defmcasthlim) = IPV6_DEFAULT_MULTICAST_HOPS; 396VNET_DEFINE(int, ip6_accept_rtadv) = 0; 397VNET_DEFINE(int, ip6_maxfragpackets); /* initialized in frag6.c:frag6_init() */ 398VNET_DEFINE(int, ip6_maxfrags); /* initialized in frag6.c:frag6_init() */ 399VNET_DEFINE(int, ip6_log_interval) = 5; 400VNET_DEFINE(int, ip6_hdrnestlimit) = 15;/* How many header options will we 401 * process? */ 402VNET_DEFINE(int, ip6_dad_count) = 1; /* DupAddrDetectionTransmits */ 403VNET_DEFINE(int, ip6_auto_flowlabel) = 1; 404VNET_DEFINE(int, ip6_use_deprecated) = 1;/* allow deprecated addr 405 * (RFC2462 5.5.4) */ 406VNET_DEFINE(int, ip6_rr_prune) = 5; /* router renumbering prefix 407 * walk list every 5 sec. */ 408VNET_DEFINE(int, ip6_mcast_pmtu) = 0; /* enable pMTU discovery for multicast? */ 409VNET_DEFINE(int, ip6_v6only) = 1; 410 411VNET_DEFINE(int, ip6_keepfaith) = 0; 412VNET_DEFINE(time_t, ip6_log_time) = (time_t)0L; 413#ifdef IPSTEALTH 414VNET_DEFINE(int, ip6stealth) = 0; 415#endif 416VNET_DEFINE(int, nd6_onlink_ns_rfc4861) = 0;/* allow 'on-link' nd6 NS 417 * (RFC 4861) */ 418 |
|
401/* icmp6 */ 402/* 403 * BSDI4 defines these variables in in_proto.c... 404 * XXX: what if we don't define INET? Should we define pmtu6_expire 405 * or so? (jinmei@kame.net 19990310) 406 */ | 419/* icmp6 */ 420/* 421 * BSDI4 defines these variables in in_proto.c... 422 * XXX: what if we don't define INET? Should we define pmtu6_expire 423 * or so? (jinmei@kame.net 19990310) 424 */ |
407VNET_DEFINE(int, pmtu_expire); 408VNET_DEFINE(int, pmtu_probe); | 425VNET_DEFINE(int, pmtu_expire) = 60*10; 426VNET_DEFINE(int, pmtu_probe) = 60*2; |
409 410/* raw IP6 parameters */ 411/* 412 * Nominal space allocated to a raw ip socket. 413 */ | 427 428/* raw IP6 parameters */ 429/* 430 * Nominal space allocated to a raw ip socket. 431 */ |
414VNET_DEFINE(u_long, rip6_sendspace); 415VNET_DEFINE(u_long, rip6_recvspace); | 432#define RIPV6SNDQ 8192 433#define RIPV6RCVQ 8192 |
416 | 434 |
435VNET_DEFINE(u_long, rip6_sendspace) = RIPV6SNDQ; 436VNET_DEFINE(u_long, rip6_recvspace) = RIPV6RCVQ; 437 |
|
417/* ICMPV6 parameters */ | 438/* ICMPV6 parameters */ |
418VNET_DEFINE(int, icmp6_rediraccept); 419VNET_DEFINE(int, icmp6_redirtimeout); 420VNET_DEFINE(int, icmp6errppslim); | 439VNET_DEFINE(int, icmp6_rediraccept) = 1;/* accept and process redirects */ 440VNET_DEFINE(int, icmp6_redirtimeout) = 10 * 60; /* 10 minutes */ 441VNET_DEFINE(int, icmp6errppslim) = 100; /* 100pps */ |
421/* control how to respond to NI queries */ | 442/* control how to respond to NI queries */ |
422VNET_DEFINE(int, icmp6_nodeinfo); | 443VNET_DEFINE(int, icmp6_nodeinfo) = 444 (ICMP6_NODEINFO_FQDNOK|ICMP6_NODEINFO_NODEADDROK); |
423 424/* UDP on IP6 parameters */ | 445 446/* UDP on IP6 parameters */ |
425VNET_DEFINE(int, udp6_sendspace); 426VNET_DEFINE(int, udp6_recvspace); | 447VNET_DEFINE(int, udp6_sendspace) = 9216;/* really max datagram size */ 448VNET_DEFINE(int, udp6_recvspace) = 40 * (1024 + sizeof(struct sockaddr_in6)); 449 /* 40 1K datagrams */ |
427 428/* 429 * sysctl related items. 430 */ 431SYSCTL_NODE(_net, PF_INET6, inet6, CTLFLAG_RW, 0, 432 "Internet6 Family"); 433 434/* net.inet6 */ --- 131 unchanged lines hidden (view full) --- 566SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_NODEINFO, nodeinfo, CTLFLAG_RW, 567 &VNET_NAME(icmp6_nodeinfo), 0, ""); 568SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_ERRPPSLIMIT, errppslimit, 569 CTLFLAG_RW, &VNET_NAME(icmp6errppslim), 0, ""); 570SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_MAXNUDHINT, nd6_maxnudhint, 571 CTLFLAG_RW, &VNET_NAME(nd6_maxnudhint), 0, ""); 572SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_DEBUG, nd6_debug, CTLFLAG_RW, 573 &VNET_NAME(nd6_debug), 0, ""); | 450 451/* 452 * sysctl related items. 453 */ 454SYSCTL_NODE(_net, PF_INET6, inet6, CTLFLAG_RW, 0, 455 "Internet6 Family"); 456 457/* net.inet6 */ --- 131 unchanged lines hidden (view full) --- 589SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_NODEINFO, nodeinfo, CTLFLAG_RW, 590 &VNET_NAME(icmp6_nodeinfo), 0, ""); 591SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_ERRPPSLIMIT, errppslimit, 592 CTLFLAG_RW, &VNET_NAME(icmp6errppslim), 0, ""); 593SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_MAXNUDHINT, nd6_maxnudhint, 594 CTLFLAG_RW, &VNET_NAME(nd6_maxnudhint), 0, ""); 595SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_DEBUG, nd6_debug, CTLFLAG_RW, 596 &VNET_NAME(nd6_debug), 0, ""); |
574 | |
575SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_ONLINKNSRFC4861, 576 nd6_onlink_ns_rfc4861, CTLFLAG_RW, &VNET_NAME(nd6_onlink_ns_rfc4861), 577 0, "Accept 'on-link' nd6 NS in compliance with RFC 4861."); | 597SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_ONLINKNSRFC4861, 598 nd6_onlink_ns_rfc4861, CTLFLAG_RW, &VNET_NAME(nd6_onlink_ns_rfc4861), 599 0, "Accept 'on-link' nd6 NS in compliance with RFC 4861."); |