ldns(3)

πŸ“¦
version 1.9.2 Β· 2 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– ldns(3) β€” the rdf attributes page, bestie edition πŸ’–

okay so this is the manual page for the ldns(3) library β€” yes, the whole DNS library, but today we're zooming in on four little functions that peek at your rdfs (that's "resource data field", the raw wire-format chunks). They tell you how big it is, what type it is, where the data lives, and how two of them stack up against each other. Let's get into it πŸ¦‹


✨ NAME ✨

ldns_rdf_size, ldns_rdf_get_type, ldns_rdf_data, ldns_rdf_compare β€” get rdf attributes πŸ’…


🌸 SYNOPSIS 🌸

#include <stdint.h>
#include <stdbool.h>

#include <ldns/ldns.h>

size_t ldns_rdf_size(const ldns_rdf *rd);

ldns_rdf_type ldns_rdf_get_type(const ldns_rdf *rd);

uint8_t* ldns_rdf_data(const ldns_rdf *rd);

int ldns_rdf_compare(const ldns_rdf *rd1, const ldns_rdf *rd2);

πŸ‘‘ DESCRIPTION πŸ‘‘

ldns_rdf_size()

returns the size of the rdf. like, how many bytes are we even working with here.

  • *rd: the rdf to read from
  • Returns uint16_t with the size

ldns_rdf_get_type()

returns the type of the rdf. We need to insert _get_ here to prevent conflict the rdf_type TYPE. (their words, not mine, but honestly iconic that they documented the naming drama 😭)

  • *rd: the rdf to read from
  • Returns ldns_rdf_type with the type

ldns_rdf_data()

returns the data of the rdf.

  • *rd: the rdf to read from
  • Returns uint8_t* pointer to the rdf's data

ldns_rdf_compare()

compares two rdf's on their wire formats. (To order dnames according to rfc4034, use ldns_dname_compare) β€” not me repeating that caveat verbatim because it MATTERS, fr fr πŸ™ˆ

  • rd1: the first one
  • rd2: the second one
  • Returns 0 if equal
  • Returns -1 if rd1 comes before rd2
  • Returns +1 if rd2 comes before rd1
bestie the return values are literally 0, -1, and +1. classic comparison trio. memorize it, it's giving "I've seen this in qsort before" ✨

🫢 AUTHOR 🫢

The ldns team at NLnet Labs. absolute legends, no cap πŸ’œ


😭 REPORTING BUGS 😭

found something cursed? Please report bugs to dns-team@nlnetlabs.nl or on GitHub at https://github.com/NLnetLabs/ldns/issues β€” they wanna know, seriously πŸ›


Copyright (c) 2004 - 2006 NLnet Labs.

Licensed under the BSD License. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

read that again. NO warranty. not even the obvious ones. don't come for them if your DNS explodes 🫠

🌈 SEE ALSO 🌈

ldns_rdf. And perldoc Net::DNS, RFC1034, RFC1035, RFC4033, RFC4034 and RFC4035.


🧚 REMARKS 🧚

This manpage was automatically generated from the ldns source code. (a robot wrote the skeleton, I just gave it a makeover πŸ’…)


and that's the whole page, bestie!! πŸŽ€ this one's from the ldns library, dated 30 May 2006 β€” yeah, it's older than most of us but the vibes are still immaculate. go read your rdfs. slay. periodt. πŸ’–βœ¨πŸ¦‹