|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
26 .n_packets_to_capture = 15,
27 .packet_type = MPCAP_PACKET_TYPE_ethernet,
36 #ifndef CLIB_MARCH_VARIANT
46 s =
format (s,
"MPCAP: sw_if_index %d, next index %d\n",
55 #define foreach_mpcap_error \
56 _(PROCESSED, "Mapped pcap packets processed")
60 #define _(sym,str) MPCAP_ERROR_##sym,
66 #ifndef CLIB_MARCH_VARIANT
68 #define _(sym,string) string,
83 int is_ip4,
int is_trace)
91 u32 error_index =
node->errors[MPCAP_ERROR_PROCESSED];
130 b[0]->
error = error_index;
131 b[1]->
error = error_index;
132 b[2]->
error = error_index;
133 b[3]->
error = error_index;
149 if (
b[0]->
flags & VLIB_BUFFER_IS_TRACED)
155 if (
b[1]->
flags & VLIB_BUFFER_IS_TRACED)
161 if (
b[2]->
flags & VLIB_BUFFER_IS_TRACED)
167 if (
b[3]->
flags & VLIB_BUFFER_IS_TRACED)
185 b[0]->
error = error_index;
189 if (
b[0]->
flags & VLIB_BUFFER_IS_TRACED)
204 return frame->n_vectors;
219 #ifndef CLIB_MARCH_VARIANT
222 .name =
"mpcap-unittest",
223 .vector_size =
sizeof (
u32),
vlib_buffer_t * bufs[VLIB_FRAME_SIZE]
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
vlib_node_registration_t mpcap_node
(constructor) VLIB_REGISTER_NODE (mpcap_node)
__clib_export clib_error_t * mpcap_init(mpcap_main_t *pm)
Initialize a mapped pcap file.
static char * mpcap_error_strings[]
vlib_get_buffers(vm, from, b, n_left_from)
@ VLIB_NODE_TYPE_INTERNAL
vlib_main_t vlib_node_runtime_t * node
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
vlib_buffer_enqueue_to_next(vm, node, from,(u16 *) nexts, frame->n_vectors)
#define clib_error_report(e)
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
vlib_error_t error
Error code for buffers to be enqueued to error handler.
#define VLIB_NODE_FN(node)
static mpcap_main_t test_mpcap_main
#define VLIB_NODE_FLAG_TRACE
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
static void mpcap_add_buffer(mpcap_main_t *pm, vlib_main_t *vm, f64 time_now, u32 buffer_index, u32 n_bytes_in_trace)
Add buffer (vlib_buffer_t) to the trace.
struct _vlib_node_registration vlib_node_registration_t
#define foreach_mpcap_error
uword unformat_ethernet_header(unformat_input_t *input, va_list *args)
description fragment has unexpected format
#define VLIB_INIT_FUNCTION(x)
u8 * format_ethernet_header_with_length(u8 *s, va_list *args)
MPCAP main state data structure.
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static uword mpcap_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int is_ip4, int is_trace)
#define MPCAP_FLAG_INIT_DONE
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
static clib_error_t * mpcap_node_init(vlib_main_t *vm)
u16 nexts[VLIB_FRAME_SIZE]
static f64 vlib_time_now(vlib_main_t *vm)
static_always_inline void clib_prefetch_store(void *p)
void ethernet_setup_node(vlib_main_t *vm, u32 node_index)
vl_api_fib_path_type_t type
static u8 * format_mpcap_trace(u8 *s, va_list *args)
VLIB buffer representation.
#define VLIB_REGISTER_NODE(x,...)
char * file_name
File name of mpcap output.
vl_api_wireguard_peer_flags_t flags