dnsjit.input.fpcap(3)
π dnsjit.input.fpcap β the manual, but make it cute π
ok so bestie, this is dnsjit.input.fpcap(3) from the dnsjit library functions manual and it's literally just "read a PCAP file, but with fopen() energy instead of libpcap energy". Let's get into it π«Ά
β¨ NAME β¨
dnsjit.input.fpcap β Read input from a PCAP file using fopen()
πΈ SYNOPSIS πΈ
local input = require("dnsjit.input.fpcap").new()
input:open("file.pcap")
input:receiver(filter_or_output)
input:run()
like... that's the whole vibe. three lines and you're eating π
π¦ DESCRIPTION π¦
So here's the tea: this reads input from a PCAP file using the standard library function fopen(), and it parses the PCAP without libpcap. No cap. Once you've opened a file and read the PCAP header, the attributes get populated. Iconic behaviour honestly π
π Attributes π
is_swappedβ Says whether the byte order in the PCAP is in reverse order of the host. yes she's checking if things are backwards πis_nanosecβ Says whether the time stamps are in nanoseconds or not. nano-girlies know πmagic_numberβ The magic number. β¨ magic β¨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, seehttps://www.tcpdump.org/linktypes.html. go look it up bestie, it's giving reference material π₯linktypeβ The data link type, mapped fromnetwork.
β Functions β
Fpcap.new()β Create a new Fpcap input. fresh start, main character energy β¨Fpcap:log()β Return the Log object to control logging of this instance or module. for when you need to journal about it πFpcap:receiver(o)β Set the receiver to pass objects to. like handing the aux cord to someone you trust π§Fpcap:produce()β Return the C functions and context for producing objects.Fpcap:fadvise_sequential()β Useposix_fadvise()to indicate sequential reading (if supported), may increase performance. MUST be called beforeopen(). π¨ not me stressing this β it literally MUST be beforeopen(), so do not skip that part.Fpcap:open(file)β Open a PCAP file for processing and read the PCAP header. Returns0on success. zero means slay πFpcap: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. Returns0on success. so like, the fd is still yours, don't come for her π«ΆFpcap:run()β Start processing packets and send each packet read to the receiver. Returns0if all packets was read successfully. run it up, it's giving productive πFpcap:packets()β Return the number of packets seen. she's been counting. always counting. π
π AUTHORS and CONTRIBUTORS π
Jerry LundstrΓΆm (DNS-OARC), TomΓ‘Ε‘ KΕΓΕΎek (CZ.NIC), Petr Ε paΔek (ISC)
Maintained by DNS-OARC
the way these people built this... legends only, periodt π
π BUGS π
For issues and feature requests please use:
https://codeberg.org/DNS-OARC/dnsjit/issues
For question and help please use:
admin@dns-oarc.net
ngl if something's broken, tell them, they're nice about it π
and that's the whole page bestie, no notes π this was dnsjit.input.fpcap(3) from dnsjit version 1.5.1 β big love to DNS-OARC for keeping it cute and maintained, mwah π
π¦ 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