add TCP User Timout Option (RFC 5482)

Allow one to send the TCP User Timeout Option described in RFC 5482 in
a crafted TCP segment.
Also added unit tests in new "TCP options" section of
test/regression.uts
This commit is contained in:
Jeffrey Bencteux 2016-03-05 09:19:44 +01:00
parent 4fcc67c199
commit 3e53fe5da3
1 changed files with 11 additions and 0 deletions

View File

@ -4396,3 +4396,14 @@ defrags = defragment(frags)
assert len(defrags) == 1
* which should be the same as pkt reconstructed
assert defrags[0] == IP(str(pkt))
############
############
+ Test TCP options
= TCP options: UTO - basic build
str(TCP(options=[("UTO", 0xffff)])) == "\x00\x14\x00\x50\x00\x00\x00\x00\x00\x00\x00\x00\x60\x02\x20\x00\x00\x00\x00\x00\x1c\x04\xff\xff"
= TCP options: UTO - basic dissection
uto = TCP("\x00\x14\x00\x50\x00\x00\x00\x00\x00\x00\x00\x00\x60\x02\x20\x00\x00\x00\x00\x00\x1c\x04\xff\xff")
uto[TCP].options[0][0] == "UTO" and uto[TCP].options[0][1] == 0xffff