Lines Matching defs:asoc

44 				struct sctp_association *asoc,
53 struct sctp_association **asoc,
64 static void sctp_do_ecn_ce_work(struct sctp_association *asoc,
69 asoc->last_ecne_tsn = lowest_tsn;
70 asoc->need_ecne = 1;
85 static struct sctp_chunk *sctp_do_ecn_ecne_work(struct sctp_association *asoc,
101 if (TSN_lt(asoc->last_cwr_tsn, lowest_tsn)) {
107 transport = sctp_assoc_lookup_tsn(asoc, lowest_tsn);
113 asoc->last_cwr_tsn = lowest_tsn;
119 repl = sctp_make_cwr(asoc, asoc->last_cwr_tsn, chunk);
128 static void sctp_do_ecn_cwr_work(struct sctp_association *asoc,
134 asoc->need_ecne = 0;
138 static int sctp_gen_sack(struct sctp_association *asoc, int force,
141 struct sctp_transport *trans = asoc->peer.last_data_from;
147 (!trans && (asoc->param_flags & SPP_SACKDELAY_DISABLE)) ||
149 asoc->peer.sack_needed = 1;
151 ctsn = sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map);
152 max_tsn_seen = sctp_tsnmap_get_max_tsn_seen(&asoc->peer.tsn_map);
165 asoc->peer.sack_needed = 1;
175 if (!asoc->peer.sack_needed) {
176 asoc->peer.sack_cnt++;
185 if (asoc->peer.sack_cnt >= trans->sackfreq - 1)
186 asoc->peer.sack_needed = 1;
188 asoc->timeouts[SCTP_EVENT_TIMEOUT_SACK] =
192 if (asoc->peer.sack_cnt >= asoc->sackfreq - 1)
193 asoc->peer.sack_needed = 1;
195 asoc->timeouts[SCTP_EVENT_TIMEOUT_SACK] =
196 asoc->sackdelay;
203 __u32 old_a_rwnd = asoc->a_rwnd;
205 asoc->a_rwnd = asoc->rwnd;
206 sack = sctp_make_sack(asoc);
208 asoc->a_rwnd = old_a_rwnd;
212 asoc->peer.sack_needed = 0;
213 asoc->peer.sack_cnt = 0;
235 struct sctp_association *asoc = transport->asoc;
236 struct sock *sk = asoc->base.sk;
255 asoc->state,
256 asoc->ep, asoc,
270 static void sctp_generate_timeout_event(struct sctp_association *asoc,
273 struct sock *sk = asoc->base.sk;
283 if (!mod_timer(&asoc->timers[timeout_type], jiffies + (HZ/20)))
284 sctp_association_hold(asoc);
291 if (asoc->base.dead)
297 asoc->state, asoc->ep, asoc,
305 sctp_association_put(asoc);
310 struct sctp_association *asoc =
311 from_timer(asoc, t, timers[SCTP_EVENT_TIMEOUT_T1_COOKIE]);
313 sctp_generate_timeout_event(asoc, SCTP_EVENT_TIMEOUT_T1_COOKIE);
318 struct sctp_association *asoc =
319 from_timer(asoc, t, timers[SCTP_EVENT_TIMEOUT_T1_INIT]);
321 sctp_generate_timeout_event(asoc, SCTP_EVENT_TIMEOUT_T1_INIT);
326 struct sctp_association *asoc =
327 from_timer(asoc, t, timers[SCTP_EVENT_TIMEOUT_T2_SHUTDOWN]);
329 sctp_generate_timeout_event(asoc, SCTP_EVENT_TIMEOUT_T2_SHUTDOWN);
334 struct sctp_association *asoc =
335 from_timer(asoc, t, timers[SCTP_EVENT_TIMEOUT_T4_RTO]);
337 sctp_generate_timeout_event(asoc, SCTP_EVENT_TIMEOUT_T4_RTO);
342 struct sctp_association *asoc =
343 from_timer(asoc, t,
346 sctp_generate_timeout_event(asoc,
353 struct sctp_association *asoc =
354 from_timer(asoc, t, timers[SCTP_EVENT_TIMEOUT_AUTOCLOSE]);
356 sctp_generate_timeout_event(asoc, SCTP_EVENT_TIMEOUT_AUTOCLOSE);
365 struct sctp_association *asoc = transport->asoc;
366 struct sock *sk = asoc->base.sk;
393 asoc->state, asoc->ep, asoc,
411 struct sctp_association *asoc = transport->asoc;
412 struct sock *sk = asoc->base.sk;
429 if (asoc->base.dead)
434 asoc->state, asoc->ep, asoc, transport, GFP_ATOMIC);
446 struct sctp_association *asoc = transport->asoc;
447 struct sock *sk = asoc->base.sk;
462 if (!asoc->strreset_chunk)
467 asoc->state, asoc->ep, asoc,
482 struct sctp_association *asoc = transport->asoc;
483 struct sock *sk = asoc->base.sk;
499 asoc->state, asoc->ep, asoc,
513 struct sctp_association *asoc =
514 from_timer(asoc, t, timers[SCTP_EVENT_TIMEOUT_SACK]);
516 sctp_generate_timeout_event(asoc, SCTP_EVENT_TIMEOUT_SACK);
551 struct sctp_association *asoc,
566 asoc->overall_error_count++;
571 asoc->overall_error_count++;
581 if (asoc->base.net->sctp.pf_enable &&
586 sctp_assoc_control_transport(asoc, transport,
597 __func__, asoc, &transport->ipaddr.sa);
599 sctp_assoc_control_transport(asoc, transport,
605 asoc->peer.primary_path == transport &&
606 asoc->peer.active_path != transport)
607 sctp_assoc_set_primary(asoc, asoc->peer.active_path);
619 transport->rto = min((transport->rto * 2), transport->asoc->rto_max);
620 sctp_max_rto(asoc, transport);
626 struct sctp_association *asoc,
631 event = sctp_ulpevent_make_assoc_change(asoc, 0, SCTP_CANT_STR_ASSOC,
643 asoc->outqueue.error = error;
649 struct sctp_association *asoc,
659 asoc->stream.si->abort_pd(&asoc->ulpq, GFP_ATOMIC);
662 event = sctp_ulpevent_make_assoc_change(asoc, 0, SCTP_COMM_LOST,
666 event = sctp_ulpevent_make_assoc_change(asoc, 0, SCTP_COMM_LOST,
673 if (asoc->overall_error_count >= asoc->max_retrans) {
674 abort = sctp_make_violation_max_retrans(asoc, chunk);
684 asoc->outqueue.error = error;
694 struct sctp_association *asoc,
706 if (!sctp_process_init(asoc, chunk, sctp_source(chunk), peer_init, gfp))
716 struct sctp_association *asoc)
724 list_for_each_entry(t, &asoc->peer.transport_addr_list, transports)
729 struct sctp_association *asoc)
735 list_for_each_entry(t, &asoc->peer.transport_addr_list,
744 struct sctp_association *asoc)
748 list_for_each_entry(t, &asoc->peer.transport_addr_list,
758 struct sctp_association *asoc,
779 if (t->asoc->state < SCTP_STATE_SHUTDOWN_PENDING)
780 t->asoc->overall_error_count = 0;
792 sctp_assoc_control_transport(asoc, t, SCTP_TRANSPORT_UP,
797 sctp_assoc_control_transport(asoc, t, SCTP_TRANSPORT_UP,
822 if (was_unconfirmed && asoc->peer.transport_count == 1)
829 struct sctp_association *asoc,
834 if (sctp_outq_sack(&asoc->outqueue, chunk)) {
836 err = sctp_do_sm(asoc->base.net, SCTP_EVENT_T_OTHER,
838 asoc->state, asoc->ep, asoc, NULL,
849 struct sctp_association *asoc,
857 t = sctp_assoc_choose_alter_transport(asoc,
858 asoc->shutdown_last_sent_to);
861 asoc->shutdown_last_sent_to = t;
862 asoc->timeouts[SCTP_EVENT_TIMEOUT_T2_SHUTDOWN] = t->rto;
867 struct sctp_association *asoc,
870 struct sock *sk = asoc->base.sk;
872 asoc->state = state;
874 pr_debug("%s: asoc:%p[%s]\n", __func__, asoc, sctp_state_tbl[state]);
880 if (sctp_state(asoc, ESTABLISHED) && sctp_sstate(sk, CLOSED))
884 if (sctp_state(asoc, SHUTDOWN_RECEIVED) &&
891 if (sctp_state(asoc, COOKIE_WAIT)) {
895 asoc->timeouts[SCTP_EVENT_TIMEOUT_T1_INIT] =
896 asoc->rto_initial;
897 asoc->timeouts[SCTP_EVENT_TIMEOUT_T1_COOKIE] =
898 asoc->rto_initial;
901 if (sctp_state(asoc, ESTABLISHED)) {
902 kfree(asoc->peer.cookie);
903 asoc->peer.cookie = NULL;
906 if (sctp_state(asoc, ESTABLISHED) ||
907 sctp_state(asoc, CLOSED) ||
908 sctp_state(asoc, SHUTDOWN_RECEIVED)) {
909 /* Wake up any processes waiting in the asoc's wait queue in
912 if (waitqueue_active(&asoc->wait))
913 wake_up_interruptible(&asoc->wait);
925 if (sctp_state(asoc, SHUTDOWN_PENDING) &&
926 !sctp_outq_is_empty(&asoc->outqueue))
927 sctp_outq_uncork(&asoc->outqueue, GFP_ATOMIC);
932 struct sctp_association *asoc)
934 struct sock *sk = asoc->base.sk;
941 (!asoc->temp) && (sk->sk_shutdown != SHUTDOWN_MASK))
944 sctp_association_free(asoc);
954 struct sctp_association *asoc,
959 t = sctp_assoc_choose_alter_transport(asoc, chunk->transport);
960 asoc->timeouts[SCTP_EVENT_TIMEOUT_T4_RTO] = t->rto;
966 struct sctp_association *asoc,
975 ev = sctp_ulpevent_make_remote_error(asoc, chunk, 0,
980 asoc->stream.si->enqueue_event(&asoc->ulpq, ev);
996 if (asoc->peer.asconf_capable == 0)
999 asoc->peer.asconf_capable = 0;
1017 static void sctp_cmd_del_non_primary(struct sctp_association *asoc)
1023 list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) {
1026 &asoc->peer.primary_addr)) {
1027 sctp_assoc_rm_peer(asoc, t);
1033 static void sctp_cmd_set_sk_err(struct sctp_association *asoc, int error)
1035 struct sock *sk = asoc->base.sk;
1043 struct sctp_association *asoc,
1048 ev = sctp_ulpevent_make_assoc_change(asoc, 0, state, 0,
1049 asoc->c.sinit_num_ostreams,
1050 asoc->c.sinit_max_instreams,
1053 asoc->stream.si->enqueue_event(&asoc->ulpq, ev);
1057 struct sctp_association *asoc)
1061 ev = sctp_ulpevent_make_authkey(asoc, 0, SCTP_AUTH_NO_AUTH, GFP_ATOMIC);
1063 asoc->stream.si->enqueue_event(&asoc->ulpq, ev);
1068 struct sctp_association *asoc)
1072 ev = sctp_ulpevent_make_adaptation_indication(asoc, GFP_ATOMIC);
1075 asoc->stream.si->enqueue_event(&asoc->ulpq, ev);
1079 static void sctp_cmd_t1_timer_update(struct sctp_association *asoc,
1085 t = asoc->init_last_sent_to;
1086 asoc->init_err_counter++;
1088 if (t->init_sent_count > (asoc->init_cycle + 1)) {
1089 asoc->timeouts[timer] *= 2;
1090 if (asoc->timeouts[timer] > asoc->max_init_timeo) {
1091 asoc->timeouts[timer] = asoc->max_init_timeo;
1093 asoc->init_cycle++;
1097 asoc->init_err_counter, asoc->init_cycle,
1098 asoc->timeouts[timer]);
1107 static void sctp_cmd_send_msg(struct sctp_association *asoc,
1113 sctp_outq_tail(&asoc->outqueue, chunk, gfp);
1115 asoc->outqueue.sched->enqueue(&asoc->outqueue, msg);
1124 pr_debug("%s[pre-fn]: ep:%p, %s, %s, asoc:%p[%s], %s\n", __func__, \
1126 asoc, sctp_state_tbl[state], state_fn->name)
1129 pr_debug("%s[post-fn]: asoc:%p, status:%s\n", __func__, asoc, \
1133 pr_debug("%s[post-sfx]: error:%d, asoc:%p[%s]\n", __func__, error, \
1134 asoc, sctp_state_tbl[(asoc && sctp_id2assoc(ep->base.sk, \
1135 sctp_assoc2id(asoc))) ? asoc->state : SCTP_STATE_CLOSED])
1145 struct sctp_endpoint *ep, struct sctp_association *asoc,
1166 status = state_fn->fn(net, ep, asoc, subtype, event_arg, &commands);
1170 ep, &asoc, event_arg, status,
1184 struct sctp_association **asoc,
1199 ep, *asoc,
1224 *asoc = NULL;
1273 struct sctp_association *asoc,
1310 sctp_outq_uncork(&asoc->outqueue, gfp);
1315 asoc = cmd->obj.asoc;
1316 BUG_ON(asoc->peer.primary_path == NULL);
1317 sctp_endpoint_add_asoc(ep, asoc);
1321 sctp_outq_teardown(&asoc->outqueue);
1326 sctp_outq_uncork(&asoc->outqueue, gfp);
1330 sctp_cmd_delete_tcb(commands, asoc);
1331 asoc = NULL;
1336 sctp_cmd_new_state(commands, asoc, cmd->obj.state);
1341 error = sctp_tsnmap_mark(&asoc->peer.tsn_map,
1346 asoc->stream.si->report_ftsn(&asoc->ulpq, cmd->obj.u32);
1350 asoc->stream.si->handle_ftsn(&asoc->ulpq,
1361 error = sctp_gen_sack(asoc, force, commands);
1366 error = sctp_cmd_process_sack(commands, asoc,
1372 new_obj = sctp_make_init_ack(asoc, chunk, GFP_ATOMIC,
1389 error = sctp_cmd_process_init(commands, asoc, chunk,
1395 new_obj = sctp_make_cookie_echo(asoc, chunk);
1414 asoc->init_last_sent_to = new_obj->transport;
1420 * command plays with asoc->peer.retran_path to
1429 if ((asoc->peer.retran_path !=
1430 asoc->peer.primary_path) &&
1431 (asoc->init_err_counter > 0)) {
1443 asoc->overall_error_count = 0;
1446 new_obj = sctp_make_shutdown(asoc, chunk);
1458 __func__, cmd->obj.chunk, &asoc->ulpq);
1460 asoc->stream.si->ulpevent_data(&asoc->ulpq,
1468 __func__, cmd->obj.ulpevent, &asoc->ulpq);
1470 asoc->stream.si->enqueue_event(&asoc->ulpq,
1476 if (!asoc->outqueue.cork) {
1477 sctp_outq_cork(&asoc->outqueue);
1481 sctp_outq_tail(&asoc->outqueue, cmd->obj.chunk, gfp);
1493 sctp_retransmit(&asoc->outqueue, cmd->obj.transport,
1499 sctp_retransmit(&asoc->outqueue, cmd->obj.transport,
1505 sctp_do_ecn_ce_work(asoc, cmd->obj.u32);
1510 new_obj = sctp_do_ecn_ecne_work(asoc, cmd->obj.u32,
1519 sctp_do_ecn_cwr_work(asoc, cmd->obj.u32);
1523 sctp_cmd_setup_t2(commands, asoc, cmd->obj.chunk);
1527 timer = &asoc->timers[cmd->obj.to];
1534 timer = &asoc->timers[cmd->obj.to];
1535 timeout = asoc->timeouts[cmd->obj.to];
1547 sctp_association_hold(asoc);
1552 timer = &asoc->timers[cmd->obj.to];
1553 timeout = asoc->timeouts[cmd->obj.to];
1555 sctp_association_hold(asoc);
1559 timer = &asoc->timers[cmd->obj.to];
1561 sctp_association_put(asoc);
1566 t = sctp_assoc_choose_alter_transport(asoc,
1567 asoc->init_last_sent_to);
1568 asoc->init_last_sent_to = t;
1572 sctp_assoc_set_primary(asoc, t);
1582 sctp_cmd_t1_timer_update(asoc,
1597 sctp_cmd_t1_timer_update(asoc,
1604 list_for_each_entry(t, &asoc->peer.transport_addr_list,
1606 sctp_retransmit_mark(&asoc->outqueue, t,
1616 sctp_cmd_init_failed(commands, asoc, cmd->obj.u16);
1620 sctp_cmd_assoc_failed(commands, asoc, event_type,
1625 asoc->init_err_counter++;
1629 asoc->init_err_counter = 0;
1630 asoc->init_cycle = 0;
1631 list_for_each_entry(t, &asoc->peer.transport_addr_list,
1638 sctp_tsnmap_mark_dup(&asoc->peer.tsn_map,
1648 sctp_do_8_2_transport_strike(commands, asoc,
1659 sctp_do_8_2_transport_strike(commands, asoc,
1666 sctp_cmd_transport_on(commands, asoc, t, chunk);
1670 sctp_cmd_hb_timers_start(commands, asoc);
1679 sctp_cmd_hb_timers_stop(commands, asoc);
1694 sackh.a_rwnd = htonl(asoc->peer.rwnd +
1695 asoc->outqueue.outstanding_bytes);
1709 if (asoc) {
1710 sctp_outq_uncork(&asoc->outqueue, gfp);
1721 asoc->stream.si->start_pd(&asoc->ulpq, GFP_ATOMIC);
1725 asoc->stream.si->renege_events(&asoc->ulpq,
1731 sctp_cmd_setup_t4(commands, asoc, cmd->obj.chunk);
1735 sctp_cmd_process_operr(commands, asoc, chunk);
1738 asoc->peer.i.init_tag = 0;
1741 sctp_cmd_del_non_primary(asoc);
1744 sctp_cmd_t3_rtx_timers_stop(commands, asoc);
1747 t = asoc->peer.retran_path;
1748 asoc->peer.retran_path = asoc->peer.primary_path;
1749 sctp_outq_uncork(&asoc->outqueue, gfp);
1751 asoc->peer.retran_path = t;
1754 sctp_cmd_set_sk_err(asoc, cmd->obj.error);
1757 sctp_cmd_assoc_change(commands, asoc,
1761 sctp_cmd_adaptation_ind(commands, asoc);
1764 sctp_cmd_peer_no_auth(commands, asoc);
1768 error = sctp_auth_asoc_init_active_key(asoc,
1772 asoc->peer.i.init_tag = cmd->obj.u32;
1775 if (!asoc->outqueue.cork) {
1776 sctp_outq_cork(&asoc->outqueue);
1779 sctp_cmd_send_msg(asoc, cmd->obj.msg, gfp);
1782 sctp_asconf_queue_teardown(asoc);
1786 if (asoc && local_cork) {
1787 sctp_outq_uncork(&asoc->outqueue, gfp);
1790 asoc = cmd->obj.asoc;
1814 if (asoc && SCTP_EVENT_T_CHUNK == event_type && chunk) {
1816 sctp_outq_uncork(&asoc->outqueue, gfp);
1818 sctp_outq_uncork(&asoc->outqueue, gfp);