aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/bfd/bfd_api.c
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2017-02-02 06:58:07 +0100
committerKlement Sekera <ksekera@cisco.com>2017-02-08 07:47:00 +0100
commita57a970952be2c3403c57dd7a16cd3d73660ef79 (patch)
tree89c0aab21b2c5f15d3b3cd355fb54c2c7ae7c66d /src/vnet/bfd/bfd_api.c
parent8ea6d7153b053f1b9bf837ef3a927136f44b41fd (diff)
BFD: modify session parameters
Change-Id: I666e5c0cc71a3693640960c93cdd1907f84fbe23 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.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/vnet/bfd/bfd_api.c b/src/vnet/bfd/bfd_api.c
index cfc3a38d575..af70f0ec2d5 100644
--- a/src/vnet/bfd/bfd_api.c
+++ b/src/vnet/bfd/bfd_api.c
@@ -45,6 +45,7 @@
#define foreach_vpe_api_msg \
_ (BFD_UDP_ADD, bfd_udp_add) \
+ _ (BFD_UDP_MOD, bfd_udp_mod) \
_ (BFD_UDP_DEL, bfd_udp_del) \
_ (BFD_UDP_SESSION_DUMP, bfd_udp_session_dump) \
_ (BFD_UDP_SESSION_SET_FLAGS, bfd_udp_session_set_flags) \
@@ -98,6 +99,25 @@ vl_api_bfd_udp_add_t_handler (vl_api_bfd_udp_add_t * mp)
}
static void
+vl_api_bfd_udp_mod_t_handler (vl_api_bfd_udp_mod_t * mp)
+{
+ vl_api_bfd_udp_mod_reply_t *rmp;
+ int rv;
+
+ VALIDATE_SW_IF_INDEX (mp);
+
+ BFD_UDP_API_PARAM_COMMON_CODE;
+
+ rv = bfd_udp_mod_session (BFD_UDP_API_PARAM_FROM_MP (mp),
+ clib_net_to_host_u32 (mp->desired_min_tx),
+ clib_net_to_host_u32 (mp->required_min_rx),
+ mp->detect_mult);
+
+ BAD_SW_IF_INDEX_LABEL;
+ REPLY_MACRO (VL_API_BFD_UDP_MOD_REPLY);
+}
+
+static void
vl_api_bfd_udp_del_t_handler (vl_api_bfd_udp_del_t * mp)
{
vl_api_bfd_udp_del_reply_t *rmp;
@@ -146,6 +166,10 @@ send_bfd_udp_session_details (unix_shared_memory_queue_t * q, u32 context,
sizeof (key->peer_addr.ip4.data));
}
+ mp->required_min_rx =
+ clib_host_to_net_u32 (bs->config_required_min_rx_usec);
+ mp->desired_min_tx = clib_host_to_net_u32 (bs->config_desired_min_tx_usec);
+ mp->detect_mult = bs->local_detect_mult;
vl_msg_api_send_shmem (q, (u8 *) & mp);
}