FD.io VPP  v18.01.2-1-g9b554f3
Vector Packet Processing
node.c File Reference
+ Include dependency graph for node.c:

Go to the source code of this file.

Data Structures

struct  srp_input_trace_t
 
struct  srp_input_disposition_t
 

Typedefs

typedef uwordsrp_control_handler_function_t) (vlib_main_t *vm, u32 sw_if_index, u8 **contents)
 

Enumerations

enum  srp_input_next_t { SRP_INPUT_NEXT_ERROR, SRP_INPUT_NEXT_ETHERNET_INPUT, SRP_INPUT_NEXT_CONTROL, SRP_INPUT_N_NEXT }
 

Functions

static u8format_srp_input_trace (u8 *s, va_list *va)
 
static uword srp_input (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
static uword srp_topology_packet (vlib_main_t *vm, u32 sw_if_index, u8 **contents)
 
static uword srp_control_input (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
static u8format_srp_ips_request_type (u8 *s, va_list *args)
 
static u8format_srp_ips_status (u8 *s, va_list *args)
 
static u8format_srp_ips_state (u8 *s, va_list *args)
 
static u8format_srp_ring (u8 *s, va_list *args)
 
static u8format_srp_ips_header (u8 *s, va_list *args)
 
static u8format_srp_interface (u8 *s, va_list *args)
 
u8format_srp_device (u8 *s, va_list *args)
 
static srp_interface_tsrp_get_interface (u32 sw_if_index, srp_ring_type_t *ring)
 
static void init_ips_packet (srp_interface_t *si, srp_ring_type_t tx_ring, srp_ips_header_t *i)
 
static void tx_ips_packet (srp_interface_t *si, srp_ring_type_t tx_ring, srp_ips_header_t *i)
 
static void serialize_srp_interface_state_msg (serialize_main_t *m, va_list *va)
 
static void unserialize_srp_interface_state_msg (serialize_main_t *m, va_list *va)
 
 MC_SERIALIZE_MSG (srp_interface_state_msg, static)
 
static int requests_switch (srp_ips_request_type_t r)
 
void srp_ips_rx_packet (u32 sw_if_index, srp_ips_header_t *h)
 
void srp_ips_local_request (u32 sw_if_index, srp_ips_request_type_t request)
 
static void maybe_send_ips_message (srp_interface_t *si)
 
static uword srp_ips_process (vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
 
static clib_error_tsrp_init (vlib_main_t *vm)
 

Variables

srp_main_t srp_main
 
static srp_input_disposition_t srp_input_disposition_by_mode [8]
 
static char * srp_error_strings []
 
static vlib_node_registration_t srp_input_node
 
static vlib_node_registration_t srp_control_input_node
 
vlib_node_registration_t srp_ips_process_node
 

Typedef Documentation

typedef uword( srp_control_handler_function_t) (vlib_main_t *vm, u32 sw_if_index, u8 **contents)

Definition at line 349 of file node.c.

Enumeration Type Documentation

Enumerator
SRP_INPUT_NEXT_ERROR 
SRP_INPUT_NEXT_ETHERNET_INPUT 
SRP_INPUT_NEXT_CONTROL 
SRP_INPUT_N_NEXT 

Definition at line 61 of file node.c.

Function Documentation

u8* format_srp_device ( u8 s,
va_list *  args 
)

Definition at line 546 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8* format_srp_input_trace ( u8 s,
va_list *  va 
)
static

Definition at line 50 of file node.c.

+ Here is the call graph for this function:

static u8* format_srp_interface ( u8 s,
va_list *  args 
)
static

Definition at line 529 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8* format_srp_ips_header ( u8 s,
va_list *  args 
)
static

Definition at line 516 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8* format_srp_ips_request_type ( u8 s,
va_list *  args 
)
static

Definition at line 465 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8* format_srp_ips_state ( u8 s,
va_list *  args 
)
static

Definition at line 495 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8* format_srp_ips_status ( u8 s,
va_list *  args 
)
static

Definition at line 480 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8* format_srp_ring ( u8 s,
va_list *  args 
)
static

Definition at line 510 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void init_ips_packet ( srp_interface_t si,
srp_ring_type_t  tx_ring,
srp_ips_header_t i 
)
static

Definition at line 579 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void maybe_send_ips_message ( srp_interface_t si)
static

Definition at line 839 of file node.c.

+ Here is the call graph for this function:

MC_SERIALIZE_MSG ( srp_interface_state_msg  ,
static   
)

+ Here is the caller graph for this function:

static int requests_switch ( srp_ips_request_type_t  r)
static

Definition at line 700 of file node.c.

+ Here is the caller graph for this function:

static void serialize_srp_interface_state_msg ( serialize_main_t m,
va_list *  va 
)
static

Definition at line 643 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 354 of file node.c.

+ Here is the call graph for this function:

static srp_interface_t* srp_get_interface ( u32  sw_if_index,
srp_ring_type_t ring 
)
inlinestatic

Definition at line 558 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* srp_init ( vlib_main_t vm)
static

Definition at line 920 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 108 of file node.c.

+ Here is the call graph for this function:

void srp_ips_local_request ( u32  sw_if_index,
srp_ips_request_type_t  request 
)

Definition at line 800 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword srp_ips_process ( vlib_main_t vm,
vlib_node_runtime_t rt,
vlib_frame_t f 
)
static

Definition at line 895 of file node.c.

+ Here is the call graph for this function:

void srp_ips_rx_packet ( u32  sw_if_index,
srp_ips_header_t h 
)

Definition at line 712 of file node.c.

+ Here is the call graph for this function:

static uword srp_topology_packet ( vlib_main_t vm,
u32  sw_if_index,
u8 **  contents 
)
static

Definition at line 296 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void tx_ips_packet ( srp_interface_t si,
srp_ring_type_t  tx_ring,
srp_ips_header_t i 
)
static

Definition at line 602 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void unserialize_srp_interface_state_msg ( serialize_main_t m,
va_list *  va 
)
static

Definition at line 668 of file node.c.

+ Here is the call graph for this function:

Variable Documentation

vlib_node_registration_t srp_control_input_node
static
Initial value:
= {
.function = srp_control_input,
.name = "srp-control",
.vector_size = sizeof (u32),
.n_next_nodes = 1,
.next_nodes = {
[0] = "error-drop",
},
.format_trace = format_srp_input_trace,
.unformat_buffer = unformat_srp_header,
}
static u8 * format_srp_input_trace(u8 *s, va_list *va)
Definition: node.c:50
uword unformat_srp_header(unformat_input_t *input, va_list *args)
Definition: format.c:111
u8 * format_srp_header_with_length(u8 *s, va_list *args)
Definition: format.c:63
unsigned int u32
Definition: types.h:88
static uword srp_control_input(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition: node.c:354

Definition at line 449 of file node.c.

char* srp_error_strings[]
static
Initial value:
= {
#define _(f,s)
}
#define foreach_srp_error
Definition: srp.h:202

Definition at line 268 of file node.c.

srp_input_disposition_t srp_input_disposition_by_mode[8]
static
Initial value:
= {
[SRP_MODE_reserved0] = {
.next_index = SRP_INPUT_NEXT_ERROR,
.error = SRP_ERROR_UNKNOWN_MODE,
},
[SRP_MODE_reserved1] = {
.next_index = SRP_INPUT_NEXT_ERROR,
.error = SRP_ERROR_UNKNOWN_MODE,
},
[SRP_MODE_reserved2] = {
.next_index = SRP_INPUT_NEXT_ERROR,
.error = SRP_ERROR_UNKNOWN_MODE,
},
[SRP_MODE_reserved3] = {
.next_index = SRP_INPUT_NEXT_ERROR,
.error = SRP_ERROR_UNKNOWN_MODE,
},
[SRP_MODE_keep_alive] = {
.next_index = SRP_INPUT_NEXT_ERROR,
.error = SRP_ERROR_KEEP_ALIVE_DROPPED,
},
[SRP_MODE_data] = {
.buffer_advance = sizeof (srp_header_t),
},
[SRP_MODE_control_pass_to_host] = {
.next_index = SRP_INPUT_NEXT_CONTROL,
},
[SRP_MODE_control_locally_buffered_for_host] = {
.next_index = SRP_INPUT_NEXT_CONTROL,
},
}

Definition at line 74 of file node.c.

vlib_node_registration_t srp_input_node
static
Initial value:
= {
.function = srp_input,
.name = "srp-input",
.vector_size = sizeof (u32),
.n_errors = SRP_N_ERROR,
.error_strings = srp_error_strings,
.n_next_nodes = SRP_INPUT_N_NEXT,
.next_nodes = {
[SRP_INPUT_NEXT_ERROR] = "error-drop",
[SRP_INPUT_NEXT_ETHERNET_INPUT] = "ethernet-input",
[SRP_INPUT_NEXT_CONTROL] = "srp-control",
},
.format_trace = format_srp_input_trace,
.unformat_buffer = unformat_srp_header,
}
static u8 * format_srp_input_trace(u8 *s, va_list *va)
Definition: node.c:50
static char * srp_error_strings[]
Definition: node.c:268
uword unformat_srp_header(unformat_input_t *input, va_list *args)
Definition: format.c:111
u8 * format_srp_header_with_length(u8 *s, va_list *args)
Definition: format.c:63
unsigned int u32
Definition: types.h:88
static uword srp_input(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition: node.c:108

Definition at line 274 of file node.c.

vlib_node_registration_t srp_ips_process_node
Initial value:
= {
.function = srp_ips_process,
.name = "srp-ips-process",
.state = VLIB_NODE_STATE_DISABLED,
}
static uword srp_ips_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
Definition: node.c:895

Definition at line 913 of file node.c.

srp_main_t srp_main

Definition at line 44 of file node.c.