Commit cfe1a9f9 authored by Marek Vavruša's avatar Marek Vavruša

lib: cleanup

parent 250b12d6
......@@ -21,24 +21,33 @@
#pragma once
#include <netinet/in.h>
#include <libknot/dname.h>
#include "lib/generic/map.h"
#include "lib/layer.h"
/**
* Special values for nameserver score.
* All positive values mean valid nameserver.
*/
enum kr_ns_score {
KR_NS_INVALID = 0,
KR_NS_VALID = 1
};
/**
* Name server representation.
* Contains extra information about the name server, e.g. score
* or other metadata.
*/
struct kr_nsrep
{
unsigned score;
const knot_dname_t *name;
unsigned score; /**< Server score */
const knot_dname_t *name; /**< Server name */
union {
struct sockaddr ip;
struct sockaddr_in ip4;
struct sockaddr_in6 ip6;
} addr;
} addr; /**< Server address */
};
/** @internal Address bytes for given family. */
......@@ -52,7 +61,7 @@ struct kr_nsrep
* Elect best nameserver/address pair from the nsset.
* @param ns updated NS representation
* @param nsset NS set to choose from
* @return 0 if success (ns is updated), error otherwise
* @return score, see enum kr_ns_score
*/
int kr_nsrep_elect(struct kr_nsrep *ns, map_t *nsset);
......
......@@ -21,7 +21,6 @@
#pragma once
#include <sys/time.h>
#include <libknot/dname.h>
#include <libknot/internal/lists.h>
#include <libknot/internal/namedb/namedb.h>
......
......@@ -20,9 +20,9 @@
#pragma once
#include "lib/cache.h"
#include "lib/generic/map.h"
#include "lib/generic/pack.h"
#include "lib/cache.h"
struct kr_rplan;
......@@ -31,8 +31,8 @@ struct kr_rplan;
*/
struct kr_zonecut {
knot_dname_t *name; /**< Zone cut name. */
mm_ctx_t *pool; /**< Memory pool. */
map_t nsset; /**< Map of nameserver => address_set. */
mm_ctx_t *pool; /**< Memory pool. */
map_t nsset; /**< Map of nameserver => address_set. */
};
/**
......
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