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