summaryrefslogtreecommitdiffstats
path: root/tests/py/ip/redirect.t.payload
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2016-01-31 23:17:20 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2016-01-31 23:43:18 +0100
commit55d4a890af9fae63226511e056e44ab74a94f197 (patch)
tree8d57ebb27897438aa7391e3e9cb0a592a8b8e13a /tests/py/ip/redirect.t.payload
parent878b97fc251a09c12db489c32b87bf33aa5aa81b (diff)
tests/py: test port ranges and maps for redirect
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/py/ip/redirect.t.payload')
-rw-r--r--tests/py/ip/redirect.t.payload19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/py/ip/redirect.t.payload b/tests/py/ip/redirect.t.payload
index ac718043..da603e73 100644
--- a/tests/py/ip/redirect.t.payload
+++ b/tests/py/ip/redirect.t.payload
@@ -124,6 +124,14 @@ ip test-ip4 output
[ immediate reg 1 0x0000e103 ]
[ redir proto_min reg 1 ]
+# ip protocol tcp redirect to 100-200
+ip test-ip4 output
+ [ payload load 1b @ network header + 9 => reg 1 ]
+ [ cmp eq reg 1 0x00000006 ]
+ [ immediate reg 1 0x00006400 ]
+ [ immediate reg 2 0x0000c800 ]
+ [ redir proto_min reg 1 proto_max reg 2 ]
+
# tcp dport 9128 redirect to 993 random
ip test-ip4 output
[ payload load 1b @ network header + 9 => reg 1 ]
@@ -199,3 +207,14 @@ ip test-ip4 output
[ lookup reg 1 set map%d dreg 0 ]
[ redir ]
+# ip protocol 6 redirect to tcp dport map { 22 : 8000, 80 : 8080}
+map%d test-ip4 b
+map%d test-ip4 0
+ element 00001600 : 0000401f 0 [end] element 00005000 : 0000901f 0 [end]
+ip test-ip4 output
+ [ payload load 1b @ network header + 9 => reg 1 ]
+ [ cmp eq reg 1 0x00000006 ]
+ [ payload load 2b @ transport header + 2 => reg 1 ]
+ [ lookup reg 1 set map%d dreg 1 ]
+ [ redir proto_min reg 1 ]
+