44#include <netinet6/sctp6_var.h>
55#if defined(INET6) || defined(INET)
66#define KTR_SCTP KTR_SUBSYS
75#if defined(SCTP_LOCAL_TRACE_BUF)
98#if defined(SCTP_LOCAL_TRACE_BUF)
124#if defined(SCTP_LOCAL_TRACE_BUF)
127 memset(&sctp_clog, 0,
sizeof(sctp_clog));
128 sctp_clog.
x.
rto.
net = (
void *)net;
143#if defined(SCTP_LOCAL_TRACE_BUF)
165#if defined(SCTP_LOCAL_TRACE_BUF)
186#if defined(SCTP_LOCAL_TRACE_BUF)
207#if defined(SCTP_LOCAL_TRACE_BUF)
210 memset(&sctp_clog, 0,
sizeof(sctp_clog));
227#if defined(SCTP_LOCAL_TRACE_BUF)
230 memset(&sctp_clog, 0,
sizeof(sctp_clog));
244#ifdef SCTP_MBUF_LOGGING
246sctp_log_mb(
struct mbuf *m,
int from)
248#if defined(SCTP_LOCAL_TRACE_BUF)
251 sctp_clog.
x.
mb.
mp = m;
259 sctp_clog.x.mb.ext = 0;
260 sctp_clog.x.mb.refcnt = 0;
265 sctp_clog.x.misc.log1,
266 sctp_clog.x.misc.log2,
267 sctp_clog.x.misc.log3,
268 sctp_clog.x.misc.log4);
273sctp_log_mbc(
struct mbuf *m,
int from)
278 sctp_log_mb(mat, from);
286#if defined(SCTP_LOCAL_TRACE_BUF)
289 if (control == NULL) {
297 if (poschk != NULL) {
317#if defined(SCTP_LOCAL_TRACE_BUF)
354#if defined(SCTP_LOCAL_TRACE_BUF)
357 memset(&sctp_clog, 0,
sizeof(sctp_clog));
400#if defined(SCTP_LOCAL_TRACE_BUF)
403 memset(&sctp_clog, 0,
sizeof(sctp_clog));
429#if defined(SCTP_LOCAL_TRACE_BUF)
449#if defined(SCTP_LOCAL_TRACE_BUF)
466#ifdef SCTP_MBCNT_LOGGING
470#if defined(SCTP_LOCAL_TRACE_BUF)
474 sctp_clog.x.mbcnt.size_change = book;
475 sctp_clog.x.mbcnt.total_queue_mb_size = total_mbcnt_q;
476 sctp_clog.x.mbcnt.mbcnt_change =
mbcnt;
480 sctp_clog.x.misc.log1,
481 sctp_clog.x.misc.log2,
482 sctp_clog.x.misc.log3,
483 sctp_clog.x.misc.log4);
491#if defined(SCTP_LOCAL_TRACE_BUF)
502#if defined(SCTP_LOCAL_TRACE_BUF)
550#if defined(SCTP_LOCAL_TRACE_BUF)
577#ifdef SCTP_AUDITING_ENABLED
579static int sctp_audit_indx = 0;
583sctp_print_audit_report(
void)
590 if ((sctp_audit_data[i][0] == 0xe0) &&
591 (sctp_audit_data[i][1] == 0x01)) {
594 }
else if (sctp_audit_data[i][0] == 0xf0) {
597 }
else if ((sctp_audit_data[i][0] == 0xc0) &&
598 (sctp_audit_data[i][1] == 0x01)) {
608 for (i = 0; i < sctp_audit_indx; i++) {
609 if ((sctp_audit_data[i][0] == 0xe0) &&
610 (sctp_audit_data[i][1] == 0x01)) {
613 }
else if (sctp_audit_data[i][0] == 0xf0) {
616 }
else if ((sctp_audit_data[i][0] == 0xc0) &&
617 (sctp_audit_data[i][1] == 0x01)) {
634 int resend_cnt, tot_out, rep, tot_book_cnt;
638 sctp_audit_data[sctp_audit_indx][0] = 0xAA;
639 sctp_audit_data[sctp_audit_indx][1] = 0x000000ff & from;
645 sctp_audit_data[sctp_audit_indx][0] = 0xAF;
646 sctp_audit_data[sctp_audit_indx][1] = 0x01;
654 sctp_audit_data[sctp_audit_indx][0] = 0xAF;
655 sctp_audit_data[sctp_audit_indx][1] = 0x02;
662 sctp_audit_data[sctp_audit_indx][0] = 0xA1;
663 sctp_audit_data[sctp_audit_indx][1] =
671 resend_cnt = tot_out = 0;
681 sctp_audit_data[sctp_audit_indx][0] = 0xAF;
682 sctp_audit_data[sctp_audit_indx][1] = 0xA1;
691 sctp_audit_data[sctp_audit_indx][0] = 0xA2;
692 sctp_audit_data[sctp_audit_indx][1] =
700 sctp_audit_data[sctp_audit_indx][0] = 0xAF;
701 sctp_audit_data[sctp_audit_indx][1] = 0xA2;
712 sctp_audit_data[sctp_audit_indx][0] = 0xAF;
713 sctp_audit_data[sctp_audit_indx][1] = 0xA5;
724 TAILQ_FOREACH(lnet, &stcb->
asoc.
nets, sctp_next) {
728 sctp_audit_data[sctp_audit_indx][0] = 0xAF;
729 sctp_audit_data[sctp_audit_indx][1] = 0xA3;
738 TAILQ_FOREACH(lnet, &stcb->
asoc.
nets, sctp_next) {
741 if ((chk->
whoTo == lnet) &&
747 SCTP_PRINTF(
"net:%p flight was %d corrected to %d\n",
748 (
void *)lnet, lnet->flight_size,
755 sctp_print_audit_report();
763 sctp_audit_data[sctp_audit_indx][0] = ev;
764 sctp_audit_data[sctp_audit_indx][1] = fd;
788 temp = (((uint64_t)msecs * hz) + 999) / 1000;
789 if (temp > UINT32_MAX) {
807 temp = (((uint64_t)ticks * 1000) + (hz - 1)) / hz;
808 if (temp > UINT32_MAX) {
823 temp = (uint64_t)secs * hz;
824 if (temp > UINT32_MAX) {
838 temp = ((uint64_t)ticks + (hz - 1)) / hz;
839 if (temp > UINT32_MAX) {
868 TAILQ_FOREACH(net, &stcb->
asoc.
nets, sctp_next) {
887 if (stop_assoc_kill_timer) {
900 TAILQ_FOREACH(net, &stcb->
asoc.
nets, sctp_next) {
964 (
"sctp_mtu_sizes[%u] not a multiple of 4", i - 1));
984 (
"sctp_mtu_sizes[%u] not a multiple of 4", i));
1020 int store_at, new_store;
1031 new_store = store_at +
sizeof(
uint32_t);
1035 if (!atomic_cmpset_int(&inp->
store_at, store_at, new_store)) {
1038 if (new_store == 0) {
1110 return (user_state);
1132#if defined(SCTP_DETAILED_STR_STATS)
1158 if (inp->
sctp_ep.default_flowlabel) {
1159 asoc->default_flowlabel = inp->
sctp_ep.default_flowlabel;
1163 asoc->default_flowlabel &= 0x000fffff;
1164 asoc->default_flowlabel |= 0x80000000;
1166 asoc->default_flowlabel = 0;
1181#ifdef SCTP_ASOCLOG_OF_TSNS
1182 asoc->tsn_in_at = 0;
1183 asoc->tsn_out_at = 0;
1184 asoc->tsn_in_wrapped = 0;
1185 asoc->tsn_out_wrapped = 0;
1186 asoc->cumack_log_at = 0;
1187 asoc->cumack_log_atsnt = 0;
1189#ifdef SCTP_FS_SPEC_LOG
1263 TAILQ_INIT(&asoc->
nets);
1304#if defined(SCTP_DETAILED_STR_STATS)
1384 unsigned int i, limit;
1386 SCTP_PRINTF(
"Mapping array size: %d, baseTSN: %8.8x, cumAck: %8.8x, highestTSN: (%8.8x, %8.8x).\n",
1398 for (i = 0; i < limit; i++) {
1409 for (i = 0; i < limit; i++) {
1420 uint8_t *new_array1, *new_array2;
1426 if ((new_array1 == NULL) || (new_array2 == NULL)) {
1428 SCTP_PRINTF(
"No memory for expansion of SCTP mapping array %d\n", new_size);
1437 memset(new_array1, 0, new_size);
1438 memset(new_array2, 0, new_size);
1452 struct epoch_tracker et;
1454 int iteration_count = 0;
1458 NET_EPOCH_ENTER(et);
1466 if (it->
inp == NULL) {
1492 goto done_with_iterator;
1495 it->
inp = LIST_NEXT(it->
inp, sctp_list);
1498 if (it->
inp == NULL) {
1499 goto done_with_iterator;
1509 if (it->
stcb == NULL) {
1513 if ((inp_skip) || it->
stcb == NULL) {
1522 while (it->
stcb != NULL) {
1548 goto done_with_iterator;
1564 iteration_count = 0;
1567 (
"%s: stcb %p does not belong to inp %p, but inp %p",
1589 it->
stcb = LIST_NEXT(it->
stcb, sctp_tcblist);
1590 if (it->
stcb == NULL) {
1606 it->
inp = LIST_NEXT(it->
inp, sctp_list);
1609 if (it->
inp == NULL) {
1610 goto done_with_iterator;
1612 goto select_a_new_ep;
1626 CURVNET_SET(it->
vn);
1656 LIST_FOREACH_SAFE(wi, &
SCTP_BASE_INFO(addr_wq), sctp_nxt_addr, nwi) {
1657 LIST_REMOVE(wi, sctp_nxt_addr);
1658 LIST_INSERT_HEAD(&asc->
list_of_work, wi, sctp_nxt_addr);
1662 if (asc->
cnt == 0) {
1676 SCTP_PRINTF(
"Failed to initiate iterator for handle_addr_wq\n");
1684 LIST_FOREACH(wi, &asc->list_of_work, sctp_nxt_addr) {
1721 struct epoch_tracker et;
1727 struct mbuf *op_err;
1730 bool did_output, released_asoc_reference;
1741 CURVNET_SET((
struct vnet *)tmr->
vnet);
1742 NET_EPOCH_ENTER(et);
1743 released_asoc_reference =
false;
1745#ifdef SCTP_AUDITING_ENABLED
1747 sctp_auditing(3, inp, stcb, net);
1751 KASSERT(tmr->
self == NULL || tmr->
self == tmr,
1752 (
"sctp_timeout_handler: tmr->self corrupted"));
1754 (
"sctp_timeout_handler: invalid timer type %d", tmr->
type));
1756 KASSERT(stcb == NULL || stcb->
sctp_ep == inp,
1757 (
"sctp_timeout_handler of type %d: inp = %p, stcb->sctp_ep %p",
1762 "Timer type %d handler exiting due to CLOSED association.\n",
1770 "Timer type %d handler exiting due to not being active.\n",
1784 released_asoc_reference =
true;
1789 "Timer type %d handler exiting due to CLOSED association.\n",
1793 }
else if (inp != NULL) {
1819 KASSERT(inp != NULL && stcb != NULL && net != NULL,
1820 (
"timeout of type %d: inp = %p, stcb = %p, net = %p",
1821 type, inp, stcb, net));
1835#ifdef SCTP_AUDITING_ENABLED
1836 sctp_auditing(4, inp, stcb, net);
1851 if (chk->
whoTo != NULL) {
1861 KASSERT(inp != NULL && stcb != NULL && net != NULL,
1862 (
"timeout of type %d: inp = %p, stcb = %p, net = %p",
1863 type, inp, stcb, net));
1873 KASSERT(inp != NULL && stcb != NULL && net == NULL,
1874 (
"timeout of type %d: inp = %p, stcb = %p, net = %p",
1875 type, inp, stcb, net));
1879#ifdef SCTP_AUDITING_ENABLED
1880 sctp_auditing(4, inp, stcb, NULL);
1886 KASSERT(inp != NULL && stcb != NULL && net != NULL,
1887 (
"timeout of type %d: inp = %p, stcb = %p, net = %p",
1888 type, inp, stcb, net));
1895#ifdef SCTP_AUDITING_ENABLED
1896 sctp_auditing(4, inp, stcb, net);
1902 KASSERT(inp != NULL && stcb != NULL && net != NULL,
1903 (
"timeout of type %d: inp = %p, stcb = %p, net = %p",
1904 type, inp, stcb, net));
1911#ifdef SCTP_AUDITING_ENABLED
1912 sctp_auditing(4, inp, stcb, net);
1923 KASSERT(inp != NULL && stcb != NULL && net != NULL,
1924 (
"timeout of type %d: inp = %p, stcb = %p, net = %p",
1925 type, inp, stcb, net));
1932#ifdef SCTP_AUDITING_ENABLED
1933 sctp_auditing(4, inp, stcb, net);
1943 KASSERT(inp != NULL && stcb == NULL && net == NULL,
1944 (
"timeout of type %d: inp = %p, stcb = %p, net = %p",
1945 type, inp, stcb, net));
1965 KASSERT(inp != NULL && stcb != NULL && net != NULL,
1966 (
"timeout of type %d: inp = %p, stcb = %p, net = %p",
1967 type, inp, stcb, net));
1973 KASSERT(inp != NULL && stcb != NULL && net != NULL,
1974 (
"timeout of type %d: inp = %p, stcb = %p, net = %p",
1975 type, inp, stcb, net));
1982#ifdef SCTP_AUDITING_ENABLED
1983 sctp_auditing(4, inp, stcb, net);
1989 KASSERT(inp != NULL && stcb != NULL && net != NULL,
1990 (
"timeout of type %d: inp = %p, stcb = %p, net = %p",
1991 type, inp, stcb, net));
1997#ifdef SCTP_AUDITING_ENABLED
1998 sctp_auditing(4, inp, stcb, net);
2004 KASSERT(inp != NULL && stcb != NULL && net == NULL,
2005 (
"timeout of type %d: inp = %p, stcb = %p, net = %p",
2006 type, inp, stcb, net));
2009 "Shutdown guard timer expired");
2014 KASSERT(inp != NULL && stcb != NULL && net == NULL,
2015 (
"timeout of type %d: inp = %p, stcb = %p, net = %p",
2016 type, inp, stcb, net));
2023 KASSERT(inp != NULL && stcb != NULL && net == NULL,
2024 (
"timeout of type %d: inp = %p, stcb = %p, net = %p",
2025 type, inp, stcb, net));
2035 KASSERT(inp != NULL && stcb == NULL && net == NULL,
2036 (
"timeout of type %d: inp = %p, stcb = %p, net = %p",
2037 type, inp, stcb, net));
2052 KASSERT(inp != NULL && stcb != NULL && net == NULL,
2053 (
"timeout of type %d: inp = %p, stcb = %p, net = %p",
2054 type, inp, stcb, net));
2068 KASSERT(inp == NULL && stcb == NULL && net == NULL,
2069 (
"timeout of type %d: inp = %p, stcb = %p, net = %p",
2070 type, inp, stcb, net));
2075 KASSERT(inp != NULL && stcb != NULL && net == NULL,
2076 (
"timeout of type %d: inp = %p, stcb = %p, net = %p",
2077 type, inp, stcb, net));
2084 panic(
"Unknown timer type %d", type);
2089#ifdef SCTP_AUDITING_ENABLED
2090 sctp_audit_log(0xF1, (
uint8_t)type);
2092 sctp_auditing(5, inp, stcb, net);
2094 if (did_output && (stcb != NULL)) {
2107 }
else if (inp != NULL) {
2118 if ((stcb != NULL) && !released_asoc_reference) {
2164 KASSERT(stcb == NULL || stcb->
sctp_ep == inp,
2165 (
"sctp_timer_start of type %d: inp = %p, stcb->sctp_ep %p",
2166 t_type, stcb, stcb->
sctp_ep));
2170 }
else if (inp != NULL) {
2183 "Timer type %d not started: inp=%p, stcb=%p, net=%p (stcb deleted).\n",
2184 t_type, inp, stcb,
net);
2190 "Timer type %d not started: inp=%p, stcb=%p, net=%p (net deleted).\n",
2191 t_type, inp, stcb,
net);
2198 if ((inp == NULL) || (stcb == NULL) || (
net == NULL)) {
2200 panic(
"sctp_timer_start of type %d: inp = %p, stcb = %p, net = %p",
2201 t_type, inp, stcb,
net);
2206 tmr = &
net->rxt_timer;
2207 if (
net->RTO == 0) {
2218 if ((inp == NULL) || (stcb == NULL) || (
net == NULL)) {
2220 panic(
"sctp_timer_start of type %d: inp = %p, stcb = %p, net = %p",
2221 t_type, inp, stcb,
net);
2226 tmr = &
net->rxt_timer;
2227 if (
net->RTO == 0) {
2238 if ((inp == NULL) || (stcb == NULL) || (
net != NULL)) {
2240 panic(
"sctp_timer_start of type %d: inp = %p, stcb = %p, net = %p",
2241 t_type, inp, stcb,
net);
2251 if ((inp == NULL) || (stcb == NULL) || (
net == NULL)) {
2253 panic(
"sctp_timer_start of type %d: inp = %p, stcb = %p, net = %p",
2254 t_type, inp, stcb,
net);
2259 tmr = &
net->rxt_timer;
2260 if (
net->RTO == 0) {
2272 if ((inp == NULL) || (stcb == NULL) || (
net == NULL)) {
2274 panic(
"sctp_timer_start of type %d: inp = %p, stcb = %p, net = %p",
2275 t_type, inp, stcb,
net);
2283 "Timer type %d not started: inp=%p, stcb=%p, net=%p.\n",
2284 t_type, inp, stcb,
net);
2287 tmr = &
net->hb_timer;
2288 if (
net->RTO == 0) {
2291 to_ticks =
net->RTO;
2294 jitter = rndval % to_ticks;
2298 if (jitter < (UINT32_MAX - to_ticks)) {
2301 to_ticks = UINT32_MAX;
2305 if (
net->heart_beat_delay < (UINT32_MAX - to_ticks)) {
2306 to_ticks +=
net->heart_beat_delay;
2308 to_ticks = UINT32_MAX;
2323 if ((inp == NULL) || (stcb == NULL) || (
net == NULL)) {
2325 panic(
"sctp_timer_start of type %d: inp = %p, stcb = %p, net = %p",
2326 t_type, inp, stcb,
net);
2331 tmr = &
net->rxt_timer;
2332 if (
net->RTO == 0) {
2343 if ((inp == NULL) || (stcb != NULL) || (
net != NULL)) {
2345 panic(
"sctp_timer_start of type %d: inp = %p, stcb = %p, net = %p",
2346 t_type, inp, stcb,
net);
2359 if ((inp == NULL) || (stcb == NULL) || (
net == NULL)) {
2361 panic(
"sctp_timer_start of type %d: inp = %p, stcb = %p, net = %p",
2362 t_type, inp, stcb,
net);
2369 "Timer type %d not started: inp=%p, stcb=%p, net=%p.\n",
2370 t_type, inp, stcb,
net);
2373 tmr = &
net->pmtu_timer;
2378 if ((inp == NULL) || (stcb == NULL) || (
net == NULL)) {
2380 panic(
"sctp_timer_start of type %d: inp = %p, stcb = %p, net = %p",
2381 t_type, inp, stcb,
net);
2386 tmr = &
net->rxt_timer;
2387 if (
net->RTO == 0) {
2398 if ((inp == NULL) || (stcb == NULL) || (
net == NULL)) {
2400 panic(
"sctp_timer_start of type %d: inp = %p, stcb = %p, net = %p",
2401 t_type, inp, stcb,
net);
2407 if (
net->RTO == 0) {
2418 if ((inp == NULL) || (stcb == NULL) || (
net != NULL)) {
2420 panic(
"sctp_timer_start of type %d: inp = %p, stcb = %p, net = %p",
2421 t_type, inp, stcb,
net);
2438 if ((inp == NULL) || (stcb == NULL) || (
net != NULL)) {
2440 panic(
"sctp_timer_start of type %d: inp = %p, stcb = %p, net = %p",
2441 t_type, inp, stcb,
net);
2454 if ((inp == NULL) || (stcb == NULL) || (
net == NULL)) {
2456 panic(
"sctp_timer_start of type %d: inp = %p, stcb = %p, net = %p",
2457 t_type, inp, stcb,
net);
2463 if (
net->RTO == 0) {
2475 if ((inp == NULL) || (stcb != NULL) || (
net != NULL)) {
2477 panic(
"sctp_timer_start of type %d: inp = %p, stcb = %p, net = %p",
2478 t_type, inp, stcb,
net);
2487 if ((inp == NULL) || (stcb == NULL) || (
net != NULL)) {
2489 panic(
"sctp_timer_start of type %d: inp = %p, stcb = %p, net = %p",
2490 t_type, inp, stcb,
net);
2499 if ((inp != NULL) || (stcb != NULL) || (
net != NULL)) {
2501 panic(
"sctp_timer_start of type %d: inp = %p, stcb = %p, net = %p",
2502 t_type, inp, stcb,
net);
2512 if ((inp == NULL) || (stcb == NULL) || (
net != NULL)) {
2514 panic(
"sctp_timer_start of type %d: inp = %p, stcb = %p, net = %p",
2515 t_type, inp, stcb,
net);
2525 panic(
"Unknown timer type %d", t_type);
2530 KASSERT(tmr != NULL, (
"tmr is NULL for timer type %d", t_type));
2531 KASSERT(to_ticks > 0, (
"to_ticks == 0 for timer type %d", t_type));
2538 "Timer type %d already running: inp=%p, stcb=%p, net=%p.\n",
2539 t_type, inp, stcb,
net);
2548 tmr->
ep = (
void *)inp;
2549 tmr->
tcb = (
void *)stcb;
2555 tmr->
self = (
void *)tmr;
2556 tmr->
vnet = (
void *)curvnet;
2560 "Timer type %d started: ticks=%u, inp=%p, stcb=%p, net=%p.\n",
2561 t_type, to_ticks, inp, stcb,
net);
2566 if (tmr->
ep != NULL) {
2569 if (tmr->
tcb != NULL) {
2572 if (tmr->
net != NULL) {
2573 atomic_add_int(&
net->ref_count, 1);
2581 "Timer type %d restarted: ticks=%u, inp=%p, stcb=%p, net=%p.\n",
2582 t_type, to_ticks, inp, stcb,
net);
2620 KASSERT(stcb == NULL || stcb->
sctp_ep == inp,
2621 (
"sctp_timer_stop of type %d: inp = %p, stcb->sctp_ep %p",
2622 t_type, stcb, stcb->
sctp_ep));
2625 }
else if (inp != NULL) {
2633 if ((inp == NULL) || (stcb == NULL) || (
net == NULL)) {
2635 panic(
"sctp_timer_stop of type %d: inp = %p, stcb = %p, net = %p",
2636 t_type, inp, stcb,
net);
2641 tmr = &
net->rxt_timer;
2644 if ((inp == NULL) || (stcb == NULL) || (
net == NULL)) {
2646 panic(
"sctp_timer_stop of type %d: inp = %p, stcb = %p, net = %p",
2647 t_type, inp, stcb,
net);
2652 tmr = &
net->rxt_timer;
2655 if ((inp == NULL) || (stcb == NULL) || (
net != NULL)) {
2657 panic(
"sctp_timer_stop of type %d: inp = %p, stcb = %p, net = %p",
2658 t_type, inp, stcb,
net);
2666 if ((inp == NULL) || (stcb == NULL) || (
net == NULL)) {
2668 panic(
"sctp_timer_stop of type %d: inp = %p, stcb = %p, net = %p",
2669 t_type, inp, stcb,
net);
2674 tmr = &
net->rxt_timer;
2677 if ((inp == NULL) || (stcb == NULL) || (
net == NULL)) {
2679 panic(
"sctp_timer_stop of type %d: inp = %p, stcb = %p, net = %p",
2680 t_type, inp, stcb,
net);
2685 tmr = &
net->hb_timer;
2688 if ((inp == NULL) || (stcb == NULL) || (
net == NULL)) {
2690 panic(
"sctp_timer_stop of type %d: inp = %p, stcb = %p, net = %p",
2691 t_type, inp, stcb,
net);
2696 tmr = &
net->rxt_timer;
2699 if ((inp == NULL) || (stcb != NULL) || (
net != NULL)) {
2701 panic(
"sctp_timer_stop of type %d: inp = %p, stcb = %p, net = %p",
2702 t_type, inp, stcb,
net);
2710 if ((inp == NULL) || (stcb == NULL) || (
net == NULL)) {
2712 panic(
"sctp_timer_stop of type %d: inp = %p, stcb = %p, net = %p",
2713 t_type, inp, stcb,
net);
2718 tmr = &
net->pmtu_timer;
2721 if ((inp == NULL) || (stcb == NULL) || (
net == NULL)) {
2723 panic(
"sctp_timer_stop of type %d: inp = %p, stcb = %p, net = %p",
2724 t_type, inp, stcb,
net);
2729 tmr = &
net->rxt_timer;
2732 if ((inp == NULL) || (stcb == NULL) || (
net != NULL)) {
2734 panic(
"sctp_timer_stop of type %d: inp = %p, stcb = %p, net = %p",
2735 t_type, inp, stcb,
net);
2743 if ((inp == NULL) || (stcb == NULL) || (
net != NULL)) {
2745 panic(
"sctp_timer_stop of type %d: inp = %p, stcb = %p, net = %p",
2746 t_type, inp, stcb,
net);
2754 if ((inp == NULL) || (stcb == NULL) || (
net != NULL)) {
2756 panic(
"sctp_timer_stop of type %d: inp = %p, stcb = %p, net = %p",
2757 t_type, inp, stcb,
net);
2765 if ((inp == NULL) || (stcb == NULL) || (
net != NULL)) {
2767 panic(
"sctp_timer_stop of type %d: inp = %p, stcb = %p, net = %p",
2768 t_type, inp, stcb,
net);
2781 if ((inp == NULL) || (stcb != NULL) || (
net != NULL)) {
2783 panic(
"sctp_timer_stop of type %d: inp = %p, stcb = %p, net = %p",
2784 t_type, inp, stcb,
net);
2792 if ((inp == NULL) || (stcb == NULL) || (
net != NULL)) {
2794 panic(
"sctp_timer_stop of type %d: inp = %p, stcb = %p, net = %p",
2795 t_type, inp, stcb,
net);
2803 if ((inp != NULL) || (stcb != NULL) || (
net != NULL)) {
2805 panic(
"sctp_timer_stop of type %d: inp = %p, stcb = %p, net = %p",
2806 t_type, inp, stcb,
net);
2814 if ((inp == NULL) || (stcb == NULL) || (
net != NULL)) {
2816 panic(
"sctp_timer_stop of type %d: inp = %p, stcb = %p, net = %p",
2817 t_type, inp, stcb,
net);
2826 panic(
"Unknown timer type %d", t_type);
2831 KASSERT(tmr != NULL, (
"tmr is NULL for timer type %d", t_type));
2833 (tmr->
type != t_type)) {
2841 "Shared timer type %d not running: inp=%p, stcb=%p, net=%p.\n",
2842 t_type, inp, stcb,
net);
2854 KASSERT(tmr->
ep == inp,
2855 (
"sctp_timer_stop of type %d: inp = %p, tmr->inp = %p",
2856 t_type, inp, tmr->
ep));
2857 KASSERT(tmr->
tcb == stcb,
2858 (
"sctp_timer_stop of type %d: stcb = %p, tmr->stcb = %p",
2859 t_type, stcb, tmr->
tcb));
2862 (
"sctp_timer_stop of type %d: net = %p, tmr->net = %p",
2865 "Timer type %d stopped: inp=%p, stcb=%p, net=%p.\n",
2866 t_type, inp, stcb,
net);
2871 if (tmr->
ep != NULL) {
2875 if (tmr->
tcb != NULL) {
2879 if (tmr->
net != NULL) {
2889 "Timer type %d not stopped: inp=%p, stcb=%p, net=%p.\n",
2890 t_type, inp, stcb,
net);
2919 struct timeval *old,
2926 int first_measure = 0;
2937 if ((old->tv_sec > now.tv_sec) ||
2938 ((old->tv_sec == now.tv_sec) && (old->tv_usec > now.tv_usec))) {
2942 timevalsub(&now, old);
2943 rtt_us = (uint64_t)1000000 * (uint64_t)now.tv_sec + (uint64_t)now.tv_usec;
2951 rtt = (int32_t)(net->
rtt / 1000);
3016 if (new_rto < stcb->asoc.
minrto) {
3039 if ((off < 0) || (len <= 0))
3043 while ((m != NULL) && (off > 0)) {
3054 return (mtod(m, caddr_t)+off);
3057 while ((m != NULL) && (len > 0)) {
3059 memcpy(ptr, mtod(m, caddr_t)+off,
count);
3065 if ((m == NULL) && (len > 0))
3068 return ((caddr_t)in_ptr);
3086 struct mbuf *m_last;
3092 if (padlen <= M_TRAILINGSPACE(m)) {
3101 if (m_last == NULL) {
3110 memset(dp, 0, padlen);
3120 if (last_mbuf != NULL) {
3135 bool from_peer,
bool timedout,
int so_locked)
3137 struct mbuf *m_notify;
3140 unsigned int notif_len;
3144 KASSERT(abort == NULL || from_peer,
3145 (
"sctp_notify_assoc_change: ABORT chunk provided for local termination"));
3146 KASSERT(!from_peer || !timedout,
3147 (
"sctp_notify_assoc_change: timeouts can only be local"));
3153 if (abort != NULL) {
3168 notif_len += abort_len;
3171 if (m_notify == NULL) {
3175 if (m_notify == NULL) {
3181 memset(sac, 0, notif_len);
3216 memcpy(sac->
sac_info, abort, abort_len);
3224 if (control != NULL) {
3277 struct sockaddr *sa,
uint32_t error,
int so_locked)
3279 struct mbuf *m_notify;
3283 if ((
stcb == NULL) ||
3289 if (m_notify == NULL)
3297 switch (sa->sa_family) {
3303 (
struct sockaddr_in6 *)&spc->
spc_aaddr);
3315 struct sockaddr_in6 *sin6;
3317 memcpy(&spc->
spc_aaddr, sa,
sizeof(
struct sockaddr_in6));
3319 sin6 = (
struct sockaddr_in6 *)&spc->
spc_aaddr;
3320 if (IN6_IS_SCOPE_LINKLOCAL(&sin6->sin6_addr)) {
3321 if (sin6->sin6_scope_id == 0) {
3323 (void)sa6_recoverscope(sin6);
3326 in6_clearscope(&sin6->sin6_addr);
3347 if (control == NULL) {
3367 struct mbuf *m_notify;
3372 int notifhdr_len, chk_len, chkhdr_len, padding_len, payload_len;
3374 if ((stcb == NULL) ||
3387 if (m_notify == NULL)
3398 payload_len = chk->
send_size - chkhdr_len;
3403 if (chk->
data != NULL) {
3405 if (chkhdr != NULL) {
3407 if ((chk_len >= chkhdr_len) &&
3411 payload_len = chk->
send_size - chkhdr_len - padding_len;
3417 memset(ssfe, 0, notifhdr_len);
3435 memset(ssf, 0, notifhdr_len);
3453 if (chk->
data != NULL) {
3455 if (chk->
send_size == chkhdr_len + payload_len + padding_len) {
3456 m_adj(chk->
data, chkhdr_len);
3457 m_adj(chk->
data, -padding_len);
3459 chk->
send_size -= (chkhdr_len + padding_len);
3478 if (control == NULL) {
3498 struct mbuf *m_notify;
3504 if ((
stcb == NULL) ||
3516 if (m_notify == NULL) {
3523 memset(ssfe, 0, notifhdr_len);
3541 memset(ssf, 0, notifhdr_len);
3576 if (control == NULL) {
3593 struct mbuf *m_notify;
3597 if ((
stcb == NULL) ||
3604 if (m_notify == NULL)
3623 if (control == NULL) {
3642 struct mbuf *m_notify;
3647 if ((stcb == NULL) ||
3657 if (m_notify == NULL)
3676 if (control == NULL) {
3709 struct mbuf *m_notify;
3728 if (m_notify == NULL)
3745 if (control == NULL) {
3763 struct mbuf *m_notify;
3767 if ((
stcb == NULL) ||
3774 if (m_notify == NULL) {
3782 event->sender_dry_flags = 0;
3793 if (control == NULL) {
3809 struct mbuf *m_notify;
3813 if ((stcb == NULL) ||
3825 if (m_notify == NULL)
3848 if (control == NULL) {
3865 struct mbuf *m_notify;
3869 if ((stcb == NULL) ||
3875 if (m_notify == NULL)
3898 if (control == NULL) {
3914 int number_entries,
uint16_t *list,
int flag)
3916 struct mbuf *m_notify;
3921 if ((stcb == NULL) ||
3928 if (m_notify == NULL)
3933 if (len > M_TRAILINGSPACE(m_notify)) {
3939 memset(strreset, 0, len);
3944 if (number_entries) {
3947 for (i = 0; i < number_entries; i++) {
3962 if (control == NULL) {
3979 struct mbuf *m_notify;
3982 unsigned int notif_len;
3985 if ((
stcb == NULL) ||
3989 if (chunk != NULL) {
4003 if (m_notify == NULL) {
4007 if (m_notify == NULL) {
4013 memset(sre, 0, notif_len);
4020 memcpy(sre->
sre_data, chunk, chunk_len);
4027 if (control != NULL) {
4043 uint32_t error,
void *data,
int so_locked)
4045 if ((stcb == NULL) ||
4052 if (stcb->
sctp_socket->so_rcv.sb_state & SBS_CANTRCVMORE) {
4064 switch (notification) {
4087 (
struct sockaddr *)&net->
ro.
_l_addr, error, so_locked);
4096 (
struct sockaddr *)&net->
ro.
_l_addr, error, so_locked);
4105 (
struct sockaddr *)&net->
ro.
_l_addr, error, so_locked);
4220 __func__, notification, notification);
4249 TAILQ_FOREACH_SAFE(chk, &asoc->
sent_queue, sctp_next, nchk) {
4250 TAILQ_REMOVE(&asoc->
sent_queue, chk, sctp_next);
4257 panic(
"No chunks on the queues for sid %u.", chk->
rec.
data.
sid);
4261 if (chk->
data != NULL) {
4264 error, chk, so_locked);
4274 TAILQ_FOREACH_SAFE(chk, &asoc->
send_queue, sctp_next, nchk) {
4275 TAILQ_REMOVE(&asoc->
send_queue, chk, sctp_next);
4281 panic(
"No chunks on the queues for sid %u.", chk->
rec.
data.
sid);
4284 if (chk->
data != NULL) {
4287 error, chk, so_locked);
4307 error, (
void *)sp, so_locked);
4311 sp->tail_mbuf = NULL;
4362 struct mbuf *m,
int iphlen,
4363 struct sockaddr *src,
struct sockaddr *dst,
4364 struct sctphdr *sh,
struct mbuf *op_err,
4375 if (op_err != NULL) {
4378 cause_code = ntohs(cause->
code);
4386 mflowtype, mflowid, inp->
fibnum,
4401#ifdef SCTP_ASOCLOG_OF_TSNS
4403sctp_print_out_track_log(
struct sctp_tcb *stcb)
4410 if ((stcb->
asoc.tsn_in_at == 0) && (stcb->
asoc.tsn_in_wrapped == 0)) {
4414 if (stcb->
asoc.tsn_in_wrapped) {
4416 SCTP_PRINTF(
"TSN:%x strm:%d seq:%d flags:%x sz:%d\n",
4417 stcb->
asoc.in_tsnlog[i].tsn,
4418 stcb->
asoc.in_tsnlog[i].strm,
4419 stcb->
asoc.in_tsnlog[i].seq,
4420 stcb->
asoc.in_tsnlog[i].flgs,
4421 stcb->
asoc.in_tsnlog[i].sz);
4424 if (stcb->
asoc.tsn_in_at) {
4425 for (i = 0; i < stcb->
asoc.tsn_in_at; i++) {
4426 SCTP_PRINTF(
"TSN:%x strm:%d seq:%d flags:%x sz:%d\n",
4427 stcb->
asoc.in_tsnlog[i].tsn,
4428 stcb->
asoc.in_tsnlog[i].strm,
4429 stcb->
asoc.in_tsnlog[i].seq,
4430 stcb->
asoc.in_tsnlog[i].flgs,
4431 stcb->
asoc.in_tsnlog[i].sz);
4436 if ((stcb->
asoc.tsn_out_at == 0) &&
4437 (stcb->
asoc.tsn_out_wrapped == 0)) {
4440 if (stcb->
asoc.tsn_out_wrapped) {
4442 SCTP_PRINTF(
"TSN:%x strm:%d seq:%d flags:%x sz:%d\n",
4443 stcb->
asoc.out_tsnlog[i].tsn,
4444 stcb->
asoc.out_tsnlog[i].strm,
4445 stcb->
asoc.out_tsnlog[i].seq,
4446 stcb->
asoc.out_tsnlog[i].flgs,
4447 stcb->
asoc.out_tsnlog[i].sz);
4450 if (stcb->
asoc.tsn_out_at) {
4451 for (i = 0; i < stcb->
asoc.tsn_out_at; i++) {
4452 SCTP_PRINTF(
"TSN:%x strm:%d seq:%d flags:%x sz:%d\n",
4453 stcb->
asoc.out_tsnlog[i].tsn,
4454 stcb->
asoc.out_tsnlog[i].strm,
4455 stcb->
asoc.out_tsnlog[i].seq,
4456 stcb->
asoc.out_tsnlog[i].flgs,
4457 stcb->
asoc.out_tsnlog[i].sz);
4466 struct mbuf *op_err,
bool timedout,
int so_locked)
4481 if (op_err != NULL) {
4484 cause_code = ntohs(cause->
code);
4500#ifdef SCTP_ASOCLOG_OF_TSNS
4501 sctp_print_out_track_log(stcb);
4509 struct sockaddr *src,
struct sockaddr *dst,
4516 unsigned int chk_length;
4517 int contains_init_chunk;
4527 contains_init_chunk = 0;
4529 sizeof(*ch), (
uint8_t *)&chunk_buf);
4530 while (ch != NULL) {
4532 if (chk_length <
sizeof(*ch)) {
4538 contains_init_chunk = 1;
4554 mflowtype, mflowid, fibnum,
4562 sizeof(*ch), (
uint8_t *)&chunk_buf);
4566 (contains_init_chunk == 0))) {
4568 mflowtype, mflowid, fibnum,
4583 unsigned int chk_length;
4585 offset = iphlen +
sizeof(
struct sctphdr);
4588 while (ch != NULL) {
4590 if (chk_length <
sizeof(*ch)) {
4604 if (init_chk != NULL) {
4611 sizeof(*ch), (
uint8_t *)&chunk_buf);
4622sctp_is_same_scope(
struct sockaddr_in6 *addr1,
struct sockaddr_in6 *addr2)
4624 struct sockaddr_in6 a, b;
4630 if (a.sin6_scope_id == 0)
4631 if (sa6_recoverscope(&a)) {
4635 if (b.sin6_scope_id == 0)
4636 if (sa6_recoverscope(&b)) {
4640 if (a.sin6_scope_id != b.sin6_scope_id)
4649struct sockaddr_in6 *
4650sctp_recover_scope(
struct sockaddr_in6 *addr,
struct sockaddr_in6 *store)
4653 if (addr->sin6_family == AF_INET6) {
4654 if (IN6_IS_SCOPE_LINKLOCAL(&addr->sin6_addr)) {
4655 if (addr->sin6_scope_id == 0) {
4657 if (!sa6_recoverscope(store)) {
4663 in6_clearscope(&addr->sin6_addr);
4680 if (sa1 == NULL || sa2 == NULL)
4684 if (sa1->sa_family != sa2->sa_family)
4687 switch (sa1->sa_family) {
4692 struct sockaddr_in6 *sin6_1, *sin6_2;
4694 sin6_1 = (
struct sockaddr_in6 *)sa1;
4695 sin6_2 = (
struct sockaddr_in6 *)sa2;
4696 return (SCTP6_ARE_ADDR_EQUAL(sin6_1,
4721 char ip6buf[INET6_ADDRSTRLEN];
4724 switch (sa->sa_family) {
4728 struct sockaddr_in6 *sin6;
4730 sin6 = (
struct sockaddr_in6 *)sa;
4731 SCTP_PRINTF(
"IPv6 address: %s:port:%d scope:%u\n",
4732 ip6_sprintf(ip6buf, &sin6->sin6_addr),
4733 ntohs(sin6->sin6_port),
4734 sin6->sin6_scope_id);
4745 p = (
unsigned char *)&sin->
sin_addr;
4747 p[0], p[1], p[2], p[3], ntohs(sin->
sin_port));
4767 struct socket *old_so, *new_so;
4769 struct sctp_readhead tmp_queue;
4775 TAILQ_INIT(&tmp_queue);
4776 error = SOCK_IO_RECV_LOCK(old_so, waitflags);
4793 if (control->
stcb == stcb) {
4796 TAILQ_INSERT_TAIL(&tmp_queue, control,
next);
4812 SOCK_IO_RECV_UNLOCK(old_so);
4815 TAILQ_FOREACH_SAFE(control, &tmp_queue,
next, nctl) {
4839 if ((inp != NULL) && (inp->
sctp_socket != NULL)) {
4850 int inp_read_lock_held,
4858 struct mbuf *m, *prev = NULL;
4863 panic(
"Gak, inp NULL on add_to_readq");
4867 if (inp_read_lock_held == 0)
4872 if (control->
data) {
4874 control->
data = NULL;
4878 if (inp_read_lock_held == 0)
4926 if (inp_read_lock_held == 0)
4935 if (inp_read_lock_held == 0)
4958 if ((
code == 0) || (
info == NULL)) {
4961 info_len = strlen(
info);
4971 cause->
length = htons(len);
4972 memcpy(cause->
info,
info, info_len);
4991 no_user_data_cause->
tsn = htonl(
tsn);
4996#ifdef SCTP_MBCNT_LOGGING
5001 if (tp1->
data == NULL) {
5042 int do_wakeup_routine = 0;
5050#if defined(SCTP_DETAILED_STR_STATS)
5057#if defined(SCTP_DETAILED_STR_STATS)
5063 if (tp1->
data != NULL) {
5080 do_wakeup_routine = 1;
5101 tp1 = TAILQ_NEXT(tp1, sctp_next);
5103 }
while (tp1 && notdone);
5104 if (foundeom == 0) {
5109 TAILQ_FOREACH_SAFE(tp1, &stcb->
asoc.
send_queue, sctp_next, tp2) {
5136 do_wakeup_routine = 1;
5149 if (foundeom == 0) {
5176 memset(chk, 0,
sizeof(*chk));
5228 do_wakeup_routine = 1;
5238 if (do_wakeup_routine) {
5256 if (holds_lock == 0) {
5261 if (laddr->
ifa == NULL)
5263 if (addr->sa_family != laddr->
ifa->
address.
sa.sa_family)
5266 if (addr->sa_family == AF_INET) {
5267 if (((
struct sockaddr_in *)addr)->sin_addr.s_addr ==
5275 if (addr->sa_family == AF_INET6) {
5276 if (SCTP6_ARE_ADDR_EQUAL((
struct sockaddr_in6 *)addr,
5284 if (holds_lock == 0) {
5287 if (laddr != NULL) {
5288 return (laddr->
ifa);
5297 switch (addr->sa_family) {
5310 struct sockaddr_in6 *sin6;
5313 sin6 = (
struct sockaddr_in6 *)addr;
5314 hash_of_addr = (sin6->sin6_addr.s6_addr32[0] +
5315 sin6->sin6_addr.s6_addr32[1] +
5316 sin6->sin6_addr.s6_addr32[2] +
5317 sin6->sin6_addr.s6_addr32[3]);
5318 hash_of_addr = (hash_of_addr ^ (hash_of_addr >> 16));
5319 return (hash_of_addr);
5333 struct sctp_ifalist *hash_head;
5336 if (holds_lock == 0) {
5344 if (holds_lock == 0)
5352 if (hash_head == NULL) {
5353 SCTP_PRINTF(
"hash_of_addr:%x mask:%x table:%x - ",
5358 if (holds_lock == 0)
5363 LIST_FOREACH(sctp_ifap, hash_head, next_bucket) {
5364 if (addr->sa_family != sctp_ifap->
address.
sa.sa_family)
5367 if (addr->sa_family == AF_INET) {
5368 if (((
struct sockaddr_in *)addr)->sin_addr.s_addr ==
5376 if (addr->sa_family == AF_INET6) {
5377 if (SCTP6_ARE_ADDR_EQUAL((
struct sockaddr_in6 *)addr,
5385 if (holds_lock == 0)
5395 struct epoch_tracker et;
5398 struct socket *so = NULL;
5431 if (dif >= rwnd_req) {
5451 NET_EPOCH_ENTER(et);
5466 if (so && r_unlocked && hold_rlock) {
5480 struct sockaddr *from,
5499 struct mbuf *m = NULL;
5501 int wakeup_read_socket = 0;
5502 int freecnt_applied = 0;
5503 int out_flags = 0, in_flags = 0;
5504 int block_allowed = 1;
5506 ssize_t copied_so_far = 0;
5507 int in_eeor_mode = 0;
5508 int no_rcv_needed = 0;
5510 int hold_sblock = 0;
5514 int sockbuf_lock = 0;
5522 in_flags = *msg_flags;
5523 if (in_flags & MSG_PEEK)
5528 slen = uio->uio_resid;
5531 if (in_flags & MSG_OOB) {
5533 return (EOPNOTSUPP);
5535 if ((in_flags & MSG_PEEK) && (mp != NULL)) {
5539 if ((in_flags & (MSG_DONTWAIT
5558 rwnd_req, in_eeor_mode, so->so_rcv.sb_cc, (
uint32_t)uio->uio_resid);
5562 rwnd_req, block_allowed, so->so_rcv.sb_cc, (
uint32_t)uio->uio_resid);
5565 error = SOCK_IO_RECV_LOCK(so, SBLOCKWAIT(in_flags));
5567 goto release_unlocked;
5573 if (hold_sblock == 0) {
5574 SOCKBUF_LOCK(&so->so_rcv);
5581 if ((so->so_rcv.sb_state & SBS_CANTRCVMORE) && (so->so_rcv.sb_cc == 0)) {
5583 error = so->so_error;
5584 if ((in_flags & MSG_PEEK) == 0)
5588 if (so->so_rcv.sb_cc == 0) {
5595 if (so->so_rcv.sb_cc <= held_length) {
5597 error = so->so_error;
5598 if ((in_flags & MSG_PEEK) == 0) {
5603 if ((so->so_rcv.sb_cc == 0) &&
5620 so->so_state &= ~(SS_ISCONNECTING |
5621 SS_ISDISCONNECTING |
5633 if (block_allowed) {
5634 error = sbwait(&so->so_rcv);
5639 goto restart_nosblocks;
5642 error = EWOULDBLOCK;
5646 if (hold_sblock == 1) {
5647 SOCKBUF_UNLOCK(&so->so_rcv);
5659 if (hold_rlock == 0) {
5663 if ((
control == NULL) && (so->so_rcv.sb_cc != 0)) {
5665 panic(
"Huh, its non zero and nothing on control?");
5667 so->so_rcv.sb_cc = 0;
5681 if (hold_rlock == 0) {
5691 m_tmp = control->
data;
5714 if ((control->
length == 0) &&
5720 if (hold_rlock == 0) {
5725 if (control->
data) {
5727 panic(
"control->data not null but control->length == 0");
5729 SCTP_PRINTF(
"Strange, data left in the control buffer. Cleaning up.\n");
5731 control->
data = NULL;
5740 panic(
"About to free ctl:%p so:%p and its in %d",
5752 if (control->
length == 0) {
5756 ctl = TAILQ_NEXT(control,
next);
5758 if ((ctl->stcb != control->
stcb) && (ctl->length) &&
5761 ((ctl->do_not_ref_stcb == 0) &&
5762 (ctl->stcb->asoc.strmin[ctl->sinfo_stream].delivery_started == 0)))
5775 ((ctl->some_taken) ||
5776 ((ctl->do_not_ref_stcb == 0) &&
5778 (ctl->stcb->asoc.strmin[ctl->sinfo_stream].delivery_started == 0)))) {
5790 ctl = TAILQ_NEXT(ctl,
next);
5798 held_length = so->so_rcv.sb_cc;
5809 if (hold_rlock == 0) {
5814 stcb = control->
stcb;
5818 if (freecnt_applied == 0)
5829 if (freecnt_applied) {
5831 panic(
"refcnt already incremented");
5837 freecnt_applied = 1;
5859 if ((sinfo != NULL) && (filling_sinfo != 0)) {
5869 nxt = TAILQ_NEXT(control,
next);
5888 if (nxt->tail_mbuf != NULL) {
5889 if (nxt->end_added) {
5922#ifdef SCTP_ASOCLOG_OF_TSNS
5924 int index, newindex;
5928 index = inp->readlog_index;
5929 newindex = index + 1;
5933 }
while (atomic_cmpset_int(&inp->readlog_index, index, newindex) == 0);
5934 entry = &inp->readlog[index];
5942 if ((fromlen > 0) && (from != NULL)) {
5949 len =
sizeof(
struct sockaddr_in6);
5958 len =
sizeof(
struct sockaddr_in6);
5978 memcpy(from, &store, min((
size_t)fromlen, len));
5981 struct sockaddr_in6 lsa6, *from6;
5983 from6 = (
struct sockaddr_in6 *)from;
5984 sctp_recover_scope_mac(from6, (&lsa6));
5993 SOCKBUF_UNLOCK(&so->so_rcv);
6003 cp_len = uio->uio_resid;
6005 if (cp_len > my_len) {
6014 error = uiomove(mtod(m,
char *), (
int)cp_len, uio);
6033 out_flags |= MSG_EOR;
6035 (control->
stcb != NULL) &&
6040 out_flags |= MSG_NOTIFICATION;
6043 if (in_flags & MSG_PEEK) {
6046 copied_so_far += cp_len;
6058 copied_so_far += cp_len;
6060 freed_so_far += MSIZE;
6061 atomic_subtract_int(&control->
length, (
int)cp_len);
6068 if (control->
data == NULL) {
6071 (TAILQ_NEXT(control,
next) == NULL)) {
6080 panic(
"Hmm we don't own the lock?");
6086 if ((control->
end_added) && ((out_flags & MSG_EOR) == 0)) {
6087 panic(
"end_added, nothing left and no MSG_EOR");
6095 out_flags |= MSG_NOTIFICATION;
6097 if ((in_flags & MSG_PEEK) == 0) {
6103 atomic_subtract_int(&so->so_rcv.sb_cc, (
int)cp_len);
6106 atomic_subtract_int(&stcb->
asoc.
sb_cc, (
int)cp_len);
6108 copied_so_far += cp_len;
6110 freed_so_far += MSIZE;
6115 atomic_subtract_int(&control->
length, (
int)cp_len);
6117 copied_so_far += cp_len;
6120 if ((out_flags & MSG_EOR) || (uio->uio_resid == 0)) {
6123 if (((stcb) && (in_flags & MSG_PEEK) == 0) &&
6125 (freed_so_far >= rwnd_req)) {
6134 if ((out_flags & MSG_EOR) && ((in_flags & MSG_PEEK) == 0)) {
6136 if (control->
length == 0) {
6137 if (control->
data) {
6139 panic(
"control->data not null at read eor?");
6141 SCTP_PRINTF(
"Strange, data left in the control buffer .. invarients would panic?\n");
6143 control->
data = NULL;
6147 if (hold_rlock == 0) {
6156 wakeup_read_socket = 1;
6164 control->
data = NULL;
6167 panic(
"About to free ctl:%p so:%p and its in %d",
6173 if ((freed_so_far >= rwnd_req) &&
6174 (no_rcv_needed == 0))
6186 (control->
data == NULL) &&
6188 panic(
"Gak, control->length is corrupt?");
6192 out_flags &= ~MSG_EOR;
6195 if (out_flags & MSG_EOR) {
6198 if ((uio->uio_resid == 0) ||
6200 (copied_so_far >= max(so->so_rcv.sb_lowat, 1)))) {
6208 if (block_allowed == 0) {
6222 if (((stcb) && (in_flags & MSG_PEEK) == 0) &&
6223 ((freed_so_far >= rwnd_req) &&
6225 (no_rcv_needed == 0))) {
6229 if (so->so_rcv.sb_state & SBS_CANTRCVMORE) {
6236 if (hold_rlock == 1) {
6240 if (hold_sblock == 0) {
6241 SOCKBUF_LOCK(&so->so_rcv);
6244 if ((copied_so_far) && (control->
length == 0) &&
6249 error = sbwait(&so->so_rcv);
6256 SOCKBUF_UNLOCK(&so->so_rcv);
6259 if (control->
length == 0) {
6263 out_flags |= MSG_EOR;
6268 out_flags |= MSG_TRUNC;
6273 goto done_with_control;
6275 if (so->so_rcv.sb_cc > held_length) {
6279 goto wait_some_more;
6280 }
else if (control->
data == NULL) {
6286 if ((control->
length > 0) && (control->
data == NULL)) {
6292 panic(
"Impossible data==NULL length !=0");
6294 out_flags |= MSG_EOR;
6295 out_flags |= MSG_TRUNC;
6298 goto done_with_control;
6309 wakeup_read_socket = 0;
6311 (TAILQ_NEXT(control,
next) == NULL)) {
6313 if (hold_rlock == 0) {
6319 out_flags |= MSG_EOR;
6321 (control->
stcb != NULL) &&
6326 out_flags |= MSG_NOTIFICATION;
6328 uio->uio_resid = control->
length;
6329 *mp = control->
data;
6338 freed_so_far += MSIZE;
6347 if (out_flags & MSG_EOR) {
6349 goto done_with_control;
6353 if (hold_rlock == 1) {
6357 if (hold_sblock == 1) {
6358 SOCKBUF_UNLOCK(&so->so_rcv);
6362 SOCK_IO_RECV_UNLOCK(so);
6367 SOCKBUF_UNLOCK(&so->so_rcv);
6370 if ((stcb) && (in_flags & MSG_PEEK) == 0) {
6371 if ((freed_so_far >= rwnd_req) &&
6373 (no_rcv_needed == 0))
6378 *msg_flags = out_flags;
6380 if (((out_flags & MSG_EOR) == 0) &&
6381 ((in_flags & MSG_PEEK) == 0) &&
6390 if (hold_rlock == 1) {
6394 SOCKBUF_UNLOCK(&so->so_rcv);
6397 SOCK_IO_RECV_UNLOCK(so);
6400 if (freecnt_applied) {
6409 panic(
"stcb for refcnt has gone NULL?");
6423 (
uint32_t)((uio) ? (slen - uio->uio_resid) : slen),
6429 (
uint32_t)((uio) ? (slen - uio->uio_resid) : slen),
6435 if (wakeup_read_socket) {
6441#ifdef SCTP_MBUF_LOGGING
6473 return (EADDRNOTAVAIL);
6486 memset(wi, 0,
sizeof(*wi));
6509 struct sockaddr **psa,
6512 struct mbuf **controlp,
6517 struct sockaddr *from;
6519 int filling_sinfo = 1;
6532 (controlp == NULL)) {
6537 from = (
struct sockaddr *)sockbuf;
6538 fromlen =
sizeof(sockbuf);
6545 if (filling_sinfo) {
6548 if (flagsp != NULL) {
6555 if (flagsp != NULL) {
6558 if (controlp != NULL) {
6560 if (filling_sinfo && ((flags & MSG_NOTIFICATION) == 0)) {
6569 if (from && from->sa_len) {
6570 *psa = sodupsockaddr(from, M_NOWAIT);
6580 int totaddr,
int *error)
6585 struct sockaddr *sa;
6591 struct sockaddr_in6 *sin6;
6597 for (i = 0; i < totaddr; i++) {
6598 switch (sa->sa_family) {
6627 incr =
sizeof(
struct sockaddr_in6);
6628 sin6 = (
struct sockaddr_in6 *)sa;
6629 if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr) ||
6630 IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) {
6653 sa = (
struct sockaddr *)((caddr_t)sa + incr);
6661 unsigned int totaddr,
6662 unsigned int *num_v4,
unsigned int *num_v6,
6665 struct sockaddr *sa;
6667 unsigned int incr, at, i;
6671 *num_v6 = *num_v4 = 0;
6676 for (i = 0; i < totaddr; i++) {
6677 if (at +
sizeof(
struct sockaddr) > limit) {
6680 switch (sa->sa_family) {
6684 if (sa->sa_len != incr) {
6693 struct sockaddr_in6 *sin6;
6695 incr = (
unsigned int)
sizeof(
struct sockaddr_in6);
6696 if (sa->sa_len != incr) {
6699 sin6 = (
struct sockaddr_in6 *)sa;
6700 if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) {
6711 if ((at + incr) > limit) {
6723 sa = (
struct sockaddr *)((caddr_t)sa + incr);
6734 struct sockaddr *sa,
uint32_t vrf_id,
int *error,
6737#if defined(INET) && defined(INET6)
6741 struct sockaddr_in6 *sin6;
6746 struct sockaddr *addr_to_use;
6756 switch (sa->sa_family) {
6759 if (sa->sa_len !=
sizeof(
struct sockaddr_in6)) {
6770 sin6 = (
struct sockaddr_in6 *)sa;
6771 port = sin6->sin6_port;
6773 if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) {
6781 in6_sin6_2_sin(&sin, sin6);
6782 addr_to_use = (
struct sockaddr *)&sin;
6826 if ((port != 0) && (port != inp->sctp_lport)) {
6838 *error = EADDRINUSE;
6850 struct sockaddr *sa,
uint32_t vrf_id,
int *error)
6852 struct sockaddr *addr_to_use;
6853#if defined(INET) && defined(INET6)
6854 struct sockaddr_in6 *sin6;
6864 switch (sa->sa_family) {
6867 if (sa->sa_len !=
sizeof(
struct sockaddr_in6)) {
6879 sin6 = (
struct sockaddr_in6 *)sa;
6880 if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) {
6888 in6_sin6_2_sin(&sin, sin6);
6889 addr_to_use = (
struct sockaddr *)&sin;
6934 int ipv4_local_scope, ipv4_addr_legal;
6937 int local_scope, site_scope, ipv6_addr_legal;
6968 if ((loopback_scope == 0) &&
6978 if (ipv4_addr_legal) {
6993 if ((ipv4_local_scope == 0) &&
7006 if (ipv6_addr_legal) {
7007 struct sockaddr_in6 *sin6;
7010 if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) {
7014 &sin6->sin6_addr) != 0) {
7017 if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) {
7018 if (local_scope == 0)
7020 if (sin6->sin6_scope_id == 0) {
7021 if (sa6_recoverscope(sin6) != 0)
7034 if ((site_scope == 0) &&
7035 (IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr))) {
7068#if defined(SCTP_LOCAL_TRACE_BUF)
7080 newindex = saveindex + 1;
7105 struct mbuf *sp, *last;
7109 if ((m->m_flags & M_PKTHDR) == 0) {
7114 iph = mtod(m,
struct ip *);
7115 uhdr = (
struct udphdr *)((caddr_t)iph + off);
7121 sp = m_split(m, off, M_NOWAIT);
7126 if (sp->m_pkthdr.len <
sizeof(
struct udphdr) +
sizeof(
struct sctphdr)) {
7132 sp = m_pullup(sp,
sizeof(
struct udphdr) +
sizeof(
struct sctphdr));
7138 m_adj(sp,
sizeof(
struct udphdr));
7141 for (last = m; last->m_next; last = last->m_next);
7143 m->m_pkthdr.len += sp->m_pkthdr.len;
7151 "sctp_recv_udp_tunneled_packet(): Packet of length %d received on %s with csum_flags 0x%b.\n",
7153 if_name(m->m_pkthdr.rcvif),
7154 (
int)m->m_pkthdr.csum_flags, CSUM_BITS);
7155 m->m_pkthdr.csum_flags &= ~CSUM_DATA_VALID;
7156 iph = mtod(m,
struct ip *);
7157 switch (iph->
ip_v) {
7161 sctp_input_with_port(m, off, port);
7166 ip6 = mtod(m,
struct ip6_hdr *);
7167 ip6->ip6_plen = htons(ntohs(ip6->ip6_plen) -
sizeof(
struct udphdr));
7168 sctp6_input_with_port(&m, &off, port);
7182sctp_recv_icmp_tunneled_packet(
int cmd,
struct sockaddr *sa,
void *vip,
void *ctx
SCTP_UNUSED)
7184 struct ip *outer_ip, *inner_ip;
7195 inner_ip = (
struct ip *)vip;
7196 icmp = (
struct icmp *)((caddr_t)inner_ip -
7197 (
sizeof(
struct icmp) - sizeof(struct
ip)));
7198 outer_ip = (
struct ip *)((caddr_t)
icmp -
sizeof(
struct ip));
7199 if (ntohs(outer_ip->
ip_len) <
7200 sizeof(
struct ip) + 8 + (inner_ip->
ip_hl << 2) + sizeof(struct
udphdr) + 8) {
7203 udp = (
struct udphdr *)((caddr_t)inner_ip + (inner_ip->
ip_hl << 2));
7204 sh = (
struct sctphdr *)(udp + 1);
7206 src.sin_family = AF_INET;
7209 src.sin_addr = inner_ip->ip_src;
7211 dst.sin_family = AF_INET;
7214 dst.sin_addr = inner_ip->
ip_dst;
7223 (
struct sockaddr *)&src,
7226 if ((stcb != NULL) &&
7236 if (ntohl(sh->
v_tag) != 0) {
7247 if (ntohs(outer_ip->
ip_len) >=
7249 8 + (inner_ip->
ip_hl << 2) + 8 + 20) {
7276 if ((stcb == NULL) && (inp != NULL)) {
7292sctp_recv_icmp6_tunneled_packet(
int cmd,
struct sockaddr *sa,
void *d,
void *ctx
SCTP_UNUSED)
7294 struct ip6ctlparam *ip6cp;
7300 struct sockaddr_in6 src, dst;
7303 ip6cp = (
struct ip6ctlparam *)d;
7307 if (ip6cp->ip6c_m == NULL) {
7314 if (ip6cp->ip6c_m->m_pkthdr.len <
7315 ip6cp->ip6c_off +
sizeof(
struct udphdr) + offsetof(
struct sctphdr, checksum)) {
7319 memset(&udp, 0,
sizeof(
struct udphdr));
7320 m_copydata(ip6cp->ip6c_m,
7325 memset(&sh, 0,
sizeof(
struct sctphdr));
7326 m_copydata(ip6cp->ip6c_m,
7327 ip6cp->ip6c_off +
sizeof(
struct udphdr),
7330 memset(&src, 0,
sizeof(
struct sockaddr_in6));
7331 src.sin6_family = AF_INET6;
7332 src.sin6_len =
sizeof(
struct sockaddr_in6);
7334 src.sin6_addr = ip6cp->ip6c_ip6->ip6_src;
7335 if (in6_setscope(&src.sin6_addr, ip6cp->ip6c_m->m_pkthdr.rcvif, NULL) != 0) {
7338 memset(&dst, 0,
sizeof(
struct sockaddr_in6));
7339 dst.sin6_family = AF_INET6;
7340 dst.sin6_len =
sizeof(
struct sockaddr_in6);
7342 dst.sin6_addr = ip6cp->ip6c_ip6->ip6_dst;
7343 if (in6_setscope(&dst.sin6_addr, ip6cp->ip6c_m->m_pkthdr.rcvif, NULL) != 0) {
7349 (
struct sockaddr *)&src,
7351 if ((stcb != NULL) &&
7361 if (ntohl(sh.
v_tag) != 0) {
7372 if (ip6cp->ip6c_m->m_pkthdr.len >=
7373 ip6cp->ip6c_off +
sizeof(
struct udphdr) +
7385 m_copydata(ip6cp->ip6c_m,
7390 (caddr_t)&chunk_type);
7391 m_copydata(ip6cp->ip6c_m,
7397 (caddr_t)&initiate_tag);
7408 type = ip6cp->ip6c_icmp6->icmp6_type;
7409 code = ip6cp->ip6c_icmp6->icmp6_code;
7415 sctp6_notify(inp, stcb, net, type, code,
7416 ntohl(ip6cp->ip6c_icmp6->icmp6_mtu));
7418 if ((stcb == NULL) && (inp != NULL)) {
7461 struct sockaddr_in6 sin6;
7468 if (ntohs(port) == 0) {
7487 curthread->td_ucred, curthread))) {
7494 sctp_recv_icmp_tunneled_packet,
7505 (
struct sockaddr *)&sin, curthread))) {
7513 curthread->td_ucred, curthread))) {
7520 sctp_recv_icmp6_tunneled_packet,
7526 memset(&sin6, 0,
sizeof(
struct sockaddr_in6));
7527 sin6.sin6_len =
sizeof(
struct sockaddr_in6);
7528 sin6.sin6_family = AF_INET6;
7529 sin6.sin6_port = htons(port);
7531 (
struct sockaddr *)&sin6, curthread))) {
7549 return (min(mtu1, min(mtu2, mtu3)));
7551 return (min(mtu1, mtu2));
7555 return (min(mtu1, mtu3));
7563 return (min(mtu2, mtu3));
7580 switch (addr->
sa.sa_family) {
7589 inc.inc6_faddr = addr->
sin6.sin6_addr;
7605 switch (addr->
sa.sa_family) {
7614 inc.inc6_faddr = addr->
sin6.sin6_addr;
7626#if defined(KDTRACE_HOOKS)
7631 (
"sctp_set_state: Can't set substate (new_state = %x)",
7639#if defined(KDTRACE_HOOKS)
7643 SCTP_PROBE6(state__change, NULL, stcb, NULL, stcb, NULL, old_state);
7651#if defined(KDTRACE_HOOKS)
7656 (
"sctp_add_substate: Can't set state (substate = %x)",
7659#if defined(KDTRACE_HOOKS)
7664 SCTP_PROBE6(state__change, NULL, stcb, NULL, stcb, NULL, old_state);
#define ICMP6_DST_UNREACH
#define ICMP6_DST_UNREACH_NOPORT
#define ICMP6_PARAMPROB_NEXTHEADER
int prison_check_ip4(const struct ucred *cred, const struct in_addr *ia)
#define IN6P_AUTOFLOWLABEL
#define ICMP_UNREACH_PROTOCOL
#define ICMP_UNREACH_PORT
#define SCTP_DATA_FIRST_FRAG
#define SCTP_PCB_FLAGS_INTERLEAVE_STRMS
#define SCTP_PCB_FLAGS_DONT_WAKE
#define SCTP_SB_LOGGING_ENABLE
#define SCTP_INITIATION_ACK
#define SCTP_SHUTDOWN_SENT
#define SCTP_PCB_FLAGS_BOUND_V6
#define SCTP_PCB_FLAGS_TCPTYPE
#define SCTP_PCB_FLAGS_SOCKET_ALLGONE
#define SCTP_PCB_FLAGS_PDAPIEVNT
#define SCTP_DATA_UNORDERED
#define SCTP_PCB_FLAGS_STREAM_RESETEVNT
#define SCTP_PCB_FLAGS_EXT_RCVINFO
#define SCTP_PCB_FLAGS_WAKEINPUT
#define SCTP_PCB_FLAGS_UNBOUND
#define SCTP_MBCNT_LOGGING_ENABLE
#define SCTP_PCB_FLAGS_WAS_CONNECTED
#define SCTP_PACKET_DROPPED
#define SCTP_PCB_FLAGS_RECVNXTINFO
#define SCTP_PCB_FLAGS_SOCKET_CANT_READ
#define SCTP_PCB_FLAGS_RECVPADDREVNT
#define SCTP_PCB_FLAGS_RECVSENDFAILEVNT
#define SCTP_PCB_FLAGS_IN_TCPPOOL
#define SCTP_PCB_FLAGS_SOCKET_GONE
#define SCTP_DATA_NOT_FRAG
#define SCTP_PCB_FLAGS_RECVDATAIOEVNT
#define SCTP_RECV_RWND_LOGGING_ENABLE
#define SCTP_PCB_FLAGS_EXPLICIT_EOR
#define SCTP_PCB_FLAGS_WAS_ABORTED
#define SCTP_STREAM_RESET_INCOMING
#define SCTP_DATA_LAST_FRAG
#define SCTP_PCB_FLAGS_DRYEVNT
#define SCTP_PCB_FLAGS_CONNECTED
#define SCTP_SHUTDOWN_ACK
#define SCTP_SHUTDOWN_ACK_SENT
#define SCTP_RTTVAR_LOGGING_ENABLE
#define SCTP_PCB_FLAGS_ASSOC_RESETEVNT
#define SCTP_PCB_FLAGS_RECVASSOCEVNT
#define SCTP_SHUTDOWN_COMPLETE
#define SCTP_PCB_FLAGS_RECVPEERERR
#define SCTP_PCB_FLAGS_WAKEOUTPUT
#define SCTP_SAT_NETWORK_MIN
#define SCTP_MBUF_LOGGING_ENABLE
#define SCTP_PCB_FLAGS_STREAM_CHANGEEVNT
#define SCTP_ABORT_ASSOCIATION
#define SCTP_SHUTDOWN_PENDING
#define SCTP_SHUTDOWN_RECEIVED
#define SCTP_CAUSE_NO_USER_DATA
#define SCTP_PCB_FLAGS_RECVRCVINFO
#define SCTP_PCB_FLAGS_NEEDS_MAPPED_V4
#define SCTP_PCB_FLAGS_RECVSHUTDOWNEVNT
#define SCTP_PCB_FLAGS_ADAPTATIONEVNT
#define SCTP_PCB_FLAGS_RECVNSENDFAILEVNT
#define SCTP_COOKIE_ECHOED
#define SCTP_PCB_FLAGS_BOUNDALL
#define SCTP_PCB_FLAGS_FRAG_INTERLEAVE
uint32_t sctp_addr_mgmt_ep_sa(struct sctp_inpcb *inp, struct sockaddr *sa, uint32_t type, uint32_t vrf_id)
int sctp_asconf_iterator_ep(struct sctp_inpcb *inp, void *ptr, uint32_t val SCTP_UNUSED)
void sctp_asconf_iterator_end(void *ptr, uint32_t val SCTP_UNUSED)
void sctp_asconf_iterator_stcb(struct sctp_inpcb *inp, struct sctp_tcb *stcb, void *ptr, uint32_t val SCTP_UNUSED)
void sctp_notify_authentication(struct sctp_tcb *stcb, uint32_t indication, uint16_t keyid, uint16_t alt_keyid, int so_locked)
uint32_t sctp_hmac(uint16_t hmac_algo, uint8_t *key, uint32_t keylen, uint8_t *text, uint32_t textlen, uint8_t *digest)
struct mbuf * sctp_get_mbuf_for_msg(unsigned int space_needed, int want_header, int how, int allonebuf, int type)
struct iterator_control sctp_it_ctl
#define SCTP_OUTPUT_FROM_SACK_TMR
#define SCTP_LOG_LOCK_EVENT
#define SCTP_NOTIFY_ASCONF_DELETE_IP
#define IN4_ISPRIVATE_ADDRESS(a)
#define SCTP_MAPPING_ARRAY_INCR
#define SCTP_NOTIFY_ASSOC_LOC_ABORTED
#define SCTP_NOTIFY_AUTH_FREE_KEY
#define SCTP_TIMER_TYPE_SHUTDOWNACK
#define SCTP_LOG_EVENT_BLOCK
#define SCTP_STATE_COOKIE_ECHOED
#define SCTP_ADD_IP_ADDRESS
#define SCTP_INP_KILL_TIMEOUT
#define SCTP_DATAGRAM_NR_ACKED
#define SCTP_FROM_SCTPUTIL
#define SCTP_NOTIFY_SENDER_DRY
#define SCTP_STATE_WAS_ABORTED
#define SCTP_OUTPUT_FROM_STRRST_TMR
#define SCTP_TIMER_MAXSHUTDOWN
#define SCTP_CLOCK_GRANULARITY
#define SCTP_ADD_SUBSTATE(_stcb, _substate)
#define SCTP_TIMER_SIGNATURE
#define SCTP_OUTPUT_FROM_T3
#define SCTP_NOTIFY_STR_RESET_DENIED_IN
#define SCTP_ITERATOR_MAX_AT_ONCE
#define SCTP_TIMER_TYPE_ASOCKILL
#define SCTP_DATAGRAM_RESEND
#define SCTP_NOTIFY_STR_RESET_FAILED_OUT
#define SCTP_LOG_EVENT_SB
#define SCTP_RTO_UPPER_BOUND
#define SCTP_NOTIFY_PEER_SHUTDOWN
#define SCTP_SO_NOT_LOCKED
#define SCTP_CWNDLOG_PRESEND
#define SCTP_NUMBER_OF_SECRETS
#define SCTP_TIMER_TYPE_HEARTBEAT
#define SCTP_SORECV_ENTERPL
#define SCTP_DEL_IP_ADDRESS
#define SCTP_LOG_EVENT_WAKE
#define SCTP_NOTIFY_AUTH_NEW_KEY
#define SCTP_NOTIFY_REMOTE_ERROR
#define SCTP_LOG_EVENT_NAGLE
#define SCTP_NOTIFY_INTERFACE_UP
#define SCTP_SIGNATURE_SIZE
#define SCTP_LOG_SBRESULT
#define SCTP_TIMER_TYPE_INIT
#define SCTP_HOW_MANY_SECRETS
#define SCTP_OUTPUT_FROM_ASCONF_TMR
#define SCTP_LOG_EVENT_FR
#define SCTP_NOTIFY_STR_RESET_DENIED_OUT
#define sctp_sorwakeup(inp, so)
#define SCTP_GETPTIME_TIMEVAL(x)
#define SCTP_LOG_EVENT_CLOSE
#define SCTP_NOTIFY_UNSENT_DG_FAIL
#define SCTP_ADDR_NO_PMTUD
#define SCTP_DEBUG_CRCOFFLOAD
#define SCTP_STATE_SHUTDOWN_PENDING
#define SCTP_CALLED_DIRECTLY_NOCMPSET
#define SCTP_DEBUG_TIMER2
#define SCTP_TIMER_TYPE_PRIM_DELETED
#define SCTP_ADDR_UNCONFIRMED
#define SCTP_TIMER_TYPE_STRRESET
#define SCTP_LOG_EVENT_MBUF
#define SCTP_LAN_INTERNET
#define SCTP_CHUNK_BUFFER_SIZE
#define SCTP_TIMER_TYPE_RECV
#define SCTP_CLEAR_SUBSTATE(_stcb, _substate)
#define SCTP_DONOT_SETSCOPE
#define SCTP_LOG_EVENT_RWND
#define SCTP_OUTPUT_FROM_SHUT_TMR
#define SCTP_NOTIFY_SENT_DG_FAIL
#define SCTP_NOTIFY_ASCONF_ADD_IP
#define SCTP_INITIAL_MAPPING_ARRAY
#define SCTP_NOTIFY_STR_RESET_RECV
#define SCTP_STATE_SHUTDOWN_ACK_SENT
#define SCTP_NOTIFY_INTERFACE_CONFIRMED
#define SCTP_OUTPUT_FROM_USR_RCVD
#define SCTP_LOCAL_LAN_RTT
#define SCTP_TIMER_TYPE_SHUTDOWNGUARD
#define SCTP_GET_STATE(_stcb)
#define SCTP_NOTIFY_ASSOC_REM_ABORTED
#define SCTP_ADDR_IS_CONFIRMED
#define SCTP_NOTIFY_ASSOC_UP
#define SCTP_GETTIME_TIMEVAL(x)
#define SCTP_LOG_EVENT_STRM
#define SCTP_STATE_CLOSED_SOCKET
#define SCTP_RTT_FROM_DATA
#define SCTP_LOCK_UNKNOWN
#define SCTP_NOTIFY_NO_PEER_AUTH
#define SCTP_NOTIFY_PARTIAL_DELVIERY_INDICATION
#define SCTP_OUTPUT_FROM_HB_TMR
#define SCTP_TIMER_TYPE_PATHMTURAISE
#define SCTP_OUTPUT_FROM_AUTOCLOSE_TMR
#define SCTP_NOTIFY_ASSOC_DOWN
#define SCTP_NOTIFY_SPECIAL_SP_FAIL
#define SCTP_STATE_COOKIE_WAIT
#define SCTP_NOTIFY_STR_RESET_FAILED_IN
#define SCTP_ADDRESS_TICK_DELAY
#define SCTP_TIMER_TYPE_SHUTDOWN
#define SCTP_ASOC_KILL_TIMEOUT
#define SCTP_STATE_SHUTDOWN_SENT
#define SCTP_LOG_EVENT_MAXBURST
#define SCTP_RWND_HIWAT_SHIFT
#define SCTP_NOTIFY_STR_RESET_SEND
#define SCTP_LOG_EVENT_SACK
#define SCTP_STATE_SHUTDOWN_RECEIVED
#define SCTP_LOG_EVENT_CWND
#define SCTP_IS_TIMER_TYPE_VALID(t)
#define SCTP_CALLED_FROM_INPKILL_TIMER
#define SCTP_SET_PRIM_ADDR
#define SCTP_STATE_ABOUT_TO_BE_FREED
#define SCTP_SORECV_ENTER
#define SCTP_LOG_MBCNT_DECREASE
#define SCTP_NOTIFY_INTERFACE_DOWN
#define sctp_sowwakeup(inp, so)
#define SCTP_LOG_INITIAL_RTT
#define SCTP_OUTPUT_FROM_SHUT_ACK_TMR
#define SCTP_SET_STATE(_stcb, _state)
#define SCTP_TIMER_TYPE_AUTOCLOSE
#define SCTP_LOG_EVENT_MAP
#define SCTP_TIMER_TYPE_INPKILL
#define SCTP_TIMER_TYPE_ASCONF
#define SCTP_ADDR_BEING_DELETED
#define SCTP_NOTIFY_ASCONF_SET_PRIMARY
#define SCTP_LOG_EVENT_RTT
#define SCTP_FORWARD_TSN_SKIP
#define SCTP_NOTIFY_ASSOC_TIMEDOUT
#define SCTP_LOG_MISC_EVENT
#define SCTP_MID_EQ(i, a, b)
#define SCTP_TIMER_HEARTBEAT
#define SCTP_LOG_EVENT_MBCNT
#define SCTP_TIMER_TYPE_SEND
#define SCTP_MAX_CAUSE_LENGTH
#define SCTP_FREE_SHOULD_USE_ABORT
#define SCTP_ADDR_NOT_LOCKED
#define SCTP_TIMER_TYPE_NEWCOOKIE
#define SCTP_MINIMAL_RWND
#define SCTP_TIMER_TYPE_NONE
#define SCTP_TIMER_TYPE_COOKIE
#define SCTP_TIMER_TYPE_ADDR_WQ
#define SCTP_NOTIFY_ASSOC_RESTART
uint32_t sctp_calc_rwnd(struct sctp_tcb *stcb, struct sctp_association *asoc)
struct mbuf * sctp_build_ctl_nchunk(struct sctp_inpcb *inp, struct sctp_sndrcvinfo *sinfo)
struct sctp_queued_to_read * sctp_build_readq_entry(struct sctp_tcb *stcb, struct sctp_nets *net, uint32_t tsn, uint32_t ppid, uint32_t context, uint16_t sid, uint32_t mid, uint8_t flags, struct mbuf *dm)
#define SCTP_PROBE6(probe, arg0, arg1, arg2, arg3, arg4, arg5)
#define SCTP_TCB_LOCK(_tcb)
#define SCTP_ITERATOR_UNLOCK()
#define SCTP_IPI_ADDR_RLOCK()
#define SCTP_IPI_ITERATOR_WQ_LOCK()
#define SCTP_INP_RLOCK(_inp)
#define SCTP_INP_INFO_RLOCK()
#define SCTP_INP_WLOCK_ASSERT(_inp)
#define SCTP_INP_READ_UNLOCK(_inp)
#define SCTP_IPI_ITERATOR_WQ_UNLOCK()
#define SCTP_IPI_ADDR_RUNLOCK()
#define SCTP_INCR_LADDR_COUNT()
#define SCTP_INP_WUNLOCK(_inp)
#define SCTP_WQ_ADDR_LOCK()
#define SCTP_TCB_SEND_UNLOCK(_tcb)
#define SCTP_IPI_ADDR_LOCK_ASSERT()
#define SCTP_INP_DECR_REF(_inp)
#define SCTP_INP_RLOCK_ASSERT(_inp)
#define SCTP_ITERATOR_LOCK()
#define SCTP_INP_INFO_RUNLOCK()
#define SCTP_WQ_ADDR_LOCK_ASSERT()
#define SCTP_INP_WLOCK(_inp)
#define SCTP_TCB_LOCK_ASSERT(_tcb)
#define SCTP_INP_INCR_REF(_inp)
#define SCTP_WQ_ADDR_UNLOCK()
#define SCTP_TCB_UNLOCK(_tcb)
#define SCTP_TCB_SEND_LOCK(_tcb)
#define SCTP_INP_READ_LOCK(_inp)
#define SCTP_INP_RUNLOCK(_inp)
#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_BUF_AT(m, size)
#define SCTP_OS_TIMER_PENDING
#define SCTP_BUF_RESV_UF(m, size)
#define SCTP_OS_TIMER_STOP
#define SCTP_MALLOC(var, type, size, name)
#define SCTP_BASE_INFO(__m)
#define SCTP_IPV6_V6ONLY(sctp_inpcb)
#define SCTP_PRINTF(params...)
#define SCTP_BASE_VAR(__m)
#define SCTP_OS_TIMER_DEACTIVATE
#define SCTP_BUF_EXTEND_REFCNT(m)
#define SCTP_OS_TIMER_ACTIVE
#define SCTP_FREE(var, type)
#define SCTP_DEFAULT_VRFID
#define SCTP_OS_TIMER_START
#define SCTP_BUF_IS_EXTENDED(m)
#define SCTPDBG(level, params...)
#define SCTP_SO_IS_NBIO(so)
#define SCTP_BUF_EXTEND_BASE(m)
#define SCTP_BASE_SYSCTL(__m)
#define SCTP_BUF_GET_FLAGS(m)
#define SCTP_SB_LIMIT_RCV(so)
#define sctp_get_tick_count()
int sctp_is_addr_restricted(struct sctp_tcb *stcb, struct sctp_ifa *ifa)
void sctp_fix_ecn_echo(struct sctp_association *asoc)
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_complete2(struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, uint8_t mflowtype, uint32_t mflowid, uint16_t fibnum, uint32_t vrf_id, uint16_t port)
void sctp_send_abort(struct mbuf *m, int iphlen, struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, uint32_t vtag, struct mbuf *cause, uint8_t mflowtype, uint32_t mflowid, uint16_t fibnum, uint32_t vrf_id, uint16_t port)
void sctp_chunk_output(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int from_where, int so_locked)
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)
int sctp_inpcb_bind(struct socket *so, struct sockaddr *addr, struct sctp_ifa *sctp_ifap, struct thread *td)
struct sctp_inpcb * sctp_pcb_findep(struct sockaddr *nam, int find_tcp_pool, int have_lock, uint32_t vrf_id)
void sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, int from)
int sctp_add_remote_addr(struct sctp_tcb *stcb, struct sockaddr *newaddr, struct sctp_nets **netp, uint16_t port, int set_scope, int from)
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)
bool sctp_is_vtag_good(uint32_t tag, uint16_t lport, uint16_t rport, struct timeval *now)
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)
struct sctp_vrf * sctp_find_vrf(uint32_t vrf_id)
#define SCTP_READ_LOG_SIZE
#define SCTP_ITERATOR_STOP_CUR_INP
#define SCTP_STREAM_OPENING
#define SCTP_ITERATOR_DO_SINGLE_INP
#define SCTP_ASOC_ANY_STATE
#define SCTP_ITERATOR_STOP_CUR_IT
#define SCTP_PCB_ANY_FEATURES
#define SCTP_TSN_LOG_SIZE
void sctp_delete_prim_timer(struct sctp_inpcb *inp, struct sctp_tcb *stcb)
int sctp_shutdown_timer(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net)
int sctp_asconf_timer(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net)
int sctp_strreset_timer(struct sctp_inpcb *inp, struct sctp_tcb *stcb)
int sctp_shutdownack_timer(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net)
void sctp_autoclose_timer(struct sctp_inpcb *inp, struct sctp_tcb *stcb)
int sctp_t1init_timer(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net)
int sctp_heartbeat_timer(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net)
int sctp_cookie_timer(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net SCTP_UNUSED)
int sctp_t3rxt_timer(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net)
void sctp_pathmtu_timer(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net)
#define SCTP_RTT_VAR_SHIFT
#define SCTP_ASSOC_SUPPORTS_PR
#define SCTP_STREAM_RESET_DENIED
#define SCTP_SHUTDOWN_COMP
#define SCTP_NEXT_MSG_IS_NOTIFICATION
#define SCTP_ASSOC_RESET_EVENT
#define SCTP_ASSOC_CHANGE
#define SCTP_MAX_LOGGING_SIZE
#define SCTP_NEXT_MSG_AVAIL
#define SCTP_ASSOC_SUPPORTS_MULTIBUF
#define SCTP_PEER_ADDR_CHANGE
#define SCTP_AUTH_FREE_KEY
#define SCTP_REMOTE_ERROR
#define SCTP_ADDR_CONFIRMED
#define SCTP_NEXT_MSG_ISCOMPLETE
#define SCTP_ASSOC_SUPPORTS_AUTH
#define SCTP_STAT_INCR_COUNTER32(_x)
#define PR_SCTP_BUF_ENABLED(x)
#define SCTP_ASSOC_SUPPORTS_RE_CONFIG
#define SCTP_SHUTDOWN_EVENT
#define SCTP_SEND_FAILED_EVENT
#define SCTP_CANT_STR_ASSOC
#define SCTP_AUTH_NEW_KEY
#define SCTP_ASSOC_SUPPORTS_MAX
#define SCTP_STREAM_RESET_FAILED
#define SCTP_STREAM_RESET_EVENT
#define SCTP_ASSOC_SUPPORTS_ASCONF
#define SCTP_ADDR_MADE_PRIM
#define SCTP_STREAM_RESET_OUTGOING_SSN
#define SCTP_ADDR_UNREACHABLE
#define SCTP_ADAPTATION_INDICATION
#define SCTP_ADDR_REMOVED
#define PR_SCTP_POLICY(x)
#define SCTP_STAT_INCR(_x)
#define SCTP_ADDR_AVAILABLE
#define SCTP_SENDER_DRY_EVENT
#define SCTP_ASSOC_SUPPORTS_INTERLEAVING
#define SCTP_STREAM_CHANGE_EVENT
#define SCTP_STAT_DECR_GAUGE32(_x)
#define SCTP_PARTIAL_DELIVERY_EVENT
#define SCTP_AUTH_NO_AUTH
#define SCTP_NEXT_MSG_IS_UNORDERED
#define sctp_free_a_chunk(_stcb, _chk, _so_locked)
#define sctp_flight_size_decrease(tp1)
#define sctp_total_flight_decrease(stcb, tp1)
#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_mbuf_crush(data)
void sctp_notify(struct sctp_inpcb *, struct sctp_tcb *, struct sctp_nets *, uint8_t, uint8_t, uint16_t, uint32_t)
#define sctp_free_a_readq(_stcb, _readq)
#define sctp_free_remote_addr(__net)
#define sctp_sbspace(asoc, sb)
#define sctp_stcb_is_feature_on(inp, stcb, feature)
#define sctp_sbspace_failedmsgs(sb)
#define sctp_sbfree(ctl, stcb, sb, m)
#define sctp_stcb_is_feature_off(inp, stcb, feature)
#define sctp_alloc_a_chunk(_stcb, _chk)
#define sctp_sballoc(stcb, sb, m)
int32_t sctp_map_assoc_state(int kernel_state)
void rto_logging(struct sctp_nets *net, int from)
struct sctp_ifa * sctp_find_ifa_in_ep(struct sctp_inpcb *inp, struct sockaddr *addr, int holds_lock)
void sctp_misc_ints(uint8_t from, uint32_t a, uint32_t b, uint32_t c, uint32_t d)
struct mbuf * sctp_add_pad_tombuf(struct mbuf *m, int padlen)
static void sctp_user_rcvd(struct sctp_tcb *stcb, uint32_t *freed_so_far, int hold_rlock, uint32_t rwnd_req)
uint32_t sctp_calculate_len(struct mbuf *m)
void sctp_add_substate(struct sctp_tcb *stcb, int substate)
struct mbuf * sctp_generate_no_user_data_cause(uint32_t tsn)
static void sctp_notify_sender_dry_event(struct sctp_tcb *stcb, int so_locked)
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_report_all_outbound(struct sctp_tcb *stcb, uint16_t error, int so_locked)
void sctp_stop_association_timers(struct sctp_tcb *stcb, bool stop_assoc_kill_timer)
int sctp_expand_mapping_array(struct sctp_association *asoc, uint32_t needed)
void sctp_log_maxburst(struct sctp_tcb *stcb, struct sctp_nets *net, int error, int burst, uint8_t from)
int sctp_local_addr_count(struct sctp_tcb *stcb)
struct sctp_paramhdr * sctp_get_next_param(struct mbuf *m, int offset, struct sctp_paramhdr *pull, int pull_limit)
void sctp_log_rwnd(uint8_t from, uint32_t peers_rwnd, uint32_t snd_size, uint32_t overhead)
struct mbuf * sctp_generate_cause(uint16_t code, char *info)
int sctp_calculate_rto(struct sctp_tcb *stcb, struct sctp_association *asoc, struct sctp_nets *net, struct timeval *old, int rtt_from_sack)
int sctp_over_udp_start(void)
void sctp_set_state(struct sctp_tcb *stcb, int new_state)
void sctp_wakeup_log(struct sctp_tcb *stcb, uint32_t wake_cnt, int from)
void sctp_over_udp_stop(void)
int sctp_fill_stat_log(void *optval SCTP_UNUSED, size_t *optsize SCTP_UNUSED)
void sctp_log_sack(uint32_t old_cumack, uint32_t cumack, uint32_t tsn, uint16_t gaps, uint16_t dups, int from)
void sctp_ulp_notify(uint32_t notification, struct sctp_tcb *stcb, uint32_t error, void *data, int so_locked)
static uint32_t sctp_mtu_sizes[]
void sctp_iterator_worker(void)
static void sctp_notify_assoc_change(uint16_t state, struct sctp_tcb *stcb, uint16_t error, struct sctp_abort_chunk *abort, bool from_peer, bool timedout, int so_locked)
uint32_t sctp_select_a_tag(struct sctp_inpcb *inp, uint16_t lport, uint16_t rport, int check)
void sctp_bindx_add_address(struct socket *so, struct sctp_inpcb *inp, struct sockaddr *sa, uint32_t vrf_id, int *error, void *p)
static void sctp_notify_peer_addr_change(struct sctp_tcb *stcb, uint32_t state, struct sockaddr *sa, uint32_t error, int so_locked)
static void sctp_notify_send_failed2(struct sctp_tcb *stcb, uint32_t error, struct sctp_stream_queue_pending *sp, int so_locked)
void sctp_sblog(struct sockbuf *sb, struct sctp_tcb *stcb, int from, int incr)
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)
void sctp_handle_ootb(struct mbuf *m, int iphlen, int offset, struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_inpcb *inp, struct mbuf *cause, uint8_t mflowtype, uint32_t mflowid, uint16_t fibnum, uint32_t vrf_id, uint16_t port)
uint32_t sctp_min_mtu(uint32_t mtu1, uint32_t mtu2, uint32_t mtu3)
void sctp_notify_stream_reset_tsn(struct sctp_tcb *stcb, uint32_t sending_tsn, uint32_t recv_tsn, int flag)
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)
void sctp_log_map(uint32_t map, uint32_t cum, uint32_t high, int from)
void sctp_print_address(struct sockaddr *sa)
void sctp_log_strm_del(struct sctp_queued_to_read *control, struct sctp_queued_to_read *poschk, int from)
int sctp_connectx_helper_find(struct sctp_inpcb *inp, struct sockaddr *addr, unsigned int totaddr, unsigned int *num_v4, unsigned int *num_v6, unsigned int limit)
static void sctp_iterator_work(struct sctp_iterator *it)
void sctp_print_mapping_array(struct sctp_association *asoc)
static void sctp_handle_addr_wq(void)
void sctp_log_rwnd_set(uint8_t from, uint32_t peers_rwnd, uint32_t flight_size, uint32_t overhead, uint32_t a_rwndval)
uint32_t sctp_get_prev_mtu(uint32_t val)
int sctp_dynamic_set_primary(struct sockaddr *sa, uint32_t vrf_id)
void sctp_log_block(uint8_t from, struct sctp_association *asoc, ssize_t sendlen)
static void sctp_recv_udp_tunneled_packet(struct mbuf *m, int off, struct inpcb *inp, const struct sockaddr *sa SCTP_UNUSED, void *ctx SCTP_UNUSED)
uint32_t sctp_ticks_to_secs(uint32_t ticks)
void sctp_bindx_delete_address(struct sctp_inpcb *inp, struct sockaddr *sa, uint32_t vrf_id, int *error)
void sctp_log_lock(struct sctp_inpcb *inp, struct sctp_tcb *stcb, uint8_t from)
void sctp_add_to_readq(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_queued_to_read *control, struct sockbuf *sb, int end, int inp_read_lock_held, int so_locked)
void sctp_notify_stream_reset_add(struct sctp_tcb *stcb, uint16_t numberin, uint16_t numberout, int flag)
void sctp_timeout_handler(void *t)
static void sctp_notify_send_failed(struct sctp_tcb *stcb, uint8_t sent, uint32_t error, struct sctp_tmit_chunk *chk, int so_locked)
void sctp_pull_off_control_to_new_inp(struct sctp_inpcb *old_inp, struct sctp_inpcb *new_inp, struct sctp_tcb *stcb, int waitflags)
static void sctp_notify_partial_delivery_indication(struct sctp_tcb *stcb, uint32_t error, uint32_t val, int so_locked)
uint32_t sctp_select_initial_TSN(struct sctp_pcb *inp)
void sctp_hc_set_mtu(union sctp_sockstore *addr, uint16_t fibnum, uint32_t mtu)
uint32_t sctp_get_next_mtu(uint32_t val)
void sctp_log_cwnd(struct sctp_tcb *stcb, struct sctp_nets *net, int augment, uint8_t from)
uint32_t sctp_get_ifa_hash_val(struct sockaddr *addr)
static void sctp_notify_remote_error(struct sctp_tcb *stcb, uint16_t error, struct sctp_error_chunk *chunk)
int sctp_soreceive(struct socket *so, struct sockaddr **psa, struct uio *uio, struct mbuf **mp0, struct mbuf **controlp, int *flagsp)
void sctp_log_fr(uint32_t biggest_tsn, uint32_t biggest_new_tsn, uint32_t tsn, int from)
void sctp_log_strm_del_alt(struct sctp_tcb *stcb, uint32_t tsn, uint16_t sseq, uint16_t stream, int from)
static void sctp_notify_adaptation_layer(struct sctp_tcb *stcb)
int sctp_cmpaddr(struct sockaddr *sa1, struct sockaddr *sa2)
static void sctp_notify_shutdown_event(struct sctp_tcb *stcb)
void sctp_log_closing(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int16_t loc)
void sctp_wakeup_the_read_socket(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int so_locked SCTP_UNUSED)
caddr_t sctp_m_getptr(struct mbuf *m, int off, int len, uint8_t *in_ptr)
static void sctp_notify_stream_reset(struct sctp_tcb *stcb, int number_entries, uint16_t *list, int flag)
void sctp_abort_association(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct mbuf *m, int iphlen, struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct mbuf *op_err, uint8_t mflowtype, uint32_t mflowid, uint32_t vrf_id, uint16_t port)
uint32_t sctp_secs_to_ticks(uint32_t secs)
uint32_t sctp_msecs_to_ticks(uint32_t msecs)
uint32_t sctp_ticks_to_msecs(uint32_t ticks)
int sctp_connectx_helper_add(struct sctp_tcb *stcb, struct sockaddr *addr, int totaddr, int *error)
void sctp_log_nagle_event(struct sctp_tcb *stcb, int action)
struct mbuf * sctp_pad_lastmbuf(struct mbuf *m, int padval, struct mbuf *last_mbuf)
int sctp_sorecvmsg(struct socket *so, struct uio *uio, struct mbuf **mp, struct sockaddr *from, int fromlen, int *msg_flags, struct sctp_sndrcvinfo *sinfo, int filling_sinfo)
void sctp_abort_notification(struct sctp_tcb *stcb, bool from_peer, bool timeout, uint16_t error, struct sctp_abort_chunk *abort, int so_locked)
int sctp_release_pr_sctp_chunk(struct sctp_tcb *stcb, struct sctp_tmit_chunk *tp1, uint8_t sent, int so_locked)
void sctp_stop_timers_for_shutdown(struct sctp_tcb *stcb)
int sctp_is_there_an_abort_here(struct mbuf *m, int iphlen, uint32_t *vtag)
#define sctp_get_associd(stcb)
#define sctp_free_bufspace(stcb, asoc, tp1, chk_cnt)
#define sctp_free_spbufspace(stcb, asoc, sp)
#define SCTP_READ_LOCK_NOT_HELD
struct in_addr ip_src ip_dst
struct sctpiterators iteratorhead
uint32_t iterator_running
struct sctp_iterator * cur_it
sctp_assoc_t sai_assoc_id
uint32_t sai_adaptation_ind
struct sctpladdr list_of_work
uint16_t sac_inbound_streams
uint16_t sac_outbound_streams
sctp_assoc_t sac_assoc_id
uint32_t assocreset_remote_tsn
uint16_t assocreset_flags
uint32_t assocreset_length
sctp_assoc_t assocreset_assoc_id
uint32_t assocreset_local_tsn
int16_t num_send_timers_up
uint16_t strm_realoutsize
uint16_t mapping_array_size
uint32_t total_output_queue_size
unsigned int sent_queue_retran_cnt
unsigned int sent_queue_cnt_removeable
uint16_t stream_locked_on
uint8_t peer_supports_nat
uint32_t highest_tsn_inside_map
struct sctp_timer asconf_timer
uint32_t str_reset_seq_out
uint32_t my_last_reported_rwnd
uint8_t adaptation_needed
struct sctpchunk_listhead send_queue
struct sctp_timer strreset_timer
struct sctp_stream_out * strmout
struct sctpladdr sctp_restricted_addrs
unsigned int total_flight_count
struct sctp_keyhead shared_keys
struct timeval start_time
uint32_t sctp_autoclose_ticks
struct sctpnetlisthead nets
uint8_t reconfig_supported
struct sctp_readhead pending_reply_queue
uint8_t sat_network_lockout
uint32_t asconf_seq_out_acked
struct sctp_timer dack_timer
struct sctp_asconf_ackhead asconf_ack_sent
struct sctpchunk_listhead free_chunks
uint32_t mapping_array_base_tsn
uint32_t peers_adaptation
uint32_t str_reset_seq_in
unsigned int total_flight
unsigned int stream_queue_cnt
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
uint32_t highest_tsn_inside_nr_map
unsigned int max_inbound_streams
uint16_t def_net_pf_threshold
uint64_t abandoned_unsent[SCTP_PR_SCTP_MAX+1]
struct sctp_timer delete_prim_timer
uint32_t congestion_control_module
struct sctp_scoping scope
uint8_t pktdrop_supported
uint32_t chunks_on_out_queue
unsigned int send_queue_cnt
uint64_t abandoned_sent[SCTP_PR_SCTP_MAX+1]
struct sctp_nonpad_sndrcvinfo def_send
uint16_t ecn_echo_cnt_onq
uint32_t heart_beat_delay
struct sctp_nets * primary_destination
uint32_t stream_scheduling_module
struct sctp_cc_functions cc_functions
struct sctpchunk_listhead sent_queue
unsigned int pre_open_streams
uint32_t initial_init_rto_max
uint32_t advanced_peer_ack_point
struct sctp_stream_in * strmin
uint8_t local_strreset_support
struct timeval discontinuity_time
unsigned int sent_queue_cnt
void(* sctp_rtt_calculated)(struct sctp_tcb *, struct sctp_nets *, struct timeval *)
uint8_t need_new_pseudo_cumack
uint8_t meets_pseudo_cumack
struct sctp_log_closing close
struct sctp_nagle_log nagle
struct sctp_misc_info misc
struct sctp_cwnd_args cwnd
struct sctp_mbcnt_log mbcnt
struct sctp_rwnd_log rwnd
struct sctp_sack_log sack
union sctp_cwnd_log::@37 x
struct sctp_lock_log lock
struct sctp_str_log strlog
struct sctp_sbwake_log wake
struct sctp_error_cause cause
uint16_t serinfo_next_stream
uint16_t serinfo_next_flags
uint32_t serinfo_next_length
uint32_t serinfo_next_aid
uint32_t serinfo_next_ppid
union sctp_sockstore address
struct sctp_ifalist ifalist
struct mtx inp_create_mtx
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 sctp_nonpad_sndrcvinfo def_send
struct sctpladdr sctp_addr_list
uint8_t pktdrop_supported
uint8_t local_strreset_support
inp_func function_inp_end
struct timeval start_time
uint32_t total_queue_size
union sctp_sockstore _l_addr
uint8_t new_pseudo_cumack
uint8_t find_pseudo_cumack
struct sockaddr_storage spc_aaddr
sctp_assoc_t spc_assoc_id
uint32_t initial_init_rto_max
uint32_t secret_key[SCTP_HOW_MANY_SECRETS][SCTP_NUMBER_OF_SECRETS]
char current_secret_number
uint8_t random_numbers[SCTP_SIGNATURE_ALOC_SIZE]
uint32_t sctp_default_ss_module
struct sctp_timer signature_change
uint32_t initial_sequence_debug
unsigned int sctp_sack_freq
uint16_t def_net_pf_threshold
unsigned int time_of_secret_change
uint16_t max_open_streams_intome
uint8_t random_store[SCTP_SIGNATURE_ALOC_SIZE]
uint32_t sctp_default_cc_module
uint32_t sctp_timeoutticks[SCTP_NUM_TMRS]
sctp_assoc_t pdapi_assoc_id
uint32_t pdapi_indication
uint32_t sinfo_timetolive
sctp_assoc_t sinfo_assoc_id
struct sctp_nets * whoFrom
sctp_assoc_t sre_assoc_id
sctp_assoc_t ssfe_assoc_id
struct sctp_sndinfo ssfe_info
struct sctp_sndrcvinfo ssf_info
sctp_assoc_t ssf_assoc_id
sctp_assoc_t sse_assoc_id
sctp_assoc_t snd_assoc_id
sctp_assoc_t sinfo_assoc_id
uint32_t sinfo_timetolive
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)
void(* sctp_ss_init)(struct sctp_tcb *stcb, struct sctp_association *asoc)
void(* sctp_ss_init_stream)(struct sctp_tcb *stcb, struct sctp_stream_out *strq, struct sctp_stream_out *with_strq)
sctp_assoc_t strchange_assoc_id
uint16_t strchange_instrms
uint16_t strchange_outstrms
uint32_t strchange_length
uint8_t last_msg_incomplete
uint32_t chunks_on_queues
uint32_t next_mid_ordered
uint32_t abandoned_unsent[1]
uint32_t next_mid_unordered
struct sctp_streamhead outqueue
uint32_t abandoned_sent[1]
sctp_assoc_t strreset_assoc_id
uint16_t strreset_stream_list[]
struct socket * sctp_socket
uint32_t freed_by_sorcv_sincelast
struct sctp_association asoc
struct sctp_inpcb * sctp_ep
union sctp_tmit_chunk::@34 rec
struct sctp_data_chunkrec data
struct sctp_association * asoc
struct sctp_ifnlist ifnlist
struct sctp_ifalist * vrf_addr_hash
uint32_t tcp_hc_getmtu(struct in_conninfo *inc)
void tcp_hc_updatemtu(struct in_conninfo *inc, uint32_t mtu)
int udp_set_kernel_tunneling(struct socket *so, udp_tun_func_t f, udp_tun_icmp_t i, void *ctx)