1. kresd/cache

/kr_cache_peek /zonecut.c

https://github.com/CZ-NIC/knot-resolver/issues/34

2. 管理

キャッシュは"kr_cache_*"インタフェースで管理される。

$ grep KR_CACHE_ ../*.c

../cache.c:     int ret = kr_cache_peek(txn, KR_CACHE_RR, rr->owner, rr->type, &entry, timestamp);
../cache.c:     return kr_cache_insert(txn, KR_CACHE_RR, rr->owner, rr->type, &header, data);
../cache.c:     int ret = kr_cache_peek(txn, KR_CACHE_SIG, rr->owner, rr->type, &entry, timestamp);
../cache.c:     return kr_cache_insert(txn, KR_CACHE_SIG, rr->owner, covered, &header, data);
../resolve.c:           int ret = kr_cache_peek(txn, KR_CACHE_PKT, target, KNOT_RRTYPE_NS, &entry, &timestamp);

$ grep KR_CACHE_ *.c

pktcache.c:     int ret = kr_cache_peek(txn, KR_CACHE_PKT, qname, rrtype, &entry, &timestamp);
pktcache.c:             if (flags & KR_CACHE_FLAG_WCARD_PROOF) {
pktcache.c:             .flags = KR_CACHE_FLAG_NONE,
pktcache.c:             header.flags |= KR_CACHE_FLAG_WCARD_PROOF;
pktcache.c:             int cached_rank = kr_cache_peek_rank(&txn, KR_CACHE_PKT, qname, qtype, header.timestamp);
pktcache.c:     int ret = kr_cache_insert(&txn, KR_CACHE_PKT, qname, qtype, &header, data);     
rrcache.c:      if ((*flags) & KR_CACHE_FLAG_WCARD_PROOF) {
rrcache.c:              return commit_rrsig(baton, rank, KR_CACHE_FLAG_NONE, rr);
rrcache.c:              int cached_rank = kr_cache_peek_rank(baton->txn, KR_CACHE_RR, rr->owner, rr->type, baton->timestamp);
rrcache.c:      uint8_t flags = KR_CACHE_FLAG_NONE;
rrcache.c:              flags |= KR_CACHE_FLAG_WCARD_PROOF;

-- ToshinoriMaeno 2016-04-23 13:05:07