---
name: "ldns_wire2dname"
section: "3"
platform: "linux"
package: "ldns"
version: "1.9.2-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/ldns_wire2dname"
---

# ldns\_wire2dname(3)

convert from wire format to host type

## NAME

ldns\_wire2rr, ldns\_wire2pkt, ldns\_wire2rdf, ldns\_wire2dname - convert from wire format to host type

## SYNOPSIS

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

\#include \<ldns/ldns.h\>

ldns\_status ldns\_wire2rr(ldns\_rr \*\*rr, const uint8\_t \*wire, size\_t max, size\_t \*pos, ldns\_pkt\_section section);

ldns\_status ldns\_wire2pkt(ldns\_pkt \*\*packet, const uint8\_t \*data, size\_t len);

ldns\_status ldns\_wire2rdf(ldns\_rr \*rr, const uint8\_t \*wire, size\_t max, size\_t \*pos);

ldns\_status ldns\_wire2dname(ldns\_rdf \*\*dname, const uint8\_t \*wire, size\_t max, size\_t \*pos);

## DESCRIPTION

*ldns\_wire2rr*() converts the data on the uint8\_t bytearray (in wire format) to a DNS  resource record. This function will initialize and allocate memory space for the rr structure. The length of the wiredata of this rr is added to the \*pos value.

.br **rr**: pointer to the structure to hold the rdata value .br **wire**: pointer to the buffer with the data .br **max**: the length of the data buffer (in bytes) .br **pos**: the position of the rr in the buffer (ie. the number of bytes  from the start of the buffer) .br **section**: the section in the packet the rr is meant for .br Returns LDNS\_STATUS\_OK if everything succeeds, error otherwise

*ldns\_wire2pkt*() converts the data on the uint8\_t bytearray (in wire format) to a DNS packet. This function will initialize and allocate memory space for the packet  structure.

.br **packet**: pointer to the structure to hold the packet .br **data**: pointer to the buffer with the data .br **len**: the length of the data buffer (in bytes) .br Returns LDNS\_STATUS\_OK if everything succeeds, error otherwise

*ldns\_wire2rdf*() converts the data on the uint8\_t bytearray (in wire format) to DNS  rdata fields, and adds them to the list of rdfs of the given rr. This function will initialize and allocate memory space for the dname structures. The length of the wiredata of these rdfs is added to the \*pos value.

All rdfs belonging to the RR are read; the rr should have no rdfs yet. An error is returned if the format cannot be parsed.

.br **rr**: pointer to the ldns\_rr structure to hold the rdata value .br **wire**: pointer to the buffer with the data .br **max**: the length of the data buffer (in bytes) .br **pos**: the position of the rdf in the buffer (ie. the number of bytes  from the start of the buffer) .br Returns LDNS\_STATUS\_OK if everything succeeds, error otherwise

*ldns\_wire2dname*() converts the data on the uint8\_t bytearray (in wire format) to a DNS  dname rdata field. This function will initialize and allocate memory space for the dname structure. The length of the wiredata of this rdf  is added to the \*pos value.

.br **dname**: pointer to the structure to hold the rdata value .br **wire**: pointer to the buffer with the data .br **max**: the length of the data buffer (in bytes) .br **pos**: the position of the rdf in the buffer (ie. the number of bytes  from the start of the buffer) .br Returns LDNS\_STATUS\_OK if everything succeeds, error otherwise

## 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\_rr2wire*, *ldns\_pkt2wire*, *ldns\_rdf2wire*, *ldns\_dname2wire*. And **perldoc Net::DNS**, **RFC1034**, **RFC1035**, **RFC4033**, **RFC4034**  and **RFC4035**.

## REMARKS

This manpage was automatically generated from the ldns source code.
