dnsjit.input.zmmpcap(3)

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

πŸ’– dnsjit.input.zmmpcap β€” Library Functions Manual πŸ’–

okay bestie, gather round, because this one is a whole mood. this is dnsjit.input.zmmpcap(3), and she reads input from a PCAP file using mmap(). yes. mmap. she's that girl. πŸ¦‹


✨ NAME ✨

dnsjit.input.zmmpcap β€” Read input from a PCAP file using mmap()


✨ SYNOPSIS ✨

local input = require("dnsjit.input.zmmpcap").new()
input:zstd()
input:open("file.pcap.zst")
input:receiver(filter_or_output)
input:run()

like. look at her. five lines and she's already eating. πŸ’…


✨ DESCRIPTION ✨

so basically? she reads input from a PCAP file by mapping the whole entire file into memory using mmap() β€” no cap, the whole thing β€” and then she parses the PCAP without libpcap. not a single libpcap in sight. iconic behaviour, honestly.

and then β€” after you open a file and read the PCAP header β€” the attributes get populated. she fills herself in. main character energy. πŸ‘‘

🌸 Attributes 🌸

  • is_swapped β€” tells you if the byte order in the PCAP is in reverse order of the host. backwards byte order? she clocks it. πŸ™ˆ
  • is_nanosec β€” tells you whether the time stamps are in nanoseconds or not. nanosecond girlies vs the rest of us.
  • magic_number β€” the magic number. ✨ literally what it says on the tin.
  • 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, see https://www.tcpdump.org/linktypes.html. go look, i'll wait. 🫢
  • linktype β€” the data link type, mapped from network. it's giving "derived field", lowkey.

πŸŽ€ Functions πŸŽ€

  • Zmmpcap.new() β€” Create a new Zmmpcap input. fresh start, new you. ✨
  • Zmmpcap:log() β€” Return the Log object to control logging of this instance or module. she keeps receipts. πŸ“
  • Zmmpcap:receiver(o) β€” Set the receiver to pass objects to.
  • Zmmpcap:produce() β€” Return the C functions and context for producing objects.
  • Zmmpcap:lz4() β€” Use liblz4 to decompress the input file/data.
  • Zmmpcap:zstd() β€” Use libzstd to decompress the input file/data.
  • Zmmpcap:gzip() β€” Use zlib/gzip to decompress the input file/data.
  • Zmmpcap:lzma() β€” Use liblzma/xz to decompress the input file/data.
  • Zmmpcap:have_support() β€” Return true if support for selected compression library is built in. (bestie, check this before you get your hopes up. 😭)
  • Zmmpcap:open(file) β€” Open a PCAP file for processing and read the PCAP header. Returns 0 on success.
  • Zmmpcap:run() β€” Start processing packets and send each packet read to the receiver. Returns 0 if all packets was read successfully.
  • Zmmpcap:packets() β€” Return the number of packets seen. she's been counting. πŸ‘€
ngl the return values matter here: 0 means success, on both open() and run(). don't sleep on that. πŸ’€

πŸ’œ AUTHORS and CONTRIBUTORS πŸ’œ

Jerry LundstrΓΆm (DNS-OARC), TomΓ‘Ε‘ KΕ™Γ­ΕΎek (CZ.NIC), Petr Ε paček (ISC)

Maintained by DNS-OARC

https://www.dns-oarc.net/

legends, all of them. periodt. πŸ‘‘


🌈 BUGS 🌈

found a bug? want a feature? first of all, thank you for your service. 🫑

For issues and feature requests please use:

https://codeberg.org/DNS-OARC/dnsjit/issues

For question and help please use:

admin@dns-oarc.net

they're nice, i promise. go say hi. πŸ’–


and that's the whole page, bestie β€” you read it, you understood it, you slayed it. 🧚 this was dnsjit.input.zmmpcap(3) from dnsjit 1.5.1, dated dnsjit.input.zmmpcap(3) (yes the footer said the same name twice, she's consistent and we love that for her). go map some files to memory. πŸ¦‹βœ¨πŸ’