38 uword n_left_from, n_left_to_next, next_index;
42 n_left_from = frame->n_vectors;
45 while (n_left_from > 0)
53 while (n_left_from > 0 && n_left_to_next > 0)
72 options = (
u8 *) (ip4 + 1);
77 switch (options[0] & 0x7f)
83 if (IP_PROTOCOL_IGMP == ip4->
protocol)
92 if (b->
flags & VLIB_BUFFER_IS_TRACED)
100 n_left_to_next, bi, next);
106 return frame->n_vectors;
117 s =
format (s,
"%Uoption:[0x%x,0x%x,0x%x,0x%x]",
125 .name =
"ip4-options",
126 .vector_size =
sizeof (
u32),
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
#define IP4_ROUTER_ALERT_OPTION
#define clib_memcpy_fast(a, b, c)
enum ip4_options_next_t_ ip4_options_next_t
Handle IPv4 header options in the data-path.
#define VLIB_NODE_FN(node)
ip4_options_next_t_
Handle IPv4 header options in the data-path.
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
Finish enqueueing one buffer forward in the graph.
#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).
#define VLIB_REGISTER_NODE(x,...)
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
Release pointer to next frame vector data.
vlib_node_registration_t ip4_options_node
(constructor) VLIB_REGISTER_NODE (ip4_options_node)
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
VLIB buffer representation.
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
struct ip4_options_trace_t_ ip4_options_trace_t
u8 * format_ip4_options_trace(u8 *s, va_list *args)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.