static const int EXPIRING = 1 << 12;
static const int DNSSEC_WANT = 1 << 14;
static const int STUB = 1 << 17;
+ static const int ALWAYS_CUT = 1 << 18;
};
/*
RESUME_LAYERS(layer_id(request, pickle->api), request, qry, consume, pickle->pkt);
qry->deferred = pickle->next;
} else {
+ /* Caller is interested in always tracking a zone cut, even if the answer is cached
+ * this is normally not required, and incurrs another cache lookups for cached answer. */
+ if (qry->flags & QUERY_ALWAYS_CUT) {
+ switch(zone_cut_check(request, qry, packet)) {
+ case KNOT_STATE_FAIL: return KNOT_STATE_FAIL;
+ case KNOT_STATE_DONE: return KNOT_STATE_PRODUCE;
+ default: break;
+ }
+ }
/* Resolve current query and produce dependent or finish */
request->state = KNOT_STATE_PRODUCE;
ITERATE_LAYERS(request, qry, produce, packet);
X(DNSSEC_BOGUS, 1 << 15) /**< Query response is DNSSEC bogus. */ \
X(DNSSEC_INSECURE, 1 << 16) /**< Query response is DNSSEC insecure. */ \
X(STUB, 1 << 17) /**< Stub resolution, accept received answer as solved. */ \
+ X(ALWAYS_CUT, 1 << 18) /**< Always recover zone cut (even if cached). */
/** Query flags */
enum kr_query_flag {
uint32_t flags;
uint32_t secret;
struct timeval timestamp;
- struct kr_nsrep ns;
struct kr_zonecut zone_cut;
+ struct kr_nsrep ns;
struct kr_layer_pickle *deferred;
};
*/
struct kr_zonecut {
knot_dname_t *name; /**< Zone cut name. */
- map_t nsset; /**< Map of nameserver => address_set. */
knot_rrset_t* key; /**< Zone cut DNSKEY. */
knot_rrset_t* trust_anchor; /**< Current trust anchor. */
struct kr_zonecut *parent; /**< Parent zone cut. */
+ map_t nsset; /**< Map of nameserver => address_set. */
knot_mm_t *pool; /**< Memory pool. */
};