dnsjit.input.mmpcap(3)
π dnsjit.input.mmpcap β the manual page, but make it cute β¨
okay so bestie, welcome to dnsjit.input.mmpcap(3) β section 3 of the dnsjit library functions manual, and she is iconic. this is the one that reads input from a PCAP file using mmap(). no cap. let's get into it π«Ά
β¨ NAME β¨
dnsjit.input.mmpcap β read input from a PCAP file using mmap(). that's it, that's the whole vibe. π
πΈ SYNOPSIS πΈ
local input = require("dnsjit.input.fpcap").new()
input:open("file.pcap")
input:receiver(filter_or_output)
input:run()
literally copy that exactly as it is, mwah π
π¦ DESCRIPTION π¦
so what she does is: she reads input from a PCAP file by mapping the whole file to memory using mmap(), and then she parses the PCAP without libpcap. no libpcap needed, she's self-sufficient like that. π
and the way that she works is β after you open a file and she reads the PCAP header, the attributes get populated. that's the moment. main character energy honestly. β¨
π Attributes
is_swappedβ says whether the byte order in the PCAP is in reverse order of the host. i.e. is it backwards bestie πis_nanosecβ tells you if the time stamps are in nanoseconds or not. nano or not nano, that is the question βmagic_numberβ the magic number. yes, magic. β¨version_majorβ the major version number.version_minorβ the 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, seehttps://www.tcpdump.org/linktypes.html. go look it up, i'll wait πlinktypeβ the data link type, mapped fromnetwork.
π§ Functions
Mmpcap.new()β create a new Mmpcap input. birth of a legend, honestly πMmpcap:log()β return theLogobject so you can control logging of this instance or module. for when you need to gossip about what she's doing πMmpcap:receiver(o)β set the receiver to pass objects to.Mmpcap:produce()β return the C functions and context for producing objects. very low-level, very cunt πMmpcap:open(file)β open a PCAP file for processing and read the PCAP header. returns0on success. πMmpcap:run()β start processing packets and send each packet read to the receiver. returns0if all packets was read successfully. slay π₯Mmpcap:packets()β return the number of packets seen. the receipts π
π AUTHORS and CONTRIBUTORS π
the girlies and guys who made this happen:
- Jerry LundstrΓΆm (DNS-OARC)
- TomΓ‘Ε‘ KΕΓΕΎek (CZ.NIC)
- Petr Ε paΔek (ISC)
maintained by DNS-OARC β go say hi, they're doing the lord's work:
https://www.dns-oarc.net/
π BUGS π
found a problem? want a feature? bestie, don't suffer in silence, for issues and feature requests please use:
https://codeberg.org/DNS-OARC/dnsjit/issues
and for questions and help please use:
admin@dns-oarc.net
fr fr, they want to hear from you. no gatekeeping π
and that's the whole page, bestie! π«Ά this was dnsjit version 1.5.1, from the dnsjit.input.mmpcap(3) manual β tysm for reading, you ate that, periodt. π
β¨ππ¦
π¦ 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