diff options
author | Florian Westphal <fw@strlen.de> | 2016-07-21 15:57:15 +0200 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2016-07-21 17:22:05 +0200 |
commit | 6c0cb3d568322cc4dc9854980fd3b9d6e8c8046e (patch) | |
tree | 933bd16d2995bf5d2fd2d6cbd1cff878852bad45 /tests/py/ip/ip.t.payload | |
parent | a4fe9cfe788706c0bf1c3a40b7c92f1d2bebf7e7 (diff) |
tests: add basic payload tests
payload set operations should work at least for byte-sized
quantities >= 2 byte.
Before adding support for odd-sized writes (ecn, dscp, ip6 flowlabel
...) add a bunch of tests to cover current state.
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'tests/py/ip/ip.t.payload')
-rw-r--r-- | tests/py/ip/ip.t.payload | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/py/ip/ip.t.payload b/tests/py/ip/ip.t.payload index 15cc5904..d6ef540b 100644 --- a/tests/py/ip/ip.t.payload +++ b/tests/py/ip/ip.t.payload @@ -416,3 +416,24 @@ ip test-ip4 input [ bitwise reg 1 = (reg=1 & 0x0000000f ) ^ 0x00000000 ] [ cmp eq reg 1 0x0000000f ] +# iif lo ip daddr set 127.0.0.1 +ip test-ip4 input + [ meta load iif => reg 1 ] + [ cmp eq reg 1 0x00000001 ] + [ immediate reg 1 0x0100007f ] + [ payload write reg 1 => 4b @ network header + 16 csum_type 1 csum_off 10 ] + +# iif lo ip checksum set 0 +ip test-ip4 input + [ meta load iif => reg 1 ] + [ cmp eq reg 1 0x00000001 ] + [ immediate reg 1 0x00000000 ] + [ payload write reg 1 => 2b @ network header + 10 csum_type 1 csum_off 10 ] + +# iif lo ip id set 0 +ip test-ip4 input + [ meta load iif => reg 1 ] + [ cmp eq reg 1 0x00000001 ] + [ immediate reg 1 0x00000000 ] + [ payload write reg 1 => 2b @ network header + 4 csum_type 1 csum_off 10 ] + |