]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: add total path count for bgp net in json output
authorSoumya Roy <souroy@nvidia.com>
Thu, 1 May 2025 06:12:40 +0000 (06:12 +0000)
committerSoumya Roy <souroy@nvidia.com>
Thu, 1 May 2025 17:31:49 +0000 (17:31 +0000)
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 <souroy@nvidia.com>
bgpd/bgp_route.c

index f250b0338c20fe4c7e13b3d6a6c7ef61647a54e5..f8dc684a1e50d71ff50898878f51b621174bbba1 100644 (file)
@@ -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);
+               }
        }
 }