67 if (
vec_len (rxs) <= rx_sw_if_index)
70 return rxs[rx_sw_if_index];
81 if (~0 == rx_sw_if_index)
88 ipri = ipr - ip_punt_redirect_cfg.
pool;
112 if (~0 == rx_sw_if_index)
117 if ((
vec_len (rxs) <= rx_sw_if_index) ||
148 s =
format (s,
" rx %U via:\n",
164 u32 ii, rx_sw_if_index;
176 rx_sw_if_index = (ii == 0 ? ~0 : ii);
177 cb (rx_sw_if_index, rx, ctx);
185 return (&(ipr->
node));
238 &ip_punt_redirect_vft);
void dpo_stack_from_node(u32 child_node_index, dpo_id_t *dpo, const dpo_id_t *parent)
Stack one DPO object on another, and thus establish a child parent relationship.
ip_punt_redirect_cfg_t ip_punt_redirect_cfg
ip_punt_redirect_rx_t * pool
#define vec_foreach_index(var, v)
Iterate over vector indices.
void fib_path_list_child_remove(fib_node_index_t path_list_index, u32 si)
A representation of a path as described by a route producer.
static void ip_punt_redirect_last_lock_gone(fib_node_t *node)
vnet_main_t * vnet_get_main(void)
void fib_node_init(fib_node_t *node, fib_node_type_t type)
u8 * format_fib_path_list(u8 *s, va_list *args)
u8 * format_ip_punt_redirect_trace(u8 *s, va_list *args)
enum fib_node_back_walk_rc_t_ fib_node_back_walk_rc_t
Return code from a back walk function.
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
static fib_node_back_walk_rc_t ip_punt_redirect_back_walk_notify(fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
#define STRUCT_OFFSET_OF(t, f)
static vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
void ip_punt_redirect_add(fib_protocol_t fproto, u32 rx_sw_if_index, fib_forward_chain_type_t ct, fib_route_path_t *rpaths)
Add a punt redirect entry.
u32 fib_path_list_child_add(fib_node_index_t path_list_index, fib_node_type_t child_type, fib_node_index_t child_index)
static ip_punt_redirect_rx_t * ip_punt_redirect_get_from_node(fib_node_t *node)
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
index_t ip_punt_redirect_find(fib_protocol_t fproto, u32 rx_sw_if_index)
void fib_node_register_type(fib_node_type_t type, const fib_node_vft_t *vft)
fib_node_register_type
u8 * format_ip_punt_redirect(u8 *s, va_list *args)
#define VLIB_INIT_FUNCTION(x)
fib_forward_chain_type_t payload_type
description fragment has unexpected format
IP punt redirect configuration.
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
format_function_t format_vnet_sw_interface_name
fib_node_t node
Node linkage into the FIB graph.
fib_node_index_t fib_path_list_create(fib_path_list_flags_t flags, const fib_route_path_t *rpaths)
vlib_node_t * vlib_get_node_by_name(vlib_main_t *vm, u8 *name)
static clib_error_t * ip_punt_drop_init(vlib_main_t *vm)
#define pool_put(P, E)
Free an object E in pool P.
An node in the FIB graph.
static fib_node_t * ip_punt_redirect_get_node(fib_node_index_t index)
static_always_inline ip_punt_redirect_rx_t * ip_punt_redirect_get(index_t rrxi)
IP4 punt redirect per-rx interface configuration redirect punted traffic to another location...
dpo_id_t dpo
redirect forwarding
u32 fib_node_index_t
A typedef of a node index.
vlib_main_t vlib_node_runtime_t * node
Context passed between object during a back walk.
enum fib_forward_chain_type_t_ fib_forward_chain_type_t
FIB output chain type.
walk_rc_t(* ip_punt_redirect_walk_cb_t)(u32 rx_sw_if_index, const ip_punt_redirect_rx_t *redirect, void *arg)
u8 * format_dpo_id(u8 *s, va_list *args)
Format a DPO_id_t oject.
static vlib_main_t * vlib_get_main(void)
static void ip_punt_redirect_stack(ip_punt_redirect_rx_t *ipr)
void ip_punt_redirect_del(fib_protocol_t fproto, u32 rx_sw_if_index)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
#define DPO_INVALID
An initialiser for DPOs declared on the stack.
void fib_path_list_contribute_forwarding(fib_node_index_t path_list_index, fib_forward_chain_type_t fct, fib_path_list_fwd_flags_t flags, dpo_id_t *dpo)
A FIB graph nodes virtual function table.
index_t * redirect_by_rx_sw_if_index[FIB_PROTOCOL_IP_MAX]
per-RX interface configuration.
void dpo_reset(dpo_id_t *dpo)
reset a DPO ID The DPO will be unlocked.
#define vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header, unspecified alignment)
void ip_punt_redirect_walk(fib_protocol_t fproto, ip_punt_redirect_walk_cb_t cb, void *ctx)