summaryrefslogtreecommitdiffstats
path: root/tests/py/inet/esp.t.payload.inet
diff options
context:
space:
mode:
Diffstat (limited to 'tests/py/inet/esp.t.payload.inet')
-rw-r--r--tests/py/inet/esp.t.payload.inet93
1 files changed, 93 insertions, 0 deletions
diff --git a/tests/py/inet/esp.t.payload.inet b/tests/py/inet/esp.t.payload.inet
new file mode 100644
index 00000000..4ba9ea8e
--- /dev/null
+++ b/tests/py/inet/esp.t.payload.inet
@@ -0,0 +1,93 @@
+# esp spi 100
+inet test-inet input
+ [ meta load l4proto => reg 1 ]
+ [ cmp eq reg 1 0x00000032 ]
+ [ payload load 4b @ transport header + 0 => reg 1 ]
+ [ cmp eq reg 1 0x64000000 ]
+
+# esp spi != 100
+inet test-inet input
+ [ meta load l4proto => reg 1 ]
+ [ cmp eq reg 1 0x00000032 ]
+ [ payload load 4b @ transport header + 0 => reg 1 ]
+ [ cmp neq reg 1 0x64000000 ]
+
+# esp spi 111-222
+inet test-inet input
+ [ meta load l4proto => reg 1 ]
+ [ cmp eq reg 1 0x00000032 ]
+ [ payload load 4b @ transport header + 0 => reg 1 ]
+ [ cmp gte reg 1 0x6f000000 ]
+ [ cmp lte reg 1 0xde000000 ]
+
+# esp spi != 111-222
+inet test-inet input
+ [ meta load l4proto => reg 1 ]
+ [ cmp eq reg 1 0x00000032 ]
+ [ payload load 4b @ transport header + 0 => reg 1 ]
+ [ cmp lt reg 1 0x6f000000 ]
+ [ cmp gt reg 1 0xde000000 ]
+
+# esp spi { 100, 102}
+set%d test-inet 3
+set%d test-inet 0
+ element 64000000 : 0 [end] element 66000000 : 0 [end]
+inet test-inet input
+ [ meta load l4proto => reg 1 ]
+ [ cmp eq reg 1 0x00000032 ]
+ [ payload load 4b @ transport header + 0 => reg 1 ]
+ [ lookup reg 1 set set%d ]
+
+# esp spi { 100-102}
+set%d test-inet 7
+set%d test-inet 0
+ element 00000000 : 1 [end] element 64000000 : 0 [end] element 67000000 : 1 [end]
+inet test-inet input
+ [ meta load l4proto => reg 1 ]
+ [ cmp eq reg 1 0x00000032 ]
+ [ payload load 4b @ transport header + 0 => reg 1 ]
+ [ lookup reg 1 set set%d ]
+
+# esp sequence 22
+inet test-inet input
+ [ meta load l4proto => reg 1 ]
+ [ cmp eq reg 1 0x00000032 ]
+ [ payload load 4b @ transport header + 4 => reg 1 ]
+ [ cmp eq reg 1 0x16000000 ]
+
+# esp sequence 22-24
+inet test-inet input
+ [ meta load l4proto => reg 1 ]
+ [ cmp eq reg 1 0x00000032 ]
+ [ payload load 4b @ transport header + 4 => reg 1 ]
+ [ cmp gte reg 1 0x16000000 ]
+ [ cmp lte reg 1 0x18000000 ]
+
+# esp sequence != 22-24
+inet test-inet input
+ [ meta load l4proto => reg 1 ]
+ [ cmp eq reg 1 0x00000032 ]
+ [ payload load 4b @ transport header + 4 => reg 1 ]
+ [ cmp lt reg 1 0x16000000 ]
+ [ cmp gt reg 1 0x18000000 ]
+
+# esp sequence { 22, 24}
+set%d test-inet 3
+set%d test-inet 0
+ element 16000000 : 0 [end] element 18000000 : 0 [end]
+inet test-inet input
+ [ meta load l4proto => reg 1 ]
+ [ cmp eq reg 1 0x00000032 ]
+ [ payload load 4b @ transport header + 4 => reg 1 ]
+ [ lookup reg 1 set set%d ]
+
+# esp sequence { 22-25}
+set%d test-inet 7
+set%d test-inet 0
+ element 00000000 : 1 [end] element 16000000 : 0 [end] element 1a000000 : 1 [end]
+inet test-inet input
+ [ meta load l4proto => reg 1 ]
+ [ cmp eq reg 1 0x00000032 ]
+ [ payload load 4b @ transport header + 4 => reg 1 ]
+ [ lookup reg 1 set set%d ]
+