FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
l2_input_node.c File Reference

Interface Input Mode (Layer 2 Cross-Connect or Bridge / Layer 3). More...

+ Include dependency graph for l2_input_node.c:

Go to the source code of this file.

Data Structures

struct  l2input_trace_t
 

Macros

#define foreach_l2input_error
 
#define get_u16(addr)   ( *((u16 *)(addr)) )
 

Enumerations

enum  l2input_error_t { L2INPUT_N_ERROR }
 
enum  l2input_next_t { L2INPUT_NEXT_LEARN, L2INPUT_NEXT_FWD, L2INPUT_NEXT_DROP, L2INPUT_N_NEXT }
 

Functions

static u8format_l2input_trace (u8 *s, va_list *args)
 
static_always_inline void classify_and_dispatch (l2input_main_t *msm, vlib_buffer_t *b0, u16 *next0)
 
static_always_inline uword l2input_node_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int do_trace)
 
VLIB_NODE_FN() l2input_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 

Variables

l2input_main_t l2input_main
 
static char * l2input_error_strings []
 
vlib_node_registration_t l2input_node
 (constructor) VLIB_REGISTER_NODE (l2input_node) More...
 

Detailed Description

Interface Input Mode (Layer 2 Cross-Connect or Bridge / Layer 3).

This file contains the CLI Commands that modify the input mode of an interface. For interfaces in a Layer 2 cross-connect, all packets received on one interface will be transmitted to the other. For interfaces in a bridge-domain, packets will be forwarded to other interfaces in the same bridge-domain based on destination mac address. For interfaces in Layer 3 mode, the packets will be routed.

Definition in file l2_input_node.c.

Macro Definition Documentation

◆ foreach_l2input_error

#define foreach_l2input_error
Value:
_(L2INPUT, "L2 input packets") \
_(DROP, "L2 input drops")

Definition at line 81 of file l2_input_node.c.

◆ get_u16

#define get_u16 (   addr)    ( *((u16 *)(addr)) )

Enumeration Type Documentation

◆ l2input_error_t

Enumerator
L2INPUT_N_ERROR 

Definition at line 85 of file l2_input_node.c.

◆ l2input_next_t

Enumerator
L2INPUT_NEXT_LEARN 
L2INPUT_NEXT_FWD 
L2INPUT_NEXT_DROP 
L2INPUT_N_NEXT 

Definition at line 99 of file l2_input_node.c.

Function Documentation

◆ classify_and_dispatch()

static_always_inline void classify_and_dispatch ( l2input_main_t msm,
vlib_buffer_t b0,
u16 next0 
)

Definition at line 108 of file l2_input_node.c.

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

◆ format_l2input_trace()

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

Definition at line 61 of file l2_input_node.c.

+ Here is the call graph for this function:

◆ l2input_node()

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

Definition at line 361 of file l2_input_node.c.

+ Here is the call graph for this function:

◆ l2input_node_inline()

static_always_inline uword l2input_node_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
int  do_trace 
)

Definition at line 233 of file l2_input_node.c.

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

Variable Documentation

◆ l2input_error_strings

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

Definition at line 93 of file l2_input_node.c.

◆ l2input_main

l2input_main_t l2input_main

Definition at line 78 of file l2_input_node.c.

◆ l2input_node

Initial value:
= {
.name = "l2-input",
.vector_size = sizeof (u32),
.format_trace = format_l2input_trace,
.error_strings = l2input_error_strings,
.n_next_nodes = L2INPUT_N_NEXT,
.next_nodes = {
[L2INPUT_NEXT_LEARN] = "l2-learn",
[L2INPUT_NEXT_FWD] = "l2-fwd",
[L2INPUT_NEXT_DROP] = "error-drop",
},
}

(constructor) VLIB_REGISTER_NODE (l2input_node)

Definition at line 370 of file l2_input_node.c.

L2INPUT_NEXT_DROP
@ L2INPUT_NEXT_DROP
Definition: l2_input_node.c:103
DROP
DROP
Definition: error.def:41
VLIB_NODE_TYPE_INTERNAL
@ VLIB_NODE_TYPE_INTERNAL
Definition: node.h:72
L2INPUT_NEXT_LEARN
@ L2INPUT_NEXT_LEARN
Definition: l2_input_node.c:101
ARRAY_LEN
#define ARRAY_LEN(x)
Definition: clib.h:70
L2INPUT_NEXT_FWD
@ L2INPUT_NEXT_FWD
Definition: l2_input_node.c:102
l2input_error_strings
static char * l2input_error_strings[]
Definition: l2_input_node.c:93
u32
unsigned int u32
Definition: types.h:88
format_ethernet_header_with_length
u8 * format_ethernet_header_with_length(u8 *s, va_list *args)
Definition: format.c:97
foreach_l2input_error
#define foreach_l2input_error
Definition: l2_input_node.c:81
format_l2input_trace
static u8 * format_l2input_trace(u8 *s, va_list *args)
Definition: l2_input_node.c:61
type
vl_api_fib_path_type_t type
Definition: fib_types.api:123
L2INPUT_N_NEXT
@ L2INPUT_N_NEXT
Definition: l2_input_node.c:104