summaryrefslogtreecommitdiffstats
path: root/bfdd
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas.abraitis@gmail.com>2021-11-25 16:51:02 +0100
committerDonatas Abraitis <donatas.abraitis@gmail.com>2021-11-25 16:51:02 +0100
commit4e37fcb61e55ffdbe6b60891684e1a995852bc42 (patch)
tree12c917622560ea416f41ed390a921423a87b1b42 /bfdd
parentldpd: Convert vty_out to vty_json for JSON (diff)
downloadfrr-4e37fcb61e55ffdbe6b60891684e1a995852bc42.tar.xz
frr-4e37fcb61e55ffdbe6b60891684e1a995852bc42.zip
bfdd: Convert vty_out to vty_json for JSON
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Diffstat (limited to 'bfdd')
-rw-r--r--bfdd/bfdd_vty.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/bfdd/bfdd_vty.c b/bfdd/bfdd_vty.c
index 4091ab9ca..fc3a17870 100644
--- a/bfdd/bfdd_vty.c
+++ b/bfdd/bfdd_vty.c
@@ -282,8 +282,7 @@ static void _display_peer_json(struct vty *vty, struct bfd_session *bs)
{
struct json_object *jo = __display_peer_json(bs);
- vty_out(vty, "%s\n", json_object_to_json_string_ext(jo, 0));
- json_object_free(jo);
+ vty_json(vty, jo);
}
struct bfd_vrf_tuple {
@@ -353,8 +352,7 @@ static void _display_all_peers(struct vty *vty, char *vrfname, bool use_json)
bvt.jo = jo;
bfd_id_iterate(_display_peer_json_iter, &bvt);
- vty_out(vty, "%s\n", json_object_to_json_string_ext(jo, 0));
- json_object_free(jo);
+ vty_json(vty, jo);
}
static void _display_peer_counter(struct vty *vty, struct bfd_session *bs)
@@ -407,8 +405,7 @@ static void _display_peer_counters_json(struct vty *vty, struct bfd_session *bs)
{
struct json_object *jo = __display_peer_counters_json(bs);
- vty_out(vty, "%s\n", json_object_to_json_string_ext(jo, 0));
- json_object_free(jo);
+ vty_json(vty, jo);
}
static void _display_peer_counter_iter(struct hash_bucket *hb, void *arg)
@@ -472,8 +469,7 @@ static void _display_peers_counter(struct vty *vty, char *vrfname, bool use_json
bvt.jo = jo;
bfd_id_iterate(_display_peer_counter_json_iter, &bvt);
- vty_out(vty, "%s\n", json_object_to_json_string_ext(jo, 0));
- json_object_free(jo);
+ vty_json(vty, jo);
}
static void _clear_peer_counter(struct bfd_session *bs)
@@ -556,8 +552,7 @@ static void _display_peers_brief(struct vty *vty, const char *vrfname, bool use_
bfd_id_iterate(_display_peer_json_iter, &bvt);
- vty_out(vty, "%s\n", json_object_to_json_string_ext(jo, 0));
- json_object_free(jo);
+ vty_json(vty, jo);
}
static struct bfd_session *