summaryrefslogtreecommitdiffstats
path: root/contrib/tcpdump
diff options
context:
space:
mode:
authorrpaulo <rpaulo@FreeBSD.org>2009-10-07 09:07:06 +0000
committerrpaulo <rpaulo@FreeBSD.org>2009-10-07 09:07:06 +0000
commit38b5375bb9e04dc98166ad7cb26eeea6454a92fc (patch)
tree31ee79eebdb43e93bb0d2b6c8ead8e8013ecdddc /contrib/tcpdump
parentd6f29069b6735fa01a2f684d5224bd939b5ef84f (diff)
downloadFreeBSD-src-38b5375bb9e04dc98166ad7cb26eeea6454a92fc.zip
FreeBSD-src-38b5375bb9e04dc98166ad7cb26eeea6454a92fc.tar.gz
Add parsing code for TCP UTO (User Timeout Option).
Submitted by: fangwang@ Obtained from: //depot/projects/soc2009/tcputo/
Diffstat (limited to 'contrib/tcpdump')
-rw-r--r--contrib/tcpdump/print-tcp.c12
-rw-r--r--contrib/tcpdump/tcp.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/contrib/tcpdump/print-tcp.c b/contrib/tcpdump/print-tcp.c
index 5b0a796..4200c31 100644
--- a/contrib/tcpdump/print-tcp.c
+++ b/contrib/tcpdump/print-tcp.c
@@ -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) {
diff --git a/contrib/tcpdump/tcp.h b/contrib/tcpdump/tcp.h
index db7dd44..1393a27 100644
--- a/contrib/tcpdump/tcp.h
+++ b/contrib/tcpdump/tcp.h
@@ -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)
OpenPOWER on IntegriCloud