This command helps in troubleshooting static bfd feature.
Add traces upon bfd events.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
#include "staticd/static_routes.h"
#include "staticd/static_zebra.h"
+#include "staticd/static_debug.h"
#include "lib/openbsd-queue.h"
break;
case BSS_DOWN:
/* Peer went down, remove this next hop. */
- zlog_info("%s: next hop is down, remove it from RIB", __func__);
+ DEBUGD(&static_dbg_bfd,
+ "%s: next hop is down, remove it from RIB", __func__);
sn->path_down = true;
static_zebra_route_add(sn->pn, true);
break;
case BSS_UP:
/* Peer is back up, add this next hop. */
- zlog_info("%s: next hop is up, add it to RIB", __func__);
+ DEBUGD(&static_dbg_bfd, "%s: next hop is up, add it to RIB",
+ __func__);
sn->path_down = false;
static_zebra_route_add(sn->pn, true);
break;
#include "lib/command.h"
#include "lib/debug.h"
+#include "lib/bfd.h"
#include "static_debug.h"
/* clang-format off */
struct debug static_dbg_events = {0, "Staticd events"};
struct debug static_dbg_route = {0, "Staticd route"};
+struct debug static_dbg_bfd = {0, "Staticd bfd"};
struct debug *static_debug_arr[] = {
&static_dbg_events,
- &static_dbg_route
+ &static_dbg_route,
+ &static_dbg_bfd
};
const char *static_debugs_conflines[] = {
"debug static events",
- "debug static route"
+ "debug static route",
+ "debug static bfd"
};
/* clang-format on */
* Debug general internal events
*
*/
-void static_debug_set(int vtynode, bool onoff, bool events, bool route)
+void static_debug_set(int vtynode, bool onoff, bool events, bool route,
+ bool bfd)
{
uint32_t mode = DEBUG_NODE2MODE(vtynode);
DEBUG_MODE_SET(&static_dbg_events, mode, onoff);
if (route)
DEBUG_MODE_SET(&static_dbg_route, mode, onoff);
+ if (bfd) {
+ DEBUG_MODE_SET(&static_dbg_bfd, mode, onoff);
+ bfd_protocol_integration_set_debug(onoff);
+ }
}
/*
/* staticd debugging records */
extern struct debug static_dbg_events;
extern struct debug static_dbg_route;
+extern struct debug static_dbg_bfd;
/*
* Initialize staticd debugging.
* Debug general internal events
*
*/
-void static_debug_set(int vtynode, bool onoff, bool events, bool route);
+void static_debug_set(int vtynode, bool onoff, bool events, bool route,
+ bool bfd);
#ifdef __cplusplus
}
}
DEFPY_YANG(debug_staticd, debug_staticd_cmd,
- "[no] debug static [{events$events|route$route}]",
+ "[no] debug static [{events$events|route$route|bfd$bfd}]",
NO_STR DEBUG_STR STATICD_STR
"Debug events\n"
- "Debug route\n")
+ "Debug route\n"
+ "Debug bfd\n")
{
/* If no specific category, change all */
if (strmatch(argv[argc - 1]->text, "static"))
- static_debug_set(vty->node, !no, true, true);
+ static_debug_set(vty->node, !no, true, true, true);
else
- static_debug_set(vty->node, !no, !!events, !!route);
+ static_debug_set(vty->node, !no, !!events, !!route, !!bfd);
return CMD_SUCCESS;
}