Lines Matching refs:net

91     struct sctp_nets *net, uint16_t threshold)  in sctp_threshold_management()  argument
93 if (net) { in sctp_threshold_management()
94 net->error_count++; in sctp_threshold_management()
96 (void *)net, net->error_count, in sctp_threshold_management()
97 net->failure_threshold); in sctp_threshold_management()
98 if (net->error_count > net->failure_threshold) { in sctp_threshold_management()
100 if (net->dest_state & SCTP_ADDR_REACHABLE) { in sctp_threshold_management()
101 net->dest_state &= ~SCTP_ADDR_REACHABLE; in sctp_threshold_management()
102 net->dest_state &= ~SCTP_ADDR_REQ_PRIMARY; in sctp_threshold_management()
103 net->dest_state &= ~SCTP_ADDR_PF; in sctp_threshold_management()
106 (void *)net, SCTP_SO_NOT_LOCKED); in sctp_threshold_management()
108 } else if ((net->pf_threshold < net->failure_threshold) && in sctp_threshold_management()
109 (net->error_count > net->pf_threshold)) { in sctp_threshold_management()
110 if (!(net->dest_state & SCTP_ADDR_PF)) { in sctp_threshold_management()
111 net->dest_state |= SCTP_ADDR_PF; in sctp_threshold_management()
112 net->last_active = sctp_get_tick_count(); in sctp_threshold_management()
113 sctp_send_hb(stcb, net, SCTP_SO_NOT_LOCKED); in sctp_threshold_management()
115 inp, stcb, net, in sctp_threshold_management()
117 sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net); in sctp_threshold_management()
124 if (net) { in sctp_threshold_management()
125 if ((net->dest_state & SCTP_ADDR_UNCONFIRMED) == 0) { in sctp_threshold_management()
148 ((net == NULL) ? (uint32_t)0 : (uint32_t)net->dest_state)); in sctp_threshold_management()
172 struct sctp_nets *net, in sctp_find_alternate_net() argument
222 if (mnet == net) { in sctp_find_alternate_net()
284 return (net); in sctp_find_alternate_net()
332 if ((net != NULL) && ((net->dest_state & SCTP_ADDR_BEING_DELETED) == 0)) { in sctp_find_alternate_net()
333 alt = TAILQ_NEXT(net, sctp_next);; in sctp_find_alternate_net()
359 (alt != net)) { in sctp_find_alternate_net()
371 if ((net != NULL) && ((net->dest_state & SCTP_ADDR_BEING_DELETED) == 0)) { in sctp_find_alternate_net()
372 alt = TAILQ_NEXT(net, sctp_next);; in sctp_find_alternate_net()
389 (alt != net)) { in sctp_find_alternate_net()
405 if ((net != NULL) && ((net->dest_state & SCTP_ADDR_BEING_DELETED) == 0)) { in sctp_find_alternate_net()
406 alt = net; in sctp_find_alternate_net()
417 struct sctp_nets *net, in sctp_backoff_on_timeout() argument
421 if (net->RTO == 0) { in sctp_backoff_on_timeout()
422 if (net->RTO_measured) { in sctp_backoff_on_timeout()
423 net->RTO = stcb->asoc.minrto; in sctp_backoff_on_timeout()
425 net->RTO = stcb->asoc.initial_rto; in sctp_backoff_on_timeout()
428 net->RTO <<= 1; in sctp_backoff_on_timeout()
429 if (net->RTO > stcb->asoc.maxrto) { in sctp_backoff_on_timeout()
430 net->RTO = stcb->asoc.maxrto; in sctp_backoff_on_timeout()
435 stcb->asoc.cc_functions.sctp_cwnd_update_after_timeout(stcb, net); in sctp_backoff_on_timeout()
488 struct sctp_nets *net, in sctp_mark_all_for_resend() argument
521 cur_rto = (net->lastsa >> SCTP_RTT_SHIFT) + net->lastsv; in sctp_mark_all_for_resend()
528 sctp_log_fr(net->flight_size, 0, 0, SCTP_FR_CWND_REPORT); in sctp_mark_all_for_resend()
529 sctp_log_fr(net->flight_size, net->cwnd, stcb->asoc.total_flight, SCTP_FR_CWND_REPORT); in sctp_mark_all_for_resend()
552 orig_flight = net->flight_size; in sctp_mark_all_for_resend()
555 net->fast_retran_ip = 0; in sctp_mark_all_for_resend()
581 if ((chk->whoTo == net) && (chk->sent < SCTP_DATAGRAM_ACKED)) { in sctp_mark_all_for_resend()
669 net->marked_retrans++; in sctp_mark_all_for_resend()
697 if (alt != net) { in sctp_mark_all_for_resend()
726 if ((orig_flight - net->flight_size) != (orig_tf - stcb->asoc.total_flight)) { in sctp_mark_all_for_resend()
753 if ((chk->whoTo == net) && in sctp_mark_all_for_resend()
786 (void *)net); in sctp_mark_all_for_resend()
818 struct sctp_nets *net) in sctp_t3rxt_timer() argument
830 if (net == lnet) { in sctp_t3rxt_timer()
839 (stcb->asoc.total_flight < net->mtu)) { in sctp_t3rxt_timer()
848 if (sctp_threshold_management(inp, stcb, net, in sctp_t3rxt_timer()
853 if (net != stcb->asoc.primary_destination) { in sctp_t3rxt_timer()
859 if (net->last_sent_time.tv_sec) { in sctp_t3rxt_timer()
860 ms_goneby = (now.tv_sec - net->last_sent_time.tv_sec) * 1000; in sctp_t3rxt_timer()
864 if ((net->dest_state & SCTP_ADDR_PF) == 0) { in sctp_t3rxt_timer()
865 if ((ms_goneby > net->RTO) || (net->RTO == 0)) { in sctp_t3rxt_timer()
871 sctp_send_hb(stcb, net, SCTP_SO_NOT_LOCKED); in sctp_t3rxt_timer()
890 if (net->pf_threshold < net->failure_threshold) { in sctp_t3rxt_timer()
891 alt = sctp_find_alternate_net(stcb, net, 2); in sctp_t3rxt_timer()
898 alt = sctp_find_alternate_net(stcb, net, 1); in sctp_t3rxt_timer()
905 net->find_pseudo_cumack = 1; in sctp_t3rxt_timer()
906 net->find_rtx_pseudo_cumack = 1; in sctp_t3rxt_timer()
909 alt = sctp_find_alternate_net(stcb, net, 0); in sctp_t3rxt_timer()
914 (void)sctp_mark_all_for_resend(stcb, net, alt, win_probe, in sctp_t3rxt_timer()
920 net->fast_retran_loss_recovery = 0; in sctp_t3rxt_timer()
922 (net->flight_size == 0)) { in sctp_t3rxt_timer()
923 (*stcb->asoc.cc_functions.sctp_cwnd_new_transmission_begins) (stcb, net); in sctp_t3rxt_timer()
933 sctp_backoff_on_timeout(stcb, net, win_probe, num_mk, num_abandoned); in sctp_t3rxt_timer()
934 if ((!(net->dest_state & SCTP_ADDR_REACHABLE)) || in sctp_t3rxt_timer()
935 (net->dest_state & SCTP_ADDR_PF)) { in sctp_t3rxt_timer()
937 sctp_move_chunks_from_net(stcb, net); in sctp_t3rxt_timer()
943 if (net->ro._s_addr) { in sctp_t3rxt_timer()
944 sctp_free_ifa(net->ro._s_addr); in sctp_t3rxt_timer()
945 net->ro._s_addr = NULL; in sctp_t3rxt_timer()
947 net->src_addr_selected = 0; in sctp_t3rxt_timer()
950 RO_NHFREE(&net->ro); in sctp_t3rxt_timer()
953 if ((stcb->asoc.primary_destination == net) && (alt != net)) { in sctp_t3rxt_timer()
977 sctp_timer_start(SCTP_TIMER_TYPE_SEND, inp, stcb, net); in sctp_t3rxt_timer()
999 sctp_log_cwnd(stcb, net, net->cwnd, SCTP_CWND_LOG_FROM_RTX); in sctp_t3rxt_timer()
1007 struct sctp_nets *net) in sctp_t1init_timer() argument
1022 if (sctp_threshold_management(inp, stcb, net, in sctp_t1init_timer()
1029 if (stcb->asoc.initial_init_rto_max < net->RTO) { in sctp_t1init_timer()
1030 net->RTO = stcb->asoc.initial_init_rto_max; in sctp_t1init_timer()
1055 struct sctp_nets *net SCTP_UNUSED) in sctp_cookie_timer()
1120 struct sctp_nets *alt, *net; in sctp_strreset_timer() local
1131 net = strrst->whoTo; in sctp_strreset_timer()
1133 if (sctp_threshold_management(inp, stcb, net, stcb->asoc.max_send_times)) { in sctp_strreset_timer()
1141 sctp_backoff_on_timeout(stcb, net, 1, 0, 0); in sctp_strreset_timer()
1142 alt = sctp_find_alternate_net(stcb, net, 0); in sctp_strreset_timer()
1148 if ((chk->whoTo == net) && in sctp_strreset_timer()
1160 if (!(net->dest_state & SCTP_ADDR_REACHABLE)) { in sctp_strreset_timer()
1165 sctp_move_chunks_from_net(stcb, net); in sctp_strreset_timer()
1167 sctp_free_remote_addr(net); in sctp_strreset_timer()
1182 struct sctp_nets *net) in sctp_asconf_timer() argument
1190 sctp_send_asconf(stcb, net, SCTP_ADDR_NOT_LOCKED); in sctp_asconf_timer()
1201 net = asconf->whoTo; in sctp_asconf_timer()
1203 if (sctp_threshold_management(inp, stcb, net, in sctp_asconf_timer()
1224 sctp_backoff_on_timeout(stcb, net, 1, 0, 0); in sctp_asconf_timer()
1225 alt = sctp_find_alternate_net(stcb, net, 0); in sctp_asconf_timer()
1233 if ((chk->whoTo == net) && in sctp_asconf_timer()
1256 if (!(net->dest_state & SCTP_ADDR_REACHABLE)) { in sctp_asconf_timer()
1261 sctp_move_chunks_from_net(stcb, net); in sctp_asconf_timer()
1263 sctp_free_remote_addr(net); in sctp_asconf_timer()
1302 struct sctp_nets *net) in sctp_shutdown_timer() argument
1307 if (sctp_threshold_management(inp, stcb, net, stcb->asoc.max_send_times)) { in sctp_shutdown_timer()
1311 sctp_backoff_on_timeout(stcb, net, 1, 0, 0); in sctp_shutdown_timer()
1313 alt = sctp_find_alternate_net(stcb, net, 0); in sctp_shutdown_timer()
1325 struct sctp_nets *net) in sctp_shutdownack_timer() argument
1330 if (sctp_threshold_management(inp, stcb, net, stcb->asoc.max_send_times)) { in sctp_shutdownack_timer()
1334 sctp_backoff_on_timeout(stcb, net, 1, 0, 0); in sctp_shutdownack_timer()
1336 alt = sctp_find_alternate_net(stcb, net, 0); in sctp_shutdownack_timer()
1413 struct sctp_nets *net) in sctp_heartbeat_timer() argument
1417 if (net->dest_state & SCTP_ADDR_PF) { in sctp_heartbeat_timer()
1422 if (net->hb_responded == 0) { in sctp_heartbeat_timer()
1423 if (net->ro._s_addr) { in sctp_heartbeat_timer()
1428 sctp_free_ifa(net->ro._s_addr); in sctp_heartbeat_timer()
1429 net->ro._s_addr = NULL; in sctp_heartbeat_timer()
1430 net->src_addr_selected = 0; in sctp_heartbeat_timer()
1432 sctp_backoff_on_timeout(stcb, net, 1, 0, 0); in sctp_heartbeat_timer()
1433 if (sctp_threshold_management(inp, stcb, net, stcb->asoc.max_send_times)) { in sctp_heartbeat_timer()
1439 if (net->partial_bytes_acked) { in sctp_heartbeat_timer()
1440 net->partial_bytes_acked = 0; in sctp_heartbeat_timer()
1447 if (!(net->dest_state & SCTP_ADDR_NOHB) && in sctp_heartbeat_timer()
1448 !((net_was_pf == 0) && (net->dest_state & SCTP_ADDR_PF))) { in sctp_heartbeat_timer()
1455 if ((net->last_sent_time.tv_sec > 0) || in sctp_heartbeat_timer()
1456 (net->last_sent_time.tv_usec > 0)) { in sctp_heartbeat_timer()
1460 timevalsub(&diff, &net->last_sent_time); in sctp_heartbeat_timer()
1466 if ((ms_gone_by >= net->heart_beat_delay) || in sctp_heartbeat_timer()
1467 (net->dest_state & SCTP_ADDR_PF)) { in sctp_heartbeat_timer()
1468 sctp_send_hb(stcb, net, SCTP_SO_NOT_LOCKED); in sctp_heartbeat_timer()
1477 struct sctp_nets *net) in sctp_pathmtu_timer() argument
1481 next_mtu = sctp_get_next_mtu(net->mtu); in sctp_pathmtu_timer()
1483 if ((next_mtu > net->mtu) && (net->port == 0)) { in sctp_pathmtu_timer()
1484 if ((net->src_addr_selected == 0) || in sctp_pathmtu_timer()
1485 (net->ro._s_addr == NULL) || in sctp_pathmtu_timer()
1486 (net->ro._s_addr->localifa_flags & SCTP_BEING_DELETED)) { in sctp_pathmtu_timer()
1487 if ((net->ro._s_addr != NULL) && (net->ro._s_addr->localifa_flags & SCTP_BEING_DELETED)) { in sctp_pathmtu_timer()
1488 sctp_free_ifa(net->ro._s_addr); in sctp_pathmtu_timer()
1489 net->ro._s_addr = NULL; in sctp_pathmtu_timer()
1490 net->src_addr_selected = 0; in sctp_pathmtu_timer()
1491 } else if (net->ro._s_addr == NULL) { in sctp_pathmtu_timer()
1493 if (net->ro._l_addr.sa.sa_family == AF_INET6) { in sctp_pathmtu_timer()
1494 struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)&net->ro._l_addr; in sctp_pathmtu_timer()
1501 net->ro._s_addr = sctp_source_address_selection(inp, in sctp_pathmtu_timer()
1503 (sctp_route_t *)&net->ro, in sctp_pathmtu_timer()
1504 net, 0, stcb->asoc.vrf_id); in sctp_pathmtu_timer()
1506 if (net->ro._l_addr.sa.sa_family == AF_INET6) { in sctp_pathmtu_timer()
1507 struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)&net->ro._l_addr; in sctp_pathmtu_timer()
1513 if (net->ro._s_addr) in sctp_pathmtu_timer()
1514 net->src_addr_selected = 1; in sctp_pathmtu_timer()
1516 if (net->ro._s_addr) { in sctp_pathmtu_timer()
1517 mtu = SCTP_GATHER_MTU_FROM_ROUTE(net->ro._s_addr, &net->ro._s_addr.sa, net->ro.ro_nh); in sctp_pathmtu_timer()
1519 if (net->port) { in sctp_pathmtu_timer()
1524 net->mtu = next_mtu; in sctp_pathmtu_timer()
1526 net->mtu = mtu; in sctp_pathmtu_timer()
1531 sctp_timer_start(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, net); in sctp_pathmtu_timer()
1573 struct sctp_nets *net; in sctp_autoclose_timer() local
1582 net = stcb->asoc.alternate; in sctp_autoclose_timer()
1584 net = stcb->asoc.primary_destination; in sctp_autoclose_timer()
1586 sctp_send_shutdown(stcb, net); in sctp_autoclose_timer()
1588 stcb->sctp_ep, stcb, net); in sctp_autoclose_timer()