Commit d49b3d45 authored by Lubos Slovak's avatar Lubos Slovak

Changed prefix of all dnslib functions to knot_

refs #1087
parent 26160049
......@@ -14,21 +14,21 @@ static const size_t DNSLIB_CHANGESET_RRSET_STEP = 5;
/*----------------------------------------------------------------------------*/
static int dnslib_changeset_check_count(dnslib_rrset_t ***rrsets, size_t count,
static int knot_changeset_check_count(knot_rrset_t ***rrsets, size_t count,
size_t *allocated)
{
// this should also do for the initial case (*rrsets == NULL)
if (count == *allocated) {
dnslib_rrset_t **rrsets_new = (dnslib_rrset_t **)calloc(
knot_rrset_t **rrsets_new = (knot_rrset_t **)calloc(
*allocated + DNSLIB_CHANGESET_RRSET_STEP,
sizeof(dnslib_rrset_t *));
sizeof(knot_rrset_t *));
if (rrsets_new == NULL) {
return DNSLIB_ENOMEM;
}
memcpy(rrsets_new, *rrsets, count);
dnslib_rrset_t **rrsets_old = *rrsets;
knot_rrset_t **rrsets_old = *rrsets;
*rrsets = rrsets_new;
*allocated += DNSLIB_CHANGESET_RRSET_STEP;
free(rrsets_old);
......@@ -39,24 +39,24 @@ static int dnslib_changeset_check_count(dnslib_rrset_t ***rrsets, size_t count,
/*----------------------------------------------------------------------------*/
static int dnslib_changeset_rrsets_match(const dnslib_rrset_t *rrset1,
const dnslib_rrset_t *rrset2)
static int knot_changeset_rrsets_match(const knot_rrset_t *rrset1,
const knot_rrset_t *rrset2)
{
return dnslib_rrset_compare(rrset1, rrset2, DNSLIB_RRSET_COMPARE_HEADER)
&& (dnslib_rrset_type(rrset1) != DNSLIB_RRTYPE_RRSIG
|| dnslib_rdata_rrsig_type_covered(
dnslib_rrset_rdata(rrset1))
== dnslib_rdata_rrsig_type_covered(
dnslib_rrset_rdata(rrset2)));
return knot_rrset_compare(rrset1, rrset2, DNSLIB_RRSET_COMPARE_HEADER)
&& (knot_rrset_type(rrset1) != DNSLIB_RRTYPE_RRSIG
|| knot_rdata_rrsig_type_covered(
knot_rrset_rdata(rrset1))
== knot_rdata_rrsig_type_covered(
knot_rrset_rdata(rrset2)));
}
/*----------------------------------------------------------------------------*/
int dnslib_changeset_allocate(dnslib_changesets_t **changesets)
int knot_changeset_allocate(knot_changesets_t **changesets)
{
// create new changesets
*changesets = (dnslib_changesets_t *)(
calloc(1, sizeof(dnslib_changesets_t)));
*changesets = (knot_changesets_t *)(
calloc(1, sizeof(knot_changesets_t)));
if (*changesets == NULL) {
return DNSLIB_ENOMEM;
......@@ -66,16 +66,16 @@ int dnslib_changeset_allocate(dnslib_changesets_t **changesets)
assert((*changesets)->count == 0);
assert((*changesets)->sets = NULL);
return dnslib_changesets_check_size(*changesets);
return knot_changesets_check_size(*changesets);
}
/*----------------------------------------------------------------------------*/
int dnslib_changeset_add_rrset(dnslib_rrset_t ***rrsets,
int knot_changeset_add_rrset(knot_rrset_t ***rrsets,
size_t *count, size_t *allocated,
dnslib_rrset_t *rrset)
knot_rrset_t *rrset)
{
int ret = dnslib_changeset_check_count(rrsets, *count, allocated);
int ret = knot_changeset_check_count(rrsets, *count, allocated);
if (ret != DNSLIB_EOK) {
return ret;
}
......@@ -87,39 +87,39 @@ int dnslib_changeset_add_rrset(dnslib_rrset_t ***rrsets,
/*----------------------------------------------------------------------------*/
int dnslib_changeset_add_rr(dnslib_rrset_t ***rrsets, size_t *count,
size_t *allocated, dnslib_rrset_t *rr)
int knot_changeset_add_rr(knot_rrset_t ***rrsets, size_t *count,
size_t *allocated, knot_rrset_t *rr)
{
// try to find the RRSet in the list of RRSets
int i = 0;
while (i < *count && !dnslib_changeset_rrsets_match((*rrsets)[i], rr)) {
while (i < *count && !knot_changeset_rrsets_match((*rrsets)[i], rr)) {
++i;
}
if (i < *count) {
// found RRSet to merge the new one into
if (dnslib_rrset_merge((void **)&(*rrsets)[i],
if (knot_rrset_merge((void **)&(*rrsets)[i],
(void **)&rr) != DNSLIB_EOK) {
return DNSLIB_ERROR;
}
// remove the RR
dnslib_rrset_deep_free(&rr, 1, 1, 1);
knot_rrset_deep_free(&rr, 1, 1, 1);
return DNSLIB_EOK;
} else {
return dnslib_changeset_add_rrset(rrsets, count, allocated, rr);
return knot_changeset_add_rrset(rrsets, count, allocated, rr);
}
}
/*----------------------------------------------------------------------------*/
int dnslib_changeset_add_new_rr(dnslib_changeset_t *changeset,
dnslib_rrset_t *rrset,
int knot_changeset_add_new_rr(knot_changeset_t *changeset,
knot_rrset_t *rrset,
xfrin_changeset_part_t part)
{
dnslib_rrset_t ***rrsets = NULL;
knot_rrset_t ***rrsets = NULL;
size_t *count = NULL;
size_t *allocated = NULL;
......@@ -142,7 +142,7 @@ int dnslib_changeset_add_new_rr(dnslib_changeset_t *changeset,
assert(count != NULL);
assert(allocated != NULL);
int ret = dnslib_changeset_add_rr(rrsets, count, allocated, rrset);
int ret = knot_changeset_add_rr(rrsets, count, allocated, rrset);
if (ret != DNSLIB_EOK) {
return ret;
}
......@@ -152,25 +152,25 @@ int dnslib_changeset_add_new_rr(dnslib_changeset_t *changeset,
/*----------------------------------------------------------------------------*/
void dnslib_changeset_store_soa(dnslib_rrset_t **chg_soa,
uint32_t *chg_serial, dnslib_rrset_t *soa)
void knot_changeset_store_soa(knot_rrset_t **chg_soa,
uint32_t *chg_serial, knot_rrset_t *soa)
{
*chg_soa = soa;
*chg_serial = dnslib_rdata_soa_serial(dnslib_rrset_rdata(soa));
*chg_serial = knot_rdata_soa_serial(knot_rrset_rdata(soa));
}
/*----------------------------------------------------------------------------*/
int dnslib_changeset_add_soa(dnslib_changeset_t *changeset, dnslib_rrset_t *soa,
int knot_changeset_add_soa(knot_changeset_t *changeset, knot_rrset_t *soa,
xfrin_changeset_part_t part)
{
switch (part) {
case XFRIN_CHANGESET_ADD:
dnslib_changeset_store_soa(&changeset->soa_to,
knot_changeset_store_soa(&changeset->soa_to,
&changeset->serial_to, soa);
break;
case XFRIN_CHANGESET_REMOVE:
dnslib_changeset_store_soa(&changeset->soa_from,
knot_changeset_store_soa(&changeset->soa_from,
&changeset->serial_from, soa);
break;
default:
......@@ -183,19 +183,19 @@ int dnslib_changeset_add_soa(dnslib_changeset_t *changeset, dnslib_rrset_t *soa,
/*---------------------------------------------------------------------------*/
int dnslib_changesets_check_size(dnslib_changesets_t *changesets)
int knot_changesets_check_size(knot_changesets_t *changesets)
{
if (changesets->allocated == changesets->count) {
dnslib_changeset_t *sets = (dnslib_changeset_t *)calloc(
knot_changeset_t *sets = (knot_changeset_t *)calloc(
changesets->allocated + DNSLIB_CHANGESET_STEP,
sizeof(dnslib_changeset_t));
sizeof(knot_changeset_t));
if (sets == NULL) {
return DNSLIB_ENOMEM;
}
/*! \todo realloc() may be more effective. */
memcpy(sets, changesets->sets, changesets->count);
dnslib_changeset_t *old_sets = changesets->sets;
knot_changeset_t *old_sets = changesets->sets;
changesets->sets = sets;
changesets->count += DNSLIB_CHANGESET_STEP;
free(old_sets);
......@@ -206,7 +206,7 @@ int dnslib_changesets_check_size(dnslib_changesets_t *changesets)
/*----------------------------------------------------------------------------*/
void dnslib_free_changesets(dnslib_changesets_t **changesets)
void knot_free_changesets(knot_changesets_t **changesets)
{
if (changesets == NULL || *changesets == NULL) {
return;
......@@ -215,7 +215,7 @@ void dnslib_free_changesets(dnslib_changesets_t **changesets)
assert((*changesets)->allocated >= (*changesets)->count);
for (int i = 0; i < (*changesets)->count; ++i) {
dnslib_changeset_t *ch = &(*changesets)->sets[i];
knot_changeset_t *ch = &(*changesets)->sets[i];
assert(ch->add_allocated >= ch->add_count);
assert(ch->remove_allocated >= ch->remove_count);
......@@ -223,17 +223,17 @@ void dnslib_free_changesets(dnslib_changesets_t **changesets)
int j;
for (j = 0; i < ch->add_count; ++j) {
dnslib_rrset_deep_free(&ch->add[j], 1, 1, 1);
knot_rrset_deep_free(&ch->add[j], 1, 1, 1);
}
free(ch->add);
for (j = 0; i < ch->remove_count; ++j) {
dnslib_rrset_deep_free(&ch->add[j], 1, 1, 1);
knot_rrset_deep_free(&ch->add[j], 1, 1, 1);
}
free(ch->remove);
dnslib_rrset_deep_free(&ch->soa_from, 1, 1, 1);
dnslib_rrset_deep_free(&ch->soa_to, 1, 1, 1);
knot_rrset_deep_free(&ch->soa_from, 1, 1, 1);
knot_rrset_deep_free(&ch->soa_to, 1, 1, 1);
free(ch->data);
}
......
......@@ -22,13 +22,13 @@
* \todo Preallocation of space for changeset.
*/
typedef struct {
dnslib_rrset_t *soa_from;
dnslib_rrset_t **remove;
knot_rrset_t *soa_from;
knot_rrset_t **remove;
size_t remove_count;
size_t remove_allocated;
dnslib_rrset_t *soa_to;
dnslib_rrset_t **add;
knot_rrset_t *soa_to;
knot_rrset_t **add;
size_t add_count;
size_t add_allocated;
......@@ -37,15 +37,15 @@ typedef struct {
size_t allocated;
uint32_t serial_from;
uint32_t serial_to;
} dnslib_changeset_t;
} knot_changeset_t;
/*----------------------------------------------------------------------------*/
typedef struct {
dnslib_changeset_t *sets;
knot_changeset_t *sets;
size_t count;
size_t allocated;
} dnslib_changesets_t;
} knot_changesets_t;
/*----------------------------------------------------------------------------*/
......@@ -56,28 +56,28 @@ typedef enum {
/*----------------------------------------------------------------------------*/
int dnslib_changeset_allocate(dnslib_changesets_t **changesets);
int knot_changeset_allocate(knot_changesets_t **changesets);
int dnslib_changeset_add_rrset(dnslib_rrset_t ***rrsets,
int knot_changeset_add_rrset(knot_rrset_t ***rrsets,
size_t *count, size_t *allocated,
dnslib_rrset_t *rrset);
knot_rrset_t *rrset);
int dnslib_changeset_add_rr(dnslib_rrset_t ***rrsets, size_t *count,
size_t *allocated, dnslib_rrset_t *rr);
int knot_changeset_add_rr(knot_rrset_t ***rrsets, size_t *count,
size_t *allocated, knot_rrset_t *rr);
int dnslib_changeset_add_new_rr(dnslib_changeset_t *changeset,
dnslib_rrset_t *rrset,
int knot_changeset_add_new_rr(knot_changeset_t *changeset,
knot_rrset_t *rrset,
xfrin_changeset_part_t part);
void dnslib_changeset_store_soa(dnslib_rrset_t **chg_soa,
uint32_t *chg_serial, dnslib_rrset_t *soa);
void knot_changeset_store_soa(knot_rrset_t **chg_soa,
uint32_t *chg_serial, knot_rrset_t *soa);
int dnslib_changeset_add_soa(dnslib_changeset_t *changeset, dnslib_rrset_t *soa,
int knot_changeset_add_soa(knot_changeset_t *changeset, knot_rrset_t *soa,
xfrin_changeset_part_t part);
int dnslib_changesets_check_size(dnslib_changesets_t *changesets);
int knot_changesets_check_size(knot_changesets_t *changesets);
void dnslib_free_changesets(dnslib_changesets_t **changesets);
void knot_free_changesets(knot_changesets_t **changesets);
#endif /* _KNOT_DNSLIB_CHANGESETS_H_ */
......
......@@ -18,14 +18,14 @@
/*
* OPCODEs
*/
typedef enum dnslib_opcode {
typedef enum knot_opcode {
DNSLIB_OPCODE_QUERY = 0, /* a standard query (QUERY) */
DNSLIB_OPCODE_IQUERY = 1, /* an inverse query (IQUERY) */
DNSLIB_OPCODE_STATUS = 2, /* a server status request (STATUS) */
DNSLIB_OPCODE_NOTIFY = 4, /* NOTIFY */
DNSLIB_OPCODE_UPDATE = 5, /* Dynamic update */
DNSLIB_OPCODE_OFFSET = 14
} dnslib_opcode_t;
} knot_opcode_t;
/*!
* \brief Query types (internal use only).
......@@ -33,7 +33,7 @@ typedef enum dnslib_opcode {
* This type encompasses the different query types distinguished by both the
* OPCODE and the QTYPE.
*/
typedef enum dnslib_packet_type {
typedef enum knot_packet_type {
DNSLIB_QUERY_NORMAL, /*!< Normal query. */
DNSLIB_QUERY_AXFR, /*!< Request for AXFR transfer. */
DNSLIB_QUERY_IXFR, /*!< Request for IXFR transfer. */
......@@ -43,12 +43,12 @@ typedef enum dnslib_packet_type {
DNSLIB_RESPONSE_AXFR, /*!< AXFR transfer response. */
DNSLIB_RESPONSE_IXFR, /*!< IXFR transfer response. */
DNSLIB_RESPONSE_NOTIFY /*!< NOTIFY response. */
} dnslib_packet_type_t;
} knot_packet_type_t;
/*
* RCODEs
*/
typedef enum dnslib_rcode {
typedef enum knot_rcode {
DNSLIB_RCODE_NOERROR = 0, /* No error condition */
DNSLIB_RCODE_FORMERR = 1, /* Format error */
DNSLIB_RCODE_SERVFAIL = 2, /* Server failure */
......@@ -60,27 +60,27 @@ typedef enum dnslib_rcode {
DNSLIB_RCODE_NXRRSET = 8, /* rrset does not exist */
DNSLIB_RCODE_NOTAUTH = 9, /* server not authoritative */
DNSLIB_RCODE_NOTZONE = 10 /* name not inside zone */
} dnslib_rcode_t;
} knot_rcode_t;
/*
* CLASSes
*/
//typedef enum dnslib_class {
//typedef enum knot_class {
// DNSLIB_CLASS_IN = 1, /* Class IN */
// DNSLIB_CLASS_CS = 2, /* Class CS */
// DNSLIB_CLASS_CH = 3, /* Class CHAOS */
// DNSLIB_CLASS_HS = 4, /* Class HS */
// DNSLIB_CLASS_NONE = 254, /* Class NONE rfc2136 */
// DNSLIB_CLASS_ANY = 255 /* Class ANY */
//} dnslib_class_t;
//} knot_class_t;
/*
* Other
*/
typedef enum dnslib_const {
typedef enum knot_const {
DNSLIB_MAX_DNAME_LENGTH = 255,
DNSLIB_MAX_DNAME_LABELS = 127 // 1-char labels
} dnslib_const_t;
} knot_const_t;
#endif /* _KNOT_DNSLIB_CONSTS_H_ */
......
......@@ -9,7 +9,7 @@
#include "dnslib/dnslib.h"
#include "common/print.h"
void dnslib_rdata_dump(dnslib_rdata_t *rdata, uint32_t type, char loaded_zone)
void knot_rdata_dump(knot_rdata_t *rdata, uint32_t type, char loaded_zone)
{
#if defined(DNSLIB_ZONE_DEBUG) || defined(DNSLIB_RDATA_DEBUG)
printf(" ------- RDATA -------\n");
......@@ -18,7 +18,7 @@ void dnslib_rdata_dump(dnslib_rdata_t *rdata, uint32_t type, char loaded_zone)
printf(" ------- RDATA -------\n");
return;
}
dnslib_rrtype_descriptor_t *desc = dnslib_rrtype_descriptor_by_type(type);
knot_rrtype_descriptor_t *desc = knot_rrtype_descriptor_by_type(type);
assert(desc != NULL);
char *name;
......@@ -27,14 +27,14 @@ void dnslib_rdata_dump(dnslib_rdata_t *rdata, uint32_t type, char loaded_zone)
desc->wireformat[i] == DNSLIB_RDATA_WF_UNCOMPRESSED_DNAME ||
desc->wireformat[i] == DNSLIB_RDATA_WF_LITERAL_DNAME ) {
assert(rdata->items[i].dname != NULL);
name = dnslib_dname_to_str(rdata->items[i].dname);
name = knot_dname_to_str(rdata->items[i].dname);
printf(" DNAME: %d: %s\n",
i, name);
free(name);
if (loaded_zone) {
if (rdata->items[i].dname->node) {
name =
dnslib_dname_to_str(rdata->items[i].dname->node->owner);
knot_dname_to_str(rdata->items[i].dname->node->owner);
printf(" Has node owner: %s\n", name);
free(name);
} else {
......@@ -59,21 +59,21 @@ void dnslib_rdata_dump(dnslib_rdata_t *rdata, uint32_t type, char loaded_zone)
#endif
}
void dnslib_rrset_dump(dnslib_rrset_t *rrset, char loaded_zone)
void knot_rrset_dump(knot_rrset_t *rrset, char loaded_zone)
{
#if defined(DNSLIB_ZONE_DEBUG) || defined(DNSLIB_RRSET_DEBUG)
printf(" ------- RRSET -------\n");
printf(" %p\n", rrset);
char *name = dnslib_dname_to_str(rrset->owner);
char *name = knot_dname_to_str(rrset->owner);
printf(" owner: %s\n", name);
free(name);
printf(" type: %s\n", dnslib_rrtype_to_string(rrset->type));
printf(" type: %s\n", knot_rrtype_to_string(rrset->type));
printf(" class: %d\n", rrset->rclass);
printf(" ttl: %d\n", rrset->ttl);
printf(" RRSIGs:\n");
if (rrset->rrsigs != NULL) {
dnslib_rrset_dump(rrset->rrsigs, loaded_zone);
knot_rrset_dump(rrset->rrsigs, loaded_zone);
} else {
printf(" none\n");
}
......@@ -84,48 +84,48 @@ void dnslib_rrset_dump(dnslib_rrset_t *rrset, char loaded_zone)
return;
}
dnslib_rdata_t *tmp = rrset->rdata;
knot_rdata_t *tmp = rrset->rdata;
while (tmp->next != rrset->rdata) {
dnslib_rdata_dump(tmp, rrset->type, loaded_zone);
knot_rdata_dump(tmp, rrset->type, loaded_zone);
tmp = tmp->next;
}
dnslib_rdata_dump(tmp, rrset->type, loaded_zone);
knot_rdata_dump(tmp, rrset->type, loaded_zone);
printf(" ------- RRSET -------\n");
#endif
}
void dnslib_node_dump(dnslib_node_t *node, void *loaded_zone)
void knot_node_dump(knot_node_t *node, void *loaded_zone)
{
#if defined(DNSLIB_ZONE_DEBUG) || defined(DNSLIB_NODE_DEBUG)
//char loaded_zone = *((char*) data);
char *name;
printf("------- NODE --------\n");
name = dnslib_dname_to_str(node->owner);
name = knot_dname_to_str(node->owner);
printf("owner: %s\n", name);
free(name);
printf("labels: ");
hex_print((char *)node->owner->labels, node->owner->label_count);
printf("node/id: %p\n", node->owner->node);
if (loaded_zone && node->prev != NULL) {
name = dnslib_dname_to_str(node->prev->owner);
name = knot_dname_to_str(node->prev->owner);
printf("previous node: %s\n", name);
free(name);
}
if (dnslib_node_is_deleg_point(node)) {
if (knot_node_is_deleg_point(node)) {
printf("delegation point\n");
}
if (dnslib_node_is_non_auth(node)) {
if (knot_node_is_non_auth(node)) {
printf("non-authoritative node\n");
}
if (node->parent != NULL) {
name = dnslib_dname_to_str(node->parent->owner);
name = knot_dname_to_str(node->parent->owner);
printf("parent: %s\n", name);
free(name);
} else {
......@@ -133,19 +133,19 @@ void dnslib_node_dump(dnslib_node_t *node, void *loaded_zone)
}
if (node->prev != NULL) {
name = dnslib_dname_to_str(node->prev->owner);
name = knot_dname_to_str(node->prev->owner);
printf("previous node: %s\n", name);
free(name);
} else {
printf("previous node: none\n");
}
dnslib_rrset_t **rrsets = dnslib_node_get_rrsets(node);
knot_rrset_t **rrsets = knot_node_get_rrsets(node);
printf("Wildcard child: ");
if (node->wildcard_child != NULL) {
name = dnslib_dname_to_str(node->wildcard_child->owner);
name = knot_dname_to_str(node->wildcard_child->owner);
printf("%s\n", name);
free(name);
} else {
......@@ -155,7 +155,7 @@ void dnslib_node_dump(dnslib_node_t *node, void *loaded_zone)
printf("NSEC3 node: ");
if (node->nsec3_node != NULL) {
name = dnslib_dname_to_str(node->nsec3_node->owner);
name = knot_dname_to_str(node->nsec3_node->owner);
printf("%s\n", name);
free(name);
} else {
......@@ -165,25 +165,25 @@ void dnslib_node_dump(dnslib_node_t *node, void *loaded_zone)
printf("RRSet count: %d\n", node->rrset_count);
for (int i = 0; i < node->rrset_count; i++) {
dnslib_rrset_dump(rrsets[i], (int) loaded_zone);
knot_rrset_dump(rrsets[i], (int) loaded_zone);
}
//assert(node->owner->node == node);
printf("------- NODE --------\n");
#endif
}
void dnslib_zone_contents_dump(dnslib_zone_contents_t *zone, char loaded_zone)
void knot_zone_contents_dump(knot_zone_contents_t *zone, char loaded_zone)
{
#if defined(DNSLIB_ZONE_DEBUG)
printf("------- ZONE --------\n");
dnslib_zone_contents_tree_apply_inorder(zone, dnslib_node_dump, (void *)&loaded_zone);
knot_zone_contents_tree_apply_inorder(zone, knot_node_dump, (void *)&loaded_zone);
printf("------- ZONE --------\n");
printf("------- NSEC 3 tree -\n");
dnslib_zone_contents_nsec3_apply_inorder(zone, dnslib_node_dump, (void *)&loaded_zone);
knot_zone_contents_nsec3_apply_inorder(zone, knot_node_dump, (void *)&loaded_zone);
printf("------- NSEC 3 tree -\n");
#endif
......
......@@ -33,7 +33,7 @@
* \param loaded_zone Set to <> 0 if the RDATA is part of a zone loaded into
* the server. Set to 0 otherwise.
*/
void dnslib_rdata_dump(dnslib_rdata_t *rdata, uint32_t type, char loaded_zone);
void knot_rdata_dump(knot_rdata_t *rdata, uint32_t type, char loaded_zone);
/*!
* \brief Dumps RRSet.
......@@ -45,7 +45,7 @@ void dnslib_rdata_dump(dnslib_rdata_t *rdata, uint32_t type, char loaded_zone);
* \param loaded_zone Set to <> 0 if the RRSet is part of a zone loaded into
* the server. Set to 0 otherwise.
*/
void dnslib_rrset_dump(dnslib_rrset_t *rrset, char loaded_zone);
void knot_rrset_dump(knot_rrset_t *rrset, char loaded_zone);
/*!
* \brief Dumps zone node.
......@@ -57,7 +57,7 @@ void dnslib_rrset_dump(dnslib_rrset_t *rrset, char loaded_zone);
* \param loaded_zone Set to <> 0 if the node is part of a zone loaded into
* the server. Set to 0 otherwise.
*/
void dnslib_node_dump(dnslib_node_t *node, void *loaded_zone);
void knot_node_dump(knot_node_t *node, void *loaded_zone);
/*!
* \brief Dumps the whole zone.
......@@ -68,7 +68,7 @@ void dnslib_node_dump(dnslib_node_t *node, void *loaded_zone);
* \param loaded_zone Set to <> 0 if the node is part of a zone loaded into
* the server. Set to 0 otherwise.
*/
void dnslib_zone_contents_dump(dnslib_zone_contents_t *zone, char loaded_zone);
void knot_zone_contents_dump(knot_zone_contents_t *zone, char loaded_zone);
/*
* Debug macros
......@@ -91,111 +91,111 @@ void dnslib_zone_contents_dump(dnslib_zone_contents_t *zone, char loaded_zone);
//#define DNSLIB_XFR_DEBUG
#ifdef DNSLIB_XFR_DEBUG
#define debug_dnslib_xfr(msg...) fprintf(stderr, msg)
#define debug_dnslib_xfr_hex(data, len) hex_print((data), (len))
#define debug_knot_xfr(msg...) fprintf(stderr, msg)
#define debug_knot_xfr_hex(data, len) hex_print((data), (len))
#define DEBUG_DNSLIB_NS(cmds) do { cmds } while (0)
#else
#define debug_dnslib_xfr(msg...)
#define debug_dnslib_xfr_hex(data, len)
#define debug_knot_xfr(msg...)
#define debug_knot_xfr_hex(data, len)
#define DEBUG_DNSLIB_XFR(cmds)
#endif
#ifdef DNSLIB_NS_DEBUG
#define debug_dnslib_ns(msg...) fprintf(stderr, msg)
#define debug_dnslib_ns_hex(data, len) hex_print((data), (len))
#define debug_knot_ns(msg...) fprintf(stderr, msg)
#define debug_knot_ns_hex(data, len) hex_print((data), (len))
#define DEBUG_DNSLIB_NS(cmds) do { cmds } while (0)
#else
#define debug_dnslib_ns(msg...)
#define debug_dnslib_ns_hex(data, len)
#define debug_knot_ns(msg...)
#define debug_knot_ns_hex(data, len)
#define DEBUG_DNSLIB_NS(cmds)
#endif
#ifdef DNSLIB_DNAME_DEBUG
#define debug_dnslib_dname(msg...) fprintf(stderr, msg)
#define debug_dnslib_dname_hex(data, len) hex_print((data), (len))
#define debug_knot_dname(msg...) fprintf(stderr, msg)
#define debug_knot_dname_hex(data, len) hex_print((data), (len))
#define DEBUG_DNSLIB_DNAME(cmds) do { cmds } while (0)
#else
#define debug_dnslib_dname(msg...)
#define debug_dnslib_dname_hex(data, len)
#define debug_knot_dname(msg...)
#define debug_knot_dname_hex(data, len)
#define DEBUG_DNSLIB_DNAME(cmds)
#endif
#ifdef DNSLIB_NODE_DEBUG
#define debug_dnslib_node(msg...) fprintf(stderr, msg)
#define debug_dnslib_node_hex(data, len) hex_print((data), (len))
#define debug_knot_node(msg...) fprintf(stderr, msg)
#define debug_knot_node_hex(data, len) hex_print((data), (len))
#define DEBUG_DNSLIB_node(cmds) do { cmds } while (0)
#else
#define debug_dnslib_node(msg...)
#define debug_dnslib_node_hex(data, len)
#define debug_knot_node(msg...)
#define debug_knot_node_hex(data, len)
#define DEBUG_DNSLIB_NODE(cmds)
#endif
#ifdef DNSLIB_ZONE_DEBUG
#define debug_dnslib_zone(msg...) fprintf(stderr, msg)
#define debug_dnslib_zone_hex(data, len) hex_print((data), (len))
#define debug_knot_zone(msg...) fprintf(stderr, msg)
#define debug_knot_zone_hex(data, len) hex_print((data), (len))
#define DEBUG_DNSLIB_ZONE(cmds) do { cmds } while (0)
#else
#define debug_dnslib_zone(msg...)
#define debug_dnslib_zone_hex(data, len)
#define debug_knot_zone(msg...)
#define debug_knot_zone_hex(data, len)
#define DEBUG_DNSLIB_ZONE(cmds)
#endif
#ifdef DNSLIB_ZONEDB_DEBUG
#define debug_dnslib_zonedb(msg...) fprintf(stderr, msg)
#define debug_knot_zonedb(msg...) fprintf(stderr, msg)
#define DEBUG_DNSLIB_ZONEDB(cmds) do { cmds } while (0)
#else
#define debug_dnslib_zonedb(msg...)
#define debug_knot_zonedb(msg...)
#define DEBUG_DNSLIB_ZONEDB(cmds)
#endif
#ifdef DNSLIB_RESPONSE_DEBUG
#define debug_dnslib_response(msg...) fprintf(stderr, msg)
#define debug_dnslib_response_hex(data, len) hex_print((data), (len))
#define debug_knot_response(msg...) fprintf(stderr, msg)
#define debug_knot_response_hex(data, len) hex_print((data), (len))
#define DEBUG_DNSLIB_RESPONSE(cmds) do { cmds } while (0)
#else
#define debug_dnslib_response(msg...)
#define debug_dnslib_response_hex(data, len)
#define debug_knot_response(msg...)
#define debug_knot_response_hex(data, len)
#define DEBUG_DNSLIB_RESPONSE(cmds)
#endif
#ifdef DNSLIB_PACKET_DEBUG
#define debug_dnslib_packet(msg...) fprintf(stderr, msg)
#define debug_dnslib_packet_hex(data, len) hex_print((data), (len))