summaryrefslogtreecommitdiffstats
path: root/vtysh
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2018-02-05 16:36:13 +0100
committerPhilippe Guibert <philippe.guibert@6wind.com>2018-02-27 11:11:24 +0100
commitf5d20fdb4e1fae6ccdcd3efa9136663481a5e355 (patch)
tree261d2f608650950acf8d7f11cd2c3c7f5ac44e09 /vtysh
parentzebra: adapt the vrf and logical router initialisation (diff)
downloadfrr-f5d20fdb4e1fae6ccdcd3efa9136663481a5e355.tar.xz
frr-f5d20fdb4e1fae6ccdcd3efa9136663481a5e355.zip
vtysh: change logical router node name
The logical router node goes from NS_NODE to LOGICALROUTER_NODE. Vty commands are renamed accordingly. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'vtysh')
-rw-r--r--vtysh/Makefile.am2
-rwxr-xr-xvtysh/extract.pl.in3
-rw-r--r--vtysh/vtysh.c40
-rw-r--r--vtysh/vtysh_config.c4
4 files changed, 33 insertions, 16 deletions
diff --git a/vtysh/Makefile.am b/vtysh/Makefile.am
index c9b6f5016..33d34fc0d 100644
--- a/vtysh/Makefile.am
+++ b/vtysh/Makefile.am
@@ -147,7 +147,7 @@ vtysh_cmd_FILES = $(vtysh_scan) \
$(top_srcdir)/lib/distribute.c $(top_srcdir)/lib/if_rmap.c \
$(top_srcdir)/lib/vrf.c \
$(top_srcdir)/lib/vty.c $(top_srcdir)/zebra/debug.c \
- $(top_srcdir)/lib/ns.c \
+ $(top_srcdir)/lib/logicalrouter.c \
$(top_srcdir)/zebra/interface.c \
$(top_srcdir)/zebra/irdp_interface.c \
$(top_srcdir)/zebra/rtadv.c $(top_srcdir)/zebra/zebra_vty.c \
diff --git a/vtysh/extract.pl.in b/vtysh/extract.pl.in
index dedf3d164..6cfb51b00 100755
--- a/vtysh/extract.pl.in
+++ b/vtysh/extract.pl.in
@@ -87,6 +87,9 @@ foreach (@ARGV) {
elsif ($file =~ /lib\/vrf\.c$/) {
$protocol = "VTYSH_ALL";
}
+ elsif ($file =~ /lib\/logicalrouter\.c$/) {
+ $protocol = "VTYSH_ALL";
+ }
elsif ($file =~ /lib\/filter\.c$/) {
$protocol = "VTYSH_ALL";
}
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index 65e9c9f8c..e0a0dd585 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -975,8 +975,8 @@ static struct cmd_node pw_node = {
PW_NODE, "%s(config-pw)# ",
};
-static struct cmd_node ns_node = {
- NS_NODE, "%s(config-logical-router)# ",
+static struct cmd_node logicalrouter_node = {
+ LOGICALROUTER_NODE, "%s(config-logical-router)# ",
};
static struct cmd_node vrf_node = {
@@ -1508,7 +1508,7 @@ static int vtysh_exit(struct vty *vty)
break;
case INTERFACE_NODE:
case PW_NODE:
- case NS_NODE:
+ case LOGICALROUTER_NODE:
case VRF_NODE:
case ZEBRA_NODE:
case BGP_NODE:
@@ -1782,16 +1782,25 @@ DEFSH(VTYSH_ZEBRA, vtysh_no_interface_vrf_cmd, "no interface IFNAME vrf NAME",
"Delete a pseudo interface's configuration\n"
"Interface's name\n" VRF_CMD_HELP_STR)
-DEFUNSH(VTYSH_NS, vtysh_ns, vtysh_ns_cmd, "logical-router (1-65535) ns NAME",
+DEFUNSH(VTYSH_ZEBRA, vtysh_logicalrouter, vtysh_logicalrouter_cmd,
+ "logical-router (1-65535) ns NAME",
"Enable a logical-router\n"
"Specify the logical-router indentifier\n"
"The Name Space\n"
"The file name in " NS_RUN_DIR ", or a full pathname\n")
{
- vty->node = NS_NODE;
+ vty->node = LOGICALROUTER_NODE;
return CMD_SUCCESS;
}
+DEFSH(VTYSH_ZEBRA, vtysh_no_logicalrouter_cmd,
+ "no logical-router (1-65535) ns NAME",
+ NO_STR
+ "Enable a Logical-Router\n"
+ "Specify the Logical-Router identifier\n"
+ "The Name Space\n"
+ "The file name in " NS_RUN_DIR ", or a full pathname\n")
+
DEFUNSH(VTYSH_VRF, vtysh_vrf, vtysh_vrf_cmd, "vrf NAME",
"Select a VRF to configure\n"
"VRF's name\n")
@@ -1804,16 +1813,18 @@ DEFSH(VTYSH_ZEBRA, vtysh_no_vrf_cmd, "no vrf NAME", NO_STR
"Delete a pseudo vrf's configuration\n"
"VRF's name\n")
-DEFUNSH(VTYSH_NS, vtysh_exit_ns, vtysh_exit_ns_cmd, "exit",
+DEFUNSH(VTYSH_NS, vtysh_exit_logicalrouter,
+ vtysh_exit_logicalrouter_cmd, "exit",
"Exit current mode and down to previous mode\n")
{
return vtysh_exit(vty);
}
-DEFUNSH(VTYSH_NS, vtysh_quit_ns, vtysh_quit_ns_cmd, "quit",
+DEFUNSH(VTYSH_NS, vtysh_quit_logicalrouter,
+ vtysh_quit_logicalrouter_cmd, "quit",
"Exit current mode and down to previous mode\n")
{
- return vtysh_exit_ns(self, vty, argc, argv);
+ return vtysh_exit_logicalrouter(self, vty, argc, argv);
}
DEFUNSH(VTYSH_VRF, vtysh_exit_vrf, vtysh_exit_vrf_cmd, "exit",
@@ -3055,7 +3066,7 @@ void vtysh_init_vty(void)
install_node(&interface_node, NULL);
install_node(&pw_node, NULL);
install_node(&link_params_node, NULL);
- install_node(&ns_node, NULL);
+ install_node(&logicalrouter_node, NULL);
install_node(&vrf_node, NULL);
install_node(&rmap_node, NULL);
install_node(&zebra_node, NULL);
@@ -3233,11 +3244,14 @@ void vtysh_init_vty(void)
install_element(PW_NODE, &vtysh_exit_interface_cmd);
install_element(PW_NODE, &vtysh_quit_interface_cmd);
- install_element(NS_NODE, &vtysh_end_all_cmd);
+ install_element(LOGICALROUTER_NODE, &vtysh_end_all_cmd);
- install_element(CONFIG_NODE, &vtysh_ns_cmd);
- install_element(NS_NODE, &vtysh_exit_ns_cmd);
- install_element(NS_NODE, &vtysh_quit_ns_cmd);
+ install_element(CONFIG_NODE, &vtysh_logicalrouter_cmd);
+ install_element(CONFIG_NODE, &vtysh_no_logicalrouter_cmd);
+ install_element(LOGICALROUTER_NODE,
+ &vtysh_exit_logicalrouter_cmd);
+ install_element(LOGICALROUTER_NODE,
+ &vtysh_quit_logicalrouter_cmd);
install_element(VRF_NODE, &vtysh_end_all_cmd);
install_element(VRF_NODE, &vtysh_exit_vrf_cmd);
diff --git a/vtysh/vtysh_config.c b/vtysh/vtysh_config.c
index 967f855fb..aa1dd407e 100644
--- a/vtysh/vtysh_config.c
+++ b/vtysh/vtysh_config.c
@@ -187,7 +187,7 @@ void vtysh_config_parse_line(void *arg, const char *line)
config->index = INTERFACE_NODE;
} else if (config->index == RMAP_NODE
|| config->index == INTERFACE_NODE
- || config->index == NS_NODE
+ || config->index == LOGICALROUTER_NODE
|| config->index == VTY_NODE
|| config->index == VRF_NODE)
config_add_line_uniq(config->line, line);
@@ -202,7 +202,7 @@ void vtysh_config_parse_line(void *arg, const char *line)
else if (strncmp(line, "pseudowire", strlen("pseudowire")) == 0)
config = config_get(PW_NODE, line);
else if (strncmp(line, "logical-router", strlen("ns")) == 0)
- config = config_get(NS_NODE, line);
+ config = config_get(LOGICALROUTER_NODE, line);
else if (strncmp(line, "vrf", strlen("vrf")) == 0)
config = config_get(VRF_NODE, line);
else if (strncmp(line, "router-id", strlen("router-id")) == 0)