ldns(3)
π ldns β the library functions manual, bestie edition π
okay so this is ldns(3), the manual for the ldns library. it's giving "DNS but make it a C library", and honestly? iconic. we're talking about conversion functions today β the ones that take your nice cozy structs and yeet them into raw wireformat bytes. let's get into it π¦
β¨ NAME β¨
ldns_rr2wire, ldns_pkt2wire, ldns_rdf2wire β conversion functions π
β¨ SYNOPSIS β¨
#include <stdint.h>
#include <stdbool.h>
#include <ldns/ldns.h>
ldns_status ldns_rr2wire(uint8_t **dest, const ldns_rr *rr, int section,
size_t *size);
ldns_status ldns_pkt2wire(uint8_t **dest, const ldns_pkt *p, size_t
*size);
ldns_status ldns_rdf2wire(uint8_t **dest, const ldns_rdf *rdf, size_t
*size);
like yes bestie, three functions, one vibe: turn stuff into wireformat. no cap. π
β¨ DESCRIPTION β¨
π©· ldns_rr2wire()
it allocates an array of uint8_t at dest, and puts the wireformat of the given rr in that array. the result_size value contains the length of the array, if it succeeds, and 0 otherwise β and in that sad little failure case, the function also returns NULL. π
if the section argument is LDNS_SECTION_QUESTION, data like ttl and rdata are not put into the result. periodt.
destβ pointer to the array of bytes to be createdrrβ the rr to convertsectionβ the rr section, determines how the rr is writtensizeβ the size of the converted result
π©· ldns_pkt2wire()
it allocates an array of uint8_t at dest, and puts the wireformat of the given packet in that array. the result_size value contains the length of the array, if it succeeds, and 0 otherwise β and again, in that case the function also returns NULL. π«Ά
destβ pointer to the array of bytes to be createdpβ the packet to convertsizeβ the size of the converted result
π©· ldns_rdf2wire()
it allocates an array of uint8_t at dest, and puts the wireformat of the given rdf in that array. the result_size value contains the length of the array, if it succeeds, and 0 otherwise β yep, and in that case the function also returns NULL. π
destβ pointer to the array of bytes to be createdrdfβ the rdata field to convertsizeβ the size of the converted result
lowkey the pattern here is: allocate, convert, and if it flops you get0size +NULL. check your return values, bestie, i'm begging π
β¨ AUTHOR β¨
the ldns team at NLnet Labs. π
β¨ REPORTING BUGS β¨
please report bugs to dns-team@nlnetlabs.nl or on GitHub at https://github.com/NLnetLabs/ldns/issues π
β¨ COPYRIGHT β¨
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. β οΈ
β¨ SEE ALSO β¨
ldns_wire2rr, ldns_wire2pkt, ldns_wire2rdf. and perldoc Net::DNS, RFC1034, RFC1035, RFC4033, RFC4034 and RFC4035. π
β¨ REMARKS β¨
this manpage was automatically generated from the ldns source code. π€
okay bestie that's the whole page, mwah π this lil beauty is from the ldns(3) manual, dated 30 May 2006 β yes she's vintage, yes she still slays. go convert some bytes, you've got this ππβ¨
π¦ where this page comes from
- alpine 3.22: ldns-doc 1.8.4-r0 Β· BSD-3-Clause
- alpine 3.23: ldns-doc 1.8.4-r1 Β· BSD-3-Clause
- alpine 3.24: ldns-doc 1.8.4-r1 Β· BSD-3-Clause
- arch rolling: ldns 1.9.2-1 Β· custom:BSD
- debian trixie: libldns-dev 1.8.4-2+b1
- fedora 43: ldns-devel 1.8.4-8.fc43 Β· BSD-3-Clause
- fedora 43: ldns-devel 1.8.4-8.fc43 Β· BSD-3-Clause
- fedora 43: ldns-devel 1.9.2-1.fc43 Β· BSD-3-Clause
- fedora 43: ldns-devel 1.9.2-1.fc43 Β· BSD-3-Clause
- fedora 44: ldns-devel 1.9.0-2.fc44 Β· BSD-3-Clause
- fedora 44: ldns-devel 1.9.0-2.fc44 Β· BSD-3-Clause
- fedora 44: ldns-devel 1.9.2-1.fc44 Β· BSD-3-Clause
- fedora 44: ldns-devel 1.9.2-1.fc44 Β· BSD-3-Clause
- nixos 26.05: ldns 1.9.2
- nixpkgs unstable: ldns 1.9.2
- opensuse-leap 16.0: ldns-devel 1.8.4-160000.3.1 Β· BSD-3-Clause
- opensuse-leap 16.0: ldns-devel 1.8.4-160000.3.1 Β· BSD-3-Clause
- opensuse-leap 16.0: ldns-devel 1.8.4-160000.3.1 Β· BSD-3-Clause
- opensuse-leap 16.0: ldns-devel 1.8.4-160000.3.1 Β· BSD-3-Clause
- ubuntu questing: libldns-dev 1.8.4-2build1
- ubuntu resolute: libldns-dev 1.8.4-2build3
- ubuntu stonking: libldns-dev 1.9.2-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms