FreeBSD kernel IPv4 code
sctputil.c File Reference
#include <sys/cdefs.h>
#include <netinet/sctp_os.h>
#include <netinet/sctp_pcb.h>
#include <netinet/sctputil.h>
#include <netinet/sctp_var.h>
#include <netinet/sctp_sysctl.h>
#include <netinet/sctp_header.h>
#include <netinet/sctp_output.h>
#include <netinet/sctp_uio.h>
#include <netinet/sctp_timer.h>
#include <netinet/sctp_indata.h>
#include <netinet/sctp_auth.h>
#include <netinet/sctp_asconf.h>
#include <netinet/sctp_bsd_addr.h>
#include <netinet/sctp_kdtrace.h>
#include <netinet/udp.h>
#include <netinet/udp_var.h>
#include <sys/proc.h>
Include dependency graph for sctputil.c:

Go to the source code of this file.

Macros

#define KTR_SCTP   KTR_SUBSYS
 

Functions

 __FBSDID ("$FreeBSD$")
 
void sctp_sblog (struct sockbuf *sb, struct sctp_tcb *stcb, int from, int incr)
 
void sctp_log_closing (struct sctp_inpcb *inp, struct sctp_tcb *stcb, int16_t loc)
 
void rto_logging (struct sctp_nets *net, int from)
 
void sctp_log_strm_del_alt (struct sctp_tcb *stcb, uint32_t tsn, uint16_t sseq, uint16_t stream, int from)
 
void sctp_log_nagle_event (struct sctp_tcb *stcb, int action)
 
void sctp_log_sack (uint32_t old_cumack, uint32_t cumack, uint32_t tsn, uint16_t gaps, uint16_t dups, int from)
 
void sctp_log_map (uint32_t map, uint32_t cum, uint32_t high, int from)
 
void sctp_log_fr (uint32_t biggest_tsn, uint32_t biggest_new_tsn, uint32_t tsn, int from)
 
void sctp_log_strm_del (struct sctp_queued_to_read *control, struct sctp_queued_to_read *poschk, int from)
 
void sctp_log_cwnd (struct sctp_tcb *stcb, struct sctp_nets *net, int augment, uint8_t from)
 
void sctp_log_lock (struct sctp_inpcb *inp, struct sctp_tcb *stcb, uint8_t from)
 
void sctp_log_maxburst (struct sctp_tcb *stcb, struct sctp_nets *net, int error, int burst, uint8_t from)
 
void sctp_log_rwnd (uint8_t from, uint32_t peers_rwnd, uint32_t snd_size, uint32_t overhead)
 
void sctp_log_rwnd_set (uint8_t from, uint32_t peers_rwnd, uint32_t flight_size, uint32_t overhead, uint32_t a_rwndval)
 
void sctp_misc_ints (uint8_t from, uint32_t a, uint32_t b, uint32_t c, uint32_t d)
 
void sctp_wakeup_log (struct sctp_tcb *stcb, uint32_t wake_cnt, int from)
 
void sctp_log_block (uint8_t from, struct sctp_association *asoc, ssize_t sendlen)
 
int sctp_fill_stat_log (void *optval SCTP_UNUSED, size_t *optsize SCTP_UNUSED)
 
uint32_t sctp_msecs_to_ticks (uint32_t msecs)
 
uint32_t sctp_ticks_to_msecs (uint32_t ticks)
 
uint32_t sctp_secs_to_ticks (uint32_t secs)
 
uint32_t sctp_ticks_to_secs (uint32_t ticks)
 
void sctp_stop_timers_for_shutdown (struct sctp_tcb *stcb)
 
void sctp_stop_association_timers (struct sctp_tcb *stcb, bool stop_assoc_kill_timer)
 
uint32_t sctp_get_prev_mtu (uint32_t val)
 
uint32_t sctp_get_next_mtu (uint32_t val)
 
void sctp_fill_random_store (struct sctp_pcb *m)
 
uint32_t sctp_select_initial_TSN (struct sctp_pcb *inp)
 
uint32_t sctp_select_a_tag (struct sctp_inpcb *inp, uint16_t lport, uint16_t rport, int check)
 
int32_t sctp_map_assoc_state (int kernel_state)
 
int sctp_init_asoc (struct sctp_inpcb *inp, struct sctp_tcb *stcb, uint32_t override_tag, uint32_t initial_tsn, uint32_t vrf_id, uint16_t o_strms)
 
void sctp_print_mapping_array (struct sctp_association *asoc)
 
int sctp_expand_mapping_array (struct sctp_association *asoc, uint32_t needed)
 
static void sctp_iterator_work (struct sctp_iterator *it)
 
void sctp_iterator_worker (void)
 
static void sctp_handle_addr_wq (void)
 
void sctp_timeout_handler (void *t)
 
void sctp_timer_start (int t_type, struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net)
 
void sctp_timer_stop (int t_type, struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net, uint32_t from)
 
uint32_t sctp_calculate_len (struct mbuf *m)
 
int sctp_calculate_rto (struct sctp_tcb *stcb, struct sctp_association *asoc, struct sctp_nets *net, struct timeval *old, int rtt_from_sack)
 
caddr_t sctp_m_getptr (struct mbuf *m, int off, int len, uint8_t *in_ptr)
 
struct sctp_paramhdrsctp_get_next_param (struct mbuf *m, int offset, struct sctp_paramhdr *pull, int pull_limit)
 
struct mbuf * sctp_add_pad_tombuf (struct mbuf *m, int padlen)
 
struct mbuf * sctp_pad_lastmbuf (struct mbuf *m, int padval, struct mbuf *last_mbuf)
 
static void sctp_notify_assoc_change (uint16_t state, struct sctp_tcb *stcb, uint16_t error, struct sctp_abort_chunk *abort, bool from_peer, bool timedout, int so_locked)
 
static void sctp_notify_peer_addr_change (struct sctp_tcb *stcb, uint32_t state, struct sockaddr *sa, uint32_t error, int so_locked)
 
static void sctp_notify_send_failed (struct sctp_tcb *stcb, uint8_t sent, uint32_t error, struct sctp_tmit_chunk *chk, int so_locked)
 
static void sctp_notify_send_failed2 (struct sctp_tcb *stcb, uint32_t error, struct sctp_stream_queue_pending *sp, int so_locked)
 
static void sctp_notify_adaptation_layer (struct sctp_tcb *stcb)
 
static void sctp_notify_partial_delivery_indication (struct sctp_tcb *stcb, uint32_t error, uint32_t val, int so_locked)
 
static void sctp_notify_shutdown_event (struct sctp_tcb *stcb)
 
static void sctp_notify_sender_dry_event (struct sctp_tcb *stcb, int so_locked)
 
void sctp_notify_stream_reset_add (struct sctp_tcb *stcb, uint16_t numberin, uint16_t numberout, int flag)
 
void sctp_notify_stream_reset_tsn (struct sctp_tcb *stcb, uint32_t sending_tsn, uint32_t recv_tsn, int flag)
 
static void sctp_notify_stream_reset (struct sctp_tcb *stcb, int number_entries, uint16_t *list, int flag)
 
static void sctp_notify_remote_error (struct sctp_tcb *stcb, uint16_t error, struct sctp_error_chunk *chunk)
 
void sctp_ulp_notify (uint32_t notification, struct sctp_tcb *stcb, uint32_t error, void *data, int so_locked)
 
void sctp_report_all_outbound (struct sctp_tcb *stcb, uint16_t error, int so_locked)
 
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_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)
 
void sctp_abort_an_association (struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct mbuf *op_err, bool timedout, int so_locked)
 
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)
 
int sctp_is_there_an_abort_here (struct mbuf *m, int iphlen, uint32_t *vtag)
 
int sctp_cmpaddr (struct sockaddr *sa1, struct sockaddr *sa2)
 
void sctp_print_address (struct sockaddr *sa)
 
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_wakeup_the_read_socket (struct sctp_inpcb *inp, struct sctp_tcb *stcb, int so_locked SCTP_UNUSED)
 
void sctp_add_to_readq (struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_queued_to_read *control, struct sockbuf *sb, int end, int inp_read_lock_held, int so_locked)
 
struct mbuf * sctp_generate_cause (uint16_t code, char *info)
 
struct mbuf * sctp_generate_no_user_data_cause (uint32_t tsn)
 
int sctp_release_pr_sctp_chunk (struct sctp_tcb *stcb, struct sctp_tmit_chunk *tp1, uint8_t sent, int so_locked)
 
struct sctp_ifasctp_find_ifa_in_ep (struct sctp_inpcb *inp, struct sockaddr *addr, int holds_lock)
 
uint32_t sctp_get_ifa_hash_val (struct sockaddr *addr)
 
struct sctp_ifasctp_find_ifa_by_addr (struct sockaddr *addr, uint32_t vrf_id, int holds_lock)
 
static void sctp_user_rcvd (struct sctp_tcb *stcb, uint32_t *freed_so_far, int hold_rlock, uint32_t rwnd_req)
 
int sctp_sorecvmsg (struct socket *so, struct uio *uio, struct mbuf **mp, struct sockaddr *from, int fromlen, int *msg_flags, struct sctp_sndrcvinfo *sinfo, int filling_sinfo)
 
int sctp_dynamic_set_primary (struct sockaddr *sa, uint32_t vrf_id)
 
int sctp_soreceive (struct socket *so, struct sockaddr **psa, struct uio *uio, struct mbuf **mp0, struct mbuf **controlp, int *flagsp)
 
int sctp_connectx_helper_add (struct sctp_tcb *stcb, struct sockaddr *addr, int totaddr, int *error)
 
int sctp_connectx_helper_find (struct sctp_inpcb *inp, struct sockaddr *addr, unsigned int totaddr, unsigned int *num_v4, unsigned int *num_v6, unsigned int limit)
 
void sctp_bindx_add_address (struct socket *so, struct sctp_inpcb *inp, struct sockaddr *sa, uint32_t vrf_id, int *error, void *p)
 
void sctp_bindx_delete_address (struct sctp_inpcb *inp, struct sockaddr *sa, uint32_t vrf_id, int *error)
 
int sctp_local_addr_count (struct sctp_tcb *stcb)
 
static void sctp_recv_udp_tunneled_packet (struct mbuf *m, int off, struct inpcb *inp, const struct sockaddr *sa SCTP_UNUSED, void *ctx SCTP_UNUSED)
 
void sctp_over_udp_stop (void)
 
int sctp_over_udp_start (void)
 
uint32_t sctp_min_mtu (uint32_t mtu1, uint32_t mtu2, uint32_t mtu3)
 
void sctp_hc_set_mtu (union sctp_sockstore *addr, uint16_t fibnum, uint32_t mtu)
 
uint32_t sctp_hc_get_mtu (union sctp_sockstore *addr, uint16_t fibnum)
 
void sctp_set_state (struct sctp_tcb *stcb, int new_state)
 
void sctp_add_substate (struct sctp_tcb *stcb, int substate)
 

Variables

const struct sctp_cc_functions sctp_cc_functions []
 
const struct sctp_ss_functions sctp_ss_functions []
 
static uint32_t sctp_mtu_sizes []
 

Macro Definition Documentation

◆ KTR_SCTP

#define KTR_SCTP   KTR_SUBSYS

Definition at line 66 of file sctputil.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ rto_logging()

void rto_logging ( struct sctp_nets net,
int  from 
)

◆ sctp_abort_an_association()

◆ sctp_abort_association()

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 
)

◆ sctp_abort_notification()

◆ sctp_add_pad_tombuf()

struct mbuf * sctp_add_pad_tombuf ( struct mbuf *  m,
int  padlen 
)

Definition at line 3084 of file sctputil.c.

References SCTP_BUF_LEN, SCTP_BUF_NEXT, and sctp_get_mbuf_for_msg().

Referenced by sctp_arethere_unrecognized_parameters(), sctp_pad_lastmbuf(), sctp_queue_op_err(), sctp_send_abort_tcb(), sctp_send_initiate(), sctp_send_initiate_ack(), and sctp_send_resp_msg().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sctp_add_substate()

void sctp_add_substate ( struct sctp_tcb stcb,
int  substate 
)

◆ sctp_add_to_readq()

void sctp_add_to_readq ( struct sctp_inpcb inp,
struct sctp_tcb stcb,
struct sctp_queued_to_read control,
struct sockbuf *  sb,
int  end,
int  inp_read_lock_held,
int  so_locked 
)

◆ sctp_bindx_add_address()

void sctp_bindx_add_address ( struct socket *  so,
struct sctp_inpcb inp,
struct sockaddr *  sa,
uint32_t  vrf_id,
int *  error,
void *  p 
)

◆ sctp_bindx_delete_address()

void sctp_bindx_delete_address ( struct sctp_inpcb inp,
struct sockaddr *  sa,
uint32_t  vrf_id,
int *  error 
)

Definition at line 6849 of file sctputil.c.

References sctp_addr_mgmt_ep_sa(), SCTP_DEL_IP_ADDRESS, sctp_inpcb::sctp_flags, SCTP_FROM_SCTPUTIL, SCTP_IPV6_V6ONLY, SCTP_LTRACE_ERR_RET, SCTP_PCB_FLAGS_BOUND_V6, and SCTP_PCB_FLAGS_BOUNDALL.

Referenced by sctp_setopt().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sctp_calculate_len()

uint32_t sctp_calculate_len ( struct mbuf *  m)

Definition at line 2896 of file sctputil.c.

References SCTP_BUF_LEN, and SCTP_BUF_NEXT.

Referenced by sctp_lowlevel_chunk_output().

Here is the caller graph for this function:

◆ sctp_calculate_rto()

◆ sctp_cmpaddr()

int sctp_cmpaddr ( struct sockaddr *  sa1,
struct sockaddr *  sa2 
)

Definition at line 4676 of file sctputil.c.

References in_addr::s_addr, and sockaddr_in::sin_addr.

Referenced by sctp_check_address_list_all(), sctp_check_address_list_ep(), sctp_del_remote_addr(), sctp_findnet(), and sctp_process_asconf_delete_ip().

Here is the caller graph for this function:

◆ sctp_connectx_helper_add()

int sctp_connectx_helper_add ( struct sctp_tcb stcb,
struct sockaddr *  addr,
int  totaddr,
int *  error 
)

◆ sctp_connectx_helper_find()

int sctp_connectx_helper_find ( struct sctp_inpcb inp,
struct sockaddr *  addr,
unsigned int  totaddr,
unsigned int *  num_v4,
unsigned int *  num_v6,
unsigned int  limit 
)

Definition at line 6660 of file sctputil.c.

References sctp_findassociation_ep_addr(), SCTP_INP_DECR_REF, SCTP_INP_INCR_REF, and SCTP_TCB_UNLOCK.

Referenced by sctp_do_connect_x().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sctp_dynamic_set_primary()

int sctp_dynamic_set_primary ( struct sockaddr *  sa,
uint32_t  vrf_id 
)

◆ sctp_expand_mapping_array()

int sctp_expand_mapping_array ( struct sctp_association asoc,
uint32_t  needed 
)

◆ sctp_fill_random_store()

void sctp_fill_random_store ( struct sctp_pcb m)

Definition at line 992 of file sctputil.c.

References sctp_pcb::random_counter, sctp_pcb::random_numbers, sctp_pcb::random_store, sctp_hmac(), SCTP_HMAC, and sctp_pcb::store_at.

Referenced by sctp_inpcb_alloc(), and sctp_select_initial_TSN().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sctp_fill_stat_log()

int sctp_fill_stat_log ( void *optval  SCTP_UNUSED,
size_t *optsize  SCTP_UNUSED 
)

Definition at line 571 of file sctputil.c.

Referenced by sctp_getopt().

Here is the caller graph for this function:

◆ sctp_find_ifa_by_addr()

◆ sctp_find_ifa_in_ep()

struct sctp_ifa * sctp_find_ifa_in_ep ( struct sctp_inpcb inp,
struct sockaddr *  addr,
int  holds_lock 
)

◆ sctp_generate_cause()

◆ sctp_generate_no_user_data_cause()

struct mbuf * sctp_generate_no_user_data_cause ( uint32_t  tsn)

Definition at line 4978 of file sctputil.c.

References sctp_error_no_user_data::cause, sctp_error_cause::code, sctp_error_cause::length, SCTP_BUF_LEN, SCTP_CAUSE_NO_USER_DATA, sctp_get_mbuf_for_msg(), and sctp_error_no_user_data::tsn.

Referenced by sctp_process_a_data_chunk().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sctp_get_ifa_hash_val()

uint32_t sctp_get_ifa_hash_val ( struct sockaddr *  addr)

Definition at line 5295 of file sctputil.c.

References in_addr::s_addr, and sockaddr_in::sin_addr.

Referenced by sctp_add_addr_to_vrf(), and sctp_find_ifa_by_addr().

Here is the caller graph for this function:

◆ sctp_get_next_mtu()

uint32_t sctp_get_next_mtu ( uint32_t  val)

Definition at line 975 of file sctputil.c.

References sctp_mtu_sizes.

Referenced by sctp_pathmtu_timer().

Here is the caller graph for this function:

◆ sctp_get_next_param()

struct sctp_paramhdr * sctp_get_next_param ( struct mbuf *  m,
int  offset,
struct sctp_paramhdr pull,
int  pull_limit 
)

◆ sctp_get_prev_mtu()

uint32_t sctp_get_prev_mtu ( uint32_t  val)

Definition at line 950 of file sctputil.c.

References sctp_mtu_sizes.

◆ sctp_handle_addr_wq()

◆ sctp_handle_ootb()

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 
)

◆ sctp_hc_get_mtu()

uint32_t sctp_hc_get_mtu ( union sctp_sockstore addr,
uint16_t  fibnum 
)

Definition at line 7599 of file sctputil.c.

References in_conninfo::inc_fibnum, in_conninfo::inc_flags, INC_ISIPV6, sctp_sockstore::sa, sctp_sockstore::sin, sctp_sockstore::sin6, sockaddr_in::sin_addr, and tcp_hc_getmtu().

Referenced by sctp_add_remote_addr().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sctp_hc_set_mtu()

void sctp_hc_set_mtu ( union sctp_sockstore addr,
uint16_t  fibnum,
uint32_t  mtu 
)

◆ sctp_init_asoc()

int sctp_init_asoc ( struct sctp_inpcb inp,
struct sctp_tcb stcb,
uint32_t  override_tag,
uint32_t  initial_tsn,
uint32_t  vrf_id,
uint16_t  o_strms 
)

Definition at line 1114 of file sctputil.c.

References sctp_stream_out::abandoned_sent, sctp_association::abandoned_sent, sctp_stream_out::abandoned_unsent, sctp_association::abandoned_unsent, sctp_authinformation::active_keyid, sctp_association::advanced_peer_ack_point, sctp_association::asconf_ack_sent, sctp_association::asconf_queue, sctp_association::asconf_send_queue, sctp_association::asconf_seq_in, sctp_association::asconf_seq_out, sctp_association::asconf_seq_out_acked, sctp_inpcb::asconf_supported, sctp_association::asconf_supported, sctp_tcb::asoc, sctp_authinformation::assoc_key, sctp_authinformation::assoc_keyid, sctp_association::assoc_up_sent, sctp_inpcb::auth_supported, sctp_association::auth_supported, sctp_association::authinfo, sctp_pcb::auto_close_time, sctp_association::cc_functions, sctp_stream_out::chunks_on_queues, sctp_association::congestion_control_module, sctp_association::context, sctp_association::control_send_queue, sctp_association::cookie_life, sctp_pcb::def_cookie_life, sctp_pcb::def_net_failure, sctp_association::def_net_failure, sctp_pcb::def_net_pf_threshold, sctp_association::def_net_pf_threshold, sctp_inpcb::def_send, sctp_association::def_send, sctp_pcb::default_dscp, sctp_association::default_dscp, sctp_pcb::default_mtu, sctp_association::default_mtu, sctp_association::delayed_ack, sctp_association::discontinuity_time, sctp_association::ecn_echo_cnt_onq, sctp_inpcb::ecn_supported, sctp_association::ecn_supported, sctp_pcb::fr_max_burst, sctp_association::fr_max_burst, sctp_association::free_chunk_cnt, sctp_association::free_chunks, sctp_association::hb_random_idx, sctp_association::heart_beat_delay, sctp_association::iam_blocking, sctp_inpcb::idata_supported, sctp_association::idata_supported, IN6P_AUTOFLOWLABEL, sctp_association::init_seq_number, sctp_pcb::initial_init_rto_max, sctp_association::initial_init_rto_max, sctp_pcb::initial_rto, sctp_association::initial_rto, sctp_inpcb::inp, inpcb::inp_flags, sctp_inpcb::ip_inp, sctp_scoping::ipv4_addr_legal, sctp_scoping::ipv6_addr_legal, sctp_association::last_acked_seq, sctp_stream_out::last_msg_incomplete, sctp_association::last_net_cmt_send_started, sctp_inpcb::local_strreset_support, sctp_association::local_strreset_support, sctp_association::mapping_array, sctp_association::mapping_array_size, sctp_association::marked_retrans, sctp_pcb::max_burst, sctp_association::max_burst, sctp_inpcb::max_cwnd, sctp_association::max_cwnd, sctp_association::max_inbound_streams, sctp_pcb::max_init_times, sctp_association::max_init_times, sctp_pcb::max_open_streams_intome, sctp_pcb::max_send_times, sctp_association::max_send_times, sctp_association::maxrto, sctp_association::minrto, sctp_association::my_rwnd, sctp_association::my_vtag, sctp_association::my_vtag_nonce, sctp_association::nets, sctp_stream_out::next_mid_ordered, sctp_stream_out::next_mid_unordered, sctp_association::nr_mapping_array, sctp_inpcb::nrsack_supported, sctp_association::nrsack_supported, sctp_stream_out::outqueue, sctp_association::peer_supports_nat, sctp_association::peer_vtag_nonce, sctp_association::peers_rwnd, sctp_association::pending_reply_queue, sctp_inpcb::pktdrop_supported, sctp_association::pktdrop_supported, sctp_pcb::port, sctp_association::port, sctp_association::pr_sctp_cnt, sctp_association::pre_open_streams, sctp_inpcb::prsctp_supported, sctp_association::prsctp_supported, sctp_authinformation::random, sctp_inpcb::reconfig_supported, sctp_association::reconfig_supported, sctp_authinformation::recv_key, sctp_authinformation::recv_keyid, sctp_association::refcnt, sctp_association::resetHead, sctp_tcb::rport, sctp_association::sack_freq, sctp_association::sb_send_resv, sctp_association::scope, sctp_association::sctp_autoclose_ticks, sctp_inpcb::sctp_cmt_on_off, sctp_association::sctp_cmt_on_off, sctp_association::sctp_cmt_pf, sctp_inpcb::sctp_context, sctp_pcb::sctp_default_cc_module, sctp_pcb::sctp_default_ss_module, sctp_inpcb::sctp_ep, sctp_tcb::sctp_ep, sctp_inpcb::sctp_features, sctp_association::sctp_features, sctp_inpcb::sctp_flags, sctp_inpcb::sctp_frag_point, sctp_association::sctp_frag_point, SCTP_FREE, SCTP_FROM_SCTPUTIL, SCTP_GETTIME_TIMEVAL, SCTP_INITIAL_MAPPING_ARRAY, SCTP_IPV6_V6ONLY, SCTP_LTRACE_ERR_RET, SCTP_MALLOC, sctp_pcb::sctp_maxrto, SCTP_MINIMAL_RWND, sctp_pcb::sctp_minrto, SCTP_PCB_FLAGS_BOUND_V6, SCTP_PR_SCTP_MAX, sctp_association::sctp_restricted_addrs, sctp_pcb::sctp_sack_freq, SCTP_SB_LIMIT_RCV, sctp_select_a_tag(), sctp_select_initial_TSN(), SCTP_SET_STATE, sctp_inpcb::sctp_socket, sctp_ss_functions::sctp_ss_init, sctp_ss_functions::sctp_ss_init_stream, SCTP_STATE_INUSE, SCTP_STREAM_OPENING, SCTP_TCB_SEND_LOCK, SCTP_TCB_SEND_UNLOCK, sctp_ticks_to_msecs(), sctp_pcb::sctp_timeoutticks, SCTP_TIMER_HEARTBEAT, SCTP_TIMER_RECV, sctp_association::send_queue, sctp_association::send_sack, sctp_association::sending_seq, sctp_association::sent_queue, sctp_association::sent_queue_retran_cnt, sctp_association::shared_keys, sctp_stream_out::sid, sctp_association::smallest_mtu, sctp_association::ss_functions, sctp_association::start_time, sctp_stream_out::state, sctp_association::str_reset_seq_in, sctp_association::str_reset_seq_out, sctp_association::stream_locked, sctp_association::stream_locked_on, sctp_association::stream_scheduling_module, sctp_association::streamoutcnt, sctp_association::strm_realoutsize, sctp_association::strmout, sctp_association::timocookie, sctp_association::timodata, sctp_association::timoheartbeat, sctp_association::timoinit, sctp_association::timosack, sctp_association::timoshutdown, sctp_association::timoshutdownack, sctp_association::total_output_queue_size, and sctp_association::vrf_id.

Referenced by sctp_aloc_assoc_locked().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sctp_is_there_an_abort_here()

int sctp_is_there_an_abort_here ( struct mbuf *  m,
int  iphlen,
uint32_t vtag 
)

Definition at line 4578 of file sctputil.c.

References sctp_init_chunk::ch, sctp_chunkhdr::chunk_length, sctp_chunkhdr::chunk_type, sctp_init_chunk::init, sctp_init::initiate_tag, SCTP_ABORT_ASSOCIATION, SCTP_INITIATION, SCTP_INITIATION_ACK, sctp_m_getptr(), and SCTP_SIZE32.

Referenced by sctp_send_abort().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sctp_iterator_work()

◆ sctp_iterator_worker()

void sctp_iterator_worker ( void  )

Definition at line 1616 of file sctputil.c.

References iterator_control::iterator_running, iterator_control::iteratorhead, SCTP_IPI_ITERATOR_WQ_LOCK, SCTP_IPI_ITERATOR_WQ_UNLOCK, sctp_it_ctl, sctp_iterator_work(), and sctp_iterator::vn.

Referenced by sctp_iterator_thread().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sctp_local_addr_count()

◆ sctp_log_block()

◆ sctp_log_closing()

◆ sctp_log_cwnd()

void sctp_log_cwnd ( struct sctp_tcb stcb,
struct sctp_nets net,
int  augment,
uint8_t  from 
)

Definition at line 315 of file sctputil.c.

References sctp_tcb::asoc, sctp_cwnd_args::cnt_in_send, sctp_cwnd_args::cnt_in_str, sctp_nets::cwnd, sctp_cwnd_log::cwnd, sctp_cwnd_args::cwnd_augment, sctp_cwnd_args::cwnd_new_value, sctp_nets::find_pseudo_cumack, sctp_nets::flight_size, sctp_cwnd_log::from, sctp_cwnd_args::inflight, KTR_SCTP, sctp_misc_info::log1, sctp_misc_info::log2, sctp_misc_info::log3, sctp_misc_info::log4, sctp_cwnd_args::meets_pseudo_cumack, sctp_cwnd_log::misc, sctp_cwnd_args::need_new_pseudo_cumack, sctp_cwnd_args::net, sctp_nets::new_pseudo_cumack, sctp_association::peers_rwnd, sctp_nets::pseudo_cumack, sctp_cwnd_args::pseudo_cumack, SCTP_CTR6, SCTP_CWNDLOG_PRESEND, SCTP_LOG_EVENT_CWND, sctp_association::send_queue_cnt, sctp_association::stream_queue_cnt, and sctp_cwnd_log::x.

Referenced by htcp_cong_avoid(), sctp_chunk_output(), sctp_chunk_retransmission(), sctp_cwnd_update_after_ecn_echo_common(), sctp_cwnd_update_after_fr(), sctp_cwnd_update_after_output(), sctp_cwnd_update_after_packet_dropped(), sctp_cwnd_update_after_sack_common(), sctp_cwnd_update_after_timeout(), sctp_express_handle_sack(), sctp_handle_sack(), sctp_hs_cwnd_decrease(), sctp_hs_cwnd_increase(), sctp_hs_cwnd_update_after_sack(), sctp_htcp_cwnd_update_after_ecn_echo(), sctp_htcp_cwnd_update_after_fr(), sctp_htcp_cwnd_update_after_sack(), sctp_htcp_cwnd_update_after_timeout(), sctp_htcp_set_initial_cc_param(), sctp_med_chunk_output(), sctp_process_init(), sctp_process_segment_range(), sctp_set_initial_cc_param(), and sctp_t3rxt_timer().

Here is the caller graph for this function:

◆ sctp_log_fr()

◆ sctp_log_lock()

◆ sctp_log_map()

◆ sctp_log_maxburst()

◆ sctp_log_nagle_event()

◆ sctp_log_rwnd()

◆ sctp_log_rwnd_set()

◆ sctp_log_sack()

◆ sctp_log_strm_del()

◆ sctp_log_strm_del_alt()

◆ sctp_m_getptr()

◆ sctp_map_assoc_state()

◆ sctp_min_mtu()

uint32_t sctp_min_mtu ( uint32_t  mtu1,
uint32_t  mtu2,
uint32_t  mtu3 
)

Definition at line 7544 of file sctputil.c.

Referenced by sctp_add_remote_addr().

Here is the caller graph for this function:

◆ sctp_misc_ints()

◆ sctp_msecs_to_ticks()

uint32_t sctp_msecs_to_ticks ( uint32_t  msecs)

Definition at line 780 of file sctputil.c.

Referenced by htcp_beta_update(), measure_rtt(), sctp_inpcb_alloc(), sctp_setopt(), and sctp_timer_start().

Here is the caller graph for this function:

◆ sctp_notify_adaptation_layer()

◆ sctp_notify_assoc_change()

static void sctp_notify_assoc_change ( uint16_t  state,
struct sctp_tcb stcb,
uint16_t  error,
struct sctp_abort_chunk abort,
bool  from_peer,
bool  timedout,
int  so_locked 
)
static

Definition at line 3133 of file sctputil.c.

References sctp_association::asconf_supported, sctp_tcb::asoc, sctp_association::auth_supported, sctp_abort_chunk::ch, sctp_chunkhdr::chunk_length, sctp_association::context, sctp_association::idata_supported, sctp_queued_to_read::length, M_NOTIFICATION, sctp_association::primary_destination, sctp_association::prsctp_supported, sctp_association::reconfig_supported, sctp_assoc_change::sac_assoc_id, sctp_assoc_change::sac_error, sctp_assoc_change::sac_flags, sctp_assoc_change::sac_inbound_streams, sctp_assoc_change::sac_info, sctp_assoc_change::sac_length, sctp_assoc_change::sac_outbound_streams, sctp_assoc_change::sac_state, sctp_assoc_change::sac_type, sctp_add_to_readq(), SCTP_ASSOC_CHANGE, SCTP_ASSOC_SUPPORTS_ASCONF, SCTP_ASSOC_SUPPORTS_AUTH, SCTP_ASSOC_SUPPORTS_INTERLEAVING, SCTP_ASSOC_SUPPORTS_MAX, SCTP_ASSOC_SUPPORTS_MULTIBUF, SCTP_ASSOC_SUPPORTS_PR, SCTP_ASSOC_SUPPORTS_RE_CONFIG, SCTP_BUF_LEN, SCTP_BUF_NEXT, sctp_build_readq_entry(), SCTP_CANT_STR_ASSOC, SCTP_CHUNK_BUFFER_SIZE, SCTP_COMM_LOST, SCTP_COMM_UP, sctp_tcb::sctp_ep, sctp_inpcb::sctp_flags, SCTP_FROM_SCTPUTIL, sctp_get_associd, sctp_get_mbuf_for_msg(), SCTP_GET_STATE, SCTP_LTRACE_ERR_RET, sctp_m_freem, SCTP_PCB_FLAGS_IN_TCPPOOL, SCTP_PCB_FLAGS_RECVASSOCEVNT, SCTP_PCB_FLAGS_TCPTYPE, SCTP_READ_LOCK_NOT_HELD, SCTP_RESTART, sctp_tcb::sctp_socket, SCTP_STATE_COOKIE_WAIT, sctp_stcb_is_feature_on, sctp_queued_to_read::spec_flags, state, sctp_queued_to_read::stcb, sctp_association::streamincnt, sctp_association::streamoutcnt, and sctp_queued_to_read::tail_mbuf.

Referenced by sctp_ulp_notify().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sctp_notify_partial_delivery_indication()

◆ sctp_notify_peer_addr_change()

◆ sctp_notify_remote_error()

◆ sctp_notify_send_failed()

static void sctp_notify_send_failed ( struct sctp_tcb stcb,
uint8_t  sent,
uint32_t  error,
struct sctp_tmit_chunk chk,
int  so_locked 
)
static

Definition at line 3364 of file sctputil.c.

References sctp_tcb::asoc, sctp_chunkhdr::chunk_length, sctp_data_chunkrec::context, sctp_association::context, sctp_tmit_chunk::data, sctp_association::idata_supported, sctp_queued_to_read::length, M_NOTIFICATION, sctp_data_chunkrec::mid, sctp_data_chunkrec::ppid, sctp_association::primary_destination, sctp_data_chunkrec::rcv_flags, sctp_tmit_chunk::rec, sctp_add_to_readq(), SCTP_BUF_LEN, SCTP_BUF_NEXT, sctp_build_readq_entry(), SCTP_DATA_SENT, SCTP_DATA_UNSENT, sctp_tcb::sctp_ep, sctp_get_associd, sctp_get_mbuf_for_msg(), sctp_m_freem, sctp_mbuf_crush, SCTP_PCB_FLAGS_RECVNSENDFAILEVNT, SCTP_PCB_FLAGS_RECVSENDFAILEVNT, SCTP_READ_LOCK_NOT_HELD, sctp_sbspace_failedmsgs, SCTP_SEND_FAILED, SCTP_SEND_FAILED_EVENT, sctp_tcb::sctp_socket, sctp_stcb_is_feature_off, sctp_stcb_is_feature_on, sctp_tmit_chunk::send_size, sctp_data_chunkrec::sid, sctp_sndrcvinfo::sinfo_assoc_id, sctp_sndrcvinfo::sinfo_context, sctp_sndrcvinfo::sinfo_flags, sctp_sndrcvinfo::sinfo_ppid, sctp_sndrcvinfo::sinfo_ssn, sctp_sndrcvinfo::sinfo_stream, sctp_sndinfo::snd_assoc_id, sctp_sndinfo::snd_context, sctp_sndinfo::snd_flags, sctp_sndinfo::snd_ppid, sctp_sndinfo::snd_sid, sctp_queued_to_read::spec_flags, sctp_send_failed::ssf_assoc_id, sctp_send_failed::ssf_error, sctp_send_failed::ssf_flags, sctp_send_failed::ssf_info, sctp_send_failed::ssf_length, sctp_send_failed::ssf_type, sctp_send_failed_event::ssfe_assoc_id, sctp_send_failed_event::ssfe_error, sctp_send_failed_event::ssfe_flags, sctp_send_failed_event::ssfe_info, sctp_send_failed_event::ssfe_length, sctp_send_failed_event::ssfe_type, and sctp_queued_to_read::tail_mbuf.

Referenced by sctp_ulp_notify().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sctp_notify_send_failed2()

static void sctp_notify_send_failed2 ( struct sctp_tcb stcb,
uint32_t  error,
struct sctp_stream_queue_pending sp,
int  so_locked 
)
static

Definition at line 3495 of file sctputil.c.

References sctp_tcb::asoc, sctp_stream_queue_pending::context, sctp_association::context, sctp_stream_queue_pending::data, sctp_queued_to_read::length, sctp_stream_queue_pending::length, M_NOTIFICATION, sctp_stream_queue_pending::ppid, sctp_association::primary_destination, sctp_add_to_readq(), SCTP_BUF_LEN, SCTP_BUF_NEXT, sctp_build_readq_entry(), SCTP_DATA_LAST_FRAG, SCTP_DATA_NOT_FRAG, SCTP_DATA_UNSENT, sctp_tcb::sctp_ep, sctp_get_associd, sctp_get_mbuf_for_msg(), sctp_m_freem, SCTP_PCB_FLAGS_RECVNSENDFAILEVNT, SCTP_PCB_FLAGS_RECVSENDFAILEVNT, SCTP_READ_LOCK_NOT_HELD, sctp_sbspace_failedmsgs, SCTP_SEND_FAILED, SCTP_SEND_FAILED_EVENT, sctp_tcb::sctp_socket, sctp_stcb_is_feature_off, sctp_stcb_is_feature_on, sctp_stream_queue_pending::sid, sctp_sndrcvinfo::sinfo_assoc_id, sctp_sndrcvinfo::sinfo_context, sctp_sndrcvinfo::sinfo_flags, sctp_sndrcvinfo::sinfo_ppid, sctp_sndrcvinfo::sinfo_ssn, sctp_sndrcvinfo::sinfo_stream, sctp_sndinfo::snd_assoc_id, sctp_sndinfo::snd_context, sctp_sndinfo::snd_flags, sctp_sndinfo::snd_ppid, sctp_sndinfo::snd_sid, sctp_stream_queue_pending::some_taken, sctp_queued_to_read::spec_flags, sctp_send_failed::ssf_assoc_id, sctp_send_failed::ssf_error, sctp_send_failed::ssf_flags, sctp_send_failed::ssf_info, sctp_send_failed::ssf_length, sctp_send_failed::ssf_type, sctp_send_failed_event::ssfe_assoc_id, sctp_send_failed_event::ssfe_error, sctp_send_failed_event::ssfe_flags, sctp_send_failed_event::ssfe_info, sctp_send_failed_event::ssfe_length, sctp_send_failed_event::ssfe_type, sctp_queued_to_read::stcb, and sctp_queued_to_read::tail_mbuf.

Referenced by sctp_ulp_notify().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sctp_notify_sender_dry_event()

◆ sctp_notify_shutdown_event()

◆ sctp_notify_stream_reset()

◆ sctp_notify_stream_reset_add()

◆ sctp_notify_stream_reset_tsn()

◆ sctp_over_udp_start()

int sctp_over_udp_start ( void  )

Definition at line 7453 of file sctputil.c.

References IPPROTO_UDP, SCTP_BASE_INFO, SCTP_BASE_SYSCTL, sctp_over_udp_stop(), sctp_recv_udp_tunneled_packet(), sockaddr_in::sin_family, sockaddr_in::sin_len, sockaddr_in::sin_port, and udp_set_kernel_tunneling().

Referenced by sctp_sysctl_handle_udp_tunneling().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sctp_over_udp_stop()

void sctp_over_udp_stop ( void  )

Definition at line 7432 of file sctputil.c.

References SCTP_BASE_INFO.

Referenced by sctp_over_udp_start(), and sctp_sysctl_handle_udp_tunneling().

Here is the caller graph for this function:

◆ sctp_pad_lastmbuf()

struct mbuf * sctp_pad_lastmbuf ( struct mbuf *  m,
int  padval,
struct mbuf *  last_mbuf 
)

Definition at line 3115 of file sctputil.c.

References sctp_add_pad_tombuf(), and SCTP_BUF_NEXT.

Referenced by sctp_move_to_outqueue(), sctp_send_cookie_echo(), and sctp_send_heartbeat_ack().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sctp_print_address()

void sctp_print_address ( struct sockaddr *  sa)

Definition at line 4718 of file sctputil.c.

References SCTP_PRINTF, sockaddr_in::sin_addr, and sockaddr_in::sin_port.

Referenced by sctp_find_ifa_by_addr().

Here is the caller graph for this function:

◆ sctp_print_mapping_array()

◆ sctp_pull_off_control_to_new_inp()

void sctp_pull_off_control_to_new_inp ( struct sctp_inpcb old_inp,
struct sctp_inpcb new_inp,
struct sctp_tcb stcb,
int  waitflags 
)

◆ sctp_recv_udp_tunneled_packet()

static void sctp_recv_udp_tunneled_packet ( struct mbuf *  m,
int  off,
struct inpcb inp,
const struct sockaddr *sa  SCTP_UNUSED,
void *ctx  SCTP_UNUSED 
)
static

Definition at line 7098 of file sctputil.c.

References ip::ip_len, ip::ip_v, IPV6_VERSION, IPVERSION, SCTP_DEBUG_CRCOFFLOAD, SCTPDBG, and udphdr::uh_sport.

Referenced by sctp_over_udp_start().

Here is the caller graph for this function:

◆ sctp_release_pr_sctp_chunk()

int sctp_release_pr_sctp_chunk ( struct sctp_tcb stcb,
struct sctp_tmit_chunk tp1,
uint8_t  sent,
int  so_locked 
)

Definition at line 5031 of file sctputil.c.

References sctp_stream_out::abandoned_sent, sctp_association::abandoned_sent, sctp_stream_out::abandoned_unsent, sctp_association::abandoned_unsent, sctp_stream_queue_pending::act_flags, sctp_tcb::asoc, sctp_tmit_chunk::asoc, sctp_tmit_chunk::book_size, sctp_stream_out::chunks_on_queues, sctp_data_chunkrec::context, sctp_stream_queue_pending::context, sctp_tmit_chunk::data, sctp_stream_queue_pending::data, sctp_stream_queue_pending::discard_rest, sctp_tmit_chunk::flags, sctp_association::idata_supported, sctp_stream_queue_pending::length, sctp_data_chunkrec::mid, sctp_stream_out::next_mid_ordered, sctp_stream_out::next_mid_unordered, sctp_stream_out::outqueue, sctp_association::peers_rwnd, sctp_data_chunkrec::ppid, sctp_stream_queue_pending::ppid, PR_SCTP_BUF_ENABLED, sctp_association::pr_sctp_cnt, PR_SCTP_POLICY, sctp_data_chunkrec::rcv_flags, sctp_tmit_chunk::rec, sctp_alloc_a_chunk, SCTP_BASE_SYSCTL, SCTP_DATA_FIRST_FRAG, SCTP_DATA_LAST_FRAG, SCTP_DATA_NOT_FRAG, SCTP_DATA_UNORDERED, SCTP_DATAGRAM_RESEND, sctp_tcb::sctp_ep, sctp_flight_size_decrease, SCTP_FORWARD_TSN_SKIP, sctp_free_bufspace, sctp_free_spbufspace, sctp_m_freem, SCTP_MID_EQ, SCTP_NOTIFY_SENT_DG_FAIL, SCTP_NOTIFY_UNSENT_DG_FAIL, sctp_tcb::sctp_socket, sctp_sowwakeup, SCTP_TCB_SEND_LOCK, SCTP_TCB_SEND_UNLOCK, sctp_total_flight_decrease, sctp_ulp_notify(), SCTP_UNORDERED, sctp_association::send_queue, sctp_association::send_queue_cnt, sctp_tmit_chunk::send_size, sctp_association::sending_seq, sctp_tmit_chunk::sent, sctp_association::sent_queue, sctp_association::sent_queue_cnt, sctp_association::sent_queue_cnt_removeable, sctp_data_chunkrec::sid, sctp_stream_queue_pending::sid, sctp_stream_queue_pending::sinfo_flags, sctp_stream_queue_pending::some_taken, sctp_association::strmout, sctp_stream_queue_pending::tail_mbuf, sctp_data_chunkrec::tsn, and sctp_tmit_chunk::whoTo.

Referenced by sctp_mark_all_for_resend(), sctp_prune_prsctp(), sctp_strike_gap_ack_chunks(), and sctp_try_advance_peer_ack_point().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sctp_report_all_outbound()

◆ sctp_sblog()

◆ sctp_secs_to_ticks()

uint32_t sctp_secs_to_ticks ( uint32_t  secs)

Definition at line 818 of file sctputil.c.

Referenced by sctp_autoclose_timer(), sctp_inpcb_alloc(), and sctp_setopt().

Here is the caller graph for this function:

◆ sctp_select_a_tag()

uint32_t sctp_select_a_tag ( struct sctp_inpcb inp,
uint16_t  lport,
uint16_t  rport,
int  check 
)

Definition at line 1049 of file sctputil.c.

References sctp_inpcb::sctp_ep, SCTP_GETTIME_TIMEVAL, sctp_is_vtag_good(), and sctp_select_initial_TSN().

Referenced by sctp_handle_nat_colliding_state(), sctp_init_asoc(), and sctp_send_initiate_ack().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sctp_select_initial_TSN()

uint32_t sctp_select_initial_TSN ( struct sctp_pcb inp)

◆ sctp_set_state()

◆ sctp_soreceive()

int sctp_soreceive ( struct socket *  so,
struct sockaddr **  psa,
struct uio *  uio,
struct mbuf **  mp0,
struct mbuf **  controlp,
int *  flagsp 
)

◆ sctp_sorecvmsg()

int sctp_sorecvmsg ( struct socket *  so,
struct uio *  uio,
struct mbuf **  mp,
struct sockaddr *  from,
int  fromlen,
int *  msg_flags,
struct sctp_sndrcvinfo sinfo,
int  filling_sinfo 
)

Definition at line 5477 of file sctputil.c.

References sctp_net_route::_l_addr, sctp_tcb::asoc, sctp_queued_to_read::aux_data, sctp_inpcb::control, sctp_association::cumulative_tsn, sctp_queued_to_read::data, sctp_stream_in::delivery_started, sctp_queued_to_read::do_not_ref_stcb, sctp_queued_to_read::end_added, sctp_pcbtsn_rlog::flgs, sctp_tcb::freed_by_sorcv_sincelast, sctp_queued_to_read::held_length, sctp_inpcb::inp, sctp_inpcb::inp_rdata_mtx, sctp_queued_to_read::length, M_NOTIFICATION, sctp_queued_to_read::mid, sctp_association::my_rwnd, next, sctp_queued_to_read::on_strm_q, sctp_queued_to_read::pdapi_aborted, sctp_queued_to_read::port_from, sctp_inpcb::read_queue, sctp_association::refcnt, sctp_nets::ro, sctp_sockstore::sa, sctp_association::sb_cc, SCTP_BASE_SYSCTL, SCTP_BUF_LEN, SCTP_BUF_NEXT, SCTP_BUF_RESV_UF, SCTP_DATA_UNORDERED, sctp_inpcb::sctp_flags, sctp_free_a_readq, sctp_free_remote_addr, SCTP_FROM_SCTPUTIL, SCTP_INP_READ_LOCK, SCTP_INP_READ_UNLOCK, sctp_is_feature_on, SCTP_LOG_SBFREE, SCTP_LOG_SBRESULT, SCTP_LTRACE_ERR_RET, sctp_m_free, sctp_m_freem, SCTP_MIN_RWND, sctp_misc_ints(), SCTP_NEXT_MSG_AVAIL, SCTP_NEXT_MSG_IS_NOTIFICATION, SCTP_NEXT_MSG_IS_UNORDERED, SCTP_NEXT_MSG_ISCOMPLETE, SCTP_NO_NEXT_MSG, SCTP_PCB_FLAGS_CONNECTED, SCTP_PCB_FLAGS_EXPLICIT_EOR, SCTP_PCB_FLAGS_EXT_RCVINFO, SCTP_PCB_FLAGS_FRAG_INTERLEAVE, SCTP_PCB_FLAGS_IN_TCPPOOL, SCTP_PCB_FLAGS_INTERLEAVE_STRMS, SCTP_PCB_FLAGS_NEEDS_MAPPED_V4, SCTP_PCB_FLAGS_RECVNXTINFO, SCTP_PCB_FLAGS_SOCKET_ALLGONE, SCTP_PCB_FLAGS_SOCKET_GONE, SCTP_PCB_FLAGS_TCPTYPE, SCTP_PCB_FLAGS_WAS_ABORTED, SCTP_PCB_FLAGS_WAS_CONNECTED, SCTP_PRINTF, SCTP_READ_LOG_SIZE, SCTP_RECV_RWND_LOGGING_ENABLE, SCTP_RWND_HIWAT_SHIFT, SCTP_SB_LIMIT_RCV, SCTP_SB_LOGGING_ENABLE, sctp_sbfree, sctp_sblog(), SCTP_SO_IS_NBIO, SCTP_SORECV_DONE, SCTP_SORECV_ENTER, SCTP_SORECV_ENTERPL, sctp_sorwakeup, SCTP_STAT_INCR, SCTP_STATE_ABOUT_TO_BE_FREED, SCTP_UNORDERED, sctp_user_rcvd(), sctp_pcbtsn_rlog::seq, sctp_extrcvinfo::serinfo_next_aid, sctp_extrcvinfo::serinfo_next_flags, sctp_extrcvinfo::serinfo_next_length, sctp_extrcvinfo::serinfo_next_ppid, sctp_extrcvinfo::serinfo_next_stream, sctp_sockstore::sin, sctp_sockstore::sin6, sockaddr_in::sin_port, sctp_queued_to_read::sinfo_assoc_id, sctp_sndrcvinfo::sinfo_assoc_id, sctp_queued_to_read::sinfo_context, sctp_sndrcvinfo::sinfo_context, sctp_queued_to_read::sinfo_cumtsn, sctp_sndrcvinfo::sinfo_cumtsn, sctp_queued_to_read::sinfo_flags, sctp_sndrcvinfo::sinfo_flags, sctp_queued_to_read::sinfo_ppid, sctp_sndrcvinfo::sinfo_ppid, sctp_sndrcvinfo::sinfo_ssn, sctp_queued_to_read::sinfo_stream, sctp_sndrcvinfo::sinfo_stream, sctp_queued_to_read::sinfo_timetolive, sctp_sndrcvinfo::sinfo_timetolive, sctp_queued_to_read::sinfo_tsn, sctp_sndrcvinfo::sinfo_tsn, sctp_queued_to_read::some_taken, sctp_queued_to_read::spec_flags, sctp_association::state, sctp_queued_to_read::stcb, sctp_pcbtsn_rlog::strm, sctp_association::strmin, sctp_pcbtsn_rlog::sz, sctp_queued_to_read::tail_mbuf, sctp_pcbtsn_rlog::vtag, and sctp_queued_to_read::whoFrom.

Referenced by sctp_soreceive(), and sys_sctp_generic_recvmsg().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sctp_stop_association_timers()

◆ sctp_stop_timers_for_shutdown()

◆ sctp_ticks_to_msecs()

uint32_t sctp_ticks_to_msecs ( uint32_t  ticks)

Definition at line 799 of file sctputil.c.

Referenced by sctp_getopt(), sctp_handle_cookie_echo(), and sctp_init_asoc().

Here is the caller graph for this function:

◆ sctp_ticks_to_secs()

uint32_t sctp_ticks_to_secs ( uint32_t  ticks)

Definition at line 833 of file sctputil.c.

Referenced by sctp_getopt(), and sctp_handle_cookie_echo().

Here is the caller graph for this function:

◆ sctp_timeout_handler()

void sctp_timeout_handler ( void *  t)

Definition at line 1719 of file sctputil.c.

References sctp_tcb::asoc, sctp_pcb::current_secret_number, sctp_nets::dest_state, sctp_timer::ep, sctp_inpcb::inp, sctp_pcb::last_secret_number, sctp_timer::net, sctp_association::num_send_timers_up, sctp_association::refcnt, sctp_abort_an_association(), SCTP_ADDR_NOHB, sctp_asconf_timer(), sctp_autoclose_timer(), SCTP_BASE_SYSCTL, SCTP_CALLED_FROM_INPKILL_TIMER, sctp_chunk_output(), sctp_cookie_timer(), SCTP_DEBUG_TIMER2, sctp_delete_prim_timer(), sctp_inpcb::sctp_ep, sctp_tcb::sctp_ep, sctp_fix_ecn_echo(), sctp_free_assoc(), sctp_free_remote_addr, SCTP_FREE_SHOULD_USE_ABORT, SCTP_FROM_SCTPUTIL, sctp_generate_cause(), SCTP_GETTIME_TIMEVAL, sctp_handle_addr_wq(), sctp_heartbeat_timer(), SCTP_HOW_MANY_SECRETS, SCTP_INP_DECR_REF, SCTP_INP_WLOCK, SCTP_INP_WUNLOCK, sctp_inpcb_free(), SCTP_IS_TIMER_TYPE_VALID, SCTP_LOC_1, SCTP_LOC_2, SCTP_LOC_3, SCTP_NORMAL_PROC, SCTP_NUMBER_OF_SECRETS, SCTP_OS_TIMER_ACTIVE, SCTP_OS_TIMER_DEACTIVATE, SCTP_OS_TIMER_PENDING, SCTP_OUTPUT_FROM_ASCONF_TMR, SCTP_OUTPUT_FROM_AUTOCLOSE_TMR, SCTP_OUTPUT_FROM_HB_TMR, SCTP_OUTPUT_FROM_SACK_TMR, SCTP_OUTPUT_FROM_SHUT_ACK_TMR, SCTP_OUTPUT_FROM_SHUT_TMR, SCTP_OUTPUT_FROM_STRRST_TMR, SCTP_OUTPUT_FROM_T3, sctp_pathmtu_timer(), sctp_select_initial_TSN(), sctp_send_sack(), sctp_shutdown_timer(), sctp_shutdownack_timer(), SCTP_SO_NOT_LOCKED, SCTP_STAT_INCR, SCTP_STATE_ABOUT_TO_BE_FREED, SCTP_STATE_EMPTY, sctp_strreset_timer(), sctp_t1init_timer(), sctp_t3rxt_timer(), SCTP_TCB_LOCK, SCTP_TCB_LOCK_ASSERT, SCTP_TCB_UNLOCK, sctp_timer_start(), sctp_timer_stop(), SCTP_TIMER_TYPE_ADDR_WQ, SCTP_TIMER_TYPE_ASCONF, SCTP_TIMER_TYPE_ASOCKILL, SCTP_TIMER_TYPE_AUTOCLOSE, SCTP_TIMER_TYPE_COOKIE, SCTP_TIMER_TYPE_HEARTBEAT, SCTP_TIMER_TYPE_INIT, SCTP_TIMER_TYPE_INPKILL, SCTP_TIMER_TYPE_NEWCOOKIE, SCTP_TIMER_TYPE_PATHMTURAISE, SCTP_TIMER_TYPE_PRIM_DELETED, SCTP_TIMER_TYPE_RECV, SCTP_TIMER_TYPE_SEND, SCTP_TIMER_TYPE_SHUTDOWN, SCTP_TIMER_TYPE_SHUTDOWNACK, SCTP_TIMER_TYPE_SHUTDOWNGUARD, SCTP_TIMER_TYPE_STRRESET, SCTP_WQ_ADDR_LOCK, SCTP_WQ_ADDR_UNLOCK, SCTPDBG, sctp_pcb::secret_key, sctp_timer::self, sctp_association::sent_queue, sctp_association::sent_queue_cnt, sctp_association::state, sctp_timer::stopped_from, sctp_timer::tcb, sctp_pcb::time_of_secret_change, sctp_timer::timer, sctp_association::timocookie, sctp_association::timodata, sctp_association::timoheartbeat, sctp_association::timoinit, sctp_association::timosack, sctp_association::timoshutdown, sctp_association::timoshutdownack, sctp_timer::type, sctp_timer::vnet, and sctp_tmit_chunk::whoTo.

Referenced by sctp_timer_start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sctp_timer_start()

void sctp_timer_start ( int  t_type,
struct sctp_inpcb inp,
struct sctp_tcb stcb,
struct sctp_nets net 
)

Definition at line 2157 of file sctputil.c.

References sctp_association::asconf_timer, sctp_tcb::asoc, sctp_association::autoclose_timer, sctp_association::dack_timer, sctp_association::delayed_ack, sctp_association::delete_prim_timer, sctp_timer::ep, sctp_association::initial_rto, sctp_association::maxrto, sctp_timer::net, sctp_association::num_send_timers_up, sctp_association::refcnt, SCTP_ADDR_BEING_DELETED, SCTP_ADDR_NO_PMTUD, SCTP_ADDR_NOHB, SCTP_ADDR_PF, SCTP_ADDR_UNCONFIRMED, SCTP_ADDRESS_TICK_DELAY, SCTP_ASOC_KILL_TIMEOUT, sctp_association::sctp_autoclose_ticks, SCTP_BASE_INFO, SCTP_DEBUG_TIMER2, sctp_inpcb::sctp_ep, sctp_tcb::sctp_ep, sctp_get_tick_count, SCTP_INP_INCR_REF, SCTP_INP_KILL_TIMEOUT, SCTP_INP_WLOCK_ASSERT, sctp_msecs_to_ticks(), SCTP_OS_TIMER_PENDING, SCTP_OS_TIMER_START, sctp_select_initial_TSN(), SCTP_STATE_ABOUT_TO_BE_FREED, SCTP_TCB_LOCK_ASSERT, sctp_timeout_handler(), sctp_pcb::sctp_timeoutticks, SCTP_TIMER_MAXSHUTDOWN, SCTP_TIMER_PMTU, SCTP_TIMER_SIGNATURE, SCTP_TIMER_TYPE_ADDR_WQ, SCTP_TIMER_TYPE_ASCONF, SCTP_TIMER_TYPE_ASOCKILL, SCTP_TIMER_TYPE_AUTOCLOSE, SCTP_TIMER_TYPE_COOKIE, SCTP_TIMER_TYPE_HEARTBEAT, SCTP_TIMER_TYPE_INIT, SCTP_TIMER_TYPE_INPKILL, SCTP_TIMER_TYPE_NEWCOOKIE, SCTP_TIMER_TYPE_PATHMTURAISE, SCTP_TIMER_TYPE_PRIM_DELETED, SCTP_TIMER_TYPE_RECV, SCTP_TIMER_TYPE_SEND, SCTP_TIMER_TYPE_SHUTDOWN, SCTP_TIMER_TYPE_SHUTDOWNACK, SCTP_TIMER_TYPE_SHUTDOWNGUARD, SCTP_TIMER_TYPE_STRRESET, SCTP_WQ_ADDR_LOCK_ASSERT, SCTPDBG, sctp_timer::self, sctp_association::shut_guard_timer, sctp_pcb::signature_change, sctp_association::state, sctp_timer::stopped_from, sctp_association::strreset_timer, sctp_timer::tcb, sctp_timer::ticks, sctp_timer::timer, sctp_timer::type, and sctp_timer::vnet.

Referenced by process_chunk_drop(), sctp_add_addr_to_vrf(), sctp_addr_mgmt_assoc(), sctp_assoc_immediate_retrans(), sctp_autoclose_timer(), sctp_chunk_retransmission(), sctp_cwnd_update_after_fr(), sctp_del_addr_from_vrf(), sctp_disconnect(), sctp_do_connect_x(), sctp_dynamic_set_primary(), sctp_express_handle_sack(), sctp_free_assoc(), sctp_handle_addr_wq(), sctp_handle_asconf_ack(), sctp_handle_cookie_ack(), sctp_handle_heartbeat_ack(), sctp_handle_init_ack(), sctp_handle_sack(), sctp_handle_shutdown(), sctp_hs_cwnd_update_after_fr(), sctp_htcp_cwnd_update_after_fr(), sctp_inpcb_alloc(), sctp_inpcb_free(), sctp_lower_sosend(), sctp_med_chunk_output(), sctp_move_pcb_and_assoc(), sctp_pathmtu_timer(), sctp_process_asconf_add_ip(), sctp_process_control(), sctp_process_cookie_existing(), sctp_process_cookie_new(), sctp_process_initack_addresses(), sctp_remove_net(), sctp_sack_check(), sctp_send_initiate(), sctp_send_sack(), sctp_send_str_reset_req(), sctp_send_stream_reset_out_if_possible(), sctp_sendall_iterator(), sctp_set_primary_ip_address_sa(), sctp_setopt(), sctp_shutdown(), sctp_shutdown_timer(), sctp_shutdownack_timer(), sctp_start_net_timers(), sctp_strreset_timer(), sctp_t3rxt_timer(), sctp_threshold_management(), sctp_timeout_handler(), and sctp_timer_validation().

Here is the call graph for this function:

◆ sctp_timer_stop()

void sctp_timer_stop ( int  t_type,
struct sctp_inpcb inp,
struct sctp_tcb stcb,
struct sctp_nets net,
uint32_t  from 
)

Definition at line 2615 of file sctputil.c.

References sctp_association::asconf_timer, sctp_tcb::asoc, sctp_association::autoclose_timer, sctp_association::dack_timer, sctp_association::delete_prim_timer, sctp_timer::ep, sctp_timer::net, sctp_association::num_send_timers_up, sctp_association::refcnt, SCTP_BASE_INFO, SCTP_DEBUG_TIMER2, sctp_inpcb::sctp_ep, sctp_tcb::sctp_ep, sctp_free_remote_addr, SCTP_INP_DECR_REF, SCTP_INP_WLOCK_ASSERT, SCTP_OS_TIMER_STOP, SCTP_TCB_LOCK_ASSERT, SCTP_TIMER_TYPE_ADDR_WQ, SCTP_TIMER_TYPE_ASCONF, SCTP_TIMER_TYPE_ASOCKILL, SCTP_TIMER_TYPE_AUTOCLOSE, SCTP_TIMER_TYPE_COOKIE, SCTP_TIMER_TYPE_HEARTBEAT, SCTP_TIMER_TYPE_INIT, SCTP_TIMER_TYPE_INPKILL, SCTP_TIMER_TYPE_NEWCOOKIE, SCTP_TIMER_TYPE_NONE, SCTP_TIMER_TYPE_PATHMTURAISE, SCTP_TIMER_TYPE_PRIM_DELETED, SCTP_TIMER_TYPE_RECV, SCTP_TIMER_TYPE_SEND, SCTP_TIMER_TYPE_SHUTDOWN, SCTP_TIMER_TYPE_SHUTDOWNACK, SCTP_TIMER_TYPE_SHUTDOWNGUARD, SCTP_TIMER_TYPE_STRRESET, SCTP_WQ_ADDR_LOCK_ASSERT, SCTPDBG, sctp_timer::self, sctp_association::shut_guard_timer, sctp_pcb::signature_change, sctp_timer::stopped_from, sctp_association::strreset_timer, sctp_timer::tcb, sctp_timer::timer, and sctp_timer::type.

Referenced by process_chunk_drop(), sctp_asconf_cleanup(), sctp_assoc_immediate_retrans(), sctp_chunk_output(), sctp_chunk_retransmission(), sctp_clean_up_stream_reset(), sctp_cwnd_update_after_fr(), sctp_drain_mbufs(), sctp_express_handle_sack(), sctp_handle_abort(), sctp_handle_asconf_ack(), sctp_handle_heartbeat_ack(), sctp_handle_sack(), sctp_handle_shutdown(), sctp_handle_shutdown_ack(), sctp_handle_shutdown_complete(), sctp_hs_cwnd_update_after_fr(), sctp_htcp_cwnd_update_after_fr(), sctp_inpcb_free(), sctp_med_chunk_output(), sctp_net_immediate_retrans(), sctp_process_asconf_set_primary(), sctp_process_cookie_existing(), sctp_process_init_ack(), sctp_remove_net(), sctp_sack_check(), sctp_send_sack(), sctp_setopt(), sctp_stop_all_cookie_timers(), sctp_stop_association_timers(), sctp_stop_timers_for_shutdown(), sctp_threshold_management(), sctp_timeout_handler(), and sctp_user_rcvd().

Here is the caller graph for this function:

◆ sctp_ulp_notify()

void sctp_ulp_notify ( uint32_t  notification,
struct sctp_tcb stcb,
uint32_t  error,
void *  data,
int  so_locked 
)

Definition at line 4042 of file sctputil.c.

References sctp_net_route::_l_addr, sctp_association::adaptation_needed, sctp_association::adaptation_sent, sctp_tcb::asoc, sctp_association::assoc_up_sent, sctp_association::auth_supported, sctp_nets::ro, SCTP_ADDR_ADDED, SCTP_ADDR_AVAILABLE, SCTP_ADDR_CONFIRMED, SCTP_ADDR_MADE_PRIM, SCTP_ADDR_REMOVED, SCTP_ADDR_UNREACHABLE, SCTP_AUTH_FREE_KEY, SCTP_AUTH_NEW_KEY, SCTP_AUTH_NO_AUTH, SCTP_CANT_STR_ASSOC, SCTP_COMM_LOST, SCTP_COMM_UP, SCTP_DEBUG_UTIL1, sctp_tcb::sctp_ep, sctp_inpcb::sctp_flags, SCTP_GET_STATE, sctp_notify_adaptation_layer(), SCTP_NOTIFY_ASCONF_ADD_IP, SCTP_NOTIFY_ASCONF_DELETE_IP, SCTP_NOTIFY_ASCONF_SET_PRIMARY, sctp_notify_assoc_change(), SCTP_NOTIFY_ASSOC_DOWN, SCTP_NOTIFY_ASSOC_LOC_ABORTED, SCTP_NOTIFY_ASSOC_REM_ABORTED, SCTP_NOTIFY_ASSOC_RESTART, SCTP_NOTIFY_ASSOC_TIMEDOUT, SCTP_NOTIFY_ASSOC_UP, SCTP_NOTIFY_AUTH_FREE_KEY, SCTP_NOTIFY_AUTH_NEW_KEY, sctp_notify_authentication(), SCTP_NOTIFY_INTERFACE_CONFIRMED, SCTP_NOTIFY_INTERFACE_DOWN, SCTP_NOTIFY_INTERFACE_UP, SCTP_NOTIFY_NO_PEER_AUTH, sctp_notify_partial_delivery_indication(), SCTP_NOTIFY_PARTIAL_DELVIERY_INDICATION, sctp_notify_peer_addr_change(), SCTP_NOTIFY_PEER_SHUTDOWN, SCTP_NOTIFY_REMOTE_ERROR, sctp_notify_remote_error(), sctp_notify_send_failed(), sctp_notify_send_failed2(), SCTP_NOTIFY_SENDER_DRY, sctp_notify_sender_dry_event(), SCTP_NOTIFY_SENT_DG_FAIL, sctp_notify_shutdown_event(), SCTP_NOTIFY_SPECIAL_SP_FAIL, SCTP_NOTIFY_STR_RESET_DENIED_IN, SCTP_NOTIFY_STR_RESET_DENIED_OUT, SCTP_NOTIFY_STR_RESET_FAILED_IN, SCTP_NOTIFY_STR_RESET_FAILED_OUT, SCTP_NOTIFY_STR_RESET_RECV, SCTP_NOTIFY_STR_RESET_SEND, sctp_notify_stream_reset(), SCTP_NOTIFY_UNSENT_DG_FAIL, SCTP_PCB_FLAGS_SOCKET_ALLGONE, SCTP_PCB_FLAGS_SOCKET_GONE, SCTP_RESTART, SCTP_SHUTDOWN_COMP, sctp_tcb::sctp_socket, SCTP_STATE_CLOSED_SOCKET, SCTP_STATE_COOKIE_ECHOED, SCTP_STATE_COOKIE_WAIT, SCTP_STREAM_RESET_DENIED, SCTP_STREAM_RESET_FAILED, SCTP_STREAM_RESET_INCOMING, SCTP_STREAM_RESET_OUTGOING_SSN, sctp_ulp_notify(), SCTPDBG, and sctp_association::state.

Referenced by sctp_abort_notification(), sctp_asconf_del_remote_addrs_except(), sctp_auth_key_release(), sctp_deact_sharedkey(), sctp_express_handle_sack(), sctp_free_assoc(), sctp_handle_cookie_ack(), sctp_handle_cookie_echo(), sctp_handle_error(), sctp_handle_forward_tsn(), sctp_handle_heartbeat_ack(), sctp_handle_init_ack(), sctp_handle_sack(), sctp_handle_shutdown(), sctp_handle_shutdown_ack(), sctp_handle_shutdown_complete(), sctp_handle_stream_reset_response(), sctp_process_asconf_add_ip(), sctp_process_asconf_delete_ip(), sctp_process_asconf_set_primary(), sctp_process_control(), sctp_process_init(), sctp_release_pr_sctp_chunk(), sctp_report_all_outbound(), sctp_reset_in_stream(), sctp_reset_out_streams(), sctp_setopt(), sctp_threshold_management(), and sctp_ulp_notify().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sctp_user_rcvd()

◆ sctp_wakeup_log()

◆ sctp_wakeup_the_read_socket()

void sctp_wakeup_the_read_socket ( struct sctp_inpcb inp,
struct sctp_tcb stcb,
int so_locked  SCTP_UNUSED 
)

Definition at line 4833 of file sctputil.c.

References sctp_inpcb::sctp_socket, and sctp_sorwakeup.

Referenced by sctp_add_to_readq(), sctp_handle_old_unordered_data(), and sctp_queue_data_for_reasm().

Here is the caller graph for this function:

Variable Documentation

◆ sctp_cc_functions

const struct sctp_cc_functions sctp_cc_functions[]
extern

Definition at line 2319 of file sctp_cc_functions.c.

◆ sctp_mtu_sizes

uint32_t sctp_mtu_sizes[]
static
Initial value:
= {
68,
296,
508,
512,
544,
576,
1004,
1492,
1500,
1536,
2000,
2048,
4352,
4464,
8168,
17912,
32000,
65532
}

Definition at line 922 of file sctputil.c.

Referenced by sctp_get_next_mtu(), and sctp_get_prev_mtu().

◆ sctp_ss_functions

const struct sctp_ss_functions sctp_ss_functions[]
extern

Definition at line 899 of file sctp_ss_functions.c.