Question

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?

Was it helpful?

Solution

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

Replay network traffic stored in pcap files

OTHER TIPS

Newer versions of libpcap provide a pcap_inject() function that can be used to write packets back out.

You can see someone's testing program to use pcap_inject() over on UbuntuForums.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top