Lines Matching refs:cache
23 #include "resolved-dns-cache.h"
27 /* Never cache more than 4K entries. RFC 1536, Section 5 suggests to
31 /* We never keep any item longer than 2h in our cache */
150 * the cache to grow beyond CACHE_MAX, but only when we shall
151 * add more RRs to the cache than CACHE_MAX at once. In that
152 * case the cache will be emptied completely otherwise. */
386 /* Never cache pseudo RRs */
402 log_debug("Removed zero TTL entry from cache: %s", key_str);
404 log_debug("Not caching zero TTL cache entry: %s", key_str);
457 log_debug("Added positive cache entry for %s", key_str);
484 /* Never cache pseudo RR keys. DNS_TYPE_ANY is particularly
532 * specific ANY key. (For non-ANY keys the cache data
534 * don't bother removing positive or NODATA cache
550 log_debug("Added %s cache entry for %s", i->type == DNS_CACHE_NODATA ? "NODATA" : "NXDOMAIN", key_str);
575 * peers (i.e. mDNS RRs without the flush-cache bit set). */
590 /* When we see an NSEC/NSEC3 RR, we'll only cache it if it is from the lower zone, not the upper zone, since
756 * much, after all this is just a cache */
764 /* Check if we have an NXDOMAIN cache item for the name, notice that we use
765 * the pseudo-type ANY for NXDOMAIN cache items. */
820 /* If we have ANY lookups we don't use the cache, so
828 log_debug("Ignoring cache for ANY lookup: %s", key_str);
873 /* Note that we won't derive information for DS RRs from an NSEC, because we only cache NSEC RRs from
881 log_debug("NSEC NODATA cache hit for %s", key_str);
886 * NODATA. Otherwise report a cache miss. */
908 log_debug("%s cache hit for %s",
946 int dns_cache_check_conflicts(DnsCache *cache, DnsResourceRecord *rr, int owner_family, const union in_addr_union *owner_address) {
950 assert(cache);
953 dns_cache_prune(cache);
955 /* See if there's a cache entry for the same key. If there
957 first = hashmap_get(cache->by_key, rr->key);
973 /* See if there's the exact same RR in the cache. If yes, then
975 if (dns_cache_get(cache, rr))
982 int dns_cache_export_shared_to_packet(DnsCache *cache, DnsPacket *p) {
988 assert(cache);
991 HASHMAP_FOREACH(i, cache->by_key, iterator) {
1031 void dns_cache_dump(DnsCache *cache, FILE *f) {
1036 if (!cache)
1042 HASHMAP_FOREACH(i, cache->by_key, iterator) {
1076 bool dns_cache_is_empty(DnsCache *cache) {
1077 if (!cache)
1080 return hashmap_isempty(cache->by_key);
1083 unsigned dns_cache_size(DnsCache *cache) {
1084 if (!cache)
1087 return hashmap_size(cache->by_key);