Lines Matching refs:net

153     struct sctp_nets *net,  in sctp_notify()  argument
178 if (net->dest_state & SCTP_ADDR_REACHABLE) { in sctp_notify()
180 net->dest_state &= ~SCTP_ADDR_REACHABLE; in sctp_notify()
181 net->dest_state &= ~SCTP_ADDR_PF; in sctp_notify()
184 (void *)net, SCTP_SO_NOT_LOCKED); in sctp_notify()
207 if (net->dest_state & SCTP_ADDR_NO_PMTUD) { in sctp_notify()
221 if (SCTP_OS_TIMER_PENDING(&net->pmtu_timer.timer)) { in sctp_notify()
223 sctp_timer_stop(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, net, in sctp_notify()
229 if (net->port) { in sctp_notify()
232 if (net->mtu > next_mtu) { in sctp_notify()
233 net->mtu = next_mtu; in sctp_notify()
234 if (net->port) { in sctp_notify()
235 sctp_hc_set_mtu(&net->ro._l_addr, inp->fibnum, next_mtu + sizeof(struct udphdr)); in sctp_notify()
237 sctp_hc_set_mtu(&net->ro._l_addr, inp->fibnum, next_mtu); in sctp_notify()
246 sctp_timer_start(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, net); in sctp_notify()
263 struct sctp_nets *net; in sctp_ctlinput() local
298 net = NULL; in sctp_ctlinput()
301 &inp, &net, 1, in sctp_ctlinput()
304 (net != NULL) && in sctp_ctlinput()
338 sctp_notify(inp, stcb, net, in sctp_ctlinput()
365 struct sctp_nets *net; in sctp_getcred() local
384 &inp, &net, 1, vrf_id); in sctp_getcred()
2174 struct sctp_nets *net; local
2183 TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
2184 switch (net->ro._l_addr.sa.sa_family) {
2224 struct sctp_nets *net; local
2235 TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
2236 switch (net->ro._l_addr.sa.sa_family) {
2268 (net->ro._l_addr.sa.sa_family == AF_INET)) {
2270 in6_sin_2_v4mapsin6(&net->ro._l_addr.sin,
2273 memcpy(sas, &net->ro._l_addr, cpsz);
2276 memcpy(sas, &net->ro._l_addr, cpsz);
2312 struct sctp_nets *net; local
2339 net = sctp_findnet(stcb, addr);
2348 net = NULL;
2350 stcb = sctp_findassociation_ep_addr(&inp, addr, &net, NULL, NULL);
2355 if ((stcb != NULL) && (net == NULL)) {
2393 if (net != NULL) {
2394 paddrp->spp_hbinterval = net->heart_beat_delay;
2395 paddrp->spp_pathmaxrxt = net->failure_threshold;
2396 paddrp->spp_pathmtu = net->mtu;
2397 switch (net->ro._l_addr.sa.sa_family) {
2412 if (net->dest_state & SCTP_ADDR_NOHB) {
2418 if (net->dest_state & SCTP_ADDR_NO_PMTUD) {
2423 if (net->dscp & 0x01) {
2424 paddrp->spp_dscp = net->dscp & 0xfc;
2428 if ((net->ro._l_addr.sa.sa_family == AF_INET6) &&
2429 (net->flowlabel & 0x80000000)) {
2430 paddrp->spp_ipv6_flowlabel = net->flowlabel & 0x000fffff;
2513 struct sctp_nets *net; local
2540 net = sctp_findnet(stcb, addr);
2549 net = NULL;
2551 stcb = sctp_findassociation_ep_addr(&inp, addr, &net, NULL, NULL);
2557 if ((stcb != NULL) && (net != NULL)) {
2558 if (net->dest_state & SCTP_ADDR_UNCONFIRMED) {
2561 } else if (net->dest_state & SCTP_ADDR_REACHABLE) {
2568 paddri->spinfo_cwnd = net->cwnd;
2569 paddri->spinfo_srtt = net->lastsa >> SCTP_RTT_SHIFT;
2570 paddri->spinfo_rto = net->RTO;
2572 paddri->spinfo_mtu = net->mtu;
2609 struct sctp_nets *net; local
2635 net = stcb->asoc.primary_destination;
2636 if (net != NULL) {
2646 if (net->dest_state & SCTP_ADDR_UNCONFIRMED) {
2649 } else if (net->dest_state & SCTP_ADDR_REACHABLE) {
2656 sstat->sstat_primary.spinfo_cwnd = net->cwnd;
2657 sstat->sstat_primary.spinfo_srtt = net->lastsa >> SCTP_RTT_SHIFT;
2658 sstat->sstat_primary.spinfo_rto = net->RTO;
2659 sstat->sstat_primary.spinfo_mtu = net->mtu;
3187 struct sctp_nets *net; local
3214 net = sctp_findnet(stcb, addr);
3223 net = NULL;
3225 stcb = sctp_findassociation_ep_addr(&inp, addr, &net, NULL, NULL);
3230 if ((stcb != NULL) && (net == NULL)) {
3266 if (net != NULL) {
3267 thlds->spt_pathmaxrxt = net->failure_threshold;
3268 thlds->spt_pathpfthld = net->pf_threshold;
3300 struct sctp_nets *net; local
3327 net = sctp_findnet(stcb, addr);
3336 net = NULL;
3338 stcb = sctp_findassociation_ep_addr(&inp, addr, &net, NULL, NULL);
3343 if ((stcb != NULL) && (net == NULL)) {
3379 if (net) {
3380 encaps->sue_port = net->port;
3964 struct sctp_nets *net; local
3980 TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
3981 stcb->asoc.cc_functions.sctp_set_initial_cc_param(stcb, net);
4002 TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
4003 stcb->asoc.cc_functions.sctp_set_initial_cc_param(stcb, net);
5214 struct sctp_nets *net; local
5241 net = sctp_findnet(stcb, addr);
5250 net = NULL;
5253 &net, NULL, NULL);
5258 if ((stcb != NULL) && (net == NULL)) {
5310 if (net != NULL) {
5313 if (!(net->dest_state & SCTP_ADDR_UNCONFIRMED) &&
5314 !(net->dest_state & SCTP_ADDR_NOHB)) {
5315 sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net,
5318 net->dest_state |= SCTP_ADDR_NOHB;
5322 net->heart_beat_delay = paddrp->spp_hbinterval;
5324 net->heart_beat_delay = 0;
5326 sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net,
5328 sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net);
5329 net->dest_state &= ~SCTP_ADDR_NOHB;
5333 sctp_send_hb(stcb, net, SCTP_SO_LOCKED);
5335 sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net);
5339 if (SCTP_OS_TIMER_PENDING(&net->pmtu_timer.timer)) {
5340 sctp_timer_stop(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, net,
5343 net->dest_state |= SCTP_ADDR_NO_PMTUD;
5344 net->mtu = paddrp->spp_pathmtu;
5345 switch (net->ro._l_addr.sa.sa_family) {
5348 net->mtu += SCTP_MIN_V4_OVERHEAD;
5353 net->mtu += SCTP_MIN_OVERHEAD;
5359 if (net->mtu < stcb->asoc.smallest_mtu) {
5360 sctp_pathmtu_adjustment(stcb, net->mtu);
5364 if (!SCTP_OS_TIMER_PENDING(&net->pmtu_timer.timer)) {
5365 sctp_timer_start(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, net);
5367 net->dest_state &= ~SCTP_ADDR_NO_PMTUD;
5370 if (net->dest_state & SCTP_ADDR_PF) {
5371 if (net->error_count > paddrp->spp_pathmaxrxt) {
5372 net->dest_state &= ~SCTP_ADDR_PF;
5375 if ((net->error_count <= paddrp->spp_pathmaxrxt) &&
5376 (net->error_count > net->pf_threshold)) {
5377 net->dest_state |= SCTP_ADDR_PF;
5378 sctp_send_hb(stcb, net, SCTP_SO_LOCKED);
5380 stcb->sctp_ep, stcb, net,
5382 sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net);
5385 if (net->dest_state & SCTP_ADDR_REACHABLE) {
5386 if (net->error_count > paddrp->spp_pathmaxrxt) {
5387 net->dest_state &= ~SCTP_ADDR_REACHABLE;
5388 sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN, stcb, 0, net, SCTP_SO_LOCKED);
5391 if (net->error_count <= paddrp->spp_pathmaxrxt) {
5392 net->dest_state |= SCTP_ADDR_REACHABLE;
5393 sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, 0, net, SCTP_SO_LOCKED);
5396 net->failure_threshold = paddrp->spp_pathmaxrxt;
5399 net->dscp = paddrp->spp_dscp & 0xfc;
5400 net->dscp |= 0x01;
5404 if (net->ro._l_addr.sa.sa_family == AF_INET6) {
5405 net->flowlabel = paddrp->spp_ipv6_flowlabel & 0x000fffff;
5406 net->flowlabel |= 0x80000000;
5414 TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
5415 if (net->dest_state & SCTP_ADDR_PF) {
5416 if (net->error_count > paddrp->spp_pathmaxrxt) {
5417 net->dest_state &= ~SCTP_ADDR_PF;
5420 if ((net->error_count <= paddrp->spp_pathmaxrxt) &&
5421 (net->error_count > net->pf_threshold)) {
5422 net->dest_state |= SCTP_ADDR_PF;
5423 sctp_send_hb(stcb, net, SCTP_SO_LOCKED);
5425 stcb->sctp_ep, stcb, net,
5427 sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net);
5430 if (net->dest_state & SCTP_ADDR_REACHABLE) {
5431 if (net->error_count > paddrp->spp_pathmaxrxt) {
5432 net->dest_state &= ~SCTP_ADDR_REACHABLE;
5433 sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN, stcb, 0, net, SCTP_SO_LOCKED);
5436 if (net->error_count <= paddrp->spp_pathmaxrxt) {
5437 net->dest_state |= SCTP_ADDR_REACHABLE;
5438 sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, 0, net, SCTP_SO_LOCKED);
5441 net->failure_threshold = paddrp->spp_pathmaxrxt;
5452 TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
5454 net->heart_beat_delay = paddrp->spp_hbinterval;
5456 net->heart_beat_delay = 0;
5458 if (net->dest_state & SCTP_ADDR_NOHB) {
5459 net->dest_state &= ~SCTP_ADDR_NOHB;
5461 sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net,
5463 sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net);
5468 TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
5469 if (!(net->dest_state & SCTP_ADDR_NOHB)) {
5470 net->dest_state |= SCTP_ADDR_NOHB;
5471 if (!(net->dest_state & SCTP_ADDR_UNCONFIRMED)) {
5473 inp, stcb, net,
5481 TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
5482 if (SCTP_OS_TIMER_PENDING(&net->pmtu_timer.timer)) {
5483 sctp_timer_stop(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, net,
5486 net->dest_state |= SCTP_ADDR_NO_PMTUD;
5487 net->mtu = paddrp->spp_pathmtu;
5488 switch (net->ro._l_addr.sa.sa_family) {
5491 net->mtu += SCTP_MIN_V4_OVERHEAD;
5496 net->mtu += SCTP_MIN_OVERHEAD;
5502 if (net->mtu < stcb->asoc.smallest_mtu) {
5503 sctp_pathmtu_adjustment(stcb, net->mtu);
5510 TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
5511 if (!SCTP_OS_TIMER_PENDING(&net->pmtu_timer.timer)) {
5512 sctp_timer_start(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, net);
5514 net->dest_state &= ~SCTP_ADDR_NO_PMTUD;
5520 TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
5521 net->dscp = paddrp->spp_dscp & 0xfc;
5522 net->dscp |= 0x01;
5529 TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
5530 if (net->ro._l_addr.sa.sa_family == AF_INET6) {
5531 net->flowlabel = paddrp->spp_ipv6_flowlabel & 0x000fffff;
5532 net->flowlabel |= 0x80000000;
5728 struct sctp_nets *net; local
5755 net = sctp_findnet(stcb, addr);
5764 net = NULL;
5767 &net, NULL, NULL);
5773 if ((stcb != NULL) && (net != NULL)) {
5774 if (net != stcb->asoc.primary_destination) {
5775 if (!(net->dest_state & SCTP_ADDR_UNCONFIRMED)) {
5777 if (sctp_set_primary_addr(stcb, (struct sockaddr *)NULL, net) == 0) {
5779 (!(net->dest_state & SCTP_ADDR_PF)) &&
5780 (net->dest_state & SCTP_ADDR_REACHABLE)) {
6276 struct sctp_nets *net; local
6303 net = sctp_findnet(stcb, addr);
6312 net = NULL;
6315 &net, NULL, NULL);
6320 if ((stcb != NULL) && (net == NULL)) {
6364 if (net != NULL) {
6365 net->failure_threshold = thlds->spt_pathmaxrxt;
6366 net->pf_threshold = thlds->spt_pathpfthld;
6367 if (net->dest_state & SCTP_ADDR_PF) {
6368 if ((net->error_count > net->failure_threshold) ||
6369 (net->error_count <= net->pf_threshold)) {
6370 net->dest_state &= ~SCTP_ADDR_PF;
6373 if ((net->error_count > net->pf_threshold) &&
6374 (net->error_count <= net->failure_threshold)) {
6375 net->dest_state |= SCTP_ADDR_PF;
6376 sctp_send_hb(stcb, net, SCTP_SO_LOCKED);
6378 stcb->sctp_ep, stcb, net,
6380 sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net);
6383 if (net->dest_state & SCTP_ADDR_REACHABLE) {
6384 if (net->error_count > net->failure_threshold) {
6385 net->dest_state &= ~SCTP_ADDR_REACHABLE;
6386 sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN, stcb, 0, net, SCTP_SO_LOCKED);
6389 if (net->error_count <= net->failure_threshold) {
6390 net->dest_state |= SCTP_ADDR_REACHABLE;
6391 sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, 0, net, SCTP_SO_LOCKED);
6395 TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
6396 net->failure_threshold = thlds->spt_pathmaxrxt;
6397 net->pf_threshold = thlds->spt_pathpfthld;
6398 if (net->dest_state & SCTP_ADDR_PF) {
6399 if ((net->error_count > net->failure_threshold) ||
6400 (net->error_count <= net->pf_threshold)) {
6401 net->dest_state &= ~SCTP_ADDR_PF;
6404 if ((net->error_count > net->pf_threshold) &&
6405 (net->error_count <= net->failure_threshold)) {
6406 net->dest_state |= SCTP_ADDR_PF;
6407 sctp_send_hb(stcb, net, SCTP_SO_LOCKED);
6409 stcb->sctp_ep, stcb, net,
6411 sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep, stcb, net);
6414 if (net->dest_state & SCTP_ADDR_REACHABLE) {
6415 if (net->error_count > net->failure_threshold) {
6416 net->dest_state &= ~SCTP_ADDR_REACHABLE;
6417 sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN, stcb, 0, net, SCTP_SO_LOCKED);
6420 if (net->error_count <= net->failure_threshold) {
6421 net->dest_state |= SCTP_ADDR_REACHABLE;
6422 sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, 0, net, SCTP_SO_LOCKED);
6448 struct sctp_nets *net; local
6475 net = sctp_findnet(stcb, addr);
6484 net = NULL;
6486 stcb = sctp_findassociation_ep_addr(&inp, addr, &net, NULL, NULL);
6491 if ((stcb != NULL) && (net == NULL)) {
6528 if (net != NULL) {
6529 net->port = encaps->sue_port;
6782 struct sctp_nets *net; local
6790 TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
6791 if ((net->cwnd > stcb->asoc.max_cwnd) &&
6792 (net->cwnd > (net->mtu - sizeof(struct sctphdr)))) {
6793 net->cwnd = stcb->asoc.max_cwnd;
6794 if (net->cwnd < (net->mtu - sizeof(struct sctphdr))) {
6795 net->cwnd = net->mtu - sizeof(struct sctphdr);
7355 struct sctp_nets *net; local
7365 TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
7366 sin_a = (struct sockaddr_in *)&net->ro._l_addr;
7385 (sctp_route_t *)&net->ro,
7386 net, 0, vrf_id);
7433 struct sctp_nets *net; local
7462 TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
7463 sin_a = (struct sockaddr_in *)&net->ro._l_addr;