From 67799a4893724dd614f6ecb7c1de08fa4bb3e945 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Tue, 20 Dec 2022 11:52:19 +0200 Subject: [PATCH] bgpd: Rename BGP_SHOW_OPT_DETAIL to BGP_SHOW_OPT_JSON_DETAIL This option used only for JSON detailed output. Signed-off-by: Donatas Abraitis --- bgpd/bgp_route.c | 18 +++++++++--------- bgpd/bgp_route.h | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index e300543a37..13290d213d 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -11248,7 +11248,7 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi, bool use_json = CHECK_FLAG(show_flags, BGP_SHOW_OPT_JSON); bool wide = CHECK_FLAG(show_flags, BGP_SHOW_OPT_WIDE); bool all = CHECK_FLAG(show_flags, BGP_SHOW_OPT_AFI_ALL); - bool detail = CHECK_FLAG(show_flags, BGP_SHOW_OPT_DETAIL); + bool detail_json = CHECK_FLAG(show_flags, BGP_SHOW_OPT_JSON_DETAIL); if (output_cum && *output_cum != 0) header = false; @@ -11282,7 +11282,7 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi, } /* Check for 'json detail', where we need header output once per dest */ - if (use_json && detail && type != bgp_show_type_dampend_paths && + if (use_json && detail_json && type != bgp_show_type_dampend_paths && type != bgp_show_type_damp_neighbor && type != bgp_show_type_flap_statistics && type != bgp_show_type_flap_neighbor) @@ -11545,7 +11545,7 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi, vty_out(vty, "Default local pref %u, ", bgp->default_local_pref); vty_out(vty, "local AS %u\n", bgp->as); - if (!detail) { + if (!detail_json) { vty_out(vty, BGP_SHOW_SCODE_HEADER); vty_out(vty, BGP_SHOW_NCODE_HEADER); vty_out(vty, BGP_SHOW_OCODE_HEADER); @@ -11557,7 +11557,7 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi, else if (type == bgp_show_type_flap_statistics || type == bgp_show_type_flap_neighbor) vty_out(vty, BGP_SHOW_FLAP_HEADER); - else if (!detail) + else if (!detail_json) vty_out(vty, (wide ? BGP_SHOW_HEADER_WIDE : BGP_SHOW_HEADER)); header = false; @@ -11600,7 +11600,7 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi, AFI_IP, safi, use_json, json_paths); else { - if (detail) { + if (detail_json) { const struct prefix_rd *prd; prd = bgp_rd_from_dest(dest, safi); @@ -12666,7 +12666,7 @@ DEFPY(show_ip_bgp, show_ip_bgp_cmd, |A.B.C.D/M longer-prefixes\ |X:X::X:X/M longer-prefixes\ |optimal-route-reflection [WORD$orr_group_name]\ - ] [json$uj [detail$detail] | wide$wide]", + ] [json$uj [detail$detail_json] | wide$wide]", SHOW_STR IP_STR BGP_STR BGP_INSTANCE_HELP_STR BGP_AFI_HELP_STR BGP_SAFI_WITH_LABEL_HELP_STR "Display the entries for all address families\n" @@ -12739,8 +12739,8 @@ DEFPY(show_ip_bgp, show_ip_bgp_cmd, SET_FLAG(show_flags, BGP_SHOW_OPT_JSON); } - if (detail) - SET_FLAG(show_flags, BGP_SHOW_OPT_DETAIL); + if (detail_json) + SET_FLAG(show_flags, BGP_SHOW_OPT_JSON_DETAIL); /* [ [all]] */ if (all) { @@ -14717,7 +14717,7 @@ DEFUN (show_ip_bgp_flowspec_routes_detailed, struct bgp *bgp = NULL; int idx = 0; bool uj = use_json(argc, argv); - uint16_t show_flags = BGP_SHOW_OPT_DETAIL; + uint16_t show_flags = BGP_SHOW_OPT_JSON_DETAIL; if (uj) { argc--; diff --git a/bgpd/bgp_route.h b/bgpd/bgp_route.h index 3fa58c0dfb..2b91c048cb 100644 --- a/bgpd/bgp_route.h +++ b/bgpd/bgp_route.h @@ -663,7 +663,7 @@ DECLARE_HOOK(bgp_process, #define BGP_SHOW_OPT_AFI_IP6 (1 << 4) #define BGP_SHOW_OPT_ESTABLISHED (1 << 5) #define BGP_SHOW_OPT_FAILED (1 << 6) -#define BGP_SHOW_OPT_DETAIL (1 << 7) +#define BGP_SHOW_OPT_JSON_DETAIL (1 << 7) #define BGP_SHOW_OPT_TERSE (1 << 8) /* Prototypes. */ -- 2.39.5