summaryrefslogtreecommitdiffstats
path: root/vtysh
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-08-14 14:16:10 +0200
committerGitHub <noreply@github.com>2018-08-14 14:16:10 +0200
commitd6853655b597e041b24a2b8d9367eea04d666c69 (patch)
treebcaf438322b7934b1a1a77f0800271a1b77f4b0b /vtysh
parentbgpd/ospf(6)d/pimd: hide BFD commands with timers (diff)
parentMerge pull request #2823 from opensourcerouting/snap-staticd (diff)
downloadfrr-d6853655b597e041b24a2b8d9367eea04d666c69.tar.xz
frr-d6853655b597e041b24a2b8d9367eea04d666c69.zip
Merge branch 'master' into bfd-final
Diffstat (limited to 'vtysh')
-rw-r--r--vtysh/Makefile.am2
-rwxr-xr-xvtysh/extract.pl.in5
-rw-r--r--vtysh/vtysh.c47
-rw-r--r--vtysh/vtysh_main.c2
4 files changed, 19 insertions, 37 deletions
diff --git a/vtysh/Makefile.am b/vtysh/Makefile.am
index f241f3c5a..936640c83 100644
--- a/vtysh/Makefile.am
+++ b/vtysh/Makefile.am
@@ -158,7 +158,7 @@ vtysh_cmd_FILES = $(vtysh_scan) \
$(top_srcdir)/lib/keychain.c $(top_srcdir)/lib/routemap.c \
$(top_srcdir)/lib/filter.c $(top_srcdir)/lib/plist.c \
$(top_srcdir)/lib/distribute.c $(top_srcdir)/lib/if_rmap.c \
- $(top_srcdir)/lib/vrf.c \
+ $(top_srcdir)/lib/vrf.c $(top_srcdir)/lib/if.c \
$(top_srcdir)/lib/vty.c $(top_srcdir)/zebra/debug.c \
$(top_srcdir)/lib/logicalrouter.c \
$(top_srcdir)/lib/nexthop_group.c \
diff --git a/vtysh/extract.pl.in b/vtysh/extract.pl.in
index c0277b3d6..92b5686a9 100755
--- a/vtysh/extract.pl.in
+++ b/vtysh/extract.pl.in
@@ -85,7 +85,10 @@ foreach (@ARGV) {
$protocol = "VTYSH_RMAP";
}
elsif ($file =~ /lib\/vrf\.c$/) {
- $protocol = "VTYSH_ALL";
+ $protocol = "VTYSH_VRF";
+ }
+ elsif ($file =~ /lib\/if\.c$/) {
+ $protocol = "VTYSH_INTERFACE";
}
elsif ($file =~ /lib\/logicalrouter\.c$/) {
$protocol = "VTYSH_ALL";
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index d0b654d2c..48a90a695 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -2072,18 +2072,6 @@ DEFUNSH(VTYSH_ZEBRA, vtysh_pseudowire, vtysh_pseudowire_cmd,
return CMD_SUCCESS;
}
-/* TODO Implement "no interface command in isisd. */
-DEFSH(VTYSH_ZEBRA | VTYSH_RIPD | VTYSH_RIPNGD | VTYSH_OSPFD | VTYSH_OSPF6D
- | VTYSH_EIGRPD,
- vtysh_no_interface_cmd, "no interface IFNAME", NO_STR
- "Delete a pseudo interface's configuration\n"
- "Interface's name\n")
-
-DEFSH(VTYSH_ZEBRA, vtysh_no_interface_vrf_cmd, "no interface IFNAME vrf NAME",
- NO_STR
- "Delete a pseudo interface's configuration\n"
- "Interface's name\n" VRF_CMD_HELP_STR)
-
DEFUNSH(VTYSH_ZEBRA, vtysh_logicalrouter, vtysh_logicalrouter_cmd,
"logical-router (1-65535) ns NAME",
"Enable a logical-router\n"
@@ -2124,9 +2112,16 @@ DEFUNSH(VTYSH_VRF, vtysh_vrf, vtysh_vrf_cmd, "vrf NAME",
return CMD_SUCCESS;
}
-DEFSH(VTYSH_ZEBRA, vtysh_no_vrf_cmd, "no vrf NAME", NO_STR
- "Delete a pseudo vrf's configuration\n"
- "VRF's name\n")
+DEFSH(VTYSH_ZEBRA, vtysh_vrf_netns_cmd,
+ "netns NAME",
+ "Attach VRF to a Namespace\n"
+ "The file name in " NS_RUN_DIR ", or a full pathname\n")
+
+DEFSH(VTYSH_ZEBRA, vtysh_no_vrf_netns_cmd,
+ "no netns [NAME]",
+ NO_STR
+ "Detach VRF from a Namespace\n"
+ "The file name in " NS_RUN_DIR ", or a full pathname\n")
DEFUNSH(VTYSH_NS, vtysh_exit_logicalrouter,
vtysh_exit_logicalrouter_cmd, "exit",
@@ -2166,19 +2161,6 @@ DEFUNSH(VTYSH_VRF, vtysh_quit_nexthop_group, vtysh_quit_nexthop_group_cmd,
return vtysh_exit_nexthop_group(self, vty, argc, argv);
}
-/*
- * TODO Implement interface description commands in ripngd, ospf6d
- * and isisd.
- */
-DEFSH(VTYSH_ZEBRA | VTYSH_RIPD | VTYSH_OSPFD | VTYSH_EIGRPD,
- vtysh_interface_desc_cmd, "description LINE...",
- "Interface specific description\n"
- "Characters describing this interface\n")
-
-DEFSH(VTYSH_ZEBRA | VTYSH_RIPD | VTYSH_OSPFD | VTYSH_EIGRPD,
- vtysh_no_interface_desc_cmd, "no description",
- NO_STR "Interface specific description\n")
-
DEFUNSH(VTYSH_INTERFACE, vtysh_exit_interface, vtysh_exit_interface_cmd, "exit",
"Exit current mode and down to previous mode\n")
{
@@ -3650,8 +3632,6 @@ void vtysh_init_vty(void)
install_element(PBRMAP_NODE, &vtysh_end_all_cmd);
install_element(VTY_NODE, &vtysh_end_all_cmd);
- install_element(INTERFACE_NODE, &vtysh_interface_desc_cmd);
- install_element(INTERFACE_NODE, &vtysh_no_interface_desc_cmd);
install_element(INTERFACE_NODE, &vtysh_end_all_cmd);
install_element(INTERFACE_NODE, &vtysh_exit_interface_cmd);
install_element(LINK_PARAMS_NODE, &exit_link_params_cmd);
@@ -3755,17 +3735,16 @@ void vtysh_init_vty(void)
install_element(KEYCHAIN_NODE, &key_chain_cmd);
install_element(KEYCHAIN_KEY_NODE, &key_chain_cmd);
install_element(CONFIG_NODE, &vtysh_interface_cmd);
- install_element(CONFIG_NODE, &vtysh_no_interface_cmd);
- install_element(CONFIG_NODE, &vtysh_no_interface_vrf_cmd);
install_element(CONFIG_NODE, &vtysh_pseudowire_cmd);
install_element(INTERFACE_NODE, &vtysh_link_params_cmd);
install_element(ENABLE_NODE, &vtysh_show_running_config_cmd);
install_element(ENABLE_NODE, &vtysh_copy_running_config_cmd);
+ install_element(CONFIG_NODE, &vtysh_vrf_cmd);
+ install_element(VRF_NODE, &vtysh_vrf_netns_cmd);
+ install_element(VRF_NODE, &vtysh_no_vrf_netns_cmd);
install_element(VRF_NODE, &exit_vrf_config_cmd);
- install_element(CONFIG_NODE, &vtysh_vrf_cmd);
- install_element(CONFIG_NODE, &vtysh_no_vrf_cmd);
install_element(CONFIG_NODE, &vtysh_no_nexthop_group_cmd);
/* "write terminal" command. */
diff --git a/vtysh/vtysh_main.c b/vtysh/vtysh_main.c
index 7d882620e..86fa62f47 100644
--- a/vtysh/vtysh_main.c
+++ b/vtysh/vtysh_main.c
@@ -356,7 +356,7 @@ int main(int argc, char **argv, char **env)
break;
case OPTION_CONFDIR:
ditch_suid = 1; /* option disables SUID */
- strlcpy(sysconfdir, optarg, sizeof(sysconfdir));
+ snprintf(sysconfdir, sizeof(sysconfdir), "%s/", optarg);
break;
case 'N':
if (strchr(optarg, '/') || strchr(optarg, '.')) {