|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
19 #ifndef __included_bfd_main_h__
20 #define __included_bfd_main_h__
29 #define foreach_bfd_mode(F) \
35 #define F(x) BFD_MODE_##x,
58 #define foreach_bfd_poll_state(F) \
62 F (IN_PROGRESS_AND_QUEUED)
66 #define F(x) BFD_POLL_##x,
74 #define foreach_bfd_hop(F) \
75 F (SINGLE, "single") \
80 #define F(sym, str) BFD_HOP_TYPE_##sym,
248 #define foreach_bfd_listen_event(F) \
249 F (CREATE, "sesion-created") \
250 F (UPDATE, "session-updated") \
251 F (DELETE, "session-deleted")
255 #define F(sym, str) BFD_LISTEN_EVENT_##sym,
288 TWT (tw_timer_wheel) wheel;
330 #define foreach_bfd_error(F) \
331 F (NONE, "good bfd packets (processed)") \
332 F (BAD, "invalid bfd packets") \
333 F (DISABLED, "bfd packets received on disabled interfaces")
337 #define F(sym, str) BFD_ERROR_##sym,
363 u64 expire_time_nsec;
372 uword my_thread_index = __os_thread_index;
389 uword my_thread_index = __os_thread_index;
416 const bfd_pkt_t * bfd,
u32 bs_idx);
433 u8 bfd_key_id,
u8 is_delayed);
436 u32 desired_min_tx_usec,
437 u32 required_min_rx_usec,
443 #define USEC_PER_MS (1000LL)
444 #define MSEC_PER_SEC (1000LL)
445 #define NSEC_PER_USEC (1000LL)
446 #define USEC_PER_SEC (MSEC_PER_SEC * USEC_PER_MS)
447 #define NSEC_PER_SEC (NSEC_PER_USEC * USEC_PER_SEC)
448 #define SEC_PER_NSEC ((f64)1/NSEC_PER_SEC)
451 #define BFD_TW_TPS (MSEC_PER_SEC)
454 #define BFD_DEFAULT_DESIRED_MIN_TX_USEC USEC_PER_SEC
460 #define BFD_REQUIRED_MIN_RX_USEC_WHILE_ECHO USEC_PER_SEC
#define foreach_bfd_error(F)
Packet counters.
u64 remote_desired_min_tx_nsec
remote desired min tx interval (nsec)
u64 last_rx_nsec
timestamp of last packet received
u32 remote_discr
remote discriminator
bfd_diag_code_e remote_diag
remote diagnostics
vlib_main_t * vlib_main
convenience variables
typedef CLIB_PACKED(struct { u32 discriminator;u64 expire_time_nsec;u64 checksum;}) bfd_echo_pkt_t
echo packet structure
bfd_transport_e transport
transport type for this session
u64 effective_desired_min_tx_nsec
effective desired min tx interval (nsec)
void(* bfd_notify_fn_t)(bfd_listen_event_e, const bfd_session_t *)
session nitification call back function type
u64 last_tx_nsec
timestamp of last packet transmitted
static_always_inline void clib_spinlock_lock_if_init(clib_spinlock_t *p)
static void bfd_lock(bfd_main_t *bm)
void bfd_register_listener(bfd_notify_fn_t fn)
Register a callback function to receive session notifications.
u8 * format_bfd_session_brief(u8 *s, va_list *args)
u32 config_desired_min_tx_usec
configured desired min tx interval (microseconds)
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...
bfd_hop_type_e hop_type
BFD hop type.
u64 detection_time_nsec
detection time
u32 local_discr
local discriminator
u32 conf_key_id
global configuration key ID
clib_spinlock_t lock
lock to protect data structures
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
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)
vl_api_dhcp_client_state_t state
u32 * session_by_disc
hashmap - bfd session by discriminator
u64 transmit_interval_nsec
transmit interval
@ BFD_EVENT_CONFIG_CHANGED
u64 effective_required_min_rx_nsec
effective required min rx interval (nsec)
u32 local_seq_number
sequence number incremented occasionally or always (if meticulous)
UDP transport specific data embedded in bfd_session's union.
u64 event_time_nsec
next event time in nsec for this session (0 if no event)
u8 next_bfd_key_id
key ID to use when switched to next_key
u64 config_required_min_rx_nsec
configured required min rx interval (nsec)
u64 config_desired_min_tx_nsec
configured desired min tx interval (nsec)
u32 bs_idx
index in bfd_main.sessions pool
void bfd_session_set_flags(vlib_main_t *vm, bfd_session_t *bs, u8 admin_up_down)
u8 * format_bfd_session(u8 *s, va_list *args)
u64 bfd_process_next_wakeup_nsec
When the bfd process is supposed to wake up next.
u8 remote_detect_mult
remote detect multiplier
const char * bfd_poll_state_string(bfd_poll_state_e state)
u64 remote_min_echo_rx_usec
remote min echo rx interval (microseconds)
u32 random_seed
for generating random numbers
u64 poll_state_start_or_timeout_nsec
helper for delayed poll sequence - marks either start of running poll sequence or timeout,...
u32 bfd_nsec_to_usec(u64 nsec)
static void bfd_lock_check(bfd_main_t *bm)
bfd_state_e local_state
session state
BFD protocol declarations.
u64 remote_min_rx_nsec
remote min rx interval (nsec)
u32 remote_seq_number
remote sequence number
bfd_session_t * sessions
pool of bfd sessions context data
#define foreach_bfd_poll_state(F)
void bfd_event(bfd_main_t *bm, bfd_session_t *bs)
u32 bfd_process_node_index
background process node index
int bfd_process_wakeup_events_in_flight
Number of event wakeup RPCs in flight.
void bfd_put_session(bfd_main_t *bm, bfd_session_t *bs)
bfd_auth_key_t * curr_key
current key in use
#define foreach_bfd_mode(F)
int bfd_verify_pkt_auth(vlib_main_t *vm, const bfd_pkt_t *pkt, u16 pkt_size, bfd_session_t *bs)
verify bfd packet - authentication
u8 remote_seq_number_known
set to 1 if remote sequence number is known
bfd_session_t * bfd_get_session(bfd_main_t *bm, bfd_transport_e t)
u64 bfd_process_wakeup_event_start_nsec
The timestamp of last wakeup event being sent.
bfd_session_t * bfd_find_session_by_disc(bfd_main_t *bm, u32 disc)
u64 tx_timeout_nsec
next time at which to transmit a packet
u8 * format_bfd_auth_key(u8 *s, va_list *args)
void bfd_session_start(bfd_main_t *bm, bfd_session_t *bs)
u32 * auth_key_by_conf_key_id
hashmap - index in pool auth_keys by conf_key_id
u32 use_count
keeps track of how many sessions reference this key
u64 bfd_process_wakeup_event_delay_nsec
The time it took the last wakeup event to make it to handling.
u8 curr_bfd_key_id
current key ID sent out in bfd packet
bfd_session_t * bfd_find_session_by_idx(bfd_main_t *bm, uword bs_idx)
u8 local_detect_mult
configured detect multiplier
#define foreach_bfd_listen_event(F)
listener events
u64 echo_tx_timeout_nsec
next time at which to transmit echo packet
static void bfd_unlock(bfd_main_t *bm)
bfd_diag_code_e local_diag
local diagnostics
bfd_notify_fn_t * listeners
vector of callback notification functions
u8 remote_demand
1 if remote system sets demand mode, 0 otherwise
u8 * bfd_input_format_trace(u8 *s, va_list *args)
u32 tw_id
timing wheel internal id used to manipulate timer (if set)
unsigned bfd_auth_type_supported(bfd_auth_type_e auth_type)
bfd_state_e remote_state
remote session state
vlib_log_class_t log_class
log class
u64 nsec_per_tw_tick
how many nanoseconds is one timing wheel tick
u64 remote_min_echo_rx_nsec
remote min echo rx interval (nsec)
vnet_api_error_t bfd_auth_deactivate(bfd_session_t *bs, u8 is_delayed)
u8 is_delayed
set to 1 if delayed action is pending, which might be activation of authentication,...
u64 min_required_min_rx_while_echo_nsec
minimum required min rx while echo function is active - nsec
bfd_poll_state_e poll_state
state info regarding poll sequence
u64 default_desired_min_tx_nsec
default desired min tx in nsec
#define foreach_bfd_hop(F)
hop types
void bfd_consume_pkt(vlib_main_t *vm, bfd_main_t *bm, const bfd_pkt_t *bfd, u32 bs_idx)
#define clib_warning(format, args...)
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)
struct bfd_session_s bfd_session_t
int bfd_verify_pkt_common(const bfd_pkt_t *pkt)
verify bfd packet - common checks
vnet_api_error_t bfd_auth_activate(bfd_session_t *bs, u32 conf_key_id, u8 bfd_key_id, u8 is_delayed)
bfd_auth_type_e auth_type
authentication type for this key
u64 remote_min_rx_usec
remote min rx interval (microseconds)
static_always_inline void clib_spinlock_unlock_if_init(clib_spinlock_t *p)
struct bfd_session_s::@149 auth
authentication information
BFD UDP transport layer declarations.
u32 config_required_min_rx_usec
configured required min rx interval (microseconds)
bfd_auth_key_t * auth_keys
pool of authentication keys
u32 echo_secret
secret used for calculating/checking checksum of echo packets
u64 echo_last_tx_nsec
timestamp of last echo packet transmitted
int bfd_consume_echo_pkt(vlib_main_t *vm, bfd_main_t *bm, vlib_buffer_t *b)
u64 echo_transmit_interval_nsec
transmit interval for echo packets
VLIB buffer representation.
u64 echo_last_rx_nsec
timestamp of last echo packet received
u8 echo
1 is echo function is active, 0 otherwise