summaryrefslogtreecommitdiff
path: root/pbrd/pbr_vty.c
diff options
context:
space:
mode:
Diffstat (limited to 'pbrd/pbr_vty.c')
-rw-r--r--pbrd/pbr_vty.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/pbrd/pbr_vty.c b/pbrd/pbr_vty.c
index 64d88847c8..08fe56c7bb 100644
--- a/pbrd/pbr_vty.c
+++ b/pbrd/pbr_vty.c
@@ -1954,13 +1954,6 @@ DEFPY (show_pbr_interface,
/* PBR debugging CLI ------------------------------------------------------- */
-static struct cmd_node debug_node = {
- .name = "debug",
- .node = DEBUG_NODE,
- .prompt = "",
- .config_write = pbr_debug_config_write,
-};
-
DEFPY(debug_pbr,
debug_pbr_cmd,
"[no] debug pbr [{map$map|zebra$zebra|nht$nht|events$events}]",
@@ -1973,20 +1966,21 @@ DEFPY(debug_pbr,
"Events\n")
{
uint32_t mode = DEBUG_NODE2MODE(vty->node);
+ bool all = false;
+
+ /* no specific debug --> act on all of them */
+ if (strmatch(argv[argc - 1]->text, "pbr"))
+ all = true;
- if (map)
+ if (map || all)
DEBUG_MODE_SET(&pbr_dbg_map, mode, !no);
- if (zebra)
+ if (zebra || all)
DEBUG_MODE_SET(&pbr_dbg_zebra, mode, !no);
- if (nht)
+ if (nht || all)
DEBUG_MODE_SET(&pbr_dbg_nht, mode, !no);
- if (events)
+ if (events || all)
DEBUG_MODE_SET(&pbr_dbg_event, mode, !no);
- /* no specific debug --> act on all of them */
- if (strmatch(argv[argc - 1]->text, "pbr"))
- pbr_debug_set_all(mode, !no);
-
return CMD_SUCCESS;
}
@@ -1999,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;
@@ -2194,7 +2186,6 @@ void pbr_vty_init(void)
install_node(&pbr_map_node);
/* debug */
- install_node(&debug_node);
install_element(ENABLE_NODE, &debug_pbr_cmd);
install_element(CONFIG_NODE, &debug_pbr_cmd);
install_element(ENABLE_NODE, &show_debugging_pbr_cmd);