summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_route.h
diff options
context:
space:
mode:
authorTrey Aspelund <taspelund@nvidia.com>2023-02-10 20:05:27 +0100
committerTrey Aspelund <taspelund@nvidia.com>2023-02-16 17:05:16 +0100
commitf9f2d188e3980d2338747739848001a432ad30b2 (patch)
treeac5e2ee9c082ae1dd5aa445c63d2eea51416dda9 /bgpd/bgp_route.h
parentMerge pull request #12794 from anlancs/fix/doc-pid-path (diff)
downloadfrr-f9f2d188e3980d2338747739848001a432ad30b2.tar.xz
frr-f9f2d188e3980d2338747739848001a432ad30b2.zip
bgpd: fix 'json detail' output structure
"show bgp <afi> <safi> json detail" was incorrectly displaying header information from route_vty_out_detail_header() as an element of the "paths" array. This corrects the behavior for 'json detail' so that a route holds a dictionary with keys for "paths" and header info, which aligns with how we structure the output for a specific prefix, e.g. "show bgp <afi> <safi> <prefix> json". Before: ``` ub20# show ip bgp json detail { "vrfId": 0, "vrfName": "default", "tableVersion": 3, "routerId": "100.64.0.222", "defaultLocPrf": 100, "localAS": 1, "routes": { "2.2.2.2/32": [ { <<<<<<<<< should be outside the array "prefix":"2.2.2.2/32", "version":1, "advertisedTo":{ "192.168.122.12":{ "hostname":"ub20-2" } } }, { "aspath":{ "string":"Local", "segments":[ ], "length":0 }, <snip> ``` After: ``` ub20# show ip bgp json detail { "vrfId": 0, "vrfName": "default", "tableVersion": 3, "routerId": "100.64.0.222", "defaultLocPrf": 100, "localAS": 1, "routes": { "2.2.2.2/32": { "prefix": "2.2.2.2/32", "version": "1", "advertisedTo": { "192.168.122.12":{ "hostname":"ub20-2" } } ,"paths": [ { "aspath":{ "string":"Local", "segments":[ ], "length":0 }, ``` Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
Diffstat (limited to 'bgpd/bgp_route.h')
-rw-r--r--bgpd/bgp_route.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/bgpd/bgp_route.h b/bgpd/bgp_route.h
index 452282926..a288192e5 100644
--- a/bgpd/bgp_route.h
+++ b/bgpd/bgp_route.h
@@ -857,7 +857,8 @@ extern void route_vty_out_detail_header(struct vty *vty, struct bgp *bgp,
struct bgp_dest *dest,
const struct prefix *p,
const struct prefix_rd *prd, afi_t afi,
- safi_t safi, json_object *json);
+ safi_t safi, json_object *json,
+ bool incremental_print);
extern void route_vty_out_detail(struct vty *vty, struct bgp *bgp,
struct bgp_dest *bn, const struct prefix *p,
struct bgp_path_info *path, afi_t afi,