29 s =
format (s,
"IP4_COP_WHITELIST: sw_if_index %d, next index %d",
36 #define foreach_ip4_cop_whitelist_error \ 37 _(DROPPED, "ip4 cop whitelist packets dropped") 40 #define _(sym,str) IP4_COP_WHITELIST_ERROR_##sym, 47 #define _(sym,string) string, 57 u32 n_left_from, * from, * to_next;
69 while (n_left_from > 0)
74 to_next, n_left_to_next);
76 while (n_left_from >= 4 && n_left_to_next >= 2)
81 u32 sw_if_index0, sw_if_index1;
87 u32 adj_index0, adj_index1;
105 to_next[0] = bi0 = from[0];
106 to_next[1] = bi1 = from[1];
150 b0->
error = node->
errors[IP4_COP_WHITELIST_ERROR_DROPPED];
192 (vcm, cpu_index, adj_index0, 1,
197 (vcm, cpu_index, adj_index1, 1,
203 b0->
error = node->
errors[IP4_COP_WHITELIST_ERROR_DROPPED];
209 b1->
error = node->
errors[IP4_COP_WHITELIST_ERROR_DROPPED];
233 to_next, n_left_to_next,
234 bi0, bi1, next0, next1);
237 while (n_left_from > 0 && n_left_to_next > 0)
297 (vcm, cpu_index, adj_index0, 1,
303 b0->
error = node->
errors[IP4_COP_WHITELIST_ERROR_DROPPED];
318 to_next, n_left_to_next,
329 .name =
"ip4-cop-whitelist",
330 .vector_size =
sizeof (
u32),
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.
cop_config_main_t cop_config_mains[VNET_N_COPS]
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
ip_lookup_next_t lookup_next_index
#define foreach_ip4_cop_whitelist_error
struct _vlib_node_registration vlib_node_registration_t
ip_lookup_main_t lookup_main
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
static u8 * format_ip4_cop_whitelist_trace(u8 *s, va_list *args)
#define VLIB_INIT_FUNCTION(x)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
u32 ip4_fib_lookup_with_table(ip4_main_t *im, u32 fib_index, ip4_address_t *dst, u32 disable_default_route)
This packet is for one of our own IP addresses.
static u32 ip4_fib_mtrie_leaf_get_adj_index(ip4_fib_mtrie_leaf_t n)
static char * ip4_cop_whitelist_error_strings[]
static void * vnet_get_config_data(vnet_config_main_t *cm, u32 *config_index, u32 *next_index, u32 n_data_bytes)
#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.
static ip4_fib_mtrie_leaf_t ip4_fib_mtrie_lookup_step(ip4_fib_mtrie_t *m, ip4_fib_mtrie_leaf_t current_leaf, ip4_address_t *dst_address, u32 dst_address_byte_index)
#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).
vlib_error_t error
Error code for buffers to be enqueued to error handler.
vlib_node_registration_t ip4_cop_whitelist_node
(constructor) VLIB_REGISTER_NODE (ip4_cop_whitelist_node)
#define CLIB_PREFETCH(addr, size, type)
vlib_combined_counter_main_t adjacency_counters
Adjacency packet/byte counters indexed by adjacency index.
static void vlib_increment_combined_counter(vlib_combined_counter_main_t *cm, u32 cpu_index, u32 index, u32 packet_increment, u32 byte_increment)
Increment a combined counter.
#define IP4_FIB_MTRIE_LEAF_ROOT
ip4_fib_t * fibs
Vector of FIBs.
#define VLIB_NODE_FLAG_TRACE
#define VLIB_BUFFER_IS_TRACED
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
ip4_cop_whitelist_error_t
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
static clib_error_t * ip4_whitelist_init(vlib_main_t *vm)
A collection of combined counters.
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
#define VLIB_NODE_FUNCTION_MULTIARCH(node, fn)
#define VLIB_REGISTER_NODE(x,...)
ip4_main_t ip4_main
Global ip4 main structure.
#define CLIB_CACHE_LINE_BYTES
u32 flags
buffer flags: VLIB_BUFFER_IS_TRACED: trace this buffer.
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
static uword ip4_cop_whitelist_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
vnet_config_main_t config_main
static ip_adjacency_t * ip_get_adjacency(ip_lookup_main_t *lm, u32 adj_index)