libpcap

Capture and analyze network traffic packets from live interfaces or files.

brewmacoslinux
Try with needOr install directly
Source

About

Portable library for network traffic capture

Commands

pcap-config

Examples

list all network interfaces available to capture from$ pcap-config --cflags --libs
get compiler flags and library paths for building with libpcap$ pcap-config --cflags --libs
check libpcap version installed on system$ pcap-config --version
see compilation flags needed to use libpcap in C programs$ pcap-config --cflags
find linker flags to link against libpcap library$ pcap-config --libs