45 #define foreach_ppp_input_next \ 46 _ (PUNT, "error-punt") \ 47 _ (DROP, "error-drop") 50 #define _(s,n) PPP_INPUT_NEXT_##s, 85 u32 n_left_from, next_index, i_next, * from, * to_next;
100 while (n_left_from > 0)
105 to_next, n_left_to_next);
107 while (n_left_from >= 4 && n_left_to_next >= 2)
112 u32 i0, i1, protocol0, protocol1, enqueue_code;
157 enqueue_code = (i0 != i_next) + 2*(i1 != i_next);
161 switch (enqueue_code)
196 while (n_left_from > 0 && n_left_to_next > 0)
232 to_next, n_left_to_next);
246 #define ppp_error(n,s) s, 255 .vector_size =
sizeof (
u32),
264 #define _(s,n) [PPP_INPUT_NEXT_##s] = n, #define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
sll srl srl sll sra u16x4 i
unformat_function_t unformat_ppp_header
always_inline ppp_protocol_info_t * ppp_get_protocol_info(ppp_main_t *em, ppp_protocol_t protocol)
vlib_node_registration_t ppp_input_node
(constructor) VLIB_REGISTER_NODE (ppp_input_node)
#define foreach_ppp_input_next
#define clib_error_report(e)
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
#define VLIB_INIT_FUNCTION(x)
#define sparse_vec_validate(v, i)
format_function_t format_ppp_header
#define vlib_call_init_function(vm, x)
always_inline void * vlib_frame_vector_args(vlib_frame_t *f)
void ppp_register_input_protocol(vlib_main_t *vm, ppp_protocol_t protocol, u32 node_index)
u16 current_length
Nbytes between current data and the end of this buffer.
always_inline void * sparse_vec_new(uword elt_bytes, uword sparse_index_bits)
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
vlib_error_t error
Error code for buffers to be enqueued to error handler.
#define CLIB_PREFETCH(addr, size, type)
always_inline void ppp_setup_node(vlib_main_t *vm, u32 node_index)
format_function_t format_ppp_header_with_length
always_inline void sparse_vec_index2(void *v, u32 si0, u32 si1, u32 *i0_return, u32 *i1_return)
#define VLIB_NODE_FLAG_TRACE
always_inline uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
#define vec_elt(v, i)
Get vector value at index i.
static char * ppp_error_strings[]
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)
always_inline void * vlib_node_get_runtime_data(vlib_main_t *vm, u32 node_index)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
always_inline void vlib_set_next_frame_buffer(vlib_main_t *vm, vlib_node_runtime_t *node, u32 next_index, u32 buffer_index)
static clib_error_t * ppp_init(vlib_main_t *vm)
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
static uword ppp_input(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
static clib_error_t * ppp_input_init(vlib_main_t *vm)
#define VLIB_REGISTER_NODE(x,...)
static u8 * format_ppp_input_trace(u8 *s, va_list *va)
uword runtime_data[(128-1 *sizeof(vlib_node_function_t *)-1 *sizeof(vlib_error_t *)-11 *sizeof(u32)-5 *sizeof(u16))/sizeof(uword)]
always_inline vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
#define SPARSE_VEC_INVALID_INDEX
always_inline uword sparse_vec_index(void *v, uword sparse_index)