Skip to content

A pure Zig library for reading and writing PCAP files

License

Notifications You must be signed in to change notification settings

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

Packages

No packages published

Languages