summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2021-11-27 08:30:04 -0500
committerGitHub <noreply@github.com>2021-11-27 08:30:04 -0500
commitd41e9fe0cb43003fe0a027fe2357e9ebd0ebbb78 (patch)
tree4c37eb9d7260feca10f30a23e138d4e589fc7751
parent0e57e379255c7cbffeb475dbc3682b7f09ce20d6 (diff)
parentfe0f234d1303d560f1b1bf1c4a039ac0fc0158ea (diff)
Merge pull request #9203 from opensourcerouting/bgpd-show-json
bgpd: add "json" option to a few more show commands
-rw-r--r--bgpd/bgp_damp.c62
-rw-r--r--bgpd/bgp_route.c330
-rw-r--r--doc/user/bgp.rst47
3 files changed, 216 insertions, 223 deletions
diff --git a/bgpd/bgp_damp.c b/bgpd/bgp_damp.c
index 6726dd6160..90b7958c43 100644
--- a/bgpd/bgp_damp.c
+++ b/bgpd/bgp_damp.c
@@ -653,21 +653,42 @@ const char *bgp_damp_reuse_time_vty(struct vty *vty, struct bgp_path_info *path,
}
static int bgp_print_dampening_parameters(struct bgp *bgp, struct vty *vty,
- afi_t afi, safi_t safi)
+ afi_t afi, safi_t safi, bool use_json)
{
if (CHECK_FLAG(bgp->af_flags[afi][safi], BGP_CONFIG_DAMPENING)) {
- vty_out(vty, "Half-life time: %lld min\n",
- (long long)damp[afi][safi].half_life / 60);
- vty_out(vty, "Reuse penalty: %d\n",
- damp[afi][safi].reuse_limit);
- vty_out(vty, "Suppress penalty: %d\n",
- damp[afi][safi].suppress_value);
- vty_out(vty, "Max suppress time: %lld min\n",
- (long long)damp[afi][safi].max_suppress_time / 60);
- vty_out(vty, "Max suppress penalty: %u\n",
- damp[afi][safi].ceiling);
- vty_out(vty, "\n");
- } else
+ struct bgp_damp_config *bdc = &damp[afi][safi];
+
+ if (use_json) {
+ json_object *json = json_object_new_object();
+
+ json_object_int_add(json, "halfLifeSecs",
+ bdc->half_life);
+ json_object_int_add(json, "reusePenalty",
+ bdc->reuse_limit);
+ json_object_int_add(json, "suppressPenalty",
+ bdc->suppress_value);
+ json_object_int_add(json, "maxSuppressTimeSecs",
+ bdc->max_suppress_time);
+ json_object_int_add(json, "maxSuppressPenalty",
+ bdc->ceiling);
+
+ vty_out(vty, "%s\n",
+ json_object_to_json_string_ext(
+ json, JSON_C_TO_STRING_PRETTY));
+ json_object_free(json);
+ } else {
+ vty_out(vty, "Half-life time: %lld min\n",
+ (long long)bdc->half_life / 60);
+ vty_out(vty, "Reuse penalty: %d\n", bdc->reuse_limit);
+ vty_out(vty, "Suppress penalty: %d\n",
+ bdc->suppress_value);
+ vty_out(vty, "Max suppress time: %lld min\n",
+ (long long)bdc->max_suppress_time / 60);
+ vty_out(vty, "Max suppress penalty: %u\n",
+ bdc->ceiling);
+ vty_out(vty, "\n");
+ }
+ } else if (!use_json)
vty_out(vty, "dampening not enabled for %s\n",
get_afi_safi_str(afi, safi, false));
@@ -678,6 +699,8 @@ int bgp_show_dampening_parameters(struct vty *vty, afi_t afi, safi_t safi,
uint16_t show_flags)
{
struct bgp *bgp;
+ bool use_json = CHECK_FLAG(show_flags, BGP_SHOW_OPT_JSON);
+
bgp = bgp_get_default();
if (bgp == NULL) {
@@ -686,7 +709,8 @@ int bgp_show_dampening_parameters(struct vty *vty, afi_t afi, safi_t safi,
}
if (!CHECK_FLAG(show_flags, BGP_SHOW_OPT_AFI_ALL))
- return bgp_print_dampening_parameters(bgp, vty, afi, safi);
+ return bgp_print_dampening_parameters(bgp, vty, afi, safi,
+ use_json);
if (CHECK_FLAG(show_flags, BGP_SHOW_OPT_AFI_IP)
|| CHECK_FLAG(show_flags, BGP_SHOW_OPT_AFI_IP6)) {
@@ -697,11 +721,12 @@ int bgp_show_dampening_parameters(struct vty *vty, afi_t afi, safi_t safi,
"Unknown"))
continue;
- if (!CHECK_FLAG(show_flags, BGP_SHOW_OPT_JSON))
+ if (!use_json)
vty_out(vty, "\nFor address family: %s\n\n",
get_afi_safi_str(afi, safi, false));
- bgp_print_dampening_parameters(bgp, vty, afi, safi);
+ bgp_print_dampening_parameters(bgp, vty, afi, safi,
+ use_json);
}
} else {
FOREACH_AFI_SAFI (afi, safi) {
@@ -709,11 +734,12 @@ int bgp_show_dampening_parameters(struct vty *vty, afi_t afi, safi_t safi,
"Unknown"))
continue;
- if (!CHECK_FLAG(show_flags, BGP_SHOW_OPT_JSON))
+ if (!use_json)
vty_out(vty, "\nFor address family: %s\n",
get_afi_safi_str(afi, safi, false));
- bgp_print_dampening_parameters(bgp, vty, afi, safi);
+ bgp_print_dampening_parameters(bgp, vty, afi, safi,
+ use_json);
}
}
return CMD_SUCCESS;
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index f8b09e56bf..c4079d9724 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -10631,21 +10631,6 @@ void route_vty_out_detail(struct vty *vty, struct bgp *bgp, struct bgp_dest *bn,
#define BGP_SHOW_DAMP_HEADER " Network From Reuse Path\n"
#define BGP_SHOW_FLAP_HEADER " Network From Flaps Duration Reuse Path\n"
-static int bgp_show_prefix_list(struct vty *vty, struct bgp *bgp,
- const char *prefix_list_str, afi_t afi,
- safi_t safi, enum bgp_show_type type);
-static int bgp_show_filter_list(struct vty *vty, struct bgp *bgp,
- const char *filter, afi_t afi, safi_t safi,
- enum bgp_show_type type);
-static int bgp_show_route_map(struct vty *vty, struct bgp *bgp,
- const char *rmap_str, afi_t afi, safi_t safi,
- enum bgp_show_type type);
-static int bgp_show_community_list(struct vty *vty, struct bgp *bgp,
- const char *com, int exact, afi_t afi,
- safi_t safi);
-static int bgp_show_prefix_longer(struct vty *vty, struct bgp *bgp,
- const char *prefix, afi_t afi, safi_t safi,
- enum bgp_show_type type);
static int bgp_show_regexp(struct vty *vty, struct bgp *bgp, const char *regstr,
afi_t afi, safi_t safi, enum bgp_show_type type,
bool use_json);
@@ -12006,45 +11991,28 @@ DEFUN(show_ip_bgp_afi_safi_statistics, show_ip_bgp_afi_safi_statistics_cmd,
return ret;
}
-/* BGP route print out function without JSON */
-DEFPY(show_ip_bgp, show_ip_bgp_cmd,
+DEFPY(show_ip_bgp_dampening_params, show_ip_bgp_dampening_params_cmd,
"show [ip] bgp [<view|vrf> VIEWVRFNAME] [" BGP_AFI_CMD_STR
" [" BGP_SAFI_WITH_LABEL_CMD_STR
- "]]\
- <[all$all] dampening <parameters>\
- |route-map WORD\
- |prefix-list WORD\
- |filter-list AS_PATH_FILTER_NAME\
- |community-list <(1-500)|COMMUNITY_LIST_NAME> [exact-match]\
- |A.B.C.D/M longer-prefixes\
- |X:X::X:X/M longer-prefixes\
- >",
+ "]] [all$all] dampening parameters [json]",
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"
"Display detailed information about dampening\n"
"Display detail of configured dampening parameters\n"
- "Display routes matching the route-map\n"
- "A route-map to match on\n"
- "Display routes conforming to the prefix-list\n"
- "Prefix-list name\n"
- "Display routes conforming to the filter-list\n"
- "Regular expression access list name\n"
- "Display routes matching the community-list\n"
- "community-list number\n"
- "community-list name\n"
- "Exact match of the communities\n"
- "IPv4 prefix\n"
- "Display route and more specific routes\n"
- "IPv6 prefix\n"
- "Display route and more specific routes\n")
+ JSON_STR)
{
afi_t afi = AFI_IP6;
safi_t safi = SAFI_UNICAST;
- int exact_match = 0;
struct bgp *bgp = NULL;
int idx = 0;
uint16_t show_flags = 0;
+ bool uj = use_json(argc, argv);
+
+ if (uj) {
+ argc--;
+ SET_FLAG(show_flags, BGP_SHOW_OPT_JSON);
+ }
/* [<ipv4|ipv6> [all]] */
if (all) {
@@ -12061,43 +12029,11 @@ DEFPY(show_ip_bgp, show_ip_bgp_cmd,
if (!idx)
return CMD_WARNING;
- if (argv_find(argv, argc, "dampening", &idx)) {
- if (argv_find(argv, argc, "parameters", &idx))
- return bgp_show_dampening_parameters(vty, afi, safi,
- show_flags);
- }
-
- if (argv_find(argv, argc, "prefix-list", &idx))
- return bgp_show_prefix_list(vty, bgp, argv[idx + 1]->arg, afi,
- safi, bgp_show_type_prefix_list);
-
- if (argv_find(argv, argc, "filter-list", &idx))
- return bgp_show_filter_list(vty, bgp, argv[idx + 1]->arg, afi,
- safi, bgp_show_type_filter_list);
-
- if (argv_find(argv, argc, "route-map", &idx))
- return bgp_show_route_map(vty, bgp, argv[idx + 1]->arg, afi,
- safi, bgp_show_type_route_map);
-
- if (argv_find(argv, argc, "community-list", &idx)) {
- const char *clist_number_or_name = argv[++idx]->arg;
- if (++idx < argc && strmatch(argv[idx]->text, "exact-match"))
- exact_match = 1;
- return bgp_show_community_list(vty, bgp, clist_number_or_name,
- exact_match, afi, safi);
- }
- /* prefix-longer */
- if (argv_find(argv, argc, "A.B.C.D/M", &idx)
- || argv_find(argv, argc, "X:X::X:X/M", &idx))
- return bgp_show_prefix_longer(vty, bgp, argv[idx]->arg, afi,
- safi,
- bgp_show_type_prefix_longer);
-
- return CMD_WARNING;
+ return bgp_show_dampening_parameters(vty, afi, safi, show_flags);
}
-/* BGP route print out function with JSON */
-DEFPY(show_ip_bgp_json, show_ip_bgp_json_cmd,
+/* BGP route print out function */
+DEFPY(show_ip_bgp, show_ip_bgp_cmd,
"show [ip] bgp [<view|vrf> VIEWVRFNAME] [" BGP_AFI_CMD_STR
" [" BGP_SAFI_WITH_LABEL_CMD_STR
"]]\
@@ -12109,9 +12045,15 @@ DEFPY(show_ip_bgp_json, show_ip_bgp_json_cmd,
|accept-own|accept-own-nexthop|route-filter-v6\
|route-filter-v4|route-filter-translated-v6\
|route-filter-translated-v4] [exact-match]\
+ |community-list <(1-500)|COMMUNITY_LIST_NAME> [exact-match]\
+ |filter-list AS_PATH_FILTER_NAME\
+ |prefix-list WORD\
+ |route-map WORD\
|rpki <invalid|valid|notfound>\
|version (1-4294967295)\
|alias ALIAS_NAME\
+ |A.B.C.D/M longer-prefixes\
+ |X:X::X:X/M longer-prefixes\
] [json$uj [detail$detail] | wide$wide]",
SHOW_STR IP_STR BGP_STR BGP_INSTANCE_HELP_STR BGP_AFI_HELP_STR
BGP_SAFI_WITH_LABEL_HELP_STR
@@ -12136,6 +12078,16 @@ DEFPY(show_ip_bgp_json, show_ip_bgp_json_cmd,
"RT translated VPNv6 route filtering (well-known community)\n"
"RT translated VPNv4 route filtering (well-known community)\n"
"Exact match of the communities\n"
+ "Community-list number\n"
+ "Community-list name\n"
+ "Display routes matching the community-list\n"
+ "Exact match of the communities\n"
+ "Display routes conforming to the filter-list\n"
+ "Regular expression access list name\n"
+ "Display routes conforming to the prefix-list\n"
+ "Prefix-list name\n"
+ "Display routes matching the route-map\n"
+ "A route-map to match on\n"
"RPKI route types\n"
"A valid path as determined by rpki\n"
"A invalid path as determined by rpki\n"
@@ -12143,19 +12095,23 @@ DEFPY(show_ip_bgp_json, show_ip_bgp_json_cmd,
"Display prefixes with matching version numbers\n"
"Version number and above\n"
"Display prefixes with matching BGP community alias\n"
- "BGP community alias\n" JSON_STR
+ "BGP community alias\n"
+ "IPv4 prefix\n"
+ "Display route and more specific routes\n"
+ "IPv6 prefix\n"
+ "Display route and more specific routes\n"
+ JSON_STR
"Display detailed version of JSON output\n"
"Increase table width for longer prefixes\n")
{
afi_t afi = AFI_IP6;
safi_t safi = SAFI_UNICAST;
enum bgp_show_type sh_type = bgp_show_type_normal;
+ void *output_arg = NULL;
struct bgp *bgp = NULL;
int idx = 0;
int exact_match = 0;
char *community = NULL;
- char *prefix_version = NULL;
- char *bgp_community_alias = NULL;
bool first = true;
uint16_t show_flags = 0;
enum rpki_states rpki_target_state = RPKI_NOT_BEING_USED;
@@ -12218,6 +12174,75 @@ DEFPY(show_ip_bgp_json, show_ip_bgp_json_cmd,
sh_type = bgp_show_type_community_all;
}
+ if (argv_find(argv, argc, "community-list", &idx)) {
+ const char *clist_number_or_name = argv[++idx]->arg;
+ struct community_list *list;
+
+ if (argv_find(argv, argc, "exact-match", &idx))
+ exact_match = 1;
+
+ list = community_list_lookup(bgp_clist, clist_number_or_name, 0,
+ COMMUNITY_LIST_MASTER);
+ if (list == NULL) {
+ vty_out(vty,
+ "%% %s is not a valid community-list name\n",
+ clist_number_or_name);
+ return CMD_WARNING;
+ }
+
+ if (exact_match)
+ sh_type = bgp_show_type_community_list_exact;
+ else
+ sh_type = bgp_show_type_community_list;
+ output_arg = list;
+ }
+
+ if (argv_find(argv, argc, "filter-list", &idx)) {
+ const char *filter = argv[++idx]->arg;
+ struct as_list *as_list;
+
+ as_list = as_list_lookup(filter);
+ if (as_list == NULL) {
+ vty_out(vty,
+ "%% %s is not a valid AS-path access-list name\n",
+ filter);
+ return CMD_WARNING;
+ }
+
+ sh_type = bgp_show_type_filter_list;
+ output_arg = as_list;
+ }
+
+ if (argv_find(argv, argc, "prefix-list", &idx)) {
+ const char *prefix_list_str = argv[++idx]->arg;
+ struct prefix_list *plist;
+
+ plist = prefix_list_lookup(afi, prefix_list_str);
+ if (plist == NULL) {
+ vty_out(vty, "%% %s is not a valid prefix-list name\n",
+ prefix_list_str);
+ return CMD_WARNING;
+ }
+
+ sh_type = bgp_show_type_prefix_list;
+ output_arg = plist;
+ }
+
+ if (argv_find(argv, argc, "route-map", &idx)) {
+ const char *rmap_str = argv[++idx]->arg;
+ struct route_map *rmap;
+
+ rmap = route_map_lookup_by_name(rmap_str);
+ if (!rmap) {
+ vty_out(vty, "%% %s is not a valid route-map name\n",
+ rmap_str);
+ return CMD_WARNING;
+ }
+
+ sh_type = bgp_show_type_route_map;
+ output_arg = rmap;
+ }
+
if (argv_find(argv, argc, "rpki", &idx)) {
sh_type = bgp_show_type_rpki;
if (argv_find(argv, argc, "valid", &idx))
@@ -12229,13 +12254,28 @@ DEFPY(show_ip_bgp_json, show_ip_bgp_json_cmd,
/* Display prefixes with matching version numbers */
if (argv_find(argv, argc, "version", &idx)) {
sh_type = bgp_show_type_prefix_version;
- prefix_version = argv[idx + 1]->arg;
+ output_arg = argv[idx + 1]->arg;
}
/* Display prefixes with matching BGP community alias */
if (argv_find(argv, argc, "alias", &idx)) {
sh_type = bgp_show_type_community_alias;
- bgp_community_alias = argv[idx + 1]->arg;
+ output_arg = argv[idx + 1]->arg;
+ }
+
+ /* prefix-longer */
+ if (argv_find(argv, argc, "A.B.C.D/M", &idx)
+ || argv_find(argv, argc, "X:X::X:X/M", &idx)) {
+ const char *prefix_str = argv[idx]->arg;
+ struct prefix p;
+
+ if (!str2prefix(prefix_str, &p)) {
+ vty_out(vty, "%% Malformed Prefix\n");
+ return CMD_WARNING;
+ }
+
+ sh_type = bgp_show_type_prefix_longer;
+ output_arg = &p;
}
if (!all) {
@@ -12244,17 +12284,10 @@ DEFPY(show_ip_bgp_json, show_ip_bgp_json_cmd,
return bgp_show_community(vty, bgp, community,
exact_match, afi, safi,
show_flags);
- else if (prefix_version)
- return bgp_show(vty, bgp, afi, safi, sh_type,
- prefix_version, show_flags,
- rpki_target_state);
- else if (bgp_community_alias)
+ else
return bgp_show(vty, bgp, afi, safi, sh_type,
- bgp_community_alias, show_flags,
+ output_arg, show_flags,
rpki_target_state);
- else
- return bgp_show(vty, bgp, afi, safi, sh_type, NULL,
- show_flags, rpki_target_state);
} else {
/* show <ip> bgp ipv4 all: AFI_IP, show <ip> bgp ipv6 all:
* AFI_IP6 */
@@ -12289,19 +12322,9 @@ DEFPY(show_ip_bgp_json, show_ip_bgp_json_cmd,
bgp_show_community(vty, bgp, community,
exact_match, afi,
safi, show_flags);
- else if (prefix_version)
- return bgp_show(vty, bgp, afi, safi,
- sh_type, prefix_version,
- show_flags,
- rpki_target_state);
- else if (bgp_community_alias)
- return bgp_show(
- vty, bgp, afi, safi, sh_type,
- bgp_community_alias, show_flags,
- rpki_target_state);
else
bgp_show(vty, bgp, afi, safi, sh_type,
- NULL, show_flags,
+ output_arg, show_flags,
rpki_target_state);
if (uj)
vty_out(vty, "}\n");
@@ -12331,14 +12354,9 @@ DEFPY(show_ip_bgp_json, show_ip_bgp_json_cmd,
bgp_show_community(vty, bgp, community,
exact_match, afi,
safi, show_flags);
- else if (prefix_version)
- return bgp_show(vty, bgp, afi, safi,
- sh_type, prefix_version,
- show_flags,
- rpki_target_state);
else
bgp_show(vty, bgp, afi, safi, sh_type,
- NULL, show_flags,
+ output_arg, show_flags,
rpki_target_state);
if (uj)
vty_out(vty, "}\n");
@@ -12526,59 +12544,6 @@ static int bgp_show_regexp(struct vty *vty, struct bgp *bgp, const char *regstr,
return rc;
}
-static int bgp_show_prefix_list(struct vty *vty, struct bgp *bgp,
- const char *prefix_list_str, afi_t afi,
- safi_t safi, enum bgp_show_type type)
-{
- struct prefix_list *plist;
- uint16_t show_flags = 0;
-
- plist = prefix_list_lookup(afi, prefix_list_str);
- if (plist == NULL) {
- vty_out(vty, "%% %s is not a valid prefix-list name\n",
- prefix_list_str);
- return CMD_WARNING;
- }
-
- return bgp_show(vty, bgp, afi, safi, type, plist, show_flags,
- RPKI_NOT_BEING_USED);
-}
-
-static int bgp_show_filter_list(struct vty *vty, struct bgp *bgp,
- const char *filter, afi_t afi, safi_t safi,
- enum bgp_show_type type)
-{
- struct as_list *as_list;
- uint16_t show_flags = 0;
-
- as_list = as_list_lookup(filter);
- if (as_list == NULL) {
- vty_out(vty, "%% %s is not a valid AS-path access-list name\n",
- filter);
- return CMD_WARNING;
- }
-
- return bgp_show(vty, bgp, afi, safi, type, as_list, show_flags,
- RPKI_NOT_BEING_USED);
-}
-
-static int bgp_show_route_map(struct vty *vty, struct bgp *bgp,
- const char *rmap_str, afi_t afi, safi_t safi,
- enum bgp_show_type type)
-{
- struct route_map *rmap;
- uint16_t show_flags = 0;
-
- rmap = route_map_lookup_by_name(rmap_str);
- if (!rmap) {
- vty_out(vty, "%% %s is not a valid route-map name\n", rmap_str);
- return CMD_WARNING;
- }
-
- return bgp_show(vty, bgp, afi, safi, type, rmap, show_flags,
- RPKI_NOT_BEING_USED);
-}
-
static int bgp_show_community(struct vty *vty, struct bgp *bgp,
const char *comstr, int exact, afi_t afi,
safi_t safi, uint16_t show_flags)
@@ -12601,47 +12566,6 @@ static int bgp_show_community(struct vty *vty, struct bgp *bgp,
return ret;
}
-static int bgp_show_community_list(struct vty *vty, struct bgp *bgp,
- const char *com, int exact, afi_t afi,
- safi_t safi)
-{
- struct community_list *list;
- uint16_t show_flags = 0;
-
- list = community_list_lookup(bgp_clist, com, 0, COMMUNITY_LIST_MASTER);
- if (list == NULL) {
- vty_out(vty, "%% %s is not a valid community-list name\n", com);
- return CMD_WARNING;
- }
-
- return bgp_show(vty, bgp, afi, safi,
- (exact ? bgp_show_type_community_list_exact
- : bgp_show_type_community_list),
- list, show_flags, RPKI_NOT_BEING_USED);
-}
-
-static int bgp_show_prefix_longer(struct vty *vty, struct bgp *bgp,
- const char *prefix, afi_t afi, safi_t safi,
- enum bgp_show_type type)
-{
- int ret;
- struct prefix *p;
- uint16_t show_flags = 0;
-
- p = prefix_new();
-
- ret = str2prefix(prefix, p);
- if (!ret) {
- vty_out(vty, "%% Malformed Prefix\n");
- return CMD_WARNING;
- }
-
- ret = bgp_show(vty, bgp, afi, safi, type, p, show_flags,
- RPKI_NOT_BEING_USED);
- prefix_free(&p);
- return ret;
-}
-
enum bgp_stats {
BGP_STATS_MAXBITLEN = 0,
BGP_STATS_RIB,
@@ -15096,10 +15020,10 @@ void bgp_route_init(void)
install_element(BGP_IPV4L_NODE, &aggregate_addressv4_cmd);
install_element(VIEW_NODE, &show_ip_bgp_instance_all_cmd);
- install_element(VIEW_NODE, &show_ip_bgp_cmd);
install_element(VIEW_NODE, &show_ip_bgp_afi_safi_statistics_cmd);
install_element(VIEW_NODE, &show_ip_bgp_l2vpn_evpn_statistics_cmd);
- install_element(VIEW_NODE, &show_ip_bgp_json_cmd);
+ install_element(VIEW_NODE, &show_ip_bgp_dampening_params_cmd);
+ install_element(VIEW_NODE, &show_ip_bgp_cmd);
install_element(VIEW_NODE, &show_ip_bgp_route_cmd);
install_element(VIEW_NODE, &show_ip_bgp_regexp_cmd);
install_element(VIEW_NODE, &show_ip_bgp_statistics_all_cmd);
diff --git a/doc/user/bgp.rst b/doc/user/bgp.rst
index db59c42773..4e996aa69c 100644
--- a/doc/user/bgp.rst
+++ b/doc/user/bgp.rst
@@ -3553,6 +3553,13 @@ structure is extended with :clicmd:`show bgp [afi] [safi]`.
Display flap statistics of routes of the selected afi and safi selected.
+.. clicmd:: show bgp [afi] [safi] [all] dampening parameters [json]
+
+ Display details of configured dampening parameters of the selected afi and
+ safi.
+
+ If the ``json`` option is specified, output is displayed in JSON format.
+
.. clicmd:: show bgp [afi] [safi] [all] version (1-4294967295) [wide|json]
Display prefixes with matching version numbers. The version number and
@@ -3585,6 +3592,42 @@ structure is extended with :clicmd:`show bgp [afi] [safi]`.
Display routes with non-natural netmasks.
+.. clicmd:: show [ip] bgp [afi] [safi] [all] prefix-list WORD [wide|json]
+
+ Display routes that match the specified prefix-list.
+
+ If ``wide`` option is specified, then the prefix table's width is increased
+ to fully display the prefix and the nexthop.
+
+ If the ``json`` option is specified, output is displayed in JSON format.
+
+.. clicmd:: show [ip] bgp [afi] [safi] [all] filter-list WORD [wide|json]
+
+ Display routes that match the specified AS-Path filter-list.
+
+ If ``wide`` option is specified, then the prefix table's width is increased
+ to fully display the prefix and the nexthop.
+
+ If the ``json`` option is specified, output is displayed in JSON format.
+
+.. clicmd:: show [ip] bgp [afi] [safi] [all] route-map WORD [wide|json]
+
+ Display routes that match the specified route-map.
+
+ If ``wide`` option is specified, then the prefix table's width is increased
+ to fully display the prefix and the nexthop.
+
+ If the ``json`` option is specified, output is displayed in JSON format.
+
+.. clicmd:: show [ip] bgp [afi] [safi] [all] <A.B.C.D/M|X:X::X:X/M> longer-prefixes [wide|json]
+
+ Displays the specified route and all more specific routes.
+
+ If ``wide`` option is specified, then the prefix table's width is increased
+ to fully display the prefix and the nexthop.
+
+ If the ``json`` option is specified, output is displayed in JSON format.
+
.. clicmd:: show [ip] bgp [afi] [safi] [all] neighbors A.B.C.D [advertised-routes|received-routes|filtered-routes] [json|wide]
Display the routes advertised to a BGP neighbor or received routes
@@ -3623,9 +3666,9 @@ attribute.
community are displayed. When `exact-match` is specified, it display only
routes that have an exact match.
-.. clicmd:: show [ip] bgp <ipv4|ipv6> community-list WORD
+.. clicmd:: show [ip] bgp <ipv4|ipv6> community-list WORD [json]
-.. clicmd:: show [ip] bgp <ipv4|ipv6> community-list WORD exact-match
+.. clicmd:: show [ip] bgp <ipv4|ipv6> community-list WORD exact-match [json]
These commands display BGP routes for the address family specified that
match the specified community list. When `exact-match` is specified, it