From: Soumya Roy Date: Thu, 1 May 2025 06:12:40 +0000 (+0000) Subject: bgpd: add total path count for bgp net in json output X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=be3c6d3d3d6220d6ef8600c966f9fca838e10521;p=mirror%2Ffrr.git bgpd: add total path count for bgp net in json output Currently only vty output shows total path count for a BGP net. This fix add that information in josn output too. Signed-off-by: Soumya Roy --- diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index f250b0338c..f8dc684a1e 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -13219,6 +13219,14 @@ void route_vty_out_detail_header(struct vty *vty, struct bgp *bgp, } vty_out(vty, "\n"); } + + if (json) { + if (incremental_print) { + vty_out(vty, "\"pathCount\": %d", count); + vty_out(vty, ","); + } else + json_object_int_add(json, "pathCount", count); + } } }