26 #include <freeradius-devel/util/rand.h>
27 #include <freeradius-devel/util/log.h>
28 #include <freeradius-devel/util/pair.h>
29 #include <freeradius-devel/util/md5.h>
30 #include <freeradius-devel/util/sha1.h>
31 #include <freeradius-devel/util/dbuff.h>
61 #define BFD_AUTH_INVALID (BFD_AUTH_MET_KEYED_SHA1 + 1)
97 bfd_auth_basic_t basic;
98 bfd_auth_simple_t password;
100 bfd_auth_sha1_t sha1;
109 #ifdef WORDS_BIGENDIAN
110 unsigned int version : 3;
111 unsigned int diag : 5;
112 unsigned int state : 2;
113 unsigned int poll : 1;
114 unsigned int final : 1;
115 unsigned int control_plane_independent : 1;
116 unsigned int auth_present : 1;
117 unsigned int demand : 1;
118 unsigned int multipoint : 1;
141 #define FR_BFD_HEADER_LENGTH (24)
149 #define FR_BFD_CODE_MAX (4)
152 #define FR_BFD_PACKET_CODE_VALID(_code) (_code < FR_BFD_CODE_MAX)
163 uint8_t const *packet,
size_t packet_len,
164 char const *
secret,
size_t secret_len);
char const * fr_bfd_packet_names[FR_BFD_CODE_MAX]
TALLOC_CTX * tmp_ctx
for temporary things cleaned up during decoding
uint32_t required_min_rx_interval
unsigned int control_plane_independent
unsigned int auth_present
@ BFD_AUTH_MET_KEYED_SHA1
ssize_t fr_bfd_encode(uint8_t *packet, size_t packet_len, uint8_t const *original, char const *secret, size_t secret_len, fr_pair_list_t *vps)
int fr_bfd_global_init(void)
ssize_t fr_bfd_decode(TALLOC_CTX *ctx, fr_pair_list_t *out, uint8_t const *packet, size_t packet_len, char const *secret, size_t secret_len)
void fr_bfd_global_free(void)
@ BFD_FORWARD_PLANE_RESET
@ BFD_CONCATENATED_PATH_DOWN
@ BFD_REVERSE_CONCAT_PATH_DOWN
size_t const bfd_auth_type_table_len
char const * secret
shared secret. MUST be talloc'd
fr_table_num_ordered_t const bfd_auth_type_table[]
bool fr_bfd_packet_ok(char const **err, uint8_t const *packet, size_t packet_len)
uint32_t desired_min_tx_interval
uint32_t min_echo_rx_interval
#define MD5_DIGEST_LENGTH
#define SHA1_DIGEST_LENGTH
An element in an arbitrarily ordered array of name to num mappings.
static size_t char ** out