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 bestie guide to checking your buffer's whole vibe πŸ’–

okay so this is a page from the ldns Library Functions Manual, and babes, it's literally just about checking how your buffer is doing. no drama, just status checks. let's get into it 🫢


✨ NAME ✨

ldns_buffer_remaining_at, ldns_buffer_remaining, ldns_buffer_available_at, ldns_buffer_available, ldns_buffer_status, ldns_buffer_status_ok β€” check buffer status πŸ‘‘

like, the whole point is "how much room do we have, and are we okay?" and honestly? same.


🌸 SYNOPSIS 🌸

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

#include <ldns/ldns.h>

size_t ldns_buffer_remaining_at(const ldns_buffer *buffer, size_t at);

size_t ldns_buffer_remaining(const ldns_buffer *buffer);

int ldns_buffer_available_at(const ldns_buffer *buffer, size_t at,
size_t count);

int ldns_buffer_available(const ldns_buffer *buffer, size_t count);

ldns_status ldns_buffer_status(const ldns_buffer *buffer);

bool ldns_buffer_status_ok(const ldns_buffer *buffer);

no cap, that's the whole cast of characters. six little functions, all main character energy ✨


πŸ’… DESCRIPTION πŸ’…

okay bestie, here's the tea on each one. one at a time, no skipping, we're not doing that πŸ™ˆ


πŸ¦‹ ldns_buffer_remaining_at()

returns the number of bytes remaining between the indicated position and the limit.

  • buffer: the buffer
  • at: indicated position
  • returns: number of bytes

so like, "from this spot right here, how much runway do we have left?" slay.


πŸŽ€ ldns_buffer_remaining()

returns the number of bytes remaining between the buffer's position and limit.

  • buffer: the buffer
  • returns: the number of bytes

same vibe as above but from wherever the buffer's position currently is. the way that it just... measures the gap πŸ’–


πŸ”₯ ldns_buffer_available_at()

checks if the buffer has at least COUNT more bytes available.

⚠️ BESTIE LISTEN. before reading or writing, the caller needs to ensure enough space is available! this is not optional, this is the rule. do not skip the vibe check and then come crying to me 😭
  • buffer: the buffer
  • at: indicated position
  • count: how much is available
  • returns: true or false (as int?)

(the original really does go "as int?" with the question mark, and honestly? the sass. we love an honest manpage πŸ’€)


🌈 ldns_buffer_available()

checks if the buffer has count bytes available at the current position.

  • buffer: the buffer
  • count: how much is available
  • returns: true or false (as int?)

the current-position edition, periodt.


⭐ ldns_buffer_status()

returns the status of the buffer

\param[in] buffer

  • returns: the status

yeah, the original literally has that \param[in] buffer sitting in the middle of the sentence like it wandered in from a doxygen comment and decided to stay. iconic behaviour, we're keeping it exactly as is πŸ’…


πŸ’œ ldns_buffer_status_ok()

returns true if the status of the buffer is LDNS_STATUS_OK, false otherwise.

  • buffer: the buffer
  • returns: true or false

the yes/no girlie of the group. is it okay? is it not? she'll tell you 🫢


πŸ‘‘ AUTHOR πŸ‘‘

the ldns team at NLnet Labs. absolute legends, no notes.


😭 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


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.

like, it's giving "we love you but we're not liable" and honestly, fair πŸ’€

🌸 SEE ALSO 🌸

ldns_buffer. 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.

so yeah, a robot wrote the bones of this and i just gave it a personality. we're both doing our part ✨


and that's the whole page bestie, you ate it, no crumbs left πŸ“ this little gem came from the ldns Library Functions Manual and it's dated 30 May 2006 β€” yes, she's vintage, she's been slaying since before some of us could walk πŸ’…βœ¨ mwah, go check those buffers responsibly 🫢