I need to write a program in C to read in pcap files and extract the packets and send them out . It's like a traffic replay. I know there's tcpreplay but I didn't see its C library, it seems to be only a command-line application.
I know how to do it with pcap_open(), but it's only available in WinPcap, I need to do it in linux with libpcap. Anybody can provide some hint? Thanks in advance.
edit: I can parse the packets, but now I just don't know how to open an interface to send the packets out. Thanks.
pcap_open_offline
from pcap man page – SleuthEyepcap_inject
. – moorray