dnsjit.input.pcap(3)
π dnsjit.input.pcap π
okay bestie, welcome to dnsjit.input.pcap(3) β yes that's the whole manual name, we're being β¨officialβ¨ β and this is the module that snatches packets straight off an interface or out of a PCAP file using libpcap. it's giving main character energy for your packet pipeline, fr fr.
β¨ SYNOPSIS β¨
local input = require("dnsjit.input.pcap").new()
input:open_offline("file.pcap")
input:receiver(filter_or_output)
input:run()
like, that's the whole vibe. three little lines and you're literally reading packets. obsessed. π¦
πΈ DESCRIPTION πΈ
it's an input module, bestie. its whole job is reading packets from interfaces and PCAP files. that's it, that's the girlboss era. π
π Functions π
Pcap.new()β make a brand new Pcap input. fresh start, new me, etc. β¨Pcap:log()β hands you theLogobject so you can control logging for this instance or module. you do want logs, trust. π₯Pcap:receiver(o)β set the receiver, i.e. the thing that receives all the objects it passes along. point it at your filter or your output, iykyk.Pcap:produce()β gives you back the C functions and the context for producing objects. very behind-the-scenes, very backstage pass. ποΈPcap:create(source)β open a live packet capture on source, where source is an interface name, or"any"on Linux, or"all"on BSD. important queen behavior: it must be activated before use. no activation, no packets. periodt.Pcap:activate()β activates that live packet capture. go readpcap_activate(3pcap)for more info and for all the possible return values, because there are several and you should lowkey know them. πPcap:open_offline(file)β opens a PCAP file for processing. checkpcap_open_offline(3pcap)for the deets. returns0on success. zero equals slay. πPcap:loop(cnt)β processes packets from a live capture or a savefile until cnt packets are processed. seepcap_loop(3pcap)for more info and possible return values. it will simply keep going until the count says stop. iconic.Pcap:dispatch(cnt)β same energy, different function: processes packets from a live capture or savefile until cnt packets are processed. seepcap_dispatch(3pcap)for more info and possible return values. πPcap:packets()β returns the number of packets seen. the receipts, bestie. the literal receipts. π§ΎPcap:linktype()β returns the linktype of the opened PCAP. β¨Pcap:snaplen()β returns the snaplen of the opened PCAP. yes she's short for "snapshot length", no she will not be elaborating further. π
π¦ SEE ALSO π¦
dnsjit.output.pcap(3)β the other half of the story, go read her too. π
π AUTHORS and CONTRIBUTORS π
absolute legends, no cap:
- 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 something broken? want a feature? bestie, they want to hear about it:
https://codeberg.org/DNS-OARC/dnsjit/issues
got a question or just need a hand? slide into the inbox:
admin@dns-oarc.net
and that's the whole page, babe. this was dnsjit 1.5.1, page dnsjit.input.pcap(3) β go forth, capture some packets, and remember: activate before use. 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