Creating pcap file from packets?

Dec 10, 2010 at 11:32 AM

What is the best way of creating the new pcap file from the packets extracted from another one?

Most likely it is something very simple but I cannot find the way so far.

Any ideas will be greatly appreciated.


Dec 13, 2010 at 3:21 AM
Edited Dec 13, 2010 at 5:15 AM

I think I have found one way to do this.

  using (PacketDumpFile dumpFile = [Any instance of PacketCommunicator].OpenDump("test.pcap"))

While the code above works it is a bit ugly as it requires creating a PacketCommunicator either for the actual device or a dummy pcap file.

Is there a better way? Something like this:

 using (PacketDumpFile dumpFile = PacketCommunicator.OpenDump("test.pcap"))
Dec 13, 2010 at 4:13 AM

Hi taras_b,


I think you can use PacketDumpFile.Dump() static method.

It does need a few parameters that can usually be extracted from the PacketCommunicator instance.


I hope this helps,


Dec 13, 2010 at 4:30 AM

Thank you, this is exactly what I was looking for.