FD.io VPP  v19.01.3-6-g70449b9b9
Vector Packet Processing
sctp_output.c File Reference
+ Include dependency graph for sctp_output.c:

Go to the source code of this file.

Data Structures

struct  sctp_tx_trace_t
 

Macros

#define foreach_sctp4_output_next
 
#define foreach_sctp6_output_next
 
#define sctp_error(n, s)   s,
 

Typedefs

typedef enum _sctp_output_next sctp_output_next_t
 

Functions

void sctp_flush_frame_to_output (vlib_main_t *vm, u8 thread_index, u8 is_ip4)
 Flush tx frame populated by retransmits and timer pops. More...
 
static void sctp_flush_frame_to_ip_lookup (vlib_main_t *vm, u8 thread_index, u8 is_ip4)
 Flush ip lookup tx frames populated by timer pops. More...
 
void sctp_flush_frames_to_output (u8 thread_index)
 Flush v4 and v6 sctp and ip-lookup tx frames for thread index. More...
 
u32 ip4_sctp_compute_checksum (vlib_main_t *vm, vlib_buffer_t *p0, ip4_header_t *ip0)
 
u32 ip6_sctp_compute_checksum (vlib_main_t *vm, vlib_buffer_t *p0, ip6_header_t *ip0, int *bogus_lengthp)
 
void sctp_push_ip_hdr (sctp_main_t *tm, sctp_sub_connection_t *sctp_sub_conn, vlib_buffer_t *b)
 
static void * sctp_reuse_buffer (vlib_main_t *vm, vlib_buffer_t *b)
 
static void * sctp_init_buffer (vlib_main_t *vm, vlib_buffer_t *b)
 
static int sctp_alloc_tx_buffers (sctp_main_t *tm, u8 thread_index, u32 n_free_buffers)
 
static int sctp_get_free_buffer_index (sctp_main_t *tm, u32 *bidx)
 
static void sctp_enqueue_to_output_i (vlib_main_t *vm, vlib_buffer_t *b, u32 bi, u8 is_ip4, u8 flush)
 
static void sctp_enqueue_to_output_now (vlib_main_t *vm, vlib_buffer_t *b, u32 bi, u8 is_ip4)
 
static void sctp_enqueue_to_ip_lookup_i (vlib_main_t *vm, vlib_buffer_t *b, u32 bi, u8 is_ip4, u32 fib_index, u8 flush)
 
static void sctp_enqueue_to_ip_lookup (vlib_main_t *vm, vlib_buffer_t *b, u32 bi, u8 is_ip4, u32 fib_index)
 
void sctp_prepare_init_chunk (sctp_connection_t *sctp_conn, u8 idx, vlib_buffer_t *b)
 Convert buffer to INIT. More...
 
void sctp_compute_mac (sctp_connection_t *sctp_conn, sctp_state_cookie_param_t *state_cookie)
 
void sctp_prepare_cookie_ack_chunk (sctp_connection_t *sctp_conn, u8 idx, vlib_buffer_t *b)
 
void sctp_prepare_cookie_echo_chunk (sctp_connection_t *sctp_conn, u8 idx, vlib_buffer_t *b, u8 reuse_buffer)
 
void sctp_send_cookie_echo (sctp_connection_t *sctp_conn)
 
void sctp_prepare_operation_error (sctp_connection_t *sctp_conn, u8 idx, vlib_buffer_t *b, u8 err_cause)
 Convert buffer to ERROR. More...
 
void sctp_prepare_abort_for_collision (sctp_connection_t *sctp_conn, u8 idx, vlib_buffer_t *b, ip4_address_t *ip4_addr, ip6_address_t *ip6_addr)
 Convert buffer to ABORT. More...
 
void sctp_prepare_initack_chunk_for_collision (sctp_connection_t *sctp_conn, u8 idx, vlib_buffer_t *b, ip4_address_t *ip4_addr, ip6_address_t *ip6_addr)
 Convert buffer to INIT-ACK. More...
 
void sctp_prepare_initack_chunk (sctp_connection_t *sctp_conn, u8 idx, vlib_buffer_t *b, ip4_address_t *ip4_addr, u8 add_ip4, ip6_address_t *ip6_addr, u8 add_ip6)
 Convert buffer to INIT-ACK. More...
 
void sctp_prepare_shutdown_chunk (sctp_connection_t *sctp_conn, u8 idx, vlib_buffer_t *b)
 Convert buffer to SHUTDOWN. More...
 
void sctp_send_shutdown (sctp_connection_t *sctp_conn)
 
void sctp_prepare_shutdown_ack_chunk (sctp_connection_t *sctp_conn, u8 idx, vlib_buffer_t *b)
 Convert buffer to SHUTDOWN_ACK. More...
 
void sctp_send_shutdown_ack (sctp_connection_t *sctp_conn, u8 idx, vlib_buffer_t *b)
 
void sctp_prepare_sack_chunk (sctp_connection_t *sctp_conn, u8 idx, vlib_buffer_t *b)
 Convert buffer to SACK. More...
 
void sctp_prepare_heartbeat_ack_chunk (sctp_connection_t *sctp_conn, u8 idx, vlib_buffer_t *b)
 Convert buffer to HEARTBEAT_ACK. More...
 
void sctp_prepare_heartbeat_chunk (sctp_connection_t *sctp_conn, u8 idx, vlib_buffer_t *b)
 Convert buffer to HEARTBEAT. More...
 
void sctp_send_heartbeat (sctp_connection_t *sctp_conn)
 
void sctp_prepare_shutdown_complete_chunk (sctp_connection_t *sctp_conn, u8 idx, vlib_buffer_t *b)
 Convert buffer to SHUTDOWN_COMPLETE. More...
 
void sctp_send_shutdown_complete (sctp_connection_t *sctp_conn, u8 idx, vlib_buffer_t *b0)
 
void sctp_send_init (sctp_connection_t *sctp_conn)
 
static void sctp_push_hdr_i (sctp_connection_t *sctp_conn, vlib_buffer_t *b, sctp_state_t next_state)
 Push SCTP header and update connection variables. More...
 
u32 sctp_push_header (transport_connection_t *trans_conn, vlib_buffer_t *b)
 
u32 sctp_prepare_data_retransmit (sctp_connection_t *sctp_conn, u8 idx, u32 offset, u32 max_deq_bytes, vlib_buffer_t **b)
 
void sctp_data_retransmit (sctp_connection_t *sctp_conn)
 
static u8 sctp_is_retransmitting (sctp_connection_t *sctp_conn, u8 idx)
 
static uword sctp46_output_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame, int is_ip4)
 
static uword sctp4_output (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
static uword sctp6_output (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
 VLIB_NODE_FUNCTION_MULTIARCH (sctp4_output_node, sctp4_output)
 
 VLIB_NODE_FUNCTION_MULTIARCH (sctp6_output_node, sctp6_output)
 

Variables

vlib_node_registration_t sctp4_output_node
 (constructor) VLIB_REGISTER_NODE (sctp4_output_node) More...
 
vlib_node_registration_t sctp6_output_node
 (constructor) VLIB_REGISTER_NODE (sctp6_output_node) More...
 
static char * sctp_error_strings []
 

Macro Definition Documentation

◆ foreach_sctp4_output_next

#define foreach_sctp4_output_next
Value:
_ (DROP, "error-drop") \
_ (IP_LOOKUP, "ip4-lookup")
DROP
Definition: error.def:41

Definition at line 30 of file sctp_output.c.

◆ foreach_sctp6_output_next

#define foreach_sctp6_output_next
Value:
_ (DROP, "error-drop") \
_ (IP_LOOKUP, "ip6-lookup")
DROP
Definition: error.def:41

Definition at line 34 of file sctp_output.c.

◆ sctp_error

#define sctp_error (   n,
 
)    s,

Typedef Documentation

◆ sctp_output_next_t

typedef enum _sctp_output_next sctp_output_next_t

Function Documentation

◆ ip4_sctp_compute_checksum()

u32 ip4_sctp_compute_checksum ( vlib_main_t vm,
vlib_buffer_t p0,
ip4_header_t ip0 
)

Definition at line 97 of file sctp_output.c.

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

◆ ip6_sctp_compute_checksum()

u32 ip6_sctp_compute_checksum ( vlib_main_t vm,
vlib_buffer_t p0,
ip6_header_t ip0,
int *  bogus_lengthp 
)

Definition at line 154 of file sctp_output.c.

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

◆ sctp46_output_inline()

static uword sctp46_output_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame,
int  is_ip4 
)
inlinestatic

Definition at line 1597 of file sctp_output.c.

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

◆ sctp4_output()

static uword sctp4_output ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)
static

Definition at line 1875 of file sctp_output.c.

+ Here is the call graph for this function:

◆ sctp6_output()

static uword sctp6_output ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)
static

Definition at line 1882 of file sctp_output.c.

+ Here is the call graph for this function:

◆ sctp_alloc_tx_buffers()

static int sctp_alloc_tx_buffers ( sctp_main_t tm,
u8  thread_index,
u32  n_free_buffers 
)
inlinestatic

Definition at line 285 of file sctp_output.c.

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

◆ sctp_compute_mac()

void sctp_compute_mac ( sctp_connection_t sctp_conn,
sctp_state_cookie_param_t state_cookie 
)

Definition at line 499 of file sctp_output.c.

+ Here is the caller graph for this function:

◆ sctp_data_retransmit()

void sctp_data_retransmit ( sctp_connection_t sctp_conn)

Definition at line 1521 of file sctp_output.c.

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

◆ sctp_enqueue_to_ip_lookup()

static void sctp_enqueue_to_ip_lookup ( vlib_main_t vm,
vlib_buffer_t b,
u32  bi,
u8  is_ip4,
u32  fib_index 
)
inlinestatic

Definition at line 405 of file sctp_output.c.

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

◆ sctp_enqueue_to_ip_lookup_i()

static void sctp_enqueue_to_ip_lookup_i ( vlib_main_t vm,
vlib_buffer_t b,
u32  bi,
u8  is_ip4,
u32  fib_index,
u8  flush 
)
inlinestatic

Definition at line 364 of file sctp_output.c.

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

◆ sctp_enqueue_to_output_i()

static void sctp_enqueue_to_output_i ( vlib_main_t vm,
vlib_buffer_t b,
u32  bi,
u8  is_ip4,
u8  flush 
)
inlinestatic

Definition at line 323 of file sctp_output.c.

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

◆ sctp_enqueue_to_output_now()

static void sctp_enqueue_to_output_now ( vlib_main_t vm,
vlib_buffer_t b,
u32  bi,
u8  is_ip4 
)
inlinestatic

Definition at line 357 of file sctp_output.c.

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

◆ sctp_flush_frame_to_ip_lookup()

static void sctp_flush_frame_to_ip_lookup ( vlib_main_t vm,
u8  thread_index,
u8  is_ip4 
)
inlinestatic

Flush ip lookup tx frames populated by timer pops.

Definition at line 70 of file sctp_output.c.

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

◆ sctp_flush_frame_to_output()

void sctp_flush_frame_to_output ( vlib_main_t vm,
u8  thread_index,
u8  is_ip4 
)

Flush tx frame populated by retransmits and timer pops.

Definition at line 54 of file sctp_output.c.

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

◆ sctp_flush_frames_to_output()

void sctp_flush_frames_to_output ( u8  thread_index)

Flush v4 and v6 sctp and ip-lookup tx frames for thread index.

Definition at line 87 of file sctp_output.c.

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

◆ sctp_get_free_buffer_index()

static int sctp_get_free_buffer_index ( sctp_main_t tm,
u32 bidx 
)
inlinestatic

Definition at line 307 of file sctp_output.c.

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

◆ sctp_init_buffer()

static void* sctp_init_buffer ( vlib_main_t vm,
vlib_buffer_t b 
)
inlinestatic

Definition at line 271 of file sctp_output.c.

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

◆ sctp_is_retransmitting()

static u8 sctp_is_retransmitting ( sctp_connection_t sctp_conn,
u8  idx 
)
inlinestatic

Definition at line 1591 of file sctp_output.c.

+ Here is the caller graph for this function:

◆ sctp_prepare_abort_for_collision()

void sctp_prepare_abort_for_collision ( sctp_connection_t sctp_conn,
u8  idx,
vlib_buffer_t b,
ip4_address_t ip4_addr,
ip6_address_t ip6_addr 
)

Convert buffer to ABORT.

Definition at line 690 of file sctp_output.c.

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

◆ sctp_prepare_cookie_ack_chunk()

void sctp_prepare_cookie_ack_chunk ( sctp_connection_t sctp_conn,
u8  idx,
vlib_buffer_t b 
)

Definition at line 528 of file sctp_output.c.

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

◆ sctp_prepare_cookie_echo_chunk()

void sctp_prepare_cookie_echo_chunk ( sctp_connection_t sctp_conn,
u8  idx,
vlib_buffer_t b,
u8  reuse_buffer 
)

Definition at line 562 of file sctp_output.c.

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

◆ sctp_prepare_data_retransmit()

u32 sctp_prepare_data_retransmit ( sctp_connection_t sctp_conn,
u8  idx,
u32  offset,
u32  max_deq_bytes,
vlib_buffer_t **  b 
)

Definition at line 1469 of file sctp_output.c.

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

◆ sctp_prepare_heartbeat_ack_chunk()

void sctp_prepare_heartbeat_ack_chunk ( sctp_connection_t sctp_conn,
u8  idx,
vlib_buffer_t b 
)

Convert buffer to HEARTBEAT_ACK.

Definition at line 1163 of file sctp_output.c.

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

◆ sctp_prepare_heartbeat_chunk()

void sctp_prepare_heartbeat_chunk ( sctp_connection_t sctp_conn,
u8  idx,
vlib_buffer_t b 
)

Convert buffer to HEARTBEAT.

Definition at line 1202 of file sctp_output.c.

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

◆ sctp_prepare_init_chunk()

void sctp_prepare_init_chunk ( sctp_connection_t sctp_conn,
u8  idx,
vlib_buffer_t b 
)

Convert buffer to INIT.

Definition at line 417 of file sctp_output.c.

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

◆ sctp_prepare_initack_chunk()

void sctp_prepare_initack_chunk ( sctp_connection_t sctp_conn,
u8  idx,
vlib_buffer_t b,
ip4_address_t ip4_addr,
u8  add_ip4,
ip6_address_t ip6_addr,
u8  add_ip6 
)

Convert buffer to INIT-ACK.

Definition at line 871 of file sctp_output.c.

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

◆ sctp_prepare_initack_chunk_for_collision()

void sctp_prepare_initack_chunk_for_collision ( sctp_connection_t sctp_conn,
u8  idx,
vlib_buffer_t b,
ip4_address_t ip4_addr,
ip6_address_t ip6_addr 
)

Convert buffer to INIT-ACK.

Definition at line 731 of file sctp_output.c.

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

◆ sctp_prepare_operation_error()

void sctp_prepare_operation_error ( sctp_connection_t sctp_conn,
u8  idx,
vlib_buffer_t b,
u8  err_cause 
)

Convert buffer to ERROR.

Definition at line 645 of file sctp_output.c.

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

◆ sctp_prepare_sack_chunk()

void sctp_prepare_sack_chunk ( sctp_connection_t sctp_conn,
u8  idx,
vlib_buffer_t b 
)

Convert buffer to SACK.

Definition at line 1125 of file sctp_output.c.

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

◆ sctp_prepare_shutdown_ack_chunk()

void sctp_prepare_shutdown_ack_chunk ( sctp_connection_t sctp_conn,
u8  idx,
vlib_buffer_t b 
)

Convert buffer to SHUTDOWN_ACK.

Definition at line 1077 of file sctp_output.c.

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

◆ sctp_prepare_shutdown_chunk()

void sctp_prepare_shutdown_chunk ( sctp_connection_t sctp_conn,
u8  idx,
vlib_buffer_t b 
)

Convert buffer to SHUTDOWN.

Definition at line 1014 of file sctp_output.c.

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

◆ sctp_prepare_shutdown_complete_chunk()

void sctp_prepare_shutdown_complete_chunk ( sctp_connection_t sctp_conn,
u8  idx,
vlib_buffer_t b 
)

Convert buffer to SHUTDOWN_COMPLETE.

Definition at line 1271 of file sctp_output.c.

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

◆ sctp_push_hdr_i()

static void sctp_push_hdr_i ( sctp_connection_t sctp_conn,
vlib_buffer_t b,
sctp_state_t  next_state 
)
static

Push SCTP header and update connection variables.

Definition at line 1365 of file sctp_output.c.

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

◆ sctp_push_header()

u32 sctp_push_header ( transport_connection_t trans_conn,
vlib_buffer_t b 
)

Definition at line 1447 of file sctp_output.c.

+ Here is the call graph for this function:

◆ sctp_push_ip_hdr()

void sctp_push_ip_hdr ( sctp_main_t tm,
sctp_sub_connection_t sctp_sub_conn,
vlib_buffer_t b 
)

Definition at line 228 of file sctp_output.c.

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

◆ sctp_reuse_buffer()

static void* sctp_reuse_buffer ( vlib_main_t vm,
vlib_buffer_t b 
)
inlinestatic

Definition at line 254 of file sctp_output.c.

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

◆ sctp_send_cookie_echo()

void sctp_send_cookie_echo ( sctp_connection_t sctp_conn)

Definition at line 600 of file sctp_output.c.

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

◆ sctp_send_heartbeat()

void sctp_send_heartbeat ( sctp_connection_t sctp_conn)

Definition at line 1234 of file sctp_output.c.

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

◆ sctp_send_init()

void sctp_send_init ( sctp_connection_t sctp_conn)

Definition at line 1316 of file sctp_output.c.

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

◆ sctp_send_shutdown()

void sctp_send_shutdown ( sctp_connection_t sctp_conn)

Definition at line 1050 of file sctp_output.c.

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

◆ sctp_send_shutdown_ack()

void sctp_send_shutdown_ack ( sctp_connection_t sctp_conn,
u8  idx,
vlib_buffer_t b 
)

Definition at line 1108 of file sctp_output.c.

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

◆ sctp_send_shutdown_complete()

void sctp_send_shutdown_complete ( sctp_connection_t sctp_conn,
u8  idx,
vlib_buffer_t b0 
)

Definition at line 1299 of file sctp_output.c.

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

◆ VLIB_NODE_FUNCTION_MULTIARCH() [1/2]

VLIB_NODE_FUNCTION_MULTIARCH ( sctp4_output_node  ,
sctp4_output   
)

◆ VLIB_NODE_FUNCTION_MULTIARCH() [2/2]

VLIB_NODE_FUNCTION_MULTIARCH ( sctp6_output_node  ,
sctp6_output   
)

Variable Documentation

◆ sctp4_output_node

vlib_node_registration_t sctp4_output_node
Initial value:
=
{
.function = sctp4_output,.name = "sctp4-output",
.vector_size = sizeof (u32),
.n_errors = SCTP_N_ERROR,
.error_strings = sctp_error_strings,
.n_next_nodes = SCTP_OUTPUT_N_NEXT,
.next_nodes = {
#define _(s,n)
},
.format_buffer = format_sctp_header,
.format_trace = format_sctp_tx_trace,
}
static char * sctp_error_strings[]
Definition: sctp_output.c:38
#define foreach_sctp4_output_next
Definition: sctp_output.c:30
unsigned int u32
Definition: types.h:88
u8 * format_sctp_tx_trace(u8 *s, va_list *args)
Definition: sctp_format.c:26
format_function_t format_sctp_header
Definition: format.h:101
static uword sctp4_output(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition: sctp_output.c:1875

(constructor) VLIB_REGISTER_NODE (sctp4_output_node)

Definition at line 20 of file sctp_output.c.

◆ sctp6_output_node

vlib_node_registration_t sctp6_output_node
Initial value:
=
{
.function = sctp6_output,
.name = "sctp6-output",
.vector_size = sizeof (u32),
.n_errors = SCTP_N_ERROR,
.error_strings = sctp_error_strings,
.n_next_nodes = SCTP_OUTPUT_N_NEXT,
.next_nodes = {
#define _(s,n)
},
.format_buffer = format_sctp_header,
.format_trace = format_sctp_tx_trace,
}
static char * sctp_error_strings[]
Definition: sctp_output.c:38
static uword sctp6_output(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition: sctp_output.c:1882
unsigned int u32
Definition: types.h:88
u8 * format_sctp_tx_trace(u8 *s, va_list *args)
Definition: sctp_format.c:26
format_function_t format_sctp_header
Definition: format.h:101
#define foreach_sctp6_output_next
Definition: sctp_output.c:34

(constructor) VLIB_REGISTER_NODE (sctp6_output_node)

Definition at line 21 of file sctp_output.c.

◆ sctp_error_strings

char* sctp_error_strings[]
static
Initial value:
= {
#define sctp_error(n,s)
}

Definition at line 38 of file sctp_output.c.