Lines Matching defs:control

282 sctp_log_strm_del(struct sctp_queued_to_read *control, struct sctp_queued_to_read *poschk, int from)
287 if (control == NULL) {
291 sctp_clog.x.strlog.stcb = control->stcb;
292 sctp_clog.x.strlog.n_tsn = control->sinfo_tsn;
293 sctp_clog.x.strlog.n_sseq = (uint16_t)control->mid;
294 sctp_clog.x.strlog.strm = control->sinfo_stream;
2018 * Now we need to clean up the control chunk chain if an
2764 struct sctp_queued_to_read *control;
2841 control = sctp_build_readq_entry(stcb, stcb->asoc.primary_destination,
2844 if (control != NULL) {
2845 control->length = SCTP_BUF_LEN(m_notify);
2846 control->spec_flags = M_NOTIFICATION;
2848 control->tail_mbuf = m_notify;
2850 control,
2924 struct sctp_queued_to_read *control;
2987 control = sctp_build_readq_entry(stcb, stcb->asoc.primary_destination,
2990 if (control == NULL) {
2995 control->length = SCTP_BUF_LEN(m_notify);
2996 control->spec_flags = M_NOTIFICATION;
2998 control->tail_mbuf = m_notify;
3000 control,
3018 struct sctp_queued_to_read *control;
3123 control = sctp_build_readq_entry(stcb, stcb->asoc.primary_destination,
3126 if (control == NULL) {
3131 control->length = SCTP_BUF_LEN(m_notify);
3132 control->spec_flags = M_NOTIFICATION;
3134 control->tail_mbuf = m_notify;
3136 control,
3154 struct sctp_queued_to_read *control;
3226 control = sctp_build_readq_entry(stcb, stcb->asoc.primary_destination,
3229 if (control == NULL) {
3234 control->length = SCTP_BUF_LEN(m_notify);
3235 control->spec_flags = M_NOTIFICATION;
3237 control->tail_mbuf = m_notify;
3239 control,
3250 struct sctp_queued_to_read *control;
3275 control = sctp_build_readq_entry(stcb, stcb->asoc.primary_destination,
3278 if (control == NULL) {
3283 control->length = SCTP_BUF_LEN(m_notify);
3284 control->spec_flags = M_NOTIFICATION;
3286 control->tail_mbuf = m_notify;
3288 control,
3303 struct sctp_queued_to_read *control;
3332 control = sctp_build_readq_entry(stcb, stcb->asoc.primary_destination,
3335 if (control == NULL) {
3340 control->length = SCTP_BUF_LEN(m_notify);
3341 control->spec_flags = M_NOTIFICATION;
3343 control->tail_mbuf = m_notify;
3346 sctp_sblog(sb, control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBALLOC, SCTP_BUF_LEN(m_notify));
3350 sctp_sblog(sb, control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBRESULT, 0);
3352 control->end_added = 1;
3354 TAILQ_INSERT_AFTER(&stcb->sctp_ep->read_queue, stcb->asoc.control_pdapi, control, next);
3357 TAILQ_INSERT_TAIL(&stcb->sctp_ep->read_queue, control, next);
3391 struct sctp_queued_to_read *control;
3439 control = sctp_build_readq_entry(stcb, stcb->asoc.primary_destination,
3442 if (control == NULL) {
3447 control->length = SCTP_BUF_LEN(m_notify);
3448 control->spec_flags = M_NOTIFICATION;
3450 control->tail_mbuf = m_notify;
3452 control,
3466 struct sctp_queued_to_read *control;
3491 control = sctp_build_readq_entry(stcb, stcb->asoc.primary_destination,
3494 if (control == NULL) {
3499 control->length = SCTP_BUF_LEN(m_notify);
3500 control->spec_flags = M_NOTIFICATION;
3502 control->tail_mbuf = m_notify;
3503 sctp_add_to_readq(stcb->sctp_ep, stcb, control,
3512 struct sctp_queued_to_read *control;
3547 control = sctp_build_readq_entry(stcb, stcb->asoc.primary_destination,
3550 if (control == NULL) {
3555 control->length = SCTP_BUF_LEN(m_notify);
3556 control->spec_flags = M_NOTIFICATION;
3558 control->tail_mbuf = m_notify;
3560 control,
3568 struct sctp_queued_to_read *control;
3597 control = sctp_build_readq_entry(stcb, stcb->asoc.primary_destination,
3600 if (control == NULL) {
3605 control->length = SCTP_BUF_LEN(m_notify);
3606 control->spec_flags = M_NOTIFICATION;
3608 control->tail_mbuf = m_notify;
3610 control,
3621 struct sctp_queued_to_read *control;
3663 control = sctp_build_readq_entry(stcb, stcb->asoc.primary_destination,
3666 if (control == NULL) {
3671 control->length = SCTP_BUF_LEN(m_notify);
3672 control->spec_flags = M_NOTIFICATION;
3674 control->tail_mbuf = m_notify;
3676 control,
3686 struct sctp_queued_to_read *control;
3729 control = sctp_build_readq_entry(stcb, stcb->asoc.primary_destination,
3732 if (control != NULL) {
3733 control->length = SCTP_BUF_LEN(m_notify);
3734 control->spec_flags = M_NOTIFICATION;
3736 control->tail_mbuf = m_notify;
3738 control,
4488 * go through our old INP and pull off any control structures that
4492 struct sctp_queued_to_read *control, *nctl;
4515 TAILQ_FOREACH_SAFE(control, &old_inp->read_queue, next, nctl) {
4517 if (control->stcb == stcb) {
4519 TAILQ_REMOVE(&old_inp->read_queue, control, next);
4520 TAILQ_INSERT_TAIL(&tmp_queue, control, next);
4521 m = control->data;
4524 sctp_sblog(&old_so->so_rcv, control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBFREE, SCTP_BUF_LEN(m));
4526 sctp_sbfree(control, stcb, &old_so->so_rcv, m);
4528 sctp_sblog(&old_so->so_rcv, control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBRESULT, 0);
4540 TAILQ_FOREACH_SAFE(control, &tmp_queue, next, nctl) {
4541 TAILQ_INSERT_TAIL(&new_inp->read_queue, control, next);
4542 m = control->data;
4545 sctp_sblog(&new_so->so_rcv, control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBALLOC, SCTP_BUF_LEN(m));
4549 sctp_sblog(&new_so->so_rcv, control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBRESULT, 0);
4599 struct sctp_queued_to_read *control,
4610 * Here we must place the control on the end of the socket read
4626 sctp_free_remote_addr(control->whoFrom);
4627 if (control->data) {
4628 sctp_m_freem(control->data);
4629 control->data = NULL;
4631 sctp_free_a_readq(stcb, control);
4636 if (!(control->spec_flags & M_NOTIFICATION)) {
4638 if (!control->do_not_ref_stcb) {
4642 m = control->data;
4643 control->held_length = 0;
4644 control->length = 0;
4650 control->data = sctp_m_free(m);
4651 m = control->data;
4657 control->tail_mbuf = prev;
4663 sctp_sblog(sb, control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBALLOC, SCTP_BUF_LEN(m));
4667 sctp_sblog(sb, control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBRESULT, 0);
4669 atomic_add_int(&control->length, SCTP_BUF_LEN(m));
4673 control->tail_mbuf = prev;
4676 sctp_free_remote_addr(control->whoFrom);
4677 sctp_free_a_readq(stcb, control);
4683 control->end_added = 1;
4685 TAILQ_INSERT_TAIL(&inp->read_queue, control, next);
4686 control->on_read_q = 1;
5281 struct sctp_queued_to_read *control = NULL, *ctl = NULL, *nxt = NULL;
5437 control = TAILQ_FIRST(&inp->read_queue);
5438 if (control == NULL) {
5447 control = TAILQ_FIRST(&inp->read_queue);
5448 if ((control == NULL) && (so->so_rcv.sb_cc != 0)) {
5450 panic("Huh, its non zero and nothing on control?");
5459 if ((control->length == 0) &&
5460 (control->do_not_ref_stcb)) {
5470 control->held_length = 0;
5471 if (control->data) {
5476 m_tmp = control->data;
5480 control->tail_mbuf = m_tmp;
5481 control->end_added = 1;
5485 control->length = cnt;
5488 TAILQ_REMOVE(&inp->read_queue, control, next);
5490 sctp_free_remote_addr(control->whoFrom);
5491 sctp_free_a_readq(stcb, control);
5499 if ((control->length == 0) &&
5500 (control->end_added == 1)) {
5502 * Do we also need to check for (control->pdapi_aborted ==
5509 TAILQ_REMOVE(&inp->read_queue, control, next);
5510 if (control->data) {
5512 panic("control->data not null but control->length == 0");
5514 SCTP_PRINTF("Strange, data left in the control buffer. Cleaning up.\n");
5515 sctp_m_freem(control->data);
5516 control->data = NULL;
5519 if (control->aux_data) {
5520 sctp_m_free(control->aux_data);
5521 control->aux_data = NULL;
5524 if (control->on_strm_q) {
5526 control, so, control->on_strm_q);
5529 sctp_free_remote_addr(control->whoFrom);
5530 sctp_free_a_readq(stcb, control);
5537 if (control->length == 0) {
5541 ctl = TAILQ_NEXT(control, next);
5543 if ((ctl->stcb != control->stcb) && (ctl->length) &&
5556 control = ctl;
5572 control = ctl;
5584 control->held_length = so->so_rcv.sb_cc;
5588 control->held_length = 0;
5591 * If we reach here, control has a some data for us to read off.
5598 control->some_taken++;
5599 stcb = control->stcb;
5601 if ((control->do_not_ref_stcb == 0) &&
5605 } else if (control->do_not_ref_stcb == 0) {
5638 ((control->spec_flags & M_NOTIFICATION) == 0) &&
5639 control->do_not_ref_stcb == 0) {
5640 stcb->asoc.strmin[control->sinfo_stream].delivery_started = 1;
5645 sinfo->sinfo_stream = control->sinfo_stream;
5646 sinfo->sinfo_ssn = (uint16_t)control->mid;
5647 sinfo->sinfo_flags = control->sinfo_flags;
5648 sinfo->sinfo_ppid = control->sinfo_ppid;
5649 sinfo->sinfo_context = control->sinfo_context;
5650 sinfo->sinfo_timetolive = control->sinfo_timetolive;
5651 sinfo->sinfo_tsn = control->sinfo_tsn;
5652 sinfo->sinfo_cumtsn = control->sinfo_cumtsn;
5653 sinfo->sinfo_assoc_id = control->sinfo_assoc_id;
5654 nxt = TAILQ_NEXT(control, next);
5682 * sinfo_ that is on the control's structure
5696 if ((control->do_not_ref_stcb == 0) && stcb)
5703 if ((control->sinfo_flags >> 8) & SCTP_DATA_UNORDERED) {
5720 entry->vtag = control->sinfo_assoc_id;
5721 entry->strm = control->sinfo_stream;
5722 entry->seq = (uint16_t)control->mid;
5723 entry->sz = control->length;
5724 entry->flgs = control->sinfo_flags;
5731 switch (control->whoFrom->ro._l_addr.sa.sa_family) {
5735 store.sin6 = control->whoFrom->ro._l_addr.sin6;
5736 store.sin6.sin6_port = control->port_from;
5744 in6_sin_2_v4mapsin6(&control->whoFrom->ro._l_addr.sin,
5746 store.sin6.sin6_port = control->port_from;
5749 store.sin = control->whoFrom->ro._l_addr.sin;
5750 store.sin.sin_port = control->port_from;
5754 store.sin = control->whoFrom->ro._l_addr.sin;
5755 store.sin.sin_port = control->port_from;
5785 m = control->data;
5805 if ((control->do_not_ref_stcb == 0) && stcb &&
5817 (control->end_added)) {
5819 if ((control->do_not_ref_stcb == 0) &&
5820 (control->stcb != NULL) &&
5821 ((control->spec_flags & M_NOTIFICATION) == 0))
5822 control->stcb->asoc.strmin[control->sinfo_stream].delivery_started = 0;
5824 if (control->spec_flags & M_NOTIFICATION) {
5836 control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBFREE, SCTP_BUF_LEN(m));
5838 sctp_sbfree(control, stcb, &so->so_rcv, m);
5841 control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBRESULT, 0);
5846 atomic_subtract_int(&control->length, cp_len);
5847 control->data = sctp_m_free(m);
5848 m = control->data;
5853 if (control->data == NULL) {
5855 if ((control->end_added == 0) ||
5856 (TAILQ_NEXT(control, next) == NULL)) {
5869 control->tail_mbuf = NULL;
5871 if ((control->end_added) && ((out_flags & MSG_EOR) == 0)) {
5879 if (control->spec_flags & M_NOTIFICATION) {
5886 sctp_sblog(&so->so_rcv, control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBFREE, (int)cp_len);
5889 if ((control->do_not_ref_stcb == 0) &&
5897 sctp_sblog(&so->so_rcv, control->do_not_ref_stcb ? NULL : stcb,
5900 atomic_subtract_int(&control->length, cp_len);
5909 (control->do_not_ref_stcb == 0) &&
5917 * control->length == 0.
5920 /* we are done with this control */
5921 if (control->length == 0) {
5922 if (control->data) {
5924 panic("control->data not null at read eor?");
5926 SCTP_PRINTF("Strange, data left in the control buffer .. invarients would panic?\n");
5927 sctp_m_freem(control->data);
5928 control->data = NULL;
5936 TAILQ_REMOVE(&inp->read_queue, control, next);
5938 if (control->held_length) {
5940 control->held_length = 0;
5943 if (control->aux_data) {
5944 sctp_m_free(control->aux_data);
5945 control->aux_data = NULL;
5947 no_rcv_needed = control->do_not_ref_stcb;
5948 sctp_free_remote_addr(control->whoFrom);
5949 control->data = NULL;
5951 if (control->on_strm_q) {
5953 control, so, control->on_strm_q);
5956 sctp_free_a_readq(stcb, control);
5957 control = NULL;
5967 * control to read.
5970 if (control->end_added &&
5971 (control->data == NULL) &&
5972 (control->tail_mbuf == NULL)) {
5973 panic("Gak, control->length is corrupt?");
5976 no_rcv_needed = control->do_not_ref_stcb;
6000 * is NOT to our control when we wakeup.
6009 (control->do_not_ref_stcb == 0) &&
6029 if ((copied_so_far) && (control->length == 0) &&
6033 if (so->so_rcv.sb_cc <= control->held_length) {
6038 control->held_length = 0;
6044 if (control->length == 0) {
6046 if (control->end_added == 1) {
6049 if (control->pdapi_aborted) {
6050 if ((control->do_not_ref_stcb == 0) && ((control->spec_flags & M_NOTIFICATION) == 0))
6051 control->stcb->asoc.strmin[control->sinfo_stream].delivery_started = 0;
6055 if ((control->do_not_ref_stcb == 0) && ((control->spec_flags & M_NOTIFICATION) == 0))
6056 control->stcb->asoc.strmin[control->sinfo_stream].delivery_started = 0;
6061 control->held_length = so->so_rcv.sb_cc;
6065 } else if (control->data == NULL) {
6071 if ((control->length > 0) && (control->data == NULL)) {
6081 control->length = 0;
6095 if ((control->end_added == 0) ||
6096 (TAILQ_NEXT(control, next) == NULL)) {
6103 if (control->end_added) {
6105 if ((control->do_not_ref_stcb == 0) &&
6106 (control->stcb != NULL) &&
6107 ((control->spec_flags & M_NOTIFICATION) == 0))
6108 control->stcb->asoc.strmin[control->sinfo_stream].delivery_started = 0;
6110 if (control->spec_flags & M_NOTIFICATION) {
6113 uio->uio_resid = control->length;
6114 *mp = control->data;
6115 m = control->data;
6119 control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBFREE, SCTP_BUF_LEN(m));
6121 sctp_sbfree(control, stcb, &so->so_rcv, m);
6126 control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBRESULT, 0);
6130 control->data = control->tail_mbuf = NULL;
6131 control->length = 0;
6133 /* Done with this control */
6157 (control && (control->do_not_ref_stcb == 0)) &&