FD.io VPP  v21.10.1-2-g0a485f517
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 uword() srp_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 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 void srp_setup_node (vlib_main_t *vm, u32 node_index)
 
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

◆ srp_control_handler_function_t

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

Definition at line 357 of file node.c.

Enumeration Type Documentation

◆ srp_input_next_t

Enumerator
SRP_INPUT_NEXT_ERROR 
SRP_INPUT_NEXT_ETHERNET_INPUT 
SRP_INPUT_NEXT_CONTROL 
SRP_INPUT_N_NEXT 

Definition at line 62 of file node.c.

Function Documentation

◆ format_srp_device()

u8* format_srp_device ( u8 s,
va_list *  args 
)

Definition at line 554 of file node.c.

+ Here is the call graph for this function:

◆ format_srp_input_trace()

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

Definition at line 51 of file node.c.

+ Here is the call graph for this function:

◆ format_srp_interface()

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

Definition at line 537 of file node.c.

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

◆ format_srp_ips_header()

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

Definition at line 524 of file node.c.

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

◆ format_srp_ips_request_type()

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

Definition at line 473 of file node.c.

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

◆ format_srp_ips_state()

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

Definition at line 503 of file node.c.

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

◆ format_srp_ips_status()

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

Definition at line 488 of file node.c.

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

◆ format_srp_ring()

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

Definition at line 518 of file node.c.

+ Here is the caller graph for this function:

◆ init_ips_packet()

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

Definition at line 587 of file node.c.

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

◆ maybe_send_ips_message()

static void maybe_send_ips_message ( srp_interface_t si)
static

Definition at line 784 of file node.c.

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

◆ requests_switch()

static int requests_switch ( srp_ips_request_type_t  r)
static

Definition at line 656 of file node.c.

+ Here is the caller graph for this function:

◆ srp_control_input()

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

Definition at line 362 of file node.c.

+ Here is the call graph for this function:

◆ srp_get_interface()

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

Definition at line 566 of file node.c.

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

◆ srp_init()

static clib_error_t* srp_init ( vlib_main_t vm)
static

Definition at line 875 of file node.c.

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

◆ srp_input()

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

Definition at line 109 of file node.c.

+ Here is the call graph for this function:

◆ srp_ips_local_request()

void srp_ips_local_request ( u32  sw_if_index,
srp_ips_request_type_t  request 
)

Definition at line 751 of file node.c.

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

◆ srp_ips_process()

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

Definition at line 840 of file node.c.

+ Here is the call graph for this function:

◆ srp_ips_rx_packet()

void srp_ips_rx_packet ( u32  sw_if_index,
srp_ips_header_t h 
)

Definition at line 668 of file node.c.

+ Here is the call graph for this function:

◆ srp_setup_node()

static void srp_setup_node ( vlib_main_t vm,
u32  node_index 
)
static

Definition at line 866 of file node.c.

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

◆ srp_topology_packet()

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

Definition at line 297 of file node.c.

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

◆ tx_ips_packet()

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

Definition at line 610 of file node.c.

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

Variable Documentation

◆ srp_control_input_node

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,
}

Definition at line 457 of file node.c.

◆ srp_error_strings

char* srp_error_strings[]
static
Initial value:
= {
#define _(f,s)
}

Definition at line 269 of file node.c.

◆ srp_input_disposition_by_mode

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

◆ srp_input_node

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,
}

Definition at line 275 of file node.c.

◆ srp_ips_process_node

vlib_node_registration_t srp_ips_process_node
Initial value:
= {
.function = srp_ips_process,
.name = "srp-ips-process",
.state = VLIB_NODE_STATE_DISABLED,
}

Definition at line 858 of file node.c.

◆ srp_main

srp_main_t srp_main

Definition at line 45 of file node.c.

format_srp_input_trace
static u8 * format_srp_input_trace(u8 *s, va_list *va)
Definition: node.c:51
SRP_INPUT_NEXT_ERROR
@ SRP_INPUT_NEXT_ERROR
Definition: node.c:63
srp_header_t
Definition: packet.h:66
srp_error_strings
static char * srp_error_strings[]
Definition: node.c:269
SRP_INPUT_N_NEXT
@ SRP_INPUT_N_NEXT
Definition: node.c:66
SRP_N_ERROR
@ SRP_N_ERROR
Definition: srp.h:206
format_srp_header_with_length
u8 * format_srp_header_with_length(u8 *s, va_list *args)
Definition: format.c:63
foreach_srp_error
#define foreach_srp_error
Definition: srp.h:191
SRP_INPUT_NEXT_CONTROL
@ SRP_INPUT_NEXT_CONTROL
Definition: node.c:65
srp_ips_process
static uword srp_ips_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
Definition: node.c:840
SRP_INPUT_NEXT_ETHERNET_INPUT
@ SRP_INPUT_NEXT_ETHERNET_INPUT
Definition: node.c:64
u32
unsigned int u32
Definition: types.h:88
VLIB_NODE_TYPE_PROCESS
@ VLIB_NODE_TYPE_PROCESS
Definition: node.h:84
srp_control_input
static uword srp_control_input(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition: node.c:362
srp_input
static uword srp_input(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition: node.c:109
unformat_srp_header
uword unformat_srp_header(unformat_input_t *input, va_list *args)
Definition: format.c:111