pcap
Tiny pure Nim library to read PCAP files
Summary
| Latest Version | 0.1.0 |
|---|---|
| License | MIT |
| CI Status | Failing |
| Downloads | 0 |
| Last Indexed | 2026-08-30 07:10 |
Tags
Authors
- Peter Munch-Ellingsen
Installation
nimble install pcap
choosenim install pcap
git clone https://github.com/PMunch/nim-pcap
OS Compatibility
| Platform | Linux | macOS | Windows | FreeBSD | OpenBSD | NetBSD | Android | iOS | WASM | Embedded |
|---|---|---|---|---|---|---|---|---|---|---|
| pcap | ✓ | ✓ | ✓ | - | - | - | - | - | - | - |
Dependencies
| Package | Version | Optional |
|---|---|---|
| nim >= | 0.17.1 | No |
Source
| Repository | https://github.com/PMunch/nim-pcap |
|---|---|
| Homepage | https://github.com/PMunch/nim-pcap |
| Registry Source | nimble_official |
README
PCAP parser
Tiny pure Nim library to read PCAP files used by TcpDump/WinDump/Wireshark as described here: https://wiki.wireshark.org/Development/LibpcapFileFormat
Code example
import pcap
let
s = newFileStream("test.pcap", fmRead)
globalHeader = s.readGlobalHeader()
echo globalHeader
while not s.atEnd:
let
record = s.readRecord(globalHeader)
echo record