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) ✨ β€” it's giving "Library Functions Manual", bestie πŸ’…

okay so you found yourself in the ldns(3) manual, which means you're deep in DNS-adjacent C code and honestly? iconic behavior. sit down, hydrate, let's get into it 🫢


πŸŽ€ NAME πŸŽ€

ldns_buffer2pkt_wire β€” convert buffer/wire format to ldns_pkt

like, that's the whole job description. one function. one destiny. main character energy fr fr πŸ’–


🌸 SYNOPSIS 🌸

so this is how you actually pull it into your code, no cap:

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

#include <ldns/ldns.h>

ldns_status ldns_buffer2pkt_wire(ldns_pkt **packet, const ldns_buffer
*buffer);

look at those includes. stdint.h and stdbool.h are just vibing up there, and then the real one: ldns/ldns.h. that's your girl. that's where everything lives πŸ’œ


πŸ¦‹ DESCRIPTION πŸ¦‹

ldns_buffer2pkt_wire() takes the data sitting in your ldns_buffer β€” which is in wire format, aka the raw on-the-wire byte soup β€” and converts it into a proper DNS packet. πŸŽ€

and bestie, important detail: this function will initialize and allocate memory space for the packet structure. so it's not just filling in something you already made β€” it's setting it up for you. obsessed with a function that does the heavy lifting. πŸ’…

here's what the args are giving:

  • packet β€” pointer to the structure that's gonna hold the packet
  • buffer β€” the buffer with the data
  • Returns LDNS_STATUS_OK if everything succeeds, and an error otherwise 😭
so like, always check that return value, okay? LDNS_STATUS_OK means we ate. anything else means something went sideways and you should go look at it. πŸ™ˆ

πŸ‘‘ AUTHOR πŸ‘‘

The ldns team at NLnet Labs. πŸ’– legends, honestly.


πŸ“ REPORTING BUGS πŸ“

found something cursed? Please report bugs to dns-team@nlnetlabs.nl or on GitHub at https://github.com/NLnetLabs/ldns/issues πŸ›βœ¨

like, do it. they wanna know. it's giving "community" and it's giving "please help us make it better". 🫢


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.

okay so real talk: NO WARRANTY. like, none. zero. not even the implied ones. if this thing does something unhinged at 3am, that's on you, bestie πŸ’€ β€” but also it's a BSD license so go wild, just don't come for them legally. πŸ™ˆ

⭐ SEE ALSO ⭐

go read these when you're done here, iykyk:


πŸ’€ REMARKS πŸ’€

This manpage was automatically generated from the ldns source code.

so yeah, no human wrote this prose originally. wild. anyway, we fixed the vibe. 🧚


okay so that's the whole page!! mwah πŸ’‹ written up on 30 May 2006, and it's the ldns(3) page from the ldns library β€” go forth and parse those packets, you absolute icon πŸ‘‘βœ¨