Index: interface.h
===================================================================
RCS file: /home/ncvs/src/contrib/tcpdump/interface.h,v
retrieving revision 1.13
diff -w -u -r1.13 interface.h
--- interface.h	16 Oct 2007 02:31:47 -0000	1.13
+++ interface.h	15 Jan 2008 00:28:30 -0000
@@ -342,7 +342,7 @@
 /* forward compatibility */
 
 extern netdissect_options *gndo;
-
+extern int hflag;                               /* human-readable time formats */
 #define eflag gndo->ndo_eflag 
 #define fflag gndo->ndo_fflag 
 #define nflag gndo->ndo_nflag 
Index: tcpdump.1
===================================================================
RCS file: /home/ncvs/src/contrib/tcpdump/tcpdump.1,v
retrieving revision 1.18
diff -w -u -r1.18 tcpdump.1
--- tcpdump.1	16 Oct 2007 02:31:48 -0000	1.18
+++ tcpdump.1	15 Jan 2008 00:21:05 -0000
@@ -31,7 +31,7 @@
 .na
 .B tcpdump
 [
-.B \-AdDeflLnNOpqRStuUvxX
+.B \-AdDefhlLnNOpqRStuUvxX
 ] [
 .B \-c
 .I count
@@ -366,6 +366,12 @@
 Use \fIfile\fP as input for the filter expression.
 An additional expression given on the command line is ignored.
 .TP
+.B \-h
+Create output more suitable for human reading than for processing by scripts.
+Currently only the
+.B \-ttt
+option pays attention to this option.
+.TP
 .B \-i
 Listen on \fIinterface\fP.
 If unspecified, \fItcpdump\fP searches the system interface list for the
@@ -488,8 +494,18 @@
 Print an unformatted timestamp on each dump line.
 .TP
 .B \-ttt
-Print a delta (in micro-seconds) between current and previous line
-on each dump line.
+Print a time delta between current and previous line at the beginning
+of each dump line.
+The output format depends on whether the 
+.B \-h
+option has been set.  
+If it has, the time will be shown in a fixed width column, showing
+microseconds only, with no leading 0s, if the time is less than a
+second, or in seconds and microseconds if it is at least 1 second.  
+If the
+.B \-h
+option has not been set, this time is always in seconds with a
+microsecond resolution.
 .TP
 .B \-tttt
 Print a timestamp in default format proceeded by date on each dump line.
Index: tcpdump.c
===================================================================
RCS file: /home/ncvs/src/contrib/tcpdump/tcpdump.c,v
retrieving revision 1.13
diff -w -u -r1.13 tcpdump.c
--- tcpdump.c	21 Nov 2007 12:52:26 -0000	1.13
+++ tcpdump.c	15 Jan 2008 00:33:40 -0000
@@ -93,6 +93,7 @@
 #define MAX_CFLAG_CHARS	6
 
 int dflag;			/* print filter code */
+int hflag;			/* human readable output */
 int Lflag;			/* list available data link types and exit */
 
 static int infodelay;
@@ -501,7 +502,7 @@
 
 	opterr = 0;
 	while (
-	    (op = getopt(argc, argv, "aA" B_FLAG "c:C:d" D_FLAG "eE:fF:i:lLm:M:nNOpqr:Rs:StT:u" U_FLAG "vw:W:xXy:YZ:")) != -1)
+	    (op = getopt(argc, argv, "aA" B_FLAG "c:C:d" D_FLAG "eE:fF:hi:lLm:M:nNOpqr:Rs:StT:u" U_FLAG "vw:W:xXy:YZ:")) != -1)
 		switch (op) {
 
 		case 'a':
@@ -575,6 +576,10 @@
 			infile = optarg;
 			break;
 
+                case 'h':
+                  	hflag = 1;
+                        break;
+
 		case 'i':
 			if (optarg[0] == '0' && optarg[1] == 0)
 				error("Invalid adapter index");
Index: util.c
===================================================================
RCS file: /home/ncvs/src/contrib/tcpdump/util.c,v
retrieving revision 1.1.1.11
diff -w -u -r1.1.1.11 util.c
--- util.c	16 Oct 2007 02:20:34 -0000	1.1.1.11
+++ util.c	15 Jan 2008 01:20:32 -0000
@@ -170,7 +170,10 @@
 
 	case 3: /* Microseconds since previous packet */
 		if (b_sec == 0) {
-			printf("000000 ");
+			if (hflag)
+				printf ("          ");
+			else
+				printf(" 0.000000 ");
 		} else {
 			int d_usec = tvp->tv_usec - b_usec;
 			int d_sec = tvp->tv_sec - b_sec;
@@ -179,9 +182,11 @@
 				d_usec += 1000000;
 				d_sec--;
 			}
-			if (d_sec)
-				printf("%d. ", d_sec);
-			printf("%06d ", d_usec);
+                        if (hflag && (d_sec == 0))
+				printf("%9d ", d_usec);
+                        else
+				printf("%2d.%06d ",
+                                       d_sec, d_usec);
 		}
 		b_sec = tvp->tv_sec;
 		b_usec = tvp->tv_usec;
