FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
mpcap_node.c File Reference
+ Include dependency graph for mpcap_node.c:

Go to the source code of this file.

Data Structures

struct  mpcap_trace_t
 

Macros

#define foreach_mpcap_error   _(PROCESSED, "Mapped pcap packets processed")
 

Enumerations

enum  mpcap_error_t { MPCAP_N_ERROR }
 
enum  mpcap_next_t { MPCAP_NEXT_DROP, MPCAP_N_NEXT }
 

Functions

static u8format_mpcap_trace (u8 *s, va_list *args)
 
static uword mpcap_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int is_ip4, int is_trace)
 
VLIB_NODE_FN() mpcap_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static clib_error_tmpcap_node_init (vlib_main_t *vm)
 

Variables

static mpcap_main_t test_mpcap_main
 
vlib_node_registration_t mpcap_node
 (constructor) VLIB_REGISTER_NODE (mpcap_node) More...
 
static char * mpcap_error_strings []
 

Macro Definition Documentation

◆ foreach_mpcap_error

#define foreach_mpcap_error   _(PROCESSED, "Mapped pcap packets processed")

Definition at line 55 of file mpcap_node.c.

Enumeration Type Documentation

◆ mpcap_error_t

Enumerator
MPCAP_N_ERROR 

Definition at line 58 of file mpcap_node.c.

◆ mpcap_next_t

Enumerator
MPCAP_NEXT_DROP 
MPCAP_N_NEXT 

Definition at line 74 of file mpcap_node.c.

Function Documentation

◆ format_mpcap_trace()

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

Definition at line 40 of file mpcap_node.c.

◆ mpcap_inline()

static uword mpcap_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
int  is_ip4,
int  is_trace 
)
inlinestatic

Definition at line 81 of file mpcap_node.c.

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

◆ mpcap_node()

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

Definition at line 207 of file mpcap_node.c.

+ Here is the call graph for this function:

◆ mpcap_node_init()

static clib_error_t* mpcap_node_init ( vlib_main_t vm)
static

Definition at line 243 of file mpcap_node.c.

+ Here is the call graph for this function:

Variable Documentation

◆ mpcap_error_strings

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

Definition at line 67 of file mpcap_node.c.

◆ mpcap_node

Initial value:
=
{
.name = "mpcap-unittest",
.vector_size = sizeof (u32),
.format_trace = format_mpcap_trace,
.unformat_buffer = unformat_ethernet_header,
.error_strings = mpcap_error_strings,
.n_next_nodes = MPCAP_N_NEXT,
.next_nodes =
{
[MPCAP_NEXT_DROP] = "error-drop",
},
}

(constructor) VLIB_REGISTER_NODE (mpcap_node)

Definition at line 51 of file mpcap_node.c.

◆ test_mpcap_main

mpcap_main_t test_mpcap_main
static
Initial value:
= {
.file_name = "/tmp/mpcap_unittest.pcap",
.n_packets_to_capture = 15,
.packet_type = MPCAP_PACKET_TYPE_ethernet,
}

Definition at line 24 of file mpcap_node.c.

MPCAP_N_NEXT
@ MPCAP_N_NEXT
Definition: mpcap_node.c:77
mpcap_error_strings
static char * mpcap_error_strings[]
Definition: mpcap_node.c:67
VLIB_NODE_TYPE_INTERNAL
@ VLIB_NODE_TYPE_INTERNAL
Definition: node.h:72
ARRAY_LEN
#define ARRAY_LEN(x)
Definition: clib.h:70
foreach_mpcap_error
#define foreach_mpcap_error
Definition: mpcap_node.c:55
unformat_ethernet_header
uword unformat_ethernet_header(unformat_input_t *input, va_list *args)
Definition: format.c:290
MPCAP_NEXT_DROP
@ MPCAP_NEXT_DROP
Definition: mpcap_node.c:76
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
type
vl_api_fib_path_type_t type
Definition: fib_types.api:123
format_mpcap_trace
static u8 * format_mpcap_trace(u8 *s, va_list *args)
Definition: mpcap_node.c:40