summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_debug.c
diff options
context:
space:
mode:
authorRafael Zalamena <rzalamena@opensourcerouting.org>2021-03-01 20:07:28 +0100
committerRafael Zalamena <rzalamena@opensourcerouting.org>2021-03-23 16:40:10 +0100
commit259f42367c9580234d41b47a800dc007e9b9a5ea (patch)
tree8ae1f5dab6b2f3f5d106c2e9a796aeaf1d0349d5 /bgpd/bgp_debug.c
parentbgpd: rework BFD integration (diff)
downloadfrr-259f42367c9580234d41b47a800dc007e9b9a5ea.tar.xz
frr-259f42367c9580234d41b47a800dc007e9b9a5ea.zip
bgpd: add debug option for BFD
Add new BGP debug option to enable BFD related debugging messages. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Diffstat (limited to 'bgpd/bgp_debug.c')
-rw-r--r--bgpd/bgp_debug.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/bgpd/bgp_debug.c b/bgpd/bgp_debug.c
index 3afa6eaf0..ce1b7b552 100644
--- a/bgpd/bgp_debug.c
+++ b/bgpd/bgp_debug.c
@@ -21,6 +21,7 @@
#include <zebra.h>
#include <lib/version.h>
+#include "lib/bfd.h"
#include "lib/printfrr.h"
#include "prefix.h"
#include "linklist.h"
@@ -67,6 +68,7 @@ unsigned long conf_bgp_debug_labelpool;
unsigned long conf_bgp_debug_pbr;
unsigned long conf_bgp_debug_graceful_restart;
unsigned long conf_bgp_debug_evpn_mh;
+unsigned long conf_bgp_debug_bfd;
unsigned long term_bgp_debug_as4;
unsigned long term_bgp_debug_neighbor_events;
@@ -86,6 +88,7 @@ unsigned long term_bgp_debug_labelpool;
unsigned long term_bgp_debug_pbr;
unsigned long term_bgp_debug_graceful_restart;
unsigned long term_bgp_debug_evpn_mh;
+unsigned long term_bgp_debug_bfd;
struct list *bgp_debug_neighbor_events_peers = NULL;
struct list *bgp_debug_keepalive_peers = NULL;
@@ -2093,6 +2096,31 @@ DEFUN (no_debug_bgp_labelpool,
return CMD_SUCCESS;
}
+DEFPY(debug_bgp_bfd, debug_bgp_bfd_cmd,
+ "[no] debug bgp bfd",
+ NO_STR
+ DEBUG_STR
+ BGP_STR
+ "Bidirection Forwarding Detection\n")
+{
+ if (vty->node == CONFIG_NODE) {
+ if (no) {
+ DEBUG_OFF(bfd, BFD_LIB);
+ bfd_protocol_integration_set_debug(false);
+ } else {
+ DEBUG_ON(bfd, BFD_LIB);
+ bfd_protocol_integration_set_debug(true);
+ }
+ } else {
+ if (no)
+ TERM_DEBUG_OFF(bfd, BFD_LIB);
+ else
+ TERM_DEBUG_ON(bfd, BFD_LIB);
+ }
+
+ return CMD_SUCCESS;
+}
+
DEFUN (no_debug_bgp,
no_debug_bgp_cmd,
"no debug bgp",
@@ -2136,6 +2164,7 @@ DEFUN (no_debug_bgp,
TERM_DEBUG_OFF(graceful_restart, GRACEFUL_RESTART);
TERM_DEBUG_OFF(evpn_mh, EVPN_MH_ES);
TERM_DEBUG_OFF(evpn_mh, EVPN_MH_RT);
+ TERM_DEBUG_OFF(bfd, BFD_LIB);
vty_out(vty, "All possible debugging has been turned off\n");
@@ -2225,6 +2254,9 @@ DEFUN_NOSH (show_debugging_bgp,
if (BGP_DEBUG(evpn_mh, EVPN_MH_RT))
vty_out(vty, " BGP EVPN-MH route debugging is on\n");
+ if (BGP_DEBUG(bfd, BFD_LIB))
+ vty_out(vty, " BGP BFD library debugging is on\n");
+
vty_out(vty, "\n");
return CMD_SUCCESS;
}
@@ -2350,6 +2382,11 @@ static int bgp_config_write_debug(struct vty *vty)
write++;
}
+ if (CONF_BGP_DEBUG(bfd, BFD_LIB)) {
+ vty_out(vty, "debug bgp bfd\n");
+ write++;
+ }
+
return write;
}
@@ -2478,6 +2515,10 @@ void bgp_debug_init(void)
install_element(ENABLE_NODE, &debug_bgp_evpn_mh_cmd);
install_element(CONFIG_NODE, &debug_bgp_evpn_mh_cmd);
+
+ /* debug bgp bfd */
+ install_element(ENABLE_NODE, &debug_bgp_bfd_cmd);
+ install_element(CONFIG_NODE, &debug_bgp_bfd_cmd);
}
/* Return true if this prefix is on the per_prefix_list of prefixes to debug