Lines Matching defs:stcb

89 sctp_threshold_management(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
104 stcb, 0,
112 sctp_send_hb(stcb, net, SCTP_SO_NOT_LOCKED);
114 inp, stcb, net,
116 sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net);
120 if (stcb == NULL)
127 stcb->asoc.overall_error_count,
128 (stcb->asoc.overall_error_count + 1),
132 stcb->asoc.overall_error_count++;
137 stcb->asoc.overall_error_count,
138 (stcb->asoc.overall_error_count + 1),
142 stcb->asoc.overall_error_count++;
145 (void *)&stcb->asoc, stcb->asoc.overall_error_count,
152 if (stcb->asoc.overall_error_count > threshold) {
159 sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED);
170 sctp_find_alternate_net(struct sctp_tcb *stcb,
182 if (stcb->asoc.numnets == 1) {
184 return (TAILQ_FIRST(&stcb->asoc.nets));
195 TAILQ_FOREACH(mnet, &stcb->asoc.nets, sctp_next) {
264 if (stcb->asoc.hb_random_idx > 3) {
265 rndval = sctp_select_initial_TSN(&stcb->sctp_ep->sctp_ep);
266 memcpy(stcb->asoc.hb_random_values, &rndval, sizeof(stcb->asoc.hb_random_values));
267 this_random = stcb->asoc.hb_random_values[0];
268 stcb->asoc.hb_random_idx++;
269 stcb->asoc.hb_ect_randombit = 0;
271 this_random = stcb->asoc.hb_random_values[stcb->asoc.hb_random_idx];
272 stcb->asoc.hb_random_idx++;
273 stcb->asoc.hb_ect_randombit = 0;
295 TAILQ_FOREACH(mnet, &stcb->asoc.nets, sctp_next) {
311 if (stcb->asoc.hb_random_idx > 3) {
312 rndval = sctp_select_initial_TSN(&stcb->sctp_ep->sctp_ep);
313 memcpy(stcb->asoc.hb_random_values, &rndval,
314 sizeof(stcb->asoc.hb_random_values));
315 this_random = stcb->asoc.hb_random_values[0];
316 stcb->asoc.hb_random_idx = 0;
317 stcb->asoc.hb_ect_randombit = 0;
319 this_random = stcb->asoc.hb_random_values[stcb->asoc.hb_random_idx];
320 stcb->asoc.hb_random_idx++;
321 stcb->asoc.hb_ect_randombit = 0;
337 mnet = TAILQ_FIRST(&stcb->asoc.nets);
349 alt = TAILQ_FIRST(&stcb->asoc.nets);
377 return (TAILQ_FIRST(&stcb->asoc.nets));
385 alt = TAILQ_FIRST(&stcb->asoc.nets);
405 sctp_backoff_on_timeout(struct sctp_tcb *stcb,
412 net->RTO = stcb->asoc.minrto;
414 net->RTO = stcb->asoc.initial_rto;
418 if (net->RTO > stcb->asoc.maxrto) {
419 net->RTO = stcb->asoc.maxrto;
424 stcb->asoc.cc_functions.sctp_cwnd_update_after_timeout(stcb, net);
430 sctp_recover_sent_list(struct sctp_tcb *stcb)
435 asoc = &stcb->asoc;
457 sctp_free_bufspace(stcb, asoc, chk, 1);
465 sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED);
477 sctp_mark_all_for_resend(struct sctp_tcb *stcb,
516 stcb->asoc.peers_rwnd,
520 sctp_log_fr(net->flight_size, net->cwnd, stcb->asoc.total_flight, SCTP_FR_CWND_REPORT);
544 orig_tf = stcb->asoc.total_flight;
554 TAILQ_FOREACH_SAFE(chk, &stcb->asoc.sent_queue, sctp_next, nchk) {
555 if (SCTP_TSN_GE(stcb->asoc.last_acked_seq, chk->rec.data.TSN_seq)) {
558 (unsigned int)stcb->asoc.last_acked_seq, (unsigned int)chk->rec.data.TSN_seq);
564 sctp_recover_sent_list(stcb);
615 if (stcb->asoc.prsctp_supported && PR_SCTP_TTL_ENABLED(chk->flags)) {
620 (void)sctp_release_pr_sctp_chunk(stcb,
629 if (stcb->asoc.prsctp_supported && PR_SCTP_RTX_ENABLED(chk->flags)) {
633 (void)sctp_release_pr_sctp_chunk(stcb,
643 sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt);
660 stcb->asoc.marked_retrans++;
669 sctp_total_flight_decrease(stcb, chk);
670 stcb->asoc.peers_rwnd += chk->send_size;
671 stcb->asoc.peers_rwnd += SCTP_BASE_SYSCTL(sctp_peer_chunk_oh);
693 if (TAILQ_EMPTY(&stcb->asoc.send_queue)) {
694 chk->rec.data.fast_retran_tsn = stcb->asoc.sending_seq;
696 chk->rec.data.fast_retran_tsn = (TAILQ_FIRST(&stcb->asoc.send_queue))->rec.data.TSN_seq;
702 if (stcb->asoc.sctp_cmt_on_off > 0) {
715 if ((orig_flight - net->flight_size) != (orig_tf - stcb->asoc.total_flight)) {
727 num_mk, (u_long)stcb->asoc.peers_rwnd);
732 (int)stcb->asoc.peers_rwnd);
741 TAILQ_FOREACH(chk, &stcb->asoc.control_send_queue, sctp_next) {
751 sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt);
758 if ((stcb->asoc.sent_queue_retran_cnt == 0) && (could_be_sent)) {
760 sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt);
765 if (stcb->asoc.sent_queue_retran_cnt != cnt_mk) {
768 cnt_mk, stcb->asoc.sent_queue_retran_cnt, num_mk);
771 stcb->asoc.sent_queue_retran_cnt = cnt_mk;
778 stcb->asoc.total_flight = 0;
779 stcb->asoc.total_flight_count = 0;
781 TAILQ_FOREACH(lnets, &stcb->asoc.nets, sctp_next) {
787 TAILQ_FOREACH(chk, &stcb->asoc.sent_queue, sctp_next) {
797 sctp_total_flight_increase(stcb, chk);
808 struct sctp_tcb *stcb,
820 TAILQ_FOREACH(lnet, &stcb->asoc.nets, sctp_next) {
822 sctp_log_cwnd(stcb, lnet, 1, SCTP_CWND_LOG_FROM_T3);
824 sctp_log_cwnd(stcb, lnet, 0, SCTP_CWND_LOG_FROM_T3);
829 if ((stcb->asoc.peers_rwnd == 0) &&
830 (stcb->asoc.total_flight < net->mtu)) {
839 if (sctp_threshold_management(inp, stcb, net,
840 stcb->asoc.max_send_times)) {
844 if (net != stcb->asoc.primary_destination) {
862 sctp_send_hb(stcb, net, SCTP_SO_NOT_LOCKED);
874 if (sctp_threshold_management(inp, stcb, NULL,
875 stcb->asoc.max_send_times)) {
880 if (stcb->asoc.sctp_cmt_on_off > 0) {
882 alt = sctp_find_alternate_net(stcb, net, 2);
889 alt = sctp_find_alternate_net(stcb, net, 1);
900 alt = sctp_find_alternate_net(stcb, net, 0);
905 (void)sctp_mark_all_for_resend(stcb, net, alt, win_probe,
908 stcb->asoc.fast_retran_loss_recovery = 0;
912 if ((stcb->asoc.cc_functions.sctp_cwnd_new_transmission_begins) &&
914 (*stcb->asoc.cc_functions.sctp_cwnd_new_transmission_begins) (stcb, net);
919 stcb->asoc.sat_t3_loss_recovery = 1;
920 stcb->asoc.sat_t3_recovery_tsn = stcb->asoc.sending_seq;
923 sctp_backoff_on_timeout(stcb, net, win_probe, num_mk, num_abandoned);
927 sctp_move_chunks_from_net(stcb, net);
945 if ((stcb->asoc.primary_destination == net) && (alt != net)) {
953 if (stcb->asoc.alternate) {
954 sctp_free_remote_addr(stcb->asoc.alternate);
956 stcb->asoc.alternate = alt;
957 atomic_add_int(&stcb->asoc.alternate->ref_count, 1);
964 if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_ECHOED) {
969 sctp_timer_start(SCTP_TIMER_TYPE_SEND, inp, stcb, net);
972 if (stcb->asoc.prsctp_supported) {
975 lchk = sctp_try_advance_peer_ack_point(stcb, &stcb->asoc);
977 if (SCTP_TSN_GT(stcb->asoc.advanced_peer_ack_point, stcb->asoc.last_acked_seq)) {
978 send_forward_tsn(stcb, &stcb->asoc);
981 sctp_timer_start(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, lchk->whoTo);
986 sctp_log_cwnd(stcb, net, net->cwnd, SCTP_CWND_LOG_FROM_RTX);
993 struct sctp_tcb *stcb,
997 if (stcb->asoc.delayed_connection) {
1002 stcb->asoc.delayed_connection = 0;
1003 sctp_send_initiate(inp, stcb, SCTP_SO_NOT_LOCKED);
1006 if (SCTP_GET_STATE((&stcb->asoc)) != SCTP_STATE_COOKIE_WAIT) {
1009 if (sctp_threshold_management(inp, stcb, net,
1010 stcb->asoc.max_init_times)) {
1014 stcb->asoc.dropped_special_cnt = 0;
1015 sctp_backoff_on_timeout(stcb, stcb->asoc.primary_destination, 1, 0, 0);
1016 if (stcb->asoc.initial_init_rto_max < net->RTO) {
1017 net->RTO = stcb->asoc.initial_init_rto_max;
1019 if (stcb->asoc.numnets > 1) {
1023 alt = sctp_find_alternate_net(stcb, stcb->asoc.primary_destination, 0);
1024 if (alt != stcb->asoc.primary_destination) {
1025 sctp_move_chunks_from_net(stcb, stcb->asoc.primary_destination);
1026 stcb->asoc.primary_destination = alt;
1030 sctp_send_initiate(inp, stcb, SCTP_SO_NOT_LOCKED);
1041 struct sctp_tcb *stcb,
1048 TAILQ_FOREACH(cookie, &stcb->asoc.control_send_queue, sctp_next) {
1054 if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_ECHOED) {
1061 sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED);
1066 SCTP_PRINTF("Strange in state %d not cookie-echoed yet c-e timer expires?\n", SCTP_GET_STATE(&stcb->asoc));
1073 if (sctp_threshold_management(inp, stcb, cookie->whoTo,
1074 stcb->asoc.max_init_times)) {
1082 stcb->asoc.dropped_special_cnt = 0;
1083 sctp_backoff_on_timeout(stcb, cookie->whoTo, 1, 0, 0);
1084 alt = sctp_find_alternate_net(stcb, cookie->whoTo, 0);
1092 sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt);
1104 sctp_strreset_timer(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
1110 if (stcb->asoc.stream_reset_outstanding == 0) {
1114 (void)sctp_find_stream_reset(stcb, stcb->asoc.str_reset_seq_out, &strrst);
1119 if (sctp_threshold_management(inp, stcb, strrst->whoTo,
1120 stcb->asoc.max_send_times)) {
1128 sctp_backoff_on_timeout(stcb, strrst->whoTo, 1, 0, 0);
1129 alt = sctp_find_alternate_net(stcb, strrst->whoTo, 0);
1135 TAILQ_FOREACH(chk, &stcb->asoc.control_send_queue, sctp_next) {
1141 sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt);
1152 sctp_move_chunks_from_net(stcb, net);
1156 sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt);
1160 sctp_timer_start(SCTP_TIMER_TYPE_STRRESET, inp, stcb, strrst->whoTo);
1165 sctp_asconf_timer(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
1172 if (TAILQ_EMPTY(&stcb->asoc.asconf_send_queue)) {
1174 sctp_send_asconf(stcb, net, SCTP_ADDR_NOT_LOCKED);
1181 asconf = TAILQ_FIRST(&stcb->asoc.asconf_send_queue);
1186 if (sctp_threshold_management(inp, stcb, asconf->whoTo,
1187 stcb->asoc.max_send_times)) {
1191 if (asconf->snd_count > stcb->asoc.max_send_times) {
1200 sctp_asconf_cleanup(stcb, net);
1207 sctp_backoff_on_timeout(stcb, asconf->whoTo, 1, 0, 0);
1208 alt = sctp_find_alternate_net(stcb, asconf->whoTo, 0);
1215 TAILQ_FOREACH(chk, &stcb->asoc.control_send_queue, sctp_next) {
1222 sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt);
1227 TAILQ_FOREACH(chk, &stcb->asoc.asconf_send_queue, sctp_next) {
1234 sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt);
1242 sctp_move_chunks_from_net(stcb, net);
1246 sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt);
1250 sctp_send_asconf(stcb, alt, SCTP_ADDR_NOT_LOCKED);
1257 sctp_delete_prim_timer(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
1260 if (stcb->asoc.deleted_primary == NULL) {
1266 SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, &stcb->asoc.deleted_primary->ro._l_addr.sa);
1267 sctp_free_remote_addr(stcb->asoc.deleted_primary);
1268 stcb->asoc.deleted_primary = NULL;
1280 sctp_shutdown_timer(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
1286 if (sctp_threshold_management(inp, stcb, net, stcb->asoc.max_send_times)) {
1290 sctp_backoff_on_timeout(stcb, net, 1, 0, 0);
1292 alt = sctp_find_alternate_net(stcb, net, 0);
1295 sctp_send_shutdown(stcb, alt);
1298 sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, inp, stcb, alt);
1303 sctp_shutdownack_timer(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
1309 if (sctp_threshold_management(inp, stcb, net, stcb->asoc.max_send_times)) {
1313 sctp_backoff_on_timeout(stcb, net, 1, 0, 0);
1315 alt = sctp_find_alternate_net(stcb, net, 0);
1318 sctp_send_shutdown_ack(stcb, alt);
1321 sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNACK, inp, stcb, alt);
1327 struct sctp_tcb *stcb)
1336 if ((stcb == NULL) || (inp == NULL))
1339 if (stcb->asoc.sent_queue_retran_cnt) {
1341 stcb->asoc.sent_queue_retran_cnt);
1342 stcb->asoc.sent_queue_retran_cnt = 0;
1344 if (stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, &stcb->asoc)) {
1346 stcb->asoc.ss_functions.sctp_ss_init(stcb, &stcb->asoc, 0);
1347 if (!stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, &stcb->asoc)) {
1352 stcb->asoc.total_output_queue_size = 0;
1356 for (i = 0; i < stcb->asoc.streamoutcnt; i++) {
1357 if (!TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) {
1358 TAILQ_FOREACH(sp, &stcb->asoc.strmout[i].outqueue, next) {
1365 if (chks_in_queue != stcb->asoc.stream_queue_cnt) {
1367 stcb->asoc.stream_queue_cnt, chks_in_queue);
1371 sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_T3, SCTP_SO_NOT_LOCKED);
1372 if ((TAILQ_EMPTY(&stcb->asoc.send_queue)) &&
1373 (TAILQ_EMPTY(&stcb->asoc.sent_queue))) {
1385 (u_long)stcb->asoc.total_output_queue_size);
1386 stcb->asoc.total_output_queue_size = 0;
1391 sctp_heartbeat_timer(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
1411 sctp_backoff_on_timeout(stcb, net, 1, 0, 0);
1412 if (sctp_threshold_management(inp, stcb, net, stcb->asoc.max_send_times)) {
1421 if ((stcb->asoc.total_output_queue_size > 0) &&
1422 (TAILQ_EMPTY(&stcb->asoc.send_queue)) &&
1423 (TAILQ_EMPTY(&stcb->asoc.sent_queue))) {
1424 sctp_audit_stream_queues_for_size(inp, stcb);
1447 sctp_send_hb(stcb, net, SCTP_SO_NOT_LOCKED);
1455 struct sctp_tcb *stcb,
1481 stcb,
1483 net, 0, stcb->asoc.vrf_id);
1510 sctp_timer_start(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, net);
1515 struct sctp_tcb *stcb,
1523 if (stcb->asoc.sctp_autoclose_ticks &&
1526 asoc = &stcb->asoc;
1545 sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_AUTOCLOSE_TMR, SCTP_SO_NOT_LOCKED);
1563 sctp_stop_timers_for_shutdown(stcb);
1564 if (stcb->asoc.alternate) {
1565 netp = stcb->asoc.alternate;
1567 netp = stcb->asoc.primary_destination;
1569 sctp_send_shutdown(stcb, netp);
1571 stcb->sctp_ep, stcb,
1574 stcb->sctp_ep, stcb,
1588 sctp_timer_start(SCTP_TIMER_TYPE_AUTOCLOSE, inp, stcb,