Commit e24fc8bf authored by Vladimír Čunát's avatar Vladimír Čunát

remove some old code

parent 0c49eccb
......@@ -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);
......
......@@ -26,44 +26,12 @@
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
......
......@@ -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)
......
......@@ -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 */
......
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