Commit 61b94642 authored by Lubos Slovak's avatar Lubos Slovak

A lot of renaming stuff.

 KNOT -> KNOTD
 DNSLIB -> KNOT

refs #1087 @20m
parent 14492262
......@@ -5,7 +5,7 @@ Coding style
* Max line width: 80 chars
* Pointer asterisk attached to the name of the variable
* Own structures/types: _t suffix (f.e. nameserver_t)
* Header guard format: _KNOT_HEADER_H_
* Header guard format: _KNOTDHEADER_H_
* Spaces around binary operators
* Space between keyword and bracket (f.e. "if (predicate)")
* No space between variable and typecast (f.e. "return (int)val;")
......
......@@ -12,8 +12,8 @@
* @{
*/
#ifndef _KNOT_ACL_H_
#define _KNOT_ACL_H_
#ifndef _KNOTDACL_H_
#define _KNOTDACL_H_
#include "common/skip-list.h"
#include "common/sockaddr.h"
......@@ -118,6 +118,6 @@ static inline skip_list_t* acl_rules(acl_t *acl) {
return acl->rules;
}
#endif /* _KNOT_ACL_H_ */
#endif /* _KNOTDACL_H_ */
/*! @} */
......@@ -13,8 +13,8 @@
* @{
*/
#ifndef _KNOT_COMMON_DYNAMIC_ARRAY_H_
#define _KNOT_COMMON_DYNAMIC_ARRAY_H_
#ifndef _KNOTDCOMMON_DYNAMIC_ARRAY_H_
#define _KNOTDCOMMON_DYNAMIC_ARRAY_H_
#include <string.h>
#include <pthread.h>
......@@ -136,6 +136,6 @@ unsigned da_get_count(const da_array_t *array);
/*----------------------------------------------------------------------------*/
#endif /* _KNOT_COMMON_DYNAMIC_ARRAY_H_ */
#endif /* _KNOTDCOMMON_DYNAMIC_ARRAY_H_ */
/*! @} */
......@@ -42,7 +42,7 @@ int _map_errno(int fallback_value, int arg0, ...)
va_list ap;
va_start(ap, arg0);
/* KNOT_ERROR serves as a sentinel. */
/* KNOTDERROR serves as a sentinel. */
for (int c = arg0; c != 0; c = va_arg(ap, int)) {
/* Error code matches with mapped. */
......
......@@ -10,8 +10,8 @@
* @{
*/
#ifndef _KNOT_COMMON_ERROR_H_
#define _KNOT_COMMON_ERROR_H_
#ifndef _KNOTDCOMMON_ERROR_H_
#define _KNOTDCOMMON_ERROR_H_
#include <errno.h>
......@@ -60,6 +60,6 @@ const char *error_to_str(const error_table_t *table, int code);
*/
int _map_errno(int fallback_value, int arg0, ...);
#endif /* _KNOT_COMMON_ERROR_H_ */
#endif /* _KNOTDCOMMON_ERROR_H_ */
/*! @} */
......@@ -9,8 +9,8 @@
* @{
*/
#ifndef _KNOT_COMMON_EVQUEUE_H_
#define _KNOT_COMMON_EVQUEUE_H_
#ifndef _KNOTDCOMMON_EVQUEUE_H_
#define _KNOTDCOMMON_EVQUEUE_H_
#include <pthread.h>
#include <signal.h> // sigset_t
......@@ -179,6 +179,6 @@ static inline void evqueue_set(evqueue_t *q) {
s_evqueue = q;
}
#endif /* _KNOT_COMMON_EVQUEUE_H_ */
#endif /* _KNOTDCOMMON_EVQUEUE_H_ */
/*! @} */
......@@ -48,8 +48,8 @@
* @{
*/
#ifndef _KNOT_COMMON_EVSCHED_H_
#define _KNOT_COMMON_EVSCHED_H_
#ifndef _KNOTDCOMMON_EVSCHED_H_
#define _KNOTDCOMMON_EVSCHED_H_
#include <pthread.h>
#include "common/slab/slab.h"
......@@ -198,6 +198,6 @@ static inline void evsched_set(evsched_t *s) {
}
#endif /* _KNOT_COMMON_EVSCHED_H_ */
#endif /* _KNOTDCOMMON_EVSCHED_H_ */
/*! @} */
#ifndef _KNOT_COMMON_GENERAL_TREE_H_
#define _KNOT_COMMON_GENERAL_TREE_H_
#ifndef _KNOTDCOMMON_GENERAL_TREE_H_
#define _KNOTDCOMMON_GENERAL_TREE_H_
#include "common/modified_tree.h"
......@@ -52,4 +52,4 @@ int gen_tree_find_less_or_equal(general_tree_t *tree,
general_tree_t *gen_tree_shallow_copy(general_tree_t *tree);
#endif // _KNOT_COMMON_GENERAL_TREE_H_
#endif // _KNOTDCOMMON_GENERAL_TREE_H_
......@@ -12,8 +12,8 @@
* @{
*/
#ifndef _KNOT_COMMON_LATENCY_H_
#define _KNOT_COMMON_LATENCY_H_
#ifndef _KNOTDCOMMON_LATENCY_H_
#define _KNOTDCOMMON_LATENCY_H_
/* Optional. */
#ifdef PROF_LATENCY
......@@ -95,6 +95,6 @@ int pf_pthread_mutex_unlock(pthread_mutex_t *mutex,
#define perf_end(d)
#endif // PROF_LATENCY
#endif // _KNOT_COMMON_LATENCY_H_
#endif // _KNOTDCOMMON_LATENCY_H_
/*! @} */
......@@ -12,8 +12,8 @@
* @{
*/
#ifndef _KNOT_COMMON_PRINT_H_
#define _KNOT_COMMON_PRINT_H_
#ifndef _KNOTDCOMMON_PRINT_H_
#define _KNOTDCOMMON_PRINT_H_
typedef int (*printf_t)(const char *fmt, ...);
......@@ -52,6 +52,6 @@ void bit_print(const char *data, int length);
*/
void bit_printf(const char *data, int length, printf_t print_handler);
#endif /* _KNOT_COMMON_PRINT_H_ */
#endif /* _KNOTDCOMMON_PRINT_H_ */
/*! @} */
......@@ -12,8 +12,8 @@
* @{
*/
#ifndef _KNOT_REF_H_
#define _KNOT_REF_H_
#ifndef _KNOTDREF_H_
#define _KNOTDREF_H_
#include <stddef.h>
......@@ -70,6 +70,6 @@ void ref_retain(ref_t *p);
*/
void ref_release(ref_t *p);
#endif /* _KNOT_REF_H_ */
#endif /* _KNOTDREF_H_ */
/*! @} */
......@@ -41,8 +41,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Retrieved from: http://en.literateprograms.org/Skip_list_(C)?oldid=12811
*/
#ifndef _KNOT_COMMON_SKIP_LIST_H_
#define _KNOT_COMMON_SKIP_LIST_H_
#ifndef _KNOTDCOMMON_SKIP_LIST_H_
#define _KNOTDCOMMON_SKIP_LIST_H_
/*----------------------------------------------------------------------------*/
/*!
......@@ -210,6 +210,6 @@ void skip_print_list(const skip_list_t *list,
*/
skip_list_t *skip_copy_list(const skip_list_t *list);
#endif /* _KNOT_COMMON_SKIP_LIST_H_ */
#endif /* _KNOTDCOMMON_SKIP_LIST_H_ */
/*! @} */
......@@ -9,8 +9,8 @@
* @{
*/
#ifndef _KNOT_COMMON_ALLOC_COMMON_H_
#define _KNOT_COMMON_ALLOC_COMMON_H_
#ifndef _KNOTDCOMMON_ALLOC_COMMON_H_
#define _KNOTDCOMMON_ALLOC_COMMON_H_
#include <stdio.h>
......@@ -41,6 +41,6 @@
#endif
#endif /* _KNOT_COMMON_ALLOC_COMMON_H_ */
#endif /* _KNOTDCOMMON_ALLOC_COMMON_H_ */
/*! @} */
......@@ -9,8 +9,8 @@
* @{
*/
#ifndef _KNOT_COMMON_MALLOC_H_
#define _KNOT_COMMON_MALLOC_H_
#ifndef _KNOTDCOMMON_MALLOC_H_
#define _KNOTDCOMMON_MALLOC_H_
#include <stdlib.h>
......@@ -23,6 +23,6 @@
*/
void usage_dump();
#endif // _KNOT_COMMON_MALLOC_H_
#endif // _KNOTDCOMMON_MALLOC_H_
/*! @} */
......@@ -67,8 +67,8 @@
* @{
*/
#ifndef _KNOT_COMMON_SLAB_H_
#define _KNOT_COMMON_SLAB_H_
#ifndef _KNOTDCOMMON_SLAB_H_
#define _KNOTDCOMMON_SLAB_H_
#include <pthread.h>
#include <stdint.h>
......@@ -333,6 +333,6 @@ void *slab_alloc_realloc(slab_alloc_t* alloc, void *ptr, size_t size);
*/
void slab_alloc_stats(slab_alloc_t* alloc);
#endif /* _KNOT_COMMON_SLAB_H_ */
#endif /* _KNOTDCOMMON_SLAB_H_ */
/*! @} */
......@@ -9,8 +9,8 @@
* @{
*/
#ifndef _KNOT_SOCKADDR_H_
#define _KNOT_SOCKADDR_H_
#ifndef _KNOTDSOCKADDR_H_
#define _KNOTDSOCKADDR_H_
/* BSD IPv6 */
#ifndef __POSIX_VISIBLE
......@@ -100,6 +100,6 @@ int sockaddr_tostr(sockaddr_t *addr, char *dst, size_t size);
*/
int sockaddr_portnum(sockaddr_t *addr);
#endif /* _KNOT_SOCKADDR_H_ */
#endif /* _KNOTDSOCKADDR_H_ */
/*! @} */
......@@ -7,10 +7,10 @@
#include "dnslib/rrset.h"
#include "dnslib/error.h"
static const size_t DNSLIB_CHANGESET_COUNT = 5;
static const size_t DNSLIB_CHANGESET_STEP = 5;
static const size_t DNSLIB_CHANGESET_RRSET_COUNT = 5;
static const size_t DNSLIB_CHANGESET_RRSET_STEP = 5;
static const size_t KNOT_CHANGESET_COUNT = 5;
static const size_t KNOT_CHANGESET_STEP = 5;
static const size_t KNOT_CHANGESET_RRSET_COUNT = 5;
static const size_t KNOT_CHANGESET_RRSET_STEP = 5;
/*----------------------------------------------------------------------------*/
......@@ -20,21 +20,21 @@ static int knot_changeset_check_count(knot_rrset_t ***rrsets, size_t count,
// this should also do for the initial case (*rrsets == NULL)
if (count == *allocated) {
knot_rrset_t **rrsets_new = (knot_rrset_t **)calloc(
*allocated + DNSLIB_CHANGESET_RRSET_STEP,
*allocated + KNOT_CHANGESET_RRSET_STEP,
sizeof(knot_rrset_t *));
if (rrsets_new == NULL) {
return DNSLIB_ENOMEM;
return KNOT_ENOMEM;
}
memcpy(rrsets_new, *rrsets, count);
knot_rrset_t **rrsets_old = *rrsets;
*rrsets = rrsets_new;
*allocated += DNSLIB_CHANGESET_RRSET_STEP;
*allocated += KNOT_CHANGESET_RRSET_STEP;
free(rrsets_old);
}
return DNSLIB_EOK;
return KNOT_EOK;
}
/*----------------------------------------------------------------------------*/
......@@ -42,8 +42,8 @@ static int knot_changeset_check_count(knot_rrset_t ***rrsets, size_t count,
static int knot_changeset_rrsets_match(const knot_rrset_t *rrset1,
const knot_rrset_t *rrset2)
{
return knot_rrset_compare(rrset1, rrset2, DNSLIB_RRSET_COMPARE_HEADER)
&& (knot_rrset_type(rrset1) != DNSLIB_RRTYPE_RRSIG
return knot_rrset_compare(rrset1, rrset2, KNOT_RRSET_COMPARE_HEADER)
&& (knot_rrset_type(rrset1) != KNOT_RRTYPE_RRSIG
|| knot_rdata_rrsig_type_covered(
knot_rrset_rdata(rrset1))
== knot_rdata_rrsig_type_covered(
......@@ -59,7 +59,7 @@ int knot_changeset_allocate(knot_changesets_t **changesets)
calloc(1, sizeof(knot_changesets_t)));
if (*changesets == NULL) {
return DNSLIB_ENOMEM;
return KNOT_ENOMEM;
}
assert((*changesets)->allocated == 0);
......@@ -76,13 +76,13 @@ int knot_changeset_add_rrset(knot_rrset_t ***rrsets,
knot_rrset_t *rrset)
{
int ret = knot_changeset_check_count(rrsets, *count, allocated);
if (ret != DNSLIB_EOK) {
if (ret != KNOT_EOK) {
return ret;
}
(*rrsets)[(*count)++] = rrset;
return DNSLIB_EOK;
return KNOT_EOK;
}
/*----------------------------------------------------------------------------*/
......@@ -100,14 +100,14 @@ int knot_changeset_add_rr(knot_rrset_t ***rrsets, size_t *count,
if (i < *count) {
// found RRSet to merge the new one into
if (knot_rrset_merge((void **)&(*rrsets)[i],
(void **)&rr) != DNSLIB_EOK) {
return DNSLIB_ERROR;
(void **)&rr) != KNOT_EOK) {
return KNOT_ERROR;
}
// remove the RR
knot_rrset_deep_free(&rr, 1, 1, 1);
return DNSLIB_EOK;
return KNOT_EOK;
} else {
return knot_changeset_add_rrset(rrsets, count, allocated, rr);
}
......@@ -143,7 +143,7 @@ int knot_changeset_add_new_rr(knot_changeset_t *changeset,
assert(allocated != NULL);
int ret = knot_changeset_add_rr(rrsets, count, allocated, rrset);
if (ret != DNSLIB_EOK) {
if (ret != KNOT_EOK) {
return ret;
}
......@@ -178,7 +178,7 @@ int knot_changeset_add_soa(knot_changeset_t *changeset, knot_rrset_t *soa,
}
/*! \todo Remove return value? */
return DNSLIB_EOK;
return KNOT_EOK;
}
/*---------------------------------------------------------------------------*/
......@@ -187,21 +187,21 @@ int knot_changesets_check_size(knot_changesets_t *changesets)
{
if (changesets->allocated == changesets->count) {
knot_changeset_t *sets = (knot_changeset_t *)calloc(
changesets->allocated + DNSLIB_CHANGESET_STEP,
changesets->allocated + KNOT_CHANGESET_STEP,
sizeof(knot_changeset_t));
if (sets == NULL) {
return DNSLIB_ENOMEM;
return KNOT_ENOMEM;
}
/*! \todo realloc() may be more effective. */
memcpy(sets, changesets->sets, changesets->count);
knot_changeset_t *old_sets = changesets->sets;
changesets->sets = sets;
changesets->count += DNSLIB_CHANGESET_STEP;
changesets->count += KNOT_CHANGESET_STEP;
free(old_sets);
}
return DNSLIB_EOK;
return KNOT_EOK;
}
/*----------------------------------------------------------------------------*/
......
......@@ -9,8 +9,8 @@
* @{
*/
#ifndef _KNOT_DNSLIB_CHANGESETS_H_
#define _KNOT_DNSLIB_CHANGESETS_H_
#ifndef _KNOTDKNOT_CHANGESETS_H_
#define _KNOTDKNOT_CHANGESETS_H_
#include "dnslib/rrset.h"
......@@ -79,6 +79,6 @@ int knot_changesets_check_size(knot_changesets_t *changesets);
void knot_free_changesets(knot_changesets_t **changesets);
#endif /* _KNOT_DNSLIB_CHANGESETS_H_ */
#endif /* _KNOTDKNOT_CHANGESETS_H_ */
/*! @} */
......@@ -9,8 +9,8 @@
* @{
*/
#ifndef _KNOT_DNSLIB_CONSTS_H_
#define _KNOT_DNSLIB_CONSTS_H_
#ifndef _KNOTDKNOT_CONSTS_H_
#define _KNOTDKNOT_CONSTS_H_
#include <stdint.h>
#include "dnslib/descriptor.h"
......@@ -19,12 +19,12 @@
* OPCODEs
*/
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
KNOT_OPCODE_QUERY = 0, /* a standard query (QUERY) */
KNOT_OPCODE_IQUERY = 1, /* an inverse query (IQUERY) */
KNOT_OPCODE_STATUS = 2, /* a server status request (STATUS) */
KNOT_OPCODE_NOTIFY = 4, /* NOTIFY */
KNOT_OPCODE_UPDATE = 5, /* Dynamic update */
KNOT_OPCODE_OFFSET = 14
} knot_opcode_t;
/*!
......@@ -34,54 +34,54 @@ typedef enum knot_opcode {
* OPCODE and the QTYPE.
*/
typedef enum knot_packet_type {
DNSLIB_QUERY_NORMAL, /*!< Normal query. */
DNSLIB_QUERY_AXFR, /*!< Request for AXFR transfer. */
DNSLIB_QUERY_IXFR, /*!< Request for IXFR transfer. */
DNSLIB_QUERY_NOTIFY, /*!< NOTIFY query. */
DNSLIB_QUERY_UPDATE, /*!< Dynamic update. */
DNSLIB_RESPONSE_NORMAL, /*!< Normal response. */
DNSLIB_RESPONSE_AXFR, /*!< AXFR transfer response. */
DNSLIB_RESPONSE_IXFR, /*!< IXFR transfer response. */
DNSLIB_RESPONSE_NOTIFY /*!< NOTIFY response. */
KNOT_QUERY_NORMAL, /*!< Normal query. */
KNOT_QUERY_AXFR, /*!< Request for AXFR transfer. */
KNOT_QUERY_IXFR, /*!< Request for IXFR transfer. */
KNOT_QUERY_NOTIFY, /*!< NOTIFY query. */
KNOT_QUERY_UPDATE, /*!< Dynamic update. */
KNOT_RESPONSE_NORMAL, /*!< Normal response. */
KNOT_RESPONSE_AXFR, /*!< AXFR transfer response. */
KNOT_RESPONSE_IXFR, /*!< IXFR transfer response. */
KNOT_RESPONSE_NOTIFY /*!< NOTIFY response. */
} knot_packet_type_t;
/*
* RCODEs
*/
typedef enum knot_rcode {
DNSLIB_RCODE_NOERROR = 0, /* No error condition */
DNSLIB_RCODE_FORMERR = 1, /* Format error */
DNSLIB_RCODE_SERVFAIL = 2, /* Server failure */
DNSLIB_RCODE_NXDOMAIN = 3, /* Name Error */
DNSLIB_RCODE_NOTIMPL = 4, /* Not implemented */
DNSLIB_RCODE_REFUSED = 5, /* Refused */
DNSLIB_RCODE_YXDOMAIN = 6, /* name should not exist */
DNSLIB_RCODE_YXRRSET = 7, /* rrset should not exist */
DNSLIB_RCODE_NXRRSET = 8, /* rrset does not exist */
DNSLIB_RCODE_NOTAUTH = 9, /* server not authoritative */
DNSLIB_RCODE_NOTZONE = 10 /* name not inside zone */
KNOT_RCODE_NOERROR = 0, /* No error condition */
KNOT_RCODE_FORMERR = 1, /* Format error */
KNOT_RCODE_SERVFAIL = 2, /* Server failure */
KNOT_RCODE_NXDOMAIN = 3, /* Name Error */
KNOT_RCODE_NOTIMPL = 4, /* Not implemented */
KNOT_RCODE_REFUSED = 5, /* Refused */
KNOT_RCODE_YXDOMAIN = 6, /* name should not exist */
KNOT_RCODE_YXRRSET = 7, /* rrset should not exist */
KNOT_RCODE_NXRRSET = 8, /* rrset does not exist */
KNOT_RCODE_NOTAUTH = 9, /* server not authoritative */
KNOT_RCODE_NOTZONE = 10 /* name not inside zone */
} knot_rcode_t;
/*
* CLASSes
*/
//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 */
// KNOT_CLASS_IN = 1, /* Class IN */
// KNOT_CLASS_CS = 2, /* Class CS */
// KNOT_CLASS_CH = 3, /* Class CHAOS */
// KNOT_CLASS_HS = 4, /* Class HS */
// KNOT_CLASS_NONE = 254, /* Class NONE rfc2136 */
// KNOT_CLASS_ANY = 255 /* Class ANY */
//} knot_class_t;
/*
* Other
*/
typedef enum knot_const {
DNSLIB_MAX_DNAME_LENGTH = 255,
DNSLIB_MAX_DNAME_LABELS = 127 // 1-char labels
KNOT_MAX_DNAME_LENGTH = 255,
KNOT_MAX_DNAME_LABELS = 127 // 1-char labels
} knot_const_t;
#endif /* _KNOT_DNSLIB_CONSTS_H_ */
#endif /* _KNOTDKNOT_CONSTS_H_ */
/*! @} */
......@@ -11,7 +11,7 @@
void knot_rdata_dump(knot_rdata_t *rdata, uint32_t type, char loaded_zone)
{
#if defined(DNSLIB_ZONE_DEBUG) || defined(DNSLIB_RDATA_DEBUG)
#if defined(KNOT_ZONE_DEBUG) || defined(KNOT_RDATA_DEBUG)
printf(" ------- RDATA -------\n");
if (rdata == NULL) {
printf(" There are no rdata in this RRset!\n");
......@@ -23,9 +23,9 @@ void knot_rdata_dump(knot_rdata_t *rdata, uint32_t type, char loaded_zone)
char *name;
for (int i = 0; i < rdata->count; i++) {
if (desc->wireformat[i] == DNSLIB_RDATA_WF_COMPRESSED_DNAME ||
desc->wireformat[i] == DNSLIB_RDATA_WF_UNCOMPRESSED_DNAME ||
desc->wireformat[i] == DNSLIB_RDATA_WF_LITERAL_DNAME ) {
if (desc->wireformat[i] == KNOT_RDATA_WF_COMPRESSED_DNAME ||
desc->wireformat[i] == KNOT_RDATA_WF_UNCOMPRESSED_DNAME ||
desc->wireformat[i] == KNOT_RDATA_WF_LITERAL_DNAME ) {
assert(rdata->items[i].dname != NULL);
name = knot_dname_to_str(rdata->items[i].dname);
printf(" DNAME: %d: %s\n",
......@@ -61,7 +61,7 @@ void knot_rdata_dump(knot_rdata_t *rdata, uint32_t type, char loaded_zone)
void knot_rrset_dump(knot_rrset_t *rrset, char loaded_zone)
{
#if defined(DNSLIB_ZONE_DEBUG) || defined(DNSLIB_RRSET_DEBUG)
#if defined(KNOT_ZONE_DEBUG) || defined(KNOT_RRSET_DEBUG)
printf(" ------- RRSET -------\n");
printf(" %p\n", rrset);
char *name = knot_dname_to_str(rrset->owner);
......@@ -99,7 +99,7 @@ void knot_rrset_dump(knot_rrset_t *rrset, char loaded_zone)
void knot_node_dump(knot_node_t *node, void *loaded_zone)
{
#if defined(DNSLIB_ZONE_DEBUG) || defined(DNSLIB_NODE_DEBUG)
#if defined(KNOT_ZONE_DEBUG) || defined(KNOT_NODE_DEBUG)
//char loaded_zone = *((char*) data);
char *name;
......@@ -174,7 +174,7 @@ void knot_node_dump(knot_node_t *node, void *loaded_zone)
void knot_zone_contents_dump(knot_zone_contents_t *zone, char loaded_zone)
{
#if defined(DNSLIB_ZONE_DEBUG)
#if defined(KNOT_ZONE_DEBUG)
printf("------- ZONE --------\n");
knot_zone_contents_tree_apply_inorder(zone, knot_node_dump, (void *)&loaded_zone);
......
......@@ -10,8 +10,8 @@
* @{
*/
#ifndef _KNOT_DNSLIB_DEBUG_H_
#define _KNOT_DNSLIB_DEBUG_H_
#ifndef _KNOTDKNOT_DEBUG_H_
#define _KNOTDKNOT_DEBUG_H_
#include <stdint.h>
#include <stdio.h>
......@@ -25,7 +25,7 @@
/*!
* \brief Dumps RDATA of the given type.
*
* This function is empty if neither DNSLIB_ZONE_DEBUG nor DNSLIB_RDATA_DEBUG
* This function is empty if neither KNOT_ZONE_DEBUG nor KNOT_RDATA_DEBUG
* is defined.
*
* \param rdata RDATA to dump.
......@@ -38,7 +38,7 @@ void knot_rdata_dump(knot_rdata_t *rdata, uint32_t type, char loaded_zone);
/*!
* \brief Dumps RRSet.
*
* This function is empty if neither DNSLIB_ZONE_DEBUG nor DNSLIB_RRSET_DEBUG
* This function is empty if neither KNOT_ZONE_DEBUG nor KNOT_RRSET_DEBUG
* is defined.
*
* \param rrset RRSet to dump.
......@@ -50,7 +50,7 @@ void knot_rrset_dump(knot_rrset_t *rrset, char loaded_zone);
/*!
* \brief Dumps zone node.
*
* This function is empty if neither DNSLIB_ZONE_DEBUG nor DNSLIB_NODE_DEBUG
* This function is empty if neither KNOT_ZONE_DEBUG nor KNOT_NODE_DEBUG
* is defined.
*
* \param node Node to dump.
......@@ -62,7 +62,7 @@ void knot_node_dump(knot_node_t *node, void *loaded_zone);
/*!
* \brief Dumps the whole zone.
*
* This function is empty if DNSLIB_ZONE_DEBUG is not defined.
* This function is empty if KNOT_ZONE_DEBUG is not defined.
*
* \param zone Zone to dump.
* \param loaded_zone Set to <> 0 if the node is part of a zone loaded into
......@@ -73,126 +73,126 @@ void knot_zone_contents_dump(knot_zone_contents_t *zone, char loaded_zone);
/*
* Debug macros
*/
//#define DNSLIB_ZONE_DEBUG
//#define DNSLIB_RESPONSE_DEBUG
//#define DNSLIB_ZONEDB_DEBUG
//#define DNSLIB_DNAME_DEBUG
//#define DNSLIB_NODE_DEBUG
//#define DNSLIB_RESPONSE_DEBUG
//#define DNSLIB_PACKET_DEBUG
//#define DNSLIB_EDNS_DEBUG
//#define DNSLIB_RRSET_DEBUG
//#define DNSLIB_NSEC3_DEBUG
//#define DNSLIB_ZDUMP_DEBUG
//#define DNSLIB_ZLOAD_DEBUG
//#define KNOT_ZONE_DEBUG
//#define KNOT_RESPONSE_DEBUG
//#define KNOT_ZONEDB_DEBUG
//#define KNOT_DNAME_DEBUG
//#define KNOT_NODE_DEBUG
//#define KNOT_RESPONSE_DEBUG
//#define KNOT_PACKET_DEBUG
//#define KNOT_EDNS_DEBUG
//#define KNOT_RRSET_DEBUG
//#define KNOT_NSEC3_DEBUG
//#define KNOT_ZDUMP_DEBUG
//#define KNOT_ZLOAD_DEBUG
//#define CUCKOO_DEBUG
//#define CUCKOO_DEBUG_HASH
//#define DNSLIB_NS_DEBUG
//#define DNSLIB_XFR_DEBUG
//#define KNOT_NS_DEBUG
//#define KNOT_XFR_DEBUG
#ifdef DNSLIB_XFR_DEBUG
#ifdef KNOT_XFR_DEBUG
#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)
#define DEBUG_KNOT_NS(cmds) do { cmds } while (0)
#else
#define debug_knot_xfr(msg...)
#define debug_knot_xfr_hex(data, len)
#define DEBUG_DNSLIB_XFR(cmds)
#define DEBUG_KNOT_XFR(cmds)
#endif
#ifdef DNSLIB_NS_DEBUG
#ifdef KNOT_NS_DEBUG
#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)
#define DEBUG_KNOT_NS(cmds) do { cmds } while (0)