summaryrefslogtreecommitdiff
path: root/bgpd/bgp_labelpool.c
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas.abraitis@gmail.com>2021-11-25 17:51:12 +0200
committerDonatas Abraitis <donatas.abraitis@gmail.com>2021-11-25 17:51:12 +0200
commit75eeda93231620d732be3b1d4e62e74e9ac46e14 (patch)
treeed569233301f880e630f7262bce0f7e07b197296 /bgpd/bgp_labelpool.c
parent4e37fcb61e55ffdbe6b60891684e1a995852bc42 (diff)
bgpd: Convert vty_out to vty_json for JSON
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Diffstat (limited to 'bgpd/bgp_labelpool.c')
-rw-r--r--bgpd/bgp_labelpool.c25
1 files changed, 5 insertions, 20 deletions
diff --git a/bgpd/bgp_labelpool.c b/bgpd/bgp_labelpool.c
index fcb2df9d6f..b4eb5d54ad 100644
--- a/bgpd/bgp_labelpool.c
+++ b/bgpd/bgp_labelpool.c
@@ -638,10 +638,7 @@ DEFUN(show_bgp_labelpool_summary, show_bgp_labelpool_summary_cmd,
json_object_int_add(json, "LabelChunks", listcount(lp->chunks));
json_object_int_add(json, "Pending", lp->pending_count);
json_object_int_add(json, "Reconnects", lp->reconnect_count);
- vty_out(vty, "%s\n",
- json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
+ vty_json(vty, json);
} else {
vty_out(vty, "Labelpool Summary\n");
vty_out(vty, "-----------------\n");
@@ -739,10 +736,7 @@ DEFUN(show_bgp_labelpool_ledger, show_bgp_labelpool_ledger_cmd,
}
}
if (uj) {
- vty_out(vty, "%s\n",
- json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
+ vty_json(vty, json);
}
return CMD_SUCCESS;
}
@@ -834,10 +828,7 @@ DEFUN(show_bgp_labelpool_inuse, show_bgp_labelpool_inuse_cmd,
}
}
if (uj) {
- vty_out(vty, "%s\n",
- json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
+ vty_json(vty, json);
}
return CMD_SUCCESS;
}
@@ -912,10 +903,7 @@ DEFUN(show_bgp_labelpool_requests, show_bgp_labelpool_requests_cmd,
}
}
if (uj) {
- vty_out(vty, "%s\n",
- json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
+ vty_json(vty, json);
}
return CMD_SUCCESS;
}
@@ -963,10 +951,7 @@ DEFUN(show_bgp_labelpool_chunks, show_bgp_labelpool_chunks_cmd,
chunk->last);
}
if (uj) {
- vty_out(vty, "%s\n",
- json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
+ vty_json(vty, json);
}
return CMD_SUCCESS;
}