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 β€” the ldns_rr_push_rdf / ldns_rr_pop_rdf page

okay bestie, you found the ldns manual page, specifically the little corner of it about pushing and popping rdata fields. it's giving tiny but mighty ✨ and honestly? kinda iconic.


πŸŽ€ NAME πŸŽ€

ldns_rr_push_rdf, ldns_rr_pop_rdf β€” push and pop rdata fields 🫢

🌸 SYNOPSIS 🌸

first things first, you gotta bring in the headers, no cap:

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

#include <ldns/ldns.h>

and here's the two functions, exactly as they are, do not freestyle them:

bool ldns_rr_push_rdf(ldns_rr *rr, const ldns_rdf *f);

ldns_rdf* ldns_rr_pop_rdf(ldns_rr *rr);

πŸ’– DESCRIPTION πŸ’–

so, two besties, one resource record. let's get into it.

ldns_rr_push_rdf()

ldns_rr_push_rdf() sets the rd_field member β€” and the way it works is it slides it into the next available spot. no skipping, no drama, it just goes to the next free slot. πŸ¦‹

  • *rr β€” the rr you're operating on
  • *f β€” the data field member you wanna set
  • Returns bool

ldns_rr_pop_rdf()

ldns_rr_pop_rdf() removes a rd_field member, and it gets popped from the last position. last in, first out, periodt. πŸ’…

  • *rr β€” the rr you're operating on
  • Returns the rdf which was popped (null if nothing)
not me reminding you that popping an empty thing gives you null 😭 it's literally in the docs, null if nothing, so handle that case or suffer.

πŸ‘‘ AUTHOR πŸ‘‘

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

πŸ’€ 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, 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. read that again, bestie, no warranty, not even the fitness-for-a-particular-purpose one. so don't come for them if it breaks. 😭

🌈 SEE ALSO 🌈

ldns_rr, ldns_rr_list. And perldoc Net::DNS, RFC1034, RFC1035, RFC4033, RFC4034 and RFC4035. go read them, iykyk. πŸ“š

🧚 REMARKS 🧚

This manpage was automatically generated from the ldns source code. yes, a robot wrote it originally, and now a girl on the internet rewrote the robot. circle of life. πŸŽ€


and that's the whole page, bestie β€” ldns(3), dated 30 May 2006, straight from the ldns library functions manual. mwah. πŸ’‹ ✨