diff options
author | Madhuri Kuruganti <maduri111@gmail.com> | 2022-09-21 09:03:52 +0200 |
---|---|---|
committer | Madhuri Kuruganti <maduri111@gmail.com> | 2022-10-06 08:47:27 +0200 |
commit | 8093d7999ca7ba3b8c60217544ae977698128b01 (patch) | |
tree | fb9208bf8fd15f5fdd6c97952f102edae204afef /bgpd/bgp_debug.c | |
parent | Merge pull request #12060 from donaldsharp/tunnel_shenanigans (diff) | |
download | frr-8093d7999ca7ba3b8c60217544ae977698128b01.tar.xz frr-8093d7999ca7ba3b8c60217544ae977698128b01.zip |
bgpd: adding debug command for conditional advertisement
Signed-off-by: Madhuri Kuruganti <maduri111@gmail.com>
Diffstat (limited to 'bgpd/bgp_debug.c')
-rw-r--r-- | bgpd/bgp_debug.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/bgpd/bgp_debug.c b/bgpd/bgp_debug.c index 864cdb51a..df7262be6 100644 --- a/bgpd/bgp_debug.c +++ b/bgpd/bgp_debug.c @@ -70,6 +70,7 @@ 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 conf_bgp_debug_cond_adv; unsigned long term_bgp_debug_as4; unsigned long term_bgp_debug_neighbor_events; @@ -90,6 +91,7 @@ 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; +unsigned long term_bgp_debug_cond_adv; struct list *bgp_debug_neighbor_events_peers = NULL; struct list *bgp_debug_keepalive_peers = NULL; @@ -2108,6 +2110,33 @@ DEFPY(debug_bgp_bfd, debug_bgp_bfd_cmd, return CMD_SUCCESS; } +DEFPY (debug_bgp_cond_adv, + debug_bgp_cond_adv_cmd, + "[no$no] debug bgp conditional-advertisement", + NO_STR + DEBUG_STR + BGP_STR + "BGP conditional advertisement\n") +{ + if (vty->node == CONFIG_NODE) { + if (no) + DEBUG_OFF(cond_adv, COND_ADV); + else + DEBUG_ON(cond_adv, COND_ADV); + } else { + if (no) { + TERM_DEBUG_OFF(cond_adv, COND_ADV); + vty_out(vty, + "BGP conditional advertisement debugging is off\n"); + } else { + TERM_DEBUG_ON(cond_adv, COND_ADV); + vty_out(vty, + "BGP conditional advertisement debugging is on\n"); + } + } + return CMD_SUCCESS; +} + DEFUN (no_debug_bgp, no_debug_bgp_cmd, "no debug bgp", @@ -2152,6 +2181,7 @@ DEFUN (no_debug_bgp, TERM_DEBUG_OFF(evpn_mh, EVPN_MH_ES); TERM_DEBUG_OFF(evpn_mh, EVPN_MH_RT); TERM_DEBUG_OFF(bfd, BFD_LIB); + TERM_DEBUG_OFF(cond_adv, COND_ADV); vty_out(vty, "All possible debugging has been turned off\n"); @@ -2244,6 +2274,10 @@ DEFUN_NOSH (show_debugging_bgp, if (BGP_DEBUG(bfd, BFD_LIB)) vty_out(vty, " BGP BFD library debugging is on\n"); + if (BGP_DEBUG(cond_adv, COND_ADV)) + vty_out(vty, + " BGP conditional advertisement debugging is on\n"); + return CMD_SUCCESS; } @@ -2373,6 +2407,11 @@ static int bgp_config_write_debug(struct vty *vty) write++; } + if (CONF_BGP_DEBUG(cond_adv, COND_ADV)) { + vty_out(vty, "debug bgp conditional-advertisement\n"); + write++; + } + return write; } @@ -2501,6 +2540,10 @@ void bgp_debug_init(void) /* debug bgp bfd */ install_element(ENABLE_NODE, &debug_bgp_bfd_cmd); install_element(CONFIG_NODE, &debug_bgp_bfd_cmd); + + /* debug bgp conditional advertisement */ + install_element(ENABLE_NODE, &debug_bgp_cond_adv_cmd); + install_element(CONFIG_NODE, &debug_bgp_cond_adv_cmd); } /* Return true if this prefix is on the per_prefix_list of prefixes to debug |