summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Walton <dwalton@cumulusnetworks.com>2016-10-20 17:21:34 +0000
committerDaniel Walton <dwalton@cumulusnetworks.com>2016-10-20 17:21:34 +0000
commitc6a7d59c20f238aab096f918acf84ca30265ed07 (patch)
tree511b7a16c2ba5f44c73bec40fd8994a458edd341 /lib
parent7b8def580a061c7e454db83b85e8453d13d65c78 (diff)
bgpd: 'show ip bgp summary json' shows large negative value for "peerUptimeMsec"
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Don Slice <dslice@cumulusnetworks.com> Ticket: CM-13239
Diffstat (limited to 'lib')
-rw-r--r--lib/json.c6
-rw-r--r--lib/json.h2
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/json.c b/lib/json.c
index 58f0e995f2..ca30c60984 100644
--- a/lib/json.c
+++ b/lib/json.c
@@ -54,6 +54,12 @@ json_object_int_add(struct json_object* obj, const char *key, int32_t i)
}
void
+json_object_long_add(struct json_object* obj, const char *key, int64_t i)
+{
+ json_object_object_add(obj, key, json_object_new_int64(i));
+}
+
+void
json_object_boolean_false_add(struct json_object* obj, const char *key)
{
json_object_object_add(obj, key, json_object_new_boolean(0));
diff --git a/lib/json.h b/lib/json.h
index c8d7fae1cd..b217df0a7b 100644
--- a/lib/json.h
+++ b/lib/json.h
@@ -39,6 +39,8 @@ extern void json_object_string_add(struct json_object* obj, const char *key,
const char *s);
extern void json_object_int_add(struct json_object* obj, const char *key,
int32_t i);
+extern void json_object_long_add(struct json_object* obj, const char *key,
+ int64_t i);
extern void json_object_boolean_false_add(struct json_object* obj,
const char *key);
extern void json_object_boolean_true_add(struct json_object* obj,