Lines Matching full:control

62 sctp_add_chk_to_control(struct sctp_queued_to_read *control,
329 struct sctp_queued_to_read *control)
335 flags = (control->sinfo_flags >> 8);
347 TAILQ_INSERT_TAIL(q, control, next_instrm);
348 control->on_strm_q = SCTP_ON_UNORDERED;
355 control->end_added = 1;
356 control->first_frag_seen = 1;
357 control->last_frag_seen = 1;
361 TAILQ_INSERT_HEAD(q, control, next_instrm);
363 control->on_strm_q = SCTP_ON_UNORDERED;
365 control->on_strm_q = SCTP_ON_ORDERED;
370 if (SCTP_MID_GT(asoc->idata_supported, at->mid, control->mid)) {
375 TAILQ_INSERT_BEFORE(at, control, next_instrm);
377 control->on_strm_q = SCTP_ON_UNORDERED;
379 control->on_strm_q = SCTP_ON_ORDERED;
382 } else if (SCTP_MID_EQ(asoc->idata_supported, at->mid, control->mid)) {
395 sctp_log_strm_del(control, at,
398 TAILQ_INSERT_AFTER(q, at, control, next_instrm);
400 control->on_strm_q = SCTP_ON_UNORDERED;
402 control->on_strm_q = SCTP_ON_ORDERED;
414 struct sctp_queued_to_read *control,
425 control->fsn_included,
433 control->fsn_included,
449 sctp_clean_up_control(struct sctp_tcb *stcb, struct sctp_queued_to_read *control)
452 * The control could not be placed and must be cleaned.
456 TAILQ_FOREACH_SAFE(chk, &control->reasm, sctp_next, nchk) {
457 TAILQ_REMOVE(&control->reasm, chk, sctp_next);
463 sctp_free_remote_addr(control->whoFrom);
464 if (control->data) {
465 sctp_m_freem(control->data);
466 control->data = NULL;
468 sctp_free_a_readq(stcb, control);
475 * long as the control's entered are non-fragmented.
480 struct sctp_queued_to_read *control, int *abort_flag, int *need_reasm)
507 strm = &asoc->strmin[control->sinfo_stream];
509 sctp_log_strm_del(control, NULL, SCTP_STR_LOG_FROM_INTO_STRD);
511 if (SCTP_MID_GT((asoc->idata_supported), strm->last_mid_delivered, control->mid)) {
514 strm->last_mid_delivered, control->mid);
519 TAILQ_INSERT_HEAD(&strm->inqueue, control, next_instrm);
522 strm->last_mid_delivered, control->sinfo_tsn,
523 control->sinfo_stream, control->mid);
527 control->sinfo_tsn,
528 control->sinfo_stream,
529 (uint16_t)control->mid);
538 asoc->size_on_all_streams += control->length;
541 if (SCTP_MID_EQ(asoc->idata_supported, nxt_todel, control->mid)) {
544 sctp_log_strm_del(control, NULL, SCTP_STR_LOG_FROM_IMMED_DEL);
548 if (asoc->size_on_all_streams >= control->length) {
549 asoc->size_on_all_streams -= control->length;
552 panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length);
559 sctp_mark_non_revokable(asoc, control->sinfo_tsn);
561 control,
564 TAILQ_FOREACH_SAFE(control, &strm->inqueue, next_instrm, at) {
567 if (SCTP_MID_EQ(asoc->idata_supported, nxt_todel, control->mid) &&
568 (((control->sinfo_flags >> 8) & SCTP_DATA_NOT_FRAG) == SCTP_DATA_NOT_FRAG)) {
569 if (control->on_strm_q == SCTP_ON_ORDERED) {
570 TAILQ_REMOVE(&strm->inqueue, control, next_instrm);
571 if (asoc->size_on_all_streams >= control->length) {
572 asoc->size_on_all_streams -= control->length;
575 panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length);
583 panic("Huh control: %p is on_strm_q: %d",
584 control, control->on_strm_q);
587 control->on_strm_q = 0;
596 sctp_log_strm_del(control, NULL,
599 sctp_mark_non_revokable(asoc, control->sinfo_tsn);
601 control,
606 } else if (SCTP_MID_EQ(asoc->idata_supported, nxt_todel, control->mid)) {
617 if (sctp_place_control_in_stream(strm, asoc, control)) {
619 "Queue to str MID: %u duplicate", control->mid);
620 sctp_clean_up_control(stcb, control);
630 sctp_setup_tail_pointer(struct sctp_queued_to_read *control)
635 stcb = control->stcb;
636 control->held_length = 0;
637 control->length = 0;
638 m = control->data;
644 control->data = sctp_m_free(m);
645 m = control->data;
651 control->tail_mbuf = prev;
656 atomic_add_int(&control->length, SCTP_BUF_LEN(m));
657 if (control->on_read_q) {
667 control->tail_mbuf = prev;
672 sctp_add_to_tail_pointer(struct sctp_queued_to_read *control, struct mbuf *m, uint32_t *added)
677 stcb = control->stcb;
680 panic("Control broken");
685 if (control->tail_mbuf == NULL) {
687 sctp_m_freem(control->data);
688 control->data = m;
689 sctp_setup_tail_pointer(control);
692 control->tail_mbuf->m_next = m;
698 control->tail_mbuf->m_next = sctp_m_free(m);
699 m = control->tail_mbuf->m_next;
705 control->tail_mbuf = prev;
710 if (control->on_read_q) {
718 atomic_add_int(&control->length, SCTP_BUF_LEN(m));
722 control->tail_mbuf = prev;
727 sctp_build_readq_entry_from_ctl(struct sctp_queued_to_read *nc, struct sctp_queued_to_read *control)
730 nc->sinfo_stream = control->sinfo_stream;
731 nc->mid = control->mid;
733 nc->top_fsn = control->top_fsn;
734 nc->mid = control->mid;
735 nc->sinfo_flags = control->sinfo_flags;
736 nc->sinfo_ppid = control->sinfo_ppid;
737 nc->sinfo_context = control->sinfo_context;
739 nc->sinfo_tsn = control->sinfo_tsn;
740 nc->sinfo_cumtsn = control->sinfo_cumtsn;
741 nc->sinfo_assoc_id = control->sinfo_assoc_id;
742 nc->whoFrom = control->whoFrom;
744 nc->stcb = control->stcb;
745 nc->port_from = control->port_from;
746 nc->do_not_ref_stcb = control->do_not_ref_stcb;
753 struct sctp_queued_to_read *control,
760 * to see if we have it all. If you return one, no other control
770 if (control->first_frag_seen == 0) {
777 fsn = control->fsn_included + 1;
779 TAILQ_FOREACH_SAFE(chk, &control->reasm, sctp_next, lchk) {
787 TAILQ_REMOVE(&control->reasm, chk, sctp_next);
788 sctp_add_chk_to_control(control, strm, stcb, asoc, chk, inp_read_lock_held);
792 if (control->end_added) {
794 if (!TAILQ_EMPTY(&control->reasm)) {
797 * on the control queue to a new
798 * control.
800 sctp_build_readq_entry_from_ctl(nc, control);
801 tchk = TAILQ_FIRST(&control->reasm);
803 TAILQ_REMOVE(&control->reasm, tchk, sctp_next);
823 tchk = TAILQ_FIRST(&control->reasm);
827 TAILQ_REMOVE(&control->reasm, tchk, sctp_next);
829 tchk = TAILQ_FIRST(&control->reasm);
833 * after removing control
837 if (control->on_strm_q) {
838 TAILQ_REMOVE(&strm->uno_inqueue, control, next_instrm);
839 control->on_strm_q = 0;
842 if (control->pdapi_started) {
844 control->pdapi_started = 0;
846 if (control->on_strm_q) {
847 TAILQ_REMOVE(&strm->uno_inqueue, control, next_instrm);
848 control->on_strm_q = 0;
851 if (control->on_read_q == 0) {
852 sctp_add_to_readq(stcb->sctp_ep, stcb, control,
853 &stcb->sctp_socket->so_rcv, control->end_added,
862 control = nc;
881 if ((control->length > pd_point) && (strm->pd_api_started == 0)) {
883 control->pdapi_started = 1;
884 sctp_add_to_readq(stcb->sctp_ep, stcb, control,
885 &stcb->sctp_socket->so_rcv, control->end_added,
897 struct sctp_queued_to_read *control,
905 * Here we need to place the chunk into the control structure sorted
913 at = TAILQ_FIRST(&control->reasm);
922 if (control->first_frag_seen) {
925 * control multiple messages. As long as the next
932 if (SCTP_TSN_GT(chk->rec.data.fsn, control->fsn_included)) {
939 if ((chk->rec.data.fsn == control->fsn_included) ||
940 (control->pdapi_started)) {
953 sctp_abort_in_reasm(stcb, control, chk,
965 tdata = control->data;
966 control->data = chk->data;
969 chk->send_size = control->length;
970 /* Recompute length of control and tail pointer */
971 sctp_setup_tail_pointer(control);
973 tmp = control->fsn_included;
974 control->fsn_included = chk->rec.data.fsn;
977 tmp = control->sinfo_tsn;
978 control->sinfo_tsn = chk->rec.data.tsn;
981 tmp = control->sinfo_ppid;
982 control->sinfo_ppid = chk->rec.data.ppid;
987 control->first_frag_seen = 1;
988 control->fsn_included = chk->rec.data.fsn;
989 control->top_fsn = chk->rec.data.fsn;
990 control->sinfo_tsn = chk->rec.data.tsn;
991 control->sinfo_ppid = chk->rec.data.ppid;
992 control->data = chk->data;
996 sctp_setup_tail_pointer(control);
1001 TAILQ_FOREACH(at, &control->reasm, sctp_next) {
1018 sctp_abort_in_reasm(stcb, control, chk,
1028 control->top_fsn = chk->rec.data.fsn;
1029 TAILQ_INSERT_TAIL(&control->reasm, chk, sctp_next);
1043 struct sctp_queued_to_read *control, *nctl = NULL;
1054 control = TAILQ_FIRST(&strm->uno_inqueue);
1056 if ((control != NULL) &&
1059 if (sctp_handle_old_unordered_data(stcb, asoc, strm, control, pd_point, inp_read_lock_held)) {
1067 while (control) {
1068 SCTPDBG(SCTP_DEBUG_XXX, "Looking at control: %p e(%d) ssn: %u top_fsn: %u inc_fsn: %u -uo\n",
1069 control, control->end_added, control->mid, control->top_fsn, control->fsn_included);
1070 nctl = TAILQ_NEXT(control, next_instrm);
1071 if (control->end_added) {
1073 if (control->on_strm_q) {
1075 if (control->on_strm_q != SCTP_ON_UNORDERED) {
1076 panic("Huh control: %p on_q: %d -- not unordered?",
1077 control, control->on_strm_q);
1081 TAILQ_REMOVE(&strm->uno_inqueue, control, next_instrm);
1082 if (asoc->size_on_all_streams >= control->length) {
1083 asoc->size_on_all_streams -= control->length;
1086 panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length);
1092 control->on_strm_q = 0;
1094 if (control->on_read_q == 0) {
1096 control,
1097 &stcb->sctp_socket->so_rcv, control->end_added,
1102 if ((control->length >= pd_point) && (strm->pd_api_started == 0)) {
1104 control->pdapi_started = 1;
1106 control,
1107 &stcb->sctp_socket->so_rcv, control->end_added,
1113 control = nctl;
1116 control = TAILQ_FIRST(&strm->inqueue);
1121 if (control == NULL) {
1124 if (SCTP_MID_EQ(asoc->idata_supported, strm->last_mid_delivered, control->mid)) {
1131 nctl = TAILQ_NEXT(control, next_instrm);
1133 "Looking at control: %p e(%d) ssn: %u top_fsn: %u inc_fsn: %u (lastdel: %u)- o\n",
1134 control, control->end_added, control->mid,
1135 control->top_fsn, control->fsn_included,
1137 if (control->end_added) {
1138 if (control->on_strm_q) {
1140 if (control->on_strm_q != SCTP_ON_ORDERED) {
1141 panic("Huh control: %p on_q: %d -- not ordered?",
1142 control, control->on_strm_q);
1146 TAILQ_REMOVE(&strm->inqueue, control, next_instrm);
1147 if (asoc->size_on_all_streams >= control->length) {
1148 asoc->size_on_all_streams -= control->length;
1151 panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length);
1157 control->on_strm_q = 0;
1159 if (strm->pd_api_started && control->pdapi_started) {
1160 control->pdapi_started = 0;
1163 if (control->on_read_q == 0) {
1165 control,
1166 &stcb->sctp_socket->so_rcv, control->end_added,
1169 control = nctl;
1181 if (control) {
1183 "Looking at control: %p e(%d) ssn: %u top_fsn: %u inc_fsn: %u (nxtdel: %u)- o\n",
1184 control, control->end_added, control->mid, control->top_fsn, control->fsn_included,
1186 nctl = TAILQ_NEXT(control, next_instrm);
1187 if (SCTP_MID_EQ(asoc->idata_supported, control->mid, next_to_del) &&
1188 (control->first_frag_seen)) {
1192 if (control->end_added) {
1194 if (control->on_strm_q) {
1196 if (control->on_strm_q != SCTP_ON_ORDERED) {
1197 panic("Huh control: %p on_q: %d -- not ordered?",
1198 control, control->on_strm_q);
1202 TAILQ_REMOVE(&strm->inqueue, control, next_instrm);
1203 if (asoc->size_on_all_streams >= control->length) {
1204 asoc->size_on_all_streams -= control->length;
1207 panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length);
1213 control->on_strm_q = 0;
1217 if (((control->sinfo_flags >> 8) & SCTP_DATA_NOT_FRAG) == SCTP_DATA_NOT_FRAG) {
1222 sctp_mark_non_revokable(asoc, control->sinfo_tsn);
1223 } else if (control->end_added == 0) {
1228 if ((control->length < pd_point) || (strm->pd_api_started)) {
1236 done = (control->end_added) && (control->last_frag_seen);
1237 if (control->on_read_q == 0) {
1239 if (asoc->size_on_all_streams >= control->length) {
1240 asoc->size_on_all_streams -= control->length;
1243 panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length);
1249 control->pdapi_started = 1;
1252 control,
1253 &stcb->sctp_socket->so_rcv, control->end_added,
1258 control = nctl;
1268 sctp_add_chk_to_control(struct sctp_queued_to_read *control,
1274 * Given a control and a chunk, merge the data from the chk onto the
1275 * control and free up the chunk resources.
1280 if (control->on_read_q) {
1290 if (control->data == NULL) {
1291 control->data = chk->data;
1292 sctp_setup_tail_pointer(control);
1294 sctp_add_to_tail_pointer(control, chk->data, &added);
1296 control->fsn_included = chk->rec.data.fsn;
1302 control->first_frag_seen = 1;
1303 control->sinfo_tsn = chk->rec.data.tsn;
1304 control->sinfo_ppid = chk->rec.data.ppid;
1308 if ((control->on_strm_q) && (control->on_read_q)) {
1309 if (control->pdapi_started) {
1310 control->pdapi_started = 0;
1313 if (control->on_strm_q == SCTP_ON_UNORDERED) {
1315 TAILQ_REMOVE(&strm->uno_inqueue, control, next_instrm);
1316 control->on_strm_q = 0;
1317 } else if (control->on_strm_q == SCTP_ON_ORDERED) {
1319 TAILQ_REMOVE(&strm->inqueue, control, next_instrm);
1322 * size_on_all_streams, since control is on
1326 control->on_strm_q = 0;
1328 } else if (control->on_strm_q) {
1329 panic("Unknown state on ctrl: %p on_strm_q: %d", control,
1330 control->on_strm_q);
1334 control->end_added = 1;
1335 control->last_frag_seen = 1;
1353 struct sctp_queued_to_read *control,
1364 strm = &asoc->strmin[control->sinfo_stream];
1368 if ((control->sinfo_flags >> 8) & SCTP_DATA_UNORDERED) {
1378 if (sctp_place_control_in_stream(strm, asoc, control)) {
1380 sctp_abort_in_reasm(stcb, control, chk,
1383 sctp_clean_up_control(stcb, control);
1388 * Ok we created this control and now lets validate
1393 sctp_abort_in_reasm(stcb, control, chk,
1401 sctp_inject_old_unordered_data(stcb, asoc, control, chk, abort_flag);
1406 * the first it goes to the control mbuf. o if its not first but the
1407 * next in sequence it goes to the control, and each succeeding one
1416 if (control->first_frag_seen) {
1423 sctp_abort_in_reasm(stcb, control, chk,
1428 control->first_frag_seen = 1;
1429 control->sinfo_ppid = chk->rec.data.ppid;
1430 control->sinfo_tsn = chk->rec.data.tsn;
1431 control->fsn_included = chk->rec.data.fsn;
1432 control->data = chk->data;
1436 sctp_setup_tail_pointer(control);
1437 asoc->size_on_all_streams += control->length;
1442 if (control->last_frag_seen == 0) {
1444 if (SCTP_TSN_GT(chk->rec.data.fsn, control->top_fsn)) {
1448 control->top_fsn = chk->rec.data.fsn;
1454 control->last_frag_seen = 1;
1455 if (SCTP_TSN_GT(control->top_fsn, chk->rec.data.fsn)) {
1459 control->top_fsn);
1460 sctp_abort_in_reasm(stcb, control, chk,
1466 if (asoc->idata_supported || control->first_frag_seen) {
1473 if (SCTP_TSN_GE(control->fsn_included, chk->rec.data.fsn)) {
1478 sctp_abort_in_reasm(stcb, control, chk,
1489 chk->rec.data.fsn, control->top_fsn);
1490 sctp_abort_in_reasm(stcb, control,
1495 if (asoc->idata_supported || control->first_frag_seen) {
1503 if (SCTP_TSN_GE(control->fsn_included, chk->rec.data.fsn)) {
1510 chk->rec.data.fsn, control->fsn_included);
1511 sctp_abort_in_reasm(stcb, control, chk,
1521 if (SCTP_TSN_GT(chk->rec.data.fsn, control->top_fsn)) {
1525 control->top_fsn);
1526 sctp_abort_in_reasm(stcb, control, chk,
1534 * reassembly for this control.
1539 TAILQ_FOREACH(at, &control->reasm, sctp_next) {
1545 sctp_abort_in_reasm(stcb, control,
1578 sctp_abort_in_reasm(stcb, control,
1590 TAILQ_INSERT_TAIL(&control->reasm, chk, sctp_next);
1594 * Ok lets see if we can suck any up into the control structure that
1602 if (control->first_frag_seen) {
1603 next_fsn = control->fsn_included + 1;
1604 TAILQ_FOREACH_SAFE(at, &control->reasm, sctp_next, nat) {
1606 /* We can add this one now to the control */
1608 "Adding more to control: %p at: %p fsn: %u next_fsn: %u included: %u\n",
1609 control, at,
1611 next_fsn, control->fsn_included);
1612 TAILQ_REMOVE(&control->reasm, at, sctp_next);
1613 lenadded = sctp_add_chk_to_control(control, strm, stcb, asoc, at, SCTP_READ_LOCK_NOT_HELD);
1614 if (control->on_read_q) {
1627 if (control->end_added && control->pdapi_started) {
1630 control->pdapi_started = 0;
1632 if (control->on_read_q == 0) {
1634 control,
1635 &stcb->sctp_socket->so_rcv, control->end_added,
1654 struct sctp_queued_to_read *control;
1657 TAILQ_FOREACH(control, &strm->inqueue, next_instrm) {
1658 if (SCTP_MID_EQ(idata_supported, control->mid, mid)) {
1664 TAILQ_FOREACH(control, &strm->uno_inqueue, next_instrm) {
1665 if (SCTP_MID_EQ(idata_supported, control->mid, mid)) {
1670 control = TAILQ_FIRST(&strm->uno_inqueue);
1673 return (control);
1691 struct sctp_queued_to_read *control, *ncontrol;
1846 * If its a fragmented message, lets see if we can find the control
1860 control = sctp_find_reasm_entry(&asoc->strmin[sid], mid, ordered, asoc->idata_supported);
1861 SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags:0x%x look for control on queues %p\n",
1862 chk_flags, control);
1865 if (control != NULL) {
1867 if (ordered && (mid != control->mid)) {
1876 if (ordered && ((control->sinfo_flags >> 8) & SCTP_DATA_UNORDERED)) {
1886 if (!ordered && (((control->sinfo_flags >> 8) & SCTP_DATA_UNORDERED) == 0)) {
1903 if (control != NULL) {
1910 if ((control->first_frag_seen) &&
1911 (tsn == control->fsn_included + 1) &&
1912 (control->end_added == 0)) {
1915 control->fsn_included);
1918 control = NULL;
1954 if (control == NULL) {
1957 if (SCTP_TSN_GT(fsn, control->top_fsn)) {
2067 * Now no matter what, we need a control, get one if we don't have
2071 if (control == NULL) {
2072 sctp_alloc_a_readq(stcb, control);
2073 sctp_build_readq_entry_mac(control, stcb, asoc->context, net, tsn,
2078 if (control == NULL) {
2085 control->data = dmbuf;
2086 control->tail_mbuf = NULL;
2087 for (mm = control->data; mm; mm = mm->m_next) {
2088 control->length += SCTP_BUF_LEN(mm);
2090 control->tail_mbuf = mm;
2093 control->end_added = 1;
2094 control->last_frag_seen = 1;
2095 control->first_frag_seen = 1;
2096 control->fsn_included = fsn;
2097 control->top_fsn = fsn;
2101 SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags: 0x%x ordered: %d MID: %u control: %p\n",
2102 chk_flags, ordered, mid, control);
2120 SCTPDBG(SCTP_DEBUG_XXX, "Injecting control: %p to be read (MID: %u)\n",
2121 control, mid);
2124 control, &stcb->sctp_socket->so_rcv,
2136 control = NULL;
2164 SCTPDBG(SCTP_DEBUG_XXX, "Building ck: %p for control: %p to be read (MID: %u)\n",
2166 control, mid);
2200 TAILQ_INSERT_TAIL(&asoc->pending_reply_queue, control, next);
2206 if (SCTP_TSN_GT(control->sinfo_tsn, lcontrol->sinfo_tsn)) {
2210 TAILQ_INSERT_BEFORE(lcontrol, control, next);
2221 TAILQ_INSERT_TAIL(&asoc->pending_reply_queue, control, next);
2228 SCTPDBG(SCTP_DEBUG_XXX, "Unordered data to be read control: %p MID: %u\n",
2229 control, mid);
2230 sctp_mark_non_revokable(asoc, control->sinfo_tsn);
2232 control,
2237 SCTPDBG(SCTP_DEBUG_XXX, "Queue control: %p for reordering MID: %u\n", control,
2239 sctp_queue_data_to_stream(stcb, asoc, control, abort_flag, &need_reasm_check);
2252 "Queue data to stream for reasm control: %p MID: %u\n",
2253 control, mid);
2254 sctp_queue_data_for_reasm(stcb, asoc, control, chk, created_control, abort_flag, tsn);
2309 TAILQ_FOREACH_SAFE(control, &asoc->pending_reply_queue, next, ncontrol) {
2310 TAILQ_REMOVE(&asoc->pending_reply_queue, control, next);
2311 strm = &asoc->strmin[control->sinfo_stream];
2312 sctp_queue_data_to_stream(stcb, asoc, control, abort_flag, &need_reasm_check);
2322 TAILQ_FOREACH_SAFE(control, &asoc->pending_reply_queue, next, ncontrol) {
2323 if (SCTP_TSN_GT(control->sinfo_tsn, liste->tsn)) {
2327 * if control->sinfo_tsn is <= liste->tsn we
2329 * control->sinfo_tsn > liste->tsn
2331 TAILQ_REMOVE(&asoc->pending_reply_queue, control, next);
2332 strm = &asoc->strmin[control->sinfo_stream];
2333 sctp_queue_data_to_stream(stcb, asoc, control, abort_flag, &need_reasm_check);
2643 int num_chunks = 0; /* number of control chunks processed */
4136 /* JRS - Use the congestion control given in the CC module */
4879 /* JRS - Use the congestion control given in the CC module */
5038 /* JRS - Use the congestion control given in the CC module */
5225 struct sctp_queued_to_read *control, *ncontrol;
5240 TAILQ_FOREACH_SAFE(control, &strmin->inqueue, next_instrm, ncontrol) {
5241 if (SCTP_MID_GE(asoc->idata_supported, mid, control->mid)) {
5243 if (((control->sinfo_flags >> 8) & SCTP_DATA_NOT_FRAG) == SCTP_DATA_NOT_FRAG) {
5244 if (control->on_strm_q) {
5245 if (control->on_strm_q == SCTP_ON_ORDERED) {
5246 TAILQ_REMOVE(&strmin->inqueue, control, next_instrm);
5247 } else if (control->on_strm_q == SCTP_ON_UNORDERED) {
5248 TAILQ_REMOVE(&strmin->uno_inqueue, control, next_instrm);
5252 strmin, control, control->on_strm_q);
5255 control->on_strm_q = 0;
5258 if (asoc->size_on_all_streams >= control->length) {
5259 asoc->size_on_all_streams -= control->length;
5262 panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length);
5270 sctp_mark_non_revokable(asoc, control->sinfo_tsn);
5271 sctp_add_to_readq(stcb->sctp_ep, stcb, control,
5277 if (control->first_frag_seen) {
5282 strmin->last_mid_delivered = control->mid - 1;
5311 TAILQ_FOREACH_SAFE(control, &strmin->inqueue, next_instrm, ncontrol) {
5312 if (SCTP_MID_EQ(asoc->idata_supported, mid, control->mid)) {
5313 if (((control->sinfo_flags >> 8) & SCTP_DATA_NOT_FRAG) == SCTP_DATA_NOT_FRAG) {
5315 if (control->on_strm_q) {
5316 if (control->on_strm_q == SCTP_ON_ORDERED) {
5317 TAILQ_REMOVE(&strmin->inqueue, control, next_instrm);
5318 } else if (control->on_strm_q == SCTP_ON_UNORDERED) {
5319 TAILQ_REMOVE(&strmin->uno_inqueue, control, next_instrm);
5323 strmin, control, control->on_strm_q);
5326 control->on_strm_q = 0;
5329 if (asoc->size_on_all_streams >= control->length) {
5330 asoc->size_on_all_streams -= control->length;
5333 panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length);
5340 strmin->last_mid_delivered = control->mid;
5342 sctp_mark_non_revokable(asoc, control->sinfo_tsn);
5343 sctp_add_to_readq(stcb->sctp_ep, stcb, control,
5350 if (control->first_frag_seen) {
5355 strmin->last_mid_delivered = control->mid - 1;
5372 struct sctp_queued_to_read *control, int ordered, uint32_t cumtsn)
5390 control->first_frag_seen &&
5391 SCTP_TSN_GT(control->fsn_included, cumtsn)) {
5394 TAILQ_FOREACH_SAFE(chk, &control->reasm, sctp_next, nchk) {
5401 TAILQ_REMOVE(&control->reasm, chk, sctp_next);
5418 if (!TAILQ_EMPTY(&control->reasm)) {
5423 if (control->data) {
5424 sctp_m_freem(control->data);
5425 control->data = NULL;
5427 control->fsn_included = 0xffffffff;
5428 control->first_frag_seen = 0;
5429 control->last_frag_seen = 0;
5430 if (control->on_read_q) {
5435 TAILQ_REMOVE(&stcb->sctp_ep->read_queue, control, next);
5436 control->on_read_q = 0;
5438 chk = TAILQ_FIRST(&control->reasm);
5440 TAILQ_REMOVE(&control->reasm, chk, sctp_next);
5441 sctp_add_chk_to_control(control, strm, stcb, asoc,
5447 if (control->on_strm_q == SCTP_ON_ORDERED) {
5448 TAILQ_REMOVE(&strm->inqueue, control, next_instrm);
5449 if (asoc->size_on_all_streams >= control->length) {
5450 asoc->size_on_all_streams -= control->length;
5453 panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length);
5459 control->on_strm_q = 0;
5460 } else if (control->on_strm_q == SCTP_ON_UNORDERED) {
5461 TAILQ_REMOVE(&strm->uno_inqueue, control, next_instrm);
5462 control->on_strm_q = 0;
5464 } else if (control->on_strm_q) {
5466 strm, control, control->on_strm_q);
5469 control->on_strm_q = 0;
5470 if (control->on_read_q == 0) {
5471 sctp_free_remote_addr(control->whoFrom);
5472 if (control->data) {
5473 sctp_m_freem(control->data);
5474 control->data = NULL;
5476 sctp_free_a_readq(stcb, control);
5501 struct sctp_queued_to_read *control, *ncontrol;
5661 TAILQ_FOREACH_SAFE(control, &strm->inqueue, next_instrm, ncontrol) {
5662 if (SCTP_MID_GE(asoc->idata_supported, mid, control->mid)) {
5663 sctp_flush_reassm_for_str_seq(stcb, asoc, strm, control, ordered, new_cum_tsn);
5668 TAILQ_FOREACH_SAFE(control, &strm->uno_inqueue, next_instrm, ncontrol) {
5669 if (SCTP_MID_GE(asoc->idata_supported, mid, control->mid)) {
5670 sctp_flush_reassm_for_str_seq(stcb, asoc, strm, control, ordered, new_cum_tsn);
5679 TAILQ_FOREACH(control, &stcb->sctp_ep->read_queue, next) {
5680 if ((control->sinfo_stream == sid) &&
5681 (SCTP_MID_EQ(asoc->idata_supported, control->mid, mid))) {
5682 control->pdapi_aborted = 1;
5683 control->end_added = 1;
5684 if (control->on_strm_q == SCTP_ON_ORDERED) {
5685 TAILQ_REMOVE(&strm->inqueue, control, next_instrm);
5686 if (asoc->size_on_all_streams >= control->length) {
5687 asoc->size_on_all_streams -= control->length;
5690 panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length);
5696 } else if (control->on_strm_q == SCTP_ON_UNORDERED) {
5697 TAILQ_REMOVE(&strm->uno_inqueue, control, next_instrm);
5699 } else if (control->on_strm_q) {
5701 strm, control, control->on_strm_q);
5704 control->on_strm_q = 0;
5708 (void *)control,
5711 } else if ((control->sinfo_stream == sid) &&
5712 SCTP_MID_GT(asoc->idata_supported, control->mid, mid)) {