summaryrefslogtreecommitdiff
path: root/usr.sbin/nsd
diff options
context:
space:
mode:
authorJakob Schlyter <jakob@cvs.openbsd.org>2010-01-15 19:24:56 +0000
committerJakob Schlyter <jakob@cvs.openbsd.org>2010-01-15 19:24:56 +0000
commitda21d22be27d618763189b7fa9c7f9cc44fe28ac (patch)
treed2779c870b7b0a1ea11223b78d4ab1fdb4c3ee89 /usr.sbin/nsd
parentc706a174f5fd648caaf55f957a754cec1187ad07 (diff)
NSD v3.2.4
Diffstat (limited to 'usr.sbin/nsd')
-rw-r--r--usr.sbin/nsd/nsec3.h73
1 files changed, 18 insertions, 55 deletions
diff --git a/usr.sbin/nsd/nsec3.h b/usr.sbin/nsd/nsec3.h
index 663776f220b..af87113ed56 100644
--- a/usr.sbin/nsd/nsec3.h
+++ b/usr.sbin/nsd/nsec3.h
@@ -9,8 +9,9 @@
#ifndef NSEC3_H
#define NSEC3_H
+#include <config.h>
#ifdef NSEC3
-struct udb_ptr;
+
struct domain;
struct dname;
struct region;
@@ -18,23 +19,27 @@ struct zone;
struct namedb;
struct query;
struct answer;
-struct rr;
/*
- * calculate prehash information for zone.
+ * Create the hashed name of the nsec3 record
+ * for the given dname.
*/
-void prehash_zone(struct namedb* db, struct zone* zone);
+const struct dname *nsec3_hash_dname(struct region *region,
+ struct zone *zone, const struct dname *dname);
+
/*
- * calculate prehash for zone, assumes no partial precompile or prehashlist
+ * calculate prehash information for all zones,
+ * selects only updated=1 zones if bool set.
*/
-void prehash_zone_complete(struct namedb* db, struct zone* zone);
+void prehash(struct namedb* db, int updated_only);
/*
- * finds nsec3 that covers the given domain hash.
+ * finds nsec3 that covers the given domain dname.
* returns true if the find is exact.
+ * hashname is the already hashed dname for the NSEC3.
*/
-int nsec3_find_cover(struct zone* zone, uint8_t* hash, size_t hashlen,
- struct domain** result);
+int nsec3_find_cover(struct namedb* db, struct zone* zone,
+ const struct dname* hashname, struct domain** result);
/*
* _answer_ Routines used to add the correct nsec3 record to a query answer.
@@ -44,8 +49,9 @@ int nsec3_find_cover(struct zone* zone, uint8_t* hash, size_t hashlen,
* add proof for wildcards that the name below the wildcard.parent
* does not exist
*/
-void nsec3_answer_wildcard(struct query* query, struct answer* answer,
- struct domain* wildcard, const struct dname* qname);
+void nsec3_answer_wildcard(struct query *query, struct answer *answer,
+ struct domain *wildcard, struct namedb* db,
+ const struct dname *qname);
/*
* add NSEC3 to provide domain name but not rrset exists,
@@ -65,7 +71,7 @@ void nsec3_answer_delegation(struct query *query, struct answer *answer);
*/
void nsec3_answer_authoritative(struct domain** match, struct query *query,
struct answer *answer, struct domain* closest_encloser,
- const struct dname* qname);
+ struct namedb* db, const struct dname* qname);
/*
* True if domain is a NSEC3 (+RRSIG) data only variety.
@@ -73,48 +79,5 @@ void nsec3_answer_authoritative(struct domain** match, struct query *query,
*/
int domain_has_only_NSEC3(struct domain* domain, struct zone* zone);
-/* get hashed bytes */
-void nsec3_hash_and_store(struct zone* zone, const struct dname* dname,
- uint8_t* store);
-/* see if NSEC3 record uses the params in use for the zone */
-int nsec3_rr_uses_params(struct rr* rr, struct zone* zone);
-/* number of NSEC3s that are in the zone chain */
-int nsec3_in_chain_count(struct domain* domain, struct zone* zone);
-/* find previous NSEC3, or, lastinzone, or, NULL */
-struct domain* nsec3_chain_find_prev(struct zone* zone, struct domain* domain);
-/* clear nsec3 precompile for the zone */
-void nsec3_clear_precompile(struct namedb* db, struct zone* zone);
-/* if domain is part of nsec3hashed domains of a zone */
-int nsec3_domain_part_of_zone(struct domain* d, struct zone* z);
-/* condition when a domain is precompiled */
-int nsec3_condition_hash(struct domain* d, struct zone* z);
-/* condition when a domain is ds precompiled */
-int nsec3_condition_dshash(struct domain* d, struct zone* z);
-/* set nsec3param for this zone or NULL if no NSEC3 available */
-void nsec3_find_zone_param(struct namedb* db, struct zone* zone,
- struct udb_ptr* z, struct rr* avoid_rr);
-/* hash domain and wcchild, and lookup nsec3 in tree, and precompile */
-void nsec3_precompile_domain(struct namedb* db, struct domain* domain,
- struct zone* zone, struct region* tmpregion);
-/* hash ds_parent_cover, and lookup nsec3 and precompile */
-void nsec3_precompile_domain_ds(struct namedb* db, struct domain* domain,
- struct zone* zone);
-/* put nsec3 into nsec3tree and adjust zonelast */
-void nsec3_precompile_nsec3rr(struct namedb* db, struct domain* domain,
- struct zone* zone);
-/* precompile entire zone, assumes all is null at start */
-void nsec3_precompile_newparam(struct namedb* db, struct zone* zone);
-/* create b32.zone for a hash, allocated in the region */
-const struct dname* nsec3_b32_create(struct region* region, struct zone* zone,
- unsigned char* hash);
-/* create trees for nsec3 updates and lookups in zone */
-void nsec3_zone_trees_create(struct region* region, struct zone* zone);
-/* clear trees for nsec3 in zone */
-void nsec3_hash_tree_clear(struct zone* zone);
-/* lookup zone that contains domain's nsec3 trees */
-struct zone* nsec3_tree_zone(struct namedb* db, struct domain* domain);
-/* lookup zone that contains domain's ds tree */
-struct zone* nsec3_tree_dszone(struct namedb* db, struct domain* domain);
-
#endif /* NSEC3 */
#endif /* NSEC3_H*/