chiark / gitweb /
resolved: we don't need the DNS server "source" concept anymore, remove it
[elogind.git] / src / resolve / resolved-dns-cache.h
index 1ede5bfd81cab9fd01d17bbaa8e48d163fde70a8..590cf691b3e75c2d6b03847fa5037ac3b72a2358 100644 (file)
 #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_lookup(DnsCache *c, DnsQuestion *q, DnsAnswer **ret);
+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);