53#if defined(INET) || defined(INET6)
69 TAILQ_FOREACH(net, &stcb->
asoc.
nets, sctp_next) {
87 struct sockaddr *src,
struct sockaddr *dst,
struct sctphdr *sh,
112 mflowtype, mflowid, inp->
fibnum,
120 "Problem with AUTH parameters");
122 mflowtype, mflowid, inp->
fibnum,
127 if ((stcb == NULL) &&
147 mflowtype, mflowid, inp->
fibnum,
152 if ((stcb != NULL) &&
207 SCTP_PRINTF(
"Gak, put out entire msg with NO end!-1\n");
208 SCTP_PRINTF(
"sender_done:%d len:%d msg_comp:%d put_last_out:%d\n",
232 if (unsent_data > 0) {
238 return (unsent_data);
257 if (!TAILQ_EMPTY(&asoc->
nets)) {
259 TAILQ_FOREACH(lnet, &asoc->
nets, sctp_next) {
283 panic(
"No chunks on the queues for sid %u.", chk->
rec.
data.
sid);
286 if (chk->
data != NULL) {
393 struct sockaddr *src,
struct sockaddr *dst,
struct sctphdr *sh,
395 struct sctp_nets *net,
int *abort_no_unlock,
401 int retval, abort_flag, cookie_found;
403 int nat_friendly = 0;
412 &nat_friendly, &cookie_found);
416 *abort_no_unlock = 1;
423 if (op_err != NULL) {
429 if (op_err != NULL) {
437 cause->num_missing_params = htonl(1);
441 src, dst, sh, op_err,
444 *abort_no_unlock = 1;
451 if (op_err != NULL) {
457 src, dst, sh, op_err,
460 *abort_no_unlock = 1;
463 initack_limit = offset + ntohs(cp->ch.chunk_length);
467 initack_limit, src, dst, NULL, stcb->
asoc.
port)) < 0) {
468 if (op_err != NULL) {
472 "Problem with address parameters");
474 "Load addresses from INIT causes an abort %d\n",
477 src, dst, sh, op_err,
480 *abort_no_unlock = 1;
542 memset(&store, 0,
sizeof(store));
588 f_net = TAILQ_FIRST(&stcb->
asoc.
nets);
589 if (f_net != r_net) {
596 TAILQ_REMOVE(&stcb->
asoc.
nets, r_net, sctp_next);
597 TAILQ_INSERT_HEAD(&stcb->
asoc.
nets, r_net, sctp_next);
632 if (old_error_counter > 0) {
678 struct sctpasochead *head;
693 LIST_REMOVE(stcb, sctp_asocs);
700 LIST_INSERT_HEAD(head, stcb, sctp_asocs);
710 LIST_REMOVE(stcb, sctp_asocs);
720 LIST_INSERT_HEAD(head, stcb, sctp_asocs);
765 error = ntohs(cause->
code);
793#ifdef SCTP_ASOCLOG_OF_TSNS
794 sctp_print_out_track_log(stcb);
809 TAILQ_FOREACH(net, &stcb->
asoc.
nets, sctp_next) {
835 int some_on_streamwheel;
839 "sctp_handle_shutdown: handling SHUTDOWN\n");
875 panic(
"Unknown state on ctrl:%p on_strm_q:%d",
918 some_on_streamwheel) {
949 "sctp_handle_shutdown_ack: handling SHUTDOWN ACK\n");
983 panic(
"Queues are not empty when handling SHUTDOWN-ACK");
1008 switch (chunk_type) {
1019 "Peer does not support chunk type %d (0x%x).\n",
1020 chunk_type, chunk_type);
1034 switch (parameter_type) {
1054 "Turning off ASCONF to this strange peer\n");
1059 "Peer does not support param type %d (0x%x)??\n",
1060 parameter_type, parameter_type);
1072 uint16_t code, cause_code, cause_length;
1079 if (remaining_length > limit) {
1080 remaining_length = limit;
1085 remaining_length = 0;
1090 cause_code = ntohs(cause->
code);
1091 cause_length = ntohs(cause->
length);
1092 if ((cause_length > remaining_length) || (cause_length == 0)) {
1095 remaining_length, cause_length);
1102 switch (cause_code) {
1217 if (remaining_length >= adjust) {
1218 remaining_length -= adjust;
1220 remaining_length = 0;
1230 struct sockaddr *src,
struct sockaddr *dst,
struct sctphdr *sh,
1232 struct sctp_nets *net,
int *abort_no_unlock,
1237 struct mbuf *op_err;
1240 "sctp_handle_init_ack: handling INIT-ACK\n");
1244 "sctp_handle_init_ack: TCB is null\n");
1249 init_ack = &cp->init;
1251 if ((ntohl(init_ack->initiate_tag) == 0) ||
1253 (ntohs(init_ack->num_inbound_streams) == 0) ||
1254 (ntohs(init_ack->num_outbound_streams) == 0)) {
1258 src, dst, sh, op_err,
1261 *abort_no_unlock = 1;
1273 ~SCTP_ADDR_UNCONFIRMED;
1278 net, abort_no_unlock,
1317 struct sockaddr *src,
struct sockaddr *dst,
1320 struct sockaddr *init_src,
int *notification,
1333 struct sockaddr *src,
struct sockaddr *dst,
1336 struct sockaddr *init_src,
int *notification,
1350 struct mbuf *op_err;
1352 int init_offset, initack_offset, i;
1356#if defined(SCTP_DETAILED_STR_STATS)
1363 for (how_indx = 0; how_indx <
sizeof(asoc->
cookie_how); how_indx++) {
1375 mflowtype, mflowid, inp->
fibnum,
1392 if (init_cp == NULL) {
1409 if (initack_cp == NULL) {
1418 if ((ntohl(initack_cp->init.initiate_tag) == asoc->
my_vtag) &&
1460 src, dst, sh, op_err,
1504 old.tv_sec =
cookie->time_entered.tv_sec;
1505 old.tv_usec =
cookie->time_entered.tv_usec;
1526 initack_offset, src, dst, init_src, stcb->
asoc.
port)) < 0) {
1530 "Problem with address parameters");
1532 "Load addresses from INIT causes an abort %d\n",
1535 src, dst, sh, op_err,
1548 if (ntohl(initack_cp->init.initiate_tag) != asoc->
my_vtag &&
1550 cookie->tie_tag_my_vtag == 0 &&
1551 cookie->tie_tag_peer_vtag == 0) {
1566 ((ntohl(initack_cp->init.initiate_tag) == asoc->
my_vtag) &&
1581 mflowtype, mflowid, inp->
fibnum,
1586 if ((ntohl(initack_cp->init.initiate_tag) == asoc->
my_vtag) &&
1632 asoc->
my_rwnd = ntohl(initack_cp->init.a_rwnd);
1664 src, dst, sh, op_err,
1671 initack_offset, src, dst, init_src, stcb->
asoc.
port)) < 0) {
1675 "Problem with address parameters");
1677 "Load addresses from INIT causes an abort %d\n",
1680 src, dst, sh, op_err,
1728 if ((ntohl(initack_cp->init.initiate_tag) != asoc->
my_vtag &&
1732 cookie->tie_tag_peer_vtag != 0) {
1733 struct sctpasochead *head;
1745 inp, netp, init_src, notification,
1746 auth_skipped, auth_offset, auth_len,
1749 if (local_stcb == NULL) {
1752 return (local_stcb);
1816#if defined(SCTP_DETAILED_STR_STATS)
1830 TAILQ_FOREACH_SAFE(strrst, &
asoc->
resetHead, next_resp, nstrrst) {
1878 if (aack->
data != NULL) {
1885 asoc->
my_vtag = ntohl(initack_cp->init.initiate_tag);
1889 LIST_REMOVE(stcb, sctp_asocs);
1897 LIST_INSERT_HEAD(head, stcb, sctp_asocs);
1911 src, dst, sh, op_err,
1924 initack_offset, src, dst, init_src, stcb->
asoc.
port)) < 0) {
1928 "Problem with address parameters");
1930 "Load addresses from INIT causes an abort %d\n",
1933 src, dst, sh, op_err,
1964 struct sockaddr *src,
struct sockaddr *dst,
1967 struct sockaddr *init_src,
int *notification,
1977 int init_offset, initack_offset, initack_limit;
1990 if (init_cp == NULL) {
1993 "process_cookie_new: could not pull INIT chunk hdr\n");
2008 if (initack_cp == NULL) {
2022 initack_limit = offset + cookie_len;
2036 ntohl(initack_cp->init.initiate_tag),
2037 ntohl(initack_cp->init.initial_tsn), vrf_id,
2038 ntohs(initack_cp->init.num_outbound_streams),
2040 (
struct thread *)NULL,
2043 struct mbuf *op_err;
2047 "process_cookie_new: no room for another TCB!\n");
2050 src, dst, sh, op_err,
2064 struct mbuf *op_err;
2073 src, dst, sh, op_err,
2081 asoc->
my_rwnd = ntohl(initack_cp->init.a_rwnd);
2092 initack_offset, src, dst, init_src, port) < 0) {
2115 "COOKIE-ECHO: AUTH failed\n");
2136 switch (
cookie->laddr_type) {
2149 memset(&store.
sin6, 0,
sizeof(
struct sockaddr_in6));
2150 store.
sin6.sin6_family = AF_INET6;
2151 store.
sin6.sin6_len =
sizeof(
struct sockaddr_in6);
2153 memcpy(&store.
sin6.sin6_addr,
cookie->laddress,
sizeof(
struct in6_addr));
2205 if (*netp != NULL) {
2212 (*netp)->hb_responded = 1;
2214 old.tv_sec =
cookie->time_entered.tv_sec;
2215 old.tv_usec =
cookie->time_entered.tv_usec;
2253 struct sockaddr *src,
struct sockaddr *dst,
2264 struct sockaddr *to;
2270 unsigned int sig_offset, cookie_offset;
2271 unsigned int cookie_len;
2273 struct timeval time_entered, time_expires;
2274 int notification = 0;
2276 int had_a_existing_tcb = 0;
2277 int send_int_conf = 0;
2282 struct sockaddr_in6 sin6;
2286 "sctp_handle_cookie: handling COOKIE-ECHO\n");
2288 if (inp_p == NULL) {
2318 m_sig = m_split(m, sig_offset, M_NOWAIT);
2319 if (m_sig == NULL) {
2323#ifdef SCTP_MBUF_LOGGING
2332 ep = &(*inp_p)->sctp_ep;
2393 if (cookie_ok == 0) {
2396 "offset = %u, cookie_offset = %u, sig_offset = %u\n",
2397 (
uint32_t)offset, cookie_offset, sig_offset);
2405 time_entered.tv_sec =
cookie->time_entered.tv_sec;
2406 time_entered.tv_usec =
cookie->time_entered.tv_usec;
2407 if ((time_entered.tv_sec < 0) ||
2408 (time_entered.tv_usec < 0) ||
2409 (time_entered.tv_usec >= 1000000)) {
2415 if (timevalcmp(&now, &time_entered, <)) {
2424 time_expires.tv_usec = time_entered.tv_usec;
2425 if (timevalcmp(&now, &time_expires, >)) {
2427 struct mbuf *op_err;
2429 struct timeval diff;
2433 0, M_NOWAIT, 1, MT_DATA);
2434 if (op_err == NULL) {
2444 timevalsub(&diff, &time_expires);
2445 if ((
uint32_t)diff.tv_sec > UINT32_MAX / 1000000) {
2446 staleness = UINT32_MAX;
2448 staleness = (
uint32_t)diff.tv_sec * 1000000;
2450 if (UINT32_MAX - staleness >= (
uint32_t)diff.tv_usec) {
2451 staleness += (
uint32_t)diff.tv_usec;
2453 staleness = UINT32_MAX;
2455 cause->stale_time = htonl(staleness);
2457 mflowtype, mflowid, l_inp->
fibnum,
2471 switch (
cookie->addr_type) {
2474 memset(&sin6, 0,
sizeof(sin6));
2475 sin6.sin6_family = AF_INET6;
2476 sin6.sin6_len =
sizeof(sin6);
2478 sin6.sin6_scope_id =
cookie->scope_id;
2479 memcpy(&sin6.sin6_addr.s6_addr,
cookie->address,
2480 sizeof(sin6.sin6_addr.s6_addr));
2481 to = (
struct sockaddr *)&sin6;
2486 memset(&sin, 0,
sizeof(sin));
2491 to = (
struct sockaddr *)&sin;
2498 if (*stcb == NULL) {
2501 if (*stcb == NULL) {
2507 if (l_inp != *inp_p) {
2508 SCTP_PRINTF(
"Bad problem find_ep got a diff inp then special_locate?\n");
2511 if (*locked_tcb == NULL) {
2520 *locked_tcb = *stcb;
2530 if ((*stcb)->sctp_ep != l_inp) {
2532 (
void *)(*stcb)->sctp_ep, (
void *)l_inp);
2539 if (*stcb == NULL) {
2542 cookie, cookie_len, *inp_p,
2543 netp, to, ¬ification,
2544 auth_skipped, auth_offset, auth_len,
2549 had_a_existing_tcb = 1;
2552 cookie, cookie_len, *inp_p, *stcb, netp, to,
2553 ¬ification, auth_skipped, auth_offset, auth_len,
2556 if (*stcb == NULL) {
2561 if (*stcb == NULL) {
2565 if (*netp != NULL) {
2566 (*netp)->flowtype = mflowtype;
2567 (*netp)->flowid = mflowid;
2595 if (!had_a_existing_tcb ||
2602 struct socket *so, *oso;
2611 if (send_int_conf) {
2617 oso = (*inp_p)->sctp_socket;
2618 atomic_add_int(&(*stcb)->asoc.refcnt, 1);
2620 CURVNET_SET(oso->so_vnet);
2621 so = sonewconn(oso, 0
2625 atomic_subtract_int(&(*stcb)->asoc.refcnt, 1);
2628 struct mbuf *op_err;
2634 src, dst, sh, op_err,
2654 inp->sctp_features = (*inp_p)->sctp_features;
2655 inp->sctp_mobility_features = (*inp_p)->sctp_mobility_features;
2656 inp->sctp_socket = so;
2657 inp->sctp_frag_point = (*inp_p)->sctp_frag_point;
2658 inp->max_cwnd = (*inp_p)->max_cwnd;
2659 inp->sctp_cmt_on_off = (*inp_p)->sctp_cmt_on_off;
2660 inp->ecn_supported = (*inp_p)->ecn_supported;
2661 inp->prsctp_supported = (*inp_p)->prsctp_supported;
2662 inp->auth_supported = (*inp_p)->auth_supported;
2663 inp->asconf_supported = (*inp_p)->asconf_supported;
2664 inp->reconfig_supported = (*inp_p)->reconfig_supported;
2665 inp->nrsack_supported = (*inp_p)->nrsack_supported;
2666 inp->pktdrop_supported = (*inp_p)->pktdrop_supported;
2667 inp->partial_delivery_point = (*inp_p)->partial_delivery_point;
2668 inp->sctp_context = (*inp_p)->sctp_context;
2669 inp->local_strreset_support = (*inp_p)->local_strreset_support;
2670 inp->fibnum = (*inp_p)->fibnum;
2675 if (
inp->sctp_ep.local_hmacs)
2677 inp->sctp_ep.local_hmacs =
2679 if (
inp->sctp_ep.local_auth_chunks)
2681 inp->sctp_ep.local_auth_chunks =
2698 atomic_add_int(&(*stcb)->asoc.refcnt, 1);
2704 atomic_subtract_int(&(*stcb)->asoc.refcnt, 1);
2724 if (send_int_conf) {
2740 if (send_int_conf) {
2756 "sctp_handle_cookie_ack: handling COOKIE-ACK\n");
2757 if ((stcb == NULL) || (net == NULL)) {
2827#ifdef SCTP_TIMER_BASED_ASCONF
2842 if (chk->
whoTo != NULL) {
2861 unsigned int pkt_cnt;
2898 TAILQ_FOREACH(net, &stcb->
asoc.
nets, sctp_next) {
2910 net = TAILQ_FIRST(&stcb->
asoc.
nets);
2983 cwr_tsn = ntohl(cp->
tsn);
2989 if ((
override == 0) && (chk->
whoTo != net)) {
3003 if (
override == 0) {
3016 "sctp_handle_shutdown_complete: handling SHUTDOWN-COMPLETE\n");
3024 "sctp_handle_shutdown_complete: not in SCTP_STATE_SHUTDOWN_ACK_SENT --- ignore\n");
3036 panic(
"Queues are not empty when handling SHUTDOWN-COMPLETE");
3045 "sctp_handle_shutdown_complete: calls free-asoc\n");
3182 SCTP_PRINTF(
"**Local Audit finds cnt:%d asoc cnt:%d\n",
3184#ifndef SCTP_AUDITING_ENABLED
3300 if (number_entries) {
3301 for (i = 0; i < number_entries; i++) {
3302 temp = ntohs(list[i]);
3323 if (number_entries > 0) {
3324 for (i = 0; i < number_entries; i++) {
3325 temp = ntohs(list[i]);
3348 if (number_entries > 0) {
3349 for (i = 0; i < number_entries; i++) {
3350 temp = ntohs(list[i]);
3380 if (chk->
data == NULL) {
3449 if (req_param != NULL) {
3478 if (no_clear == 0) {
3541 if (respin == NULL) {
3623 if (number_entries) {
3624 for (i = 0; i < number_entries; i++) {
3632 for (i = 0; i < number_entries; i++) {
3733 int number_entries, len;
3771 siz, SCTP_M_STRESET);
3772 if (liste == NULL) {
3782 TAILQ_INSERT_TAIL(&asoc->
resetHead, liste, next_resp);
3827 (num_stream > 0xffff)) {
3853 TAILQ_FOREACH_SAFE(ctl, &oldstrm[i].
inqueue, next_instrm, nctl) {
3854 TAILQ_REMOVE(&oldstrm[i].
inqueue, ctl, next_instrm);
3857 TAILQ_FOREACH_SAFE(ctl, &oldstrm[i].
uno_inqueue, next_instrm, nctl) {
3858 TAILQ_REMOVE(&oldstrm[i].
uno_inqueue, ctl, next_instrm);
3924 mychk += num_stream;
3925 if (mychk < 0x10000) {
3954__attribute__((noinline))
3960 uint16_t remaining_length, param_len, ptype;
3989 if (chk->
data == NULL) {
4018 if ((param_len > remaining_length) ||
4031 if (param_len >
sizeof(cstore)) {
4087 goto strres_nochunk;
4103 goto strres_nochunk;
4112 remaining_length = 0;
4117 goto strres_nochunk;
4147 (
"PKTDROP chunk too small"));
4150 KASSERT(limit <= pktdrp_len, (
"Inconsistent limit"));
4159 if (offset == limit) {
4163 }
else if (offset +
sizeof(
struct sctphdr) > limit) {
4169 offset +=
sizeof(
struct sctphdr);
4172 while (offset < limit) {
4260 if (bottle_bw && on_queue) {
4262 if (bottle_bw > on_queue)
4263 a_rwnd = bottle_bw - on_queue;
4297 net, cp, &bottle_bw, &on_queue);
4311__attribute__((noinline))
4315 struct sockaddr *src,
struct sockaddr *dst,
4322 struct mbuf *op_err;
4328 int abort_no_unlock = 0;
4339 uint32_t auth_offset = 0, auth_len = 0;
4340 int auth_skipped = 0;
4344 iphlen, *offset, length, (
void *)stcb);
4359 vtag_in = ntohl(sh->
v_tag);
4383 auth_offset = *offset;
4388 if (*offset >= length) {
4402 goto process_control_chunks;
4410 uint32_t asconf_offset = 0, asconf_len = 0;
4415 asconf_offset = *offset;
4423 sh, &inp, netp, vrf_id);
4439 if (auth_skipped && (stcb != NULL)) {
4461 SCTP_SNPRINTF(msg,
sizeof(msg),
"OOTB, %s:%d at %s", __FILE__, __LINE__, __func__);
4466 mflowtype, mflowid, inp->
fibnum,
4478 (vtag_in == asoc->
my_vtag)) ||
4493 if (vtag_in != asoc->
my_vtag) {
4496 "invalid vtag: %xh, expect %xh\n",
4519process_control_chunks:
4526 if (chk_length <
sizeof(*
ch) ||
4527 (*offset + (
int)chk_length) > length) {
4545 contiguous = min(chk_length,
sizeof(chunk_buf));
4565 if ((netp != NULL) && (*netp != NULL))
4569#ifdef SCTP_AUDITING_ENABLED
4574 if ((stcb != NULL) &&
4585 if ((num_chunks > 1) ||
4586 (length - *offset > (
int)
SCTP_SIZE32(chk_length))) {
4598 mflowtype, mflowid, inp->
fibnum,
4635 if ((num_chunks > 1) ||
4636 (length - *offset > (int)
SCTP_SIZE32(chk_length))) {
4640 if ((netp != NULL) && (*netp != NULL)) {
4652 if (abort_no_unlock) {
4659 if ((stcb != NULL) && (ret == 0)) {
4669 uint16_t num_seg, num_nr_seg, num_dup;
4671 int offset_seg, offset_dup;
4703 flags = ch->chunk_flags;
4715 num_dup *
sizeof(
uint32_t) != chk_length) {
4732 num_dup *
sizeof(
uint32_t) != chk_length) {
4737 offset_dup = offset_seg + (num_seg + num_nr_seg) *
sizeof(
struct sctp_gap_ack_block);
4741 cum_ack, num_seg, a_rwnd);
4744 (num_seg == 0) && (num_nr_seg == 0) &&
4759 &abort_now, ecne_seen);
4761 if ((netp != NULL) && (*netp != NULL)) {
4763 num_seg, num_nr_seg, num_dup, &abort_now, flags,
4764 cum_ack, a_rwnd, ecne_seen);
4781 if ((stcb != NULL) && (netp != NULL) && (*netp != NULL)) {
4794 if ((netp != NULL) && (*netp != NULL)) {
4803 if ((stcb != NULL) && (netp != NULL) && (*netp != NULL)) {
4819 if ((netp != NULL) && (*netp != NULL)) {
4822 stcb, *netp, &abort_flag);
4832 (stcb != NULL) && (netp != NULL) && (*netp != NULL)) {
4840 if ((stcb != NULL) && (netp != NULL) && (*netp != NULL) &&
4848 "SCTP_COOKIE_ECHO, stcb %p\n", (
void *)stcb);
4849 if ((stcb != NULL) && (stcb->asoc.total_output_queue_size > 0)) {
4879 if ((stcb == NULL) &&
4887 src, dst, sh, op_err,
4894 struct mbuf *ret_buf;
4932 if ((locked_stcb != NULL) && (locked_stcb != stcb)) {
4944 if (ret_buf == NULL) {
4949 "GAK, null buffer\n");
4960 if (chk->
whoTo != NULL) {
4976 if ((stcb) && (stcb->asoc.total_output_queue_size)) {
4985 if ((netp != NULL) && (*netp != NULL)) {
4994 if (stcb->asoc.ecn_supported == 0) {
5009 if (stcb->asoc.ecn_supported == 0) {
5020 if ((num_chunks > 1) ||
5021 (length - *offset > (
int)
SCTP_SIZE32(chk_length))) {
5026 (stcb != NULL) && (netp != NULL) && (*netp != NULL)) {
5036 if (stcb->asoc.asconf_supported == 0) {
5049 if (stcb->asoc.asconf_supported == 0) {
5055 if ((netp != NULL) && (*netp != NULL)) {
5059 stcb->asoc.overall_error_count,
5064 stcb->asoc.overall_error_count = 0;
5067 if (abort_no_unlock)
5078 if (stcb->asoc.prsctp_supported == 0) {
5087 SCTP_SNPRINTF(msg,
sizeof(msg),
"%s",
"FORWARD-TSN chunk received when I-FORWARD-TSN was negotiated");
5089 SCTP_SNPRINTF(msg,
sizeof(msg),
"%s",
"I-FORWARD-TSN chunk received when FORWARD-TSN was negotiated");
5107 stcb->asoc.last_data_chunk_from = stcb->asoc.last_control_chunk_from;
5121 if (stcb->asoc.reconfig_supported == 0) {
5138 if (stcb->asoc.pktdrop_supported == 0) {
5144 if ((netp != NULL) && (*netp != NULL)) {
5147 min(chk_length, contiguous));
5154 if (auth_skipped == 0) {
5155 auth_offset = *offset;
5156 auth_len = chk_length;
5162 if (stcb->asoc.auth_supported == 0) {
5172 if (got_auth == 1) {
5183 stcb->asoc.authenticated = 1;
5190 if ((ch->chunk_type & 0x40) &&
5199 0, M_NOWAIT, 1, MT_DATA);
5200 if (op_err != NULL) {
5208#ifdef SCTP_MBUF_LOGGING
5219 if ((ch->chunk_type & 0x80) == 0) {
5242 if ((asconf_cnt > 0) && (stcb != NULL)) {
5253 struct sockaddr *src,
struct sockaddr *dst,
5261 int fwd_tsn_seen = 0, data_processed = 0;
5262 struct mbuf *m = *mm, *op_err;
5265 int cnt_ctrl_ready = 0;
5271#ifdef SCTP_AUDITING_ENABLED
5272 sctp_audit_log(0xE0, 1);
5273 sctp_auditing(0, inp, stcb, net);
5275 if (compute_crc != 0) {
5282 if (calc_check != check) {
5284 calc_check, check, (
void *)m, length, iphlen);
5286 sh, ch, &inp, &net, vrf_id);
5287#if defined(INET) || defined(INET6)
5289 (net != NULL) && (net->
port !=
port)) {
5290 if (net->
port == 0) {
5296 }
else if (port == 0) {
5309 if ((inp != NULL) && (stcb != NULL)) {
5312 }
else if ((inp != NULL) && (stcb == NULL)) {
5326 sh, ch, &inp, &net, vrf_id);
5327#if defined(INET) || defined(INET6)
5329 (net != NULL) && (net->
port != port)) {
5330 if (net->
port == 0) {
5336 }
else if (port == 0) {
5357 mflowtype, mflowid, fibnum,
5373 mflowtype, mflowid, fibnum,
5378 }
else if (stcb == NULL) {
5382 (
void *)m, iphlen, offset, length, (
void *)stcb);
5401 SCTP_SNPRINTF(msg,
sizeof(msg),
"OOTB, %s:%d at %s", __FILE__, __LINE__, __func__);
5405 mflowtype, mflowid, inp->
fibnum,
5415 inp, stcb, &net, &fwd_tsn_seen,
5416 mflowtype, mflowid, fibnum,
5424#if defined(INET) || defined(INET6)
5426 (net != NULL) && (net->
port != port)) {
5427 if (net->
port == 0) {
5433 }
else if (port == 0) {
5453 if ((stcb != NULL) &&
5463 SCTP_SNPRINTF(msg,
sizeof(msg),
"OOTB, %s:%d at %s", __FILE__, __LINE__, __func__);
5467 mflowtype, mflowid, fibnum,
5498 if ((length > offset) &&
5505 "Data chunk requires AUTH, skipped\n");
5508 if (length > offset) {
5529 SCTP_SNPRINTF(msg,
sizeof(msg),
"OOTB, %s:%d at %s", __FILE__, __LINE__, __func__);
5533 mflowtype, mflowid, inp->
fibnum,
5552 inp, stcb, net, &high_tsn);
5571 if ((data_processed == 1) &&
5578 if ((data_processed == 0) && (fwd_tsn_seen)) {
5590 }
else if (fwd_tsn_seen) {
5595#ifdef SCTP_AUDITING_ENABLED
5596 sctp_audit_log(0xE0, 2);
5597 sctp_auditing(1, inp, stcb, net);
5600 "Check for chunk output prw:%d tqe:%d tf=%d\n",
5617#ifdef SCTP_AUDITING_ENABLED
5618 sctp_audit_log(0xE0, 3);
5619 sctp_auditing(2, inp, stcb, net);
5625 if (inp_decr != NULL) {
5636sctp_input_with_port(
struct mbuf *i_pak,
int off,
uint16_t port)
5658#ifdef SCTP_MBUF_LOGGING
5664#ifdef SCTP_PACKET_LOGGING
5670 "sctp_input(): Packet of length %d received on %s with csum_flags 0x%b.\n",
5672 if_name(m->m_pkthdr.rcvif),
5673 (
int)m->m_pkthdr.csum_flags, CSUM_BITS);
5674 mflowid = m->m_pkthdr.flowid;
5675 mflowtype = M_HASHTYPE_GET(m);
5676 fibnum = M_GETFIB(m);
5682 if ((m = m_pullup(m, offset)) == NULL) {
5687 ip = mtod(m,
struct ip *);
5688 sh = (
struct sctphdr *)((caddr_t)
ip + iphlen);
5692 src.sin_family = AF_INET;
5695 src.sin_addr =
ip->ip_src;
5697 dst.sin_family = AF_INET;
5705 "sctp_input() length:%d reported length:%d\n", length,
SCTP_HEADER_LEN(m));
5710 if (IN_MULTICAST(ntohl(dst.sin_addr.s_addr))) {
5717 if (m->m_pkthdr.csum_flags & CSUM_SCTP_VALID) {
5725 (
struct sockaddr *)&src,
5726 (
struct sockaddr *)&dst,
5730 mflowtype, mflowid, fibnum,
5739#if defined(SCTP_MCORE_INPUT) && defined(SMP)
5740extern int *sctp_cpuarry;
5744sctp_input(
struct mbuf **mp,
int *offp,
int proto
SCTP_UNUSED)
5751#if defined(SCTP_MCORE_INPUT) && defined(SMP)
5759 if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) {
5760 flowid = m->m_pkthdr.flowid;
5766 offset = off +
sizeof(
struct sctphdr);
5768 if ((m = m_pullup(m, offset)) == NULL) {
5770 return (IPPROTO_DONE);
5773 ip = mtod(m,
struct ip *);
5774 sh = (
struct sctphdr *)((caddr_t)
ip + off);
5775 tag = htonl(sh->
v_tag);
5777 m->m_pkthdr.flowid = flowid;
5778 M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE_HASH);
5780 cpu_to_use = sctp_cpuarry[flowid % mp_ncpus];
5781 sctp_queue_to_mcore(m, off, cpu_to_use);
5782 return (IPPROTO_DONE);
5785 sctp_input_with_port(m, off, 0);
5786 return (IPPROTO_DONE);
#define BANDLIM_SCTP_OOTB
const struct encaptab * cookie
#define SCTP_CWR_IN_SAME_WINDOW
#define SCTP_PCB_FLAGS_DONT_WAKE
#define SCTP_INITIATION_ACK
#define SCTP_FLIGHT_LOGGING_ENABLE
#define SCTP_HEARTBEAT_ACK
#define SCTP_CAUSE_DELETING_LAST_ADDR
#define SCTP_CAUSE_UNRECOG_CHUNK
#define SCTP_PCB_FLAGS_TCPTYPE
#define SCTP_PCB_FLAGS_SOCKET_ALLGONE
#define SCTP_FORWARD_CUM_TSN
#define SCTP_CAUSE_NAT_COLLIDING_STATE
#define SCTP_CWND_MONITOR_ENABLE
#define SCTP_PCB_FLAGS_UDPTYPE
#define SCTP_MAX_COOKIE_LIFE
#define SCTP_OPERATION_ERROR
#define SCTP_ENABLE_RESET_STREAM_REQ
#define SCTP_PCB_FLAGS_UNBOUND
#define SCTP_CAUSE_COOKIE_IN_SHUTDOWN
#define SCTP_CAUSE_INVALID_STREAM
#define SCTP_CAUSE_MISSING_PARAM
#define SCTP_PACKET_DROPPED
#define SCTP_SELECTIVE_ACK
#define SCTP_THRESHOLD_LOGGING
#define SCTP_MAP_LOGGING_ENABLE
#define SCTP_MOBILITY_BASE
#define SCTP_CAUSE_RESOURCE_SHORTAGE
#define SCTP_PCB_FLAGS_IN_TCPPOOL
#define SCTP_CAUSE_UNRESOLVABLE_ADDR
#define SCTP_PCB_FLAGS_SOCKET_GONE
#define SCTP_PCB_FLAGS_DO_ASCONF
#define SCTP_CAUSE_PROTOCOL_VIOLATION
#define SCTP_CAUSE_DELETING_SRC_ADDR
#define SCTP_STREAM_RESET
#define SCTP_FROM_MIDDLE_BOX
#define SCTP_CAUSE_NAT_MISSING_STATE
#define SCTP_PCB_FLAGS_CONNECTED
#define SCTP_AUTHENTICATION
#define SCTP_SHUTDOWN_ACK
#define SCTP_CAUSE_UNRECOG_PARAM
#define SCTP_ENABLE_CHANGE_ASSOC_REQ
#define SCTP_CAUSE_OUT_OF_RESC
#define SCTP_SHUTDOWN_COMPLETE
#define SCTP_PCB_COPY_FLAGS
#define SCTP_MBUF_LOGGING_ENABLE
#define SCTP_CWND_LOGGING_ENABLE
#define SCTP_CWR_REDUCE_OVERRIDE
#define SCTP_CAUSE_STALE_COOKIE
#define SCTP_ABORT_ASSOCIATION
#define SCTP_MOBILITY_FASTHANDOFF
#define SCTP_CAUSE_NO_USER_DATA
#define SCTP_HEARTBEAT_REQUEST
#define SCTP_NR_SELECTIVE_ACK
#define SCTP_PACKET_TRUNCATED
#define SCTP_LAST_PACKET_TRACING
#define SCTP_CAUSE_INVALID_PARAM
#define SCTP_IFORWARD_CUM_TSN
#define SCTP_MOBILITY_PRIM_DELETED
#define SCTP_PCB_FLAGS_AUTOCLOSE
void sctp_handle_asconf(struct mbuf *m, unsigned int offset, struct sockaddr *src, struct sctp_asconf_chunk *cp, struct sctp_tcb *stcb, int first)
void sctp_assoc_immediate_retrans(struct sctp_tcb *stcb, struct sctp_nets *dstnet)
void sctp_asconf_send_nat_state_update(struct sctp_tcb *stcb, struct sctp_nets *net)
void sctp_check_address_list(struct sctp_tcb *stcb, struct mbuf *m, int offset, int length, struct sockaddr *init_addr, uint16_t local_scope, uint16_t site_scope, uint16_t ipv4_scope, uint16_t loopback_scope)
void sctp_asconf_cleanup(struct sctp_tcb *stcb)
void sctp_handle_asconf_ack(struct mbuf *m, int offset, struct sctp_asconf_ack_chunk *cp, struct sctp_tcb *stcb, struct sctp_nets *net, int *abort_no_unlock)
sctp_auth_chklist_t * sctp_copy_chunklist(sctp_auth_chklist_t *list)
void sctp_free_chunklist(sctp_auth_chklist_t *list)
void sctp_free_hmaclist(sctp_hmaclist_t *list)
sctp_hmaclist_t * sctp_copy_hmaclist(sctp_hmaclist_t *list)
int sctp_validate_init_auth_params(struct mbuf *m, int offset, int limit)
uint16_t sctp_negotiate_hmacid(sctp_hmaclist_t *peer, sctp_hmaclist_t *local)
void sctp_auth_get_cookie_params(struct sctp_tcb *stcb, struct mbuf *m, uint32_t offset, uint32_t length)
void sctp_auth_key_release(struct sctp_tcb *stcb, uint16_t key_id, int so_locked)
int sctp_handle_auth(struct sctp_tcb *stcb, struct sctp_auth_chunk *auth, struct mbuf *m, uint32_t offset)
uint32_t sctp_hmac_m(uint16_t hmac_algo, uint8_t *key, uint32_t keylen, struct mbuf *m, uint32_t m_offset, uint8_t *digest, uint32_t trailer)
#define SCTP_AUTH_DIGEST_LEN_MAX
#define sctp_auth_is_required_chunk(chunk, list)
struct mbuf * sctp_get_mbuf_for_msg(unsigned int space_needed, int want_header, int how, int allonebuf, int type)
#define SCTP_DEBUG_INPUT2
#define SCTP_IN_COOKIE_PROC
#define SCTP_STR_RESET_OUT_REQUEST
#define SCTP_DIAG_INFO_LEN
#define SCTP_SUPPORTED_CHUNK_EXT
#define SCTP_TIMER_TYPE_SHUTDOWNACK
#define SCTP_STATE_COOKIE_ECHOED
#define SCTP_ADD_IP_ADDRESS
#define SCTP_NOTIFY_SENDER_DRY
#define SCTP_HAS_NAT_SUPPORT
#define SCTP_STATE_WAS_ABORTED
#define SCTP_PRSCTP_SUPPORTED
#define SCTP_ADDR_REQ_PRIMARY
#define SCTP_ADD_SUBSTATE(_stcb, _substate)
#define SCTP_TSN_GT(a, b)
#define SCTP_NOTIFY_STR_RESET_DENIED_IN
#define SCTP_RTT_FROM_NON_DATA
#define SCTP_DEBUG_INPUT1
#define SCTP_DATAGRAM_RESEND
#define SCTP_NOTIFY_STR_RESET_FAILED_OUT
#define SCTP_SUCCESS_REPORT
#define SCTP_NOTIFY_PEER_SHUTDOWN
#define SCTP_SO_NOT_LOCKED
#define SCTP_TIMER_TYPE_HEARTBEAT
#define SCTP_OUTPUT_FROM_COOKIE_ACK
#define SCTP_DEL_IP_ADDRESS
#define SCTP_DEBUG_INPUT3
#define SCTP_MAP_SLIDE_RESULT
#define SCTP_STATE_COOKIE
#define SCTP_NOTIFY_REMOTE_ERROR
#define SCTP_RETRY_DROPPED_THRESH
#define SCTP_STREAM_RESET_TSN_DELTA
#define SCTP_NOTIFY_INTERFACE_UP
#define SCTP_SIGNATURE_SIZE
#define SCTP_TIMER_TYPE_INIT
#define SCTP_STR_RESET_IN_REQUEST
#define SCTP_NOTIFY_STR_RESET_DENIED_OUT
#define sctp_sorwakeup(inp, so)
#define SCTP_FROM_SCTP_INPUT
#define SCTP_NOTIFY_UNSENT_DG_FAIL
#define SCTP_STATE_IN_ACCEPT_QUEUE
#define SCTP_DEBUG_CRCOFFLOAD
#define SCTP_STATE_SHUTDOWN_PENDING
#define SCTP_TIMER_TYPE_PRIM_DELETED
#define SCTP_ADDR_UNCONFIRMED
#define SCTP_TIMER_TYPE_STRRESET
#define SCTP_OUTPUT_FROM_CONTROL_PROC
#define SCTP_CHUNK_BUFFER_SIZE
#define SCTP_TIMER_TYPE_RECV
#define SCTP_DONOT_SETSCOPE
#define SCTP_TSN_GE(a, b)
#define SCTP_FLIGHT_LOG_DOWN_PDRP
#define SCTP_NOTIFY_STR_RESET_RECV
#define SCTP_STATE_SHUTDOWN_ACK_SENT
#define SCTP_NOTIFY_INTERFACE_CONFIRMED
#define SCTP_TIMER_TYPE_SHUTDOWNGUARD
#define SCTP_GET_STATE(_stcb)
#define SCTP_NOTIFY_ASSOC_UP
#define SCTP_THRESHOLD_CLEAR
#define SCTP_GETTIME_TIMEVAL(x)
#define SCTP_STR_RESET_ADD_IN_STREAMS
#define SCTP_DATAGRAM_UNSENT
#define SCTP_STATE_CLOSED_SOCKET
#define SCTP_TIMER_TYPE_PATHMTURAISE
#define SCTP_NOTIFY_ASSOC_DOWN
#define SCTP_NOTIFY_SPECIAL_SP_FAIL
#define SCTP_IPV4_ADDRESS
#define SCTP_CWND_INITIALIZATION
#define SCTP_STATE_COOKIE_WAIT
#define SCTP_NOTIFY_STR_RESET_FAILED_IN
#define SCTP_TIMER_TYPE_SHUTDOWN
#define SCTP_STATE_SHUTDOWN_SENT
#define SCTP_STR_RESET_TSN_REQUEST
#define SCTP_NOTIFY_STR_RESET_SEND
#define SCTP_STATE_SHUTDOWN_RECEIVED
#define SCTP_OUTPUT_FROM_INPUT_ERROR
#define SCTP_SET_PRIM_ADDR
#define SCTP_STR_RESET_ADD_OUT_STREAMS
#define SCTP_STATE_ABOUT_TO_BE_FREED
#define IS_SCTP_CONTROL(a)
#define SCTP_IPV6_ADDRESS
#define SCTP_ADDR_REACHABLE
#define SCTP_SET_STATE(_stcb, _state)
#define SCTP_TIMER_TYPE_AUTOCLOSE
#define SCTP_TIMER_TYPE_ASCONF
#define SCTP_STR_RESET_RESPONSE
#define SCTP_ERROR_CAUSE_IND
#define SCTP_DATAGRAM_ACKED
#define SCTP_TIMER_TYPE_SEND
#define SCTP_DEBUG_INDATA1
#define SCTP_LARGEST_INIT_ACCEPTED
#define SCTP_ADDR_NOT_LOCKED
#define SCTP_MAX_RESET_PARAMS
#define SCTP_TIMER_TYPE_COOKIE
#define SCTP_NOTIFY_ASSOC_RESTART
uint32_t sctp_calculate_cksum(struct mbuf *m, int32_t offset)
void sctp_update_acked(struct sctp_tcb *stcb, struct sctp_shutdown_chunk *cp, int *abort_flag)
void sctp_handle_forward_tsn(struct sctp_tcb *stcb, struct sctp_forward_tsn_chunk *fwd, int *abort_flag, struct mbuf *m, int offset)
int sctp_process_data(struct mbuf **mm, int iphlen, int *offset, int length, struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net, uint32_t *high_tsn)
void sctp_sack_check(struct sctp_tcb *stcb, int was_a_gap)
void sctp_handle_sack(struct mbuf *m, int offset_seg, int offset_dup, struct sctp_tcb *stcb, uint16_t num_seg, uint16_t num_nr_seg, uint16_t num_dup, int *abort_now, uint8_t flags, uint32_t cum_ack, uint32_t rwnd, int ecne_seen)
void sctp_express_handle_sack(struct sctp_tcb *stcb, uint32_t cumack, uint32_t rwnd, int *abort_now, int ecne_seen)
#define SCTP_PROBE5(probe, arg0, arg1, arg2, arg3, arg4)
#define SCTP_TCB_LOCK(_tcb)
#define SCTP_INP_INFO_WLOCK()
#define SCTP_INP_RLOCK(_inp)
#define SCTP_ASOC_CREATE_UNLOCK(_inp)
#define SCTP_INP_READ_UNLOCK(_inp)
#define SCTP_INP_WUNLOCK(_inp)
#define SCTP_TCB_SEND_UNLOCK(_tcb)
#define SCTP_INP_DECR_REF(_inp)
#define SCTP_INP_WLOCK(_inp)
#define SCTP_DECR_CHK_COUNT()
#define SCTP_TCB_LOCK_ASSERT(_tcb)
#define SCTP_INP_INCR_REF(_inp)
#define SCTP_TCB_UNLOCK(_tcb)
#define SCTP_ASOC_CREATE_LOCK(_inp)
#define SCTP_INP_INFO_WUNLOCK()
#define SCTP_TCB_SEND_LOCK(_tcb)
#define SCTP_INP_READ_LOCK(_inp)
#define SCTP_INP_RUNLOCK(_inp)
#define SCTP_IS_IT_BROADCAST(dst, m)
#define SCTP_LTRACE_CHK(a, b, c, d)
#define SCTP_HEADER_TO_CHAIN(m)
#define SCTP_SNPRINTF(...)
#define SCTP_BUF_RESV_UF(m, size)
#define SCTP_GET_PKT_VRFID(m, vrf_id)
#define SCTP_MALLOC(var, type, size, name)
#define SCTP_BASE_INFO(__m)
#define SCTP_RELEASE_PKT(m)
#define SCTP_PRINTF(params...)
#define SCTP_FREE(var, type)
#define SCTP_HEADER_LEN(m)
#define SCTPDBG(level, params...)
#define SCTP_ZONE_FREE(zone, element)
#define SCTP_IS_LISTENING(inp)
#define SCTP_BASE_SYSCTL(__m)
void sctp_send_shutdown_complete(struct sctp_tcb *stcb, struct sctp_nets *net, int reflect_vtag)
void sctp_send_shutdown_ack(struct sctp_tcb *stcb, struct sctp_nets *net)
int sctp_send_cookie_echo(struct mbuf *m, int offset, int limit, struct sctp_tcb *stcb, struct sctp_nets *net)
void sctp_send_cookie_ack(struct sctp_tcb *stcb)
void sctp_send_cwr(struct sctp_tcb *stcb, struct sctp_nets *net, uint32_t high_tsn, uint8_t override)
void send_forward_tsn(struct sctp_tcb *stcb, struct sctp_association *asoc)
void sctp_add_stream_reset_result_tsn(struct sctp_tmit_chunk *chk, uint32_t resp_seq, uint32_t result, uint32_t send_una, uint32_t recv_next)
void sctp_toss_old_cookies(struct sctp_tcb *stcb, struct sctp_association *asoc)
void sctp_queue_op_err(struct sctp_tcb *stcb, struct mbuf *op_err)
struct mbuf * sctp_arethere_unrecognized_parameters(struct mbuf *in_initpkt, int param_offset, int *abort_processing, struct sctp_chunkhdr *cp, int *nat_friendly, int *cookie_found)
void sctp_send_packet_dropped(struct sctp_tcb *stcb, struct sctp_nets *net, struct mbuf *m, int len, int iphlen, int bad_crc)
int sctp_send_str_reset_req(struct sctp_tcb *stcb, uint16_t number_entries, uint16_t *list, uint8_t send_in_req, uint8_t send_tsn_req, uint8_t add_stream, uint16_t adding_o, uint16_t adding_i, uint8_t peer_asked)
void sctp_send_hb(struct sctp_tcb *stcb, struct sctp_nets *net, int so_locked)
void sctp_send_initiate_ack(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *src_net, struct mbuf *init_pkt, int iphlen, int offset, struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_init_chunk *init_chk, uint8_t mflowtype, uint32_t mflowid, uint32_t vrf_id, uint16_t port)
void sctp_send_initiate(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int so_locked)
void sctp_send_asconf(struct sctp_tcb *stcb, struct sctp_nets *net, int addr_locked)
void sctp_add_stream_reset_result(struct sctp_tmit_chunk *chk, uint32_t resp_seq, uint32_t result)
void sctp_move_chunks_from_net(struct sctp_tcb *stcb, struct sctp_nets *net)
void sctp_send_sack(struct sctp_tcb *stcb, int so_locked)
void sctp_send_operr_to(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_send_heartbeat_ack(struct sctp_tcb *stcb, struct mbuf *m, int offset, int chk_length, struct sctp_nets *net)
void sctp_send_asconf_ack(struct sctp_tcb *stcb)
void sctp_send_shutdown(struct sctp_tcb *stcb, struct sctp_nets *net)
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_send_ecn_echo(struct sctp_tcb *stcb, struct sctp_nets *net, uint32_t high_tsn)
int sctp_send_stream_reset_out_if_possible(struct sctp_tcb *stcb, int so_locked)
void sctp_chunk_output(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int from_where, int so_locked)
#define SCTP_DATA_CHUNK_OVERHEAD(stcb)
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)
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)
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)
void sctp_clean_up_stream(struct sctp_tcb *stcb, struct sctp_readhead *rh)
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)
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)
int sctp_set_primary_addr(struct sctp_tcb *stcb, struct sockaddr *sa, struct sctp_nets *net)
void sctp_move_pcb_and_assoc(struct sctp_inpcb *old_inp, struct sctp_inpcb *new_inp, struct sctp_tcb *stcb)
#define SCTP_DONT_INITIALIZE_AUTH_PARAMS
#define SCTP_PCBHASH_ASOC(tag, mask)
#define SCTP_ON_UNORDERED
#define SCTP_STREAM_RESET_PENDING
#define SCTP_STREAM_CLOSED
void sctp_delete_prim_timer(struct sctp_inpcb *inp, struct sctp_tcb *stcb)
#define SCTP_ASSOC_RESET_FAILED
#define SCTP_STREAM_CHANGE_FAILED
#define SCTP_STAT_INCR_COUNTER32(_x)
#define SCTP_STREAM_CHANGE_DENIED
#define SCTP_STAT_INCR_COUNTER64(_x)
#define SCTP_ASSOC_RESET_DENIED
#define SCTP_STAT_INCR_GAUGE32(_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_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_free_a_readq(_stcb, _readq)
#define sctp_is_mobility_feature_on(inp, feature)
#define sctp_free_remote_addr(__net)
#define sctp_ucount_incr(val)
#define sctp_alloc_a_chunk(_stcb, _chk)
void sctp_misc_ints(uint8_t from, uint32_t a, uint32_t b, uint32_t c, uint32_t d)
void sctp_timer_stop(int t_type, struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net, uint32_t from)
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)
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)
void sctp_ulp_notify(uint32_t notification, struct sctp_tcb *stcb, uint32_t error, void *data, int so_locked)
uint32_t sctp_select_a_tag(struct sctp_inpcb *inp, uint16_t lport, uint16_t rport, int check)
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)
void sctp_notify_stream_reset_tsn(struct sctp_tcb *stcb, uint32_t sending_tsn, uint32_t recv_tsn, int flag)
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)
uint32_t sctp_ticks_to_secs(uint32_t ticks)
void sctp_notify_stream_reset_add(struct sctp_tcb *stcb, uint16_t numberin, uint16_t numberout, int flag)
void sctp_pull_off_control_to_new_inp(struct sctp_inpcb *old_inp, struct sctp_inpcb *new_inp, struct sctp_tcb *stcb, int waitflags)
void sctp_log_cwnd(struct sctp_tcb *stcb, struct sctp_nets *net, int augment, uint8_t from)
caddr_t sctp_m_getptr(struct mbuf *m, int off, int len, uint8_t *in_ptr)
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_ticks_to_msecs(uint32_t ticks)
void sctp_abort_notification(struct sctp_tcb *stcb, bool from_peer, bool timeout, uint16_t error, struct sctp_abort_chunk *abort, int so_locked)
void sctp_stop_timers_for_shutdown(struct sctp_tcb *stcb)
#define sctp_free_bufspace(stcb, asoc, tp1, chk_cnt)
struct in_addr ip_src ip_dst
uint32_t cookie_preserve_req
uint16_t strm_realoutsize
struct timeval time_entered
uint16_t mapping_array_size
uint32_t last_base_tsnsent[SCTP_MAX_RESET_PARAMS]
uint32_t total_output_queue_size
unsigned int sent_queue_retran_cnt
uint8_t peer_supports_nat
sctp_auth_chklist_t * local_auth_chunks
uint32_t highest_tsn_inside_map
struct sctp_nets * alternate
uint32_t str_reset_seq_out
struct sctpchunk_listhead send_queue
struct sctp_stream_out * strmout
unsigned int total_flight_count
uint32_t sctp_autoclose_ticks
struct sctpnetlisthead nets
struct sctp_nets * last_control_chunk_from
struct sctp_readhead pending_reply_queue
uint16_t stale_cookie_count
struct sctp_nets * deleted_primary
uint8_t dropped_special_cnt
uint32_t last_reset_action[SCTP_MAX_RESET_PARAMS]
uint32_t asconf_seq_out_acked
struct sctp_asconf_ackhead asconf_ack_sent
uint32_t mapping_array_base_tsn
uint8_t stream_reset_out_is_outstanding
uint32_t str_reset_seq_in
unsigned int total_flight
unsigned int stream_queue_cnt
uint32_t tsn_last_delivered
uint8_t sat_t3_loss_recovery
struct sctp_asconf_addrhead asconf_queue
struct sctpchunk_listhead asconf_send_queue
struct sctp_queued_to_read * control_pdapi
uint8_t saw_sack_with_nr_frags
uint8_t saw_sack_with_frags
struct sctp_nets * last_net_cmt_send_started
struct sctp_resethead resetHead
struct sctp_ss_functions ss_functions
uint8_t * nr_mapping_array
struct sctpchunk_listhead control_send_queue
uint32_t highest_tsn_inside_nr_map
uint8_t seen_a_sack_this_pkt
unsigned int max_inbound_streams
sctp_hmaclist_t * local_hmacs
unsigned int data_pkts_seen
sctp_hmaclist_t * peer_hmacs
struct sctp_scoping scope
uint32_t last_sending_seq[SCTP_MAX_RESET_PARAMS]
struct sctp_tmit_chunk * str_reset
unsigned int send_queue_cnt
uint16_t ecn_echo_cnt_onq
struct sctp_nets * primary_destination
struct sctp_cc_functions cc_functions
unsigned int overall_error_count
struct sctp_nets * last_data_chunk_from
struct sctpchunk_listhead sent_queue
unsigned int pre_open_streams
uint8_t stream_reset_outstanding
uint16_t strm_pending_add_size
uint32_t advanced_peer_ack_point
struct sctp_stream_in * strmin
uint8_t local_strreset_support
void(* sctp_cwnd_update_after_packet_dropped)(struct sctp_tcb *stcb, struct sctp_nets *net, struct sctp_pktdrop_chunk *cp, uint32_t *bottle_bw, uint32_t *on_queue)
void(* sctp_cwnd_update_exit_pf)(struct sctp_tcb *stcb, struct sctp_nets *net)
void(* sctp_cwnd_update_after_ecn_echo)(struct sctp_tcb *stcb, struct sctp_nets *net, int in_window, int num_pkt_lost)
uint8_t data_bytes[SCTP_NUM_DB_TO_VERIFY]
struct sctp_state_cookie cookie
uint8_t doing_fast_retransmit
uint32_t num_pkts_since_cwr
struct sctp_error_cause cause
struct sctp_error_cause cause
struct sctp_error_cause cause
uint32_t new_cumulative_tsn
struct sctp_heartbeat heartbeat
char address[SCTP_ADDRMAX]
struct sctp_heartbeat_info_param hb_info
uint16_t num_inbound_streams
uint16_t num_outbound_streams
struct socket * sctp_socket
uint32_t heartbeat_random1
uint32_t heartbeat_random2
struct sctp_timer rxt_timer
struct sctp_nr_sack nr_sack
uint16_t num_nr_gap_ack_blks
uint16_t num_gap_ack_blks
uint32_t secret_key[SCTP_HOW_MANY_SECRETS][SCTP_NUMBER_OF_SECRETS]
char current_secret_number
unsigned int time_of_secret_change
struct sctp_nets * whoFrom
uint16_t num_gap_ack_blks
bool(* sctp_ss_is_empty)(struct sctp_tcb *stcb, struct sctp_association *asoc)
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)
uint32_t last_mid_delivered
struct sctp_readhead inqueue
struct sctp_readhead uno_inqueue
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]
uint16_t number_of_streams
uint16_t list_of_streams[]
uint16_t list_of_streams[]
uint32_t send_reset_at_tsn
uint16_t list_of_streams[]
uint32_t receivers_next_tsn
uint32_t senders_next_tsn
struct socket * sctp_socket
struct sctp_association asoc
struct sctp_inpcb * sctp_ep
union sctp_tmit_chunk::@34 rec
struct sctp_data_chunkrec data
struct sctp_association * asoc