ldns(3) Library Functions Manual ldns(3)

# [NAME](#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](#SYNOPSIS)

#include &lt;stdint.h&gt;  
#include &lt;stdbool.h&gt;

#include &lt;ldns/ldns.h&gt;

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);

struct sockaddr\_storage * ldns\_rdf2native\_sockaddr\_storage(const ldns\_rdf \*rd, uint16\_t port, size\_t \*size);

time\_t ldns\_rdf2native\_time\_t(const ldns\_rdf \*rd);

# [DESCRIPTION](#DESCRIPTION)

*ldns\_native2rdf\_int8*() returns the rdf containing 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.

Because multiple rdf types can contain an int32, the type must be specified  
**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  
**size**: the size of the data  
**\*data**: pointer to the actual data

Returns ldns\_rd* the rdf with the data

*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*() returns the native sockaddr representation from the rdf.  
**rd**: the ldns\_rdf to operate on  
**port**: what port to use. 0 means; use default (53)  
**size**: what is the size of the sockaddr\_storage  
Returns struct sockaddr* the address in the format so other functions can use it (sendto)

*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](#AUTHOR)

The ldns team at NLnet Labs.

# [REPORTING BUGS](#REPORTING_BUGS)

Please report bugs to dns-team@nlnetlabs.nl or on GitHub at https://github.com/NLnetLabs/ldns/issues

# [COPYRIGHT](#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](#SEE_ALSO)

*ldns\_rdf*. And **perldoc Net::DNS**, **RFC1034**, **RFC1035**, **RFC4033**, **RFC4034** and **RFC4035**.

# [REMARKS](#REMARKS)

This manpage was automatically generated from the ldns source code.

30 May 2006

---

Document: ldns_rdf2native_int16(3) from ldns 1.9.2-r3 (Chainguard OS)
Source: https://github.com/NLnetLabs/ldns.git
