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 dname label girlies πŸ’–

okay bestie, welcome to the ldns(3) manual page (library functions manual, if we're being formal, which we are not). this is the corner of the ldns docs that handles dname labels, and honestly? it's giving tiny-but-mighty. two functions. that's it. that's the whole vibe. let's get into it πŸ¦‹


✨ NAME ✨

ldns_dname_left_chop, ldns_dname_label_count β€” dname label functions. yes, just the two of them, and they're both iconic in their own little way πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

okay so first you gotta pull in the headers, no cap:

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

#include <ldns/ldns.h>

then the two stars of the show:

ldns_rdf* ldns_dname_left_chop(const ldns_rdf *d);

uint8_t ldns_dname_label_count(const ldns_rdf *r);

look at them. ldns_rdf* returning, uint8_t returning. periodt. πŸ’œ


🌸 DESCRIPTION 🌸

ldns_dname_left_chop()

bestie. this one chops one label off the left side of a dname. that's literally the whole job. it takes wwww.nlnetlabs.nl and hands you back nlnetlabs.nl. left label? gone. not me being emotionally attached to a label πŸ’€

the way that this new name is a clone, so you have to free it yourself with ldns_deep_free(). like, it's not borrowing memory, it's making a whole new one and you're responsible for it now. main character energy but also main character responsibility, iykyk 🫢

  • d β€” the dname to chop πŸ”ͺ
  • Returns β€” the remaining dname ✨

ldns_dname_label_count()

this one is the chill one. it just counts the number of labels inside a LDNS_RDF_DNAME type rdf. no chopping, no drama, just counting. lowkey soothing tbh πŸ“

  • *r β€” the rdf
  • Returns β€” the number of labels πŸ”’

πŸ‘‘ AUTHOR πŸ‘‘

The ldns team at NLnet Labs. absolute legends, we stan 🌈


😭 REPORTING BUGS 😭

found a bug? don't suffer in silence bestie, please report bugs to dns-team@nlnetlabs.nl or on GitHub at https://github.com/NLnetLabs/ldns/issues. they want to know. fr fr πŸ™ˆ


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. so like, use it, love it, but if it breaks, that's on you bestie πŸ’…


πŸ’œ SEE ALSO πŸ’œ

go read these too, they're the extended universe:


🧚 REMARKS 🧚

This manpage was automatically generated from the ldns source code. yes, a robot wrote it. we just gave it a glow-up ✨

and that's the whole page bestie!! this one's from the ldns library functions manual, dated 30 May 2006 β€” shoutout to that timestamp, it's been holding it down since forever πŸŽ€ chop your labels, count your labels, free your clones, and stay slay πŸ¦‹πŸ’–β­