Lines Matching refs: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;
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;
750 sctp_reset_a_control(struct sctp_queued_to_read *control,
753 control->fsn_included = tsn;
754 if (control->on_read_q) {
759 TAILQ_REMOVE(&inp->read_queue, control, next);
760 control->on_read_q = 0;
768 struct sctp_queued_to_read *control,
775 * to see if we have it all. If you return one, no other control
785 if (control->first_frag_seen == 0) {
792 fsn = control->fsn_included + 1;
794 TAILQ_FOREACH_SAFE(chk, &control->reasm, sctp_next, lchk) {
802 TAILQ_REMOVE(&control->reasm, chk, sctp_next);
803 sctp_add_chk_to_control(control, strm, stcb, asoc, chk, inp_read_lock_held);
807 if (control->end_added) {
809 if (!TAILQ_EMPTY(&control->reasm)) {
812 * on the control queue to a new
813 * control.
815 sctp_build_readq_entry_from_ctl(nc, control);
816 tchk = TAILQ_FIRST(&control->reasm);
818 TAILQ_REMOVE(&control->reasm, tchk, sctp_next);
838 tchk = TAILQ_FIRST(&control->reasm);
842 TAILQ_REMOVE(&control->reasm, tchk, sctp_next);
844 tchk = TAILQ_FIRST(&control->reasm);
848 * after removing control
852 if (control->on_strm_q) {
853 TAILQ_REMOVE(&strm->uno_inqueue, control, next_instrm);
854 control->on_strm_q = 0;
857 if (control->pdapi_started) {
859 control->pdapi_started = 0;
861 if (control->on_strm_q) {
862 TAILQ_REMOVE(&strm->uno_inqueue, control, next_instrm);
863 control->on_strm_q = 0;
866 if (control->on_read_q == 0) {
867 sctp_add_to_readq(stcb->sctp_ep, stcb, control,
868 &stcb->sctp_socket->so_rcv, control->end_added,
877 control = nc;
896 if ((control->length > pd_point) && (strm->pd_api_started == 0)) {
898 control->pdapi_started = 1;
899 sctp_add_to_readq(stcb->sctp_ep, stcb, control,
900 &stcb->sctp_socket->so_rcv, control->end_added,
912 struct sctp_queued_to_read *control,
920 * Here we need to place the chunk into the control structure sorted
928 at = TAILQ_FIRST(&control->reasm);
937 if (control->first_frag_seen) {
940 * control multiple messages. As long as the next
947 if (SCTP_TSN_GT(chk->rec.data.fsn, control->fsn_included)) {
954 if ((chk->rec.data.fsn == control->fsn_included) ||
955 (control->pdapi_started)) {
968 sctp_abort_in_reasm(stcb, control, chk,
980 tdata = control->data;
981 control->data = chk->data;
984 chk->send_size = control->length;
985 /* Recompute length of control and tail pointer */
986 sctp_setup_tail_pointer(control);
988 tmp = control->fsn_included;
989 control->fsn_included = chk->rec.data.fsn;
992 tmp = control->sinfo_tsn;
993 control->sinfo_tsn = chk->rec.data.tsn;
996 tmp = control->sinfo_ppid;
997 control->sinfo_ppid = chk->rec.data.ppid;
1002 control->first_frag_seen = 1;
1003 control->fsn_included = chk->rec.data.fsn;
1004 control->top_fsn = chk->rec.data.fsn;
1005 control->sinfo_tsn = chk->rec.data.tsn;
1006 control->sinfo_ppid = chk->rec.data.ppid;
1007 control->data = chk->data;
1011 sctp_setup_tail_pointer(control);
1016 TAILQ_FOREACH(at, &control->reasm, sctp_next) {
1033 sctp_abort_in_reasm(stcb, control, chk,
1043 control->top_fsn = chk->rec.data.fsn;
1044 TAILQ_INSERT_TAIL(&control->reasm, chk, sctp_next);
1058 struct sctp_queued_to_read *control, *nctl = NULL;
1069 control = TAILQ_FIRST(&strm->uno_inqueue);
1071 if ((control != NULL) &&
1074 if (sctp_handle_old_unordered_data(stcb, asoc, strm, control, pd_point, inp_read_lock_held)) {
1082 while (control) {
1083 SCTPDBG(SCTP_DEBUG_XXX, "Looking at control: %p e(%d) ssn: %u top_fsn: %u inc_fsn: %u -uo\n",
1084 control, control->end_added, control->mid, control->top_fsn, control->fsn_included);
1085 nctl = TAILQ_NEXT(control, next_instrm);
1086 if (control->end_added) {
1088 if (control->on_strm_q) {
1090 if (control->on_strm_q != SCTP_ON_UNORDERED) {
1091 panic("Huh control: %p on_q: %d -- not unordered?",
1092 control, control->on_strm_q);
1096 TAILQ_REMOVE(&strm->uno_inqueue, control, next_instrm);
1097 if (asoc->size_on_all_streams >= control->length) {
1098 asoc->size_on_all_streams -= control->length;
1101 panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length);
1107 control->on_strm_q = 0;
1109 if (control->on_read_q == 0) {
1111 control,
1112 &stcb->sctp_socket->so_rcv, control->end_added,
1117 if ((control->length >= pd_point) && (strm->pd_api_started == 0)) {
1119 control->pdapi_started = 1;
1121 control,
1122 &stcb->sctp_socket->so_rcv, control->end_added,
1128 control = nctl;
1131 control = TAILQ_FIRST(&strm->inqueue);
1136 if (control == NULL) {
1139 if (SCTP_MID_EQ(asoc->idata_supported, strm->last_mid_delivered, control->mid)) {
1146 nctl = TAILQ_NEXT(control, next_instrm);
1148 "Looking at control: %p e(%d) ssn: %u top_fsn: %u inc_fsn: %u (lastdel: %u)- o\n",
1149 control, control->end_added, control->mid,
1150 control->top_fsn, control->fsn_included,
1152 if (control->end_added) {
1153 if (control->on_strm_q) {
1155 if (control->on_strm_q != SCTP_ON_ORDERED) {
1156 panic("Huh control: %p on_q: %d -- not ordered?",
1157 control, control->on_strm_q);
1161 TAILQ_REMOVE(&strm->inqueue, control, next_instrm);
1162 if (asoc->size_on_all_streams >= control->length) {
1163 asoc->size_on_all_streams -= control->length;
1166 panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length);
1172 control->on_strm_q = 0;
1174 if (strm->pd_api_started && control->pdapi_started) {
1175 control->pdapi_started = 0;
1178 if (control->on_read_q == 0) {
1180 control,
1181 &stcb->sctp_socket->so_rcv, control->end_added,
1184 control = nctl;
1196 if (control) {
1198 "Looking at control: %p e(%d) ssn: %u top_fsn: %u inc_fsn: %u (nxtdel: %u)- o\n",
1199 control, control->end_added, control->mid, control->top_fsn, control->fsn_included,
1201 nctl = TAILQ_NEXT(control, next_instrm);
1202 if (SCTP_MID_EQ(asoc->idata_supported, control->mid, next_to_del) &&
1203 (control->first_frag_seen)) {
1207 if (control->end_added) {
1209 if (control->on_strm_q) {
1211 if (control->on_strm_q != SCTP_ON_ORDERED) {
1212 panic("Huh control: %p on_q: %d -- not ordered?",
1213 control, control->on_strm_q);
1217 TAILQ_REMOVE(&strm->inqueue, control, next_instrm);
1218 if (asoc->size_on_all_streams >= control->length) {
1219 asoc->size_on_all_streams -= control->length;
1222 panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length);
1228 control->on_strm_q = 0;
1232 if (((control->sinfo_flags >> 8) & SCTP_DATA_NOT_FRAG) == SCTP_DATA_NOT_FRAG) {
1237 sctp_mark_non_revokable(asoc, control->sinfo_tsn);
1238 } else if (control->end_added == 0) {
1243 if ((control->length < pd_point) || (strm->pd_api_started)) {
1251 done = (control->end_added) && (control->last_frag_seen);
1252 if (control->on_read_q == 0) {
1254 if (asoc->size_on_all_streams >= control->length) {
1255 asoc->size_on_all_streams -= control->length;
1258 panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length);
1264 control->pdapi_started = 1;
1267 control,
1268 &stcb->sctp_socket->so_rcv, control->end_added,
1273 control = nctl;
1283 sctp_add_chk_to_control(struct sctp_queued_to_read *control,
1289 * Given a control and a chunk, merge the data from the chk onto the
1290 * control and free up the chunk resources.
1295 if (control->on_read_q) {
1305 if (control->data == NULL) {
1306 control->data = chk->data;
1307 sctp_setup_tail_pointer(control);
1309 sctp_add_to_tail_pointer(control, chk->data, &added);
1311 control->fsn_included = chk->rec.data.fsn;
1317 control->first_frag_seen = 1;
1318 control->sinfo_tsn = chk->rec.data.tsn;
1319 control->sinfo_ppid = chk->rec.data.ppid;
1323 if ((control->on_strm_q) && (control->on_read_q)) {
1324 if (control->pdapi_started) {
1325 control->pdapi_started = 0;
1328 if (control->on_strm_q == SCTP_ON_UNORDERED) {
1330 TAILQ_REMOVE(&strm->uno_inqueue, control, next_instrm);
1331 control->on_strm_q = 0;
1332 } else if (control->on_strm_q == SCTP_ON_ORDERED) {
1334 TAILQ_REMOVE(&strm->inqueue, control, next_instrm);
1337 * size_on_all_streams, since control is on
1341 control->on_strm_q = 0;
1343 } else if (control->on_strm_q) {
1344 panic("Unknown state on ctrl: %p on_strm_q: %d", control,
1345 control->on_strm_q);
1349 control->end_added = 1;
1350 control->last_frag_seen = 1;
1368 struct sctp_queued_to_read *control,
1379 strm = &asoc->strmin[control->sinfo_stream];
1383 if ((control->sinfo_flags >> 8) & SCTP_DATA_UNORDERED) {
1393 if (sctp_place_control_in_stream(strm, asoc, control)) {
1395 sctp_abort_in_reasm(stcb, control, chk,
1398 sctp_clean_up_control(stcb, control);
1403 * Ok we created this control and now lets validate
1408 sctp_abort_in_reasm(stcb, control, chk,
1416 sctp_inject_old_unordered_data(stcb, asoc, control, chk, abort_flag);
1421 * the first it goes to the control mbuf. o if its not first but the
1422 * next in sequence it goes to the control, and each succeeding one
1431 if (control->first_frag_seen) {
1438 sctp_abort_in_reasm(stcb, control, chk,
1443 control->first_frag_seen = 1;
1444 control->sinfo_ppid = chk->rec.data.ppid;
1445 control->sinfo_tsn = chk->rec.data.tsn;
1446 control->fsn_included = chk->rec.data.fsn;
1447 control->data = chk->data;
1451 sctp_setup_tail_pointer(control);
1452 asoc->size_on_all_streams += control->length;
1457 if (control->last_frag_seen == 0) {
1459 if (SCTP_TSN_GT(chk->rec.data.fsn, control->top_fsn)) {
1463 control->top_fsn = chk->rec.data.fsn;
1469 control->last_frag_seen = 1;
1470 if (SCTP_TSN_GT(control->top_fsn, chk->rec.data.fsn)) {
1474 control->top_fsn);
1475 sctp_abort_in_reasm(stcb, control, chk,
1481 if (asoc->idata_supported || control->first_frag_seen) {
1488 if (SCTP_TSN_GE(control->fsn_included, chk->rec.data.fsn)) {
1493 sctp_abort_in_reasm(stcb, control, chk,
1504 chk->rec.data.fsn, control->top_fsn);
1505 sctp_abort_in_reasm(stcb, control,
1510 if (asoc->idata_supported || control->first_frag_seen) {
1518 if (SCTP_TSN_GE(control->fsn_included, chk->rec.data.fsn)) {
1525 chk->rec.data.fsn, control->fsn_included);
1526 sctp_abort_in_reasm(stcb, control, chk,
1536 if (SCTP_TSN_GT(chk->rec.data.fsn, control->top_fsn)) {
1540 control->top_fsn);
1541 sctp_abort_in_reasm(stcb, control, chk,
1549 * reassembly for this control.
1554 TAILQ_FOREACH(at, &control->reasm, sctp_next) {
1560 sctp_abort_in_reasm(stcb, control,
1593 sctp_abort_in_reasm(stcb, control,
1605 TAILQ_INSERT_TAIL(&control->reasm, chk, sctp_next);
1609 * Ok lets see if we can suck any up into the control structure that
1617 if (control->first_frag_seen) {
1618 next_fsn = control->fsn_included + 1;
1619 TAILQ_FOREACH_SAFE(at, &control->reasm, sctp_next, nat) {
1621 /* We can add this one now to the control */
1623 "Adding more to control: %p at: %p fsn: %u next_fsn: %u included: %u\n",
1624 control, at,
1626 next_fsn, control->fsn_included);
1627 TAILQ_REMOVE(&control->reasm, at, sctp_next);
1628 lenadded = sctp_add_chk_to_control(control, strm, stcb, asoc, at, SCTP_READ_LOCK_NOT_HELD);
1629 if (control->on_read_q) {
1642 if (control->end_added && control->pdapi_started) {
1645 control->pdapi_started = 0;
1647 if (control->on_read_q == 0) {
1649 control,
1650 &stcb->sctp_socket->so_rcv, control->end_added,
1669 struct sctp_queued_to_read *control;
1672 TAILQ_FOREACH(control, &strm->inqueue, next_instrm) {
1673 if (SCTP_MID_EQ(idata_supported, control->mid, mid)) {
1679 TAILQ_FOREACH(control, &strm->uno_inqueue, next_instrm) {
1680 if (SCTP_MID_EQ(idata_supported, control->mid, mid)) {
1685 control = TAILQ_FIRST(&strm->uno_inqueue);
1688 return (control);
1706 struct sctp_queued_to_read *control, *ncontrol;
1861 * If its a fragmented message, lets see if we can find the control
1875 control = sctp_find_reasm_entry(&asoc->strmin[sid], mid, ordered, asoc->idata_supported);
1876 SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags:0x%x look for control on queues %p\n",
1877 chk_flags, control);
1880 if (control != NULL) {
1882 if (ordered && (mid != control->mid)) {
1891 if (ordered && ((control->sinfo_flags >> 8) & SCTP_DATA_UNORDERED)) {
1901 if (!ordered && (((control->sinfo_flags >> 8) & SCTP_DATA_UNORDERED) == 0)) {
1918 if (control != NULL) {
1925 if ((tsn == control->fsn_included + 1) &&
1926 (control->end_added == 0)) {
1929 control->fsn_included);
1932 control = NULL;
1968 if (control == NULL) {
1971 if (SCTP_TSN_GT(fsn, control->top_fsn)) {
2081 * Now no matter what, we need a control, get one if we don't have
2085 if (control == NULL) {
2086 sctp_alloc_a_readq(stcb, control);
2087 sctp_build_readq_entry_mac(control, stcb, asoc->context, net, tsn,
2092 if (control == NULL) {
2099 control->data = dmbuf;
2100 control->tail_mbuf = NULL;
2101 for (mm = control->data; mm; mm = mm->m_next) {
2102 control->length += SCTP_BUF_LEN(mm);
2104 control->tail_mbuf = mm;
2107 control->end_added = 1;
2108 control->last_frag_seen = 1;
2109 control->first_frag_seen = 1;
2110 control->fsn_included = fsn;
2111 control->top_fsn = fsn;
2115 SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags: 0x%x ordered: %d MID: %u control: %p\n",
2116 chk_flags, ordered, mid, control);
2134 SCTPDBG(SCTP_DEBUG_XXX, "Injecting control: %p to be read (MID: %u)\n",
2135 control, mid);
2138 control, &stcb->sctp_socket->so_rcv,
2150 control = NULL;
2178 SCTPDBG(SCTP_DEBUG_XXX, "Building ck: %p for control: %p to be read (MID: %u)\n",
2180 control, mid);
2214 TAILQ_INSERT_TAIL(&asoc->pending_reply_queue, control, next);
2220 if (SCTP_TSN_GT(control->sinfo_tsn, lcontrol->sinfo_tsn)) {
2224 TAILQ_INSERT_BEFORE(lcontrol, control, next);
2235 TAILQ_INSERT_TAIL(&asoc->pending_reply_queue, control, next);
2242 SCTPDBG(SCTP_DEBUG_XXX, "Unordered data to be read control: %p MID: %u\n",
2243 control, mid);
2244 sctp_mark_non_revokable(asoc, control->sinfo_tsn);
2246 control,
2251 SCTPDBG(SCTP_DEBUG_XXX, "Queue control: %p for reordering MID: %u\n", control,
2253 sctp_queue_data_to_stream(stcb, asoc, control, abort_flag, &need_reasm_check);
2266 "Queue data to stream for reasm control: %p MID: %u\n",
2267 control, mid);
2268 sctp_queue_data_for_reasm(stcb, asoc, control, chk, created_control, abort_flag, tsn);
2323 TAILQ_FOREACH_SAFE(control, &asoc->pending_reply_queue, next, ncontrol) {
2324 TAILQ_REMOVE(&asoc->pending_reply_queue, control, next);
2325 strm = &asoc->strmin[control->sinfo_stream];
2326 sctp_queue_data_to_stream(stcb, asoc, control, abort_flag, &need_reasm_check);
2336 TAILQ_FOREACH_SAFE(control, &asoc->pending_reply_queue, next, ncontrol) {
2337 if (SCTP_TSN_GT(control->sinfo_tsn, liste->tsn)) {
2341 * if control->sinfo_tsn is <= liste->tsn we
2343 * control->sinfo_tsn > liste->tsn
2345 TAILQ_REMOVE(&asoc->pending_reply_queue, control, next);
2346 strm = &asoc->strmin[control->sinfo_stream];
2347 sctp_queue_data_to_stream(stcb, asoc, control, abort_flag, &need_reasm_check);
2657 int num_chunks = 0; /* number of control chunks processed */
4150 /* JRS - Use the congestion control given in the CC module */
4893 /* JRS - Use the congestion control given in the CC module */
5052 /* JRS - Use the congestion control given in the CC module */
5239 struct sctp_queued_to_read *control, *ncontrol;
5254 TAILQ_FOREACH_SAFE(control, &strmin->inqueue, next_instrm, ncontrol) {
5255 if (SCTP_MID_GE(asoc->idata_supported, mid, control->mid)) {
5257 if (((control->sinfo_flags >> 8) & SCTP_DATA_NOT_FRAG) == SCTP_DATA_NOT_FRAG) {
5258 if (control->on_strm_q) {
5259 if (control->on_strm_q == SCTP_ON_ORDERED) {
5260 TAILQ_REMOVE(&strmin->inqueue, control, next_instrm);
5261 } else if (control->on_strm_q == SCTP_ON_UNORDERED) {
5262 TAILQ_REMOVE(&strmin->uno_inqueue, control, next_instrm);
5266 strmin, control, control->on_strm_q);
5269 control->on_strm_q = 0;
5272 if (asoc->size_on_all_streams >= control->length) {
5273 asoc->size_on_all_streams -= control->length;
5276 panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length);
5284 sctp_mark_non_revokable(asoc, control->sinfo_tsn);
5285 sctp_add_to_readq(stcb->sctp_ep, stcb, control,
5291 if (control->first_frag_seen) {
5296 strmin->last_mid_delivered = control->mid - 1;
5325 TAILQ_FOREACH_SAFE(control, &strmin->inqueue, next_instrm, ncontrol) {
5326 if (SCTP_MID_EQ(asoc->idata_supported, mid, control->mid)) {
5327 if (((control->sinfo_flags >> 8) & SCTP_DATA_NOT_FRAG) == SCTP_DATA_NOT_FRAG) {
5329 if (control->on_strm_q) {
5330 if (control->on_strm_q == SCTP_ON_ORDERED) {
5331 TAILQ_REMOVE(&strmin->inqueue, control, next_instrm);
5332 } else if (control->on_strm_q == SCTP_ON_UNORDERED) {
5333 TAILQ_REMOVE(&strmin->uno_inqueue, control, next_instrm);
5337 strmin, control, control->on_strm_q);
5340 control->on_strm_q = 0;
5343 if (asoc->size_on_all_streams >= control->length) {
5344 asoc->size_on_all_streams -= control->length;
5347 panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length);
5354 strmin->last_mid_delivered = control->mid;
5356 sctp_mark_non_revokable(asoc, control->sinfo_tsn);
5357 sctp_add_to_readq(stcb->sctp_ep, stcb, control,
5364 if (control->first_frag_seen) {
5369 strmin->last_mid_delivered = control->mid - 1;
5386 struct sctp_queued_to_read *control, int ordered, uint32_t cumtsn)
5404 control->first_frag_seen &&
5405 SCTP_TSN_GT(control->fsn_included, cumtsn)) {
5408 TAILQ_FOREACH_SAFE(chk, &control->reasm, sctp_next, nchk) {
5415 TAILQ_REMOVE(&control->reasm, chk, sctp_next);
5432 if (!TAILQ_EMPTY(&control->reasm)) {
5434 if (control->data) {
5435 sctp_m_freem(control->data);
5436 control->data = NULL;
5438 sctp_reset_a_control(control, stcb->sctp_ep, cumtsn);
5439 chk = TAILQ_FIRST(&control->reasm);
5441 TAILQ_REMOVE(&control->reasm, chk, sctp_next);
5442 sctp_add_chk_to_control(control, strm, stcb, asoc,
5448 if (control->on_strm_q == SCTP_ON_ORDERED) {
5449 TAILQ_REMOVE(&strm->inqueue, control, next_instrm);
5450 if (asoc->size_on_all_streams >= control->length) {
5451 asoc->size_on_all_streams -= control->length;
5454 panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length);
5460 control->on_strm_q = 0;
5461 } else if (control->on_strm_q == SCTP_ON_UNORDERED) {
5462 TAILQ_REMOVE(&strm->uno_inqueue, control, next_instrm);
5463 control->on_strm_q = 0;
5465 } else if (control->on_strm_q) {
5467 strm, control, control->on_strm_q);
5470 control->on_strm_q = 0;
5471 if (control->on_read_q == 0) {
5472 sctp_free_remote_addr(control->whoFrom);
5473 if (control->data) {
5474 sctp_m_freem(control->data);
5475 control->data = NULL;
5477 sctp_free_a_readq(stcb, control);
5502 struct sctp_queued_to_read *control, *ncontrol;
5662 TAILQ_FOREACH_SAFE(control, &strm->inqueue, next_instrm, ncontrol) {
5663 if (SCTP_MID_GE(asoc->idata_supported, mid, control->mid)) {
5664 sctp_flush_reassm_for_str_seq(stcb, asoc, strm, control, ordered, new_cum_tsn);
5669 TAILQ_FOREACH_SAFE(control, &strm->uno_inqueue, next_instrm, ncontrol) {
5670 if (SCTP_MID_GE(asoc->idata_supported, mid, control->mid)) {
5671 sctp_flush_reassm_for_str_seq(stcb, asoc, strm, control, ordered, new_cum_tsn);
5680 TAILQ_FOREACH(control, &stcb->sctp_ep->read_queue, next) {
5681 if ((control->sinfo_stream == sid) &&
5682 (SCTP_MID_EQ(asoc->idata_supported, control->mid, mid))) {
5683 control->pdapi_aborted = 1;
5684 control->end_added = 1;
5685 if (control->on_strm_q == SCTP_ON_ORDERED) {
5686 TAILQ_REMOVE(&strm->inqueue, control, next_instrm);
5687 if (asoc->size_on_all_streams >= control->length) {
5688 asoc->size_on_all_streams -= control->length;
5691 panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length);
5697 } else if (control->on_strm_q == SCTP_ON_UNORDERED) {
5698 TAILQ_REMOVE(&strm->uno_inqueue, control, next_instrm);
5700 } else if (control->on_strm_q) {
5702 strm, control, control->on_strm_q);
5705 control->on_strm_q = 0;
5709 (void *)control,
5712 } else if ((control->sinfo_stream == sid) &&
5713 SCTP_MID_GT(asoc->idata_supported, control->mid, mid)) {