|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
44 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__)
51 #define foreach_vpe_api_msg \
52 _ (BFD_UDP_ADD, bfd_udp_add) \
53 _ (BFD_UDP_MOD, bfd_udp_mod) \
54 _ (BFD_UDP_DEL, bfd_udp_del) \
55 _ (BFD_UDP_SESSION_DUMP, bfd_udp_session_dump) \
56 _ (BFD_UDP_SESSION_SET_FLAGS, bfd_udp_session_set_flags) \
57 _ (WANT_BFD_EVENTS, want_bfd_events) \
58 _ (BFD_AUTH_SET_KEY, bfd_auth_set_key) \
59 _ (BFD_AUTH_DEL_KEY, bfd_auth_del_key) \
60 _ (BFD_AUTH_KEYS_DUMP, bfd_auth_keys_dump) \
61 _ (BFD_UDP_AUTH_ACTIVATE, bfd_udp_auth_activate) \
62 _ (BFD_UDP_AUTH_DEACTIVATE, bfd_udp_auth_deactivate) \
63 _ (BFD_UDP_SET_ECHO_SOURCE, bfd_udp_set_echo_source) \
64 _ (BFD_UDP_DEL_ECHO_SOURCE, bfd_udp_del_echo_source) \
65 _ (BFD_UDP_GET_ECHO_SOURCE, bfd_udp_get_echo_source)
69 #define BFD_UDP_API_PARAM_COMMON_CODE \
70 ip46_address_t local_addr; \
71 ip46_address_t peer_addr; \
72 ip_address_decode(&mp->local_addr, &local_addr); \
73 ip_address_decode(&mp->peer_addr, &peer_addr);
75 #define BFD_UDP_API_PARAM_FROM_MP(mp) \
76 clib_net_to_host_u32 (mp->sw_if_index), &local_addr, &peer_addr
81 vl_api_bfd_udp_add_reply_t *rmp;
102 vl_api_bfd_udp_mod_reply_t *rmp;
121 vl_api_bfd_udp_del_reply_t *rmp;
138 if (bs->
transport != BFD_TRANSPORT_UDP4 &&
146 mp->_vl_msg_id =
ntohs (VL_API_BFD_UDP_SESSION_DETAILS);
150 bfd_udp_key_t *
key = &
bus->key;
181 if (bs->
transport != BFD_TRANSPORT_UDP4 &&
189 mp->_vl_msg_id =
ntohs (VL_API_BFD_UDP_SESSION_EVENT);
193 bfd_udp_key_t *
key = &
bus->key;
232 case BFD_TRANSPORT_UDP4:
234 case BFD_TRANSPORT_UDP6:
254 if (bs->
transport == BFD_TRANSPORT_UDP4 ||
265 vl_api_bfd_udp_session_set_flags_reply_t *rmp;
272 clib_net_to_host_u32 (mp->
flags) &
275 REPLY_MACRO (VL_API_BFD_UDP_SESSION_SET_FLAGS_REPLY);
281 vl_api_bfd_auth_set_key_reply_t *rmp;
291 vl_api_bfd_auth_del_key_reply_t *rmp;
313 rmp->_vl_msg_id =
ntohs (VL_API_BFD_AUTH_KEYS_DETAILS);
326 vl_api_bfd_udp_auth_activate_reply_t *rmp;
345 vl_api_bfd_udp_auth_deactivate_reply_t *rmp;
356 REPLY_MACRO (VL_API_BFD_UDP_AUTH_DEACTIVATE_REPLY);
363 vl_api_bfd_udp_set_echo_source_reply_t *rmp;
371 REPLY_MACRO (VL_API_BFD_UDP_SET_ECHO_SOURCE_REPLY);
378 vl_api_bfd_udp_del_echo_source_reply_t *rmp;
383 REPLY_MACRO (VL_API_BFD_UDP_DEL_ECHO_SOURCE_REPLY);
400 &have_usable_ip6, &
ip6);
446 #define vl_msg_name_crc_list
448 #undef vl_msg_name_crc_list
453 #define _(id, n, crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id);
454 foreach_vl_msg_name_crc_bfd;
464 vl_msg_api_set_handlers (VL_API_##N, #n, vl_api_##n##_t_handler, \
465 vl_noop_handler, vl_api_##n##_t_endian, \
466 vl_api_##n##_t_print, sizeof (vl_api_##n##_t), 1);
#define VALIDATE_SW_IF_INDEX(mp)
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
vl_api_address_t peer_addr
bfd_transport_e transport
transport type for this session
static void vl_api_bfd_udp_get_echo_source_t_handler(vl_api_bfd_udp_get_echo_source_t *mp)
pub_sub_handler(bfd_events, BFD_EVENTS)
vnet_api_error_t bfd_udp_auth_deactivate(u32 sw_if_index, const ip46_address_t *local_addr, const ip46_address_t *peer_addr, u8 is_delayed)
deactivate authentication for existing session
static void vl_api_bfd_udp_del_echo_source_t_handler(vl_api_bfd_udp_del_echo_source_t *mp)
Get a list of configured authentication keys.
vl_api_address_t local_addr
#define REPLY_MACRO2(t, body)
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
#define BFD_UDP_API_PARAM_FROM_MP(mp)
vl_api_interface_index_t sw_if_index
u32 config_desired_min_tx_usec
configured desired min tx interval (microseconds)
static void vl_api_bfd_auth_keys_dump_t_handler(vl_api_bfd_auth_keys_dump_t *mp)
bfd_auth_key_t * next_key
set to next key to use if delayed switch is enabled - in that case the key is switched when first inc...
vnet_api_error_t bfd_auth_set_key(u32 conf_key_id, u8 auth_type, u8 key_len, const u8 *key)
create or modify bfd authentication key
u32 conf_key_id
global configuration key ID
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static void vl_api_bfd_udp_auth_activate_t_handler(vl_api_bfd_udp_auth_activate_t *mp)
#define foreach_vpe_api_msg
vl_api_interface_index_t sw_if_index
vl_api_address_t local_addr
vl_api_interface_index_t sw_if_index
UDP transport specific data embedded in bfd_session's union.
static void vl_api_bfd_udp_auth_deactivate_t_handler(vl_api_bfd_udp_auth_deactivate_t *mp)
vnet_api_error_t bfd_udp_auth_activate(u32 sw_if_index, const ip46_address_t *local_addr, const ip46_address_t *peer_addr, u32 conf_key_id, u8 bfd_key_id, u8 is_delayed)
activate authentication for existing session
u8 next_bfd_key_id
key ID to use when switched to next_key
static void setup_message_id_table(api_main_t *am)
#define pool_foreach(VAR, POOL)
Iterate through pool.
BFD authentication key details.
void send_bfd_udp_session_event(vl_api_registration_t *reg, u32 pid, bfd_session_t *bs)
Get BFD echo source reply.
BFD UDP - delete key from configuration.
void ip6_address_encode(const ip6_address_t *in, vl_api_ip6_address_t out)
static void vl_api_bfd_auth_set_key_t_handler(vl_api_bfd_auth_set_key_t *mp)
#define BFD_UDP_API_PARAM_COMMON_CODE
@ IF_STATUS_API_FLAG_ADMIN_UP
An API client registration, only in vpp/vlib.
bfd_state_e local_state
session state
bfd_session_t * sessions
pool of bfd sessions context data
static api_main_t * vlibapi_get_main(void)
static clib_error_t * bfd_api_hookup(vlib_main_t *vm)
void bfd_event(bfd_main_t *bm, bfd_session_t *bs)
bfd_auth_key_t * curr_key
current key in use
BFD UDP - add/replace key to configuration.
Set flags of BFD UDP session.
vnet_api_error_t bfd_udp_session_set_flags(vlib_main_t *vm, u32 sw_if_index, const ip46_address_t *local_addr, const ip46_address_t *peer_addr, u8 admin_up_down)
set session admin down/up
#define BAD_SW_IF_INDEX_LABEL
static void vl_api_bfd_udp_mod_t_handler(vl_api_bfd_udp_mod_t *mp)
API main structure, used by both vpp and binary API clients.
static void vl_api_bfd_udp_session_set_flags_t_handler(vl_api_bfd_udp_session_set_flags_t *mp)
BFD UDP - activate/change authentication.
vnet_api_error_t bfd_udp_mod_session(u32 sw_if_index, const ip46_address_t *local_addr, const ip46_address_t *peer_addr, u32 desired_min_tx_usec, u32 required_min_rx_usec, u8 detect_mult)
modify existing session
u8 curr_bfd_key_id
current key ID sent out in bfd packet
void send_bfd_udp_session_details(vl_api_registration_t *reg, u32 context, bfd_session_t *bs)
u8 local_detect_mult
configured detect multiplier
vnet_api_error_t bfd_auth_del_key(u32 conf_key_id)
delete existing authentication key
vnet_api_error_t bfd_udp_add_session(u32 sw_if_index, const ip46_address_t *local_addr, const ip46_address_t *peer_addr, u32 desired_min_tx_usec, u32 required_min_rx_usec, u8 detect_mult, u8 is_authenticated, u32 conf_key_id, u8 bfd_key_id)
create a new bfd session
BFD session details structure.
Delete UDP BFD session on interface.
vl_api_address_t peer_addr
vnet_api_error_t bfd_udp_del_session(u32 sw_if_index, const ip46_address_t *local_addr, const ip46_address_t *peer_addr)
delete existing session
void ip4_address_encode(const ip4_address_t *in, vl_api_ip4_address_t out)
void bfd_udp_get_echo_source(int *is_set, u32 *sw_if_index, int *have_usable_ip4, ip4_address_t *ip4, int *have_usable_ip6, ip6_address_t *ip6)
get echo source information - used by CLI
BFD UDP - deactivate authentication.
static void vl_api_bfd_udp_set_echo_source_t_handler(vl_api_bfd_udp_set_echo_source_t *mp)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
void ip_address_encode(const ip46_address_t *in, ip46_type_t type, vl_api_address_t *out)
static vlib_main_t * vlib_get_main(void)
VLIB_API_INIT_FUNCTION(bfd_api_hookup)
u8 is_delayed
set to 1 if delayed action is pending, which might be activation of authentication,...
vnet_api_error_t bfd_udp_del_echo_source()
unset echo-source interface
Modify UDP BFD session on interface.
static void vl_api_bfd_udp_add_t_handler(vl_api_bfd_udp_add_t *mp)
static void vl_api_bfd_udp_session_dump_t_handler(vl_api_bfd_udp_session_dump_t *mp)
vl_api_ip6_address_t ip6_addr
struct bfd_session_s::@149 auth
authentication information
u32 config_required_min_rx_usec
configured required min rx interval (microseconds)
vl_api_interface_index_t sw_if_index
vl_api_interface_index_t sw_if_index
static void vl_api_bfd_auth_del_key_t_handler(vl_api_bfd_auth_del_key_t *mp)
bfd_auth_key_t * auth_keys
pool of authentication keys
vnet_api_error_t bfd_udp_set_echo_source(u32 loopback_sw_if_index)
set echo-source interface
vl_api_ip4_address_t ip4_addr
vl_api_if_status_flags_t flags
vpe_api_main_t vpe_api_main
Add UDP BFD session on interface.
void * vl_msg_api_alloc(int nbytes)
static void vl_api_bfd_udp_del_t_handler(vl_api_bfd_udp_del_t *mp)