netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guruswamy Basavaiah <guru2018@gmail.com>
To: netfilter-devel@vger.kernel.org
Subject: [PATCH] iptables-translate: translate iptables --flush
Date: Sat, 19 Mar 2016 02:05:49 +0530	[thread overview]
Message-ID: <20160318203549.GA18494@localhost.localdomain> (raw)

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


             reply	other threads:[~2016-03-18 20:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-18 20:35 Guruswamy Basavaiah [this message]
2016-03-22 18:45 ` [PATCH] iptables-translate: translate iptables --flush Pablo Neira Ayuso

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=20160318203549.GA18494@localhost.localdomain \
    --to=guru2018@gmail.com \
    --cc=netfilter-devel@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).