40 #define NHRP_NOTIFY(_ne, _fn) { \ 42 vec_foreach(_vft, nhrp_vfts) { \ 61 const ip46_address_t *
120 const ip46_address_t *
peer,
134 return (VNET_API_ERROR_NO_SUCH_FIB);
167 return (VNET_API_ERROR_ENTRY_ALREADY_EXISTS);
193 return (VNET_API_ERROR_ENTRY_ALREADY_EXISTS);
207 s =
format (s,
"[%d] ", nei);
212 s =
format (s,
" via [%d]:%U",
fib_protocol_t fp_proto
protocol type
void adj_nbr_walk_nh(u32 sw_if_index, fib_protocol_t adj_nh_proto, const ip46_address_t *nh, adj_walk_cb_t cb, void *ctx)
Walk adjacencies on a link with a given next-hop.
#define NHRP_NOTIFY(_ne, _fn)
vnet_main_t * vnet_get_main(void)
#define pool_get_zero(P, E)
Allocate an object E from a pool P and zero it.
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
nhrp_entry_t * nhrp_entry_get(index_t nei)
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
#define hash_set_mem(h, key, value)
static u8 ip46_address_is_ip4(const ip46_address_t *ip46)
void nhrp_walk(nhrp_walk_cb_t fn, void *ctx)
u8 * format_nhrp_entry(u8 *s, va_list *args)
format_function_t format_vnet_sw_if_index_name
static adj_walk_rc_t nhrp_entry_del_adj_walk(adj_index_t ai, void *ctx)
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
#define clib_memcpy(d, s, n)
int nhrp_entry_add(u32 sw_if_index, const ip46_address_t *peer, u32 nh_table_id, const ip46_address_t *nh)
Create a new NHRP entry.
vl_api_interface_index_t sw_if_index
#define VLIB_INIT_FUNCTION(x)
enum adj_walk_rc_t_ adj_walk_rc_t
return codes from a adjacency walker callback function
u8 * format_fib_prefix(u8 *s, va_list *args)
Aggregate type for a prefix.
u32 fib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
u16 fp_len
The mask length.
static clib_error_t * nhrp_init(vlib_main_t *vm)
#define hash_create_mem(elts, key_bytes, value_bytes)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
#define hash_unset_mem(h, key)
static_always_inline void ip46_address_copy(ip46_address_t *dst, const ip46_address_t *src)
ip46_address_t fp_addr
The address type is not deriveable from the fp_addr member.
#define pool_put(P, E)
Free an object E in pool P.
static nhrp_vft_t * nhrp_vfts
walk_rc_t(* nhrp_walk_cb_t)(index_t nei, void *ctx)
format_function_t format_ip46_address
u32 nhrp_entry_get_fib_index(const nhrp_entry_t *ne)
const ip46_address_t * nhrp_entry_get_peer(const nhrp_entry_t *ne)
struct nhrp_key_t_ nhrp_key_t
int nhrp_entry_del(u32 sw_if_index, const ip46_address_t *peer)
static adj_walk_rc_t nhrp_entry_add_adj_walk(adj_index_t ai, void *ctx)
u32 adj_index_t
An index for adjacencies.
void adj_midchain_delegate_unstack(adj_index_t ai)
unstack a midchain delegate (this stacks it on a drop)
u32 fib_table_get_table_id(u32 fib_index, fib_protocol_t proto)
Get the Table-ID of the FIB from protocol and index.
static void clib_mem_free(void *p)
static void * clib_mem_alloc(uword size)
void nhrp_walk_itf(u32 sw_if_index, nhrp_walk_cb_t fn, void *ctx)
const fib_prefix_t * nhrp_entry_get_nh(const nhrp_entry_t *ne)
#define hash_get_mem(h, key)
nhrp_entry_t * nhrp_entry_find(u32 sw_if_index, const ip46_address_t *peer)
void nhrp_entry_adj_stack(const nhrp_entry_t *ne, adj_index_t ai)
void nhrp_register(const nhrp_vft_t *vft)
u32 nhrp_entry_get_sw_if_index(const nhrp_entry_t *ne)
accessors for the opaque struct
#define pool_foreach_index(i, v, body)
Iterate pool by index.
static nhrp_entry_t * nhrp_pool