summaryrefslogtreecommitdiff
path: root/vtysh
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2024-01-19 13:06:53 +0200
committerIgor Ryzhov <iryzhov@nfware.com>2024-01-28 23:28:39 +0200
commitb688eb7e9e565abd37b9cd95f2035d25612e2a3f (patch)
tree8831ead389b2684c270f4b85adf36d6326406df1 /vtysh
parent7fc02c462cf16877440755c00bce931f9f2a6eb5 (diff)
zebra: convert interface link-params command to NB
Make link-params a presence container and activate it when entering the node. The "enable" command is not necessary anymore but kept hidden for backwards compatibility. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'vtysh')
-rw-r--r--vtysh/vtysh.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index b1a53965cd..299165e2aa 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -1615,7 +1615,6 @@ struct cmd_node link_params_node = {
.node = LINK_PARAMS_NODE,
.parent_node = INTERFACE_NODE,
.prompt = "%s(config-link-params)# ",
- .no_xpath = true,
};
#ifdef HAVE_BGPD
@@ -3015,6 +3014,14 @@ DEFUNSH(VTYSH_ZEBRA, vtysh_link_params, vtysh_link_params_cmd, "link-params",
return CMD_SUCCESS;
}
+DEFUNSH_HIDDEN(VTYSH_ZEBRA, no_link_params_enable, no_link_params_enable_cmd,
+ "no enable", NO_STR "Disable link parameters on this interface\n")
+{
+ if (vty->node == LINK_PARAMS_NODE)
+ vty->node = INTERFACE_NODE;
+ return CMD_SUCCESS;
+}
+
DEFUNSH(VTYSH_ZEBRA, exit_link_params, exit_link_params_cmd, "exit-link-params",
"Exit from Link Params configuration node\n")
{
@@ -5064,6 +5071,7 @@ void vtysh_init_vty(void)
install_node(&link_params_node);
install_element(INTERFACE_NODE, &vtysh_link_params_cmd);
+ install_element(LINK_PARAMS_NODE, &no_link_params_enable_cmd);
install_element(LINK_PARAMS_NODE, &exit_link_params_cmd);
install_element(LINK_PARAMS_NODE, &vtysh_end_all_cmd);
install_element(LINK_PARAMS_NODE, &vtysh_exit_link_params_cmd);