Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/udp_usrreq.c
Show First 20 Lines • Show All 1,747 Lines • ▼ Show 20 Lines | udp_shutdown(struct socket *so) | ||||
KASSERT(inp != NULL, ("udp_shutdown: inp == NULL")); | KASSERT(inp != NULL, ("udp_shutdown: inp == NULL")); | ||||
INP_WLOCK(inp); | INP_WLOCK(inp); | ||||
socantsendmore(so); | socantsendmore(so); | ||||
INP_WUNLOCK(inp); | INP_WUNLOCK(inp); | ||||
return (0); | return (0); | ||||
} | } | ||||
#ifdef INET | #ifdef INET | ||||
struct pr_usrreqs udp_usrreqs = { | #define UDP_PROTOSW \ | ||||
.pru_abort = udp_abort, | .pr_type = SOCK_DGRAM, \ | ||||
.pru_attach = udp_attach, | .pr_flags = PR_ATOMIC | PR_ADDR | PR_CAPATTACH, \ | ||||
.pru_bind = udp_bind, | .pr_ctloutput = udp_ctloutput, \ | ||||
.pru_connect = udp_connect, | .pr_abort = udp_abort, \ | ||||
.pru_control = in_control, | .pr_attach = udp_attach, \ | ||||
.pru_detach = udp_detach, | .pr_bind = udp_bind, \ | ||||
.pru_disconnect = udp_disconnect, | .pr_connect = udp_connect, \ | ||||
.pru_peeraddr = in_getpeeraddr, | .pr_control = in_control, \ | ||||
.pru_send = udp_send, | .pr_detach = udp_detach, \ | ||||
.pru_soreceive = soreceive_dgram, | .pr_disconnect = udp_disconnect, \ | ||||
.pru_sosend = sosend_dgram, | .pr_peeraddr = in_getpeeraddr, \ | ||||
.pru_shutdown = udp_shutdown, | .pr_send = udp_send, \ | ||||
.pru_sockaddr = in_getsockaddr, | .pr_soreceive = soreceive_dgram, \ | ||||
.pru_sosetlabel = in_pcbsosetlabel, | .pr_sosend = sosend_dgram, \ | ||||
.pru_close = udp_close, | .pr_shutdown = udp_shutdown, \ | ||||
.pr_sockaddr = in_getsockaddr, \ | |||||
.pr_sosetlabel = in_pcbsosetlabel, \ | |||||
.pr_close = udp_close | |||||
struct protosw udp_protosw = { | |||||
.pr_protocol = IPPROTO_UDP, | |||||
UDP_PROTOSW | |||||
}; | |||||
struct protosw udplite_protosw = { | |||||
.pr_protocol = IPPROTO_UDPLITE, | |||||
UDP_PROTOSW | |||||
}; | }; | ||||
static void | static void | ||||
udp_init(void *arg __unused) | udp_init(void *arg __unused) | ||||
{ | { | ||||
IPPROTO_REGISTER(IPPROTO_UDP, udp_input, udp_ctlinput); | IPPROTO_REGISTER(IPPROTO_UDP, udp_input, udp_ctlinput); | ||||
IPPROTO_REGISTER(IPPROTO_UDPLITE, udp_input, udplite_ctlinput); | IPPROTO_REGISTER(IPPROTO_UDPLITE, udp_input, udplite_ctlinput); | ||||
} | } | ||||
SYSINIT(udp_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, udp_init, NULL); | SYSINIT(udp_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, udp_init, NULL); | ||||
#endif /* INET */ | #endif /* INET */ |