Home | History | Annotate | Download | only in netinet

Lines Matching defs:asoc

75 	TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
215 (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_ACK_SENT)) {
249 struct sctp_association *asoc;
256 asoc = &stcb->asoc;
258 if (!stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) {
260 for (i = 0; i < stcb->asoc.streamoutcnt; i++) {
262 sp = TAILQ_FIRST(&stcb->asoc.strmout[i].outqueue);
281 atomic_subtract_int(&stcb->asoc.stream_queue_cnt, 1);
282 TAILQ_REMOVE(&stcb->asoc.strmout[i].outqueue, sp, next);
306 struct sctp_association *asoc;
311 asoc = &stcb->asoc;
313 asoc->peer_vtag = ntohl(init->initiate_tag);
314 asoc->peers_rwnd = ntohl(init->a_rwnd);
316 asoc->highest_tsn_inside_map = asoc->asconf_seq_in = ntohl(init->initial_tsn) - 1;
318 if (!TAILQ_EMPTY(&asoc->nets)) {
320 TAILQ_FOREACH(lnet, &asoc->nets, sctp_next) {
321 lnet->ssthresh = asoc->peers_rwnd;
329 if (asoc->pre_open_streams > ntohs(init->num_inbound_streams)) {
337 TAILQ_FOREACH_SAFE(chk, &asoc->send_queue, sctp_next, nchk) {
339 TAILQ_REMOVE(&asoc->send_queue, chk, sctp_next);
340 asoc->send_queue_cnt--;
341 if (asoc->strmout[chk->rec.data.stream_number].chunks_on_queues > 0) {
342 asoc->strmout[chk->rec.data.stream_number].chunks_on_queues--;
349 sctp_free_bufspace(stcb, asoc, chk, 1);
361 if (asoc->strmout) {
362 for (i = newcnt; i < asoc->pre_open_streams; i++) {
363 outs = &asoc->strmout[i];
366 asoc->stream_queue_cnt--;
384 asoc->pre_open_streams = newcnt;
387 asoc->strm_realoutsize = asoc->streamoutcnt = asoc->pre_open_streams;
390 asoc->highest_tsn_inside_nr_map = asoc->highest_tsn_inside_map;
392 sctp_log_map(0, 5, asoc->highest_tsn_inside_map, SCTP_MAP_SLIDE_RESULT);
395 asoc->str_reset_seq_in = asoc->asconf_seq_in + 1;
397 asoc->mapping_array_base_tsn = ntohl(init->initial_tsn);
398 asoc->tsn_last_delivered = asoc->cumulative_tsn = asoc->asconf_seq_in;
400 asoc->advanced_peer_ack_point = asoc->last_acked_seq;
403 if (asoc->strmin != NULL) {
407 for (i = 0; i < asoc->streamincnt; i++) {
408 TAILQ_FOREACH_SAFE(ctl, &asoc->strmin[i].inqueue, next, nctl) {
409 TAILQ_REMOVE(&asoc->strmin[i].inqueue, ctl, next);
417 SCTP_FREE(asoc->strmin, SCTP_M_STRMI);
419 if (asoc->max_inbound_streams > ntohs(init->num_outbound_streams)) {
420 asoc->streamincnt = ntohs(init->num_outbound_streams);
422 asoc->streamincnt = asoc->max_inbound_streams;
424 SCTP_MALLOC(asoc->strmin, struct sctp_stream_in *, asoc->streamincnt *
426 if (asoc->strmin == NULL) {
431 for (i = 0; i < asoc->streamincnt; i++) {
432 asoc->strmin[i].stream_no = i;
433 asoc->strmin[i].last_sequence_delivered = 0xffff;
434 TAILQ_INIT(&asoc->strmin[i].inqueue);
435 asoc->strmin[i].delivery_started = 0;
463 struct sctp_association *asoc;
481 asoc = &stcb->asoc;
482 asoc->peer_supports_nat = (uint8_t)nat_friendly;
508 if (asoc->peer_supports_asconf == 0) {
511 TAILQ_FOREACH_SAFE(param, &asoc->asconf_queue, next, nparam) {
512 TAILQ_REMOVE(&asoc->asconf_queue, param, next);
517 stcb->asoc.peer_hmac_id = sctp_negotiate_hmacid(stcb->asoc.peer_hmacs,
518 stcb->asoc.local_hmacs);
527 stcb->asoc.overall_error_count,
532 stcb->asoc.overall_error_count = 0;
542 asoc->primary_destination, SCTP_FROM_SCTP_INPUT+SCTP_LOC_4);
545 net->RTO = sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered, sctp_align_safe_nocopy,
681 stcb->asoc.primary_destination = r_net;
683 f_net = TAILQ_FIRST(&stcb->asoc.nets);
690 TAILQ_REMOVE(&stcb->asoc.nets, r_net, sctp_next);
691 TAILQ_INSERT_HEAD(&stcb->asoc.nets, r_net, sctp_next);
706 r_net->RTO = sctp_calculate_rto(stcb, &stcb->asoc, r_net, &tv, sctp_align_safe_nocopy,
715 stcb->asoc.cc_functions.sctp_cwnd_update_exit_pf(stcb, net);
721 if (r_net == stcb->asoc.primary_destination) {
722 if (stcb->asoc.alternate) {
724 sctp_free_remote_addr(stcb->asoc.alternate);
725 stcb->asoc.alternate = NULL;
741 stcb->asoc.primary_destination);
746 stcb->asoc.deleted_primary);
749 stcb->asoc.deleted_primary);
762 if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_WAIT) {
765 stcb->asoc.my_vtag = sctp_select_a_tag(stcb->sctp_ep, stcb->sctp_ep->sctp_lport, stcb->rport, 1);
766 head = &SCTP_BASE_INFO(sctp_asochash)[SCTP_PCBHASH_ASOC(stcb->asoc.my_vtag, SCTP_BASE_INFO(hashasocmark))];
772 if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_ECHOED) {
780 stcb->asoc.state &= ~SCTP_STATE_COOKIE_ECHOED;
781 stcb->asoc.state |= SCTP_STATE_COOKIE_WAIT;
783 sctp_toss_old_cookies(stcb, &stcb->asoc);
784 stcb->asoc.my_vtag = sctp_select_a_tag(stcb->sctp_ep, stcb->sctp_ep->sctp_lport, stcb->rport, 1);
785 head = &SCTP_BASE_INFO(sctp_asochash)[SCTP_PCBHASH_ASOC(stcb->asoc.my_vtag, SCTP_BASE_INFO(hashasocmark))];
802 if (stcb->asoc.peer_supports_auth == 0) {
857 if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) ||
858 (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) {
866 atomic_add_int(&stcb->asoc.refcnt, 1);
870 atomic_subtract_int(&stcb->asoc.refcnt, 1);
872 stcb->asoc.state |= SCTP_STATE_WAS_ABORTED;
888 TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
916 struct sctp_association *asoc;
926 asoc = &stcb->asoc;
927 if ((SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_WAIT) ||
928 (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED)) {
940 if (asoc->control_pdapi) {
945 asoc->control_pdapi->end_added = 1;
946 asoc->control_pdapi->pdapi_aborted = 1;
947 asoc->control_pdapi = NULL;
951 atomic_add_int(&stcb->asoc.refcnt, 1);
955 atomic_subtract_int(&stcb->asoc.refcnt, 1);
956 if (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) {
969 if ((SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_RECEIVED) &&
970 (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT) &&
971 (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_SENT)) {
972 SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_RECEIVED);
973 SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING);
978 (void)SCTP_GETTIME_TIMEVAL(&asoc->time_entered);
981 if (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_SENT) {
991 if (!TAILQ_EMPTY(&asoc->send_queue) ||
992 !TAILQ_EMPTY(&asoc->sent_queue) ||
1000 if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) ||
1001 (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) {
1004 SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_ACK_SENT);
1005 SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING);
1018 struct sctp_association *asoc;
1029 asoc = &stcb->asoc;
1031 if ((SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_WAIT) ||
1032 (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED)) {
1038 if ((SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_SENT) &&
1039 (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT)) {
1044 if (asoc->control_pdapi) {
1049 asoc->control_pdapi->end_added = 1;
1050 asoc->control_pdapi->pdapi_aborted = 1;
1051 asoc->control_pdapi = NULL;
1054 atomic_add_int(&stcb->asoc.refcnt, 1);
1058 atomic_subtract_int(&stcb->asoc.refcnt, 1);
1059 if (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) {
1071 if (!TAILQ_EMPTY(&asoc->send_queue) ||
1072 !TAILQ_EMPTY(&asoc->sent_queue) ||
1073 !stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) {
1092 atomic_add_int(&stcb->asoc.refcnt, 1);
1096 atomic_subtract_int(&stcb->asoc.refcnt, 1);
1123 stcb->asoc.peer_supports_prsctp = 0;
1147 stcb->asoc.peer_supports_prsctp = 0;
1153 stcb->asoc.peer_supports_nat = 0;
1158 stcb->asoc.peer_supports_asconf = 0;
1165 stcb->asoc.peer_supports_asconf = 0;
1183 struct sctp_association *asoc;
1190 asoc = &stcb->asoc;
1236 if (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED) {
1241 asoc->cookie_preserve_req = ntohl(*p) << 1;
1242 asoc->stale_cookie_count++;
1243 if (asoc->stale_cookie_count >
1244 asoc->max_init_times) {
1246 /* now free the asoc */
1249 atomic_add_int(&stcb->asoc.refcnt, 1);
1253 atomic_subtract_int(&stcb->asoc.refcnt, 1);
1263 sctp_toss_old_cookies(stcb, &stcb->asoc);
1264 asoc->state &= ~SCTP_STATE_COOKIE_ECHOED;
1265 asoc->state |= SCTP_STATE_COOKIE_WAIT;
1413 switch (stcb->asoc.state & SCTP_STATE_MASK) {
1417 if (stcb->asoc.primary_destination->dest_state &
1425 stcb->asoc.primary_destination->dest_state &=
1428 stcb, 0, (void *)stcb->asoc.primary_destination, SCTP_SO_NOT_LOCKED);
1441 SCTP_SET_STATE(&stcb->asoc, SCTP_STATE_COOKIE_ECHOED);
1446 stcb->asoc.overall_error_count,
1451 stcb->asoc.overall_error_count = 0;
1452 (void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered);
1515 struct sctp_association *asoc;
1527 asoc = &stcb->asoc;
1528 for (how_indx = 0; how_indx < sizeof(asoc->cookie_how); how_indx++) {
1529 if (asoc->cookie_how[how_indx] == 0)
1532 if (how_indx < sizeof(asoc->cookie_how)) {
1533 asoc->cookie_how[how_indx] = 1;
1535 if (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_ACK_SENT) {
1537 sctp_send_shutdown_ack(stcb, stcb->asoc.primary_destination);
1544 if (how_indx < sizeof(asoc->cookie_how))
1545 asoc->cookie_how[how_indx] = 2;
1580 if ((ntohl(initack_cp->init.initiate_tag) == asoc->my_vtag) &&
1581 (ntohl(init_cp->init.initiate_tag) == asoc->peer_vtag)) {
1586 if (ntohl(initack_cp->init.initial_tsn) != asoc->init_seq_number) {
1601 if (how_indx < sizeof(asoc->cookie_how))
1602 asoc->cookie_how[how_indx] = 17;
1606 switch (SCTP_GET_STATE(asoc)) {
1618 if (how_indx < sizeof(asoc->cookie_how))
1619 asoc->cookie_how[how_indx] = 3;
1627 if (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED)
1632 SCTP_SET_STATE(asoc, SCTP_STATE_OPEN);
1633 if (asoc->state & SCTP_STATE_SHUTDOWN_PENDING) {
1635 stcb->sctp_ep, stcb, asoc->primary_destination);
1656 atomic_add_int(&stcb->asoc.refcnt, 1);
1660 atomic_add_int(&stcb->asoc.refcnt, -1);
1661 if (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) {
1678 net->RTO = sctp_calculate_rto(stcb, asoc, net,
1683 if (stcb->asoc.sctp_autoclose_ticks &&
1699 * somehow abort.. but we do have an existing asoc. This
1705 if (how_indx < sizeof(asoc->cookie_how))
1706 asoc->cookie_how[how_indx] = 4;
1710 sctp_toss_old_cookies(stcb, asoc);
1712 if (how_indx < sizeof(asoc->cookie_how))
1713 asoc->cookie_how[how_indx] = 5;
1717 if (ntohl(initack_cp->init.initiate_tag) != asoc->my_vtag &&
1718 ntohl(init_cp->init.initiate_tag) == asoc->peer_vtag &&
1724 if (how_indx < sizeof(asoc->cookie_how))
1725 asoc->cookie_how[how_indx] = 6;
1731 if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) &&
1732 (asoc->peer_supports_nat) &&
1733 ((ntohl(initack_cp->init.initiate_tag) == asoc->my_vtag) &&
1734 ((ntohl(init_cp->init.initiate_tag) != asoc->peer_vtag) ||
1735 (asoc->peer_vtag == 0)))) {
1753 if ((ntohl(initack_cp->init.initiate_tag) == asoc->my_vtag) &&
1754 ((ntohl(init_cp->init.initiate_tag) != asoc->peer_vtag) ||
1755 (asoc->peer_vtag == 0))) {
1760 if (ntohl(initack_cp->init.initial_tsn) != asoc->init_seq_number) {
1777 if (how_indx < sizeof(asoc->cookie_how))
1778 asoc->cookie_how[how_indx] = 7;
1782 if (how_indx < sizeof(asoc->cookie_how))
1783 asoc->cookie_how[how_indx] = 8;
1791 if (stcb->asoc.sctp_autoclose_ticks &&
1796 asoc->my_rwnd = ntohl(initack_cp->init.a_rwnd);
1797 asoc->pre_open_streams = ntohs(initack_cp->init.num_outbound_streams);
1799 if (ntohl(init_cp->init.initiate_tag) != asoc->peer_vtag) {
1808 TAILQ_FOREACH(chk, &stcb->asoc.sent_queue, sctp_next) {
1813 sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt);
1822 if (how_indx < sizeof(asoc->cookie_how))
1823 asoc->cookie_how[how_indx] = 9;
1829 if (how_indx < sizeof(asoc->cookie_how))
1830 asoc->cookie_how[how_indx] = 10;
1833 if ((asoc->state & SCTP_STATE_COOKIE_WAIT) ||
1834 (asoc->state & SCTP_STATE_COOKIE_ECHOED)) {
1847 atomic_add_int(&stcb->asoc.refcnt, 1);
1851 atomic_add_int(&stcb->asoc.refcnt, -1);
1852 if (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) {
1862 if (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED)
1867 } else if (SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) {
1872 SCTP_SET_STATE(asoc, SCTP_STATE_OPEN);
1873 if (asoc->state & SCTP_STATE_SHUTDOWN_PENDING) {
1875 stcb->sctp_ep, stcb, asoc->primary_destination);
1878 sctp_toss_old_cookies(stcb, asoc);
1889 if (how_indx < sizeof(asoc->cookie_how))
1890 asoc->cookie_how[how_indx] = 11;
1894 if ((ntohl(initack_cp->init.initiate_tag) != asoc->my_vtag &&
1895 ntohl(init_cp->init.initiate_tag) != asoc->peer_vtag) &&
1896 cookie->tie_tag_my_vtag == asoc->my_vtag_nonce &&
1897 cookie->tie_tag_peer_vtag == asoc->peer_vtag_nonce &&
1904 if (asoc->peer_supports_nat) {
1923 if (how_indx < sizeof(asoc->cookie_how))
1924 asoc->cookie_how[how_indx] = 12;
1930 atomic_add_int(&stcb->asoc.refcnt, 1);
1931 if ((SCTP_GET_STATE(asoc) != SCTP_STATE_OPEN) &&
1932 (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_RECEIVED) &&
1933 (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_SENT)) {
1936 if (SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) {
1938 } else if (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_SENT) {
1941 if (asoc->state & SCTP_STATE_SHUTDOWN_PENDING) {
1942 SCTP_SET_STATE(asoc, SCTP_STATE_OPEN);
1944 stcb->sctp_ep, stcb, asoc->primary_destination);
1946 } else if (!(asoc->state & SCTP_STATE_SHUTDOWN_SENT)) {
1948 SCTP_SET_STATE(asoc, SCTP_STATE_OPEN);
1950 asoc->pre_open_streams =
1952 asoc->init_seq_number = ntohl(initack_cp->init.initial_tsn);
1953 asoc->sending_seq = asoc->asconf_seq_out = asoc->str_reset_seq_out = asoc->init_seq_number;
1954 asoc->asconf_seq_out_acked = asoc->asconf_seq_out - 1;
1956 asoc->asconf_seq_in = asoc->last_acked_seq = asoc->init_seq_number - 1;
1958 asoc->str_reset_seq_in = asoc
1960 asoc->advanced_peer_ack_point = asoc->last_acked_seq;
1961 if (asoc->mapping_array) {
1962 memset(asoc->mapping_array, 0,
1963 asoc->mapping_array_size);
1965 if (asoc->nr_mapping_array) {
1966 memset(asoc->nr_mapping_array, 0,
1967 asoc->mapping_array_size);
1977 atomic_add_int(&stcb->asoc.refcnt, -1);
1982 for (i = 0; i < stcb->asoc.streamoutcnt; i++) {
1983 stcb->asoc.strmout[i].chunks_on_queues = 0;
1984 stcb->asoc.strmout[i].stream_no = i;
1985 stcb->asoc.strmout[i].next_sequence_send = 0;
1986 stcb->asoc.strmout[i].last_msg_incomplete = 0;
1989 asoc->my_vtag = ntohl(initack_cp->init.initiate_tag);
1990 asoc->my_rwnd = ntohl(initack_cp->init.a_rwnd);
1995 head = &SCTP_BASE_INFO(sctp_asochash)[SCTP_PCBHASH_ASOC(stcb->asoc.my_vtag,
2009 asoc->total_flight = 0;
2010 asoc->total_flight_count = 0;
2014 if (how_indx < sizeof(asoc->cookie_how))
2015 asoc->cookie_how[how_indx] = 13;
2028 if (how_indx < sizeof(asoc->cookie_how))
2029 asoc->cookie_how[how_indx] = 14;
2035 sctp_toss_old_cookies(stcb, asoc);
2037 if (how_indx < sizeof(asoc->cookie_how))
2038 asoc->cookie_how[how_indx] = 15;
2042 if (how_indx < sizeof(asoc->cookie_how))
2043 asoc->cookie_how[how_indx] = 16;
2073 struct sctp_association *asoc;
2176 asoc = &stcb->asoc;
2178 asoc->scope.ipv4_local_scope = cookie->ipv4_scope;
2179 asoc->scope.site_scope = cookie->site_scope;
2180 asoc->scope.local_scope = cookie->local_scope;
2181 asoc->scope.loopback_scope = cookie->loopback_scope;
2184 if ((asoc->scope.ipv4_addr_legal != cookie->ipv4_addr_legal) ||
2185 (asoc->scope.ipv6_addr_legal != cookie->ipv6_addr_legal) ||
2186 (asoc->scope.conn_addr_legal != cookie->conn_addr_legal)) {
2188 if ((asoc->scope.ipv4_addr_legal != cookie->ipv4_addr_legal) ||
2189 (asoc->scope.ipv6_addr_legal != cookie->ipv6_addr_legal)) {
2198 atomic_add_int(&stcb->asoc.refcnt, 1);
2216 atomic_subtract_int(&stcb->asoc.refcnt, 1);
2220 asoc->my_vtag = ntohl(initack_cp->init.initiate_tag);
2221 asoc->my_rwnd = ntohl(initack_cp->init.a_rwnd);
2222 asoc->pre_open_streams = ntohs(initack_cp->init.num_outbound_streams);
2223 asoc->init_seq_number = ntohl(initack_cp->init.initial_tsn);
2224 asoc->sending_seq = asoc->asconf_seq_out = asoc->str_reset_seq_out = asoc->init_seq_number;
2225 asoc->asconf_seq_out_acked = asoc->asconf_seq_out - 1;
2226 asoc->asconf_seq_in = asoc->last_acked_seq = asoc->init_seq_number - 1;
2227 asoc->str_reset_seq_in = asoc->init_seq_number;
2229 asoc->advanced_peer_ack_point = asoc->last_acked_seq;
2237 atomic_add_int(&stcb->asoc.refcnt, 1);
2247 atomic_subtract_int(&stcb->asoc.refcnt, 1);
2254 atomic_add_int(&stcb->asoc.refcnt, 1);
2264 atomic_subtract_int(&stcb->asoc.refcnt, 1);
2283 atomic_add_int(&stcb->asoc.refcnt, 1);
2293 atomic_subtract_int(&stcb->asoc.refcnt, 1);
2297 stcb->asoc.authenticated = 1;
2302 SCTP_SET_STATE(asoc, SCTP_STATE_OPEN);
2303 if (asoc->state & SCTP_STATE_SHUTDOWN_PENDING) {
2305 stcb->sctp_ep, stcb, asoc->primary_destination);
2362 atomic_add_int(&stcb->asoc.refcnt, 1);
2372 atomic_subtract_int(&stcb->asoc.refcnt, 1);
2391 atomic_add_int(&stcb->asoc.refcnt, 1);
2395 atomic_subtract_int(&stcb->asoc.refcnt, 1);
2396 if (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) {
2418 if (stcb->asoc.sctp_autoclose_ticks &&
2423 (void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered);
2425 (*netp)->RTO = sctp_calculate_rto(stcb, asoc, *netp,
2453 if ((stcb->asoc.my_vtag == tag) && (stcb->rport == rport) && (inp == stcb->sctp_ep)) {
2671 * asoc. This will only happen if we were in the COOKIE-WAIT state
2853 atomic_add_int(&(*stcb)->asoc.refcnt, 1);
2879 atomic_subtract_int(&(*stcb)->asoc.refcnt, 1);
2897 atomic_add_int(&(*stcb)->asoc.refcnt, 1);
2901 atomic_subtract_int(&(*stcb)->asoc.refcnt, 1);
2960 (*stcb)->asoc.state |= SCTP_STATE_IN_ACCEPT_QUEUE;
2964 atomic_add_int(&(*stcb)->asoc.refcnt, 1);
2974 atomic_subtract_int(&(*stcb)->asoc.refcnt, 1);
3000 atomic_add_int(&(*stcb)->asoc.refcnt, 1);
3007 atomic_subtract_int(&(*stcb)->asoc.refcnt, 1);
3028 struct sctp_association *asoc;
3035 asoc = &stcb->asoc;
3039 if (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED) {
3042 SCTP_SET_STATE(asoc, SCTP_STATE_OPEN);
3044 if (asoc->state & SCTP_STATE_SHUTDOWN_PENDING) {
3046 stcb->sctp_ep, stcb, asoc->primary_destination);
3052 if (asoc->overall_error_count == 0) {
3053 net->RTO = sctp_calculate_rto(stcb, asoc, net,
3054 &asoc->time_entered, sctp_align_safe_nocopy,
3057 (void)SCTP_GETTIME_TIMEVAL(&asoc->time_entered);
3068 atomic_add_int(&stcb->asoc.refcnt, 1);
3072 atomic_subtract_int(&stcb->asoc.refcnt, 1);
3074 if ((stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) == 0) {
3087 if (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) {
3098 if (stcb->asoc.sctp_autoclose_ticks &&
3109 (stcb->asoc.peer_supports_asconf) &&
3110 (!TAILQ_EMPTY(&stcb->asoc.asconf_queue))) {
3114 stcb->asoc.primary_destination);
3116 sctp_send_asconf(stcb, stcb->asoc.primary_destination,
3123 sctp_toss_old_cookies(stcb, asoc);
3124 if (!TAILQ_EMPTY(&asoc->sent_queue)) {
3128 chk = TAILQ_FIRST(&asoc->sent_queue);
3159 lchk = TAILQ_LAST(&stcb->asoc.send_queue, sctpchunk_listhead);
3161 window_data_tsn = stcb->asoc.sending_seq - 1;
3168 TAILQ_FOREACH(lchk, &stcb->asoc.sent_queue, sctp_next) {
3184 TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
3196 net = TAILQ_FIRST(&stcb->asoc.nets);
3211 stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo(stcb, net, 0, pkt_cnt);
3240 stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo(stcb, net, 1, cnt);
3267 TAILQ_FOREACH(chk, &stcb->asoc.control_send_queue, sctp_next) {
3278 stcb->asoc.ecn_echo_cnt_onq--;
3279 TAILQ_REMOVE(&stcb->asoc.control_send_queue, chk,
3285 stcb->asoc.ctrl_queue_cnt--;
3298 struct sctp_association *asoc;
3308 asoc = &stcb->asoc;
3310 if (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT) {
3322 if (!TAILQ_EMPTY(&asoc->send_queue) ||
3323 !TAILQ_EMPTY(&asoc->sent_queue) ||
3324 !stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) {
3333 "sctp_handle_shutdown_complete: calls free-asoc\n");
3336 atomic_add_int(&stcb->asoc.refcnt, 1);
3340 atomic_subtract_int(&stcb->asoc.refcnt, 1);
3361 TAILQ_FOREACH(tp1, &stcb->asoc.sent_queue, sctp_next) {
3378 TAILQ_FOREACH(tp1, &stcb->asoc.sent_queue, sctp_next) {
3395 if ((stcb->asoc.peers_rwnd == 0) &&
3400 if (stcb->asoc.peers_rwnd == 0 &&
3431 sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt);
3442 if (TAILQ_EMPTY(&stcb->asoc.send_queue)) {
3443 tp1->rec.data.fast_retran_tsn = stcb->asoc.sending_seq;
3445 tp1->rec.data.fast_retran_tsn = (TAILQ_FIRST(&stcb->asoc.send_queue))->rec.data.TSN_seq;
3472 TAILQ_FOREACH(tp1, &stcb->asoc.sent_queue, sctp_next) {
3476 TAILQ_FOREACH(tp1, &stcb->asoc.control_send_queue,
3481 if (audit != stcb->asoc.sent_queue_retran_cnt) {
3482 SCTP_PRINTF("**Local Audit finds cnt:%d asoc cnt:%d\n",
3483 audit, stcb->asoc.sent_queue_retran_cnt);
3485 stcb->asoc.sent_queue_retran_cnt = audit;
3495 TAILQ_FOREACH(asconf, &stcb->asoc.control_send_queue,
3503 sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt);
3511 stcb->asoc.dropped_special_cnt++;
3512 if (stcb->asoc.dropped_special_cnt < SCTP_RETRY_DROPPED_THRESH) {
3529 if ((stcb->asoc.overall_error_count + 3) < stcb->asoc.max_send_times) {
3545 TAILQ_FOREACH(cookie, &stcb->asoc.control_send_queue,
3553 sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt);
3567 send_forward_tsn(stcb, &stcb->asoc);
3598 if (temp >= stcb->asoc.streamincnt) {
3601 stcb->asoc.strmin[temp].last_sequence_delivered = 0xffff;
3605 for (i = 0; i < stcb->asoc.streamincnt; i++) {
3606 stcb->asoc.strmin[i].last_sequence_delivered = 0xffff;
3621 if (temp >= stcb->asoc.streamoutcnt) {
3625 stcb->asoc.strmout[temp].next_sequence_send = 0;
3628 for (i = 0; i < stcb->asoc.streamoutcnt; i++) {
3629 stcb->asoc.strmout[i].next_sequence_send = 0;
3639 struct sctp_association *asoc;
3645 asoc = &stcb->asoc;
3646 if (TAILQ_EMPTY(&stcb->asoc.control_send_queue)) {
3647 asoc->stream_reset_outstanding = 0;
3650 if (stcb->asoc.str_reset == NULL) {
3651 asoc->stream_reset_outstanding = 0;
3654 chk = stcb->asoc.str_reset;
3684 struct sctp_association *asoc;
3685 struct sctp_tmit_chunk *chk = stcb->asoc.str_reset;
3687 if (stcb->asoc.str_reset == NULL) {
3690 asoc = &stcb->asoc;
3693 TAILQ_REMOVE(&asoc->control_send_queue,
3700 asoc->ctrl_queue_cnt--;
3703 stcb->asoc.str_reset = NULL;
3714 struct sctp_association *asoc = &stcb->asoc;
3719 if (asoc->stream_reset_outstanding == 0) {
3723 if (seq == stcb->asoc.str_reset_seq_out) {
3726 stcb->asoc.str_reset_seq_out++;
3731 asoc->stream_reset_out_is_outstanding = 0;
3732 if (asoc->stream_reset_outstanding)
3733 asoc->stream_reset_outstanding--;
3745 if (asoc->stream_reset_outstanding)
3746 asoc->stream_reset_outstanding--;
3758 num_stream = stcb->asoc.strm_pending_add_size;
3759 if (num_stream > (stcb->asoc.strm_realoutsize - stcb->asoc.streamoutcnt)) {
3761 num_stream = stcb->asoc.strm_realoutsize - stcb->asoc.streamoutcnt;
3763 stcb->asoc.strm_pending_add_size = 0;
3764 if (asoc->stream_reset_outstanding)
3765 asoc->stream_reset_outstanding--;
3768 stcb->asoc.streamoutcnt += num_stream;
3769 sctp_notify_stream_reset_add(stcb, stcb->asoc.streamincnt, stcb->asoc.streamoutcnt, 0);
3771 sctp_notify_stream_reset_add(stcb, stcb->asoc.streamincnt, stcb->asoc.streamoutcnt,
3774 sctp_notify_stream_reset_add(stcb, stcb->asoc.streamincnt, stcb->asoc.streamoutcnt,
3778 if (asoc->stream_reset_outstanding)
3779 asoc->stream_reset_outstanding--;
3781 sctp_notify_stream_reset_add(stcb, stcb->asoc.streamincnt, stcb->asoc.streamoutcnt,
3784 sctp_notify_stream_reset_add(stcb, stcb->asoc.streamincnt, stcb->asoc.streamoutcnt,
3802 asoc->stream_reset_outstanding--;
3810 stcb->asoc.highest_tsn_inside_map = (ntohl(resp->senders_next_tsn) - 1);
3812 sctp_log_map(0, 7, asoc->highest_tsn_inside_map, SCTP_MAP_SLIDE_RESULT);
3815 stcb->asoc.tsn_last_delivered = stcb->asoc.cumulative_tsn = stcb->asoc.highest_tsn_inside_map;
3816 stcb->asoc.mapping_array_base_tsn = ntohl(resp->senders_next_tsn);
3817 memset(stcb->asoc.mapping_array, 0, stcb->asoc.mapping_array_size);
3819 stcb->asoc.highest_tsn_inside_nr_map = stcb->asoc.highest_tsn_inside_map;
3820 memset(stcb->asoc.nr_mapping_array, 0, stcb->asoc.mapping_array_size);
3822 stcb->asoc.sending_seq = ntohl(resp->receivers_next_tsn);
3823 stcb->asoc.last_acked_seq = stcb->asoc.cumulative_tsn;
3827 sctp_notify_stream_reset_tsn(stcb, stcb->asoc.sending_seq, (stcb->asoc.mapping_array_base_tsn + 1), 0);
3829 sctp_notify_stream_reset_tsn(stcb, stcb->asoc.sending_seq, (stcb->asoc.mapping_array_base_tsn + 1),
3832 sctp_notify_stream_reset_tsn(stcb, stcb->asoc.sending_seq, (stcb->asoc.mapping_array_base_tsn + 1),
3837 if (asoc->stream_reset_outstanding == 0) {
3859 struct sctp_association *asoc = &stcb->asoc;
3862 if (asoc->str_reset_seq_in == seq) {
3863 asoc->last_reset_action[1] = asoc->last_reset_action[0];
3864 if (!(asoc->local_strreset_support & SCTP_ENABLE_RESET_STREAM_REQ)) {
3865 asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_DENIED;
3868 asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_DENIED;
3869 } else if (stcb->asoc.stream_reset_out_is_outstanding == 0) {
3876 asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_PERFORMED;
3878 asoc->str_reset_seq_out,
3879 seq, (asoc->sending_seq - 1));
3880 asoc->stream_reset_out_is_outstanding = 1;
3881 asoc->str_reset = chk;
3883 stcb->asoc.stream_reset_outstanding++;
3886 asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_ERR_IN_PROGRESS;
3888 sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[0]);
3889 asoc->str_reset_seq_in++;
3890 } else if (asoc->str_reset_seq_in - 1 == seq) {
3891 sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[0]);
3892 } else if (asoc->str_reset_seq_in - 2 == seq) {
3893 sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[1]);
3911 struct sctp_association *asoc = &stcb->asoc;
3916 if (asoc->str_reset_seq_in == seq) {
3917 asoc->last_reset_action[1] = stcb->asoc.last_reset_action[0];
3918 if (!(asoc->local_strreset_support & SCTP_ENABLE_CHANGE_ASSOC_REQ)) {
3919 asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_DENIED;
3924 fwdtsn.new_cumulative_tsn = htonl(stcb->asoc.highest_tsn_inside_map + 1);
3929 asoc->highest_tsn_inside_map += SCTP_STREAM_RESET_TSN_DELTA;
3931 sctp_log_map(0, 10, asoc->highest_tsn_inside_map, SCTP_MAP_SLIDE_RESULT);
3933 asoc->tsn_last_delivered = asoc->cumulative_tsn = asoc->highest_tsn_inside_map;
3934 asoc->mapping_array_base_tsn = asoc->highest_tsn_inside_map + 1;
3935 memset(asoc->mapping_array, 0, asoc->mapping_array_size);
3936 asoc->highest_tsn_inside_nr_map = asoc->highest_tsn_inside_map;
3937 memset(asoc->nr_mapping_array, 0, asoc->mapping_array_size);
3938 atomic_add_int(&asoc->sending_seq, 1);
3940 asoc->last_sending_seq[1] = asoc->last_sending_seq[0];
3941 asoc->last_sending_seq[0] = asoc->sending_seq;
3942 asoc->last_base_tsnsent[1] = asoc->last_base_tsnsent[0];
3943 asoc->last_base_tsnsent[0] = asoc->mapping_array_base_tsn;
3946 asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_PERFORMED;
3947 sctp_notify_stream_reset_tsn(stcb, asoc->sending_seq, (asoc->mapping_array_base_tsn + 1), 0);
3949 sctp_add_stream_reset_result_tsn(chk, seq, asoc->last_reset_action[0],
3950 asoc->last_sending_seq[0], asoc->last_base_tsnsent[0]);
3951 asoc->str_reset_seq_in++;
3952 } else if (asoc->str_reset_seq_in - 1 == seq) {
3953 sctp_add_stream_reset_result_tsn(chk, seq, asoc->last_reset_action[0],
3954 asoc->last_sending_seq[0], asoc->last_base_tsnsent[0]);
3955 } else if (asoc->str_reset_seq_in - 2 == seq) {
3956 sctp_add_stream_reset_result_tsn(chk, seq, asoc->last_reset_action[1],
3957 asoc->last_sending_seq[1], asoc->last_base_tsnsent[1]);
3971 struct sctp_association *asoc = &stcb->asoc;
3976 if (asoc->str_reset_seq_in == seq) {
3989 asoc->last_reset_action[1] = asoc->last_reset_action[0];
3990 if (!(asoc->local_strreset_support & SCTP_ENABLE_RESET_STREAM_REQ)) {
3991 asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_DENIED;
3993 asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_DENIED;
3994 } else if (SCTP_TSN_GE(asoc->cumulative_tsn, tsn)) {
3997 asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_PERFORMED;
4011 asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_DENIED;
4012 sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[0]);
4018 TAILQ_INSERT_TAIL(&asoc->resetHead, liste, next_resp);
4019 asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_PERFORMED;
4021 sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[0]);
4022 asoc->str_reset_seq_in++;
4023 } else if ((asoc->str_reset_seq_in - 1) == seq) {
4028 sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[0]);
4029 } else if ((asoc->str_reset_seq_in - 2) == seq) {
4034 sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[1]);
4051 struct sctp_association *asoc = &stcb->asoc;
4058 if (asoc->str_reset_seq_in == seq) {
4059 num_stream += stcb->asoc.streamincnt;
4060 stcb->asoc.last_reset_action[1] = stcb->asoc.last_reset_action[0];
4061 if (!(asoc->local_strreset_support & SCTP_ENABLE_CHANGE_ASSOC_REQ)) {
4062 asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_DENIED;
4063 } else if ((num_stream > stcb->asoc.max_inbound_streams) ||
4067 stcb->asoc.last_reset_action[0] = SCTP_STREAM_RESET_RESULT_DENIED;
4073 oldstrm = stcb->asoc.strmin;
4074 SCTP_MALLOC(stcb->asoc.strmin, struct sctp_stream_in *,
4077 if (stcb->asoc.strmin == NULL) {
4078 stcb->asoc.strmin = oldstrm;
4082 for (i = 0; i < stcb->asoc.streamincnt; i++) {
4083 TAILQ_INIT(&stcb->asoc.strmin[i].inqueue);
4084 stcb->asoc.strmin[i].stream_no = i;
4085 stcb->asoc.strmin[i].last_sequence_delivered = oldstrm[i].last_sequence_delivered;
4086 stcb->asoc.strmin[i].delivery_started = oldstrm[i].delivery_started;
4090 TAILQ_INSERT_TAIL(&stcb->asoc.strmin[i].inqueue, ctl, next);
4094 for (i = stcb->asoc.streamincnt; i < num_stream; i++) {
4095 TAILQ_INIT(&stcb->asoc.strmin[i].inqueue);
4096 stcb->asoc.strmin[i].stream_no = i;
4097 stcb->asoc.strmin[i].last_sequence_delivered = 0xffff;
4098 stcb->asoc.strmin[i].delivery_started = 0;
4102 stcb->asoc.streamincnt = num_stream;
4103 stcb->asoc.last_reset_action[0] = SCTP_STREAM_RESET_RESULT_PERFORMED;
4104 sctp_notify_stream_reset_add(stcb, stcb->asoc.streamincnt, stcb->asoc.streamoutcnt, 0);
4106 sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[0]);
4107 asoc->str_reset_seq_in++;
4108 } else if ((asoc->str_reset_seq_in - 1) == seq) {
4113 sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[0]);
4114 } else if ((asoc->str_reset_seq_in - 2) == seq) {
4119 sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[1]);
4137 struct sctp_association *asoc = &stcb->asoc;
4143 if (asoc->str_reset_seq_in == seq) {
4144 stcb->asoc.last_reset_action[1] = stcb->asoc.last_reset_action[0];
4145 if (!(asoc->local_strreset_support & SCTP_ENABLE_CHANGE_ASSOC_REQ)) {
4146 asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_DENIED;
4147 } else if (stcb->asoc.stream_reset_outstanding) {
4149 stcb->asoc.last_reset_action[0] = SCTP_STREAM_RESET_RESULT_ERR_IN_PROGRESS;
4153 mychk = stcb->asoc.streamoutcnt;
4156 stcb->asoc.last_reset_action[0] = SCTP_STREAM_RESET_RESULT_PERFORMED;
4158 stcb->asoc.last_reset_action[0] = SCTP_STREAM_RESET_RESULT_DENIED;
4161 stcb->asoc.last_reset_action[0] = SCTP_STREAM_RESET_RESULT_DENIED;
4164 sctp_add_stream_reset_result(chk, seq, stcb->asoc.last_reset_action[0]);
4165 asoc->str_reset_seq_in++;
4166 } else if ((asoc->str_reset_seq_in - 1) == seq) {
4171 sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[0]);
4172 } else if ((asoc->str_reset_seq_in - 2) == seq) {
4177 sctp_add_stream_reset_result(chk, seq, asoc->last_reset_action[1]);
4214 chk->asoc = &stcb->asoc;
4267 if (stcb->asoc.stream_reset_outstanding) {
4269 if (seq == stcb->asoc.str_reset_seq_out) {
4321 TAILQ_INSERT_TAIL(&stcb->asoc.control_send_queue,
4324 stcb->asoc.ctrl_queue_cnt++;
4451 stcb->asoc.peers_rwnd = 0;
4453 if (a_rwnd > stcb->asoc.total_flight) {
4454 stcb->asoc.peers_rwnd =
4455 a_rwnd - stcb->asoc.total_flight;
4457 stcb->asoc.peers_rwnd = 0;
4459 if (stcb->asoc.peers_rwnd <
4462 stcb->asoc.peers_rwnd = 0;
4472 (stcb->asoc.sat_t3_loss_recovery == 0) &&
4473 (stcb->asoc.sat_network)) {
4479 stcb->asoc.cc_functions.sctp_cwnd_update_after_packet_dropped(stcb,
4490 * cookie-echo processing - return NULL to discard the packet (ie. no asoc,
4508 struct sctp_association *asoc;
4656 stcb->asoc.authenticated = 1;
4676 asoc = &stcb->asoc;
4683 (vtag_in == asoc->my_vtag)) ||
4685 (vtag_in == asoc->peer_vtag))) {
4696 if (vtag_in != asoc->my_vtag) {
4700 * is still hung; we have started a new asoc
4720 if (vtag_in != asoc->my_vtag) {
4724 vtag_in, asoc->my_vtag);
4740 (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_ECHOED)) {
4744 stcb->asoc.overall_error_count,
4749 stcb->asoc.overall_error_count = 0;
4834 stcb->asoc.last_control_chunk_from = *netp;
4844 sctp_auth_is_required_chunk(ch->chunk_type, stcb->asoc.local_auth_chunks) &&
4845 !stcb->asoc.authenticated) {
4898 if ((stcb) && (stcb->asoc.total_output_queue_size)) {
4909 atomic_add_int(&stcb->asoc.refcnt, 1);
4913 atomic_subtract_int(&stcb->asoc.refcnt, 1);
4980 if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_ACK_SENT) {
5004 stcb->asoc.seen_a_sack_this_pkt = 1;
5005 if ((stcb->asoc.pr_sctp_cnt == 0) &&
5007 SCTP_TSN_GE(cum_ack, stcb->asoc.last_acked_seq) &&
5008 (stcb->asoc.saw_sack_with_frags == 0) &&
5009 (stcb->asoc.saw_sack_with_nr_frags == 0) &&
5010 (!TAILQ_EMPTY(&stcb->asoc.sent_queue))
5029 if (TAILQ_EMPTY(&stcb->asoc
5030 TAILQ_EMPTY(&stcb->asoc.sent_queue) &&
5031 (stcb->asoc.stream_queue_cnt == 0)) {
5052 if ((stcb->asoc.sctp_nr_sack_on_off == 0) ||
5053 (stcb->asoc.peer_supports_nr_sack == 0)) {
5060 if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_ACK_SENT) {
5085 stcb->asoc.seen_a_sack_this_pkt = 1;
5086 if ((stcb->asoc.pr_sctp_cnt == 0) &&
5088 SCTP_TSN_GE(cum_ack, stcb->asoc.last_acked_seq) &&
5089 (stcb->asoc.saw_sack_with_frags == 0) &&
5090 (stcb->asoc.saw_sack_with_nr_frags == 0) &&
5091 (!TAILQ_EMPTY(&stcb->asoc.sent_queue))) {
5114 if (TAILQ_EMPTY(&stcb->asoc.send_queue) &&
5115 TAILQ_EMPTY(&stcb->asoc.sent_queue) &&
5116 (stcb->asoc.stream_queue_cnt == 0)) {
5132 stcb->asoc.overall_error_count,
5137 stcb->asoc.overall_error_count = 0;
5153 stcb->asoc.overall_error_count,
5158 stcb->asoc.overall_error_count = 0;
5212 if ((stcb) && (stcb->asoc.total_output_queue_size)) {
5302 if (!TAILQ_EMPTY(&stcb->asoc.sent_queue)) {
5309 chk = TAILQ_FIRST(&stcb->asoc.sent_queue);
5324 if ((stcb) && (stcb->asoc.total_output_queue_size)) {
5329 atomic_add_int(&stcb->asoc.refcnt, 1);
5333 atomic_subtract_int(&stcb->asoc.refcnt, 1);
5347 stcb->asoc.overall_error_count,
5352 stcb->asoc.overall_error_count = 0;
5370 stcb->asoc.overall_error_count,
5375 stcb->asoc.overall_error_count = 0;
5395 stcb->asoc.overall_error_count,
5400 stcb->asoc.overall_error_count = 0;
5428 stcb->asoc.overall_error_count,
5433 stcb->asoc.overall_error_count = 0;
5453 stcb->asoc.overall_error_count,
5458 stcb->asoc.overall_error_count = 0;
5479 stcb->asoc.overall_error_count = 0;
5482 stcb->asoc.overall_error_count,
5492 atomic_add_int(&stcb->asoc.refcnt, 1);
5496 atomic_subtract_int(&stcb->asoc.refcnt, 1);
5513 stcb->asoc.overall_error_count,
5518 stcb->asoc.overall_error_count = 0;
5533 if (stcb->asoc.peer_supports_strreset == 0) {
5539 stcb->asoc.peer_supports_strreset = 1;
5606 stcb->asoc.authenticated = 1;
5882 stcb->asoc.authenticated = 0;
5883 stcb->asoc.seen_a_sack_this_pkt = 0;
5885 (void *)stcb, stcb->asoc.state);
5887 if ((stcb->asoc.state & SCTP_STATE_WAS_ABORTED) ||
5888 (stcb->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED)) {
5944 sctp_auth_is_required_chunk(SCTP_DATA, stcb->asoc.local_auth_chunks)) {
5961 if (stcb->asoc.my_vtag != ntohl(sh->v_tag)) {
5989 sctp_auth_is_required_chunk(SCTP_DATA, stcb->asoc.local_auth_chunks) &&
5990 !stcb->asoc.authenticated) {
6005 switch (SCTP_GET_STATE(&stcb->asoc)) {
6014 stcb->asoc.overall_error_count,
6019 stcb->asoc.overall_error_count = 0;
6024 * We consider OOTB any data sent during asoc setup.
6074 (stcb->asoc.ecn_allowed == 1) &&
6084 if (SCTP_TSN_GT(stcb->asoc.highest_tsn_inside_nr_map, stcb->asoc.highest_tsn_inside_map)) {
6085 highest_tsn = stcb->asoc.highest_tsn_inside_nr_map;
6087 highest_tsn = stcb->asoc.highest_tsn_inside_map;
6089 was_a_gap = SCTP_TSN_GT(highest_tsn, stcb->asoc.cumulative_tsn);
6090 stcb->asoc.send_sack = 1;
6093 stcb->asoc.send_sack = 1;
6103 stcb->asoc.peers_rwnd,
6104 TAILQ_EMPTY(&stcb->asoc.control_send_queue),
6105 stcb->asoc.total_flight);
6106 un_sent = (stcb->asoc.total_output_queue_size - stcb->asoc.total_flight);
6107 if (!TAILQ_EMPTY(&stcb->asoc.control_send_queue)) {
6108 cnt_ctrl_ready = stcb->asoc.ctrl_queue_cnt - stcb->asoc.ecn_echo_cnt_onq;
6112 (stcb->asoc.peers_rwnd > 0 ||
6113 (stcb->asoc.peers_rwnd <= 0 && stcb->asoc.total_flight == 0)))) {