47 #define foreach_osi_input_next \ 48 _ (PUNT, "error-punt") \ 49 _ (DROP, "error-drop") 52 #define _(s,n) OSI_INPUT_NEXT_##s, 79 u32 n_left_from, next_index, * from, * to_next;
93 while (n_left_from > 0)
98 to_next, n_left_to_next);
100 while (n_left_from >= 4 && n_left_to_next >= 2)
105 u8 next0, next1, enqueue_code;
139 b0->
error = node->
errors[next0 == OSI_INPUT_NEXT_DROP ? OSI_ERROR_UNKNOWN_PROTOCOL : OSI_ERROR_NONE];
140 b1->
error = node->
errors[next1 == OSI_INPUT_NEXT_DROP ? OSI_ERROR_UNKNOWN_PROTOCOL : OSI_ERROR_NONE];
142 enqueue_code = (next0 != next_index) + 2*(next1 != next_index);
146 switch (enqueue_code)
180 while (n_left_from > 0 && n_left_to_next > 0)
200 b0->
error = node->
errors[next0 == OSI_INPUT_NEXT_DROP ? OSI_ERROR_UNKNOWN_PROTOCOL : OSI_ERROR_NONE];
211 to_next, n_left_to_next);
235 .vector_size =
sizeof (
u32),
242 #define _(s,n) [OSI_INPUT_NEXT_##s] = n, void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
static uword osi_input(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
sll srl srl sll sra u16x4 i
static u8 * format_osi_input_trace(u8 *s, va_list *va)
unformat_function_t unformat_osi_header
format_function_t format_osi_header_with_length
#define clib_error_report(e)
always_inline osi_protocol_info_t * osi_get_protocol_info(osi_main_t *m, osi_protocol_t protocol)
#define foreach_osi_error
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
#define VLIB_INIT_FUNCTION(x)
void llc_register_input_protocol(vlib_main_t *vm, llc_protocol_t protocol, u32 node_index)
static char * osi_error_strings[]
#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)
vlib_node_registration_t osi_input_node
(constructor) VLIB_REGISTER_NODE (osi_input_node)
void osi_register_input_protocol(osi_protocol_t protocol, u32 node_index)
#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.
static clib_error_t * osi_init(vlib_main_t *vm)
#define CLIB_PREFETCH(addr, size, type)
#define foreach_osi_input_next
static clib_error_t * osi_input_init(vlib_main_t *vm)
#define VLIB_NODE_FLAG_TRACE
always_inline uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
always_inline void osi_setup_node(vlib_main_t *vm, u32 node_index)
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)
void hdlc_register_input_protocol(vlib_main_t *vm, hdlc_protocol_t protocol, u32 node_index)
always_inline void vlib_set_next_frame_buffer(vlib_main_t *vm, vlib_node_runtime_t *node, u32 next_index, u32 buffer_index)
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
#define VLIB_REGISTER_NODE(x,...)
u8 input_next_by_protocol[256]
format_function_t format_osi_header
always_inline vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.