mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 13:33:15 +00:00
vtysh: handle "show modules" like "show memory"
Preface with line identifying which daemon it applies to. [Also fixes a missed "plugin" -> "module" replace.] Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
parent
6b0275ac35
commit
2a8e27afb8
@ -121,7 +121,7 @@ DEFUN (show_modules,
|
|||||||
struct frrmod_runtime *plug = frrmod_list;
|
struct frrmod_runtime *plug = frrmod_list;
|
||||||
|
|
||||||
vty_out (vty, "%-12s %-25s %s%s%s",
|
vty_out (vty, "%-12s %-25s %s%s%s",
|
||||||
"Plugin Name", "Version", "Description",
|
"Module Name", "Version", "Description",
|
||||||
VTY_NEWLINE, VTY_NEWLINE);
|
VTY_NEWLINE, VTY_NEWLINE);
|
||||||
while (plug)
|
while (plug)
|
||||||
{
|
{
|
||||||
|
@ -2010,6 +2010,24 @@ DEFUNSH (VTYSH_ZEBRA,
|
|||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
show_per_daemon (const char *line, const char *headline)
|
||||||
|
{
|
||||||
|
unsigned int i;
|
||||||
|
int ret = CMD_SUCCESS;
|
||||||
|
|
||||||
|
for (i = 0; i < array_size(vtysh_client); i++)
|
||||||
|
if ( vtysh_client[i].fd >= 0 )
|
||||||
|
{
|
||||||
|
fprintf (stdout, headline,
|
||||||
|
vtysh_client[i].name);
|
||||||
|
ret = vtysh_client_execute (&vtysh_client[i], line, stdout);
|
||||||
|
fprintf (stdout,"\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/* Memory */
|
/* Memory */
|
||||||
DEFUN (vtysh_show_memory,
|
DEFUN (vtysh_show_memory,
|
||||||
vtysh_show_memory_cmd,
|
vtysh_show_memory_cmd,
|
||||||
@ -2017,20 +2035,16 @@ DEFUN (vtysh_show_memory,
|
|||||||
SHOW_STR
|
SHOW_STR
|
||||||
"Memory statistics\n")
|
"Memory statistics\n")
|
||||||
{
|
{
|
||||||
unsigned int i;
|
return show_per_daemon ("show memory\n", "Memory statistics for %s:\n");
|
||||||
int ret = CMD_SUCCESS;
|
}
|
||||||
char line[] = "show memory\n";
|
|
||||||
|
DEFUN (vtysh_show_modules,
|
||||||
for (i = 0; i < array_size(vtysh_client); i++)
|
vtysh_show_modules_cmd,
|
||||||
if ( vtysh_client[i].fd >= 0 )
|
"show modules",
|
||||||
{
|
SHOW_STR
|
||||||
fprintf (stdout, "Memory statistics for %s:\n",
|
"Loaded modules\n")
|
||||||
vtysh_client[i].name);
|
{
|
||||||
ret = vtysh_client_execute (&vtysh_client[i], line, stdout);
|
return show_per_daemon ("show modules\n", "Module information for %s:\n");
|
||||||
fprintf (stdout,"\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Logging commands. */
|
/* Logging commands. */
|
||||||
@ -3388,6 +3402,7 @@ vtysh_init_vty (void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
install_element (VIEW_NODE, &vtysh_show_memory_cmd);
|
install_element (VIEW_NODE, &vtysh_show_memory_cmd);
|
||||||
|
install_element (VIEW_NODE, &vtysh_show_modules_cmd);
|
||||||
|
|
||||||
install_element (VIEW_NODE, &vtysh_show_work_queues_cmd);
|
install_element (VIEW_NODE, &vtysh_show_work_queues_cmd);
|
||||||
install_element (VIEW_NODE, &vtysh_show_work_queues_daemon_cmd);
|
install_element (VIEW_NODE, &vtysh_show_work_queues_daemon_cmd);
|
||||||
|
Loading…
Reference in New Issue
Block a user