]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Add an example of how to check for TCP packets with a payload, at least
authorguy <guy>
Fri, 26 Nov 2004 00:17:26 +0000 (00:17 +0000)
committerguy <guy>
Fri, 26 Nov 2004 00:17:26 +0000 (00:17 +0000)
for IPv4.

tcpdump.1

index efab5b97dc0e36ec68bc11d585372aad46e18c02..98840da688be05c55834cbba0f0659f8e323d313 100644 (file)
--- a/tcpdump.1
+++ b/tcpdump.1
@@ -1,4 +1,4 @@
-.\" @(#) $Header: /tcpdump/master/tcpdump/Attic/tcpdump.1,v 1.165 2004-11-08 07:45:05 guy Exp $ (LBL)
+.\" @(#) $Header: /tcpdump/master/tcpdump/Attic/tcpdump.1,v 1.166 2004-11-26 00:17:26 guy Exp $ (LBL)
 .\"
 .\"    $NetBSD: tcpdump.8,v 1.9 2003/03/31 00:18:17 perry Exp $
 .\"
@@ -1232,6 +1232,16 @@ tcpdump 'tcp[tcpflags] & (tcp-syn|tcp-fin) != 0 and not src and dst net \fIlocal
 .fi
 .RE
 .LP
+To print all IPv4 HTTP packets to and from port 80, i.e. print only
+packets that contain data, not, for example, SYN and FIN packets and
+ACK-only packets.  (IPv6 is left as an exercise for the reader.)
+.RS
+.nf
+.B
+tcpdump 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)'
+.fi
+.RE
+.LP
 To print IP packets longer than 576 bytes sent through gateway \fIsnup\fP:
 .RS
 .nf