summaryrefslogtreecommitdiff
path: root/bgpd/bgp_debug.c
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2024-01-09 10:18:50 -0500
committerGitHub <noreply@github.com>2024-01-09 10:18:50 -0500
commit6c8706802a3eb82e369a32033e7777a1f264161e (patch)
tree0c694d08c8792928b54500a1e31edd4df2395bee /bgpd/bgp_debug.c
parentd5a0a70bbf109d71266d77540876e1d9e6d3dec8 (diff)
parent7a474b87548189e82c40e95010319603771b5e29 (diff)
Merge pull request #15108 from opensourcerouting/fix/debug_bgp_updates_detail
bgpd: Add `debug bgp updates detail` command
Diffstat (limited to 'bgpd/bgp_debug.c')
-rw-r--r--bgpd/bgp_debug.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/bgpd/bgp_debug.c b/bgpd/bgp_debug.c
index 138ffedb29..20608b295c 100644
--- a/bgpd/bgp_debug.c
+++ b/bgpd/bgp_debug.c
@@ -1148,6 +1148,31 @@ DEFUN (debug_bgp_update,
return CMD_SUCCESS;
}
+DEFPY (debug_bgp_update_detail,
+ debug_bgp_update_detail_cmd,
+ "[no] debug bgp updates detail",
+ NO_STR
+ DEBUG_STR
+ BGP_STR
+ "BGP updates\n"
+ "Show detailed information about updates\n")
+{
+ if (vty->node == CONFIG_NODE) {
+ if (no)
+ DEBUG_OFF(update, UPDATE_DETAIL);
+ else
+ DEBUG_ON(update, UPDATE_DETAIL);
+ } else {
+ if (no)
+ TERM_DEBUG_OFF(update, UPDATE_DETAIL);
+ else
+ TERM_DEBUG_ON(update, UPDATE_DETAIL);
+ vty_out(vty, "BGP updates detail debugging is on\n");
+ }
+
+ return CMD_SUCCESS;
+}
+
DEFUN (debug_bgp_update_direct,
debug_bgp_update_direct_cmd,
"debug bgp updates <in|out>",
@@ -2304,6 +2329,11 @@ static int bgp_config_write_debug(struct vty *vty)
bgp_debug_update_out_peers);
}
+ if (CONF_BGP_DEBUG(update, UPDATE_DETAIL)) {
+ vty_out(vty, "debug bgp updates detail\n");
+ write++;
+ }
+
if (CONF_BGP_DEBUG(zebra, ZEBRA)) {
if (!bgp_debug_zebra_prefixes
|| list_isempty(bgp_debug_zebra_prefixes)) {
@@ -2409,6 +2439,8 @@ void bgp_debug_init(void)
install_element(CONFIG_NODE, &debug_bgp_keepalive_cmd);
install_element(ENABLE_NODE, &debug_bgp_update_cmd);
install_element(CONFIG_NODE, &debug_bgp_update_cmd);
+ install_element(ENABLE_NODE, &debug_bgp_update_detail_cmd);
+ install_element(CONFIG_NODE, &debug_bgp_update_detail_cmd);
install_element(ENABLE_NODE, &debug_bgp_zebra_cmd);
install_element(CONFIG_NODE, &debug_bgp_zebra_cmd);
install_element(ENABLE_NODE, &debug_bgp_update_groups_cmd);