#include <freeradius-devel/radiusd.h>
#include <freeradius-devel/protocol.h>
#include <freeradius-devel/modules.h>
#include <freeradius-devel/rad_assert.h>
#include <freeradius-devel/event.h>
#include <freeradius-devel/md5.h>
#include <freeradius-devel/sha1.h>
Go to the source code of this file.
Data Structures | |
struct | bfd_auth_basic_t |
struct | bfd_auth_md5_t |
struct | bfd_auth_sha1_t |
struct | bfd_auth_simple_t |
union | bfd_auth_t |
struct | bfd_packet_t |
struct | bfd_state_t |
Macros | |
#define | BFD_AUTH_INVALID (BFD_AUTH_MET_KEYED_SHA1 + 1) |
#define | BFD_MAX_SECRET_LENGTH 20 |
#define | FORWARD len = strlen(buffer); if (len >= (bufsize + 1)) return 0;buffer += len;bufsize -= len |
#define | USEC (1000000) |
Typedefs | |
typedef struct bfd_auth_basic_t | bfd_auth_basic_t |
typedef struct bfd_auth_md5_t | bfd_auth_md5_t |
typedef struct bfd_auth_sha1_t | bfd_auth_sha1_t |
typedef struct bfd_auth_simple_t | bfd_auth_simple_t |
typedef union bfd_auth_t | bfd_auth_t |
typedef enum bfd_auth_type_t | bfd_auth_type_t |
typedef enum bfd_diag_t | bfd_diag_t |
typedef enum bfd_session_state_t | bfd_session_state_t |
typedef struct bfd_state_t | bfd_state_t |
Functions | |
struct bfd_packet_t | __attribute__ ((packed)) |
static void | bfd_auth_md5 (bfd_state_t *session, bfd_packet_t *bfd) |
static void | bfd_auth_sha1 (bfd_state_t *session, bfd_packet_t *bfd) |
static int | bfd_authenticate (bfd_state_t *session, bfd_packet_t *bfd) |
static void | bfd_calc_md5 (bfd_state_t *session, bfd_packet_t *bfd) |
static void | bfd_calc_sha1 (bfd_state_t *session, bfd_packet_t *bfd) |
static void | bfd_control_packet_init (bfd_state_t *session, bfd_packet_t *bfd) |
static void | bfd_detection_timeout (void *ctx, struct timeval *now) |
void | bfd_init (fr_event_list_t *xel) |
static int | bfd_init_sessions (CONF_SECTION *cs, bfd_socket_t *sock, int sockfd) |
static bfd_state_t * | bfd_new_session (bfd_socket_t *sock, int sockfd, CONF_SECTION *cs, const fr_ipaddr_t *ipaddr, uint16_t port) |
static int | bfd_parse_ip_port (CONF_SECTION *cs, fr_ipaddr_t *ipaddr, uint16_t *port) |
static ssize_t | bfd_parse_secret (CONF_SECTION *cs, uint8_t secret[BFD_MAX_SECRET_LENGTH]) |
static void | bfd_poll_response (bfd_state_t *session) |
static int | bfd_process (bfd_state_t *session, bfd_packet_t *bfd) |
static void | bfd_request (bfd_state_t *session, REQUEST *request, RADIUS_PACKET *packet) |
static void | bfd_send_packet (void *ctx, UNUSED struct timeval *now) |
static int | bfd_session_cmp (const void *one, const void *two) |
static void | bfd_session_free (void *ctx) |
static void | bfd_set_desired_min_tx_interval (bfd_state_t *session, uint32_t value) |
static void | bfd_set_timeout (bfd_state_t *session, struct timeval *when) |
static void | bfd_sign (bfd_state_t *session, bfd_packet_t *bfd) |
static int | bfd_socket_decode (UNUSED rad_listen_t *listener, UNUSED REQUEST *request) |
static int | bfd_socket_encode (UNUSED rad_listen_t *listener, UNUSED REQUEST *request) |
static void | bfd_socket_free (rad_listen_t *this) |
static int | bfd_socket_open (CONF_SECTION *cs, rad_listen_t *this) |
static int | bfd_socket_parse (CONF_SECTION *cs, rad_listen_t *this) |
static int | bfd_socket_print (const rad_listen_t *this, char *buffer, size_t bufsize) |
static int | bfd_socket_recv (rad_listen_t *listener) |
static int | bfd_socket_send (UNUSED rad_listen_t *listener, UNUSED REQUEST *request) |
static int | bfd_start_control (bfd_state_t *session) |
static int | bfd_start_packets (bfd_state_t *session) |
static int | bfd_start_poll (bfd_state_t *session) |
static int | bfd_stop_control (bfd_state_t *session) |
static int | bfd_stop_poll (bfd_state_t *session) |
static void | bfd_trigger (bfd_state_t *session) |
static int | bfd_verify_md5 (bfd_state_t *session, bfd_packet_t *bfd) |
static int | bfd_verify_sequence (bfd_state_t *session, uint32_t sequence_no, int keyed) |
static int | bfd_verify_sha1 (bfd_state_t *session, bfd_packet_t *bfd) |
Variables | |
bfd_auth_t | auth |
unsigned int | auth_present |
static const FR_NAME_NUMBER | auth_types [] |
bfd_socket_t | |
static const char * | bfd_state [] |
unsigned int | control_plane_independent |
unsigned int | demand |
uint32_t | desired_min_tx_interval |
uint8_t | detect_multi |
unsigned int | diag |
static fr_event_list_t * | el = NULL |
unsigned int | final |
uint8_t | length |
uint32_t | min_echo_rx_interval |
unsigned int | multipoint |
uint32_t | my_disc |
unsigned int | poll |
fr_protocol_t | proto_bfd |
uint32_t | required_min_rx_interval |
unsigned int | state |
unsigned int | version |
uint32_t | your_disc |
struct bfd_auth_basic_t |
Definition at line 132 of file proto_bfd.c.
Data Fields | ||
---|---|---|
uint8_t | auth_len | |
uint8_t | auth_type | |
uint8_t | key_id |
struct bfd_auth_md5_t |
Definition at line 146 of file proto_bfd.c.
Data Fields | ||
---|---|---|
uint8_t | auth_len | |
uint8_t | auth_type | |
uint8_t | digest[MD5_DIGEST_LENGTH] | |
uint8_t | key_id | |
uint8_t | reserved | |
uint32_t | sequence_no |
struct bfd_auth_sha1_t |
Definition at line 155 of file proto_bfd.c.
Data Fields | ||
---|---|---|
uint8_t | auth_len | |
uint8_t | auth_type | |
uint8_t | digest[SHA1_DIGEST_LENGTH] | |
uint8_t | key_id | |
uint8_t | reserved | |
uint32_t | sequence_no |
struct bfd_auth_simple_t |
Definition at line 139 of file proto_bfd.c.
Data Fields | ||
---|---|---|
uint8_t | auth_len | |
uint8_t | auth_type | |
uint8_t | key_id | |
uint8_t | password[16] |
union bfd_auth_t |
Definition at line 164 of file proto_bfd.c.
Data Fields | ||
---|---|---|
bfd_auth_basic_t | basic | |
bfd_auth_md5_t | md5 | |
bfd_auth_simple_t | password | |
bfd_auth_sha1_t | sha1 |
struct bfd_packet_t |
Definition at line 175 of file proto_bfd.c.
Data Fields | ||
---|---|---|
bfd_auth_t | auth | |
unsigned int | auth_present: 1 | |
unsigned int | control_plane_independent: 1 | |
unsigned int | demand: 1 | |
uint32_t | desired_min_tx_interval | |
uint8_t | detect_multi | |
unsigned int | diag: 5 | |
unsigned int | final: 1 | |
uint8_t | length | |
uint32_t | min_echo_rx_interval | |
unsigned int | multipoint: 1 | |
uint32_t | my_disc | |
unsigned int | poll: 1 | |
uint32_t | required_min_rx_interval | |
unsigned int | state: 2 | |
unsigned int | version: 3 | |
uint32_t | your_disc |
struct bfd_state_t |
Definition at line 64 of file proto_bfd.c.
Data Fields | ||
---|---|---|
int | auth_seq_known | |
bfd_auth_type_t | auth_type | |
bool | demand_mode | |
uint32_t | desired_min_tx_interval | |
int | detect_multi | |
uint32_t | detection_time | |
int | detection_timeouts | |
int | doing_poll | |
fr_event_list_t * | el | |
fr_event_t * | ev_packet | |
fr_event_t * | ev_timeout | |
struct timeval | last_recv | |
struct timeval | last_sent | |
bfd_diag_t | local_diag | |
uint32_t | local_disc | |
fr_ipaddr_t | local_ipaddr | |
uint16_t | local_port | |
uint32_t | my_min_echo_rx_interval | |
uint32_t | next_min_tx_interval | |
struct timeval | next_recv | |
int | number | |
int | passive | |
uint32_t | recv_auth_seq | |
bool | remote_demand_mode | |
uint32_t | remote_disc | |
fr_ipaddr_t | remote_ipaddr | |
uint32_t | remote_min_echo_rx_interval | |
uint32_t | remote_min_rx_interval | |
uint16_t | remote_port | |
bfd_session_state_t | remote_session_state | |
struct sockaddr_storage | remote_sockaddr | |
uint32_t | required_min_rx_interval | |
socklen_t | salen | |
uint8_t | secret[BFD_MAX_SECRET_LENGTH] | |
size_t | secret_len | |
const char * | server | |
bfd_session_state_t | session_state | |
int | sockfd | |
uint32_t | xmit_auth_seq |
#define BFD_AUTH_INVALID (BFD_AUTH_MET_KEYED_SHA1 + 1) |
Definition at line 62 of file proto_bfd.c.
#define BFD_MAX_SECRET_LENGTH 20 |
Definition at line 32 of file proto_bfd.c.
#define FORWARD len = strlen(buffer); if (len >= (bufsize + 1)) return 0;buffer += len;bufsize -= len |
#define USEC (1000000) |
Definition at line 31 of file proto_bfd.c.
typedef struct bfd_auth_basic_t bfd_auth_basic_t |
typedef struct bfd_auth_md5_t bfd_auth_md5_t |
typedef struct bfd_auth_sha1_t bfd_auth_sha1_t |
typedef struct bfd_auth_simple_t bfd_auth_simple_t |
typedef union bfd_auth_t bfd_auth_t |
typedef enum bfd_auth_type_t bfd_auth_type_t |
typedef enum bfd_diag_t bfd_diag_t |
typedef enum bfd_session_state_t bfd_session_state_t |
typedef struct bfd_state_t bfd_state_t |
enum bfd_auth_type_t |
Enumerator | |
---|---|
BFD_AUTH_RESERVED | |
BFD_AUTH_SIMPLE | |
BFD_AUTH_KEYED_MD5 | |
BFD_AUTH_MET_KEYED_MD5 | |
BFD_AUTH_KEYED_SHA1 | |
BFD_AUTH_MET_KEYED_SHA1 |
Definition at line 53 of file proto_bfd.c.
enum bfd_diag_t |
Enumerator | |
---|---|
BFD_DIAG_NONE | |
BFD_CTRL_EXPIRED | |
BFD_ECHO_FAILED | |
BFD_NEIGHBOR_DOWN | |
BFD_FORWARD_PLANE_RESET | |
BFD_PATH_DOWN | |
BFD_CONCATENATED_PATH_DOWN | |
BFD_ADMIN_DOWN | |
BFD_REVERSE_CONCAT_PATH_DOWN |
Definition at line 41 of file proto_bfd.c.
enum bfd_session_state_t |
Enumerator | |
---|---|
BFD_STATE_ADMIN_DOWN | |
BFD_STATE_DOWN | |
BFD_STATE_INIT | |
BFD_STATE_UP |
Definition at line 34 of file proto_bfd.c.
struct bfd_packet_t __attribute__ | ( | (packed) | ) |
Definition at line 206 of file proto_bfd.c.
|
static |
Definition at line 641 of file proto_bfd.c.
|
static |
Definition at line 710 of file proto_bfd.c.
|
static |
Definition at line 764 of file proto_bfd.c.
|
static |
Definition at line 625 of file proto_bfd.c.
|
static |
Definition at line 694 of file proto_bfd.c.
|
static |
Definition at line 785 of file proto_bfd.c.
|
static |
Definition at line 1090 of file proto_bfd.c.
void bfd_init | ( | fr_event_list_t * | xel | ) |
Definition at line 240 of file proto_bfd.c.
|
static |
Definition at line 1576 of file proto_bfd.c.
|
static |
Definition at line 464 of file proto_bfd.c.
|
static |
Definition at line 1540 of file proto_bfd.c.
|
static |
Definition at line 424 of file proto_bfd.c.
|
static |
Definition at line 1135 of file proto_bfd.c.
|
static |
Definition at line 1157 of file proto_bfd.c.
|
static |
|
static |
Definition at line 860 of file proto_bfd.c.
|
static |
Definition at line 1636 of file proto_bfd.c.
|
static |
|
static |
Definition at line 1064 of file proto_bfd.c.
|
static |
Definition at line 939 of file proto_bfd.c.
|
static |
Definition at line 833 of file proto_bfd.c.
|
static |
Definition at line 1630 of file proto_bfd.c.
|
static |
Definition at line 1623 of file proto_bfd.c.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 1616 of file proto_bfd.c.
|
static |
Definition at line 978 of file proto_bfd.c.
|
static |
Definition at line 886 of file proto_bfd.c.
|
static |
Definition at line 1010 of file proto_bfd.c.
|
static |
Definition at line 1002 of file proto_bfd.c.
|
static |
Definition at line 1031 of file proto_bfd.c.
|
static |
Definition at line 392 of file proto_bfd.c.
|
static |
Definition at line 655 of file proto_bfd.c.
|
static |
|
static |
Definition at line 724 of file proto_bfd.c.
bfd_auth_t auth |
Definition at line 209 of file proto_bfd.c.
unsigned int auth_present |
Definition at line 196 of file proto_bfd.c.
|
static |
Definition at line 1653 of file proto_bfd.c.
bfd_socket_t |
Definition at line 228 of file proto_bfd.c.
|
static |
Definition at line 368 of file proto_bfd.c.
unsigned int control_plane_independent |
Definition at line 197 of file proto_bfd.c.
unsigned int demand |
Definition at line 195 of file proto_bfd.c.
uint32_t desired_min_tx_interval |
Definition at line 206 of file proto_bfd.c.
uint8_t detect_multi |
Definition at line 202 of file proto_bfd.c.
unsigned int diag |
Definition at line 191 of file proto_bfd.c.
|
static |
Definition at line 236 of file proto_bfd.c.
unsigned int final |
Definition at line 198 of file proto_bfd.c.
uint8_t length |
Definition at line 203 of file proto_bfd.c.
uint32_t min_echo_rx_interval |
Definition at line 208 of file proto_bfd.c.
unsigned int multipoint |
Definition at line 194 of file proto_bfd.c.
uint32_t my_disc |
Definition at line 204 of file proto_bfd.c.
unsigned int poll |
Definition at line 199 of file proto_bfd.c.
fr_protocol_t proto_bfd |
Definition at line 1809 of file proto_bfd.c.
uint32_t required_min_rx_interval |
Definition at line 207 of file proto_bfd.c.
unsigned int state |
Definition at line 200 of file proto_bfd.c.
unsigned int version |
Definition at line 192 of file proto_bfd.c.
uint32_t your_disc |
Definition at line 205 of file proto_bfd.c.