Skip to content

spyderorg/zig-pcapfile

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zig-pcapfile

A pure Zig library for reading and writing PCAP files

Releases target Zig releases (e.g. 0.10.x). Master follows the Zig master branch

Status

Full support for reading and writing PCAP version 2.4 files (.pcap extension)
No support for PCAPNG files (.pcapng extension)

Usage

// PCAP reading
var in_file = try std.fs.cwd().openFile("test.pcap", .{});
var it = try pcap.iterator(allocator, .{}, in_file.reader());
defer it.deinit(allocator);

while (try it.next()) |rec| {
    try std.debug.print("packet with len = {d}\n", .{rec.data.len});
}

About

A pure Zig library for reading and writing PCAP files

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Zig 100.0%