summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDavid Hill <dhill@cvs.openbsd.org>2017-02-22 19:34:43 +0000
committerDavid Hill <dhill@cvs.openbsd.org>2017-02-22 19:34:43 +0000
commitc5a71d5b6f58699a3359bf2b71d4b560ed2e85fe (patch)
treed549acdebee4fcadaf9a5447a30c7778be54b132 /sys
parentbf890000abe81f1160ca6077c200c133653ea16b (diff)
Use c99 struct initialization with protosw.
This makes it easier to grep for a member, such as .pr_usrreq, and know which functions to review. ok mpi@ bluhm@ jca@
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/uipc_proto.c32
-rw-r--r--sys/net/pfkey.c22
-rw-r--r--sys/net/rtsock.c16
-rw-r--r--sys/netinet/in_proto.c311
-rw-r--r--sys/netinet6/in6_proto.c277
5 files changed, 443 insertions, 215 deletions
diff --git a/sys/kern/uipc_proto.c b/sys/kern/uipc_proto.c
index b8b2c13f582..24d843e5f73 100644
--- a/sys/kern/uipc_proto.c
+++ b/sys/kern/uipc_proto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_proto.c,v 1.11 2017/02/05 07:57:08 guenther Exp $ */
+/* $OpenBSD: uipc_proto.c,v 1.12 2017/02/22 19:34:42 dhill Exp $ */
/* $NetBSD: uipc_proto.c,v 1.8 1996/02/13 21:10:47 christos Exp $ */
/*-
@@ -49,20 +49,26 @@
extern struct domain unixdomain; /* or at least forward */
struct protosw unixsw[] = {
-{ SOCK_STREAM, &unixdomain, PF_LOCAL, PR_CONNREQUIRED|PR_WANTRCVD|PR_RIGHTS,
- 0, 0, 0, 0,
- uipc_usrreq,
- 0, 0, 0, 0,
+{
+ .pr_type = SOCK_STREAM,
+ .pr_domain = &unixdomain,
+ .pr_protocol = PF_LOCAL,
+ .pr_flags = PR_CONNREQUIRED|PR_WANTRCVD|PR_RIGHTS,
+ .pr_usrreq = uipc_usrreq,
},
-{ SOCK_SEQPACKET,&unixdomain, PF_LOCAL, PR_ATOMIC|PR_CONNREQUIRED|PR_WANTRCVD|PR_RIGHTS,
- 0, 0, 0, 0,
- uipc_usrreq,
- 0, 0, 0, 0,
+{
+ .pr_type = SOCK_SEQPACKET,
+ .pr_domain = &unixdomain,
+ .pr_protocol = PF_LOCAL,
+ .pr_flags = PR_ATOMIC|PR_CONNREQUIRED|PR_WANTRCVD|PR_RIGHTS,
+ .pr_usrreq = uipc_usrreq,
},
-{ SOCK_DGRAM, &unixdomain, PF_LOCAL, PR_ATOMIC|PR_ADDR|PR_RIGHTS,
- 0, 0, 0, 0,
- uipc_usrreq,
- 0, 0, 0, 0,
+{
+ .pr_type = SOCK_DGRAM,
+ .pr_domain = &unixdomain,
+ .pr_protocol = PF_LOCAL,
+ .pr_flags = PR_ATOMIC|PR_ADDR|PR_RIGHTS,
+ .pr_usrreq = uipc_usrreq,
}
};
diff --git a/sys/net/pfkey.c b/sys/net/pfkey.c
index e70a936b6b6..8ce5b4ec0b0 100644
--- a/sys/net/pfkey.c
+++ b/sys/net/pfkey.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfkey.c,v 1.36 2017/01/24 10:08:30 krw Exp $ */
+/* $OpenBSD: pfkey.c,v 1.37 2017/02/22 19:34:42 dhill Exp $ */
/*
* @(#)COPYRIGHT 1.1 (NRL) 17 January 1995
@@ -266,20 +266,12 @@ struct domain pfkeydomain = {
};
static struct protosw pfkey_protosw_template = {
- SOCK_RAW,
- &pfkeydomain,
- -1, /* protocol */
- PR_ATOMIC | PR_ADDR,
- NULL, /* input */
- (void *) pfkey_output,
- NULL, /* ctlinput */
- NULL, /* ctloutput */
- pfkey_usrreq,
- NULL, /* init */
- NULL, /* fasttimo */
- NULL, /* slowtimo */
- NULL, /* drain */
- NULL /* sysctl */
+ .pr_type = SOCK_RAW,
+ .pr_domain = &pfkeydomain,
+ .pr_protocol = -1,
+ .pr_flags = PR_ATOMIC | PR_ADDR,
+ .pr_output = (void *) pfkey_output,
+ .pr_usrreq = pfkey_usrreq
};
int
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
index 6ae7c1cebef..4446e6373d9 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtsock.c,v 1.222 2017/02/01 20:59:47 dhill Exp $ */
+/* $OpenBSD: rtsock.c,v 1.223 2017/02/22 19:34:42 dhill Exp $ */
/* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */
/*
@@ -1654,11 +1654,15 @@ sysctl_rtable_rtstat(void *oldp, size_t *oldlenp, void *newp)
extern struct domain routedomain; /* or at least forward */
struct protosw routesw[] = {
-{ SOCK_RAW, &routedomain, 0, PR_ATOMIC|PR_ADDR|PR_WANTRCVD,
- 0, route_output, 0, route_ctloutput,
- route_usrreq,
- raw_init, 0, 0, 0,
- sysctl_rtable,
+{
+ .pr_type = SOCK_RAW,
+ .pr_domain = &routedomain,
+ .pr_flags = PR_ATOMIC|PR_ADDR|PR_WANTRCVD,
+ .pr_output = route_output,
+ .pr_ctloutput = route_ctloutput,
+ .pr_usrreq = route_usrreq,
+ .pr_init = raw_init,
+ .pr_sysctl = sysctl_rtable
}
};
diff --git a/sys/netinet/in_proto.c b/sys/netinet/in_proto.c
index 4d124afdc36..b1ca73acb39 100644
--- a/sys/netinet/in_proto.c
+++ b/sys/netinet/in_proto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in_proto.c,v 1.72 2017/01/29 19:58:47 bluhm Exp $ */
+/* $OpenBSD: in_proto.c,v 1.73 2017/02/22 19:34:42 dhill Exp $ */
/* $NetBSD: in_proto.c,v 1.14 1996/02/18 18:58:32 christos Exp $ */
/*
@@ -175,138 +175,267 @@
u_char ip_protox[IPPROTO_MAX];
struct protosw inetsw[] = {
-{ 0, &inetdomain, 0, 0,
- 0, 0, 0, 0,
- 0,
- ip_init, 0, ip_slowtimo, ip_drain, ip_sysctl
+{
+ .pr_domain = &inetdomain,
+ .pr_init = ip_init,
+ .pr_slowtimo = ip_slowtimo,
+ .pr_drain = ip_drain,
+ .pr_sysctl = ip_sysctl
},
-{ SOCK_DGRAM, &inetdomain, IPPROTO_UDP, PR_ATOMIC|PR_ADDR|PR_SPLICE,
- udp_input, 0, udp_ctlinput, ip_ctloutput,
- udp_usrreq,
- udp_init, 0, 0, 0, udp_sysctl
+{
+ .pr_type = SOCK_DGRAM,
+ .pr_domain = &inetdomain,
+ .pr_protocol = IPPROTO_UDP,
+ .pr_flags = PR_ATOMIC|PR_ADDR|PR_SPLICE,
+ .pr_input = udp_input,
+ .pr_ctlinput = udp_ctlinput,
+ .pr_ctloutput = ip_ctloutput,
+ .pr_usrreq = udp_usrreq,
+ .pr_init = udp_init,
+ .pr_sysctl = udp_sysctl
},
-{ SOCK_STREAM, &inetdomain, IPPROTO_TCP, PR_CONNREQUIRED|PR_WANTRCVD|PR_ABRTACPTDIS|PR_SPLICE,
- tcp_input, 0, tcp_ctlinput, tcp_ctloutput,
- tcp_usrreq,
- tcp_init, 0, tcp_slowtimo, 0, tcp_sysctl
+{
+ .pr_type = SOCK_STREAM,
+ .pr_domain = &inetdomain,
+ .pr_protocol = IPPROTO_TCP,
+ .pr_flags = PR_CONNREQUIRED|PR_WANTRCVD|PR_ABRTACPTDIS|PR_SPLICE,
+ .pr_input = tcp_input,
+ .pr_ctlinput = tcp_ctlinput,
+ .pr_ctloutput = tcp_ctloutput,
+ .pr_usrreq = tcp_usrreq,
+ .pr_init = tcp_init,
+ .pr_slowtimo = tcp_slowtimo,
+ .pr_sysctl = tcp_sysctl
},
-{ SOCK_RAW, &inetdomain, IPPROTO_RAW, PR_ATOMIC|PR_ADDR,
- rip_input, rip_output, 0, rip_ctloutput,
- rip_usrreq,
- 0, 0, 0, 0,
+{
+ .pr_type = SOCK_RAW,
+ .pr_domain = &inetdomain,
+ .pr_protocol = IPPROTO_RAW,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_input = rip_input,
+ .pr_output = rip_output,
+ .pr_ctloutput = rip_ctloutput,
+ .pr_usrreq = rip_usrreq
},
-{ SOCK_RAW, &inetdomain, IPPROTO_ICMP, PR_ATOMIC|PR_ADDR,
- icmp_input, rip_output, 0, rip_ctloutput,
- rip_usrreq,
- icmp_init, 0, 0, 0, icmp_sysctl
+{
+ .pr_type = SOCK_RAW,
+ .pr_domain = &inetdomain,
+ .pr_protocol = IPPROTO_ICMP,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_input = icmp_input,
+ .pr_output = rip_output,
+ .pr_ctloutput = rip_ctloutput,
+ .pr_usrreq = rip_usrreq,
+ .pr_init = icmp_init,
+ .pr_sysctl = icmp_sysctl
},
#if NGIF > 0
-{ SOCK_RAW, &inetdomain, IPPROTO_IPV4, PR_ATOMIC|PR_ADDR,
- in_gif_input, rip_output, 0, rip_ctloutput,
- rip_usrreq,
- 0, 0, 0, 0, ipip_sysctl
+{
+ .pr_type = SOCK_RAW,
+ .pr_domain = &inetdomain,
+ .pr_protocol = IPPROTO_IPV4,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_input = in_gif_input,
+ .pr_output = rip_output,
+ .pr_ctloutput = rip_ctloutput,
+ .pr_usrreq = rip_usrreq,
+ .pr_sysctl = ipip_sysctl
},
-{ SOCK_RAW, &inetdomain, IPPROTO_ETHERIP, PR_ATOMIC|PR_ADDR,
- etherip_input, rip_output, 0, rip_ctloutput,
- rip_usrreq,
- 0, 0, 0, 0, etherip_sysctl
+{
+ .pr_type = SOCK_RAW,
+ .pr_domain = &inetdomain,
+ .pr_protocol = IPPROTO_ETHERIP,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_input = etherip_input,
+ .pr_output = rip_output,
+ .pr_ctloutput = rip_ctloutput,
+ .pr_usrreq = rip_usrreq,
+ .pr_sysctl = etherip_sysctl
},
#ifdef INET6
-{ SOCK_RAW, &inetdomain, IPPROTO_IPV6, PR_ATOMIC|PR_ADDR,
- in_gif_input, rip_output, 0, 0,
- rip_usrreq, /*XXX*/
- 0, 0, 0, 0,
+{
+ .pr_type = SOCK_RAW,
+ .pr_domain = &inetdomain,
+ .pr_protocol = IPPROTO_IPV6,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_input = in_gif_input,
+ .pr_output = rip_output,
+ .pr_usrreq = rip_usrreq /* XXX */
},
#endif
#ifdef MPLS
-{ SOCK_RAW, &inetdomain, IPPROTO_MPLS, PR_ATOMIC|PR_ADDR,
- etherip_input, rip_output, 0, 0,
- rip_usrreq,
- 0, 0, 0, 0,
+{
+ .pr_type = SOCK_RAW,
+ .pr_domain = &inetdomain,
+ .pr_protocol = IPPROTO_MPLS,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_input = etherip_input,
+ .pr_output = rip_output,
+ .pr_usrreq = rip_usrreq
},
#endif
#else /* NGIF */
-{ SOCK_RAW, &inetdomain, IPPROTO_IPIP, PR_ATOMIC|PR_ADDR,
- ip4_input, rip_output, 0, rip_ctloutput,
- rip_usrreq,
- 0, 0, 0, 0, ipip_sysctl
+{
+ .pr_type = SOCK_RAW,
+ .pr_domain = &inetdomain,
+ .pr_protocol = IPPROTO_IPIP,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_input = ip4_input,
+ .pr_output = rip_output,
+ .pr_ctloutput = rip_ctloutput,
+ .pr_usrreq = rip_usrreq,
+ .pr_sysctl = ipip_sysctl
},
#ifdef INET6
-{ SOCK_RAW, &inetdomain, IPPROTO_IPV6, PR_ATOMIC|PR_ADDR,
- ip4_input, rip_output, 0, rip_ctloutput,
- rip_usrreq, /*XXX*/
- 0, 0, 0, 0,
+{
+ .pr_type = SOCK_RAW,
+ .pr_domain = &inetdomain,
+ .pr_protocol = IPPROTO_IPV6,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_input = ip4_input,
+ .pr_output = rip_output,
+ .pr_ctloutput = rip_ctloutput,
+ .pr_usrreq = rip_usrreq /* XXX */
},
#endif
#endif /*NGIF*/
-{ SOCK_RAW, &inetdomain, IPPROTO_IGMP, PR_ATOMIC|PR_ADDR,
- igmp_input, rip_output, 0, rip_ctloutput,
- rip_usrreq,
- igmp_init, igmp_fasttimo, igmp_slowtimo, 0, igmp_sysctl
+{
+ .pr_type = SOCK_RAW,
+ .pr_domain = &inetdomain,
+ .pr_protocol = IPPROTO_IGMP,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_input = igmp_input,
+ .pr_output = rip_output,
+ .pr_ctloutput = rip_ctloutput,
+ .pr_usrreq = rip_usrreq,
+ .pr_init = igmp_init,
+ .pr_fasttimo = igmp_fasttimo,
+ .pr_slowtimo = igmp_slowtimo,
+ .pr_sysctl = igmp_sysctl
},
#ifdef IPSEC
-{ SOCK_RAW, &inetdomain, IPPROTO_AH, PR_ATOMIC|PR_ADDR,
- ah4_input, rip_output, ah4_ctlinput, rip_ctloutput,
- rip_usrreq,
- 0, 0, 0, 0, ah_sysctl
+{
+ .pr_type = SOCK_RAW,
+ .pr_domain = &inetdomain,
+ .pr_protocol = IPPROTO_AH,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_input = ah4_input,
+ .pr_output = rip_output,
+ .pr_ctlinput = ah4_ctlinput,
+ .pr_ctloutput = rip_ctloutput,
+ .pr_usrreq = rip_usrreq,
+ .pr_sysctl = ah_sysctl
},
-{ SOCK_RAW, &inetdomain, IPPROTO_ESP, PR_ATOMIC|PR_ADDR,
- esp4_input, rip_output, esp4_ctlinput, rip_ctloutput,
- rip_usrreq,
- 0, 0, 0, 0, esp_sysctl
+{
+ .pr_type = SOCK_RAW,
+ .pr_domain = &inetdomain,
+ .pr_protocol = IPPROTO_ESP,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_input = esp4_input,
+ .pr_output = rip_output,
+ .pr_ctlinput = esp4_ctlinput,
+ .pr_ctloutput = rip_ctloutput,
+ .pr_usrreq = rip_usrreq,
+ .pr_sysctl = esp_sysctl
},
-{ SOCK_RAW, &inetdomain, IPPROTO_IPCOMP, PR_ATOMIC|PR_ADDR,
- ipcomp4_input, rip_output, 0, rip_ctloutput,
- rip_usrreq,
- 0, 0, 0, 0, ipcomp_sysctl
+{
+ .pr_type = SOCK_RAW,
+ .pr_domain = &inetdomain,
+ .pr_protocol = IPPROTO_IPCOMP,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_input = ipcomp4_input,
+ .pr_output = rip_output,
+ .pr_ctloutput = rip_ctloutput,
+ .pr_usrreq = rip_usrreq,
+ .pr_sysctl = ipcomp_sysctl
},
#endif /* IPSEC */
#if NGRE > 0
-{ SOCK_RAW, &inetdomain, IPPROTO_GRE, PR_ATOMIC|PR_ADDR,
- gre_input, rip_output, 0, rip_ctloutput,
- gre_usrreq,
- 0, 0, 0, 0, gre_sysctl
+{
+ .pr_type = SOCK_RAW,
+ .pr_domain = &inetdomain,
+ .pr_protocol = IPPROTO_GRE,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_input = gre_input,
+ .pr_output = rip_output,
+ .pr_ctloutput = rip_ctloutput,
+ .pr_usrreq = gre_usrreq,
+ .pr_sysctl = gre_sysctl
},
-{ SOCK_RAW, &inetdomain, IPPROTO_MOBILE, PR_ATOMIC|PR_ADDR,
- gre_mobile_input, rip_output, 0, rip_ctloutput,
- rip_usrreq,
- 0, 0, 0, 0, ipmobile_sysctl
+{
+ .pr_type = SOCK_RAW,
+ .pr_domain = &inetdomain,
+ .pr_protocol = IPPROTO_MOBILE,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_input = gre_mobile_input,
+ .pr_output = rip_output,
+ .pr_ctloutput = rip_ctloutput,
+ .pr_usrreq = rip_usrreq,
+ .pr_sysctl = ipmobile_sysctl
},
#endif /* NGRE > 0 */
#if NCARP > 0
-{ SOCK_RAW, &inetdomain, IPPROTO_CARP, PR_ATOMIC|PR_ADDR,
- carp_proto_input, rip_output, 0, rip_ctloutput,
- rip_usrreq,
- 0, 0, 0, 0, carp_sysctl
+{
+ .pr_type = SOCK_RAW,
+ .pr_domain = &inetdomain,
+ .pr_protocol = IPPROTO_CARP,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_input = carp_proto_input,
+ .pr_output = rip_output,
+ .pr_ctloutput = rip_ctloutput,
+ .pr_usrreq = rip_usrreq,
+ .pr_sysctl = carp_sysctl
},
#endif /* NCARP > 0 */
#if NPFSYNC > 0
-{ SOCK_RAW, &inetdomain, IPPROTO_PFSYNC, PR_ATOMIC|PR_ADDR,
- pfsync_input, rip_output, 0, rip_ctloutput,
- rip_usrreq,
- 0, 0, 0, 0, pfsync_sysctl
+{
+ .pr_type = SOCK_RAW,
+ .pr_domain = &inetdomain,
+ .pr_protocol = IPPROTO_PFSYNC,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_input = pfsync_input,
+ .pr_output = rip_output,
+ .pr_ctloutput = rip_ctloutput,
+ .pr_usrreq = rip_usrreq,
+ .pr_sysctl = pfsync_sysctl
},
#endif /* NPFSYNC > 0 */
#if NPF > 0
-{ SOCK_RAW, &inetdomain, IPPROTO_DIVERT, PR_ATOMIC|PR_ADDR,
- 0, 0, 0, rip_ctloutput,
- divert_usrreq,
- divert_init, 0, 0, 0, divert_sysctl
+{
+ .pr_type = SOCK_RAW,
+ .pr_domain = &inetdomain,
+ .pr_protocol = IPPROTO_DIVERT,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_ctloutput = rip_ctloutput,
+ .pr_usrreq = divert_usrreq,
+ .pr_init = divert_init,
+ .pr_sysctl = divert_sysctl
},
#endif /* NPF > 0 */
#if NETHERIP > 0
-{ SOCK_RAW, &inetdomain, IPPROTO_ETHERIP, PR_ATOMIC|PR_ADDR,
- ip_etherip_input, rip_output, 0, rip_ctloutput,
- rip_usrreq,
- 0, 0, 0, 0, ip_etherip_sysctl
+{
+ .pr_type = SOCK_RAW,
+ .pr_domain = &inetdomain,
+ .pr_protocol = IPPROTO_ETHERIP,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_input = ip_etherip_input,
+ .pr_output = rip_output,
+ .pr_ctloutput = rip_ctloutput,
+ .pr_usrreq = rip_usrreq,
+ .pr_sysctl = ip_etherip_sysctl
},
#endif /* NETHERIP */
-/* raw wildcard */
-{ SOCK_RAW, &inetdomain, 0, PR_ATOMIC|PR_ADDR,
- rip_input, rip_output, 0, rip_ctloutput,
- rip_usrreq,
- rip_init, 0, 0, 0,
-},
+{
+ /* raw wildcard */
+ .pr_type = SOCK_RAW,
+ .pr_domain = &inetdomain,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_input = rip_input,
+ .pr_output = rip_output,
+ .pr_ctloutput = rip_ctloutput,
+ .pr_usrreq = rip_usrreq,
+ .pr_init = rip_init
+}
};
struct domain inetdomain =
diff --git a/sys/netinet6/in6_proto.c b/sys/netinet6/in6_proto.c
index 6fc03970f08..73d1bdadcfe 100644
--- a/sys/netinet6/in6_proto.c
+++ b/sys/netinet6/in6_proto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in6_proto.c,v 1.88 2017/01/29 19:58:47 bluhm Exp $ */
+/* $OpenBSD: in6_proto.c,v 1.89 2017/02/22 19:34:42 dhill Exp $ */
/* $KAME: in6_proto.c,v 1.66 2000/10/10 15:35:47 itojun Exp $ */
/*
@@ -122,125 +122,222 @@
u_char ip6_protox[IPPROTO_MAX];
struct protosw inet6sw[] = {
-{ 0, &inet6domain, IPPROTO_IPV6, 0,
- 0, 0, 0, 0,
- 0,
- ip6_init, 0, frag6_slowtimo, frag6_drain,
- ip6_sysctl,
+{
+ .pr_domain = &inet6domain,
+ .pr_protocol = IPPROTO_IPV6,
+ .pr_init = ip6_init,
+ .pr_slowtimo = frag6_slowtimo,
+ .pr_drain = frag6_drain,
+ .pr_sysctl = ip6_sysctl
},
-{ SOCK_DGRAM, &inet6domain, IPPROTO_UDP, PR_ATOMIC|PR_ADDR|PR_SPLICE,
- udp_input, 0, udp6_ctlinput, ip6_ctloutput,
- udp_usrreq, 0,
- 0, 0, 0,
- udp_sysctl,
+{
+ .pr_type = SOCK_DGRAM,
+ .pr_domain = &inet6domain,
+ .pr_protocol = IPPROTO_UDP,
+ .pr_flags = PR_ATOMIC|PR_ADDR|PR_SPLICE,
+ .pr_input = udp_input,
+ .pr_ctlinput = udp6_ctlinput,
+ .pr_ctloutput = ip6_ctloutput,
+ .pr_usrreq = udp_usrreq,
+ .pr_sysctl = udp_sysctl
},
-{ SOCK_STREAM, &inet6domain, IPPROTO_TCP, PR_CONNREQUIRED|PR_WANTRCVD|PR_ABRTACPTDIS|PR_SPLICE,
- tcp_input, 0, tcp6_ctlinput, tcp_ctloutput,
- tcp_usrreq,
- 0, 0, 0, 0,
- tcp_sysctl,
+{
+ .pr_type = SOCK_STREAM,
+ .pr_domain = &inet6domain,
+ .pr_protocol = IPPROTO_TCP,
+ .pr_flags = PR_CONNREQUIRED|PR_WANTRCVD|PR_ABRTACPTDIS|PR_SPLICE,
+ .pr_input = tcp_input,
+ .pr_ctlinput = tcp6_ctlinput,
+ .pr_ctloutput = tcp_ctloutput,
+ .pr_usrreq = tcp_usrreq,
+ .pr_sysctl = tcp_sysctl
},
-{ SOCK_RAW, &inet6domain, IPPROTO_RAW, PR_ATOMIC|PR_ADDR,
- rip6_input, rip6_output, rip6_ctlinput, rip6_ctloutput,
- rip6_usrreq,
- 0, 0, 0, 0, rip6_sysctl
+{
+ .pr_type = SOCK_RAW,
+ .pr_domain = &inet6domain,
+ .pr_protocol = IPPROTO_RAW,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_input = rip6_input,
+ .pr_output = rip6_output,
+ .pr_ctlinput = rip6_ctlinput,
+ .pr_ctloutput = rip6_ctloutput,
+ .pr_usrreq = rip6_usrreq,
+ .pr_sysctl = rip6_sysctl
},
-{ SOCK_RAW, &inet6domain, IPPROTO_ICMPV6, PR_ATOMIC|PR_ADDR,
- icmp6_input, rip6_output, rip6_ctlinput, rip6_ctloutput,
- rip6_usrreq,
- icmp6_init, icmp6_fasttimo, 0, 0,
- icmp6_sysctl,
+{
+ .pr_type = SOCK_RAW,
+ .pr_domain = &inet6domain,
+ .pr_protocol = IPPROTO_ICMPV6,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_input = icmp6_input,
+ .pr_output = rip6_output,
+ .pr_ctlinput = rip6_ctlinput,
+ .pr_ctloutput = rip6_ctloutput,
+ .pr_usrreq = rip6_usrreq,
+ .pr_init = icmp6_init,
+ .pr_fasttimo = icmp6_fasttimo,
+ .pr_sysctl = icmp6_sysctl
},
-{ SOCK_RAW, &inet6domain, IPPROTO_DSTOPTS,PR_ATOMIC|PR_ADDR,
- dest6_input, 0, 0, 0,
- 0,
- 0, 0, 0, 0,
+{
+ .pr_type = SOCK_RAW,
+ .pr_domain = &inet6domain,
+ .pr_protocol = IPPROTO_DSTOPTS,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_input = dest6_input
},
-{ SOCK_RAW, &inet6domain, IPPROTO_ROUTING,PR_ATOMIC|PR_ADDR,
- route6_input, 0, 0, 0,
- 0,
- 0, 0, 0, 0,
+{
+ .pr_type = SOCK_RAW,
+ .pr_domain = &inet6domain,
+ .pr_protocol = IPPROTO_ROUTING,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_input = route6_input
},
-{ SOCK_RAW, &inet6domain, IPPROTO_FRAGMENT,PR_ATOMIC|PR_ADDR,
- frag6_input, 0, 0, 0,
- 0,
- 0, 0, 0, 0,
+{
+ .pr_type = SOCK_RAW,
+ .pr_domain = &inet6domain,
+ .pr_protocol = IPPROTO_FRAGMENT,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_input = frag6_input
},
#ifdef IPSEC
-{ SOCK_RAW, &inet6domain, IPPROTO_AH, PR_ATOMIC|PR_ADDR,
- ah6_input, rip6_output, 0, rip6_ctloutput,
- rip6_usrreq,
- 0, 0, 0, 0,
- ah_sysctl,
+{
+ .pr_type = SOCK_RAW,
+ .pr_domain = &inet6domain,
+ .pr_protocol = IPPROTO_AH,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_input = ah6_input,
+ .pr_output = rip6_output,
+ .pr_ctloutput = rip6_ctloutput,
+ .pr_usrreq = rip6_usrreq,
+ .pr_sysctl = ah_sysctl
},
-{ SOCK_RAW, &inet6domain, IPPROTO_ESP, PR_ATOMIC|PR_ADDR,
- esp6_input, rip6_output, 0, rip6_ctloutput,
- rip6_usrreq,
- 0, 0, 0, 0,
- esp_sysctl,
+{
+ .pr_type = SOCK_RAW,
+ .pr_domain = &inet6domain,
+ .pr_protocol = IPPROTO_ESP,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_input = esp6_input,
+ .pr_output = rip6_output,
+ .pr_ctloutput = rip6_ctloutput,
+ .pr_usrreq = rip6_usrreq,
+ .pr_sysctl = esp_sysctl
},
-{ SOCK_RAW, &inet6domain, IPPROTO_IPCOMP, PR_ATOMIC|PR_ADDR,
- ipcomp6_input, rip6_output, 0, rip6_ctloutput,
- rip6_usrreq,
- 0, 0, 0, 0,
- ipcomp_sysctl,
+{
+ .pr_type = SOCK_RAW,
+ .pr_domain = &inet6domain,
+ .pr_protocol = IPPROTO_IPCOMP,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_input = ipcomp6_input,
+ .pr_output = rip6_output,
+ .pr_ctloutput = rip6_ctloutput,
+ .pr_usrreq = rip6_usrreq,
+ .pr_sysctl = ipcomp_sysctl
},
#endif /* IPSEC */
#if NGIF > 0
-{ SOCK_RAW, &inet6domain, IPPROTO_ETHERIP,PR_ATOMIC|PR_ADDR,
- etherip_input, rip6_output, 0, rip6_ctloutput,
- rip6_usrreq,
- 0, 0, 0, 0, etherip_sysctl
+{
+ .pr_type = SOCK_RAW,
+ .pr_domain = &inet6domain,
+ .pr_protocol = IPPROTO_ETHERIP,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_input = etherip_input,
+ .pr_output = rip6_output,
+ .pr_ctloutput = rip6_ctloutput,
+ .pr_usrreq = rip6_usrreq,
+ .pr_sysctl = etherip_sysctl
},
-{ SOCK_RAW, &inet6domain, IPPROTO_IPV6, PR_ATOMIC|PR_ADDR,
- in6_gif_input, rip6_output, 0, rip6_ctloutput,
- rip6_usrreq, /* XXX */
- 0, 0, 0, 0,
+{
+ .pr_type = SOCK_RAW,
+ .pr_domain = &inet6domain,
+ .pr_protocol = IPPROTO_IPV6,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_input = in6_gif_input,
+ .pr_output = rip6_output,
+ .pr_ctloutput = rip6_ctloutput,
+ .pr_usrreq = rip6_usrreq /* XXX */
},
-{ SOCK_RAW, &inet6domain, IPPROTO_IPV4, PR_ATOMIC|PR_ADDR,
- in6_gif_input, rip6_output, 0, rip6_ctloutput,
- rip6_usrreq, /* XXX */
- 0, 0, 0, 0,
+{
+ .pr_type = SOCK_RAW,
+ .pr_domain = &inet6domain,
+ .pr_protocol = IPPROTO_IPV4,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_input = in6_gif_input,
+ .pr_output = rip6_output,
+ .pr_ctloutput = rip6_ctloutput,
+ .pr_usrreq = rip6_usrreq /* XXX */
},
#else /* NGIF */
-{ SOCK_RAW, &inet6domain, IPPROTO_IPV6, PR_ATOMIC|PR_ADDR,
- ip4_input, rip6_output, 0, rip6_ctloutput,
- rip6_usrreq, /* XXX */
- 0, 0, 0, 0, ipip_sysctl
+{
+ .pr_type = SOCK_RAW,
+ .pr_domain = &inet6domain,
+ .pr_protocol = IPPROTO_IPV6,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_input = ip4_input,
+ .pr_output = rip6_output,
+ .pr_ctloutput = rip6_ctloutput,
+ .pr_usrreq = rip6_usrreq, /* XXX */
+ .pr_sysctl = ipip_sysctl
},
-{ SOCK_RAW, &inet6domain, IPPROTO_IPV4, PR_ATOMIC|PR_ADDR,
- ip4_input, rip6_output, 0, rip6_ctloutput,
- rip6_usrreq, /* XXX */
- 0, 0, 0, 0,
+{
+ .pr_type = SOCK_RAW,
+ .pr_domain = &inet6domain,
+ .pr_protocol = IPPROTO_IPV4,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_input = ip4_input,
+ .pr_output = rip6_output,
+ .pr_ctloutput = rip6_ctloutput,
+ .pr_usrreq = rip6_usrreq /* XXX */
},
#endif /* GIF */
#if NCARP > 0
-{ SOCK_RAW, &inet6domain, IPPROTO_CARP, PR_ATOMIC|PR_ADDR,
- carp6_proto_input, rip6_output, 0, rip6_ctloutput,
- rip6_usrreq,
- 0, 0, 0, 0, carp_sysctl
+{
+ .pr_type = SOCK_RAW,
+ .pr_domain = &inet6domain,
+ .pr_protocol = IPPROTO_CARP,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_input = carp6_proto_input,
+ .pr_output = rip6_output,
+ .pr_ctloutput = rip6_ctloutput,
+ .pr_usrreq = rip6_usrreq,
+ .pr_sysctl = carp_sysctl
},
#endif /* NCARP */
#if NPF > 0
-{ SOCK_RAW, &inet6domain, IPPROTO_DIVERT, PR_ATOMIC|PR_ADDR,
- 0, 0, 0, rip6_ctloutput,
- divert6_usrreq,
- divert6_init, 0, 0, 0, divert6_sysctl
+{
+ .pr_type = SOCK_RAW,
+ .pr_domain = &inet6domain,
+ .pr_protocol = IPPROTO_DIVERT,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_ctloutput = rip6_ctloutput,
+ .pr_usrreq = divert6_usrreq,
+ .pr_init = divert6_init,
+ .pr_sysctl = divert6_sysctl
},
#endif /* NPF > 0 */
#if NETHERIP > 0
-{ SOCK_RAW, &inet6domain, IPPROTO_ETHERIP,PR_ATOMIC|PR_ADDR,
- ip6_etherip_input, rip6_output, 0, rip6_ctloutput,
- rip6_usrreq,
- 0, 0, 0, 0, ip_etherip_sysctl
+{
+ .pr_type = SOCK_RAW,
+ .pr_domain = &inet6domain,
+ .pr_protocol = IPPROTO_ETHERIP,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_input = ip6_etherip_input,
+ .pr_output = rip6_output,
+ .pr_ctloutput = rip6_ctloutput,
+ .pr_usrreq = rip6_usrreq,
+ .pr_sysctl = ip_etherip_sysctl
},
#endif /* NETHERIP */
-/* raw wildcard */
-{ SOCK_RAW, &inet6domain, 0, PR_ATOMIC|PR_ADDR,
- rip6_input, rip6_output, 0, rip6_ctloutput,
- rip6_usrreq, rip6_init,
- 0, 0, 0,
-},
+{
+ /* raw wildcard */
+ .pr_type = SOCK_RAW,
+ .pr_domain = &inet6domain,
+ .pr_flags = PR_ATOMIC|PR_ADDR,
+ .pr_input = rip6_input,
+ .pr_output = rip6_output,
+ .pr_ctloutput = rip6_ctloutput,
+ .pr_usrreq = rip6_usrreq,
+ .pr_init = rip6_init
+}
};
struct domain inet6domain =