Commit 465e18fa authored by Daniel Salzman's avatar Daniel Salzman

knot: remove redundant includes

parent 419c7ab8
......@@ -35,6 +35,7 @@
#include "knot/common/evsched.h"
#include "knot/common/fdset.h"
#include "knot/server/dthreads.h"
#include "knot/common/ref.h"
#include "knot/server/rrl.h"
#include "knot/worker/pool.h"
#include "knot/zone/zonedb.h"
......
......@@ -23,6 +23,7 @@
#include "knot/common/log.h"
#include "libknot/libknot.h"
#include "contrib/macros.h"
#include "contrib/mempattern.h"
#include "contrib/ucw/lists.h"
/* --------------------------- Update cleanup ------------------------------- */
......
......@@ -20,6 +20,7 @@
#include "knot/dnssec/zone-events.h"
#include "knot/updates/apply.h"
#include "knot/zone/serial.h"
#include "contrib/mempattern.h"
#include "contrib/ucw/lists.h"
#include "contrib/ucw/mempool.h"
......
/* Copyright (C) 2014 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
/* Copyright (C) 2015 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -18,15 +18,11 @@
#include <time.h>
#include "libknot/libknot.h"
#include "knot/common/evsched.h"
#include "knot/common/log.h"
#include "knot/server/server.h"
#include "knot/worker/pool.h"
#include "knot/zone/zone.h"
#include "knot/zone/events/events.h"
#include "knot/zone/events/handlers.h"
#include "knot/zone/events/replan.h"
#include "knot/zone/timers.h"
#include "knot/zone/zone.h"
/* ------------------------- internal timers -------------------------------- */
......
/* Copyright (C) 2014 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
/* Copyright (C) 2015 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -18,18 +18,17 @@
#include <pthread.h>
#include <stdbool.h>
#include <sys/time.h>
#include "libknot/libknot.h"
#include "knot/common/evsched.h"
#include "knot/worker/pool.h"
#include "libknot/db/db.h"
/* Timer special values. */
#define ZONE_EVENT_NOW 0
struct zone;
struct server;
typedef enum zone_event_type {
ZONE_EVENT_INVALID = -1,
// supported event types
......
/* Copyright (C) 2014 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
/* Copyright (C) 2015 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -18,7 +18,6 @@
#include "dnssec/random.h"
#include "libknot/libknot.h"
#include "libknot/processing/requestor.h"
#include "libknot/yparser/yptrafo.h"
#include "contrib/trim.h"
#include "contrib/ucw/mempool.h"
......@@ -29,7 +28,6 @@
#include "knot/server/tcp-handler.h"
#include "knot/updates/changesets.h"
#include "knot/dnssec/zone-events.h"
#include "knot/zone/timers.h"
#include "knot/zone/zone-load.h"
#include "knot/zone/zonefile.h"
#include "knot/zone/events/events.h"
......
/* Copyright (C) 2014 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
/* Copyright (C) 2015 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -16,7 +16,7 @@
#pragma once
#include "knot/zone/events/events.h"
#include "knot/zone/zone.h"
/*! \brief Loads or reloads potentially changed zone. */
int event_load(zone_t *zone);
......
......@@ -18,7 +18,6 @@
#include "knot/zone/events/replan.h"
#include "knot/zone/events/handlers.h"
#include "knot/zone/zone.h"
#include "libknot/rrtype/soa.h"
#include "contrib/macros.h"
......
......@@ -16,7 +16,6 @@
#pragma once
#include "knot/zone/events/events.h"
#include "knot/zone/zone.h"
/*! \brief Replans zone's events using old zone. */
......
/* Copyright (C) 2011 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
/* Copyright (C) 2015 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -14,15 +14,9 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdlib.h>
#include <stdio.h>
#include "knot/zone/node.h"
#include "libknot/libknot.h"
#include "libknot/rrset.h"
#include "libknot/rdataset.h"
#include "libknot/rrtype/rrsig.h"
#include "libknot/descriptor.h"
#include "contrib/mempattern.h"
/*! \brief Clears allocated data in RRSet entry. */
......
/*!
* \file node.h
*
* \author Lubos Slovak <lubos.slovak@nic.cz>
* \author Jan Kadlec <jan.kadlec@nic.cz>
*
* \brief Structure representing one node in domain name tree and API for
* manipulating it.
*
* \addtogroup libknot
* @{
*/
/* Copyright (C) 2011 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
/* Copyright (C) 2015 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -25,6 +13,15 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*!
* \file
*
* \brief Structure representing one node in domain name tree and API for
* manipulating it.
*
* \addtogroup zone
* @{
*/
#pragma once
......
......@@ -14,12 +14,12 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "knot/zone/serial.h"
#include "knot/conf/conf.h"
#include <assert.h>
#include <time.h>
#include "knot/conf/conf.h"
#include "knot/zone/serial.h"
static int32_t serial_difference(uint32_t s1, uint32_t s2)
{
return (((int64_t)s1 - s2) % ((int64_t)1 << 32));
......
/* Copyright (C) 2014 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
/* Copyright (C) 2015 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -16,8 +16,6 @@
#include "libknot/libknot.h"
#include "knot/zone/timers.h"
#include "knot/zone/zonedb.h"
#include "contrib/string.h"
#include "contrib/wire.h"
#include "contrib/wire_ctx.h"
......
/* Copyright (C) 2014 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
/* Copyright (C) 2015 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -16,7 +16,7 @@
#pragma once
#include "libknot/libknot.h"
#include "libknot/db/db.h"
#include "knot/zone/zone.h"
#include "knot/zone/zonedb.h"
......
/* Copyright (C) 2011 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
/* Copyright (C) 2015 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -16,8 +16,6 @@
#pragma once
#include <stdint.h>
#include "knot/zone/contents.h"
#include "knot/updates/changesets.h"
......
/* Copyright (C) 2011 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
/* Copyright (C) 2015 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -14,13 +14,11 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*!
* \file zone-dump.h
*
* \author Daniel Salzman <daniel.salzman@nic.cz>
* \file
*
* \brief Zone text dump facility.
*
* \addtogroup zone-load-dump
* \addtogroup zone
* @{
*/
......
/* Copyright (C) 2011 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
/* Copyright (C) 2015 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -16,26 +16,17 @@
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include "knot/zone/zone-tree.h"
#include "knot/zone/node.h"
#include "libknot/consts.h"
#include "libknot/errcode.h"
#include "contrib/hat-trie/hat-trie.h"
#include "contrib/macros.h"
/*----------------------------------------------------------------------------*/
/* API functions */
/*----------------------------------------------------------------------------*/
zone_tree_t* zone_tree_create()
{
return hattrie_create();
}
/*----------------------------------------------------------------------------*/
size_t zone_tree_weight(const zone_tree_t* tree)
{
return hattrie_weight(tree);
......@@ -46,8 +37,6 @@ int zone_tree_is_empty(const zone_tree_t *tree)
return zone_tree_weight(tree) == 0;
}
/*----------------------------------------------------------------------------*/
int zone_tree_insert(zone_tree_t *tree, zone_node_t *node)
{
if (tree == NULL) {
......@@ -62,8 +51,6 @@ int zone_tree_insert(zone_tree_t *tree, zone_node_t *node)
return KNOT_EOK;
}
/*----------------------------------------------------------------------------*/
int zone_tree_find(zone_tree_t *tree, const knot_dname_t *owner,
const zone_node_t **found)
{
......@@ -74,8 +61,6 @@ int zone_tree_find(zone_tree_t *tree, const knot_dname_t *owner,
return zone_tree_get(tree, owner, (zone_node_t **)found);
}
/*----------------------------------------------------------------------------*/
int zone_tree_get(zone_tree_t *tree, const knot_dname_t *owner,
zone_node_t **found)
{
......@@ -100,8 +85,6 @@ int zone_tree_get(zone_tree_t *tree, const knot_dname_t *owner,
return KNOT_EOK;
}
/*----------------------------------------------------------------------------*/
int zone_tree_find_less_or_equal(zone_tree_t *tree,
const knot_dname_t *owner,
const zone_node_t **found,
......@@ -120,8 +103,6 @@ int zone_tree_find_less_or_equal(zone_tree_t *tree,
return ret;
}
/*----------------------------------------------------------------------------*/
int zone_tree_get_less_or_equal(zone_tree_t *tree,
const knot_dname_t *owner,
zone_node_t **found,
......@@ -174,8 +155,6 @@ int zone_tree_get_less_or_equal(zone_tree_t *tree,
return exact_match;
}
/*----------------------------------------------------------------------------*/
zone_node_t *zone_tree_get_next(zone_tree_t *tree,
const knot_dname_t *owner)
{
......@@ -208,8 +187,6 @@ zone_node_t *zone_tree_get_next(zone_tree_t *tree,
}
}
/*----------------------------------------------------------------------------*/
int zone_tree_remove(zone_tree_t *tree,
const knot_dname_t *owner,
zone_node_t **removed)
......@@ -236,8 +213,6 @@ int zone_tree_remove(zone_tree_t *tree,
return KNOT_EOK;
}
/*----------------------------------------------------------------------------*/
int zone_tree_apply_inorder(zone_tree_t *tree,
zone_tree_apply_cb_t function,
void *data)
......@@ -265,8 +240,6 @@ int zone_tree_apply_inorder(zone_tree_t *tree,
return result;
}
/*----------------------------------------------------------------------------*/
int zone_tree_apply(zone_tree_t *tree,
zone_tree_apply_cb_t function,
void *data)
......@@ -282,8 +255,6 @@ int zone_tree_apply(zone_tree_t *tree,
return hattrie_apply_rev(tree, (int (*)(value_t*,void*))function, data);
}
/*----------------------------------------------------------------------------*/
void zone_tree_free(zone_tree_t **tree)
{
if (tree == NULL || *tree == NULL) {
......@@ -293,8 +264,6 @@ void zone_tree_free(zone_tree_t **tree)
*tree = NULL;
}
/*----------------------------------------------------------------------------*/
static int zone_tree_free_node(zone_node_t **node, void *data)
{
UNUSED(data);
......
/*!
* \file zone-tree.h
*
* \author Lubos Slovak <lubos.slovak@nic.cz>
*
* \brief Zone tree structure and API for manipulating it.
*
* Implemented as AVL tree.
*
* \addtogroup libknot
* @{
*/
/* Copyright (C) 2011 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
/* Copyright (C) 2015 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -25,14 +13,20 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*!
* \file
*
* \brief Zone trie structure and API for manipulating it.
*
* \addtogroup zone
* @{
*/
#pragma once
#include "contrib/hat-trie/hat-trie.h"
#include "knot/zone/node.h"
/*----------------------------------------------------------------------------*/
typedef hattrie_t zone_tree_t;
/*!
......@@ -40,7 +34,6 @@ typedef hattrie_t zone_tree_t;
*/
typedef int (*zone_tree_apply_cb_t)(zone_node_t **node, void *data);
/*----------------------------------------------------------------------------*/
/*!
* \brief Creates the zone tree.
*
......@@ -222,6 +215,4 @@ void zone_tree_free(zone_tree_t **tree);
*/
void zone_tree_deep_free(zone_tree_t **tree);
/*----------------------------------------------------------------------------*/
/*! @} */
......@@ -20,22 +20,17 @@
#include <sys/stat.h>
#include <urcu.h>
#include "dnssec/random.h"
#include "knot/common/evsched.h"
#include "knot/common/log.h"
#include "knot/zone/node.h"
#include "knot/zone/serial.h"
#include "knot/zone/zone.h"
#include "knot/zone/zonefile.h"
#include "knot/zone/contents.h"
#include "knot/updates/acl.h"
#include "knot/updates/apply.h"
#include "knot/nameserver/process_query.h"
#include "libknot/libknot.h"
#include "libknot/processing/requestor.h"
#include "contrib/string.h"
#include "contrib/trim.h"
#include "contrib/mempattern.h"
#include "contrib/ucw/lists.h"
#include "contrib/ucw/mempool.h"
#define JOURNAL_SUFFIX ".diff.db"
......
/* Copyright (C) 2011 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
/* Copyright (C) 2015 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -14,11 +14,11 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*!
* \file zone.h
* \file
*
* \brief Zone structure and API for manipulating it.
*
* \addtogroup libknot
* \addtogroup zone
* @{
*/
......@@ -28,11 +28,8 @@
#include <stdbool.h>
#include <stdint.h>
#include "knot/common/evsched.h"
#include "knot/common/ref.h"
#include "knot/conf/conf.h"
#include "knot/server/journal.h"
#include "knot/updates/acl.h"
#include "knot/zone/events/events.h"
#include "knot/zone/contents.h"
#include "libknot/dname.h"
......
/* Copyright (C) 2013 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
/* Copyright (C) 2015 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -15,17 +15,14 @@
*/
#include <assert.h>
#include <sys/stat.h>
#include <urcu.h>
#include "knot/zone/zonedb-load.h"
#include "knot/zone/zone-load.h"
#include "knot/conf/conf.h"
#include "knot/zone/zone.h"
#include "knot/zone/zonefile.h"
#include "knot/zone/zonedb.h"
#include "knot/zone/timers.h"
#include "knot/server/server.h"
#include "knot/common/log.h"
#include "libknot/libknot.h"
......@@ -351,7 +348,7 @@ static int remove_old_zonedb(const knot_zonedb_t *db_new, knot_zonedb_t *db_old)
/*!
* \brief Update zone database according to configuration.
*/
int zonedb_reload(conf_t *conf, struct server *server)
int zonedb_reload(conf_t *conf, server_t *server)
{
/* Check parameters */
if (conf == NULL || server == NULL) {
......
/* Copyright (C) 2013 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
/* Copyright (C) 2015 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -17,9 +17,7 @@
#pragma once
#include "knot/conf/conf.h"
#include "knot/zone/zonedb.h"
struct server;
#include "knot/server/server.h"
/*!
* \brief Update zone database according to configuration.
......@@ -31,4 +29,4 @@ struct server;
* \retval KNOT_EINVAL
* \retval KNOT_ERROR
*/
int zonedb_reload(conf_t *conf, struct server *server);
int zonedb_reload(conf_t *conf, server_t *server);
......@@ -17,15 +17,8 @@
#include <stdlib.h>
#include <assert.h>
#include <urcu.h>
#include "knot/zone/zonedb.h"
#include "knot/server/server.h"
#include "knot/zone/zone.h"
#include "knot/zone/zonedb.h"
#include "libknot/dname.h"
#include "libknot/packet/wire.h"
#include "knot/zone/node.h"
#include "contrib/macros.h"
#include "contrib/mempattern.h"
#include "contrib/ucw/mempool.h"
......
/*!
* \file zonedb.h
*
* \author Lubos Slovak <lubos.slovak@nic.cz>
*
* \brief Zone database structure and API for manipulating it.
*
* Zone database groups several zones and provides functions for finding
* suitable zone for a domain name, for searching in a particular zone, etc.
*
* \addtogroup libknot
* @{
*/
/* Copyright (C) 2011 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
......@@ -26,12 +13,21 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*!
* \file
*
* \brief Zone database structure and API for manipulating it.
*
* Zone database groups several zones and provides functions for finding
* suitable zone for a domain name, for searching in a particular zone, etc.
*
* \addtogroup zone
* @{
*/
#pragma once
#include "knot/zone/node.h"
#include "knot/zone/zone.h"
#include "knot/zone/contents.h"
#include "libknot/dname.h"
#include "contrib/hhash.h"
......
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