* [PATCH] iptables-translate: translate iptables --flush
@ 2016-03-18 20:35 Guruswamy Basavaiah
2016-03-22 18:45 ` Pablo Neira Ayuso
0 siblings, 1 reply; 2+ messages in thread
From: Guruswamy Basavaiah @ 2016-03-18 20:35 UTC (permalink / raw)
To: netfilter-devel
translation for iptables --flush
Examples: $ sudo
iptables-translate -F INPUT nft flush chain ip filter INPUT
$ sudo iptables-translate -F -t nat
nft flush table ip nat
Signed-off-by: Guruswamy Basavaiah <guru2018@gmail.com>
---
iptables/xtables-translate.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/iptables/xtables-translate.c b/iptables/xtables-translate.c
index 13a0bc7..354357c 100644
--- a/iptables/xtables-translate.c
+++ b/iptables/xtables-translate.c
@@ -216,6 +216,14 @@ static int do_command_xlate(struct nft_handle *h, int argc, char *argv[],
}
break;
case CMD_FLUSH:
+ if (p.chain) {
+ printf("flush chain %s %s %s\n",
+ family2str[h->family], p.table, p.chain);
+ } else {
+ printf("flush table %s %s\n",
+ family2str[h->family], p.table);
+ }
+ ret = 1;
break;
case CMD_ZERO:
break;
--
2.5.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-03-22 18:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-18 20:35 [PATCH] iptables-translate: translate iptables --flush Guruswamy Basavaiah
2016-03-22 18:45 ` Pablo Neira Ayuso
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).