---
name: "ldns_rdf_clone"
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_rdf_clone"
---

# ldns\_rdf\_clone(3)

ldns\_rdf creation, destruction and printing

## NAME

ldns\_rdf\_new, ldns\_rdf\_clone, ldns\_rdf\_new\_frm\_data, ldns\_rdf\_new\_frm\_str, ldns\_rdf\_new\_frm\_fp, ldns\_rdf\_free, ldns\_rdf\_deep\_free, ldns\_rdf\_print - ldns\_rdf creation, destruction and printing

## SYNOPSIS

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

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

ldns\_rdf\* ldns\_rdf\_new(ldns\_rdf\_type type, size\_t size, void \*data);

ldns\_rdf\* ldns\_rdf\_clone(const ldns\_rdf \*rd);

ldns\_rdf\* ldns\_rdf\_new\_frm\_data(ldns\_rdf\_type type, size\_t size, const void \*data);

ldns\_rdf\* ldns\_rdf\_new\_frm\_str(ldns\_rdf\_type type, const char \*str);

ldns\_status ldns\_rdf\_new\_frm\_fp(ldns\_rdf \*\*r, ldns\_rdf\_type type, FILE \*fp);

void ldns\_rdf\_free(ldns\_rdf \*rd);

void ldns\_rdf\_deep\_free(ldns\_rdf \*rd);

void ldns\_rdf\_print(FILE \*output, const ldns\_rdf \*rdf);

## DESCRIPTION

*ldns\_rdf\_new*() allocates a new rdf structure and fills it. This function DOES NOT copy the contents from the buffer, unlike ldns\_rdf\_new\_frm\_data() .br **type**: type of the rdf .br **size**: size of the buffer .br **data**: pointer to the buffer to be copied .br Returns the new rdf structure or NULL on failure

*ldns\_rdf\_clone*() clones a rdf structure. The data is copied. .br **rd**: rdf to be copied .br Returns a new rdf structure

*ldns\_rdf\_new\_frm\_data*() allocates a new rdf structure and fills it. This function \_does\_ copy the contents from the buffer, unlike ldns\_rdf\_new() .br **type**: type of the rdf .br **size**: size of the buffer .br **data**: pointer to the buffer to be copied .br Returns the new rdf structure or NULL on failure

*ldns\_rdf\_new\_frm\_str*() creates a new rdf from a string. .br **type**: type to use .br **str**: string to use .br Returns ldns\_rdf\* or NULL in case of an error

*ldns\_rdf\_new\_frm\_fp*() creates a new rdf from a file containing a string. .br **r**: the new rdf .br **type**: type to use .br **fp**: the file pointer  to use .br Returns LDNS\_STATUS\_OK or the error

*ldns\_rdf\_free*() frees a rdf structure, leaving the data pointer intact. .br **rd**: the pointer to be freed .br Returns void

*ldns\_rdf\_deep\_free*() frees a rdf structure \_and\_ frees the data. rdf should be created with \_new\_frm\_data .br **rd**: the rdf structure to be freed .br Returns void

*ldns\_rdf\_print*() Prints the data in the rdata field to the given file stream (in presentation format)

.br **output**: the file stream to print to .br **rdf**: the rdata field to print .br Returns void

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

## REMARKS

This manpage was automatically generated from the ldns source code.
