Skip to content
Snippets Groups Projects
Commit 3e53fe5d authored by Jeffrey Bencteux's avatar Jeffrey Bencteux
Browse files

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
parent 4fcc67c1
No related branches found
No related tags found
No related merge requests found
...@@ -4396,3 +4396,14 @@ defrags = defragment(frags) ...@@ -4396,3 +4396,14 @@ defrags = defragment(frags)
assert len(defrags) == 1 assert len(defrags) == 1
* which should be the same as pkt reconstructed * which should be the same as pkt reconstructed
assert defrags[0] == IP(str(pkt)) 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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment