summaryrefslogtreecommitdiffstats
path: root/tests/py/ip6
diff options
context:
space:
mode:
Diffstat (limited to 'tests/py/ip6')
-rw-r--r--tests/py/ip6/sets.t3
-rw-r--r--tests/py/ip6/sets.t.json37
-rw-r--r--tests/py/ip6/sets.t.payload.inet11
-rw-r--r--tests/py/ip6/sets.t.payload.ip68
-rw-r--r--tests/py/ip6/sets.t.payload.netdev10
5 files changed, 69 insertions, 0 deletions
diff --git a/tests/py/ip6/sets.t b/tests/py/ip6/sets.t
index 17fd62f5..cc26bd22 100644
--- a/tests/py/ip6/sets.t
+++ b/tests/py/ip6/sets.t
@@ -46,3 +46,6 @@ add @set5 { ip6 saddr . ip6 daddr };ok
add @map1 { ip6 saddr . ip6 daddr : meta mark };ok
delete @set5 { ip6 saddr . ip6 daddr };ok
+
+!map2 type ipv6_addr . ipv6_addr . inet_service : ipv6_addr . inet_service;ok
+add @map2 { ip6 saddr . ip6 daddr . th dport : 1234::1 . 80 };ok \ No newline at end of file
diff --git a/tests/py/ip6/sets.t.json b/tests/py/ip6/sets.t.json
index 2029d2b5..99236099 100644
--- a/tests/py/ip6/sets.t.json
+++ b/tests/py/ip6/sets.t.json
@@ -148,3 +148,40 @@
}
]
+# add @map2 { ip6 saddr . ip6 daddr . th dport : 1234::1 . 80 }
+[
+ {
+ "map": {
+ "data": {
+ "concat": [
+ "1234::1",
+ 80
+ ]
+ },
+ "elem": {
+ "concat": [
+ {
+ "payload": {
+ "field": "saddr",
+ "protocol": "ip6"
+ }
+ },
+ {
+ "payload": {
+ "field": "daddr",
+ "protocol": "ip6"
+ }
+ },
+ {
+ "payload": {
+ "field": "dport",
+ "protocol": "th"
+ }
+ }
+ ]
+ },
+ "map": "@map2",
+ "op": "add"
+ }
+ }
+]
diff --git a/tests/py/ip6/sets.t.payload.inet b/tests/py/ip6/sets.t.payload.inet
index 2bbd5573..2dbb818a 100644
--- a/tests/py/ip6/sets.t.payload.inet
+++ b/tests/py/ip6/sets.t.payload.inet
@@ -47,3 +47,14 @@ inet test-inet input
[ payload load 16b @ network header + 8 => reg 1 ]
[ payload load 16b @ network header + 24 => reg 2 ]
[ dynset delete reg_key 1 set set5 ]
+
+# add @map2 { ip6 saddr . ip6 daddr . th dport : 1234::1 . 80 }
+inet test-inet input
+ [ meta load nfproto => reg 1 ]
+ [ cmp eq reg 1 0x0000000a ]
+ [ payload load 16b @ network header + 8 => reg 1 ]
+ [ payload load 16b @ network header + 24 => reg 2 ]
+ [ payload load 2b @ transport header + 2 => reg 3 ]
+ [ immediate reg 17 0x00003412 0x00000000 0x00000000 0x01000000 ]
+ [ immediate reg 21 0x00005000 ]
+ [ dynset add reg_key 1 set map2 sreg_data 17 ]
diff --git a/tests/py/ip6/sets.t.payload.ip6 b/tests/py/ip6/sets.t.payload.ip6
index c59f7b5c..7234b989 100644
--- a/tests/py/ip6/sets.t.payload.ip6
+++ b/tests/py/ip6/sets.t.payload.ip6
@@ -36,3 +36,11 @@ ip6 test-ip6 input
[ meta load mark => reg 3 ]
[ dynset add reg_key 1 set map1 sreg_data 3 ]
+# add @map2 { ip6 saddr . ip6 daddr . th dport : 1234::1 . 80 }
+ip6 test-ip6 input
+ [ payload load 16b @ network header + 8 => reg 1 ]
+ [ payload load 16b @ network header + 24 => reg 2 ]
+ [ payload load 2b @ transport header + 2 => reg 3 ]
+ [ immediate reg 17 0x00003412 0x00000000 0x00000000 0x01000000 ]
+ [ immediate reg 21 0x00005000 ]
+ [ dynset add reg_key 1 set map2 sreg_data 17 ]
diff --git a/tests/py/ip6/sets.t.payload.netdev b/tests/py/ip6/sets.t.payload.netdev
index 1866d26b..2ad0f434 100644
--- a/tests/py/ip6/sets.t.payload.netdev
+++ b/tests/py/ip6/sets.t.payload.netdev
@@ -48,3 +48,13 @@ netdev test-netdev ingress
[ meta load mark => reg 3 ]
[ dynset add reg_key 1 set map1 sreg_data 3 ]
+# add @map2 { ip6 saddr . ip6 daddr . th dport : 1234::1 . 80 }
+netdev test-netdev ingress
+ [ meta load protocol => reg 1 ]
+ [ cmp eq reg 1 0x0000dd86 ]
+ [ payload load 16b @ network header + 8 => reg 1 ]
+ [ payload load 16b @ network header + 24 => reg 2 ]
+ [ payload load 2b @ transport header + 2 => reg 3 ]
+ [ immediate reg 17 0x00003412 0x00000000 0x00000000 0x01000000 ]
+ [ immediate reg 21 0x00005000 ]
+ [ dynset add reg_key 1 set map2 sreg_data 17 ]