1c398230bSWarner Losh /*- 2df8bae1dSRodney W. Grimes * Copyright (c) 1982, 1986, 1993 3df8bae1dSRodney W. Grimes * The Regents of the University of California. All rights reserved. 4df8bae1dSRodney W. Grimes * 5df8bae1dSRodney W. Grimes * Redistribution and use in source and binary forms, with or without 6df8bae1dSRodney W. Grimes * modification, are permitted provided that the following conditions 7df8bae1dSRodney W. Grimes * are met: 8df8bae1dSRodney W. Grimes * 1. Redistributions of source code must retain the above copyright 9df8bae1dSRodney W. Grimes * notice, this list of conditions and the following disclaimer. 10df8bae1dSRodney W. Grimes * 2. Redistributions in binary form must reproduce the above copyright 11df8bae1dSRodney W. Grimes * notice, this list of conditions and the following disclaimer in the 12df8bae1dSRodney W. Grimes * documentation and/or other materials provided with the distribution. 13df8bae1dSRodney W. Grimes * 4. Neither the name of the University nor the names of its contributors 14df8bae1dSRodney W. Grimes * may be used to endorse or promote products derived from this software 15df8bae1dSRodney W. Grimes * without specific prior written permission. 16df8bae1dSRodney W. Grimes * 17df8bae1dSRodney W. Grimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 18df8bae1dSRodney W. Grimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19df8bae1dSRodney W. Grimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20df8bae1dSRodney W. Grimes * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 21df8bae1dSRodney W. Grimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22df8bae1dSRodney W. Grimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23df8bae1dSRodney W. Grimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24df8bae1dSRodney W. Grimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25df8bae1dSRodney W. Grimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26df8bae1dSRodney W. Grimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27df8bae1dSRodney W. Grimes * SUCH DAMAGE. 28df8bae1dSRodney W. Grimes * 29425f123eSGarrett Wollman * @(#)in_proto.c 8.2 (Berkeley) 2/9/95 30df8bae1dSRodney W. Grimes */ 31df8bae1dSRodney W. Grimes 324b421e2dSMike Silbersack #include <sys/cdefs.h> 334b421e2dSMike Silbersack __FBSDID("$FreeBSD$"); 344b421e2dSMike Silbersack 35430df5f4SEivind Eklund #include "opt_ipx.h" 361e78ac21SJeffrey Hsu #include "opt_mrouting.h" 376a800098SYoshinobu Inoue #include "opt_ipsec.h" 38336d023bSBjoern A. Zeeb #include "opt_inet.h" 396a800098SYoshinobu Inoue #include "opt_inet6.h" 407c1fe953SMax Laier #include "opt_pf.h" 41f8829a4aSRandall Stewart #include "opt_sctp.h" 42e440aed9SQing Li #include "opt_mpath.h" 43fbd1372aSJoerg Wunsch 44df8bae1dSRodney W. Grimes #include <sys/param.h> 45340c35deSJonathan Lemon #include <sys/systm.h> 46748e0b0aSGarrett Wollman #include <sys/kernel.h> 47df8bae1dSRodney W. Grimes #include <sys/socket.h> 48df8bae1dSRodney W. Grimes #include <sys/domain.h> 49385195c0SMarko Zec #include <sys/proc.h> 50dcc3cb75SPoul-Henning Kamp #include <sys/protosw.h> 51ce02431fSDoug Rabson #include <sys/queue.h> 5298163b98SPoul-Henning Kamp #include <sys/sysctl.h> 53df8bae1dSRodney W. Grimes 54336d023bSBjoern A. Zeeb /* 55336d023bSBjoern A. Zeeb * While this file provides the domain and protocol switch tables for IPv4, it 56336d023bSBjoern A. Zeeb * also provides the sysctl node declarations for net.inet.* often shared with 57336d023bSBjoern A. Zeeb * IPv6 for common features or by upper layer protocols. In case of no IPv4 58336d023bSBjoern A. Zeeb * support compile out everything but these sysctl nodes. 59336d023bSBjoern A. Zeeb */ 60336d023bSBjoern A. Zeeb #ifdef INET 61df8bae1dSRodney W. Grimes #include <net/if.h> 62df8bae1dSRodney W. Grimes #include <net/route.h> 63e440aed9SQing Li #ifdef RADIX_MPATH 64e440aed9SQing Li #include <net/radix_mpath.h> 65e440aed9SQing Li #endif 66530c0060SRobert Watson #include <net/vnet.h> 67acaeca65SBjoern A. Zeeb #endif /* INET */ 68df8bae1dSRodney W. Grimes 69acaeca65SBjoern A. Zeeb #if defined(INET) || defined(INET6) 70df8bae1dSRodney W. Grimes #include <netinet/in.h> 71acaeca65SBjoern A. Zeeb #endif 72acaeca65SBjoern A. Zeeb 73acaeca65SBjoern A. Zeeb #ifdef INET 74df8bae1dSRodney W. Grimes #include <netinet/in_systm.h> 756e6b3f7cSQing Li #include <netinet/in_var.h> 76df8bae1dSRodney W. Grimes #include <netinet/ip.h> 77df8bae1dSRodney W. Grimes #include <netinet/ip_var.h> 78df8bae1dSRodney W. Grimes #include <netinet/ip_icmp.h> 79df8bae1dSRodney W. Grimes #include <netinet/igmp_var.h> 80df8bae1dSRodney W. Grimes #include <netinet/tcp.h> 81df8bae1dSRodney W. Grimes #include <netinet/tcp_timer.h> 82df8bae1dSRodney W. Grimes #include <netinet/tcp_var.h> 83df8bae1dSRodney W. Grimes #include <netinet/udp.h> 84df8bae1dSRodney W. Grimes #include <netinet/udp_var.h> 85686cdd19SJun-ichiro itojun Hagino #include <netinet/ip_encap.h> 866a800098SYoshinobu Inoue 87df8bae1dSRodney W. Grimes /* 88df8bae1dSRodney W. Grimes * TCP/IP protocol family: IP, ICMP, UDP, TCP. 89df8bae1dSRodney W. Grimes */ 90df8bae1dSRodney W. Grimes 9131793d59SDavid E. O'Brien static struct pr_usrreqs nousrreqs; 9231793d59SDavid E. O'Brien 93b2630c29SGeorge V. Neville-Neil #ifdef IPSEC 94b9234fafSSam Leffler #include <netipsec/ipsec.h> 95b2630c29SGeorge V. Neville-Neil #endif /* IPSEC */ 96b9234fafSSam Leffler 97f8829a4aSRandall Stewart #ifdef SCTP 98f8829a4aSRandall Stewart #include <netinet/in_pcb.h> 99f8829a4aSRandall Stewart #include <netinet/sctp_pcb.h> 100f8829a4aSRandall Stewart #include <netinet/sctp.h> 101f8829a4aSRandall Stewart #include <netinet/sctp_var.h> 102f8829a4aSRandall Stewart #endif /* SCTP */ 103f8829a4aSRandall Stewart 1047c1fe953SMax Laier #ifdef DEV_PFSYNC 1057c1fe953SMax Laier #include <net/pfvar.h> 1067c1fe953SMax Laier #include <net/if_pfsync.h> 1077c1fe953SMax Laier #endif 1087c1fe953SMax Laier 109*8d5a3ca7SBjoern A. Zeeb FEATURE(inet, "Internet Protocol version 4"); 110*8d5a3ca7SBjoern A. Zeeb 111df8bae1dSRodney W. Grimes extern struct domain inetdomain; 112dff3237eSAndre Oppermann 113dff3237eSAndre Oppermann /* Spacer for loadable protocols. */ 114dff3237eSAndre Oppermann #define IPPROTOSPACER \ 115303989a2SRuslan Ermilov { \ 116303989a2SRuslan Ermilov .pr_domain = &inetdomain, \ 117303989a2SRuslan Ermilov .pr_protocol = PROTO_SPACER, \ 118303989a2SRuslan Ermilov .pr_usrreqs = &nousrreqs \ 119dff3237eSAndre Oppermann } 120df8bae1dSRodney W. Grimes 121f0ffb944SJulian Elischer struct protosw inetsw[] = { 122303989a2SRuslan Ermilov { 123303989a2SRuslan Ermilov .pr_type = 0, 124303989a2SRuslan Ermilov .pr_domain = &inetdomain, 125303989a2SRuslan Ermilov .pr_protocol = IPPROTO_IP, 126303989a2SRuslan Ermilov .pr_init = ip_init, 1279802380eSBjoern A. Zeeb #ifdef VIMAGE 1289802380eSBjoern A. Zeeb .pr_destroy = ip_destroy, 1299802380eSBjoern A. Zeeb #endif 130303989a2SRuslan Ermilov .pr_slowtimo = ip_slowtimo, 131303989a2SRuslan Ermilov .pr_drain = ip_drain, 132303989a2SRuslan Ermilov .pr_usrreqs = &nousrreqs 133df8bae1dSRodney W. Grimes }, 134303989a2SRuslan Ermilov { 135303989a2SRuslan Ermilov .pr_type = SOCK_DGRAM, 136303989a2SRuslan Ermilov .pr_domain = &inetdomain, 137303989a2SRuslan Ermilov .pr_protocol = IPPROTO_UDP, 138303989a2SRuslan Ermilov .pr_flags = PR_ATOMIC|PR_ADDR, 139303989a2SRuslan Ermilov .pr_input = udp_input, 140303989a2SRuslan Ermilov .pr_ctlinput = udp_ctlinput, 1417b495c44SVANHULLEBUS Yvan .pr_ctloutput = udp_ctloutput, 142303989a2SRuslan Ermilov .pr_init = udp_init, 143bc29160dSMarko Zec #ifdef VIMAGE 144bc29160dSMarko Zec .pr_destroy = udp_destroy, 145bc29160dSMarko Zec #endif 146303989a2SRuslan Ermilov .pr_usrreqs = &udp_usrreqs 147df8bae1dSRodney W. Grimes }, 148303989a2SRuslan Ermilov { 149303989a2SRuslan Ermilov .pr_type = SOCK_STREAM, 150303989a2SRuslan Ermilov .pr_domain = &inetdomain, 151303989a2SRuslan Ermilov .pr_protocol = IPPROTO_TCP, 152303989a2SRuslan Ermilov .pr_flags = PR_CONNREQUIRED|PR_IMPLOPCL|PR_WANTRCVD, 153303989a2SRuslan Ermilov .pr_input = tcp_input, 154303989a2SRuslan Ermilov .pr_ctlinput = tcp_ctlinput, 155303989a2SRuslan Ermilov .pr_ctloutput = tcp_ctloutput, 156303989a2SRuslan Ermilov .pr_init = tcp_init, 157bc29160dSMarko Zec #ifdef VIMAGE 158bc29160dSMarko Zec .pr_destroy = tcp_destroy, 159bc29160dSMarko Zec #endif 160303989a2SRuslan Ermilov .pr_slowtimo = tcp_slowtimo, 161303989a2SRuslan Ermilov .pr_drain = tcp_drain, 162303989a2SRuslan Ermilov .pr_usrreqs = &tcp_usrreqs 163df8bae1dSRodney W. Grimes }, 164f8829a4aSRandall Stewart #ifdef SCTP 165f8829a4aSRandall Stewart { 166f8829a4aSRandall Stewart .pr_type = SOCK_DGRAM, 167f8829a4aSRandall Stewart .pr_domain = &inetdomain, 168f8829a4aSRandall Stewart .pr_protocol = IPPROTO_SCTP, 169f8829a4aSRandall Stewart .pr_flags = PR_WANTRCVD, 170f8829a4aSRandall Stewart .pr_input = sctp_input, 171f8829a4aSRandall Stewart .pr_ctlinput = sctp_ctlinput, 172f8829a4aSRandall Stewart .pr_ctloutput = sctp_ctloutput, 173f8829a4aSRandall Stewart .pr_init = sctp_init, 1748518270eSMichael Tuexen #ifdef VIMAGE 1758518270eSMichael Tuexen .pr_destroy = sctp_finish, 1768518270eSMichael Tuexen #endif 177f8829a4aSRandall Stewart .pr_drain = sctp_drain, 178f8829a4aSRandall Stewart .pr_usrreqs = &sctp_usrreqs 179f8829a4aSRandall Stewart }, 180f8829a4aSRandall Stewart { 181f8829a4aSRandall Stewart .pr_type = SOCK_SEQPACKET, 182f8829a4aSRandall Stewart .pr_domain = &inetdomain, 183f8829a4aSRandall Stewart .pr_protocol = IPPROTO_SCTP, 184f8829a4aSRandall Stewart .pr_flags = PR_WANTRCVD, 185f8829a4aSRandall Stewart .pr_input = sctp_input, 186f8829a4aSRandall Stewart .pr_ctlinput = sctp_ctlinput, 187f8829a4aSRandall Stewart .pr_ctloutput = sctp_ctloutput, 188f8829a4aSRandall Stewart .pr_drain = sctp_drain, 189f8829a4aSRandall Stewart .pr_usrreqs = &sctp_usrreqs 190f8829a4aSRandall Stewart }, 191f8829a4aSRandall Stewart 192f8829a4aSRandall Stewart { 193f8829a4aSRandall Stewart .pr_type = SOCK_STREAM, 194f8829a4aSRandall Stewart .pr_domain = &inetdomain, 195f8829a4aSRandall Stewart .pr_protocol = IPPROTO_SCTP, 196f8829a4aSRandall Stewart .pr_flags = PR_WANTRCVD, 197f8829a4aSRandall Stewart .pr_input = sctp_input, 198f8829a4aSRandall Stewart .pr_ctlinput = sctp_ctlinput, 199f8829a4aSRandall Stewart .pr_ctloutput = sctp_ctloutput, 200f8829a4aSRandall Stewart .pr_drain = sctp_drain, 201f8829a4aSRandall Stewart .pr_usrreqs = &sctp_usrreqs 202f8829a4aSRandall Stewart }, 203f8829a4aSRandall Stewart #endif /* SCTP */ 204303989a2SRuslan Ermilov { 205303989a2SRuslan Ermilov .pr_type = SOCK_RAW, 206303989a2SRuslan Ermilov .pr_domain = &inetdomain, 207303989a2SRuslan Ermilov .pr_protocol = IPPROTO_RAW, 208303989a2SRuslan Ermilov .pr_flags = PR_ATOMIC|PR_ADDR, 209303989a2SRuslan Ermilov .pr_input = rip_input, 210303989a2SRuslan Ermilov .pr_ctlinput = rip_ctlinput, 211303989a2SRuslan Ermilov .pr_ctloutput = rip_ctloutput, 212303989a2SRuslan Ermilov .pr_usrreqs = &rip_usrreqs 213df8bae1dSRodney W. Grimes }, 214303989a2SRuslan Ermilov { 215303989a2SRuslan Ermilov .pr_type = SOCK_RAW, 216303989a2SRuslan Ermilov .pr_domain = &inetdomain, 217303989a2SRuslan Ermilov .pr_protocol = IPPROTO_ICMP, 218303989a2SRuslan Ermilov .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, 219303989a2SRuslan Ermilov .pr_input = icmp_input, 220303989a2SRuslan Ermilov .pr_ctloutput = rip_ctloutput, 221303989a2SRuslan Ermilov .pr_usrreqs = &rip_usrreqs 222df8bae1dSRodney W. Grimes }, 223303989a2SRuslan Ermilov { 224303989a2SRuslan Ermilov .pr_type = SOCK_RAW, 225303989a2SRuslan Ermilov .pr_domain = &inetdomain, 226303989a2SRuslan Ermilov .pr_protocol = IPPROTO_IGMP, 227303989a2SRuslan Ermilov .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, 228303989a2SRuslan Ermilov .pr_input = igmp_input, 229303989a2SRuslan Ermilov .pr_ctloutput = rip_ctloutput, 230303989a2SRuslan Ermilov .pr_fasttimo = igmp_fasttimo, 231303989a2SRuslan Ermilov .pr_slowtimo = igmp_slowtimo, 232303989a2SRuslan Ermilov .pr_usrreqs = &rip_usrreqs 233df8bae1dSRodney W. Grimes }, 234303989a2SRuslan Ermilov { 235303989a2SRuslan Ermilov .pr_type = SOCK_RAW, 236303989a2SRuslan Ermilov .pr_domain = &inetdomain, 237303989a2SRuslan Ermilov .pr_protocol = IPPROTO_RSVP, 238303989a2SRuslan Ermilov .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, 239303989a2SRuslan Ermilov .pr_input = rsvp_input, 240303989a2SRuslan Ermilov .pr_ctloutput = rip_ctloutput, 241303989a2SRuslan Ermilov .pr_usrreqs = &rip_usrreqs 242f0068c4aSGarrett Wollman }, 243b2630c29SGeorge V. Neville-Neil #ifdef IPSEC 244303989a2SRuslan Ermilov { 245303989a2SRuslan Ermilov .pr_type = SOCK_RAW, 246303989a2SRuslan Ermilov .pr_domain = &inetdomain, 247303989a2SRuslan Ermilov .pr_protocol = IPPROTO_AH, 248303989a2SRuslan Ermilov .pr_flags = PR_ATOMIC|PR_ADDR, 249303989a2SRuslan Ermilov .pr_input = ah4_input, 250303989a2SRuslan Ermilov .pr_ctlinput = ah4_ctlinput, 251303989a2SRuslan Ermilov .pr_usrreqs = &nousrreqs 252e8539d32SSam Leffler }, 253303989a2SRuslan Ermilov { 254303989a2SRuslan Ermilov .pr_type = SOCK_RAW, 255303989a2SRuslan Ermilov .pr_domain = &inetdomain, 256303989a2SRuslan Ermilov .pr_protocol = IPPROTO_ESP, 257303989a2SRuslan Ermilov .pr_flags = PR_ATOMIC|PR_ADDR, 258303989a2SRuslan Ermilov .pr_input = esp4_input, 259303989a2SRuslan Ermilov .pr_ctlinput = esp4_ctlinput, 260303989a2SRuslan Ermilov .pr_usrreqs = &nousrreqs 261e8539d32SSam Leffler }, 262303989a2SRuslan Ermilov { 263303989a2SRuslan Ermilov .pr_type = SOCK_RAW, 264303989a2SRuslan Ermilov .pr_domain = &inetdomain, 265303989a2SRuslan Ermilov .pr_protocol = IPPROTO_IPCOMP, 266303989a2SRuslan Ermilov .pr_flags = PR_ATOMIC|PR_ADDR, 267303989a2SRuslan Ermilov .pr_input = ipcomp4_input, 268303989a2SRuslan Ermilov .pr_usrreqs = &nousrreqs 269e8539d32SSam Leffler }, 270b2630c29SGeorge V. Neville-Neil #endif /* IPSEC */ 271303989a2SRuslan Ermilov { 272303989a2SRuslan Ermilov .pr_type = SOCK_RAW, 273303989a2SRuslan Ermilov .pr_domain = &inetdomain, 274303989a2SRuslan Ermilov .pr_protocol = IPPROTO_IPV4, 275303989a2SRuslan Ermilov .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, 276303989a2SRuslan Ermilov .pr_input = encap4_input, 277303989a2SRuslan Ermilov .pr_ctloutput = rip_ctloutput, 278303989a2SRuslan Ermilov .pr_init = encap_init, 279303989a2SRuslan Ermilov .pr_usrreqs = &rip_usrreqs 28033841545SHajimu UMEMOTO }, 281303989a2SRuslan Ermilov { 282303989a2SRuslan Ermilov .pr_type = SOCK_RAW, 283303989a2SRuslan Ermilov .pr_domain = &inetdomain, 284303989a2SRuslan Ermilov .pr_protocol = IPPROTO_MOBILE, 285303989a2SRuslan Ermilov .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, 286303989a2SRuslan Ermilov .pr_input = encap4_input, 287303989a2SRuslan Ermilov .pr_ctloutput = rip_ctloutput, 288303989a2SRuslan Ermilov .pr_init = encap_init, 289303989a2SRuslan Ermilov .pr_usrreqs = &rip_usrreqs 2908e96e13eSMaxim Sobolev }, 291303989a2SRuslan Ermilov { 292303989a2SRuslan Ermilov .pr_type = SOCK_RAW, 293303989a2SRuslan Ermilov .pr_domain = &inetdomain, 29473ff045cSAndrew Thompson .pr_protocol = IPPROTO_ETHERIP, 29573ff045cSAndrew Thompson .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, 29673ff045cSAndrew Thompson .pr_input = encap4_input, 29773ff045cSAndrew Thompson .pr_ctloutput = rip_ctloutput, 29873ff045cSAndrew Thompson .pr_init = encap_init, 29973ff045cSAndrew Thompson .pr_usrreqs = &rip_usrreqs 30073ff045cSAndrew Thompson }, 30173ff045cSAndrew Thompson { 30273ff045cSAndrew Thompson .pr_type = SOCK_RAW, 30373ff045cSAndrew Thompson .pr_domain = &inetdomain, 304303989a2SRuslan Ermilov .pr_protocol = IPPROTO_GRE, 305303989a2SRuslan Ermilov .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, 306303989a2SRuslan Ermilov .pr_input = encap4_input, 307303989a2SRuslan Ermilov .pr_ctloutput = rip_ctloutput, 308303989a2SRuslan Ermilov .pr_init = encap_init, 309303989a2SRuslan Ermilov .pr_usrreqs = &rip_usrreqs 3108e96e13eSMaxim Sobolev }, 31133841545SHajimu UMEMOTO # ifdef INET6 312303989a2SRuslan Ermilov { 313303989a2SRuslan Ermilov .pr_type = SOCK_RAW, 314303989a2SRuslan Ermilov .pr_domain = &inetdomain, 315303989a2SRuslan Ermilov .pr_protocol = IPPROTO_IPV6, 316303989a2SRuslan Ermilov .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, 317303989a2SRuslan Ermilov .pr_input = encap4_input, 318303989a2SRuslan Ermilov .pr_ctloutput = rip_ctloutput, 319303989a2SRuslan Ermilov .pr_init = encap_init, 320303989a2SRuslan Ermilov .pr_usrreqs = &rip_usrreqs 32133841545SHajimu UMEMOTO }, 322cfa1ca9dSYoshinobu Inoue #endif 323303989a2SRuslan Ermilov { 324303989a2SRuslan Ermilov .pr_type = SOCK_RAW, 325303989a2SRuslan Ermilov .pr_domain = &inetdomain, 326303989a2SRuslan Ermilov .pr_protocol = IPPROTO_PIM, 327303989a2SRuslan Ermilov .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, 3280948f0a2SBruce M Simpson .pr_input = encap4_input, 329303989a2SRuslan Ermilov .pr_ctloutput = rip_ctloutput, 330303989a2SRuslan Ermilov .pr_usrreqs = &rip_usrreqs 3311e78ac21SJeffrey Hsu }, 3327c1fe953SMax Laier #ifdef DEV_PFSYNC 333303989a2SRuslan Ermilov { 334303989a2SRuslan Ermilov .pr_type = SOCK_RAW, 335303989a2SRuslan Ermilov .pr_domain = &inetdomain, 336303989a2SRuslan Ermilov .pr_protocol = IPPROTO_PFSYNC, 337303989a2SRuslan Ermilov .pr_flags = PR_ATOMIC|PR_ADDR, 338303989a2SRuslan Ermilov .pr_input = pfsync_input, 339303989a2SRuslan Ermilov .pr_ctloutput = rip_ctloutput, 340303989a2SRuslan Ermilov .pr_usrreqs = &rip_usrreqs 3417c1fe953SMax Laier }, 3427c1fe953SMax Laier #endif /* DEV_PFSYNC */ 343dff3237eSAndre Oppermann /* Spacer n-times for loadable protocols. */ 344dff3237eSAndre Oppermann IPPROTOSPACER, 345dff3237eSAndre Oppermann IPPROTOSPACER, 346dff3237eSAndre Oppermann IPPROTOSPACER, 347dff3237eSAndre Oppermann IPPROTOSPACER, 348dff3237eSAndre Oppermann IPPROTOSPACER, 349dff3237eSAndre Oppermann IPPROTOSPACER, 350dff3237eSAndre Oppermann IPPROTOSPACER, 351dff3237eSAndre Oppermann IPPROTOSPACER, 352df8bae1dSRodney W. Grimes /* raw wildcard */ 353303989a2SRuslan Ermilov { 354303989a2SRuslan Ermilov .pr_type = SOCK_RAW, 355303989a2SRuslan Ermilov .pr_domain = &inetdomain, 356303989a2SRuslan Ermilov .pr_flags = PR_ATOMIC|PR_ADDR, 357303989a2SRuslan Ermilov .pr_input = rip_input, 358303989a2SRuslan Ermilov .pr_ctloutput = rip_ctloutput, 359303989a2SRuslan Ermilov .pr_init = rip_init, 360bc29160dSMarko Zec #ifdef VIMAGE 361bc29160dSMarko Zec .pr_destroy = rip_destroy, 362bc29160dSMarko Zec #endif 363303989a2SRuslan Ermilov .pr_usrreqs = &rip_usrreqs 364df8bae1dSRodney W. Grimes }, 365df8bae1dSRodney W. Grimes }; 366df8bae1dSRodney W. Grimes 3674d77a549SAlfred Perlstein extern int in_inithead(void **, int); 368bc29160dSMarko Zec extern int in_detachhead(void **, int); 3695c2dae8eSGarrett Wollman 370303989a2SRuslan Ermilov struct domain inetdomain = { 371303989a2SRuslan Ermilov .dom_family = AF_INET, 372303989a2SRuslan Ermilov .dom_name = "internet", 373303989a2SRuslan Ermilov .dom_protosw = inetsw, 374303989a2SRuslan Ermilov .dom_protoswNPROTOSW = &inetsw[sizeof(inetsw)/sizeof(inetsw[0])], 375e440aed9SQing Li #ifdef RADIX_MPATH 376e440aed9SQing Li .dom_rtattach = rn4_mpath_inithead, 377e440aed9SQing Li #else 378303989a2SRuslan Ermilov .dom_rtattach = in_inithead, 379e440aed9SQing Li #endif 380bc29160dSMarko Zec #ifdef VIMAGE 381bc29160dSMarko Zec .dom_rtdetach = in_detachhead, 382bc29160dSMarko Zec #endif 383303989a2SRuslan Ermilov .dom_rtoffset = 32, 3846e6b3f7cSQing Li .dom_maxrtkey = sizeof(struct sockaddr_in), 3856e6b3f7cSQing Li .dom_ifattach = in_domifattach, 3866e6b3f7cSQing Li .dom_ifdetach = in_domifdetach 3875c2dae8eSGarrett Wollman }; 388df8bae1dSRodney W. Grimes 389d0728d71SRobert Watson VNET_DOMAIN_SET(inet); 390336d023bSBjoern A. Zeeb #endif /* INET */ 391748e0b0aSGarrett Wollman 392602d513cSGarrett Wollman SYSCTL_NODE(_net, PF_INET, inet, CTLFLAG_RW, 0, 393602d513cSGarrett Wollman "Internet Family"); 39498163b98SPoul-Henning Kamp 39598163b98SPoul-Henning Kamp SYSCTL_NODE(_net_inet, IPPROTO_IP, ip, CTLFLAG_RW, 0, "IP"); 39698163b98SPoul-Henning Kamp SYSCTL_NODE(_net_inet, IPPROTO_ICMP, icmp, CTLFLAG_RW, 0, "ICMP"); 39798163b98SPoul-Henning Kamp SYSCTL_NODE(_net_inet, IPPROTO_UDP, udp, CTLFLAG_RW, 0, "UDP"); 39898163b98SPoul-Henning Kamp SYSCTL_NODE(_net_inet, IPPROTO_TCP, tcp, CTLFLAG_RW, 0, "TCP"); 399f8829a4aSRandall Stewart #ifdef SCTP 400f8829a4aSRandall Stewart SYSCTL_NODE(_net_inet, IPPROTO_SCTP, sctp, CTLFLAG_RW, 0, "SCTP"); 401f8829a4aSRandall Stewart #endif 40298163b98SPoul-Henning Kamp SYSCTL_NODE(_net_inet, IPPROTO_IGMP, igmp, CTLFLAG_RW, 0, "IGMP"); 403b2630c29SGeorge V. Neville-Neil #ifdef IPSEC 404b9234fafSSam Leffler /* XXX no protocol # to use, pick something "reserved" */ 405b9234fafSSam Leffler SYSCTL_NODE(_net_inet, 253, ipsec, CTLFLAG_RW, 0, "IPSEC"); 406b9234fafSSam Leffler SYSCTL_NODE(_net_inet, IPPROTO_AH, ah, CTLFLAG_RW, 0, "AH"); 407b9234fafSSam Leffler SYSCTL_NODE(_net_inet, IPPROTO_ESP, esp, CTLFLAG_RW, 0, "ESP"); 408b9234fafSSam Leffler SYSCTL_NODE(_net_inet, IPPROTO_IPCOMP, ipcomp, CTLFLAG_RW, 0, "IPCOMP"); 409b9234fafSSam Leffler SYSCTL_NODE(_net_inet, IPPROTO_IPIP, ipip, CTLFLAG_RW, 0, "IPIP"); 410b2630c29SGeorge V. Neville-Neil #endif /* IPSEC */ 411117bcae7SGarrett Wollman SYSCTL_NODE(_net_inet, IPPROTO_RAW, raw, CTLFLAG_RW, 0, "RAW"); 4126de8d9dcSMax Laier #ifdef DEV_PFSYNC 4136de8d9dcSMax Laier SYSCTL_NODE(_net_inet, IPPROTO_PFSYNC, pfsync, CTLFLAG_RW, 0, "PFSYNC"); 4146de8d9dcSMax Laier #endif 415