Skip to content

philippelatulippe/PcapngFile

 
 

Repository files navigation

PCAP-NG File Reader

Reads PCAP Next Generation files and generates CLR objects from its data. Implemented according to the draft specification at http://www.winpcap.org/ntar/draft/PCAP-DumpFileFormat.html.

Usage

var reader = new Reader("myfile.pcapng");

BlockBase block;
while ((block = reader.ReadBlock()) != null)
{
   // Act on received block. It's cast will be BlockBase 
   // but its true underlying type will be any of BlockBase's
   // children.
}

reader.Reset();

// Which is equivalent to.
foreach (var readBlock in reader.AllBlocks)
{
   // ...
}

Or if you just want a particular block type.

var reader = new Reader("myfile.pcapng");

foreach (var block in reader.EnhancedPacketBlocks)
{
   // Act on received block of type EnhancedPacketBlock.
}

Additional Information

See my blog post for more information.

About

PCAP-NG File Reader

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%