diff options
author | Renato Westphal <renato@opensourcerouting.org> | 2018-07-09 02:16:47 +0200 |
---|---|---|
committer | Renato Westphal <renato@opensourcerouting.org> | 2018-08-13 23:59:31 +0200 |
commit | 34c462745724f4c7693a8dcc17fef70f8dac7dbb (patch) | |
tree | b3e4f42166d66b92922fe172b34ebfd9789ef292 /vtysh | |
parent | zebra: fix "no pseudowire IFNAME" on vtysh (diff) | |
download | frr-34c462745724f4c7693a8dcc17fef70f8dac7dbb.tar.xz frr-34c462745724f4c7693a8dcc17fef70f8dac7dbb.zip |
lib, vtysh: fix inconsistent VRF commands in vtysh
* Only zebra and pimd call vrf_cmd_init(), so these are the only daemons
that should receive VRF commands from vtysh;
* "netns NAME" and "no netns NAME" are available only in zebra, write
custom DEFSHs in vtysh to make it aware of that;
* Remove the "no vrf NAME" definition from vtysh.c and expose the
original command to vtysh by converting the DEFUN_NOSH to a simple
DEFUN. This command doesn't change the vty node so there's no need to
special case it.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'vtysh')
-rwxr-xr-x | vtysh/extract.pl.in | 2 | ||||
-rw-r--r-- | vtysh/vtysh.c | 18 |
2 files changed, 14 insertions, 6 deletions
diff --git a/vtysh/extract.pl.in b/vtysh/extract.pl.in index c0277b3d6..b93314c96 100755 --- a/vtysh/extract.pl.in +++ b/vtysh/extract.pl.in @@ -85,7 +85,7 @@ foreach (@ARGV) { $protocol = "VTYSH_RMAP"; } elsif ($file =~ /lib\/vrf\.c$/) { - $protocol = "VTYSH_ALL"; + $protocol = "VTYSH_VRF"; } elsif ($file =~ /lib\/logicalrouter\.c$/) { $protocol = "VTYSH_ALL"; diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index e25a57692..4e24bef92 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -2070,9 +2070,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", @@ -3689,10 +3696,11 @@ void vtysh_init_vty(void) 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. */ |