Lines Matching refs:cache_info

1784 static void _insert_cache_info_locked(struct resolv_cache_info* cache_info);
1794 static void _free_nameservers_locked(struct resolv_cache_info* cache_info);
1796 * currently attached to the provided cache_info */
1797 static int _resolv_is_nameservers_equal_locked(struct resolv_cache_info* cache_info,
1819 struct resolv_cache_info* cache_info = _create_cache_info();
1820 if (cache_info) {
1823 cache_info->cache = cache;
1824 cache_info->netid = netid;
1825 _insert_cache_info_locked(cache_info);
1827 free(cache_info);
1862 struct resolv_cache_info* cache_info = prev_cache_info->next;
1864 if (cache_info->netid == netid) {
1865 prev_cache_info->next = cache_info->next;
1866 _cache_flush_locked(cache_info->cache);
1867 free(cache_info->cache->entries);
1868 free(cache_info->cache);
1869 _free_nameservers_locked(cache_info);
1870 free(cache_info);
1883 struct resolv_cache_info* cache_info;
1885 cache_info = calloc(sizeof(*cache_info), 1);
1886 return cache_info;
1890 _insert_cache_info_locked(struct resolv_cache_info* cache_info)
1896 last->next = cache_info;
1913 struct resolv_cache_info* cache_info = _res_cache_list.next;
1915 while (cache_info) {
1916 if (cache_info->netid == netid) {
1920 cache_info = cache_info->next;
1922 return cache_info;
1941 struct resolv_cache_info* cache_info = _find_cache_info_locked(netid);
1943 if (cache_info != NULL &&
1944 !_resolv_is_nameservers_equal_locked(cache_info, servers, numservers)) {
1946 _free_nameservers_locked(cache_info);
1956 rt = getaddrinfo(servers[i], sbuf, &hints, &cache_info->nsaddrinfo[index]);
1958 cache_info->nameservers[index] = strdup(servers[i]);
1962 cache_info->nsaddrinfo[index] = NULL;
1967 strlcpy(cache_info->defdname, domains, sizeof(cache_info->defdname));
1968 if ((cp = strchr(cache_info->defdname, '\n')) != NULL)
1970 cp = cache_info->defdname;
1971 offset = cache_info->dnsrch_offset;
1972 while (offset < cache_info->dnsrch_offset + MAXDNSRCH) {
1977 *offset++ = cp - cache_info->defdname; /* record this search domain */
1986 *offset = -1; /* cache_info->dnsrch_offset has MAXDNSRCH+1 items */
1997 _resolv_is_nameservers_equal_locked(struct resolv_cache_info* cache_info,
2009 for (ns = cache_info->nameservers; *ns; ns++)
2022 ns = cache_info->nameservers;
2037 _free_nameservers_locked(struct resolv_cache_info* cache_info)
2041 free(cache_info->nameservers[i]);
2042 cache_info->nameservers[i] = NULL;
2043 if (cache_info->nsaddrinfo[i] != NULL) {
2044 freeaddrinfo(cache_info->nsaddrinfo[i]);
2045 cache_info->nsaddrinfo[i] = NULL;