ldns(3)
π 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 nativeuint8_trepr π- type: the
ldns_rdftype to use - value: the
uint8_tto use - Returns
ldns_rdf*with the converted value
- type: the
ldns_native2rdf_int16()β returns the rdf containing the nativeuint16_trepresentation β¨- type: the
ldns_rdftype to use - value: the
uint16_tto use - Returns
ldns_rdf*with the converted value
- type: the
ldns_native2rdf_int32()β returns an rdf that contains the givenint32value π«Ά
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_rdftype to use - value: the
uint32_tto use - Returns
ldns_rdf*with the converted value
ldns_native2rdf_int16_data()β returns anint16_datardf that contains the data in the given array, preceded by anint16specifying 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 nativeuint8_trepresentation from the rdf π- rd: the
ldns_rdfto operate on - Returns
uint8_tthe value extracted
- rd: the
ldns_rdf2native_int16()β returns the nativeuint16_trepresentation from the rdf β- rd: the
ldns_rdfto operate on - Returns
uint16_tthe value extracted
- rd: the
ldns_rdf2native_int32()β returns the nativeuint32_trepresentation from the rdf π₯- rd: the
ldns_rdfto operate on - Returns
uint32_tthe value extracted
- rd: the
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 nativetime_trepresentation from the rdf π- rd: the
ldns_rdfto operate on - Returns
time_tthe value extracted (32 bits currently)
- rd: the
π 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 πΈ
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 ππ¦
π¦ 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
- 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