ldns(3)

πŸ“¦
version 1.9.2 Β· 3 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, 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 πŸ’…

okay so bestie, welcome to the ldns numeric conversion zone ✨ this is one of those pages where the C library just hands you a lil toolkit for turning plain old native numbers into ldns rdf things, and turning rdf things back into plain old native numbers. it's giving glorified type-casting but make it DNS πŸ¦‹


🌸 NAME 🌸

ldns_native2rdf_int8, ldns_native2rdf_int16, ldns_native2rdf_int32, ldns_native2rdf_int16_data, ldns_rdf2native_int8, ldns_rdf2native_int16, ldns_rdf2native_int32, ldns_rdf2native_sockaddr_storage, ldns_rdf2native_time_t β€” rdf numeric conversion functions πŸ’œ


✨ SYNOPSIS ✨

like, here's the whole cast of characters, no cap:

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

#include <ldns/ldns.h>

ldns_rdf* ldns_native2rdf_int8(ldns_rdf_type type, uint8_t value);

ldns_rdf* ldns_native2rdf_int16(ldns_rdf_type type, uint16_t value);

ldns_rdf* ldns_native2rdf_int32(ldns_rdf_type type, uint32_t value);

ldns_rdf* ldns_native2rdf_int16_data(size_t size, uint8_t *data);

uint8_t ldns_rdf2native_int8(const ldns_rdf *rd);

uint16_t ldns_rdf2native_int16(const ldns_rdf *rd);

uint32_t ldns_rdf2native_int32(const ldns_rdf *rd);

 ldns_rdf2native_sockaddr_storage();

time_t ldns_rdf2native_time_t(const ldns_rdf *rd);

πŸŽ€ DESCRIPTION πŸŽ€

okay so it's basically two directions, bestie: native β†’ rdf and rdf β†’ native. the first four make rdfs out of your numbers, the last bunch pull numbers back out. let's go one by one πŸ‘‘

🌈 the native β†’ rdf girlies

  • ldns_native2rdf_int8() β€” hands you back the rdf holding the native uint8_t repr πŸ’–
    • type: the ldns_rdf type to use
    • value: the uint8_t to use
    • Returns ldns_rdf* with the converted value
  • ldns_native2rdf_int16() β€” returns the rdf containing the native uint16_t representation ✨
    • type: the ldns_rdf type to use
    • value: the uint16_t to use
    • Returns ldns_rdf* with the converted value
  • ldns_native2rdf_int32() β€” returns an rdf that contains the given int32 value 🫢
bestie listen: because multiple rdf types can contain an int32, the type must be specified. it's not optional, she needs to know what she's cooking.
  • type: the ldns_rdf type to use
  • value: the uint32_t to use
  • Returns ldns_rdf* with the converted value
  • ldns_native2rdf_int16_data() β€” returns an int16_data rdf that contains the data in the given array, preceded by an int16 specifying the length 🌸
the memory is copied, and an LDNS_RDF_TYPE_INT16DATA is returned. so like, you're safe, she made her own copy πŸ’…
  • size: the size of the data
  • data: pointer to the actual data
  • Returns ldns_rd* the rdf with the data

πŸ¦‹ the rdf β†’ native girlies

  • ldns_rdf2native_int8() β€” returns the native uint8_t representation from the rdf πŸ’œ
    • rd: the ldns_rdf to operate on
    • Returns uint8_t the value extracted
  • ldns_rdf2native_int16() β€” returns the native uint16_t representation from the rdf ⭐
    • rd: the ldns_rdf to operate on
    • Returns uint16_t the value extracted
  • ldns_rdf2native_int32() β€” returns the native uint32_t representation from the rdf πŸ”₯
    • rd: the ldns_rdf to operate on
    • Returns uint32_t the value extracted
  • ldns_rdf2native_sockaddr_storage() β€” that's it. that's the whole entry. she's mysterious, she's iconic, the manpage said nothing else and honestly? respect πŸ™ˆ
  • ldns_rdf2native_time_t() β€” returns the native time_t representation from the rdf πŸŽ€
    • rd: the ldns_rdf to operate on
    • Returns time_t the value extracted (32 bits currently)

πŸ‘‘ AUTHOR πŸ‘‘

the ldns team at NLnet Labs. legends only, fr fr 🫢


πŸ’€ REPORTING BUGS πŸ’€

found something cursed? please report bugs to dns-team@nlnetlabs.nl or on GitHub at https://github.com/NLnetLabs/ldns/issues β€” they wanna know, bestie, don't gatekeep πŸ›


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.

no cap, that all-caps bit is doing the most but it's legally required so we keep it. she's serious 😭

🌈 SEE ALSO 🌈

ldns_rdf. And perldoc Net::DNS, RFC1034, RFC1035, RFC4033, RFC4034 and RFC4035.


🧚 REMARKS 🧚

This manpage was automatically generated from the ldns source code. so if something reads a lil robotic, blame the generator, not the vibes πŸ’…


okay and that's the whole page, bestie πŸ’– this was ldns(3) from the Library Functions Manual, dated 30 May 2006 β€” yeah she's an elder but she ate and left no crumbs πŸ‘‘βœ¨ mwah, go convert some numbers πŸŽ€πŸ¦‹