summaryrefslogtreecommitdiffstats
path: root/src/vnet/bfd/bfd_api.c
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2017-02-23 09:26:30 +0100
committerDamjan Marion <dmarion.lists@gmail.com>2017-03-02 11:56:47 +0000
commit738844871220f853629504f61c248f0c9402dc77 (patch)
tree63892d6c317c1d1067f9ecd2a913d2ac7c671fcb /src/vnet/bfd/bfd_api.c
parentc3a814be9dc769be942ff8029c7b6eccd4b3af05 (diff)
BFD: command line interface
Implement command line interface to the BFD binary APIs. Add corresponding unit tests. Change-Id: Ia0542d0bc4c8d78e6f7b777a08fd94ebfe4d524f Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'src/vnet/bfd/bfd_api.c')
-rw-r--r--src/vnet/bfd/bfd_api.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/vnet/bfd/bfd_api.c b/src/vnet/bfd/bfd_api.c
index 6632eae4c91..e64df48e11f 100644
--- a/src/vnet/bfd/bfd_api.c
+++ b/src/vnet/bfd/bfd_api.c
@@ -154,6 +154,21 @@ send_bfd_udp_session_details (unix_shared_memory_queue_t * q, u32 context,
bfd_udp_key_t *key = &bus->key;
mp->sw_if_index = clib_host_to_net_u32 (key->sw_if_index);
mp->is_ipv6 = !(ip46_address_is_ip4 (&key->local_addr));
+ if ((!bs->auth.is_delayed && bs->auth.curr_key) ||
+ (bs->auth.is_delayed && bs->auth.next_key))
+ {
+ mp->is_authenticated = 1;
+ }
+ if (bs->auth.is_delayed && bs->auth.next_key)
+ {
+ mp->bfd_key_id = bs->auth.next_bfd_key_id;
+ mp->conf_key_id = clib_host_to_net_u32 (bs->auth.next_key->conf_key_id);
+ }
+ else if (!bs->auth.is_delayed && bs->auth.curr_key)
+ {
+ mp->bfd_key_id = bs->auth.curr_bfd_key_id;
+ mp->conf_key_id = clib_host_to_net_u32 (bs->auth.curr_key->conf_key_id);
+ }
if (mp->is_ipv6)
{
clib_memcpy (mp->local_addr, &key->local_addr,
@@ -289,10 +304,9 @@ vl_api_bfd_udp_auth_activate_t_handler (vl_api_bfd_udp_auth_activate_t * mp)
BFD_UDP_API_PARAM_COMMON_CODE;
- rv =
- bfd_udp_auth_activate (BFD_UDP_API_PARAM_FROM_MP (mp),
- clib_net_to_host_u32 (mp->conf_key_id),
- mp->bfd_key_id, mp->is_delayed);
+ rv = bfd_udp_auth_activate (BFD_UDP_API_PARAM_FROM_MP (mp),
+ clib_net_to_host_u32 (mp->conf_key_id),
+ mp->bfd_key_id, mp->is_delayed);
BAD_SW_IF_INDEX_LABEL;
REPLY_MACRO (VL_API_BFD_UDP_AUTH_ACTIVATE_REPLY);