diff options
Diffstat (limited to 'tests/py')
-rw-r--r-- | tests/py/inet/tcp.t | 1 | ||||
-rw-r--r-- | tests/py/inet/tcp.t.json | 23 | ||||
-rw-r--r-- | tests/py/inet/tcp.t.json.output | 16 | ||||
-rw-r--r-- | tests/py/inet/tcp.t.payload | 8 |
4 files changed, 48 insertions, 0 deletions
diff --git a/tests/py/inet/tcp.t b/tests/py/inet/tcp.t index d66ba843..f96e3634 100644 --- a/tests/py/inet/tcp.t +++ b/tests/py/inet/tcp.t @@ -78,6 +78,7 @@ tcp flags cwr;ok tcp flags != cwr;ok tcp flags == syn;ok tcp flags & (syn|fin) == (syn|fin);ok;tcp flags & (fin | syn) == fin | syn +tcp flags & (fin | syn | rst | psh | ack | urg | ecn | cwr) == fin | syn | rst | psh | ack | urg | ecn | cwr;ok;tcp flags == 0xff tcp window 22222;ok tcp window 22;ok diff --git a/tests/py/inet/tcp.t.json b/tests/py/inet/tcp.t.json index 5744e594..babe5920 100644 --- a/tests/py/inet/tcp.t.json +++ b/tests/py/inet/tcp.t.json @@ -1101,6 +1101,29 @@ } ] +# tcp flags & (fin | syn | rst | psh | ack | urg | ecn | cwr) == fin | syn | rst | psh | ack | urg | ecn | cwr +[ + { + "match": { + "left": { + "&": [ + { + "payload": { + "field": "flags", + "protocol": "tcp" + } + }, + { + "|": [ "fin", { "|": [ "syn", { "|": [ "rst", { "|": [ "psh", { "|": [ "ack", { "|": [ "urg", { "|": [ "ecn", "cwr" ] } ] } ] } ] } ] } ] } ] + } + ] + }, + "op": "==", + "right": { "|": [ "fin", { "|": [ "syn", { "|": [ "rst", { "|": [ "psh", { "|": [ "ack", { "|": [ "urg", { "|": [ "ecn", "cwr" ] } ] } ] } ] } ] } ] } ] } + } + } +] + # tcp window 22222 [ { diff --git a/tests/py/inet/tcp.t.json.output b/tests/py/inet/tcp.t.json.output index 50282ec5..143490f7 100644 --- a/tests/py/inet/tcp.t.json.output +++ b/tests/py/inet/tcp.t.json.output @@ -139,3 +139,19 @@ } ] +# tcp flags & (fin | syn | rst | psh | ack | urg | ecn | cwr) == fin | syn | rst | psh | ack | urg | ecn | cwr +[ + { + "match": { + "left": { + "payload": { + "field": "flags", + "protocol": "tcp" + } + }, + "op": "==", + "right": 255 + } + } +] + diff --git a/tests/py/inet/tcp.t.payload b/tests/py/inet/tcp.t.payload index 09538aed..2390a24e 100644 --- a/tests/py/inet/tcp.t.payload +++ b/tests/py/inet/tcp.t.payload @@ -436,6 +436,14 @@ inet test-inet input [ bitwise reg 1 = (reg=1 & 0x00000003 ) ^ 0x00000000 ] [ cmp eq reg 1 0x00000003 ] +# tcp flags & (fin | syn | rst | psh | ack | urg | ecn | cwr) == fin | syn | rst | psh | ack | urg | ecn | cwr +inet test-inet input + [ meta load l4proto => reg 1 ] + [ cmp eq reg 1 0x00000006 ] + [ payload load 1b @ transport header + 13 => reg 1 ] + [ bitwise reg 1 = (reg=1 & 0x000000ff ) ^ 0x00000000 ] + [ cmp eq reg 1 0x000000ff ] + # tcp window 22222 inet test-inet input [ meta load l4proto => reg 1 ] |