30 s =
format (s,
"COP_INPUT: sw_if_index %d, next index %d",
37 #define foreach_cop_input_error \ 38 _(PROCESSED, "COP input packets processed") 41 #define _(sym,str) COP_INPUT_ERROR_##sym, 48 #define _(sym,string) string, 58 u32 n_left_from, * from, * to_next;
66 while (n_left_from > 0)
71 to_next, n_left_to_next);
73 while (n_left_from >= 4 && n_left_to_next >= 2)
78 u32 sw_if_index0, sw_if_index1;
81 u32 advance0, advance1;
99 to_next[0] = bi0 = from[0];
100 to_next[1] = bi1 = from[1];
120 if (en0->
type == clib_host_to_net_u16(ETHERNET_TYPE_IP4))
125 else if (en0->
type == clib_host_to_net_u16(ETHERNET_TYPE_IP6))
131 if (en1->
type == clib_host_to_net_u16(ETHERNET_TYPE_IP4))
136 else if (en1->
type == clib_host_to_net_u16(ETHERNET_TYPE_IP6))
180 to_next, n_left_to_next,
181 bi0, bi1, next0, next1);
184 while (n_left_from > 0 && n_left_to_next > 0)
218 if (en0->
type == clib_host_to_net_u16(ETHERNET_TYPE_IP4))
223 else if (en0->
type == clib_host_to_net_u16(ETHERNET_TYPE_IP6))
250 to_next, n_left_to_next,
257 COP_INPUT_ERROR_PROCESSED, frame->
n_vectors);
264 .vector_size =
sizeof (
u32),
285 #define foreach_cop_stub \ 286 _(default-cop-whitelist, default_cop_whitelist) 291 f##_node_fn (vlib_main_t * vm, \ 292 vlib_node_runtime_t * node, \ 293 vlib_frame_t * frame) \ 295 clib_warning ("BUG: stub function called"); \ 299 VLIB_REGISTER_NODE (f##_input_node) = { \ 300 .function = f##_node_fn, \ 302 .vector_size = sizeof (u32), \ 303 .type = VLIB_NODE_TYPE_INTERNAL, \ 306 .error_strings = 0, \ void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
cop_config_main_t cop_config_mains[VNET_N_COPS]
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
vlib_node_registration_t cop_input_node
(constructor) VLIB_REGISTER_NODE (cop_input_node)
struct _vlib_node_registration vlib_node_registration_t
static char * cop_input_error_strings[]
always_inline void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
u32 * config_index_by_sw_if_index
static uword cop_input_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static u8 * format_cop_input_trace(u8 *s, va_list *args)
always_inline void * vlib_frame_vector_args(vlib_frame_t *f)
always_inline void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
#define vlib_validate_buffer_enqueue_x2(vm, node, next_index, to_next, n_left_to_next, bi0, bi1, next0, next1)
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
#define foreach_cop_input_error
#define CLIB_PREFETCH(addr, size, type)
#define VLIB_NODE_FLAG_TRACE
#define VLIB_BUFFER_IS_TRACED
always_inline void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
always_inline void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
#define VLIB_REGISTER_NODE(x,...)
#define CLIB_CACHE_LINE_BYTES
always_inline void * vnet_get_config_data(vnet_config_main_t *cm, u32 *config_index, u32 *next_index, u32 n_data_bytes)
u32 flags
buffer flags: VLIB_BUFFER_IS_TRACED: trace this buffer.
always_inline vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
vnet_config_main_t config_main