mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-29 12:03:03 +00:00
Initialize struct pr_userreqs in new/sparse style and fill in common
default elements in net_init_domain(). This makes it possible to grep these structures and see any bogosities.
This commit is contained in:
parent
598b7ec86b
commit
756d52a195
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=137386
@ -74,13 +74,27 @@ MTX_SYSINIT(domain, &dom_mtx, "domain list", MTX_DEF);
|
||||
* All functions return EOPNOTSUPP.
|
||||
*/
|
||||
struct pr_usrreqs nousrreqs = {
|
||||
pru_abort_notsupp, pru_accept_notsupp, pru_attach_notsupp,
|
||||
pru_bind_notsupp, pru_connect_notsupp, pru_connect2_notsupp,
|
||||
pru_control_notsupp, pru_detach_notsupp, pru_disconnect_notsupp,
|
||||
pru_listen_notsupp, pru_peeraddr_notsupp, pru_rcvd_notsupp,
|
||||
pru_rcvoob_notsupp, pru_send_notsupp, pru_sense_null,
|
||||
pru_shutdown_notsupp, pru_sockaddr_notsupp, pru_sosend_notsupp,
|
||||
pru_soreceive_notsupp, pru_sopoll_notsupp, pru_sosetlabel_null
|
||||
.pru_abort = pru_abort_notsupp,
|
||||
.pru_accept = pru_accept_notsupp,
|
||||
.pru_attach = pru_attach_notsupp,
|
||||
.pru_bind = pru_bind_notsupp,
|
||||
.pru_connect = pru_connect_notsupp,
|
||||
.pru_connect2 = pru_connect2_notsupp,
|
||||
.pru_control = pru_control_notsupp,
|
||||
.pru_detach = pru_detach_notsupp,
|
||||
.pru_disconnect = pru_disconnect_notsupp,
|
||||
.pru_listen = pru_listen_notsupp,
|
||||
.pru_peeraddr = pru_peeraddr_notsupp,
|
||||
.pru_rcvd = pru_rcvd_notsupp,
|
||||
.pru_rcvoob = pru_rcvoob_notsupp,
|
||||
.pru_send = pru_send_notsupp,
|
||||
.pru_sense = pru_sense_null,
|
||||
.pru_shutdown = pru_shutdown_notsupp,
|
||||
.pru_sockaddr = pru_sockaddr_notsupp,
|
||||
.pru_sosend = pru_sosend_notsupp,
|
||||
.pru_soreceive = pru_soreceive_notsupp,
|
||||
.pru_sopoll = pru_sopoll_notsupp,
|
||||
.pru_sosetlabel = pru_sosetlabel_null
|
||||
};
|
||||
|
||||
/*
|
||||
@ -92,14 +106,30 @@ static void
|
||||
net_init_domain(struct domain *dp)
|
||||
{
|
||||
struct protosw *pr;
|
||||
struct pr_usrreqs *pu;
|
||||
|
||||
if (dp->dom_init)
|
||||
(*dp->dom_init)();
|
||||
for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++){
|
||||
if (pr->pr_usrreqs == 0)
|
||||
panic("domaininit: %ssw[%d] has no usrreqs!",
|
||||
dp->dom_name,
|
||||
(int)(pr - dp->dom_protosw));
|
||||
pu = pr->pr_usrreqs;
|
||||
KASSERT(pu != NULL,
|
||||
("domaininit: %ssw[%d] has no usrreqs!",
|
||||
dp->dom_name, (int)(pr - dp->dom_protosw)));
|
||||
#define DEFAULT(foo, bar) if ((foo) == NULL) (foo) = (bar)
|
||||
DEFAULT(pu->pru_accept, pru_accept_notsupp);
|
||||
DEFAULT(pu->pru_connect, pru_connect_notsupp);
|
||||
DEFAULT(pu->pru_connect2, pru_connect2_notsupp);
|
||||
DEFAULT(pu->pru_control, pru_control_notsupp);
|
||||
DEFAULT(pu->pru_listen, pru_listen_notsupp);
|
||||
DEFAULT(pu->pru_rcvd, pru_rcvd_notsupp);
|
||||
DEFAULT(pu->pru_rcvoob, pru_rcvoob_notsupp);
|
||||
DEFAULT(pu->pru_sense, pru_sense_null);
|
||||
DEFAULT(pu->pru_sosend, sosend);
|
||||
DEFAULT(pu->pru_soreceive, soreceive);
|
||||
DEFAULT(pu->pru_sopoll, sopoll);
|
||||
DEFAULT(pu->pru_sosetlabel, pru_sosetlabel_null);
|
||||
#undef DEFAULT
|
||||
|
||||
if (pr->pr_init)
|
||||
(*pr->pr_init)();
|
||||
}
|
||||
|
@ -576,11 +576,24 @@ uipc_sockaddr(struct socket *so, struct sockaddr **nam)
|
||||
}
|
||||
|
||||
struct pr_usrreqs uipc_usrreqs = {
|
||||
uipc_abort, uipc_accept, uipc_attach, uipc_bind, uipc_connect,
|
||||
uipc_connect2, pru_control_notsupp, uipc_detach, uipc_disconnect,
|
||||
uipc_listen, uipc_peeraddr, uipc_rcvd, pru_rcvoob_notsupp,
|
||||
uipc_send, uipc_sense, uipc_shutdown, uipc_sockaddr,
|
||||
sosend, soreceive, sopoll, pru_sosetlabel_null
|
||||
.pru_abort = uipc_abort,
|
||||
.pru_accept = uipc_accept,
|
||||
.pru_attach = uipc_attach,
|
||||
.pru_bind = uipc_bind,
|
||||
.pru_connect = uipc_connect,
|
||||
.pru_connect2 = uipc_connect2,
|
||||
.pru_detach = uipc_detach,
|
||||
.pru_disconnect = uipc_disconnect,
|
||||
.pru_listen = uipc_listen,
|
||||
.pru_peeraddr = uipc_peeraddr,
|
||||
.pru_rcvd = uipc_rcvd,
|
||||
.pru_send = uipc_send,
|
||||
.pru_sense = uipc_sense,
|
||||
.pru_shutdown = uipc_shutdown,
|
||||
.pru_sockaddr = uipc_sockaddr,
|
||||
.pru_sosend = sosend,
|
||||
.pru_soreceive = soreceive,
|
||||
.pru_sopoll = sopoll,
|
||||
};
|
||||
|
||||
int
|
||||
|
@ -297,9 +297,14 @@ raw_usockaddr(struct socket *so, struct sockaddr **nam)
|
||||
}
|
||||
|
||||
struct pr_usrreqs raw_usrreqs = {
|
||||
raw_uabort, pru_accept_notsupp, raw_uattach, raw_ubind, raw_uconnect,
|
||||
pru_connect2_notsupp, pru_control_notsupp, raw_udetach,
|
||||
raw_udisconnect, pru_listen_notsupp, raw_upeeraddr, pru_rcvd_notsupp,
|
||||
pru_rcvoob_notsupp, raw_usend, pru_sense_null, raw_ushutdown,
|
||||
raw_usockaddr, sosend, soreceive, sopoll, pru_sosetlabel_null
|
||||
.pru_abort = raw_uabort,
|
||||
.pru_attach = raw_uattach,
|
||||
.pru_bind = raw_ubind,
|
||||
.pru_connect = raw_uconnect,
|
||||
.pru_detach = raw_udetach,
|
||||
.pru_disconnect = raw_udisconnect,
|
||||
.pru_peeraddr = raw_upeeraddr,
|
||||
.pru_send = raw_usend,
|
||||
.pru_shutdown = raw_ushutdown,
|
||||
.pru_sockaddr = raw_usockaddr,
|
||||
};
|
||||
|
@ -310,11 +310,16 @@ rts_sockaddr(struct socket *so, struct sockaddr **nam)
|
||||
}
|
||||
|
||||
static struct pr_usrreqs route_usrreqs = {
|
||||
rts_abort, pru_accept_notsupp, rts_attach, rts_bind, rts_connect,
|
||||
pru_connect2_notsupp, pru_control_notsupp, rts_detach, rts_disconnect,
|
||||
pru_listen_notsupp, rts_peeraddr, pru_rcvd_notsupp, pru_rcvoob_notsupp,
|
||||
rts_send, pru_sense_null, rts_shutdown, rts_sockaddr,
|
||||
sosend, soreceive, sopoll, pru_sosetlabel_null
|
||||
.pru_abort = rts_abort,
|
||||
.pru_attach = rts_attach,
|
||||
.pru_bind = rts_bind,
|
||||
.pru_connect = rts_connect,
|
||||
.pru_detach = rts_detach,
|
||||
.pru_disconnect = rts_disconnect,
|
||||
.pru_peeraddr = rts_peeraddr,
|
||||
.pru_send = rts_send,
|
||||
.pru_shutdown = rts_shutdown,
|
||||
.pru_sockaddr = rts_sockaddr,
|
||||
};
|
||||
|
||||
/*ARGSUSED*/
|
||||
|
@ -258,25 +258,15 @@ at_setsockaddr(struct socket *so, struct sockaddr **nam)
|
||||
}
|
||||
|
||||
struct pr_usrreqs ddp_usrreqs = {
|
||||
ddp_abort,
|
||||
pru_accept_notsupp,
|
||||
ddp_attach,
|
||||
ddp_bind,
|
||||
ddp_connect,
|
||||
pru_connect2_notsupp,
|
||||
at_control,
|
||||
ddp_detach,
|
||||
ddp_disconnect,
|
||||
pru_listen_notsupp,
|
||||
at_setpeeraddr,
|
||||
pru_rcvd_notsupp,
|
||||
pru_rcvoob_notsupp,
|
||||
ddp_send,
|
||||
pru_sense_null,
|
||||
ddp_shutdown,
|
||||
at_setsockaddr,
|
||||
sosend,
|
||||
soreceive,
|
||||
sopoll,
|
||||
pru_sosetlabel_null
|
||||
.pru_abort = ddp_abort,
|
||||
.pru_attach = ddp_attach,
|
||||
.pru_bind = ddp_bind,
|
||||
.pru_connect = ddp_connect,
|
||||
.pru_control = at_control,
|
||||
.pru_detach = ddp_detach,
|
||||
.pru_disconnect = ddp_disconnect,
|
||||
.pru_peeraddr = at_setpeeraddr,
|
||||
.pru_send = ddp_send,
|
||||
.pru_shutdown = ddp_shutdown,
|
||||
.pru_sockaddr = at_setsockaddr,
|
||||
};
|
||||
|
@ -93,27 +93,20 @@ static caddr_t atm_aal5_getname(void *);
|
||||
* New-style socket request routines
|
||||
*/
|
||||
struct pr_usrreqs atm_aal5_usrreqs = {
|
||||
atm_aal5_abort, /* pru_abort */
|
||||
atm_aal5_accept, /* pru_accept */
|
||||
atm_aal5_attach, /* pru_attach */
|
||||
atm_aal5_bind, /* pru_bind */
|
||||
atm_aal5_connect, /* pru_connect */
|
||||
pru_connect2_notsupp, /* pru_connect2 */
|
||||
atm_aal5_control, /* pru_control */
|
||||
atm_aal5_detach, /* pru_detach */
|
||||
atm_aal5_disconnect, /* pru_disconnect */
|
||||
atm_aal5_listen, /* pru_listen */
|
||||
atm_aal5_peeraddr, /* pru_peeraddr */
|
||||
pru_rcvd_notsupp, /* pru_rcvd */
|
||||
pru_rcvoob_notsupp, /* pru_rcvoob */
|
||||
atm_aal5_send, /* pru_send */
|
||||
atm_aal5_sense, /* pru_sense */
|
||||
atm_aal5_shutdown, /* pru_shutdown */
|
||||
atm_aal5_sockaddr, /* pru_sockaddr */
|
||||
sosend, /* pru_sosend */
|
||||
soreceive, /* pru_soreceive */
|
||||
sopoll, /* pru_sopoll */
|
||||
pru_sosetlabel_null /* pru_sosetlabel */
|
||||
.pru_abort = atm_aal5_abort,
|
||||
.pru_accept = atm_aal5_accept,
|
||||
.pru_attach = atm_aal5_attach,
|
||||
.pru_bind = atm_aal5_bind,
|
||||
.pru_connect = atm_aal5_connect,
|
||||
.pru_control = atm_aal5_control,
|
||||
.pru_detach = atm_aal5_detach,
|
||||
.pru_disconnect = atm_aal5_disconnect,
|
||||
.pru_listen = atm_aal5_listen,
|
||||
.pru_peeraddr = atm_aal5_peeraddr,
|
||||
.pru_send = atm_aal5_send,
|
||||
.pru_sense = atm_aal5_sense,
|
||||
.pru_shutdown = atm_aal5_shutdown,
|
||||
.pru_sockaddr = atm_aal5_sockaddr,
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -66,27 +66,19 @@ static int atm_dgram_info(caddr_t);
|
||||
* New-style socket request routines
|
||||
*/
|
||||
struct pr_usrreqs atm_dgram_usrreqs = {
|
||||
atm_proto_notsupp1, /* pru_abort */
|
||||
pru_accept_notsupp, /* pru_accept */
|
||||
atm_dgram_attach, /* pru_attach */
|
||||
atm_proto_notsupp2, /* pru_bind */
|
||||
pru_connect_notsupp, /* pru_connect */
|
||||
pru_connect2_notsupp, /* pru_connect2 */
|
||||
atm_dgram_control, /* pru_control */
|
||||
atm_proto_notsupp1, /* pru_detach */
|
||||
atm_proto_notsupp1, /* pru_disconnect */
|
||||
pru_listen_notsupp, /* pru_listen */
|
||||
atm_proto_notsupp3, /* pru_peeraddr */
|
||||
pru_rcvd_notsupp, /* pru_rcvd */
|
||||
pru_rcvoob_notsupp, /* pru_rcvoob */
|
||||
atm_proto_notsupp4, /* pru_send */
|
||||
pru_sense_null, /* pru_sense */
|
||||
atm_proto_notsupp1, /* pru_shutdown */
|
||||
atm_proto_notsupp3, /* pru_sockaddr */
|
||||
NULL, /* pru_sosend */
|
||||
NULL, /* pru_soreceive */
|
||||
NULL, /* pru_sooll */
|
||||
pru_sosetlabel_null /* pru_sosetlabel */
|
||||
.pru_abort = atm_proto_notsupp1,
|
||||
.pru_attach = atm_dgram_attach,
|
||||
.pru_bind = atm_proto_notsupp2,
|
||||
.pru_control = atm_dgram_control,
|
||||
.pru_detach = atm_proto_notsupp1,
|
||||
.pru_disconnect = atm_proto_notsupp1,
|
||||
.pru_peeraddr = atm_proto_notsupp3,
|
||||
.pru_send = atm_proto_notsupp4,
|
||||
.pru_shutdown = atm_proto_notsupp1,
|
||||
.pru_sockaddr = atm_proto_notsupp3,
|
||||
.pru_sosend = NULL,
|
||||
.pru_soreceive = NULL,
|
||||
.pru_sopoll = NULL,
|
||||
};
|
||||
|
||||
|
||||
|
@ -61,27 +61,17 @@ extern struct domain ng_btsocket_domain;
|
||||
*/
|
||||
|
||||
static struct pr_usrreqs ng_btsocket_hci_raw_usrreqs = {
|
||||
ng_btsocket_hci_raw_abort, /* abort */
|
||||
pru_accept_notsupp, /* accept */
|
||||
ng_btsocket_hci_raw_attach, /* attach */
|
||||
ng_btsocket_hci_raw_bind, /* bind */
|
||||
ng_btsocket_hci_raw_connect, /* connect */
|
||||
pru_connect2_notsupp, /* connect2 */
|
||||
ng_btsocket_hci_raw_control, /* control */
|
||||
ng_btsocket_hci_raw_detach, /* detach */
|
||||
ng_btsocket_hci_raw_disconnect, /* disconnect */
|
||||
pru_listen_notsupp, /* listen */
|
||||
ng_btsocket_hci_raw_peeraddr, /* peeraddr */
|
||||
pru_rcvd_notsupp, /* rcvd */
|
||||
pru_rcvoob_notsupp, /* rcvoob */
|
||||
ng_btsocket_hci_raw_send, /* send */
|
||||
pru_sense_null, /* send */
|
||||
NULL, /* shutdown */
|
||||
ng_btsocket_hci_raw_sockaddr, /* sockaddr */
|
||||
sosend,
|
||||
soreceive,
|
||||
sopoll,
|
||||
pru_sosetlabel_null
|
||||
.pru_abort = ng_btsocket_hci_raw_abort,
|
||||
.pru_attach = ng_btsocket_hci_raw_attach,
|
||||
.pru_bind = ng_btsocket_hci_raw_bind,
|
||||
.pru_connect = ng_btsocket_hci_raw_connect,
|
||||
.pru_control = ng_btsocket_hci_raw_control,
|
||||
.pru_detach = ng_btsocket_hci_raw_detach,
|
||||
.pru_disconnect = ng_btsocket_hci_raw_disconnect,
|
||||
.pru_peeraddr = ng_btsocket_hci_raw_peeraddr,
|
||||
.pru_send = ng_btsocket_hci_raw_send,
|
||||
.pru_shutdown = NULL,
|
||||
.pru_sockaddr = ng_btsocket_hci_raw_sockaddr,
|
||||
};
|
||||
|
||||
/*
|
||||
@ -89,27 +79,17 @@ static struct pr_usrreqs ng_btsocket_hci_raw_usrreqs = {
|
||||
*/
|
||||
|
||||
static struct pr_usrreqs ng_btsocket_l2cap_raw_usrreqs = {
|
||||
ng_btsocket_l2cap_raw_abort, /* abort */
|
||||
pru_accept_notsupp, /* accept */
|
||||
ng_btsocket_l2cap_raw_attach, /* attach */
|
||||
ng_btsocket_l2cap_raw_bind, /* bind */
|
||||
ng_btsocket_l2cap_raw_connect, /* connect */
|
||||
pru_connect2_notsupp, /* connect2 */
|
||||
ng_btsocket_l2cap_raw_control, /* control */
|
||||
ng_btsocket_l2cap_raw_detach, /* detach */
|
||||
ng_btsocket_l2cap_raw_disconnect, /* disconnect */
|
||||
pru_listen_notsupp, /* listen */
|
||||
ng_btsocket_l2cap_raw_peeraddr, /* peeraddr */
|
||||
pru_rcvd_notsupp, /* rcvd */
|
||||
pru_rcvoob_notsupp, /* rcvoob */
|
||||
ng_btsocket_l2cap_raw_send, /* send */
|
||||
pru_sense_null, /* send */
|
||||
NULL, /* shutdown */
|
||||
ng_btsocket_l2cap_raw_sockaddr, /* sockaddr */
|
||||
sosend,
|
||||
soreceive,
|
||||
sopoll,
|
||||
pru_sosetlabel_null
|
||||
.pru_abort = ng_btsocket_l2cap_raw_abort,
|
||||
.pru_attach = ng_btsocket_l2cap_raw_attach,
|
||||
.pru_bind = ng_btsocket_l2cap_raw_bind,
|
||||
.pru_connect = ng_btsocket_l2cap_raw_connect,
|
||||
.pru_control = ng_btsocket_l2cap_raw_control,
|
||||
.pru_detach = ng_btsocket_l2cap_raw_detach,
|
||||
.pru_disconnect = ng_btsocket_l2cap_raw_disconnect,
|
||||
.pru_peeraddr = ng_btsocket_l2cap_raw_peeraddr,
|
||||
.pru_send = ng_btsocket_l2cap_raw_send,
|
||||
.pru_shutdown = NULL,
|
||||
.pru_sockaddr = ng_btsocket_l2cap_raw_sockaddr,
|
||||
};
|
||||
|
||||
/*
|
||||
@ -117,27 +97,19 @@ static struct pr_usrreqs ng_btsocket_l2cap_raw_usrreqs = {
|
||||
*/
|
||||
|
||||
static struct pr_usrreqs ng_btsocket_l2cap_usrreqs = {
|
||||
ng_btsocket_l2cap_abort, /* abort */
|
||||
ng_btsocket_l2cap_accept, /* accept */
|
||||
ng_btsocket_l2cap_attach, /* attach */
|
||||
ng_btsocket_l2cap_bind, /* bind */
|
||||
ng_btsocket_l2cap_connect, /* connect */
|
||||
pru_connect2_notsupp, /* connect2 */
|
||||
ng_btsocket_l2cap_control, /* control */
|
||||
ng_btsocket_l2cap_detach, /* detach */
|
||||
ng_btsocket_l2cap_disconnect, /* disconnect */
|
||||
ng_btsocket_l2cap_listen, /* listen */
|
||||
ng_btsocket_l2cap_peeraddr, /* peeraddr */
|
||||
pru_rcvd_notsupp, /* rcvd */
|
||||
pru_rcvoob_notsupp, /* rcvoob */
|
||||
ng_btsocket_l2cap_send, /* send */
|
||||
pru_sense_null, /* send */
|
||||
NULL, /* shutdown */
|
||||
ng_btsocket_l2cap_sockaddr, /* sockaddr */
|
||||
sosend,
|
||||
soreceive,
|
||||
sopoll,
|
||||
pru_sosetlabel_null
|
||||
.pru_abort = ng_btsocket_l2cap_abort,
|
||||
.pru_accept = ng_btsocket_l2cap_accept,
|
||||
.pru_attach = ng_btsocket_l2cap_attach,
|
||||
.pru_bind = ng_btsocket_l2cap_bind,
|
||||
.pru_connect = ng_btsocket_l2cap_connect,
|
||||
.pru_control = ng_btsocket_l2cap_control,
|
||||
.pru_detach = ng_btsocket_l2cap_detach,
|
||||
.pru_disconnect = ng_btsocket_l2cap_disconnect,
|
||||
.pru_listen = ng_btsocket_l2cap_listen,
|
||||
.pru_peeraddr = ng_btsocket_l2cap_peeraddr,
|
||||
.pru_send = ng_btsocket_l2cap_send,
|
||||
.pru_shutdown = NULL,
|
||||
.pru_sockaddr = ng_btsocket_l2cap_sockaddr,
|
||||
};
|
||||
|
||||
/*
|
||||
@ -145,27 +117,19 @@ static struct pr_usrreqs ng_btsocket_l2cap_usrreqs = {
|
||||
*/
|
||||
|
||||
static struct pr_usrreqs ng_btsocket_rfcomm_usrreqs = {
|
||||
ng_btsocket_rfcomm_abort, /* abort */
|
||||
ng_btsocket_rfcomm_accept, /* accept */
|
||||
ng_btsocket_rfcomm_attach, /* attach */
|
||||
ng_btsocket_rfcomm_bind, /* bind */
|
||||
ng_btsocket_rfcomm_connect, /* connect */
|
||||
pru_connect2_notsupp, /* connect2 */
|
||||
ng_btsocket_rfcomm_control, /* control */
|
||||
ng_btsocket_rfcomm_detach, /* detach */
|
||||
ng_btsocket_rfcomm_disconnect, /* disconnect */
|
||||
ng_btsocket_rfcomm_listen, /* listen */
|
||||
ng_btsocket_rfcomm_peeraddr, /* peeraddr */
|
||||
pru_rcvd_notsupp, /* rcvd */
|
||||
pru_rcvoob_notsupp, /* rcvoob */
|
||||
ng_btsocket_rfcomm_send, /* send */
|
||||
pru_sense_null, /* send */
|
||||
NULL, /* shutdown */
|
||||
ng_btsocket_rfcomm_sockaddr, /* sockaddr */
|
||||
sosend,
|
||||
soreceive,
|
||||
sopoll,
|
||||
pru_sosetlabel_null
|
||||
.pru_abort = ng_btsocket_rfcomm_abort,
|
||||
.pru_accept = ng_btsocket_rfcomm_accept,
|
||||
.pru_attach = ng_btsocket_rfcomm_attach,
|
||||
.pru_bind = ng_btsocket_rfcomm_bind,
|
||||
.pru_connect = ng_btsocket_rfcomm_connect,
|
||||
.pru_control = ng_btsocket_rfcomm_control,
|
||||
.pru_detach = ng_btsocket_rfcomm_detach,
|
||||
.pru_disconnect = ng_btsocket_rfcomm_disconnect,
|
||||
.pru_listen = ng_btsocket_rfcomm_listen,
|
||||
.pru_peeraddr = ng_btsocket_rfcomm_peeraddr,
|
||||
.pru_send = ng_btsocket_rfcomm_send,
|
||||
.pru_shutdown = NULL,
|
||||
.pru_sockaddr = ng_btsocket_rfcomm_sockaddr,
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -1006,51 +1006,29 @@ dummy_disconnect(struct socket *so)
|
||||
*/
|
||||
|
||||
static struct pr_usrreqs ngc_usrreqs = {
|
||||
NULL, /* abort */
|
||||
pru_accept_notsupp,
|
||||
ngc_attach,
|
||||
ngc_bind,
|
||||
ngc_connect,
|
||||
pru_connect2_notsupp,
|
||||
pru_control_notsupp,
|
||||
ngc_detach,
|
||||
dummy_disconnect, /* disconnect */
|
||||
pru_listen_notsupp,
|
||||
NULL, /* setpeeraddr */
|
||||
pru_rcvd_notsupp,
|
||||
pru_rcvoob_notsupp,
|
||||
ngc_send,
|
||||
pru_sense_null,
|
||||
NULL, /* shutdown */
|
||||
ng_setsockaddr,
|
||||
sosend,
|
||||
soreceive,
|
||||
sopoll,
|
||||
pru_sosetlabel_null
|
||||
.pru_abort = NULL,
|
||||
.pru_attach = ngc_attach,
|
||||
.pru_bind = ngc_bind,
|
||||
.pru_connect = ngc_connect,
|
||||
.pru_detach = ngc_detach,
|
||||
.pru_disconnect = dummy_disconnect,
|
||||
.pru_peeraddr = NULL,
|
||||
.pru_send = ngc_send,
|
||||
.pru_shutdown = NULL,
|
||||
.pru_sockaddr = ng_setsockaddr,
|
||||
};
|
||||
|
||||
static struct pr_usrreqs ngd_usrreqs = {
|
||||
NULL, /* abort */
|
||||
pru_accept_notsupp,
|
||||
ngd_attach,
|
||||
NULL, /* bind */
|
||||
ngd_connect,
|
||||
pru_connect2_notsupp,
|
||||
pru_control_notsupp,
|
||||
ngd_detach,
|
||||
dummy_disconnect, /* disconnect */
|
||||
pru_listen_notsupp,
|
||||
NULL, /* setpeeraddr */
|
||||
pru_rcvd_notsupp,
|
||||
pru_rcvoob_notsupp,
|
||||
ngd_send,
|
||||
pru_sense_null,
|
||||
NULL, /* shutdown */
|
||||
ng_setsockaddr,
|
||||
sosend,
|
||||
soreceive,
|
||||
sopoll,
|
||||
pru_sosetlabel_null
|
||||
.pru_abort = NULL,
|
||||
.pru_attach = ngd_attach,
|
||||
.pru_bind = NULL,
|
||||
.pru_connect = ngd_connect,
|
||||
.pru_detach = ngd_detach,
|
||||
.pru_disconnect = dummy_disconnect,
|
||||
.pru_peeraddr = NULL,
|
||||
.pru_send = ngd_send,
|
||||
.pru_shutdown = NULL,
|
||||
.pru_sockaddr ng_setsockaddr,
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -661,11 +661,17 @@ SYSCTL_PROC(_net_inet_divert, OID_AUTO, pcblist, CTLFLAG_RD, 0, 0,
|
||||
#endif
|
||||
|
||||
struct pr_usrreqs div_usrreqs = {
|
||||
div_abort, pru_accept_notsupp, div_attach, div_bind,
|
||||
pru_connect_notsupp, pru_connect2_notsupp, in_control, div_detach,
|
||||
div_disconnect, pru_listen_notsupp, div_peeraddr, pru_rcvd_notsupp,
|
||||
pru_rcvoob_notsupp, div_send, pru_sense_null, div_shutdown,
|
||||
div_sockaddr, sosend, soreceive, sopoll, in_pcbsosetlabel
|
||||
.pru_abort = div_abort,
|
||||
.pru_attach = div_attach,
|
||||
.pru_bind = div_bind,
|
||||
.pru_control = in_control,
|
||||
.pru_detach = div_detach,
|
||||
.pru_disconnect = div_disconnect,
|
||||
.pru_peeraddr = div_peeraddr,
|
||||
.pru_send = div_send,
|
||||
.pru_shutdown = div_shutdown,
|
||||
.pru_sockaddr = div_sockaddr,
|
||||
.pru_sosetlabel in_pcbsosetlabel
|
||||
};
|
||||
|
||||
struct protosw div_protosw = {
|
||||
|
@ -899,9 +899,16 @@ SYSCTL_PROC(_net_inet_raw, OID_AUTO/*XXX*/, pcblist, CTLFLAG_RD, 0, 0,
|
||||
rip_pcblist, "S,xinpcb", "List of active raw IP sockets");
|
||||
|
||||
struct pr_usrreqs rip_usrreqs = {
|
||||
rip_abort, pru_accept_notsupp, rip_attach, rip_bind, rip_connect,
|
||||
pru_connect2_notsupp, in_control, rip_detach, rip_disconnect,
|
||||
pru_listen_notsupp, rip_peeraddr, pru_rcvd_notsupp,
|
||||
pru_rcvoob_notsupp, rip_send, pru_sense_null, rip_shutdown,
|
||||
rip_sockaddr, sosend, soreceive, sopoll, in_pcbsosetlabel
|
||||
.pru_abort = rip_abort,
|
||||
.pru_attach = rip_attach,
|
||||
.pru_bind = rip_bind,
|
||||
.pru_connect = rip_connect,
|
||||
.pru_control = in_control,
|
||||
.pru_detach = rip_detach,
|
||||
.pru_disconnect = rip_disconnect,
|
||||
.pru_peeraddr = rip_peeraddr,
|
||||
.pru_send = rip_send,
|
||||
.pru_shutdown = rip_shutdown,
|
||||
.pru_sockaddr = rip_sockaddr,
|
||||
.pru_sosetlabel = in_pcbsosetlabel
|
||||
};
|
||||
|
@ -778,22 +778,43 @@ tcp_usr_rcvoob(struct socket *so, struct mbuf *m, int flags)
|
||||
COMMON_END(PRU_RCVOOB);
|
||||
}
|
||||
|
||||
/* xxx - should be const */
|
||||
struct pr_usrreqs tcp_usrreqs = {
|
||||
tcp_usr_abort, tcp_usr_accept, tcp_usr_attach, tcp_usr_bind,
|
||||
tcp_usr_connect, pru_connect2_notsupp, in_control, tcp_usr_detach,
|
||||
tcp_usr_disconnect, tcp_usr_listen, tcp_peeraddr, tcp_usr_rcvd,
|
||||
tcp_usr_rcvoob, tcp_usr_send, pru_sense_null, tcp_usr_shutdown,
|
||||
tcp_sockaddr, sosend, soreceive, sopoll, in_pcbsosetlabel
|
||||
.pru_abort = tcp_usr_abort,
|
||||
.pru_accept = tcp_usr_accept,
|
||||
.pru_attach = tcp_usr_attach,
|
||||
.pru_bind = tcp_usr_bind,
|
||||
.pru_connect = tcp_usr_connect,
|
||||
.pru_control = in_control,
|
||||
.pru_detach = tcp_usr_detach,
|
||||
.pru_disconnect = tcp_usr_disconnect,
|
||||
.pru_listen = tcp_usr_listen,
|
||||
.pru_peeraddr = tcp_peeraddr,
|
||||
.pru_rcvd = tcp_usr_rcvd,
|
||||
.pru_rcvoob = tcp_usr_rcvoob,
|
||||
.pru_send = tcp_usr_send,
|
||||
.pru_shutdown = tcp_usr_shutdown,
|
||||
.pru_sockaddr = tcp_sockaddr,
|
||||
.pru_sosetlabel = in_pcbsosetlabel
|
||||
};
|
||||
|
||||
#ifdef INET6
|
||||
struct pr_usrreqs tcp6_usrreqs = {
|
||||
tcp_usr_abort, tcp6_usr_accept, tcp_usr_attach, tcp6_usr_bind,
|
||||
tcp6_usr_connect, pru_connect2_notsupp, in6_control, tcp_usr_detach,
|
||||
tcp_usr_disconnect, tcp6_usr_listen, in6_mapped_peeraddr, tcp_usr_rcvd,
|
||||
tcp_usr_rcvoob, tcp_usr_send, pru_sense_null, tcp_usr_shutdown,
|
||||
in6_mapped_sockaddr, sosend, soreceive, sopoll, in_pcbsosetlabel
|
||||
.pru_abort = tcp_usr_abort,
|
||||
.pru_accept = tcp6_usr_accept,
|
||||
.pru_attach = tcp_usr_attach,
|
||||
.pru_bind = tcp6_usr_bind,
|
||||
.pru_connect = tcp6_usr_connect,
|
||||
.pru_control = in6_control,
|
||||
.pru_detach = tcp_usr_detach,
|
||||
.pru_disconnect = tcp_usr_disconnect,
|
||||
.pru_listen = tcp6_usr_listen,
|
||||
.pru_peeraddr = in6_mapped_peeraddr,
|
||||
.pru_rcvd = tcp_usr_rcvd,
|
||||
.pru_rcvoob = tcp_usr_rcvoob,
|
||||
.pru_send = tcp_usr_send,
|
||||
.pru_shutdown = tcp_usr_shutdown,
|
||||
.pru_sockaddr = in6_mapped_sockaddr,
|
||||
.pru_sosetlabel = in_pcbsosetlabel
|
||||
};
|
||||
#endif /* INET6 */
|
||||
|
||||
|
@ -1111,9 +1111,16 @@ udp_peeraddr(struct socket *so, struct sockaddr **nam)
|
||||
}
|
||||
|
||||
struct pr_usrreqs udp_usrreqs = {
|
||||
udp_abort, pru_accept_notsupp, udp_attach, udp_bind, udp_connect,
|
||||
pru_connect2_notsupp, in_control, udp_detach, udp_disconnect,
|
||||
pru_listen_notsupp, udp_peeraddr, pru_rcvd_notsupp,
|
||||
pru_rcvoob_notsupp, udp_send, pru_sense_null, udp_shutdown,
|
||||
udp_sockaddr, sosend, soreceive, sopoll, in_pcbsosetlabel
|
||||
.pru_abort = udp_abort,
|
||||
.pru_attach = udp_attach,
|
||||
.pru_bind = udp_bind,
|
||||
.pru_connect = udp_connect,
|
||||
.pru_control = in_control,
|
||||
.pru_detach = udp_detach,
|
||||
.pru_disconnect = udp_disconnect,
|
||||
.pru_peeraddr = udp_peeraddr,
|
||||
.pru_send = udp_send,
|
||||
.pru_shutdown = udp_shutdown,
|
||||
.pru_sockaddr = udp_sockaddr,
|
||||
.pru_sosetlabel = in_pcbsosetlabel
|
||||
};
|
||||
|
@ -782,9 +782,15 @@ rip6_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *nam,
|
||||
}
|
||||
|
||||
struct pr_usrreqs rip6_usrreqs = {
|
||||
rip6_abort, pru_accept_notsupp, rip6_attach, rip6_bind, rip6_connect,
|
||||
pru_connect2_notsupp, in6_control, rip6_detach, rip6_disconnect,
|
||||
pru_listen_notsupp, in6_setpeeraddr, pru_rcvd_notsupp,
|
||||
pru_rcvoob_notsupp, rip6_send, pru_sense_null, rip6_shutdown,
|
||||
in6_setsockaddr, sosend, soreceive, sopoll, pru_sosetlabel_null
|
||||
.pru_abort = rip6_abort,
|
||||
.pru_attach = rip6_attach,
|
||||
.pru_bind = rip6_bind,
|
||||
.pru_connect = rip6_connect,
|
||||
.pru_control = in6_control,
|
||||
.pru_detach = rip6_detach,
|
||||
.pru_disconnect = rip6_disconnect,
|
||||
.pru_peeraddr = in6_setpeeraddr,
|
||||
.pru_send = rip6_send,
|
||||
.pru_shutdown = rip6_shutdown,
|
||||
.pru_sockaddr = in6_setsockaddr,
|
||||
};
|
||||
|
@ -804,9 +804,16 @@ udp6_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr,
|
||||
}
|
||||
|
||||
struct pr_usrreqs udp6_usrreqs = {
|
||||
udp6_abort, pru_accept_notsupp, udp6_attach, udp6_bind, udp6_connect,
|
||||
pru_connect2_notsupp, in6_control, udp6_detach, udp6_disconnect,
|
||||
pru_listen_notsupp, in6_mapped_peeraddr, pru_rcvd_notsupp,
|
||||
pru_rcvoob_notsupp, udp6_send, pru_sense_null, udp_shutdown,
|
||||
in6_mapped_sockaddr, sosend, soreceive, sopoll, in_pcbsosetlabel
|
||||
.pru_abort = udp6_abort,
|
||||
.pru_attach = udp6_attach,
|
||||
.pru_bind = udp6_bind,
|
||||
.pru_connect = udp6_connect,
|
||||
.pru_control = in6_control,
|
||||
.pru_detach = udp6_detach,
|
||||
.pru_disconnect = udp6_disconnect,
|
||||
.pru_peeraddr = in6_mapped_peeraddr,
|
||||
.pru_send = udp6_send,
|
||||
.pru_shutdown = udp_shutdown,
|
||||
.pru_sockaddr = in6_mapped_sockaddr,
|
||||
.pru_sosetlabel = in_pcbsosetlabel
|
||||
};
|
||||
|
@ -563,14 +563,16 @@ key_sockaddr(struct socket *so, struct sockaddr **nam)
|
||||
}
|
||||
|
||||
struct pr_usrreqs key_usrreqs = {
|
||||
key_abort, pru_accept_notsupp, key_attach, key_bind,
|
||||
key_connect,
|
||||
pru_connect2_notsupp, pru_control_notsupp, key_detach,
|
||||
key_disconnect, pru_listen_notsupp, key_peeraddr,
|
||||
pru_rcvd_notsupp,
|
||||
pru_rcvoob_notsupp, key_send, pru_sense_null, key_shutdown,
|
||||
key_sockaddr, sosend, soreceive, sopoll,
|
||||
pru_sosetlabel_null
|
||||
.pru_abort = key_abort,
|
||||
.pru_attach = key_attach,
|
||||
.pru_bind = key_bind,
|
||||
.pru_connect = key_connect,
|
||||
.pru_detach = key_detach,
|
||||
.pru_disconnect = key_disconnect,
|
||||
.pru_peeraddr = key_peeraddr,
|
||||
.pru_send = key_send,
|
||||
.pru_shutdown = key_shutdown,
|
||||
.pru_sockaddr = key_sockaddr,
|
||||
};
|
||||
|
||||
/* sysctl */
|
||||
|
@ -88,19 +88,31 @@ static int ripx_attach(struct socket *so, int proto, struct thread *td);
|
||||
static int ipx_output(struct ipxpcb *ipxp, struct mbuf *m0);
|
||||
|
||||
struct pr_usrreqs ipx_usrreqs = {
|
||||
ipx_usr_abort, pru_accept_notsupp, ipx_attach, ipx_bind,
|
||||
ipx_connect, pru_connect2_notsupp, ipx_control, ipx_detach,
|
||||
ipx_disconnect, pru_listen_notsupp, ipx_peeraddr, pru_rcvd_notsupp,
|
||||
pru_rcvoob_notsupp, ipx_send, pru_sense_null, ipx_shutdown,
|
||||
ipx_sockaddr, sosend, soreceive, sopoll, pru_sosetlabel_null
|
||||
.pru_abort = ipx_usr_abort,
|
||||
.pru_attach = ipx_attach,
|
||||
.pru_bind = ipx_bind,
|
||||
.pru_connect = ipx_connect,
|
||||
.pru_control = ipx_control,
|
||||
.pru_detach = ipx_detach,
|
||||
.pru_disconnect = ipx_disconnect,
|
||||
.pru_peeraddr = ipx_peeraddr,
|
||||
.pru_send = ipx_send,
|
||||
.pru_shutdown = ipx_shutdown,
|
||||
.pru_sockaddr = ipx_sockaddr,
|
||||
};
|
||||
|
||||
struct pr_usrreqs ripx_usrreqs = {
|
||||
ipx_usr_abort, pru_accept_notsupp, ripx_attach, ipx_bind,
|
||||
ipx_connect, pru_connect2_notsupp, ipx_control, ipx_detach,
|
||||
ipx_disconnect, pru_listen_notsupp, ipx_peeraddr, pru_rcvd_notsupp,
|
||||
pru_rcvoob_notsupp, ipx_send, pru_sense_null, ipx_shutdown,
|
||||
ipx_sockaddr, sosend, soreceive, sopoll, pru_sosetlabel_null
|
||||
.pru_abort = ipx_usr_abort,
|
||||
.pru_attach = ripx_attach,
|
||||
.pru_bind = ipx_bind,
|
||||
.pru_connect = ipx_connect,
|
||||
.pru_control = ipx_control,
|
||||
.pru_detach = ipx_detach,
|
||||
.pru_disconnect = ipx_disconnect,
|
||||
.pru_peeraddr = ipx_peeraddr,
|
||||
.pru_send = ipx_send,
|
||||
.pru_shutdown = ipx_shutdown,
|
||||
.pru_sockaddr = ipx_sockaddr,
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -108,19 +108,39 @@ static int spx_shutdown(struct socket *so);
|
||||
static int spx_sp_attach(struct socket *so, int proto, struct thread *td);
|
||||
|
||||
struct pr_usrreqs spx_usrreqs = {
|
||||
spx_usr_abort, spx_accept, spx_attach, spx_bind,
|
||||
spx_connect, pru_connect2_notsupp, ipx_control, spx_detach,
|
||||
spx_usr_disconnect, spx_listen, ipx_peeraddr, spx_rcvd,
|
||||
spx_rcvoob, spx_send, pru_sense_null, spx_shutdown,
|
||||
ipx_sockaddr, sosend, soreceive, sopoll, pru_sosetlabel_null
|
||||
.pru_abort = spx_usr_abort,
|
||||
.pru_accept = spx_accept,
|
||||
.pru_attach = spx_attach,
|
||||
.pru_bind = spx_bind,
|
||||
.pru_connect = spx_connect,
|
||||
.pru_control = ipx_control,
|
||||
.pru_detach = spx_detach,
|
||||
.pru_disconnect = spx_usr_disconnect,
|
||||
.pru_listen = spx_listen,
|
||||
.pru_peeraddr = ipx_peeraddr,
|
||||
.pru_rcvd = spx_rcvd,
|
||||
.pru_rcvoob = spx_rcvoob,
|
||||
.pru_send = spx_send,
|
||||
.pru_shutdown = spx_shutdown,
|
||||
.pru_sockaddr = ipx_sockaddr,
|
||||
};
|
||||
|
||||
struct pr_usrreqs spx_usrreq_sps = {
|
||||
spx_usr_abort, spx_accept, spx_sp_attach, spx_bind,
|
||||
spx_connect, pru_connect2_notsupp, ipx_control, spx_detach,
|
||||
spx_usr_disconnect, spx_listen, ipx_peeraddr, spx_rcvd,
|
||||
spx_rcvoob, spx_send, pru_sense_null, spx_shutdown,
|
||||
ipx_sockaddr, sosend, soreceive, sopoll, pru_sosetlabel_null
|
||||
.pru_abort = spx_usr_abort,
|
||||
.pru_accept = spx_accept,
|
||||
.pru_attach = spx_sp_attach,
|
||||
.pru_bind = spx_bind,
|
||||
.pru_connect = spx_connect,
|
||||
.pru_control = ipx_control,
|
||||
.pru_detach = spx_detach,
|
||||
.pru_disconnect = spx_usr_disconnect,
|
||||
.pru_listen = spx_listen,
|
||||
.pru_peeraddr = ipx_peeraddr,
|
||||
.pru_rcvd = spx_rcvd,
|
||||
.pru_rcvoob = spx_rcvoob,
|
||||
.pru_send = spx_send,
|
||||
.pru_shutdown = spx_shutdown,
|
||||
.pru_sockaddr = ipx_sockaddr,
|
||||
};
|
||||
|
||||
void
|
||||
|
@ -473,16 +473,16 @@ key_sockaddr(struct socket *so, struct sockaddr **nam)
|
||||
}
|
||||
|
||||
struct pr_usrreqs key_usrreqs = {
|
||||
key_abort, pru_accept_notsupp,
|
||||
key_attach,
|
||||
key_bind,
|
||||
key_connect,
|
||||
pru_connect2_notsupp, pru_control_notsupp, key_detach,
|
||||
key_disconnect, pru_listen_notsupp, key_peeraddr,
|
||||
pru_rcvd_notsupp,
|
||||
pru_rcvoob_notsupp, key_send, pru_sense_null, key_shutdown,
|
||||
key_sockaddr, sosend, soreceive, sopoll,
|
||||
pru_sosetlabel_null
|
||||
.pru_abort = key_abort,
|
||||
.pru_attach = key_attach,
|
||||
.pru_bind = key_bind,
|
||||
.pru_connect = key_connect,
|
||||
.pru_detach = key_detach,
|
||||
.pru_disconnect = key_disconnect,
|
||||
.pru_peeraddr = key_peeraddr,
|
||||
.pru_send = key_send,
|
||||
.pru_shutdown = key_shutdown,
|
||||
.pru_sockaddr = key_sockaddr,
|
||||
};
|
||||
|
||||
/* sysctl */
|
||||
|
@ -393,12 +393,17 @@ natm_usr_sockaddr(struct socket *so, struct sockaddr **nam)
|
||||
|
||||
/* xxx - should be const */
|
||||
struct pr_usrreqs natm_usrreqs = {
|
||||
natm_usr_abort, pru_accept_notsupp, natm_usr_attach, natm_usr_bind,
|
||||
natm_usr_connect, pru_connect2_notsupp, natm_usr_control,
|
||||
natm_usr_detach, natm_usr_disconnect, pru_listen_notsupp,
|
||||
natm_usr_peeraddr, pru_rcvd_notsupp, pru_rcvoob_notsupp,
|
||||
natm_usr_send, pru_sense_null, natm_usr_shutdown,
|
||||
natm_usr_sockaddr, sosend, soreceive, sopoll, pru_sosetlabel_null
|
||||
.pru_abort = natm_usr_abort,
|
||||
.pru_attach = natm_usr_attach,
|
||||
.pru_bind = natm_usr_bind,
|
||||
.pru_connect = natm_usr_connect,
|
||||
.pru_control = natm_usr_control,
|
||||
.pru_detach = natm_usr_detach,
|
||||
.pru_disconnect = natm_usr_disconnect,
|
||||
.pru_peeraddr = natm_usr_peeraddr,
|
||||
.pru_send = natm_usr_send,
|
||||
.pru_shutdown = natm_usr_shutdown,
|
||||
.pru_sockaddr = natm_usr_sockaddr,
|
||||
};
|
||||
|
||||
#else /* !FREEBSD_USRREQS */
|
||||
|
@ -190,8 +190,12 @@ struct uio;
|
||||
* Having this structure separated out from the main protoswitch is allegedly
|
||||
* a big (12 cycles per call) lose on high-end CPUs. We will eventually
|
||||
* migrate this stuff back into the main structure.
|
||||
*
|
||||
* Some fields initialized to defaults if they are NULL.
|
||||
* See uipc_domain.c:net_init_domain()
|
||||
*/
|
||||
struct pr_usrreqs {
|
||||
double __Break_the_struct_layout_for_now;
|
||||
int (*pru_abort)(struct socket *so);
|
||||
int (*pru_accept)(struct socket *so, struct sockaddr **nam);
|
||||
int (*pru_attach)(struct socket *so, int proto, struct thread *td);
|
||||
|
Loading…
Reference in New Issue
Block a user