summaryrefslogtreecommitdiffstats
path: root/tests/py/inet/dccp.t.payload.ip
diff options
context:
space:
mode:
Diffstat (limited to 'tests/py/inet/dccp.t.payload.ip')
-rw-r--r--tests/py/inet/dccp.t.payload.ip82
1 files changed, 82 insertions, 0 deletions
diff --git a/tests/py/inet/dccp.t.payload.ip b/tests/py/inet/dccp.t.payload.ip
new file mode 100644
index 00000000..9e1cc2ec
--- /dev/null
+++ b/tests/py/inet/dccp.t.payload.ip
@@ -0,0 +1,82 @@
+# dccp sport 21-35
+ip test-ip4 input
+ [ payload load 1b @ network header + 9 => reg 1 ]
+ [ cmp eq reg 1 0x00000021 ]
+ [ payload load 2b @ transport header + 0 => reg 1 ]
+ [ cmp gte reg 1 0x00001500 ]
+ [ cmp lte reg 1 0x00002300 ]
+
+# dccp sport != 21-35
+ip test-ip4 input
+ [ payload load 1b @ network header + 9 => reg 1 ]
+ [ cmp eq reg 1 0x00000021 ]
+ [ payload load 2b @ transport header + 0 => reg 1 ]
+ [ cmp lt reg 1 0x00001500 ]
+ [ cmp gt reg 1 0x00002300 ]
+
+# dccp sport {23, 24, 25}
+set%d test-ip4 3
+set%d test-ip4 0
+ element 00001700 : 0 [end] element 00001800 : 0 [end] element 00001900 : 0 [end]
+ip test-ip4 input
+ [ payload load 1b @ network header + 9 => reg 1 ]
+ [ cmp eq reg 1 0x00000021 ]
+ [ payload load 2b @ transport header + 0 => reg 1 ]
+ [ lookup reg 1 set set%d ]
+
+# dccp sport { 20-50 }
+set%d test-ip4 7
+set%d test-ip4 0
+ element 00000000 : 1 [end] element 00001400 : 0 [end] element 00003300 : 1 [end]
+ip test-ip4 input
+ [ payload load 1b @ network header + 9 => reg 1 ]
+ [ cmp eq reg 1 0x00000021 ]
+ [ payload load 2b @ transport header + 0 => reg 1 ]
+ [ lookup reg 1 set set%d ]
+
+# dccp sport ftp-data - re-mail-ck
+ip test-ip4 input
+ [ payload load 1b @ network header + 9 => reg 1 ]
+ [ cmp eq reg 1 0x00000021 ]
+ [ payload load 2b @ transport header + 0 => reg 1 ]
+ [ cmp gte reg 1 0x00001400 ]
+ [ cmp lte reg 1 0x00003200 ]
+
+# dccp sport 20-50
+ip test-ip4 input
+ [ payload load 1b @ network header + 9 => reg 1 ]
+ [ cmp eq reg 1 0x00000021 ]
+ [ payload load 2b @ transport header + 0 => reg 1 ]
+ [ cmp gte reg 1 0x00001400 ]
+ [ cmp lte reg 1 0x00003200 ]
+
+# dccp sport { 20-50}
+set%d test-ip4 7
+set%d test-ip4 0
+ element 00000000 : 1 [end] element 00001400 : 0 [end] element 00003300 : 1 [end]
+ip test-ip4 input
+ [ payload load 1b @ network header + 9 => reg 1 ]
+ [ cmp eq reg 1 0x00000021 ]
+ [ payload load 2b @ transport header + 0 => reg 1 ]
+ [ lookup reg 1 set set%d ]
+
+# dccp dport {23, 24, 25}
+set%d test-ip4 3
+set%d test-ip4 0
+ element 00001700 : 0 [end] element 00001800 : 0 [end] element 00001900 : 0 [end]
+ip test-ip4 input
+ [ payload load 1b @ network header + 9 => reg 1 ]
+ [ cmp eq reg 1 0x00000021 ]
+ [ payload load 2b @ transport header + 2 => reg 1 ]
+ [ lookup reg 1 set set%d ]
+
+# dccp dport { 20-50}
+set%d test-ip4 7
+set%d test-ip4 0
+ element 00000000 : 1 [end] element 00001400 : 0 [end] element 00003300 : 1 [end]
+ip test-ip4 input
+ [ payload load 1b @ network header + 9 => reg 1 ]
+ [ cmp eq reg 1 0x00000021 ]
+ [ payload load 2b @ transport header + 2 => reg 1 ]
+ [ lookup reg 1 set set%d ]
+