summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-01-02 10:12:05 -0500
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-01-03 11:19:20 -0500
commitd3c7efede79f88c978efadd850034d472e02cfdb (patch)
treed975f73754a239959ce4bbdb25f73c5e410272aa
parente0330274590f87f53838b0a2e62f467dae77d566 (diff)
bgpd: Allow for deprecation of json bgpTimerUp
The bgpTimerUp value was incorrectly named, add a correct name bgpTimerUpMsec and add some code to allow for deprecation. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
-rw-r--r--bgpd/bgp_vty.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 2d37e6bd57..af05a1f3b1 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -8293,8 +8293,24 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, u_char use_json,
uptime -= p->uptime;
epoch_tbuf = time(NULL) - uptime;
+#if CONFDATE > 20200101
+ CPP_NOTICE("bgpTimerUp should be deprecated and can be removed now");
+#endif
+ /*
+ * bgpTimerUp was miliseconds that was accurate
+ * up to 1 day, then the value returned
+ * became garbage. So in order to provide
+ * some level of backwards compatability,
+ * we still provde the data, but now
+ * we are returning the correct value
+ * and also adding a new bgpTimerUpMsec
+ * which will allow us to deprecate
+ * this eventually
+ */
json_object_int_add(json_neigh, "bgpTimerUp",
uptime * 1000);
+ json_object_int_add(json_neigh, "bgpTimerUpMsec",
+ uptime * 1000);
json_object_string_add(json_neigh, "bgpTimerUpString",
peer_uptime(p->uptime, timebuf,
BGP_UPTIME_LEN, 0,