commit 4edb46e9a85ca35d3bed523171d11a748861ce82 Author: Paul Traina Date: Mon Aug 19 20:34:12 1996 +0000 Virgin import of unmodified tcpdump v3.2.1 distribution from LBL. Obtained from: ftp://ftp.ee.lbl.gov/tcpdump.tar.Z on 19-Aug-1996. Notes: svn path=/vendor/tcpdump/dist/; revision=17680 svn path=/vendor/tcpdump/3.2.1/; revision=17682; tag=vendor/tcpdump/3.2.1 diff --git a/contrib/tcpdump/CHANGES b/contrib/tcpdump/CHANGES new file mode 100644 index 000000000000..d98f03313ece --- /dev/null +++ b/contrib/tcpdump/CHANGES @@ -0,0 +1,402 @@ +@(#) $Header: CHANGES,v 1.42 96/07/23 14:36:37 leres Exp $ (LBL) + +v3.2.1 Sun Jul 14 03:02:26 PDT 1996 + +- Added rfc1716 icmp codes as suggested by Martin Fredriksson + (martin@msp.se) + +- Print mtu for icmp unreach need frag packets. Thanks to John + Hawkinson (jhawk@mit.edu) + +- Decode icmp router discovery messages. Thanks to Jeffrey Honig + (jch@bsdi.com) + +- Added a printer entry for DLT_IEEE802 as suggested by Tak Kushida + (kushida@trl.ibm.co.jp) + +- Check igmp checksum if possible. Thanks to John Hawkinson. + +- Made changes for SINIX. Thanks to Andrej Borsenkow + (borsenkow.msk@sni.de) + +- Use autoconf's idea of the top level directory in install targets. + Thanks to John Hawkinson. + +- Avoid infinite loop in tcp options printing code. Thanks to Jeffrey + Mogul (mogul@pa.dec.com) + +- Avoid using -lsocket in IRIX 5.2 and earlier since it breaks snoop. + Thanks to John Hawkinson. + +- Added some more packet truncation checks. + +- On systems that have it, use sigset() instead of signal() since + signal() has different semantics on these systems. + +- Fixed some more alignment problems on the alpha. + +- Add code to massage unprintable characters in the domain and ipx + printers. Thanks to John Hawkinson. + +- Added explicit netmask support. Thanks to Steve Nuchia + (steve@research.oknet.com) + +- Add "sca" keyword (for DEC cluster services) as suggested by Terry + Kennedy (terry@spcvxa.spc.edu) + +- Add "atalk" keyword as suggested by John Hawkinson. + +- Added an igrp printer. Thanks to Francis Dupont + (francis.dupont@inria.fr) + +- Print IPX net numbers in hex a la Novell Netware. Thanks to Terry + Kennedy (terry@spcvxa.spc.edu) + +- Fixed snmp extended tag field parsing bug. Thanks to Pascal Hennequin + (pascal.hennequin@hugo.int-evry.fr) + +- Added some ETHERTYPEs missing on some systems. + +- Added truncated packet macros and various checks. + +- Fixed endian problems with the DECnet printer. + +- Use $CC when checking gcc version. Thanks to Carl Lindberg + (carl_lindberg@blacksmith.com) + +- Fixes for AIX (although this system is not yet supported). Thanks to + John Hawkinson. + +- Fix bugs in the autoconf misaligned accesses code fragment. + +- Include sys/param.h to get BYTE_ORDER in a few places. Thanks to + Pavlin Ivanov Radoslavov (pavlin@cs.titech.ac.jp) + +v3.2 Sun Jun 23 02:28:10 PDT 1996 + +- Print new icmp unreachable codes as suggested by Martin Fredriksson + (martin@msp.se). Also print code value when unknown for icmp redirect + and time exceeded. + +- Fix an alignment endian bug in getname(). Thanks to John Hawkinson. + +- Define "new" domain record types if not found in arpa/nameserv.h. + Resulted from a suggestion from John Hawkinson (jhawk@mit.edu). Also + fixed an endian bug when printing mx record and added some new record + types. + +- Added RIP V2 support. Thanks to Jeffrey Honig (jch@bsdi.com) + +- Added T/TCP options printing. As suggested by Richard Stevens + (rstevens@noao.edu) + +- Use autoconf to detect architectures that can't handle misaligned + accesses. + +v3.1 Thu Jun 13 20:59:32 PDT 1996 + +- Changed u_int32/int32 to u_int32_t/int32_t to be consistent with bsd + and bind (as suggested by Charles Hannum). + +- Port to GNU autoconf. + +- Add support for printing DVMRP and PIM traffic thanks to + Havard Eidnes (Havard.Eidnes@runit.sintef.no). + +- Fix AppleTalk, IPX and DECnet byte order problems due to wrong endian + define being referenced. Reported by Terry Kennedy. + +- Minor fixes to the man page thanks to Mark Andrews. + +- Endian fixes to RTP and vat packet dumpers, thanks to Bruce Mah + (bmah@cs.berkeley.edu). + +- Added support for new dns types, thanks to Rainer Orth. + +- Fixed tftp_print() to print the block number for ACKs. + +- Document -dd and -ddd. Resulted from a bug report from Charlie Slater + (cslater@imatek.com). + +- Check return status from malloc/calloc/etc. + +- Check return status from pcap_loop() so we can print an error and + exit with a bad status if there were problems. + +- Bail if ip option length is <= 0. Resulted from a bug report from + Darren Reed (darrenr@vitruvius.arbld.unimelb.edu.au). + +- Print out a little more information for sun rpc packets. + +- Add suport for Kerberos 4 thanks to John Hawkinson (jhawk@mit.edu). + +- Fixed the Fix EXTRACT_SHORT() and EXTRACT_LONG() macros (which were + wrong on little endian machines). + +- Fixed alignment bug in ipx_decode(). Thanks to Matt Crawford + (crawdad@fnal.gov). + +- Fix ntp_print() to not print garbage when the stratum is + "unspecified." Thanks to Deus Ex Machina (root@belle.bork.com). + +- Rewrote tcp options printer code to check for truncation. Added + selective acknowledgment case. + +- Fixed an endian bug in the ospf printer. Thanks to Jeffrey C Honig + (jch@bsdi.com) + +- Fix rip printer to handle 4.4 BSD sockaddr struct which only uses one + octet for the sa_family member. Thanks to Yoshitaka Tokugawa + (toku@dit.co.jp) + +- Don't checksum ip header if we don't have all of it. Thanks to John + Hawkinson (jhawk@mit.edu). + +- Print out hostnames if possible in egp printer. Thanks to Jeffrey + Honig (jhc@bsdi.com) + + +v3.1a1 Wed May 3 19:21:11 PDT 1995 + +- Include time.h when SVR4 is defined to avoid problems under Solaris + 2.3. + +- Fix etheraddr_string() in the ETHER_SERVICE to return the saved + strings, not the local buffer. Thanks to Stefan Petri + (petri@ibr.cs.tu-bs.de). + +- Detect when pcap raises the snaplen (e.g. with snit). Print a warning + that the selected value was not used. Thanks to Pascal Hennequin + (Pascal.Hennequin@hugo.int-evry.fr). + +- Add a truncated packet test to print-nfs.c. Thanks to Pascal Hennequin. + +- BYTEORDER -> BYTE_ORDER Thanks to Terry Kennedy (terry@spcvxa.spc.edu). + +v3.0.3 Sun Oct 1 18:35:00 GMT 1995 + +- Although there never was a 3.0.3 release, the linux boys cleverly + "released" one in late 1995. + +v3.0.2 Thu Apr 20 21:28:16 PDT 1995 + +- Change configuration to not use gcc v2 flags with gcc v1. + +- Redo gmt2local() so that it works under BSDI (which seems to return + an empty timezone struct from gettimeofday()). Based on report from + Terry Kennedy (terry@spcvxa.spc.edu). + +- Change configure to recognize IP[0-9]* as "mips" SGI hardware. Based + on report from Mark Andrews (mandrews@alias.com). + +- Don't pass cc flags to gcc. Resulted from a bug report from Rainer + Orth (ro@techfak.uni-bielefeld.de). + +- Fixed printout of connection id for uncompressed tcp slip packets. + Resulted from a bug report from Richard Stevens (rstevens@noao.edu). + +- Hack around deficiency in Ultrix's make. + +- Add ETHERTYPE_TRAIL define which is missing from irix5. + +v3.0.1 Wed Aug 31 22:42:26 PDT 1994 + +- Fix problems with gcc2 vs. malloc() and read() prototypes under SunOS 4. + +v3.0 Mon Jun 20 19:23:27 PDT 1994 + +- Added support for printing tcp option timestamps thanks to + Mark Andrews (mandrews@alias.com). + +- Reorganize protocol dumpers to take const pointers to packets so they + never change the contents (i.e., they used to do endian conversions + in place). Previously, whenever more than one pass was taken over + the packet, the packet contents would be dumped incorrectly (i.e., + the output form -x would be wrong on little endian machines because + the protocol dumpers would modify the data). Thanks to Charles Hannum + (mycroft@gnu.ai.mit.edu) for reporting this problem. + +- Added support for decnet protocol dumping thanks to Jeff Mogul + (mogul@pa.dec.com). + +- Fix bug that caused length of packet to be incorrectly printed + (off by ether header size) for unknown ethernet types thanks + to Greg Miller (gmiller@kayak.mitre.org). + +- Added support for IPX protocol dumping thanks to Brad Parker + (brad@fcr.com). + +- Added check to verify IP header checksum under -v thanks to + Brad Parker (brad@fcr.com). + +- Move packet capture code to new libpcap library (which is + packaged separately). + +- Prototype everything and assume an ansi compiler. + +- print-arp.c: Print hardware ethernet addresses if they're not + what we expect. + +- print-bootp.c: Decode the cmu vendor field. Add RFC1497 tags. + Many helpful suggestions from Gordon Ross (gwr@jericho.mc.com). + +- print-fddi.c: Improvements. Thanks to Jeffrey Mogul + (mogul@pa.dec.com). + +- print-icmp.c: Byte swap netmask before printing. Thanks to + Richard Stevens (rstevens@noao.edu). Print icmp type when unknown. + +- print-ip.c: Print the inner ip datagram of ip-in-ip encapsulated packets. + By default, only the inner packet is dumped, appended with the token + "(encap)". Under -v, both the inner and output packets are dumped + (on the same line). Note that the filter applies to the original packet, + not the encapsulated packet. So if you run tcpdump on a net with an + IP Multicast tunnel, you cannot filter out the datagrams using the + conventional syntax. (You can filter away all the ip-in-ip traffic + with "not ip proto 4".) + +- print-nfs.c: Keep pending rpc's in circular table. Add generic + nfs header and remove os dependences. Thanks to Jeffrey Mogul. + +- print-ospf.c: Improvements. Thanks to Jeffrey Mogul. + +- tcpdump.c: Add -T flag allows interpretation of "vat", "wb", "rpc" + (sunrpc) and rtp packets. Added "inbound" and "outbound" keywords + Add && and || operators + +v2.2.1 Tue Jun 6 17:57:22 PDT 1992 + +- Fix bug with -c flag. + +v2.2 Fri May 22 17:19:41 PDT 1992 + +- savefile.c: Remove hack that shouldn't have been exported. Add + truncate checks. + +- Added the 'icmp' keyword. For example, 'icmp[0] != 8 and icmp[0] != 0' + matches non-echo/reply ICMP packets. + +- Many improvements to filter code optimizer. + +- Added 'multicast' keyword and extended the 'broadcast' keyword can now be + so that protocol qualifications are allowed. For example, "ip broadcast" + and "ether multicast" are valid filters. + +- Added support for monitoring the loopback interface (i.e. 'tcpdump -i lo'). + Jeffrey Honig (jch@MITCHELL.CIT.CORNELL.EDU) contributed the kernel + patches to netinet/if_loop.c. + +- Added support for the Ungermann-Bass Ethernet on IBM/PC-RTs running AOS. + Contact Jeffrey Honig (jch@MITCHELL.CIT.CORNELL.EDU) for the diffs. + +- Added EGP and OSPF printers, thanks to Jeffrey Honig. + +v2.1 Tue Jan 28 11:00:14 PST 1992 + +- Internal release (never publically exported). + +v2.0.1 Sun Jan 26 21:10:10 PDT + +- Various byte ordering fixes. + +- Add truncation checks. + +- inet.c: Support BSD style SIOCGIFCONF. + +- nametoaddr.c: Handle multi addresses for single host. + +- optimize.c: Rewritten. + +- pcap-bpf.c: don't choke when we get ptraced. only set promiscuous + for broadcast nets. + +- print-atal.c: Fix an alignment bug (thanks to + stanonik@nprdc.navy.mil) Add missing printf() argument. + +- print-bootp.c: First attempt at decoding the vendor buffer. + +- print-domain.c: Fix truncation checks. + +- print-icmp.c: Calculate length of packets from the ip header. + +- print-ip.c: Print frag id in decimal (so it's easier to match up + with non-frags). Add support for ospf, egp and igmp. + +- print-nfs.c: Lots of changes. + +- print-ntp.c: Make some verbose output depend on -v. + +- print-snmp.c: New version from John LoVerso. + +- print-tcp.c: Print rfc1072 tcp options. + +- tcpdump.c: Print "0x" prefix for %x formats. Always print 6 digits + (microseconds) worth of precision. Fix uid bugs. + +- A packet dumper has been added (thanks to Jeff Mogul of DECWRL). + With this option, you can create an architecture independent binary + trace file in real time, without the overhead of the packet printer. + At a later time, the packets can be filtered (again) and printed. + +- BSD is supported. You must have BPF in your kernel. + Since the filtering is now done in the kernel, fewer packets are + dropped. In fact, with BPF and the packet dumper option, a measly + Sun 3/50 can keep up with a busy network. + +- Compressed SLIP packets can now be dumped, provided you use our + SLIP software and BPF. These packets are dumped as any other IP + packet; the compressed headers are dumped with the '-e' option. + +- Machines with little-endian byte ordering are supported (thanks to + Jeff Mogul). + +- Ultrix 4.0 is supported (also thanks to Jeff Mogul). + +- IBM RT and Stanford Enetfilter support has been added by + Rayan Zachariassen . Tcpdump has been tested under + both the vanilla Enetfilter interface, and the extended interface + (#ifdef'd by IBMRTPC) present in the MERIT version of the Enetfilter. + +- TFTP packets are now printed (requests only). + +- BOOTP packets are now printed. + +- SNMP packets are now printed. (thanks to John LoVerso of Xylogics). + +- Sparc architectures, including the Sparcstation-1, are now + supported thanks to Steve McCanne and Craig Leres. + +- SunOS 4 is now supported thanks to Micky Liu of Columbia + University (micky@cunixc.cc.columbia.edu). + +- IP options are now printed. + +- RIP packets are now printed. + +- There's a -v flag that prints out more information than the + default (e.g., it will enable printing of IP ttl, tos and id) + and -q flag that prints out less (e.g., it will disable + interpretation of AppleTalk-in-UDP). + +- The grammar has undergone substantial changes (if you have an + earlier version of tcpdump, you should re-read the manual + entry). + + The most useful change is the addition of an expression + syntax that lets you filter on arbitrary fields or values in the + packet. E.g., "ip[0] > 0x45" would print only packets with IP + options, "tcp[13] & 3 != 0" would print only TCP SYN and FIN + packets. + + The most painful change is that concatenation no longer means + "and" -- e.g., you have to say "host foo and port bar" instead + of "host foo port bar". The up side to this down is that + repeated qualifiers can be omitted, making most filter + expressions shorter. E.g., you can now say "ip host foo and + (bar or baz)" to look at ip traffic between hosts foo and bar or + between hosts foo and baz. [The old way of saying this was "ip + host foo and (ip host bar or ip host baz)".] + +v2.0 Sun Jan 13 12:20:40 PST 1991 + +- Initial public release. diff --git a/contrib/tcpdump/FILES b/contrib/tcpdump/FILES new file mode 100644 index 000000000000..5d4c3387ee51 --- /dev/null +++ b/contrib/tcpdump/FILES @@ -0,0 +1,80 @@ +CHANGES +FILES +INSTALL +Makefile.in +README +VERSION +aclocal.m4 +addrtoname.c +addrtoname.h +appletalk.h +atime.awk +bootp.h +bpf_dump.c +config.guess +config.sub +configure +configure.in +decnet.h +ethertype.h +extract.h +fddi.h +igrp.h +install-sh +interface.h +ipx.h +lbl/gnuc.h +lbl/os-solaris2.h +lbl/os-sunos4.h +llc.h +machdep.c +machdep.h +makemib +mib.h +mkdep +netbios.h +nfsfh.h +nfsv2.h +ntp.h +ospf.h +packetdat.awk +parsenfsfh.c +print-arp.c +print-atalk.c +print-atm.c +print-bootp.c +print-decnet.c +print-domain.c +print-dvmrp.c +print-egp.c +print-ether.c +print-fddi.c +print-icmp.c +print-igrp.c +print-ip.c +print-ipx.c +print-isoclns.c +print-krb.c +print-llc.c +print-netbios.c +print-nfs.c +print-ntp.c +print-null.c +print-ospf.c +print-pim.c +print-ppp.c +print-rip.c +print-sl.c +print-snmp.c +print-sunrpc.c +print-tcp.c +print-tftp.c +print-udp.c +print-wb.c +send-ack.awk +stime.awk +strcasecmp.c +tcpdump.1 +tcpdump.c +util.c +vfprintf.c diff --git a/contrib/tcpdump/INSTALL b/contrib/tcpdump/INSTALL new file mode 100644 index 000000000000..c5512c00b1be --- /dev/null +++ b/contrib/tcpdump/INSTALL @@ -0,0 +1,116 @@ +@(#) $Header: INSTALL,v 1.25 96/07/21 04:02:01 leres Exp $ (LBL) + +If you have not built libpcap, do so first. See the README +file in this directory for the ftp location. + +You will need an ANSI C compiler to build tcpdump. The configure script +will abort if your compiler is not ANSI compliant. If this happens, use +the GNU C compiler, available via anonymous ftp: + + ftp://prep.ai.mit.edu/pub/gnu/gcc-*.tar.gz + +After libpcap has been built (either install it with "make install" and +"make install-incl" or make sure both the libpcap and tcpdump source +trees are in the same directory), edit the BINDEST and MANDEST paths in +Makefile.in and run ./configure (a shell script). "configure" will +determine your system attributes and generate an appropriate Makefile +from Makefile.in. Now build tcpdump by running "make". + +If everything builds ok, su and type "make install" (and optionally +"make install-man). This will install tcpdump and the manual entry. By +default, tcpdump is installed with group execute permissions. The group +used depends on your os. In addition, BPF packet access is controlled +by permissions to /dev/bpf0. In any case, DO NOT give untrusted users +the capability of running tcpdump. Tcpdump can capture any traffic on +your net, including passwords. + +Note that tcpdump is shipped with some systems, for example, DEC/OSF +and BSD/386. Remember to remove or rename the installed binary +when upgrading. + +If your system is not one which we have tested tcpdump on, you may have +to modify the configure script and Makefile.in. Please send us patches +for any modifications you need to make. However, we are not interested +in ascii packet printer patches. We believe adding this feature would +make it too easy for crackers who do not have the programming skills +needed to write a password sniffer to grab clear text passwords. + +FILES +----- +CHANGES - description of differences between releases +FILES - list of files exported as part of the distribution +INSTALL - this file +Makefile.in - compilation rules (input to the configure script) +README - description of distribution +VERSION - version of this release +aclocal.m4 - autoconf macros +addrtoname.c - address to hostname routines +addrtoname.h - address to hostname definitions +appletalk.h - AppleTalk definitions +atime.awk - tcp ack awk script +bootp.h - BOOTP definitions +bpf_dump.c - bpf instruction pretty-printer routine +config.guess - autoconf support +config.sub - autoconf support +configure - configure script (run this first) +configure.in - configure script source +decnet.h - DECnet definitions +ethertype.h - ethernet definitions +extract.h - alignment definitions +fddi.h - FDDI definitions +igrp.h - Interior Gateway Routing Protoco definitions +install-sh - BSD style install script +interface.h - globals, prototypes and definitions +ipx.h - IPX definitions +lbl/gnuc.h - gcc macros and defines +lbl/os-*.h - os dependent defines and prototypes +llc.h - LLC definitions +machdep.c - machine dependent routines +machdep.h - machine dependent definitions +makemib - mib to header script +mib.h - mib definitions +mkdep - construct Makefile dependency list +netbios.h - NETBIOS definitions +nfsfh.h - NFS file handle definitions +nfsv2.h - NFS V2 definitions +ntp.h - NTP definitions +ospf.h - OSPF definitions +packetdat.awk - tcp chunk summary awk script +parsenfsfh.c - NFS file parser routines +print-arp.c - ARP printer routines +print-atalk.c - AppleTalk printer routines +print-atm.c - atm printer routines +print-bootp.c - BOOTP printer routines +print-decnet.c - DECnet printer routines +print-domain.c - Domain Name System printer routines +print-egp.c - EGP printer routines +print-ether.c - ethernet printer routines +print-fddi.c - FDDI printer routines +print-icmp.c - ICMP printer routines +print-igrp.c - Interior Gateway Routing Protoco printer routines +print-ip.c - ip printer routines +print-ipx.c - IPX printer routines +print-isoclns.c - isoclns printer routines +print-krb.c - Kerberos printer routines +print-llc.c - llc printer routines +print-netbios.c - netbios printer routines +print-nfs.c - NFS printer routines +print-ntp.c - NTP printer routines +print-null.c - null printer routines +print-ospf.c - ospf printer routines +print-pim.c - Protocol Independent Multicast printer routines +print-ppp.c - PPP printer routines +print-rip.c - RIP printer routines +print-sl.c - CSLIP printer routines +print-snmp.c - SNMP printer routines +print-sunrpc.c - Sun RPC printer routines +print-tcp.c - TCP printer routines +print-tftp.c - TFTP printer routines +print-udp.c - UDP printer routines +print-wb.c - white board printer routines +send-ack.awk - unidirectional tcp send/ack awk script +stime.awk - tcp send awk script +tcpdump.1 - manual entry +tcpdump.c - main program +util.c - utility routines +vfprintf.c - emulation routine diff --git a/contrib/tcpdump/Makefile.in b/contrib/tcpdump/Makefile.in new file mode 100644 index 000000000000..f4490ba03592 --- /dev/null +++ b/contrib/tcpdump/Makefile.in @@ -0,0 +1,140 @@ +# Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996 +# The Regents of the University of California. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that: (1) source code distributions +# retain the above copyright notice and this paragraph in its entirety, (2) +# distributions including binary code include the above copyright notice and +# this paragraph in its entirety in the documentation or other materials +# provided with the distribution, and (3) all advertising materials mentioning +# features or use of this software display the following acknowledgement: +# ``This product includes software developed by the University of California, +# Lawrence Berkeley Laboratory and its contributors.'' Neither the name of +# the University nor the names of its contributors may be used to endorse +# or promote products derived from this software without specific prior +# written permission. +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# @(#) $Header: Makefile.in,v 1.195 96/07/16 23:52:06 leres Exp $ (LBL) + +# +# Various configurable paths (remember to edit Makefile.in, not Makefile) +# + +# Top level hierarchy +prefix = @prefix@ +exec_prefix = @exec_prefix@ +# Pathname of directory to install the binary +BINDEST = @sbindir@ +# Pathname of directory to install the man page +MANDEST = @mandir@ + +# +# You shouldn't need to edit anything below here. +# + +CC = @CC@ +CCOPT = @V_CCOPT@ +INCLS = -I. @V_INCLS@ +DEFS = @DEFS@ -DPPP -DHAVE_FDDI + +# Standard CFLAGS +CFLAGS = $(CCOPT) $(DEFS) $(INCLS) + +# Standard LIBS +LIBS = @LIBS@ + +INSTALL = @INSTALL@ + +# Explicitly define compilation rule since SunOS 4's make doesn't like gcc. +# Also, gcc does not remove the .o before forking 'as', which can be a +# problem if you don't own the file but can write to the directory. +.c.o: + @rm -f $@ + $(CC) $(CFLAGS) -c $*.c + +CSRC = tcpdump.c addrtoname.c \ + print-ether.c print-ip.c print-arp.c print-tcp.c \ + print-udp.c print-atalk.c print-domain.c print-tftp.c \ + print-bootp.c print-nfs.c print-icmp.c print-igrp.c \ + print-sl.c print-ppp.c print-rip.c print-snmp.c \ + print-ntp.c print-null.c print-egp.c print-ospf.c \ + print-fddi.c print-llc.c print-sunrpc.c print-wb.c \ + print-decnet.c print-isoclns.c print-ipx.c \ + print-atm.c print-dvmrp.c print-pim.c print-krb.c \ + util.c machdep.c bpf_dump.c parsenfsfh.c +LOCALSRC = +GENSRC = version.c + +SRC = $(CSRC) $(GENSRC) $(LOCALSRC) + +# We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot +# hack the extra indirection +OBJ = $(CSRC:.c=.o) $(GENSRC:.c=.o) $(LOCALSRC:.c=.o) @LIBOBJS@ +HDR = addrtoname.h appletalk.h bootp.h decnet.h \ + ethertype.h extract.h fddi.h interface.h igrp.h ipx.h \ + llc.h machdep.h mib.h nfsfh.h nfsv2.h ntp.h ospf.h + +TAGHDR = \ + /usr/include/arpa/tftp.h \ + /usr/include/net/slip.h \ + /usr/include/netinet/if_ether.h \ + /usr/include/netinet/in.h \ + /usr/include/netinet/ip_icmp.h \ + /usr/include/netinet/tcp.h \ + /usr/include/netinet/udp.h \ + /usr/include/protocols/routed.h + +TAGFILES = $(SRC) $(HDR) $(TAGHDR) + +CLEANFILES = $(OBJ) tcpdump $(GENSRC) + +tcpdump: $(OBJ) @V_PCAPDEP@ + @rm -f $@ + $(CC) $(CFLAGS) -o $@ $(OBJ) $(LIBS) + +version.o: version.c +version.c: VERSION + @rm -f $@ + sed -e 's/.*/char version[] = "&";/' VERSION > $@ + +install: force + $(INSTALL) -m 550 -o bin -g @V_GROUP@ tcpdump $(DESTDIR)$(BINDEST) + +install-man: force + $(INSTALL) -m 444 -o bin -g bin tcpdump.1 $(DESTDIR)$(MANDEST)/man1 + +lint: $(GENSRC) force + lint -hbxn $(SRC) | \ + grep -v 'struct/union .* never defined' | \ + grep -v 'possible pointer alignment problem' + +clean: + rm -f $(CLEANFILES) + +distclean: + rm -f $(CLEANFILES) Makefile config.cache config.log config.status \ + gnuc.h os-proto.h + +tags: $(TAGFILES) + ctags -wtd $(TAGFILES) + +tar: force + @cwd=`pwd` ; dir=`basename $$cwd` ; name=tcpdump-`cat VERSION` ; \ + list="" ; tar="tar chFFf" ; \ + for i in `cat FILES` ; do list="$$list $$name/$$i" ; done; \ + echo \ + "rm -f ../$$name; ln -s $$dir ../$$name" ; \ + rm -f ../$$name; ln -s $$dir ../$$name ; \ + echo \ + "(cd .. ; $$tar - [lots of files]) | compress > /tmp/$$name.tar.Z" ; \ + (cd .. ; $$tar - $$list) | compress > /tmp/$$name.tar.Z ; \ + echo \ + "rm -f ../$$name" ; \ + rm -f ../$$name + +force: /tmp +depend: $(GENSRC) force + ./mkdep -c $(CC) $(DEFS) $(INCLS) $(SRC) diff --git a/contrib/tcpdump/README b/contrib/tcpdump/README new file mode 100644 index 000000000000..49a4578b82ab --- /dev/null +++ b/contrib/tcpdump/README @@ -0,0 +1,203 @@ +@(#) $Header: README,v 1.49 96/07/15 18:28:23 leres Exp $ (LBL) + +TCPDUMP 3.2.1 +Lawrence Berkeley National Laboratory +Network Research Group +tcpdump@ee.lbl.gov +ftp://ftp.ee.lbl.gov/tcpdump.tar.Z + +This directory contains source code for tcpdump, a tool for network +monitoring and data acquisition. The original distribution is +available via anonymous ftp to ftp.ee.lbl.gov, in tcpdump.tar.Z. + +Tcpdump now uses libcap, a system-independent interface for user-level +packet capture. Before building tcpdump, you must first retrieve and +build libpcap, also from LBL, in: + + ftp://ftp.ee.lbl.gov/libpcap.tar.Z + +Once libpcap is built (either install it or make sure it's in +../libpcap), you can build tcpdump using the procedure in the INSTALL +file. + +The program is loosely based on SMI's "etherfind" although none +of the etherfind code remains. It was originally written by Van +Jacobson as part of an ongoing research project to investigate and +improve tcp and internet gateway performance. The parts of the +program originally taken from Sun's etherfind were later re-written +by Steven McCanne of LBL. To insure that there would be no vestige +of proprietary code in tcpdump, Steve wrote these pieces from the +specification given by the manual entry, with no access to the +source of tcpdump or etherfind. + +Over the past few years, tcpdump has been steadily improved +by the excellent contributions from the Internet community +(just browse through the CHANGES file). We are grateful for +all the input. + +Richard Stevens gives an excellent treatment of the Internet +protocols in his book ``TCP/IP Illustrated, Volume 1''. +If you want to learn more about tcpdump and how to interpret +its output, pick up this book. + +Some tools for viewing and analyzing tcpdump trace files are available +from the Internet Traffic Archive: + + http://town.hall.org/Archives/pub/ITA/ + +Problems, bugs, questions, desirable enhancements, source code +contributions, etc., should be sent to the email address +"tcpdump@ee.lbl.gov". + + - Steve McCanne + Craig Leres + Van Jacobson +------------------------------------- +This directory also contains some short awk programs intended as +examples of ways to reduce tcpdump data when you're tracking +particular network problems: + +send-ack.awk + Simplifies the tcpdump trace for an ftp (or other unidirectional + tcp transfer). Since we assume that one host only sends and + the other only acks, all address information is left off and + we just note if the packet is a "send" or an "ack". + + There is one output line per line of the original trace. + Field 1 is the packet time in decimal seconds, relative + to the start of the conversation. Field 2 is delta-time + from last packet. Field 3 is packet type/direction. + "Send" means data going from sender to receiver, "ack" + means an ack going from the receiver to the sender. A + preceding "*" indicates that the data is a retransmission. + A preceding "-" indicates a hole in the sequence space + (i.e., missing packet(s)), a "#" means an odd-size (not max + seg size) packet. Field 4 has the packet flags + (same format as raw trace). Field 5 is the sequence + number (start seq. num for sender, next expected seq number + for acks). The number in parens following an ack is + the delta-time from the first send of the packet to the + ack. A number in parens following a send is the + delta-time from the first send of the packet to the + current send (on duplicate packets only). Duplicate + sends or acks have a number in square brackets showing + the number of duplicates so far. + + Here is a short sample from near the start of an ftp: + 3.00 0.20 send . 512 + 3.20 0.20 ack . 1024 (0.20) + 3.20 0.00 send P 1024 + 3.40 0.20 ack . 1536 (0.20) + 3.80 0.40 * send . 0 (3.80) [2] + 3.82 0.02 * ack . 1536 (0.62) [2] + Three seconds into the conversation, bytes 512 through 1023 + were sent. 200ms later they were acked. Shortly thereafter + bytes 1024-1535 were sent and again acked after 200ms. + Then, for no apparent reason, 0-511 is retransmitted, 3.8 + seconds after its initial send (the round trip time for this + ftp was 1sec, +-500ms). Since the receiver is expecting + 1536, 1536 is re-acked when 0 arrives. + +packetdat.awk + Computes chunk summary data for an ftp (or similar + unidirectional tcp transfer). [A "chunk" refers to + a chunk of the sequence space -- essentially the packet + sequence number divided by the max segment size.] + + A summary line is printed showing the number of chunks, + the number of packets it took to send that many chunks + (if there are no lost or duplicated packets, the number + of packets should equal the number of chunks) and the + number of acks. + + Following the summary line is one line of information + per chunk. The line contains eight fields: + 1 - the chunk number + 2 - the start sequence number for this chunk + 3 - time of first send + 4 - time of last send + 5 - time of first ack + 6 - time of last ack + 7 - number of times chunk was sent + 8 - number of times chunk was acked + (all times are in decimal seconds, relative to the start + of the conversation.) + + As an example, here is the first part of the output for + an ftp trace: + + # 134 chunks. 536 packets sent. 508 acks. + 1 1 0.00 5.80 0.20 0.20 4 1 + 2 513 0.28 6.20 0.40 0.40 4 1 + 3 1025 1.16 6.32 1.20 1.20 4 1 + 4 1561 1.86 15.00 2.00 2.00 6 1 + 5 2049 2.16 15.44 2.20 2.20 5 1 + 6 2585 2.64 16.44 2.80 2.80 5 1 + 7 3073 3.00 16.66 3.20 3.20 4 1 + 8 3609 3.20 17.24 3.40 5.82 4 11 + 9 4097 6.02 6.58 6.20 6.80 2 5 + + This says that 134 chunks were transferred (about 70K + since the average packet size was 512 bytes). It took + 536 packets to transfer the data (i.e., on the average + each chunk was transmitted four times). Looking at, + say, chunk 4, we see it represents the 512 bytes of + sequence space from 1561 to 2048. It was first sent + 1.86 seconds into the conversation. It was last + sent 15 seconds into the conversation and was sent + a total of 6 times (i.e., it was retransmitted every + 2 seconds on the average). It was acked once, 140ms + after it first arrived. + +stime.awk +atime.awk + Output one line per send or ack, respectively, in the form +