From be70918eab26e0c5fe219fefab325056144976d9 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Mon, 18 Jun 2018 09:18:28 +0200 Subject: xtables: rename xt-multi binaries to -nft, -legacy This adds a clear distinction between old iptables (formerly xtables-multi, now xtables-legacy-multi) and new iptables (formerly xtables-compat-multi, now xtables-nft-multi). Users will get the ip/ip6tables names via symbolic links, having a distinct name postfix for the legacy/nft variants helps to make a clear distinction, as iptables-nft will always use nf_tables and iptables-legacy always uses get/setsockopt wheres "iptables" could be symlinked to either -nft or -legacy. Signed-off-by: Florian Westphal --- iptables/xtables-legacy-multi.c | 53 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 iptables/xtables-legacy-multi.c (limited to 'iptables/xtables-legacy-multi.c') diff --git a/iptables/xtables-legacy-multi.c b/iptables/xtables-legacy-multi.c new file mode 100644 index 00000000..71ec7f5e --- /dev/null +++ b/iptables/xtables-legacy-multi.c @@ -0,0 +1,53 @@ +#include +#include +#include +#include "xshared.h" + +#include "xtables-multi.h" + +#ifdef ENABLE_IPV4 +#include "iptables-multi.h" +#endif + +#ifdef ENABLE_IPV6 +#include "ip6tables-multi.h" +#endif + +#ifdef ENABLE_NFTABLES +#include "xtables-multi.h" +#endif + +static const struct subcommand multi_subcommands[] = { +#ifdef ENABLE_IPV4 + {"iptables", iptables_main}, + {"main4", iptables_main}, + {"iptables-save", iptables_save_main}, + {"save4", iptables_save_main}, + {"iptables-restore", iptables_restore_main}, + {"restore4", iptables_restore_main}, + {"iptables-legacy", iptables_main}, + {"iptables-legacy-save",iptables_save_main}, + {"iptables-legacy-restore",iptables_restore_main}, + + +#endif + {"iptables-xml", iptables_xml_main}, + {"xml", iptables_xml_main}, +#ifdef ENABLE_IPV6 + {"ip6tables", ip6tables_main}, + {"main6", ip6tables_main}, + {"ip6tables-save", ip6tables_save_main}, + {"save6", ip6tables_save_main}, + {"ip6tables-restore", ip6tables_restore_main}, + {"restore6", ip6tables_restore_main}, + {"ip6tables", ip6tables_main}, + {"ip6tables-legacy-save",ip6tables_save_main}, + {"ip6tables-legacy-restore",ip6tables_restore_main}, +#endif + {NULL}, +}; + +int main(int argc, char **argv) +{ + return subcmd_main(argc, argv, multi_subcommands); +} -- cgit v1.2.3