dnsjit.cor....dns.label(3)

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

πŸ’– dnsjit.core.object.dns.label β€” the DNS label container, bestie edition πŸ’–

okay so real quick, this page lives in the dnsjit.cor....dns.label(3) corner of the Library Functions Manual and it's all about one lil' guy: the DNS label. let's get into it πŸŽ€

✨ NAME ✨

dnsjit.core.object.dns.label β€” a container of a DNS label 🏷️


πŸ¦‹ DESCRIPTION πŸ¦‹

so this is the object that describes a DNS label, periodt. if you wanna extract a domain name label, first check that have_dn is set β€” vibe check first, always β€” then use offset + 1 to say where in the payload the label actually starts, and length for how many bytes long it is. no cap, that's the whole trick πŸ’…

🌸 Attributes 🌸

  • is_end β€” yeah it's just... there. sitting pretty. (that's all the docs say bestie, I'm not making stuff up πŸ™ˆ)
  • have_length β€” set if there's a length. slay.
  • have_offset β€” set if there's an offset. iconic.
  • have_extension_bits β€” set if there are extension bits. okurr.
  • have_dn β€” set if the label contained a domain name. πŸ‘‘
  • extension_bits β€” the extension bits themselves, obviously.
  • length β€” the length of the domain name.
  • offset β€” so if have_dn is set, this holds the offset within the payload to where this label starts. otherwise? it holds the offset to another label. two moods, one field ✨

πŸ’œ Functions πŸ’œ

  • Label.new(size) β€” makes you a brand new array of labels. fresh out the box, size-many of them 🫢
  • Label.tostring(dns, labels, num_labels, offset_labels) β€” returns the labels as a string plus an offset pointing to the next label. it takes labels, which is an array of labels returned by any of the parse functions, and num_labels, the number of labels in that array. the optional offset_labels lets you skip some labels at the start (very "I'm not reading allat" of you, and honestly valid). heads up though: the return string may be nil if the first label was an offset, and the return offset may be nil if the last label was an extension bits or end marker 😭
  • Label.torfc1035(dns, labels, num_labels, offset_labels) β€” same energy but it returns an RFC1035 domain name of the labels and an offset to the next label. takes labels, an array of labels returned by any of the parse functions, and num_labels, number of labels in the array. optional offset_labels can be used to skip labels at the start. the return string may be nil if the first label was an offset, and the return offset may be nil if the last label was an extension bits or end marker πŸ’€
  • Label.tooffstr(dns, labels, num_labels, offset_labels) β€” returns the labels as a string that also includes a textual notation of the offset, in the form <offset>label. takes labels, an array of labels returned by any of the parse functions, and num_labels, the number of labels in the array. optional offset_labels can be used to skip labels at the start. cute lil annotated vibes 🌈

πŸ‘€ SEE ALSO πŸ‘€


πŸ‘‘ AUTHORS and CONTRIBUTORS πŸ‘‘

the icons who built this:

  • 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 or got a feature request? for issues and feature requests please use:

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

got questions or need help? for question and help please use:

admin@dns-oarc.net

and that's the whole page bestie, no notes πŸŽ€ this was dnsjit version 1.5.1, straight from the dnsjit.cor....dns.label(3) manual β€” go forth and parse those labels, you absolute main character πŸ’…βœ¨πŸ¦‹