diff options
| author | Donatas Abraitis <donatas.abraitis@gmail.com> | 2021-10-08 08:52:37 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-08 08:52:37 +0300 |
| commit | 89748f2704ee69177e5adb5ca08f5c1fd00bb50e (patch) | |
| tree | 1c660f43602b88d22d7bd5fa15fc3b7c3264c21b | |
| parent | b105e0bc2bb1a07d88036110a47df50b9f3ffe4c (diff) | |
| parent | d3120452c480c5ac85a3b626df3f64b21bbca2f0 (diff) | |
Merge pull request #9773 from idryzhov/bgp-show-prefix-filter-vrf
bgpd: add missing vrf/view parameter to one command
| -rw-r--r-- | bgpd/bgp_route.c | 53 | ||||
| -rw-r--r-- | doc/user/bgp.rst | 4 |
2 files changed, 20 insertions, 37 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index fc97178450..1111f867c4 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -13961,10 +13961,11 @@ DEFPY (show_ip_bgp_instance_neighbor_advertised_route, DEFUN (show_ip_bgp_neighbor_received_prefix_filter, show_ip_bgp_neighbor_received_prefix_filter_cmd, - "show [ip] bgp [<ipv4|ipv6> [unicast]] neighbors <A.B.C.D|X:X::X:X|WORD> received prefix-filter [json]", + "show [ip] bgp [<view|vrf> VIEWVRFNAME] [<ipv4|ipv6> [unicast]] neighbors <A.B.C.D|X:X::X:X|WORD> received prefix-filter [json]", SHOW_STR IP_STR BGP_STR + BGP_INSTANCE_HELP_STR "Address Family\n" "Address Family\n" "Address Family modifier\n" @@ -13979,50 +13980,28 @@ DEFUN (show_ip_bgp_neighbor_received_prefix_filter, afi_t afi = AFI_IP6; safi_t safi = SAFI_UNICAST; char *peerstr = NULL; - char name[BUFSIZ]; - union sockunion su; struct peer *peer; - int count, ret; - + int count; int idx = 0; + struct bgp *bgp = NULL; + bool uj = use_json(argc, argv); + + if (uj) + argc--; + + bgp_vty_find_and_parse_afi_safi_bgp(vty, argv, argc, &idx, &afi, &safi, + &bgp, uj); + if (!idx) + return CMD_WARNING; - /* show [ip] bgp */ - if (argv_find(argv, argc, "ip", &idx)) - afi = AFI_IP; - /* [<ipv4|ipv6> [unicast]] */ - if (argv_find(argv, argc, "ipv4", &idx)) - afi = AFI_IP; - if (argv_find(argv, argc, "ipv6", &idx)) - afi = AFI_IP6; /* neighbors <A.B.C.D|X:X::X:X|WORD> */ argv_find(argv, argc, "neighbors", &idx); peerstr = argv[++idx]->arg; - bool uj = use_json(argc, argv); - - ret = str2sockunion(peerstr, &su); - if (ret < 0) { - peer = peer_lookup_by_conf_if(NULL, peerstr); - if (!peer) { - if (uj) - vty_out(vty, "{}\n"); - else - vty_out(vty, - "%% Malformed address or name: %s\n", - peerstr); - return CMD_WARNING; - } - } else { - peer = peer_lookup(NULL, &su); - if (!peer) { - if (uj) - vty_out(vty, "{}\n"); - else - vty_out(vty, "No peer\n"); - return CMD_WARNING; - } - } + peer = peer_lookup_in_view(vty, bgp, peerstr, uj); + if (!peer) + return CMD_WARNING; snprintf(name, sizeof(name), "%s.%d.%d", peer->host, afi, safi); count = prefix_bgp_show_prefix_list(NULL, afi, name, uj); diff --git a/doc/user/bgp.rst b/doc/user/bgp.rst index d37c2b6682..5fcddafaaa 100644 --- a/doc/user/bgp.rst +++ b/doc/user/bgp.rst @@ -3540,6 +3540,10 @@ structure is extended with :clicmd:`show bgp [afi] [safi]`. The ``received-routes`` keyword displays all routes belonging to this address-family (prior to inbound policy) that were received by this peer. +.. clicmd:: show bgp [<view|vrf> VIEWVRFNAME] [afi] [safi] neighbors PEER received prefix-filter [json] + + Display Address Prefix ORFs received from this peer. + .. clicmd:: show bgp [afi] [safi] [all] dampening dampened-paths [wide|json] Display paths suppressed due to dampening of the selected afi and safi |
