X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fresolve%2Fresolved-dns-cache.h;h=e92280c31957b19e3f3645a1b36c3111e67fac4f;hp=8d1cf95342f42eb744743681112c72906e4ff7ce;hb=de45d726034f33afdb0a185e62fc61bf10a0acd2;hpb=322345fdb9865ef2477fba8e4bdde0e1183ef505 diff --git a/src/resolve/resolved-dns-cache.h b/src/resolve/resolved-dns-cache.h index 8d1cf9534..e92280c31 100644 --- a/src/resolve/resolved-dns-cache.h +++ b/src/resolve/resolved-dns-cache.h @@ -28,30 +28,19 @@ #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); +int dns_cache_put(DnsCache *c, DnsQuestion *q, int rcode, DnsAnswer *answer, unsigned max_rrs, usec_t timestamp, int owner_family, const union in_addr_union *owner_address); +int dns_cache_lookup(DnsCache *c, DnsQuestion *q, int *rcode, DnsAnswer **answer); -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_check_conflicts(DnsCache *cache, DnsResourceRecord *rr, int owner_family, const union in_addr_union *owner_address);