Home | History | Annotate | Download | only in netinet

Lines Matching defs:asoc

168 	struct sctp_association *asoc;
173 asoc = &stcb->asoc;
175 asoc->peer_vtag = ntohl(init->initiate_tag);
176 asoc->peers_rwnd = ntohl(init->a_rwnd);
178 if (TAILQ_FIRST(&asoc->nets)) {
180 TAILQ_FOREACH(lnet, &asoc->nets, sctp_next) {
181 lnet->ssthresh = asoc->peers_rwnd;
184 if (asoc->pre_open_streams > ntohs(init->num_inbound_streams)) {
192 if (asoc->strmout) {
194 for (i=newcnt; i < asoc->pre_open_streams; i++) {
195 outs = &asoc->strmout[i];
200 asoc->stream_queue_cnt--;
208 chk->asoc = NULL;
221 asoc->pre_open_streams = newcnt;
223 asoc->streamincnt = ntohs(init->num_outbound_streams);
224 if (asoc->streamincnt > MAX_SCTP_STREAMS) {
225 asoc->streamincnt = MAX_SCTP_STREAMS;
228 asoc->streamoutcnt = asoc->pre_open_streams;
230 asoc->highest_tsn_inside_map = asoc->asconf_seq_in = ntohl(init->initial_tsn) - 1;
232 sctp_log_map(0, 5, asoc->highest_tsn_inside_map, SCTP_MAP_SLIDE_RESULT);
235 asoc->str_reset_seq_in = asoc->asconf_seq_in + 1;
237 asoc->mapping_array_base_tsn = ntohl(init->initial_tsn);
238 asoc->cumulative_tsn = asoc->asconf_seq_in;
239 asoc->last_echo_tsn = asoc->asconf_seq_in;
240 asoc->advanced_peer_ack_point = asoc->last_acked_seq;
242 if (asoc->strmin != NULL) {
244 free(asoc->strmin, M_PCB);
246 asoc->strmin = malloc(asoc->streamincnt * sizeof(struct sctp_stream_in),
248 if (asoc->strmin == NULL) {
257 for (i = 0; i < asoc->streamincnt; i++) {
258 asoc->strmin[i].stream_no = i;
259 asoc->strmin[i].last_sequence_delivered = 0xffff;
266 TAILQ_INIT(&asoc->strmin[i].inqueue);
272 asoc->strmin[i].next_spoke.tqe_next = 0;
273 asoc->strmin[i].next_spoke.tqe_prev = 0;
298 struct sctp_association *asoc;
327 asoc = &stcb->asoc;
350 stcb->asoc.overall_error_count = 0;
393 asoc->primary_destination);
396 net->RTO = sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered);
477 r_net->RTO = sctp_calculate_rto(stcb, &stcb->asoc, r_net, &tv);
512 struct sctp_association *asoc;
523 if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_WAIT) ||
524 (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_ECHOED)) {
541 asoc = &stcb->asoc;
543 if ((SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_RECEIVED) &&
544 (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_SENT)) {
545 asoc->state = SCTP_STATE_SHUTDOWN_RECEIVED;
568 SCTP_GETTIME_TIMEVAL(&asoc->time_entered);
570 if (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_SENT) {
579 if (!TAILQ_EMPTY(&asoc->out_wheel)) {
582 TAILQ_FOREACH(outs, &asoc->out_wheel, next_spoke) {
593 !TAILQ_EMPTY(&asoc->send_queue),
594 !TAILQ_EMPTY(&asoc->sent_queue));
597 if (!TAILQ_EMPTY(&asoc->send_queue) ||
598 !TAILQ_EMPTY(&asoc->sent_queue) ||
605 sctp_send_shutdown_ack(stcb, stcb->asoc.primary_destination);
607 asoc->state = SCTP_STATE_SHUTDOWN_ACK_SENT;
623 struct sctp_association *asoc;
633 asoc = &stcb->asoc;
635 if ((SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_SENT) &&
636 (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT)) {
641 if (!TAILQ_EMPTY(&asoc->send_queue) ||
642 !TAILQ_EMPTY(&asoc->sent_queue) ||
643 !TAILQ_EMPTY(&asoc->out_wheel)) {
693 stcb->asoc.peer_supports_prsctp = 0;
720 stcb->asoc.peer_supports_prsctp = 0;
726 stcb->asoc.peer_supports_ecn_nonce = 0;
727 stcb->asoc.ecn_nonce_allowed = 0;
728 stcb->asoc.ecn_allowed = 0;
732 stcb->asoc.peer_supports_asconf = 0;
735 stcb->asoc.peer_supports_asconf_setprim = 0;
745 stcb->asoc.peer_supports_asconf = 0;
746 stcb->asoc.peer_supports_asconf_setprim = 0;
767 struct sctp_association *asoc;
771 asoc = &stcb->asoc;
803 if (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED) {
807 asoc->cookie_preserve_req = ntohl(*p) << 1;
808 asoc->stale_cookie_count++;
809 if (asoc->stale_cookie_count >
810 asoc->max_init_times) {
812 /* now free the asoc */
817 asoc->state &= ~SCTP_STATE_COOKIE_ECHOED;
818 asoc->state |= SCTP_STATE_COOKIE_WAIT;
949 state = &stcb->asoc.state;
954 if (stcb->asoc.primary_destination->dest_state &
962 stcb->asoc.primary_destination->dest_state &=
965 stcb, 0, (void *)stcb->asoc.primary_destination);
991 stcb->asoc.overall_error_count = 0;
992 SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered);
1023 } /* end switch asoc state */
1045 struct sctp_association *asoc;
1053 asoc = &stcb->asoc;
1055 if (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_ACK_SENT) {
1060 sctp_send_shutdown_ack(stcb, stcb->asoc.primary_destination);
1138 if ((ntohl(initack_cp->init.initiate_tag) == asoc->my_vtag) &&
1139 (ntohl(init_cp->init.initiate_tag) == asoc->peer_vtag)) {
1144 switch SCTP_GET_STATE(asoc) {
1170 if (asoc->state & SCTP_STATE_SHUTDOWN_PENDING) {
1171 asoc->state = SCTP_STATE_OPEN |
1173 } else if ((asoc->state & SCTP_STATE_SHUTDOWN_SENT) == 0) {
1175 asoc->state = SCTP_STATE_OPEN;
1200 if (stcb->asoc.sctp_autoclose_ticks &&
1216 * somehow abort.. but we do have an existing asoc. This
1234 if (ntohl(initack_cp->init.initiate_tag) != asoc->my_vtag &&
1235 ntohl(init_cp->init.initiate_tag) == asoc->peer_vtag &&
1244 if (ntohl(initack_cp->init.initiate_tag) == asoc->my_vtag &&
1245 (ntohl(init_cp->init.initiate_tag) != asoc->peer_vtag ||
1259 if (stcb->asoc.sctp_autoclose_ticks &&
1264 asoc->my_rwnd = ntohl(initack_cp->init.a_rwnd);
1265 asoc->pre_open_streams =
1267 asoc->init_seq_number = ntohl(initack_cp->init.initial_tsn);
1268 asoc->sending_seq = asoc->asconf_seq_out = asoc->str_reset_seq_out =
1269 asoc->init_seq_number;
1270 asoc->t3timeout_highest_marked = asoc->asconf_seq_out;
1271 asoc->last_cwr_tsn = asoc->init_seq_number - 1;
1272 asoc->asconf_seq_in = asoc->last_acked_seq = asoc->init_seq_number - 1;
1273 asoc->str_reset_seq_in = asoc->init_seq_number;
1274 asoc->advanced_peer_ack_point = asoc->last_acked_seq;
1297 if ((asoc->state & SCTP_STATE_COOKIE_WAIT) ||
1298 (asoc->state & SCTP_STATE_COOKIE_ECHOED)) {
1309 if (asoc->state & SCTP_STATE_SHUTDOWN_PENDING) {
1310 asoc->state = SCTP_STATE_OPEN |
1313 asoc->state = SCTP_STATE_OPEN;
1319 if ((ntohl(initack_cp->init.initiate_tag) != asoc->my_vtag &&
1320 ntohl(init_cp->init.initiate_tag) != asoc->peer_vtag) &&
1321 cookie->tie_tag_my_vtag == asoc->my_vtag_nonce &&
1322 cookie->tie_tag_peer_vtag == asoc->peer_vtag_nonce &&
1338 asoc->my_vtag = ntohl(initack_cp->init.initiate_tag);
1339 asoc->my_rwnd = ntohl(initack_cp->init.a_rwnd);
1340 asoc->pre_open_streams =
1342 asoc->init_seq_number = ntohl(initack_cp->init.initial_tsn);
1343 asoc->sending_seq = asoc->asconf_seq_out = asoc->str_reset_seq_out =
1344 asoc->init_seq_number;
1345 asoc->t3timeout_highest_marked = asoc->asconf_seq_out;
1346 asoc->last_cwr_tsn = asoc->init_seq_number - 1;
1347 asoc->asconf_seq_in = asoc->last_acked_seq = asoc->init_seq_number - 1;
1348 asoc->str_reset_seq_in = asoc->init_seq_number;
1350 asoc->advanced_peer_ack_point = asoc->last_acked_seq;
1351 if (asoc->mapping_array)
1352 memset(asoc->mapping_array, 0,
1353 asoc->mapping_array_size);
1382 if (asoc->state & SCTP_STATE_SHUTDOWN_PENDING) {
1383 asoc->state = SCTP_STATE_OPEN |
1385 } else if (!(asoc->state & SCTP_STATE_SHUTDOWN_SENT)) {
1387 asoc->state = SCTP_STATE_OPEN;
1420 struct sctp_association *asoc;
1507 asoc = &stcb->asoc;
1509 asoc->ipv4_local_scope = cookie->ipv4_scope;
1510 asoc->site_scope = cookie->site_scope;
1511 asoc->local_scope = cookie->local_scope;
1512 asoc->loopback_scope = cookie->loopback_scope;
1514 if ((asoc->ipv4_addr_legal != cookie->ipv4_addr_legal) ||
1515 (asoc->ipv6_addr_legal != cookie->ipv6_addr_legal)) {
1528 asoc->my_vtag = ntohl(initack_cp->init.initiate_tag);
1529 asoc->my_rwnd = ntohl(initack_cp->init.a_rwnd);
1530 asoc->pre_open_streams = ntohs(initack_cp->init.num_outbound_streams);
1531 asoc->init_seq_number = ntohl(initack_cp->init.initial_tsn);
1532 asoc->sending_seq = asoc->asconf_seq_out = asoc->str_reset_seq_out = asoc->init_seq_number;
1533 asoc->t3timeout_highest_marked = asoc->asconf_seq_out;
1534 asoc->last_cwr_tsn = asoc->init_seq_number - 1;
1535 asoc->asconf_seq_in = asoc->last_acked_seq = asoc->init_seq_number - 1;
1536 asoc->str_reset_seq_in = asoc->init_seq_number;
1538 asoc->advanced_peer_ack_point = asoc->last_acked_seq;
1565 if (asoc->state & SCTP_STATE_SHUTDOWN_PENDING) {
1566 asoc->state = SCTP_STATE_OPEN | SCTP_STATE_SHUTDOWN_PENDING;
1568 asoc->state = SCTP_STATE_OPEN;
1571 (*netp)->RTO = sctp_calculate_rto(stcb, asoc, *netp,
1643 if (stcb->asoc.sctp_autoclose_ticks &&
1963 * asoc. This will only happen if we were in the COOKIE-WAIT state
2140 struct sctp_association *asoc;
2150 asoc = &stcb->asoc;
2155 if (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED) {
2162 if (asoc->state & SCTP_STATE_SHUTDOWN_PENDING) {
2163 asoc->state = SCTP_STATE_OPEN | SCTP_STATE_SHUTDOWN_PENDING;
2165 asoc->state = SCTP_STATE_OPEN;
2169 if (asoc->overall_error_count == 0) {
2170 net->RTO = sctp_calculate_rto(stcb, asoc, net,
2171 &asoc->time_entered);
2173 SCTP_GETTIME_TIMEVAL(&asoc->time_entered);
2185 if (stcb->asoc.sctp_autoclose_ticks &&
2196 (stcb->asoc.peer_supports_asconf) &&
2197 (!TAILQ_EMPTY(&stcb->asoc.asconf_queue))) {
2200 stcb->asoc.primary_destination);
2205 sctp_toss_old_cookies(asoc);
2206 if (!TAILQ_EMPTY(&asoc->sent_queue)) {
2209 chk = TAILQ_FIRST(&asoc->sent_queue);
2232 lchk = TAILQ_FIRST(&stcb->asoc.send_queue);
2234 stcb->asoc.nonce_resync_tsn = stcb->asoc.sending_seq;
2236 stcb->asoc.nonce_resync_tsn = lchk->rec.data.TSN_seq;
2238 stcb->asoc.nonce_wait_for_ecne = 0;
2239 stcb->asoc.nonce_sum_check = 0;
2243 lchk = TAILQ_FIRST(&stcb->asoc.sent_queue);
2255 net = stcb->asoc.primary_destination;
2257 if (compare_with_wrap(tsn, stcb->asoc.last_cwr_tsn, MAX_TSN)) {
2278 stcb->asoc.last_cwr_tsn = stcb->asoc.nonce_resync_tsn;
2298 TAILQ_FOREACH(chk, &stcb->asoc.control_send_queue, sctp_next) {
2311 TAILQ_REMOVE(&stcb->asoc.control_send_queue, chk,
2315 stcb->asoc.ctrl_queue_cnt--;
2332 struct sctp_association *asoc;
2342 asoc = &stcb->asoc;
2344 if (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT) {
2358 if (!TAILQ_EMPTY(&asoc->send_queue) ||
2359 !TAILQ_EMPTY(&asoc->sent_queue) ||
2360 !TAILQ_EMPTY(&asoc->out_wheel)) {
2381 tp1 = TAILQ_FIRST(&stcb->asoc.sent_queue);
2398 tp1 = TAILQ_FIRST(&stcb->asoc.sent_queue);
2417 if (stcb->asoc.peers_rwnd == 0 &&
2435 stcb->asoc.sent_queue_retran_cnt++;
2459 if (TAILQ_EMPTY(&stcb->asoc.send_queue) ) {
2460 tp1->rec.data.fast_retran_tsn = stcb->asoc.sending_seq;
2462 tp1->rec.data.fast_retran_tsn = (TAILQ_FIRST(&stcb->asoc.send_queue))->rec.data.TSN_seq;
2480 TAILQ_FOREACH(tp1, &stcb->asoc.sent_queue, sctp_next) {
2484 TAILQ_FOREACH(tp1, &stcb->asoc.control_send_queue,
2489 if (audit != stcb->asoc.sent_queue_retran_cnt) {
2490 printf("**Local Audit finds cnt:%d asoc cnt:%d\n",
2491 audit, stcb->asoc.sent_queue_retran_cnt);
2493 stcb->asoc.sent_queue_retran_cnt = audit;
2502 TAILQ_FOREACH(asconf, &stcb->asoc.control_send_queue,
2510 stcb->asoc.sent_queue_retran_cnt++;
2518 stcb->asoc.dropped_special_cnt++;
2519 if (stcb->asoc.dropped_special_cnt < SCTP_RETRY_DROPPED_THRESH) {
2555 TAILQ_FOREACH(cookie, &stcb->asoc.control_send_queue,
2563 stcb->asoc.sent_queue_retran_cnt++;
2577 send_forward_tsn(stcb, &stcb->asoc);
2611 if (list[i] >= stcb->asoc.streamincnt) {
2615 stcb->asoc.strmin[(list[i])].last_sequence_delivered = 0xffff;
2619 for (i = 0; i < stcb->asoc.streamincnt; i++) {
2620 stcb->asoc.strmin[i].last_sequence_delivered = 0xffff;
2631 struct sctp_association *asoc;
2633 asoc = &stcb->asoc;
2635 for (chk = TAILQ_FIRST(&asoc->control_send_queue);
2650 TAILQ_REMOVE(&asoc->control_send_queue,
2655 asoc->ctrl_queue_cnt--;
2679 if (seq == stcb->asoc.str_reset_seq_out) {
2681 stcb->asoc.str_reset_seq_out++;
2682 stcb->asoc.stream_reset_outstanding = 0;
2686 if ((tsn == stcb->asoc.cumulative_tsn) ||
2687 (compare_with_wrap(stcb->asoc.cumulative_tsn, tsn, MAX_TSN))) {
2696 if (stcb->asoc.pending_reply != NULL) {
2704 free(stcb->asoc.pending_reply, M_PCB);
2706 stcb->asoc.pending_reply = malloc(param_length,
2708 memcpy(stcb->asoc.pending_reply, resp, param_length);
2715 stcb->asoc.str_reset_seq_out, seq);
2802 stcb->asoc.peers_rwnd = 0;
2804 if (a_rwnd > stcb->asoc.total_flight) {
2805 stcb->asoc.peers_rwnd =
2806 a_rwnd - stcb->asoc.total_flight;
2808 stcb->asoc.peers_rwnd = 0;
2810 if (stcb->asoc.peers_rwnd <
2813 stcb->asoc.peers_rwnd = 0;
2894 (stcb->asoc.sat_t3_loss_recovery == 0) &&
2895 (stcb->asoc.sat_network)) {
2944 if (stcb->asoc.seen_a_sack_this_pkt) {
2988 (int)stcb->asoc.max_burst * (int)net->mtu);
3021 * - return NULL to discard the packet (ie. no asoc, bad packet,...)
3029 struct sctp_association *asoc;
3102 asoc = &stcb->asoc;
3107 if ((vtag_in == asoc->my_vtag) ||
3109 (vtag_in == asoc->peer_vtag))) {
3120 if (vtag_in != asoc->my_vtag) {
3124 * is still hung; we have started a new asoc
3138 if (vtag_in != asoc->my_vtag) {
3142 printf("invalid vtag: %xh, expect %xh\n", vtag_in, asoc->my_vtag);
3166 (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_ECHOED)) {
3168 stcb->asoc.overall_error_count = 0;
3250 stcb->asoc.last_control_chunk_from = *netp;
3284 (SCTP_GET_STATE(&stcb->asoc) ==
3287 stcb->asoc.primary_destination);
3368 stcb->asoc.seen_a_sack_this_pkt = 1;
3389 stcb->asoc.overall_error_count = 0;
3399 stcb->asoc.overall_error_count = 0;
3536 if (!TAILQ_EMPTY(&stcb->asoc.sent_queue)) {
3542 chk = TAILQ_FIRST(&stcb->asoc.sent_queue);
3565 stcb->asoc.overall_error_count = 0;
3576 stcb->asoc.overall_error_count = 0;
3587 stcb->asoc.overall_error_count = 0;
3618 stcb->asoc.overall_error_count = 0;
3630 stcb->asoc.overall_error_count = 0;
3644 stcb->asoc.overall_error_count = 0;
3652 stcb->asoc.overall_error_count = 0;
3665 if (stcb->asoc.peer_supports_strreset == 0) {
3670 stcb->asoc.peer_supports_strreset = 1;
3780 stcb->asoc.receiver_nonce_sum++;
3781 stcb->asoc.receiver_nonce_sum &= SCTP_SACK_NONCE_SUM;
3788 if (compare_with_wrap(stcb->asoc.cumulative_tsn,
3789 stcb->asoc.last_echo_tsn, MAX_TSN)) {
3790 stcb->asoc.last_echo_tsn = stcb->asoc.cumulative_tsn;
3798 if (compare_with_wrap(stcb->asoc.cumulative_tsn,
3799 stcb->asoc.last_echo_tsn, MAX_TSN)) {
3800 stcb->asoc.last_echo_tsn = stcb->asoc.cumulative_tsn;
3816 if (compare_with_wrap(high_tsn, stcb->asoc.last_echo_tsn,
3820 stcb->asoc.last_echo_tsn = high_tsn;
3880 if (stcb->asoc.my_vtag != ntohl(sh->v_tag)) {
3906 stcb->asoc.seen_a_sack_this_pkt = 0;
3916 switch (SCTP_GET_STATE(&stcb->asoc)) {
3923 stcb->asoc.overall_error_count = 0;
3929 * We consider OOTB any data sent during asoc setup.
3942 printf("Got data in invalid state %d.. dropping\n", stcb->asoc.state);
3953 if (stcb->asoc.ecn_allowed &&
3970 if (stcb->asoc.ecn_allowed && (ecn_bits & (SCTP_ECT0_BIT|SCTP_ECT1_BIT)) ) {
3983 if (compare_with_wrap(stcb->asoc.highest_tsn_inside_map,
3984 stcb->asoc.cumulative_tsn, MAX_TSN)) {
4002 stcb->asoc.peers_rwnd,
4003 TAILQ_EMPTY(&stcb->asoc.control_send_queue),
4004 stcb->asoc.total_flight);
4007 if (stcb->asoc.peers_rwnd > 0 ||
4008 !TAILQ_EMPTY(&stcb->asoc.control_send_queue) ||
4009 (stcb->asoc.peers_rwnd <= 0 && stcb->asoc.total_flight == 0)) {