diff --git a/src/libknot/packet/pkt.c b/src/libknot/packet/pkt.c index 8a36d4cab96216bd4611d1b250e811ae64c48783..e44085e692dc6e56a71b969ed46b3bdf302f7a51 100644 --- a/src/libknot/packet/pkt.c +++ b/src/libknot/packet/pkt.c @@ -876,44 +876,6 @@ int knot_pkt_parse_payload(knot_pkt_t *pkt, unsigned flags) /*** <<< #10 DEPRECATED */ /*----------------------------------------------------------------------------*/ -/*! - * \brief Reallocate space for Wildcard nodes. - * - * \retval KNOT_EOK - * \retval KNOT_ENOMEM - */ -static int knot_response_realloc_wc_nodes(const knot_node_t ***nodes, - const knot_dname_t ***snames, - short *max_count, - mm_ctx_t *mm) -{ - - short new_max_count = *max_count + 8; - - const knot_node_t **new_nodes = mm->alloc(mm->ctx, - new_max_count * sizeof(knot_node_t *)); - CHECK_ALLOC_LOG(new_nodes, KNOT_ENOMEM); - - const knot_dname_t **new_snames = mm->alloc(mm->ctx, - new_max_count * sizeof(knot_dname_t *)); - if (new_snames == NULL) { - mm->free(new_nodes); - return KNOT_ENOMEM; - } - - memcpy(new_nodes, *nodes, (*max_count) * sizeof(knot_node_t *)); - memcpy(new_snames, *snames, (*max_count) * sizeof(knot_dname_t *)); - - mm->free(*nodes); - mm->free(*snames); - - *nodes = new_nodes; - *snames = new_snames; - *max_count = new_max_count; - - return KNOT_EOK; -} - int knot_pkt_add_opt(knot_pkt_t *resp, const knot_opt_rr_t *opt_rr, int add_nsid) @@ -967,32 +929,5 @@ int knot_pkt_add_opt(knot_pkt_t *resp, return KNOT_EOK; } -int knot_pkt_add_wildcard_node(knot_pkt_t *response, - const knot_node_t *node, - const knot_dname_t *sname) -{ - if (response == NULL || node == NULL || sname == NULL) { - return KNOT_EINVAL; - } - - if (response->wildcard_nodes.count == response->wildcard_nodes.max - && knot_response_realloc_wc_nodes(&response->wildcard_nodes.nodes, - &response->wildcard_nodes.snames, - &response->wildcard_nodes.max, - &response->mm) != KNOT_EOK) { - return KNOT_ENOMEM; - } - - response->wildcard_nodes.nodes[response->wildcard_nodes.count] = node; - response->wildcard_nodes.snames[response->wildcard_nodes.count] = sname; - ++response->wildcard_nodes.count; - - dbg_response_verb("Current wildcard nodes count: %d, max count: %d\n", - response->wildcard_nodes.count, - response->wildcard_nodes.max); - - return KNOT_EOK; -} - /*** >>> #10 DEPRECATED */ /*----------------------------------------------------------------------------*/ diff --git a/src/libknot/packet/pkt.h b/src/libknot/packet/pkt.h index a6af0eef03e8123e0ea14caea39936fd32b25e3f..6d18ed1f2e19864fed306bb012a94d82f8bb2867 100644 --- a/src/libknot/packet/pkt.h +++ b/src/libknot/packet/pkt.h @@ -42,15 +42,6 @@ /*** <<< #10 DEPRECATED */ /*----------------------------------------------------------------------------*/ -struct knot_wildcard_nodes { - const knot_node_t **nodes; /*!< Wildcard nodes from CNAME processing. */ - const knot_dname_t **snames; /*!< SNAMEs related to the nodes. */ - short count; /*!< Count of items in the previous arrays. */ - short max; /*!< Capacity of the structure (allocated). */ -}; - -typedef struct knot_wildcard_nodes knot_wildcard_nodes_t; - #define KNOT_PKT_IN_AN(pkt) ((pkt)->current == KNOT_ANSWER) #define KNOT_PKT_IN_NS(pkt) ((pkt)->current == KNOT_AUTHORITY) #define KNOT_PKT_IN_AR(pkt) ((pkt)->current == KNOT_ADDITIONAL) @@ -106,9 +97,6 @@ typedef struct knot_pkt { /* #10 <<< SHOULD BE IN ANSWERING CONTEXT */ const knot_tsig_key_t *tsig_key; const struct knot_pkt *query; /*!< Associated query. */ - - /*! \brief Wildcard nodes to be processed for NSEC/NSEC3. */ - knot_wildcard_nodes_t wildcard_nodes; /* #10 >>> SHOULD BE IN ANSWERING CONTEXT */ knot_section_t current; @@ -204,11 +192,6 @@ int knot_pkt_add_opt(knot_pkt_t *resp, const knot_opt_rr_t *opt_rr, int add_nsid); - -int knot_pkt_add_wildcard_node(knot_pkt_t *response, - const knot_node_t *node, - const knot_dname_t *sname); - /*----------------------------------------------------------------------------*/ /*** >>> #10 DEPRECATED */