summaryrefslogtreecommitdiff
path: root/zebra/debug.c
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2024-10-29 10:32:20 +0200
committerGitHub <noreply@github.com>2024-10-29 10:32:20 +0200
commit60f77de79dcc7cc629adfb51117aa0121d81825c (patch)
tree43b1d67748acd62b991e12f6fb3b9dc7b898ae65 /zebra/debug.c
parent2945258c7ce1f08472ac45117c16ca1591af6d03 (diff)
parenta7fec9c387bd9696444b111fd8b0c631ecbf7522 (diff)
Merge pull request #17257 from pguibert6WIND/srv6_debug
zebra: add 'debug zebra srv6' command
Diffstat (limited to 'zebra/debug.c')
-rw-r--r--zebra/debug.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/zebra/debug.c b/zebra/debug.c
index cf1701be19..7b6a19fa1d 100644
--- a/zebra/debug.c
+++ b/zebra/debug.c
@@ -29,6 +29,7 @@ unsigned long zebra_debug_evpn_mh;
unsigned long zebra_debug_pbr;
unsigned long zebra_debug_neigh;
unsigned long zebra_debug_tc;
+unsigned long zebra_debug_srv6;
DEFINE_HOOK(zebra_debug_show_debugging, (struct vty *vty), (vty));
@@ -121,6 +122,9 @@ DEFUN_NOSH (show_debugging_zebra,
if (IS_ZEBRA_DEBUG_PBR)
vty_out(vty, " Zebra PBR debugging is on\n");
+ if (IS_ZEBRA_DEBUG_SRV6)
+ vty_out(vty, " Zebra SRv6 is on\n");
+
hook_call(zebra_debug_show_debugging, vty);
cmd_show_lib_debugs(vty);
@@ -372,6 +376,21 @@ DEFUN (debug_zebra_tc,
return CMD_SUCCESS;
}
+DEFPY(debug_zebra_srv6,
+ debug_zebra_srv6_cmd,
+ "[no$no] debug zebra srv6",
+ NO_STR
+ DEBUG_STR
+ "Zebra configuration\n"
+ "Debug zebra SRv6 events\n")
+{
+ if (no)
+ UNSET_FLAG(zebra_debug_srv6, ZEBRA_DEBUG_SRV6);
+ else
+ SET_FLAG(zebra_debug_srv6, ZEBRA_DEBUG_SRV6);
+ return CMD_SUCCESS;
+}
+
DEFPY (debug_zebra_mlag,
debug_zebra_mlag_cmd,
"[no$no] debug zebra mlag",
@@ -754,6 +773,11 @@ static int config_write_debug(struct vty *vty)
write++;
}
+ if (IS_ZEBRA_DEBUG_SRV6) {
+ vty_out(vty, "debug zebra srv6\n");
+ write++;
+ }
+
return write;
}
@@ -793,6 +817,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_srv6_cmd);
install_element(ENABLE_NODE, &debug_zebra_mlag_cmd);
install_element(ENABLE_NODE, &debug_zebra_nexthop_cmd);
install_element(ENABLE_NODE, &debug_zebra_pbr_cmd);
@@ -845,6 +870,7 @@ void zebra_debug_init(void)
install_element(CONFIG_NODE, &no_debug_zebra_fpm_cmd);
install_element(CONFIG_NODE, &no_debug_zebra_dplane_cmd);
install_element(CONFIG_NODE, &no_debug_zebra_pbr_cmd);
+ install_element(CONFIG_NODE, &debug_zebra_srv6_cmd);
install_element(CONFIG_NODE, &debug_zebra_mlag_cmd);
install_element(CONFIG_NODE, &debug_zebra_evpn_mh_cmd);