Lines Matching full:asoc

66 	TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {  in sctp_stop_all_cookie_timers()
177 struct sctp_association *asoc; in sctp_is_there_unsent_data() local
186 asoc = &stcb->asoc; in sctp_is_there_unsent_data()
188 if (!stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { in sctp_is_there_unsent_data()
190 for (i = 0; i < stcb->asoc.streamoutcnt; i++) { in sctp_is_there_unsent_data()
192 sp = TAILQ_FIRST(&stcb->asoc.strmout[i].outqueue); in sctp_is_there_unsent_data()
212 atomic_subtract_int(&stcb->asoc.stream_queue_cnt, 1); in sctp_is_there_unsent_data()
213 TAILQ_REMOVE(&stcb->asoc.strmout[i].outqueue, sp, next); in sctp_is_there_unsent_data()
214 stcb->asoc.ss_functions.sctp_ss_remove_from_stream(stcb, asoc, &asoc->strmout[i], sp); in sctp_is_there_unsent_data()
224 if (!TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { in sctp_is_there_unsent_data()
242 struct sctp_association *asoc; in sctp_process_init() local
249 asoc = &stcb->asoc; in sctp_process_init()
251 asoc->peer_vtag = ntohl(init->initiate_tag); in sctp_process_init()
252 asoc->peers_rwnd = ntohl(init->a_rwnd); in sctp_process_init()
254 asoc->highest_tsn_inside_map = asoc->asconf_seq_in = ntohl(init->initial_tsn) - 1; in sctp_process_init()
256 if (!TAILQ_EMPTY(&asoc->nets)) { in sctp_process_init()
258 TAILQ_FOREACH(lnet, &asoc->nets, sctp_next) { in sctp_process_init()
259 lnet->ssthresh = asoc->peers_rwnd; in sctp_process_init()
265 if (asoc->pre_open_streams > ntohs(init->num_inbound_streams)) { in sctp_process_init()
273 TAILQ_FOREACH_SAFE(chk, &asoc->send_queue, sctp_next, nchk) { in sctp_process_init()
275 TAILQ_REMOVE(&asoc->send_queue, chk, sctp_next); in sctp_process_init()
276 asoc->send_queue_cnt--; in sctp_process_init()
277 if (asoc->strmout[chk->rec.data.sid].chunks_on_queues > 0) { in sctp_process_init()
278 asoc->strmout[chk->rec.data.sid].chunks_on_queues--; in sctp_process_init()
285 sctp_free_bufspace(stcb, asoc, chk, 1); in sctp_process_init()
297 if (asoc->strmout) { in sctp_process_init()
298 for (i = newcnt; i < asoc->pre_open_streams; i++) { in sctp_process_init()
299 outs = &asoc->strmout[i]; in sctp_process_init()
301 atomic_subtract_int(&stcb->asoc.stream_queue_cnt, 1); in sctp_process_init()
303 stcb->asoc.ss_functions.sctp_ss_remove_from_stream(stcb, asoc, outs, sp); in sctp_process_init()
322 asoc->pre_open_streams = newcnt; in sctp_process_init()
324 asoc->streamoutcnt = asoc->pre_open_streams; in sctp_process_init()
325 if (asoc->strmout) { in sctp_process_init()
326 for (i = 0; i < asoc->streamoutcnt; i++) { in sctp_process_init()
327 asoc->strmout[i].state = SCTP_STREAM_OPEN; in sctp_process_init()
331 asoc->highest_tsn_inside_nr_map = asoc->highest_tsn_inside_map; in sctp_process_init()
333 sctp_log_map(0, 5, asoc->highest_tsn_inside_map, SCTP_MAP_SLIDE_RESULT); in sctp_process_init()
336 asoc->str_reset_seq_in = asoc->asconf_seq_in + 1; in sctp_process_init()
338 asoc->mapping_array_base_tsn = ntohl(init->initial_tsn); in sctp_process_init()
339 asoc->tsn_last_delivered = asoc->cumulative_tsn = asoc->asconf_seq_in; in sctp_process_init()
341 asoc->advanced_peer_ack_point = asoc->last_acked_seq; in sctp_process_init()
344 if (asoc->strmin != NULL) { in sctp_process_init()
346 for (i = 0; i < asoc->streamincnt; i++) { in sctp_process_init()
347 sctp_clean_up_stream(stcb, &asoc->strmin[i].inqueue); in sctp_process_init()
348 sctp_clean_up_stream(stcb, &asoc->strmin[i].uno_inqueue); in sctp_process_init()
350 SCTP_FREE(asoc->strmin, SCTP_M_STRMI); in sctp_process_init()
352 if (asoc->max_inbound_streams > ntohs(init->num_outbound_streams)) { in sctp_process_init()
353 asoc->streamincnt = ntohs(init->num_outbound_streams); in sctp_process_init()
355 asoc->streamincnt = asoc->max_inbound_streams; in sctp_process_init()
357 SCTP_MALLOC(asoc->strmin, struct sctp_stream_in *, asoc->streamincnt * in sctp_process_init()
359 if (asoc->strmin == NULL) { in sctp_process_init()
364 for (i = 0; i < asoc->streamincnt; i++) { in sctp_process_init()
365 asoc->strmin[i].sid = i; in sctp_process_init()
366 asoc->strmin[i].last_mid_delivered = 0xffffffff; in sctp_process_init()
367 TAILQ_INIT(&asoc->strmin[i].inqueue); in sctp_process_init()
368 TAILQ_INIT(&asoc->strmin[i].uno_inqueue); in sctp_process_init()
369 asoc->strmin[i].pd_api_started = 0; in sctp_process_init()
370 asoc->strmin[i].delivery_started = 0; in sctp_process_init()
396 struct sctp_association *asoc; in sctp_process_init_ack() local
447 asoc = &stcb->asoc; in sctp_process_init_ack()
448 asoc->peer_supports_nat = (uint8_t)nat_friendly; in sctp_process_init_ack()
467 initack_limit, src, dst, NULL, stcb->asoc.port)) < 0) { in sctp_process_init_ack()
484 if (asoc->asconf_supported == 0) { in sctp_process_init_ack()
487 TAILQ_FOREACH_SAFE(param, &asoc->asconf_queue, next, nparam) { in sctp_process_init_ack()
488 TAILQ_REMOVE(&asoc->asconf_queue, param, next); in sctp_process_init_ack()
493 stcb->asoc.peer_hmac_id = sctp_negotiate_hmacid(stcb->asoc.peer_hmacs, in sctp_process_init_ack()
494 stcb->asoc.local_hmacs); in sctp_process_init_ack()
503 stcb->asoc.overall_error_count, in sctp_process_init_ack()
516 asoc->primary_destination, SCTP_FROM_SCTP_INPUT + SCTP_LOC_3); in sctp_process_init_ack()
519 if (asoc->overall_error_count == 0) { in sctp_process_init_ack()
520 sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered, in sctp_process_init_ack()
523 stcb->asoc.overall_error_count = 0; in sctp_process_init_ack()
588 stcb->asoc.primary_destination = r_net; in sctp_handle_heartbeat_ack()
590 f_net = TAILQ_FIRST(&stcb->asoc.nets); in sctp_handle_heartbeat_ack()
598 TAILQ_REMOVE(&stcb->asoc.nets, r_net, sctp_next); in sctp_handle_heartbeat_ack()
599 TAILQ_INSERT_HEAD(&stcb->asoc.nets, r_net, sctp_next); in sctp_handle_heartbeat_ack()
611 stcb->asoc.overall_error_count, in sctp_handle_heartbeat_ack()
616 stcb->asoc.overall_error_count = 0; in sctp_handle_heartbeat_ack()
623 sctp_calculate_rto(stcb, &stcb->asoc, r_net, &tv, in sctp_handle_heartbeat_ack()
632 stcb->asoc.cc_functions.sctp_cwnd_update_exit_pf(stcb, net); in sctp_handle_heartbeat_ack()
639 if (r_net == stcb->asoc.primary_destination) { in sctp_handle_heartbeat_ack()
640 if (stcb->asoc.alternate) { in sctp_handle_heartbeat_ack()
642 sctp_free_remote_addr(stcb->asoc.alternate); in sctp_handle_heartbeat_ack()
643 stcb->asoc.alternate = NULL; in sctp_handle_heartbeat_ack()
660 stcb->asoc.primary_destination); in sctp_handle_heartbeat_ack()
665 stcb->asoc.deleted_primary); in sctp_handle_heartbeat_ack()
684 atomic_add_int(&stcb->asoc.refcnt, 1); in sctp_handle_nat_colliding_state()
688 atomic_subtract_int(&stcb->asoc.refcnt, 1); in sctp_handle_nat_colliding_state()
696 stcb->asoc.my_vtag = new_vtag; in sctp_handle_nat_colliding_state()
697 …head = &SCTP_BASE_INFO(sctp_asochash)[SCTP_PCBHASH_ASOC(stcb->asoc.my_vtag, SCTP_BASE_INFO(hashaso… in sctp_handle_nat_colliding_state()
715 sctp_toss_old_cookies(stcb, &stcb->asoc); in sctp_handle_nat_colliding_state()
716 stcb->asoc.my_vtag = new_vtag; in sctp_handle_nat_colliding_state()
717 …head = &SCTP_BASE_INFO(sctp_asochash)[SCTP_PCBHASH_ASOC(stcb->asoc.my_vtag, SCTP_BASE_INFO(hashaso… in sctp_handle_nat_colliding_state()
738 if (stcb->asoc.auth_supported == 0) { in sctp_handle_nat_missing_state()
811 TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { in sctp_start_net_timers()
836 struct sctp_association *asoc; in sctp_check_data_from_peer() local
841 asoc = &stcb->asoc; in sctp_check_data_from_peer()
842 if (SCTP_TSN_GT(asoc->highest_tsn_inside_map, asoc->cumulative_tsn) || in sctp_check_data_from_peer()
843 SCTP_TSN_GT(asoc->highest_tsn_inside_nr_map, asoc->cumulative_tsn)) { in sctp_check_data_from_peer()
848 for (i = 0; i < asoc->streamincnt; i++) { in sctp_check_data_from_peer()
849 if (!TAILQ_EMPTY(&asoc->strmin[i].inqueue) || in sctp_check_data_from_peer()
850 !TAILQ_EMPTY(&asoc->strmin[i].uno_inqueue)) { in sctp_check_data_from_peer()
903 (void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered); in sctp_handle_shutdown()
917 if (!TAILQ_EMPTY(&stcb->asoc.send_queue) || in sctp_handle_shutdown()
918 !TAILQ_EMPTY(&stcb->asoc.sent_queue) || in sctp_handle_shutdown()
974 if (!TAILQ_EMPTY(&stcb->asoc.send_queue) || in sctp_handle_shutdown_ack()
975 !TAILQ_EMPTY(&stcb->asoc.sent_queue) || in sctp_handle_shutdown_ack()
1009 stcb->asoc.prsctp_supported = 0; in sctp_process_unrecog_chunk()
1031 stcb->asoc.prsctp_supported = 0; in sctp_process_unrecog_param()
1037 stcb->asoc.peer_supports_nat = 0; in sctp_process_unrecog_param()
1042 stcb->asoc.asconf_supported = 0; in sctp_process_unrecog_param()
1049 stcb->asoc.asconf_supported = 0; in sctp_process_unrecog_param()
1064 struct sctp_association *asoc; in sctp_handle_error() local
1069 asoc = &stcb->asoc; in sctp_handle_error()
1129 asoc->stale_cookie_count++; in sctp_handle_error()
1130 if (asoc->stale_cookie_count > asoc->max_init_times) { in sctp_handle_error()
1141 timevalsub(&now, &asoc->time_entered); in sctp_handle_error()
1155 asoc->cookie_preserve_req = (uint32_t)stale_time; in sctp_handle_error()
1156 if (asoc->overall_error_count == 0) { in sctp_handle_error()
1157 sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered, in sctp_handle_error()
1160 asoc->overall_error_count = 0; in sctp_handle_error()
1162 sctp_toss_old_cookies(stcb, &stcb->asoc); in sctp_handle_error()
1165 (void)SCTP_GETTIME_TIMEVAL(&asoc->time_entered); in sctp_handle_error()
1279 if (stcb->asoc.primary_destination->dest_state & in sctp_handle_init_ack()
1287 stcb->asoc.primary_destination->dest_state &= in sctp_handle_init_ack()
1290 stcb, 0, (void *)stcb->asoc.primary_destination, SCTP_SO_NOT_LOCKED); in sctp_handle_init_ack()
1306 stcb->asoc.overall_error_count, in sctp_handle_init_ack()
1311 stcb->asoc.overall_error_count = 0; in sctp_handle_init_ack()
1312 (void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered); in sctp_handle_init_ack()
1356 struct sctp_association *asoc; in sctp_process_cookie_existing() local
1376 asoc = &stcb->asoc; in sctp_process_cookie_existing()
1377 for (how_indx = 0; how_indx < sizeof(asoc->cookie_how); how_indx++) { in sctp_process_cookie_existing()
1378 if (asoc->cookie_how[how_indx] == 0) in sctp_process_cookie_existing()
1381 if (how_indx < sizeof(asoc->cookie_how)) { in sctp_process_cookie_existing()
1382 asoc->cookie_how[how_indx] = 1; in sctp_process_cookie_existing()
1386 sctp_send_shutdown_ack(stcb, stcb->asoc.primary_destination); in sctp_process_cookie_existing()
1391 if (how_indx < sizeof(asoc->cookie_how)) in sctp_process_cookie_existing()
1392 asoc->cookie_how[how_indx] = 2; in sctp_process_cookie_existing()
1432 if ((ntohl(initack_cp->init.initiate_tag) == asoc->my_vtag) && in sctp_process_cookie_existing()
1433 (ntohl(init_cp->init.initiate_tag) == asoc->peer_vtag)) { in sctp_process_cookie_existing()
1438 if (ntohl(initack_cp->init.initial_tsn) != asoc->init_seq_number) { in sctp_process_cookie_existing()
1453 if (how_indx < sizeof(asoc->cookie_how)) in sctp_process_cookie_existing()
1454 asoc->cookie_how[how_indx] = 17; in sctp_process_cookie_existing()
1469 if (how_indx < sizeof(asoc->cookie_how)) in sctp_process_cookie_existing()
1470 asoc->cookie_how[how_indx] = 3; in sctp_process_cookie_existing()
1510 if (stcb->asoc.sctp_autoclose_ticks && in sctp_process_cookie_existing()
1526 initack_offset, src, dst, init_src, stcb->asoc.port)) < 0) { in sctp_process_cookie_existing()
1527 if (how_indx < sizeof(asoc->cookie_how)) in sctp_process_cookie_existing()
1528 asoc->cookie_how[how_indx] = 4; in sctp_process_cookie_existing()
1541 sctp_toss_old_cookies(stcb, asoc); in sctp_process_cookie_existing()
1543 if (how_indx < sizeof(asoc->cookie_how)) in sctp_process_cookie_existing()
1544 asoc->cookie_how[how_indx] = 5; in sctp_process_cookie_existing()
1548 if (ntohl(initack_cp->init.initiate_tag) != asoc->my_vtag && in sctp_process_cookie_existing()
1549 ntohl(init_cp->init.initiate_tag) == asoc->peer_vtag && in sctp_process_cookie_existing()
1555 if (how_indx < sizeof(asoc->cookie_how)) in sctp_process_cookie_existing()
1556 asoc->cookie_how[how_indx] = 6; in sctp_process_cookie_existing()
1565 (asoc->peer_supports_nat) && in sctp_process_cookie_existing()
1566 ((ntohl(initack_cp->init.initiate_tag) == asoc->my_vtag) && in sctp_process_cookie_existing()
1567 ((ntohl(init_cp->init.initiate_tag) != asoc->peer_vtag) || in sctp_process_cookie_existing()
1568 (asoc->peer_vtag == 0)))) { in sctp_process_cookie_existing()
1586 if ((ntohl(initack_cp->init.initiate_tag) == asoc->my_vtag) && in sctp_process_cookie_existing()
1587 ((ntohl(init_cp->init.initiate_tag) != asoc->peer_vtag) || in sctp_process_cookie_existing()
1588 (asoc->peer_vtag == 0))) { in sctp_process_cookie_existing()
1593 if (ntohl(initack_cp->init.initial_tsn) != asoc->init_seq_number) { in sctp_process_cookie_existing()
1611 if (how_indx < sizeof(asoc->cookie_how)) in sctp_process_cookie_existing()
1612 asoc->cookie_how[how_indx] = 7; in sctp_process_cookie_existing()
1617 if (how_indx < sizeof(asoc->cookie_how)) in sctp_process_cookie_existing()
1618 asoc->cookie_how[how_indx] = 8; in sctp_process_cookie_existing()
1627 if (stcb->asoc.sctp_autoclose_ticks && in sctp_process_cookie_existing()
1632 asoc->my_rwnd = ntohl(initack_cp->init.a_rwnd); in sctp_process_cookie_existing()
1633 if (asoc->pre_open_streams < asoc->streamoutcnt) { in sctp_process_cookie_existing()
1634 asoc->pre_open_streams = asoc->streamoutcnt; in sctp_process_cookie_existing()
1637 if (ntohl(init_cp->init.initiate_tag) != asoc->peer_vtag) { in sctp_process_cookie_existing()
1647 TAILQ_FOREACH(chk, &stcb->asoc.sent_queue, sctp_next) { in sctp_process_cookie_existing()
1652 sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); in sctp_process_cookie_existing()
1659 if (how_indx < sizeof(asoc->cookie_how)) in sctp_process_cookie_existing()
1660 asoc->cookie_how[how_indx] = 9; in sctp_process_cookie_existing()
1671 initack_offset, src, dst, init_src, stcb->asoc.port)) < 0) { in sctp_process_cookie_existing()
1672 if (how_indx < sizeof(asoc->cookie_how)) in sctp_process_cookie_existing()
1673 asoc->cookie_how[how_indx] = 10; in sctp_process_cookie_existing()
1707 sctp_toss_old_cookies(stcb, asoc); in sctp_process_cookie_existing()
1719 if (how_indx < sizeof(asoc->cookie_how)) in sctp_process_cookie_existing()
1720 asoc->cookie_how[how_indx] = 11; in sctp_process_cookie_existing()
1724 if ((ntohl(initack_cp->init.initiate_tag) != asoc->my_vtag && in sctp_process_cookie_existing()
1725 ntohl(init_cp->init.initiate_tag) != asoc->peer_vtag) && in sctp_process_cookie_existing()
1726 cookie->tie_tag_my_vtag == asoc->my_vtag_nonce && in sctp_process_cookie_existing()
1727 cookie->tie_tag_peer_vtag == asoc->peer_vtag_nonce && in sctp_process_cookie_existing()
1731 if (asoc->peer_supports_nat) { in sctp_process_cookie_existing()
1754 if (how_indx < sizeof(asoc->cookie_how)) in sctp_process_cookie_existing()
1755 asoc->cookie_how[how_indx] = 12; in sctp_process_cookie_existing()
1759 atomic_add_int(&stcb->asoc.refcnt, 1); in sctp_process_cookie_existing()
1770 if (asoc->state & SCTP_STATE_SHUTDOWN_PENDING) { in sctp_process_cookie_existing()
1777 if (asoc->pre_open_streams < asoc->streamoutcnt) { in sctp_process_cookie_existing()
1778 asoc->pre_open_streams = asoc->streamoutcnt; in sctp_process_cookie_existing()
1780 asoc->init_seq_number = ntohl(initack_cp->init.initial_tsn); in sctp_process_cookie_existing()
1781 asoc->sending_seq = asoc->asconf_seq_out = asoc->str_reset_seq_out = asoc->init_seq_number; in sctp_process_cookie_existing()
1782 asoc->asconf_seq_out_acked = asoc->asconf_seq_out - 1; in sctp_process_cookie_existing()
1783 asoc->asconf_seq_in = asoc->last_acked_seq = asoc->init_seq_number - 1; in sctp_process_cookie_existing()
1784 asoc->str_reset_seq_in = asoc->init_seq_number; in sctp_process_cookie_existing()
1785 asoc->advanced_peer_ack_point = asoc->last_acked_seq; in sctp_process_cookie_existing()
1786 asoc->send_sack = 1; in sctp_process_cookie_existing()
1787 asoc->data_pkts_seen = 0; in sctp_process_cookie_existing()
1788 asoc->last_data_chunk_from = NULL; in sctp_process_cookie_existing()
1789 asoc->last_control_chunk_from = NULL; in sctp_process_cookie_existing()
1790 asoc->last_net_cmt_send_started = NULL; in sctp_process_cookie_existing()
1791 if (asoc->mapping_array) { in sctp_process_cookie_existing()
1792 memset(asoc->mapping_array, 0, in sctp_process_cookie_existing()
1793 asoc->mapping_array_size); in sctp_process_cookie_existing()
1795 if (asoc->nr_mapping_array) { in sctp_process_cookie_existing()
1796 memset(asoc->nr_mapping_array, 0, in sctp_process_cookie_existing()
1797 asoc->mapping_array_size); in sctp_process_cookie_existing()
1803 atomic_subtract_int(&stcb->asoc.refcnt, 1); in sctp_process_cookie_existing()
1806 for (i = 0; i < stcb->asoc.streamoutcnt; i++) { in sctp_process_cookie_existing()
1807 stcb->asoc.strmout[i].chunks_on_queues = 0; in sctp_process_cookie_existing()
1810 asoc->strmout[i].abandoned_sent[j] = 0; in sctp_process_cookie_existing()
1811 asoc->strmout[i].abandoned_unsent[j] = 0; in sctp_process_cookie_existing()
1814 asoc->strmout[i].abandoned_sent[0] = 0; in sctp_process_cookie_existing()
1815 asoc->strmout[i].abandoned_unsent[0] = 0; in sctp_process_cookie_existing()
1817 stcb->asoc.strmout[i].next_mid_ordered = 0; in sctp_process_cookie_existing()
1818 stcb->asoc.strmout[i].next_mid_unordered = 0; in sctp_process_cookie_existing()
1819 stcb->asoc.strmout[i].sid = i; in sctp_process_cookie_existing()
1820 stcb->asoc.strmout[i].last_msg_incomplete = 0; in sctp_process_cookie_existing()
1822 TAILQ_FOREACH_SAFE(strrst, &asoc->resetHead, next_resp, nstrrst) { in sctp_process_cookie_existing()
1823 TAILQ_REMOVE(&asoc->resetHead, strrst, next_resp); in sctp_process_cookie_existing()
1826 TAILQ_FOREACH_SAFE(sq, &asoc->pending_reply_queue, next, nsq) { in sctp_process_cookie_existing()
1827 TAILQ_REMOVE(&asoc->pending_reply_queue, sq, next); in sctp_process_cookie_existing()
1837 TAILQ_FOREACH_SAFE(chk, &asoc->control_send_queue, sctp_next, nchk) { in sctp_process_cookie_existing()
1838 TAILQ_REMOVE(&asoc->control_send_queue, chk, sctp_next); in sctp_process_cookie_existing()
1849 asoc->ctrl_queue_cnt = 0; in sctp_process_cookie_existing()
1850 asoc->str_reset = NULL; in sctp_process_cookie_existing()
1851 asoc->stream_reset_outstanding = 0; in sctp_process_cookie_existing()
1852 TAILQ_FOREACH_SAFE(chk, &asoc->asconf_send_queue, sctp_next, nchk) { in sctp_process_cookie_existing()
1853 TAILQ_REMOVE(&asoc->asconf_send_queue, chk, sctp_next); in sctp_process_cookie_existing()
1864 TAILQ_FOREACH_SAFE(aparam, &asoc->asconf_queue, next, naparam) { in sctp_process_cookie_existing()
1865 TAILQ_REMOVE(&asoc->asconf_queue, aparam, next); in sctp_process_cookie_existing()
1868 TAILQ_FOREACH_SAFE(aack, &asoc->asconf_ack_sent, next, naack) { in sctp_process_cookie_existing()
1869 TAILQ_REMOVE(&asoc->asconf_ack_sent, aack, next); in sctp_process_cookie_existing()
1875 asoc->rcv_edmid = cookie->rcv_edmid; in sctp_process_cookie_existing()
1878 asoc->my_vtag = ntohl(initack_cp->init.initiate_tag); in sctp_process_cookie_existing()
1879 asoc->my_rwnd = ntohl(initack_cp->init.a_rwnd); in sctp_process_cookie_existing()
1884 head = &SCTP_BASE_INFO(sctp_asochash)[SCTP_PCBHASH_ASOC(stcb->asoc.my_vtag, in sctp_process_cookie_existing()
1894 asoc->total_flight = 0; in sctp_process_cookie_existing()
1895 asoc->total_flight_count = 0; in sctp_process_cookie_existing()
1898 if (how_indx < sizeof(asoc->cookie_how)) in sctp_process_cookie_existing()
1899 asoc->cookie_how[how_indx] = 13; in sctp_process_cookie_existing()
1916 initack_offset, src, dst, init_src, stcb->asoc.port)) < 0) { in sctp_process_cookie_existing()
1917 if (how_indx < sizeof(asoc->cookie_how)) in sctp_process_cookie_existing()
1918 asoc->cookie_how[how_indx] = 14; in sctp_process_cookie_existing()
1932 if (how_indx < sizeof(asoc->cookie_how)) in sctp_process_cookie_existing()
1933 asoc->cookie_how[how_indx] = 15; in sctp_process_cookie_existing()
1935 (asoc->sctp_autoclose_ticks > 0)) { in sctp_process_cookie_existing()
1940 if (how_indx < sizeof(asoc->cookie_how)) in sctp_process_cookie_existing()
1941 asoc->cookie_how[how_indx] = 16; in sctp_process_cookie_existing()
1968 struct sctp_association *asoc; in sctp_process_cookie_new() local
2047 asoc = &stcb->asoc; in sctp_process_cookie_new()
2049 asoc->scope.ipv4_local_scope = cookie->ipv4_scope; in sctp_process_cookie_new()
2050 asoc->scope.site_scope = cookie->site_scope; in sctp_process_cookie_new()
2051 asoc->scope.local_scope = cookie->local_scope; in sctp_process_cookie_new()
2052 asoc->scope.loopback_scope = cookie->loopback_scope; in sctp_process_cookie_new()
2054 if ((asoc->scope.ipv4_addr_legal != cookie->ipv4_addr_legal) || in sctp_process_cookie_new()
2055 (asoc->scope.ipv6_addr_legal != cookie->ipv6_addr_legal)) { in sctp_process_cookie_new()
2072 asoc->rcv_edmid = cookie->rcv_edmid; in sctp_process_cookie_new()
2074 asoc->my_rwnd = ntohl(initack_cp->init.a_rwnd); in sctp_process_cookie_new()
2114 stcb->asoc.authenticated = 1; in sctp_process_cookie_new()
2188 if (stcb->asoc.sctp_autoclose_ticks && in sctp_process_cookie_new()
2192 (void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered); in sctp_process_cookie_new()
2224 if ((stcb->asoc.my_vtag == tag) && (stcb->rport == rport) && (inp == stcb->sctp_ep)) {
2316 atomic_add_int(&l_stcb->asoc.refcnt, 1); in sctp_handle_cookie_echo()
2323 atomic_subtract_int(&l_stcb->asoc.refcnt, 1); in sctp_handle_cookie_echo()
2453 * asoc. This will only happen if we were in the COOKIE-WAIT state in sctp_handle_cookie_echo()
2608 atomic_add_int(&(*stcb)->asoc.refcnt, 1); in sctp_handle_cookie_echo()
2615 atomic_subtract_int(&(*stcb)->asoc.refcnt, 1); in sctp_handle_cookie_echo()
2688 atomic_add_int(&(*stcb)->asoc.refcnt, 1); in sctp_handle_cookie_echo()
2694 atomic_subtract_int(&(*stcb)->asoc.refcnt, 1); in sctp_handle_cookie_echo()
2742 struct sctp_association *asoc; in sctp_handle_cookie_ack() local
2751 asoc = &stcb->asoc; in sctp_handle_cookie_ack()
2754 asoc->overall_error_count, in sctp_handle_cookie_ack()
2760 sctp_toss_old_cookies(stcb, asoc); in sctp_handle_cookie_ack()
2770 if (asoc->overall_error_count == 0) { in sctp_handle_cookie_ack()
2771 sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered, in sctp_handle_cookie_ack()
2778 asoc->overall_error_count = 0; in sctp_handle_cookie_ack()
2780 (void)SCTP_GETTIME_TIMEVAL(&asoc->time_entered); in sctp_handle_cookie_ack()
2785 if ((stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) == 0) { in sctp_handle_cookie_ack()
2790 if ((asoc->state & SCTP_STATE_SHUTDOWN_PENDING) && in sctp_handle_cookie_ack()
2791 TAILQ_EMPTY(&asoc->send_queue) && in sctp_handle_cookie_ack()
2792 TAILQ_EMPTY(&asoc->sent_queue) && in sctp_handle_cookie_ack()
2793 (asoc->stream_queue_cnt == 0)) { in sctp_handle_cookie_ack()
2805 if (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) { in sctp_handle_cookie_ack()
2816 if (stcb->asoc.sctp_autoclose_ticks && in sctp_handle_cookie_ack()
2827 (stcb->asoc.asconf_supported == 1) && in sctp_handle_cookie_ack()
2828 (!TAILQ_EMPTY(&stcb->asoc.asconf_queue))) { in sctp_handle_cookie_ack()
2832 stcb->asoc.primary_destination); in sctp_handle_cookie_ack()
2834 sctp_send_asconf(stcb, stcb->asoc.primary_destination, in sctp_handle_cookie_ack()
2841 TAILQ_FOREACH(chk, &asoc->sent_queue, sctp_next) { in sctp_handle_cookie_ack()
2873 lchk = TAILQ_LAST(&stcb->asoc.send_queue, sctpchunk_listhead); in sctp_handle_ecn_echo()
2875 window_data_tsn = stcb->asoc.sending_seq - 1; in sctp_handle_ecn_echo()
2882 TAILQ_FOREACH(lchk, &stcb->asoc.sent_queue, sctp_next) { in sctp_handle_ecn_echo()
2898 TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { in sctp_handle_ecn_echo()
2910 net = TAILQ_FIRST(&stcb->asoc.nets); in sctp_handle_ecn_echo()
2928 stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo(stcb, net, 0, pkt_cnt); in sctp_handle_ecn_echo()
2958 stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo(stcb, net, 1, cnt); in sctp_handle_ecn_echo()
2985 TAILQ_FOREACH_SAFE(chk, &stcb->asoc.control_send_queue, sctp_next, nchk) { in sctp_handle_ecn_cwr()
2996 stcb->asoc.ecn_echo_cnt_onq--; in sctp_handle_ecn_cwr()
2997 TAILQ_REMOVE(&stcb->asoc.control_send_queue, chk, in sctp_handle_ecn_cwr()
2999 stcb->asoc.ctrl_queue_cnt--; in sctp_handle_ecn_cwr()
3033 if (!TAILQ_EMPTY(&stcb->asoc.send_queue) || in sctp_handle_shutdown_complete()
3034 !TAILQ_EMPTY(&stcb->asoc.sent_queue) || in sctp_handle_shutdown_complete()
3045 "sctp_handle_shutdown_complete: calls free-asoc\n"); in sctp_handle_shutdown_complete()
3064 TAILQ_FOREACH(tp1, &stcb->asoc.sent_queue, sctp_next) { in process_chunk_drop()
3081 TAILQ_FOREACH(tp1, &stcb->asoc.sent_queue, sctp_next) { in process_chunk_drop()
3096 if ((stcb->asoc.peers_rwnd == 0) && in process_chunk_drop()
3101 if (stcb->asoc.peers_rwnd == 0 && in process_chunk_drop()
3130 sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); in process_chunk_drop()
3141 if (TAILQ_EMPTY(&stcb->asoc.send_queue)) { in process_chunk_drop()
3142 tp1->rec.data.fast_retran_tsn = stcb->asoc.sending_seq; in process_chunk_drop()
3144 tp1->rec.data.fast_retran_tsn = (TAILQ_FIRST(&stcb->asoc.send_queue))->rec.data.tsn; in process_chunk_drop()
3172 TAILQ_FOREACH(tp1, &stcb->asoc.sent_queue, sctp_next) { in process_chunk_drop()
3176 TAILQ_FOREACH(tp1, &stcb->asoc.control_send_queue, in process_chunk_drop()
3181 if (audit != stcb->asoc.sent_queue_retran_cnt) { in process_chunk_drop()
3182 SCTP_PRINTF("**Local Audit finds cnt:%d asoc cnt:%d\n", in process_chunk_drop()
3183 audit, stcb->asoc.sent_queue_retran_cnt); in process_chunk_drop()
3185 stcb->asoc.sent_queue_retran_cnt = audit; in process_chunk_drop()
3195 TAILQ_FOREACH(asconf, &stcb->asoc.control_send_queue, in process_chunk_drop()
3203 sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); in process_chunk_drop()
3211 stcb->asoc.dropped_special_cnt++; in process_chunk_drop()
3212 if (stcb->asoc.dropped_special_cnt < SCTP_RETRY_DROPPED_THRESH) { in process_chunk_drop()
3230 if ((stcb->asoc.overall_error_count + 3) < stcb->asoc.max_send_times) { in process_chunk_drop()
3249 TAILQ_FOREACH(cookie, &stcb->asoc.control_send_queue, in process_chunk_drop()
3257 sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); in process_chunk_drop()
3272 send_forward_tsn(stcb, &stcb->asoc); in process_chunk_drop()
3303 if (temp >= stcb->asoc.streamincnt) { in sctp_reset_in_stream()
3306 stcb->asoc.strmin[temp].last_mid_delivered = 0xffffffff; in sctp_reset_in_stream()
3310 for (i = 0; i < stcb->asoc.streamincnt; i++) { in sctp_reset_in_stream()
3311 stcb->asoc.strmin[i].last_mid_delivered = 0xffffffff; in sctp_reset_in_stream()
3326 if (temp >= stcb->asoc.streamoutcnt) { in sctp_reset_out_streams()
3330 stcb->asoc.strmout[temp].next_mid_ordered = 0; in sctp_reset_out_streams()
3331 stcb->asoc.strmout[temp].next_mid_unordered = 0; in sctp_reset_out_streams()
3334 for (i = 0; i < stcb->asoc.streamoutcnt; i++) { in sctp_reset_out_streams()
3335 stcb->asoc.strmout[i].next_mid_ordered = 0; in sctp_reset_out_streams()
3336 stcb->asoc.strmout[i].next_mid_unordered = 0; in sctp_reset_out_streams()
3351 if (temp >= stcb->asoc.streamoutcnt) { in sctp_reset_clear_pending()
3355 stcb->asoc.strmout[temp].state = SCTP_STREAM_OPEN; in sctp_reset_clear_pending()
3358 for (i = 0; i < stcb->asoc.streamoutcnt; i++) { in sctp_reset_clear_pending()
3359 stcb->asoc.strmout[i].state = SCTP_STREAM_OPEN; in sctp_reset_clear_pending()
3367 struct sctp_association *asoc; in sctp_find_stream_reset() local
3373 asoc = &stcb->asoc; in sctp_find_stream_reset()
3374 chk = asoc->str_reset; in sctp_find_stream_reset()
3375 if (TAILQ_EMPTY(&asoc->control_send_queue) || in sctp_find_stream_reset()
3377 asoc->stream_reset_outstanding = 0; in sctp_find_stream_reset()
3409 struct sctp_association *asoc; in sctp_clean_up_stream_reset() local
3412 asoc = &stcb->asoc; in sctp_clean_up_stream_reset()
3413 chk = asoc->str_reset; in sctp_clean_up_stream_reset()
3417 asoc->str_reset = NULL; in sctp_clean_up_stream_reset()
3420 TAILQ_REMOVE(&asoc->control_send_queue, chk, sctp_next); in sctp_clean_up_stream_reset()
3421 asoc->ctrl_queue_cnt--; in sctp_clean_up_stream_reset()
3436 struct sctp_association *asoc = &stcb->asoc; in sctp_handle_stream_reset_response() local
3443 if (asoc->stream_reset_outstanding == 0) { in sctp_handle_stream_reset_response()
3447 if (seq == stcb->asoc.str_reset_seq_out) { in sctp_handle_stream_reset_response()
3450 stcb->asoc.str_reset_seq_out++; in sctp_handle_stream_reset_response()
3458 asoc->stream_reset_out_is_outstanding = 0; in sctp_handle_stream_reset_response()
3459 if (asoc->stream_reset_outstanding) in sctp_handle_stream_reset_response()
3460 asoc->stream_reset_outstanding--; in sctp_handle_stream_reset_response()
3471 asoc->stream_reset_outstanding++; in sctp_handle_stream_reset_response()
3472 stcb->asoc.str_reset_seq_out--; in sctp_handle_stream_reset_response()
3473 asoc->stream_reset_out_is_outstanding = 1; in sctp_handle_stream_reset_response()
3484 if (asoc->stream_reset_outstanding) in sctp_handle_stream_reset_response()
3485 asoc->stream_reset_outstanding--; in sctp_handle_stream_reset_response()
3497 num_stream = stcb->asoc.strm_pending_add_size; in sctp_handle_stream_reset_response()
3498 if (num_stream > (stcb->asoc.strm_realoutsize - stcb->asoc.streamoutcnt)) { in sctp_handle_stream_reset_response()
3500 num_stream = stcb->asoc.strm_realoutsize - stcb->asoc.streamoutcnt; in sctp_handle_stream_reset_response()
3502 stcb->asoc.strm_pending_add_size = 0; in sctp_handle_stream_reset_response()
3503 if (asoc->stream_reset_outstanding) in sctp_handle_stream_reset_response()
3504 asoc->stream_reset_outstanding--; in sctp_handle_stream_reset_response()
3509 for (i = asoc->streamoutcnt; i < (asoc->streamoutcnt + num_stream); i++) { in sctp_handle_stream_reset_response()
3510 asoc->strmout[i].state = SCTP_STREAM_OPEN; in sctp_handle_stream_reset_response()
3512 asoc->streamoutcnt += num_stream; in sctp_handle_stream_reset_response()
3520 if (asoc->stream_reset_outstanding) in sctp_handle_stream_reset_response()
3521 asoc->stream_reset_outstanding--; in sctp_handle_stream_reset_response()
3546 asoc->stream_reset_outstanding--; in sctp_handle_stream_reset_response()
3554 stcb->asoc.highest_tsn_inside_map = (ntohl(resp->senders_next_tsn) - 1); in sctp_handle_stream_reset_response()
3556 sctp_log_map(0, 7, asoc->highest_tsn_inside_map, SCTP_MAP_SLIDE_RESULT); in sctp_handle_stream_reset_response()
3559 stcb->asoc.tsn_last_delivered = stcb->asoc.cumulative_tsn = stcb->asoc.highest_tsn_inside_map; in sctp_handle_stream_reset_response()
3560 stcb->asoc.mapping_array_base_tsn = ntohl(resp->senders_next_tsn); in sctp_handle_stream_reset_response()
3561 memset(stcb->asoc.mapping_array, 0, stcb->asoc.mapping_array_size); in sctp_handle_stream_reset_response()
3563 stcb->asoc.highest_tsn_inside_nr_map = stcb->asoc.highest_tsn_inside_map; in sctp_handle_stream_reset_response()
3564 memset(stcb->asoc.nr_mapping_array, 0, stcb->asoc.mapping_array_size); in sctp_handle_stream_reset_response()
3566 stcb->asoc.sending_seq = ntohl(resp->receivers_next_tsn); in sctp_handle_stream_reset_response()
3567 stcb->asoc.last_acked_seq = stcb->asoc.cumulative_tsn; in sctp_handle_stream_reset_response()
3579 if (asoc->stream_reset_outstanding == 0) { in sctp_handle_stream_reset_response()
3584 if (asoc->stream_reset_outstanding == 0) { in sctp_handle_stream_reset_response()
3604 struct sctp_association *asoc = &stcb->asoc; in sctp_handle_str_reset_request_in() local
3607 if (asoc->str_reset_seq_in == seq) { in sctp_handle_str_reset_request_in()
3608 asoc->last_reset_action[1] = asoc->last_reset_action[0]; in sctp_handle_str_reset_request_in()
3609 if ((asoc->local_strreset_support & SCTP_ENABLE_RESET_STREAM_REQ) == 0) { in sctp_handle_str_reset_request_in()
3610 asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_DENIED; in sctp_handle_str_reset_request_in()
3613 asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_DENIED; in sctp_handle_str_reset_request_in()
3614 } else if (stcb->asoc.stream_reset_out_is_outstanding == 0) { in sctp_handle_str_reset_request_in()
3620 if (temp >= stcb->asoc.streamoutcnt) { in sctp_handle_str_reset_request_in()
3621 asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_DENIED; in sctp_handle_str_reset_request_in()
3627 if (stcb->asoc.strmout[req->list_of_streams[i]].state == SCTP_STREAM_OPEN) { in sctp_handle_str_reset_request_in()
3628 stcb->asoc.strmout[req->list_of_streams[i]].state = SCTP_STREAM_RESET_PENDING; in sctp_handle_str_reset_request_in()
3633 for (i = 0; i < stcb->asoc.streamoutcnt; i++) { in sctp_handle_str_reset_request_in()
3634 if (stcb->asoc.strmout[i].state == SCTP_STREAM_OPEN) in sctp_handle_str_reset_request_in()
3635 stcb->asoc.strmout[i].state = SCTP_STREAM_RESET_PENDING; in sctp_handle_str_reset_request_in()
3638 asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_PERFORMED; in sctp_handle_str_reset_request_in()
3641 asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_ERR_IN_PROGRESS; in sctp_handle_str_reset_request_in()
3644 sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[0]); in sctp_handle_str_reset_request_in()
3645 asoc->str_reset_seq_in++; in sctp_handle_str_reset_request_in()
3646 } else if (asoc->str_reset_seq_in - 1 == seq) { in sctp_handle_str_reset_request_in()
3647 sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[0]); in sctp_handle_str_reset_request_in()
3648 } else if (asoc->str_reset_seq_in - 2 == seq) { in sctp_handle_str_reset_request_in()
3649 sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[1]); in sctp_handle_str_reset_request_in()
3668 struct sctp_association *asoc = &stcb->asoc; in sctp_handle_str_reset_request_tsn() local
3673 if (asoc->str_reset_seq_in == seq) { in sctp_handle_str_reset_request_tsn()
3674 asoc->last_reset_action[1] = stcb->asoc.last_reset_action[0]; in sctp_handle_str_reset_request_tsn()
3675 if ((asoc->local_strreset_support & SCTP_ENABLE_CHANGE_ASSOC_REQ) == 0) { in sctp_handle_str_reset_request_tsn()
3676 asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_DENIED; in sctp_handle_str_reset_request_tsn()
3681 fwdtsn.new_cumulative_tsn = htonl(stcb->asoc.highest_tsn_inside_map + 1); in sctp_handle_str_reset_request_tsn()
3686 asoc->highest_tsn_inside_map += SCTP_STREAM_RESET_TSN_DELTA; in sctp_handle_str_reset_request_tsn()
3688 sctp_log_map(0, 10, asoc->highest_tsn_inside_map, SCTP_MAP_SLIDE_RESULT); in sctp_handle_str_reset_request_tsn()
3690 asoc->tsn_last_delivered = asoc->cumulative_tsn = asoc->highest_tsn_inside_map; in sctp_handle_str_reset_request_tsn()
3691 asoc->mapping_array_base_tsn = asoc->highest_tsn_inside_map + 1; in sctp_handle_str_reset_request_tsn()
3692 memset(asoc->mapping_array, 0, asoc->mapping_array_size); in sctp_handle_str_reset_request_tsn()
3693 asoc->highest_tsn_inside_nr_map = asoc->highest_tsn_inside_map; in sctp_handle_str_reset_request_tsn()
3694 memset(asoc->nr_mapping_array, 0, asoc->mapping_array_size); in sctp_handle_str_reset_request_tsn()
3695 atomic_add_int(&asoc->sending_seq, 1); in sctp_handle_str_reset_request_tsn()
3697 asoc->last_sending_seq[1] = asoc->last_sending_seq[0]; in sctp_handle_str_reset_request_tsn()
3698 asoc->last_sending_seq[0] = asoc->sending_seq; in sctp_handle_str_reset_request_tsn()
3699 asoc->last_base_tsnsent[1] = asoc->last_base_tsnsent[0]; in sctp_handle_str_reset_request_tsn()
3700 asoc->last_base_tsnsent[0] = asoc->mapping_array_base_tsn; in sctp_handle_str_reset_request_tsn()
3703 asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_PERFORMED; in sctp_handle_str_reset_request_tsn()
3706 sctp_add_stream_reset_result_tsn(chk, seq, asoc->last_reset_action[0], in sctp_handle_str_reset_request_tsn()
3707 asoc->last_sending_seq[0], asoc->last_base_tsnsent[0]); in sctp_handle_str_reset_request_tsn()
3708 asoc->str_reset_seq_in++; in sctp_handle_str_reset_request_tsn()
3709 } else if (asoc->str_reset_seq_in - 1 == seq) { in sctp_handle_str_reset_request_tsn()
3710 sctp_add_stream_reset_result_tsn(chk, seq, asoc->last_reset_action[0], in sctp_handle_str_reset_request_tsn()
3711 asoc->last_sending_seq[0], asoc->last_base_tsnsent[0]); in sctp_handle_str_reset_request_tsn()
3712 } else if (asoc->str_reset_seq_in - 2 == seq) { in sctp_handle_str_reset_request_tsn()
3713 sctp_add_stream_reset_result_tsn(chk, seq, asoc->last_reset_action[1], in sctp_handle_str_reset_request_tsn()
3714 asoc->last_sending_seq[1], asoc->last_base_tsnsent[1]); in sctp_handle_str_reset_request_tsn()
3728 struct sctp_association *asoc = &stcb->asoc; in sctp_handle_str_reset_request_out() local
3733 if (asoc->str_reset_seq_in == seq) { in sctp_handle_str_reset_request_out()
3746 asoc->last_reset_action[1] = asoc->last_reset_action[0]; in sctp_handle_str_reset_request_out()
3747 if ((asoc->local_strreset_support & SCTP_ENABLE_RESET_STREAM_REQ) == 0) { in sctp_handle_str_reset_request_out()
3748 asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_DENIED; in sctp_handle_str_reset_request_out()
3750 asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_DENIED; in sctp_handle_str_reset_request_out()
3751 } else if (SCTP_TSN_GE(asoc->cumulative_tsn, tsn)) { in sctp_handle_str_reset_request_out()
3754 asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_PERFORMED; in sctp_handle_str_reset_request_out()
3768 asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_DENIED; in sctp_handle_str_reset_request_out()
3769 sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[0]); in sctp_handle_str_reset_request_out()
3776 TAILQ_INSERT_TAIL(&asoc->resetHead, liste, next_resp); in sctp_handle_str_reset_request_out()
3777 asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_IN_PROGRESS; in sctp_handle_str_reset_request_out()
3779 sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[0]); in sctp_handle_str_reset_request_out()
3780 asoc->str_reset_seq_in++; in sctp_handle_str_reset_request_out()
3781 } else if ((asoc->str_reset_seq_in - 1) == seq) { in sctp_handle_str_reset_request_out()
3786 sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[0]); in sctp_handle_str_reset_request_out()
3787 } else if ((asoc->str_reset_seq_in - 2) == seq) { in sctp_handle_str_reset_request_out()
3792 sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[1]); in sctp_handle_str_reset_request_out()
3808 struct sctp_association *asoc = &stcb->asoc; in sctp_handle_str_reset_add_strm() local
3815 if (asoc->str_reset_seq_in == seq) { in sctp_handle_str_reset_add_strm()
3816 num_stream += stcb->asoc.streamincnt; in sctp_handle_str_reset_add_strm()
3817 stcb->asoc.last_reset_action[1] = stcb->asoc.last_reset_action[0]; in sctp_handle_str_reset_add_strm()
3818 if ((asoc->local_strreset_support & SCTP_ENABLE_CHANGE_ASSOC_REQ) == 0) { in sctp_handle_str_reset_add_strm()
3819 asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_DENIED; in sctp_handle_str_reset_add_strm()
3820 } else if ((num_stream > stcb->asoc.max_inbound_streams) || in sctp_handle_str_reset_add_strm()
3824 stcb->asoc.last_reset_action[0] = SCTP_STREAM_RESET_RESULT_DENIED; in sctp_handle_str_reset_add_strm()
3830 oldstrm = stcb->asoc.strmin; in sctp_handle_str_reset_add_strm()
3831 SCTP_MALLOC(stcb->asoc.strmin, struct sctp_stream_in *, in sctp_handle_str_reset_add_strm()
3834 if (stcb->asoc.strmin == NULL) { in sctp_handle_str_reset_add_strm()
3835 stcb->asoc.strmin = oldstrm; in sctp_handle_str_reset_add_strm()
3839 for (i = 0; i < stcb->asoc.streamincnt; i++) { in sctp_handle_str_reset_add_strm()
3840 TAILQ_INIT(&stcb->asoc.strmin[i].inqueue); in sctp_handle_str_reset_add_strm()
3841 TAILQ_INIT(&stcb->asoc.strmin[i].uno_inqueue); in sctp_handle_str_reset_add_strm()
3842 stcb->asoc.strmin[i].sid = i; in sctp_handle_str_reset_add_strm()
3843 stcb->asoc.strmin[i].last_mid_delivered = oldstrm[i].last_mid_delivered; in sctp_handle_str_reset_add_strm()
3844 stcb->asoc.strmin[i].delivery_started = oldstrm[i].delivery_started; in sctp_handle_str_reset_add_strm()
3845 stcb->asoc.strmin[i].pd_api_started = oldstrm[i].pd_api_started; in sctp_handle_str_reset_add_strm()
3849 TAILQ_INSERT_TAIL(&stcb->asoc.strmin[i].inqueue, ctl, next_instrm); in sctp_handle_str_reset_add_strm()
3853 TAILQ_INSERT_TAIL(&stcb->asoc.strmin[i].uno_inqueue, ctl, next_instrm); in sctp_handle_str_reset_add_strm()
3857 for (i = stcb->asoc.streamincnt; i < num_stream; i++) { in sctp_handle_str_reset_add_strm()
3858 TAILQ_INIT(&stcb->asoc.strmin[i].inqueue); in sctp_handle_str_reset_add_strm()
3859 TAILQ_INIT(&stcb->asoc.strmin[i].uno_inqueue); in sctp_handle_str_reset_add_strm()
3860 stcb->asoc.strmin[i].sid = i; in sctp_handle_str_reset_add_strm()
3861 stcb->asoc.strmin[i].last_mid_delivered = 0xffffffff; in sctp_handle_str_reset_add_strm()
3862 stcb->asoc.strmin[i].pd_api_started = 0; in sctp_handle_str_reset_add_strm()
3863 stcb->asoc.strmin[i].delivery_started = 0; in sctp_handle_str_reset_add_strm()
3867 stcb->asoc.streamincnt = num_stream; in sctp_handle_str_reset_add_strm()
3868 stcb->asoc.last_reset_action[0] = SCTP_STREAM_RESET_RESULT_PERFORMED; in sctp_handle_str_reset_add_strm()
3871 sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[0]); in sctp_handle_str_reset_add_strm()
3872 asoc->str_reset_seq_in++; in sctp_handle_str_reset_add_strm()
3873 } else if ((asoc->str_reset_seq_in - 1) == seq) { in sctp_handle_str_reset_add_strm()
3878 sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[0]); in sctp_handle_str_reset_add_strm()
3879 } else if ((asoc->str_reset_seq_in - 2) == seq) { in sctp_handle_str_reset_add_strm()
3884 sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[1]); in sctp_handle_str_reset_add_strm()
3900 struct sctp_association *asoc = &stcb->asoc; in sctp_handle_str_reset_add_out_strm() local
3906 if (asoc->str_reset_seq_in == seq) { in sctp_handle_str_reset_add_out_strm()
3907 stcb->asoc.last_reset_action[1] = stcb->asoc.last_reset_action[0]; in sctp_handle_str_reset_add_out_strm()
3908 if ((asoc->local_strreset_support & SCTP_ENABLE_CHANGE_ASSOC_REQ) == 0) { in sctp_handle_str_reset_add_out_strm()
3909 asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_DENIED; in sctp_handle_str_reset_add_out_strm()
3910 } else if (stcb->asoc.stream_reset_outstanding) { in sctp_handle_str_reset_add_out_strm()
3912 stcb->asoc.last_reset_action[0] = SCTP_STREAM_RESET_RESULT_ERR_IN_PROGRESS; in sctp_handle_str_reset_add_out_strm()
3917 mychk = stcb->asoc.streamoutcnt; in sctp_handle_str_reset_add_out_strm()
3920 stcb->asoc.last_reset_action[0] = SCTP_STREAM_RESET_RESULT_PERFORMED; in sctp_handle_str_reset_add_out_strm()
3922 stcb->asoc.last_reset_action[0] = SCTP_STREAM_RESET_RESULT_DENIED; in sctp_handle_str_reset_add_out_strm()
3925 stcb->asoc.last_reset_action[0] = SCTP_STREAM_RESET_RESULT_DENIED; in sctp_handle_str_reset_add_out_strm()
3928 sctp_add_stream_reset_result(chk, seq, stcb->asoc.last_reset_action[0]); in sctp_handle_str_reset_add_out_strm()
3929 asoc->str_reset_seq_in++; in sctp_handle_str_reset_add_out_strm()
3930 } else if ((asoc->str_reset_seq_in - 1) == seq) { in sctp_handle_str_reset_add_out_strm()
3935 sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[0]); in sctp_handle_str_reset_add_out_strm()
3936 } else if ((asoc->str_reset_seq_in - 2) == seq) { in sctp_handle_str_reset_add_out_strm()
3941 sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[1]); in sctp_handle_str_reset_add_out_strm()
3978 chk->asoc = &stcb->asoc; in sctp_handle_stream_reset()
4042 if (stcb->asoc.stream_reset_outstanding) { in sctp_handle_stream_reset()
4044 if (seq == stcb->asoc.str_reset_seq_out) { in sctp_handle_stream_reset()
4114 TAILQ_INSERT_TAIL(&stcb->asoc.control_send_queue, in sctp_handle_stream_reset()
4117 stcb->asoc.ctrl_queue_cnt++; in sctp_handle_stream_reset()
4180 if (stcb->asoc.idata_supported) { in sctp_handle_packet_dropped()
4207 if (!stcb->asoc.idata_supported) { in sctp_handle_packet_dropped()
4264 stcb->asoc.peers_rwnd = 0; in sctp_handle_packet_dropped()
4266 if (a_rwnd > stcb->asoc.total_flight) { in sctp_handle_packet_dropped()
4267 stcb->asoc.peers_rwnd = in sctp_handle_packet_dropped()
4268 a_rwnd - stcb->asoc.total_flight; in sctp_handle_packet_dropped()
4270 stcb->asoc.peers_rwnd = 0; in sctp_handle_packet_dropped()
4272 if (stcb->asoc.peers_rwnd < in sctp_handle_packet_dropped()
4275 stcb->asoc.peers_rwnd = 0; in sctp_handle_packet_dropped()
4285 (stcb->asoc.sat_t3_loss_recovery == 0) && in sctp_handle_packet_dropped()
4286 (stcb->asoc.sat_network)) { in sctp_handle_packet_dropped()
4292 stcb->asoc.cc_functions.sctp_cwnd_update_after_packet_dropped(stcb, in sctp_handle_packet_dropped()
4303 * cookie-echo processing - return NULL to discard the packet (ie. no asoc,
4317 struct sctp_association *asoc; in sctp_process_control() local
4452 stcb->asoc.authenticated = 1; in sctp_process_control()
4467 asoc = &stcb->asoc; in sctp_process_control()
4474 (vtag_in == asoc->my_vtag)) || in sctp_process_control()
4476 (asoc->peer_vtag != htonl(0)) && in sctp_process_control()
4477 (vtag_in == asoc->peer_vtag))) { in sctp_process_control()
4489 if (vtag_in != asoc->my_vtag) { in sctp_process_control()
4493 vtag_in, asoc->my_vtag); in sctp_process_control()
4562 stcb->asoc.last_control_chunk_from = *netp; in sctp_process_control()
4571 sctp_auth_is_required_chunk(ch->chunk_type, stcb->asoc.local_auth_chunks) && in sctp_process_control()
4572 !stcb->asoc.authenticated) { in sctp_process_control()
4619 if ((stcb != NULL) && (stcb->asoc.total_output_queue_size)) { in sctp_process_control()
4683 if (stcb->asoc.nrsack_supported == 0) { in sctp_process_control()
4738 stcb->asoc.seen_a_sack_this_pkt = 1; in sctp_process_control()
4739 if ((stcb->asoc.pr_sctp_cnt == 0) && in sctp_process_control()
4741 SCTP_TSN_GE(cum_ack, stcb->asoc.last_acked_seq) && in sctp_process_control()
4742 (stcb->asoc.saw_sack_with_frags == 0) && in sctp_process_control()
4743 (stcb->asoc.saw_sack_with_nr_frags == 0) && in sctp_process_control()
4744 (!TAILQ_EMPTY(&stcb->asoc.sent_queue))) { in sctp_process_control()
4768 if (TAILQ_EMPTY(&stcb->asoc.send_queue) && in sctp_process_control()
4769 TAILQ_EMPTY(&stcb->asoc.sent_queue) && in sctp_process_control()
4770 (stcb->asoc.stream_queue_cnt == 0)) { in sctp_process_control()
4845 if ((stcb != NULL) && (stcb->asoc.total_output_queue_size > 0)) { in sctp_process_control()
4955 TAILQ_FOREACH(chk, &stcb->asoc.sent_queue, sctp_next) { in sctp_process_control()
4972 if ((stcb) && (stcb->asoc.total_output_queue_size)) { in sctp_process_control()
4990 if (stcb->asoc.ecn_supported == 0) { in sctp_process_control()
5005 if (stcb->asoc.ecn_supported == 0) { in sctp_process_control()
5032 if (stcb->asoc.asconf_supported == 0) { in sctp_process_control()
5045 if (stcb->asoc.asconf_supported == 0) { in sctp_process_control()
5055 stcb->asoc.overall_error_count, in sctp_process_control()
5060 stcb->asoc.overall_error_count = 0; in sctp_process_control()
5074 if (stcb->asoc.prsctp_supported == 0) { in sctp_process_control()
5080 if (((stcb->asoc.idata_supported == 1) && (ch->chunk_type == SCTP_FORWARD_CUM_TSN)) || in sctp_process_control()
5081 ((stcb->asoc.idata_supported == 0) && (ch->chunk_type == SCTP_IFORWARD_CUM_TSN))) { in sctp_process_control()
5103 stcb->asoc.last_data_chunk_from = stcb->asoc.last_control_chunk_from; in sctp_process_control()
5117 if (stcb->asoc.reconfig_supported == 0) { in sctp_process_control()
5134 if (stcb->asoc.pktdrop_supported == 0) { in sctp_process_control()
5158 if (stcb->asoc.auth_supported == 0) { in sctp_process_control()
5179 stcb->asoc.authenticated = 1; in sctp_process_control()
5329 if (stcb->asoc.smallest_mtu > net->mtu) { in sctp_common_input_processing()
5349 if (stcb->asoc.pktdrop_supported) { in sctp_common_input_processing()
5372 if (stcb->asoc.rcv_edmid == SCTP_EDMID_NONE) { in sctp_common_input_processing()
5375 KASSERT(stcb->asoc.rcv_edmid == SCTP_EDMID_LOWER_LAYER_DTLS, in sctp_common_input_processing()
5376 ("Unexpected EDMID %u", stcb->asoc.rcv_edmid)); in sctp_common_input_processing()
5399 if (stcb->asoc.smallest_mtu > net->mtu) { in sctp_common_input_processing()
5451 stcb->asoc.authenticated = 0; in sctp_common_input_processing()
5452 stcb->asoc.seen_a_sack_this_pkt = 0; in sctp_common_input_processing()
5454 (void *)stcb, stcb->asoc.state); in sctp_common_input_processing()
5456 if ((stcb->asoc.state & SCTP_STATE_WAS_ABORTED) || in sctp_common_input_processing()
5457 (stcb->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED)) { in sctp_common_input_processing()
5496 if (stcb->asoc.smallest_mtu > net->mtu) { in sctp_common_input_processing()
5520 sctp_auth_is_required_chunk(SCTP_DATA, stcb->asoc.local_auth_chunks)) { in sctp_common_input_processing()
5537 if (stcb->asoc.my_vtag != ntohl(sh->v_tag)) { in sctp_common_input_processing()
5566 sctp_auth_is_required_chunk(SCTP_DATA, stcb->asoc.local_auth_chunks) && in sctp_common_input_processing()
5567 !stcb->asoc.authenticated) { in sctp_common_input_processing()
5593 * We consider OOTB any data sent during asoc setup. in sctp_common_input_processing()
5638 (stcb->asoc.ecn_supported == 1) && in sctp_common_input_processing()
5648 if (SCTP_TSN_GT(stcb->asoc.highest_tsn_inside_nr_map, stcb->asoc.highest_tsn_inside_map)) { in sctp_common_input_processing()
5649 highest_tsn = stcb->asoc.highest_tsn_inside_nr_map; in sctp_common_input_processing()
5651 highest_tsn = stcb->asoc.highest_tsn_inside_map; in sctp_common_input_processing()
5653 was_a_gap = SCTP_TSN_GT(highest_tsn, stcb->asoc.cumulative_tsn); in sctp_common_input_processing()
5654 stcb->asoc.send_sack = 1; in sctp_common_input_processing()
5657 stcb->asoc.send_sack = 1; in sctp_common_input_processing()
5667 stcb->asoc.peers_rwnd, in sctp_common_input_processing()
5668 TAILQ_EMPTY(&stcb->asoc.control_send_queue), in sctp_common_input_processing()
5669 stcb->asoc.total_flight); in sctp_common_input_processing()
5670 un_sent = (stcb->asoc.total_output_queue_size - stcb->asoc.total_flight); in sctp_common_input_processing()
5671 if (!TAILQ_EMPTY(&stcb->asoc.control_send_queue)) { in sctp_common_input_processing()
5672 cnt_ctrl_ready = stcb->asoc.ctrl_queue_cnt - stcb->asoc.ecn_echo_cnt_onq; in sctp_common_input_processing()
5674 if (!TAILQ_EMPTY(&stcb->asoc.asconf_send_queue) || in sctp_common_input_processing()
5676 stcb->asoc.trigger_reset || in sctp_common_input_processing()
5678 (stcb->asoc.peers_rwnd > 0 || stcb->asoc.total_flight == 0))) { in sctp_common_input_processing()