X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fresolve%2Fresolved-dns-cache.h;h=590cf691b3e75c2d6b03847fa5037ac3b72a2358;hb=2f82f5eae471a23a7aa9f40f19079a4b63e19496;hp=8d1cf95342f42eb744743681112c72906e4ff7ce;hpb=322345fdb9865ef2477fba8e4bdde0e1183ef505;p=elogind.git diff --git a/src/resolve/resolved-dns-cache.h b/src/resolve/resolved-dns-cache.h index 8d1cf9534..590cf691b 100644 --- a/src/resolve/resolved-dns-cache.h +++ b/src/resolve/resolved-dns-cache.h @@ -28,30 +28,17 @@ #include "time-util.h" #include "list.h" -typedef struct DnsCacheItem DnsCacheItem; - typedef struct DnsCache { - Hashmap *rrsets; - Prioq *expire; + Hashmap *by_key; + Prioq *by_expiry; } DnsCache; #include "resolved-dns-rr.h" - -typedef struct DnsCacheItem { - DnsResourceRecord *rr; - usec_t timestamp; - unsigned expire_prioq_idx; - LIST_FIELDS(DnsCacheItem, rrsets); -} DnsCacheItem; +#include "resolved-dns-question.h" +#include "resolved-dns-answer.h" void dns_cache_flush(DnsCache *c); void dns_cache_prune(DnsCache *c); -void dns_cache_remove(DnsCache *c, DnsResourceKey *key); - -int dns_cache_put(DnsCache *c, DnsResourceRecord *rr, usec_t timestamp); -int dns_cache_put_rrs(DnsCache *c, DnsResourceRecord **rrs, unsigned n_rrs, usec_t timestamp); - -DnsCacheItem* dns_cache_lookup(DnsCache *c, DnsResourceKey *key); -DnsCacheItem* dns_cache_get(DnsCache *c, DnsResourceRecord *rr); -int dns_cache_lookup_many(DnsCache *c, DnsResourceKey *keys, unsigned n_keys, DnsResourceRecord ***rrs); +int dns_cache_put(DnsCache *c, DnsQuestion *q, int rcode, DnsAnswer *answer, usec_t timestamp); +int dns_cache_lookup(DnsCache *c, DnsQuestion *q, int *rcode, DnsAnswer **answer);