dnsjit.core.object.pcap(3)

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

πŸ’– dnsjit.core.object.pcap(3) β€” Library Functions Manual πŸ’–

okay bestie, pull up a chair, we're talking about dnsjit.core.object.pcap from the dnsjit manual, section 3 (library functions, iykyk). this one is literally just a lil container, but she's important. 🫢


✨ NAME ✨

dnsjit.core.object.pcap β€” a container holding one single packet that got found inside a PCAP. that's her. that's the whole job. πŸ’…


🌸 DESCRIPTION 🌸

so like. this object is the container of a PCAP packet, and she's carrying info from two places at once: stuff that came from the PCAP itself, and stuff from the pcap_pkthdr object that gets received for every single packet in the PCAP. two sources, one iconic little struct. main character energy fr fr. πŸ‘‘


πŸŽ€ Attributes πŸŽ€

these are her fields, her little personality traits:

  • snaplen β€” max length of the saved portion of each packet.
  • linktype β€” the data link type for the PCAP.
  • ts β€” time stamp of this packet.
  • caplen β€” length of the portion that's actually present.
  • len β€” length of this packet (off wire, so the real full thing).
  • bytes β€” a pointer to the packet.
  • is_swapped β€” tells you if the byte order of the PCAP is different than the host's. this one is used in, for example, the Layer filter, so it can correctly parse null objects β€” because those get stored in the capturer's host byte order. so yeah, do not sleep on is_swapped, she matters. 🧚

πŸ¦‹ Functions πŸ¦‹

the methods, the moves, the choreography:

  • Pcap:type() β€” returns the textual type of the object.
  • Pcap:prev() β€” returns the previous object.
  • Pcap:cast() β€” casts the object to the underlining object module and returns it.
  • Pcap:uncast() β€” casts the object to the generic object module and returns it.
  • Pcap:copy() β€” makes a copy of the object and returns it.
  • Pcap:free() β€” frees the object. ⚠️ should only be used on copies or on something that was otherwise allocated. do not be out here freeing things you don't own, bestie, that's a one-way ticket to chaos city. πŸ’€

🌈 SEE ALSO 🌈

go read these next, they're all in the family:


πŸ‘‘ AUTHORS and CONTRIBUTORS πŸ‘‘

the legends who made this happen:

  • 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 cursed? want a feature? don't suffer in silence, go file it:

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

got questions or need a human? slide into the inbox:

admin@dns-oarc.net

and that's the whole page, bestie. this one's from dnsjit version 1.5.1, and it's the dnsjit.core.object.pcap(3) page β€” no cap. now go parse some packets responsibly. βœ¨πŸŽ€πŸ¦‹πŸ’–