I converted the declarations when I audited the existing 'dom_init'
functions.
ok?
Index: kern/uipc_proto.c
===================================================================
RCS file: /cvs/src/sys/kern/uipc_proto.c,v
retrieving revision 1.12
diff -u -p -r1.12 uipc_proto.c
--- kern/uipc_proto.c 22 Feb 2017 19:34:42 -0000 1.12
+++ kern/uipc_proto.c 1 Mar 2017 12:05:35 -0000
@@ -37,9 +37,9 @@
#include <sys/protosw.h>
#include <sys/domain.h>
#include <sys/mbuf.h>
-#include <sys/unpcb.h>
+#include <sys/unpcb.h>
#include <sys/socketvar.h>
-
+
#include <net/raw_cb.h>
/*
@@ -72,6 +72,11 @@ struct protosw unixsw[] = {
}
};
-struct domain unixdomain =
- { AF_LOCAL, "unix", 0, unp_externalize, unp_dispose,
- unixsw, &unixsw[nitems(unixsw)] };
+struct domain unixdomain = {
+ .dom_family = AF_LOCAL,
+ .dom_name = "unix",
+ .dom_externalize = unp_externalize,
+ .dom_dispose = unp_dispose,
+ .dom_protosw = unixsw,
+ .dom_protoswNPROTOSW = &unixsw[nitems(unixsw)]
+};
Index: net/pfkey.c
===================================================================
RCS file: /cvs/src/sys/net/pfkey.c,v
retrieving revision 1.37
diff -u -p -r1.37 pfkey.c
--- net/pfkey.c 22 Feb 2017 19:34:42 -0000 1.37
+++ net/pfkey.c 1 Mar 2017 12:11:31 -0000
@@ -256,13 +256,9 @@ pfkey_usrreq(struct socket *socket, int
}
struct domain pfkeydomain = {
- PF_KEY,
- "PF_KEY",
- pfkey_init, /* init */
- NULL, /* externalize */
- NULL, /* dispose */
- NULL, /* protosw */
- NULL, /* protoswNPROTOSW */
+ .dom_family = PF_KEY,
+ .dom_name = "PF_KEY",
+ .dom_init = pfkey_init,
};
static struct protosw pfkey_protosw_template = {
Index: net/rtsock.c
===================================================================
RCS file: /cvs/src/sys/net/rtsock.c,v
retrieving revision 1.223
diff -u -p -r1.223 rtsock.c
--- net/rtsock.c 22 Feb 2017 19:34:42 -0000 1.223
+++ net/rtsock.c 1 Mar 2017 12:33:46 -0000
@@ -1666,6 +1666,10 @@ struct protosw routesw[] = {
}
};
-struct domain routedomain =
- { PF_ROUTE, "route", route_init, 0, 0,
- routesw, &routesw[nitems(routesw)] };
+struct domain routedomain = {
+ .dom_family = PF_ROUTE,
+ .dom_name = "route",
+ .dom_init = route_init,
+ .dom_protosw = routesw,
+ .dom_protoswNPROTOSW = &routesw[nitems(routesw)]
+};
Index: netinet/in_proto.c
===================================================================
RCS file: /cvs/src/sys/netinet/in_proto.c,v
retrieving revision 1.73
diff -u -p -r1.73 in_proto.c
--- netinet/in_proto.c 22 Feb 2017 19:34:42 -0000 1.73
+++ netinet/in_proto.c 1 Mar 2017 12:07:53 -0000
@@ -438,8 +438,12 @@ struct protosw inetsw[] = {
}
};
-struct domain inetdomain =
- { AF_INET, "internet", 0, 0, 0,
- inetsw, &inetsw[nitems(inetsw)],
- sizeof(struct sockaddr_in),
- offsetof(struct sockaddr_in, sin_addr), 32 };
+struct domain inetdomain = {
+ .dom_family = AF_INET,
+ .dom_name = "internet",
+ .dom_protosw = inetsw,
+ .dom_protoswNPROTOSW = &inetsw[nitems(inetsw)],
+ .dom_rtkeylen = sizeof(struct sockaddr_in),
+ .dom_rtoffset = offsetof(struct sockaddr_in, sin_addr),
+ .dom_maxplen = 32
+};
Index: netinet6/in6_proto.c
===================================================================
RCS file: /cvs/src/sys/netinet6/in6_proto.c,v
retrieving revision 1.89
diff -u -p -r1.89 in6_proto.c
--- netinet6/in6_proto.c 22 Feb 2017 19:34:42 -0000 1.89
+++ netinet6/in6_proto.c 1 Mar 2017 12:10:23 -0000
@@ -340,13 +340,17 @@ struct protosw inet6sw[] = {
}
};
-struct domain inet6domain =
- { AF_INET6, "internet6", 0, 0, 0,
- (struct protosw *)inet6sw,
- (struct protosw *)&inet6sw[nitems(inet6sw)],
- sizeof(struct sockaddr_in6),
- offsetof(struct sockaddr_in6, sin6_addr), 128,
- in6_domifattach, in6_domifdetach, };
+struct domain inet6domain = {
+ .dom_family = AF_INET6,
+ .dom_name = "internet6",
+ .dom_protosw = (struct protosw *)inet6sw,
+ .dom_protoswNPROTOSW = (struct protosw *)&inet6sw[nitems(inet6sw)],
+ .dom_rtkeylen = sizeof(struct sockaddr_in6),
+ .dom_rtoffset = offsetof(struct sockaddr_in6, sin6_addr),
+ .dom_maxplen = 128,
+ .dom_ifattach = in6_domifattach,
+ .dom_ifdetach = in6_domifdetach
+};
/*
* Internet configuration info
Index: netmpls/mpls_proto.c
===================================================================
RCS file: /cvs/src/sys/netmpls/mpls_proto.c,v
retrieving revision 1.15
diff -u -p -r1.15 mpls_proto.c
--- netmpls/mpls_proto.c 27 Feb 2017 19:16:56 -0000 1.15
+++ netmpls/mpls_proto.c 1 Mar 2017 12:14:17 -0000
@@ -46,9 +46,9 @@
* MPLS address family: needed for the routing table
*/
struct domain mplsdomain = {
- AF_MPLS, "mpls", NULL, 0, 0,
- NULL,
- 0,
- sizeof(struct sockaddr_mpls),
- offsetof(struct sockaddr_mpls, smpls_label), 32
+ .dom_family = AF_MPLS,
+ .dom_name = "mpls",
+ .dom_rtkeylen = sizeof(struct sockaddr_mpls),
+ .dom_rtoffset = offsetof(struct sockaddr_mpls, smpls_label),
+ .dom_maxplen = 32
};