|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
101 u8 next0, next1, is_ethernet0, is_ethernet1, len0, len1,
137 is_ethernet0 = oui0 == IEEE_OUI_ethernet;
138 is_ethernet1 = oui1 == IEEE_OUI_ethernet;
140 len0 =
sizeof (h0[0]) - (is_ethernet0 ?
sizeof (h0->protocol) : 0);
141 len1 =
sizeof (h1[0]) - (is_ethernet1 ?
sizeof (h1->protocol) : 0);
156 b0->
error =
node->errors[SNAP_ERROR_UNKNOWN_PROTOCOL];
157 b1->
error =
node->errors[SNAP_ERROR_UNKNOWN_PROTOCOL];
163 switch (enqueue_code)
204 u8 next0, is_ethernet0, len0;
220 is_ethernet0 = oui0 == IEEE_OUI_ethernet;
222 len0 =
sizeof (h0[0]) - (is_ethernet0 ?
sizeof (h0->protocol) : 0);
233 b0->
error =
node->errors[SNAP_ERROR_UNKNOWN_PROTOCOL];
244 to_next, n_left_to_next);
267 .name =
"snap-input",
269 .vector_size =
sizeof (
u32),
321 h.protocol = clib_host_to_net_u16 (
protocol);
322 h.oui[0] = (ieee_oui >> 16) & 0xff;
323 h.oui[1] = (ieee_oui >> 8) & 0xff;
324 h.oui[2] = (ieee_oui >> 0) & 0xff;
static u32 snap_header_get_oui(snap_header_t *h)
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
static uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
nat44_ei_hairpin_src_next_t next_index
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
void vlib_trace_frame_buffers_only(vlib_main_t *vm, vlib_node_runtime_t *node, u32 *buffers, uword n_buffers, uword next_buffer_stride, uword n_buffer_data_bytes_in_trace)
vlib_main_t vlib_node_runtime_t * node
#define vlib_call_init_function(vm, x)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static clib_error_t * snap_init(vlib_main_t *vm)
vlib_main_t vlib_node_runtime_t vlib_frame_t * from_frame
#define clib_error_report(e)
static void snap_setup_node(vlib_main_t *vm, u32 node_index)
#define CLIB_PREFETCH(addr, size, type)
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
vlib_error_t error
Error code for buffers to be enqueued to error handler.
#define vec_add2(V, P, N)
Add N elements to end of vector V, return pointer to new elements in P.
format_function_t format_snap_header
void snap_register_input_protocol(vlib_main_t *vm, char *name, u32 ieee_oui, u16 protocol, u32 node_index)
#define VLIB_NODE_FLAG_TRACE
static char * snap_error_strings[]
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
unformat_function_t unformat_snap_header
#define hash_set_mem(h, key, value)
uword * protocol_info_by_name
struct _vlib_node_registration vlib_node_registration_t
static uword snap_input(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
vlib_node_registration_t snap_input_node
(constructor) VLIB_REGISTER_NODE (snap_input_node)
static u8 * format_snap_input_trace(u8 *s, va_list *va)
description fragment has unexpected format
vlib_put_next_frame(vm, node, next_index, 0)
static void vlib_set_next_frame_buffer(vlib_main_t *vm, vlib_node_runtime_t *node, u32 next_index, u32 buffer_index)
#define VLIB_INIT_FUNCTION(x)
vl_api_ip_proto_t protocol
static clib_error_t * snap_input_init(vlib_main_t *vm)
#define foreach_snap_error
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
format_function_t format_snap_header_with_length
@ SNAP_INPUT_NEXT_ETHERNET_TYPE
static snap_protocol_info_t * snap_get_protocol_info(snap_main_t *sm, snap_header_t *h)
void llc_register_input_protocol(vlib_main_t *vm, llc_protocol_t protocol, u32 node_index)
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Get pointer to next frame vector data by (vlib_node_runtime_t, next_index).
snap_protocol_info_t * protocols
static uword mhash_set(mhash_t *h, void *key, uword new_value, uword *old_value)
VLIB buffer representation.
#define VLIB_REGISTER_NODE(x,...)