Просмотр исходного кода

Merge pull request #43 from ldnvnbl/idev

fix #42: add change policy method
Casey Callendrello 7 лет назад
Родитель
Сommit
073684287c
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      iptables/iptables.go

+ 5 - 0
iptables/iptables.go

@@ -289,6 +289,11 @@ func (ipt *IPTables) DeleteChain(table, chain string) error {
 	return ipt.run("-t", table, "-X", chain)
 }
 
+// ChangePolicy changes policy on chain to target
+func (ipt *IPTables) ChangePolicy(table, chain, target string) error {
+	return ipt.run("-t", table, "-P", chain, target)
+}
+
 // run runs an iptables command with the given arguments, ignoring
 // any stdout output
 func (ipt *IPTables) run(args ...string) error {