Skip to content

Commit be3c6d3

Browse files
committed
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 <souroy@nvidia.com>
1 parent 3dd4d41 commit be3c6d3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

bgpd/bgp_route.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13219,6 +13219,14 @@ void route_vty_out_detail_header(struct vty *vty, struct bgp *bgp,
1321913219
}
1322013220
vty_out(vty, "\n");
1322113221
}
13222+
13223+
if (json) {
13224+
if (incremental_print) {
13225+
vty_out(vty, "\"pathCount\": %d", count);
13226+
vty_out(vty, ",");
13227+
} else
13228+
json_object_int_add(json, "pathCount", count);
13229+
}
1322213230
}
1322313231
}
1322413232

0 commit comments

Comments
 (0)