summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2022-04-09 17:52:46 +0300
committerDonatas Abraitis <donatas@opensourcerouting.org>2022-04-09 18:12:36 +0300
commit6e37924b05f3e81d368a4de6b2900c343119c48c (patch)
treedf3dcfd65a1f49c47943b87d5b83c85518ceaac0
parentef362a5156ff5cc358cf2efe0797bf634bb1c5a5 (diff)
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 <donatas@opensourcerouting.org>
-rw-r--r--bgpd/bgp_vty.c22
1 files changed, 22 insertions, 0 deletions
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) &&