From: David Ahern <dsa@cumulusnetworks.com>
To: netdev@vger.kernel.org
Cc: David Ahern <dsa@cumulusnetworks.com>
Subject: [PATCH iproute2 3/6] ip neigh: Add support for keyword
Date: Tue, 14 Jun 2016 13:59:29 -0700 [thread overview]
Message-ID: <1465937972-25011-4-git-send-email-dsa@cumulusnetworks.com> (raw)
In-Reply-To: <1465937972-25011-1-git-send-email-dsa@cumulusnetworks.com>
Add vrf keyword to 'ip neigh' commands. Allows listing neighbor
entries for all links associated with a given VRF.
$ ip neigh show vrf NAME
versus current syntax:
$ ip neigh show master DEV
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
---
ip/ipneigh.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/ip/ipneigh.c b/ip/ipneigh.c
index 4ddb747e2086..3e444712645f 100644
--- a/ip/ipneigh.c
+++ b/ip/ipneigh.c
@@ -48,7 +48,8 @@ static void usage(void)
{
fprintf(stderr, "Usage: ip neigh { add | del | change | replace }\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"
" incomplete | delay | probe | failed }\n");
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);
addattr32(&req.n, sizeof(req), NDA_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) {
filter.unused_only = 1;
} else if (strcmp(*argv, "nud") == 0) {
--
2.1.4
next prev parent reply other threads:[~2016-06-14 20:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-14 20:59 [PATCH iproute2 0/6] Add support for vrf keyword David Ahern
2016-06-14 20:59 ` [PATCH iproute2 1/6] ip vrf: Add name_is_vrf David Ahern
2016-06-14 20:59 ` [PATCH iproute2 2/6] ip link/addr: Add support for vrf keyword David Ahern
2016-06-14 20:59 ` David Ahern [this message]
2016-06-14 20:59 ` [PATCH iproute2 4/6] ip route: Change type mask to bitmask David Ahern
2016-06-14 20:59 ` [PATCH iproute2 5/6] ip vrf: Add ipvrf_get_table David Ahern
2016-06-14 20:59 ` [PATCH iproute2 6/6] ip route: Add support for vrf keyword David Ahern
2016-06-24 1:46 ` [PATCH iproute2 0/6] " David Ahern
-- strict thread matches above, loose matches on Subject: below --
2016-06-27 18:50 [PATCH v2 " David Ahern
2016-06-27 18:50 ` [PATCH iproute2 3/6] ip neigh: Add support for keyword David Ahern
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1465937972-25011-4-git-send-email-dsa@cumulusnetworks.com \
--to=dsa@cumulusnetworks.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).