FreeBSD kernel IPv4 code
sctp_output.h File Reference
#include <sys/cdefs.h>
#include <netinet/sctp_header.h>
Include dependency graph for sctp_output.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define _NETINET_SCTP_OUTPUT_H_
 
#define SCTP_DATA_CHUNK_OVERHEAD(stcb)
 

Functions

 __FBSDID ("$FreeBSD$")
 
struct mbuf * sctp_add_addresses_to_i_ia (struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_scoping *scope, struct mbuf *m_at, int cnt_inits_to, uint16_t *padding_len, uint16_t *chunk_len)
 
int sctp_is_addr_restricted (struct sctp_tcb *, struct sctp_ifa *)
 
int sctp_is_address_in_scope (struct sctp_ifa *ifa, struct sctp_scoping *scope, int do_update)
 
int sctp_is_addr_in_ep (struct sctp_inpcb *inp, struct sctp_ifa *ifa)
 
struct sctp_ifasctp_source_address_selection (struct sctp_inpcb *inp, struct sctp_tcb *stcb, sctp_route_t *ro, struct sctp_nets *net, int non_asoc_addr_ok, uint32_t vrf_id)
 
int sctp_v6src_match_nexthop (struct sockaddr_in6 *src6, sctp_route_t *ro)
 
int sctp_v4src_match_nexthop (struct sctp_ifa *sifa, sctp_route_t *ro)
 
void sctp_send_initiate (struct sctp_inpcb *, struct sctp_tcb *, int)
 
void sctp_send_initiate_ack (struct sctp_inpcb *, struct sctp_tcb *, struct sctp_nets *, struct mbuf *, int, int, struct sockaddr *, struct sockaddr *, struct sctphdr *, struct sctp_init_chunk *, uint8_t, uint32_t, uint32_t, uint16_t)
 
struct mbuf * sctp_arethere_unrecognized_parameters (struct mbuf *, int, int *, struct sctp_chunkhdr *, int *, int *)
 
void sctp_queue_op_err (struct sctp_tcb *, struct mbuf *)
 
int sctp_send_cookie_echo (struct mbuf *, int, int, struct sctp_tcb *, struct sctp_nets *)
 
void sctp_send_cookie_ack (struct sctp_tcb *)
 
void sctp_send_heartbeat_ack (struct sctp_tcb *, struct mbuf *, int, int, struct sctp_nets *)
 
void sctp_remove_from_wheel (struct sctp_tcb *stcb, struct sctp_association *asoc, struct sctp_stream_out *strq, int holds_lock)
 
void sctp_send_shutdown (struct sctp_tcb *, struct sctp_nets *)
 
void sctp_send_shutdown_ack (struct sctp_tcb *, struct sctp_nets *)
 
void sctp_send_shutdown_complete (struct sctp_tcb *, struct sctp_nets *, int)
 
void sctp_send_shutdown_complete2 (struct sockaddr *, struct sockaddr *, struct sctphdr *, uint8_t, uint32_t, uint16_t, uint32_t, uint16_t)
 
void sctp_send_asconf (struct sctp_tcb *, struct sctp_nets *, int addr_locked)
 
void sctp_send_asconf_ack (struct sctp_tcb *)
 
uint32_t sctp_get_frag_point (struct sctp_tcb *)
 
void sctp_toss_old_cookies (struct sctp_tcb *, struct sctp_association *)
 
void sctp_toss_old_asconf (struct sctp_tcb *)
 
void sctp_fix_ecn_echo (struct sctp_association *)
 
void sctp_move_chunks_from_net (struct sctp_tcb *stcb, struct sctp_nets *net)
 
int sctp_output (struct sctp_inpcb *, struct mbuf *, struct sockaddr *, struct mbuf *, struct thread *, int)
 
void sctp_chunk_output (struct sctp_inpcb *, struct sctp_tcb *, int, int)
 
void sctp_send_abort_tcb (struct sctp_tcb *, struct mbuf *, int)
 
void send_forward_tsn (struct sctp_tcb *, struct sctp_association *)
 
void sctp_send_sack (struct sctp_tcb *, int)
 
void sctp_send_hb (struct sctp_tcb *, struct sctp_nets *, int)
 
void sctp_send_ecn_echo (struct sctp_tcb *, struct sctp_nets *, uint32_t)
 
void sctp_send_packet_dropped (struct sctp_tcb *, struct sctp_nets *, struct mbuf *, int, int, int)
 
void sctp_send_cwr (struct sctp_tcb *, struct sctp_nets *, uint32_t, uint8_t)
 
void sctp_add_stream_reset_result (struct sctp_tmit_chunk *, uint32_t, uint32_t)
 
void sctp_send_deferred_reset_response (struct sctp_tcb *, struct sctp_stream_reset_list *, int)
 
void sctp_add_stream_reset_result_tsn (struct sctp_tmit_chunk *, uint32_t, uint32_t, uint32_t, uint32_t)
 
int sctp_send_stream_reset_out_if_possible (struct sctp_tcb *, int)
 
int sctp_send_str_reset_req (struct sctp_tcb *, uint16_t, uint16_t *, uint8_t, uint8_t, uint8_t, uint16_t, uint16_t, uint8_t)
 
void sctp_send_abort (struct mbuf *, int, struct sockaddr *, struct sockaddr *, struct sctphdr *, uint32_t, struct mbuf *, uint8_t, uint32_t, uint16_t, uint32_t, uint16_t)
 
void sctp_send_operr_to (struct sockaddr *, struct sockaddr *, struct sctphdr *, uint32_t, struct mbuf *, uint8_t, uint32_t, uint16_t, uint32_t, uint16_t)
 
int sctp_sosend (struct socket *so, struct sockaddr *addr, struct uio *uio, struct mbuf *top, struct mbuf *control, int flags, struct thread *p)
 

Macro Definition Documentation

◆ _NETINET_SCTP_OUTPUT_H_

#define _NETINET_SCTP_OUTPUT_H_

Definition at line 39 of file sctp_output.h.

◆ SCTP_DATA_CHUNK_OVERHEAD

#define SCTP_DATA_CHUNK_OVERHEAD (   stcb)
Value:
((stcb)->asoc.idata_supported ? \
sizeof(struct sctp_idata_chunk) : \
sizeof(struct sctp_data_chunk))

Definition at line 130 of file sctp_output.h.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ sctp_add_addresses_to_i_ia()

◆ sctp_add_stream_reset_result()

◆ sctp_add_stream_reset_result_tsn()

◆ sctp_arethere_unrecognized_parameters()

◆ sctp_chunk_output()

void sctp_chunk_output ( struct sctp_inpcb inp,
struct sctp_tcb stcb,
int  from_where,
int  so_locked 
)

Definition at line 9960 of file sctp_output.c.

References sctp_association::asconf_send_queue, sctp_tcb::asoc, sctp_association::burst_limit_applied, sctp_association::cc_functions, sctp_association::control_send_queue, sctp_nets::cwnd, sctp_association::dack_timer, sctp_nets::dest_state, sctp_association::ecn_echo_cnt_onq, sctp_nets::fast_retran_ip, sctp_nets::flight_size, sctp_association::fr_max_burst, sctp_association::max_burst, sctp_nets::mtu, sctp_association::nets, sctp_association::primary_destination, sctp_nets::ref_count, SCTP_ADDR_REACHABLE, SCTP_BASE_SYSCTL, sctp_chunk_retransmission(), SCTP_CWND_LOGGING_ENABLE, sctp_cc_functions::sctp_cwnd_update_after_output, SCTP_DEBUG_OUTPUT1, SCTP_DEBUG_OUTPUT3, sctp_tcb::sctp_ep, sctp_fix_ecn_echo(), SCTP_FROM_SCTP_OUTPUT, sctp_get_frag_point(), sctp_is_feature_on, sctp_is_there_unsent_data(), SCTP_LOC_3, sctp_log_cwnd(), sctp_log_maxburst(), SCTP_LOG_MAXBURST_ENABLE, SCTP_MAX_BURST_APPLIED, SCTP_MAX_BURST_ERROR_STOP, sctp_med_chunk_output(), SCTP_MIN_OVERHEAD, sctp_move_chunks_from_net(), SCTP_OS_TIMER_PENDING, SCTP_OUTPUT_FROM_COOKIE_ACK, SCTP_OUTPUT_FROM_HB_TMR, SCTP_OUTPUT_FROM_T3, SCTP_OUTPUT_FROM_USR_SEND, SCTP_PCB_FLAGS_NODELAY, SCTP_RETRAN_EXIT, SCTP_SEND_NOW_COMPLETES, sctp_send_sack(), sctp_send_stream_reset_out_if_possible(), SCTP_STAT_INCR, SCTP_TCB_LOCK_ASSERT, sctp_timer_stop(), SCTP_TIMER_TYPE_RECV, sctp_timer_validation(), SCTPDBG, sctp_association::send_queue, sctp_association::sent_queue_retran_cnt, sctp_association::smallest_mtu, sctp_timer::timer, sctp_association::total_flight, sctp_association::total_output_queue_size, and sctp_association::trigger_reset.

Referenced by sctp_assoc_immediate_retrans(), sctp_audit_stream_queues_for_size(), sctp_autoclose_timer(), sctp_common_input_processing(), sctp_disconnect(), sctp_drain_mbufs(), sctp_handle_init(), sctp_inpcb_free(), sctp_iterator_work(), sctp_lower_sosend(), sctp_net_immediate_retrans(), sctp_process_control(), sctp_process_cookie_existing(), sctp_sendall_iterator(), sctp_setopt(), sctp_shutdown(), sctp_start_net_timers(), sctp_timeout_handler(), and sctp_user_rcvd().

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

◆ sctp_fix_ecn_echo()

void sctp_fix_ecn_echo ( struct sctp_association asoc)

◆ sctp_get_frag_point()

◆ sctp_is_addr_in_ep()

int sctp_is_addr_in_ep ( struct sctp_inpcb inp,
struct sctp_ifa ifa 
)

◆ sctp_is_addr_restricted()

◆ sctp_is_address_in_scope()

◆ sctp_move_chunks_from_net()

◆ sctp_output()

int sctp_output ( struct sctp_inpcb inp,
struct mbuf *  m,
struct sockaddr *  addr,
struct mbuf *  control,
struct thread *  p,
int  flags 
)

Definition at line 10237 of file sctp_output.c.

References SCTP_FROM_SCTP_OUTPUT, SCTP_LTRACE_ERR_RET_PKT, sctp_inpcb::sctp_socket, and sctp_sosend().

Referenced by sctp_sendm().

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

◆ sctp_queue_op_err()

◆ sctp_remove_from_wheel()

void sctp_remove_from_wheel ( struct sctp_tcb stcb,
struct sctp_association asoc,
struct sctp_stream_out strq,
int  holds_lock 
)

◆ sctp_send_abort()

void sctp_send_abort ( struct mbuf *  m,
int  iphlen,
struct sockaddr *  src,
struct sockaddr *  dst,
struct sctphdr sh,
uint32_t  vtag,
struct mbuf *  cause,
uint8_t  mflowtype,
uint32_t  mflowid,
uint16_t  fibnum,
uint32_t  vrf_id,
uint16_t  port 
)

◆ sctp_send_abort_tcb()

◆ sctp_send_asconf()

◆ sctp_send_asconf_ack()

◆ sctp_send_cookie_ack()

◆ sctp_send_cookie_echo()

◆ sctp_send_cwr()

◆ sctp_send_deferred_reset_response()

◆ sctp_send_ecn_echo()

◆ sctp_send_hb()

void sctp_send_hb ( struct sctp_tcb stcb,
struct sctp_nets net,
int  so_locked 
)

Definition at line 11287 of file sctp_output.c.

References sctp_net_route::_l_addr, sctp_heartbeat_info_param::addr_family, sctp_heartbeat_info_param::addr_len, sctp_heartbeat_info_param::address, sctp_tcb::asoc, sctp_tmit_chunk::asoc, chk_id::can_take_data, sctp_heartbeat_chunk::ch, sctp_chunkhdr::chunk_flags, sctp_tmit_chunk::chunk_id, sctp_chunkhdr::chunk_length, sctp_chunkhdr::chunk_type, sctp_association::control_send_queue, sctp_tmit_chunk::copy_by_ref, sctp_association::ctrl_queue_cnt, sctp_tmit_chunk::data, sctp_nets::dest_state, sctp_tmit_chunk::flags, sctp_heartbeat::hb_info, sctp_nets::hb_responded, sctp_heartbeat_chunk::heartbeat, sctp_nets::heartbeat_random1, sctp_nets::heartbeat_random2, chk_id::id, sctp_paramhdr::param_length, sctp_paramhdr::param_type, sctp_heartbeat_info_param::ph, sctp_heartbeat_info_param::random_value1, sctp_heartbeat_info_param::random_value2, sctp_tmit_chunk::rec, sctp_nets::ref_count, sctp_nets::ro, sctp_sockstore::sa, SCTP_ADDR_UNCONFIRMED, sctp_alloc_a_chunk, SCTP_BUF_LEN, SCTP_BUF_RESV_UF, SCTP_DATAGRAM_UNSENT, SCTP_DEBUG_OUTPUT4, sctp_inpcb::sctp_ep, sctp_tcb::sctp_ep, sctp_free_a_chunk, sctp_get_mbuf_for_msg(), SCTP_GETTIME_TIMEVAL, SCTP_HEARTBEAT_INFO, SCTP_HEARTBEAT_REQUEST, sctp_m_freem, SCTP_MIN_OVERHEAD, sctp_select_initial_TSN(), SCTP_STAT_INCR, SCTP_TCB_LOCK_ASSERT, SCTPDBG, sctp_tmit_chunk::send_size, sctp_tmit_chunk::sent, sctp_sockstore::sin, sctp_sockstore::sin6, sockaddr_in::sin_addr, sctp_tmit_chunk::snd_count, sctp_heartbeat_info_param::time_value_1, sctp_heartbeat_info_param::time_value_2, and sctp_tmit_chunk::whoTo.

Referenced by process_chunk_drop(), sctp_heartbeat_timer(), sctp_process_asconf_add_ip(), sctp_setopt(), sctp_start_net_timers(), sctp_t3rxt_timer(), and sctp_threshold_management().

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

◆ sctp_send_heartbeat_ack()

◆ sctp_send_initiate()

void sctp_send_initiate ( struct sctp_inpcb inp,
struct sctp_tcb stcb,
int  so_locked 
)

Definition at line 4615 of file sctp_output.c.

References sctp_net_route::_l_addr, sctp_init::a_rwnd, sctp_pcb::adaptation_layer_indicator, sctp_pcb::adaptation_layer_indicator_provided, sctp_supported_addr_param::addr_type, sctp_association::asconf_supported, sctp_tcb::asoc, sctp_association::auth_supported, sctp_association::authinfo, sctp_init_chunk::ch, sctp_chunkhdr::chunk_flags, sctp_chunkhdr::chunk_length, sctp_chunkhdr::chunk_type, sctp_supported_chunk_types_param::chunk_types, sctp_auth_chunk_list::chunk_types, sctp_association::cookie_preserve_req, sctp_nets::dest_state, sctp_association::ecn_supported, sctp_auth_hmac_algo::hmac_ids, sctp_association::idata_supported, sctp_association::ifp_had_enobuf, sctp_adaptation_layer_indication::indication, sctp_init_chunk::init, sctp_association::init_seq_number, sctp_init::initial_tsn, sctp_init::initiate_tag, sctp_scoping::ipv4_addr_legal, sctp_scoping::ipv6_addr_legal, sctp_key::key, sctp_nets::last_sent_time, sctp_association::local_auth_chunks, sctp_association::local_hmacs, sctp_association::max_inbound_streams, sctp_association::my_vtag, sctp_association::nets, sctp_association::nrsack_supported, sctp_hmaclist::num_algo, sctp_init::num_inbound_streams, sctp_init::num_outbound_streams, sctp_paramhdr::param_length, sctp_paramhdr::param_type, sctp_cookie_perserve_param::ph, sctp_supported_addr_param::ph, sctp_supported_chunk_types_param::ph, sctp_adaptation_layer_indication::ph, sctp_auth_chunk_list::ph, sctp_auth_hmac_algo::ph, sctp_association::pktdrop_supported, sctp_nets::port, sctp_association::pre_open_streams, sctp_association::primary_destination, sctp_association::prsctp_supported, sctp_authinformation::random, sctp_authinformation::random_len, sctp_association::reconfig_supported, sctp_nets::ro, sctp_tcb::rport, sctp_nets::rxt_timer, sctp_sockstore::sa, sctp_association::scope, sctp_add_addresses_to_i_ia(), sctp_add_pad_tombuf(), SCTP_ASCONF, SCTP_ASCONF_ACK, sctp_auth_get_chklist_size(), SCTP_AUTHENTICATION, SCTP_BASE_SYSCTL, SCTP_BUF_LEN, SCTP_CHUNK_LIST, SCTP_COOKIE_PRESERVE, SCTP_DEBUG_OUTPUT4, SCTP_ECN_CAPABLE, sctp_inpcb::sctp_ep, SCTP_FORWARD_CUM_TSN, sctp_get_mbuf_for_msg(), SCTP_GETTIME_TIMEVAL, SCTP_HAS_NAT_SUPPORT, SCTP_HMAC_LIST, SCTP_IDATA, SCTP_IFORWARD_CUM_TSN, SCTP_INITIATION, SCTP_IPV4_ADDRESS, SCTP_IPV6_ADDRESS, sctp_lowlevel_chunk_output(), sctp_m_freem, SCTP_MINIMAL_RWND, SCTP_NR_SELECTIVE_ACK, SCTP_OS_TIMER_PENDING, SCTP_PACKET_DROPPED, SCTP_PRSCTP_SUPPORTED, SCTP_SB_LIMIT_RCV, sctp_serialize_auth_chunks(), sctp_serialize_hmaclist(), sctp_set_primary_addr(), SCTP_SIZE32, sctp_inpcb::sctp_socket, SCTP_STAT_INCR, SCTP_STAT_INCR_COUNTER64, SCTP_STREAM_RESET, SCTP_SUPPORTED_ADDRTYPE, SCTP_SUPPORTED_CHUNK_EXT, sctp_timer_start(), SCTP_TIMER_TYPE_INIT, SCTP_ULP_ADAPTATION, SCTPDBG, sctp_sockstore::sin6, sctp_cookie_perserve_param::time, and sctp_timer::timer.

Referenced by process_chunk_drop(), sctp_do_connect_x(), sctp_handle_error(), sctp_handle_nat_colliding_state(), sctp_lower_sosend(), sctp_setopt(), and sctp_t1init_timer().

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

◆ sctp_send_initiate_ack()

void sctp_send_initiate_ack ( struct sctp_inpcb inp,
struct sctp_tcb stcb,
struct sctp_nets src_net,
struct mbuf *  init_pkt,
int  iphlen,
int  offset,
struct sockaddr *  src,
struct sockaddr *  dst,
struct sctphdr sh,
struct sctp_init_chunk init_chk,
uint8_t  mflowtype,
uint32_t  mflowid,
uint32_t  vrf_id,
uint16_t  port 
)

Definition at line 5457 of file sctp_output.c.

References sctp_net_route::_l_addr, sctp_net_route::_s_addr, sctp_pcb::adaptation_layer_indicator, sctp_pcb::adaptation_layer_indicator_provided, sctp_state_cookie::addr_type, sctp_state_cookie::address, sctp_ifa::address, sctp_inpcb::asconf_supported, sctp_association::asconf_supported, sctp_tcb::asoc, sctp_inpcb::auth_supported, sctp_association::auth_supported, sctp_init_chunk::ch, sctp_chunkhdr::chunk_length, sctp_supported_chunk_types_param::chunk_types, sctp_auth_chunk_list::chunk_types, sctp_state_cookie::cookie_life, sctp_association::cookie_life, sctp_pcb::current_secret_number, sctp_pcb::def_cookie_life, sctphdr::dest_port, sctp_inpcb::ecn_supported, sctp_association::ecn_supported, sctp_inpcb::fibnum, sctp_auth_hmac_algo::hmac_ids, sctp_inpcb::idata_supported, sctp_association::idata_supported, sctp_state_cookie::identification, sctp_association::ifp_had_enobuf, IN4_ISPRIVATE_ADDRESS, sctp_adaptation_layer_indication::indication, sctp_init_chunk::init, sctp_association::init_seq_number, sctp_init::initiate_tag, sctp_state_cookie::ipv4_addr_legal, sctp_scoping::ipv4_addr_legal, sctp_scoping::ipv4_local_scope, sctp_state_cookie::ipv4_scope, sctp_state_cookie::ipv6_addr_legal, sctp_scoping::ipv6_addr_legal, sctp_state_cookie::laddr_type, sctp_state_cookie::laddress, sctp_pcb::local_auth_chunks, sctp_pcb::local_hmacs, sctp_state_cookie::local_scope, sctp_scoping::local_scope, sctp_state_cookie::loopback_scope, sctp_scoping::loopback_scope, sctp_pcb::max_open_streams_intome, sctp_state_cookie::my_vtag, sctp_association::my_vtag, sctp_association::my_vtag_nonce, sctp_state_cookie::myport, sctp_association::nets, sctp_inpcb::nrsack_supported, sctp_association::nrsack_supported, sctp_init::num_inbound_streams, sctp_paramhdr::param_length, sctp_paramhdr::param_type, sctp_association::peer_supports_nat, sctp_association::peer_vtag_nonce, sctp_state_cookie::peerport, sctp_state_cookie::peers_vtag, sctp_supported_chunk_types_param::ph, sctp_adaptation_layer_indication::ph, sctp_auth_random::ph, sctp_auth_chunk_list::ph, sctp_auth_hmac_algo::ph, sctp_inpcb::pktdrop_supported, sctp_association::pktdrop_supported, sctp_nets::port, sctp_pcb::pre_open_stream_count, sctp_association::pre_open_streams, sctp_association::primary_destination, sctp_inpcb::prsctp_supported, sctp_association::prsctp_supported, sctp_auth_random::random_data, sctp_inpcb::reconfig_supported, sctp_association::reconfig_supported, sctp_association::refcnt, sctp_state_cookie::reserved, sctp_nets::ro, in_addr::s_addr, sctp_association::scope, sctp_state_cookie::scope_id, sctp_add_addresses_to_i_ia(), sctp_add_cookie(), sctp_add_pad_tombuf(), sctp_are_there_new_addresses(), sctp_arethere_unrecognized_parameters(), SCTP_ASCONF, SCTP_ASCONF_ACK, SCTP_AUTH_RANDOM_SIZE_DEFAULT, SCTP_AUTHENTICATION, SCTP_BASE_SYSCTL, SCTP_BUF_LEN, SCTP_BUF_NEXT, SCTP_CHUNK_LIST, SCTP_DEBUG_OUTPUT4, SCTP_DIAG_INFO_LEN, SCTP_ECN_CAPABLE, sctp_inpcb::sctp_ep, sctp_inpcb::sctp_flags, SCTP_FORWARD_CUM_TSN, sctp_generate_cause(), sctp_get_mbuf_for_msg(), SCTP_GET_STATE, SCTP_GETTIME_TIMEVAL, SCTP_HAS_NAT_SUPPORT, SCTP_HMAC, SCTP_HMAC_LIST, sctp_hmac_m(), SCTP_IDATA, SCTP_IFORWARD_CUM_TSN, sctp_init_ack_chunk, SCTP_INITIATION_ACK, SCTP_INP_DECR_REF, SCTP_INP_INCR_REF, SCTP_INP_INFO_RLOCK, SCTP_INP_INFO_RUNLOCK, SCTP_INP_RLOCK, SCTP_INP_RUNLOCK, SCTP_IPV4_ADDRESS, SCTP_IPV6_ADDRESS, SCTP_IPV6_V6ONLY, sctp_is_address_on_local_host(), sctp_lowlevel_chunk_output(), sctp_m_freem, SCTP_MINIMAL_RWND, SCTP_NR_SELECTIVE_ACK, SCTP_PACKET_DROPPED, SCTP_PCB_FLAGS_BOUND_V6, SCTP_PRSCTP_SUPPORTED, SCTP_RANDOM, SCTP_READ_RANDOM, SCTP_RESERVE_SPACE, SCTP_SB_LIMIT_RCV, SCTP_SECRET_SIZE, sctp_select_a_tag(), sctp_select_initial_TSN(), sctp_send_abort(), sctp_serialize_auth_chunks(), sctp_serialize_hmaclist(), SCTP_SIGNATURE_SIZE, SCTP_SIZE32, SCTP_SNPRINTF, SCTP_SO_NOT_LOCKED, sctp_inpcb::sctp_socket, sctp_source_address_selection(), SCTP_STAT_INCR, SCTP_STAT_INCR_COUNTER64, SCTP_STATE_COOKIE_ECHOED, SCTP_STATE_COOKIE_WAIT, SCTP_STATE_INUSE, SCTP_STREAM_RESET, SCTP_SUPPORTED_CHUNK_EXT, SCTP_TCB_LOCK, SCTP_TCB_UNLOCK, SCTP_ULP_ADAPTATION, SCTP_VERSION_STRING, SCTPDBG, sctp_pcb::secret_key, sctp_sockstore::sin, sctp_sockstore::sin6, sockaddr_in::sin_addr, sctp_state_cookie::site_scope, sctp_scoping::site_scope, sctp_nets::src_addr_selected, sctphdr::src_port, sctp_association::streamoutcnt, sctp_state_cookie::tie_tag_my_vtag, sctp_state_cookie::tie_tag_peer_vtag, and sctp_state_cookie::time_entered.

Referenced by sctp_handle_init().

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

◆ sctp_send_operr_to()

void sctp_send_operr_to ( struct sockaddr *  src,
struct sockaddr *  dst,
struct sctphdr sh,
uint32_t  vtag,
struct mbuf *  cause,
uint8_t  mflowtype,
uint32_t  mflowid,
uint16_t  fibnum,
uint32_t  vrf_id,
uint16_t  port 
)

Definition at line 12297 of file sctp_output.c.

References SCTP_OPERATION_ERROR, and sctp_send_resp_msg().

Referenced by sctp_handle_cookie_echo(), and sctp_process_cookie_existing().

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

◆ sctp_send_packet_dropped()

void sctp_send_packet_dropped ( struct sctp_tcb stcb,
struct sctp_nets net,
struct mbuf *  m,
int  len,
int  iphlen,
int  bad_crc 
)

We don't respond with an PKT-DROP to an ABORT or PKT-DROP. We also do not respond to an INIT-ACK, because we can't know if the initiation tag is correct or not.

Definition at line 11457 of file sctp_output.c.

References sctp_tcb::asoc, sctp_tmit_chunk::asoc, sctp_tmit_chunk::book_size, sctp_tmit_chunk::book_size_scale, sctp_pktdrop_chunk::bottle_bw, chk_id::can_take_data, sctp_pktdrop_chunk::ch, sctp_chunkhdr::chunk_flags, sctp_tmit_chunk::chunk_id, sctp_chunkhdr::chunk_length, sctp_chunkhdr::chunk_type, sctp_association::control_send_queue, sctp_tmit_chunk::copy_by_ref, sctp_association::ctrl_queue_cnt, sctp_pktdrop_chunk::current_onq, sctp_pktdrop_chunk::data, sctp_tmit_chunk::data, sctp_tmit_chunk::flags, chk_id::id, sctp_association::my_rwnd, sctp_association::my_rwnd_control_len, sctp_association::pktdrop_supported, sctp_tmit_chunk::rec, sctp_nets::ref_count, sctp_pktdrop_chunk::reserved, SCTP_ABORT_ASSOCIATION, sctp_alloc_a_chunk, SCTP_BADCRC, SCTP_BUF_LEN, SCTP_BUF_RESV_UF, SCTP_DATAGRAM_UNSENT, sctp_free_a_chunk, sctp_get_mbuf_for_msg(), SCTP_INITIATION_ACK, sctp_m_freem, sctp_m_getptr(), SCTP_MAX_OVERHEAD, SCTP_MED_OVERHEAD, SCTP_MIN_OVERHEAD, SCTP_PACKET_DROPPED, SCTP_PACKET_TRUNCATED, SCTP_SB_LIMIT_RCV, SCTP_SIZE32, SCTP_SO_NOT_LOCKED, sctp_tcb::sctp_socket, SCTP_TCB_LOCK_ASSERT, sctp_tmit_chunk::send_size, sctp_tmit_chunk::sent, sctp_association::size_on_all_streams, sctp_association::size_on_reasm_queue, sctp_association::smallest_mtu, sctp_tmit_chunk::snd_count, sctp_pktdrop_chunk::trunc_len, and sctp_tmit_chunk::whoTo.

Referenced by sctp_common_input_processing(), and sctp_process_data().

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

◆ sctp_send_sack()

void sctp_send_sack ( struct sctp_tcb stcb,
int  so_locked 
)

Definition at line 10478 of file sctp_output.c.

References sctp_sack::a_rwnd, sctp_nr_sack::a_rwnd, sctp_tcb::asoc, sctp_tmit_chunk::asoc, chk_id::can_take_data, sctp_sack_chunk::ch, sctp_chunkhdr::chunk_flags, sctp_tmit_chunk::chunk_id, sctp_chunkhdr::chunk_length, sctp_chunkhdr::chunk_type, sctp_association::cmt_dac_pkts_rcvd, sctp_association::control_send_queue, sctp_tmit_chunk::copy_by_ref, sctp_association::ctrl_queue_cnt, sctp_sack::cum_tsn_ack, sctp_nr_sack::cum_tsn_ack, sctp_association::cumulative_tsn, sctp_tmit_chunk::data, sctp_association::data_pkts_seen, sctp_association::delayed_ack, sctp_nets::dest_state, sctp_association::dup_tsns, sctp_gap_ack_block::end, sctp_tmit_chunk::flags, sctp_tcb::freed_by_sorcv_sincelast, sack_track::gaps, sctp_association::highest_tsn_inside_map, sctp_association::highest_tsn_inside_nr_map, chk_id::id, sctp_association::last_data_chunk_from, sack_track::left_edge, sctp_association::mapping_array, sctp_association::mapping_array_base_tsn, MAX_TSN, sctp_nets::mtu, sctp_association::my_last_reported_rwnd, sctp_association::my_rwnd, sctp_association::nr_mapping_array, sctp_nr_sack_chunk::nr_sack, sctp_association::nrsack_supported, sctp_sack::num_dup_tsns, sctp_nr_sack::num_dup_tsns, sack_track::num_entries, sctp_sack::num_gap_ack_blks, sctp_nr_sack::num_gap_ack_blks, sctp_nr_sack::num_nr_gap_ack_blks, sctp_association::numduptsns, sctp_tmit_chunk::rec, sctp_nets::ref_count, sctp_nr_sack::reserved, sack_track::right_edge, sctp_sack_chunk::sack, sack_array, SCTP_ADDR_REACHABLE, sctp_alloc_a_chunk, SCTP_BASE_SYSCTL, SCTP_BUF_LEN, SCTP_BUF_RESV_UF, sctp_association::sctp_cmt_on_off, SCTP_DATAGRAM_UNSENT, sctp_tcb::sctp_ep, sctp_find_alternate_net(), sctp_free_a_chunk, sctp_free_remote_addr, SCTP_FROM_SCTP_OUTPUT, sctp_get_mbuf_for_msg(), SCTP_LOC_4, SCTP_LOC_5, sctp_m_freem, SCTP_MIN_OVERHEAD, SCTP_NR_SELECTIVE_ACK, SCTP_SELECTIVE_ACK, sctp_set_rwnd(), sctp_slide_mapping_arrays(), SCTP_STAT_INCR, SCTP_TCB_LOCK_ASSERT, sctp_timer_start(), sctp_timer_stop(), SCTP_TIMER_TYPE_RECV, SCTP_TSN_GT, SCTP_TSN_LOG_SIZE, sctp_association::send_sack, sctp_tmit_chunk::send_size, sctp_tmit_chunk::sent, sctp_tmit_chunk::snd_count, sctp_gap_ack_block::start, and sctp_tmit_chunk::whoTo.

Referenced by process_chunk_drop(), sctp_chunk_output(), sctp_drain_mbufs(), sctp_sack_check(), sctp_send_str_reset_req(), sctp_send_stream_reset_out_if_possible(), sctp_timeout_handler(), and sctp_user_rcvd().

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

◆ sctp_send_shutdown()

◆ sctp_send_shutdown_ack()

◆ sctp_send_shutdown_complete()

◆ sctp_send_shutdown_complete2()

void sctp_send_shutdown_complete2 ( struct sockaddr *  src,
struct sockaddr *  dst,
struct sctphdr sh,
uint8_t  mflowtype,
uint32_t  mflowid,
uint16_t  fibnum,
uint32_t  vrf_id,
uint16_t  port 
)

Definition at line 11276 of file sctp_output.c.

References sctp_send_resp_msg(), and SCTP_SHUTDOWN_COMPLETE.

Referenced by sctp_common_input_processing(), and sctp_handle_ootb().

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

◆ sctp_send_str_reset_req()

int sctp_send_str_reset_req ( struct sctp_tcb stcb,
uint16_t  number_entries,
uint16_t list,
uint8_t  send_in_req,
uint8_t  send_tsn_req,
uint8_t  add_stream,
uint16_t  adding_o,
uint16_t  adding_i,
uint8_t  peer_asked 
)

Definition at line 12070 of file sctp_output.c.

References sctp_stream_out::abandoned_sent, sctp_stream_out::abandoned_unsent, sctp_association::alternate, sctp_tcb::asoc, sctp_tmit_chunk::asoc, sctp_tmit_chunk::book_size, sctp_tmit_chunk::book_size_scale, chk_id::can_take_data, sctp_chunkhdr::chunk_flags, sctp_tmit_chunk::chunk_id, sctp_chunkhdr::chunk_length, sctp_chunkhdr::chunk_type, sctp_stream_out::chunks_on_queues, sctp_association::control_send_queue, sctp_tmit_chunk::copy_by_ref, sctp_association::ctrl_queue_cnt, sctp_tmit_chunk::data, sctp_tmit_chunk::flags, chk_id::id, sctp_stream_out::last_msg_incomplete, next, sctp_stream_out::next_mid_ordered, sctp_stream_out::next_mid_unordered, sctp_stream_out::outqueue, sctp_association::peer_req_out, sctp_association::primary_destination, sctp_tmit_chunk::rec, sctp_nets::ref_count, sctp_add_an_in_stream(), sctp_add_an_out_stream(), sctp_add_stream_reset_in(), sctp_add_stream_reset_out(), sctp_add_stream_reset_tsn(), sctp_alloc_a_chunk, SCTP_BUF_LEN, SCTP_BUF_RESV_UF, SCTP_DATAGRAM_UNSENT, sctp_tcb::sctp_ep, SCTP_FREE, sctp_free_a_chunk, SCTP_FROM_SCTP_OUTPUT, sctp_get_mbuf_for_msg(), SCTP_LTRACE_ERR_RET, SCTP_MALLOC, SCTP_MIN_OVERHEAD, SCTP_PR_SCTP_MAX, sctp_send_sack(), SCTP_SIZE32, SCTP_SO_LOCKED, sctp_ss_functions::sctp_ss_clear, sctp_ss_functions::sctp_ss_init, sctp_ss_functions::sctp_ss_init_stream, SCTP_STREAM_CLOSED, SCTP_STREAM_RESET, SCTP_TCB_SEND_LOCK, SCTP_TCB_SEND_UNLOCK, sctp_timer_start(), SCTP_TIMER_TYPE_STRRESET, sctp_association::send_sack, sctp_tmit_chunk::send_size, sctp_association::sending_seq, sctp_tmit_chunk::sent, sctp_stream_out::sid, sctp_tmit_chunk::snd_count, sctp_association::ss_functions, sctp_stream_out::state, sctp_association::str_reset, sctp_association::str_reset_seq_in, sctp_association::str_reset_seq_out, sctp_association::stream_reset_outstanding, sctp_association::streamoutcnt, sctp_association::strm_pending_add_size, sctp_association::strm_realoutsize, sctp_association::strmout, and sctp_tmit_chunk::whoTo.

Referenced by sctp_handle_str_reset_add_out_strm(), and sctp_setopt().

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

◆ sctp_send_stream_reset_out_if_possible()

int sctp_send_stream_reset_out_if_possible ( struct sctp_tcb stcb,
int  so_locked 
)

◆ sctp_sosend()

int sctp_sosend ( struct socket *  so,
struct sockaddr *  addr,
struct uio *  uio,
struct mbuf *  top,
struct mbuf *  control,
int  flags,
struct thread *  p 
)

Definition at line 12439 of file sctp_output.c.

References sctp_find_cmsg(), SCTP_FROM_SCTP_OUTPUT, sctp_lower_sosend(), SCTP_LTRACE_ERR_RET, and SCTP_SNDRCV.

Referenced by sctp_output().

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

◆ sctp_source_address_selection()

struct sctp_ifa * sctp_source_address_selection ( struct sctp_inpcb inp,
struct sctp_tcb stcb,
sctp_route_t ro,
struct sctp_nets net,
int  non_asoc_addr_ok,
uint32_t  vrf_id 
)

Rules:

  • Find the route if needed, cache if I can.
  • Look at interface address in route, Is it in the bound list. If so we have the best source.
  • If not we must rotate amongst the addresses.

Cavets and issues

Do we need to pay attention to scope. We can have a private address or a global address we are sourcing or sending to. So if we draw it out zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz

For V4

source * dest * result

<a> Private * Global * NAT

<b> Private * Private * No problem

<c> Global * Private * Huh, How will this work?

<d> Global * Global * No Problem

zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz

For V6

source * dest * result

<a> Linklocal * Global *

<b> Linklocal * Linklocal * No problem

<c> Global * Linklocal * Huh, How will this work?

<d> Global * Global * No Problem

zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz

And then we add to that what happens if there are multiple addresses assigned to an interface. Remember the ifa on a ifn is a linked list of addresses. So one interface can have more than one IP address. What happens if we have both a private and a global address? Do we then use context of destination to sort out which one is best? And what about NAT's sending P->G may get you a NAT translation, or should you select the G thats on the interface in preference.

Decisions:

  • count the number of addresses on the interface.
  • if it is one, no problem except case . For we will assume a NAT out there.
  • if there are more than one, then we need to worry about scope P or G. We should prefer G -> G and P -> P if possible. Then as a secondary fall back to mixed types G->P being a last ditch one.
  • The above all works for bound all, but bound specific we need to use the same concept but instead only consider the bound addresses. If the bound set is NOT assigned to the interface then we must use rotation amongst the bound addresses..

Definition at line 3297 of file sctp_output.c.

References sctp_nets::addr_is_local, sctp_inpcb::fibnum, IN4_ISLOOPBACK_ADDRESS, IN4_ISPRIVATE_ADDRESS, sctp_choose_boundall(), sctp_choose_boundspecific_inp(), sctp_choose_boundspecific_stcb(), SCTP_DEBUG_OUTPUT2, sctp_inpcb::sctp_flags, SCTP_IPI_ADDR_RLOCK, SCTP_IPI_ADDR_RUNLOCK, SCTP_PCB_FLAGS_BOUNDALL, SCTP_ROUTE_IS_REAL_LOOP, SCTP_RTALLOC, SCTPDBG, SCTPDBG_ADDR, and sockaddr_in::sin_addr.

Referenced by sctp_add_remote_addr(), sctp_lowlevel_chunk_output(), sctp_pathmtu_timer(), and sctp_send_initiate_ack().

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

◆ sctp_toss_old_asconf()

◆ sctp_toss_old_cookies()

◆ sctp_v4src_match_nexthop()

int sctp_v4src_match_nexthop ( struct sctp_ifa sifa,
sctp_route_t ro 
)

◆ sctp_v6src_match_nexthop()

int sctp_v6src_match_nexthop ( struct sockaddr_in6 *  src6,
sctp_route_t ro 
)

Referenced by sctp_path_check_and_react(), and sctp_select_nth_preferred_addr_from_ifn_boundall().

Here is the caller graph for this function:

◆ send_forward_tsn()

void send_forward_tsn ( struct sctp_tcb stcb,
struct sctp_association asoc 
)

Definition at line 10264 of file sctp_output.c.

References sctp_association::advanced_peer_ack_point, sctp_tmit_chunk::asoc, chk_id::can_take_data, sctp_forward_tsn_chunk::ch, sctp_chunkhdr::chunk_flags, sctp_tmit_chunk::chunk_id, sctp_chunkhdr::chunk_length, sctp_chunkhdr::chunk_type, sctp_association::control_send_queue, sctp_tmit_chunk::copy_by_ref, sctp_association::ctrl_queue_cnt, sctp_tmit_chunk::data, sctp_strseq_mid::flags, sctp_tmit_chunk::flags, sctp_data_chunkrec::fwd_tsn_cnt, sctp_association::fwd_tsn_cnt, chk_id::id, sctp_association::idata_supported, sctp_strseq_mid::mid, sctp_data_chunkrec::mid, sctp_forward_tsn_chunk::new_cumulative_tsn, PR_SCTP_UNORDERED_FLAG, sctp_data_chunkrec::rcv_flags, sctp_tmit_chunk::rec, sctp_alloc_a_chunk, SCTP_BASE_SYSCTL, SCTP_BUF_LEN, SCTP_BUF_RESV_UF, SCTP_DATA_UNORDERED, SCTP_DATAGRAM_NR_ACKED, SCTP_DATAGRAM_UNSENT, sctp_tcb::sctp_ep, sctp_inpcb::sctp_flags, SCTP_FORWARD_CUM_TSN, SCTP_FORWARD_TSN_SKIP, sctp_free_a_chunk, sctp_free_remote_addr, SCTP_FWD_TSN_CHECK, sctp_get_mbuf_for_msg(), SCTP_IFORWARD_CUM_TSN, SCTP_LOG_TRY_ADVANCE, SCTP_MIN_OVERHEAD, SCTP_MIN_V4_OVERHEAD, sctp_misc_ints(), SCTP_PCB_FLAGS_BOUND_V6, SCTP_SO_NOT_LOCKED, SCTP_TCB_LOCK_ASSERT, sctp_tmit_chunk::send_size, sctp_tmit_chunk::sent, sctp_association::sent_queue, sctp_strseq::sid, sctp_strseq_mid::sid, sctp_data_chunkrec::sid, sctp_association::smallest_mtu, sctp_tmit_chunk::snd_count, sctp_strseq::ssn, sctp_data_chunkrec::tsn, and sctp_tmit_chunk::whoTo.

Referenced by process_chunk_drop(), sctp_express_handle_sack(), sctp_handle_sack(), and sctp_t3rxt_timer().

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