summaryrefslogtreecommitdiffstats
path: root/tests/py/any/frag.t.payload
diff options
context:
space:
mode:
authorArturo Borrero <arturo.borrero.glez@gmail.com>2015-12-11 11:10:14 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2015-12-15 21:36:14 +0100
commit6b29a5bebb957387fe1aac8fcbfd431e6be237f0 (patch)
tree7e0be595ee6acfbdd2611045a7d227d5f329a16e /tests/py/any/frag.t.payload
parent564b0e7c13f98b9ad054058137b4c0bb61bd46b4 (diff)
tests/: rearrange tests directory
Rearrange the directory to obtain a better organization of files and tests-suites. We end with a tree like this: tests | .--- py .--- shell .--- files This was suggested by Pablo. Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/py/any/frag.t.payload')
-rw-r--r--tests/py/any/frag.t.payload109
1 files changed, 109 insertions, 0 deletions
diff --git a/tests/py/any/frag.t.payload b/tests/py/any/frag.t.payload
new file mode 100644
index 00000000..a91ab3fa
--- /dev/null
+++ b/tests/py/any/frag.t.payload
@@ -0,0 +1,109 @@
+# frag nexthdr tcp
+ip test-ip4 output
+ [ exthdr load 1b @ 44 + 0 => reg 1 ]
+ [ cmp eq reg 1 0x00000006 ]
+
+# frag nexthdr != icmp
+ip test-ip4 output
+ [ exthdr load 1b @ 44 + 0 => reg 1 ]
+ [ cmp neq reg 1 0x00000001 ]
+
+# frag nexthdr {esp, ah, comp, udp, udplite, tcp, dccp, sctp}
+set%d test-ip4 3
+set%d test-ip4 0
+ element 00000032 : 0 [end] element 00000033 : 0 [end] element 0000006c : 0 [end] element 00000011 : 0 [end] element 00000088 : 0 [end] element 00000006 : 0 [end] element 00000021 : 0 [end] element 00000084 : 0 [end]
+ip test-ip4 output
+ [ exthdr load 1b @ 44 + 0 => reg 1 ]
+ [ lookup reg 1 set set%d ]
+
+# frag nexthdr esp
+ip test-ip4 output
+ [ exthdr load 1b @ 44 + 0 => reg 1 ]
+ [ cmp eq reg 1 0x00000032 ]
+
+# frag nexthdr ah
+ip test-ip4 output
+ [ exthdr load 1b @ 44 + 0 => reg 1 ]
+ [ cmp eq reg 1 0x00000033 ]
+
+# frag reserved 22
+ip test-ip4 output
+ [ exthdr load 1b @ 44 + 1 => reg 1 ]
+ [ cmp eq reg 1 0x00000016 ]
+
+# frag reserved != 233
+ip test-ip4 output
+ [ exthdr load 1b @ 44 + 1 => reg 1 ]
+ [ cmp neq reg 1 0x000000e9 ]
+
+# frag reserved 33-45
+ip test-ip4 output
+ [ exthdr load 1b @ 44 + 1 => reg 1 ]
+ [ cmp gte reg 1 0x00000021 ]
+ [ cmp lte reg 1 0x0000002d ]
+
+# frag reserved != 33-45
+ip test-ip4 output
+ [ exthdr load 1b @ 44 + 1 => reg 1 ]
+ [ cmp lt reg 1 0x00000021 ]
+ [ cmp gt reg 1 0x0000002d ]
+
+# frag reserved { 33, 55, 67, 88}
+set%d test-ip4 3
+set%d test-ip4 0
+ element 00000021 : 0 [end] element 00000037 : 0 [end] element 00000043 : 0 [end] element 00000058 : 0 [end]
+ip test-ip4 output
+ [ exthdr load 1b @ 44 + 1 => reg 1 ]
+ [ lookup reg 1 set set%d ]
+
+# frag reserved { 33-55}
+set%d test-ip4 7
+set%d test-ip4 0
+ element 00000000 : 1 [end] element 00000021 : 0 [end] element 00000038 : 1 [end]
+ip test-ip4 output
+ [ exthdr load 1b @ 44 + 1 => reg 1 ]
+ [ lookup reg 1 set set%d ]
+
+# frag id 1
+ip test-ip4 output
+ [ exthdr load 4b @ 44 + 4 => reg 1 ]
+ [ cmp eq reg 1 0x01000000 ]
+
+# frag id 22
+ip test-ip4 output
+ [ exthdr load 4b @ 44 + 4 => reg 1 ]
+ [ cmp eq reg 1 0x16000000 ]
+
+# frag id != 33
+ip test-ip4 output
+ [ exthdr load 4b @ 44 + 4 => reg 1 ]
+ [ cmp neq reg 1 0x21000000 ]
+
+# frag id 33-45
+ip test-ip4 output
+ [ exthdr load 4b @ 44 + 4 => reg 1 ]
+ [ cmp gte reg 1 0x21000000 ]
+ [ cmp lte reg 1 0x2d000000 ]
+
+# frag id != 33-45
+ip test-ip4 output
+ [ exthdr load 4b @ 44 + 4 => reg 1 ]
+ [ cmp lt reg 1 0x21000000 ]
+ [ cmp gt reg 1 0x2d000000 ]
+
+# frag id { 33, 55, 67, 88}
+set%d test-ip4 3
+set%d test-ip4 0
+ element 21000000 : 0 [end] element 37000000 : 0 [end] element 43000000 : 0 [end] element 58000000 : 0 [end]
+ip test-ip4 output
+ [ exthdr load 4b @ 44 + 4 => reg 1 ]
+ [ lookup reg 1 set set%d ]
+
+# frag id { 33-55}
+set%d test-ip4 7
+set%d test-ip4 0
+ element 00000000 : 1 [end] element 21000000 : 0 [end] element 38000000 : 1 [end]
+ip test-ip4 output
+ [ exthdr load 4b @ 44 + 4 => reg 1 ]
+ [ lookup reg 1 set set%d ]
+