summaryrefslogtreecommitdiffstats
path: root/tests/regression/ip/ip.t.payload
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2015-08-12 03:23:40 +0200
committerFlorian Westphal <fw@strlen.de>2015-09-18 00:06:12 +0200
commite540acb8c1e16c9a9afc4c800ce524e47be803d4 (patch)
tree8bdd03c6d0b9c34bff2aed1791816035927a1eb6 /tests/regression/ip/ip.t.payload
parent048a5e093fde9db515ebc7b14f91bceb6cbd5949 (diff)
tests: add tests for ip version/hdrlength/tcp doff
Header fields of 4 bit lengths. Requires implicit masks and shifting of RHS constant. Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'tests/regression/ip/ip.t.payload')
-rw-r--r--tests/regression/ip/ip.t.payload21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/regression/ip/ip.t.payload b/tests/regression/ip/ip.t.payload
index 147923c2..da2dc218 100644
--- a/tests/regression/ip/ip.t.payload
+++ b/tests/regression/ip/ip.t.payload
@@ -363,3 +363,24 @@ ip test-ip input
[ payload load 1b @ network header + 9 => reg 10 ]
[ lookup reg 1 set set%d ]
+# ip version 4 ip hdrlength 5
+ip test-ip4 input
+ [ payload load 1b @ network header + 0 => reg 1 ]
+ [ bitwise reg 1 = (reg=1 & 0x000000f0 ) ^ 0x00000000 ]
+ [ cmp eq reg 1 0x00000040 ]
+ [ payload load 1b @ network header + 0 => reg 1 ]
+ [ bitwise reg 1 = (reg=1 & 0x0000000f ) ^ 0x00000000 ]
+ [ cmp eq reg 1 0x00000005 ]
+
+# ip hdrlength 0
+ip test-ip4 input
+ [ payload load 1b @ network header + 0 => reg 1 ]
+ [ bitwise reg 1 = (reg=1 & 0x0000000f ) ^ 0x00000000 ]
+ [ cmp eq reg 1 0x00000000 ]
+
+# ip hdrlength 15
+ip test-ip4 input
+ [ payload load 1b @ network header + 0 => reg 1 ]
+ [ bitwise reg 1 = (reg=1 & 0x0000000f ) ^ 0x00000000 ]
+ [ cmp eq reg 1 0x0000000f ]
+