]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
remove some old code
authorVladimír Čunát <vladimir.cunat@nic.cz>
Fri, 10 Nov 2017 16:31:35 +0000 (17:31 +0100)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Fri, 10 Nov 2017 16:55:10 +0000 (17:55 +0100)
lib/cache.c
lib/cache.h
lib/cdb_lmdb.c
lib/zonecut.c

index e28b8d579763202cfbac3be591001c4a205964f7..fae5609347423923eddde00a0386ba5c82d05755 100644 (file)
@@ -154,8 +154,6 @@ int kr_cache_clear(struct kr_cache *cache)
 
 
 
-
-
 struct nsec_p {
        struct {
                uint8_t salt_len;
@@ -202,8 +200,6 @@ struct entry_h * entry_h_consistent(knot_db_val_t data, uint16_t ktype)
 }
 
 
-
-
 int32_t get_new_ttl(const struct entry_h *entry, uint32_t current_time)
 {
        int32_t diff = current_time - entry->time;
@@ -223,8 +219,6 @@ int32_t kr_cache_ttl(const struct kr_cache_p *peek, uint32_t current_time)
 
 
 
-
-
 /* forwards for larger chunks of code */
 
 static uint8_t get_lowest_rank(const struct kr_request *req, const struct kr_query *qry);
index 8f359c9f5e5fb9c607463f126873972919ab5cd7..2d189b7d9e3dd2252155a7780c2b084ab3045479 100644 (file)
 static const size_t PKT_SIZE_NOWIRE = -1;
 
 
-/** Cache entry tag */
-enum kr_cache_tag {
-       KR_CACHE_RR   = 'R',
-       KR_CACHE_PKT  = 'P',
-       KR_CACHE_SIG  = 'G',
-       KR_CACHE_USER = 0x80
-};
-
-/** Cache entry flags */
-enum kr_cache_flag {
-       KR_CACHE_FLAG_NONE        = 0,
-       KR_CACHE_FLAG_WCARD_PROOF = 1, /* Entry contains either packet with wildcard
-                                       * answer either record for which wildcard
-                                       * expansion proof is needed */
-       KR_CACHE_FLAG_OPTOUT      = 2, /* Entry contains secured packet containing a
-                                       * closest  encloser proof in which the NSEC3 RR
-                                       * that covers the "next closer" name
-                                       * has the Opt-Out bit set
-                                       */
-       KR_CACHE_FLAG_NODS        = 4, /* Entry contains NS rrset
-                                       * for which DS nonexistence is proven.
-                                       */
-};
+#include "lib/module.h"
+/* Prototypes for the cache_lmdb module implementation. */
+int cache_lmdb_peek(kr_layer_t *ctx, knot_pkt_t *pkt);
+int cache_lmdb_stash(kr_layer_t *ctx, knot_pkt_t *pkt);
 
 
-/**
- * Serialized form of the RRSet with inception timestamp and maximum TTL.
- */
-struct kr_cache_entry
-{
-       uint32_t timestamp;
-       uint32_t ttl;
-       uint16_t count;
-       uint8_t  rank;
-       uint8_t  flags;
-       uint8_t  data[];
-};
-
 /**
  * Cache structure, keeps API, instance and metadata.
  */
@@ -81,13 +49,6 @@ struct kr_cache
        uint32_t ttl_min, ttl_max; /**< Maximum TTL of inserted entries */
 };
 
-
-
-#include "lib/module.h"
-/* Prototypes for the cache_lmdb module implementation. */
-int cache_lmdb_peek(kr_layer_t *ctx, knot_pkt_t *pkt);
-int cache_lmdb_stash(kr_layer_t *ctx, knot_pkt_t *pkt);
-
 /**
  * Open/create cache with provided storage options.
  * @param cache cache structure to be initialized
index ac209dbdec39aedf9200d2f5937ae42cf9b4d416..ed5e4db83489df12e869ac85174bce1c59e78cd2 100644 (file)
@@ -606,6 +606,8 @@ static int cdb_match(knot_db_t *db, knot_db_val_t *key, knot_db_val_t *val, int
 
 static int cdb_prune(knot_db_t *db, int limit)
 {
+       return -1;
+#if 0
        /* Sync in-flight transactions */
        cdb_sync(db);
 
@@ -653,6 +655,7 @@ static int cdb_prune(knot_db_t *db, int limit)
        }
        mdb_cursor_close(cur);
        return ret < 0 ? ret : results;
+#endif
 }
 
 static int cdb_read_leq(knot_db_t *env, knot_db_val_t *key, knot_db_val_t *val)
index 398bbbf07a242e20b2cb76093dafc15b1082271c..5f6aad212ed3b27d5d3d69dbf3e364fbc57eb422 100644 (file)
@@ -296,7 +296,7 @@ static void fetch_addr(struct kr_zonecut *cut, struct kr_cache *cache, const kno
 /** Fetch best NS for zone cut. */
 static int fetch_ns(struct kr_context *ctx, struct kr_zonecut *cut,
                    const knot_dname_t *name, uint32_t timestamp,
-                   uint8_t * restrict rank, uint8_t * restrict flags)
+                   uint8_t * restrict rank)
 {
        struct kr_cache_p peek = {};
        int ret = kr_cache_peek_exact(&ctx->cache, name, KNOT_RRTYPE_NS, &peek);
@@ -400,12 +400,10 @@ int kr_zonecut_find_cached(struct kr_context *ctx, struct kr_zonecut *cut, const
        while (true) {
                /* Fetch NS first and see if it's insecure. */
                uint8_t rank = 0;
-               uint8_t flags = 0;
                const bool is_root = (label[0] == '\0');
-               if (fetch_ns(ctx, cut, label, timestamp, &rank, &flags) == 0) {
+               if (fetch_ns(ctx, cut, label, timestamp, &rank) == 0) {
                        /* Flag as insecure if cached as this */
-                       if (kr_rank_test(rank, KR_RANK_INSECURE) ||
-                           (flags & KR_CACHE_FLAG_NODS)) {
+                       if (kr_rank_test(rank, KR_RANK_INSECURE)) {
                                *secured = false;
                        }
                        /* Fetch DS and DNSKEY if caller wants secure zone cut */