Lines Matching +full:fan +full:- +full:stop +full:- +full:to +full:- +full:start +full:- +full:us

1 /* SPDX-License-Identifier: GPL-2.0-or-later */
4 * Copyright (c) 1999-2000 Cisco, Inc.
5 * Copyright (c) 1999-2001 Motorola, Inc.
6 * Copyright (c) 2001-2003 Intel Corp.
12 * Please send any bug reports or fixes you make to the
14 * lksctp developers <linux-sctp@vger.kernel.org>
19 * Jon Grimm <jgrimm@us.ibm.com>
20 * Daisy Chang <daisyc@us.ibm.com>
21 * Sridhar Samudrala <sri@us.ibm.com>
22 * Ardelle Fan <ardelle.fan@intel.com>
23 * Ryan Layer <rmlayer@us.ibm.com>
31 * Start getting some control over the header file dependencies:
40 * and will continue to evolve.
207 #define SCTP_INC_STATS(net, field) SNMP_INC_STATS((net)->sctp.sctp_statistics, field)
208 #define __SCTP_INC_STATS(net, field) __SNMP_INC_STATS((net)->sctp.sctp_statistics, field)
209 #define SCTP_DEC_STATS(net, field) SNMP_DEC_STATS((net)->sctp.sctp_statistics, field)
255 /* helper function to track stats about max rto and related transport */
259 if (asoc->stats.max_obs_rto < (__u64)trans->rto) { in sctp_max_rto()
260 asoc->stats.max_obs_rto = trans->rto; in sctp_max_rto()
261 memset(&asoc->stats.obs_rto_ipaddr, 0, in sctp_max_rto()
263 memcpy(&asoc->stats.obs_rto_ipaddr, &trans->ipaddr, in sctp_max_rto()
264 trans->af_specific->sockaddr_len); in sctp_max_rto()
284 /* Macros to atomically increment/decrement objcnt counters. */
292 /* Macro to help create new entries in the global array of
345 /* Map an association to an assoc_id. */
348 return asoc ? asoc->assoc_id : 0; in sctp_assoc2id()
356 * start at =1 in user space, but actually as =0 in kernel space. in sctp_assoc_to_state()
358 * there, we need to fix it up with an ugly offset not to break in sctp_assoc_to_state()
361 return asoc->state + 1; in sctp_assoc_to_state()
369 /* A macro to walk a list of skbs. */
374 * sctp_list_dequeue - remove from the head of the queue
375 * @list: list to dequeue from
386 result = list->next; in sctp_list_dequeue()
393 * of the way we have to do receive buffer accounting on bundled
401 skb->sk = sk; in sctp_skb_set_owner_r()
402 skb->destructor = sctp_sock_rfree; in sctp_skb_set_owner_r()
403 atomic_add(event->rmem_len, &sk->sk_rmem_alloc); in sctp_skb_set_owner_r()
407 sk_mem_charge(sk, event->rmem_len); in sctp_skb_set_owner_r()
418 return !list_empty(&chunk->list); in sctp_chunk_pending()
423 * the chunk length to indicate when to stop. Make sure
427 _sctp_walk_params((pos), (chunk), ntohs((chunk)->chunk_hdr.length))
431 (pos.v + offsetof(struct sctp_paramhdr, length) + sizeof(pos.p->length) <=\
433 pos.v <= (void *)chunk + end - ntohs(pos.p->length) &&\
434 ntohs(pos.p->length) >= sizeof(struct sctp_paramhdr);\
435 pos.v += SCTP_PAD4(ntohs(pos.p->length)))
438 _sctp_walk_errors((err), (chunk_hdr), ntohs((chunk_hdr)->length))
443 ((void *)err + offsetof(struct sctp_errhdr, length) + sizeof(err->length) <=\
445 (void *)err <= (void *)chunk_hdr + end - ntohs(err->length) &&\
446 ntohs(err->length) >= sizeof(struct sctp_errhdr); \
447 err = (struct sctp_errhdr *)((void *)err + SCTP_PAD4(ntohs(err->length))))
450 _sctp_walk_fwdtsn((pos), (chunk), ntohs((chunk)->chunk_hdr->length) - sizeof(struct sctp_fwdtsn_chu…
453 for (pos = (void *)(chunk->subh.fwdtsn_hdr + 1);\
454 (void *)pos <= (void *)(chunk->subh.fwdtsn_hdr + 1) + end - sizeof(struct sctp_fwdtsn_skip);\
468 /* Convert from an IP version number to an Address Family symbol. */
481 /* Convert from an address parameter type to an address family. */
498 return (net_hash_mix(net) + lport) & (sctp_port_hashsize - 1); in sctp_phashfn()
504 return (net_hash_mix(net) + lport) & (sctp_ep_hashsize - 1); in sctp_ep_hashfn()
515 return sctp_sk(sk)->type == style; in __sctp_style()
523 return asoc->state == state; in __sctp_state()
531 return sk->sk_state == state; in __sctp_sstate()
534 /* Map v4-mapped v6 address back to v4 address */
537 addr->v4.sin_family = AF_INET; in sctp_v6_map_v4()
538 addr->v4.sin_port = addr->v6.sin6_port; in sctp_v6_map_v4()
539 addr->v4.sin_addr.s_addr = addr->v6.sin6_addr.s6_addr32[3]; in sctp_v6_map_v4()
542 /* Map v4 address to v4-mapped v6 address */
547 port = addr->v4.sin_port; in sctp_v4_map_v6()
548 addr->v6.sin6_addr.s6_addr32[3] = addr->v4.sin_addr.s_addr; in sctp_v4_map_v6()
549 addr->v6.sin6_port = port; in sctp_v4_map_v6()
550 addr->v6.sin6_family = AF_INET6; in sctp_v4_map_v6()
551 addr->v6.sin6_flowinfo = 0; in sctp_v4_map_v6()
552 addr->v6.sin6_scope_id = 0; in sctp_v4_map_v6()
553 addr->v6.sin6_addr.s6_addr32[0] = 0; in sctp_v4_map_v6()
554 addr->v6.sin6_addr.s6_addr32[1] = 0; in sctp_v4_map_v6()
555 addr->v6.sin6_addr.s6_addr32[2] = htonl(0x0000ffff); in sctp_v4_map_v6()
563 if (t->dst && !dst_check(t->dst, t->dst_cookie)) in sctp_transport_dst_check()
566 return t->dst; in sctp_transport_dst_check()
579 overhead += sp->pf->af->net_header_len; in __sctp_mtu_payload()
580 if (sp->udp_port && (!t || t->encap_port)) in __sctp_mtu_payload()
589 return mtu ? mtu - overhead : overhead; in __sctp_mtu_payload()
606 __u32 pmtu = sctp_dst_mtu(t->dst); in sctp_transport_pmtu_check()
608 if (t->pathmtu == pmtu) in sctp_transport_pmtu_check()
611 t->pathmtu = pmtu; in sctp_transport_pmtu_check()
623 return __sctp_mtu_payload(sctp_sk(t->asoc->base.sk), t, 0, 0) - in sctp_transport_pl_hlen()
629 if (t->probe_interval && (t->param_flags & SPP_PMTUD_ENABLE) && in sctp_transport_pl_reset()
630 (t->state == SCTP_ACTIVE || t->state == SCTP_UNKNOWN)) { in sctp_transport_pl_reset()
631 if (t->pl.state == SCTP_PL_DISABLED) { in sctp_transport_pl_reset()
632 t->pl.state = SCTP_PL_BASE; in sctp_transport_pl_reset()
633 t->pl.pmtu = SCTP_BASE_PLPMTU; in sctp_transport_pl_reset()
634 t->pl.probe_size = SCTP_BASE_PLPMTU; in sctp_transport_pl_reset()
638 if (t->pl.state != SCTP_PL_DISABLED) { in sctp_transport_pl_reset()
639 if (timer_delete(&t->probe_timer)) in sctp_transport_pl_reset()
641 t->pl.state = SCTP_PL_DISABLED; in sctp_transport_pl_reset()
648 if (t->pl.state == SCTP_PL_DISABLED) in sctp_transport_pl_update()
651 t->pl.state = SCTP_PL_BASE; in sctp_transport_pl_update()
652 t->pl.pmtu = SCTP_BASE_PLPMTU; in sctp_transport_pl_update()
653 t->pl.probe_size = SCTP_BASE_PLPMTU; in sctp_transport_pl_update()
659 return t->pl.state != SCTP_PL_DISABLED; in sctp_transport_pl_enabled()
664 return sock_flag(sk, SOCK_DEAD) || sk->sk_socket; in sctp_newsk_ready()
670 sctp_sk(sk)->nodelay = true; in sctp_sock_set_nodelay()