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  nsim_trace_t
 

Macros

#define foreach_nsim_error
 

Enumerations

enum  nsim_error_t { NSIM_N_ERROR }
 
enum  nsim_next_t { NSIM_NEXT_DROP, NSIM_N_NEXT, NSIM_NEXT_DROP, NSIM_N_NEXT }
 

Functions

static u8format_nsim_trace (u8 *s, va_list *args)
 
static void nsim_set_actions (nsim_main_t *nsm, vlib_buffer_t **b, nsim_node_ctx_t *ctx, u32 n_actions)
 
static void nsim_trace_buffer (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_buffer_t *b, nsim_node_ctx_t *ctx, u32 is_drop)
 
static void nsim_buffer_fwd_lookup (nsim_main_t *nsm, vlib_buffer_t *b, u32 *next, u8 is_cross_connect)
 
static void nsim_dispatch_buffer (vlib_main_t *vm, vlib_node_runtime_t *node, nsim_main_t *nsm, nsim_wheel_t *wp, vlib_buffer_t *b, u32 bi, nsim_node_ctx_t *ctx, u8 is_cross_connect, u8 is_trace)
 
static uword nsim_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int is_trace, int is_cross_connect)
 
VLIB_NODE_FN() nsim_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
VLIB_NODE_FN() nsim_feature_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 

Variables

vlib_node_registration_t nsim_node
 (constructor) VLIB_REGISTER_NODE (nsim_node) More...
 
static char * nsim_error_strings []
 
vlib_node_registration_t nsim_feature_node
 (constructor) VLIB_REGISTER_NODE (nsim_feature_node) More...
 

Macro Definition Documentation

◆ foreach_nsim_error

#define foreach_nsim_error
Value:
_(BUFFERED, "Packets buffered") \
_(DROPPED, "Packets dropped due to lack of space") \
_(LOSS, "Network loss simulation drop packets") \
_(REORDERED, "Packets reordered")

Definition at line 53 of file node.c.

Enumeration Type Documentation

◆ nsim_error_t

Enumerator
NSIM_N_ERROR 

Definition at line 59 of file node.c.

◆ nsim_next_t

Enumerator
NSIM_NEXT_DROP 
NSIM_N_NEXT 
NSIM_NEXT_DROP 
NSIM_N_NEXT 

Definition at line 75 of file node.c.

Function Documentation

◆ format_nsim_trace()

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

Definition at line 34 of file node.c.

◆ nsim_buffer_fwd_lookup()

static void nsim_buffer_fwd_lookup ( nsim_main_t nsm,
vlib_buffer_t b,
u32 next,
u8  is_cross_connect 
)
inlinestatic

Definition at line 119 of file node.c.

+ Here is the caller graph for this function:

◆ nsim_dispatch_buffer()

static void nsim_dispatch_buffer ( vlib_main_t vm,
vlib_node_runtime_t node,
nsim_main_t nsm,
nsim_wheel_t wp,
vlib_buffer_t b,
u32  bi,
nsim_node_ctx_t ctx,
u8  is_cross_connect,
u8  is_trace 
)
inlinestatic

Definition at line 139 of file node.c.

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

◆ nsim_feature_node()

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

Definition at line 324 of file node.c.

+ Here is the call graph for this function:

◆ nsim_inline()

static uword nsim_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
int  is_trace,
int  is_cross_connect 
)
inlinestatic

Definition at line 188 of file node.c.

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

◆ nsim_node()

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

Definition at line 291 of file node.c.

+ Here is the call graph for this function:

◆ nsim_set_actions()

static void nsim_set_actions ( nsim_main_t nsm,
vlib_buffer_t **  b,
nsim_node_ctx_t ctx,
u32  n_actions 
)
static

Definition at line 82 of file node.c.

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

◆ nsim_trace_buffer()

static void nsim_trace_buffer ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_buffer_t b,
nsim_node_ctx_t ctx,
u32  is_drop 
)
static

Definition at line 105 of file node.c.

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

Variable Documentation

◆ nsim_error_strings

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

Definition at line 68 of file node.c.

◆ nsim_feature_node

vlib_node_registration_t nsim_feature_node
Initial value:
=
{
.name = "nsim-output-feature",
.vector_size = sizeof (u32),
.format_trace = format_nsim_trace,
.error_strings = nsim_error_strings,
.n_next_nodes = NSIM_N_NEXT,
.next_nodes = {
[NSIM_NEXT_DROP] = "error-drop",
},
}

(constructor) VLIB_REGISTER_NODE (nsim_feature_node)

Definition at line 338 of file node.c.

◆ nsim_node

Initial value:
=
{
.name = "nsim",
.vector_size = sizeof (u32),
.format_trace = format_nsim_trace,
.error_strings = nsim_error_strings,
.n_next_nodes = NSIM_N_NEXT,
.next_nodes = {
[NSIM_NEXT_DROP] = "error-drop",
},
}

(constructor) VLIB_REGISTER_NODE (nsim_node)

Definition at line 50 of file node.c.

VLIB_NODE_TYPE_INTERNAL
@ VLIB_NODE_TYPE_INTERNAL
Definition: node.h:72
format_nsim_trace
static u8 * format_nsim_trace(u8 *s, va_list *args)
Definition: node.c:34
nsim_error_strings
static char * nsim_error_strings[]
Definition: node.c:68
ARRAY_LEN
#define ARRAY_LEN(x)
Definition: clib.h:70
NSIM_N_NEXT
@ NSIM_N_NEXT
Definition: node.c:78
foreach_nsim_error
#define foreach_nsim_error
Definition: node.c:53
u32
unsigned int u32
Definition: types.h:88
NSIM_NEXT_DROP
@ NSIM_NEXT_DROP
Definition: node.c:77
type
vl_api_fib_path_type_t type
Definition: fib_types.api:123