diff --git a/scapy/layers/inet.py b/scapy/layers/inet.py index ed61c84d1b59b239b125f39d9e46767a6e789a6b..e26c4ef265bb1447716e2f67dd031a7ee3bec1c1 100644 --- a/scapy/layers/inet.py +++ b/scapy/layers/inet.py @@ -213,7 +213,8 @@ TCPOptions = ( 8 : ("Timestamp","!II"), 14 : ("AltChkSum","!BH"), 15 : ("AltChkSumOpt",None), - 25 : ("Mood","!p") + 25 : ("Mood","!p"), + 28 : ("UTO", "!H") }, { "EOL":0, "NOP":1, @@ -224,7 +225,8 @@ TCPOptions = ( "Timestamp":8, "AltChkSum":14, "AltChkSumOpt":15, - "Mood":25 + "Mood":25, + "UTO":28 } ) class TCPOptionsField(StrField): diff --git a/test/regression.uts b/test/regression.uts index fd2569158aab4b6d7e6c2843baba25e2d3457cb2..d3ee39f4e976112358fc67abf7c860c362c8cd99 100644 --- a/test/regression.uts +++ b/test/regression.uts @@ -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