FD.io VPP  v19.08.3-2-gbabecb413
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 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 356 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 61 of file node.c.

Function Documentation

◆ format_srp_device()

u8* format_srp_device ( u8 s,
va_list *  args 
)

Definition at line 553 of file node.c.

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

◆ format_srp_input_trace()

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:

◆ format_srp_interface()

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

Definition at line 536 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 523 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 472 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 502 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 487 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 517 of file node.c.

+ Here is the call graph for this function:
+ 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 586 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 783 of file node.c.

+ Here is the call graph for this function:

◆ requests_switch()

static int requests_switch ( srp_ips_request_type_t  r)
static

Definition at line 655 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 361 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 565 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 864 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 108 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 750 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 839 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 667 of file node.c.

+ Here is the call 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 296 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 609 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,
}
static u8 * format_srp_input_trace(u8 *s, va_list *va)
Definition: node.c:50
unsigned int u32
Definition: types.h:88
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
static uword srp_control_input(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition: node.c:361

Definition at line 456 of file node.c.

◆ srp_error_strings

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_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 74 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,
}
static u8 * format_srp_input_trace(u8 *s, va_list *va)
Definition: node.c:50
unsigned int u32
Definition: types.h:88
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
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.

◆ 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,
}
static uword srp_ips_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
Definition: node.c:839

Definition at line 857 of file node.c.

◆ srp_main

srp_main_t srp_main

Definition at line 44 of file node.c.