Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
the LIBpcap interface to various kernel packet capture mechanism

This branch is 173 commits behind the-tcpdump-group:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
ChmodBPF To quote
SUNOS4 Initial revision
Win32 remove libpcap's own CVS keywords
bpf/net Support mod and XOR operators.
doc documentation for proposed pcap format
lbl remove libpcap's own CVS keywords
missing remove libpcap's own CVS keywords
msdos remove libpcap's own CVS keywords
packaging Update to handle pcap.h being in /usr/include/pcap.
pcap Add LINKTYPE_IPMI_HPM_2/DLT_IPMI_HPM_2.
tests Allow a DLT number to be specified.
.gitignore update .gitignore for test cases
.travis-coverity-scan-build.sh Coverity: customize the build script
.travis.yml Travis: add OSX support
CHANGES
CREDITS Add support for Bluetooth Linux Monitor interface
INSTALL.txt update flex and GCC text in INSTALL.txt
LICENSE added license file
Makefile-devel-adds The configure script depends on aclocal.m4.
Makefile.in
README remove libpcap's own CVS keywords
README.Win32 Again, we're using Git now.
README.aix update README.aix after GH #52
README.dag Update README.dag to cover the ERF_DONT_STRIP_FCS environment variable.
README.hpux Add to the beginning a note from Rick Jones that 11i (11.11) and later
README.linux Fix typoes, fix tabs (tabs are 8 spaces on UN*Xes - such as Linux).
README.macosx Put in a note about the Snow Leopard bug that requires that you have BPF
README.septel From Gilbert Hoyek <gil_hoyek@hotmail.com>: support for capturing SS7
README.sita The SITA code in pcap-linux.c shares very little with the Linux code;
README.tru64 Pick up the "README.tru64" file from Ethereal, and change it to refer to
TODO Again, we're using Git now.
VERSION updated VERSION file for trunk
aclocal.m4 remove libpcap's own CVS keywords
arcnet.h remove libpcap's own CVS keywords
atmuni31.h remove libpcap's own CVS keywords
bpf_dump.c remove libpcap's own CVS keywords
bpf_image.c Support mod and XOR operators.
chmod_bpf Add a script to change the permissions of /dev/bpf*, and a launchd plist
config.guess Update to autoconf 2.69.
config.h.in Check for HCI_CHANNEL_MONITOR for Linux Bluetooth Monitor support.
config.sub Update to autoconf 2.69.
configure Don't fail if --enable-can wasn't specified and we can't support CAN …
configure.in Don't fail if --enable-can wasn't specified and we can't support CAN …
dlpisubs.c remove libpcap's own CVS keywords
dlpisubs.h remove libpcap's own CVS keywords
etherent.c remove libpcap's own CVS keywords
ethertype.h remove libpcap's own CVS keywords
fad-getad.c Fix/update some comments.
fad-gifc.c Don't exclude interfaces that aren't up.
fad-glifc.c Don't exclude interfaces that aren't up.
fad-null.c remove libpcap's own CVS keywords
fad-sita.c remove libpcap's own CVS keywords
fad-win32.c Pull the code to add an address to an interface into a routine.
gencode.c Don't crash on filters testing a non-existent link-layer type field.
gencode.h Add support for filters testing for 802.2 LLC frame types.
grammar.y Add support for filters testing for 802.2 LLC frame types.
ieee80211.h Support OpenBSD's "addr1", "addr2", "addr3", and "addr4" link-layer
inet.c Only treat *trailing* digits as an instance number.
install-sh Initial revision
llc.h Add support for filters testing for 802.2 LLC frame types.
mkdep Support dependency generation with some non-GCC compilers.
nametoaddr.c remove libpcap's own CVS keywords
nlpid.h remove libpcap's own CVS keywords
optimize.c Support mod and XOR operators.
org.tcpdump.chmod_bpf.plist This is probably the right way to run something once at startup time; it
pcap-bpf.c In activate routines, don't set status unless a warning or error occurs.
pcap-bpf.h remove libpcap's own CVS keywords
pcap-bt-linux.c remove libpcap's own CVS keywords
pcap-bt-linux.h remove libpcap's own CVS keywords
pcap-bt-monitor-linux.c Check for HCI_CHANNEL_MONITOR for Linux Bluetooth Monitor support.
pcap-bt-monitor-linux.h Add support for Bluetooth Linux Monitor interface
pcap-can-linux.c resolve a Clang warning in can_read_linux()
pcap-can-linux.h Have non-interface modules take responsibility for identifying their …
pcap-canusb-linux.c Rename the "private" member of a pcap_t to avoid C++ issues.
pcap-canusb-linux.h added missing ( to pcap-canusb-linux.h
pcap-common.c Add LINKTYPE_IPMI_HPM_2/DLT_IPMI_HPM_2.
pcap-common.h Byte-swap the T and L in TLVs as necessary when reading an NFLOG file.
pcap-config.1 refresh last midification dates for some man pages
pcap-config.in Use config.status to generate pcap-config.
pcap-dag.c remove libpcap's own CVS keywords
pcap-dag.h remove libpcap's own CVS keywords
pcap-dbus.c More findalldevs fixes.
pcap-dbus.h Add a pcap-dbus.h header and include it in pcap-dbus.c and pcap.c.
pcap-dlpi.c In activate routines, don't set status unless a warning or error occurs.
pcap-dos.c remove libpcap's own CVS keywords
pcap-dos.h remove libpcap's own CVS keywords
pcap-enet.c remove libpcap's own CVS keywords
pcap-filter.manmisc.in Add support for filters testing for 802.2 LLC frame types.
pcap-int.h Expand a comment (extra information taken from tcpdump's equivalent c…
pcap-libdlpi.c In activate routines, don't set status unless a warning or error occurs.
pcap-linktype.manmisc.in refresh last midification dates for some man pages
pcap-linux.c Fix copy-and-pasteos.
pcap-namedb.h remove libpcap's own CVS keywords
pcap-netfilter-linux.c Make the code to set the type a bit clearer.
pcap-netfilter-linux.h Add netfilter/nfqueue interface.
pcap-nit.c remove libpcap's own CVS keywords
pcap-null.c
pcap-pf.c remove libpcap's own CVS keywords
pcap-savefile.manfile.in refresh last midification dates for some man pages
pcap-septel.c Return the value of pcap_add_if() from septel_findalldevs().
pcap-septel.h remove libpcap's own CVS keywords
pcap-sita.c remove libpcap's own CVS keywords
pcap-sita.h remove libpcap's own CVS keywords
pcap-sita.html Again, Git, not CVS.
pcap-snf.c Add a PACKET_COUNT_IS_UNLIMITED() to test for a packet count <= 0.
pcap-snf.h Have non-interface modules take responsibility for identifying their …
pcap-snit.c remove libpcap's own CVS keywords
pcap-snoop.c remove libpcap's own CVS keywords
pcap-stdinc.h Update pcap-stdinc.h
pcap-tstamp.manmisc.in refresh last midification dates for some man pages
pcap-usb-linux.c Check for MON_IOCH_MFLUSH failing.
pcap-usb-linux.h remove libpcap's own CVS keywords
pcap-win32.c Fix for static-lib use
pcap.3pcap.in last modification date
pcap.c Don't treat 65535 as the maximum snapshot length.
pcap.h remove libpcap's own CVS keywords
pcap1.h remove libpcap's own CVS keywords
pcap_activate.3pcap refresh last midification dates for some man pages
pcap_breakloop.3pcap remove libpcap's own CVS keywords
pcap_can_set_rfmon.3pcap remove libpcap's own CVS keywords
pcap_close.3pcap remove libpcap's own CVS keywords
pcap_compile.3pcap.in refresh last midification dates for some man pages
pcap_create.3pcap remove libpcap's own CVS keywords
pcap_datalink.3pcap.in refresh last midification dates for some man pages
pcap_datalink_name_to_val.3pcap remove libpcap's own CVS keywords
pcap_datalink_val_to_name.3pcap remove libpcap's own CVS keywords
pcap_dump.3pcap remove libpcap's own CVS keywords
pcap_dump_close.3pcap remove libpcap's own CVS keywords
pcap_dump_file.3pcap remove libpcap's own CVS keywords
pcap_dump_flush.3pcap remove libpcap's own CVS keywords
pcap_dump_ftell.3pcap remove libpcap's own CVS keywords
pcap_dump_open.3pcap.in remove libpcap's own CVS keywords
pcap_file.3pcap remove libpcap's own CVS keywords
pcap_fileno.3pcap refresh last midification dates for some man pages
pcap_findalldevs.3pcap refresh last midification dates for some man pages
pcap_freecode.3pcap remove libpcap's own CVS keywords
pcap_get_selectable_fd.3pcap refresh last midification dates for some man pages
pcap_get_tstamp_precision.3pcap.in Formatting tweak.
pcap_geterr.3pcap remove libpcap's own CVS keywords
pcap_inject.3pcap remove libpcap's own CVS keywords
pcap_is_swapped.3pcap refresh last midification dates for some man pages
pcap_lib_version.3pcap remove libpcap's own CVS keywords
pcap_list_datalinks.3pcap.in refresh last midification dates for some man pages
pcap_list_tstamp_types.3pcap.in Add support for setting the time stamp type for a capture.
pcap_lookupdev.3pcap remove libpcap's own CVS keywords
pcap_lookupnet.3pcap remove libpcap's own CVS keywords
pcap_loop.3pcap refresh last midification dates for some man pages
pcap_major_version.3pcap refresh last midification dates for some man pages
pcap_next_ex.3pcap refresh last midification dates for some man pages
pcap_offline_filter.3pcap refresh last midification dates for some man pages
pcap_open_dead.3pcap.in remove libpcap's own CVS keywords
pcap_open_live.3pcap remove libpcap's own CVS keywords
pcap_open_offline.3pcap.in remove libpcap's own CVS keywords
pcap_set_buffer_size.3pcap remove libpcap's own CVS keywords
pcap_set_datalink.3pcap remove libpcap's own CVS keywords
pcap_set_immediate_mode.3pcap Fix typo in pcap_set_immediate_mode manpage
pcap_set_promisc.3pcap remove libpcap's own CVS keywords
pcap_set_rfmon.3pcap remove libpcap's own CVS keywords
pcap_set_snaplen.3pcap remove libpcap's own CVS keywords
pcap_set_timeout.3pcap last modification date
pcap_set_tstamp_precision.3pcap.in man: add documentation for pcap_set_tstamp_precision
pcap_set_tstamp_type.3pcap.in If the specified time stamp type isn't supported, treat that as a war…
pcap_setdirection.3pcap remove libpcap's own CVS keywords
pcap_setfilter.3pcap refresh last midification dates for some man pages
pcap_setnonblock.3pcap remove libpcap's own CVS keywords
pcap_snapshot.3pcap refresh last midification dates for some man pages
pcap_stats.3pcap remove libpcap's own CVS keywords
pcap_statustostr.3pcap remove libpcap's own CVS keywords
pcap_strerror.3pcap remove libpcap's own CVS keywords
pcap_tstamp_type_name_to_val.3pcap Add support for setting the time stamp type for a capture.
pcap_tstamp_type_val_to_name.3pcap tweak manpages formatting
ppp.h remove libpcap's own CVS keywords
runlex.sh remove libpcap's own CVS keywords
savefile.c remove libpcap's own CVS keywords
scanner.l
sf-pcap-ng.c Fix the case where the requested resolution is higher than the iface …
sf-pcap-ng.h Replace the _nsectime routines with _with_tstamp_precision routines.
sf-pcap.c Don't treat 65535 as the maximum snapshot length.
sf-pcap.h Replace the _nsectime routines with _with_tstamp_precision routines.
sunatmpos.h remove libpcap's own CVS keywords

README

LIBPCAP 1.x.y

www.tcpdump.org

Please send inquiries/comments/reports to:
	tcpdump-workers@lists.tcpdump.org

Anonymous Git is available via:
	git clone git://bpf.tcpdump.org/libpcap

Please submit patches by forking the branch on GitHub at

	http://github.com/the-tcpdump-group/libpcap/tree/master

and issuing a pull request.

formerly from 	Lawrence Berkeley National Laboratory
		Network Research Group <libpcap@ee.lbl.gov>
		ftp://ftp.ee.lbl.gov/old/libpcap-0.4a7.tar.Z

This directory contains source code for libpcap, a system-independent
interface for user-level packet capture.  libpcap provides a portable
framework for low-level network monitoring.  Applications include
network statistics collection, security monitoring, network debugging,
etc.  Since almost every system vendor provides a different interface
for packet capture, and since we've developed several tools that
require this functionality, we've created this system-independent API
to ease in porting and to alleviate the need for several
system-dependent packet capture modules in each application.

For some platforms there are README.{system} files that discuss issues
with the OS's interface for packet capture on those platforms, such as
how to enable support for that interface in the OS, if it's not built in
by default.

The libpcap interface supports a filtering mechanism based on the
architecture in the BSD packet filter.  BPF is described in the 1993
Winter Usenix paper ``The BSD Packet Filter: A New Architecture for
User-level Packet Capture''.  A compressed PostScript version can be
found at

	ftp://ftp.ee.lbl.gov/papers/bpf-usenix93.ps.Z

or

	http://www.tcpdump.org/papers/bpf-usenix93.ps.Z

and a gzipped version can be found at

	http://www.tcpdump.org/papers/bpf-usenix93.ps.gz

A PDF version can be found at

	http://www.tcpdump.org/papers/bpf-usenix93.pdf

Although most packet capture interfaces support in-kernel filtering,
libpcap utilizes in-kernel filtering only for the BPF interface.
On systems that don't have BPF, all packets are read into user-space
and the BPF filters are evaluated in the libpcap library, incurring
added overhead (especially, for selective filters).  Ideally, libpcap
would translate BPF filters into a filter program that is compatible
with the underlying kernel subsystem, but this is not yet implemented.

BPF is standard in 4.4BSD, BSD/OS, NetBSD, FreeBSD, OpenBSD, DragonFly
BSD, and Mac OS X; an older, modified and undocumented version is
standard in AIX.  {DEC OSF/1, Digital UNIX, Tru64 UNIX} uses the
packetfilter interface but has been extended to accept BPF filters
(which libpcap utilizes).  Also, you can add BPF filter support to
Ultrix using the kernel source and/or object patches available in:

	http://www.tcpdump.org/other/bpfext42.tar.Z

Linux, in the 2.2 kernel and later kernels, has a "Socket Filter"
mechanism that accepts BPF filters; see the README.linux file for
information on configuring that option.

Note to Linux distributions and *BSD systems that include libpcap:

There's now a rule to make a shared library, which should work on Linux 
and *BSD, among other platforms.

It sets the soname of the library to "libpcap.so.1"; this is what it 
should be, *NOT* libpcap.so.1.x or libpcap.so.1.x.y or something such as 
that.

We've been maintaining binary compatibility between libpcap releases for 
quite a while; there's no reason to tie a binary linked with libpcap to 
a particular release of libpcap.

Problems, bugs, questions, desirable enhancements, etc. should be sent
to the address "tcpdump-workers@lists.tcpdump.org".  Bugs, support
requests, and feature requests may also be submitted on the GitHub issue
tracker for libpcap at

	https://github.com/the-tcpdump-group/libpcap/issues

Source code contributions, etc. should be sent to the email address
above or submitted by forking the branch on GitHub at

	http://github.com/the-tcpdump-group/libpcap/tree/master

and issuing a pull request.

Current versions can be found at www.tcpdump.org.

 - The TCPdump team
Something went wrong with that request. Please try again.