pcap

Tiny pure Nim library to read PCAP files used by TcpDump/WinDump/Wireshark.

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version Unknown
License MIT
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:23

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 - - - - - - -

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