libnet

C library for constructing and injecting IP packets into the network.

brewmacoslinux
Try with needOr install directly
Source

About

C library for creating IP packets

Examples

build custom network packets in C code$ gcc -o packet_tool packet.c -lnet && ./packet_tool
create raw TCP packets for network testing$ cc -I/usr/local/include -L/usr/local/lib mypacket.c -lnet -o test
develop packet crafting application with libnet$ #include <libnet.h> /* link against -lnet when compiling */
inject forged IP packets into network interface$ gcc -o inject inject.c -lnet && sudo ./inject eth0
write network protocol analysis tool in C$ cc -o analyzer analyzer.c -lnet -lpcap