Skip to content
Snippets Groups Projects
Commit 5e0ac678 authored by Lubos Slovak's avatar Lubos Slovak
Browse files

API for removing RRSet from node +getting new node

parent fb257e72
No related branches found
No related tags found
No related merge requests found
......@@ -220,6 +220,18 @@ dnslib_rrset_t *dnslib_node_get_rrset(dnslib_node_t *node, uint16_t type)
/*----------------------------------------------------------------------------*/
dnslib_rrset_t *dnslib_node_remove_rrset(dnslib_node_t *node, uint16_t type)
{
dnslib_rrset_t *rrset =
(dnslib_rrset_t *)skip_find(node->rrsets, (void *)&type);
if (rrset != NULL) {
skip_remove(node->rrsets, (void *)&type, NULL, NULL);
}
return rrset;
}
/*----------------------------------------------------------------------------*/
short dnslib_node_rrset_count(const dnslib_node_t *node)
{
return node->rrset_count;
......@@ -361,6 +373,13 @@ const dnslib_node_t *dnslib_node_new_node(const dnslib_node_t *node)
/*----------------------------------------------------------------------------*/
dnslib_node_t *dnslib_node_get_new_node(const dnslib_node_t *node)
{
return node->new_node;
}
/*----------------------------------------------------------------------------*/
void dnslib_node_set_new_node(dnslib_node_t *node,
dnslib_node_t *new_node)
{
......
......@@ -120,6 +120,8 @@ const dnslib_rrset_t *dnslib_node_rrset(const dnslib_node_t *node,
*/
dnslib_rrset_t *dnslib_node_get_rrset(dnslib_node_t *node, uint16_t type);
dnslib_rrset_t *dnslib_node_remove_rrset(dnslib_node_t *node, uint16_t type);
/*!
* \brief Returns number of RRSets in the node.
*
......@@ -254,6 +256,8 @@ void dnslib_node_set_wildcard_child(dnslib_node_t *node,
const dnslib_node_t *dnslib_node_new_node(const dnslib_node_t *node);
dnslib_node_t *dnslib_node_get_new_node(const dnslib_node_t *node);
void dnslib_node_set_new_node(dnslib_node_t *node,
dnslib_node_t *new_node);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment