Skip to contentSkip to conversation

iptables-translate: translate iptables --flush

PATCH Applied Guruswamy Basavaiah 2 participants 2 messages Mar 18, 2016 – Mar 22, 2016 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iptables-translate: translate iptables --flush

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
---
 iptables/xtables-translate.c | 8 ++++++++
 1 file changed, 8 insertions(+)
iptables/xtables-translate.c +8 -0
index 13a0bc7..354357c 100644
@@ -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;
Signature · 1 line
2.5.0
maintainer Applied
#1 lore raw
Quoted 7 lines · Guruswamy Basavaiah

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

Applied, thanks.