Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Oct 2009 09:07:07 +0000 (UTC)
From:      Rui Paulo <rpaulo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r197829 - head/contrib/tcpdump
Message-ID:  <200910070907.n97977Dt079392@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rpaulo
Date: Wed Oct  7 09:07:06 2009
New Revision: 197829
URL: http://svn.freebsd.org/changeset/base/197829

Log:
  Add parsing code for TCP UTO (User Timeout Option).
  
  Submitted by:	fangwang@
  Obtained from:	//depot/projects/soc2009/tcputo/

Modified:
  head/contrib/tcpdump/print-tcp.c
  head/contrib/tcpdump/tcp.h

Modified: head/contrib/tcpdump/print-tcp.c
==============================================================================
--- head/contrib/tcpdump/print-tcp.c	Wed Oct  7 08:43:06 2009	(r197828)
+++ head/contrib/tcpdump/print-tcp.c	Wed Oct  7 09:07:06 2009	(r197829)
@@ -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, reg
                                  */
                                 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) {

Modified: head/contrib/tcpdump/tcp.h
==============================================================================
--- head/contrib/tcpdump/tcp.h	Wed Oct  7 08:43:06 2009	(r197828)
+++ head/contrib/tcpdump/tcp.h	Wed Oct  7 09:07:06 2009	(r197829)
@@ -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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200910070907.n97977Dt079392>