diff options
author | Florian Westphal <fw@strlen.de> | 2018-06-18 13:27:59 +0200 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2018-06-18 14:52:07 +0200 |
commit | c9f5e18d72d3a010e9a53024290f9f4802ada9fd (patch) | |
tree | b4679a9e2e2ace115ba45dc0cc18efdd40a34b98 /iptables/xtables-translate.c | |
parent | e5fed16ab0b0da71dc92b052b3858d20ad9d542b (diff) |
xtables: add nf_tables vs. legacy postfix to version strings
-V now yields:
arptables vlibxtables.so.12 (nf_tables)
ebtables 1.6.2 (nf_tables)
ip6tables v1.6.2 (legacy)
ip6tables v1.6.2 (nf_tables)
ip6tables-restore v1.6.2 (nf_tables)
ip6tables-save v1.6.2 (nf_tables)
ip6tables-restore v1.6.2 (legacy)
ip6tables-restore-translate v1.6.2
ip6tables-save v1.6.2 (legacy)
ip6tables-translate v1.6.2 (nf_tables)
iptables v1.6.2 (legacy)
iptables v1.6.2 (nf_tables)
iptables-restore v1.6.2 (nf_tables)
iptables-save v1.6.2 (nf_tables)
iptables-restore v1.6.2 (legacy)
iptables-restore-translate v1.6.2
iptables-save v1.6.2 (legacy)
iptables-translate v1.6.2 (nf_tables)
This allows to see wheter "iptables" is using
old set/getsockopt or new nf_tables infrastructure.
Suggested-by: Harald Welte <laforge@gnumonks.org>
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'iptables/xtables-translate.c')
-rw-r--r-- | iptables/xtables-translate.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/iptables/xtables-translate.c b/iptables/xtables-translate.c index b08ac354..f4c0f9cf 100644 --- a/iptables/xtables-translate.c +++ b/iptables/xtables-translate.c @@ -324,6 +324,7 @@ static void print_usage(const char *name, const char *version) static const struct option options[] = { { .name = "help", .has_arg = false, .val = 'h' }, { .name = "file", .has_arg = true, .val = 'f' }, + { .name = "version", .has_arg = false, .val = 'V' }, { NULL }, }; @@ -505,7 +506,7 @@ static int xtables_restore_xlate_main(int family, const char *progname, exit(EXIT_FAILURE); opterr = 0; - while ((c = getopt_long(argc, argv, "hf:", options, NULL)) != -1) { + while ((c = getopt_long(argc, argv, "hf:V", options, NULL)) != -1) { switch (c) { case 'h': print_usage(argv[0], IPTABLES_VERSION); @@ -513,6 +514,9 @@ static int xtables_restore_xlate_main(int family, const char *progname, case 'f': file = optarg; break; + case 'V': + printf("%s v%s\n", argv[0], IPTABLES_VERSION); + exit(0); } } |