From: Donatas Abraitis Date: Sat, 9 Apr 2022 14:52:46 +0000 (+0300) Subject: bgpd: Show conditional advertisement timers in neighbor CLI output X-Git-Tag: pim6-testing-20220430~81^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=refs%2Fpull%2F11000%2Fhead;p=mirror%2Ffrr.git bgpd: Show conditional advertisement timers in neighbor CLI output ``` spine1-debian-11# sh ip bgp neighbors 192.168.0.1 BGP neighbor is 192.168.0.1, remote AS 65001, local AS 65000, external link Hostname: exit1-debian-11 BGP version 4, remote router ID 192.168.10.123, local router ID 192.168.100.1 BGP state = Established, up for 00:00:32 Last read 00:00:30, Last write 00:00:30 Hold time is 180, keepalive interval is 60 seconds Configured conditional advertisements interval is 5 seconds Time until conditional advertisements begin is 4 seconds ``` ``` "bgpTimerConfiguredConditionalAdvertisementsSec":5, "bgpTimerUntilConditionalAdvertisementsSec":1, ``` Signed-off-by: Donatas Abraitis --- diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 941696ab74..7c1c062d5e 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -12559,6 +12559,18 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, bool use_json, else json_object_boolean_false_add( json_neigh, "extendedOptionalParametersLength"); + + /* Conditional advertisements */ + json_object_int_add( + json_neigh, + "bgpTimerConfiguredConditionalAdvertisementsSec", + bgp->condition_check_period); + if (thread_is_scheduled(bgp->t_condition_check)) + json_object_int_add( + json_neigh, + "bgpTimerUntilConditionalAdvertisementsSec", + thread_timer_remain_second( + bgp->t_condition_check)); } else { /* Administrative shutdown. */ if (CHECK_FLAG(p->flags, PEER_FLAG_SHUTDOWN) @@ -12636,6 +12648,16 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, bool use_json, if (BGP_OPEN_EXT_OPT_PARAMS_CAPABLE(p)) vty_out(vty, " Extended Optional Parameters Length is enabled\n"); + + /* Conditional advertisements */ + vty_out(vty, + " Configured conditional advertisements interval is %d seconds\n", + bgp->condition_check_period); + if (thread_is_scheduled(bgp->t_condition_check)) + vty_out(vty, + " Time until conditional advertisements begin is %lu seconds\n", + thread_timer_remain_second( + bgp->t_condition_check)); } /* Capability. */ if (peer_established(p) &&