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

Function sctp_notify_sender_dry_event

freebsd/netinet/sctputil.c:3766–3811  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3764}
3765
3766static void
3767sctp_notify_sender_dry_event(struct sctp_tcb *stcb,
3768 int so_locked)
3769{
3770 struct mbuf *m_notify;
3771 struct sctp_sender_dry_event *event;
3772 struct sctp_queued_to_read *control;
3773
3774 if ((stcb == NULL) ||
3775 sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_DRYEVNT)) {
3776 /* event not enabled */
3777 return;
3778 }
3779
3780 m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_sender_dry_event), 0, M_NOWAIT, 1, MT_DATA);
3781 if (m_notify == NULL) {
3782 /* no space left */
3783 return;
3784 }
3785 SCTP_BUF_LEN(m_notify) = 0;
3786 event = mtod(m_notify, struct sctp_sender_dry_event *);
3787 memset(event, 0, sizeof(struct sctp_sender_dry_event));
3788 event->sender_dry_type = SCTP_SENDER_DRY_EVENT;
3789 event->sender_dry_flags = 0;
3790 event->sender_dry_length = sizeof(struct sctp_sender_dry_event);
3791 event->sender_dry_assoc_id = sctp_get_associd(stcb);
3792
3793 SCTP_BUF_LEN(m_notify) = sizeof(struct sctp_sender_dry_event);
3794 SCTP_BUF_NEXT(m_notify) = NULL;
3795
3796 /* append to socket */
3797 control = sctp_build_readq_entry(stcb, stcb->asoc.primary_destination,
3798 0, 0, stcb->asoc.context, 0, 0, 0,
3799 m_notify);
3800 if (control == NULL) {
3801 /* no memory */
3802 sctp_m_freem(m_notify);
3803 return;
3804 }
3805 control->length = SCTP_BUF_LEN(m_notify);
3806 control->spec_flags = M_NOTIFICATION;
3807 /* not that we need this */
3808 control->tail_mbuf = m_notify;
3809 sctp_add_to_readq(stcb->sctp_ep, stcb, control,
3810 &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, so_locked);
3811}
3812
3813void
3814sctp_notify_stream_reset_add(struct sctp_tcb *stcb, uint16_t numberin, uint16_t numberout, int flag)

Callers 1

sctp_ulp_notifyFunction · 0.85

Calls 5

sctp_get_mbuf_for_msgFunction · 0.85
memsetFunction · 0.85
sctp_build_readq_entryFunction · 0.85
sctp_m_freemFunction · 0.85
sctp_add_to_readqFunction · 0.85

Tested by

no test coverage detected