]> git.proxmox.com Git - mirror_frr.git/blobdiff - vtysh/vtysh.c
Merge branch 'master' into dev-master
[mirror_frr.git] / vtysh / vtysh.c
index 9939a7fae9eda3c6d2f109c5aa98e67bc938cb1b..34d66735dfb62f81c47d46ee8873c452d5f64fca 100644 (file)
@@ -752,6 +752,7 @@ int vtysh_config_from_file(struct vty *vty, FILE *fp)
                                                        lineno, cmd_stat,
                                                        vtysh_client[i].name,
                                                        vty->buf);
+                                               retcode = cmd_stat;
                                                break;
                                        }
                                }
@@ -1914,6 +1915,28 @@ static int show_per_daemon(const char *line, const char *headline)
        return ret;
 }
 
+DEFUN (vtysh_show_debugging,
+       vtysh_show_debugging_cmd,
+       "show debugging",
+       SHOW_STR
+       DEBUG_STR)
+{
+       return show_per_daemon("do show debugging\n",
+                              "Debugging Information for %s:\n");
+}
+
+DEFUN (vtysh_show_debugging_hashtable,
+       vtysh_show_debugging_hashtable_cmd,
+       "show debugging hashtable [statistics]",
+       SHOW_STR
+       DEBUG_STR
+       "Statistics about hash tables\n"
+       "Statistics about hash tables\n")
+{
+       return show_per_daemon("do show debugging hashtable\n",
+                              "Hashtable statistics for %s:\n");
+}
+
 /* Memory */
 DEFUN (vtysh_show_memory,
        vtysh_show_memory_cmd,
@@ -1921,7 +1944,8 @@ DEFUN (vtysh_show_memory,
        SHOW_STR
        "Memory statistics\n")
 {
-       return show_per_daemon("show memory\n", "Memory statistics for %s:\n");
+       return show_per_daemon("show memory\n",
+                              "Memory statistics for %s:\n");
 }
 
 DEFUN (vtysh_show_modules,
@@ -1941,20 +1965,8 @@ DEFUN (vtysh_show_logging,
        SHOW_STR
        "Show current logging configuration\n")
 {
-       unsigned int i;
-       int ret = CMD_SUCCESS;
-       char line[] = "do show logging\n";
-
-       for (i = 0; i < array_size(vtysh_client); i++)
-               if (vtysh_client[i].fd >= 0) {
-                       fprintf(stdout, "Logging configuration for %s:\n",
-                               vtysh_client[i].name);
-                       ret = vtysh_client_execute(&vtysh_client[i], line,
-                                                  stdout);
-                       fprintf(stdout, "\n");
-               }
-
-       return ret;
+       return show_per_daemon("do show logging\n",
+                              "Logging configuration for %s:\n");
 }
 
 DEFUNSH(VTYSH_ALL, vtysh_log_stdout, vtysh_log_stdout_cmd, "log stdout",
@@ -3220,6 +3232,8 @@ void vtysh_init_vty(void)
        install_element(ENABLE_NODE, &vtysh_start_zsh_cmd);
 #endif
 
+       install_element(VIEW_NODE, &vtysh_show_debugging_cmd);
+       install_element(VIEW_NODE, &vtysh_show_debugging_hashtable_cmd);
        install_element(VIEW_NODE, &vtysh_show_memory_cmd);
        install_element(VIEW_NODE, &vtysh_show_modules_cmd);