FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
l2_patch.c File Reference
+ Include dependency graph for l2_patch.c:

Go to the source code of this file.

Data Structures

struct  l2_patch_main_t
 
struct  l2_patch_trace_t
 

Macros

#define foreach_l2_patch_error
 

Enumerations

enum  l2_patch_error_t { L2_PATCH_N_ERROR }
 
enum  l2_patch_next_t { L2_PATCH_NEXT_DROP, L2_PATCH_N_NEXT }
 

Functions

static u8format_l2_patch_trace (u8 *s, va_list *args)
 
static_always_inline void l2_patch_trace (vlib_main_t *vm, vlib_node_runtime_t *node, l2_patch_main_t *l2pm, vlib_buffer_t *b, u32 sw_if_index)
 
static_always_inline void l2_patch_inline (vlib_main_t *vm, vlib_node_runtime_t *node, l2_patch_main_t *l2pm, vlib_buffer_t **b, u16 *next, u32 n_left, int do_trace)
 
VLIB_NODE_FN() l2_patch_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
int vnet_l2_patch_add_del (u32 rx_sw_if_index, u32 tx_sw_if_index, int is_add)
 
static clib_error_ttest_patch_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tshow_l2patch (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 Display the contents of the l2patch table. More...
 
static clib_error_tl2_patch_init (vlib_main_t *vm)
 

Variables

l2_patch_main_t l2_patch_main
 
vlib_node_registration_t l2_patch_node
 (constructor) VLIB_REGISTER_NODE (l2_patch_node) More...
 
static char * l2_patch_error_strings []
 
static vlib_cli_command_t test_patch_command
 (constructor) VLIB_CLI_COMMAND (test_patch_command) More...
 
static vlib_cli_command_t show_l2patch_cli
 (constructor) VLIB_CLI_COMMAND (show_l2patch_cli) More...
 

Macro Definition Documentation

◆ foreach_l2_patch_error

#define foreach_l2_patch_error
Value:
_(PATCHED, "L2 patch packets") \
_(DROPPED, "L2 patch misconfigured drops")

Definition at line 59 of file l2_patch.c.

Enumeration Type Documentation

◆ l2_patch_error_t

Enumerator
L2_PATCH_N_ERROR 

Definition at line 63 of file l2_patch.c.

◆ l2_patch_next_t

Enumerator
L2_PATCH_NEXT_DROP 
L2_PATCH_N_NEXT 

Definition at line 77 of file l2_patch.c.

Function Documentation

◆ format_l2_patch_trace()

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

Definition at line 40 of file l2_patch.c.

◆ l2_patch_init()

static clib_error_t* l2_patch_init ( vlib_main_t vm)
static

Definition at line 433 of file l2_patch.c.

+ Here is the call graph for this function:

◆ l2_patch_inline()

static_always_inline void l2_patch_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
l2_patch_main_t l2pm,
vlib_buffer_t **  b,
u16 next,
u32  n_left,
int  do_trace 
)

Definition at line 98 of file l2_patch.c.

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

◆ l2_patch_node()

VLIB_NODE_FN() l2_patch_node ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)

Definition at line 180 of file l2_patch.c.

+ Here is the call graph for this function:

◆ l2_patch_trace()

static_always_inline void l2_patch_trace ( vlib_main_t vm,
vlib_node_runtime_t node,
l2_patch_main_t l2pm,
vlib_buffer_t b,
u32  sw_if_index 
)

Definition at line 84 of file l2_patch.c.

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

◆ show_l2patch()

static clib_error_t* show_l2patch ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Display the contents of the l2patch table.

Definition at line 382 of file l2_patch.c.

+ Here is the call graph for this function:

◆ test_patch_command_fn()

static clib_error_t* test_patch_command_fn ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 293 of file l2_patch.c.

+ Here is the call graph for this function:

◆ vnet_l2_patch_add_del()

int vnet_l2_patch_add_del ( u32  rx_sw_if_index,
u32  tx_sw_if_index,
int  is_add 
)

Definition at line 232 of file l2_patch.c.

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

Variable Documentation

◆ l2_patch_error_strings

char* l2_patch_error_strings[]
static
Initial value:
= {
#define _(sym,string)
}

Definition at line 71 of file l2_patch.c.

◆ l2_patch_main

l2_patch_main_t l2_patch_main

Definition at line 52 of file l2_patch.c.

◆ l2_patch_node

vlib_node_registration_t l2_patch_node
Initial value:
= {
.name = "l2-patch",
.vector_size = sizeof (u32),
.format_trace = format_l2_patch_trace,
.error_strings = l2_patch_error_strings,
.n_next_nodes = L2_PATCH_N_NEXT,
.next_nodes = {
[L2_PATCH_NEXT_DROP] = "error-drop",
},
}

(constructor) VLIB_REGISTER_NODE (l2_patch_node)

Definition at line 210 of file l2_patch.c.

◆ show_l2patch_cli

vlib_cli_command_t show_l2patch_cli
static
Initial value:
= {
.path = "show l2patch",
.short_help = "Show l2 interface cross-connect entries",
.function = show_l2patch,
}

(constructor) VLIB_CLI_COMMAND (show_l2patch_cli)

Definition at line 425 of file l2_patch.c.

◆ test_patch_command

vlib_cli_command_t test_patch_command
static
Initial value:
= {
.path = "test l2patch",
.short_help = "test l2patch rx <intfc> tx <intfc> [del]",
.function = test_patch_command_fn,
}

(constructor) VLIB_CLI_COMMAND (test_patch_command)

Definition at line 373 of file l2_patch.c.

show_l2patch
static clib_error_t * show_l2patch(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Display the contents of the l2patch table.
Definition: l2_patch.c:382
VLIB_NODE_TYPE_INTERNAL
@ VLIB_NODE_TYPE_INTERNAL
Definition: node.h:72
L2_PATCH_NEXT_DROP
@ L2_PATCH_NEXT_DROP
Definition: l2_patch.c:79
l2_patch_error_strings
static char * l2_patch_error_strings[]
Definition: l2_patch.c:71
test_patch_command_fn
static clib_error_t * test_patch_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: l2_patch.c:293
ARRAY_LEN
#define ARRAY_LEN(x)
Definition: clib.h:70
foreach_l2_patch_error
#define foreach_l2_patch_error
Definition: l2_patch.c:59
format_l2_patch_trace
static u8 * format_l2_patch_trace(u8 *s, va_list *args)
Definition: l2_patch.c:40
u32
unsigned int u32
Definition: types.h:88
L2_PATCH_N_NEXT
@ L2_PATCH_N_NEXT
Definition: l2_patch.c:80
type
vl_api_fib_path_type_t type
Definition: fib_types.api:123