summaryrefslogtreecommitdiff
path: root/bfdd/bfdd_cli.c
diff options
context:
space:
mode:
authorRafael Zalamena <rzalamena@opensourcerouting.org>2019-06-25 09:34:14 -0300
committerRafael Zalamena <rzalamena@opensourcerouting.org>2019-06-25 09:34:14 -0300
commitfdf8ac87f8a6256dd657d61517cdce6642098464 (patch)
treef150876c32e53613226b711d3edbe5392d234648 /bfdd/bfdd_cli.c
parent77452ad263562ab9cca989da1df9a9ad2afd17e1 (diff)
bfdd: convert `bfd` command to northbound
This helps northbound to create the `bfd` node on the configuration output sooner than adding a peer. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Diffstat (limited to 'bfdd/bfdd_cli.c')
-rw-r--r--bfdd/bfdd_cli.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/bfdd/bfdd_cli.c b/bfdd/bfdd_cli.c
index 15df0f769f..c2c3040ebc 100644
--- a/bfdd/bfdd_cli.c
+++ b/bfdd/bfdd_cli.c
@@ -54,6 +54,21 @@
/*
* Functions.
*/
+DEFPY_NOSH(
+ bfd_enter, bfd_enter_cmd,
+ "bfd",
+ "Configure BFD peers\n")
+{
+ int ret;
+
+ nb_cli_enqueue_change(vty, "/frr-bfdd:bfdd/bfd", NB_OP_CREATE, NULL);
+ ret = nb_cli_apply_changes(vty, NULL);
+ if (ret == CMD_SUCCESS)
+ VTY_PUSH_XPATH(BFD_NODE, "/frr-bfdd:bfdd/bfd");
+
+ return ret;
+}
+
DEFUN(
bfd_config_reset, bfd_config_reset_cmd,
"no bfd",
@@ -120,7 +135,7 @@ DEFPY_NOSH(
nb_cli_enqueue_change(vty, xpath, NB_OP_CREATE, NULL);
- /* Apply settings immediatly. */
+ /* Apply settings immediately. */
ret = nb_cli_apply_changes(vty, NULL);
if (ret == CMD_SUCCESS)
VTY_PUSH_XPATH(BFD_PEER_NODE, xpath);
@@ -376,6 +391,7 @@ void bfd_cli_show_echo_interval(struct vty *vty, struct lyd_node *dnode,
void
bfdd_cli_init(void)
{
+ install_element(CONFIG_NODE, &bfd_enter_cmd);
install_element(CONFIG_NODE, &bfd_config_reset_cmd);
install_element(BFD_NODE, &bfd_peer_enter_cmd);