-
-
struct nsec_p {
struct {
uint8_t salt_len;
}
-
-
int32_t get_new_ttl(const struct entry_h *entry, uint32_t current_time)
{
int32_t diff = current_time - entry->time;
-
-
/* forwards for larger chunks of code */
static uint8_t get_lowest_rank(const struct kr_request *req, const struct kr_query *qry);
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.
*/
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
static int cdb_prune(knot_db_t *db, int limit)
{
+ return -1;
+#if 0
/* Sync in-flight transactions */
cdb_sync(db);
}
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)
/** 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);
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 */