summaryrefslogtreecommitdiffhomepage
path: root/test/iptables/iptables_util.go
diff options
context:
space:
mode:
authorKevin Krakauer <krakauer@google.com>2020-02-12 16:19:06 -0800
committerKevin Krakauer <krakauer@google.com>2020-02-13 17:02:50 -0800
commit6ef63cd7da107d487fda7c48af50fa9802913cd9 (patch)
tree29549cbf20d7a9daa58bfa218029b5e5918d1ac9 /test/iptables/iptables_util.go
parent16308b9dc1d3709fadebb9f56a71f2ab81771c8a (diff)
We can now create and jump in iptables. For example:
$ iptables -N foochain $ iptables -A INPUT -j foochain
Diffstat (limited to 'test/iptables/iptables_util.go')
-rw-r--r--test/iptables/iptables_util.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/iptables/iptables_util.go b/test/iptables/iptables_util.go
index 043114c78..293c4e6ed 100644
--- a/test/iptables/iptables_util.go
+++ b/test/iptables/iptables_util.go
@@ -35,6 +35,16 @@ func filterTable(args ...string) error {
return nil
}
+// filterTableRules is like filterTable, but runs multiple iptables commands.
+func filterTableRules(argsList [][]string) error {
+ for _, args := range argsList {
+ if err := filterTable(args...); err != nil {
+ return err
+ }
+ }
+ return nil
+}
+
// listenUDP listens on a UDP port and returns the value of net.Conn.Read() for
// the first read on that port.
func listenUDP(port int, timeout time.Duration) error {