summaryrefslogtreecommitdiff
path: root/zebra
diff options
context:
space:
mode:
Diffstat (limited to 'zebra')
-rw-r--r--zebra/ChangeLog1
-rw-r--r--zebra/debug.c74
-rw-r--r--zebra/debug.h7
3 files changed, 82 insertions, 0 deletions
diff --git a/zebra/ChangeLog b/zebra/ChangeLog
index 2e9328da..a9bb0d07 100644
--- a/zebra/ChangeLog
+++ b/zebra/ChangeLog
@@ -9,6 +9,7 @@
* Makefile.am: Build testzebra using above.
* zebra_rib.c: Add a global for the workqueue hold time, useful
for testing.
+ * debug.{c,h}: Add 'debug zebra rib' and 'debug zebra rib queue'.
2006-07-27 Rumen Svobodnikov <rumen@telecoms.bg>
diff --git a/zebra/debug.c b/zebra/debug.c
index 8575a664..23c4de3a 100644
--- a/zebra/debug.c
+++ b/zebra/debug.c
@@ -28,6 +28,7 @@
unsigned long zebra_debug_event;
unsigned long zebra_debug_packet;
unsigned long zebra_debug_kernel;
+unsigned long zebra_debug_rib;
DEFUN (show_debugging_zebra,
show_debugging_zebra_cmd,
@@ -65,6 +66,11 @@ DEFUN (show_debugging_zebra,
if (IS_ZEBRA_DEBUG_KERNEL)
vty_out (vty, " Zebra kernel debugging is on%s", VTY_NEWLINE);
+ if (IS_ZEBRA_DEBUG_RIB)
+ vty_out (vty, " Zebra RIB debugging is on%s", VTY_NEWLINE);
+ if (IS_ZEBRA_DEBUG_RIB_Q)
+ vty_out (vty, " Zebra RIB queue debugging is on%s", VTY_NEWLINE);
+
return CMD_SUCCESS;
}
@@ -140,6 +146,29 @@ DEFUN (debug_zebra_kernel,
return CMD_SUCCESS;
}
+DEFUN (debug_zebra_rib,
+ debug_zebra_rib_cmd,
+ "debug zebra rib",
+ DEBUG_STR
+ "Zebra configuration\n"
+ "Debug RIB events\n")
+{
+ SET_FLAG (zebra_debug_rib, ZEBRA_DEBUG_RIB);
+ return CMD_SUCCESS;
+}
+
+DEFUN (debug_zebra_rib_q,
+ debug_zebra_rib_q_cmd,
+ "debug zebra rib queue",
+ DEBUG_STR
+ "Zebra configuration\n"
+ "Debug RIB events\n"
+ "Debug RIB queueing\n")
+{
+ SET_FLAG (zebra_debug_rib, ZEBRA_DEBUG_RIB_Q);
+ return CMD_SUCCESS;
+}
+
DEFUN (no_debug_zebra_events,
no_debug_zebra_events_cmd,
"no debug zebra events",
@@ -193,6 +222,31 @@ DEFUN (no_debug_zebra_kernel,
return CMD_SUCCESS;
}
+DEFUN (no_debug_zebra_rib,
+ no_debug_zebra_rib_cmd,
+ "no debug zebra rib",
+ NO_STR
+ DEBUG_STR
+ "Zebra configuration\n"
+ "Debug zebra RIB\n")
+{
+ zebra_debug_rib = 0;
+ return CMD_SUCCESS;
+}
+
+DEFUN (no_debug_zebra_rib_q,
+ no_debug_zebra_rib_q_cmd,
+ "no debug zebra rib queueu",
+ NO_STR
+ DEBUG_STR
+ "Zebra configuration\n"
+ "Debug zebra RIB\n"
+ "Debug RIB queueing\n")
+{
+ UNSET_FLAG (zebra_debug_rib, ZEBRA_DEBUG_RIB_Q);
+ return CMD_SUCCESS;
+}
+
/* Debug node. */
struct cmd_node debug_node =
{
@@ -238,6 +292,16 @@ config_write_debug (struct vty *vty)
vty_out (vty, "debug zebra kernel%s", VTY_NEWLINE);
write++;
}
+ if (IS_ZEBRA_DEBUG_RIB)
+ {
+ vty_out (vty, "debug zebra rib%s", VTY_NEWLINE);
+ write++;
+ }
+ if (IS_ZEBRA_DEBUG_RIB_Q)
+ {
+ vty_out (vty, "debug zebra rib queue%s", VTY_NEWLINE);
+ write++;
+ }
return write;
}
@@ -246,6 +310,8 @@ zebra_debug_init (void)
{
zebra_debug_event = 0;
zebra_debug_packet = 0;
+ zebra_debug_kernel = 0;
+ zebra_debug_rib = 0;
install_node (&debug_node, config_write_debug);
@@ -257,16 +323,24 @@ zebra_debug_init (void)
install_element (ENABLE_NODE, &debug_zebra_packet_direct_cmd);
install_element (ENABLE_NODE, &debug_zebra_packet_detail_cmd);
install_element (ENABLE_NODE, &debug_zebra_kernel_cmd);
+ install_element (ENABLE_NODE, &debug_zebra_rib_cmd);
+ install_element (ENABLE_NODE, &debug_zebra_rib_q_cmd);
install_element (ENABLE_NODE, &no_debug_zebra_events_cmd);
install_element (ENABLE_NODE, &no_debug_zebra_packet_cmd);
install_element (ENABLE_NODE, &no_debug_zebra_kernel_cmd);
+ install_element (ENABLE_NODE, &no_debug_zebra_rib_cmd);
+ install_element (ENABLE_NODE, &no_debug_zebra_rib_q_cmd);
install_element (CONFIG_NODE, &debug_zebra_events_cmd);
install_element (CONFIG_NODE, &debug_zebra_packet_cmd);
install_element (CONFIG_NODE, &debug_zebra_packet_direct_cmd);
install_element (CONFIG_NODE, &debug_zebra_packet_detail_cmd);
install_element (CONFIG_NODE, &debug_zebra_kernel_cmd);
+ install_element (CONFIG_NODE, &debug_zebra_rib_cmd);
+ install_element (CONFIG_NODE, &debug_zebra_rib_q_cmd);
install_element (CONFIG_NODE, &no_debug_zebra_events_cmd);
install_element (CONFIG_NODE, &no_debug_zebra_packet_cmd);
install_element (CONFIG_NODE, &no_debug_zebra_kernel_cmd);
+ install_element (CONFIG_NODE, &no_debug_zebra_rib_cmd);
+ install_element (CONFIG_NODE, &no_debug_zebra_rib_q_cmd);
}
diff --git a/zebra/debug.h b/zebra/debug.h
index 96b7d8fc..9d9412bc 100644
--- a/zebra/debug.h
+++ b/zebra/debug.h
@@ -33,6 +33,9 @@
#define ZEBRA_DEBUG_KERNEL 0x01
+#define ZEBRA_DEBUG_RIB 0x01
+#define ZEBRA_DEBUG_RIB_Q 0x02
+
/* Debug related macro. */
#define IS_ZEBRA_DEBUG_EVENT (zebra_debug_event & ZEBRA_DEBUG_EVENT)
@@ -43,9 +46,13 @@
#define IS_ZEBRA_DEBUG_KERNEL (zebra_debug_kernel & ZEBRA_DEBUG_KERNEL)
+#define IS_ZEBRA_DEBUG_RIB (zebra_debug_rib & ZEBRA_DEBUG_RIB)
+#define IS_ZEBRA_DEBUG_RIB_Q (zebra_debug_rib & ZEBRA_DEBUG_RIB_Q)
+
extern unsigned long zebra_debug_event;
extern unsigned long zebra_debug_packet;
extern unsigned long zebra_debug_kernel;
+extern unsigned long zebra_debug_rib;
extern void zebra_debug_init (void);