31 s =
format (s,
"IP6_COP_WHITELIST: sw_if_index %d, next index %d",
36 #define foreach_ip6_cop_whitelist_error \ 37 _(DROPPED, "ip6 cop whitelist packets dropped") 40 #define _(sym,str) IP6_COP_WHITELIST_ERROR_##sym, 47 #define _(sym,string) string, 56 u32 n_left_from, * from, * to_next;
64 n_left_from = frame->n_vectors;
65 next_index = node->cached_next_index;
67 while (n_left_from > 0)
72 to_next, n_left_to_next);
74 while (n_left_from >= 4 && n_left_to_next >= 2)
79 u32 sw_if_index0, sw_if_index1;
83 u32 lb_index0, lb_index1;
102 to_next[0] = bi0 = from[0];
103 to_next[1] = bi1 = from[1];
129 b0->
error = node->errors[IP6_COP_WHITELIST_ERROR_DROPPED];
153 (vcm, thread_index, lb_index0, 1,
158 (vcm, thread_index, lb_index1, 1,
164 b1->
error = node->errors[IP6_COP_WHITELIST_ERROR_DROPPED];
169 && (b0->
flags & VLIB_BUFFER_IS_TRACED)))
178 && (b1->
flags & VLIB_BUFFER_IS_TRACED)))
188 to_next, n_left_to_next,
189 bi0, bi1, next0, next1);
192 while (n_left_from > 0 && n_left_to_next > 0)
233 (vcm, thread_index, lb_index0, 1,
239 b0->
error = node->errors[IP6_COP_WHITELIST_ERROR_DROPPED];
244 && (b0->
flags & VLIB_BUFFER_IS_TRACED)))
254 to_next, n_left_to_next,
260 return frame->n_vectors;
264 .name =
"ip6-cop-whitelist",
265 .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.
static void vlib_increment_combined_counter(vlib_combined_counter_main_t *cm, u32 thread_index, u32 index, u64 n_packets, u64 n_bytes)
Increment a combined counter.
cop_config_main_t cop_config_mains[VNET_N_COPS]
vlib_node_registration_t ip6_cop_whitelist_node
(constructor) VLIB_REGISTER_NODE (ip6_cop_whitelist_node)
#define VLIB_NODE_FN(node)
static u32 ip6_fib_table_fwding_lookup(ip6_main_t *im, u32 fib_index, const ip6_address_t *dst)
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
ip6_cop_whitelist_error_t
#define VLIB_INIT_FUNCTION(x)
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
static clib_error_t * ip6_whitelist_init(vlib_main_t *vm)
vlib_error_t error
Error code for buffers to be enqueued to error handler.
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
static char * ip6_cop_whitelist_error_strings[]
dpo_type_t dpoi_type
the type
static const dpo_id_t * load_balance_get_bucket_i(const load_balance_t *lb, u32 bucket)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
static void * vnet_get_config_data(vnet_config_main_t *cm, u32 *config_index, u32 *next_index, u32 n_data_bytes)
#define foreach_ip6_cop_whitelist_error
load_balance_main_t load_balance_main
The one instance of load-balance main.
#define vlib_validate_buffer_enqueue_x2(vm, node, next_index, to_next, n_left_to_next, bi0, bi1, next0, next1)
Finish enqueueing two buffers forward in the graph.
#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,...)
#define CLIB_PREFETCH(addr, size, type)
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_combined_counter_main_t lbm_via_counters
static load_balance_t * load_balance_get(index_t lbi)
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.
A collection of combined counters.
static u8 * format_ip6_cop_whitelist_trace(u8 *s, va_list *args)
#define VLIB_NODE_FLAG_TRACE
#define CLIB_CACHE_LINE_BYTES
static 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