32 #define ADJ_BFD_STATES { \ 33 [ADJ_BFD_STATE_DOWN] = "down", \ 34 [ADJ_BFD_STATE_UP] = "up", \ 88 case BFD_STATE_admin_down:
117 const bfd_udp_key_t *
key;
123 if (BFD_HOP_TYPE_SINGLE != session->
hop_type)
148 case BFD_LISTEN_EVENT_CREATE:
189 case BFD_LISTEN_EVENT_UPDATE:
206 case BFD_LISTEN_EVENT_DELETE:
269 s =
format(s,
"BFD:[state:%s index:%d]",
static const adj_bfd_delegate_t * adj_bfd_from_const_base(const adj_delegate_t *ad)
void adj_lock(adj_index_t adj_index)
Take a reference counting lock on the adjacency.
static u8 ip46_address_is_ip4(const ip46_address_t *ip46)
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
static ip_adjacency_t * adj_get(adj_index_t adj_index)
Get a pointer to an adjacency object from its index.
#define VLIB_INIT_FUNCTION(x)
adj_bfd_state_t_
Distillation of the BFD session states into a go/no-go for using the associated tracked adjacency...
void fib_walk_sync(fib_node_type_t parent_type, fib_node_index_t parent_index, fib_node_back_walk_ctx_t *ctx)
Back walk all the children of a FIB node.
description fragment has unexpected format
void adj_unlock(adj_index_t adj_index)
Release a reference counting lock on the adjacency.
int adj_bfd_is_up(adj_index_t ai)
static adj_bfd_state_t adj_bfd_bfd_state_to_fib(bfd_state_e bstate)
struct adj_bfd_delegate_t_ adj_bfd_delegate_t
BFD delegate daa.
bfd_udp_key_t key
key identifying this session
#define ADJ_INDEX_INVALID
Invalid ADJ index - used when no adj is known likewise blazoned capitals INVALID speak volumes where ...
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
enum adj_bfd_state_t_ adj_bfd_state_t
Distillation of the BFD session states into a go/no-go for using the associated tracked adjacency...
int adj_delegate_add(ip_adjacency_t *adj, adj_delegate_type_t adt, index_t adi)
Add a delegate to an adjacency.
#define pool_put(P, E)
Free an object E in pool P.
static void adj_bfd_update_walk(adj_index_t ai)
index_t ad_index
The index passed by the provider to identify its delegate instance.
static clib_error_t * adj_bfd_main_init(vlib_main_t *vm)
u32 adj_index_t
An index for adjacencies.
Context passed between object during a back walk.
void adj_delegate_register_type(adj_delegate_type_t type, const adj_delegate_vft_t *vft)
adj_delegate_register_type
static const char * adj_bfd_state_names[]
adj_delegate_t * adj_delegate_get(const ip_adjacency_t *adj, adj_delegate_type_t type)
Get a delegate from an adjacency.
adj_delegate_format_t adv_format
bfd_hop_type_e hop_type
BFD hop type.
static adj_bfd_delegate_t * adj_bfd_from_base(adj_delegate_t *ad)
static u8 * adj_delegate_fmt_bfd(const adj_delegate_t *aed, u8 *s)
Print a delegate that represents BFD tracking.
bfd_state_e local_state
session state
static adj_bfd_delegate_t * abd_pool
Pool of delegates.
void bfd_register_listener(bfd_notify_fn_t fn)
Register a callback function to receive session notifications.
An ADJ delegate virtual function table.
u32 bs_idx
index in bfd_main.sessions pool
adj_index_t adj_nbr_add_or_lock(fib_protocol_t nh_proto, vnet_link_t link_type, const ip46_address_t *nh_addr, u32 sw_if_index)
Neighbour Adjacency sub-type.
adj_bfd_state_t abd_state
BFD session state.
vnet_link_t fib_proto_to_link(fib_protocol_t proto)
Convert from a protocol to a link type.
void adj_bfd_notify(bfd_listen_event_e event, const bfd_session_t *session)
Callback function registered with BFD module to receive notifications of the CRUD of BFD sessions wou...
void adj_delegate_remove(adj_index_t ai, adj_delegate_type_t type)
Remove a delegate from an adjacency.
u32 abd_index
BFD session index.