ip neigh: Add support for keyword
Add vrf keyword to 'ip neigh' commands. Allows listing neighbor entries for all links associated with a given VRF. Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
This commit is contained in:
parent
104444c201
commit
5db1adae2a
14
ip/ipneigh.c
14
ip/ipneigh.c
|
|
@ -48,7 +48,8 @@ static void usage(void)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Usage: ip neigh { add | del | change | replace }\n"
|
fprintf(stderr, "Usage: ip neigh { add | del | change | replace }\n"
|
||||||
" { ADDR [ lladdr LLADDR ] [ nud STATE ] | proxy ADDR } [ dev DEV ]\n");
|
" { ADDR [ lladdr LLADDR ] [ nud STATE ] | proxy ADDR } [ dev DEV ]\n");
|
||||||
fprintf(stderr, " ip neigh { show | flush } [ proxy ] [ to PREFIX ] [ dev DEV ] [ nud STATE ]\n\n");
|
fprintf(stderr, " ip neigh { show | flush } [ proxy ] [ to PREFIX ] [ dev DEV ] [ nud STATE ]\n");
|
||||||
|
fprintf(stderr, " [ vrf NAME ]\n\n");
|
||||||
fprintf(stderr, "STATE := { permanent | noarp | stale | reachable | none |\n"
|
fprintf(stderr, "STATE := { permanent | noarp | stale | reachable | none |\n"
|
||||||
" incomplete | delay | probe | failed }\n");
|
" incomplete | delay | probe | failed }\n");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
|
|
@ -385,6 +386,17 @@ static int do_show_or_flush(int argc, char **argv, int flush)
|
||||||
invarg("Device does not exist\n", *argv);
|
invarg("Device does not exist\n", *argv);
|
||||||
addattr32(&req.n, sizeof(req), NDA_MASTER, ifindex);
|
addattr32(&req.n, sizeof(req), NDA_MASTER, ifindex);
|
||||||
filter.master = ifindex;
|
filter.master = ifindex;
|
||||||
|
} else if (strcmp(*argv, "vrf") == 0) {
|
||||||
|
int ifindex;
|
||||||
|
|
||||||
|
NEXT_ARG();
|
||||||
|
ifindex = ll_name_to_index(*argv);
|
||||||
|
if (!ifindex)
|
||||||
|
invarg("Not a valid VRF name\n", *argv);
|
||||||
|
if (!name_is_vrf(*argv))
|
||||||
|
invarg("Not a valid VRF name\n", *argv);
|
||||||
|
addattr32(&req.n, sizeof(req), NDA_MASTER, ifindex);
|
||||||
|
filter.master = ifindex;
|
||||||
} else if (strcmp(*argv, "unused") == 0) {
|
} else if (strcmp(*argv, "unused") == 0) {
|
||||||
filter.unused_only = 1;
|
filter.unused_only = 1;
|
||||||
} else if (strcmp(*argv, "nud") == 0) {
|
} else if (strcmp(*argv, "nud") == 0) {
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,9 @@ ip-neighbour \- neighbour/arp tables management.
|
||||||
.B dev
|
.B dev
|
||||||
.IR DEV " ] [ "
|
.IR DEV " ] [ "
|
||||||
.B nud
|
.B nud
|
||||||
.IR STATE " ]"
|
.IR STATE " ] [ "
|
||||||
|
.B vrf
|
||||||
|
.IR NAME " ] "
|
||||||
|
|
||||||
.ti -8
|
.ti -8
|
||||||
.IR STATE " := {"
|
.IR STATE " := {"
|
||||||
|
|
@ -163,6 +165,10 @@ the prefix selecting the neighbours to list.
|
||||||
.BI dev " NAME"
|
.BI dev " NAME"
|
||||||
only list the neighbours attached to this device.
|
only list the neighbours attached to this device.
|
||||||
|
|
||||||
|
.TP
|
||||||
|
.BI vrf " NAME"
|
||||||
|
only list the neighbours for given VRF.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.BI proxy
|
.BI proxy
|
||||||
list neighbour proxies.
|
list neighbour proxies.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue