Clarification of my request - specifically how to write a pcap file.

Jun 21, 2012 at 10:09 AM

As mentioned in another post, I have a client that is want to read pcap files and put the packets into a database. Doing this allows the client to query by date time and (ideally) construct a pcap bounded by the date time they specified.

Problem: How to write a PCAP file?

I have an IList<Packet> and I want to simply write that out to a pcap file.

I am not at all familiar with the problem domain (pcap) but based a day of looking through Google search results I'm not seeing this type of thing being done out there.

Can PCAP.NET support this? If so, could you steer me to an example? The examples that accompany the download assume some kind of device.

Amy I going about this the wrong way?

Recommendations would be appreciated.

Thank you,


Jun 22, 2012 at 7:16 AM

Hi Chris,


I think you will find the answer in the Pcap.Net User Guide -> Pcap.Net Tutorial - Handling offline dump files.


Specifically, I believe calling PacketDumpFile.Dump() static method would be the simplest approach in your case.


I hope this helps,