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=1ede5bfd81cab9fd01d17bbaa8e48d163fde70a8;hb=de45d726034f33afdb0a185e62fc61bf10a0acd2;hpb=faa133f3aa7a18f26563dc5d6b95898cb315c37a diff --git a/src/resolve/resolved-dns-cache.h b/src/resolve/resolved-dns-cache.h index 1ede5bfd8..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" #include "resolved-dns-question.h" #include "resolved-dns-answer.h" -typedef struct DnsCacheItem { - DnsResourceRecord *rr; - usec_t timestamp; - unsigned expire_prioq_idx; - LIST_FIELDS(DnsCacheItem, rrsets); -} DnsCacheItem; - 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_answer(DnsCache *c, DnsAnswer *answer, 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); -int dns_cache_lookup(DnsCache *c, DnsQuestion *q, DnsAnswer **ret); +int dns_cache_check_conflicts(DnsCache *cache, DnsResourceRecord *rr, int owner_family, const union in_addr_union *owner_address);