FD.io VPP  v17.07.01-10-g3be13f0
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

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 347 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 59 of file node.c.

Function Documentation

u8* format_srp_device ( u8 s,
va_list *  args 
)

Definition at line 544 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 48 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 527 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 514 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 463 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 493 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 478 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 508 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 577 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 837 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 698 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 641 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 352 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 556 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 918 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 106 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 798 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 893 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 710 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 294 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 600 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 666 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:48
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:352

Definition at line 447 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 266 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 72 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:48
static char * srp_error_strings[]
Definition: node.c:266
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:106

Definition at line 272 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:893

Definition at line 911 of file node.c.