FD.io VPP  v18.07-34-g55fbdb9
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

#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.

#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.

#define sctp_error (   n,
 
)    s,

Typedef Documentation

typedef enum _sctp_output_next sctp_output_next_t

Function Documentation

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:

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:

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 1591 of file sctp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 1869 of file sctp_output.c.

+ Here is the call graph for this function:

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

Definition at line 1876 of file sctp_output.c.

+ Here is the call graph for this function:

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:

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:

void sctp_data_retransmit ( sctp_connection_t sctp_conn)

Definition at line 1515 of file sctp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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:

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:

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:

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:

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:

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:

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:

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:

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:

static u8 sctp_is_retransmitting ( sctp_connection_t sctp_conn,
u8  idx 
)
inlinestatic

Definition at line 1585 of file sctp_output.c.

+ Here is the caller graph for this function:

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:

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:

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:

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 1463 of file sctp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

u32 sctp_push_header ( transport_connection_t trans_conn,
vlib_buffer_t b 
)

Definition at line 1441 of file sctp_output.c.

+ Here is the call graph for this function:

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:

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:

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:

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:

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:

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:

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:

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 ( sctp4_output_node  ,
sctp4_output   
)
VLIB_NODE_FUNCTION_MULTIARCH ( sctp6_output_node  ,
sctp6_output   
)

Variable Documentation

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:107
static uword sctp4_output(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition: sctp_output.c:1869

(constructor) VLIB_REGISTER_NODE (sctp4_output_node)

Definition at line 20 of file sctp_output.c.

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:1876
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:107
#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.

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

Definition at line 38 of file sctp_output.c.