Lines Matching refs:conf
113 conf_decrement (struct resolv_conf *conf) in conf_decrement() argument
115 assert (conf->__refcount > 0); in conf_decrement()
116 if (--conf->__refcount == 0) in conf_decrement()
117 free (conf); in conf_decrement()
130 struct resolv_conf *conf; in __resolv_conf_get_current() local
134 conf = global_copy->conf_current; in __resolv_conf_get_current()
140 conf = __resolv_conf_load (NULL, &after_load); in __resolv_conf_get_current()
141 if (conf != NULL) in __resolv_conf_get_current()
145 global_copy->conf_current = conf; /* Takes ownership. */ in __resolv_conf_get_current()
161 if (conf != NULL) in __resolv_conf_get_current()
164 assert (conf->__refcount > 0); in __resolv_conf_get_current()
165 ++conf->__refcount; in __resolv_conf_get_current()
166 assert (conf->__refcount > 0); in __resolv_conf_get_current()
169 return conf; in __resolv_conf_get_current()
187 struct resolv_conf *conf = NULL; in resolv_conf_get_1() local
193 conf = (struct resolv_conf *) *slot; in resolv_conf_get_1()
194 assert (conf->__refcount > 0); in resolv_conf_get_1()
195 ++conf->__refcount; in resolv_conf_get_1()
199 return conf; in resolv_conf_get_1()
243 const struct resolv_conf *conf) in resolv_conf_matches() argument
251 size_t nserv = conf->nameserver_list_size; in resolv_conf_matches()
265 conf->nameserver_list[i])) in resolv_conf_matches()
271 conf->nameserver_list[i])) in resolv_conf_matches()
282 return conf->search_list_size == 0 && resp->defdname[0] == '\0'; in resolv_conf_matches()
299 for (size_t i = 0; i < conf->search_list_size; ++i) in resolv_conf_matches()
304 if (strcmp (resp->dnsrch[i], conf->search_list[i]) != 0) in resolv_conf_matches()
323 size_t nsort = conf->sort_list_size; in resolv_conf_matches()
329 if (resp->sort_list[i].addr.s_addr != conf->sort_list[i].addr.s_addr in resolv_conf_matches()
330 || resp->sort_list[i].mask != conf->sort_list[i].mask) in resolv_conf_matches()
340 struct resolv_conf *conf = resolv_conf_get_1 (resp); in __resolv_conf_get() local
341 if (conf == NULL) in __resolv_conf_get()
343 if (resolv_conf_matches (resp, conf)) in __resolv_conf_get()
344 return conf; in __resolv_conf_get()
345 __resolv_conf_put (conf); in __resolv_conf_get()
350 __resolv_conf_put (struct resolv_conf *conf) in __resolv_conf_put() argument
352 if (conf == NULL) in __resolv_conf_put()
356 conf_decrement (conf); in __resolv_conf_put()
399 struct resolv_conf *conf in __resolv_conf_allocate() local
401 if (conf == NULL) in __resolv_conf_allocate()
404 assert (conf == ptr); in __resolv_conf_allocate()
407 conf->__refcount = 1; in __resolv_conf_allocate()
408 conf->retrans = init->retrans; in __resolv_conf_allocate()
409 conf->retry = init->retry; in __resolv_conf_allocate()
410 conf->options = init->options; in __resolv_conf_allocate()
411 conf->ndots = init->ndots; in __resolv_conf_allocate()
415 conf->nameserver_list_size = init->nameserver_list_size; in __resolv_conf_allocate()
418 conf->nameserver_list = nameserver_array; in __resolv_conf_allocate()
420 conf->search_list_size = init->search_list_size; in __resolv_conf_allocate()
423 conf->search_list = search_array; in __resolv_conf_allocate()
444 conf->sort_list_size = init->sort_list_size; in __resolv_conf_allocate()
447 conf->sort_list = array; in __resolv_conf_allocate()
461 return conf; in __resolv_conf_allocate()
466 update_from_conf (struct __res_state *resp, const struct resolv_conf *conf) in update_from_conf() argument
476 resp->retrans = conf->retrans; in update_from_conf()
477 resp->retry = conf->retry; in update_from_conf()
478 resp->options = conf->options; in update_from_conf()
479 resp->ndots = conf->ndots; in update_from_conf()
485 size_t nserv = conf->nameserver_list_size; in update_from_conf()
490 if (conf->nameserver_list[i]->sa_family == AF_INET) in update_from_conf()
493 = *(struct sockaddr_in *)conf->nameserver_list[i]; in update_from_conf()
498 assert (conf->nameserver_list[i]->sa_family == AF_INET6); in update_from_conf()
509 *sa = *(struct sockaddr_in6 *)conf->nameserver_list[i]; in update_from_conf()
523 size_t size = conf->search_list_size; in update_from_conf()
528 (&buffer, conf->search_list[i]); in update_from_conf()
538 size_t nsort = conf->sort_list_size; in update_from_conf()
543 resp->sort_list[i].addr = conf->sort_list[i].addr; in update_from_conf()
544 resp->sort_list[i].mask = conf->sort_list[i].mask; in update_from_conf()
551 assert (resolv_conf_matches (resp, conf)); in update_from_conf()
568 struct resolv_conf *conf = (struct resolv_conf *) *slot; in decrement_at_index() local
569 conf_decrement (conf); in decrement_at_index()
578 __resolv_conf_attach (struct __res_state *resp, struct resolv_conf *conf) in __resolv_conf_attach() argument
580 assert (conf->__refcount > 0); in __resolv_conf_attach()
598 *slot = (uintptr_t) conf; in __resolv_conf_attach()
604 resolv_conf_array_add (&global_copy->array, (uintptr_t) conf); in __resolv_conf_attach()
617 ++conf->__refcount; in __resolv_conf_attach()
618 assert (conf->__refcount > 0); in __resolv_conf_attach()
621 if (!update_from_conf (resp, conf)) in __resolv_conf_attach()