Home | History | Annotate | Line # | Download | only in dist
      1  1.1.1.2  christos # LIBPCAP 1.x.y by [The Tcpdump Group](https://www.tcpdump.org)
      2      1.1  christos 
      3  1.1.1.2  christos **To report a security issue please send an e-mail to security (a] tcpdump.org.**
      4      1.1  christos 
      5  1.1.1.2  christos To report bugs and other problems, contribute patches, request a
      6  1.1.1.2  christos feature, provide generic feedback etc please see the
      7  1.1.1.2  christos [guidelines for contributing](CONTRIBUTING.md).
      8      1.1  christos 
      9  1.1.1.2  christos The [documentation directory](doc/) has README files about specific
     10  1.1.1.2  christos operating systems and options.
     11      1.1  christos 
     12      1.1  christos Anonymous Git is available via:
     13      1.1  christos 
     14  1.1.1.2  christos   https://github.com/the-tcpdump-group/libpcap.git
     15      1.1  christos 
     16      1.1  christos This directory contains source code for libpcap, a system-independent
     17      1.1  christos interface for user-level packet capture.  libpcap provides a portable
     18      1.1  christos framework for low-level network monitoring.  Applications include
     19      1.1  christos network statistics collection, security monitoring, network debugging,
     20      1.1  christos etc.  Since almost every system vendor provides a different interface
     21      1.1  christos for packet capture, and since we've developed several tools that
     22      1.1  christos require this functionality, we've created this system-independent API
     23      1.1  christos to ease in porting and to alleviate the need for several
     24      1.1  christos system-dependent packet capture modules in each application.
     25      1.1  christos 
     26  1.1.1.2  christos ```text
     27  1.1.1.2  christos formerly from	Lawrence Berkeley National Laboratory
     28  1.1.1.2  christos 		Network Research Group <libpcap (a] ee.lbl.gov>
     29  1.1.1.2  christos 		ftp://ftp.ee.lbl.gov/old/libpcap-0.4a7.tar.Z
     30  1.1.1.2  christos ```
     31  1.1.1.2  christos 
     32  1.1.1.2  christos ### Support for particular platforms and BPF
     33  1.1.1.2  christos For some platforms there are `README.{system}` files that discuss issues
     34      1.1  christos with the OS's interface for packet capture on those platforms, such as
     35      1.1  christos how to enable support for that interface in the OS, if it's not built in
     36      1.1  christos by default.
     37      1.1  christos 
     38      1.1  christos The libpcap interface supports a filtering mechanism based on the
     39      1.1  christos architecture in the BSD packet filter.  BPF is described in the 1993
     40      1.1  christos Winter Usenix paper ``The BSD Packet Filter: A New Architecture for
     41  1.1.1.2  christos User-level Packet Capture''
     42  1.1.1.2  christos ([compressed PostScript](https://www.tcpdump.org/papers/bpf-usenix93.ps.Z),
     43  1.1.1.2  christos [gzipped PostScript](https://www.tcpdump.org/papers/bpf-usenix93.ps.gz),
     44  1.1.1.2  christos [PDF](https://www.tcpdump.org/papers/bpf-usenix93.pdf)).
     45      1.1  christos 
     46      1.1  christos Although most packet capture interfaces support in-kernel filtering,
     47      1.1  christos libpcap utilizes in-kernel filtering only for the BPF interface.
     48      1.1  christos On systems that don't have BPF, all packets are read into user-space
     49      1.1  christos and the BPF filters are evaluated in the libpcap library, incurring
     50      1.1  christos added overhead (especially, for selective filters).  Ideally, libpcap
     51      1.1  christos would translate BPF filters into a filter program that is compatible
     52      1.1  christos with the underlying kernel subsystem, but this is not yet implemented.
     53      1.1  christos 
     54      1.1  christos BPF is standard in 4.4BSD, BSD/OS, NetBSD, FreeBSD, OpenBSD, DragonFly
     55  1.1.1.2  christos BSD, macOS, and Solaris 11; an older, modified and undocumented version
     56  1.1.1.2  christos is standard in AIX.  {DEC OSF/1, Digital UNIX, Tru64 UNIX} uses the
     57  1.1.1.2  christos packetfilter interface but has been extended to accept BPF filters
     58  1.1.1.2  christos (which libpcap utilizes).
     59      1.1  christos 
     60      1.1  christos Linux has a number of BPF based systems, and libpcap does not support
     61      1.1  christos any of the eBPF mechanisms as yet, although it supports many of the
     62      1.1  christos memory mapped receive mechanisms.
     63  1.1.1.2  christos See the [Linux-specific README](doc/README.linux) for more information.
     64      1.1  christos 
     65  1.1.1.2  christos ### Note to Linux distributions and *BSD systems that include libpcap:
     66      1.1  christos 
     67      1.1  christos There's now a rule to make a shared library, which should work on Linux
     68      1.1  christos and *BSD, among other platforms.
     69      1.1  christos 
     70  1.1.1.2  christos It sets the soname of the library to `libpcap.so.1`; this is what it
     71  1.1.1.2  christos should be, **NOT** `libpcap.so.1.x` or `libpcap.so.1.x.y` or something such as
     72      1.1  christos that.
     73      1.1  christos 
     74      1.1  christos We've been maintaining binary compatibility between libpcap releases for
     75      1.1  christos quite a while; there's no reason to tie a binary linked with libpcap to
     76      1.1  christos a particular release of libpcap.
     77