50#if defined(INET) || defined(INET6)
54#include <netinet6/ip6_var.h>
58#include <sys/unistd.h>
64SCTP6_ARE_ADDR_EQUAL(
struct sockaddr_in6 *a,
struct sockaddr_in6 *b)
66 struct sockaddr_in6 tmp_a, tmp_b;
68 memcpy(&tmp_a, a,
sizeof(
struct sockaddr_in6));
69 if (sa6_embedscope(&tmp_a,
MODULE_GLOBAL(ip6_use_defzone)) != 0) {
72 memcpy(&tmp_b, b,
sizeof(
struct sockaddr_in6));
73 if (sa6_embedscope(&tmp_b,
MODULE_GLOBAL(ip6_use_defzone)) != 0) {
76 return (IN6_ARE_ADDR_EQUAL(&tmp_a.sin6_addr, &tmp_b.sin6_addr));
148 struct sctp_vrflist *
bucket;
161 panic(
"No memory for VRF:%d", vrf_id);
166 memset(vrf, 0,
sizeof(
struct sctp_vrf));
179 panic(
"No memory for VRF:%d", vrf_id);
187 LIST_INSERT_HEAD(
bucket, vrf, next_vrf);
196 struct sctp_ifnlist *hash_ifn_head;
204 LIST_FOREACH(sctp_ifnp, hash_ifn_head, next_bucket) {
208 if (sctp_ifnp->
ifn_p && ifn && (sctp_ifnp->
ifn_p == ifn)) {
218 struct sctp_vrflist *
bucket;
222 LIST_FOREACH(liste,
bucket, next_vrf) {
239 LIST_REMOVE(vrf, next_vrf);
250 if (sctp_ifnp->
vrf) {
264 if (sctp_ifnp != NULL) {
274 if (sctp_ifap->
ifn_p) {
292 if (hold_addr_lock == 0) {
297 LIST_REMOVE(sctp_ifnp, next_bucket);
298 LIST_REMOVE(sctp_ifnp, next_ifn);
299 if (hold_addr_lock == 0) {
320 if (sctp_ifap == NULL) {
324 if (sctp_ifap->
ifn_p == NULL) {
350 const char *if_name,
uint32_t ifn_index)
362 if (sctp_ifap == NULL) {
366 if (sctp_ifap->
ifn_p == NULL) {
400 LIST_INSERT_HEAD(&sctp_ifnp->
ifalist, sctp_ifap, next_ifa);
401 sctp_ifap->
ifn_p = sctp_ifnp;
405 ifa_af = sctp_ifap->
address.
sa.sa_family;
435 LIST_REMOVE(sctp_ifap, next_ifa);
436 if (sctp_ifap->
ifn_p) {
439 switch (sctp_ifap->
address.
sa.sa_family) {
469 sctp_ifap->
ifn_p = NULL;
476 struct sockaddr *addr,
uint32_t ifa_flags,
480 struct sctp_ifn *sctp_ifnp, *new_sctp_ifnp;
481 struct sctp_ifa *sctp_ifap, *new_sctp_ifap;
482 struct sctp_ifalist *hash_addr_head;
483 struct sctp_ifnlist *hash_ifn_head;
492 sizeof(
struct sctp_ifn), SCTP_M_IFN);
493 if (new_sctp_ifnp == NULL) {
495 panic(
"No memory for IFN");
500 if (new_sctp_ifap == NULL) {
502 panic(
"No memory for IFA");
511 vrf = sctp_ifnp->
vrf;
524 if (sctp_ifnp == NULL) {
529 sctp_ifnp = new_sctp_ifnp;
530 new_sctp_ifnp = NULL;
531 memset(sctp_ifnp, 0,
sizeof(
struct sctp_ifn));
533 sctp_ifnp->
ifn_p = ifn;
536 sctp_ifnp->
vrf = vrf;
539 if (if_name != NULL) {
545 LIST_INIT(&sctp_ifnp->
ifalist);
546 LIST_INSERT_HEAD(hash_ifn_head, sctp_ifnp, next_bucket);
547 LIST_INSERT_HEAD(&vrf->
ifnlist, sctp_ifnp, next_ifn);
554 if ((sctp_ifap->
ifn_p) &&
567 sctp_ifap->ifn_p = sctp_ifnp;
568 atomic_add_int(&sctp_ifap->ifn_p->refcount, 1);
572 if (new_sctp_ifnp != NULL) {
578 if (sctp_ifap->
ifn_p) {
585 sctp_ifap->ifn_p->ifn_index, if_name,
591 goto exit_stage_left;
596 (
void *)sctp_ifnp, (
void *)sctp_ifap);
599 goto exit_stage_left;
602 sctp_ifap = new_sctp_ifap;
603 memset(sctp_ifap, 0,
sizeof(
struct sctp_ifa));
604 sctp_ifap->
ifn_p = sctp_ifnp;
605 atomic_add_int(&sctp_ifnp->
refcount, 1);
606 sctp_ifap->
vrf_id = vrf_id;
607 sctp_ifap->
ifa = ifa;
608 memcpy(&sctp_ifap->
address, addr, addr->sa_len);
610 sctp_ifap->
flags = ifa_flags;
612 switch (sctp_ifap->
address.
sa.sa_family) {
628 new_ifn_af = AF_INET;
636 struct sockaddr_in6 *sin6;
640 (IN6_IS_ADDR_LOOPBACK(&sin6->sin6_addr))) {
643 if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) {
648 new_ifn_af = AF_INET6;
663 LIST_INSERT_HEAD(hash_addr_head, sctp_ifap, next_bucket);
665 LIST_INSERT_HEAD(&sctp_ifnp->
ifalist, sctp_ifap, next_ifa);
673 if (new_sctp_ifnp != NULL) {
684 atomic_add_int(&sctp_ifap->
refcount, 1);
698 memset(wi, 0,
sizeof(*wi));
719 uint32_t ifn_index,
const char *if_name)
738 if (sctp_ifap->
ifn_p) {
759 ifn_index, ((if_name == NULL) ?
"NULL" : if_name));
777 LIST_REMOVE(sctp_ifap, next_bucket);
806 memset(wi, 0,
sizeof(*wi));
830 int ipv4_local_scope, ipv4_addr_legal;
833 int local_scope, site_scope, ipv6_addr_legal;
860 if ((loopback_scope == 0) &&
880 if (ipv4_addr_legal) {
886 if ((ipv4_local_scope == 0) &&
903 if (ipv6_addr_legal) {
904 struct sockaddr_in6 *sin6,
908 rsin6 = (
struct sockaddr_in6 *)to;
910 &sin6->sin6_addr) != 0) {
913 if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) {
914 if (local_scope == 0)
916 if (sin6->sin6_scope_id == 0) {
917 if (sa6_recoverscope(sin6) != 0)
921 if ((site_scope == 0) &&
922 (IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr))) {
925 if (SCTP6_ARE_ADDR_EQUAL(sin6, rsin6)) {
955 if (laddr->
ifa->
address.
sa.sa_family != to->sa_family) {
958 switch (to->sa_family) {
976 struct sockaddr_in6 *sin6, *rsin6;
979 rsin6 = (
struct sockaddr_in6 *)to;
980 if (SCTP6_ARE_ADDR_EQUAL(sin6, rsin6)) {
1008 struct sctppcbhead *ephead;
1014 if ((to == NULL) || (from == NULL)) {
1018 switch (to->sa_family) {
1021 if (from->sa_family == AF_INET) {
1031 if (from->sa_family == AF_INET6) {
1032 lport = ((
struct sockaddr_in6 *)to)->sin6_port;
1033 rport = ((
struct sockaddr_in6 *)from)->sin6_port;
1049 LIST_FOREACH(inp, ephead, sctp_hash) {
1055 if (lport != inp->sctp_lport) {
1059 switch (to->sa_family) {
1077 struct sockaddr_in6 *sin6;
1079 sin6 = (
struct sockaddr_in6 *)to;
1081 &sin6->sin6_addr) != 0) {
1102 if (laddr->
ifa == NULL) {
1114 if (from->sa_family == AF_INET) {
1128 if (from->sa_family == AF_INET6) {
1129 struct sockaddr_in6 *intf_addr6;
1130 struct sockaddr_in6 *sin6;
1132 sin6 = (
struct sockaddr_in6 *)
1136 if (SCTP6_ARE_ADDR_EQUAL(sin6,
1167 if (stcb->
rport != rport) {
1184 TAILQ_FOREACH(net, &stcb->
asoc.
nets, sctp_next) {
1185 if (net->
ro.
_l_addr.
sa.sa_family != from->sa_family) {
1189 switch (from->sa_family) {
1217 struct sockaddr_in6 *sin6, *rsin6;
1219 sin6 = (
struct sockaddr_in6 *)&net->
ro.
_l_addr;
1220 rsin6 = (
struct sockaddr_in6 *)from;
1221 if (SCTP6_ARE_ADDR_EQUAL(sin6,
1262 struct sctpasochead *head;
1269 switch (remote->sa_family) {
1272 rport = (((
struct sockaddr_in *)remote)->sin_port);
1277 rport = (((
struct sockaddr_in6 *)remote)->sin6_port);
1305 if ((stcb != NULL) && (locked_tcb == NULL)) {
1309 if ((locked_tcb != NULL) && (locked_tcb != stcb)) {
1312 atomic_subtract_int(&locked_tcb->
asoc.
refcnt, 1);
1328 if (stcb->
rport != rport) {
1342 TAILQ_FOREACH(net, &stcb->
asoc.
nets, sctp_next) {
1344 if (net == (TAILQ_NEXT(net, sctp_next))) {
1345 panic(
"Corrupt net list");
1349 remote->sa_family) {
1353 switch (remote->sa_family) {
1369 if (locked_tcb == NULL) {
1371 }
else if (locked_tcb != stcb) {
1375 atomic_subtract_int(&locked_tcb->
asoc.
refcnt, 1);
1388 struct sockaddr_in6 *sin6,
1391 sin6 = (
struct sockaddr_in6 *)&net->
ro.
_l_addr;
1392 rsin6 = (
struct sockaddr_in6 *)remote;
1393 if (SCTP6_ARE_ADDR_EQUAL(sin6,
1399 if (locked_tcb == NULL) {
1401 }
else if (locked_tcb != stcb) {
1405 atomic_subtract_int(&locked_tcb->
asoc.
refcnt, 1);
1428 LIST_FOREACH(stcb, head, sctp_tcbhash) {
1429 if (stcb->
rport != rport) {
1443 TAILQ_FOREACH(net, &stcb->
asoc.
nets, sctp_next) {
1445 if (net == (TAILQ_NEXT(net, sctp_next))) {
1446 panic(
"Corrupt net list");
1450 remote->sa_family) {
1454 switch (remote->sa_family) {
1470 if (locked_tcb == NULL) {
1472 }
else if (locked_tcb != stcb) {
1476 atomic_subtract_int(&locked_tcb->
asoc.
refcnt, 1);
1488 struct sockaddr_in6 *sin6,
1491 sin6 = (
struct sockaddr_in6 *)
1493 rsin6 = (
struct sockaddr_in6 *)remote;
1494 if (SCTP6_ARE_ADDR_EQUAL(sin6,
1500 if (locked_tcb == NULL) {
1502 }
else if (locked_tcb != stcb) {
1506 atomic_subtract_int(&locked_tcb->
asoc.
refcnt, 1);
1527 atomic_subtract_int(&locked_tcb->
asoc.
refcnt, 1);
1545 struct sctpasochead *head;
1560 LIST_FOREACH(stcb, head, sctp_tcbasocidhash) {
1606 struct sockaddr_in6 *sin6;
1607 struct sockaddr_in6 *intf_addr6;
1617 switch (nam->sa_family) {
1625 sin6 = (
struct sockaddr_in6 *)nam;
1636 LIST_FOREACH(inp, head, sctp_hash) {
1643 (inp->sctp_lport == lport)) {
1645 switch (nam->sa_family) {
1675 &sin6->sin6_addr) != 0) {
1696 switch (nam->sa_family) {
1707 if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) {
1720 LIST_FOREACH(inp, head, sctp_hash) {
1734 if (inp->sctp_lport != lport) {
1748 if (laddr->
ifa == NULL) {
1754 (
void *)laddr->
ifa);
1759 if (laddr->
ifa->
address.
sa.sa_family == nam->sa_family) {
1761 switch (nam->sa_family) {
1774 if (SCTP6_ARE_ADDR_EQUAL(sin6,
1792 struct sctppcbhead *head;
1798 LIST_FOREACH(t_inp, head, sctp_hash) {
1799 if (t_inp->sctp_lport != lport) {
1841 struct sctppcbhead *head;
1858 LIST_FOREACH_SAFE(tinp, head, sctp_hash, ninp) {
1859 if (tinp->sctp_lport !=
inp->sctp_lport) {
1872 LIST_REMOVE(tinp, sctp_hash);
1875 LIST_INSERT_HEAD(head, tinp, sctp_hash);
1880 LIST_REMOVE(
inp, sctp_hash);
1881 inp->sctp_flags &= ~SCTP_PCB_FLAGS_IN_TCPPOOL;
1883 LIST_INSERT_HEAD(head,
inp, sctp_hash);
1896 struct sctppcbhead *head;
1903 struct sockaddr_in6 *sin6;
1906 switch (nam->sa_family) {
1915 sin6 = (
struct sockaddr_in6 *)nam;
1916 lport = sin6->sin6_port;
1928 if (have_lock == 0) {
1945 if (inp == NULL && find_tcp_pool) {
1957 if (have_lock == 0) {
1977 if (find_tcp_pool) {
1978 if (inp_p != NULL) {
1991 if (inp_p != NULL) {
2004 if (inp_p != NULL) {
2022 struct sockaddr *dst)
2025#if defined(INET) || defined(INET6)
2034 struct sockaddr_in6 sin6;
2038 memset(&sin4, 0,
sizeof(sin4));
2044 memset(&sin6, 0,
sizeof(sin6));
2045 sin6.sin6_len =
sizeof(sin6);
2046 sin6.sin6_family = AF_INET6;
2053 while (phdr != NULL) {
2055#if defined(INET) || defined(INET6)
2077 (
struct sockaddr *)&sin4, netp, dst, NULL);
2095 memcpy(&sin6.sin6_addr, &p6->
addr,
sizeof(p6->
addr));
2098 (
struct sockaddr *)&sin6, netp, dst, NULL);
2121 struct sctpasochead *head;
2128 LIST_FOREACH(stcb, head, sctp_asocs) {
2146 if (stcb->
sctp_ep->sctp_lport != lport) {
2174 if (skip_src_check) {
2214 struct sockaddr *src,
struct sockaddr *dst,
2239 if (stcb == NULL &&
inp) {
2258 offset, sh, &
inp, netp, dst);
2259 if (inp_p != NULL) {
2274 struct sockaddr *dst,
struct sctphdr *sh,
2281 int zero_address = 0;
2286 struct sockaddr_in6 *sin6;
2289 memset(&remote_store, 0,
sizeof(remote_store));
2311 &p6_buf.
ph,
sizeof(p6_buf));
2317 sin6 = &remote_store.
sin6;
2318 sin6->sin6_family = AF_INET6;
2319 sin6->sin6_len =
sizeof(*sin6);
2321 memcpy(&sin6->sin6_addr, &p6->
addr,
sizeof(
struct in6_addr));
2322 if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr))
2338 &p4_buf.
ph,
sizeof(p4_buf));
2344 sin = &remote_store.
sin;
2367 &remote_store.
sa, netp,
2392 struct timeval time;
2400 SCTP_PRINTF(
"Out of SCTP-INPCB structures - no resources\n");
2406 memset(inp, 0,
sizeof(*inp));
2437 inp->
fibnum = so->so_fibnum;
2450 so->so_pcb = (caddr_t)inp;
2475 return (EOPNOTSUPP);
2490 SCTP_PRINTF(
"Out of SCTP-INPCB->hashinit - no resources\n");
2502 RW_RECURSE | RW_DUPOK);
2517#ifdef SCTP_TRACK_FREED_ASOCS
2519 LIST_INIT(&inp->sctp_asoc_free_list);
2595 m->default_flowlabel = 0;
2603#ifdef SCTP_LOG_CLOSING
2615 struct sctppcbhead *head;
2634#if defined(INET) && defined(INET6)
2658 lport = new_inp->sctp_lport = old_inp->sctp_lport;
2659 rport = stcb->
rport;
2661 LIST_REMOVE(stcb, sctp_tcbhash);
2662 LIST_REMOVE(stcb, sctp_tcblist);
2664 LIST_REMOVE(stcb, sctp_tcbasocidhash);
2669 LIST_INSERT_HEAD(head, new_inp, sctp_hash);
2671 new_inp->
sctp_flags &= ~SCTP_PCB_FLAGS_UNBOUND;
2681 struct sctpasochead *lhd;
2685 LIST_INSERT_HEAD(lhd, stcb, sctp_tcbasocidhash);
2688 TAILQ_FOREACH(net, &stcb->
asoc.
nets, sctp_next) {
2702 if (laddr == NULL) {
2712 memset(laddr, 0,
sizeof(*laddr));
2714 laddr->
ifa = oladdr->
ifa;
2756 TAILQ_FOREACH(net, &stcb->
asoc.
nets, sctp_next) {
2786 if (laddr == NULL) {
2792 memset(laddr, 0,
sizeof(*laddr));
2798 LIST_INSERT_HEAD(list, laddr, sctp_nxt_addr);
2811 LIST_REMOVE(laddr, sctp_nxt_addr);
2825 struct sctp_ifa *sctp_ifap,
struct thread *td)
2828 struct sctppcbhead *head;
2830 struct inpcb *ip_inp;
2831 int port_reuse_active = 0;
2837 KASSERT(td != NULL, (
"%s: null thread", __func__));
2862 switch (addr->sa_family) {
2874 if (addr->sa_len !=
sizeof(*sin)) {
2904 struct sockaddr_in6 *sin6;
2906 sin6 = (
struct sockaddr_in6 *)addr;
2907 if (addr->sa_len !=
sizeof(*sin6)) {
2912 lport = sin6->sin6_port;
2918 if ((error = prison_local_ip6(td->td_ucred, &sin6->sin6_addr,
2923 if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) {
2926 if (sa6_embedscope(sin6,
MODULE_GLOBAL(ip6_use_defzone)) != 0) {
2933 sin6->sin6_scope_id = 0;
2938 error = EAFNOSUPPORT;
2952 if (ntohs(lport) < IPPORT_RESERVED &&
2953 (error = priv_check(td, PRIV_NETINET_RESERVEDPORT)) != 0) {
2961 if (inp_tmp != NULL) {
2977 port_reuse_active = 1;
2978 goto continue_anyway;
2988 if (inp_tmp != NULL) {
3004 port_reuse_active = 1;
3005 goto continue_anyway;
3019 if ((port_reuse_active == 0) &&
3024 port_reuse_active = 1;
3040 if ((error = priv_check(td, PRIV_NETINET_RESERVEDPORT)) != 0) {
3057 count = last - first + 1;
3062 lport = htons(candidate);
3070 if (candidate == last)
3073 candidate = candidate + 1;
3139 memset(&store, 0,
sizeof(store));
3140 switch (addr->sa_family) {
3149 memcpy(&store.
sin6, addr,
sizeof(
struct sockaddr_in6));
3150 store.
sin6.sin6_port = 0;
3161 if (sctp_ifap != NULL) {
3172 error = EADDRNOTAVAIL;
3178 if (addr->sa_family == AF_INET6) {
3202 if (port_reuse_active) {
3210 LIST_INSERT_HEAD(head, inp, sctp_hash);
3212 (
void *)head, ntohs(lport), port_reuse_active);
3214 inp->sctp_lport = lport;
3218 (
"%s: inp %p is already bound", __func__, inp));
3226 struct sctp_ifa *sctp_ifap,
struct thread *td)
3250 if (it && (it->
vn != curvnet)) {
3254 if (it && (it->
inp ==
inp)) {
3280 if (it->
vn != curvnet) {
3294 it->
inp = LIST_NEXT(it->
inp, sctp_list);
3323 struct inpcb *ip_pcb;
3325 int being_refed = 0;
3330#ifdef SCTP_LOG_CLOSING
3343 (
"%s: inp %p still has socket", __func__, inp));
3345 (
"%s: double free of inp %p", __func__, inp));
3350 inp->
sctp_flags &= ~SCTP_PCB_FLAGS_WAKEINPUT;
3351 inp->
sctp_flags &= ~SCTP_PCB_FLAGS_WAKEOUTPUT;
3372 LIST_FOREACH_SAFE(asoc, &inp->
sctp_asoc_list, sctp_tcblist, nasoc) {
3413 (so && (so->so_rcv.sb_cc > 0))) {
3415 struct mbuf *op_err;
3471 struct mbuf *op_err;
3497#ifdef SCTP_LOG_CLOSING
3514 LIST_REMOVE(inp, sctp_hash);
3523 LIST_FOREACH_SAFE(asoc, &inp->
sctp_asoc_list, sctp_tcblist, nasoc) {
3542 struct mbuf *op_err;
3564#ifdef SCTP_LOG_CLOSING
3582#ifdef SCTP_LOG_CLOSING
3596 LIST_REMOVE(inp, sctp_list);
3601#ifdef SCTP_LOG_CLOSING
3617 so->so_rcv.sb_cc -= sq->
length;
3651 LIST_REMOVE(shared_key,
next);
3661 LIST_FOREACH_SAFE(laddr, &inp->
sctp_addr_list, sctp_nxt_addr, nladdr) {
3665#ifdef SCTP_TRACK_FREED_ASOCS
3667 LIST_FOREACH_SAFE(asoc, &inp->sctp_asoc_free_list, sctp_tcblist, nasoc) {
3668 LIST_REMOVE(asoc, sctp_tcblist);
3695 TAILQ_FOREACH(net, &stcb->
asoc.
nets, sctp_next) {
3758 switch (newaddr->sa_family) {
3791 struct sockaddr_in6 *sin6;
3793 sin6 = (
struct sockaddr_in6 *)newaddr;
3794 if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) {
3799 sin6->sin6_len =
sizeof(
struct sockaddr_in6);
3806 }
else if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) {
3819 }
else if (IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr)) {
3829 if (IN6_IS_ADDR_LOOPBACK(&sin6->sin6_addr) &&
3832 }
else if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr) &&
3835 }
else if (IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr) &&
3852 memset(net, 0,
sizeof(
struct sctp_nets));
3854 memcpy(&net->
ro.
_l_addr, newaddr, newaddr->sa_len);
3855 switch (newaddr->sa_family) {
3863 ((
struct sockaddr_in6 *)&net->
ro.
_l_addr)->sin6_port = stcb->
rport;
3879 if (addr_inscope == 0) {
3903 net->flowlabel = stcb->
asoc.default_flowlabel;
3924 if (newaddr->sa_family == AF_INET6) {
3925 struct sockaddr_in6 *sin6;
3927 sin6 = (
struct sockaddr_in6 *)&net->
ro.
_l_addr;
3929 sin6->sin6_scope_id = 0;
3961#if defined(INET) || defined(INET6)
3986 if (net->
mtu == 0) {
4003#if defined(INET) || defined(INET6)
4009 switch (newaddr->sa_family) {
4025#if defined(INET) || defined(INET6)
4037 if (newaddr->sa_family == AF_INET6) {
4038 struct sockaddr_in6 *sin6;
4040 sin6 = (
struct sockaddr_in6 *)&net->
ro.
_l_addr;
4041 (
void)sa6_recoverscope(sin6);
4057 ntohs(stcb->
rport) ^
4058 ntohs(stcb->
sctp_ep->sctp_lport);
4059 net->
flowtype = M_HASHTYPE_OPAQUE_HASH;
4063 netfirst = TAILQ_FIRST(&stcb->
asoc.
nets);
4066 TAILQ_INSERT_TAIL(&stcb->
asoc.
nets, net, sctp_next);
4067 }
else if (netfirst == NULL) {
4069 TAILQ_INSERT_HEAD(&stcb->
asoc.
nets, net, sctp_next);
4070 }
else if (netfirst->
ro.
ro_nh == NULL) {
4075 TAILQ_INSERT_HEAD(&stcb->
asoc.
nets, net, sctp_next);
4076 }
else if (net->
ro.
ro_nh->nh_ifp != netfirst->
ro.
ro_nh->nh_ifp) {
4081 TAILQ_INSERT_HEAD(&stcb->
asoc.
nets, net, sctp_next);
4092 netlook = TAILQ_NEXT(netfirst, sctp_next);
4093 if (netlook == NULL) {
4095 TAILQ_INSERT_TAIL(&stcb->
asoc.
nets, net, sctp_next);
4097 }
else if (netlook->
ro.
ro_nh == NULL) {
4099 TAILQ_INSERT_BEFORE(netfirst, net, sctp_next);
4102 TAILQ_INSERT_AFTER(&stcb->
asoc.
nets, netlook,
4108 }
while (netlook != NULL);
4121 net = TAILQ_FIRST(&stcb->
asoc.
nets);
4131 TAILQ_INSERT_HEAD(&stcb->
asoc.
nets,
4141 struct sctpasochead *head;
4163 LIST_INSERT_HEAD(head, stcb, sctp_tcbasocidhash);
4178 int initialize_auth_params)
4184 struct sctpasochead *head;
4202 if (firstaddr == NULL) {
4238 switch (firstaddr->sa_family) {
4242 ntohs(((
struct sockaddr_in *)firstaddr)->sin_port));
4248 ntohs(((
struct sockaddr_in6 *)firstaddr)->sin6_port));
4258 switch (firstaddr->sa_family) {
4283 struct sockaddr_in6 *sin6;
4285 sin6 = (
struct sockaddr_in6 *)firstaddr;
4286 if ((ntohs(sin6->sin6_port) == 0) ||
4287 IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr) ||
4288 IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr) ||
4295 rport = sin6->sin6_port;
4325 memset(stcb, 0,
sizeof(*stcb));
4330 stcb->
rport = rport;
4334 if ((err =
sctp_init_asoc(inp, stcb, override_tag, initial_tsn, vrf_id, o_streams))) {
4349 LIST_INSERT_HEAD(head, stcb, sctp_asocs);
4369 LIST_REMOVE(stcb, sctp_asocs);
4370 LIST_REMOVE(stcb, sctp_tcbasocidhash);
4390 LIST_INSERT_HEAD(head, stcb, sctp_tcbhash);
4404 int initialize_auth_params)
4411 initial_tsn, vrf_id, o_streams, port, p, initialize_auth_params);
4422 int initialize_auth_params)
4436 initial_tsn, vrf_id, o_streams, port, p, initialize_auth_params);
4455 TAILQ_REMOVE(&asoc->
nets, net, sctp_next);
4460 lnet = TAILQ_FIRST(&asoc->
nets);
4532 TAILQ_FOREACH_SAFE(net, &asoc->
nets, sctp_next, nnet) {
4533 if (net->
ro.
_l_addr.
sa.sa_family != remaddr->sa_family) {
4555 struct sctpvtaghead *chain;
4561 LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) {
4587 struct sctpvtaghead *chain;
4599 LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) {
4631 if (twait_block == NULL) {
4635 LIST_INSERT_HEAD(chain, twait_block, sctp_nxt_tagblock);
4646 TAILQ_FOREACH_SAFE(control, rh, next_instrm, ncontrol) {
4647 TAILQ_REMOVE(rh, control, next_instrm);
4651 if (control->
data) {
4653 control->
data = NULL;
4657 TAILQ_FOREACH_SAFE(chk, &control->
reasm, sctp_next, nchk) {
4658 TAILQ_REMOVE(&control->
reasm, chk, sctp_next);
4706#ifdef SCTP_LOG_CLOSING
4710#ifdef SCTP_LOG_CLOSING
4753#ifdef SCTP_LOG_CLOSING
4766 if (sq->
stcb == stcb) {
4832#ifdef SCTP_LOG_CLOSING
4838#ifdef SCTP_LOG_CLOSING
4874 inp->
sctp_flags &= ~SCTP_PCB_FLAGS_CONNECTED;
4877 SOCKBUF_LOCK(&so->so_rcv);
4878 so->so_state &= ~(SS_ISCONNECTING |
4879 SS_ISDISCONNECTING |
4882 so->so_state |= SS_ISDISCONNECTED;
4883 socantrcvmore_locked(so);
4913 LIST_REMOVE(stcb, sctp_tcbhash);
4916 LIST_REMOVE(stcb, sctp_tcbasocidhash);
4922 LIST_REMOVE(stcb, sctp_tcblist);
4928 LIST_REMOVE(stcb, sctp_asocs);
4972 TAILQ_FOREACH_SAFE(strrst, &asoc->
resetHead, next_resp, nstrrst) {
4973 TAILQ_REMOVE(&asoc->
resetHead, strrst, next_resp);
4989 TAILQ_FOREACH_SAFE(chk, &asoc->
free_chunks, sctp_next, nchk) {
5004 TAILQ_FOREACH_SAFE(chk, &asoc->
send_queue, sctp_next, nchk) {
5009 panic(
"No chunks on the queues for sid %u.", chk->
rec.
data.
sid);
5012 TAILQ_REMOVE(&asoc->
send_queue, chk, sctp_next);
5035 TAILQ_FOREACH_SAFE(chk, &asoc->
sent_queue, sctp_next, nchk) {
5041 panic(
"No chunks on the queues for sid %u.", chk->
rec.
data.
sid);
5045 TAILQ_REMOVE(&asoc->
sent_queue, chk, sctp_next);
5122 TAILQ_FOREACH_SAFE(net, &asoc->
nets, sctp_next, nnet) {
5125 panic(
"no net's left alloc'ed, or list points to itself");
5128 TAILQ_REMOVE(&asoc->
nets, net, sctp_next);
5145 if (aack->
data != NULL) {
5163 LIST_FOREACH_SAFE(shared_key, &asoc->
shared_keys,
next, nshared_key) {
5164 LIST_REMOVE(shared_key,
next);
5180#ifdef SCTP_TRACK_FREED_ASOCS
5186 LIST_INSERT_HEAD(&inp->sctp_asoc_free_list, stcb, sctp_tcblist);
5217#ifdef SCTP_LOG_CLOSING
5259 switch (destaddr->sa_family) {
5290 if (laddr->
ifa == NULL) {
5334 if (ifa->
address.
sa.sa_family == AF_INET6) {
5343 if (laddr->
ifa == ifa) {
5387 TAILQ_FOREACH(net, &stcb->
asoc.
nets, sctp_next) {
5451 TAILQ_FOREACH(net, &stcb->
asoc.
nets, sctp_next) {
5454 RO_NHFREE(&net->
ro);
5480 struct sctpladdr *list;
5489 if (ifa->
address.
sa.sa_family == AF_INET6) {
5497 LIST_FOREACH(laddr, list, sctp_nxt_addr) {
5498 if (laddr->
ifa == ifa) {
5538 if (laddr->
ifa == NULL)
5554#if defined(SCTP_MCORE_INPUT) && defined(SMP)
5555struct sctp_mcore_ctrl *sctp_mcore_workers = NULL;
5556int *sctp_cpuarry = NULL;
5559sctp_queue_to_mcore(
struct mbuf *m,
int off,
int cpu_to_use)
5562 struct sctp_mcore_queue *qent;
5563 struct sctp_mcore_ctrl *wkq;
5566 if (sctp_mcore_workers == NULL) {
5568 sctp_input_with_port(m, off, 0);
5572 (
sizeof(
struct sctp_mcore_queue)),
5576 sctp_input_with_port(m, off, 0);
5583 wkq = &sctp_mcore_workers[cpu_to_use];
5586 TAILQ_INSERT_TAIL(&wkq->que, qent,
next);
5587 if (wkq->running == 0) {
5592 wakeup(&wkq->running);
5597sctp_mcore_thread(
void *arg)
5600 struct sctp_mcore_ctrl *wkq;
5601 struct sctp_mcore_queue *qent;
5603 wkq = (
struct sctp_mcore_ctrl *)arg;
5610 msleep(&wkq->running,
5612 0,
"wait for pkt", 0);
5616 thread_lock(curthread);
5617 sched_bind(curthread, wkq->cpuid);
5618 thread_unlock(curthread);
5627 qent = TAILQ_FIRST(&wkq->que);
5629 TAILQ_REMOVE(&wkq->que, qent,
next);
5631 CURVNET_SET(qent->vn);
5637 sctp_input_with_port(m, off, 0);
5646 if (!TAILQ_EMPTY(&wkq->que)) {
5650 msleep(&wkq->running,
5652 0,
"wait for pkt", 0);
5657sctp_startup_mcore_threads(
void)
5664 if (sctp_mcore_workers != NULL) {
5670 SCTP_MALLOC(sctp_mcore_workers,
struct sctp_mcore_ctrl *,
5671 ((mp_maxid + 1) *
sizeof(
struct sctp_mcore_ctrl)),
5673 if (sctp_mcore_workers == NULL) {
5677 memset(sctp_mcore_workers, 0, ((mp_maxid + 1) *
5678 sizeof(
struct sctp_mcore_ctrl)));
5680 for (i = 0; i <= mp_maxid; i++) {
5681 TAILQ_INIT(&sctp_mcore_workers[i].que);
5684 sctp_mcore_workers[i].cpuid = i;
5686 if (sctp_cpuarry == NULL) {
5688 (mp_ncpus *
sizeof(
int)),
5692 sctp_cpuarry[i] = cpu;
5698 (void)kproc_create(sctp_mcore_thread,
5699 (
void *)&sctp_mcore_workers[cpu],
5700 &sctp_mcore_workers[cpu].thread_proc,
5724#if defined(SCTP_LOCAL_TRACE_BUF)
5727#if defined(SMP) && defined(SCTP_USE_PERCPU_STAT)
5729 ((mp_maxid + 1) *
sizeof(
struct sctpstat)),
5733#if defined(SMP) && defined(SCTP_USE_PERCPU_STAT)
5746 TUNABLE_INT_FETCH(
"net.inet.sctp.tcbhashsize", &
SCTP_BASE_SYSCTL(sctp_hashtblsize));
5747 TUNABLE_INT_FETCH(
"net.inet.sctp.pcbhashsize", &
SCTP_BASE_SYSCTL(sctp_pcbtblsize));
5748 TUNABLE_INT_FETCH(
"net.inet.sctp.chunkscale", &
SCTP_BASE_SYSCTL(sctp_chunkscale));
5806#ifdef SCTP_PACKET_LOGGING
5840#if defined(SCTP_MCORE_INPUT) && defined(SMP)
5841 sctp_startup_mcore_threads();
5858 struct sctp_vrflist *vrf_bucket;
5862 struct sctpvtaghead *chain;
5869 SCTP_PRINTF(
"%s: race condition on teardown.\n", __func__);
5889 SCTP_PRINTF(
"%s: Iterator running while we held the lock. Retry. "
5895 if (it->
vn != curvnet) {
5913 LIST_FOREACH_SAFE(wi, &
SCTP_BASE_INFO(addr_wq), sctp_nxt_addr, nwi) {
5914 LIST_REMOVE(wi, sctp_nxt_addr);
5929 LIST_FOREACH_SAFE(vrf, vrf_bucket, next_vrf, nvrf) {
5930 LIST_FOREACH_SAFE(ifn, &vrf->
ifnlist, next_ifn, nifn) {
5931 LIST_FOREACH_SAFE(ifa, &ifn->
ifalist, next_ifa, nifa) {
5933 LIST_REMOVE(ifa, next_bucket);
5934 LIST_REMOVE(ifa, next_ifa);
5938 LIST_REMOVE(ifn, next_bucket);
5939 LIST_REMOVE(ifn, next_ifn);
5944 LIST_REMOVE(vrf, next_vrf);
5958 if (!LIST_EMPTY(chain)) {
5959 prev_twait_block = NULL;
5960 LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) {
5961 if (prev_twait_block) {
5962 SCTP_FREE(prev_twait_block, SCTP_M_TIMW);
5964 prev_twait_block = twait_block;
5966 SCTP_FREE(prev_twait_block, SCTP_M_TIMW);
5971#ifdef SCTP_PACKET_LOGGING
5997#if defined(SMP) && defined(SCTP_USE_PERCPU_STAT)
6004 int offset,
int limit,
6005 struct sockaddr *src,
struct sockaddr *dst,
6006 struct sockaddr *altsa,
uint16_t port)
6020 struct sockaddr *sa;
6034 int got_random = 0, got_hmacs = 0, got_chklist = 0;
6039 uint8_t peer_supports_asconf_ack;
6040 uint8_t peer_supports_reconfig;
6042 uint8_t peer_supports_pktdrop;
6048 struct sockaddr_in6 sin6;
6053 memset(&sin, 0,
sizeof(sin));
6059 memset(&sin6, 0,
sizeof(sin6));
6060 sin6.sin6_family = AF_INET6;
6061 sin6.sin6_len =
sizeof(
struct sockaddr_in6);
6062 sin6.sin6_port = stcb->
rport;
6069 peer_supports_idata = 0;
6070 peer_supports_ecn = 0;
6071 peer_supports_prsctp = 0;
6072 peer_supports_auth = 0;
6073 peer_supports_asconf = 0;
6074 peer_supports_asconf_ack = 0;
6075 peer_supports_reconfig = 0;
6076 peer_supports_nrsack = 0;
6077 peer_supports_pktdrop = 0;
6078 TAILQ_FOREACH(net, &stcb->
asoc.
nets, sctp_next) {
6088 if ((stcb_tmp == NULL && inp == stcb->
sctp_ep) || inp == NULL) {
6091 switch (sa->sa_family) {
6114 if (net_tmp != NULL && stcb_tmp == stcb) {
6115 net_tmp->
dest_state &= ~SCTP_ADDR_NOT_IN_ASSOC;
6116 }
else if (stcb_tmp != stcb) {
6136 if (offset + plen > limit) {
6165 sa = (
struct sockaddr *)&sin;
6172 if ((stcb_tmp == NULL && inp == stcb->
sctp_ep) ||
6192 }
else if (stcb_tmp == stcb) {
6200 ~SCTP_ADDR_NOT_IN_ASSOC;
6209 struct mbuf *op_err;
6217 "%s:%d at %s", __FILE__, __LINE__, __func__);
6221 stcb_tmp, op_err,
false,
6251 memcpy((caddr_t)&sin6.sin6_addr, p6->
addr,
6253 if (IN6_IS_ADDR_MULTICAST(&sin6.sin6_addr)) {
6257 if (IN6_IS_ADDR_LINKLOCAL(&sin6.sin6_addr)) {
6264 sa = (
struct sockaddr *)&sin6;
6270 if (stcb_tmp == NULL &&
6271 (inp == stcb->
sctp_ep || inp == NULL)) {
6288 }
else if (stcb_tmp == stcb) {
6300 ~SCTP_ADDR_NOT_IN_ASSOC;
6309 struct mbuf *op_err;
6317 "%s:%d at %s", __FILE__, __LINE__, __func__);
6321 stcb_tmp, op_err,
false,
6337 peer_supports_ecn = 1;
6354 struct sockaddr *lsa = NULL;
6362 if (plen >
sizeof(lstore)) {
6381 SCTP_PRINTF(
"Sizeof setprim in init/init ack not %d but %d - ignored\n",
6387 lsa = (
struct sockaddr *)&sin;
6395 SCTP_PRINTF(
"Sizeof setprim (v6) in init/init ack not %d but %d - ignored\n",
6399 memcpy(sin6.sin6_addr.s6_addr,
6402 lsa = (
struct sockaddr *)&sin6;
6416 peer_supports_prsctp = 1;
6423 if (plen >
sizeof(local_store)) {
6433 for (i = 0; i < num_ent; i++) {
6436 peer_supports_asconf = 1;
6439 peer_supports_asconf_ack = 1;
6442 peer_supports_prsctp = 1;
6445 peer_supports_pktdrop = 1;
6448 peer_supports_nrsack = 1;
6451 peer_supports_reconfig = 1;
6454 peer_supports_auth = 1;
6457 peer_supports_idata = 1;
6465 if (plen >
sizeof(random_store))
6477 random_len = plen -
sizeof(*p_random);
6488 if (plen >
sizeof(hmacs_store))
6500 hmacs_len = plen -
sizeof(*hmacs);
6501 num_hmacs = hmacs_len /
sizeof(hmacs->hmac_ids[0]);
6510 for (i = 0; i < num_hmacs; i++) {
6512 ntohs(hmacs->hmac_ids[i]));
6519 if (plen >
sizeof(chunks_store))
6531 num_chunks = plen -
sizeof(*chunks);
6536 for (i = 0; i < num_chunks; i++) {
6557 if ((ptype & 0x8000) == 0x0000) {
6571 if (offset >= limit) {
6578 TAILQ_FOREACH_SAFE(net, &stcb->
asoc.
nets, sctp_next, nnet) {
6584 TAILQ_REMOVE(&stcb->
asoc.
nets, net, sctp_next);
6597 (peer_supports_ecn == 0)) {
6601 (peer_supports_prsctp == 0)) {
6605 ((peer_supports_auth == 0) ||
6606 (got_random == 0) || (got_hmacs == 0))) {
6610 ((peer_supports_asconf == 0) || (peer_supports_asconf_ack == 0) ||
6612 (saw_asconf == 0) || (saw_asconf_ack == 0))) {
6616 (peer_supports_reconfig == 0)) {
6620 (peer_supports_idata == 0)) {
6624 (peer_supports_nrsack == 0)) {
6628 (peer_supports_pktdrop == 0)) {
6632 if ((peer_supports_auth == 0) && (got_chklist == 1)) {
6636 if ((peer_supports_asconf == 1) && (peer_supports_auth == 0)) {
6639 }
else if ((peer_supports_asconf == 1) &&
6640 (peer_supports_auth == 1) &&
6641 ((saw_asconf == 0) || (saw_asconf_ack == 0))) {
6645 keylen =
sizeof(*p_random) + random_len +
sizeof(*hmacs) + hmacs_len;
6646 if (chunks != NULL) {
6647 keylen +=
sizeof(*chunks) + num_chunks;
6650 if (new_key != NULL) {
6652 if (p_random != NULL) {
6653 keylen =
sizeof(*p_random) + random_len;
6654 memcpy(new_key->
key, p_random, keylen);
6659 if (chunks != NULL) {
6660 memcpy(new_key->
key + keylen, chunks,
6661 sizeof(*chunks) + num_chunks);
6662 keylen +=
sizeof(*chunks) + num_chunks;
6665 if (hmacs != NULL) {
6666 memcpy(new_key->
key + keylen, hmacs,
6667 sizeof(*hmacs) + hmacs_len);
6687 if (net == NULL && sa)
6705 net = TAILQ_FIRST(&stcb->
asoc.
nets);
6722 struct sctpasochead *head;
6728 LIST_FOREACH(stcb, head, sctp_asocs) {
6743 if (stcb->
sctp_ep->sctp_lport != lport) {
6779 for (strmat = 0; strmat < asoc->
streamincnt; strmat++) {
6780 TAILQ_FOREACH_SAFE(control, &asoc->
strmin[strmat].
inqueue, next_instrm, ncontrol) {
6783 panic(
"Huh control: %p on_q: %d -- not ordered?",
6791 KASSERT(control->
length > 0, (
"control has zero length"));
6807 TAILQ_REMOVE(&asoc->
strmin[strmat].
inqueue, control, next_instrm);
6809 if (control->
data) {
6811 control->
data = NULL;
6815 TAILQ_FOREACH_SAFE(chk, &control->
reasm, sctp_next, nchk) {
6818 KASSERT(chk->
send_size > 0, (
"chunk has zero length"));
6830 TAILQ_REMOVE(&control->
reasm, chk, sctp_next);
6840 TAILQ_FOREACH_SAFE(control, &asoc->
strmin[strmat].
uno_inqueue, next_instrm, ncontrol) {
6843 panic(
"Huh control: %p on_q: %d -- not unordered?",
6851 KASSERT(control->
length > 0, (
"control has zero length"));
6869 if (control->
data) {
6871 control->
data = NULL;
6875 TAILQ_FOREACH_SAFE(chk, &control->
reasm, sctp_next, nchk) {
6878 KASSERT(chk->
send_size > 0, (
"chunk has zero length"));
6890 TAILQ_REMOVE(&control->
reasm, chk, sctp_next);
6964 VNET_ITERATOR_DECL(vnet_iter);
6965 VNET_LIST_RLOCK_NOSLEEP();
6966 VNET_FOREACH(vnet_iter) {
6967 CURVNET_SET(vnet_iter);
6994 VNET_LIST_RUNLOCK_NOSLEEP();
7025 SCTP_PRINTF(
"%s: abort on initialize being %d\n", __func__,
7035 memset(it, 0,
sizeof(*it));
7068 SCTP_PRINTF(
"%s: rollback on initialize being %d it=%p\n", __func__,
int prison_local_ip4(struct ucred *cred, struct in_addr *ia)
int prison_check_ip4(const struct ucred *cred, const struct in_addr *ia)
#define IN6P_AUTOFLOWLABEL
#define INP_LOCK_DESTROY(inp)
#define SCTP_PCB_FLAGS_INTERLEAVE_STRMS
#define SCTP_PCB_FLAGS_DONT_WAKE
#define SCTP_INITIATION_ACK
#define SCTP_PCB_FLAGS_BOUND_V6
#define SCTP_PCB_FLAGS_TCPTYPE
#define SCTP_PCB_FLAGS_SOCKET_ALLGONE
#define SCTP_FORWARD_CUM_TSN
#define SCTP_PCB_FLAGS_UDPTYPE
#define SCTP_PCB_FLAGS_PDAPIEVNT
#define SCTP_PCB_FLAGS_UNBOUND
#define SCTP_PCB_FLAGS_WAS_CONNECTED
#define SCTP_PCB_FLAGS_DONOT_HEARTBEAT
#define SCTP_PACKET_DROPPED
#define SCTP_MOBILITY_BASE
#define SCTP_PCB_FLAGS_IN_TCPPOOL
#define SCTP_PCB_FLAGS_SOCKET_GONE
#define SCTP_PCB_FLAGS_DO_ASCONF
#define SCTP_STREAM_RESET
#define SCTP_PCB_FLAGS_WAS_ABORTED
#define SCTP_PCB_FLAGS_CONNECTED
#define SCTP_AUTHENTICATION
#define SCTP_PCB_FLAGS_AUTO_ASCONF
#define SCTP_PCB_FLAGS_PORTREUSE
#define SCTP_FRAG_LEVEL_1
#define SCTP_CAUSE_USER_INITIATED_ABT
#define SCTP_MOBILITY_FASTHANDOFF
#define SCTP_FRAG_LEVEL_2
#define SCTP_NR_SELECTIVE_ACK
#define SCTP_PCB_FLAGS_CLOSE_IP
#define SCTP_PCB_FLAGS_MULTIPLE_ASCONFS
#define SCTP_PCB_FLAGS_BOUNDALL
#define SCTP_FRAG_LEVEL_0
#define SCTP_MOBILITY_PRIM_DELETED
#define SCTP_PCB_FLAGS_DO_NOT_PMTUD
#define SCTP_PCB_FLAGS_FRAG_INTERLEAVE
int sctp_is_addr_pending(struct sctp_tcb *stcb, struct sctp_ifa *sctp_ifa)
int sctp_auth_add_hmacid(sctp_hmaclist_t *list, uint16_t hmac_id)
void sctp_free_key(sctp_key_t *key)
void sctp_clear_chunklist(sctp_auth_chklist_t *chklist)
void sctp_free_chunklist(sctp_auth_chklist_t *list)
void sctp_free_hmaclist(sctp_hmaclist_t *list)
sctp_sharedkey_t * sctp_alloc_sharedkey(void)
int sctp_auth_add_chunk(uint8_t chunk, sctp_auth_chklist_t *list)
int sctp_verify_hmac_param(struct sctp_auth_hmac_algo *hmacs, uint32_t num_hmacs)
void sctp_free_sharedkey(sctp_sharedkey_t *skey)
void sctp_initialize_auth_params(struct sctp_inpcb *inp, struct sctp_tcb *stcb)
void sctp_free_authinfo(sctp_authinfo_t *authinfo)
sctp_auth_chklist_t * sctp_alloc_chunklist(void)
int sctp_insert_sharedkey(struct sctp_keyhead *shared_keys, sctp_sharedkey_t *new_skey)
sctp_key_t * sctp_alloc_key(uint32_t keylen)
void sctp_auth_key_release(struct sctp_tcb *stcb, uint16_t key_id, int so_locked)
sctp_hmaclist_t * sctp_alloc_hmaclist(uint16_t num_hmacs)
sctp_hmaclist_t * sctp_default_supported_hmaclist(void)
void sctp_clear_cachedkeys(struct sctp_tcb *stcb, uint16_t keyid)
#define SCTP_AUTH_RANDOM_SIZE_REQUIRED
void sctp_startup_iterator(void)
void sctp_wakeup_iterator(void)
struct iterator_control sctp_it_ctl
void sctp_init_vrf_list(int vrfid)
#define IN4_ISPRIVATE_ADDRESS(a)
#define SCTP_DIAG_INFO_LEN
#define SCTP_PARAM_BUFFER_SIZE
#define SCTP_SUPPORTED_CHUNK_EXT
#define SCTP_CALLED_AFTER_CMPSET_OFCLOSE
#define SCTP_STATE_COOKIE_ECHOED
#define SCTP_ADD_IP_ADDRESS
#define SCTP_DATAGRAM_NR_ACKED
#define SCTP_HAS_NAT_SUPPORT
#define SCTP_PRSCTP_SUPPORTED
#define SCTP_TIMER_MAXSHUTDOWN
#define SCTP_STACK_VTAG_HASH_SIZE
#define SCTP_OUTPUT_FROM_DRAIN
#define SCTP_ADDR_REQ_PRIMARY
#define SCTP_PCBFREE_FORCE
#define SCTP_ULP_ADAPTATION
#define SCTP_ADD_SUBSTATE(_stcb, _substate)
#define SCTP_TSN_GT(a, b)
#define SCTP_TIMER_SIGNATURE
#define SCTP_TIMER_TYPE_ASOCKILL
#define SCTP_SUCCESS_REPORT
#define SCTP_SO_NOT_LOCKED
#define SCTP_NUMBER_OF_SECRETS
#define SCTP_PCBFREE_NOFORCE
#define SCTP_TIMER_TYPE_HEARTBEAT
#define SCTP_DEL_IP_ADDRESS
#define SCTP_DEBUG_INPUT3
#define SCTP_STATE_COOKIE
#define SCTP_SIGNATURE_SIZE
#define sctp_sorwakeup(inp, so)
#define SCTP_CALC_TSN_TO_GAP(gap, tsn, mapping_tsn)
#define SCTP_NOTIFY_UNSENT_DG_FAIL
#define SCTP_ADDR_NO_PMTUD
#define IN4_ISLOOPBACK_ADDRESS(a)
#define SCTP_STATE_IN_ACCEPT_QUEUE
#define SCTP_SWS_RECEIVER_DEF
#define SCTP_STATE_SHUTDOWN_PENDING
#define SCTP_CALLED_DIRECTLY_NOCMPSET
#define SCTP_ADDR_NOT_IN_ASSOC
#define SCTP_TIMER_TYPE_PRIM_DELETED
#define SCTP_ADDR_UNCONFIRMED
#define SCTP_SWS_SENDER_DEF
#define SCTP_FROM_SCTP_PCB
#define SCTP_TIMER_TYPE_RECV
#define SCTP_CLEAR_SUBSTATE(_stcb, _substate)
#define SCTP_DONOT_SETSCOPE
#define SCTP_OUTPUT_FROM_SHUT_TMR
#define SCTP_NOTIFY_SENT_DG_FAIL
#define SCTP_TSN_GE(a, b)
#define SCTP_STATE_SHUTDOWN_ACK_SENT
#define SCTP_TIMER_TYPE_SHUTDOWNGUARD
#define SCTP_GET_STATE(_stcb)
#define SCTP_ADDR_IS_CONFIRMED
#define SCTP_GETTIME_TIMEVAL(x)
#define SCTP_STATE_CLOSED_SOCKET
#define SCTP_NOTIFY_PARTIAL_DELVIERY_INDICATION
#define SCTP_TIMER_TYPE_PATHMTURAISE
#define SCTP_COOKIE_PRESERVE
#define SCTP_NOTIFY_SPECIAL_SP_FAIL
#define SCTP_IPV4_ADDRESS
#define SCTP_STATE_COOKIE_WAIT
#define SCTP_PARTIAL_DELIVERY_SHIFT
#define SCTP_TIMER_TYPE_SHUTDOWN
#define SCTP_DEBUG_ASCONF1
#define SCTP_ADDR_OUT_OF_SCOPE
#define SCTP_MAX_NUM_OF_ASOC
#define SCTP_STATE_SHUTDOWN_SENT
#define SCTP_STATE_SHUTDOWN_RECEIVED
#define SCTP_SET_PRIM_ADDR
#define SCTP_FREE_SHOULD_USE_GRACEFUL_CLOSE
#define SCTP_STATE_ABOUT_TO_BE_FREED
#define SCTP_IPV6_ADDRESS
#define SCTP_ADDR_REACHABLE
#define sctp_sowwakeup(inp, so)
#define SCTP_UNSET_TSN_PRESENT(arry, gap)
#define SCTP_SET_STATE(_stcb, _state)
#define SCTP_TIMER_TYPE_INPKILL
#define SCTP_ERROR_CAUSE_IND
#define SCTP_ADDR_BEING_DELETED
#define SCTP_NUMBER_IN_VTAG_BLOCK
#define SCTP_TIMER_HEARTBEAT
#define SCTP_SUPPORTED_ADDRTYPE
#define SCTP_OUTPUT_FROM_CLOSING
#define SCTP_HEARTBEAT_INFO
#define SCTP_SCALE_FOR_ADDR
#define SCTP_ADDR_NOT_LOCKED
#define SCTP_TIMER_TYPE_NEWCOOKIE
#define SCTP_IS_TSN_PRESENT(arry, gap)
#define SCTP_UNRECOG_PARAM
#define SCTP_STATE_PARTIAL_MSG_LEFT
#define SCTP_TIMER_TYPE_ADDR_WQ
#define SCTP_KTHREAD_PAGES
#define SCTP_TCB_LOCK(_tcb)
#define SCTP_ITERATOR_UNLOCK()
#define SCTP_IPI_ADDR_WUNLOCK()
#define SCTP_INP_INFO_WLOCK()
#define SCTP_INCR_ASOC_COUNT()
#define SCTP_IPI_COUNT_INIT()
#define SCTP_IPI_ADDR_RLOCK()
#define SCTP_STATLOG_DESTROY()
#define SCTP_IPI_ITERATOR_WQ_LOCK()
#define SCTP_INP_RLOCK(_inp)
#define SCTP_INP_INFO_RLOCK()
#define SCTP_ASOC_CREATE_UNLOCK(_inp)
#define SCTP_INP_WLOCK_ASSERT(_inp)
#define SCTP_MCORE_QLOCK(cpstr)
#define SCTP_STATLOG_INIT_LOCK()
#define SCTP_INP_READ_UNLOCK(_inp)
#define SCTP_IPI_ITERATOR_WQ_UNLOCK()
#define SCTP_DECR_LADDR_COUNT()
#define SCTP_IPI_ADDR_WLOCK()
#define SCTP_IPI_ADDR_RUNLOCK()
#define SCTP_MCORE_QLOCK_INIT(cpstr)
#define SCTP_TCB_SEND_LOCK_DESTROY(_tcb)
#define SCTP_INP_LOCK_DESTROY(_inp)
#define SCTP_INP_INFO_LOCK_INIT()
#define SCTP_IPI_ADDR_INIT()
#define SCTP_INCR_LADDR_COUNT()
#define SCTP_TCB_LOCK_DESTROY(_tcb)
#define SCTP_INP_WUNLOCK(_inp)
#define SCTP_WQ_ADDR_LOCK()
#define SCTP_ASOC_CREATE_LOCK_DESTROY(_inp)
#define SCTP_DECR_ASOC_COUNT()
#define SCTP_TCB_SEND_UNLOCK(_tcb)
#define SCTP_IPI_ADDR_LOCK_ASSERT()
#define SCTP_INP_DECR_REF(_inp)
#define SCTP_TCB_LOCK_INIT(_tcb)
#define SCTP_INCR_RADDR_COUNT()
#define SCTP_INP_READ_CONTENDED(_inp)
#define SCTP_WQ_ADDR_INIT()
#define SCTP_IPI_ADDR_WLOCK_ASSERT()
#define SCTP_IP_PKTLOG_DESTROY()
#define SCTP_MCORE_UNLOCK(cpstr)
#define SCTP_INP_INFO_LOCK_ASSERT()
#define SCTP_ITERATOR_LOCK()
#define SCTP_INP_INFO_RUNLOCK()
#define SCTP_INP_LOCK_CONTENDED(_inp)
#define SCTP_MCORE_LOCK(cpstr)
#define SCTP_INP_INFO_LOCK_DESTROY()
#define SCTP_INP_LOCK_INIT(_inp)
#define SCTP_INP_WLOCK(_inp)
#define SCTP_WQ_ADDR_DESTROY()
#define SCTP_TCB_SEND_LOCK_INIT(_tcb)
#define SCTP_DECR_CHK_COUNT()
#define SCTP_DECR_EP_COUNT()
#define SCTP_INCR_EP_COUNT()
#define SCTP_INP_INCR_REF(_inp)
#define SCTP_MCORE_QUNLOCK(cpstr)
#define SCTP_WQ_ADDR_UNLOCK()
#define SCTP_TCB_UNLOCK(_tcb)
#define SCTP_ASOC_CREATE_LOCK_INIT(_inp)
#define SCTP_INP_READ_DESTROY(_inp)
#define SCTP_INP_INFO_WLOCK_ASSERT()
#define SCTP_ASOC_CREATE_LOCK(_inp)
#define SCTP_INP_INFO_WUNLOCK()
#define SCTP_MCORE_LOCK_INIT(cpstr)
#define SCTP_INP_READ_INIT(_inp)
#define SCTP_TCB_SEND_LOCK(_tcb)
#define SCTP_IP_PKTLOG_INIT()
#define SCTP_INP_READ_LOCK(_inp)
#define SCTP_ASOC_CREATE_LOCK_CONTENDED(_inp)
#define SCTP_INP_RUNLOCK(_inp)
#define SCTP_IPI_ADDR_DESTROY()
#define SCTP_SOWAKEUP(so)
#define SCTP_OS_TIMER_STOP_DRAIN
#define SCTP_LTRACE_ERR_RET(inp, stcb, net, file, err)
#define SCTP_ZONE_GET(zone, type)
#define SCTP_IFN_IS_IFT_LOOP(ifn)
#define SCTP_INIT_VRF_TABLEID(vrf)
#define MODULE_GLOBAL(__SYMBOL)
#define SCTP_SNPRINTF(...)
struct route sctp_route_t
#define SCTP_GATHER_MTU_FROM_IFN_INFO(ifn, ifn_index)
#define SCTP_READ_RANDOM(buf, len)
#define SCTP_MALLOC(var, type, size, name)
#define SCTP_BASE_INFO(__m)
#define SCTP_DECREMENT_AND_CHECK_REFCOUNT(addr)
#define SCTP_IPV6_V6ONLY(sctp_inpcb)
#define SCTP_PRINTF(params...)
#define SCTP_HASH_INIT(size, hashmark)
#define SCTP_VRF_IFN_HASH_SIZE
#define SCTP_BASE_VAR(__m)
#define SCTP_RTALLOC(ro, vrf_id, fibnum)
#define SCTP_VRF_ADDR_HASH_SIZE
#define SCTP_ZONE_INIT(zone, name, size, number)
#define SCTP_GATHER_MTU_FROM_ROUTE(sctp_ifa, sa, nh)
#define SCTP_FREE(var, type)
#define SCTP_DEFAULT_VRFID
#define SCTP_SIZE_OF_VRF_HASH
#define SCTPDBG(level, params...)
#define SCTP_ZONE_FREE(zone, element)
#define SCTP_IS_LISTENING(inp)
#define SCTP_BASE_SYSCTL(__m)
#define SCTP_CLEAR_SO_NBIO(so)
#define SCTP_BASE_STAT(__m)
#define SCTP_ROUTE_HAS_VALID_IFN(ro)
#define SCTPDBG_ADDR(level, addr)
#define SCTP_SB_LIMIT_RCV(so)
#define SCTP_HASH_FREE(table, hashmark)
#define SCTP_ZONE_DESTROY(zone)
#define SCTP_OS_TIMER_INIT(tmr)
int sctp_is_addr_restricted(struct sctp_tcb *stcb, struct sctp_ifa *ifa)
struct sctp_ifa * sctp_source_address_selection(struct sctp_inpcb *inp, struct sctp_tcb *stcb, sctp_route_t *ro, struct sctp_nets *net, int non_asoc_addr_ok, uint32_t vrf_id)
void sctp_send_sack(struct sctp_tcb *stcb, int so_locked)
void sctp_send_abort_tcb(struct sctp_tcb *stcb, struct mbuf *operr, int so_locked)
void sctp_send_shutdown(struct sctp_tcb *stcb, struct sctp_nets *net)
void sctp_chunk_output(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int from_where, int so_locked)
int sctp_inpcb_alloc(struct socket *so, uint32_t vrf_id)
static void sctp_select_primary_destination(struct sctp_tcb *stcb)
void sctp_add_local_addr_ep(struct sctp_inpcb *inp, struct sctp_ifa *ifa, uint32_t action)
static int sctp_scale_up_for_address
static void sctp_remove_ifa_from_ifn(struct sctp_ifa *sctp_ifap)
int sctp_is_address_on_local_host(struct sockaddr *addr, uint32_t vrf_id)
struct sctp_tcb * sctp_findasoc_ep_asocid_locked(struct sctp_inpcb *inp, sctp_assoc_t asoc_id, int want_lock)
static int sctp_does_stcb_own_this_addr(struct sctp_tcb *stcb, struct sockaddr *to)
void sctp_pcb_finish(void)
static struct sctp_tcb * sctp_aloc_assoc_locked(struct sctp_inpcb *inp, struct sockaddr *firstaddr, int *error, uint32_t override_tag, uint32_t initial_tsn, uint32_t vrf_id, uint16_t o_streams, uint16_t port, struct thread *p, int initialize_auth_params)
struct sctp_tcb * sctp_aloc_assoc_connected(struct sctp_inpcb *inp, struct sockaddr *firstaddr, int *error, uint32_t override_tag, uint32_t initial_tsn, uint32_t vrf_id, uint16_t o_streams, uint16_t port, struct thread *p, int initialize_auth_params)
int sctp_del_remote_addr(struct sctp_tcb *stcb, struct sockaddr *remaddr)
void sctp_mark_ifa_addr_down(uint32_t vrf_id, struct sockaddr *addr, const char *if_name, uint32_t ifn_index)
static int sctp_max_number_of_assoc
struct sctp_ifa * sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint32_t ifn_index, uint32_t ifn_type, const char *if_name, void *ifa, struct sockaddr *addr, uint32_t ifa_flags, int dynamic_add)
struct sctp_tcb * sctp_findassociation_ep_asconf(struct mbuf *m, int offset, struct sockaddr *dst, struct sctphdr *sh, struct sctp_inpcb **inp_p, struct sctp_nets **netp, uint32_t vrf_id)
void sctp_del_local_addr_ep(struct sctp_inpcb *inp, struct sctp_ifa *ifa)
static int sctp_insert_laddr(struct sctpladdr *list, struct sctp_ifa *ifa, uint32_t act)
static bool sctp_is_in_timewait(uint32_t tag, uint16_t lport, uint16_t rport, uint32_t now)
static void sctp_set_vtag_block(struct sctp_timewait *vtag_block, uint32_t time, uint32_t tag, uint16_t lport, uint16_t rport)
void sctp_del_local_addr_restricted(struct sctp_tcb *stcb, struct sctp_ifa *ifa)
void sctp_free_ifa(struct sctp_ifa *sctp_ifap)
struct sctp_vrf * sctp_allocate_vrf(int vrf_id)
static void sctp_add_ifa_to_ifn(struct sctp_ifn *sctp_ifnp, struct sctp_ifa *sctp_ifap)
static struct sctp_tcb * sctp_tcb_special_locate(struct sctp_inpcb **inp_p, struct sockaddr *from, struct sockaddr *to, struct sctp_nets **netp, uint32_t vrf_id)
static uint32_t sctp_aloc_a_assoc_id(struct sctp_inpcb *inp, struct sctp_tcb *stcb)
int sctp_destination_is_reachable(struct sctp_tcb *stcb, struct sockaddr *destaddr)
static void sctp_delete_ifn(struct sctp_ifn *sctp_ifnp, int hold_addr_lock)
void sctp_mark_ifa_addr_up(uint32_t vrf_id, struct sockaddr *addr, const char *if_name, uint32_t ifn_index)
void sctp_fill_pcbinfo(struct sctp_pcbinfo *spcb)
int sctp_inpcb_bind_locked(struct sctp_inpcb *inp, struct sockaddr *addr, struct sctp_ifa *sctp_ifap, struct thread *td)
struct sctp_tcb * sctp_findassociation_addr_sa(struct sockaddr *from, struct sockaddr *to, struct sctp_inpcb **inp_p, struct sctp_nets **netp, int find_tcp_pool, uint32_t vrf_id)
static void sctp_iterator_inp_being_freed(struct sctp_inpcb *inp)
static void sctp_add_vtag_to_timewait(uint32_t tag, uint16_t lport, uint16_t rport)
static struct sctp_tcb * sctp_findassociation_special_addr(struct mbuf *m, int offset, struct sctphdr *sh, struct sctp_inpcb **inp_p, struct sctp_nets **netp, struct sockaddr *dst)
void sctp_free_ifn(struct sctp_ifn *sctp_ifnp)
int sctp_inpcb_bind(struct socket *so, struct sockaddr *addr, struct sctp_ifa *sctp_ifap, struct thread *td)
static struct sctp_inpcb * sctp_isport_inuse(struct sctp_inpcb *inp, uint16_t lport, uint32_t vrf_id)
struct sctp_inpcb * sctp_pcb_findep(struct sockaddr *nam, int find_tcp_pool, int have_lock, uint32_t vrf_id)
struct sctp_tcb * sctp_findassociation_ep_asocid(struct sctp_inpcb *inp, sctp_assoc_t asoc_id, int want_lock)
int sctp_swap_inpcb_for_listen(struct sctp_inpcb *inp)
static void sctp_remove_laddr(struct sctp_laddr *laddr)
struct sctp_tcb * sctp_findassociation_addr(struct mbuf *m, int offset, struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_chunkhdr *ch, struct sctp_inpcb **inp_p, struct sctp_nets **netp, uint32_t vrf_id)
void sctp_remove_net(struct sctp_tcb *stcb, struct sctp_nets *net)
void sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, int from)
struct sctp_tcb * sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockaddr *firstaddr, int *error, uint32_t override_tag, uint32_t initial_tsn, uint32_t vrf_id, uint16_t o_streams, uint16_t port, struct thread *p, int initialize_auth_params)
int sctp_add_remote_addr(struct sctp_tcb *stcb, struct sockaddr *newaddr, struct sctp_nets **netp, uint16_t port, int set_scope, int from)
static void sctp_update_ep_vflag(struct sctp_inpcb *inp)
struct sctp_ifn * sctp_find_ifn(void *ifn, uint32_t ifn_index)
void sctp_clean_up_stream(struct sctp_tcb *stcb, struct sctp_readhead *rh)
int sctp_initiate_iterator(inp_func inpf, asoc_func af, inp_func inpe, uint32_t pcb_state, uint32_t pcb_features, uint32_t asoc_state, void *argp, uint32_t argi, end_func ef, struct sctp_inpcb *s_inp, uint8_t chunk_output_off)
struct sctp_nets * sctp_findnet(struct sctp_tcb *stcb, struct sockaddr *addr)
int sctp_load_addresses_from_init(struct sctp_tcb *stcb, struct mbuf *m, int offset, int limit, struct sockaddr *src, struct sockaddr *dst, struct sockaddr *altsa, uint16_t port)
bool sctp_is_vtag_good(uint32_t tag, uint16_t lport, uint16_t rport, struct timeval *now)
static void sctp_drain_mbufs(struct sctp_tcb *stcb)
int sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int from_inpcbfree, int from_location)
struct sctp_tcb * sctp_findassociation_ep_addr(struct sctp_inpcb **inp_p, struct sockaddr *remote, struct sctp_nets **netp, struct sockaddr *local, struct sctp_tcb *locked_tcb)
void sctp_add_local_addr_restricted(struct sctp_tcb *stcb, struct sctp_ifa *ifa)
void sctp_update_ifn_mtu(uint32_t ifn_index, uint32_t mtu)
void sctp_free_vrf(struct sctp_vrf *vrf)
static struct sctp_inpcb * sctp_endpoint_probe(struct sockaddr *nam, struct sctppcbhead *head, uint16_t lport, uint32_t vrf_id)
int sctp_set_primary_addr(struct sctp_tcb *stcb, struct sockaddr *sa, struct sctp_nets *net)
static struct sctp_tcb * sctp_findassoc_by_vtag(struct sockaddr *from, struct sockaddr *to, uint32_t vtag, struct sctp_inpcb **inp_p, struct sctp_nets **netp, uint16_t rport, uint16_t lport, int skip_src_check, uint32_t vrf_id, uint32_t remote_tag)
void sctp_del_addr_from_vrf(uint32_t vrf_id, struct sockaddr *addr, uint32_t ifn_index, const char *if_name)
void sctp_move_pcb_and_assoc(struct sctp_inpcb *old_inp, struct sctp_inpcb *new_inp, struct sctp_tcb *stcb)
struct sctp_vrf * sctp_find_vrf(uint32_t vrf_id)
#define SCTP_INITIALIZE_AUTH_PARAMS
#define SCTP_ADDR_DEFER_USE
#define SCTP_ADDR_IFA_UNUSEABLE
#define SCTP_PCBHASH_ALLADDR(port, mask)
#define SCTP_PCBHASH_ASOC(tag, mask)
#define SCTP_BEING_DELETED
void(* asoc_func)(struct sctp_inpcb *, struct sctp_tcb *, void *ptr, uint32_t val)
#define SCTP_ON_UNORDERED
#define SCTP_ITERATOR_STOP_CUR_INP
#define SCTP_ITERATOR_DO_SINGLE_INP
int(* inp_func)(struct sctp_inpcb *, void *ptr, uint32_t val)
#define SCTP_ITERATOR_STOP_CUR_IT
#define SCTP_ITERATOR_DO_ALL_INP
void(* end_func)(void *ptr, uint32_t val)
struct sctp_nets * sctp_find_alternate_net(struct sctp_tcb *stcb, struct sctp_nets *net, int mode)
#define SCTP_PARTIAL_DELIVERY_ABORTED
#define SCTP_STAT_INCR_COUNTER32(_x)
#define SCTP_STAT_INCR(_x)
#define SCTP_STAT_DECR_GAUGE32(_x)
void sctp_pathmtu_adjustment(struct sctp_tcb *stcb, uint32_t mtu, bool resend)
#define sctp_mobility_feature_off(inp, feature)
#define sctp_free_a_chunk(_stcb, _chk, _so_locked)
#define sctp_feature_on(inp, feature)
#define sctp_free_a_strmoq(_stcb, _strmoq, _so_locked)
#define sctp_is_feature_on(inp, feature)
#define sctp_is_feature_off(inp, feature)
#define sctp_feature_off(inp, feature)
#define sctp_free_a_readq(_stcb, _readq)
#define sctp_is_mobility_feature_on(inp, feature)
#define sctp_free_remote_addr(__net)
#define sctp_stcb_is_feature_on(inp, stcb, feature)
#define sctp_mobility_feature_on(inp, feature)
#define sctp_ucount_decr(val)
void sctp_timer_stop(int t_type, struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net, uint32_t from)
uint32_t sctp_hc_get_mtu(union sctp_sockstore *addr, uint16_t fibnum)
void sctp_timer_start(int t_type, struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net)
void sctp_stop_association_timers(struct sctp_tcb *stcb, bool stop_assoc_kill_timer)
struct sctp_paramhdr * sctp_get_next_param(struct mbuf *m, int offset, struct sctp_paramhdr *pull, int pull_limit)
struct mbuf * sctp_generate_cause(uint16_t code, char *info)
void sctp_ulp_notify(uint32_t notification, struct sctp_tcb *stcb, uint32_t error, void *data, int so_locked)
int sctp_init_asoc(struct sctp_inpcb *inp, struct sctp_tcb *stcb, uint32_t override_tag, uint32_t initial_tsn, uint32_t vrf_id, uint16_t o_strms)
void sctp_fill_random_store(struct sctp_pcb *m)
uint32_t sctp_min_mtu(uint32_t mtu1, uint32_t mtu2, uint32_t mtu3)
struct sctp_ifa * sctp_find_ifa_by_addr(struct sockaddr *addr, uint32_t vrf_id, int holds_lock)
void sctp_abort_an_association(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct mbuf *op_err, bool timedout, int so_locked)
uint32_t sctp_select_initial_TSN(struct sctp_pcb *inp)
uint32_t sctp_get_ifa_hash_val(struct sockaddr *addr)
int sctp_cmpaddr(struct sockaddr *sa1, struct sockaddr *sa2)
void sctp_log_closing(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int16_t loc)
uint32_t sctp_secs_to_ticks(uint32_t secs)
uint32_t sctp_msecs_to_ticks(uint32_t msecs)
void sctp_stop_timers_for_shutdown(struct sctp_tcb *stcb)
#define sctp_free_spbufspace(stcb, asoc, sp)
struct socket * inp_socket
struct ip6_pktopts * in6p_outputopts
struct mbuf * inp_options
struct sctpiterators iteratorhead
uint32_t iterator_running
struct sctp_iterator * cur_it
struct sctp_ipv6addr_param addrp
struct sctp_ipv4addr_param addrp
uint16_t strm_realoutsize
uint32_t total_output_queue_size
uint8_t peer_supports_nat
sctp_auth_chklist_t * local_auth_chunks
uint32_t highest_tsn_inside_map
struct sctp_nets * alternate
struct sctp_timer asconf_timer
uint8_t adaptation_needed
struct sctpchunk_listhead send_queue
struct sctp_timer strreset_timer
struct sctp_stream_out * strmout
struct sctpladdr sctp_restricted_addrs
struct sctp_keyhead shared_keys
struct sctpnetlisthead nets
uint8_t reconfig_supported
struct sctp_nets * last_control_chunk_from
struct sctp_readhead pending_reply_queue
struct sctp_nets * deleted_primary
struct sctp_laddr * last_used_address
struct sctp_timer dack_timer
struct sctp_asconf_ackhead asconf_ack_sent
unsigned int cnt_on_all_streams
struct sctpchunk_listhead free_chunks
uint32_t mapping_array_base_tsn
uint32_t peers_adaptation
unsigned int stream_queue_cnt
uint16_t last_revoke_count
struct sctp_asconf_addrhead asconf_queue
struct sctpchunk_listhead asconf_send_queue
struct sctp_queued_to_read * control_pdapi
struct sctp_nets * last_net_cmt_send_started
struct sctp_resethead resetHead
struct sctp_ss_functions ss_functions
struct sctp_timer autoclose_timer
struct sctp_timer shut_guard_timer
uint8_t * nr_mapping_array
struct sctpchunk_listhead control_send_queue
unsigned int size_on_all_streams
uint16_t def_net_pf_threshold
struct sctp_timer delete_prim_timer
sctp_hmaclist_t * local_hmacs
sctp_hmaclist_t * peer_hmacs
struct sctp_scoping scope
uint8_t pktdrop_supported
unsigned int cnt_on_reasm_queue
uint32_t heart_beat_delay
struct sctp_nets * primary_destination
struct sctp_cc_functions cc_functions
struct sctp_nets * last_data_chunk_from
struct sctpchunk_listhead sent_queue
sctp_auth_chklist_t * peer_auth_chunks
unsigned int size_on_reasm_queue
struct sctp_stream_in * strmin
void(* sctp_set_initial_cc_param)(struct sctp_tcb *stcb, struct sctp_nets *net)
union sctp_sockstore address
struct sctp_ifalist ifalist
char ifn_name[SCTP_IFNAMSIZ]
uint32_t partial_delivery_point
struct socket * sctp_socket
union sctp_inpcb::@33 ip_inp
struct sctpasochead sctp_asoc_list
uint8_t reconfig_supported
struct sctp_readhead read_queue
struct sctpasochead * sctp_tcbhash
struct sctpladdr sctp_addr_list
struct sctp_laddr * next_addr_touse
uint32_t sctp_associd_counter
struct sctpasochead * sctp_asocidhash
uint8_t pktdrop_supported
uint8_t addr[SCTP_V6_ADDR_BYTES]
inp_func function_inp_end
struct timeval start_time
struct nhop_object * ro_nh
union sctp_sockstore _l_addr
struct sctp_ifa * _s_addr
uint16_t failure_threshold
uint8_t find_pseudo_cumack
struct sctp_timer pmtu_timer
uint32_t heart_beat_delay
struct timeval start_time
struct sctp_timer hb_timer
uint8_t find_rtx_pseudo_cumack
struct sctp_timer rxt_timer
uint8_t src_addr_selected
uint32_t initial_init_rto_max
uint32_t secret_key[SCTP_HOW_MANY_SECRETS][SCTP_NUMBER_OF_SECRETS]
uint32_t sctp_sws_receiver
char current_secret_number
uint8_t random_numbers[SCTP_SIGNATURE_ALOC_SIZE]
uint32_t sctp_default_ss_module
struct sctp_keyhead shared_keys
struct sctp_timer signature_change
sctp_auth_chklist_t * local_auth_chunks
uint16_t pre_open_stream_count
unsigned int sctp_sack_freq
uint16_t def_net_pf_threshold
unsigned int time_of_secret_change
uint32_t adaptation_layer_indicator
sctp_hmaclist_t * local_hmacs
uint16_t max_open_streams_intome
uint32_t sctp_default_cc_module
uint32_t sctp_timeoutticks[SCTP_NUM_TMRS]
unsigned int size_of_a_cookie
uint8_t adaptation_layer_indicator_provided
struct sctpchunk_listhead reasm
struct sctp_nets * whoFrom
void(* sctp_ss_remove_from_stream)(struct sctp_tcb *stcb, struct sctp_association *asoc, struct sctp_stream_out *strq, struct sctp_stream_queue_pending *sp)
bool(* sctp_ss_is_user_msgs_incomplete)(struct sctp_tcb *stcb, struct sctp_association *asoc)
struct sctp_readhead inqueue
struct sctp_readhead uno_inqueue
uint32_t chunks_on_queues
struct sctp_streamhead outqueue
struct sctp_timewait vtag_block[SCTP_NUMBER_IN_VTAG_BLOCK]
struct socket * sctp_socket
struct sctp_association asoc
struct sctp_block_entry * block_entry
struct sctp_inpcb * sctp_ep
uint32_t tv_sec_at_expire
union sctp_tmit_chunk::@34 rec
struct sctp_data_chunkrec data
struct sctp_ifnlist ifnlist
struct sctp_ifalist * vrf_addr_hash