FD.io VPP  v20.05.1-6-gf53edbc3b
Vector Packet Processing
bfd_main.h File Reference

BFD global declarations. More...

+ Include dependency graph for bfd_main.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  bfd_auth_key_t
 
struct  bfd_session_s
 
struct  bfd_main_t
 
struct  bfd_input_trace_t
 bfd packet trace capture More...
 

Macros

#define foreach_bfd_mode(F)
 
#define F(x)   BFD_MODE_##x,
 
#define foreach_bfd_poll_state(F)
 
#define F(x)   BFD_POLL_##x,
 
#define foreach_bfd_hop(F)
 hop types More...
 
#define F(sym, str)   BFD_HOP_TYPE_##sym,
 
#define foreach_bfd_listen_event(F)
 listener events More...
 
#define F(sym, str)   BFD_LISTEN_EVENT_##sym,
 
#define foreach_bfd_error(F)
 Packet counters. More...
 
#define F(sym, str)   BFD_ERROR_##sym,
 
#define USEC_PER_MS   (1000LL)
 
#define MSEC_PER_SEC   (1000LL)
 
#define NSEC_PER_USEC   (1000LL)
 
#define USEC_PER_SEC   (MSEC_PER_SEC * USEC_PER_MS)
 
#define NSEC_PER_SEC   (NSEC_PER_USEC * USEC_PER_SEC)
 
#define SEC_PER_NSEC   ((f64)1/NSEC_PER_SEC)
 
#define BFD_TW_TPS   (MSEC_PER_SEC)
 timing wheel tick-rate, 1ms should be good enough More...
 
#define BFD_DEFAULT_DESIRED_MIN_TX_USEC   USEC_PER_SEC
 default, slow transmission interval for BFD packets, per spec at least 1s More...
 
#define BFD_REQUIRED_MIN_RX_USEC_WHILE_ECHO   USEC_PER_SEC
 minimum required min rx set locally when echo function is used, per spec should be set to at least 1s More...
 

Typedefs

typedef struct bfd_session_s bfd_session_t
 
typedef void(* bfd_notify_fn_t) (bfd_listen_event_e, const bfd_session_t *)
 session nitification call back function type More...
 

Enumerations

enum  bfd_mode_e { foreach_bfd_mode =(F) }
 
enum  bfd_poll_state_e { foreach_bfd_poll_state =(F) }
 
enum  bfd_hop_type_e { foreach_bfd_hop =(F) }
 
enum  bfd_listen_event_e { foreach_bfd_listen_event =(F) }
 
enum  bfd_error_t { foreach_bfd_error }
 
enum  bfd_process_event_e { BFD_EVENT_RESCHEDULE = 1, BFD_EVENT_NEW_SESSION, BFD_EVENT_CONFIG_CHANGED }
 

Functions

typedef CLIB_PACKED (struct { u32 discriminator;u64 expire_time_nsec;u64 checksum;}) bfd_echo_pkt_t
 echo packet structure More...
 
static void bfd_lock (bfd_main_t *bm)
 
static void bfd_unlock (bfd_main_t *bm)
 
static void bfd_lock_check (bfd_main_t *bm)
 
u8bfd_input_format_trace (u8 *s, va_list *args)
 
bfd_session_tbfd_get_session (bfd_main_t *bm, bfd_transport_e t)
 
void bfd_put_session (bfd_main_t *bm, bfd_session_t *bs)
 
bfd_session_tbfd_find_session_by_idx (bfd_main_t *bm, uword bs_idx)
 
bfd_session_tbfd_find_session_by_disc (bfd_main_t *bm, u32 disc)
 
void bfd_session_start (bfd_main_t *bm, bfd_session_t *bs)
 
void bfd_consume_pkt (vlib_main_t *vm, bfd_main_t *bm, const bfd_pkt_t *bfd, u32 bs_idx)
 
int bfd_consume_echo_pkt (vlib_main_t *vm, bfd_main_t *bm, vlib_buffer_t *b)
 
int bfd_verify_pkt_common (const bfd_pkt_t *pkt)
 verify bfd packet - common checks More...
 
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 More...
 
void bfd_event (bfd_main_t *bm, bfd_session_t *bs)
 
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)
 
u8format_bfd_session (u8 *s, va_list *args)
 
u8format_bfd_session_brief (u8 *s, va_list *args)
 
u8format_bfd_auth_key (u8 *s, va_list *args)
 
void bfd_session_set_flags (vlib_main_t *vm, bfd_session_t *bs, u8 admin_up_down)
 
unsigned bfd_auth_type_supported (bfd_auth_type_e auth_type)
 
vnet_api_error_t bfd_auth_activate (bfd_session_t *bs, u32 conf_key_id, u8 bfd_key_id, u8 is_delayed)
 
vnet_api_error_t bfd_auth_deactivate (bfd_session_t *bs, u8 is_delayed)
 
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)
 
u32 bfd_nsec_to_usec (u64 nsec)
 
const char * bfd_poll_state_string (bfd_poll_state_e state)
 
void bfd_register_listener (bfd_notify_fn_t fn)
 Register a callback function to receive session notifications. More...
 

Variables

bfd_main_t bfd_main
 

Detailed Description

BFD global declarations.

Definition in file bfd_main.h.

Macro Definition Documentation

◆ BFD_DEFAULT_DESIRED_MIN_TX_USEC

#define BFD_DEFAULT_DESIRED_MIN_TX_USEC   USEC_PER_SEC

default, slow transmission interval for BFD packets, per spec at least 1s

Definition at line 452 of file bfd_main.h.

◆ BFD_REQUIRED_MIN_RX_USEC_WHILE_ECHO

#define BFD_REQUIRED_MIN_RX_USEC_WHILE_ECHO   USEC_PER_SEC

minimum required min rx set locally when echo function is used, per spec should be set to at least 1s

Definition at line 458 of file bfd_main.h.

◆ BFD_TW_TPS

#define BFD_TW_TPS   (MSEC_PER_SEC)

timing wheel tick-rate, 1ms should be good enough

Definition at line 449 of file bfd_main.h.

◆ F [1/5]

#define F (   x)    BFD_MODE_##x,

Definition at line 335 of file bfd_main.h.

◆ F [2/5]

#define F (   x)    BFD_POLL_##x,

Definition at line 335 of file bfd_main.h.

◆ F [3/5]

#define F (   sym,
  str 
)    BFD_HOP_TYPE_##sym,

Definition at line 335 of file bfd_main.h.

◆ F [4/5]

#define F (   sym,
  str 
)    BFD_LISTEN_EVENT_##sym,

Definition at line 335 of file bfd_main.h.

◆ F [5/5]

#define F (   sym,
  str 
)    BFD_ERROR_##sym,

Definition at line 335 of file bfd_main.h.

◆ foreach_bfd_error

#define foreach_bfd_error (   F)
Value:
F (NONE, "good bfd packets (processed)") \
F (BAD, "invalid bfd packets") \
F (DISABLED, "bfd packets received on disabled interfaces")
#define F(x)
Definition: bfd_main.h:335

Packet counters.

Definition at line 328 of file bfd_main.h.

◆ foreach_bfd_hop

#define foreach_bfd_hop (   F)
Value:
F (SINGLE, "single") \
F (MULTI, "multi") \
#define F(x)
Definition: bfd_main.h:335

hop types

Definition at line 74 of file bfd_main.h.

◆ foreach_bfd_listen_event

#define foreach_bfd_listen_event (   F)
Value:
F (CREATE, "sesion-created") \
F (UPDATE, "session-updated") \
F (DELETE, "session-deleted")
#define F(x)
Definition: bfd_main.h:335

listener events

Definition at line 248 of file bfd_main.h.

◆ foreach_bfd_mode

#define foreach_bfd_mode (   F)
Value:
F (asynchronous) \
F (demand)
#define F(x)
Definition: bfd_main.h:335

Definition at line 29 of file bfd_main.h.

◆ foreach_bfd_poll_state

#define foreach_bfd_poll_state (   F)
Value:
F (NOT_NEEDED) \
F (NEEDED) \
F (IN_PROGRESS) \
F (IN_PROGRESS_AND_QUEUED)
#define F(x)
Definition: bfd_main.h:335

Definition at line 58 of file bfd_main.h.

◆ MSEC_PER_SEC

#define MSEC_PER_SEC   (1000LL)

Definition at line 442 of file bfd_main.h.

◆ NSEC_PER_SEC

#define NSEC_PER_SEC   (NSEC_PER_USEC * USEC_PER_SEC)

Definition at line 445 of file bfd_main.h.

◆ NSEC_PER_USEC

#define NSEC_PER_USEC   (1000LL)

Definition at line 443 of file bfd_main.h.

◆ SEC_PER_NSEC

#define SEC_PER_NSEC   ((f64)1/NSEC_PER_SEC)

Definition at line 446 of file bfd_main.h.

◆ USEC_PER_MS

#define USEC_PER_MS   (1000LL)

Definition at line 441 of file bfd_main.h.

◆ USEC_PER_SEC

#define USEC_PER_SEC   (MSEC_PER_SEC * USEC_PER_MS)

Definition at line 444 of file bfd_main.h.

Typedef Documentation

◆ bfd_notify_fn_t

typedef void(* bfd_notify_fn_t) (bfd_listen_event_e, const bfd_session_t *)

session nitification call back function type

Definition at line 263 of file bfd_main.h.

◆ bfd_session_t

typedef struct bfd_session_s bfd_session_t

Enumeration Type Documentation

◆ bfd_error_t

Enumerator
foreach_bfd_error 

Definition at line 333 of file bfd_main.h.

◆ bfd_hop_type_e

Enumerator
foreach_bfd_hop 

Definition at line 78 of file bfd_main.h.

◆ bfd_listen_event_e

Enumerator
foreach_bfd_listen_event 

Definition at line 253 of file bfd_main.h.

◆ bfd_mode_e

enum bfd_mode_e
Enumerator
foreach_bfd_mode 

Definition at line 33 of file bfd_main.h.

◆ bfd_poll_state_e

Enumerator
foreach_bfd_poll_state 

Definition at line 64 of file bfd_main.h.

◆ bfd_process_event_e

Enumerator
BFD_EVENT_RESCHEDULE 
BFD_EVENT_NEW_SESSION 
BFD_EVENT_CONFIG_CHANGED 

Definition at line 348 of file bfd_main.h.

Function Documentation

◆ bfd_auth_activate()

vnet_api_error_t bfd_auth_activate ( bfd_session_t bs,
u32  conf_key_id,
u8  bfd_key_id,
u8  is_delayed 
)

Definition at line 2040 of file bfd_main.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bfd_auth_deactivate()

vnet_api_error_t bfd_auth_deactivate ( bfd_session_t bs,
u8  is_delayed 
)

Definition at line 2089 of file bfd_main.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bfd_auth_type_supported()

unsigned bfd_auth_type_supported ( bfd_auth_type_e  auth_type)

Definition at line 2029 of file bfd_main.c.

+ Here is the caller graph for this function:

◆ bfd_consume_echo_pkt()

int bfd_consume_echo_pkt ( vlib_main_t vm,
bfd_main_t bm,
vlib_buffer_t b 
)

Definition at line 1946 of file bfd_main.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bfd_consume_pkt()

void bfd_consume_pkt ( vlib_main_t vm,
bfd_main_t bm,
const bfd_pkt_t *  bfd,
u32  bs_idx 
)

Definition at line 1812 of file bfd_main.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bfd_event()

void bfd_event ( bfd_main_t bm,
bfd_session_t bs 
)

Definition at line 178 of file bfd_api.c.

+ Here is the caller graph for this function:

◆ bfd_find_session_by_disc()

bfd_session_t* bfd_find_session_by_disc ( bfd_main_t bm,
u32  disc 
)

Definition at line 1434 of file bfd_main.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bfd_find_session_by_idx()

bfd_session_t* bfd_find_session_by_idx ( bfd_main_t bm,
uword  bs_idx 
)

Definition at line 1423 of file bfd_main.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bfd_get_session()

bfd_session_t* bfd_get_session ( bfd_main_t bm,
bfd_transport_e  t 
)

Definition at line 1368 of file bfd_main.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bfd_init_final_control_frame()

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 
)

Definition at line 1039 of file bfd_main.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bfd_input_format_trace()

u8* bfd_input_format_trace ( u8 s,
va_list *  args 
)

Definition at line 495 of file bfd_main.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bfd_lock()

static void bfd_lock ( bfd_main_t bm)
inlinestatic

Definition at line 368 of file bfd_main.h.

+ Here is the caller graph for this function:

◆ bfd_lock_check()

static void bfd_lock_check ( bfd_main_t bm)
inlinestatic

Definition at line 401 of file bfd_main.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bfd_nsec_to_usec()

u32 bfd_nsec_to_usec ( u64  nsec)

Definition at line 61 of file bfd_main.c.

+ Here is the caller graph for this function:

◆ bfd_poll_state_string()

const char* bfd_poll_state_string ( bfd_poll_state_e  state)

Definition at line 157 of file bfd_main.c.

+ Here is the caller graph for this function:

◆ bfd_put_session()

void bfd_put_session ( bfd_main_t bm,
bfd_session_t bs 
)

Definition at line 1402 of file bfd_main.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bfd_register_listener()

void bfd_register_listener ( bfd_notify_fn_t  fn)

Register a callback function to receive session notifications.

Definition at line 1326 of file bfd_main.c.

+ Here is the caller graph for this function:

◆ bfd_session_set_flags()

void bfd_session_set_flags ( vlib_main_t vm,
bfd_session_t bs,
u8  admin_up_down 
)

Definition at line 468 of file bfd_main.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bfd_session_set_params()

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 
)

Definition at line 2131 of file bfd_main.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bfd_session_start()

void bfd_session_start ( bfd_main_t bm,
bfd_session_t bs 
)

Definition at line 455 of file bfd_main.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bfd_unlock()

static void bfd_unlock ( bfd_main_t bm)
inlinestatic

Definition at line 385 of file bfd_main.h.

+ Here is the caller graph for this function:

◆ bfd_verify_pkt_auth()

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

Parameters
pkt
Returns
1 if bfd packet is valid

Definition at line 1733 of file bfd_main.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bfd_verify_pkt_common()

int bfd_verify_pkt_common ( const bfd_pkt_t *  pkt)

verify bfd packet - common checks

Parameters
pkt
Returns
1 if bfd packet is valid

Definition at line 1453 of file bfd_main.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CLIB_PACKED()

typedef CLIB_PACKED ( struct { u32 discriminator;u64 expire_time_nsec;u64 checksum;}  )

echo packet structure

◆ format_bfd_auth_key()

u8* format_bfd_auth_key ( u8 s,
va_list *  args 
)

Definition at line 78 of file bfd_main.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_bfd_session()

u8* format_bfd_session ( u8 s,
va_list *  args 
)

Definition at line 1982 of file bfd_main.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_bfd_session_brief()

u8* format_bfd_session_brief ( u8 s,
va_list *  args 
)

Definition at line 2018 of file bfd_main.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ bfd_main

bfd_main_t bfd_main

Definition at line 2288 of file bfd_main.c.