From: Marek VavruĊĦa Date: Wed, 22 Apr 2015 19:42:19 +0000 (+0200) Subject: lib: cleanup X-Git-Tag: v1.0.0-beta1~231^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cfe1a9f9ecb2b81b3ee90471277ce1d1536671a0;p=thirdparty%2Fknot-resolver.git lib: cleanup --- diff --git a/lib/nsrep.h b/lib/nsrep.h index e61f063f2..e0f25d772 100644 --- a/lib/nsrep.h +++ b/lib/nsrep.h @@ -21,24 +21,33 @@ #pragma once #include +#include #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); diff --git a/lib/rplan.h b/lib/rplan.h index 534280d3c..fc4fe1a0a 100644 --- a/lib/rplan.h +++ b/lib/rplan.h @@ -21,7 +21,6 @@ #pragma once #include - #include #include #include diff --git a/lib/zonecut.h b/lib/zonecut.h index ed2cf3765..4022198c9 100644 --- a/lib/zonecut.h +++ b/lib/zonecut.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. */ }; /**