Skip to content

Commit 5213ed1

Browse files
ton31337cscarpitta
authored andcommitted
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 <[email protected]>
1 parent da3d37f commit 5213ed1

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

bgpd/bgp_route.c

+9-9
Original file line numberDiff line numberDiff line change
@@ -11258,7 +11258,7 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi,
1125811258
bool use_json = CHECK_FLAG(show_flags, BGP_SHOW_OPT_JSON);
1125911259
bool wide = CHECK_FLAG(show_flags, BGP_SHOW_OPT_WIDE);
1126011260
bool all = CHECK_FLAG(show_flags, BGP_SHOW_OPT_AFI_ALL);
11261-
bool detail = CHECK_FLAG(show_flags, BGP_SHOW_OPT_DETAIL);
11261+
bool detail_json = CHECK_FLAG(show_flags, BGP_SHOW_OPT_JSON_DETAIL);
1126211262

1126311263
if (output_cum && *output_cum != 0)
1126411264
header = false;
@@ -11292,7 +11292,7 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi,
1129211292
}
1129311293

1129411294
/* Check for 'json detail', where we need header output once per dest */
11295-
if (use_json && detail && type != bgp_show_type_dampend_paths &&
11295+
if (use_json && detail_json && type != bgp_show_type_dampend_paths &&
1129611296
type != bgp_show_type_damp_neighbor &&
1129711297
type != bgp_show_type_flap_statistics &&
1129811298
type != bgp_show_type_flap_neighbor)
@@ -11555,7 +11555,7 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi,
1155511555
vty_out(vty, "Default local pref %u, ",
1155611556
bgp->default_local_pref);
1155711557
vty_out(vty, "local AS %u\n", bgp->as);
11558-
if (!detail) {
11558+
if (!detail_json) {
1155911559
vty_out(vty, BGP_SHOW_SCODE_HEADER);
1156011560
vty_out(vty, BGP_SHOW_NCODE_HEADER);
1156111561
vty_out(vty, BGP_SHOW_OCODE_HEADER);
@@ -11567,7 +11567,7 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi,
1156711567
else if (type == bgp_show_type_flap_statistics
1156811568
|| type == bgp_show_type_flap_neighbor)
1156911569
vty_out(vty, BGP_SHOW_FLAP_HEADER);
11570-
else if (!detail)
11570+
else if (!detail_json)
1157111571
vty_out(vty, (wide ? BGP_SHOW_HEADER_WIDE
1157211572
: BGP_SHOW_HEADER));
1157311573
header = false;
@@ -11610,7 +11610,7 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi,
1161011610
AFI_IP, safi, use_json,
1161111611
json_paths);
1161211612
else {
11613-
if (detail) {
11613+
if (detail_json) {
1161411614
const struct prefix_rd *prd;
1161511615

1161611616
prd = bgp_rd_from_dest(dest, safi);
@@ -12676,7 +12676,7 @@ DEFPY(show_ip_bgp, show_ip_bgp_cmd,
1267612676
|A.B.C.D/M longer-prefixes\
1267712677
|X:X::X:X/M longer-prefixes\
1267812678
|optimal-route-reflection [WORD$orr_group_name]\
12679-
] [json$uj [detail$detail] | wide$wide]",
12679+
] [json$uj [detail$detail_json] | wide$wide]",
1268012680
SHOW_STR IP_STR BGP_STR BGP_INSTANCE_HELP_STR BGP_AFI_HELP_STR
1268112681
BGP_SAFI_WITH_LABEL_HELP_STR
1268212682
"Display the entries for all address families\n"
@@ -12749,8 +12749,8 @@ DEFPY(show_ip_bgp, show_ip_bgp_cmd,
1274912749
SET_FLAG(show_flags, BGP_SHOW_OPT_JSON);
1275012750
}
1275112751

12752-
if (detail)
12753-
SET_FLAG(show_flags, BGP_SHOW_OPT_DETAIL);
12752+
if (detail_json)
12753+
SET_FLAG(show_flags, BGP_SHOW_OPT_JSON_DETAIL);
1275412754

1275512755
/* [<ipv4|ipv6> [all]] */
1275612756
if (all) {
@@ -14727,7 +14727,7 @@ DEFUN (show_ip_bgp_flowspec_routes_detailed,
1472714727
struct bgp *bgp = NULL;
1472814728
int idx = 0;
1472914729
bool uj = use_json(argc, argv);
14730-
uint16_t show_flags = BGP_SHOW_OPT_DETAIL;
14730+
uint16_t show_flags = BGP_SHOW_OPT_JSON_DETAIL;
1473114731

1473214732
if (uj) {
1473314733
argc--;

bgpd/bgp_route.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ DECLARE_HOOK(bgp_process,
663663
#define BGP_SHOW_OPT_AFI_IP6 (1 << 4)
664664
#define BGP_SHOW_OPT_ESTABLISHED (1 << 5)
665665
#define BGP_SHOW_OPT_FAILED (1 << 6)
666-
#define BGP_SHOW_OPT_DETAIL (1 << 7)
666+
#define BGP_SHOW_OPT_JSON_DETAIL (1 << 7)
667667
#define BGP_SHOW_OPT_TERSE (1 << 8)
668668

669669
/* Prototypes. */

0 commit comments

Comments
 (0)