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

Go to the source code of this file.

Functions

 __FBSDID ("$FreeBSD$")
 
 MALLOC_DEFINE (SCTP_M_MAP, "sctp_map", "sctp asoc map descriptor")
 
 MALLOC_DEFINE (SCTP_M_STRMI, "sctp_stri", "sctp stream in array")
 
 MALLOC_DEFINE (SCTP_M_STRMO, "sctp_stro", "sctp stream out array")
 
 MALLOC_DEFINE (SCTP_M_ASC_ADDR, "sctp_aadr", "sctp asconf address")
 
 MALLOC_DEFINE (SCTP_M_ASC_IT, "sctp_a_it", "sctp asconf iterator")
 
 MALLOC_DEFINE (SCTP_M_AUTH_CL, "sctp_atcl", "sctp auth chunklist")
 
 MALLOC_DEFINE (SCTP_M_AUTH_KY, "sctp_atky", "sctp auth key")
 
 MALLOC_DEFINE (SCTP_M_AUTH_HL, "sctp_athm", "sctp auth hmac list")
 
 MALLOC_DEFINE (SCTP_M_AUTH_IF, "sctp_athi", "sctp auth info")
 
 MALLOC_DEFINE (SCTP_M_STRESET, "sctp_stre", "sctp stream reset")
 
 MALLOC_DEFINE (SCTP_M_CMSG, "sctp_cmsg", "sctp CMSG buffer")
 
 MALLOC_DEFINE (SCTP_M_COPYAL, "sctp_cpal", "sctp copy all")
 
 MALLOC_DEFINE (SCTP_M_VRF, "sctp_vrf", "sctp vrf struct")
 
 MALLOC_DEFINE (SCTP_M_IFA, "sctp_ifa", "sctp ifa struct")
 
 MALLOC_DEFINE (SCTP_M_IFN, "sctp_ifn", "sctp ifn struct")
 
 MALLOC_DEFINE (SCTP_M_TIMW, "sctp_timw", "sctp time block")
 
 MALLOC_DEFINE (SCTP_M_MVRF, "sctp_mvrf", "sctp mvrf pcb list")
 
 MALLOC_DEFINE (SCTP_M_ITER, "sctp_iter", "sctp iterator control")
 
 MALLOC_DEFINE (SCTP_M_SOCKOPT, "sctp_socko", "sctp socket option")
 
 MALLOC_DEFINE (SCTP_M_MCORE, "sctp_mcore", "sctp mcore queue")
 
void sctp_wakeup_iterator (void)
 
static void sctp_iterator_thread (void *v SCTP_UNUSED)
 
void sctp_startup_iterator (void)
 
static uint32_t sctp_is_desired_interface_type (struct ifnet *ifn)
 
static void sctp_init_ifns_for_vrf (int vrfid)
 
void sctp_init_vrf_list (int vrfid)
 
void sctp_addr_change (struct ifaddr *ifa, int cmd)
 
void sctp_addr_change_event_handler (void *arg __unused, struct ifaddr *ifa, int cmd)
 
struct mbuf * sctp_get_mbuf_for_msg (unsigned int space_needed, int want_header, int how, int allonebuf, int type)
 

Variables

struct iterator_control sctp_it_ctl
 

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ MALLOC_DEFINE() [1/20]

MALLOC_DEFINE ( SCTP_M_ASC_ADDR  ,
"sctp_aadr"  ,
"sctp asconf address"   
)

◆ MALLOC_DEFINE() [2/20]

MALLOC_DEFINE ( SCTP_M_ASC_IT  ,
"sctp_a_it"  ,
"sctp asconf iterator"   
)

◆ MALLOC_DEFINE() [3/20]

MALLOC_DEFINE ( SCTP_M_AUTH_CL  ,
"sctp_atcl"  ,
"sctp auth chunklist"   
)

◆ MALLOC_DEFINE() [4/20]

MALLOC_DEFINE ( SCTP_M_AUTH_HL  ,
"sctp_athm"  ,
"sctp auth hmac list"   
)

◆ MALLOC_DEFINE() [5/20]

MALLOC_DEFINE ( SCTP_M_AUTH_IF  ,
"sctp_athi"  ,
"sctp auth info"   
)

◆ MALLOC_DEFINE() [6/20]

MALLOC_DEFINE ( SCTP_M_AUTH_KY  ,
"sctp_atky"  ,
"sctp auth key"   
)

◆ MALLOC_DEFINE() [7/20]

MALLOC_DEFINE ( SCTP_M_CMSG  ,
"sctp_cmsg"  ,
"sctp CMSG buffer"   
)

◆ MALLOC_DEFINE() [8/20]

MALLOC_DEFINE ( SCTP_M_COPYAL  ,
"sctp_cpal"  ,
"sctp copy all"   
)

◆ MALLOC_DEFINE() [9/20]

MALLOC_DEFINE ( SCTP_M_IFA  ,
"sctp_ifa"  ,
"sctp ifa struct"   
)

◆ MALLOC_DEFINE() [10/20]

MALLOC_DEFINE ( SCTP_M_IFN  ,
"sctp_ifn"  ,
"sctp ifn struct"   
)

◆ MALLOC_DEFINE() [11/20]

MALLOC_DEFINE ( SCTP_M_ITER  ,
"sctp_iter"  ,
"sctp iterator control"   
)

◆ MALLOC_DEFINE() [12/20]

MALLOC_DEFINE ( SCTP_M_MAP  ,
"sctp_map"  ,
"sctp asoc map descriptor"   
)

◆ MALLOC_DEFINE() [13/20]

MALLOC_DEFINE ( SCTP_M_MCORE  ,
"sctp_mcore"  ,
"sctp mcore queue"   
)

◆ MALLOC_DEFINE() [14/20]

MALLOC_DEFINE ( SCTP_M_MVRF  ,
"sctp_mvrf"  ,
"sctp mvrf pcb list"   
)

◆ MALLOC_DEFINE() [15/20]

MALLOC_DEFINE ( SCTP_M_SOCKOPT  ,
"sctp_socko"  ,
"sctp socket option"   
)

◆ MALLOC_DEFINE() [16/20]

MALLOC_DEFINE ( SCTP_M_STRESET  ,
"sctp_stre"  ,
"sctp stream reset"   
)

◆ MALLOC_DEFINE() [17/20]

MALLOC_DEFINE ( SCTP_M_STRMI  ,
"sctp_stri"  ,
"sctp stream in array"   
)

◆ MALLOC_DEFINE() [18/20]

MALLOC_DEFINE ( SCTP_M_STRMO  ,
"sctp_stro"  ,
"sctp stream out array"   
)

◆ MALLOC_DEFINE() [19/20]

MALLOC_DEFINE ( SCTP_M_TIMW  ,
"sctp_timw"  ,
"sctp time block"   
)

◆ MALLOC_DEFINE() [20/20]

MALLOC_DEFINE ( SCTP_M_VRF  ,
"sctp_vrf"  ,
"sctp vrf struct"   
)

◆ sctp_addr_change()

void sctp_addr_change ( struct ifaddr *  ifa,
int  cmd 
)

Definition at line 287 of file sctp_bsd_addr.c.

References sctp_add_addr_to_vrf(), SCTP_BASE_VAR, SCTP_DEFAULT_VRFID, sctp_del_addr_from_vrf(), sctp_init_ifns_for_vrf(), and sctp_is_desired_interface_type().

Referenced by sctp_addr_change_event_handler().

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

◆ sctp_addr_change_event_handler()

void sctp_addr_change_event_handler ( void *arg  __unused,
struct ifaddr *  ifa,
int  cmd 
)

Definition at line 355 of file sctp_bsd_addr.c.

References sctp_addr_change().

Referenced by sctp_init().

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

◆ sctp_get_mbuf_for_msg()

struct mbuf * sctp_get_mbuf_for_msg ( unsigned int  space_needed,
int  want_header,
int  how,
int  allonebuf,
int  type 
)

Definition at line 361 of file sctp_bsd_addr.c.

References SCTP_BASE_SYSCTL, SCTP_BUF_NEXT, SCTP_BUF_SIZE, SCTP_MBUF_IALLOC, and SCTP_MBUF_LOGGING_ENABLE.

Referenced by sctp_add_addr_to_mbuf(), sctp_add_auth_chunk(), sctp_add_cookie(), sctp_add_pad_tombuf(), sctp_arethere_unrecognized_parameters(), sctp_asconf_error_response(), sctp_asconf_success_response(), sctp_build_ctl_nchunk(), sctp_compose_asconf(), sctp_copy_mbufchain(), sctp_copy_out_all(), sctp_generate_cause(), sctp_generate_no_user_data_cause(), sctp_handle_asconf(), sctp_handle_auth(), sctp_handle_cookie_echo(), sctp_handle_stream_reset(), sctp_lower_sosend(), sctp_lowlevel_chunk_output(), sctp_move_to_outqueue(), sctp_notify_adaptation_layer(), sctp_notify_assoc_change(), sctp_notify_authentication(), sctp_notify_partial_delivery_indication(), sctp_notify_peer_addr_change(), sctp_notify_remote_error(), sctp_notify_send_failed(), sctp_notify_send_failed2(), sctp_notify_sender_dry_event(), sctp_notify_shutdown_event(), sctp_notify_stream_reset(), sctp_notify_stream_reset_add(), sctp_notify_stream_reset_tsn(), sctp_process_a_data_chunk(), sctp_process_control(), sctp_process_data(), sctp_process_init_ack(), sctp_send_abort_tcb(), sctp_send_cookie_ack(), sctp_send_cwr(), sctp_send_deferred_reset_response(), sctp_send_ecn_echo(), sctp_send_hb(), sctp_send_initiate(), sctp_send_initiate_ack(), sctp_send_packet_dropped(), sctp_send_resp_msg(), sctp_send_sack(), sctp_send_shutdown(), sctp_send_shutdown_ack(), sctp_send_shutdown_complete(), sctp_send_str_reset_req(), sctp_send_stream_reset_out_if_possible(), sctp_sendall_iterator(), and send_forward_tsn().

◆ sctp_init_ifns_for_vrf()

static void sctp_init_ifns_for_vrf ( int  vrfid)
static

Definition at line 189 of file sctp_bsd_addr.c.

References sctp_ifa::localifa_flags, MODULE_GLOBAL, sctp_add_addr_to_vrf(), and sctp_is_desired_interface_type().

Referenced by sctp_addr_change(), and sctp_init_vrf_list().

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

◆ sctp_init_vrf_list()

void sctp_init_vrf_list ( int  vrfid)

Definition at line 270 of file sctp_bsd_addr.c.

References sctp_allocate_vrf(), sctp_init_ifns_for_vrf(), and SCTP_MAX_VRF_ID.

Referenced by sctp_pcb_init().

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

◆ sctp_is_desired_interface_type()

static uint32_t sctp_is_desired_interface_type ( struct ifnet *  ifn)
static

Definition at line 147 of file sctp_bsd_addr.c.

Referenced by sctp_addr_change(), and sctp_init_ifns_for_vrf().

Here is the caller graph for this function:

◆ sctp_iterator_thread()

static void sctp_iterator_thread ( void *v  SCTP_UNUSED)
static

Definition at line 85 of file sctp_bsd_addr.c.

References iterator_control::ipi_iterator_wq_mtx, iterator_control::iterator_running, SCTP_IPI_ITERATOR_WQ_LOCK, sctp_it_ctl, and sctp_iterator_worker().

Referenced by sctp_startup_iterator().

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

◆ sctp_startup_iterator()

void sctp_startup_iterator ( void  )

Definition at line 98 of file sctp_bsd_addr.c.

References iterator_control::iteratorhead, SCTP_IPI_ITERATOR_WQ_INIT, sctp_it_ctl, SCTP_ITERATOR_LOCK_INIT, sctp_iterator_thread(), SCTP_KTHREAD_PAGES, SCTP_KTRHEAD_NAME, and iterator_control::thread_proc.

Referenced by sctp_pcb_init().

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

◆ sctp_wakeup_iterator()

void sctp_wakeup_iterator ( void  )

Definition at line 79 of file sctp_bsd_addr.c.

References iterator_control::iterator_running, and sctp_it_ctl.

Referenced by sctp_initiate_iterator().

Here is the caller graph for this function:

Variable Documentation

◆ sctp_it_ctl