]> git.puffer.fish Git - mirror/frr.git/commitdiff
*: Add 'show debugging' command from vtysh 1009/head
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 18 Aug 2017 16:50:13 +0000 (12:50 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 21 Aug 2017 11:23:59 +0000 (07:23 -0400)
Allow vtysh to query every daemon about its
debugging status in one go.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
14 files changed:
babeld/babel_zebra.c
bgpd/bgp_debug.c
bgpd/rfapi/vnc_debug.c
eigrpd/eigrp_dump.c
isisd/isisd.c
ldpd/ldp_vty_cmds.c
nhrpd/nhrp_vty.c
ospf6d/ospf6d.c
ospfd/ospf_dump.c
pimd/pim_cmd.c
ripd/rip_debug.c
ripngd/ripng_debug.c
vtysh/vtysh.c
zebra/debug.c

index 11b9c5956c24cb1666bc3ac990e544e037028403..2ec5c3d7c3d2d84e3a319c8a7fee2e6805de3a29 100644 (file)
@@ -310,6 +310,20 @@ debug_babel_config_write (struct vty * vty)
 #endif /* NO_DEBUG */
 }
 
+DEFUN_NOSH (show_debugging_babel,
+           show_debugging_babel_cmd,
+           "show debugging [babel]",
+           SHOW_STR
+           DEBUG_STR
+           "Babel")
+{
+       vty_out(vty, "BABEL debugging status\n");
+
+       debug_babel_config_write(vty);
+
+       return CMD_SUCCESS;
+}
+
 static void
 babel_zebra_connected (struct zclient *zclient)
 {
@@ -339,6 +353,8 @@ void babelz_zebra_init(void)
     install_element(ENABLE_NODE, &no_debug_babel_cmd);
     install_element(CONFIG_NODE, &debug_babel_cmd);
     install_element(CONFIG_NODE, &no_debug_babel_cmd);
+
+    install_element(VIEW_NODE, &show_debugging_babel_cmd);
 }
 
 static int
index bcb3c5fc1860f1ae7761eea93dd7f217cbc373d5..c1c4f2b39cda7ffe1ed3e291543a427ac8f1eb50 100644 (file)
@@ -1615,12 +1615,12 @@ DEFUN (no_debug_bgp,
        return CMD_SUCCESS;
 }
 
-DEFUN (show_debugging_bgp,
-       show_debugging_bgp_cmd,
-       "show debugging bgp",
-       SHOW_STR
-       DEBUG_STR
-       BGP_STR)
+DEFUN_NOSH (show_debugging_bgp,
+           show_debugging_bgp_cmd,
+           "show debugging [bgp]",
+           SHOW_STR
+           DEBUG_STR
+           BGP_STR)
 {
        vty_out(vty, "BGP debugging status:\n");
 
index d4ff9451c373edc536c9a53f73ce22cc8a625f58..3e9b5ed6b97aff27ac3089897499ce3d8ae6c39b 100644 (file)
@@ -142,13 +142,13 @@ DEFUN (no_debug_bgp_vnc_all,
  *     show/save
  ***********************************************************************/
 
-DEFUN (show_debugging_bgp_vnc,
-       show_debugging_bgp_vnc_cmd,
-       "show debugging bgp vnc",
-       SHOW_STR
-       DEBUG_STR
-       BGP_STR
-       VNC_STR)
+DEFUN_NOSH (show_debugging_bgp_vnc,
+           show_debugging_bgp_vnc_cmd,
+           "show debugging bgp vnc",
+           SHOW_STR
+           DEBUG_STR
+           BGP_STR
+           VNC_STR)
 {
        size_t i;
 
index aca6e5981601ab50f7aa83253403c1b8def48d88..0cb1ee5876049e6e4c65ccbe3980283d1edf1eec 100644 (file)
@@ -323,12 +323,12 @@ void show_ip_eigrp_neighbor_entry(struct vty *vty, struct eigrp *eigrp,
 }
 
 
-DEFUN (show_debugging_eigrp,
-       show_debugging_eigrp_cmd,
-       "show debugging eigrp",
-       SHOW_STR
-       DEBUG_STR
-       EIGRP_STR)
+DEFUN_NOSH (show_debugging_eigrp,
+           show_debugging_eigrp_cmd,
+           "show debugging [eigrp]",
+           SHOW_STR
+           DEBUG_STR
+           EIGRP_STR)
 {
        int i;
 
index 60b9367da9907baf0cb3dedd82cc19d232e21c63..dba34e8e3550532d40dde4d0098661beb32391f2 100644 (file)
@@ -758,17 +758,18 @@ void print_debug(struct vty *vty, int flags, int onoff)
                vty_out(vty, "IS-IS LSP scheduling debugging is %s\n", onoffs);
 }
 
-DEFUN (show_debugging,
-       show_debugging_isis_cmd,
-       "show debugging isis",
-       SHOW_STR
-       "State of each debugging option\n"
-       ISIS_STR)
+DEFUN_NOSH (show_debugging,
+           show_debugging_isis_cmd,
+           "show debugging [isis]",
+           SHOW_STR
+           "State of each debugging option\n"
+           ISIS_STR)
 {
-       if (isis->debugs) {
-               vty_out(vty, "IS-IS:\n");
+       vty_out (vty, "IS-IS debugging status:\n");
+
+       if (isis->debugs)
                print_debug(vty, isis->debugs, 1);
-       }
+
        return CMD_SUCCESS;
 }
 
index db92b936287f9caab164e9f288c3cc37d26aa3c2..be473063cdabc68d325c17fc3a6ead2122574db5 100644 (file)
@@ -684,13 +684,13 @@ DEFPY  (ldp_show_l2vpn_atom_vc,
        return (ldp_vty_show_atom_vc(vty, json));
 }
 
-DEFPY  (ldp_show_debugging_mpls_ldp,
-       ldp_show_debugging_mpls_ldp_cmd,
-       "show debugging mpls ldp",
-       "Show running system information\n"
-       "Debugging functions\n"
-       "MPLS information\n"
-       "Label Distribution Protocol\n")
+DEFUN_NOSH (ldp_show_debugging_mpls_ldp,
+           ldp_show_debugging_mpls_ldp_cmd,
+           "show debugging [mpls ldp]",
+           "Show running system information\n"
+           "Debugging functions\n"
+           "MPLS information\n"
+           "Label Distribution Protocol\n")
 {
        return (ldp_vty_show_debugging(vty));
 }
index 20ef17de00bfb9993e8653e7b1f791e58c076411..6d78fc1d2b25f37cc52dda164251a8f4dca79491 100644 (file)
@@ -110,11 +110,11 @@ static int toggle_flag(
 
 #ifndef NO_DEBUG
 
-DEFUN(show_debugging_nhrp, show_debugging_nhrp_cmd,
-       "show debugging nhrp",
-       SHOW_STR
-       "Debugging information\n"
-       "NHRP configuration\n")
+DEFUN_NOSH(show_debugging_nhrp, show_debugging_nhrp_cmd,
+          "show debugging [nhrp]",
+          SHOW_STR
+          "Debugging information\n"
+          "NHRP configuration\n")
 {
        int i;
 
index 48c34b79751d18e3abfeeb6296a477e5614fba3a..f6b9e0ec140ed116c1ce49370ea4949b6f7ad75c 100644 (file)
@@ -85,10 +85,24 @@ static int config_write_ospf6_debug(struct vty *vty)
        config_write_ospf6_debug_asbr(vty);
        config_write_ospf6_debug_abr(vty);
        config_write_ospf6_debug_flood(vty);
-       vty_out(vty, "!\n");
+
        return 0;
 }
 
+DEFUN_NOSH (show_debugging_ospf6,
+           show_debugging_ospf6_cmd,
+           "show debugging [ospf6]",
+           SHOW_STR
+           DEBUG_STR
+           OSPF6_STR)
+{
+       vty_out(vty, "OSPF6 debugging status:");
+
+       config_write_ospf6_debug(vty);
+
+       return CMD_SUCCESS;
+}
+
 #define AREA_LSDB_TITLE_FORMAT                                                 \
        "\n        Area Scoped Link State Database (Area %s)\n\n"
 #define IF_LSDB_TITLE_FORMAT                                                   \
@@ -1157,6 +1171,8 @@ void ospf6_init(void)
 
        install_element_ospf6_clear_interface();
 
+       install_element(VIEW_NODE, &show_debugging_ospf6_cmd);
+
        install_element(VIEW_NODE, &show_ipv6_ospf6_border_routers_cmd);
 
        install_element(VIEW_NODE, &show_ipv6_ospf6_linkstate_cmd);
index d3d1ffed5ec3f19b631d4ef0a03a2330e305b49e..619bd4e5f529d9b7546a49b09a1072103a0d5dea 100644 (file)
@@ -1597,12 +1597,12 @@ static int show_debugging_ospf_common(struct vty *vty, struct ospf *ospf)
        return CMD_SUCCESS;
 }
 
-DEFUN (show_debugging_ospf,
-       show_debugging_ospf_cmd,
-       "show debugging ospf",
-       SHOW_STR
-       DEBUG_STR
-       OSPF_STR)
+DEFUN_NOSH (show_debugging_ospf,
+           show_debugging_ospf_cmd,
+           "show debugging [ospf]",
+           SHOW_STR
+           DEBUG_STR
+           OSPF_STR)
 {
        struct ospf *ospf;
 
@@ -1612,13 +1612,13 @@ DEFUN (show_debugging_ospf,
        return show_debugging_ospf_common(vty, ospf);
 }
 
-DEFUN (show_debugging_ospf_instance,
-       show_debugging_ospf_instance_cmd,
-       "show debugging ospf (1-65535)",
-       SHOW_STR
-       DEBUG_STR
-       OSPF_STR
-       "Instance ID\n")
+DEFUN_NOSH (show_debugging_ospf_instance,
+           show_debugging_ospf_instance_cmd,
+           "show debugging ospf (1-65535)",
+           SHOW_STR
+           DEBUG_STR
+           OSPF_STR
+           "Instance ID\n")
 {
        int idx_number = 3;
        struct ospf *ospf;
index 3bffaf855b893c5f3726d28d9b29e0ce18ee8440..9c79fd87e2980e4dcfc26f51c6767a6a91098115 100644 (file)
@@ -7254,14 +7254,17 @@ DEFUN (no_debug_msdp_packets,
 ALIAS(no_debug_msdp_packets, undebug_msdp_packets_cmd, "undebug msdp packets",
       UNDEBUG_STR DEBUG_MSDP_STR DEBUG_MSDP_PACKETS_STR)
 
-DEFUN (show_debugging_pim,
-       show_debugging_pim_cmd,
-       "show debugging pim",
-       SHOW_STR
-       DEBUG_STR
-       PIM_STR)
+DEFUN_NOSH (show_debugging_pim,
+           show_debugging_pim_cmd,
+           "show debugging [pim]",
+           SHOW_STR
+           DEBUG_STR
+           PIM_STR)
 {
+       vty_out(vty, "PIM debugging status\n");
+
        pim_debug_config_write(vty);
+
        return CMD_SUCCESS;
 }
 
index 492d036991b9ece51d21a6cda35b7d34b9e0d39f..56ba8e7f3e75426845dfa94d802730d24dee2996 100644 (file)
@@ -27,12 +27,12 @@ unsigned long rip_debug_event = 0;
 unsigned long rip_debug_packet = 0;
 unsigned long rip_debug_zebra = 0;
 
-DEFUN (show_debugging_rip,
-       show_debugging_rip_cmd,
-       "show debugging rip",
-       SHOW_STR
-       DEBUG_STR
-       RIP_STR)
+DEFUN_NOSH (show_debugging_rip,
+           show_debugging_rip_cmd,
+           "show debugging [rip]",
+           SHOW_STR
+           DEBUG_STR
+           RIP_STR)
 {
        vty_out(vty, "RIP debugging status:\n");
 
index d56161d39e19aff0f88f3ecef78280f9637ee7a0..9ebc302b1b32e9be2d72edda4ca0923828535c3e 100644 (file)
@@ -28,12 +28,12 @@ unsigned long ripng_debug_event = 0;
 unsigned long ripng_debug_packet = 0;
 unsigned long ripng_debug_zebra = 0;
 
-DEFUN (show_debugging_ripng,
-       show_debugging_ripng_cmd,
-       "show debugging ripng",
-       SHOW_STR
-       DEBUG_STR
-       "RIPng configuration\n")
+DEFUN_NOSH (show_debugging_ripng,
+           show_debugging_ripng_cmd,
+           "show debugging [ripng]",
+           SHOW_STR
+           DEBUG_STR
+           "RIPng configuration\n")
 {
        vty_out(vty, "RIPng debugging status:\n");
 
index 0c3cb27c18ff265e02787c240c69f95f4e40c4a1..379dbf21be13ad12e0e6f7e99ad9514fa5d3a661 100644 (file)
@@ -1914,6 +1914,16 @@ 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");
+}
+
 /* Memory */
 DEFUN (vtysh_show_memory,
        vtysh_show_memory_cmd,
@@ -1921,7 +1931,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,
@@ -3220,6 +3231,7 @@ 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_memory_cmd);
        install_element(VIEW_NODE, &vtysh_show_modules_cmd);
 
index 25f47bc51a8fa85e9068c0ce18a036f79699f496..afeba1c6dea19f090e136b0096e156a5123e07ee 100644 (file)
@@ -34,12 +34,12 @@ unsigned long zebra_debug_mpls;
 unsigned long zebra_debug_vxlan;
 unsigned long zebra_debug_pw;
 
-DEFUN (show_debugging_zebra,
-       show_debugging_zebra_cmd,
-       "show debugging zebra",
-       SHOW_STR
-       "Debugging information\n"
-       "Zebra configuration\n")
+DEFUN_NOSH (show_debugging_zebra,
+           show_debugging_zebra_cmd,
+           "show debugging [zebra]",
+           SHOW_STR
+           "Debugging information\n"
+           "Zebra configuration\n")
 {
        vty_out(vty, "Zebra debugging status:\n");