Lines Matching refs:stcb
2024 sctp_add_addresses_to_i_ia(struct sctp_inpcb *inp, struct sctp_tcb *stcb, in sctp_add_addresses_to_i_ia() argument
2074 if (sctp_is_addr_restricted(stcb, sctp_ifap)) { in sctp_add_addresses_to_i_ia()
2117 if (sctp_is_addr_restricted(stcb, sctp_ifap)) { in sctp_add_addresses_to_i_ia()
2404 sctp_is_addr_restricted(struct sctp_tcb *stcb, struct sctp_ifa *ifa) in sctp_is_addr_restricted() argument
2408 if (stcb == NULL) { in sctp_is_addr_restricted()
2412 LIST_FOREACH(laddr, &stcb->asoc.sctp_restricted_addrs, sctp_nxt_addr) { in sctp_is_addr_restricted()
2580 struct sctp_tcb *stcb, in sctp_choose_boundspecific_stcb() argument
2637 (sctp_is_addr_restricted(stcb, sifa))) || in sctp_choose_boundspecific_stcb()
2639 (sctp_is_addr_restricted(stcb, sifa)) && in sctp_choose_boundspecific_stcb()
2640 (!sctp_is_addr_pending(stcb, sifa)))) { in sctp_choose_boundspecific_stcb()
2671 (sctp_is_addr_restricted(stcb, sifa))) || in sctp_choose_boundspecific_stcb()
2673 (sctp_is_addr_restricted(stcb, sifa)) && in sctp_choose_boundspecific_stcb()
2674 (!sctp_is_addr_pending(stcb, sifa)))) { in sctp_choose_boundspecific_stcb()
2687 starting_point = stcb->asoc.last_used_address; in sctp_choose_boundspecific_stcb()
2689 if (stcb->asoc.last_used_address == NULL) { in sctp_choose_boundspecific_stcb()
2691 stcb->asoc.last_used_address = LIST_FIRST(&inp->sctp_addr_list); in sctp_choose_boundspecific_stcb()
2694 for (laddr = stcb->asoc.last_used_address; laddr; in sctp_choose_boundspecific_stcb()
2708 (sctp_is_addr_restricted(stcb, sifa))) || in sctp_choose_boundspecific_stcb()
2710 (sctp_is_addr_restricted(stcb, sifa)) && in sctp_choose_boundspecific_stcb()
2711 (!sctp_is_addr_pending(stcb, sifa)))) { in sctp_choose_boundspecific_stcb()
2715 stcb->asoc.last_used_address = laddr; in sctp_choose_boundspecific_stcb()
2720 stcb->asoc.last_used_address = NULL; in sctp_choose_boundspecific_stcb()
2724 stcb->asoc.last_used_address = starting_point; in sctp_choose_boundspecific_stcb()
2727 if (stcb->asoc.last_used_address == NULL) { in sctp_choose_boundspecific_stcb()
2729 stcb->asoc.last_used_address = LIST_FIRST(&inp->sctp_addr_list); in sctp_choose_boundspecific_stcb()
2732 for (laddr = stcb->asoc.last_used_address; laddr; in sctp_choose_boundspecific_stcb()
2747 (sctp_is_addr_restricted(stcb, sifa))) || in sctp_choose_boundspecific_stcb()
2749 (sctp_is_addr_restricted(stcb, sifa)) && in sctp_choose_boundspecific_stcb()
2750 (!sctp_is_addr_pending(stcb, sifa)))) { in sctp_choose_boundspecific_stcb()
2754 stcb->asoc.last_used_address = laddr; in sctp_choose_boundspecific_stcb()
2759 stcb->asoc.last_used_address = NULL; in sctp_choose_boundspecific_stcb()
2768 struct sctp_tcb *stcb, in sctp_select_nth_preferred_addr_from_ifn_boundall() argument
2842 if (stcb && fam == AF_INET6 && in sctp_select_nth_preferred_addr_from_ifn_boundall()
2843 sctp_is_mobility_feature_on(stcb->sctp_ep, SCTP_MOBILITY_BASE)) { in sctp_select_nth_preferred_addr_from_ifn_boundall()
2851 if (stcb && fam == AF_INET && in sctp_select_nth_preferred_addr_from_ifn_boundall()
2852 sctp_is_mobility_feature_on(stcb->sctp_ep, SCTP_MOBILITY_BASE)) { in sctp_select_nth_preferred_addr_from_ifn_boundall()
2858 if (stcb) { in sctp_select_nth_preferred_addr_from_ifn_boundall()
2859 if (sctp_is_address_in_scope(ifa, &stcb->asoc.scope, 0) == 0) { in sctp_select_nth_preferred_addr_from_ifn_boundall()
2863 (sctp_is_addr_restricted(stcb, sifa))) || in sctp_select_nth_preferred_addr_from_ifn_boundall()
2865 (sctp_is_addr_restricted(stcb, sifa)) && in sctp_select_nth_preferred_addr_from_ifn_boundall()
2866 (!sctp_is_addr_pending(stcb, sifa)))) { in sctp_select_nth_preferred_addr_from_ifn_boundall()
2885 struct sctp_tcb *stcb, in sctp_count_num_preferred_boundall() argument
2904 (stcb != NULL) && in sctp_count_num_preferred_boundall()
2919 if (stcb) { in sctp_count_num_preferred_boundall()
2920 if (sctp_is_address_in_scope(ifa, &stcb->asoc.scope, 0) == 0) { in sctp_count_num_preferred_boundall()
2924 (sctp_is_addr_restricted(stcb, sifa))) || in sctp_count_num_preferred_boundall()
2926 (sctp_is_addr_restricted(stcb, sifa)) && in sctp_count_num_preferred_boundall()
2927 (!sctp_is_addr_pending(stcb, sifa)))) { in sctp_count_num_preferred_boundall()
2942 struct sctp_tcb *stcb, in sctp_choose_boundall() argument
2995 inp, stcb, in sctp_choose_boundall()
3022 …sctp_ifa = sctp_select_nth_preferred_addr_from_ifn_boundall(sctp_ifn, inp, stcb, non_asoc_addr_ok,… in sctp_choose_boundall()
3053 num_preferred = sctp_count_num_preferred_boundall(sctp_ifn, inp, stcb, non_asoc_addr_ok, in sctp_choose_boundall()
3075 …sifa = sctp_select_nth_preferred_addr_from_ifn_boundall(sctp_ifn, inp, stcb, non_asoc_addr_ok, des… in sctp_choose_boundall()
3130 if (stcb) { in sctp_choose_boundall()
3131 if (sctp_is_address_in_scope(sifa, &stcb->asoc.scope, 0) == 0) { in sctp_choose_boundall()
3137 (sctp_is_addr_restricted(stcb, sifa))) || in sctp_choose_boundall()
3139 (sctp_is_addr_restricted(stcb, sifa)) && in sctp_choose_boundall()
3140 (!sctp_is_addr_pending(stcb, sifa)))) { in sctp_choose_boundall()
3189 if (stcb) { in sctp_choose_boundall()
3190 if (sctp_is_address_in_scope(sifa, &stcb->asoc.scope, 0) == 0) { in sctp_choose_boundall()
3195 (sctp_is_addr_restricted(stcb, sifa))) || in sctp_choose_boundall()
3197 (sctp_is_addr_restricted(stcb, sifa)) && in sctp_choose_boundall()
3198 (!sctp_is_addr_pending(stcb, sifa)))) { in sctp_choose_boundall()
3211 if (stcb) { in sctp_choose_boundall()
3212 if ((retried == 0) && (stcb->asoc.scope.ipv4_local_scope == 0)) { in sctp_choose_boundall()
3213 stcb->asoc.scope.ipv4_local_scope = 1; in sctp_choose_boundall()
3217 stcb->asoc.scope.ipv4_local_scope = 0; in sctp_choose_boundall()
3259 if (stcb) { in sctp_choose_boundall()
3261 &stcb->asoc.scope, 0) == 0) { in sctp_choose_boundall()
3265 (sctp_is_addr_restricted(stcb, tmp_sifa))) || in sctp_choose_boundall()
3267 (sctp_is_addr_restricted(stcb, tmp_sifa)) && in sctp_choose_boundall()
3268 (!sctp_is_addr_pending(stcb, tmp_sifa)))) { in sctp_choose_boundall()
3280 sctp_add_local_addr_restricted(stcb, tmp_sifa); in sctp_choose_boundall()
3294 struct sctp_tcb *stcb, in sctp_source_address_selection() argument
3428 answer = sctp_choose_boundall(inp, stcb, net, ro, vrf_id, in sctp_source_address_selection()
3437 if (stcb) { in sctp_source_address_selection()
3438 answer = sctp_choose_boundspecific_stcb(inp, stcb, ro, in sctp_source_address_selection()
3554 sctp_process_cmsgs_for_init(struct sctp_tcb *stcb, struct mbuf *control, int *error) in sctp_process_cmsgs_for_init() argument
3596 stcb->asoc.max_init_times = initmsg.sinit_max_attempts; in sctp_process_cmsgs_for_init()
3598 stcb->asoc.pre_open_streams = initmsg.sinit_num_ostreams; in sctp_process_cmsgs_for_init()
3600 stcb->asoc.max_inbound_streams = initmsg.sinit_max_instreams; in sctp_process_cmsgs_for_init()
3602 stcb->asoc.initial_init_rto_max = initmsg.sinit_max_init_timeo; in sctp_process_cmsgs_for_init()
3603 if (stcb->asoc.streamoutcnt < stcb->asoc.pre_open_streams) { in sctp_process_cmsgs_for_init()
3612 stcb->asoc.streamoutcnt, stcb->asoc.pre_open_streams); in sctp_process_cmsgs_for_init()
3613 SCTP_TCB_UNLOCK(stcb); in sctp_process_cmsgs_for_init()
3616 (stcb->asoc.pre_open_streams * sizeof(struct sctp_stream_out)), in sctp_process_cmsgs_for_init()
3618 SCTP_TCB_LOCK(stcb); in sctp_process_cmsgs_for_init()
3620 SCTP_FREE(stcb->asoc.strmout, SCTP_M_STRMO); in sctp_process_cmsgs_for_init()
3621 stcb->asoc.strmout = tmp_str; in sctp_process_cmsgs_for_init()
3622 stcb->asoc.strm_realoutsize = stcb->asoc.streamoutcnt = stcb->asoc.pre_open_streams; in sctp_process_cmsgs_for_init()
3624 stcb->asoc.pre_open_streams = stcb->asoc.streamoutcnt; in sctp_process_cmsgs_for_init()
3626 for (i = 0; i < stcb->asoc.streamoutcnt; i++) { in sctp_process_cmsgs_for_init()
3627 TAILQ_INIT(&stcb->asoc.strmout[i].outqueue); in sctp_process_cmsgs_for_init()
3628 stcb->asoc.ss_functions.sctp_ss_init_stream(stcb, &stcb->asoc.strmout[i], NULL); in sctp_process_cmsgs_for_init()
3629 stcb->asoc.strmout[i].chunks_on_queues = 0; in sctp_process_cmsgs_for_init()
3632 stcb->asoc.strmout[i].abandoned_sent[j] = 0; in sctp_process_cmsgs_for_init()
3633 stcb->asoc.strmout[i].abandoned_unsent[j] = 0; in sctp_process_cmsgs_for_init()
3636 stcb->asoc.strmout[i].abandoned_sent[0] = 0; in sctp_process_cmsgs_for_init()
3637 stcb->asoc.strmout[i].abandoned_unsent[0] = 0; in sctp_process_cmsgs_for_init()
3639 stcb->asoc.strmout[i].next_mid_ordered = 0; in sctp_process_cmsgs_for_init()
3640 stcb->asoc.strmout[i].next_mid_unordered = 0; in sctp_process_cmsgs_for_init()
3641 stcb->asoc.strmout[i].sid = i; in sctp_process_cmsgs_for_init()
3642 stcb->asoc.strmout[i].last_msg_incomplete = 0; in sctp_process_cmsgs_for_init()
3643 stcb->asoc.strmout[i].state = SCTP_STREAM_OPENING; in sctp_process_cmsgs_for_init()
3656 sin.sin_port = stcb->rport; in sctp_process_cmsgs_for_init()
3663 if (sctp_add_remote_addr(stcb, (struct sockaddr *)&sin, NULL, stcb->asoc.port, in sctp_process_cmsgs_for_init()
3679 sin6.sin6_port = stcb->rport; in sctp_process_cmsgs_for_init()
3694 if (sctp_add_remote_addr(stcb, (struct sockaddr *)&sin, NULL, stcb->asoc.port, in sctp_process_cmsgs_for_init()
3701 if (sctp_add_remote_addr(stcb, (struct sockaddr *)&sin6, NULL, stcb->asoc.port, in sctp_process_cmsgs_for_init()
3725 struct sctp_tcb *stcb; in sctp_findassociation_cmsgs() local
3797 stcb = sctp_findassociation_ep_addr(inp_p, addr, net_p, NULL, NULL); in sctp_findassociation_cmsgs()
3798 if (stcb != NULL) { in sctp_findassociation_cmsgs()
3799 return (stcb); in sctp_findassociation_cmsgs()
3894 sctp_get_ect(struct sctp_tcb *stcb) in sctp_get_ect() argument
3896 if ((stcb != NULL) && (stcb->asoc.ecn_supported == 1)) { in sctp_get_ect()
3905 sctp_handle_no_route(struct sctp_tcb *stcb, in sctp_handle_no_route() argument
3915 if ((net->dest_state & SCTP_ADDR_REACHABLE) && stcb) { in sctp_handle_no_route()
3918 stcb, 0, in sctp_handle_no_route()
3925 if (stcb) { in sctp_handle_no_route()
3926 if (net == stcb->asoc.primary_destination) { in sctp_handle_no_route()
3930 alt = sctp_find_alternate_net(stcb, net, 0); in sctp_handle_no_route()
3932 if (stcb->asoc.alternate) { in sctp_handle_no_route()
3933 sctp_free_remote_addr(stcb->asoc.alternate); in sctp_handle_no_route()
3935 stcb->asoc.alternate = alt; in sctp_handle_no_route()
3936 atomic_add_int(&stcb->asoc.alternate->ref_count, 1); in sctp_handle_no_route()
3951 struct sctp_tcb *stcb, /* may be NULL */ in sctp_lowlevel_chunk_output() argument
3999 SCTP_LTRACE_ERR_RET_PKT(m, inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EFAULT); in sctp_lowlevel_chunk_output()
4004 if (stcb) { in sctp_lowlevel_chunk_output()
4005 vrf_id = stcb->asoc.vrf_id; in sctp_lowlevel_chunk_output()
4011 if ((auth != NULL) && (stcb != NULL)) { in sctp_lowlevel_chunk_output()
4012 sctp_fill_hmac_digest_m(m, auth_offset, auth, stcb, auth_keyid); in sctp_lowlevel_chunk_output()
4017 } else if (stcb) { in sctp_lowlevel_chunk_output()
4018 tos_value = stcb->asoc.default_dscp; in sctp_lowlevel_chunk_output()
4038 SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); in sctp_lowlevel_chunk_output()
4066 tos_value |= sctp_get_ect(stcb); in sctp_lowlevel_chunk_output()
4105 net->ro._s_addr = sctp_source_address_selection(inp, stcb, in sctp_lowlevel_chunk_output()
4113 sctp_handle_no_route(stcb, net, so_locked); in sctp_lowlevel_chunk_output()
4114 SCTP_LTRACE_ERR_RET_PKT(m, inp, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, EHOSTUNREACH); in sctp_lowlevel_chunk_output()
4123 _lsrc = sctp_source_address_selection(inp, stcb, ro, in sctp_lowlevel_chunk_output()
4128 sctp_handle_no_route(stcb, net, so_locked); in sctp_lowlevel_chunk_output()
4129 SCTP_LTRACE_ERR_RET_PKT(m, inp, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, EHOSTUNREACH); in sctp_lowlevel_chunk_output()
4142 sctp_handle_no_route(stcb, net, so_locked); in sctp_lowlevel_chunk_output()
4143 SCTP_LTRACE_ERR_RET_PKT(m, inp, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, EHOSTUNREACH); in sctp_lowlevel_chunk_output()
4179 sctp_handle_no_route(stcb, net, so_locked); in sctp_lowlevel_chunk_output()
4180 SCTP_LTRACE_ERR_RET_PKT(m, inp, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, EHOSTUNREACH); in sctp_lowlevel_chunk_output()
4196 SCTP_LTRACE_ERR_RET_PKT(m, inp, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); in sctp_lowlevel_chunk_output()
4225 SCTP_PROBE5(send, NULL, stcb, ip, stcb, sctphdr); in sctp_lowlevel_chunk_output()
4251 if ((stcb != NULL) && (stcb->asoc.smallest_mtu > mtu)) { in sctp_lowlevel_chunk_output()
4252 sctp_pathmtu_adjustment(stcb, mtu, true); in sctp_lowlevel_chunk_output()
4285 } else if (stcb) { in sctp_lowlevel_chunk_output()
4286 flowlabel = stcb->asoc.default_flowlabel; in sctp_lowlevel_chunk_output()
4306 SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); in sctp_lowlevel_chunk_output()
4330 SCTP_LTRACE_ERR_RET_PKT(m, inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL); in sctp_lowlevel_chunk_output()
4355 tos_value |= sctp_get_ect(stcb); in sctp_lowlevel_chunk_output()
4392 SCTP_LTRACE_ERR_RET_PKT(m, inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL); in sctp_lowlevel_chunk_output()
4398 stcb, in sctp_lowlevel_chunk_output()
4409 sctp_handle_no_route(stcb, net, so_locked); in sctp_lowlevel_chunk_output()
4410 SCTP_LTRACE_ERR_RET_PKT(m, inp, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, EHOSTUNREACH); in sctp_lowlevel_chunk_output()
4419 SCTP_LTRACE_ERR_RET_PKT(m, inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL); in sctp_lowlevel_chunk_output()
4426 _lsrc = sctp_source_address_selection(inp, stcb, ro, in sctp_lowlevel_chunk_output()
4431 sctp_handle_no_route(stcb, net, so_locked); in sctp_lowlevel_chunk_output()
4432 SCTP_LTRACE_ERR_RET_PKT(m, inp, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, EHOSTUNREACH); in sctp_lowlevel_chunk_output()
4452 sctp_handle_no_route(stcb, net, so_locked); in sctp_lowlevel_chunk_output()
4453 SCTP_LTRACE_ERR_RET_PKT(m, inp, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, EHOSTUNREACH); in sctp_lowlevel_chunk_output()
4478 sctp_handle_no_route(stcb, net, so_locked); in sctp_lowlevel_chunk_output()
4479 SCTP_LTRACE_ERR_RET_PKT(m, inp, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, EHOSTUNREACH); in sctp_lowlevel_chunk_output()
4529 SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); in sctp_lowlevel_chunk_output()
4549 SCTP_PROBE5(send, NULL, stcb, ip6h, stcb, sctphdr); in sctp_lowlevel_chunk_output()
4593 if ((stcb != NULL) && (stcb->asoc.smallest_mtu > mtu)) { in sctp_lowlevel_chunk_output()
4594 sctp_pathmtu_adjustment(stcb, mtu, false); in sctp_lowlevel_chunk_output()
4600 (stcb->asoc.smallest_mtu > ND_IFINFO(ifp)->linkmtu)) { in sctp_lowlevel_chunk_output()
4601 sctp_pathmtu_adjustment(stcb, ND_IFINFO(ifp)->linkmtu, false); in sctp_lowlevel_chunk_output()
4612 SCTP_LTRACE_ERR_RET_PKT(m, inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EFAULT); in sctp_lowlevel_chunk_output()
4618 sctp_send_initiate(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int so_locked) in sctp_send_initiate() argument
4633 net = stcb->asoc.primary_destination; in sctp_send_initiate()
4635 net = TAILQ_FIRST(&stcb->asoc.nets); in sctp_send_initiate()
4642 (void)sctp_set_primary_addr(stcb, NULL, net); in sctp_send_initiate()
4664 sctp_timer_start(SCTP_TIMER_TYPE_INIT, inp, stcb, net); in sctp_send_initiate()
4682 init->init.initiate_tag = htonl(stcb->asoc.my_vtag); in sctp_send_initiate()
4686 init->init.num_outbound_streams = htons(stcb->asoc.pre_open_streams); in sctp_send_initiate()
4687 init->init.num_inbound_streams = htons(stcb->asoc.max_inbound_streams); in sctp_send_initiate()
4688 init->init.initial_tsn = htonl(stcb->asoc.init_seq_number); in sctp_send_initiate()
4701 if (stcb->asoc.ecn_supported == 1) { in sctp_send_initiate()
4710 if (stcb->asoc.prsctp_supported == 1) { in sctp_send_initiate()
4719 if (stcb->asoc.rcv_edmid != SCTP_EDMID_NONE) { in sctp_send_initiate()
4724 zero_chksum->edmid = htonl(stcb->asoc.rcv_edmid); in sctp_send_initiate()
4740 if (stcb->asoc.prsctp_supported == 1) { in sctp_send_initiate()
4742 if (stcb->asoc.idata_supported) { in sctp_send_initiate()
4746 if (stcb->asoc.auth_supported == 1) { in sctp_send_initiate()
4749 if (stcb->asoc.asconf_supported == 1) { in sctp_send_initiate()
4753 if (stcb->asoc.reconfig_supported == 1) { in sctp_send_initiate()
4756 if (stcb->asoc.idata_supported) { in sctp_send_initiate()
4759 if (stcb->asoc.nrsack_supported == 1) { in sctp_send_initiate()
4762 if (stcb->asoc.pktdrop_supported == 1) { in sctp_send_initiate()
4773 if (stcb->asoc.auth_supported) { in sctp_send_initiate()
4775 if (stcb->asoc.authinfo.random != NULL) { in sctp_send_initiate()
4784 parameter_len = (uint16_t)sizeof(struct sctp_auth_random) + stcb->asoc.authinfo.random_len; in sctp_send_initiate()
4786 memcpy(randp, stcb->asoc.authinfo.random->key, parameter_len); in sctp_send_initiate()
4791 if (stcb->asoc.local_hmacs != NULL) { in sctp_send_initiate()
4801 stcb->asoc.local_hmacs->num_algo * sizeof(uint16_t)); in sctp_send_initiate()
4804 sctp_serialize_hmaclist(stcb->asoc.local_hmacs, (uint8_t *)hmacs->hmac_ids); in sctp_send_initiate()
4809 if (stcb->asoc.local_auth_chunks != NULL) { in sctp_send_initiate()
4819 sctp_auth_get_chklist_size(stcb->asoc.local_auth_chunks)); in sctp_send_initiate()
4822 sctp_serialize_auth_chunks(stcb->asoc.local_auth_chunks, chunks->chunk_types); in sctp_send_initiate()
4829 if (stcb->asoc.cookie_preserve_req > 0) { in sctp_send_initiate()
4841 cookie_preserve->time = htonl(stcb->asoc.cookie_preserve_req); in sctp_send_initiate()
4842 stcb->asoc.cookie_preserve_req = 0; in sctp_send_initiate()
4846 if (stcb->asoc.scope.ipv4_addr_legal || stcb->asoc.scope.ipv6_addr_legal) { in sctp_send_initiate()
4855 if (stcb->asoc.scope.ipv4_addr_legal) { in sctp_send_initiate()
4858 if (stcb->asoc.scope.ipv6_addr_legal) { in sctp_send_initiate()
4865 if (stcb->asoc.scope.ipv4_addr_legal) { in sctp_send_initiate()
4868 if (stcb->asoc.scope.ipv6_addr_legal) { in sctp_send_initiate()
4883 m_last = sctp_add_addresses_to_i_ia(inp, stcb, &stcb->asoc.scope, in sctp_send_initiate()
4895 if ((error = sctp_lowlevel_chunk_output(inp, stcb, net, in sctp_send_initiate()
4898 inp->sctp_lport, stcb->rport, htonl(0), in sctp_send_initiate()
4904 stcb->asoc.ifp_had_enobuf = 1; in sctp_send_initiate()
4908 stcb->asoc.ifp_had_enobuf = 0; in sctp_send_initiate()
5496 sctp_send_initiate_ack(struct sctp_inpcb *inp, struct sctp_tcb *stcb, in sctp_send_initiate_ack() argument
5538 if (stcb) { in sctp_send_initiate_ack()
5539 asoc = &stcb->asoc; in sctp_send_initiate_ack()
5544 (SCTP_GET_STATE(stcb) != SCTP_STATE_COOKIE_WAIT)) { in sctp_send_initiate_ack()
5783 stcb, (sctp_route_t *)&net->ro, in sctp_send_initiate_ack()
5815 stcb, (sctp_route_t *)&net->ro, in sctp_send_initiate_ack()
5852 ((SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) || in sctp_send_initiate_ack()
5853 (SCTP_GET_STATE(stcb) == SCTP_STATE_INUSE) || in sctp_send_initiate_ack()
5854 (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED))) { in sctp_send_initiate_ack()
5863 SCTP_TCB_UNLOCK(stcb); in sctp_send_initiate_ack()
5879 SCTP_TCB_LOCK(stcb); in sctp_send_initiate_ack()
6095 m_last = sctp_add_addresses_to_i_ia(inp, stcb, &scp, m_last, in sctp_send_initiate_ack()
6207 sctp_prune_prsctp(struct sctp_tcb *stcb, in sctp_prune_prsctp() argument
6215 SCTP_TCB_LOCK_ASSERT(stcb); in sctp_prune_prsctp()
6250 ret_spc = sctp_release_pr_sctp_chunk(stcb, chk, in sctp_prune_prsctp()
6273 ret_spc = sctp_release_pr_sctp_chunk(stcb, chk, in sctp_prune_prsctp()
6288 sctp_get_frag_point(struct sctp_tcb *stcb) in sctp_get_frag_point() argument
6293 asoc = &stcb->asoc; in sctp_get_frag_point()
6295 if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { in sctp_get_frag_point()
6387 sctp_msg_append(struct sctp_tcb *stcb, in sctp_msg_append() argument
6397 SCTP_TCB_LOCK_ASSERT(stcb); in sctp_msg_append()
6403 if (srcv->sinfo_stream >= stcb->asoc.streamoutcnt) { in sctp_msg_append()
6405 SCTP_LTRACE_ERR_RET_PKT(m, NULL, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL); in sctp_msg_append()
6409 if ((stcb->asoc.stream_locked) && in sctp_msg_append()
6410 (stcb->asoc.stream_locked_on != srcv->sinfo_stream)) { in sctp_msg_append()
6411 SCTP_LTRACE_ERR_RET_PKT(m, NULL, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL); in sctp_msg_append()
6415 if ((stcb->asoc.strmout[srcv->sinfo_stream].state != SCTP_STREAM_OPEN) && in sctp_msg_append()
6416 (stcb->asoc.strmout[srcv->sinfo_stream].state != SCTP_STREAM_OPENING)) { in sctp_msg_append()
6420 if (stcb->asoc.strmout[srcv->sinfo_stream].state > SCTP_STREAM_OPEN) { in sctp_msg_append()
6428 if ((SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_SENT) || in sctp_msg_append()
6429 (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_ACK_SENT) || in sctp_msg_append()
6430 (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED) || in sctp_msg_append()
6431 (stcb->asoc.state & SCTP_STATE_SHUTDOWN_PENDING)) { in sctp_msg_append()
6433 SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, EPIPE); in sctp_msg_append()
6437 sctp_alloc_a_strmoq(stcb, sp); in sctp_msg_append()
6439 SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); in sctp_msg_append()
6476 sp->auth_keyid = stcb->asoc.authinfo.active_keyid; in sctp_msg_append()
6478 if (sctp_auth_is_required_chunk(SCTP_DATA, stcb->asoc.peer_auth_chunks)) { in sctp_msg_append()
6479 sctp_auth_key_acquire(stcb, sp->auth_keyid); in sctp_msg_append()
6482 strm = &stcb->asoc.strmout[srcv->sinfo_stream]; in sctp_msg_append()
6483 sctp_snd_sb_alloc(stcb, sp->length); in sctp_msg_append()
6484 atomic_add_int(&stcb->asoc.stream_queue_cnt, 1); in sctp_msg_append()
6486 stcb->asoc.ss_functions.sctp_ss_add_to_stream(stcb, &stcb->asoc, strm, sp); in sctp_msg_append()
6650 struct sctp_tcb *stcb,
6659 sctp_sendall_iterator(struct sctp_inpcb *inp, struct sctp_tcb *stcb, void *ptr, in sctp_sendall_iterator() argument
6693 SCTP_TCB_LOCK_ASSERT(stcb); in sctp_sendall_iterator()
6694 if (stcb->asoc.alternate) { in sctp_sendall_iterator()
6695 net = stcb->asoc.alternate; in sctp_sendall_iterator()
6697 net = stcb->asoc.primary_destination; in sctp_sendall_iterator()
6721 atomic_add_int(&stcb->asoc.refcnt, 1); in sctp_sendall_iterator()
6722 sctp_abort_an_association(inp, stcb, m, false, SCTP_SO_NOT_LOCKED); in sctp_sendall_iterator()
6734 SCTP_TCB_LOCK(stcb); in sctp_sendall_iterator()
6735 atomic_subtract_int(&stcb->asoc.refcnt, 1); in sctp_sendall_iterator()
6739 ret = sctp_msg_append(stcb, net, m, &ca->sndrcv); in sctp_sendall_iterator()
6741 asoc = &stcb->asoc; in sctp_sendall_iterator()
6746 sctp_is_there_unsent_data(stcb, SCTP_SO_NOT_LOCKED) == 0) { in sctp_sendall_iterator()
6747 if ((*asoc->ss_functions.sctp_ss_is_user_msgs_incomplete) (stcb, asoc)) { in sctp_sendall_iterator()
6754 if ((SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_SENT) && in sctp_sendall_iterator()
6755 (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_RECEIVED) && in sctp_sendall_iterator()
6756 (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { in sctp_sendall_iterator()
6761 if (SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) { in sctp_sendall_iterator()
6764 SCTP_SET_STATE(stcb, SCTP_STATE_SHUTDOWN_SENT); in sctp_sendall_iterator()
6765 sctp_stop_timers_for_shutdown(stcb); in sctp_sendall_iterator()
6766 sctp_send_shutdown(stcb, net); in sctp_sendall_iterator()
6767 sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, stcb->sctp_ep, stcb, in sctp_sendall_iterator()
6769 sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, stcb->sctp_ep, stcb, in sctp_sendall_iterator()
6785 if ((SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_SENT) && in sctp_sendall_iterator()
6786 (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_RECEIVED) && in sctp_sendall_iterator()
6787 (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { in sctp_sendall_iterator()
6788 if ((*asoc->ss_functions.sctp_ss_is_user_msgs_incomplete) (stcb, asoc)) { in sctp_sendall_iterator()
6789 SCTP_ADD_SUBSTATE(stcb, SCTP_STATE_PARTIAL_MSG_LEFT); in sctp_sendall_iterator()
6791 SCTP_ADD_SUBSTATE(stcb, SCTP_STATE_SHUTDOWN_PENDING); in sctp_sendall_iterator()
6803 atomic_add_int(&stcb->asoc.refcnt, 1); in sctp_sendall_iterator()
6804 sctp_abort_an_association(stcb->sctp_ep, stcb, in sctp_sendall_iterator()
6806 atomic_subtract_int(&stcb->asoc.refcnt, 1); in sctp_sendall_iterator()
6813 un_sent = ((stcb->asoc.total_output_queue_size - stcb->asoc.total_flight) + in sctp_sendall_iterator()
6814 (stcb->asoc.stream_queue_cnt * SCTP_DATA_CHUNK_OVERHEAD(stcb))); in sctp_sendall_iterator()
6817 (stcb->asoc.total_flight > 0) && in sctp_sendall_iterator()
6818 (un_sent < (int)(stcb->asoc.smallest_mtu - SCTP_MIN_OVERHEAD))) { in sctp_sendall_iterator()
6822 sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_USR_SEND, SCTP_SO_NOT_LOCKED); in sctp_sendall_iterator()
6827 (void)sctp_med_chunk_output(inp, stcb, &stcb->asoc, &num_out, in sctp_sendall_iterator()
6829 sctp_get_frag_point(stcb), in sctp_sendall_iterator()
6989 sctp_toss_old_cookies(struct sctp_tcb *stcb, struct sctp_association *asoc) in sctp_toss_old_cookies() argument
7001 sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); in sctp_toss_old_cookies()
7007 sctp_toss_old_asconf(struct sctp_tcb *stcb) in sctp_toss_old_asconf() argument
7013 asoc = &stcb->asoc; in sctp_toss_old_asconf()
7030 sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); in sctp_toss_old_asconf()
7036 sctp_clean_up_datalist(struct sctp_tcb *stcb, in sctp_clean_up_datalist() argument
7110 sctp_total_flight_increase(stcb, data_list[i]); in sctp_clean_up_datalist()
7117 if (asoc->peers_rwnd < stcb->sctp_ep->sctp_ep.sctp_sws_sender) { in sctp_clean_up_datalist()
7123 (*asoc->cc_functions.sctp_cwnd_update_packet_transmitted) (stcb, net); in sctp_clean_up_datalist()
7128 sctp_clean_up_ctl(struct sctp_tcb *stcb, struct sctp_association *asoc, int so_locked) in sctp_clean_up_ctl() argument
7156 sctp_free_a_chunk(stcb, chk, so_locked); in sctp_clean_up_ctl()
7167 sctp_can_we_split_this(struct sctp_tcb *stcb, uint32_t length, in sctp_can_we_split_this() argument
7186 if (stcb->asoc.total_flight == 0) { in sctp_can_we_split_this()
7205 if (SCTP_SB_LIMIT_SND(stcb->sctp_socket) < frag_point) { in sctp_can_we_split_this()
7226 sctp_move_to_outqueue(struct sctp_tcb *stcb, in sctp_move_to_outqueue() argument
7247 SCTP_TCB_LOCK_ASSERT(stcb); in sctp_move_to_outqueue()
7248 asoc = &stcb->asoc; in sctp_move_to_outqueue()
7257 if ((sctp_is_feature_on(stcb->sctp_ep, SCTP_PCB_FLAGS_EXPLICIT_EOR) == 0) && in sctp_move_to_outqueue()
7258 (stcb->asoc.idata_supported == 0) && in sctp_move_to_outqueue()
7285 stcb->asoc.ss_functions.sctp_ss_remove_from_stream(stcb, asoc, strq, sp); in sctp_move_to_outqueue()
7289 stcb->asoc.trigger_reset = 1; in sctp_move_to_outqueue()
7299 sctp_free_a_strmoq(stcb, sp, so_locked); in sctp_move_to_outqueue()
7320 atomic_subtract_int(&stcb->asoc.total_output_queue_size, sp->length); in sctp_move_to_outqueue()
7321 if ((stcb->sctp_socket != NULL) && in sctp_move_to_outqueue()
7322 ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || in sctp_move_to_outqueue()
7323 (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { in sctp_move_to_outqueue()
7324 SCTP_SB_DECR(&stcb->sctp_socket->so_snd, sp->length); in sctp_move_to_outqueue()
7362 to_move = sctp_can_we_split_this(stcb, length, space_left, frag_point, eeor_mode); in sctp_move_to_outqueue()
7380 sctp_alloc_a_chunk(stcb, chk); in sctp_move_to_outqueue()
7420 sctp_free_a_chunk(stcb, chk, so_locked); in sctp_move_to_outqueue()
7485 leading = SCTP_DATA_CHUNK_OVERHEAD(stcb); in sctp_move_to_outqueue()
7513 sctp_free_a_chunk(stcb, chk, so_locked); in sctp_move_to_outqueue()
7523 SCTP_BUF_PREPEND(chk->data, SCTP_DATA_CHUNK_OVERHEAD(stcb), M_NOWAIT); in sctp_move_to_outqueue()
7530 sctp_free_a_chunk(stcb, chk, so_locked); in sctp_move_to_outqueue()
7536 sctp_snd_sb_alloc(stcb, SCTP_DATA_CHUNK_OVERHEAD(stcb)); in sctp_move_to_outqueue()
7537 chk->book_size = chk->send_size = (uint16_t)(to_move + SCTP_DATA_CHUNK_OVERHEAD(stcb)); in sctp_move_to_outqueue()
7542 chk->asoc = &stcb->asoc; in sctp_move_to_outqueue()
7545 if (stcb->asoc.idata_supported == 0) { in sctp_move_to_outqueue()
7584 sctp_auth_key_acquire(stcb, chk->auth_keyid); in sctp_move_to_outqueue()
7587 stcb->asoc.ss_functions.sctp_ss_scheduled(stcb, net, asoc, strq, to_move); in sctp_move_to_outqueue()
7591 (uint32_t)(uintptr_t)stcb, sp->length, in sctp_move_to_outqueue()
7595 if (stcb->asoc.idata_supported == 0) { in sctp_move_to_outqueue()
7605 SCTP_TCB_LOCK_ASSERT(stcb); in sctp_move_to_outqueue()
7616 asoc->out_tsnlog[asoc->tsn_out_at].stcb = (void *)stcb; in sctp_move_to_outqueue()
7621 if (stcb->asoc.idata_supported == 0) { in sctp_move_to_outqueue()
7672 stcb->asoc.ss_functions.sctp_ss_remove_from_stream(stcb, asoc, strq, sp); in sctp_move_to_outqueue()
7676 stcb->asoc.trigger_reset = 1; in sctp_move_to_outqueue()
7686 sctp_free_a_strmoq(stcb, sp, so_locked); in sctp_move_to_outqueue()
7697 sctp_fill_outqueue(struct sctp_tcb *stcb, struct sctp_nets *net, in sctp_fill_outqueue() argument
7706 SCTP_TCB_LOCK_ASSERT(stcb); in sctp_fill_outqueue()
7707 asoc = &stcb->asoc; in sctp_fill_outqueue()
7726 space_left -= SCTP_DATA_CHUNK_OVERHEAD(stcb); in sctp_fill_outqueue()
7730 strq = stcb->asoc.ss_functions.sctp_ss_select_stream(stcb, net, asoc); in sctp_fill_outqueue()
7734 moved = sctp_move_to_outqueue(stcb, net, strq, space_left, in sctp_fill_outqueue()
7740 strq = stcb->asoc.ss_functions.sctp_ss_select_stream(stcb, net, asoc); in sctp_fill_outqueue()
7747 if (space_left >= SCTP_DATA_CHUNK_OVERHEAD(stcb)) { in sctp_fill_outqueue()
7748 space_left -= SCTP_DATA_CHUNK_OVERHEAD(stcb); in sctp_fill_outqueue()
7757 stcb->asoc.ss_functions.sctp_ss_packet_done(stcb, net, asoc); in sctp_fill_outqueue()
7760 if ((stcb->asoc.sctp_cmt_on_off == 0) && in sctp_fill_outqueue()
7761 (net == stcb->asoc.primary_destination)) { in sctp_fill_outqueue()
7764 } else if (stcb->asoc.sctp_cmt_on_off > 0) { in sctp_fill_outqueue()
7784 sctp_move_chunks_from_net(struct sctp_tcb *stcb, struct sctp_nets *net) in sctp_move_chunks_from_net() argument
7794 asoc = &stcb->asoc; in sctp_move_chunks_from_net()
7795 for (i = 0; i < stcb->asoc.streamoutcnt; i++) { in sctp_move_chunks_from_net()
7796 TAILQ_FOREACH(sp, &stcb->asoc.strmout[i].outqueue, next) { in sctp_move_chunks_from_net()
7813 struct sctp_tcb *stcb, in sctp_med_chunk_output() argument
7862 auth_keyid = stcb->asoc.authinfo.active_keyid; in sctp_med_chunk_output()
7864 (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED) || in sctp_med_chunk_output()
7879 SCTP_TCB_LOCK_ASSERT(stcb); in sctp_med_chunk_output()
7888 (asoc->ctrl_queue_cnt == stcb->asoc.ecn_echo_cnt_onq)) && in sctp_med_chunk_output()
7891 sctp_is_there_unsent_data(stcb, so_locked) == 0) { in sctp_med_chunk_output()
7904 if (stcb->asoc.ecn_echo_cnt_onq) { in sctp_med_chunk_output()
7907 (asoc->ctrl_queue_cnt == stcb->asoc.ecn_echo_cnt_onq)) { in sctp_med_chunk_output()
7920 if (stcb->sctp_socket) in sctp_med_chunk_output()
7921 max_send_per_dest = SCTP_SB_LIMIT_SND(stcb->sctp_socket) / asoc->numnets; in sctp_med_chunk_output()
7939 (!stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc))) { in sctp_med_chunk_output()
7953 if ((net != stcb->asoc.alternate) && in sctp_med_chunk_output()
7958 sctp_log_cwnd(stcb, net, 1, in sctp_med_chunk_output()
7963 if ((stcb->asoc.cc_functions.sctp_cwnd_new_transmission_begins) && in sctp_med_chunk_output()
7965 (*stcb->asoc.cc_functions.sctp_cwnd_new_transmission_begins) (stcb, net); in sctp_med_chunk_output()
7970 sctp_log_cwnd(stcb, net, 3, in sctp_med_chunk_output()
7976 sctp_log_cwnd(stcb, net, 4, SCTP_CWND_LOG_FILL_OUTQ_CALLED); in sctp_med_chunk_output()
7978 sctp_fill_outqueue(stcb, net, frag_point, eeor_mode, &quit_now, so_locked); in sctp_med_chunk_output()
8122 stcb->asoc.peer_auth_chunks)) { in sctp_med_chunk_output()
8123 omtu = sctp_get_auth_chunk_len(stcb->asoc.peer_hmac_id); in sctp_med_chunk_output()
8145 stcb->asoc.peer_auth_chunks))) { in sctp_med_chunk_output()
8150 stcb, in sctp_med_chunk_output()
8159 SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); in sctp_med_chunk_output()
8199 sctp_timer_start(SCTP_TIMER_TYPE_ASCONF, inp, stcb, net); in sctp_med_chunk_output()
8211 if ((error = sctp_lowlevel_chunk_output(inp, stcb, net, in sctp_med_chunk_output()
8214 stcb->asoc.authinfo.active_keyid, in sctp_med_chunk_output()
8216 inp->sctp_lport, stcb->rport, in sctp_med_chunk_output()
8217 htonl(stcb->asoc.peer_vtag), in sctp_med_chunk_output()
8240 sctp_move_chunks_from_net(stcb, net); in sctp_med_chunk_output()
8349 stcb->asoc.peer_auth_chunks)) { in sctp_med_chunk_output()
8350 omtu = sctp_get_auth_chunk_len(stcb->asoc.peer_hmac_id); in sctp_med_chunk_output()
8372 stcb->asoc.peer_auth_chunks))) { in sctp_med_chunk_output()
8377 stcb, in sctp_med_chunk_output()
8386 SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); in sctp_med_chunk_output()
8421 if (SCTP_OS_TIMER_PENDING(&stcb->asoc.dack_timer.timer)) { in sctp_med_chunk_output()
8423 inp, stcb, NULL, in sctp_med_chunk_output()
8477 sctp_timer_start(SCTP_TIMER_TYPE_ASCONF, inp, stcb, net); in sctp_med_chunk_output()
8487 sctp_timer_start(SCTP_TIMER_TYPE_COOKIE, inp, stcb, net); in sctp_med_chunk_output()
8500 if ((error = sctp_lowlevel_chunk_output(inp, stcb, net, in sctp_med_chunk_output()
8504 stcb->asoc.authinfo.active_keyid, in sctp_med_chunk_output()
8506 inp->sctp_lport, stcb->rport, in sctp_med_chunk_output()
8507 htonl(stcb->asoc.peer_vtag), in sctp_med_chunk_output()
8529 sctp_move_chunks_from_net(stcb, net); in sctp_med_chunk_output()
8576 (net != stcb->asoc.alternate) && in sctp_med_chunk_output()
8610 stcb->asoc.peer_auth_chunks); in sctp_med_chunk_output()
8612 mtu -= sctp_get_auth_chunk_len(stcb->asoc.peer_hmac_id); in sctp_med_chunk_output()
8637 if ((((SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) || in sctp_med_chunk_output()
8638 (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED)) && in sctp_med_chunk_output()
8708 stcb, in sctp_med_chunk_output()
8733 sctp_timer_start(SCTP_TIMER_TYPE_SEND, inp, stcb, net); in sctp_med_chunk_output()
8736 SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); in sctp_med_chunk_output()
8789 if ((one_chunk) && (stcb->asoc.total_flight == 0)) { in sctp_med_chunk_output()
8818 stcb, net); in sctp_med_chunk_output()
8827 sctp_timer_start(SCTP_TIMER_TYPE_COOKIE, inp, stcb, net); in sctp_med_chunk_output()
8837 sctp_timer_start(SCTP_TIMER_TYPE_SEND, inp, stcb, net); in sctp_med_chunk_output()
8849 stcb, in sctp_med_chunk_output()
8859 inp->sctp_lport, stcb->rport, in sctp_med_chunk_output()
8860 htonl(stcb->asoc.peer_vtag), in sctp_med_chunk_output()
8879 sctp_move_chunks_from_net(stcb, net); in sctp_med_chunk_output()
8918 sctp_clean_up_datalist(stcb, asoc, data_list, bundle_at, net); in sctp_med_chunk_output()
8925 sctp_log_cwnd(stcb, net, tsns_sent, SCTP_CWND_LOG_FROM_SEND); in sctp_med_chunk_output()
8940 sctp_log_cwnd(stcb, net, *num_out, SCTP_CWND_LOG_FROM_SEND); in sctp_med_chunk_output()
8947 sctp_clean_up_ctl(stcb, asoc, so_locked); in sctp_med_chunk_output()
8952 sctp_queue_op_err(struct sctp_tcb *stcb, struct mbuf *op_err) in sctp_queue_op_err() argument
8964 SCTP_TCB_LOCK_ASSERT(stcb); in sctp_queue_op_err()
8991 sctp_alloc_a_chunk(stcb, chk); in sctp_queue_op_err()
9004 chk->asoc = &stcb->asoc; in sctp_queue_op_err()
9018 struct sctp_tcb *stcb, in sctp_send_cookie_echo() argument
9032 SCTP_TCB_LOCK_ASSERT(stcb); in sctp_send_cookie_echo()
9081 sctp_alloc_a_chunk(stcb, chk); in sctp_send_cookie_echo()
9094 chk->asoc = &stcb->asoc; in sctp_send_cookie_echo()
9104 sctp_send_heartbeat_ack(struct sctp_tcb *stcb, in sctp_send_heartbeat_ack() argument
9137 sctp_alloc_a_chunk(stcb, chk); in sctp_send_heartbeat_ack()
9150 chk->asoc = &stcb->asoc; in sctp_send_heartbeat_ack()
9159 sctp_send_cookie_ack(struct sctp_tcb *stcb) in sctp_send_cookie_ack() argument
9166 SCTP_TCB_LOCK_ASSERT(stcb); in sctp_send_cookie_ack()
9174 sctp_alloc_a_chunk(stcb, chk); in sctp_send_cookie_ack()
9187 chk->asoc = &stcb->asoc; in sctp_send_cookie_ack()
9206 sctp_send_shutdown_ack(struct sctp_tcb *stcb, struct sctp_nets *net) in sctp_send_shutdown_ack() argument
9219 sctp_alloc_a_chunk(stcb, chk); in sctp_send_shutdown_ack()
9232 chk->asoc = &stcb->asoc; in sctp_send_shutdown_ack()
9249 sctp_send_shutdown(struct sctp_tcb *stcb, struct sctp_nets *net) in sctp_send_shutdown() argument
9256 TAILQ_FOREACH(chk, &stcb->asoc.control_send_queue, sctp_next) { in sctp_send_shutdown()
9273 sctp_alloc_a_chunk(stcb, chk); in sctp_send_shutdown()
9286 chk->asoc = &stcb->asoc; in sctp_send_shutdown()
9296 shutdown_cp->cumulative_tsn_ack = htonl(stcb->asoc.cumulative_tsn); in sctp_send_shutdown()
9301 TAILQ_REMOVE(&stcb->asoc.control_send_queue, chk, sctp_next); in sctp_send_shutdown()
9307 shutdown_cp->cumulative_tsn_ack = htonl(stcb->asoc.cumulative_tsn); in sctp_send_shutdown()
9308 TAILQ_INSERT_TAIL(&stcb->asoc.control_send_queue, chk, sctp_next); in sctp_send_shutdown()
9314 sctp_send_asconf(struct sctp_tcb *stcb, struct sctp_nets *net, int addr_locked) in sctp_send_asconf() argument
9324 SCTP_TCB_LOCK_ASSERT(stcb); in sctp_send_asconf()
9326 if ((!TAILQ_EMPTY(&stcb->asoc.asconf_send_queue)) && in sctp_send_asconf()
9327 (!sctp_is_feature_on(stcb->sctp_ep, SCTP_PCB_FLAGS_MULTIPLE_ASCONFS))) { in sctp_send_asconf()
9333 m_asconf = sctp_compose_asconf(stcb, &len, addr_locked); in sctp_send_asconf()
9338 sctp_alloc_a_chunk(stcb, chk); in sctp_send_asconf()
9353 chk->asoc = &stcb->asoc; in sctp_send_asconf()
9364 sctp_send_asconf_ack(struct sctp_tcb *stcb) in sctp_send_asconf_ack() argument
9375 SCTP_TCB_LOCK_ASSERT(stcb); in sctp_send_asconf_ack()
9377 latest_ack = TAILQ_LAST(&stcb->asoc.asconf_ack_sent, sctp_asconf_ackhead); in sctp_send_asconf_ack()
9382 latest_ack->last_sent_to == stcb->asoc.last_control_chunk_from) { in sctp_send_asconf_ack()
9384 net = sctp_find_alternate_net(stcb, stcb->asoc.last_control_chunk_from, 0); in sctp_send_asconf_ack()
9387 if (stcb->asoc.last_control_chunk_from == NULL) { in sctp_send_asconf_ack()
9388 if (stcb->asoc.alternate) { in sctp_send_asconf_ack()
9389 net = stcb->asoc.alternate; in sctp_send_asconf_ack()
9391 net = stcb->asoc.primary_destination; in sctp_send_asconf_ack()
9394 net = stcb->asoc.last_control_chunk_from; in sctp_send_asconf_ack()
9399 if (stcb->asoc.last_control_chunk_from == NULL) { in sctp_send_asconf_ack()
9400 if (stcb->asoc.alternate) { in sctp_send_asconf_ack()
9401 net = stcb->asoc.alternate; in sctp_send_asconf_ack()
9403 net = stcb->asoc.primary_destination; in sctp_send_asconf_ack()
9406 net = stcb->asoc.last_control_chunk_from; in sctp_send_asconf_ack()
9411 TAILQ_FOREACH(ack, &stcb->asoc.asconf_ack_sent, next) { in sctp_send_asconf_ack()
9428 sctp_alloc_a_chunk(stcb, chk); in sctp_send_asconf_ack()
9447 chk->asoc = &stcb->asoc; in sctp_send_asconf_ack()
9457 struct sctp_tcb *stcb, in sctp_chunk_retransmission() argument
9489 SCTP_TCB_LOCK_ASSERT(stcb); in sctp_chunk_retransmission()
9496 auth_keyid = stcb->asoc.authinfo.active_keyid; in sctp_chunk_retransmission()
9536 stcb->asoc.peer_auth_chunks))) { in sctp_chunk_retransmission()
9539 stcb, in sctp_chunk_retransmission()
9560 sctp_timer_start(SCTP_TIMER_TYPE_COOKIE, inp, stcb, chk->whoTo); in sctp_chunk_retransmission()
9564 sctp_timer_start(SCTP_TIMER_TYPE_ASCONF, inp, stcb, chk->whoTo); in sctp_chunk_retransmission()
9568 if ((error = sctp_lowlevel_chunk_output(inp, stcb, chk->whoTo, in sctp_chunk_retransmission()
9570 auth_offset, auth, stcb->asoc.authinfo.active_keyid, in sctp_chunk_retransmission()
9572 inp->sctp_lport, stcb->rport, htonl(stcb->asoc.peer_vtag), in sctp_chunk_retransmission()
9596 sctp_ucount_decr(stcb->asoc.sent_queue_retran_cnt); in sctp_chunk_retransmission()
9601 sctp_clean_up_ctl(stcb, asoc, so_locked); in sctp_chunk_retransmission()
9612 if ((SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED) || in sctp_chunk_retransmission()
9613 (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT)) { in sctp_chunk_retransmission()
9618 sctp_auditing(20, inp, stcb, NULL); in sctp_chunk_retransmission()
9620 data_auth_reqd = sctp_auth_is_required_chunk(SCTP_DATA, stcb->asoc.peer_auth_chunks); in sctp_chunk_retransmission()
9640 atomic_add_int(&stcb->asoc.refcnt, 1); in sctp_chunk_retransmission()
9641 sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, in sctp_chunk_retransmission()
9643 SCTP_TCB_LOCK(stcb); in sctp_chunk_retransmission()
9644 atomic_subtract_int(&stcb->asoc.refcnt, 1); in sctp_chunk_retransmission()
9721 dmtu = sctp_get_auth_chunk_len(stcb->asoc.peer_hmac_id); in sctp_chunk_retransmission()
9734 stcb, in sctp_chunk_retransmission()
9749 SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); in sctp_chunk_retransmission()
9781 dmtu = sctp_get_auth_chunk_len(stcb->asoc.peer_hmac_id); in sctp_chunk_retransmission()
9791 stcb, in sctp_chunk_retransmission()
9809 SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); in sctp_chunk_retransmission()
9842 sctp_timer_start(SCTP_TIMER_TYPE_SEND, inp, stcb, net); in sctp_chunk_retransmission()
9854 if ((error = sctp_lowlevel_chunk_output(inp, stcb, net, in sctp_chunk_retransmission()
9858 inp->sctp_lport, stcb->rport, htonl(stcb->asoc.peer_vtag), in sctp_chunk_retransmission()
9948 sctp_total_flight_increase(stcb, data_list[i]); in sctp_chunk_retransmission()
9949 if (asoc->peers_rwnd < stcb->sctp_ep->sctp_ep.sctp_sws_sender) { in sctp_chunk_retransmission()
9967 sctp_timer_stop(SCTP_TIMER_TYPE_SEND, inp, stcb, net, in sctp_chunk_retransmission()
9969 sctp_timer_start(SCTP_TIMER_TYPE_SEND, inp, stcb, net); in sctp_chunk_retransmission()
9974 sctp_log_cwnd(stcb, net, tsns_sent, SCTP_CWND_LOG_FROM_RESEND); in sctp_chunk_retransmission()
9977 sctp_auditing(21, inp, stcb, NULL); in sctp_chunk_retransmission()
10000 struct sctp_tcb *stcb, in sctp_timer_validation() argument
10012 SCTP_TCB_LOCK_ASSERT(stcb); in sctp_timer_validation()
10016 sctp_timer_start(SCTP_TIMER_TYPE_SEND, inp, stcb, asoc->alternate); in sctp_timer_validation()
10018 sctp_timer_start(SCTP_TIMER_TYPE_SEND, inp, stcb, asoc->primary_destination); in sctp_timer_validation()
10025 struct sctp_tcb *stcb, in sctp_chunk_output() argument
10049 uint32_t frag_point = sctp_get_frag_point(stcb); in sctp_chunk_output()
10054 asoc = &stcb->asoc; in sctp_chunk_output()
10066 SCTP_TCB_LOCK_ASSERT(stcb); in sctp_chunk_output()
10068 un_sent = (stcb->asoc.total_output_queue_size - stcb->asoc.total_flight); in sctp_chunk_output()
10082 if (SCTP_OS_TIMER_PENDING(&stcb->asoc.dack_timer.timer)) { in sctp_chunk_output()
10083 sctp_send_sack(stcb, so_locked); in sctp_chunk_output()
10084 sctp_timer_stop(SCTP_TIMER_TYPE_RECV, stcb->sctp_ep, stcb, NULL, in sctp_chunk_output()
10098 (void)sctp_med_chunk_output(inp, stcb, asoc, &num_out, &reason_code, 1, in sctp_chunk_output()
10105 …ret = sctp_chunk_retransmission(inp, stcb, asoc, &num_out, &now, &now_filled, &fr_done, so_locked); in sctp_chunk_output()
10123 (void)sctp_med_chunk_output(inp, stcb, asoc, &num_out, &reason_code, 1, in sctp_chunk_output()
10127 sctp_auditing(8, inp, stcb, NULL); in sctp_chunk_output()
10129 sctp_timer_validation(inp, stcb, asoc); in sctp_chunk_output()
10138 sctp_auditing(9, inp, stcb, NULL); in sctp_chunk_output()
10148 sctp_auditing(10, inp, stcb, NULL); in sctp_chunk_output()
10151 (void)sctp_med_chunk_output(inp, stcb, asoc, &num_out, &reason_code, 1, from_where, in sctp_chunk_output()
10165 sctp_auditing(12, inp, stcb, NULL); in sctp_chunk_output()
10178 sctp_move_chunks_from_net(stcb, net); in sctp_chunk_output()
10193 asoc->cc_functions.sctp_cwnd_update_after_output(stcb, net, asoc->max_burst); in sctp_chunk_output()
10195 sctp_log_maxburst(stcb, net, 0, asoc->max_burst, SCTP_MAX_BURST_APPLIED); in sctp_chunk_output()
10214 error = sctp_med_chunk_output(inp, stcb, asoc, &num_out, in sctp_chunk_output()
10220 sctp_log_maxburst(stcb, asoc->primary_destination, error, burst_cnt, SCTP_MAX_BURST_ERROR_STOP); in sctp_chunk_output()
10223 sctp_log_cwnd(stcb, NULL, error, SCTP_SEND_NOW_COMPLETES); in sctp_chunk_output()
10224 sctp_log_cwnd(stcb, NULL, 0xdeadbeef, SCTP_SEND_NOW_COMPLETES); in sctp_chunk_output()
10233 sctp_log_cwnd(stcb, NULL, num_out, SCTP_SEND_NOW_COMPLETES); in sctp_chunk_output()
10235 sctp_log_cwnd(stcb, NULL, reason_code, SCTP_SEND_NOW_COMPLETES); in sctp_chunk_output()
10245 un_sent = stcb->asoc.total_output_queue_size - stcb->asoc.total_flight; in sctp_chunk_output()
10246 if ((un_sent < (int)(stcb->asoc.smallest_mtu - SCTP_MIN_OVERHEAD)) && in sctp_chunk_output()
10247 (stcb->asoc.total_flight > 0)) { in sctp_chunk_output()
10254 sctp_is_there_unsent_data(stcb, so_locked) == 0) { in sctp_chunk_output()
10258 if ((stcb->asoc.total_output_queue_size - stcb->asoc.total_flight) <= 0) { in sctp_chunk_output()
10272 sctp_log_maxburst(stcb, asoc->primary_destination, 0, burst_cnt, SCTP_MAX_BURST_APPLIED); in sctp_chunk_output()
10279 sctp_log_cwnd(stcb, NULL, tot_out, SCTP_SEND_NOW_COMPLETES); in sctp_chunk_output()
10289 if (stcb->asoc.ecn_echo_cnt_onq) in sctp_chunk_output()
10292 if (stcb->asoc.trigger_reset) { in sctp_chunk_output()
10293 if (sctp_send_stream_reset_out_if_possible(stcb, so_locked) == 0) { in sctp_chunk_output()
10328 send_forward_tsn(struct sctp_tcb *stcb, in send_forward_tsn() argument
10340 SCTP_TCB_LOCK_ASSERT(stcb); in send_forward_tsn()
10355 sctp_alloc_a_chunk(stcb, chk); in send_forward_tsn()
10373 sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); in send_forward_tsn()
10408 if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { in send_forward_tsn()
10542 sctp_send_sack(struct sctp_tcb *stcb, int so_locked) in sctp_send_sack() argument
10570 if (stcb->asoc.nrsack_supported == 1) { in sctp_send_sack()
10576 asoc = &stcb->asoc; in sctp_send_sack()
10577 SCTP_TCB_LOCK_ASSERT(stcb); in sctp_send_sack()
10582 sctp_slide_mapping_arrays(stcb); in sctp_send_sack()
10583 sctp_set_rwnd(stcb, asoc); in sctp_send_sack()
10602 sctp_alloc_a_chunk(stcb, a_chk); in sctp_send_sack()
10605 if (stcb->asoc.delayed_ack) { in sctp_send_sack()
10607 stcb->sctp_ep, stcb, NULL, in sctp_send_sack()
10610 stcb->sctp_ep, stcb, NULL); in sctp_send_sack()
10612 stcb->asoc.send_sack = 1; in sctp_send_sack()
10635 a_chk->whoTo = sctp_find_alternate_net(stcb, asoc->last_data_chunk_from, 0); in sctp_send_sack()
10672 sctp_free_a_chunk(stcb, a_chk, so_locked); in sctp_send_sack()
10674 if (stcb->asoc.delayed_ack) { in sctp_send_sack()
10676 stcb->sctp_ep, stcb, NULL, in sctp_send_sack()
10679 stcb->sctp_ep, stcb, NULL); in sctp_send_sack()
10681 stcb->asoc.send_sack = 1; in sctp_send_sack()
10707 stcb->asoc.cumack_logsnt[stcb->asoc.cumack_log_atsnt] = asoc->cumulative_tsn; in sctp_send_sack()
10708 stcb->asoc.cumack_log_atsnt++; in sctp_send_sack()
10709 if (stcb->asoc.cumack_log_atsnt >= SCTP_TSN_LOG_SIZE) { in sctp_send_sack()
10710 stcb->asoc.cumack_log_atsnt = 0; in sctp_send_sack()
10714 stcb->freed_by_sorcv_sincelast = 0; in sctp_send_sack()
10935 sctp_send_abort_tcb(struct sctp_tcb *stcb, struct mbuf *operr, int so_locked) in sctp_send_abort_tcb() argument
10948 SCTP_TCB_LOCK_ASSERT(stcb); in sctp_send_abort_tcb()
10954 stcb->asoc.peer_auth_chunks)) { in sctp_send_abort_tcb()
10956 stcb, SCTP_ABORT_ASSOCIATION); in sctp_send_abort_tcb()
10961 switch (stcb->asoc.snd_edmid) { in sctp_send_abort_tcb()
11000 if (stcb->asoc.alternate) { in sctp_send_abort_tcb()
11001 net = stcb->asoc.alternate; in sctp_send_abort_tcb()
11003 net = stcb->asoc.primary_destination; in sctp_send_abort_tcb()
11008 if (stcb->asoc.peer_vtag == 0) { in sctp_send_abort_tcb()
11010 vtag = stcb->asoc.my_vtag; in sctp_send_abort_tcb()
11013 vtag = stcb->asoc.peer_vtag; in sctp_send_abort_tcb()
11025 if ((error = sctp_lowlevel_chunk_output(stcb->sctp_ep, stcb, net, in sctp_send_abort_tcb()
11027 m_out, auth_offset, auth, stcb->asoc.authinfo.active_keyid, 1, 0, 0, in sctp_send_abort_tcb()
11028 stcb->sctp_ep->sctp_lport, stcb->rport, htonl(vtag), in sctp_send_abort_tcb()
11029 stcb->asoc.primary_destination->port, NULL, in sctp_send_abort_tcb()
11035 stcb->asoc.ifp_had_enobuf = 1; in sctp_send_abort_tcb()
11039 stcb->asoc.ifp_had_enobuf = 0; in sctp_send_abort_tcb()
11045 sctp_send_shutdown_complete(struct sctp_tcb *stcb, in sctp_send_shutdown_complete() argument
11064 vtag = stcb->asoc.my_vtag; in sctp_send_shutdown_complete()
11067 vtag = stcb->asoc.peer_vtag; in sctp_send_shutdown_complete()
11069 switch (stcb->asoc.snd_edmid) { in sctp_send_shutdown_complete()
11082 if ((error = sctp_lowlevel_chunk_output(stcb->sctp_ep, stcb, net, in sctp_send_shutdown_complete()
11085 stcb->sctp_ep->sctp_lport, stcb->rport, in sctp_send_shutdown_complete()
11093 stcb->asoc.ifp_had_enobuf = 1; in sctp_send_shutdown_complete()
11097 stcb->asoc.ifp_had_enobuf = 0; in sctp_send_shutdown_complete()
11371 sctp_send_hb(struct sctp_tcb *stcb, struct sctp_nets *net, int so_locked) in sctp_send_hb() argument
11377 SCTP_TCB_LOCK_ASSERT(stcb); in sctp_send_hb()
11394 sctp_alloc_a_chunk(stcb, chk); in sctp_send_hb()
11404 chk->asoc = &stcb->asoc; in sctp_send_hb()
11409 sctp_free_a_chunk(stcb, chk, so_locked); in sctp_send_hb()
11438 …net->heartbeat_random1 = hb->heartbeat.hb_info.random_value1 = sctp_select_initial_TSN(&stcb->sctp… in sctp_send_hb()
11439 …net->heartbeat_random2 = hb->heartbeat.hb_info.random_value2 = sctp_select_initial_TSN(&stcb->sctp… in sctp_send_hb()
11464 sctp_free_a_chunk(stcb, chk, so_locked); in sctp_send_hb()
11469 TAILQ_INSERT_TAIL(&stcb->asoc.control_send_queue, chk, sctp_next); in sctp_send_hb()
11470 stcb->asoc.ctrl_queue_cnt++; in sctp_send_hb()
11476 sctp_send_ecn_echo(struct sctp_tcb *stcb, struct sctp_nets *net, in sctp_send_ecn_echo() argument
11486 asoc = &stcb->asoc; in sctp_send_ecn_echo()
11487 SCTP_TCB_LOCK_ASSERT(stcb); in sctp_send_ecn_echo()
11506 sctp_alloc_a_chunk(stcb, chk); in sctp_send_ecn_echo()
11515 chk->asoc = &stcb->asoc; in sctp_send_ecn_echo()
11519 sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); in sctp_send_ecn_echo()
11529 stcb->asoc.ecn_echo_cnt_onq++; in sctp_send_ecn_echo()
11536 TAILQ_INSERT_HEAD(&stcb->asoc.control_send_queue, chk, sctp_next); in sctp_send_ecn_echo()
11541 sctp_send_packet_dropped(struct sctp_tcb *stcb, struct sctp_nets *net, in sctp_send_packet_dropped() argument
11555 if (!stcb) { in sctp_send_packet_dropped()
11558 asoc = &stcb->asoc; in sctp_send_packet_dropped()
11559 SCTP_TCB_LOCK_ASSERT(stcb); in sctp_send_packet_dropped()
11566 if (stcb->sctp_socket == NULL) { in sctp_send_packet_dropped()
11569 sctp_alloc_a_chunk(stcb, chk); in sctp_send_packet_dropped()
11599 sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); in sctp_send_packet_dropped()
11610 min(stcb->asoc.smallest_mtu, MCLBYTES)) { in sctp_send_packet_dropped()
11615 len = min(stcb->asoc.smallest_mtu, MCLBYTES) - SCTP_MAX_OVERHEAD; in sctp_send_packet_dropped()
11618 chk->asoc = &stcb->asoc; in sctp_send_packet_dropped()
11622 sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); in sctp_send_packet_dropped()
11665 spc = SCTP_SB_LIMIT_RCV(stcb->sctp_socket); in sctp_send_packet_dropped()
11674 SCTP_SBAVAIL(&stcb->sctp_socket->so_rcv)); in sctp_send_packet_dropped()
11685 TAILQ_INSERT_TAIL(&stcb->asoc.control_send_queue, chk, sctp_next); in sctp_send_packet_dropped()
11690 sctp_send_cwr(struct sctp_tcb *stcb, struct sctp_nets *net, uint32_t high_tsn, uint8_t override) in sctp_send_cwr() argument
11696 SCTP_TCB_LOCK_ASSERT(stcb); in sctp_send_cwr()
11700 asoc = &stcb->asoc; in sctp_send_cwr()
11721 sctp_alloc_a_chunk(stcb, chk); in sctp_send_cwr()
11733 sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); in sctp_send_cwr()
11752 sctp_add_stream_reset_out(struct sctp_tcb *stcb, struct sctp_tmit_chunk *chk, in sctp_add_stream_reset_out() argument
11766 for (i = 0; i < stcb->asoc.streamoutcnt; i++) { in sctp_add_stream_reset_out()
11767 if ((stcb->asoc.strmout[i].state == SCTP_STREAM_RESET_PENDING) && in sctp_add_stream_reset_out()
11768 (stcb->asoc.strmout[i].chunks_on_queues == 0) && in sctp_add_stream_reset_out()
11769 TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { in sctp_add_stream_reset_out()
11776 if (number_entries == stcb->asoc.streamoutcnt) { in sctp_add_stream_reset_out()
11790 for (i = 0; i < stcb->asoc.streamoutcnt; i++) { in sctp_add_stream_reset_out()
11791 if ((stcb->asoc.strmout[i].state == SCTP_STREAM_RESET_PENDING) && in sctp_add_stream_reset_out()
11792 (stcb->asoc.strmout[i].chunks_on_queues == 0) && in sctp_add_stream_reset_out()
11793 TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { in sctp_add_stream_reset_out()
11796 stcb->asoc.strmout[i].state = SCTP_STREAM_RESET_IN_FLIGHT; in sctp_add_stream_reset_out()
11803 for (i = 0; i < stcb->asoc.streamoutcnt; i++) { in sctp_add_stream_reset_out()
11804 stcb->asoc.strmout[i].state = SCTP_STREAM_RESET_IN_FLIGHT; in sctp_add_stream_reset_out()
11923 sctp_send_deferred_reset_response(struct sctp_tcb *stcb, in sctp_send_deferred_reset_response() argument
11931 asoc = &stcb->asoc; in sctp_send_deferred_reset_response()
11942 sctp_alloc_a_chunk(stcb, chk); in sctp_send_deferred_reset_response()
11944 SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); in sctp_send_deferred_reset_response()
11951 chk->asoc = &stcb->asoc; in sctp_send_deferred_reset_response()
11957 sctp_free_a_chunk(stcb, chk, SCTP_SO_LOCKED); in sctp_send_deferred_reset_response()
11958 SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); in sctp_send_deferred_reset_response()
11965 if (stcb->asoc.alternate) { in sctp_send_deferred_reset_response()
11966 chk->whoTo = stcb->asoc.alternate; in sctp_send_deferred_reset_response()
11968 chk->whoTo = stcb->asoc.primary_destination; in sctp_send_deferred_reset_response()
12082 sctp_send_stream_reset_out_if_possible(struct sctp_tcb *stcb, int so_locked) in sctp_send_stream_reset_out_if_possible() argument
12089 asoc = &stcb->asoc; in sctp_send_stream_reset_out_if_possible()
12094 sctp_alloc_a_chunk(stcb, chk); in sctp_send_stream_reset_out_if_possible()
12096 SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); in sctp_send_stream_reset_out_if_possible()
12103 chk->asoc = &stcb->asoc; in sctp_send_stream_reset_out_if_possible()
12109 sctp_free_a_chunk(stcb, chk, so_locked); in sctp_send_stream_reset_out_if_possible()
12110 SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); in sctp_send_stream_reset_out_if_possible()
12118 if (stcb->asoc.alternate) { in sctp_send_stream_reset_out_if_possible()
12119 chk->whoTo = stcb->asoc.alternate; in sctp_send_stream_reset_out_if_possible()
12121 chk->whoTo = stcb->asoc.primary_destination; in sctp_send_stream_reset_out_if_possible()
12129 seq = stcb->asoc.str_reset_seq_out; in sctp_send_stream_reset_out_if_possible()
12130 …if (sctp_add_stream_reset_out(stcb, chk, seq, (stcb->asoc.str_reset_seq_in - 1), (stcb->asoc.sendi… in sctp_send_stream_reset_out_if_possible()
12136 sctp_free_a_chunk(stcb, chk, so_locked); in sctp_send_stream_reset_out_if_possible()
12146 if (stcb->asoc.send_sack) { in sctp_send_stream_reset_out_if_possible()
12147 sctp_send_sack(stcb, so_locked); in sctp_send_stream_reset_out_if_possible()
12149 sctp_timer_start(SCTP_TIMER_TYPE_STRRESET, stcb->sctp_ep, stcb, chk->whoTo); in sctp_send_stream_reset_out_if_possible()
12154 sctp_send_str_reset_req(struct sctp_tcb *stcb, in sctp_send_str_reset_req() argument
12168 SCTP_TCB_LOCK_ASSERT(stcb); in sctp_send_str_reset_req()
12170 asoc = &stcb->asoc; in sctp_send_str_reset_req()
12175 SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, EBUSY); in sctp_send_str_reset_req()
12181 SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, EINVAL); in sctp_send_str_reset_req()
12186 SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, EINVAL); in sctp_send_str_reset_req()
12196 SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); in sctp_send_str_reset_req()
12199 sctp_alloc_a_chunk(stcb, chk); in sctp_send_str_reset_req()
12201 SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); in sctp_send_str_reset_req()
12208 chk->asoc = &stcb->asoc; in sctp_send_str_reset_req()
12214 sctp_free_a_chunk(stcb, chk, SCTP_SO_LOCKED); in sctp_send_str_reset_req()
12215 SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); in sctp_send_str_reset_req()
12223 if (stcb->asoc.alternate) { in sctp_send_str_reset_req()
12224 chk->whoTo = stcb->asoc.alternate; in sctp_send_str_reset_req()
12226 chk->whoTo = stcb->asoc.primary_destination; in sctp_send_str_reset_req()
12235 seq = stcb->asoc.str_reset_seq_out; in sctp_send_str_reset_req()
12239 …ret = sctp_add_stream_reset_out(stcb, chk, seq, (stcb->asoc.str_reset_seq_in - 1), (stcb->asoc.sen… in sctp_send_str_reset_req()
12246 ((stcb->asoc.strm_realoutsize - stcb->asoc.streamoutcnt) < adding_o)) { in sctp_send_str_reset_req()
12255 oldstream = stcb->asoc.strmout; in sctp_send_str_reset_req()
12257 SCTP_MALLOC(stcb->asoc.strmout, struct sctp_stream_out *, in sctp_send_str_reset_req()
12258 (stcb->asoc.streamoutcnt + adding_o) * sizeof(struct sctp_stream_out), in sctp_send_str_reset_req()
12260 if (stcb->asoc.strmout == NULL) { in sctp_send_str_reset_req()
12263 stcb->asoc.strmout = oldstream; in sctp_send_str_reset_req()
12273 stcb->asoc.ss_functions.sctp_ss_clear(stcb, &stcb->asoc, false); in sctp_send_str_reset_req()
12274 for (i = 0; i < stcb->asoc.streamoutcnt; i++) { in sctp_send_str_reset_req()
12275 TAILQ_INIT(&stcb->asoc.strmout[i].outqueue); in sctp_send_str_reset_req()
12281 stcb->asoc.ss_functions.sctp_ss_init_stream(stcb, &stcb->asoc.strmout[i], &oldstream[i]); in sctp_send_str_reset_req()
12282 stcb->asoc.strmout[i].chunks_on_queues = oldstream[i].chunks_on_queues; in sctp_send_str_reset_req()
12285 stcb->asoc.strmout[i].abandoned_sent[j] = oldstream[i].abandoned_sent[j]; in sctp_send_str_reset_req()
12286 stcb->asoc.strmout[i].abandoned_unsent[j] = oldstream[i].abandoned_unsent[j]; in sctp_send_str_reset_req()
12289 stcb->asoc.strmout[i].abandoned_sent[0] = oldstream[i].abandoned_sent[0]; in sctp_send_str_reset_req()
12290 stcb->asoc.strmout[i].abandoned_unsent[0] = oldstream[i].abandoned_unsent[0]; in sctp_send_str_reset_req()
12292 stcb->asoc.strmout[i].next_mid_ordered = oldstream[i].next_mid_ordered; in sctp_send_str_reset_req()
12293 stcb->asoc.strmout[i].next_mid_unordered = oldstream[i].next_mid_unordered; in sctp_send_str_reset_req()
12294 stcb->asoc.strmout[i].last_msg_incomplete = oldstream[i].last_msg_incomplete; in sctp_send_str_reset_req()
12295 stcb->asoc.strmout[i].sid = i; in sctp_send_str_reset_req()
12296 stcb->asoc.strmout[i].state = oldstream[i].state; in sctp_send_str_reset_req()
12300 TAILQ_INSERT_TAIL(&stcb->asoc.strmout[i].outqueue, sp, next); in sctp_send_str_reset_req()
12304 stcb->asoc.ss_functions.sctp_ss_init(stcb, &stcb->asoc); in sctp_send_str_reset_req()
12305 for (i = stcb->asoc.streamoutcnt; i < (stcb->asoc.streamoutcnt + adding_o); i++) { in sctp_send_str_reset_req()
12306 TAILQ_INIT(&stcb->asoc.strmout[i].outqueue); in sctp_send_str_reset_req()
12307 stcb->asoc.strmout[i].chunks_on_queues = 0; in sctp_send_str_reset_req()
12310 stcb->asoc.strmout[i].abandoned_sent[j] = 0; in sctp_send_str_reset_req()
12311 stcb->asoc.strmout[i].abandoned_unsent[j] = 0; in sctp_send_str_reset_req()
12314 stcb->asoc.strmout[i].abandoned_sent[0] = 0; in sctp_send_str_reset_req()
12315 stcb->asoc.strmout[i].abandoned_unsent[0] = 0; in sctp_send_str_reset_req()
12317 stcb->asoc.strmout[i].next_mid_ordered = 0; in sctp_send_str_reset_req()
12318 stcb->asoc.strmout[i].next_mid_unordered = 0; in sctp_send_str_reset_req()
12319 stcb->asoc.strmout[i].sid = i; in sctp_send_str_reset_req()
12320 stcb->asoc.strmout[i].last_msg_incomplete = 0; in sctp_send_str_reset_req()
12321 stcb->asoc.ss_functions.sctp_ss_init_stream(stcb, &stcb->asoc.strmout[i], NULL); in sctp_send_str_reset_req()
12322 stcb->asoc.strmout[i].state = SCTP_STREAM_CLOSED; in sctp_send_str_reset_req()
12324 stcb->asoc.strm_realoutsize = stcb->asoc.streamoutcnt + adding_o; in sctp_send_str_reset_req()
12355 if (stcb->asoc.send_sack) { in sctp_send_str_reset_req()
12356 sctp_send_sack(stcb, SCTP_SO_LOCKED); in sctp_send_str_reset_req()
12358 sctp_timer_start(SCTP_TIMER_TYPE_STRRESET, stcb->sctp_ep, stcb, chk->whoTo); in sctp_send_str_reset_req()
12431 sctp_copy_it_in(struct sctp_tcb *stcb, in sctp_copy_it_in() argument
12452 sctp_alloc_a_strmoq(stcb, sp); in sctp_copy_it_in()
12454 SCTP_LTRACE_ERR_RET(NULL, stcb, net, SCTP_FROM_SCTP_OUTPUT, ENOMEM); in sctp_copy_it_in()
12479 resv_in_first = SCTP_DATA_CHUNK_OVERHEAD(stcb); in sctp_copy_it_in()
12487 sp->auth_keyid = stcb->asoc.authinfo.active_keyid; in sctp_copy_it_in()
12489 if (sctp_auth_is_required_chunk(SCTP_DATA, stcb->asoc.peer_auth_chunks)) { in sctp_copy_it_in()
12490 sctp_auth_key_acquire(stcb, sp->auth_keyid); in sctp_copy_it_in()
12496 sctp_free_a_strmoq(stcb, sp, SCTP_SO_LOCKED); in sctp_copy_it_in()
12575 struct sctp_tcb *stcb = NULL; in sctp_lower_sosend() local
12601 stcb = NULL; in sctp_lower_sosend()
12708 stcb = LIST_FIRST(&inp->sctp_asoc_list); in sctp_lower_sosend()
12709 if (stcb != NULL) { in sctp_lower_sosend()
12710 SCTP_TCB_LOCK(stcb); in sctp_lower_sosend()
12714 stcb = sctp_findasoc_ep_asocid_locked(inp, sinfo_assoc_id, 1); in sctp_lower_sosend()
12716 if (stcb != NULL) { in sctp_lower_sosend()
12717 SCTP_TCB_LOCK_ASSERT(stcb); in sctp_lower_sosend()
12727 stcb = sctp_findassociation_ep_addr(&t_inp, addr, &net, NULL, NULL); in sctp_lower_sosend()
12728 if (stcb == NULL) { in sctp_lower_sosend()
12733 SCTP_TCB_LOCK_ASSERT(stcb); in sctp_lower_sosend()
12740 if (stcb != NULL) { in sctp_lower_sosend()
12741 SCTP_TCB_LOCK_ASSERT(stcb); in sctp_lower_sosend()
12745 if ((stcb == NULL) && (addr != NULL)) { in sctp_lower_sosend()
12763 stcb = sctp_findassociation_ep_addr(&t_inp, addr, &net, NULL, NULL); in sctp_lower_sosend()
12765 if ((stcb == NULL) && (control != NULL) && (port > 0)) { in sctp_lower_sosend()
12766 stcb = sctp_findassociation_cmsgs(&t_inp, port, control, &net, &error); in sctp_lower_sosend()
12769 if (stcb == NULL) { in sctp_lower_sosend()
12774 SCTP_TCB_LOCK_ASSERT(stcb); in sctp_lower_sosend()
12786 if (stcb == NULL) { in sctp_lower_sosend()
12806 stcb = sctp_aloc_assoc_connected(inp, addr, &error, 0, 0, vrf_id, in sctp_lower_sosend()
12811 if (stcb == NULL) { in sctp_lower_sosend()
12816 SCTP_TCB_LOCK_ASSERT(stcb); in sctp_lower_sosend()
12824 SCTP_SET_STATE(stcb, SCTP_STATE_COOKIE_WAIT); in sctp_lower_sosend()
12825 (void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered); in sctp_lower_sosend()
12827 if (sctp_process_cmsgs_for_init(stcb, control, &error)) { in sctp_lower_sosend()
12828 sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, in sctp_lower_sosend()
12830 stcb = NULL; in sctp_lower_sosend()
12848 KASSERT(stcb != NULL, ("stcb is NULL")); in sctp_lower_sosend()
12849 SCTP_TCB_LOCK_ASSERT(stcb); in sctp_lower_sosend()
12851 asoc = &stcb->asoc; in sctp_lower_sosend()
12862 if ((SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) || in sctp_lower_sosend()
12863 (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED)) { in sctp_lower_sosend()
12888 if ((SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) || in sctp_lower_sosend()
12889 (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED)) { in sctp_lower_sosend()
12929 SCTP_TCB_UNLOCK(stcb); in sctp_lower_sosend()
12931 SCTP_TCB_LOCK(stcb); in sctp_lower_sosend()
12965 sctp_abort_an_association(stcb->sctp_ep, stcb, mm, false, SCTP_SO_LOCKED); in sctp_lower_sosend()
12967 stcb = NULL; in sctp_lower_sosend()
12979 KASSERT(stcb != NULL, ("stcb is NULL")); in sctp_lower_sosend()
12980 SCTP_TCB_LOCK_ASSERT(stcb); in sctp_lower_sosend()
12988 net = sctp_findnet(stcb, addr); in sctp_lower_sosend()
12993 ((port != 0) && (port != stcb->rport))) { in sctp_lower_sosend()
13038 atomic_add_int(&stcb->total_sends, 1); in sctp_lower_sosend()
13045 …tes = asoc->total_output_queue_size - (asoc->chunks_on_out_queue * SCTP_DATA_CHUNK_OVERHEAD(stcb)); in sctp_lower_sosend()
13065 KASSERT(stcb != NULL, ("stcb is NULL")); in sctp_lower_sosend()
13066 SCTP_TCB_LOCK_ASSERT(stcb); in sctp_lower_sosend()
13077 …tes = asoc->total_output_queue_size - (asoc->chunks_on_out_queue * SCTP_DATA_CHUNK_OVERHEAD(stcb)); in sctp_lower_sosend()
13085 (sndlen > (ssize_t)SCTP_SB_LIMIT_SND(stcb->sctp_socket))) { in sctp_lower_sosend()
13106 …tes = asoc->total_output_queue_size - (asoc->chunks_on_out_queue * SCTP_DATA_CHUNK_OVERHEAD(stcb)); in sctp_lower_sosend()
13121 stcb->block_entry = &be; in sctp_lower_sosend()
13122 SCTP_TCB_UNLOCK(stcb); in sctp_lower_sosend()
13133 SCTP_TCB_LOCK(stcb); in sctp_lower_sosend()
13134 stcb->block_entry = NULL; in sctp_lower_sosend()
13155 …tes = asoc->total_output_queue_size - (asoc->chunks_on_out_queue * SCTP_DATA_CHUNK_OVERHEAD(stcb)); in sctp_lower_sosend()
13167 KASSERT(stcb != NULL, ("stcb is NULL")); in sctp_lower_sosend()
13168 SCTP_TCB_LOCK_ASSERT(stcb); in sctp_lower_sosend()
13191 SCTP_TCB_UNLOCK(stcb); in sctp_lower_sosend()
13192 sp = sctp_copy_it_in(stcb, asoc, sndrcvninfo, uio, net, max_len, user_marks_eor, &error); in sctp_lower_sosend()
13193 SCTP_TCB_LOCK(stcb); in sctp_lower_sosend()
13214 if ((SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_SENT) || in sctp_lower_sosend()
13215 (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_RECEIVED) || in sctp_lower_sosend()
13216 (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_ACK_SENT) || in sctp_lower_sosend()
13228 sctp_free_a_strmoq(stcb, sp, SCTP_SO_LOCKED); in sctp_lower_sosend()
13249 sctp_snd_sb_alloc(stcb, sp->length); in sctp_lower_sosend()
13256 asoc->ss_functions.sctp_ss_add_to_stream(stcb, asoc, strm, sp); in sctp_lower_sosend()
13277 KASSERT(stcb != NULL, ("stcb is NULL")); in sctp_lower_sosend()
13278 SCTP_TCB_LOCK_ASSERT(stcb); in sctp_lower_sosend()
13288 …tes = asoc->total_output_queue_size - (asoc->chunks_on_out_queue * SCTP_DATA_CHUNK_OVERHEAD(stcb)); in sctp_lower_sosend()
13297 SCTP_TCB_UNLOCK(stcb); in sctp_lower_sosend()
13301 SCTP_TCB_LOCK(stcb); in sctp_lower_sosend()
13339 sctp_snd_sb_alloc(stcb, sndout); in sctp_lower_sosend()
13356 KASSERT(stcb != NULL, ("stcb is NULL")); in sctp_lower_sosend()
13357 SCTP_TCB_LOCK_ASSERT(stcb); in sctp_lower_sosend()
13373 sctp_prune_prsctp(stcb, asoc, sndrcvninfo, (int)sndlen); in sctp_lower_sosend()
13374 …tes = asoc->total_output_queue_size - (asoc->chunks_on_out_queue * SCTP_DATA_CHUNK_OVERHEAD(stcb)); in sctp_lower_sosend()
13393 if (SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) { in sctp_lower_sosend()
13398 sctp_send_initiate(inp, stcb, SCTP_SO_LOCKED); in sctp_lower_sosend()
13400 SCTP_SET_STATE(stcb, SCTP_STATE_COOKIE_WAIT); in sctp_lower_sosend()
13426 sctp_log_nagle_event(stcb, SCTP_NAGLE_APPLIED); in sctp_lower_sosend()
13433 sctp_log_nagle_event(stcb, SCTP_NAGLE_SKIPPED); in sctp_lower_sosend()
13457 sctp_chunk_output(inp, stcb, in sctp_lower_sosend()
13475 …tes = asoc->total_output_queue_size - (asoc->chunks_on_out_queue * SCTP_DATA_CHUNK_OVERHEAD(stcb)); in sctp_lower_sosend()
13484 stcb->block_entry = &be; in sctp_lower_sosend()
13485 SCTP_TCB_UNLOCK(stcb); in sctp_lower_sosend()
13495 SCTP_TCB_LOCK(stcb); in sctp_lower_sosend()
13496 stcb->block_entry = NULL; in sctp_lower_sosend()
13526 KASSERT(stcb != NULL, ("stcb is NULL")); in sctp_lower_sosend()
13527 SCTP_TCB_LOCK_ASSERT(stcb); in sctp_lower_sosend()
13557 error = sctp_msg_append(stcb, net, top, sndrcvninfo); in sctp_lower_sosend()
13568 KASSERT(stcb != NULL, ("stcb is NULL")); in sctp_lower_sosend()
13569 SCTP_TCB_LOCK_ASSERT(stcb); in sctp_lower_sosend()
13581 sctp_is_there_unsent_data(stcb, SCTP_SO_LOCKED) == 0) { in sctp_lower_sosend()
13582 if ((*asoc->ss_functions.sctp_ss_is_user_msgs_incomplete) (stcb, asoc)) { in sctp_lower_sosend()
13586 if ((SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_SENT) && in sctp_lower_sosend()
13587 (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_RECEIVED) && in sctp_lower_sosend()
13588 (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { in sctp_lower_sosend()
13592 if (SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) { in sctp_lower_sosend()
13595 SCTP_SET_STATE(stcb, SCTP_STATE_SHUTDOWN_SENT); in sctp_lower_sosend()
13596 sctp_stop_timers_for_shutdown(stcb); in sctp_lower_sosend()
13602 sctp_send_shutdown(stcb, netp); in sctp_lower_sosend()
13603 sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, stcb->sctp_ep, stcb, in sctp_lower_sosend()
13605 sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, stcb->sctp_ep, stcb, in sctp_lower_sosend()
13619 if ((SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_SENT) && in sctp_lower_sosend()
13620 (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_RECEIVED) && in sctp_lower_sosend()
13621 (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { in sctp_lower_sosend()
13622 if ((*asoc->ss_functions.sctp_ss_is_user_msgs_incomplete) (stcb, asoc)) { in sctp_lower_sosend()
13623 SCTP_ADD_SUBSTATE(stcb, SCTP_STATE_PARTIAL_MSG_LEFT); in sctp_lower_sosend()
13625 SCTP_ADD_SUBSTATE(stcb, SCTP_STATE_SHUTDOWN_PENDING); in sctp_lower_sosend()
13642 sctp_abort_an_association(stcb->sctp_ep, stcb, in sctp_lower_sosend()
13645 stcb = NULL; in sctp_lower_sosend()
13655 KASSERT(stcb != NULL, ("stcb is NULL")); in sctp_lower_sosend()
13656 SCTP_TCB_LOCK_ASSERT(stcb); in sctp_lower_sosend()
13664 if (SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) { in sctp_lower_sosend()
13669 sctp_send_initiate(inp, stcb, SCTP_SO_LOCKED); in sctp_lower_sosend()
13671 SCTP_SET_STATE(stcb, SCTP_STATE_COOKIE_WAIT); in sctp_lower_sosend()
13676 KASSERT(stcb != NULL, ("stcb is NULL")); in sctp_lower_sosend()
13677 SCTP_TCB_LOCK_ASSERT(stcb); in sctp_lower_sosend()
13705 sctp_log_nagle_event(stcb, SCTP_NAGLE_APPLIED); in sctp_lower_sosend()
13712 sctp_log_nagle_event(stcb, SCTP_NAGLE_SKIPPED); in sctp_lower_sosend()
13725 KASSERT(stcb != NULL, ("stcb is NULL")); in sctp_lower_sosend()
13726 SCTP_TCB_LOCK_ASSERT(stcb); in sctp_lower_sosend()
13734 sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_USR_SEND, SCTP_SO_LOCKED); in sctp_lower_sosend()
13739 sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_USR_SEND, SCTP_SO_LOCKED); in sctp_lower_sosend()
13744 (void)sctp_med_chunk_output(inp, stcb, asoc, &num_out, in sctp_lower_sosend()
13746 sctp_get_frag_point(stcb), in sctp_lower_sosend()
13755 KASSERT(stcb != NULL, ("stcb is NULL")); in sctp_lower_sosend()
13756 SCTP_TCB_LOCK_ASSERT(stcb); in sctp_lower_sosend()
13767 if (stcb != NULL) { in sctp_lower_sosend()
13774 SCTP_TCB_UNLOCK(stcb); in sctp_lower_sosend()
13782 SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, error); in sctp_lower_sosend()
13792 struct sctp_tcb *stcb, uint8_t chunk) in sctp_add_auth_chunk() argument
13800 (stcb == NULL)) in sctp_add_auth_chunk()
13803 if (stcb->asoc.auth_supported == 0) { in sctp_add_auth_chunk()
13807 if (!sctp_auth_is_required_chunk(chunk, stcb->asoc.peer_auth_chunks)) { in sctp_add_auth_chunk()
13824 sctp_get_hmac_digest_len(stcb->asoc.peer_hmac_id); in sctp_add_auth_chunk()
13826 auth->hmac_id = htons(stcb->asoc.peer_hmac_id); in sctp_add_auth_chunk()