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