summaryrefslogtreecommitdiffstats
path: root/tests/regression/ip
diff options
context:
space:
mode:
Diffstat (limited to 'tests/regression/ip')
-rw-r--r--tests/regression/ip/dnat.t3
-rw-r--r--tests/regression/ip/dnat.t.payload.ip19
-rw-r--r--tests/regression/ip/ip.t.payload10
-rw-r--r--tests/regression/ip/ip.t.payload.inet12
4 files changed, 44 insertions, 0 deletions
diff --git a/tests/regression/ip/dnat.t b/tests/regression/ip/dnat.t
index 78fc454d..cdb78116 100644
--- a/tests/regression/ip/dnat.t
+++ b/tests/regression/ip/dnat.t
@@ -10,3 +10,6 @@ iifname "eth0" tcp dport {80, 90, 23} dnat 192.168.3.2;ok
# nft: src/evaluate.c:975: expr_evaluate_relational: Assertion '0' failed.
iifname "eth0" tcp dport != 23-34 dnat 192.168.3.2;ok
+
+dnat ct mark map { 0x00000014 : 1.2.3.4};ok
+dnat ct mark . ip daddr map { 0x00000014 . 1.1.1.1 : 1.2.3.4};ok
diff --git a/tests/regression/ip/dnat.t.payload.ip b/tests/regression/ip/dnat.t.payload.ip
index 93c4d68b..026e8719 100644
--- a/tests/regression/ip/dnat.t.payload.ip
+++ b/tests/regression/ip/dnat.t.payload.ip
@@ -48,3 +48,22 @@ ip test-ip4 prerouting
[ immediate reg 1 0x0203a8c0 ]
[ nat dnat ip addr_min reg 1 addr_max reg 0 ]
+# dnat ct mark map { 0x00000014 : 1.2.3.4}
+map%d test-ip4 b
+map%d test-ip4 0
+ element 00000014 : 04030201 0 [end]
+ip test-ip4 prerouting
+ [ ct load mark => reg 1 ]
+ [ lookup reg 1 set map%d dreg 1 ]
+ [ nat dnat ip addr_min reg 1 addr_max reg 0 ]
+
+# dnat ct mark . ip daddr map { 0x00000014 . 1.1.1.1 : 1.2.3.4}
+map%d test-ip4 b
+map%d test-ip4 0
+ element 00000014 01010101 : 04030201 0 [end]
+ip test-ip4 output
+ [ ct load mark => reg 1 ]
+ [ payload load 4b @ network header + 16 => reg 9 ]
+ [ lookup reg 1 set map%d dreg 1 ]
+ [ nat dnat ip addr_min reg 1 addr_max reg 0 ]
+
diff --git a/tests/regression/ip/ip.t.payload b/tests/regression/ip/ip.t.payload
index 7a77dc40..147923c2 100644
--- a/tests/regression/ip/ip.t.payload
+++ b/tests/regression/ip/ip.t.payload
@@ -353,3 +353,13 @@ ip test-ip4 input
[ bitwise reg 1 = (reg=1 & 0x0000ffff ) ^ 0x00000000 ]
[ cmp eq reg 1 0x0000ffff ]
+# ip saddr . ip daddr . ip protocol { 1.1.1.1 . 2.2.2.2 . tcp, 1.1.1.1 . 3.3.3.3 . udp}
+set%d test-ip 3
+set%d test-ip 0
+ element 01010101 02020202 00000006 : 0 [end] element 01010101 03030303 00000011 : 0 [end]
+ip test-ip input
+ [ payload load 4b @ network header + 12 => reg 1 ]
+ [ payload load 4b @ network header + 16 => reg 9 ]
+ [ payload load 1b @ network header + 9 => reg 10 ]
+ [ lookup reg 1 set set%d ]
+
diff --git a/tests/regression/ip/ip.t.payload.inet b/tests/regression/ip/ip.t.payload.inet
index dbc7852b..4caea1e3 100644
--- a/tests/regression/ip/ip.t.payload.inet
+++ b/tests/regression/ip/ip.t.payload.inet
@@ -465,3 +465,15 @@ inet test-inet input
[ bitwise reg 1 = (reg=1 & 0x0000ffff ) ^ 0x00000000 ]
[ cmp eq reg 1 0x0000ffff ]
+# ip saddr . ip daddr . ip protocol { 1.1.1.1 . 2.2.2.2 . tcp, 1.1.1.1 . 3.3.3.3 . udp}
+set%d test-ip 3
+set%d test-ip 0
+ element 01010101 02020202 00000006 : 0 [end] element 01010101 03030303 00000011 : 0 [end]
+inet test-ip input
+ [ meta load nfproto => reg 1 ]
+ [ cmp eq reg 1 0x00000002 ]
+ [ payload load 4b @ network header + 12 => reg 1 ]
+ [ payload load 4b @ network header + 16 => reg 9 ]
+ [ payload load 1b @ network header + 9 => reg 10 ]
+ [ lookup reg 1 set set%d ]
+