/*
* 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",
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);
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);
const char *local_str, const char *ifname,
const char *vrfname);
-/*
- * Commands definition.
- */
-DEFUN_NOSH(bfd_enter, bfd_enter_cmd, "bfd", "Configure BFD peers\n")
-{
- vty->node = BFD_NODE;
- return CMD_SUCCESS;
-}
-
/*
* Show commands helper functions
install_element(ENABLE_NODE, &bfd_show_peer_counters_cmd);
install_element(ENABLE_NODE, &bfd_show_peers_cmd);
install_element(ENABLE_NODE, &bfd_show_peer_cmd);
- install_element(CONFIG_NODE, &bfd_enter_cmd);
install_element(ENABLE_NODE, &show_debugging_bfd_cmd);
/* Install BFD node and commands. */