Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/sctp_sysctl.c
Show First 20 Lines • Show All 404 Lines • ▼ Show 20 Lines | LIST_FOREACH(inp, &SCTP_BASE_INFO(listhead), sctp_list) { | ||||
xinpcb.features = inp->sctp_features; | xinpcb.features = inp->sctp_features; | ||||
xinpcb.total_sends = inp->total_sends; | xinpcb.total_sends = inp->total_sends; | ||||
xinpcb.total_recvs = inp->total_recvs; | xinpcb.total_recvs = inp->total_recvs; | ||||
xinpcb.total_nospaces = inp->total_nospaces; | xinpcb.total_nospaces = inp->total_nospaces; | ||||
xinpcb.fragmentation_point = inp->sctp_frag_point; | xinpcb.fragmentation_point = inp->sctp_frag_point; | ||||
xinpcb.socket = inp->sctp_socket; | xinpcb.socket = inp->sctp_socket; | ||||
so = inp->sctp_socket; | so = inp->sctp_socket; | ||||
if ((so == NULL) || | if ((so == NULL) || | ||||
!SOLISTENING(so) || | |||||
(inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE)) { | (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE)) { | ||||
xinpcb.qlen = 0; | xinpcb.qlen = 0; | ||||
xinpcb.maxqlen = 0; | xinpcb.maxqlen = 0; | ||||
} else { | } else { | ||||
xinpcb.qlen = so->so_qlen; | xinpcb.qlen = so->sol_qlen; | ||||
xinpcb.qlen_old = so->so_qlen > USHRT_MAX ? | xinpcb.qlen_old = so->sol_qlen > USHRT_MAX ? | ||||
USHRT_MAX : (uint16_t)so->so_qlen; | USHRT_MAX : (uint16_t)so->sol_qlen; | ||||
xinpcb.maxqlen = so->so_qlimit; | xinpcb.maxqlen = so->sol_qlimit; | ||||
xinpcb.maxqlen_old = so->so_qlimit > USHRT_MAX ? | xinpcb.maxqlen_old = so->sol_qlimit > USHRT_MAX ? | ||||
USHRT_MAX : (uint16_t)so->so_qlimit; | USHRT_MAX : (uint16_t)so->sol_qlimit; | ||||
} | } | ||||
SCTP_INP_INCR_REF(inp); | SCTP_INP_INCR_REF(inp); | ||||
SCTP_INP_RUNLOCK(inp); | SCTP_INP_RUNLOCK(inp); | ||||
SCTP_INP_INFO_RUNLOCK(); | SCTP_INP_INFO_RUNLOCK(); | ||||
error = SYSCTL_OUT(req, &xinpcb, sizeof(struct xsctp_inpcb)); | error = SYSCTL_OUT(req, &xinpcb, sizeof(struct xsctp_inpcb)); | ||||
if (error) { | if (error) { | ||||
SCTP_INP_DECR_REF(inp); | SCTP_INP_DECR_REF(inp); | ||||
return (error); | return (error); | ||||
▲ Show 20 Lines • Show All 514 Lines • Show Last 20 Lines |