Lines Matching refs:key

45         DnsResourceKey *key;
65 dns_resource_key_unref(i->key);
79 first = hashmap_get(c->by_key, i->key);
83 assert_se(hashmap_replace(c->by_key, first->key, first) >= 0);
85 hashmap_remove(c->by_key, i->key);
96 first = hashmap_get(c->by_key, rr->key);
110 static bool dns_cache_remove_by_key(DnsCache *c, DnsResourceKey *key) {
114 assert(key);
116 first = hashmap_remove(c->by_key, key);
129 DnsResourceKey *key;
133 while ((key = hashmap_first_key(c->by_key)))
134 dns_cache_remove_by_key(c, key);
155 _cleanup_(dns_resource_key_unrefp) DnsResourceKey *key = NULL;
167 /* Take an extra reference to the key so that it
169 key = dns_resource_key_ref(i->key);
170 dns_cache_remove_by_key(c, key);
200 _cleanup_(dns_resource_key_unrefp) DnsResourceKey *key = NULL;
202 /* Take an extra reference to the key so that it
204 key = dns_resource_key_ref(i->key);
205 dns_cache_remove_by_key(c, key);
247 first = hashmap_get(c->by_key, i->key);
251 /* Keep a reference to the original key, while we manipulate the list. */
252 k = dns_resource_key_ref(first->key);
255 dns_resource_key_reduce(&first->key, &i->key);
258 dns_resource_key_reduce(&first->rr->key, &i->key);
260 dns_resource_key_reduce(&i->rr->key, &i->key);
263 assert_se(hashmap_replace(c->by_key, first->key, first) >= 0);
265 r = hashmap_put(c->by_key, i->key, i);
281 LIST_FOREACH(by_key, i, hashmap_get(c->by_key, rr->key))
295 if (rr->key->type == DNS_TYPE_SOA && use_soa_minimum) {
344 * update the key used in the hashmap */
346 assert_se(hashmap_replace(c->by_key, rr->key, i) >= 0);
352 dns_resource_key_unref(i->key);
353 i->key = dns_resource_key_ref(rr->key);
387 if (dns_class_is_pseudo(rr->key->class))
389 if (dns_type_is_pseudo(rr->key->type))
397 r = dns_resource_key_to_string(rr->key, &key_str);
438 i->key = dns_resource_key_ref(rr->key);
453 r = dns_resource_key_to_string(i->key, &key_str);
466 DnsResourceKey *key,
480 assert(key);
487 if (dns_class_is_pseudo(key->class))
489 if (dns_type_is_pseudo(key->type))
494 r = dns_resource_key_to_string(key, &key_str);
527 i->key = dns_resource_key_new(key->class, DNS_TYPE_ANY, DNS_RESOURCE_KEY_NAME(key));
528 if (!i->key)
532 * specific ANY key. (For non-ANY keys the cache data
537 dns_cache_remove_by_key(c, key);
539 i->key = dns_resource_key_ref(key);
546 r = dns_resource_key_to_string(i->key, &key_str);
559 DnsResourceKey *key,
567 /* First, if we were passed a key (i.e. on LLMNR/DNS, but
570 if (key)
571 dns_cache_remove_by_key(c, key);
583 dns_cache_remove_by_key(c, rr->key);
594 switch (rr->key->type) {
611 DnsResourceKey *key,
628 dns_cache_remove_previous(c, key, answer);
634 r = dns_resource_key_to_string(key, &key_str);
651 if (key)
683 if (!key) /* mDNS doesn't know negative caching, really */
686 /* Third, add in negative entries if the key has no RR */
687 r = dns_answer_match_key(answer, key, NULL);
696 r = dns_answer_find_cname_or_dname(answer, key, NULL, NULL);
705 r = dns_answer_find_soa(answer, key, &soa, &flags);
711 /* Refuse using the SOA data if it is unsigned, but the key is
718 key,
734 if (key)
735 dns_cache_remove_by_key(c, key);
741 dns_cache_remove_by_key(c, rr->key);
802 int dns_cache_lookup(DnsCache *c, DnsResourceKey *key, int *rcode, DnsAnswer **ret, bool *authenticated) {
812 assert(key);
817 if (key->type == DNS_TYPE_ANY ||
818 key->class == DNS_CLASS_ANY) {
824 r = dns_resource_key_to_string(key, &key_str);
838 first = dns_cache_get_by_key_follow_cname_dname_nsec(c, key);
843 r = dns_resource_key_to_string(key, &key_str);
859 if (j->rr->key->type == DNS_TYPE_NSEC)
872 if (nsec && !IN_SET(key->type, DNS_TYPE_NSEC, DNS_TYPE_DS)) {
877 r = dns_resource_key_to_string(key, &key_str);
892 if (!bitmap_isset(nsec->rr->nsec.types, key->type) &&
904 r = dns_resource_key_to_string(key, &key_str);
955 /* See if there's a cache entry for the same key. If there
957 first = hashmap_get(cache->by_key, rr->key);
961 /* See if the RR key is owned by the same owner, if so, there
1061 r = dns_resource_key_to_string(j->key, &z);