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, const char *regstr, afi_t afi,
+ 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);
-static int bgp_show_community(struct vty *vty, struct bgp *bgp, int argc,
- struct cmd_token **argv, int exact, afi_t afi,
+static int bgp_show_community(struct vty *vty, struct bgp *bgp,
+ const char *comstr, int exact, afi_t afi,
safi_t safi);
static int bgp_show_table(struct vty *vty, struct bgp *bgp,
DEFUN (show_ip_bgp,
show_ip_bgp_cmd,
"show [ip] bgp [<view|vrf> VIEWVRFNAME] ["BGP_AFI_CMD_STR" ["BGP_SAFI_WITH_LABEL_CMD_STR"]]\
- [<\
- cidr-only\
- |dampening <flap-statistics|dampened-paths|parameters>\
- |route-map WORD\
- |prefix-list WORD\
- |filter-list WORD\
- |statistics\
- |community [<AA:NN|local-AS|no-advertise|no-export|graceful-shutdown> [exact-match]]\
- |community-list <(1-500)|WORD> [exact-match]\
- |A.B.C.D/M longer-prefixes\
- |X:X::X:X/M longer-prefixes>\
- ] [json]",
+ <dampening <parameters>\
+ |route-map WORD\
+ |prefix-list WORD\
+ |filter-list WORD\
+ |statistics\
- |community <AA:NN|local-AS|no-advertise|no-export> [exact-match]\
++ |community <AA:NN|local-AS|no-advertise|no-export|graceful-shutdown> [exact-match]\
+ |community-list <(1-500)|WORD> [exact-match]\
+ |A.B.C.D/M longer-prefixes\
+ |X:X::X:X/M longer-prefixes\
+ >",
SHOW_STR
IP_STR
BGP_STR
afi_t afi = AFI_IP6;
safi_t safi = SAFI_UNICAST;
int exact_match = 0;
- enum bgp_show_type sh_type = bgp_show_type_normal;
struct bgp *bgp = NULL;
int idx = 0;
+ int idx_community_type = 0;
bgp_vty_find_and_parse_afi_safi_bgp(vty, argv, argc, &idx, &afi, &safi,
&bgp);
if (argv_find(argv, argc, "community", &idx)) {
/* show a specific community */
- if (argv_find(argv, argc, "local-AS", &idx)
- || argv_find(argv, argc, "no-advertise", &idx)
- || argv_find(argv, argc, "no-export", &idx)) {
- if (argv_find(argv, argc, "exact_match", &idx))
+ if (argv_find(argv, argc, "local-AS", &idx_community_type)
+ || argv_find(argv, argc, "no-advertise", &idx_community_type)
+ || argv_find(argv, argc, "no-export", &idx_community_type)
+ || argv_find(argv, argc, "graceful-shutdown", &idx_community_type)
+ || argv_find(argv, argc, "AA:NN", &idx_community_type)) {
+
+ if (argv_find(argv, argc, "exact-match", &idx))
exact_match = 1;
- return bgp_show_community(vty, bgp, argc, argv,
+ return bgp_show_community(vty, bgp, argv[idx_community_type]->arg,
exact_match, afi, safi);
}
- /* show all communities */
- else
- return bgp_show(vty, bgp, afi, safi,
- bgp_show_type_community_all, NULL, uj);
}
if (argv_find(argv, argc, "community-list", &idx)) {