Search code examples
cnetwork-programmingpcaptcpdump

"Replay" tcpdump file


I am writing a program for analyzing certain type of packets. I got the dump file containing test packets in tcpdump format. is there any way to send this dump into one of the interfaces? I thought tcpdump would be able to do this on its own (unfortunately it isn't). Only thing I managed to do is to look at packets via wireshark (which obviously isn't the way to go).

I could use libpcap function pcap_open_offline(), unfortunately I use pcap_loop() which doesn't seem to work with pcap_open_offline() and rewriting code to pcap_next() would be very painful. Is there any program that could send packets to the interface?


Solution

  • Did you try to take a look to tcpreplay that is done to :

    Replay network traffic stored in pcap files