forked from Mirror/frr
*: Create and use infrastructure to show debugs in lib
There are lib debugs being set but never show up in `show debug` commands because there was no way to show that they were being used. Add a bit of infrastructure to allow this and then use it for `debug route-map` Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
a00621d8b9
commit
cf00164b69
|
@ -225,6 +225,8 @@ DEFUN_NOSH (show_debugging_babel,
|
||||||
|
|
||||||
debug_babel_config_write(vty);
|
debug_babel_config_write(vty);
|
||||||
|
|
||||||
|
cmd_show_lib_debugs(vty);
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -973,6 +973,8 @@ DEFUN_NOSH(show_debugging_bfd,
|
||||||
if (bglobal.debug_network)
|
if (bglobal.debug_network)
|
||||||
vty_out(vty, " Network layer debugging is on.\n");
|
vty_out(vty, " Network layer debugging is on.\n");
|
||||||
|
|
||||||
|
cmd_show_lib_debugs(vty);
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2278,6 +2278,8 @@ DEFUN_NOSH (show_debugging_bgp,
|
||||||
vty_out(vty,
|
vty_out(vty,
|
||||||
" BGP conditional advertisement debugging is on\n");
|
" BGP conditional advertisement debugging is on\n");
|
||||||
|
|
||||||
|
cmd_show_lib_debugs(vty);
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -322,6 +322,7 @@ DEFUN_NOSH (show_debugging_eigrp,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cmd_show_lib_debugs(vty);
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1700,6 +1700,8 @@ DEFUN_NOSH (show_debugging,
|
||||||
if (IS_DEBUG_LFA)
|
if (IS_DEBUG_LFA)
|
||||||
print_debug(vty, DEBUG_LFA, 1);
|
print_debug(vty, DEBUG_LFA, 1);
|
||||||
|
|
||||||
|
cmd_show_lib_debugs(vty);
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -774,7 +774,11 @@ DEFPY_NOSH (ldp_show_debugging_mpls_ldp,
|
||||||
"MPLS information\n"
|
"MPLS information\n"
|
||||||
"Label Distribution Protocol\n")
|
"Label Distribution Protocol\n")
|
||||||
{
|
{
|
||||||
return (ldp_vty_show_debugging(vty));
|
ldp_vty_show_debugging(vty);
|
||||||
|
|
||||||
|
cmd_show_lib_debugs(vty);
|
||||||
|
|
||||||
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -48,6 +48,7 @@
|
||||||
#include "lib_errors.h"
|
#include "lib_errors.h"
|
||||||
#include "northbound_cli.h"
|
#include "northbound_cli.h"
|
||||||
#include "network.h"
|
#include "network.h"
|
||||||
|
#include "routemap.h"
|
||||||
|
|
||||||
#include "frrscript.h"
|
#include "frrscript.h"
|
||||||
|
|
||||||
|
@ -2446,6 +2447,11 @@ const char *host_config_get(void)
|
||||||
return host.config;
|
return host.config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cmd_show_lib_debugs(struct vty *vty)
|
||||||
|
{
|
||||||
|
route_map_show_debug(vty);
|
||||||
|
}
|
||||||
|
|
||||||
void install_default(enum node_type node)
|
void install_default(enum node_type node)
|
||||||
{
|
{
|
||||||
_install_element(node, &config_exit_cmd);
|
_install_element(node, &config_exit_cmd);
|
||||||
|
|
|
@ -649,6 +649,12 @@ extern char *cmd_variable_comp2str(vector comps, unsigned short cols);
|
||||||
|
|
||||||
extern void command_setup_early_logging(const char *dest, const char *level);
|
extern void command_setup_early_logging(const char *dest, const char *level);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Allow a mechanism for `debug XXX` commands that live
|
||||||
|
* under the lib directory to output their debug status
|
||||||
|
*/
|
||||||
|
extern void cmd_show_lib_debugs(struct vty *vty);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -3174,6 +3174,12 @@ static struct cmd_node rmap_debug_node = {
|
||||||
.config_write = rmap_config_write_debug,
|
.config_write = rmap_config_write_debug,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void route_map_show_debug(struct vty *vty)
|
||||||
|
{
|
||||||
|
if (rmap_debug)
|
||||||
|
vty_out(vty, "debug route-map\n");
|
||||||
|
}
|
||||||
|
|
||||||
/* Configuration write function. */
|
/* Configuration write function. */
|
||||||
static int rmap_config_write_debug(struct vty *vty)
|
static int rmap_config_write_debug(struct vty *vty)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1015,6 +1015,8 @@ extern void route_map_optimization_disabled_show(struct vty *vty,
|
||||||
bool show_defaults);
|
bool show_defaults);
|
||||||
extern void route_map_cli_init(void);
|
extern void route_map_cli_init(void);
|
||||||
|
|
||||||
|
extern void route_map_show_debug(struct vty *vty);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -126,6 +126,8 @@ DEFUN_NOSH(show_debugging_nhrp, show_debugging_nhrp_cmd,
|
||||||
debug_flags_desc[i].str);
|
debug_flags_desc[i].str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cmd_show_lib_debugs(vty);
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -115,6 +115,8 @@ DEFUN_NOSH (show_debugging_ospf6,
|
||||||
|
|
||||||
config_write_ospf6_debug(vty);
|
config_write_ospf6_debug(vty);
|
||||||
|
|
||||||
|
cmd_show_lib_debugs(vty);
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1860,7 +1860,11 @@ DEFUN_NOSH (show_debugging_ospf,
|
||||||
DEBUG_STR
|
DEBUG_STR
|
||||||
OSPF_STR)
|
OSPF_STR)
|
||||||
{
|
{
|
||||||
return show_debugging_ospf_common(vty);
|
show_debugging_ospf_common(vty);
|
||||||
|
|
||||||
|
cmd_show_lib_debugs(vty);
|
||||||
|
|
||||||
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFUN_NOSH (show_debugging_ospf_instance,
|
DEFUN_NOSH (show_debugging_ospf_instance,
|
||||||
|
@ -1878,7 +1882,11 @@ DEFUN_NOSH (show_debugging_ospf_instance,
|
||||||
if (instance != ospf_instance)
|
if (instance != ospf_instance)
|
||||||
return CMD_NOT_MY_INSTANCE;
|
return CMD_NOT_MY_INSTANCE;
|
||||||
|
|
||||||
return show_debugging_ospf_common(vty);
|
show_debugging_ospf_common(vty);
|
||||||
|
|
||||||
|
cmd_show_lib_debugs(vty);
|
||||||
|
|
||||||
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int config_write_debug(struct vty *vty);
|
static int config_write_debug(struct vty *vty);
|
||||||
|
|
|
@ -1092,6 +1092,8 @@ DEFPY_NOSH(show_debugging_pathd, show_debugging_pathd_cmd,
|
||||||
"State of each debugging option\n"
|
"State of each debugging option\n"
|
||||||
"pathd module debugging\n")
|
"pathd module debugging\n")
|
||||||
{
|
{
|
||||||
|
|
||||||
|
cmd_show_lib_debugs(vty);
|
||||||
/* nothing to do here */
|
/* nothing to do here */
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1243,6 +1243,8 @@ DEFUN_NOSH(show_debugging_pbr,
|
||||||
|
|
||||||
pbr_debug_config_write_helper(vty, false);
|
pbr_debug_config_write_helper(vty, false);
|
||||||
|
|
||||||
|
cmd_show_lib_debugs(vty);
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1558,6 +1558,8 @@ DEFUN_NOSH (show_debugging_pimv6,
|
||||||
|
|
||||||
pim_debug_config_write(vty);
|
pim_debug_config_write(vty);
|
||||||
|
|
||||||
|
cmd_show_lib_debugs(vty);
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4906,6 +4906,7 @@ DEFUN_NOSH (show_debugging_pim,
|
||||||
|
|
||||||
pim_debug_config_write(vty);
|
pim_debug_config_write(vty);
|
||||||
|
|
||||||
|
cmd_show_lib_debugs(vty);
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,6 +55,8 @@ DEFUN_NOSH (show_debugging_rip,
|
||||||
if (IS_RIP_DEBUG_ZEBRA)
|
if (IS_RIP_DEBUG_ZEBRA)
|
||||||
vty_out(vty, " RIP zebra debugging is on\n");
|
vty_out(vty, " RIP zebra debugging is on\n");
|
||||||
|
|
||||||
|
cmd_show_lib_debugs(vty);
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,6 +56,8 @@ DEFUN_NOSH (show_debugging_ripng,
|
||||||
if (IS_RIPNG_DEBUG_ZEBRA)
|
if (IS_RIPNG_DEBUG_ZEBRA)
|
||||||
vty_out(vty, " RIPng zebra debugging is on\n");
|
vty_out(vty, " RIPng zebra debugging is on\n");
|
||||||
|
|
||||||
|
cmd_show_lib_debugs(vty);
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -615,6 +615,8 @@ DEFUN_NOSH (show_debugging_sharpd,
|
||||||
{
|
{
|
||||||
vty_out(vty, "Sharp debugging status:\n");
|
vty_out(vty, "Sharp debugging status:\n");
|
||||||
|
|
||||||
|
cmd_show_lib_debugs(vty);
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1301,6 +1301,8 @@ DEFUN_NOSH (show_debugging_static,
|
||||||
|
|
||||||
static_debug_status_write(vty);
|
static_debug_status_write(vty);
|
||||||
|
|
||||||
|
cmd_show_lib_debugs(vty);
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -710,6 +710,8 @@ DEFUN_NOSH (show_debugging_vrrp,
|
||||||
|
|
||||||
vrrp_debug_status_write(vty);
|
vrrp_debug_status_write(vty);
|
||||||
|
|
||||||
|
cmd_show_lib_debugs(vty);
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -125,6 +125,8 @@ DEFUN_NOSH (show_debugging_watchfrr,
|
||||||
DEBUG_STR
|
DEBUG_STR
|
||||||
WATCHFRR_STR)
|
WATCHFRR_STR)
|
||||||
{
|
{
|
||||||
|
cmd_show_lib_debugs(vty);
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -137,6 +137,9 @@ DEFUN_NOSH (show_debugging_zebra,
|
||||||
vty_out(vty, " Zebra PBR debugging is on\n");
|
vty_out(vty, " Zebra PBR debugging is on\n");
|
||||||
|
|
||||||
hook_call(zebra_debug_show_debugging, vty);
|
hook_call(zebra_debug_show_debugging, vty);
|
||||||
|
|
||||||
|
cmd_show_lib_debugs(vty);
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue