From: rgirada Date: Sun, 23 Aug 2020 13:33:04 +0000 (-0700) Subject: ospfd: Debug support to ospf GR helper functionality X-Git-Tag: base_7.6~433^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=caa1cd9eab47c4cc6647a830871693b79e431a7b;p=mirror%2Ffrr.git ospfd: Debug support to ospf GR helper functionality Description: Added the following debug commands to enable debugs GR helper functionality. [no] debug ospf gr helper Signed-off-by: Rajesh Girada --- diff --git a/ospfd/ospf_dump.c b/ospfd/ospf_dump.c index 66caf84436..7fd1b5c64e 100644 --- a/ospfd/ospf_dump.c +++ b/ospfd/ospf_dump.c @@ -41,6 +41,9 @@ #include "ospfd/ospf_dump.h" #include "ospfd/ospf_packet.h" #include "ospfd/ospf_network.h" +#ifndef VTYSH_EXTRACT_PL +#include "ospfd/ospf_dump_clippy.c" +#endif /* Configuration debug option variables. */ unsigned long conf_debug_ospf_packet[5] = {0, 0, 0, 0, 0}; @@ -1503,6 +1506,26 @@ DEFUN(no_debug_ospf_ldp_sync, if (vty->node == CONFIG_NODE) CONF_DEBUG_OFF(ldp_sync, LDP_SYNC); TERM_DEBUG_OFF(ldp_sync, LDP_SYNC); + + return CMD_SUCCESS; +} + +DEFPY (debug_ospf_gr, + debug_ospf_gr_cmd, + "[no$no] debug ospf graceful-restart helper", + NO_STR + DEBUG_STR OSPF_STR + "Gracefull restart\n" + "Helper Information\n") +{ + if (vty->node == CONFIG_NODE) + CONF_DEBUG_ON(gr, GR_HELPER); + + if (!no) + TERM_DEBUG_ON(gr, GR_HELPER); + else + TERM_DEBUG_OFF(gr, GR_HELPER); + return CMD_SUCCESS; } @@ -1669,6 +1692,10 @@ static int show_debugging_ospf_common(struct vty *vty, struct ospf *ospf) if (IS_DEBUG_OSPF(ldp_sync, LDP_SYNC) == OSPF_DEBUG_LDP_SYNC) vty_out(vty, " OSPF ldp-sync debugging is on\n"); + /* Show debug status for GR helper. */ + if (IS_DEBUG_OSPF(gr, GR_HELPER) == OSPF_DEBUG_GR_HELPER) + vty_out(vty, " OSPF Graceful Restart Helper debugging is on\n"); + vty_out(vty, "\n"); return CMD_SUCCESS; @@ -1855,6 +1882,13 @@ static int config_write_debug(struct vty *vty) vty_out(vty, "debug ospf%s ldp-sync\n", str); write = 1; } + + /* debug ospf gr helper */ + if (IS_CONF_DEBUG_OSPF(gr, GR_HELPER) == OSPF_DEBUG_GR_HELPER) { + vty_out(vty, "debug ospf%s graceful-restart helper\n", str); + write = 1; + } + return write; } @@ -1884,6 +1918,7 @@ void ospf_debug_init(void) install_element(ENABLE_NODE, &no_debug_ospf_sr_cmd); install_element(ENABLE_NODE, &no_debug_ospf_default_info_cmd); install_element(ENABLE_NODE, &no_debug_ospf_ldp_sync_cmd); + install_element(ENABLE_NODE, &debug_ospf_gr_cmd); install_element(ENABLE_NODE, &show_debugging_ospf_instance_cmd); install_element(ENABLE_NODE, &debug_ospf_packet_cmd); @@ -1924,6 +1959,7 @@ void ospf_debug_init(void) install_element(CONFIG_NODE, &no_debug_ospf_sr_cmd); install_element(CONFIG_NODE, &no_debug_ospf_default_info_cmd); install_element(CONFIG_NODE, &no_debug_ospf_ldp_sync_cmd); + install_element(CONFIG_NODE, &debug_ospf_gr_cmd); install_element(CONFIG_NODE, &debug_ospf_instance_nsm_cmd); install_element(CONFIG_NODE, &debug_ospf_instance_lsa_cmd);