From be3c6d3d3d6220d6ef8600c966f9fca838e10521 Mon Sep 17 00:00:00 2001 From: Soumya Roy Date: Thu, 1 May 2025 06:12:40 +0000 Subject: [PATCH] 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 --- bgpd/bgp_route.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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); + } } } -- 2.39.5