1
0
Fork 0
mirror of https://github.com/the-tcpdump-group/libpcap.git synced 2026-12-03 14:04:49 +00:00
the LIBpcap interface to various kernel packet capture mechanism
  • C 59.1%
  • Perl 26.4%
  • Roff 5.1%
  • CMake 4.1%
  • M4 2.2%
  • Other 3.1%
Find a file
Denis Ovsienko ed9ba26cc0 Zero-initialise a buffer in pcap_nametonetaddr().
OSS-Fuzz issue 42501981 has randomly reproduced a few times.  Although
the root cause seems to be in either Clang MemorySanitizer or glibc NSS,
this generates unnecessary noise, so let's see if the initialisation is
sufficient to avoid it.
2026-12-03 13:58:28 +00:00
.github/ISSUE_TEMPLATE Update the GitHub issue template 2025-05-14 09:51:48 +02:00
ChmodBPF To quote 2009-09-09 16:50:36 -07:00
cmake dpdk: remove capture backend 2026-07-21 19:35:15 +01:00
doc doc: Update Solaris-like OS particulars. [skip ci] 2026-11-23 21:14:19 +00:00
missing Add a comment to missing/asprintf.c. [skip ci] 2026-10-25 15:16:40 +00:00
pcap Add LINKTYPE_ETW2/DLT_ETW2. 2026-11-10 15:19:26 +00:00
rpcapd Factor portability-exec.h out. 2026-11-26 13:24:34 +00:00
testprogs TESTrun: Use prototypes for all Perl subroutines. 2026-11-28 14:36:22 +00:00
tests TESTrun: Test "protochain" using two layers of AH. 2026-10-25 15:16:40 +00:00
.appveyor.yml AppVeyor: Update the remote capture build configuration 2026-03-01 16:12:10 +00:00
.ci-coverity-scan-build.sh .ci-coverity-scan-build.sh: Fix two shellcheck notes 2023-12-03 17:57:31 +01:00
.gitattributes add a GitHub issue template 2017-03-06 11:49:32 +00:00
.gitignore Refine the .gitignore files. 2026-08-09 14:22:20 +01:00
.mailmap Add more entries to .mailmap. [skip ci] 2020-09-08 16:01:40 +01:00
aclocal.m4 Autoconf: Add QNX support to AC_LBL_LIBRARY_NET(). 2026-01-19 17:45:50 +00:00
autogen.sh In autogen.sh use mktemp(1) if available. 2026-10-21 15:01:53 +01:00
bpf_dump.c Include <config.h> unconditionally 2024-03-27 22:27:49 +00:00
bpf_filter.c Extend arity guard macros onto most BPF opcodes. 2026-11-27 09:54:43 +00:00
bpf_image.c Extend arity guard macros onto most BPF opcodes. 2026-11-27 09:54:43 +00:00
bpf_opcodes.h Extend arity guard macros onto most BPF opcodes. 2026-11-27 09:54:43 +00:00
build.sh CI: Do not fail to fail if CC cannot be used. 2026-11-26 13:24:34 +00:00
build_common.sh CI: Refine the Solaris-like case in mktempdir(). 2026-10-15 18:39:03 +01:00
build_matrix.sh CI: Add a message when using Valgrind 2026-03-10 19:46:55 +01:00
cbpf-savefile.manfile.in cbpf-savefile(5): Bump MinorVer up. [skip ci] 2026-07-14 16:05:25 +01:00
CHANGES Start libpcap 1.11.2-PRE-GIT. [skip ci] 2026-11-24 15:23:42 +00:00
charconv.c Fix some typos 2023-10-18 15:01:02 +02:00
charconv.h Refine the #ifndef guard in charconv.h. [skip ci] 2021-08-10 13:49:21 +01:00
chmod_bpf Update to reflect the name change for Apple's UNIX-for-Macs. 2018-01-08 19:23:28 -08:00
cmake_uninstall.cmake.in Support "make uninstall" for CMake. 2017-09-28 11:21:11 -07:00
cmakeconfig.h.in Test for <sysexits.h> instead of specific OSes. 2026-10-14 11:08:59 +01:00
CMakeLists.txt Test for <sysexits.h> instead of specific OSes. 2026-10-14 11:08:59 +01:00
config.guess Autoconf: Update config.{guess,sub}, timestamps 2025-07-10 2026-04-26 18:30:05 +00:00
config.sub Autoconf: Update config.{guess,sub}, timestamps 2025-07-10 2026-04-26 18:30:05 +00:00
configure.ac Give more information about missing crypt() devel library 2026-11-24 07:59:54 +00:00
CONTRIBUTING.md Mention the filter tests in CONTRIBUTING.md. [skip ci] 2025-03-17 18:00:41 +00:00
CREDITS List all recent contributors in CREDITS. [skip ci] 2026-11-22 20:51:50 +00:00
diag-control.h In pcapint_validate_filter() take an unsigned length. 2026-09-19 10:40:44 +01:00
dlpisubs.c CVE-2026-31912: Mind the program bounds in pcap_offline_filter(). 2026-09-05 10:03:46 +01:00
dlpisubs.h Include config.h in internal headers that use it. 2026-10-22 10:07:20 +01:00
etherent.c Remove all instances of the "register" specifier. 2025-10-05 11:34:42 +01:00
ethertype.h Remove some ETHERTYPE_* definitions 2025-09-16 18:26:35 +02:00
extract.h Fix spelling 2023-06-25 17:15:12 +00:00
fad-getad.c Both AF_INET and AF_INET6 are mandatory. 2026-02-24 12:26:17 +00:00
fad-gifc.c Use calloc(3) a little bit more. 2025-11-01 13:36:00 +00:00
fad-glifc.c Use calloc(3) a little bit more. 2025-11-01 13:36:00 +00:00
fmtutils.c Fix a copy-and-pasteo in utf_16le_to_utf_8_truncated(). 2025-09-07 14:46:31 -07:00
fmtutils.h More pcap_ to pcapint_ for non-API routines. 2023-11-08 23:26:22 -08:00
ftmacros.h Avoid redefining _GNU_SOURCE. [skip appveyor] 2024-09-30 11:00:54 +01:00
gencode.c Extend arity guard macros onto most BPF opcodes. 2026-11-27 09:54:43 +00:00
gencode.h Factor BPF undefined behaviour guard macros out. 2026-10-17 12:27:32 +01:00
grammar.y.in In "net <n> mask <m>" catch ENOMEM for the "m" too. 2026-02-21 15:49:55 +00:00
ieee80211.h Remove a few arrays from ieee80211.h. [skip ci] 2025-08-16 13:28:53 +01:00
install-sh Update install-sh script to the latest available version 2023-05-31 08:45:31 +01:00
INSTALL.md Extend arity guard macros onto most BPF opcodes. 2026-11-27 09:54:43 +00:00
instrument-functions.c instrument functions: Work around bfd inclusion guard [skip ci] 2026-09-11 19:09:20 +01:00
libpcap.pc.in autoconf, cmake: fix generated pcap-config and libpcap.pc. 2022-09-27 21:17:27 -07:00
LICENSE Delete trailing spaces/tabs 2015-03-08 21:39:43 +01:00
llc.h Add support for filters testing for 802.2 LLC frame types. 2014-05-19 20:53:58 -07:00
Makefile-devel-adds Use LANG=C to run some Perl scripts. [skip appveyor] 2026-10-19 17:30:32 +01:00
Makefile.in Extend arity guard macros onto most BPF opcodes. 2026-11-27 09:54:43 +00:00
mkdep mkdep: Propagate compiler errors. 2026-10-15 18:55:40 +01:00
nametoaddr.c Zero-initialise a buffer in pcap_nametonetaddr(). 2026-12-03 13:58:28 +00:00
nametoaddr.h Separate DECnet and IPv4 code paths better. 2026-01-14 21:11:10 +00:00
no_sanitize.h Suppress sanitizer warnings for unsigned left shifts. 2026-09-02 14:31:25 +01:00
nomkdep Fix "make depend" in rpcapd if we can't generate dependencies. 2017-11-25 01:00:46 -08:00
optimize.c Extend arity guard macros onto most BPF opcodes. 2026-11-27 09:54:43 +00:00
optimize.h Have separate flags for "optimizer debug" and "print DOT graph". 2018-05-03 01:39:39 -07:00
org.tcpdump.chmod_bpf.plist Use more HTTPS in URLs 2020-01-19 09:33:18 +01:00
pcap-bpf.c Extend arity guard macros onto most BPF opcodes. 2026-11-27 09:54:43 +00:00
pcap-bpf.h Delete trailing spaces/tabs 2015-03-08 21:39:43 +01:00
pcap-bt-linux.c Indicate no-capture and no-inject devices. 2026-09-30 09:40:17 +01:00
pcap-bt-linux.h Have a pcap_if_list_t structure for use by the findalldevs code. 2017-01-18 13:36:27 -08:00
pcap-bt-monitor-linux.c Indicate no-capture and no-inject devices. 2026-09-30 09:40:17 +01:00
pcap-bt-monitor-linux.h Have a pcap_if_list_t structure for use by the findalldevs code. 2017-01-18 13:36:27 -08:00
pcap-common.c Add LINKTYPE_ETW2/DLT_ETW2. 2026-11-10 15:19:26 +00:00
pcap-common.h rpcap: have the server tell the client its byte order. 2022-08-06 04:00:43 -07:00
pcap-config.1 pcap-config(1): Document --version a bit better. [skip ci] 2024-12-22 13:37:53 +00:00
pcap-config.in Document pcap-config better and test it. [skip ci] 2023-02-18 23:01:45 +00:00
pcap-dag.c Indicate no-capture and no-inject devices. 2026-09-30 09:40:17 +01:00
pcap-dag.h DAG: Fix a typo in pcap-dag.h. [skip ci] 2024-11-10 20:35:09 +00:00
pcap-dbus.c CVE-2026-31912: Mind the program bounds in pcap_offline_filter(). 2026-09-05 10:03:46 +01:00
pcap-dbus.h Have a pcap_if_list_t structure for use by the findalldevs code. 2017-01-18 13:36:27 -08:00
pcap-dll.rc Use correct strings for DLL VersionInfo 2021-10-27 15:55:26 -05:00
pcap-dlpi.c dlpi: fix an unused variable error 2026-04-27 09:45:29 -07:00
pcap-filter.manmisc.in pcap-filter(7): Refine "arithmetic expressions". 2026-09-16 18:28:46 +01:00
pcap-haiku.c Indicate no-capture and no-inject devices. 2026-09-30 09:40:17 +01:00
pcap-hurd.c Extend arity guard macros onto most BPF opcodes. 2026-11-27 09:54:43 +00:00
pcap-int.h Include config.h in internal headers that use it. 2026-10-22 10:07:20 +01:00
pcap-libdlpi.c dlpi: some restructuring. 2025-07-29 19:29:47 -07:00
pcap-linktype.manmisc.in Cross-reference some man pages better. [skip ci] 2024-10-01 12:23:59 +01:00
pcap-linux.c Extend arity guard macros onto most BPF opcodes. 2026-11-27 09:54:43 +00:00
pcap-namedb.h remove libpcap's own CVS keywords 2014-01-03 16:05:37 +04:00
pcap-netfilter-linux.c Indicate no-capture and no-inject devices. 2026-09-30 09:40:17 +01:00
pcap-netfilter-linux.h Have a pcap_if_list_t structure for use by the findalldevs code. 2017-01-18 13:36:27 -08:00
pcap-netmap.c Eliminate three temporary variables. 2026-09-19 10:40:44 +01:00
pcap-netmap.h Add netmap support. 2017-05-31 12:45:20 -07:00
pcap-new.c Fix function names in two error messages. 2026-09-19 10:40:44 +01:00
pcap-npf.c NPF: put in a comment saying what ps_recv and ps_drop do. 2026-09-10 13:19:27 -07:00
pcap-null.c Include <config.h> unconditionally 2024-03-27 22:27:49 +00:00
pcap-options.c free(3) argument needs no type cast. 2026-09-02 13:02:27 +01:00
pcap-rdmasniff.c Indicate no-capture and no-inject devices. 2026-09-30 09:40:17 +01:00
pcap-rdmasniff.h RDMA sniffing support for pcap 2017-08-25 10:47:31 -07:00
pcap-rpcap.c rpcap: add a comment for rpcap_deseraddr(). [skip ci] 2026-10-26 11:19:01 -07:00
pcap-rpcap.h More constification of arguments. 2018-12-25 00:46:46 -08:00
pcap-savefile.manfile.in pcap-savefile(5): Capitalize "GMT" properly. [skip ci] 2026-01-08 14:12:20 +00:00
pcap-snf.c CVE-2026-31912: Mind the program bounds in pcap_offline_filter(). 2026-09-05 10:03:46 +01:00
pcap-snf.h SNF: Fill pcap_if_t in more consistently. 2024-11-30 17:14:43 +00:00
pcap-tstamp.manmisc.in pcap-tstamp(7): Before pcap_activate(), not after. 2024-10-01 08:20:09 +01:00
pcap-types.h Get rid of extra blank line. 2018-08-04 02:59:54 -07:00
pcap-usb-linux-common.h usb-linux: reorganize the isochronous length handling code. 2024-03-18 14:24:58 -07:00
pcap-usb-linux.c Indicate no-capture and no-inject devices. 2026-09-30 09:40:17 +01:00
pcap-usb-linux.h Have a pcap_if_list_t structure for use by the findalldevs code. 2017-01-18 13:36:27 -08:00
pcap-util.c Rename SWAPSHORT(), SWAPLONG(), SWAPLL() to PCAP_BSWAP_({16,32,64}) 2026-08-15 05:00:50 +00:00
pcap-util.h Avoid some compiler builtins in Clang < 9.0.0. 2026-11-20 18:11:58 +00:00
pcap.3pcap.in Speak of null pointers, not NULL, in man pages. 2026-09-08 11:39:52 -07:00
pcap.c Add LINKTYPE_ETW2/DLT_ETW2. 2026-11-10 15:19:26 +00:00
pcap.h remove libpcap's own CVS keywords 2014-01-03 16:05:37 +04:00
pcap_activate.3pcap pcap_activate(3PCAP): Fix some grammar. [skip ci] 2026-10-13 10:33:35 +01:00
pcap_breakloop.3pcap Finish the pruning of unsupported OSes. 2024-02-01 15:47:50 +00:00
pcap_can_set_rfmon.3pcap man: Format more special constants bold. [skip ci] 2020-08-21 19:54:55 +01:00
pcap_close.3pcap Add missing spaces to several man pages. [skip ci] 2026-08-05 10:52:19 +01:00
pcap_compile.3pcap.in pcap_compile(3PCAP): Clarify null pointers and empty strings. 2026-09-11 13:09:27 +01:00
pcap_create.3pcap Speak of null pointers, not NULL, in man pages. 2026-09-08 11:39:52 -07:00
pcap_datalink.3pcap.in Cross-reference some man pages better. [skip ci] 2024-10-01 12:23:59 +01:00
pcap_datalink_name_to_val.3pcap Cross-reference some man pages better. [skip ci] 2024-10-01 12:23:59 +01:00
pcap_datalink_val_to_name.3pcap Speak of null pointers, not NULL, in man pages. 2026-09-08 11:39:52 -07:00
pcap_dump.3pcap man: Indent multiline prototypes consistently. [skip ci] 2023-03-11 12:34:09 +00:00
pcap_dump_close.3pcap Add missing spaces to several man pages. [skip ci] 2026-08-05 10:52:19 +01:00
pcap_dump_file.3pcap Style cleanup. 2019-11-23 20:56:35 -08:00
pcap_dump_flush.3pcap Fix punctuation in a few more man pages. [skip ci] 2024-09-26 10:35:48 +01:00
pcap_dump_ftell.3pcap Add missing spaces to several man pages. [skip ci] 2026-08-05 10:52:19 +01:00
pcap_dump_open.3pcap.in Speak of null pointers, not NULL, in man pages. 2026-09-08 11:39:52 -07:00
pcap_file.3pcap Speak of null pointers, not NULL, in man pages. 2026-09-08 11:39:52 -07:00
pcap_fileno.3pcap pcap_fileno, pcap_get_selectable_fd man pages: various fixes. 2026-09-18 18:18:08 -07:00
pcap_findalldevs.3pcap Indicate no-capture and no-inject devices. 2026-09-30 09:40:17 +01:00
pcap_freecode.3pcap Refine formatting and wording in a few man pages. [skip ci] 2026-03-14 13:13:09 +00:00
pcap_get_required_select_timeout.3pcap Speak of null pointers, not NULL, in man pages. 2026-09-08 11:39:52 -07:00
pcap_get_selectable_fd.3pcap pcap_fileno, pcap_get_selectable_fd man pages: various fixes. 2026-09-18 18:18:08 -07:00
pcap_get_tstamp_precision.3pcap.in man: Prevent hyphenation in a few more cases. [skip ci] 2022-02-13 10:42:40 +00:00
pcap_geterr.3pcap Cross-reference pcap_geterr(3PCAP) and pcap_strerror(3PCAP). 2024-10-07 22:50:19 +01:00
pcap_init.3pcap pcap_init: it was introduced in 1.10, not 1.9. [skip ci] 2025-12-30 22:32:40 -08:00
pcap_inject.3pcap Indicate no-capture and no-inject devices. 2026-09-30 09:40:17 +01:00
pcap_is_swapped.3pcap man: Format more special constants bold. [skip ci] 2020-08-21 19:54:55 +01:00
pcap_lib_version.3pcap pcap_lib_version(3PCAP): Refine the format, update an example. 2025-10-23 21:44:40 +01:00
pcap_list_datalinks.3pcap.in Cross-reference some man pages better. [skip ci] 2024-10-01 12:23:59 +01:00
pcap_list_tstamp_types.3pcap.in Cross-reference some man pages better. [skip ci] 2024-10-01 12:23:59 +01:00
pcap_lookupdev.3pcap Speak of null pointers, not NULL, in man pages. 2026-09-08 11:39:52 -07:00
pcap_lookupnet.3pcap Add missing spaces to several man pages. [skip ci] 2026-08-05 10:52:19 +01:00
pcap_loop.3pcap Add missing spaces to several man pages. [skip ci] 2026-08-05 10:52:19 +01:00
pcap_major_version.3pcap Style cleanup. 2019-11-23 20:56:35 -08:00
pcap_next_ex.3pcap Speak of null pointers, not NULL, in man pages. 2026-09-08 11:39:52 -07:00
pcap_offline_filter.3pcap Speak of null pointers, not NULL, in man pages. 2026-09-08 11:39:52 -07:00
pcap_open_dead.3pcap.in Add BACKWARD COMPATIBILITY for more post-1.0 APIs. 2020-12-21 03:12:47 -08:00
pcap_open_live.3pcap Speak of null pointers, not NULL, in man pages. 2026-09-08 11:39:52 -07:00
pcap_open_offline.3pcap.in Speak of null pointers, not NULL, in man pages. 2026-09-08 11:39:52 -07:00
pcap_set_buffer_size.3pcap man: Format more special constants bold. [skip ci] 2020-08-21 19:54:55 +01:00
pcap_set_datalink.3pcap Add missing spaces to several man pages. [skip ci] 2026-08-05 10:52:19 +01:00
pcap_set_immediate_mode.3pcap.in Finish the pruning of unsupported OSes. 2024-02-01 15:47:50 +00:00
pcap_set_promisc.3pcap man: Format more special constants bold. [skip ci] 2020-08-21 19:54:55 +01:00
pcap_set_protocol_linux.3pcap man: Format more special constants bold. [skip ci] 2020-08-21 19:54:55 +01:00
pcap_set_rfmon.3pcap man: Format more special constants bold. [skip ci] 2020-08-21 19:54:55 +01:00
pcap_set_snaplen.3pcap man: Format more special constants bold. [skip ci] 2020-08-21 19:54:55 +01:00
pcap_set_timeout.3pcap man: Format more special constants bold. [skip ci] 2020-08-21 19:54:55 +01:00
pcap_set_tstamp_precision.3pcap.in Add missing spaces to several man pages. [skip ci] 2026-08-05 10:52:19 +01:00
pcap_set_tstamp_type.3pcap.in Cross-reference some man pages better. [skip ci] 2024-10-01 12:23:59 +01:00
pcap_setdirection.3pcap Add missing spaces to several man pages. [skip ci] 2026-08-05 10:52:19 +01:00
pcap_setfilter.3pcap pcap_setfilter(3PCAP): Clarify a null pointer. [skip ci] 2026-09-11 15:10:30 +01:00
pcap_setnonblock.3pcap Speak of null pointers, not NULL, in man pages. 2026-09-08 11:39:52 -07:00
pcap_snapshot.3pcap Style cleanup. 2019-11-23 20:56:35 -08:00
pcap_stats.3pcap Add missing spaces to several man pages. [skip ci] 2026-08-05 10:52:19 +01:00
pcap_statustostr.3pcap Speak of null pointers, not NULL, in man pages. 2026-09-08 11:39:52 -07:00
pcap_strerror.3pcap Cross-reference pcap_geterr(3PCAP) and pcap_strerror(3PCAP). 2024-10-07 22:50:19 +01:00
pcap_tstamp_type_name_to_val.3pcap Cross-reference some man pages better. [skip ci] 2024-10-01 12:23:59 +01:00
pcap_tstamp_type_val_to_name.3pcap Speak of null pointers, not NULL, in man pages. 2026-09-08 11:39:52 -07:00
pflog.h Remove some apparently-unneeded includes. 2024-11-13 17:42:22 -08:00
portability-exec.h Factor DEV_NULL out. 2026-11-26 13:24:34 +00:00
portability.h Factor portability-exec.h out. 2026-11-26 13:24:34 +00:00
ppp.h Fix spelling 2023-06-25 17:15:12 +00:00
README.md README.md: Refine the OS-specific notes about BPF. 2026-01-19 18:20:39 +00:00
rpcap-protocol.c Include <config.h> unconditionally 2024-03-27 22:27:49 +00:00
rpcap-protocol.h Improve a few comments. [skip ci] 2026-05-19 13:48:35 +01:00
savefile.c Eliminate three temporary variables. 2026-09-19 10:40:44 +01:00
scanner.l scanner: Do not try including grammar.h twice. 2026-03-06 15:55:38 +00:00
sf-pcap.c Add a common routine to grow the packet buffer, and use it. 2026-10-12 16:44:04 -07:00
sf-pcap.h Read the magic number into a byte array. 2019-06-12 11:32:21 -07:00
sf-pcapng.c pcapng: don't update the interface count until we add the new interface. 2026-10-13 16:02:25 -07:00
sf-pcapng.h Read the magic number into a byte array. 2019-06-12 11:32:21 -07:00
sockutils.c rpcapd: Fixup a few comments. 2025-10-18 15:51:19 +01:00
sockutils.h Don't define SOCKET ourselves. 2024-01-19 19:31:22 -08:00
sslutils.c Include <config.h> unconditionally 2024-03-27 22:27:49 +00:00
sslutils.h Include config.h in internal headers that use it. 2026-10-22 10:07:20 +01:00
thread-local.h Check for HP's C compiler rather than for HP-UX. 2024-09-21 15:21:06 -07:00
varattrs.h Use compiler tests to determine how to define _U_. 2017-11-15 14:21:44 -08:00
VERSION Start libpcap 1.11.2-PRE-GIT. [skip ci] 2026-11-24 15:23:42 +00:00

LIBPCAP 1.x.y by The Tcpdump Group

To report a security issue please send an e-mail to security@tcpdump.org.

To report bugs and other problems, contribute patches, request a feature, provide generic feedback etc please see the guidelines for contributing.

The documentation directory has README files about specific operating systems and options.

Anonymous Git is available via:

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

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.

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

Support for particular platforms and BPF

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'' (compressed PostScript, gzipped PostScript, PDF).

Although most packet capture interfaces support some in-kernel filtering, libpcap utilizes in-kernel filtering only for the use cases that support BPF programs, namely, the BPF packet capture interface, the Linux packet socket and the GNU/Hurd interface.

In all other cases libpcap reads every packet into user-space and evaluates it using the filter program, which incurs 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 implemented.

BPF is standard in NetBSD, FreeBSD, OpenBSD, DragonFly BSD, macOS, QNX and Solaris 11; an older, modified and undocumented version is standard in AIX.

Linux has a number of BPF based systems, and libpcap does not support any of the eBPF mechanisms as yet, although it supports many of the memory mapped receive mechanisms. See the Linux-specific README for more information.

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.