Lines Matching defs:asoc
355 TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
546 TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
576 asoc.nets, sctp_next) {
640 if (stcb->asoc.my_vtag == vtag) {
1078 if (stcb->asoc.my_vtag == vtag) {
1224 printf("Found endpoint %p but no asoc - ep state:%x\n",
2002 struct sctp_tcb *asoc, *nasoc;
2037 for ((asoc = LIST_FIRST(&inp->sctp_asoc_list)); asoc != NULL;
2038 asoc = nasoc) {
2039 nasoc = LIST_NEXT(asoc, sctp_tcblist);
2040 if ((SCTP_GET_STATE(&asoc->asoc) == SCTP_STATE_COOKIE_WAIT) ||
2041 (SCTP_GET_STATE(&asoc->asoc) == SCTP_STATE_COOKIE_ECHOED)) {
2043 SCTP_TCB_LOCK(asoc);
2045 sctp_free_assoc(inp, asoc);
2049 asoc->asoc.state |= SCTP_STATE_CLOSED_SOCKET;
2051 if ((asoc->asoc.size_on_delivery_queue > 0) ||
2052 (asoc->asoc.size_on_reasm_queue > 0) ||
2053 (asoc->asoc.size_on_all_streams > 0) ||
2070 SCTP_TCB_LOCK(asoc);
2071 sctp_send_abort_tcb(asoc, op_err);
2074 sctp_free_assoc(inp, asoc);
2077 } else if (TAILQ_EMPTY(&asoc->asoc.send_queue) &&
2078 TAILQ_EMPTY(&asoc->asoc.sent_queue)) {
2079 if ((SCTP_GET_STATE(&asoc->asoc) != SCTP_STATE_SHUTDOWN_SENT) &&
2080 (SCTP_GET_STATE(&asoc->asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT)) {
2082 SCTP_TCB_LOCK(asoc);
2083 sctp_send_shutdown(asoc, asoc->asoc.primary_destination);
2084 asoc->asoc.state = SCTP_STATE_SHUTDOWN_SENT;
2085 sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, asoc->sctp_ep, asoc,
2086 asoc->asoc.primary_destination);
2087 sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, asoc->sctp_ep, asoc,
2088 asoc->asoc.primary_destination);
2089 sctp_chunk_output(inp, asoc, 1);
2090 SCTP_TCB_UNLOCK(asoc);
2094 asoc->asoc.state |= SCTP_STATE_SHUTDOWN_PENDING;
2146 * free each asoc if it is not already closed/free. we can't use
2151 for ((asoc = LIST_FIRST(&inp->sctp_asoc_list)); asoc != NULL;
2152 asoc = nasoc) {
2153 nasoc = LIST_NEXT(asoc, sctp_tcblist);
2154 SCTP_TCB_LOCK(asoc);
2155 if (SCTP_GET_STATE(&asoc->asoc) != SCTP_STATE_COOKIE_WAIT) {
2167 sctp_send_abort_tcb(asoc, op_err);
2178 sctp_free_assoc(inp, asoc);
2265 TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
2378 stcb->asoc.ipv4_local_scope = 1;
2383 stcb->asoc.loopback_scope = 1;
2384 stcb->asoc.ipv4_local_scope = 1;
2385 stcb->asoc.local_scope = 1;
2386 stcb->asoc.site_scope = 1;
2392 stcb->asoc.loopback_scope = 1;
2393 stcb->asoc.ipv4_local_scope = 1;
2394 stcb->asoc.local_scope = 1;
2395 stcb->asoc.site_scope = 1;
2400 (stcb->asoc.ipv4_local_scope == 0)) {
2415 stcb->asoc.loopback_scope = 1;
2416 stcb->asoc.local_scope = 1;
2417 stcb->asoc.ipv4_local_scope = 1;
2418 stcb->asoc.site_scope = 1;
2428 stcb->asoc.ipv4_local_scope = 1;
2429 stcb->asoc.site_scope = 1;
2435 stcb->asoc.site_scope = 1;
2441 stcb->asoc.loopback_scope = 1;
2442 stcb->asoc.ipv4_local_scope = 1;
2443 stcb->asoc.local_scope = 1;
2444 stcb->asoc.site_scope = 1;
2449 (stcb->asoc.loopback_scope == 0)) {
2452 (stcb->asoc.local_scope == 0)) {
2455 (stcb->asoc.site_scope == 0)) {
2476 net->failure_threshold = stcb->asoc.def_net_failure;
2493 net->RTO = stcb->asoc.initial_rto;
2494 stcb->asoc.numnets++;
2513 stcb->asoc.smallest_mtu = net->mtu;
2518 net->mtu = stcb->asoc.smallest_mtu;
2523 if (stcb->asoc.smallest_mtu > net->mtu) {
2524 stcb->asoc.smallest_mtu = net->mtu;
2529 net->cwnd = uimin((net->mtu * 4), uimax((stcb->asoc.max_burst * net->mtu), SCTP_INITIAL_CWND));
2536 net->ssthresh = stcb->asoc.peers_rwnd;
2539 netfirst = TAILQ_FIRST(&stcb->asoc.nets);
2542 TAILQ_INSERT_TAIL(&stcb->asoc.nets, net, sctp_next);
2545 TAILQ_INSERT_HEAD(&stcb->asoc.nets, net, sctp_next);
2551 TAILQ_INSERT_HEAD(&stcb->asoc.nets, net, sctp_next);
2558 TAILQ_INSERT_HEAD(&stcb->asoc.nets, net, sctp_next);
2573 TAILQ_INSERT_TAIL(&stcb->asoc.nets, net,
2582 TAILQ_INSERT_AFTER(&stcb->asoc.nets, netlook,
2593 if (stcb->asoc.primary_destination == 0) {
2594 stcb->asoc.primary_destination = net;
2595 } else if (!rtcache_validate(&stcb->asoc.primary_destination->ro)) {
2597 stcb->asoc.primary_destination = net;
2616 struct sctp_association *asoc;
2737 asoc = &stcb->asoc;
2745 if ((err = sctp_init_asoc(inp, asoc, for_a_init, override_tag))) {
2752 printf("aloc_assoc: couldn't init asoc, out of mem?!\n");
2771 printf("aloc_assoc: couldn't init asoc, out of mem?!\n");
2780 head = &sctppcbinfo.sctp_asochash[SCTP_PCBHASH_ASOC(stcb->asoc.my_vtag,
2789 if (asoc->strmout)
2790 free(asoc->strmout, M_PCB);
2791 if (asoc->mapping_array)
2792 free(asoc->mapping_array, M_PCB);
2806 callout_init(&asoc->hb_timer.timer, 0);
2807 callout_init(&asoc->dack_timer.timer, 0);
2808 callout_init(&asoc->asconf_timer.timer, 0);
2809 callout_init(&asoc->shut_guard_timer.timer, 0);
2810 callout_init(&asoc->autoclose_timer.timer, 0);
2811 callout_init(&asoc->delayed_event_timer.timer, 0);
2864 * (tasoc->asoc.nets) and then if it is there, we do a LIST_REMOVE on
2869 struct sctp_association *asoc;
2871 asoc = &stcb->asoc;
2872 if (asoc->numnets < 2) {
2877 asoc->nets); net != NULL; net = net_tmp) {
2884 asoc->numnets--;
2885 TAILQ_REMOVE(&asoc->nets, net, sctp_next);
2887 if (net == asoc->primary_destination) {
2890 lnet = TAILQ_FIRST(&asoc->nets);
2892 asoc->primary_destination =
2895 if (net == asoc->last_data_chunk_from) {
2897 asoc->last_data_chunk_from =
2898 TAILQ_FIRST(&asoc->nets);
2900 if (net == asoc->last_control_chunk_from) {
2902 asoc->last_control_chunk_from =
2903 TAILQ_FIRST(&asoc->nets);
2905 if (net == asoc->asconf_last_sent_to) {
2907 asoc->asconf_last_sent_to =
2908 TAILQ_FIRST(&asoc->nets);
2994 it = stcb->asoc.stcb_starting_point_for_iterator;
3007 /* done with all asoc's in this assoc */
3023 struct sctp_association *asoc;
3033 if (stcb->asoc.state == 0) {
3039 asoc = &stcb->asoc;
3040 asoc->state = 0;
3042 callout_stop(&asoc->hb_timer.timer);
3043 callout_destroy(&asoc->hb_timer.timer);
3044 callout_stop(&asoc->dack_timer.timer);
3045 callout_destroy(&asoc->dack_timer.timer);
3046 callout_stop(&asoc->asconf_timer.timer);
3047 callout_destroy(&asoc->asconf_timer.timer);
3048 callout_stop(&asoc->shut_guard_timer.timer);
3049 callout_destroy(&asoc->shut_guard_timer.timer);
3050 callout_stop(&asoc->autoclose_timer.timer);
3051 callout_destroy(&asoc->autoclose_timer.timer);
3052 callout_stop(&asoc->delayed_event_timer.timer);
3053 callout_destroy(&asoc->delayed_event_timer.timer);
3054 TAILQ_FOREACH(net, &asoc->nets, sctp_next) {
3061 /* Iterator asoc being freed we send an
3099 sctp_add_vtag_to_timewait(inp, asoc->my_vtag);
3102 while (!TAILQ_EMPTY(&asoc->nets)) {
3103 net = TAILQ_FIRST(&asoc->nets);
3109 TAILQ_REMOVE(&asoc->nets, net, sctp_next);
3121 while (!TAILQ_EMPTY(&asoc->out_wheel)) {
3123 outs = TAILQ_FIRST(&asoc->out_wheel);
3124 TAILQ_REMOVE(&asoc->out_wheel, outs, next_spoke);
3132 chk->asoc = NULL;
3142 outs = TAILQ_FIRST(&asoc->out_wheel);
3145 if (asoc->pending_reply) {
3146 free(asoc->pending_reply, M_PCB);
3147 asoc->pending_reply = NULL;
3149 chk = TAILQ_FIRST(&asoc->pending_reply_queue);
3151 TAILQ_REMOVE(&asoc->pending_reply_queue, chk, sctp_next);
3155 chk->asoc = NULL;
3163 chk = TAILQ_FIRST(&asoc->pending_reply_queue);
3166 if (!TAILQ_EMPTY(&asoc->send_queue)) {
3167 chk = TAILQ_FIRST(&asoc->send_queue);
3169 TAILQ_REMOVE(&asoc->send_queue, chk, sctp_next);
3178 chk = TAILQ_FIRST(&asoc->send_queue);
3182 if (!TAILQ_EMPTY(&asoc->sent_queue)) {
3183 chk = TAILQ_FIRST(&asoc->sent_queue);
3185 TAILQ_REMOVE(&asoc->sent_queue, chk, sctp_next);
3194 chk = TAILQ_FIRST(&asoc->sent_queue);
3198 if (!TAILQ_EMPTY(&asoc->control_send_queue)) {
3199 chk = TAILQ_FIRST(&asoc->control_send_queue);
3201 TAILQ_REMOVE(&asoc->control_send_queue, chk, sctp_next);
3210 chk = TAILQ_FIRST(&asoc->control_send_queue);
3213 if (!TAILQ_EMPTY(&asoc->reasmqueue)) {
3214 chk = TAILQ_FIRST(&asoc->reasmqueue);
3216 TAILQ_REMOVE(&asoc->reasmqueue, chk, sctp_next);
3225 chk = TAILQ_FIRST(&asoc->reasmqueue);
3228 if (!TAILQ_EMPTY(&asoc->delivery_queue)) {
3229 chk = TAILQ_FIRST(&asoc->delivery_queue);
3231 TAILQ_REMOVE(&asoc->delivery_queue, chk, sctp_next);
3240 chk = TAILQ_FIRST(&asoc->delivery_queue);
3243 if (asoc->mapping_array) {
3244 free(asoc->mapping_array, M_PCB);
3245 asoc->mapping_array = NULL;
3249 if (asoc->strmout) {
3250 free(asoc->strmout, M_PCB);
3251 asoc->strmout = NULL;
3253 asoc->streamoutcnt = 0;
3254 if (asoc->strmin) {
3256 for (i = 0; i < asoc->streamincnt; i++) {
3257 if (!TAILQ_EMPTY(&asoc->strmin[i].inqueue)) {
3259 chk = TAILQ_FIRST(&asoc->strmin[i].inqueue);
3261 TAILQ_REMOVE(&asoc->strmin[i].inqueue,
3272 chk = TAILQ_FIRST(&asoc->strmin[i].inqueue);
3276 free(asoc->strmin, M_PCB);
3277 asoc->strmin = NULL;
3279 asoc->streamincnt = 0;
3281 while (!LIST_EMPTY(&asoc->sctp_local_addr_list)) {
3282 laddr = LIST_FIRST(&asoc->sctp_local_addr_list);
3288 while (!TAILQ_EMPTY(&asoc->asconf_queue)) {
3289 aparam = TAILQ_FIRST(&asoc->asconf_queue);
3290 TAILQ_REMOVE(&asoc->asconf_queue, aparam, next);
3293 sctp_m_freem(asoc->last_asconf_ack_sent);
3294 asoc->last_asconf_ack_sent = NULL;
3472 TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
3479 stcb->asoc.primary_destination = net;
3527 if (stcb->asoc.last_used_address == laddr)
3529 stcb->asoc.last_used_address = NULL;
3542 rtcache_getdst(&stcb->asoc.primary_destination->ro)) == 0) {
3578 LIST_FOREACH(laddr, &stcb->asoc.sctp_local_addr_list, sctp_nxt_addr) {
3585 error = sctp_insert_laddr(&stcb->asoc.sctp_local_addr_list, ifa);
3661 if (stcb->asoc.numnets < 2) {
3667 LIST_FOREACH(laddr, &stcb->asoc.sctp_local_addr_list, sctp_nxt_addr) {
3702 if (stcb->asoc.numnets < 2) {
3708 LIST_FOREACH(laddr, &stcb->asoc.sctp_local_addr_list, sctp_nxt_addr) {
3899 * loading them to the nets structure in the asoc.
3966 stcb->asoc.ecn_allowed = 0;
3968 TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
3979 (stcb->asoc.ipv4_addr_legal)) {
3984 (stcb->asoc.ipv6_addr_legal)) {
4004 if (stcb->asoc.state == 0) {
4022 (stcb->asoc.ipv4_addr_legal)) {
4048 if (stcb->asoc.state == 0) {
4060 if (stcb->asoc.state == 0) {
4080 if (stcb->asoc.state == 0) {
4090 (stcb->asoc.ipv6_addr_legal)) {
4113 if (stcb->asoc.state == 0) {
4127 if (stcb->asoc.state == 0) {
4148 if (stcb->asoc.state == 0) {
4158 stcb->asoc.ecn_allowed = 1;
4160 if (stcb->asoc.state != SCTP_STATE_OPEN) {
4175 stcb->asoc.peer_supports_asconf = 1;
4176 stcb->asoc.peer_supports_asconf_setprim = 1;
4218 stcb->asoc.peer_supports_prsctp = 1;
4230 stcb->asoc.peer_supports_asconf = 0;
4231 stcb->asoc.peer_supports_asconf_setprim = 0;
4232 stcb->asoc.peer_supports_prsctp = 0;
4233 stcb->asoc.peer_supports_pktdrop = 0;
4234 stcb->asoc.peer_supports_strreset = 0;
4240 stcb->asoc.peer_supports_asconf = 1;
4241 stcb->asoc.peer_supports_asconf_setprim = 1;
4244 stcb->asoc.peer_supports_asconf = 1;
4245 stcb->asoc.peer_supports_asconf_setprim = 1;
4248 stcb->asoc.peer_supports_prsctp = 1;
4251 stcb->asoc.peer_supports_pktdrop = 1;
4254 stcb->asoc.peer_supports_strreset = 1;
4264 stcb->asoc.peer_supports_ecn_nonce = 1;
4265 stcb->asoc.ecn_nonce_allowed = 1;
4294 for (net = TAILQ_FIRST(&stcb->asoc.nets); net != NULL; net = net_tmp) {
4298 /* This address has been removed from the asoc */
4300 stcb->asoc.numnets--;
4301 TAILQ_REMOVE(&stcb->asoc.nets, net, sctp_next);
4303 if (net == stcb->asoc.primary_destination) {
4304 stcb->asoc.primary_destination = NULL;
4329 stcb->asoc.primary_destination = net;
4363 if (stcb->asoc.my_vtag == tag) {
4492 struct sctp_association *asoc;
4498 asoc = &stcb->asoc;
4499 cumulative_tsn_p1 = asoc->cumulative_tsn + 1;
4502 chk = TAILQ_FIRST(&asoc->reasmqueue);
4511 if (tsn >= asoc->mapping_array_base_tsn) {
4512 gap = tsn - asoc->mapping_array_base_tsn;
4514 gap = (MAX_TSN - asoc->mapping_array_base_tsn) +
4517 asoc->size_on_reasm_queue -= chk->send_size;
4518 asoc->cnt_on_reasm_queue--;
4519 SCTP_UNSET_TSN_PRESENT(asoc->mapping_array, gap);
4520 TAILQ_REMOVE(&asoc->reasmqueue, chk, sctp_next);
4533 for (strmat = 0; strmat < asoc->streamincnt; strmat++) {
4534 chk = TAILQ_FIRST(&asoc->strmin[strmat].inqueue);
4542 if (tsn >= asoc->mapping_array_base_tsn) {
4544 asoc->mapping_array_base_tsn;
4547 asoc->mapping_array_base_tsn) +
4550 asoc->size_on_all_streams -= chk->send_size;
4551 asoc->cnt_on_all_streams--;
4553 SCTP_UNSET_TSN_PRESENT(asoc->mapping_array,
4555 TAILQ_REMOVE(&asoc->strmin[strmat].inqueue,
4648 stcb->asoc.cnt_msg_on_sb++;
4672 stcb->asoc.cnt_msg_on_sb--;