FD.io VPP  v21.01.1
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.

+ Here is the caller graph for this function:

◆ 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)
}
#define foreach_mpcap_error
Definition: mpcap_node.c:55

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",
},
}
static u8 * format_mpcap_trace(u8 *s, va_list *args)
Definition: mpcap_node.c:40
unsigned int u32
Definition: types.h:88
vl_api_fib_path_type_t type
Definition: fib_types.api:123
u8 * format_ethernet_header_with_length(u8 *s, va_list *args)
Definition: format.c:97
#define ARRAY_LEN(x)
Definition: clib.h:67
static char * mpcap_error_strings[]
Definition: mpcap_node.c:67
uword unformat_ethernet_header(unformat_input_t *input, va_list *args)
Definition: format.c:290

(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.