diff options
| author | Mark Stapp <mjs@voltanet.io> | 2018-06-08 09:35:07 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-09-19 18:34:25 -0400 |
| commit | 6582b002016100ef44e48c3810023e599322d37b (patch) | |
| tree | d3072af382cdfa0ba1d7fd832e888171b000d0b1 /zebra/debug.c | |
| parent | 85a75f1e775be73178d1b292ec0866fb336ddf2a (diff) | |
zebra: add 'debug dplane' support and cli
Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'zebra/debug.c')
| -rw-r--r-- | zebra/debug.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/zebra/debug.c b/zebra/debug.c index 85be620bff..b21b699366 100644 --- a/zebra/debug.c +++ b/zebra/debug.c @@ -33,6 +33,7 @@ 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)); @@ -89,6 +90,10 @@ 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; @@ -261,6 +266,22 @@ DEFUN (debug_zebra_fpm, return CMD_SUCCESS; } +DEFUN (debug_zebra_dplane, + debug_zebra_dplane_cmd, + "debug zebra dataplane [detailed]", + DEBUG_STR + "Zebra configuration\n" + "Debug zebra dataplane events\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", @@ -376,6 +397,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}; @@ -449,6 +482,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; } @@ -462,6 +504,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); @@ -477,6 +520,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); @@ -486,6 +530,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); @@ -497,6 +542,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); @@ -506,4 +552,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); } |
