MCPcopy Create free account
hub / github.com/F-Stack/f-stack / sctp_free_bufspace

Function sctp_free_bufspace

freebsd/netinet/sctputil.c:4973–5002  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4971
4972#ifdef SCTP_MBCNT_LOGGING
4973void
4974sctp_free_bufspace(struct sctp_tcb *stcb, struct sctp_association *asoc,
4975 struct sctp_tmit_chunk *tp1, int chk_cnt)
4976{
4977 if (tp1->data == NULL) {
4978 return;
4979 }
4980 asoc->chunks_on_out_queue -= chk_cnt;
4981 if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBCNT_LOGGING_ENABLE) {
4982 sctp_log_mbcnt(SCTP_LOG_MBCNT_DECREASE,
4983 asoc->total_output_queue_size,
4984 tp1->book_size,
4985 0,
4986 tp1->mbcnt);
4987 }
4988 if (asoc->total_output_queue_size >= tp1->book_size) {
4989 atomic_add_int(&asoc->total_output_queue_size, -tp1->book_size);
4990 } else {
4991 asoc->total_output_queue_size = 0;
4992 }
4993
4994 if (stcb->sctp_socket && (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) ||
4995 ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE)))) {
4996 if (stcb->sctp_socket->so_snd.sb_cc >= tp1->book_size) {
4997 stcb->sctp_socket->so_snd.sb_cc -= tp1->book_size;
4998 } else {
4999 stcb->sctp_socket->so_snd.sb_cc = 0;
5000 }
5001 }
5002}
5003
5004#endif
5005

Callers 7

sctp_process_initFunction · 0.85
sctp_report_all_outboundFunction · 0.85
sctp_express_handle_sackFunction · 0.85
sctp_handle_sackFunction · 0.85
sctp_recover_sent_listFunction · 0.85

Calls 1

sctp_log_mbcntFunction · 0.85

Tested by

no test coverage detected