From e540acb8c1e16c9a9afc4c800ce524e47be803d4 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Wed, 12 Aug 2015 03:23:40 +0200 Subject: 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 --- tests/regression/ip/ip.t.payload | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'tests/regression/ip/ip.t.payload') 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 ] + -- cgit v1.2.3