https://github.com/pmunch/nim-pcap
Tiny pure Nim library to read PCAP files
https://github.com/pmunch/nim-pcap
Last synced: about 1 year ago
JSON representation
Tiny pure Nim library to read PCAP files
- Host: GitHub
- URL: https://github.com/pmunch/nim-pcap
- Owner: PMunch
- Created: 2017-05-16T14:04:59.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2019-09-22T09:50:59.000Z (over 6 years ago)
- Last Synced: 2025-02-11T13:25:26.655Z (over 1 year ago)
- Language: Nim
- Size: 4.88 KB
- Stars: 16
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
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
```