ldns(3)
π ldns(3) β Library Functions Manual π
hiii bestie β¨ okay so this is the manual for a whole little squad of ldns functions β we're in section 3 of the manual, the library-functions zone π
. Collectively they're the lower level conversions crew. No cap.
β¨ NAME β¨
ldns_pkt2buffer_str, ldns_pktheader2buffer_str, ldns_rr2buffer_str, ldns_rr_list2buffer_str, ldns_rdf2buffer_str, ldns_key2buffer_str, ldns_pkt2buffer_wire, ldns_rr2buffer_wire, ldns_rdf2buffer_wire, ldns_rrsig2buffer_wire, ldns_rr_rdata2buffer_wire β lower level conversions π¦
πΈ SYNOPSIS πΈ
#include <stdint.h>
#include <stdbool.h>
#include <ldns/ldns.h>
ldns_status ldns_pkt2buffer_str(ldns_buffer *output, const ldns_pkt *pkt);
ldns_status ldns_pktheader2buffer_str(ldns_buffer *output, const ldns_pkt *pkt);
ldns_status ldns_rr2buffer_str(ldns_buffer *output, const ldns_rr *rr);
ldns_status ldns_rr_list2buffer_str(ldns_buffer *output, const ldns_rr_list *list);
ldns_status ldns_rdf2buffer_str(ldns_buffer *output, const ldns_rdf *rdf);
ldns_status ldns_key2buffer_str(ldns_buffer *output, const ldns_key *k);
ldns_status ldns_pkt2buffer_wire(ldns_buffer *output, const ldns_pkt *pkt);
ldns_status ldns_rr2buffer_wire(ldns_buffer *output, const ldns_rr *rr, int section);
ldns_status ldns_rdf2buffer_wire(ldns_buffer *output, const ldns_rdf *rdf);
ldns_status ldns_rrsig2buffer_wire(ldns_buffer *output, const ldns_rr *sigrr);
ldns_status ldns_rr_rdata2buffer_wire(ldns_buffer *output, const ldns_rr *rr);
π DESCRIPTION π
the way that every single one of these takes a ldns_buffer *output and shoves converted data into itβ¦ it's giving "append, bestie, append" π
. Let's go one by one, no skipping, we're not doing that to each other.
ldns_pkt2buffer_str()
Converts the data in the DNS packet to presentation format (as char *) and appends it to the given buffer πΈ
output: pointer to the buffer to append the data topkt: the pointer to the packet to convert- Returns status
ldns_pktheader2buffer_str()
Converts the header of a packet to presentation format and appends it to the output buffer β¨
output: the buffer to append output topkt: the packet to convert the header of- Returns
ldns_status
ldns_rr2buffer_str()
Converts the data in the resource record to presentation format (as char *) and appends it to the given buffer. Important lore: the presentation format of DNSKEY record is annotated with comments giving the id, type and size of the key. ποΈ
output: pointer to the buffer to append the data torr: the pointer to the rr field to convert- Returns status
ldns_rr_list2buffer_str()
Converts a rr_list to presentation format and appends it to the output buffer π
output: the buffer to append output tolist: theldns_rr_listto print- Returns
ldns_status
ldns_rdf2buffer_str()
Converts the data in the rdata field to presentation format (as char *) and appends it to the given buffer π¦
output: pointer to the buffer to append the data tordf: the pointer to therdafafield containing the data- Returns status
ldns_key2buffer_str()
Converts the data in the DNS packet to presentation format (as char *) and appends it to the given buffer π
output: pointer to the buffer to append the data tok: the pointer to the private key to convert- Returns status
ldns_pkt2buffer_wire()
Copies the packet data to the buffer in wire format π‘
*output: buffer to append the result to*pkt: packet to convert- Returns
ldns_status
ldns_rr2buffer_wire()
Copies the rr data to the buffer in wire format π§
*output: buffer to append the result to*rr: resource record to convertsection: the section in the packet this rr is supposed to be in (to determine whether to add rdata or not)- Returns
ldns_status
ldns_rdf2buffer_wire()
Copies the rdata data to the buffer in wire format β
*output: buffer to append the result to*rdf: rdata to convert- Returns
ldns_status
ldns_rrsig2buffer_wire()
Converts a rrsig to wireformat BUT EXCLUDE the rrsig rdata. This is needed in DNSSEC verification π
output: buffer to append the result tosigrr: signature rr to operate on- Returns
ldns_status
not me reading that twice β the rrsig rdata is EXCLUDED, that's the whole point, it's not optional and it's not a typo. DNSSEC verification needs it that way. periodt π
ldns_rr_rdata2buffer_wire()
Converts an rr's rdata to wireformat, while excluding the ownername and all the stuff before the rdata. This is needed in DNSSEC keytag calculation, the ds calculation from the key and maybe elsewhere. π
*output: buffer where to put the result*rr: rr to operate on- Returns
ldns_status
π 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 β they wanna hear it, fr fr π
π 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_pkt2str, ldns_rr2str, ldns_rdf2str, ldns_rr_list2str, ldns_key2str. And perldoc Net::DNS, RFC1034, RFC1035, RFC4033, RFC4034 and RFC4035. π
π REMARKS π
This manpage was automatically generated from the ldns source code. π€ (yes bestie, a robot wrote it, and I just gave it a makeover π)
and that's the whole thing! π«Ά this page was dated 30 May 2006 and lives in section ldns(3) β so if you ever need to cite it, that's your receipt. slay, go convert some DNS data, ily β¨ππ
π¦ 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