diff options
author | Igor Ryzhov <iryzhov@nfware.com> | 2024-03-26 19:25:21 +0100 |
---|---|---|
committer | Mark Stapp <mjs@cisco.com> | 2024-08-27 15:53:02 +0200 |
commit | 830972cab211a2f7ad82d7635ad9111afac8f47b (patch) | |
tree | d33c9a59f0e3fefbcd9173684bacffbf41127f63 /pbrd | |
parent | lib: common debug config output (diff) | |
download | frr-830972cab211a2f7ad82d7635ad9111afac8f47b.tar.xz frr-830972cab211a2f7ad82d7635ad9111afac8f47b.zip |
lib: common debug status output
Implement common code for debug status output and remove daemon-specific
code that is duplicated everywhere.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'pbrd')
-rw-r--r-- | pbrd/pbr_debug.c | 23 | ||||
-rw-r--r-- | pbrd/pbr_debug.h | 14 | ||||
-rw-r--r-- | pbrd/pbr_vty.c | 2 |
3 files changed, 0 insertions, 39 deletions
diff --git a/pbrd/pbr_debug.c b/pbrd/pbr_debug.c index 027f1e2c5..6b0d1d5a8 100644 --- a/pbrd/pbr_debug.c +++ b/pbrd/pbr_debug.c @@ -19,29 +19,6 @@ struct debug pbr_dbg_zebra = { 0, "debug pbr zebra", struct debug pbr_dbg_nht = { 0, "debug pbr nht", "PBR nexthop tracking" }; struct debug pbr_dbg_event = { 0, "debug pbr events", "PBR events" }; -struct debug *pbr_debugs[] = {&pbr_dbg_map, &pbr_dbg_zebra, &pbr_dbg_nht, - &pbr_dbg_event}; - -const char *pbr_debugs_conflines[] = { - "debug pbr map", - "debug pbr zebra", - "debug pbr nht", - "debug pbr events", -}; - -int pbr_debug_config_write_helper(struct vty *vty, bool config) -{ - uint32_t mode = DEBUG_MODE_ALL; - - if (config) - mode = DEBUG_MODE_CONF; - - for (unsigned int i = 0; i < array_size(pbr_debugs); i++) - if (DEBUG_MODE_CHECK(pbr_debugs[i], mode)) - vty_out(vty, "%s\n", pbr_debugs_conflines[i]); - return 0; -} - void pbr_debug_init(void) { debug_install(&pbr_dbg_map); diff --git a/pbrd/pbr_debug.h b/pbrd/pbr_debug.h index 101c6986b..c1ffce99b 100644 --- a/pbrd/pbr_debug.h +++ b/pbrd/pbr_debug.h @@ -35,18 +35,4 @@ void pbr_debug_init(void); */ void pbr_debug_set_all(uint32_t flags, bool set); -/* - * Config write helper. - * - * vty - * Vty to write to - * - * config - * Whether we are writing to show run or saving config file - * - * Returns: - * 0 for convenience - */ -int pbr_debug_config_write_helper(struct vty *vty, bool config); - #endif /* __PBR_DEBUG_H__ */ diff --git a/pbrd/pbr_vty.c b/pbrd/pbr_vty.c index d08310ca8..08fe56c7b 100644 --- a/pbrd/pbr_vty.c +++ b/pbrd/pbr_vty.c @@ -1993,8 +1993,6 @@ DEFUN_NOSH(show_debugging_pbr, { vty_out(vty, "PBR debugging status:\n"); - pbr_debug_config_write_helper(vty, false); - cmd_show_lib_debugs(vty); return CMD_SUCCESS; |