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

Function sctp_sendall_iterator

freebsd/netinet/sctp_output.c:6572–6753  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6570 struct timeval *now, int *now_filled, int frag_point, int so_locked);
6571
6572static void
6573sctp_sendall_iterator(struct sctp_inpcb *inp, struct sctp_tcb *stcb, void *ptr,
6574 uint32_t val SCTP_UNUSED)
6575{
6576 struct sctp_copy_all *ca;
6577 struct mbuf *m;
6578 int ret = 0;
6579 int added_control = 0;
6580 int un_sent, do_chunk_output = 1;
6581 struct sctp_association *asoc;
6582 struct sctp_nets *net;
6583
6584 ca = (struct sctp_copy_all *)ptr;
6585 if (ca->m == NULL) {
6586 return;
6587 }
6588 if (ca->inp != inp) {
6589 /* TSNH */
6590 return;
6591 }
6592 if (ca->sndlen > 0) {
6593 m = SCTP_M_COPYM(ca->m, 0, M_COPYALL, M_NOWAIT);
6594 if (m == NULL) {
6595 /* can't copy so we are done */
6596 ca->cnt_failed++;
6597 return;
6598 }
6599#ifdef SCTP_MBUF_LOGGING
6600 if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) {
6601 sctp_log_mbc(m, SCTP_MBUF_ICOPY);
6602 }
6603#endif
6604 } else {
6605 m = NULL;
6606 }
6607 SCTP_TCB_LOCK_ASSERT(stcb);
6608 if (stcb->asoc.alternate) {
6609 net = stcb->asoc.alternate;
6610 } else {
6611 net = stcb->asoc.primary_destination;
6612 }
6613 if (ca->sndrcv.sinfo_flags & SCTP_ABORT) {
6614 /* Abort this assoc with m as the user defined reason */
6615 if (m != NULL) {
6616 SCTP_BUF_PREPEND(m, sizeof(struct sctp_paramhdr), M_NOWAIT);
6617 } else {
6618 m = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr),
6619 0, M_NOWAIT, 1, MT_DATA);
6620 SCTP_BUF_LEN(m) = sizeof(struct sctp_paramhdr);
6621 }
6622 if (m != NULL) {
6623 struct sctp_paramhdr *ph;
6624
6625 ph = mtod(m, struct sctp_paramhdr *);
6626 ph->param_type = htons(SCTP_CAUSE_USER_INITIATED_ABT);
6627 ph->param_length = htons((uint16_t)(sizeof(struct sctp_paramhdr) + ca->sndlen));
6628 }
6629 /*

Callers

nothing calls this directly

Calls 12

sctp_log_mbcFunction · 0.85
sctp_get_mbuf_for_msgFunction · 0.85
sctp_msg_appendFunction · 0.85
sctp_send_shutdownFunction · 0.85
sctp_timer_startFunction · 0.85
sctp_generate_causeFunction · 0.85
sctp_chunk_outputFunction · 0.85
sctp_get_frag_pointFunction · 0.85
sctp_med_chunk_outputFunction · 0.85

Tested by

no test coverage detected