FD.io VPP  v20.01-48-g3e0dafb74
Vector Packet Processing
bfd_protocol.h File Reference

BFD protocol declarations. More...

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

Go to the source code of this file.

Macros

#define foreach_bfd_auth_type(F)
 
#define BFD_AUTH_TYPE_NAME(t)   BFD_AUTH_TYPE_##t
 
#define F(n, l, t, s)   BFD_AUTH_TYPE_NAME (t) = n,
 
#define foreach_bfd_diag_code(F)
 
#define BFD_DIAG_CODE_NAME(t)   BFD_DIAG_CODE_##t
 
#define F(n, t, s)   BFD_DIAG_CODE_NAME (t) = n,
 
#define foreach_bfd_state(F)
 
#define BFD_STATE_NAME(t)   BFD_STATE_##t
 
#define F(n, t, s)   BFD_STATE_NAME (t) = n,
 

Enumerations

enum  bfd_auth_type_e { foreach_bfd_auth_type =(F) }
 
enum  bfd_diag_code_e { foreach_bfd_diag_code =(F) }
 
enum  bfd_state_e { foreach_bfd_state =(F) }
 

Functions

u32 bfd_max_key_len_for_auth_type (bfd_auth_type_e auth_type)
 get the maximum length of key data for given auth type More...
 
const char * bfd_auth_type_str (bfd_auth_type_e auth_type)
 
typedef CLIB_PACKED (struct { u8 type;u8 len;}) bfd_auth_common_t
 
typedef CLIB_PACKED (struct { bfd_auth_common_t type_len;u8 key_id;u8 reserved;u32 seq_num;u8 hash[20];}) bfd_auth_sha1_t
 
typedef CLIB_PACKED (struct { struct { u8 vers_diag;u8 sta_flags;u8 detect_mult;u8 length;} head;u32 my_disc;u32 your_disc;u32 des_min_tx;u32 req_min_rx;u32 req_min_echo_rx;}) bfd_pkt_t
 
typedef CLIB_PACKED (struct { bfd_pkt_t pkt;bfd_auth_common_t common_auth;}) bfd_pkt_with_common_auth_t
 
typedef CLIB_PACKED (struct { bfd_pkt_t pkt;bfd_auth_sha1_t sha1_auth;}) bfd_pkt_with_sha1_auth_t
 
u8 bfd_pkt_get_version (const bfd_pkt_t *pkt)
 
void bfd_pkt_set_version (bfd_pkt_t *pkt, int version)
 
u8 bfd_pkt_get_diag_code (const bfd_pkt_t *pkt)
 
void bfd_pkt_set_diag_code (bfd_pkt_t *pkt, int value)
 
u8 bfd_pkt_get_state (const bfd_pkt_t *pkt)
 
void bfd_pkt_set_state (bfd_pkt_t *pkt, int value)
 
u8 bfd_pkt_get_poll (const bfd_pkt_t *pkt)
 
void bfd_pkt_set_final (bfd_pkt_t *pkt)
 
u8 bfd_pkt_get_final (const bfd_pkt_t *pkt)
 
void bfd_pkt_set_poll (bfd_pkt_t *pkt)
 
u8 bfd_pkt_get_control_plane_independent (const bfd_pkt_t *pkt)
 
void bfd_pkt_set_control_plane_independent (bfd_pkt_t *pkt)
 
u8 bfd_pkt_get_auth_present (const bfd_pkt_t *pkt)
 
void bfd_pkt_set_auth_present (bfd_pkt_t *pkt)
 
u8 bfd_pkt_get_demand (const bfd_pkt_t *pkt)
 
void bfd_pkt_set_demand (bfd_pkt_t *pkt)
 
u8 bfd_pkt_get_multipoint (const bfd_pkt_t *pkt)
 
void bfd_pkt_set_multipoint (bfd_pkt_t *pkt)
 
const char * bfd_diag_code_string (bfd_diag_code_e diag)
 
const char * bfd_state_string (bfd_state_e state)
 

Detailed Description

BFD protocol declarations.

Definition in file bfd_protocol.h.

Macro Definition Documentation

◆ BFD_AUTH_TYPE_NAME

#define BFD_AUTH_TYPE_NAME (   t)    BFD_AUTH_TYPE_##t

Definition at line 34 of file bfd_protocol.h.

◆ BFD_DIAG_CODE_NAME

#define BFD_DIAG_CODE_NAME (   t)    BFD_DIAG_CODE_##t

Definition at line 175 of file bfd_protocol.h.

◆ BFD_STATE_NAME

#define BFD_STATE_NAME (   t)    BFD_STATE_##t

Definition at line 193 of file bfd_protocol.h.

◆ F [1/3]

#define F (   n,
  l,
  t,
 
)    BFD_AUTH_TYPE_NAME (t) = n,

Definition at line 197 of file bfd_protocol.h.

◆ F [2/3]

#define F (   n,
  t,
 
)    BFD_DIAG_CODE_NAME (t) = n,

Definition at line 197 of file bfd_protocol.h.

◆ F [3/3]

#define F (   n,
  t,
 
)    BFD_STATE_NAME (t) = n,

Definition at line 197 of file bfd_protocol.h.

◆ foreach_bfd_auth_type

#define foreach_bfd_auth_type (   F)
Value:
F (0, 0, reserved, "Reserved") \
F (1, 16, simple_password, "Simple Password") \
F (2, 16, keyed_md5, "Keyed MD5") \
F (3, 16, meticulous_keyed_md5, "Meticulous Keyed MD5") \
F (4, 20, keyed_sha1, "Keyed SHA1") \
F (5, 20, meticulous_keyed_sha1, "Meticulous Keyed SHA1")
#define F(n, l, t, s)
Definition: bfd_protocol.h:197

Definition at line 26 of file bfd_protocol.h.

◆ foreach_bfd_diag_code

#define foreach_bfd_diag_code (   F)
Value:
F (0, no_diag, "No Diagnostic") \
F (1, det_time_exp, "Control Detection Time Expired") \
F (2, echo_failed, "Echo Function Failed") \
F (3, neighbor_sig_down, "Neighbor Signaled Session Down") \
F (4, fwd_plain_reset, "Forwarding Plane Reset") \
F (5, path_down, "Path Down") \
F (6, concat_path_down, "Concatenated Path Down") \
F (7, admin_down, "Administratively Down") \
F (8, reverse_concat_path_down, "Reverse Concatenated Path Down")
#define F(n, l, t, s)
Definition: bfd_protocol.h:197

Definition at line 164 of file bfd_protocol.h.

◆ foreach_bfd_state

#define foreach_bfd_state (   F)
Value:
F (0, admin_down, "AdminDown") \
F (1, down, "Down") \
F (2, init, "Init") \
F (3, up, "Up")
#define F(n, l, t, s)
Definition: bfd_protocol.h:197
static void init(void)
Definition: client.c:116

Definition at line 187 of file bfd_protocol.h.

Enumeration Type Documentation

◆ bfd_auth_type_e

Enumerator
foreach_bfd_auth_type 

Definition at line 36 of file bfd_protocol.h.

◆ bfd_diag_code_e

Enumerator
foreach_bfd_diag_code 

Definition at line 177 of file bfd_protocol.h.

◆ bfd_state_e

Enumerator
foreach_bfd_state 

Definition at line 195 of file bfd_protocol.h.

Function Documentation

◆ bfd_auth_type_str()

const char* bfd_auth_type_str ( bfd_auth_type_e  auth_type)

Definition at line 151 of file bfd_protocol.c.

+ Here is the caller graph for this function:

◆ bfd_diag_code_string()

const char* bfd_diag_code_string ( bfd_diag_code_e  diag)

Definition at line 164 of file bfd_protocol.c.

+ Here is the caller graph for this function:

◆ bfd_max_key_len_for_auth_type()

u32 bfd_max_key_len_for_auth_type ( bfd_auth_type_e  auth_type)

get the maximum length of key data for given auth type

Definition at line 138 of file bfd_protocol.c.

+ Here is the caller graph for this function:

◆ bfd_pkt_get_auth_present()

u8 bfd_pkt_get_auth_present ( const bfd_pkt_t *  pkt)

Definition at line 98 of file bfd_protocol.c.

+ Here is the caller graph for this function:

◆ bfd_pkt_get_control_plane_independent()

u8 bfd_pkt_get_control_plane_independent ( const bfd_pkt_t *  pkt)

Definition at line 84 of file bfd_protocol.c.

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

◆ bfd_pkt_get_demand()

u8 bfd_pkt_get_demand ( const bfd_pkt_t *  pkt)

Definition at line 110 of file bfd_protocol.c.

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

◆ bfd_pkt_get_diag_code()

u8 bfd_pkt_get_diag_code ( const bfd_pkt_t *  pkt)

Definition at line 35 of file bfd_protocol.c.

+ Here is the caller graph for this function:

◆ bfd_pkt_get_final()

u8 bfd_pkt_get_final ( const bfd_pkt_t *  pkt)

Definition at line 72 of file bfd_protocol.c.

+ Here is the caller graph for this function:

◆ bfd_pkt_get_multipoint()

u8 bfd_pkt_get_multipoint ( const bfd_pkt_t *  pkt)

Definition at line 124 of file bfd_protocol.c.

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

◆ bfd_pkt_get_poll()

u8 bfd_pkt_get_poll ( const bfd_pkt_t *  pkt)

Definition at line 60 of file bfd_protocol.c.

+ Here is the caller graph for this function:

◆ bfd_pkt_get_state()

u8 bfd_pkt_get_state ( const bfd_pkt_t *  pkt)

Definition at line 48 of file bfd_protocol.c.

+ Here is the caller graph for this function:

◆ bfd_pkt_get_version()

u8 bfd_pkt_get_version ( const bfd_pkt_t *  pkt)

Definition at line 22 of file bfd_protocol.c.

+ Here is the caller graph for this function:

◆ bfd_pkt_set_auth_present()

void bfd_pkt_set_auth_present ( bfd_pkt_t *  pkt)

Definition at line 104 of file bfd_protocol.c.

+ Here is the caller graph for this function:

◆ bfd_pkt_set_control_plane_independent()

void bfd_pkt_set_control_plane_independent ( bfd_pkt_t *  pkt)
+ Here is the caller graph for this function:

◆ bfd_pkt_set_demand()

void bfd_pkt_set_demand ( bfd_pkt_t *  pkt)
+ Here is the caller graph for this function:

◆ bfd_pkt_set_diag_code()

void bfd_pkt_set_diag_code ( bfd_pkt_t *  pkt,
int  value 
)

Definition at line 41 of file bfd_protocol.c.

+ Here is the caller graph for this function:

◆ bfd_pkt_set_final()

void bfd_pkt_set_final ( bfd_pkt_t *  pkt)

Definition at line 78 of file bfd_protocol.c.

+ Here is the caller graph for this function:

◆ bfd_pkt_set_multipoint()

void bfd_pkt_set_multipoint ( bfd_pkt_t *  pkt)
+ Here is the caller graph for this function:

◆ bfd_pkt_set_poll()

void bfd_pkt_set_poll ( bfd_pkt_t *  pkt)

Definition at line 66 of file bfd_protocol.c.

+ Here is the caller graph for this function:

◆ bfd_pkt_set_state()

void bfd_pkt_set_state ( bfd_pkt_t *  pkt,
int  value 
)

Definition at line 54 of file bfd_protocol.c.

+ Here is the caller graph for this function:

◆ bfd_pkt_set_version()

void bfd_pkt_set_version ( bfd_pkt_t *  pkt,
int  version 
)

Definition at line 28 of file bfd_protocol.c.

+ Here is the caller graph for this function:

◆ bfd_state_string()

const char* bfd_state_string ( bfd_state_e  state)

Definition at line 177 of file bfd_protocol.c.

+ Here is the caller graph for this function:

◆ CLIB_PACKED() [1/5]

typedef CLIB_PACKED ( struct { u8 type;u8 len;}  )

◆ CLIB_PACKED() [2/5]

typedef CLIB_PACKED ( struct { bfd_auth_common_t type_len;u8 key_id;u8 reserved;u32 seq_num;u8 hash[20];}  )

◆ CLIB_PACKED() [3/5]

typedef CLIB_PACKED ( struct { struct { u8 vers_diag;u8 sta_flags;u8 detect_mult;u8 length;} head;u32 my_disc;u32 your_disc;u32 des_min_tx;u32 req_min_rx;u32 req_min_echo_rx;}  )

◆ CLIB_PACKED() [4/5]

typedef CLIB_PACKED ( struct { bfd_pkt_t pkt;bfd_auth_common_t common_auth;}  )

◆ CLIB_PACKED() [5/5]

typedef CLIB_PACKED ( struct { bfd_pkt_t pkt;bfd_auth_sha1_t sha1_auth;}  )