[PATCH] iptables-translate: translate iptables --flush

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>

---
 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

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux