static const adj_midchain_delegate_t * adj_midchain_from_const_base(const adj_delegate_t *ad)
fib_protocol_t fp_proto
protocol type
Recursive resolution source.
vnet_main_t * vnet_get_main(void)
u32 fib_entry_child_add(fib_node_index_t fib_entry_index, fib_node_type_t child_type, fib_node_index_t child_index)
struct adj_midchain_delegate_t_ adj_midchain_delegate_t
Midchain stacker delegate.
void adj_midchain_delegate_restack(adj_index_t ai)
restack a midchain delegate
void fib_entry_child_remove(fib_node_index_t fib_entry_index, u32 sibling_index)
const fib_prefix_t * fib_entry_get_prefix(fib_node_index_t fib_entry_index)
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
static ip_adjacency_t * adj_get(adj_index_t adj_index)
Get a pointer to an adjacency object from its index.
Stacking of a midchain's nexthop.
#define VLIB_INIT_FUNCTION(x)
Aggregrate type for a prefix.
void adj_nbr_midchain_stack_on_fib_entry(adj_index_t ai, fib_node_index_t fei, fib_forward_chain_type_t fct)
[re]stack a midchain.
static u8 * adj_midchain_delegate_fmt(const adj_delegate_t *aed, u8 *s)
Print a delegate that represents MIDCHAIN tracking.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
int adj_delegate_add(ip_adjacency_t *adj, adj_delegate_type_t adt, index_t adi)
Add a delegate to an adjacency.
u32 amd_sibling
The sibling entry on the FIB entry.
u32 adj_get_sw_if_index(adj_index_t ai)
Return the sw interface index of the adjacency.
#define pool_put(P, E)
Free an object E in pool P.
static void adj_midchain_delegate_restack_i(adj_index_t ai, adj_midchain_delegate_t *amd)
fib_node_index_t amd_fei
the Fib Entry we are stacked on
fib_node_index_t fib_table_entry_special_add(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags)
Add a 'special' entry to the FIB.
void fib_table_entry_delete_index(fib_node_index_t fib_entry_index, fib_source_t source)
Delete a FIB entry.
index_t ad_index
The index passed by the provider to identify its delegate instance.
static clib_error_t * adj_midchain_delegate_module_init(vlib_main_t *vm)
static void adj_midchain_delegate_adj_deleted(adj_delegate_t *ad)
u32 fib_node_index_t
A typedef of a node index.
u32 adj_index_t
An index for adjacencies.
void adj_delegate_register_type(adj_delegate_type_t type, const adj_delegate_vft_t *vft)
adj_delegate_register_type
adj_delegate_t * adj_delegate_get(const ip_adjacency_t *adj, adj_delegate_type_t type)
Get a delegate from an adjacency.
Midchain stacker delegate.
adj_delegate_format_t adv_format
void adj_nbr_midchain_unstack(adj_index_t adj_index)
adj_nbr_midchain_unstack
static uword vnet_sw_interface_is_admin_up(vnet_main_t *vnm, u32 sw_if_index)
#define FIB_NODE_INDEX_INVALID
An ADJ delegate virtual function table.
void adj_midchain_delegate_unstack(adj_index_t ai)
unstack a midchain delegate (this stacks it on a drop)
void adj_midchain_delegate_stack(adj_index_t ai, u32 fib_index, const fib_prefix_t *pfx)
create/attach a midchain delegate and stack it on the prefix passed
static adj_midchain_delegate_t * amd_pool
Pool of delegates.
fib_forward_chain_type_t fib_forw_chain_type_from_fib_proto(fib_protocol_t proto)
Convert from a fib-protocol to a chain type.