19 #ifndef __included_bfd_main_h__ 20 #define __included_bfd_main_h__ 27 #define foreach_bfd_mode(F) \ 33 #define F(x) BFD_MODE_##x, 56 #define foreach_bfd_poll_state(F) \ 60 F (IN_PROGRESS_AND_QUEUED) 64 #define F(x) BFD_POLL_##x, 72 #define foreach_bfd_hop(F) \ 73 F (SINGLE, "single") \ 78 #define F(sym, str) BFD_HOP_TYPE_##sym, 243 #define foreach_bfd_listen_event(F) \ 244 F (CREATE, "sesion-created") \ 245 F (UPDATE, "session-updated") \ 246 F (DELETE, "session-deleted") 250 #define F(sym, str) BFD_LISTEN_EVENT_##sym, 306 #define foreach_bfd_error(F) \ 307 F (NONE, "good bfd packets (processed)") \ 308 F (BAD, "invalid bfd packets") \ 309 F (DISABLED, "bfd packets received on disabled interfaces") 313 #define F(sym, str) BFD_ERROR_##sym, 339 u64 expire_time_clocks;
365 u8 bfd_key_id,
u8 is_delayed);
368 u32 desired_min_tx_usec,
369 u32 required_min_rx_usec,
375 #define USEC_PER_MS 1000LL 376 #define USEC_PER_SECOND (1000 * USEC_PER_MS) 379 #define BFD_DEFAULT_DESIRED_MIN_TX_USEC USEC_PER_SECOND 385 #define BFD_REQUIRED_MIN_RX_USEC_WHILE_ECHO USEC_PER_SECOND bfd_notify_fn_t * listeners
A vector of callback notification functions.
bfd_auth_type_e auth_type
authentication type for this key
u8 curr_bfd_key_id
current key ID sent out in bfd packet
bfd_session_t * bfd_get_session(bfd_main_t *bm, bfd_transport_e t)
struct bfd_session_s bfd_session_t
u32 * auth_key_by_conf_key_id
hashmap - index in pool auth_keys by conf_key_id
u64 echo_last_rx_clocks
timestamp of last echo packet received
u32 echo_secret
secret used for calculating/checking checksum of echo packets
bfd_session_t * bfd_find_session_by_idx(bfd_main_t *bm, uword bs_idx)
bfd_diag_code_e local_diag
local diagnostics
#define foreach_bfd_hop(F)
hop types
#define foreach_bfd_listen_event(F)
listener events
u64 last_tx_clocks
timestamp of last packet transmitted
void bfd_register_listener(bfd_notify_fn_t fn)
Register a callback function to receive session notifications.
u8 remote_seq_number_known
set to 1 if remote sequence number is known
int bfd_verify_pkt_common(const bfd_pkt_t *pkt)
verify bfd packet - common checks
u32 bfd_process_node_index
background process node index
u64 remote_min_echo_rx_clocks
remote min echo rx interval (clocks)
u64 effective_required_min_rx_clocks
effective required min rx interval (clocks)
void bfd_put_session(bfd_main_t *bm, bfd_session_t *bs)
#define foreach_bfd_mode(F)
u8 * bfd_input_format_trace(u8 *s, va_list *args)
u32 remote_seq_number
remote sequence number
unsigned bfd_auth_type_supported(bfd_auth_type_e auth_type)
timing_wheel_t wheel
timing wheel for scheduling timeouts
u64 effective_desired_min_tx_clocks
effective desired min tx interval (clocks)
u32 random_seed
for generating random numbers
int bfd_verify_pkt_auth(const bfd_pkt_t *pkt, u16 pkt_size, bfd_session_t *bs)
verify bfd packet - authentication
#define foreach_bfd_error(F)
Packet counters.
void bfd_consume_pkt(bfd_main_t *bm, const bfd_pkt_t *bfd, u32 bs_idx)
u64 remote_min_rx_usec
remote min rx interval (microseconds)
UDP transport specific data embedded in bfd_session's union.
u64 tx_timeout_clocks
next time at which to transmit a packet
int bfd_consume_echo_pkt(bfd_main_t *bm, vlib_buffer_t *b)
u64 config_required_min_rx_clocks
configured required min rx interval (clocks)
bfd_auth_key_t * next_key
set to next key to use if delayed switch is enabled - in that case the key is switched when first inc...
void bfd_event(bfd_main_t *bm, bfd_session_t *bs)
void bfd_session_set_flags(bfd_session_t *bs, u8 admin_up_down)
u8 remote_demand
1 if remote system sets demand mode, 0 otherwise
bfd_session_t * sessions
pool of bfd sessions context data
bfd_auth_key_t * auth_keys
pool of authentication keys
bfd_transport_e transport
transport type for this session
u32 remote_discr
remote discriminator
u64 default_desired_min_tx_clocks
default desired min tx in clocks
u64 echo_last_tx_clocks
timestamp of last echo packet transmitted
bfd_poll_state_e poll_state
state info regarding poll sequence
f64 cpu_cps
cpu clocks per second
u8 * format_bfd_session(u8 *s, va_list *args)
u64 echo_tx_timeout_clocks
next time at which to transmit echo packet
u8 local_detect_mult
configured detect multiplier
vnet_api_error_t bfd_auth_deactivate(bfd_session_t *bs, u8 is_delayed)
u64 last_rx_clocks
timestamp of last packet received
bfd_diag_code_e remote_diag
remote diagnostics
vnet_api_error_t bfd_session_set_params(bfd_main_t *bm, bfd_session_t *bs, u32 desired_min_tx_usec, u32 required_min_rx_usec, u8 detect_mult)
u64 transmit_interval_clocks
transmit interval
#define foreach_bfd_poll_state(F)
vnet_api_error_t bfd_auth_activate(bfd_session_t *bs, u32 conf_key_id, u8 bfd_key_id, u8 is_delayed)
BFD protocol declarations.
u32 config_desired_min_tx_usec
configured desired min tx interval (microseconds)
typedef CLIB_PACKED(struct{u32 discriminator;u64 expire_time_clocks;u64 checksum;}) bfd_echo_pkt_t
echo packet structure
u64 poll_state_start_or_timeout_clocks
helper for delayed poll sequence - marks either start of running poll sequence or timeout...
u64 detection_time_clocks
detection time
void bfd_session_start(bfd_main_t *bm, bfd_session_t *bs)
u64 config_desired_min_tx_clocks
configured desired min tx interval (clocks)
u32 bfd_clocks_to_usec(const bfd_main_t *bm, u64 clocks)
u8 echo
1 is echo function is active, 0 otherwise
u64 wheel_time_clocks
set to value of timer in timing wheel, 0 if never set
u64 remote_desired_min_tx_clocks
remote desired min tx interval (clocks)
u8 * format_bfd_auth_key(u8 *s, va_list *args)
u32 local_discr
local discriminator
bfd_hop_type_e hop_type
BFD hop type.
u32 conf_key_id
global configuration key ID
vlib_main_t * vlib_main
convenience variables
bfd_state_e local_state
session state
u32 * session_by_disc
hashmap - bfd session by discriminator
void(* bfd_notify_fn_t)(bfd_listen_event_e, const bfd_session_t *)
session nitification call back function type
u64 echo_transmit_interval_clocks
transmit interval for echo packets
u32 local_seq_number
sequence number incremented occasionally or always (if meticulous)
u32 config_required_min_rx_usec
configured required min rx interval (microseconds)
BFD UDP transport layer declarations.
void bfd_init_final_control_frame(vlib_main_t *vm, vlib_buffer_t *b, bfd_main_t *bm, bfd_session_t *bs, int is_local)
u32 use_count
keeps track of how many sessions reference this key
u8 next_bfd_key_id
key ID to use when switched to next_key
u32 bs_idx
index in bfd_main.sessions pool
u64 remote_min_echo_rx_usec
remote min echo rx interval (microseconds)
struct bfd_session_s::@48 auth
authentication information
bfd_state_e remote_state
remote session state
bfd_session_t * bfd_find_session_by_disc(bfd_main_t *bm, u32 disc)
const char * bfd_poll_state_string(bfd_poll_state_e state)
u64 min_required_min_rx_while_echo_clocks
minimum required min rx while echo function is active - clocks
bfd_auth_key_t * curr_key
current key in use
enum @47 bfd_process_event_e
u8 remote_detect_mult
remote detect multiplier
u64 remote_min_rx_clocks
remote min rx interval (clocks)
u8 is_delayed
set to 1 if delayed action is pending, which might be activation of authentication, change of key or deactivation
u64 wheel_inaccuracy
timing wheel inaccuracy, in clocks