1 # libpcap installation notes
2 To build libpcap, run `./configure` (a shell script). The configure
3 script will determine your system attributes and generate an
4 appropriate `Makefile` from `Makefile.in`. Next run `make`. If everything
5 goes well, you can `su` to root and run `make install`. However, you need
6 not install libpcap if you just want to build tcpdump; just make sure
7 the tcpdump and libpcap directory trees have the same parent
12 configure: warning: cannot determine packet capture interface
13 configure: warning: (see INSTALL for more info)
15 then your system either does not support packet capture or your system
16 does support packet capture but libpcap does not support that
17 particular type. (If you have HP-UX, see below.) If your system uses a
18 packet capture not supported by libpcap, please send us patches; don't
19 forget to include an autoconf fragment suitable for use in
22 It is possible to override the default packet capture type, although
23 the circumstances where this works are limited. One possible reason to
24 do that would be to force a supported packet capture type in the case
25 where the configure scripts fails to detect it.
27 You will need a C99 compiler to build libpcap. The configure script
28 will abort if your compiler is not C99 compliant. If this happens, use
29 the generally available GNU C compiler (GCC) or Clang.
31 You will need either Flex 2.5.31 or later, or a version of Lex
32 compatible with it (if any exist), to build libpcap. The configure
33 script will abort if there isn't any such program. If you have an older
34 version of Flex, or don't have a compatible version of Lex, the current
35 version of Flex is available [here](https://github.com/westes/flex).
37 You will need either Bison, Berkeley YACC, or a version of YACC
38 compatible with them (if any exist), to build libpcap. The configure
39 script will abort if there isn't any such program. If you don't have
40 any such program, the current version of Bison can be found
41 [here](https://ftp.gnu.org/gnu/bison/) and the current version of Berkeley YACC
42 can be found [here](https://invisible-island.net/byacc/).
44 Sometimes the stock C compiler does not interact well with Flex and
45 Bison. The list of problems includes undefined references for alloca(3).
46 You can get around this by installing GCC.
49 On Linux, libpcap will not work if the kernel does not have the packet
50 socket option enabled; see [this file](doc/README.linux) for more
54 If you use the SPARCompiler, you must be careful to not use the
55 `/usr/ucb/cc` interface. If you do, you will get bogus warnings and
56 perhaps errors. Either make sure your path has `/opt/SUNWspro/bin`
57 before `/usr/ucb` or else:
59 setenv CC /opt/SUNWspro/bin/cc
61 before running configure. (You might have to do a `make distclean`
62 if you already ran `configure` once).
64 See [this file](doc/README.solaris.md) for more up to date
65 Solaris-related information.
68 If you use HP-UX, you must have at least version 9 and either the
69 version of `cc` that supports C99 (`cc -AC99`) or else use the GNU C
70 compiler. You must also buy the optional streams package. If you don't
73 /usr/include/sys/dlpi.h
74 /usr/include/sys/dlpi_ext.h
76 then you don't have the streams package. In addition, we believe you
77 need to install the "9.X LAN and DLPI drivers cumulative" patch
78 (PHNE_6855) to make the version 9 DLPI work with libpcap.
80 The DLPI streams package is standard starting with HP-UX 10.
82 The HP implementation of DLPI is a little bit eccentric. Unlike
83 Solaris, you must attach `/dev/dlpi` instead of the specific `/dev/*`
84 network pseudo device entry in order to capture packets. The PPA is
85 based on the ifnet "index" number. Under HP-UX 9, it is necessary to
86 read `/dev/kmem` and the kernel symbol file (`/hp-ux`). Under HP-UX 10,
87 DLPI can provide information for determining the PPA. It does not seem
88 to be possible to trace the loopback interface. Unlike other DLPI
89 implementations, PHYS implies MULTI and SAP and you get an error if you
90 try to enable more than one promiscuous mode at a time.
92 It is impossible to capture outbound packets on HP-UX 9. To do so on
93 HP-UX 10, you will, apparently, need a late "LAN products cumulative
94 patch" (at one point, it was claimed that this would be PHNE_18173 for
95 s700/10.20; at another point, it was claimed that the required patches
96 were PHNE_20892, PHNE_20725 and PHCO_10947, or newer patches), and to do
97 so on HP-UX 11 you will, apparently, need the latest lancommon/DLPI
98 patches and the latest driver patch for the interface(s) in use on HP-UX
99 11 (at one point, it was claimed that patches PHNE_19766, PHNE_19826,
100 PHNE_20008, and PHNE_20735 did the trick).
102 Furthermore, on HP-UX 10, you will need to turn on a kernel switch by
105 echo 'lanc_outbound_promisc_flag/W 1' | adb -w /stand/vmunix /dev/mem
107 You would have to arrange that this happens on reboots; the right way to
108 do that would probably be to put it into an executable script file
109 `/sbin/init.d/outbound_promisc` and making
110 `/sbin/rc2.d/S350outbound_promisc` a symbolic link to that script.
112 Finally, testing shows that there can't be more than one simultaneous
113 DLPI user per network interface.
115 See [this file](doc/README.hpux) for more information specific to HP-UX.
118 See [this file](doc/README.aix) for information on installing libpcap and
119 configuring your system to be able to support libpcap.
122 If you are trying to do packet capture with a FORE ATM card, you may or
123 may not be able to. They usually only release their driver in object
124 code so unless their driver supports packet capture, there's not much
127 If you get an error like:
129 tcpdump: recv_ack: bind error 0x???
131 when using DLPI, look for the DL_ERROR_ACK error return values, usually
132 in `/usr/include/sys/dlpi.h`, and find the corresponding value.
134 ## Description of files
135 CHANGES - description of differences between releases
136 ChmodBPF/* - macOS startup item to set ownership and permissions on /dev/bpf*
137 CMakeLists.txt - CMake file
138 CONTRIBUTING.md - guidelines for contributing
139 CREDITS - people that have helped libpcap along
140 INSTALL.md - this file
141 LICENSE - the license under which tcpdump is distributed
142 Makefile.in - compilation rules (input to the configure script)
143 README.md - description of distribution
144 doc/README.aix - notes on using libpcap on AIX
145 doc/README.dag - notes on using libpcap to capture on Endace DAG devices
146 doc/README.hpux - notes on using libpcap on HP-UX
147 doc/README.linux - notes on using libpcap on Linux
148 doc/README.macos - notes on using libpcap on macOS
149 doc/README.septel - notes on using libpcap to capture on Intel/Septel devices
150 doc/README.sita - notes on using libpcap to capture on SITA devices
151 doc/README.solaris.md - notes on using libpcap on Solaris
152 doc/README.Win32.md - notes on using libpcap on Win32 systems (with Npcap)
153 VERSION - version of this release
154 aclocal.m4 - autoconf macros
155 arcnet.h - ARCNET definitions
156 atmuni31.h - ATM Q.2931 definitions
157 bpf_dump.c - BPF program printing routines
158 bpf_filter.c - BPF filtering routines
159 bpf_image.c - BPF disassembly routine
160 config.guess - autoconf support
161 config.h.in - autoconf input
162 config.sub - autoconf support
163 configure - configure script (run this first)
164 configure.ac - configure script source
165 dlpisubs.c - DLPI-related functions for pcap-dlpi.c and pcap-libdlpi.c
166 dlpisubs.h - DLPI-related function declarations
167 etherent.c - /etc/ethers support routines
168 ethertype.h - Ethernet protocol types and names definitions
169 fad-getad.c - pcap_findalldevs() for systems with getifaddrs()
170 fad-gifc.c - pcap_findalldevs() for systems with only SIOCGIFLIST
171 fad-glifc.c - pcap_findalldevs() for systems with SIOCGLIFCONF
172 testprogs/filtertest.c - test program for BPF compiler
173 testprogs/findalldevstest.c - test program for pcap_findalldevs()
174 gencode.c - BPF code generation routines
175 gencode.h - BPF code generation definitions
176 grammar.y - filter string grammar
177 ieee80211.h - 802.11 definitions
178 install-sh - BSD style install script
179 lbl/os-*.h - OS-dependent defines and prototypes
180 llc.h - 802.2 LLC SAP definitions
181 missing/* - replacements for missing library functions
182 mkdep - construct Makefile dependency list
183 msdos/* - drivers for MS-DOS capture support
184 nametoaddr.c - hostname to address routines
185 nlpid.h - OSI network layer protocol identifier definitions
186 optimize.c - BPF optimization routines
187 pcap/bluetooth.h - public definition of DLT_BLUETOOTH_HCI_H4_WITH_PHDR header
188 pcap/bpf.h - BPF definitions
189 pcap/namedb.h - public libpcap name database definitions
190 pcap/pcap.h - public libpcap definitions
191 pcap/sll.h - public definitions of DLT_LINUX_SLL and DLT_LINUX_SLL2 headers
192 pcap/usb.h - public definition of DLT_USB header
193 pcap-bpf.c - BSD Packet Filter support
194 pcap-bpf.h - header for backwards compatibility
195 pcap-bt-linux.c - Bluetooth capture support for Linux
196 pcap-bt-linux.h - Bluetooth capture support for Linux
197 pcap-dag.c - Endace DAG device capture support
198 pcap-dag.h - Endace DAG device capture support
199 pcap-dlpi.c - Data Link Provider Interface support
200 pcap-dos.c - MS-DOS capture support
201 pcap-dos.h - headers for MS-DOS capture support
202 pcap-enet.c - enet support
203 pcap-int.h - internal libpcap definitions
204 pcap-libdlpi.c - Data Link Provider Interface support for systems with libdlpi
205 pcap-linux.c - Linux packet socket support
206 pcap-namedb.h - header for backwards compatibility
207 pcap-nit.c - SunOS Network Interface Tap support
208 pcap-npf.c - Npcap capture support
209 pcap-null.c - dummy monitor support (allows offline use of libpcap)
210 pcap-pf.c - Ultrix and Digital/Tru64 UNIX Packet Filter support
211 pcap-septel.c - Intel/Septel device capture support
212 pcap-septel.h - Intel/Septel device capture support
213 pcap-sita.c - SITA device capture support
214 pcap-sita.h - SITA device capture support
215 pcap-sita.html - SITA device capture documentation
216 pcap-snit.c - SunOS 4.x STREAMS-based Network Interface Tap support
217 pcap-snoop.c - IRIX Snoop network monitoring support
218 pcap-usb-linux.c - USB capture support for Linux
219 pcap-usb-linux.h - USB capture support for Linux
220 pcap.3pcap - manual entry for the library
221 pcap.c - pcap utility routines
222 pcap.h - header for backwards compatibility
223 pcap_*.3pcap - manual entries for library functions
224 pcap-filter.manmisc.in - manual entry for filter syntax
225 pcap-linktype.manmisc.in - manual entry for link-layer header types
226 ppp.h - Point to Point Protocol definitions
227 savefile.c - offline support
228 scanner.l - filter string scanner
229 sunatmpos.h - definitions for SunATM capturing