FD.io VPP  v17.01.1-3-gc6833f8
Vector Packet Processing
bfd_main.c File Reference

BFD nodes implementation. More...

+ Include dependency graph for bfd_main.c:

Go to the source code of this file.

Macros

#define F(t, n)   BFD_OUTPUT_##t,
 
#define F(t, n)   [BFD_TRANSPORT_##t] = BFD_OUTPUT_##t,
 
#define F(n, t, s)
 
#define F(n, t, s)
 
#define F(t, n)   [BFD_OUTPUT_##t] = n,
 

Enumerations

enum  bfd_output_next_t { foreach_bfd_transport }
 
enum  bfd_input_next_t { BFD_INPUT_NEXT_NORMAL, BFD_INPUT_N_NEXT }
 

Functions

static u64 bfd_us_to_clocks (bfd_main_t *bm, u64 us)
 
static void bfd_on_state_change (bfd_main_t *bm, bfd_session_t *bs, u64 now, int handling_wakeup)
 
static void bfd_set_defaults (bfd_main_t *bm, bfd_session_t *bs)
 
static void bfd_set_diag (bfd_session_t *bs, bfd_diag_code_e code)
 
static void bfd_set_state (bfd_main_t *bm, bfd_session_t *bs, bfd_state_e new_state, int handling_wakeup)
 
static void bfd_recalc_tx_interval (bfd_main_t *bm, bfd_session_t *bs)
 
static void bfd_calc_next_tx (bfd_main_t *bm, bfd_session_t *bs, u64 now)
 
static void bfd_recalc_detection_time (bfd_main_t *bm, bfd_session_t *bs)
 
static void bfd_set_timer (bfd_main_t *bm, bfd_session_t *bs, u64 now, int handling_wakeup)
 
static void bfd_set_desired_min_tx (bfd_main_t *bm, bfd_session_t *bs, u64 now, u32 desired_min_tx_us, int handling_wakeup)
 
static void bfd_set_remote_required_min_rx (bfd_main_t *bm, bfd_session_t *bs, u64 now, u32 remote_required_min_rx_us, int handling_wakeup)
 
void bfd_session_start (bfd_main_t *bm, bfd_session_t *bs)
 
vnet_api_error_t bfd_del_session (uword bs_idx)
 
const char * bfd_diag_code_string (bfd_diag_code_e diag)
 
const char * bfd_state_string (bfd_state_e state)
 
vnet_api_error_t bfd_session_set_flags (u32 bs_idx, u8 admin_up_down)
 
u8bfd_input_format_trace (u8 *s, va_list *args)
 
static void bfd_add_transport_layer (vlib_main_t *vm, vlib_buffer_t *b, bfd_session_t *bs)
 
static vlib_buffer_tbfd_create_frame (vlib_main_t *vm, vlib_node_runtime_t *rt, bfd_session_t *bs)
 
static void bfd_init_control_frame (vlib_buffer_t *b, bfd_session_t *bs)
 
static void bfd_send_periodic (vlib_main_t *vm, vlib_node_runtime_t *rt, bfd_main_t *bm, bfd_session_t *bs, u64 now, int handling_wakeup)
 
void bfd_send_final (vlib_main_t *vm, vlib_buffer_t *b, bfd_session_t *bs)
 
static void bfd_check_rx_timeout (bfd_main_t *bm, bfd_session_t *bs, u64 now, int handling_wakeup)
 
void bfd_on_timeout (vlib_main_t *vm, vlib_node_runtime_t *rt, bfd_main_t *bm, bfd_session_t *bs, u64 now)
 
static uword bfd_process (vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
 
static clib_error_tbfd_sw_interface_up_down (vnet_main_t *vnm, u32 sw_if_index, u32 flags)
 
 VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION (bfd_sw_interface_up_down)
 
static clib_error_tbfd_hw_interface_up_down (vnet_main_t *vnm, u32 hw_if_index, u32 flags)
 
 VNET_HW_INTERFACE_LINK_UP_DOWN_FUNCTION (bfd_hw_interface_up_down)
 
static clib_error_tbfd_main_init (vlib_main_t *vm)
 
bfd_session_tbfd_get_session (bfd_main_t *bm, bfd_transport_t 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)
 
int bfd_verify_pkt_common (const bfd_pkt_t *pkt)
 verify bfd packet - common checks More...
 
int bfd_verify_pkt_session (const bfd_pkt_t *pkt, u16 pkt_size, const bfd_session_t *bs)
 verify bfd packet - authentication More...
 
void bfd_consume_pkt (bfd_main_t *bm, const bfd_pkt_t *pkt, u32 bs_idx)
 
u8format_bfd_session (u8 *s, va_list *args)
 

Variables

static vlib_node_registration_t bfd_process_node
 (constructor) VLIB_REGISTER_NODE (bfd_process_node) More...
 
static u32 bfd_next_index_by_transport []
 
bfd_main_t bfd_main
 

Detailed Description

BFD nodes implementation.

Definition in file bfd_main.c.

Macro Definition Documentation

#define F (   t,
 
)    BFD_OUTPUT_##t,

Definition at line 39 of file bfd_main.c.

#define F (   t,
 
)    [BFD_TRANSPORT_##t] = BFD_OUTPUT_##t,

Definition at line 39 of file bfd_main.c.

#define F (   n,
  t,
 
)
Value:
case BFD_DIAG_CODE_NAME (t): \
return s;
#define BFD_DIAG_CODE_NAME(t)
Definition: bfd_protocol.h:117

Definition at line 39 of file bfd_main.c.

#define F (   n,
  t,
 
)
Value:
case BFD_STATE_NAME (t): \
return s;
#define BFD_STATE_NAME(t)
Definition: bfd_protocol.h:135

Definition at line 39 of file bfd_main.c.

#define F (   t,
 
)    [BFD_OUTPUT_##t] = n,

Definition at line 39 of file bfd_main.c.

Enumeration Type Documentation

Enumerator
BFD_INPUT_NEXT_NORMAL 
BFD_INPUT_N_NEXT 

Definition at line 56 of file bfd_main.c.

Enumerator
foreach_bfd_transport 

Definition at line 37 of file bfd_main.c.

Function Documentation

static void bfd_add_transport_layer ( vlib_main_t vm,
vlib_buffer_t b,
bfd_session_t bs 
)
static

Definition at line 425 of file bfd_main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void bfd_calc_next_tx ( bfd_main_t bm,
bfd_session_t bs,
u64  now 
)
static

Definition at line 122 of file bfd_main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void bfd_check_rx_timeout ( bfd_main_t bm,
bfd_session_t bs,
u64  now,
int  handling_wakeup 
)
static

Definition at line 543 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 *  pkt,
u32  bs_idx 
)

Definition at line 875 of file bfd_main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static vlib_buffer_t* bfd_create_frame ( vlib_main_t vm,
vlib_node_runtime_t rt,
bfd_session_t bs 
)
static

Definition at line 440 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_del_session ( uword  bs_idx)

Definition at line 288 of file bfd_main.c.

const char* bfd_diag_code_string ( bfd_diag_code_e  diag)

Definition at line 306 of file bfd_main.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 774 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 764 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_t  t 
)

Definition at line 743 of file bfd_main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* bfd_hw_interface_up_down ( vnet_main_t vnm,
u32  hw_if_index,
u32  flags 
)
static

Definition at line 708 of file bfd_main.c.

+ Here is the call graph for this function:

static void bfd_init_control_frame ( vlib_buffer_t b,
bfd_session_t bs 
)
static

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:

u8* bfd_input_format_trace ( u8 s,
va_list *  args 
)

Definition at line 354 of file bfd_main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* bfd_main_init ( vlib_main_t vm)
static

Definition at line 724 of file bfd_main.c.

+ Here is the call graph for this function:

static void bfd_on_state_change ( bfd_main_t bm,
bfd_session_t bs,
u64  now,
int  handling_wakeup 
)
static

Definition at line 392 of file bfd_main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void bfd_on_timeout ( vlib_main_t vm,
vlib_node_runtime_t rt,
bfd_main_t bm,
bfd_session_t bs,
u64  now 
)

Definition at line 558 of file bfd_main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword bfd_process ( vlib_main_t vm,
vlib_node_runtime_t rt,
vlib_frame_t f 
)
static

Definition at line 588 of file bfd_main.c.

+ Here is the call graph for this function:

void bfd_put_session ( bfd_main_t bm,
bfd_session_t bs 
)

Definition at line 757 of file bfd_main.c.

+ Here is the caller graph for this function:

static void bfd_recalc_detection_time ( bfd_main_t bm,
bfd_session_t bs 
)
static

Definition at line 178 of file bfd_main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void bfd_recalc_tx_interval ( bfd_main_t bm,
bfd_session_t bs 
)
static

Definition at line 105 of file bfd_main.c.

+ Here is the caller graph for this function:

void bfd_send_final ( vlib_main_t vm,
vlib_buffer_t b,
bfd_session_t bs 
)

Definition at line 534 of file bfd_main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void bfd_send_periodic ( vlib_main_t vm,
vlib_node_runtime_t rt,
bfd_main_t bm,
bfd_session_t bs,
u64  now,
int  handling_wakeup 
)
static

Definition at line 493 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_flags ( u32  bs_idx,
u8  admin_up_down 
)

Definition at line 332 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 279 of file bfd_main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void bfd_set_defaults ( bfd_main_t bm,
bfd_session_t bs 
)
static

Definition at line 66 of file bfd_main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void bfd_set_desired_min_tx ( bfd_main_t bm,
bfd_session_t bs,
u64  now,
u32  desired_min_tx_us,
int  handling_wakeup 
)
static

Definition at line 248 of file bfd_main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void bfd_set_diag ( bfd_session_t bs,
bfd_diag_code_e  code 
)
static

Definition at line 80 of file bfd_main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void bfd_set_remote_required_min_rx ( bfd_main_t bm,
bfd_session_t bs,
u64  now,
u32  remote_required_min_rx_us,
int  handling_wakeup 
)
static

Definition at line 263 of file bfd_main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void bfd_set_state ( bfd_main_t bm,
bfd_session_t bs,
bfd_state_e  new_state,
int  handling_wakeup 
)
static

Definition at line 91 of file bfd_main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void bfd_set_timer ( bfd_main_t bm,
bfd_session_t bs,
u64  now,
int  handling_wakeup 
)
static

Definition at line 201 of file bfd_main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const char* bfd_state_string ( bfd_state_e  state)

Definition at line 319 of file bfd_main.c.

+ Here is the caller graph for this function:

static clib_error_t* bfd_sw_interface_up_down ( vnet_main_t vnm,
u32  sw_if_index,
u32  flags 
)
static

Definition at line 694 of file bfd_main.c.

+ Here is the call graph for this function:

static u64 bfd_us_to_clocks ( bfd_main_t bm,
u64  us 
)
static

Definition at line 30 of file bfd_main.c.

+ 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 792 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_session ( const bfd_pkt_t *  pkt,
u16  pkt_size,
const bfd_session_t bs 
)

verify bfd packet - authentication

Parameters
pkt
Returns
1 if bfd packet is valid

Definition at line 848 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 939 of file bfd_main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

VNET_HW_INTERFACE_LINK_UP_DOWN_FUNCTION ( bfd_hw_interface_up_down  )

+ Here is the caller graph for this function:

VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION ( bfd_sw_interface_up_down  )

+ Here is the caller graph for this function:

Variable Documentation

bfd_main_t bfd_main

Definition at line 961 of file bfd_main.c.

u32 bfd_next_index_by_transport[]
static
Initial value:
= {
#define F(t, n)
}
#define F(t, n)
Definition: bfd_main.c:39

Definition at line 45 of file bfd_main.c.

static vlib_node_registration_t bfd_process_node
static
Initial value:
= {
.function = bfd_process,
.name = "bfd-process",
.n_next_nodes = BFD_OUTPUT_N_NEXT,
.next_nodes =
{
#define F(t, n)
},
}
static uword bfd_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
Definition: bfd_main.c:588
#define F(t, n)
Definition: bfd_main.c:39

(constructor) VLIB_REGISTER_NODE (bfd_process_node)

Definition at line 35 of file bfd_main.c.