96 return (&ip_null_dpos[indi]);
123 return (
format(s,
"%U-null action:%s",
179 u32 n_left_from, next_index, *from, *to_next;
180 static f64 time_last_seed_change = -1e100;
181 static u32 hash_seeds[3];
189 if (time_now - time_last_seed_change > 1e-1)
193 sizeof (hash_seeds));
194 for (i = 0; i <
ARRAY_LEN (hash_seeds); i++)
195 hash_seeds[i] = r[i];
198 for (i = 0; i <
ARRAY_LEN (hash_bitmap); i++)
201 time_last_seed_change = time_now;
206 while (n_left_from > 0)
212 while (n_left_from > 0 && n_left_to_next > 0)
214 u32 a0, b0, c0, m0, drop0;
216 u32 bi0, indi0, next0;
267 c0 &=
BITS (hash_bitmap) - 1;
271 bm0 = hash_bitmap[c0];
272 drop0 = (bm0 & m0) != 0;
275 hash_bitmap[c0] = bm0 | m0;
292 ICMP4_destination_unreachable,
293 ICMP4_destination_unreachable_destination_unreachable_host,
301 ICMP4_destination_unreachable,
302 ICMP4_destination_unreachable_host_administratively_prohibited,
313 ICMP6_destination_unreachable,
314 ICMP6_destination_unreachable_no_route_to_destination,
322 ICMP6_destination_unreachable,
323 ICMP6_destination_unreachable_destination_administratively_prohibited,
336 n_left_to_next, bi0, next0);
370 .vector_size =
sizeof (
u32),
394 .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.
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)
sll srl srl sll sra u16x4 i
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)
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).
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.
#define VLIB_BUFFER_IS_TRACED
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.
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.
#define VLIB_REGISTER_NODE(x,...)
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.
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 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)