diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2015-09-22 11:13:12 -0400 |
---|---|---|
committer | Paul Jakma <paul@quagga.net> | 2015-10-27 10:53:20 +0000 |
commit | 9fb73e8790ab0e433686643bf245ee1f0e238b99 (patch) | |
tree | a65d96ba23fbcc4c8a1c12540d0dcc5dbc084395 | |
parent | 67c3d75f5324b610352998c670f5f0cc4ba0ff2a (diff) | |
download | quagga-9fb73e8790ab0e433686643bf245ee1f0e238b99.tar.bz2 quagga-9fb73e8790ab0e433686643bf245ee1f0e238b99.tar.xz |
vtysh: Allow display of individual daemons configs
When executing a 'show run' or 'write terminal' you see the
entire integrated config. You have no way of knowing what an
individual daemon is going to write until after you do a write
of config to disk if you are not using an integrated configuration.
This change allows the end-user to do such a thing.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
-rw-r--r-- | vtysh/vtysh.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index 91791e2d..783c383c 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -1808,6 +1808,34 @@ DEFUN (vtysh_write_terminal, return CMD_SUCCESS; } +DEFUN (vtysh_write_terminal_daemon, + vtysh_write_terminal_daemon_cmd, + "write terminal (zebra|ripd|ripngd|ospfd|ospf6d|bgpd|isisd|babeld)", + "Write running configuration to memory, network, or terminal\n" + "Write to terminal\n" + "For the zebra daemon\n" + "For the rip daemon\n" + "For the ripng daemon\n" + "For the ospf daemon\n" + "For the ospfv6 daemon\n" + "For the bgp daemon\n" + "For the isis daemon\n" + "For the babel daemon\n") +{ + unsigned int i; + int ret = CMD_SUCCESS; + + for (i = 0; i < array_size(vtysh_client); i++) + { + if (strcmp(vtysh_client[i].name, argv[0]) == 0) + break; + } + + ret = vtysh_client_execute(&vtysh_client[i], "show running-config\n", stdout); + + return ret; +} + DEFUN (vtysh_integrated_config, vtysh_integrated_config_cmd, "service integrated-vtysh-config", @@ -1926,6 +1954,20 @@ ALIAS (vtysh_write_terminal, SHOW_STR "Current operating configuration\n") +ALIAS (vtysh_write_terminal_daemon, + vtysh_show_running_config_daemon_cmd, + "show running-config (zebra|ripd|ripngd|ospfd|ospf6d|bgpd|isisd|babeld)", + SHOW_STR + "Current operating configuration\n" + "For the zebra daemon\n" + "For the rip daemon\n" + "For the ripng daemon\n" + "For the ospf daemon\n" + "For the ospfv6 daemon\n" + "For the bgp daemon\n" + "For the isis daemon\n" + "For the babel daemon\n") + DEFUN (vtysh_terminal_length, vtysh_terminal_length_cmd, "terminal length <0-512>", @@ -2447,12 +2489,14 @@ vtysh_init_vty (void) install_element (CONFIG_NODE, &vtysh_interface_vrf_cmd); install_element (CONFIG_NODE, &vtysh_no_interface_vrf_cmd); install_element (ENABLE_NODE, &vtysh_show_running_config_cmd); + install_element (ENABLE_NODE, &vtysh_show_running_config_daemon_cmd); install_element (ENABLE_NODE, &vtysh_copy_runningconfig_startupconfig_cmd); install_element (ENABLE_NODE, &vtysh_write_file_cmd); install_element (ENABLE_NODE, &vtysh_write_cmd); /* "write terminal" command. */ install_element (ENABLE_NODE, &vtysh_write_terminal_cmd); + install_element (ENABLE_NODE, &vtysh_write_terminal_daemon_cmd); install_element (CONFIG_NODE, &vtysh_integrated_config_cmd); install_element (CONFIG_NODE, &no_vtysh_integrated_config_cmd); |