96 return (&ip_null_dpos[indi]);
129 return (
format(s,
"%U-null action:%s",
185 u32 n_left_from, next_index, *from, *to_next;
186 static f64 time_last_seed_change = -1e100;
187 static u32 hash_seeds[3];
195 if (time_now - time_last_seed_change > 1e-1)
199 sizeof (hash_seeds));
200 for (i = 0; i <
ARRAY_LEN (hash_seeds); i++)
201 hash_seeds[i] = r[i];
204 for (i = 0; i <
ARRAY_LEN (hash_bitmap); i++)
207 time_last_seed_change = time_now;
212 while (n_left_from > 0)
218 while (n_left_from > 0 && n_left_to_next > 0)
220 u32 a0, b0, c0, m0, drop0;
222 u32 bi0, indi0, next0;
273 c0 &=
BITS (hash_bitmap) - 1;
277 bm0 = hash_bitmap[c0];
278 drop0 = (bm0 & m0) != 0;
281 hash_bitmap[c0] = bm0 | m0;
298 ICMP4_destination_unreachable,
299 ICMP4_destination_unreachable_destination_unreachable_host,
307 ICMP4_destination_unreachable,
308 ICMP4_destination_unreachable_host_administratively_prohibited,
319 ICMP6_destination_unreachable,
320 ICMP6_destination_unreachable_no_route_to_destination,
328 ICMP6_destination_unreachable,
329 ICMP6_destination_unreachable_destination_administratively_prohibited,
342 n_left_to_next, bi0, next0);
376 .vector_size =
sizeof (
u32),
400 .vector_size =
sizeof (
u32),
enum ip_null_dpo_action_t_ ip_null_dpo_action_t
The IP NULL DPO represents the rubbish bin for IP traffic.
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
dpo_lock_fn_t dv_lock
A reference counting lock function.
void ip_null_dpo_add_and_lock(dpo_proto_t proto, ip_null_dpo_action_t action, dpo_id_t *dpo)
vlib_node_registration_t ip6_null_dpo_node
(constructor) VLIB_REGISTER_NODE (ip6_null_dpo_node)
A virtual function table regisitered for a DPO type.
static uword ip4_null_dpo_switch(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static f64 vlib_time_now(vlib_main_t *vm)
static void ip_null_dpo_unlock(dpo_id_t *dpo)
static void * clib_random_buffer_get_data(clib_random_buffer_t *b, uword n_bytes)
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
#define IP_NULL_DPO_ACTION_NUM
#define hash_v3_mix32(a, b, c)
static const ip_null_dpo_t * ip_null_dpo_get(index_t indi)
void dpo_register(dpo_type_t type, const dpo_vft_t *vft, const char *const *const *nodes)
For a given DPO type Register:
static u8 * format_ip_null_dpo(u8 *s, va_list *ap)
ip_null_dpo_action_t ip_null_dpo_get_action(index_t indi)
enum dpo_proto_t_ dpo_proto_t
Data path protocol.
static u8 * format_ip_null_dpo_trace(u8 *s, va_list *args)
void icmp6_error_set_vnet_buffer(vlib_buffer_t *b, u8 type, u8 code, u32 data)
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
void ip_null_dpo_module_init(void)
static const char *const ip6_null_nodes[]
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
static void ip_null_dpo_lock(dpo_id_t *dpo)
#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,...)
struct ip_null_dpo_trace_t_ ip_null_dpo_trace_t
static const char *const *const ip_null_nodes[DPO_PROTO_NUM]
void icmp4_error_set_vnet_buffer(vlib_buffer_t *b, u8 type, u8 code, u32 data)
ip_null_next_t_
Exit nodes from a IP_NULL.
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.
void dpo_set(dpo_id_t *dpo, dpo_type_t type, dpo_proto_t proto, index_t index)
Set/create a DPO ID The DPO will be locked.
ip_null_dpo_action_t ind_action
The action to take on a packet.
const char * ip_null_action_strings[]
Action strings.
u16 cached_next_index
Next frame index that vector arguments were last enqueued to last time this node ran.
u32 ind_next_index
The next VLIB node.
#define hash_v3_finalize32(a, b, c)
The data-path object representing dropping the packet.
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
enum ip_null_next_t_ ip_null_next_t
Exit nodes from a IP_NULL.
VLIB buffer representation.
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
u8 * format_dpo_proto(u8 *s, va_list *args)
format a DPO protocol
static const char *const ip4_null_nodes[]
The per-protocol VLIB graph nodes that are assigned to a ip_null object.
vlib_node_registration_t ip4_null_dpo_node
(constructor) VLIB_REGISTER_NODE (ip4_null_dpo_node)
struct ip_null_dpo_t_ ip_null_dpo_t
The data-path object representing dropping the packet.
static uword ip6_null_dpo_switch(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
clib_random_buffer_t random_buffer
static uword ip_null_dpo_switch(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, u8 is_ip4)