Registry / networking / libpcap

libpcap

JSON →
library1.10.6vcpkgunverified

A portable C/C++ library for network traffic capture.

vcpkg install libpcap
INSTALL
IMPORT
SIG · LIBPCAP
L
libpcap
networkingcppv1.10.6
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

pcap.h
✓ #include <pcap.h>

Open a live packet capture session on an interface

#include <pcap.h> #include <iostream> int main() { char errbuf[PCAP_ERRBUF_SIZE]; pcap_t* handle = pcap_open_live("eth0", BUFSIZ, 1, 1000, errbuf); if (handle == nullptr) { std::cerr << "Error: " << errbuf << std::endl; return 1; } pcap_close(handle); return 0; }
Debug
Known issues
gotchaRequires root/administrator privileges to capture packets on most systems.
fix
Run the application with elevated privileges (sudo on Linux, Administrator on Windows).
affects: all
Upgrade
Version history
1.10.6latest on vcpkg
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
10
Resources

No resource links recorded.

libpcap — pip install libpcap · libregistry