dnsjit.core.object(3)

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

πŸ’– dnsjit.core.object β€” the manual page, but make it cute πŸ’–

okay bestie, this is dnsjit.core.object, from the dnsjit library functions manual (section 3, for all you nerds keeping score πŸŽ€). it's the base object, the blueprint, the main character that every other object in the chain is secretly built on top of. let's get into it ✨


🌸 NAME 🌸

dnsjit.core.object β€” the base object that gets passed between receiver and receivee. it's the vibe that travels down the pipeline, no cap πŸ¦‹


✨ SYNOPSIS ✨

require("dnsjit.core.object")
print(object:type())
packet = object:cast()

like, that's it. that's the whole mood. you require it, you ask it what it is, you cast it into whatever it actually is πŸ’…


πŸ’œ DESCRIPTION πŸ’œ

so this is the base object, right? and the way that it works is: it can be casted to other objects that describe a DNS message, how it was captured, or how it was generated. it's giving "shape-shifter but make it structured" 🧚

and here's the iconic part β€” objects can be chained together. for example, a DNS message is created ontop of a packet. so it's like a little stack of objects, each one sitting on the one below it, and you can walk the chain to find what you need. obsessed πŸ˜­πŸ’–

πŸŽ€ Attributes πŸŽ€

  • obj_type β€” the enum of the object type. basically its little name tag telling you what kind of object it is πŸ‘‘
  • obj_prev β€” the previous object in the object chain. so you can go back up the stack and see where you came from, iykyk πŸ’«

πŸ¦‹ Functions πŸ¦‹

  • Object:type() β€” return the textual type of the object. it tells you what it is, in words 🌸
  • Object:prev() β€” return the previous object. walk backwards in the chain, bestie 🫢
  • Object:cast() β€” cast the object to the underlining object module and return it. yes, the original says "underlining", and we respect the original, so it stays πŸ’…
  • Object:cast_to(obj_type) β€” cast the object to the specified object module and return it. returns nil if the object chain doesn't contained the specified object type (again, that's the original wording β€” we keep it fr fr). so like, if you're asking for a type that isn't in your chain, you get nothing back. rude, but fair πŸ™ˆ
  • Object:uncast() β€” cast the object to the generic object module and return it. back to basics, back to the base object πŸ’«
  • Object:copy() β€” make a copy of the object and return it. a lil clone, a twin, a duplicate ✨
  • Object:free() β€” free the object. should only be used on copies or otherwise allocated. okay this one matters β€” do NOT go freeing objects you didn't create, that's how you get chaos πŸ’€

🌈 SEE ALSO 🌈

the whole friend group, the entire squad, every single one of these cuties:


πŸ‘‘ AUTHORS and CONTRIBUTORS πŸ‘‘

the icons who made this happen, we stan:

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

Maintained by DNS-OARC πŸ’–

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

πŸ’€ BUGS πŸ’€

got a problem? found a bug? want a feature? don't suffer in silence bestie, go tell them:

for issues and feature requests, please use:

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

for questions and help, please use:

admin@dns-oarc.net

ngl, the base object is lowkey the most important one here β€” everything else is just a glow-up of this πŸ’…

and that's a wrap, bestie πŸŽ€ this was dnsjit.core.object(3), from dnsjit version 1.5.1. go forth, cast responsibly, and never free() something you don't own. mwah πŸ’–βœ¨