-DnsCacheItem* dns_cache_lookup(DnsCache *c, DnsResourceKey *key) {
- assert(c);
- assert(key);
-
- return hashmap_get(c->rrsets, key);
-}
-
-DnsCacheItem* dns_cache_get(DnsCache *c, DnsResourceRecord *rr) {
- DnsCacheItem *i;
-
- assert(c);
- assert(rr);
-
- LIST_FOREACH(rrsets, i, hashmap_get(c->rrsets, &rr->key))
- if (dns_resource_record_equal(i->rr, rr))
- return i;
-
- return NULL;
-}
-
-int dns_cache_lookup_many(DnsCache *c, DnsResourceKey *keys, unsigned n_keys, DnsResourceRecord ***rrs) {
- DnsResourceRecord **p = NULL;
- size_t allocated = 0, used = 0;
- unsigned i;
+int dns_cache_lookup(DnsCache *c, DnsQuestion *q, DnsAnswer **ret) {
+ _cleanup_(dns_answer_unrefp) DnsAnswer *answer = NULL;
+ unsigned i, n = 0;