diff options
| author | Gleb Smirnoff <glebius@FreeBSD.org> | 2022-08-17 18:50:32 +0000 |
|---|---|---|
| committer | Gleb Smirnoff <glebius@FreeBSD.org> | 2022-08-17 18:50:32 +0000 |
| commit | e7d02be19d40063783d6b8f1ff2bc4c7170fd434 (patch) | |
| tree | d3ed52ad147947c340a2a5ed090e61e10d7d8eef /sys/netinet/sctp_module.c | |
| parent | d9f6ac882a9597a660f83bac088a485b42fbba2c (diff) | |
Diffstat (limited to 'sys/netinet/sctp_module.c')
| -rw-r--r-- | sys/netinet/sctp_module.c | 60 |
1 files changed, 8 insertions, 52 deletions
diff --git a/sys/netinet/sctp_module.c b/sys/netinet/sctp_module.c index ba0d585bd541..a4f294d72e00 100644 --- a/sys/netinet/sctp_module.c +++ b/sys/netinet/sctp_module.c @@ -52,60 +52,16 @@ __FBSDID("$FreeBSD$"); #include <netinet6/ip6_var.h> #include <netinet6/sctp6_var.h> -#ifdef INET -extern struct domain inetdomain; - -struct protosw sctp_stream_protosw = { - .pr_type = SOCK_STREAM, - .pr_domain = &inetdomain, - .pr_protocol = IPPROTO_SCTP, - .pr_flags = PR_CONNREQUIRED|PR_WANTRCVD, - .pr_ctloutput = sctp_ctloutput, - .pr_usrreqs = &sctp_usrreqs, -}; - -struct protosw sctp_seqpacket_protosw = { - .pr_type = SOCK_SEQPACKET, - .pr_domain = &inetdomain, - .pr_protocol = IPPROTO_SCTP, - .pr_flags = PR_WANTRCVD, - .pr_ctloutput = sctp_ctloutput, - .pr_usrreqs = &sctp_usrreqs, -}; -#endif - -#ifdef INET6 -extern struct domain inet6domain; - -struct protosw sctp6_stream_protosw = { - .pr_type = SOCK_STREAM, - .pr_domain = &inet6domain, - .pr_protocol = IPPROTO_SCTP, - .pr_flags = PR_CONNREQUIRED|PR_WANTRCVD, - .pr_ctloutput = sctp_ctloutput, - .pr_usrreqs = &sctp6_usrreqs, -}; - -struct protosw sctp6_seqpacket_protosw = { - .pr_type = SOCK_SEQPACKET, - .pr_domain = &inet6domain, - .pr_protocol = IPPROTO_SCTP, - .pr_flags = PR_WANTRCVD, - .pr_ctloutput = sctp_ctloutput, - .pr_usrreqs = &sctp6_usrreqs, -}; -#endif - static int sctp_module_load(void) { int error; #ifdef INET - error = pf_proto_register(PF_INET, &sctp_stream_protosw); + error = protosw_register(&inetdomain, &sctp_stream_protosw); if (error != 0) return (error); - error = pf_proto_register(PF_INET, &sctp_seqpacket_protosw); + error = protosw_register(&inetdomain, &sctp_seqpacket_protosw); if (error != 0) return (error); error = ipproto_register(IPPROTO_SCTP, sctp_input, sctp_ctlinput); @@ -113,10 +69,10 @@ sctp_module_load(void) return (error); #endif #ifdef INET6 - error = pf_proto_register(PF_INET6, &sctp6_stream_protosw); + error = protosw_register(&inet6domain, &sctp6_stream_protosw); if (error != 0) return (error); - error = pf_proto_register(PF_INET6, &sctp6_seqpacket_protosw); + error = protosw_register(&inet6domain, &sctp6_seqpacket_protosw); if (error != 0) return (error); error = ip6proto_register(IPPROTO_SCTP, sctp6_input, sctp6_ctlinput); @@ -137,13 +93,13 @@ sctp_module_unload(void) #ifdef INET (void)ipproto_unregister(IPPROTO_SCTP); - (void)pf_proto_unregister(PF_INET, IPPROTO_SCTP, SOCK_STREAM); - (void)pf_proto_unregister(PF_INET, IPPROTO_SCTP, SOCK_SEQPACKET); + (void)protosw_unregister(&sctp_seqpacket_protosw); + (void)protosw_unregister(&sctp_stream_protosw); #endif #ifdef INET6 (void)ip6proto_unregister(IPPROTO_SCTP); - (void)pf_proto_unregister(PF_INET6, IPPROTO_SCTP, SOCK_STREAM); - (void)pf_proto_unregister(PF_INET6, IPPROTO_SCTP, SOCK_SEQPACKET); + (void)protosw_unregister(&sctp6_seqpacket_protosw); + (void)protosw_unregister(&sctp6_stream_protosw); #endif return (0); } |
