Blame INSTALL.md

Packit 209cc3
To build libpcap, run "./configure" (a shell script). The configure
Packit 209cc3
script will determine your system attributes and generate an
Packit 209cc3
appropriate Makefile from Makefile.in. Next run "make". If everything
Packit 209cc3
goes well you can su to root and run "make install". However, you need
Packit 209cc3
not install libpcap if you just want to build tcpdump; just make sure
Packit 209cc3
the tcpdump and libpcap directory trees have the same parent
Packit 209cc3
directory.
Packit 209cc3
Packit 209cc3
If configure says:
Packit 209cc3
Packit 209cc3
    configure: warning: cannot determine packet capture interface
Packit 209cc3
    configure: warning: (see INSTALL for more info)
Packit 209cc3
Packit 209cc3
then your system either does not support packet capture or your system
Packit 209cc3
does support packet capture but libpcap does not support that
Packit 209cc3
particular type. (If you have HP-UX, see below.) If your system uses a
Packit 209cc3
packet capture not supported by libpcap, please send us patches; don't
Packit 209cc3
forget to include an autoconf fragment suitable for use in
Packit 209cc3
configure.ac.
Packit 209cc3
Packit 209cc3
It is possible to override the default packet capture type, although
Packit 209cc3
the circumstance where this works are limited. For example if you have
Packit 209cc3
installed bpf under SunOS 4 and wish to build a snit libpcap:
Packit 209cc3
Packit 209cc3
    ./configure --with-pcap=snit
Packit 209cc3
Packit 209cc3
Another example is to force a supported packet capture type in the case
Packit 209cc3
where the configure scripts fails to detect it.
Packit 209cc3
Packit 209cc3
You will need an ANSI C compiler to build libpcap. The configure script
Packit 209cc3
will abort if your compiler is not ANSI compliant. If this happens, use
Packit 209cc3
the generally available GNU C compiler (GCC).
Packit 209cc3
Packit 209cc3
You will need either Flex 2.5.31 or later, or a version of Lex
Packit 209cc3
compatible with it (if any exist), to build libpcap.  The configure
Packit 209cc3
script will abort if there isn't any such program.  If you have an older
Packit 209cc3
version of Flex, or don't have a compatible version of Lex, the current
Packit 209cc3
version of flex is available at flex.sourceforge.net.
Packit 209cc3
Packit 209cc3
You will need either Bison, Berkeley YACC, or a version of YACC
Packit 209cc3
compatible with them (if any exist), to build libpcap.  The configure
Packit 209cc3
script will abort if there isn't any such program.  If you don't have
Packit 209cc3
any such program, the current version of Bison can be found at
Packit 209cc3
http://ftp.gnu.org/gnu/bison/ and the current version of Berkeley YACC
Packit 209cc3
can be found at http://invisible-island.net/byacc/.
Packit 209cc3
Packit 209cc3
Sometimes the stock C compiler does not interact well with Flex and
Packit 209cc3
Bison. The list of problems includes undefined references for alloca.
Packit 209cc3
You can get around this by installing GCC.
Packit 209cc3
Packit 209cc3
If you use Solaris, there is a bug with bufmod(7) that is fixed in
Packit 209cc3
Solaris 2.3.2 (aka SunOS 5.3.2). Setting a snapshot length with the
Packit 209cc3
broken bufmod(7) results in data be truncated from the FRONT of the
Packit 209cc3
packet instead of the end.  The work around is to not set a snapshot
Packit 209cc3
length but this results in performance problems since the entire packet
Packit 209cc3
is copied to user space. If you must run an older version of Solaris,
Packit 209cc3
there is a patch available from Sun; ask for bugid 1149065. After
Packit 209cc3
installing the patch, use "setenv BUFMOD_FIXED" to enable use of
Packit 209cc3
bufmod(7). However, we recommend you run a more current release of
Packit 209cc3
Solaris.
Packit 209cc3
Packit 209cc3
If you use the SPARCompiler, you must be careful to not use the
Packit 209cc3
/usr/ucb/cc interface. If you do, you will get bogus warnings and
Packit 209cc3
perhaps errors. Either make sure your path has /opt/SUNWspro/bin
Packit 209cc3
before /usr/ucb or else:
Packit 209cc3
Packit 209cc3
    setenv CC /opt/SUNWspro/bin/cc
Packit 209cc3
Packit 209cc3
before running configure. (You might have to do a "make distclean"
Packit 209cc3
if you already ran configure once).
Packit 209cc3
Packit 209cc3
If you are trying to do packet capture with a FORE ATM card, you may or
Packit 209cc3
may not be able to. They usually only release their driver in object
Packit 209cc3
code so unless their driver supports packet capture, there's not much
Packit 209cc3
libpcap can do.
Packit 209cc3
Packit 209cc3
If you get an error like:
Packit 209cc3
Packit 209cc3
    tcpdump: recv_ack: bind error 0x???
Packit 209cc3
Packit 209cc3
when using DLPI, look for the DL_ERROR_ACK error return values, usually
Packit 209cc3
in /usr/include/sys/dlpi.h, and find the corresponding value.
Packit 209cc3
Packit 209cc3
Under {DEC OSF/1, Digital UNIX, Tru64 UNIX}, packet capture must be
Packit 209cc3
enabled before it can be used.  For instructions on how to enable packet
Packit 209cc3
filter support, see:
Packit 209cc3
Packit 209cc3
	ftp://ftp.digital.com/pub/Digital/dec-faq/Digital-UNIX
Packit 209cc3
Packit 209cc3
Look for the "How do I configure the Berkeley Packet Filter and capture
Packit 209cc3
tcpdump traces?" item.
Packit 209cc3
Packit 209cc3
Once you enable packet filter support, your OSF system will support bpf
Packit 209cc3
natively.
Packit 209cc3
Packit 209cc3
Under Ultrix, packet capture must be enabled before it can be used. For
Packit 209cc3
instructions on how to enable packet filter support, see:
Packit 209cc3
Packit 209cc3
	ftp://ftp.digital.com/pub/Digital/dec-faq/ultrix
Packit 209cc3
Packit 209cc3
If you use HP-UX, you must have at least version 9 and either the
Packit 209cc3
version of cc that supports ANSI C (cc -Aa) or else use the GNU C
Packit 209cc3
compiler. You must also buy the optional streams package. If you don't
Packit 209cc3
have:
Packit 209cc3
Packit 209cc3
    /usr/include/sys/dlpi.h
Packit 209cc3
    /usr/include/sys/dlpi_ext.h
Packit 209cc3
Packit 209cc3
then you don't have the streams package. In addition, we believe you
Packit 209cc3
need to install the "9.X LAN and DLPI drivers cumulative" patch
Packit 209cc3
(PHNE_6855) to make the version 9 DLPI work with libpcap.
Packit 209cc3
Packit 209cc3
The DLPI streams package is standard starting with HP-UX 10.
Packit 209cc3
Packit 209cc3
The HP implementation of DLPI is a little bit eccentric. Unlike
Packit 209cc3
Solaris, you must attach /dev/dlpi instead of the specific /dev/*
Packit 209cc3
network pseudo device entry in order to capture packets. The PPA is
Packit 209cc3
based on the ifnet "index" number. Under HP-UX 9, it is necessary to
Packit 209cc3
read /dev/kmem and the kernel symbol file (/hp-ux). Under HP-UX 10,
Packit 209cc3
DLPI can provide information for determining the PPA. It does not seem
Packit 209cc3
to be possible to trace the loopback interface. Unlike other DLPI
Packit 209cc3
implementations, PHYS implies MULTI and SAP and you get an error if you
Packit 209cc3
try to enable more than one promiscuous mode at a time.
Packit 209cc3
Packit 209cc3
It is impossible to capture outbound packets on HP-UX 9.  To do so on
Packit 209cc3
HP-UX 10, you will, apparently, need a late "LAN products cumulative
Packit 209cc3
patch" (at one point, it was claimed that this would be PHNE_18173 for
Packit 209cc3
s700/10.20; at another point, it was claimed that the required patches
Packit 209cc3
were PHNE_20892, PHNE_20725 and PHCO_10947, or newer patches), and to do
Packit 209cc3
so on HP-UX 11 you will, apparently, need the latest lancommon/DLPI
Packit 209cc3
patches and the latest driver patch for the interface(s) in use on HP-UX
Packit 209cc3
11 (at one point, it was claimed that patches PHNE_19766, PHNE_19826,
Packit 209cc3
PHNE_20008, and PHNE_20735 did the trick).
Packit 209cc3
Packit 209cc3
Furthermore, on HP-UX 10, you will need to turn on a kernel switch by
Packit 209cc3
doing
Packit 209cc3
Packit 209cc3
	echo 'lanc_outbound_promisc_flag/W 1' | adb -w /stand/vmunix /dev/mem
Packit 209cc3
Packit 209cc3
You would have to arrange that this happen on reboots; the right way to
Packit 209cc3
do that would probably be to put it into an executable script file
Packit 209cc3
"/sbin/init.d/outbound_promisc" and making
Packit 209cc3
"/sbin/rc2.d/S350outbound_promisc" a symbolic link to that script.
Packit 209cc3
Packit 209cc3
Finally, testing shows that there can't be more than one simultaneous
Packit 209cc3
DLPI user per network interface.
Packit 209cc3
Packit 209cc3
If you use Linux, this version of libpcap is known to compile and run
Packit 209cc3
under Red Hat 4.0 with the 2.0.25 kernel.  It may work with earlier 2.X
Packit 209cc3
versions but is guaranteed not to work with 1.X kernels.  Running more
Packit 209cc3
than one libpcap program at a time, on a system with a 2.0.X kernel, can
Packit 209cc3
cause problems since promiscuous mode is implemented by twiddling the
Packit 209cc3
interface flags from the libpcap application; the packet capture
Packit 209cc3
mechanism in the 2.2 and later kernels doesn't have this problem.  Also,
Packit 209cc3
packet timestamps aren't very good.  This appears to be due to haphazard
Packit 209cc3
handling of the timestamp in the kernel.
Packit 209cc3
Packit 209cc3
Note well: there is rumoured to be a version of tcpdump floating around
Packit 209cc3
called 3.0.3 that includes libpcap and is supposed to support Linux.
Packit 209cc3
You should be advised that neither the Network Research Group at LBNL
Packit 209cc3
nor the Tcpdump Group ever generated a release with this version number.
Packit 209cc3
The LBNL Network Research Group notes with interest that a standard
Packit 209cc3
cracker trick to get people to install trojans is to distribute bogus
Packit 209cc3
packages that have a version number higher than the current release.
Packit 209cc3
They also noted with annoyance that 90% of the Linux related bug reports
Packit 209cc3
they got are due to changes made to unofficial versions of their page.
Packit 209cc3
If you are having trouble but aren't using a version that came from
Packit 209cc3
tcpdump.org, please try that before submitting a bug report!
Packit 209cc3
Packit 209cc3
On Linux, libpcap will not work if the kernel does not have the packet
Packit 209cc3
socket option enabled; see the README.linux file for information about
Packit 209cc3
this.
Packit 209cc3
Packit 209cc3
If you use AIX, you may not be able to build libpcap from this release.
Packit 209cc3
We do not have an AIX system in house so it's impossible for us to test
Packit 209cc3
AIX patches submitted to us.  We are told that you must link against
Packit 209cc3
/lib/pse.exp, that you must use AIX cc or a GNU C compiler newer than
Packit 209cc3
2.7.2, and that you may need to run strload before running a libpcap
Packit 209cc3
application.
Packit 209cc3
Packit 209cc3
Read the README.aix file for information on installing libpcap and
Packit 209cc3
configuring your system to be able to support libpcap.
Packit 209cc3
Packit 209cc3
If you use NeXTSTEP, you will not be able to build libpcap from this
Packit 209cc3
release.
Packit 209cc3
Packit 209cc3
If you use SINIX, you should be able to build libpcap from this
Packit 209cc3
release. It is known to compile and run on SINIX-Y/N 5.42 with the C-DS
Packit 209cc3
V1.0 or V1.1 compiler. But note that in some releases of SINIX, yacc
Packit 209cc3
emits incorrect code; if grammar.y fails to compile, change every
Packit 209cc3
occurence of:
Packit 209cc3
Packit 209cc3
	#ifdef YYDEBUG
Packit 209cc3
Packit 209cc3
to:
Packit 209cc3
	#if YYDEBUG
Packit 209cc3
Packit 209cc3
Another workaround is to use flex and bison.
Packit 209cc3
Packit 209cc3
If you use SCO, you might have trouble building libpcap from this
Packit 209cc3
release. We do not have a machine running SCO and have not had reports
Packit 209cc3
of anyone successfully building on it; the current release of libpcap
Packit 209cc3
does not compile on SCO OpenServer 5.  Although SCO apparently supports
Packit 209cc3
DLPI to some extent, the DLPI in OpenServer 5 is very non-standard, and
Packit 209cc3
it appears that completely new code would need to be written to capture
Packit 209cc3
network traffic.  SCO do not appear to provide tcpdump binaries for
Packit 209cc3
OpenServer 5 or OpenServer 6 as part of SCO Skunkware:
Packit 209cc3
Packit 209cc3
	http://www.sco.com/skunkware/
Packit 209cc3
Packit 209cc3
If you use UnixWare, you might be able to build libpcap from this
Packit 209cc3
release, or you might not.  We do not have a machine running UnixWare,
Packit 209cc3
so we have not tested it; however, SCO provide packages for libpcap
Packit 209cc3
0.6.2 and tcpdump 3.7.1 in the UnixWare 7/Open UNIX 8 part of SCO
Packit 209cc3
Skunkware, and the source package for libpcap 0.6.2 is not changed from
Packit 209cc3
the libpcap 0.6.2 source release, so this release of libpcap might also
Packit 209cc3
build without changes on UnixWare 7.
Packit 209cc3
Packit 209cc3
If linking tcpdump fails with "Undefined: _alloca" when using bison on
Packit 209cc3
a Sun4, your version of Bison is broken. In any case version 1.16 or
Packit 209cc3
higher is recommended (1.14 is known to cause problems 1.16 is known to
Packit 209cc3
work). Either pick up a current version from:
Packit 209cc3
Packit 209cc3
	http://ftp.gnu.org/gnu/bison/
Packit 209cc3
Packit 209cc3
or hack around it by inserting the lines:
Packit 209cc3
Packit 209cc3
	#ifdef __GNUC__
Packit 209cc3
	#define alloca __builtin_alloca
Packit 209cc3
	#else
Packit 209cc3
	#ifdef sparc
Packit 209cc3
	#include <alloca.h>
Packit 209cc3
	#else
Packit 209cc3
	char *alloca ();
Packit 209cc3
	#endif
Packit 209cc3
	#endif
Packit 209cc3
Packit 209cc3
right after the (100 line!) GNU license comment in bison.simple, remove
Packit 209cc3
grammar.[co] and fire up make again.
Packit 209cc3
Packit 209cc3
If you use SunOS 4, your kernel must support streams NIT. If you run a
Packit 209cc3
libpcap program and it dies with:
Packit 209cc3
Packit 209cc3
    /dev/nit: No such device
Packit 209cc3
Packit 209cc3
You must add streams NIT support to your kernel configuration, run
Packit 209cc3
config and boot the new kernel.
Packit 209cc3
Packit 209cc3
FILES
Packit 209cc3
-----
Packit 209cc3
CHANGES		- description of differences between releases
Packit 209cc3
ChmodBPF/*	- macOS startup item to set ownership and permissions
Packit 209cc3
		  on /dev/bpf*
Packit 209cc3
CMakeLists.txt	- CMake file
Packit 209cc3
CONTRIBUTING	- guidelines for contributing
Packit 209cc3
CREDITS		- people that have helped libpcap along
Packit 209cc3
INSTALL.md	- this file
Packit 209cc3
LICENSE		- the license under which tcpdump is distributed
Packit 209cc3
Makefile.in	- compilation rules (input to the configure script)
Packit 209cc3
README.md	- description of distribution
Packit 209cc3
doc/README.aix	- notes on using libpcap on AIX
Packit 209cc3
doc/README.dag	- notes on using libpcap to capture on Endace DAG devices
Packit 209cc3
doc/README.hpux	- notes on using libpcap on HP-UX
Packit 209cc3
doc/README.linux.md - notes on using libpcap on Linux
Packit 209cc3
doc/README.macos	- notes on using libpcap on macOS
Packit 209cc3
doc/README.septel   - notes on using libpcap to capture on Intel/Septel devices
Packit 209cc3
doc/README.sita	- notes on using libpcap to capture on SITA devices
Packit 209cc3
doc/README.tru64	- notes on using libpcap on Digital/Tru64 UNIX
Packit 209cc3
doc/README.Win32	- notes on using libpcap on Win32 systems (with Npcap)
Packit 209cc3
VERSION		- version of this release
Packit 209cc3
acconfig.h	- support for post-2.13 autoconf
Packit 209cc3
aclocal.m4	- autoconf macros
Packit 209cc3
arcnet.h	- ARCNET definitions
Packit 209cc3
atmuni31.h	- ATM Q.2931 definitions
Packit 209cc3
bpf_dump.c	- BPF program printing routines
Packit 209cc3
bpf_filter.c	- BPF filtering routines
Packit 209cc3
bpf_image.c	- BPF disassembly routine
Packit 209cc3
config.guess	- autoconf support
Packit 209cc3
config.h.in	- autoconf input
Packit 209cc3
config.sub	- autoconf support
Packit 209cc3
configure	- configure script (run this first)
Packit 209cc3
configure.ac	- configure script source
Packit 209cc3
dlpisubs.c	- DLPI-related functions for pcap-dlpi.c and pcap-libdlpi.c
Packit 209cc3
dlpisubs.h	- DLPI-related function declarations
Packit 209cc3
etherent.c	- /etc/ethers support routines
Packit 209cc3
ethertype.h	- Ethernet protocol types and names definitions
Packit 209cc3
fad-getad.c	- pcap_findalldevs() for systems with getifaddrs()
Packit 209cc3
fad-gifc.c	- pcap_findalldevs() for systems with only SIOCGIFLIST
Packit 209cc3
fad-glifc.c	- pcap_findalldevs() for systems with SIOCGLIFCONF
Packit 209cc3
filtertest.c	- test program for BPF compiler
Packit 209cc3
findalldevstest.c - test program for pcap_findalldevs()
Packit 209cc3
gencode.c	- BPF code generation routines
Packit 209cc3
gencode.h	- BPF code generation definitions
Packit 209cc3
grammar.y	- filter string grammar
Packit 209cc3
ieee80211.h	- 802.11 definitions
Packit 209cc3
install-sh	- BSD style install script
Packit 209cc3
lbl/os-*.h	- OS-dependent defines and prototypes
Packit 209cc3
llc.h		- 802.2 LLC SAP definitions
Packit 209cc3
missing/*	- replacements for missing library functions
Packit 209cc3
mkdep		- construct Makefile dependency list
Packit 209cc3
msdos/*		- drivers for MS-DOS capture support
Packit 209cc3
nametoaddr.c	- hostname to address routines
Packit 209cc3
nlpid.h		- OSI network layer protocol identifier definitions
Packit 209cc3
net		- symlink to bpf/net
Packit 209cc3
optimize.c	- BPF optimization routines
Packit 209cc3
pcap/bluetooth.h - public definition of DLT_BLUETOOTH_HCI_H4_WITH_PHDR header
Packit 209cc3
pcap/bpf.h	- BPF definitions
Packit 209cc3
pcap/namedb.h	- public libpcap name database definitions
Packit 209cc3
pcap/pcap.h	- public libpcap definitions
Packit 209cc3
pcap/sll.h	- public definition of DLT_LINUX_SLL header
Packit 209cc3
pcap/usb.h	- public definition of DLT_USB header
Packit 209cc3
pcap-bpf.c	- BSD Packet Filter support
Packit 209cc3
pcap-bpf.h	- header for backwards compatibility
Packit 209cc3
pcap-bt-linux.c	- Bluetooth capture support for Linux
Packit 209cc3
pcap-bt-linux.h	- Bluetooth capture support for Linux
Packit 209cc3
pcap-dag.c	- Endace DAG device capture support
Packit 209cc3
pcap-dag.h	- Endace DAG device capture support
Packit 209cc3
pcap-dlpi.c	- Data Link Provider Interface support
Packit 209cc3
pcap-dos.c	- MS-DOS capture support
Packit 209cc3
pcap-dos.h	- headers for MS-DOS capture support
Packit 209cc3
pcap-enet.c	- enet support
Packit 209cc3
pcap-int.h	- internal libpcap definitions
Packit 209cc3
pcap-libdlpi.c	- Data Link Provider Interface support for systems with libdlpi
Packit 209cc3
pcap-linux.c	- Linux packet socket support
Packit 209cc3
pcap-namedb.h	- header for backwards compatibility
Packit 209cc3
pcap-nit.c	- SunOS Network Interface Tap support
Packit 209cc3
pcap-nit.h	- SunOS Network Interface Tap definitions
Packit 209cc3
pcap-npf.c	- WinPcap capture support
Packit 209cc3
pcap-null.c	- dummy monitor support (allows offline use of libpcap)
Packit 209cc3
pcap-pf.c	- Ultrix and Digital/Tru64 UNIX Packet Filter support
Packit 209cc3
pcap-pf.h	- Ultrix and Digital/Tru64 UNIX Packet Filter definitions
Packit 209cc3
pcap-septel.c   - Intel/Septel device capture support
Packit 209cc3
pcap-septel.h   - Intel/Septel device capture support
Packit 209cc3
pcap-sita.c	- SITA device capture support
Packit 209cc3
pcap-sita.h	- SITA device capture support
Packit 209cc3
pcap-sita.html	- SITA device capture documentation
Packit 209cc3
pcap-stdinc.h	- includes and #defines for compiling on Win32 systems
Packit 209cc3
pcap-snit.c	- SunOS 4.x STREAMS-based Network Interface Tap support
Packit 209cc3
pcap-snoop.c	- IRIX Snoop network monitoring support
Packit 209cc3
pcap-usb-linux.c - USB capture support for Linux
Packit 209cc3
pcap-usb-linux.h - USB capture support for Linux
Packit 209cc3
pcap.3pcap	- manual entry for the library
Packit 209cc3
pcap.c		- pcap utility routines
Packit 209cc3
pcap.h		- header for backwards compatibility
Packit 209cc3
pcap_*.3pcap	- manual entries for library functions
Packit 209cc3
pcap-filter.4	- manual entry for filter syntax
Packit 209cc3
pcap-linktype.4	- manual entry for link-layer header types
Packit 209cc3
ppp.h		- Point to Point Protocol definitions
Packit 209cc3
savefile.c	- offline support
Packit 209cc3
scanner.l	- filter string scanner
Packit 209cc3
sunatmpos.h	- definitions for SunATM capturing
Packit 209cc3
Win32		- headers and routines for building on Win32 systems