Haukcode.PcapngUtils
1.3.42
dotnet add package Haukcode.PcapngUtils --version 1.3.42
NuGet\Install-Package Haukcode.PcapngUtils -Version 1.3.42
<PackageReference Include="Haukcode.PcapngUtils" Version="1.3.42" />
<PackageVersion Include="Haukcode.PcapngUtils" Version="1.3.42" />
<PackageReference Include="Haukcode.PcapngUtils" />
paket add Haukcode.PcapngUtils --version 1.3.42
#r "nuget: Haukcode.PcapngUtils, 1.3.42"
#:package Haukcode.PcapngUtils@1.3.42
#addin nuget:?package=Haukcode.PcapngUtils&version=1.3.42
#tool nuget:?package=Haukcode.PcapngUtils&version=1.3.42
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
One at a time (recommended)
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 | Versions 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. |
-
.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 |
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