From: Serhey Popovych <serhe.popovych@gmail.com>
To: netdev@vger.kernel.org
Subject: [PATCH iproute2 9/9] vti6/tunnel: Unify and simplify link type help functions
Date: Fri, 12 Jan 2018 19:39:34 +0200 [thread overview]
Message-ID: <1515778774-24173-10-git-send-email-serhe.popovych@gmail.com> (raw)
In-Reply-To: <1515778774-24173-1-git-send-email-serhe.popovych@gmail.com>
Both of these two changes are missing for link_vti6.c:
o commit 8b47135474cd (ip: link: Unify link type help functions a bit)
o commit 561e650eff67 (ip link: Shortify printing the usage of link type)
Replay them on link_vti6.c to bring link type help functions
inline with other tunneling code.
Signed-off-by: Serhey Popovych <serhe.popovych@gmail.com>
---
ip/link_vti6.c | 32 ++++++++++++++++++++++----------
1 file changed, 22 insertions(+), 10 deletions(-)
diff --git a/ip/link_vti6.c b/ip/link_vti6.c
index a4ad650..b9fe83a 100644
--- a/ip/link_vti6.c
+++ b/ip/link_vti6.c
@@ -24,20 +24,25 @@
#include "ip_common.h"
#include "tunnel.h"
+static void print_usage(FILE *f)
+{
+ fprintf(f,
+ "Usage: ... vti6 [ remote ADDR ]\n"
+ " [ local ADDR ]\n"
+ " [ [i|o]key KEY ]\n"
+ " [ dev PHYS_DEV ]\n"
+ " [ fwmark MARK ]\n"
+ "\n"
+ "Where: ADDR := { IPV6_ADDRESS }\n"
+ " KEY := { DOTTED_QUAD | NUMBER }\n"
+ " MARK := { 0x0..0xffffffff }\n"
+ );
+}
static void usage(void) __attribute__((noreturn));
static void usage(void)
{
- fprintf(stderr, "Usage: ip link { add | set | change | replace | del } NAME\n");
- fprintf(stderr, " type { vti6 } [ remote ADDR ] [ local ADDR ]\n");
- fprintf(stderr, " [ [i|o]key KEY ]\n");
- fprintf(stderr, " [ dev PHYS_DEV ]\n");
- fprintf(stderr, " [ fwmark MARK ]\n");
- fprintf(stderr, "\n");
- fprintf(stderr, "Where: NAME := STRING\n");
- fprintf(stderr, " ADDR := { IPV6_ADDRESS }\n");
- fprintf(stderr, " KEY := { DOTTED_QUAD | NUMBER }\n");
- fprintf(stderr, " MARK := { 0x0..0xffffffff }\n");
+ print_usage(stderr);
exit(-1);
}
@@ -216,9 +221,16 @@ static void vti6_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
print_0xhex(PRINT_ANY, "fwmark", "fwmark 0x%x ", fwmark);
}
+static void vti6_print_help(struct link_util *lu, int argc, char **argv,
+ FILE *f)
+{
+ print_usage(f);
+}
+
struct link_util vti6_link_util = {
.id = "vti6",
.maxattr = IFLA_VTI_MAX,
.parse_opt = vti6_parse_opt,
.print_opt = vti6_print_opt,
+ .print_help = vti6_print_help,
};
--
1.7.10.4
prev parent reply other threads:[~2018-01-12 17:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-12 17:39 [PATCH iproute2 0/9] ip/tunnel: Improve tunnel parameters printing Serhey Popovych
2018-01-12 17:39 ` [PATCH iproute2 1/9] iplink: Use ll_index_to_name() instead of if_indextoname() Serhey Popovych
2018-01-17 18:53 ` Stephen Hemminger
2018-01-12 17:39 ` [PATCH iproute2 2/9] ip/tunnel: Correct and unify ttl/hoplimit printing Serhey Popovych
2018-01-12 17:39 ` [PATCH iproute2 3/9] ip/tunnel: Simplify and unify tos printing Serhey Popovych
2018-01-12 17:39 ` [PATCH iproute2 4/9] ip/tunnel: Use print_0xhex() instead of print_string() Serhey Popovych
2018-01-12 17:39 ` [PATCH iproute2 5/9] ip/tunnel: Use print_string() and simplify encap option printing Serhey Popovych
2018-01-12 17:39 ` [PATCH iproute2 6/9] gre/tunnel: Print erspan_index using print_uint() Serhey Popovych
2018-01-12 17:39 ` [PATCH iproute2 7/9] ip/tunnel: Minor cleanups in print routines Serhey Popovych
2018-01-12 17:39 ` [PATCH iproute2 8/9] vti/tunnel: Unify ikey/okey printing Serhey Popovych
2018-01-12 17:39 ` Serhey Popovych [this message]
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=1515778774-24173-10-git-send-email-serhe.popovych@gmail.com \
--to=serhe.popovych@gmail.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).