dnsjit.input.pcap(3)

πŸ“¦
version 1.5.1 Β· 5 versions
, in epel 10, epel 9, fedora 43, fedora 44, ubuntu resolute, ubuntu stonking

πŸ’– 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 the Log object 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 read pcap_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. check pcap_open_offline(3pcap) for the deets. returns 0 on success. zero equals slay. πŸ’–
  • Pcap:loop(cnt) β€” processes packets from a live capture or a savefile until cnt packets are processed. see pcap_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. see pcap_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 πŸ¦‹


πŸ‘‘ 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. πŸ’…βœ¨πŸŒΈ