Add parsing code for TCP UTO (User Timeout Option).

Submitted by:	fangwang@
Obtained from:	//depot/projects/soc2009/tcputo/
This commit is contained in:
Rui Paulo 2009-10-07 09:07:06 +00:00
parent d9492a4483
commit ce3ed1caa1
2 changed files with 14 additions and 0 deletions

View File

@ -124,6 +124,7 @@ struct tok tcp_option_values[] = {
{ TCPOPT_CCECHO, "" },
{ TCPOPT_SIGNATURE, "md5" },
{ TCPOPT_AUTH, "enhanced auth" },
{ TCPOPT_UTO, "uto" },
{ 0, NULL }
};
@ -613,6 +614,17 @@ tcp_print(register const u_char *bp, register u_int length,
*/
break;
case TCPOPT_UTO:
datalen = 2;
LENCHECK(datalen);
uint utoval = EXTRACT_16BITS(cp);
if (utoval & 0x0001)
utoval = (utoval >> 1) * 60;
else
utoval >>= 1;
(void)printf(" %u", utoval);
break;
default:
datalen = len - 2;
for (i = 0; i < datalen; ++i) {

View File

@ -83,6 +83,8 @@ struct tcphdr {
#define TCPOLEN_SIGNATURE 18
#define TCP_SIGLEN 16 /* length of an option 19 digest */
#define TCPOPT_AUTH 20 /* Enhanced AUTH option */
#define TCPOPT_UTO 28 /* tcp user timeout (rfc5482) */
#define TCPOLEN_UTO 4
#define TCPOPT_TSTAMP_HDR \
(TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP)