libnetfilter-queue

Userspace library for processing packets filtered by kernel netfilter.

brewmacoslinux
Try with needOr install directly
Source

About

Userspace API to packets queued by the kernel packet filter

Examples

capture and inspect network packets in real time$ nfq-test
build custom packet filtering rules with C code$ gcc -o myfilter myfilter.c -lnetfilter_queue -lnfnetlink
queue packets for userspace processing with iptables$ iptables -I INPUT -j NFQUEUE --queue-num 0
monitor and modify packets before they reach applications$ nfq-test --queue-num 0
write network packet inspection tools in C or Python$ python3 -c 'import ctypes; lib = ctypes.CDLL("libnetfilter_queue.so")'