Home | History | Annotate | Download | only in resolv

Lines Matching defs:cache_info

1826 static void _insert_cache_info_locked(struct resolv_cache_info* cache_info);
1838 static void _free_nameservers_locked(struct resolv_cache_info* cache_info);
1846 * currently attached to the provided cache_info */
1847 static int _resolv_is_nameservers_equal_locked(struct resolv_cache_info* cache_info,
1914 struct resolv_cache_info* cache_info = _create_cache_info();
1915 if (cache_info) {
1918 int len = sizeof(cache_info->ifname);
1919 cache_info->cache = cache;
1920 strncpy(cache_info->ifname, ifname, len - 1);
1921 cache_info->ifname[len - 1] = '\0';
1923 _insert_cache_info_locked(cache_info);
1925 free(cache_info);
1947 struct resolv_cache_info* cache_info = _res_cache_list.next;
1948 while (cache_info) {
1949 if (cache_info->ifname[0] != '\0') {
1950 ifname = cache_info->ifname;
1954 cache_info = cache_info->next;
2010 struct resolv_cache_info* cache_info;
2012 cache_info = calloc(sizeof(*cache_info), 1);
2013 return cache_info;
2017 _insert_cache_info_locked(struct resolv_cache_info* cache_info)
2023 last->next = cache_info;
2043 struct resolv_cache_info* cache_info = _res_cache_list.next;
2045 while (cache_info) {
2046 if (strcmp(cache_info->ifname, ifname) == 0) {
2050 cache_info = cache_info->next;
2052 return cache_info;
2068 struct resolv_cache_info* cache_info = _res_cache_list.next;
2069 while (cache_info) {
2070 if (cache_info->ifname[0] != '\0') {
2071 ifname = cache_info->ifname;
2075 cache_info = cache_info->next;
2113 struct resolv_cache_info* cache_info = _find_cache_info_locked(ifname);
2115 if (cache_info != NULL &&
2116 !_resolv_is_nameservers_equal_locked(cache_info, servers, numservers)) {
2118 _free_nameservers_locked(cache_info);
2128 rt = getaddrinfo(servers[i], sbuf, &hints, &cache_info->nsaddrinfo[index]);
2130 cache_info->nameservers[index] = strdup(servers[i]);
2135 cache_info->nsaddrinfo[index] = NULL;
2140 strlcpy(cache_info->defdname, domains, sizeof(cache_info->defdname));
2141 if ((cp = strchr(cache_info->defdname, '\n')) != NULL)
2143 cp = cache_info->defdname;
2144 offset = cache_info->dnsrch_offset;
2145 while (offset < cache_info->dnsrch_offset + MAXDNSRCH) {
2150 *offset++ = cp - cache_info->defdname; /* record this search domain */
2159 *offset = -1; /* cache_info->dnsrch_offset has MAXDNSRCH+1 items */
2170 _resolv_is_nameservers_equal_locked(struct resolv_cache_info* cache_info,
2180 ns = cache_info->nameservers;
2195 _free_nameservers_locked(struct resolv_cache_info* cache_info)
2199 free(cache_info->nameservers[i]);
2200 cache_info->nameservers[i] = NULL;
2201 if (cache_info->nsaddrinfo[i] != NULL) {
2202 freeaddrinfo(cache_info->nsaddrinfo[i]);
2203 cache_info->nsaddrinfo[i] = NULL;
2229 struct resolv_cache_info* cache_info;
2234 cache_info = _find_cache_info_locked(ifname);
2235 if (cache_info) {
2236 ns = cache_info->nameservers[n - 1];
2271 struct resolv_cache_info* cache_info;
2276 cache_info = _find_cache_info_locked(ifname);
2277 if (cache_info) {
2278 ai = cache_info->nsaddrinfo[n - 1];
2288 struct resolv_cache_info* cache_info = _find_cache_info_locked(ifname);
2289 if (cache_info) {
2290 memcpy(&cache_info
2294 ifname, inet_ntoa(cache_info->ifaddr));
2330 struct resolv_cache_info* cache_info = _find_cache_info_locked(ifname);
2331 if (cache_info) {
2332 return &cache_info->ifaddr;