dnsjit.input.zpcap(3)
π dnsjit.input.zpcap β the manual page, but make it cute π
okay bestie, so this is dnsjit.input.zpcap(3) from the Library Functions Manual, and it's genuinely one of my faves because it's giving "compressed PCAP? no problem, we don't even need libpcap" energy. sit with me, we're gonna go through the whole thing, every single flag, no skipping, periodt. π¦
β¨ NAME β¨
dnsjit.input.zpcap β read input from a PCAP file that is compressed. yes, compressed. zstd, lz4, gzip, lzma, she contains multitudes π
π SYNOPSIS π
local input = require("dnsjit.input.zpcap").new()
input:zstd()
input:open("file.pcap.zst")
input:receiver(filter_or_output)
input:run()
look at her. pick a decompressor, open the file, set a receiver, run. that's the whole vibe. πΈ
π DESCRIPTION π
So basically: you read input from a PCAP file that is compressed, and then she parses the PCAP without libpcap. no libpcap needed, she said what she said. π₯
Once you've opened a file and read the PCAP header, the attributes get populated. that's the moment. the main character moment. π
π Attributes π
is_swappedβ tells you if the byte order in the PCAP is in reverse order of the host. little endian/big endian drama, iykyk.is_nanosecβ tells you if the time stamps are in nanoseconds or not. nano girlies rise π«Άmagic_numberβ the magic number. iconic, obviously. β¨version_majorβ major version number.version_minorβ minor version number.thiszoneβ GMT to local correction.sigfigsβ accuracy of timestamps.snaplenβ max length of captured packets, in octets.networkβ the link type found in the PCAP header, see <https://www.tcpdump.org/linktypes.html> β wait no links bestie, just go look athttps://www.tcpdump.org/linktypes.htmlyourself πlinktypeβ the data link type, mapped fromnetwork. sonetworkwalked solinktypecould run π
π Functions π
Zpcap.new()β create a new Zpcap input. the birth of a legend.Zpcap:log()β return theLogobject, so you can control logging of this instance or module. she's transparent, she journals πZpcap:receiver(o)β set the receiver to pass objects to. who's she sending her packets to? you decide.Zpcap:produce()β return the C functions and context for producing objects.Zpcap:fadvise_sequential()β useposix_fadvise()to indicate sequential reading (if supported), which may increase performance. β οΈ MUST be called beforeopen()β like, before before. if you do it after, that's on you bestie, she told you.Zpcap:lz4()β use liblz4 to decompress the input file/data.Zpcap:zstd()β use libzstd to decompress the input file/data. zstd girlies, this is our moment πZpcap:gzip()β use zlib/gzip to decompress the input file/data.Zpcap:lzma()β use liblzma/xz to decompress the input file/data.Zpcap:have_support()β returntrueif support for the selected compression library is built in. vibe check on your build πZpcap:open(file)β open a PCAP file for processing and read the PCAP header. returns0on success. we love a zero π«ΆZpcap:openfp(fp)β open a PCAP file for processing and read the PCAP header using a file descriptor, for exampleio.stdinor withio.open(). Will not take ownership of the file descriptor (she's not possessive, she respects boundaries π). returns0on success.Zpcap:run()β start processing packets and send each packet read to the receiver. returns0if all packets were read successfully. slay.Zpcap:packets()β return the number of packets seen. counting her blessings fr fr β¨
π SEE ALSO π
dnsjit.input.fpcap(3)β her uncompressed sibling, go say hi
πΈ AUTHORS and CONTRIBUTORS πΈ
Shoutout to the absolute legends who made this:
- Jerry LundstrΓΆm (DNS-OARC)
- TomΓ‘Ε‘ KΕΓΕΎek (CZ.NIC)
- Petr Ε paΔek (ISC)
Maintained by DNS-OARC π«Ά
https://www.dns-oarc.net/
π BUGS π
Found a bug? Need a feature? Not me being the bearer of bad news, but:
for issues and feature requests please use:
https://codeberg.org/DNS-OARC/dnsjit/issues
got questions, need help, just wanna chat:
admin@dns-oarc.net
and that's the whole page bestie, no cap, every flag accounted for π
this was dnsjit.input.zpcap(3) from dnsjit version 1.5.1 β go decompress something iconic, ily, bye πβ¨π¦
π¦ where this page comes from
- epel 10: dnsjit 1.5.1-2.el10_2 Β· GPL-3.0-or-later
- epel 9: dnsjit 1.5.1-2.el9 Β· GPL-3.0-or-later
- fedora 43: dnsjit 1.5.1-2.fc43 Β· GPL-3.0-or-later
- fedora 43: dnsjit 1.5.1-2.fc43 Β· GPL-3.0-or-later
- fedora 44: dnsjit 1.5.1-2.fc44 Β· GPL-3.0-or-later
- fedora 44: dnsjit 1.5.1-2.fc44 Β· GPL-3.0-or-later
- ubuntu resolute: dnsjit 1.5.1-2 Β· GPL-3.0-or-later
- ubuntu stonking: dnsjit-dev 1.5.1-6 Β· GPL-3.0-or-later
- Copyright (c) 2018-2026 OARC, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms