Haukcode.PcapngUtils 1.3.42

dotnet add package Haukcode.PcapngUtils --version 1.3.42
                    
NuGet\Install-Package Haukcode.PcapngUtils -Version 1.3.42
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Haukcode.PcapngUtils" Version="1.3.42" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Haukcode.PcapngUtils" Version="1.3.42" />
                    
Directory.Packages.props
<PackageReference Include="Haukcode.PcapngUtils" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Haukcode.PcapngUtils --version 1.3.42
                    
#r "nuget: Haukcode.PcapngUtils, 1.3.42"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Haukcode.PcapngUtils@1.3.42
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Haukcode.PcapngUtils&version=1.3.42
                    
Install as a Cake Addin
#tool nuget:?package=Haukcode.PcapngUtils&version=1.3.42
                    
Install as a Cake Tool

Haukcode.PcapngUtils

A fully managed C# library for reading and writing Pcap and PcapNG network capture files — no native WinPcap or libpcap dependency required.

Installation

dotnet add package Haukcode.PcapngUtils

Quick Start

using Haukcode.PcapngUtils;

// Auto-detect format (Pcap or PcapNG) and read packets one at a time
using var reader = IReaderFactory.GetReader("capture.pcap");

while (reader.MoreAvailable)
{
    var packet = reader.ReadNextPacket();
    if (packet == null)
        break;

    Console.WriteLine($"Packet: {packet.Seconds}.{packet.Microseconds:D6}  ({packet.Data.Length} bytes)");
}

Reading Packets

using Haukcode.PcapngUtils;

using var reader = IReaderFactory.GetReader("capture.pcap");

while (reader.MoreAvailable)
{
    var packet = reader.ReadNextPacket();
    if (packet == null)
        break;

    // Process packet.Data, packet.Seconds, packet.Microseconds
}

Via event callback

using System.Threading;
using Haukcode.PcapngUtils;

using var reader = IReaderFactory.GetReader("capture.pcap");
reader.OnReadPacketEvent += (context, packet) =>
{
    Console.WriteLine($"Packet: {packet.Seconds}.{packet.Microseconds:D6}  ({packet.Data.Length} bytes)");
};
reader.ReadPackets(CancellationToken.None);

Writing Packets

using Haukcode.PcapngUtils;
using Haukcode.PcapngUtils.PcapNG;

using var reader = IReaderFactory.GetReader("input.pcap");
using var writer = new PcapNGWriter("output.pcapng");

while (reader.MoreAvailable)
{
    var packet = reader.ReadNextPacket();
    if (packet == null)
        break;

    writer.WritePacket(packet);
}

Key Types

Type Description
IReaderFactory Opens Pcap or PcapNG files/streams with auto-detection.
PcapReader Reads Pcap format files.
PcapNGReader Reads PcapNG format files.
PcapWriter Writes Pcap format files.
PcapNGWriter Writes PcapNG format files.
IPacket Packet interface: Seconds, Microseconds, Data.

For full documentation and more examples, see the GitHub repository.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Haukcode.PcapngUtils:

Package Downloads
ExtcapNet

A library for developing extcap plugins for Wireshark.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.3.42 75 7/3/2026
1.3.40 54 7/3/2026
1.3.35 4,974 10/14/2025
1.3.34 239 10/14/2025
1.3.33 636 8/11/2025
1.3.32 222 8/11/2025
1.3.30 232 8/11/2025
1.3.26 278 7/15/2025
1.3.24 3,524 6/14/2024
1.3.22 2,256 5/23/2023
1.3.20 4,817 10/19/2022
1.3.18 676 9/18/2022
1.3.17 599 9/18/2022
1.3.14 1,224 12/21/2021
1.3.13 470 12/21/2021
1.3.11 3,049 11/25/2021
1.2.10-PR-master-ad572235 2,845 11/25/2021
Loading failed

1.3.14 Open read-only files
1.3.0 Assembly signing
1.2.0 Changed Seconds/Microseconds to uint. Renamed enchanted to enhanced
1.1.0 Added new methods to get next packet as an alternative to streaming via callback event. Also added ways to add streams to the constructors.
1.0.8 Converted to .NET Standard 2.0 and removed NUnit dependencies