ldns(3)

πŸ“¦
version 1.9.2 Β· 3 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) β€” 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 to
  • pkt: 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 to
  • pkt: 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 to
  • rr: 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 to
  • list: the ldns_rr_list to 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 to
  • rdf: the pointer to the rdafa field 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 to
  • k: 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 convert
  • section: 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 to
  • sigrr: 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 (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 βœ¨πŸŽ€πŸ’œ