Commit f8ac6060 authored by Lubos Slovak's avatar Lubos Slovak

Function for copying domain names.

refs #5
parent 350d5150
......@@ -224,6 +224,14 @@ dnslib_dname_t *dnslib_dname_new_from_wire(const uint8_t *name, uint size,
/*----------------------------------------------------------------------------*/
dnslib_dname_t *dnslib_dname_copy(const dnslib_dname_t *dname)
{
return dnslib_dname_new_from_wire(dname->name, dname->size,
dname->node);
}
/*----------------------------------------------------------------------------*/
char *dnslib_dname_to_str(const dnslib_dname_t *dname)
{
char *name;
......
......@@ -89,6 +89,15 @@ dnslib_dname_t *dnslib_dname_new_from_str(char *name, uint size,
dnslib_dname_t *dnslib_dname_new_from_wire(const uint8_t *name, uint size,
struct dnslib_node *node);
/*!
* \brief Copies the given domain name.
*
* \param dname Domain name to be copied.
*
* \return New domain name which is an exact copy of \a dname.
*/
dnslib_dname_t *dnslib_dname_copy(const dnslib_dname_t *dname);
/*!
* \brief Converts the given domain name to string representation.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment