]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/debug.c
zebra: vrf aware routmap is missing in Zebra #2802(Part 2 of 4)
[mirror_frr.git] / zebra / debug.c
index 14b36cb5fb384a2012a74ce0d0b4f7c48a7156c5..19582bb0904afc11a84aaa9c157854152636b2a5 100644 (file)
@@ -33,6 +33,9 @@ unsigned long zebra_debug_nht;
 unsigned long zebra_debug_mpls;
 unsigned long zebra_debug_vxlan;
 unsigned long zebra_debug_pw;
+unsigned long zebra_debug_dplane;
+
+DEFINE_HOOK(zebra_debug_show_debugging, (struct vty *vty), (vty));
 
 DEFUN_NOSH (show_debugging_zebra,
            show_debugging_zebra_cmd,
@@ -87,7 +90,12 @@ DEFUN_NOSH (show_debugging_zebra,
                vty_out(vty, "  Zebra VXLAN debugging is on\n");
        if (IS_ZEBRA_DEBUG_PW)
                vty_out(vty, "  Zebra pseudowire debugging is on\n");
+       if (IS_ZEBRA_DEBUG_DPLANE_DETAIL)
+               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");
 
+       hook_call(zebra_debug_show_debugging, vty);
        return CMD_SUCCESS;
 }
 
@@ -258,6 +266,23 @@ DEFUN (debug_zebra_fpm,
        return CMD_SUCCESS;
 }
 
+DEFUN (debug_zebra_dplane,
+       debug_zebra_dplane_cmd,
+       "debug zebra dplane [detailed]",
+       DEBUG_STR
+       "Zebra configuration\n"
+       "Debug zebra dataplane events\n"
+       "Detailed debug information\n")
+{
+       int idx = 0;
+       SET_FLAG(zebra_debug_dplane, ZEBRA_DEBUG_DPLANE);
+
+       if (argv_find(argv, argc, "detailed", &idx))
+               SET_FLAG(zebra_debug_dplane, ZEBRA_DEBUG_DPLANE_DETAILED);
+
+       return CMD_SUCCESS;
+}
+
 DEFUN (no_debug_zebra_events,
        no_debug_zebra_events_cmd,
        "no debug zebra events",
@@ -373,6 +398,18 @@ DEFUN (no_debug_zebra_fpm,
        return CMD_SUCCESS;
 }
 
+DEFUN (no_debug_zebra_dplane,
+       no_debug_zebra_dplane_cmd,
+       "no debug zebra dplane",
+       NO_STR
+       DEBUG_STR
+       "Zebra configuration\n"
+       "Debug zebra dataplane events\n")
+{
+       zebra_debug_dplane = 0;
+       return CMD_SUCCESS;
+}
+
 /* Debug node. */
 struct cmd_node debug_node = {DEBUG_NODE, "", /* Debug node has no interface. */
                              1};
@@ -446,6 +483,15 @@ static int config_write_debug(struct vty *vty)
                vty_out(vty, "debug zebra pseudowires\n");
                write++;
        }
+
+       if (CHECK_FLAG(zebra_debug_dplane, ZEBRA_DEBUG_DPLANE_DETAILED)) {
+               vty_out(vty, "debug zebra dplane detailed\n");
+               write++;
+       } else if (CHECK_FLAG(zebra_debug_dplane, ZEBRA_DEBUG_DPLANE)) {
+               vty_out(vty, "debug zebra dplane\n");
+               write++;
+       }
+
        return write;
 }
 
@@ -459,6 +505,7 @@ void zebra_debug_init(void)
        zebra_debug_mpls = 0;
        zebra_debug_vxlan = 0;
        zebra_debug_pw = 0;
+       zebra_debug_dplane = 0;
 
        install_node(&debug_node, config_write_debug);
 
@@ -474,6 +521,7 @@ void zebra_debug_init(void)
        install_element(ENABLE_NODE, &debug_zebra_kernel_msgdump_cmd);
        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, &no_debug_zebra_events_cmd);
        install_element(ENABLE_NODE, &no_debug_zebra_nht_cmd);
        install_element(ENABLE_NODE, &no_debug_zebra_mpls_cmd);
@@ -483,6 +531,7 @@ void zebra_debug_init(void)
        install_element(ENABLE_NODE, &no_debug_zebra_kernel_msgdump_cmd);
        install_element(ENABLE_NODE, &no_debug_zebra_rib_cmd);
        install_element(ENABLE_NODE, &no_debug_zebra_fpm_cmd);
+       install_element(ENABLE_NODE, &no_debug_zebra_dplane_cmd);
 
        install_element(CONFIG_NODE, &debug_zebra_events_cmd);
        install_element(CONFIG_NODE, &debug_zebra_nht_cmd);
@@ -494,6 +543,7 @@ void zebra_debug_init(void)
        install_element(CONFIG_NODE, &debug_zebra_kernel_msgdump_cmd);
        install_element(CONFIG_NODE, &debug_zebra_rib_cmd);
        install_element(CONFIG_NODE, &debug_zebra_fpm_cmd);
+       install_element(CONFIG_NODE, &debug_zebra_dplane_cmd);
        install_element(CONFIG_NODE, &no_debug_zebra_events_cmd);
        install_element(CONFIG_NODE, &no_debug_zebra_nht_cmd);
        install_element(CONFIG_NODE, &no_debug_zebra_mpls_cmd);
@@ -503,4 +553,5 @@ void zebra_debug_init(void)
        install_element(CONFIG_NODE, &no_debug_zebra_kernel_msgdump_cmd);
        install_element(CONFIG_NODE, &no_debug_zebra_rib_cmd);
        install_element(CONFIG_NODE, &no_debug_zebra_fpm_cmd);
+       install_element(CONFIG_NODE, &no_debug_zebra_dplane_cmd);
 }