Lines Matching refs:query
26 int dns_cache_add(struct dns_cache *cache, char const *query, struct dns_addrinfo const *addrinfo, in dns_cache_add() argument
33 if (cache == NULL || query == NULL || addrinfo == NULL || ttl == 0) { in dns_cache_add()
37 if (strlen(query) >= CONFIG_DNS_RESOLVER_MAX_QUERY_LEN) { in dns_cache_add()
40 strlen(query)); in dns_cache_add()
46 NET_DBG("Add \"%s\" with TTL %" PRIu32, query, ttl); in dns_cache_add()
62 NET_DBG("Overwrite \"%s\"", cache->entries[index_to_replace].query); in dns_cache_add()
65 strncpy(cache->entries[index_to_replace].query, query, in dns_cache_add()
76 int dns_cache_remove(struct dns_cache *cache, char const *query) in dns_cache_remove() argument
78 if (cache == NULL || query == NULL) { in dns_cache_remove()
82 NET_DBG("Remove all entries with query \"%s\"", query); in dns_cache_remove()
83 if (strlen(query) >= CONFIG_DNS_RESOLVER_MAX_QUERY_LEN) { in dns_cache_remove()
86 strlen(query)); in dns_cache_remove()
95 if (cache->entries[i].in_use && strcmp(cache->entries[i].query, query) == 0) { in dns_cache_remove()
105 int dns_cache_find(struct dns_cache const *cache, const char *query, enum dns_query_type type, in dns_cache_find() argument
111 NET_DBG("Find \"%s\"", query); in dns_cache_find()
112 if (cache == NULL || query == NULL || addrinfo == NULL || addrinfo_array_len <= 0) { in dns_cache_find()
122 if (strlen(query) >= CONFIG_DNS_RESOLVER_MAX_QUERY_LEN) { in dns_cache_find()
125 strlen(query)); in dns_cache_find()
137 if (strcmp(cache->entries[i].query, query) != 0) { in dns_cache_find()
144 NET_WARN("Found \"%s\" but not enough space in provided buffer.", query); in dns_cache_find()
149 NET_DBG("Found \"%s\"", query); in dns_cache_find()
160 NET_DBG("Could not find \"%s\"", query); in dns_cache_find()
174 NET_DBG("Remove \"%s\"", cache->entries[i].query); in dns_cache_clean()