]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Add code to allow us to add debug for mlag
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 11 Jan 2019 21:16:09 +0000 (16:16 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 31 Jan 2019 14:20:46 +0000 (09:20 -0500)
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
zebra/debug.c
zebra/debug.h
zebra/subdir.am

index 0eb06d7f25919fb5586ee592ba44ff46e27d11fd..87999a1bbce03e66976b66e967959e8ee7d42d11 100644 (file)
 #include "command.h"
 #include "debug.h"
 
+#ifndef VTYSH_EXTRACT_PL
+#include "zebra/debug_clippy.c"
+#endif
+
 /* For debug statement. */
 unsigned long zebra_debug_event;
 unsigned long zebra_debug_packet;
@@ -34,6 +38,7 @@ unsigned long zebra_debug_mpls;
 unsigned long zebra_debug_vxlan;
 unsigned long zebra_debug_pw;
 unsigned long zebra_debug_dplane;
+unsigned long zebra_debug_mlag;
 
 DEFINE_HOOK(zebra_debug_show_debugging, (struct vty *vty), (vty));
 
@@ -94,6 +99,8 @@ DEFUN_NOSH (show_debugging_zebra,
                vty_out(vty, "  Zebra detailed dataplane debugging is on\n");
        else if (IS_ZEBRA_DEBUG_DPLANE)
                vty_out(vty, "  Zebra dataplane debugging is on\n");
+       if (IS_ZEBRA_DEBUG_MLAG)
+               vty_out(vty, "  Zebra mlag debugging is on\n");
 
        hook_call(zebra_debug_show_debugging, vty);
        return CMD_SUCCESS;
@@ -284,6 +291,21 @@ DEFUN (debug_zebra_dplane,
        return CMD_SUCCESS;
 }
 
+DEFPY (debug_zebra_mlag,
+       debug_zebra_mlag_cmd,
+       "[no$no] debug zebra mlag",
+       NO_STR
+       DEBUG_STR
+       "Zebra configuration\n"
+       "Debug option set for mlag events\n")
+{
+       if (no)
+               UNSET_FLAG(zebra_debug_mlag, ZEBRA_DEBUG_MLAG);
+       else
+               SET_FLAG(zebra_debug_mlag, ZEBRA_DEBUG_MLAG);
+       return CMD_SUCCESS;
+}
+
 DEFUN (no_debug_zebra_events,
        no_debug_zebra_events_cmd,
        "no debug zebra events",
@@ -507,6 +529,7 @@ void zebra_debug_init(void)
        zebra_debug_vxlan = 0;
        zebra_debug_pw = 0;
        zebra_debug_dplane = 0;
+       zebra_debug_mlag = 0;
 
        install_node(&debug_node, config_write_debug);
 
@@ -523,6 +546,7 @@ void zebra_debug_init(void)
        install_element(ENABLE_NODE, &debug_zebra_rib_cmd);
        install_element(ENABLE_NODE, &debug_zebra_fpm_cmd);
        install_element(ENABLE_NODE, &debug_zebra_dplane_cmd);
+       install_element(ENABLE_NODE, &debug_zebra_mlag_cmd);
        install_element(ENABLE_NODE, &no_debug_zebra_events_cmd);
        install_element(ENABLE_NODE, &no_debug_zebra_nht_cmd);
        install_element(ENABLE_NODE, &no_debug_zebra_mpls_cmd);
index cd15441ec8a446142d9cef5957d9458db0ad7430..c79cd96c214d53e99c17f1e99c686df2a9da09f8 100644 (file)
@@ -51,6 +51,8 @@
 #define ZEBRA_DEBUG_DPLANE           0x01
 #define ZEBRA_DEBUG_DPLANE_DETAILED  0x02
 
+#define ZEBRA_DEBUG_MLAG    0x01
+
 /* Debug related macro. */
 #define IS_ZEBRA_DEBUG_EVENT  (zebra_debug_event & ZEBRA_DEBUG_EVENT)
 
@@ -79,6 +81,8 @@
 #define IS_ZEBRA_DEBUG_DPLANE_DETAIL \
        (zebra_debug_dplane & ZEBRA_DEBUG_DPLANE_DETAILED)
 
+#define IS_ZEBRA_DEBUG_MLAG (zebra_debug_mlag & ZEBRA_DEBUG_MLAG)
+
 extern unsigned long zebra_debug_event;
 extern unsigned long zebra_debug_packet;
 extern unsigned long zebra_debug_kernel;
@@ -89,6 +93,7 @@ extern unsigned long zebra_debug_mpls;
 extern unsigned long zebra_debug_vxlan;
 extern unsigned long zebra_debug_pw;
 extern unsigned long zebra_debug_dplane;
+extern unsigned long zebra_debug_mlag;
 
 extern void zebra_debug_init(void);
 
index daa7946bc0923697783ef687c9d893aaa4d19080..1e36d020a3235a1dc942f6be5d2ac617305871f1 100644 (file)
@@ -95,6 +95,9 @@ zebra_zebra_SOURCES = \
        zebra/zebra_errors.c \
        # end
 
+zebra/debug_clippy.c: $(CLIPPY_DEPS)
+zebra/debug.$(OBJEXT): zebra/debug_clippy.c
+
 zebra/zebra_mlag_clippy.c: $(CLIPPY_DEPS)
 zebra/zebra_mlag.$(OBJEXT): zebra/zebra_mlag_clippy.c