Lines Matching defs:net
61 #include <net/if.h>
62 #include <net/if_types.h>
64 #include <net/route.h>
609 struct sctp_nets *net,
886 struct sctp_nets *net,
913 if (net) {
914 cur_addr_num = net->indx_of_eligible_next_to_use;
1077 struct sctp_tcb *stcb, struct route *ro, struct sctp_nets *net,
1178 ans = sctp_choose_v4_boundall(inp, stcb, net, rt,
1202 ans = sctp_choose_v4_boundspecific_stcb(inp, stcb, net,
1273 struct sctp_nets *net,
1630 struct sctp_nets *net,
1653 if (net) {
1654 cur_addr_num = net->indx_of_eligible_next_to_use;
1706 if (net) {
1709 net->indx_of_eligible_next_to_use = cur_addr_num + 1;
1711 net->indx_of_eligible_next_to_use = 0;
1835 /* stcb and net may be NULL */
1838 struct sctp_tcb *stcb, struct route *ro, struct sctp_nets *net,
1933 if (net != NULL) {
1935 net->addr_is_local = 1;
1974 rt_addr = sctp_choose_v6_boundall(inp, stcb, net, rt, loc_scope, loopscope, non_asoc_addr_ok);
1982 rt_addr = sctp_choose_v6_boundspecific_stcb(inp, stcb, net, rt, loc_scope, loopscope, non_asoc_addr_ok);
2064 struct sctp_nets *net,
2092 if ((net) && (net->dest_state & SCTP_ADDR_OUT_OF_SCOPE)) {
2153 printf("chunk_output: net %p\n", net);
2155 if (net == NULL) {
2162 ro = (struct route *)&net->ro;
2168 if (net) {
2169 if (net->src_addr_selected == 0) {
2171 ((struct sockaddr_in *)&net->_s_addr)->sin_addr = sctp_ipv4_source_address_selection(inp,
2173 ro, net, out_of_asoc_ok);
2176 net->src_addr_selected = 1;
2180 ip->ip_src = ((struct sockaddr_in *)&net->_s_addr)->sin_addr;
2183 stcb, ro, net, out_of_asoc_ok);
2207 if (net) {
2208 if ((net->dest_state & SCTP_ADDR_REACHABLE) && stcb)
2212 (void *)net);
2213 net->dest_state &= ~SCTP_ADDR_REACHABLE;
2214 net->dest_state |= SCTP_ADDR_NOT_REACHABLE;
2216 if (net == stcb->asoc.primary_destination) {
2219 alt = sctp_find_alternate_net(stcb, net);
2220 if (alt != net) {
2224 net->dest_state |= SCTP_ADDR_WAS_PRIMARY;
2225 net->src_addr_selected = 0;
2247 if ((have_mtu) && (net) && (have_mtu > net->mtu)) {
2248 rt->rt_ifp->if_mtu = net->mtu;
2253 if ((rt) && (have_mtu) && (net) && (have_mtu > net->mtu)) {
2262 if (net == NULL) {
2273 net->src_addr_selected = 0;
2322 if (net == NULL) {
2329 ro = (struct route *)&net->ro;
2358 if (net) {
2359 if (net->src_addr_selected == 0) {
2361 ((struct sockaddr_in6 *)&net->_s_addr)->sin6_addr = sctp_ipv6_source_address_selection(inp,
2362 stcb, ro, net, out_of_asoc_ok);
2365 net->src_addr_selected = 1;
2368 lsa6->sin6_addr = ((struct sockaddr_in6 *)&net->_s_addr)->sin6_addr;
2371 inp, stcb, ro, net, out_of_asoc_ok);
2386 if (net) {
2387 if ((net->dest_state & SCTP_ADDR_REACHABLE) && stcb)
2391 (void *)net);
2392 net->dest_state &= ~SCTP_ADDR_REACHABLE;
2393 net->dest_state |= SCTP_ADDR_NOT_REACHABLE;
2395 if (net == stcb->asoc.primary_destination) {
2398 alt = sctp_find_alternate_net(stcb, net);
2399 if (alt != net) {
2403 net->dest_state |= SCTP_ADDR_WAS_PRIMARY;
2404 net->src_addr_selected = 0;
2438 if (net) {
2439 sin6 = (struct sockaddr_in6 *)&net->ro.ro_sa;
2452 if (net) {
2463 if (net) {
2468 net->src_addr_selected = 0;
2569 struct sctp_nets *net;
2581 net = stcb->asoc.primary_destination;
2582 if (net == NULL) {
2583 net = TAILQ_FIRST(&stcb->asoc.nets);
2584 if (net == NULL) {
2589 net->dest_state &= ~SCTP_ADDR_UNCONFIRMED;
2590 sctp_set_primary_addr(stcb, NULL, net);
2593 net->dest_state &= ~SCTP_ADDR_UNCONFIRMED;
2598 sctp_print_address (rtcache_getdst(&net->ro));
2601 if (rtcache_getdst(&net->ro)->sa_family == AF_INET6) {
2605 if (IN6_IS_ADDR_LINKLOCAL((const struct in6_addr *) rtcache_getdst(&net->ro)->sa_data))
2608 if (callout_pending(&net->rxt_timer.timer)) {
2613 if (sctp_timer_start(SCTP_TIMER_TYPE_INIT, inp, stcb, net)) {
2877 printf("Calling lowlevel output stcb:%p net:%p\n",
2878 stcb, net);
2881 ret = sctp_lowlevel_chunk_output(inp, stcb, net,
2882 rtcache_getdst(&net->ro), m, 0, 0, NULL, 0);
2888 sctp_timer_start(SCTP_TIMER_TYPE_INIT, inp, stcb, net);
2889 SCTP_GETTIME_TIMEVAL(&net->last_sent_time);
3116 struct sctp_nets *net;
3143 TAILQ_FOREACH(net, &asoc->nets, sctp_next) {
3144 sa = (struct sockaddr *)&net->ro.ro_sa;
3205 TAILQ_FOREACH(net, &asoc->nets, sctp_next) {
3206 sa = (struct sockaddr *)&net->ro.ro_sa;
3264 struct sctp_nets *net=NULL;
3329 net = asoc->primary_destination;
3395 if (net == NULL) {
3531 /* use the net pointer */
3532 to = rtcache_getdst(&net->ro);
3539 if (net->src_addr_selected == 0) {
3543 net->_s_addr.sin.sin_addr =
3545 stcb, &net->ro, net, 0);
3546 net->src_addr_selected = 1;
3550 stc.laddress[0] = net->_s_addr.sin.sin_addr.s_addr;
3559 if (net->src_addr_selected == 0) {
3563 net->_s_addr.sin6.sin6_addr =
3565 stcb, &net->ro, net, 0);
3566 net->src_addr_selected = 1;
3568 memcpy(&stc.laddress, &net->_s_addr.sin6.sin6_addr,
3997 struct sctp_nets *net)
4046 template->whoTo = net;
4052 template->whoTo = net;
4123 struct sctp_nets *net,
4141 if ((stcb == NULL) || (net == NULL) || (m == NULL) || (srcv == NULL)) {
4146 printf("stcb:%p net:%p m:%p srcv:%p\n",
4147 stcb, net, m, srcv);
4338 sctp_prepare_chunk(chk, stcb, srcv, strq, net);
4383 sctp_prepare_chunk(&template, stcb, srcv, strq, net);
4887 struct sctp_nets *net)
4900 data_list[i]->sent_rcv_time = net->last_sent_time;
4930 net->flight_size += data_list[i]->book_size;
5125 struct sctp_nets *net)
5137 goal_mtu = net->cwnd - net->flight_size;
5138 if ((unsigned int)goal_mtu < net->mtu) {
5139 goal_mtu = net->mtu;
5191 if (chk->whoTo != net) {
5230 struct sctp_nets *net)
5234 a_net = sctp_find_alternate_net(stcb, net);
5235 if ((a_net != net) &&
5244 if (chk->whoTo == net) {
5275 struct sctp_nets *net;
5336 TAILQ_FOREACH(net, &asoc->nets, sctp_next) {
5339 printf("net:%p fs:%d cwnd:%d\n",
5340 net, net->flight_size, net->cwnd);
5343 if (net->flight_size >= net->cwnd) {
5349 net->flight_size,
5350 net->cwnd);
5360 sctp_fill_outqueue(stcb, net);
5404 TAILQ_FOREACH(net, &asoc->nets, sctp_next) {
5407 if (net->ref_count < 2) {
5418 rt = rtcache_validate(&net->ro);
5425 ifp = net->ro._ro_rt->rt_ifp;
5429 sctp_log_maxburst(net, ifp->if_snd.ifq_len, ifp->if_snd.ifq_maxlen, SCTP_MAX_IFP_APPLIED);
5431 rtcache_unref(rt, &net->ro);
5434 rtcache_unref(rt, &net->ro);
5436 if (((struct sockaddr *)&net->ro.ro_sa)->sa_family == AF_INET) {
5437 mtu = net->mtu - (sizeof(struct ip) + sizeof(struct sctphdr));
5439 mtu = net->mtu - (sizeof(struct ip6_hdr) + sizeof(struct sctphdr));
5455 printf("Ok r_mtu is %d mtu is %d for this net:%p one_chunk:%d\n",
5456 r_mtu, mtu, net, one_chunk);
5466 if (chk->whoTo != net) {
5538 inp, stcb, net);
5572 sctp_timer_start(SCTP_TIMER_TYPE_ASCONF, inp, stcb, net);
5576 sctp_timer_start(SCTP_TIMER_TYPE_COOKIE, inp, stcb, net);
5601 if ((error = sctp_lowlevel_chunk_output(inp, stcb, net,
5602 rtcache_getdst(&net->ro),
5626 SCTP_GETTIME_TIMEVAL(&net->last_sent_time);
5628 *now = net->last_sent_time;
5630 net->last_sent_time = *now;
5646 sctp_move_to_an_alt(stcb, asoc, net);
5655 SCTP_GETTIME_TIMEVAL(&net->last_sent_time);
5657 *now = net->last_sent_time;
5659 net->last_sent_time = *now;
5672 mtu = (net->mtu - SCTP_MIN_OVERHEAD);
5674 mtu = (net->mtu - SCTP_MIN_V4_OVERHEAD);
5684 if (((struct sockaddr *)&net->ro.ro_sa)->sa_family == AF_INET) {
5685 omtu = net->mtu - (sizeof(struct ip) + sizeof(struct sctphdr));
5687 omtu = net->mtu - (sizeof(struct ip6_hdr) + sizeof(struct sctphdr));
5708 if (net->flight_size >= net->cwnd) {
5709 /* skip this net, no room for data */
5713 net->flight_size, net->cwnd);
5721 if (chk->whoTo != net) {
5722 /* No, not sent to this net */
5726 chk->whoTo, net);
5767 if (!callout_pending(&net->rxt_timer.timer)) {
5768 sctp_timer_start(SCTP_TIMER_TYPE_SEND, inp, stcb, net);
5819 sctp_timer_start(SCTP_TIMER_TYPE_ASCONF, inp, stcb, net);
5823 sctp_timer_start(SCTP_TIMER_TYPE_COOKIE, inp, stcb, net);
5827 if (bundle_at && (!callout_pending(&net->rxt_timer.timer))) {
5837 sctp_timer_start(SCTP_TIMER_TYPE_SEND, inp, stcb, net);
5879 if ((error = sctp_lowlevel_chunk_output(inp, stcb, net,
5880 rtcache_getdst(&net->ro),
5905 SCTP_GETTIME_TIMEVAL(&net->last_sent_time);
5907 *now = net->last_sent_time;
5909 net->last_sent_time = *now;
5924 sctp_move_to_an_alt(stcb, asoc, net);
5934 SCTP_GETTIME_TIMEVAL(&net->last_sent_time);
5936 *now = net->last_sent_time;
5938 net->last_sent_time = *now;
5946 if (!net->rto_pending) {
5948 net->rto_pending = 1;
5954 sctp_clean_up_datalist(stcb, asoc, data_list, bundle_at, net);
6030 struct sctp_nets *net)
6120 struct sctp_nets *net)
6130 if (net == NULL)
6131 /* must have a net pointer */
6178 chk->whoTo = net;
6233 sctp_send_shutdown_ack(struct sctp_tcb *stcb, struct sctp_nets *net)
6263 chk->whoTo = net;
6264 net->ref_count++;
6278 sctp_send_shutdown(struct sctp_tcb *stcb, struct sctp_nets *net)
6308 chk->whoTo = net;
6309 net->ref_count++;
6330 sctp_send_asconf(struct sctp_tcb *stcb, struct sctp_nets *net)
6416 /* need to try and alternate net */
6474 struct sctp_nets *net;
6567 *We don't want to mark the net->sent time here since this
6606 /* No, not sent to this net or not ready for rtx */
6610 /* pick up the net */
6611 net = chk->whoTo;
6613 mtu = (net->mtu - SCTP_MIN_OVERHEAD);
6615 mtu = net->mtu- SCTP_MIN_V4_OVERHEAD;
6649 net->fast_retran_ip = 0;
6654 if (net->flight_size >= net->cwnd) {
6659 /* Mark the destination net to have FR recovery
6662 net->fast_retran_ip = 1;
6692 if (fwd->whoTo != net) {
6693 /* Nope, not the net in question */
6725 if (!callout_pending(&net->rxt_timer.timer)) {
6729 sctp_timer_start(SCTP_TIMER_TYPE_SEND, inp, stcb, net);
6751 if ((error = sctp_lowlevel_chunk_output(inp, stcb, net,
6752 rtcache_getdst(&net->ro),
6761 * We don't want to mark the net->sent time here since
6765 /* SCTP_GETTIME_TIMEVAL(&net->last_sent_time);*/
6787 net->flight_size += data_list[i]->book_size;
6815 sctp_timer_stop(SCTP_TIMER_TYPE_SEND, inp, stcb, net);
6816 sctp_timer_start(SCTP_TIMER_TYPE_SEND, inp, stcb, net);
6849 struct sctp_nets *net;
6851 TAILQ_FOREACH(net, &asoc->nets, sctp_next) {
6852 if (callout_pending(&net->rxt_timer.timer)) {
6886 struct sctp_nets *net;
6971 TAILQ_FOREACH(net, &asoc->nets, sctp_next) {
6972 if ((net->dest_state & SCTP_ADDR_NOT_REACHABLE) ==
6981 sctp_move_to_an_alt(stcb, asoc, net);
6984 if ((asoc->sat_network) || (net->addr_is_local)) {
6990 printf("examined net:%p burst limit:%d\n", net, asoc->max_burst);
6995 if ((net->flight_size+(burst_limit*net->mtu)) < net->cwnd) {
6996 if (net->ssthresh < net->cwnd)
6997 net->ssthresh = net->cwnd;
6998 net->cwnd = (net->flight_size+(burst_limit*net->mtu));
7000 sctp_log_maxburst(net, 0, burst_limit, SCTP_MAX_BURST_APPLIED);
7004 net->fast_retran_ip = 0;
7090 struct sctp_nets *net;
7103 net = NULL;
7183 net = stcb->asoc.primary_destination;
7195 /* Must locate the net structure */
7197 net = sctp_findnet(stcb, addr);
7199 if (net == NULL)
7200 net = stcb->asoc.primary_destination;
7227 net = stcb->asoc.primary_destination;
7229 net = sctp_findnet(stcb, addr);
7230 if (net == NULL) {
7231 net = stcb->asoc.primary_destination;
7239 stcb = sctp_findassociation_ep_addr(&t_inp, addr, &net, NULL, NULL);
7371 net = stcb->asoc.primary_destination;
7393 sctp_msg_append(stcb, net, m, &srcv, flags);
7430 if (net && ((srcv.sinfo_flags & SCTP_ADDR_OVER))) {
7434 net = stcb->asoc.primary_destination;
7436 if ((error = sctp_msg_append(stcb, net, m, &srcv, flags))) {
7440 if (net->flight_size > net->cwnd) {
7475 sctp_auditing(6, inp, stcb, net);
7481 sctp_auditing(7, inp, stcb, net);
7999 struct sctp_nets *net)
8024 sctp_lowlevel_chunk_output(stcb->sctp_ep, stcb, net,
8025 rtcache_getdst(&net->ro), m_shutdown_comp,
8154 struct sctp_nets *net, *hnet;
8160 TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
8162 ((net->dest_state & SCTP_ADDR_NOHB) && ((net->dest_state & SCTP_ADDR_UNCONFIRMED) == 0)) ||
8163 (net->dest_state & SCTP_ADDR_OUT_OF_SCOPE)
8168 printf("Skipping net:%p state:%d nohb/out-of-scope\n",
8169 net, net->dest_state);
8174 if (sctp_destination_is_reachable(stcb, (struct sockaddr *)&net->ro.ro_sa) == 0) {
8175 /* skip this dest net from consideration */
8178 printf("Skipping net:%p reachable NOT\n",
8179 net);
8184 if (net->last_sent_time.tv_sec) {
8186 ms_goneby = (now->tv_sec - net->last_sent_time.tv_sec) * 1000;
8192 printf("net:%p ms_goneby:%d\n",
8193 net, ms_goneby);
8200 if ((net->dest_state & (SCTP_ADDR_UNCONFIRMED|SCTP_ADDR_NOT_REACHABLE)) == SCTP_ADDR_UNCONFIRMED) {
8206 if ((((unsigned int)ms_goneby >= net->RTO) || (state_override)) &&
8209 hnet = net;
8212 printf("net:%p is the new high\n",
8213 net);
8232 printf("net:%p is the hb winner -",
8252 struct sctp_nets *net;
8259 net = sctp_select_hb_destination(stcb, &now);
8260 if (net == NULL) {
8270 net);
8279 if (net->flight_size == 0) {
8280 net->cwnd /= 2;
8281 if (net->addr_is_local) {
8282 if (net->cwnd < (net->mtu *4)) {
8283 net->cwnd = net->mtu * 4;
8286 if (net->cwnd < (net->mtu * 2)) {
8287 net->cwnd = net->mtu * 2;
8296 net = u_net;
8297 if (net == NULL) {
8302 sin = (struct sockaddr_in *)&net->ro.ro_sa;
8337 chk->whoTo = net;
8355 if (net->dest_state & SCTP_ADDR_UNCONFIRMED) {
8359 net->heartbeat_random1 = hb->heartbeat.hb_info.random_value1 = sctp_select_initial_TSN(&stcb->sctp_ep->sctp_ep);
8360 net->heartbeat_random2 = hb->heartbeat.hb_info.random_value2 = sctp_select_initial_TSN(&stcb->sctp_ep->sctp_ep);
8362 net->heartbeat_random1 = hb->heartbeat.hb_info.random_value1 = 0;
8363 net->heartbeat_random2 = hb->heartbeat.hb_info.random_value2 = 0;
8369 sin6 = (struct sockaddr_in6 *)&net->ro.ro_sa;
8383 if (sctp_threshold_management(stcb->sctp_ep, stcb, net,
8402 net->hb_responded = 0;
8419 stcb, net);
8425 sctp_send_ecn_echo(struct sctp_tcb *stcb, struct sctp_nets *net,
8465 chk->whoTo = net;
8477 sctp_send_packet_dropped(struct sctp_tcb *stcb, struct sctp_nets *net,
8578 if (net) {
8580 chk->whoTo = net;
8606 sctp_send_cwr(struct sctp_tcb *stcb, struct sctp_nets *net, uint32_t high_tsn)
8648 chk->whoTo = net;
9274 struct sctp_nets *net,
9547 sctp_prepare_chunk(chk, stcb, srcv, strq, net);
9606 sctp_prepare_chunk(&template, stcb, srcv, strq, net);
9809 struct sctp_nets *net;
9815 net = NULL;
9858 net = stcb->asoc.primary_destination;
9896 /* Must locate the net structure */
9897 net = sctp_findnet(stcb, addr);
9909 stcb = sctp_findassociation_ep_addr(&t_inp, addr, &net, NULL, NULL);
10016 net = stcb->asoc.primary_destination;
10057 if (net && ((srcv.sinfo_flags & SCTP_ADDR_OVER))) {
10061 net = stcb->asoc.primary_destination;
10078 error = sctp_copy_it_in(inp, stcb, asoc, net, &srcv, uio, flags);
10088 error = sctp_msg_append(stcb, net, top, &srcv, flags);
10098 if (net->flight_size > net->cwnd) {