FreeBSD kernel IPv4 code
sctp_asconf.c File Reference
#include <sys/cdefs.h>
#include <netinet/sctp_os.h>
#include <netinet/sctp_var.h>
#include <netinet/sctp_sysctl.h>
#include <netinet/sctp_pcb.h>
#include <netinet/sctp_header.h>
#include <netinet/sctputil.h>
#include <netinet/sctp_output.h>
#include <netinet/sctp_asconf.h>
#include <netinet/sctp_timer.h>
Include dependency graph for sctp_asconf.c:

Go to the source code of this file.

Functions

 __FBSDID ("$FreeBSD$")
 
static struct mbuf * sctp_asconf_success_response (uint32_t id)
 
static struct mbuf * sctp_asconf_error_response (uint32_t id, uint16_t cause, uint8_t *error_tlv, uint16_t tlv_length)
 
static struct mbuf * sctp_process_asconf_add_ip (struct sockaddr *src, struct sctp_asconf_paramhdr *aph, struct sctp_tcb *stcb, int send_hb, int response_required)
 
static int sctp_asconf_del_remote_addrs_except (struct sctp_tcb *stcb, struct sockaddr *src)
 
static struct mbuf * sctp_process_asconf_delete_ip (struct sockaddr *src, struct sctp_asconf_paramhdr *aph, struct sctp_tcb *stcb, int response_required)
 
static struct mbuf * sctp_process_asconf_set_primary (struct sockaddr *src, struct sctp_asconf_paramhdr *aph, struct sctp_tcb *stcb, int response_required)
 
void sctp_handle_asconf (struct mbuf *m, unsigned int offset, struct sockaddr *src, struct sctp_asconf_chunk *cp, struct sctp_tcb *stcb, int first)
 
static uint32_t sctp_asconf_addr_match (struct sctp_asconf_addr *aa, struct sockaddr *sa)
 
static uint32_t sctp_addr_match (struct sctp_paramhdr *ph, struct sockaddr *sa)
 
void sctp_asconf_cleanup (struct sctp_tcb *stcb)
 
static void sctp_asconf_nets_cleanup (struct sctp_tcb *stcb, struct sctp_ifn *ifn)
 
void sctp_assoc_immediate_retrans (struct sctp_tcb *stcb, struct sctp_nets *dstnet)
 
static int sctp_asconf_queue_mgmt (struct sctp_tcb *, struct sctp_ifa *, uint16_t)
 
void sctp_net_immediate_retrans (struct sctp_tcb *stcb, struct sctp_nets *net)
 
static void sctp_path_check_and_react (struct sctp_tcb *stcb, struct sctp_ifa *newifa)
 
static void sctp_asconf_addr_mgmt_ack (struct sctp_tcb *stcb, struct sctp_ifa *addr, uint32_t flag)
 
static int sctp_asconf_queue_add (struct sctp_tcb *stcb, struct sctp_ifa *ifa, uint16_t type)
 
static int sctp_asconf_queue_sa_delete (struct sctp_tcb *stcb, struct sockaddr *sa)
 
static struct sctp_asconf_addrsctp_asconf_find_param (struct sctp_tcb *stcb, uint32_t correlation_id)
 
static void sctp_asconf_process_error (struct sctp_tcb *stcb SCTP_UNUSED, struct sctp_asconf_paramhdr *aph)
 
static void sctp_asconf_process_param_ack (struct sctp_tcb *stcb, struct sctp_asconf_addr *aparam, uint32_t flag)
 
static void sctp_asconf_ack_clear (struct sctp_tcb *stcb SCTP_UNUSED)
 
void sctp_handle_asconf_ack (struct mbuf *m, int offset, struct sctp_asconf_ack_chunk *cp, struct sctp_tcb *stcb, struct sctp_nets *net, int *abort_no_unlock)
 
static void sctp_addr_mgmt_assoc (struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_ifa *ifa, uint16_t type, int addr_locked)
 
int sctp_asconf_iterator_ep (struct sctp_inpcb *inp, void *ptr, uint32_t val SCTP_UNUSED)
 
static int sctp_asconf_iterator_ep_end (struct sctp_inpcb *inp, void *ptr, uint32_t val SCTP_UNUSED)
 
void sctp_asconf_iterator_stcb (struct sctp_inpcb *inp, struct sctp_tcb *stcb, void *ptr, uint32_t val SCTP_UNUSED)
 
void sctp_asconf_iterator_end (void *ptr, uint32_t val SCTP_UNUSED)
 
int32_t sctp_set_primary_ip_address_sa (struct sctp_tcb *stcb, struct sockaddr *sa)
 
int sctp_is_addr_pending (struct sctp_tcb *stcb, struct sctp_ifa *sctp_ifa)
 
static struct sockaddr * sctp_find_valid_localaddr (struct sctp_tcb *stcb, int addr_locked)
 
static struct sockaddr * sctp_find_valid_localaddr_ep (struct sctp_tcb *stcb)
 
struct mbuf * sctp_compose_asconf (struct sctp_tcb *stcb, int *retlen, int addr_locked)
 
static void sctp_process_initack_addresses (struct sctp_tcb *stcb, struct mbuf *m, unsigned int offset, unsigned int length)
 
static uint32_t sctp_addr_in_initack (struct mbuf *m, uint32_t offset, uint32_t length, struct sockaddr *sa)
 
static void sctp_check_address_list_ep (struct sctp_tcb *stcb, struct mbuf *m, int offset, int length, struct sockaddr *init_addr)
 
static void sctp_check_address_list_all (struct sctp_tcb *stcb, struct mbuf *m, int offset, int length, struct sockaddr *init_addr, uint16_t local_scope, uint16_t site_scope, uint16_t ipv4_scope, uint16_t loopback_scope)
 
void sctp_check_address_list (struct sctp_tcb *stcb, struct mbuf *m, int offset, int length, struct sockaddr *init_addr, uint16_t local_scope, uint16_t site_scope, uint16_t ipv4_scope, uint16_t loopback_scope)
 
uint32_t sctp_addr_mgmt_ep_sa (struct sctp_inpcb *inp, struct sockaddr *sa, uint32_t type, uint32_t vrf_id)
 
void sctp_asconf_send_nat_state_update (struct sctp_tcb *stcb, struct sctp_nets *net)
 

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ sctp_addr_in_initack()

static uint32_t sctp_addr_in_initack ( struct mbuf *  m,
uint32_t  offset,
uint32_t  length,
struct sockaddr *  sa 
)
static

◆ sctp_addr_match()

static uint32_t sctp_addr_match ( struct sctp_paramhdr ph,
struct sockaddr *  sa 
)
static

◆ sctp_addr_mgmt_assoc()

◆ sctp_addr_mgmt_ep_sa()

◆ sctp_asconf_ack_clear()

static void sctp_asconf_ack_clear ( struct sctp_tcb *stcb  SCTP_UNUSED)
static

Definition at line 1654 of file sctp_asconf.c.

Referenced by sctp_handle_asconf_ack().

Here is the caller graph for this function:

◆ sctp_asconf_addr_match()

static uint32_t sctp_asconf_addr_match ( struct sctp_asconf_addr aa,
struct sockaddr *  sa 
)
static

◆ sctp_asconf_addr_mgmt_ack()

static void sctp_asconf_addr_mgmt_ack ( struct sctp_tcb stcb,
struct sctp_ifa addr,
uint32_t  flag 
)
static

Definition at line 1178 of file sctp_asconf.c.

References sctp_ifa::ifn_p, sctp_asconf_nets_cleanup(), sctp_del_local_addr_restricted(), sctp_tcb::sctp_ep, sctp_is_mobility_feature_on, SCTP_MOBILITY_BASE, SCTP_MOBILITY_FASTHANDOFF, and sctp_path_check_and_react().

Referenced by sctp_asconf_process_param_ack().

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

◆ sctp_asconf_cleanup()

void sctp_asconf_cleanup ( struct sctp_tcb stcb)

Definition at line 939 of file sctp_asconf.c.

References sctp_association::asconf_seq_out, sctp_association::asconf_seq_out_acked, sctp_tcb::asoc, sctp_tcb::sctp_ep, SCTP_FROM_SCTP_ASCONF, SCTP_LOC_2, sctp_timer_stop(), SCTP_TIMER_TYPE_ASCONF, and sctp_toss_old_asconf().

Referenced by sctp_asconf_timer(), and sctp_process_unrecog_chunk().

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

◆ sctp_asconf_del_remote_addrs_except()

static int sctp_asconf_del_remote_addrs_except ( struct sctp_tcb stcb,
struct sockaddr *  src 
)
static

Definition at line 283 of file sctp_asconf.c.

References sctp_net_route::_l_addr, sctp_tcb::asoc, sctp_association::nets, sctp_nets::ro, SCTP_DEBUG_ASCONF1, sctp_findnet(), SCTP_NOTIFY_ASCONF_DELETE_IP, sctp_remove_net(), SCTP_SO_NOT_LOCKED, sctp_ulp_notify(), SCTPDBG, and SCTPDBG_ADDR.

Referenced by sctp_process_asconf_delete_ip().

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

◆ sctp_asconf_error_response()

static struct mbuf * sctp_asconf_error_response ( uint32_t  id,
uint16_t  cause,
uint8_t error_tlv,
uint16_t  tlv_length 
)
static

◆ sctp_asconf_find_param()

static struct sctp_asconf_addr * sctp_asconf_find_param ( struct sctp_tcb stcb,
uint32_t  correlation_id 
)
static

◆ sctp_asconf_iterator_end()

void sctp_asconf_iterator_end ( void *  ptr,
uint32_t val  SCTP_UNUSED 
)

Definition at line 2263 of file sctp_asconf.c.

References sctp_laddr::action, sctp_ifa::ifa, sctp_laddr::ifa, sctp_asconf_iterator::list_of_work, sctp_ifa::localifa_flags, SCTP_ADD_IP_ADDRESS, SCTP_BASE_INFO, SCTP_DECR_LADDR_COUNT, SCTP_FREE, sctp_free_ifa(), and SCTP_ZONE_FREE.

Referenced by sctp_addr_mgmt_ep_sa(), and sctp_handle_addr_wq().

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

◆ sctp_asconf_iterator_ep()

int sctp_asconf_iterator_ep ( struct sctp_inpcb inp,
void *  ptr,
uint32_t val  SCTP_UNUSED 
)

◆ sctp_asconf_iterator_ep_end()

static int sctp_asconf_iterator_ep_end ( struct sctp_inpcb inp,
void *  ptr,
uint32_t val  SCTP_UNUSED 
)
static

Definition at line 2069 of file sctp_asconf.c.

References sctp_laddr::action, sctp_ifa::ifa, sctp_laddr::ifa, sctp_asconf_iterator::list_of_work, SCTP_ADD_IP_ADDRESS, sctp_inpcb::sctp_addr_list, SCTP_DEL_IP_ADDRESS, and sctp_del_local_addr_ep().

Referenced by sctp_addr_mgmt_ep_sa().

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

◆ sctp_asconf_iterator_stcb()

◆ sctp_asconf_nets_cleanup()

static void sctp_asconf_nets_cleanup ( struct sctp_tcb stcb,
struct sctp_ifn ifn 
)
static

Definition at line 956 of file sctp_asconf.c.

References sctp_net_route::_s_addr, sctp_tcb::asoc, sctp_ifn::ifn_index, sctp_association::nets, sctp_nets::ro, sctp_free_ifa(), SCTP_GET_IF_INDEX_FROM_ROUTE, SCTP_ROUTE_HAS_VALID_IFN, and sctp_nets::src_addr_selected.

Referenced by sctp_asconf_addr_mgmt_ack().

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

◆ sctp_asconf_process_error()

static void sctp_asconf_process_error ( struct sctp_tcb *stcb  SCTP_UNUSED,
struct sctp_asconf_paramhdr aph 
)
static

◆ sctp_asconf_process_param_ack()

static void sctp_asconf_process_param_ack ( struct sctp_tcb stcb,
struct sctp_asconf_addr aparam,
uint32_t  flag 
)
static

◆ sctp_asconf_queue_add()

◆ sctp_asconf_queue_mgmt()

◆ sctp_asconf_queue_sa_delete()

◆ sctp_asconf_send_nat_state_update()

void sctp_asconf_send_nat_state_update ( struct sctp_tcb stcb,
struct sctp_nets net 
)

◆ sctp_asconf_success_response()

static struct mbuf * sctp_asconf_success_response ( uint32_t  id)
static

◆ sctp_assoc_immediate_retrans()

◆ sctp_check_address_list()

void sctp_check_address_list ( struct sctp_tcb stcb,
struct mbuf *  m,
int  offset,
int  length,
struct sockaddr *  init_addr,
uint16_t  local_scope,
uint16_t  site_scope,
uint16_t  ipv4_scope,
uint16_t  loopback_scope 
)

Definition at line 3132 of file sctp_asconf.c.

References sctp_check_address_list_all(), sctp_check_address_list_ep(), sctp_tcb::sctp_ep, sctp_inpcb::sctp_flags, sctp_is_feature_on, SCTP_PCB_FLAGS_BOUNDALL, SCTP_PCB_FLAGS_DO_ASCONF, and sctp_process_initack_addresses().

Referenced by sctp_process_cookie_new().

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

◆ sctp_check_address_list_all()

static void sctp_check_address_list_all ( struct sctp_tcb stcb,
struct mbuf *  m,
int  offset,
int  length,
struct sockaddr *  init_addr,
uint16_t  local_scope,
uint16_t  site_scope,
uint16_t  ipv4_scope,
uint16_t  loopback_scope 
)
static

◆ sctp_check_address_list_ep()

static void sctp_check_address_list_ep ( struct sctp_tcb stcb,
struct mbuf *  m,
int  offset,
int  length,
struct sockaddr *  init_addr 
)
static

Definition at line 3006 of file sctp_asconf.c.

References sctp_ifa::address, sctp_laddr::ifa, sctp_sockstore::sa, SCTP_ADD_IP_ADDRESS, sctp_addr_in_initack(), sctp_inpcb::sctp_addr_list, sctp_addr_mgmt_assoc(), SCTP_ADDR_NOT_LOCKED, sctp_cmpaddr(), SCTP_DEBUG_ASCONF1, sctp_tcb::sctp_ep, and SCTPDBG.

Referenced by sctp_check_address_list().

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

◆ sctp_compose_asconf()

◆ sctp_find_valid_localaddr()

◆ sctp_find_valid_localaddr_ep()

static struct sockaddr * sctp_find_valid_localaddr_ep ( struct sctp_tcb stcb)
static

Definition at line 2529 of file sctp_asconf.c.

References sctp_ifa::address, sctp_laddr::ifa, sctp_sockstore::sa, sctp_inpcb::sctp_addr_list, sctp_tcb::sctp_ep, sctp_is_addr_pending(), and sctp_is_addr_restricted().

Referenced by sctp_compose_asconf().

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

◆ sctp_handle_asconf()

◆ sctp_handle_asconf_ack()

◆ sctp_is_addr_pending()

◆ sctp_net_immediate_retrans()

◆ sctp_path_check_and_react()

◆ sctp_process_asconf_add_ip()

◆ sctp_process_asconf_delete_ip()

◆ sctp_process_asconf_set_primary()

static struct mbuf * sctp_process_asconf_set_primary ( struct sockaddr *  src,
struct sctp_asconf_paramhdr aph,
struct sctp_tcb stcb,
int  response_required 
)
static

◆ sctp_process_initack_addresses()

◆ sctp_set_primary_ip_address_sa()

int32_t sctp_set_primary_ip_address_sa ( struct sctp_tcb stcb,
struct sockaddr *  sa 
)