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