FD.io VPP  v18.11-rc0-18-g2a3fb1a
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 USEC_PER_SECOND   (1000 * USEC_PER_MS)
 
#define BFD_DEFAULT_DESIRED_MIN_TX_USEC   USEC_PER_SECOND
 default, slow transmission interval for BFD packets, per spec at least 1s More...
 
#define BFD_REQUIRED_MIN_RX_USEC_WHILE_ECHO   USEC_PER_SECOND
 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_EVENT_RESCHEDULE = 1, BFD_EVENT_NEW_SESSION, BFD_EVENT_CONFIG_CHANGED }
 

Functions

typedef CLIB_PACKED (struct{u32 discriminator;u64 expire_time_clocks;u64 checksum;}) bfd_echo_pkt_t
 echo packet structure More...
 
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 (bfd_main_t *bm, const bfd_pkt_t *bfd, u32 bs_idx)
 
int bfd_consume_echo_pkt (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 (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 (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_clocks_to_usec (const bfd_main_t *bm, u64 clocks)
 
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
 
enum { ... }  bfd_process_event_e
 

Detailed Description

BFD global declarations.

Definition in file bfd_main.h.

Macro Definition Documentation

#define BFD_DEFAULT_DESIRED_MIN_TX_USEC   USEC_PER_SECOND

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

Definition at line 384 of file bfd_main.h.

#define BFD_REQUIRED_MIN_RX_USEC_WHILE_ECHO   USEC_PER_SECOND

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

Definition at line 390 of file bfd_main.h.

#define F (   x)    BFD_MODE_##x,

Definition at line 317 of file bfd_main.h.

#define F (   x)    BFD_POLL_##x,

Definition at line 317 of file bfd_main.h.

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

Definition at line 317 of file bfd_main.h.

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

Definition at line 317 of file bfd_main.h.

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

Definition at line 317 of file bfd_main.h.

#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:317

Packet counters.

Definition at line 310 of file bfd_main.h.

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

hop types

Definition at line 73 of file bfd_main.h.

#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:317

listener events

Definition at line 244 of file bfd_main.h.

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

Definition at line 28 of file bfd_main.h.

#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:317

Definition at line 57 of file bfd_main.h.

#define USEC_PER_MS   1000LL

Definition at line 380 of file bfd_main.h.

#define USEC_PER_SECOND   (1000 * USEC_PER_MS)

Definition at line 381 of file bfd_main.h.

Typedef Documentation

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

session nitification call back function type

Definition at line 259 of file bfd_main.h.

typedef struct bfd_session_s bfd_session_t

Enumeration Type Documentation

anonymous enum
Enumerator
BFD_EVENT_RESCHEDULE 
BFD_EVENT_NEW_SESSION 
BFD_EVENT_CONFIG_CHANGED 

Definition at line 330 of file bfd_main.h.

Enumerator
foreach_bfd_error 

Definition at line 315 of file bfd_main.h.

Enumerator
foreach_bfd_hop 

Definition at line 77 of file bfd_main.h.

Enumerator
foreach_bfd_listen_event 

Definition at line 249 of file bfd_main.h.

enum bfd_mode_e
Enumerator
foreach_bfd_mode 

Definition at line 32 of file bfd_main.h.

Enumerator
foreach_bfd_poll_state 

Definition at line 63 of file bfd_main.h.

Function Documentation

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 1847 of file bfd_main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

vnet_api_error_t bfd_auth_deactivate ( bfd_session_t bs,
u8  is_delayed 
)

Definition at line 1896 of file bfd_main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

unsigned bfd_auth_type_supported ( bfd_auth_type_e  auth_type)

Definition at line 1836 of file bfd_main.c.

+ Here is the caller graph for this function:

u32 bfd_clocks_to_usec ( const bfd_main_t bm,
u64  clocks 
)

Definition at line 60 of file bfd_main.c.

+ Here is the caller graph for this function:

int bfd_consume_echo_pkt ( bfd_main_t bm,
vlib_buffer_t b 
)

Definition at line 1753 of file bfd_main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 1621 of file bfd_main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void bfd_event ( bfd_main_t bm,
bfd_session_t bs 
)

Definition at line 198 of file bfd_api.c.

+ Here is the caller graph for this function:

bfd_session_t* bfd_find_session_by_disc ( bfd_main_t bm,
u32  disc 
)

Definition at line 1244 of file bfd_main.c.

+ Here is the caller graph for this function:

bfd_session_t* bfd_find_session_by_idx ( bfd_main_t bm,
uword  bs_idx 
)

Definition at line 1234 of file bfd_main.c.

+ Here is the caller graph for this function:

bfd_session_t* bfd_get_session ( bfd_main_t bm,
bfd_transport_e  t 
)

Definition at line 1187 of file bfd_main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 904 of file bfd_main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* bfd_input_format_trace ( u8 s,
va_list *  args 
)

Definition at line 445 of file bfd_main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const char* bfd_poll_state_string ( bfd_poll_state_e  state)

Definition at line 146 of file bfd_main.c.

+ Here is the caller graph for this function:

void bfd_put_session ( bfd_main_t bm,
bfd_session_t bs 
)

Definition at line 1216 of file bfd_main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void bfd_register_listener ( bfd_notify_fn_t  fn)

Register a callback function to receive session notifications.

Definition at line 1149 of file bfd_main.c.

+ Here is the caller graph for this function:

void bfd_session_set_flags ( bfd_session_t bs,
u8  admin_up_down 
)

Definition at line 418 of file bfd_main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 1938 of file bfd_main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void bfd_session_start ( bfd_main_t bm,
bfd_session_t bs 
)

Definition at line 404 of file bfd_main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int bfd_verify_pkt_auth ( 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 1543 of file bfd_main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 1262 of file bfd_main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

echo packet structure

u8* format_bfd_auth_key ( u8 s,
va_list *  args 
)

Definition at line 68 of file bfd_main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_bfd_session ( u8 s,
va_list *  args 
)

Definition at line 1789 of file bfd_main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_bfd_session_brief ( u8 s,
va_list *  args 
)

Definition at line 1825 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_t bfd_main

Definition at line 2096 of file bfd_main.c.

enum { ... } bfd_process_event_e