]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
lib: cleanup
authorMarek Vavruša <marek.vavrusa@nic.cz>
Wed, 22 Apr 2015 19:42:19 +0000 (21:42 +0200)
committerMarek Vavruša <marek.vavrusa@nic.cz>
Wed, 22 Apr 2015 19:42:19 +0000 (21:42 +0200)
lib/nsrep.h
lib/rplan.h
lib/zonecut.h

index e61f063f2897545e13c5b834e315685b03fcc8a4..e0f25d772d65f60d554c44fc2a0c0b1a05cecf45 100644 (file)
 #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);
 
index 534280d3c2204faaaa0aefa7b6b2e87ccdd5f5bd..fc4fe1a0ae68f39f29147e34cf30cac88a5df937 100644 (file)
@@ -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>
index ed2cf3765a515d3bc55669702ef6698e5db0f7e3..4022198c92365cae485b0635ebe654ce671db03c 100644 (file)
@@ -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. */
 };
 
 /**