summaryrefslogtreecommitdiffstats
path: root/bfdd/bfdd_cli.c
diff options
context:
space:
mode:
authorRafael Zalamena <rzalamena@opensourcerouting.org>2019-05-31 21:48:25 +0200
committerRafael Zalamena <rzalamena@opensourcerouting.org>2019-06-22 15:10:56 +0200
commit2a573ff672f4b0eb76138362403a680bc9fc7fce (patch)
tree919f6343a318d3a0fc7157ce6528ab939f6472d4 /bfdd/bfdd_cli.c
parentbfdd: fix daemon warning on startup (diff)
downloadfrr-2a573ff672f4b0eb76138362403a680bc9fc7fce.tar.xz
frr-2a573ff672f4b0eb76138362403a680bc9fc7fce.zip
bfdd: support global BFD reset
Add command 'no bfd' to remove all BFD sessions configuration and fix other daemon integration. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Diffstat (limited to 'bfdd/bfdd_cli.c')
-rw-r--r--bfdd/bfdd_cli.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/bfdd/bfdd_cli.c b/bfdd/bfdd_cli.c
index dac1c2521..64500cef7 100644
--- a/bfdd/bfdd_cli.c
+++ b/bfdd/bfdd_cli.c
@@ -52,6 +52,16 @@
/*
* Functions.
*/
+DEFUN(
+ bfd_config_reset, bfd_config_reset_cmd,
+ "no bfd",
+ NO_STR
+ "Configure BFD peers\n")
+{
+ nb_cli_enqueue_change(vty, "/frr-bfdd:bfdd/bfd", NB_OP_DESTROY, NULL);
+ return nb_cli_apply_changes(vty, NULL);
+}
+
void bfd_cli_show_header(struct vty *vty,
struct lyd_node *dnode __attribute__((__unused__)),
bool show_defaults __attribute__((__unused__)))
@@ -343,6 +353,8 @@ void bfd_cli_show_echo_interval(struct vty *vty, struct lyd_node *dnode,
void
bfdd_cli_init(void)
{
+ install_element(CONFIG_NODE, &bfd_config_reset_cmd);
+
install_element(BFD_NODE, &bfd_peer_enter_cmd);
install_element(BFD_NODE, &bfd_no_peer_cmd);