Lines Matching defs:find

997 		 * can find out if any new information was added or not.
1450 dns_adbfind_t *find;
1453 find = event->ev_destroy_arg;
1454 INSIST(DNS_ADBFIND_VALID(find));
1456 LOCK(&find->lock);
1457 find->flags |= FIND_EVENT_FREED;
1459 UNLOCK(&find->lock);
1471 dns_adbfind_t *find;
1480 find = ISC_LIST_HEAD(name->finds);
1481 while (find != NULL) {
1482 LOCK(&find->lock);
1483 next_find = ISC_LIST_NEXT(find, plink);
1486 wanted = find->flags & DNS_ADBFIND_ADDRESSMASK;
1493 find->flags &= ~addrs;
1499 find->flags &= ~addrs;
1500 wanted = find->flags & DNS_ADBFIND_ADDRESSMASK;
1505 find->flags &= ~addrs;
1510 DP(DEF_LEVEL, "cfan: processing find %p", find);
1512 * Unlink the find from the name, letting the caller
1516 ISC_LIST_UNLINK(name->finds, find, plink);
1517 find->adbname = NULL;
1518 find->name_bucket = DNS_ADB_INVALIDBUCKET;
1520 INSIST(!FIND_EVENTSENT(find));
1522 ev = &find->event;
1524 ev->ev_sender = find;
1525 find->result_v4 = find_err_map[name->fetch_err];
1526 find->result_v6 = find_err_map[name->fetch6_err];
1529 ev->ev_destroy_arg = find;
1532 "sending event %p to task %p for find %p",
1533 ev, task, find);
1536 find->flags |= FIND_EVENT_SENT;
1538 DP(DEF_LEVEL, "cfan: skipping find %p", find);
1541 UNLOCK(&find->lock);
1542 find = next_find;
1969 dns_adbfind_t *find;
1972 find = *findp;
1975 INSIST(!FIND_HAS_ADDRS(find));
1976 INSIST(!ISC_LINK_LINKED(find, publink));
1977 INSIST(!ISC_LINK_LINKED(find, plink));
1978 INSIST(find->name_bucket == DNS_ADB_INVALIDBUCKET);
1979 INSIST(find->adbname == NULL);
1981 find->magic = 0;
1983 DESTROYLOCK(&find->lock);
1984 isc_mempool_put(adb->ahmp, find);
2176 copy_namehook_lists(dns_adb_t *adb, dns_adbfind_t *find, dns_name_t *qname,
2187 if (find->options & DNS_ADBFIND_INET) {
2198 find->options |=
2204 if (!FIND_RETURNLAME(find)
2206 find->options |= DNS_ADBFIND_LAMEPRUNED;
2209 addrinfo = new_adbaddrinfo(adb, entry, find->port);
2211 find->partial_result |= DNS_ADBFIND_INET;
2215 * Found a valid entry. Add it to the find's list.
2218 ISC_LIST_APPEND(find->list, addrinfo, publink);
2227 if (find->options & DNS_ADBFIND_INET6) {
2238 find->options |=
2244 if (!FIND_RETURNLAME(find)
2246 find->options |= DNS_ADBFIND_LAMEPRUNED;
2249 addrinfo = new_adbaddrinfo(adb, entry, find->port);
2251 find->partial_result |= DNS_ADBFIND_INET6;
2255 * Found a valid entry. Add it to the find's list.
2258 ISC_LIST_APPEND(find->list, addrinfo, publink);
2948 dns_adbfind_t *find;
3002 find = new_adbfind(adb);
3003 if (find == NULL)
3006 find->port = port;
3011 find->options = options;
3012 find->flags |= wanted_addresses;
3013 if (FIND_WANTEVENT(find)) {
3026 adbname = find_name_and_lock(adb, name, find->options, &bucket);
3031 RUNTIME_CHECK(free_adbfind(adb, &find) == ISC_FALSE);
3048 RUNTIME_CHECK(free_adbfind(adb, &find) == ISC_FALSE);
3053 if (FIND_HINTOK(find))
3055 if (FIND_GLUEOK(find))
3057 if (FIND_STARTATZONE(find))
3169 ! (FIND_AVOIDFETCHES(find) && have_address)) {
3177 if (FIND_STARTATZONE(find))
3207 copy_namehook_lists(adb, find, qname, qtype, adbname, now);
3220 if (!FIND_WANTEVENT(find))
3222 if (FIND_WANTEMPTYEVENT(find) && FIND_HAS_ADDRS(find))
3229 find->adbname = adbname;
3230 find->name_bucket = bucket;
3231 ISC_LIST_APPEND(adbname->finds, find, plink);
3232 find->query_pending = (query_pending & wanted_addresses);
3233 find->flags &= ~DNS_ADBFIND_ADDRESSMASK;
3234 find->flags |= (find->query_pending & DNS_ADBFIND_ADDRESSMASK);
3235 DP(DEF_LEVEL, "createfind: attaching find %p to adbname %p",
3236 find, adbname);
3244 find->query_pending = (query_pending & wanted_addresses);
3245 find->options &= ~DNS_ADBFIND_WANTEVENT;
3246 find->flags |= (FIND_EVENT_SENT | FIND_EVENT_FREED);
3247 find->flags &= ~DNS_ADBFIND_ADDRESSMASK;
3250 find->partial_result |= (adbname->partial_result & wanted_addresses);
3262 * Copy out error flags from the name structure into the find.
3264 find->result_v4 = find_err_map[adbname->fetch_err];
3265 find->result_v6 = find_err_map[adbname->fetch6_err];
3268 if (find != NULL) {
3269 *findp = find;
3274 INSIST((find->flags & DNS_ADBFIND_ADDRESSMASK) != 0);
3277 find->event.ev_sender = taskp;
3278 find->event.ev_action = action;
3279 find->event.ev_arg = arg;
3290 dns_adbfind_t *find;
3298 find = *findp;
3301 LOCK(&find->lock);
3303 DP(DEF_LEVEL, "dns_adb_destroyfind on find %p", find);
3305 adb = find->adb;
3308 REQUIRE(FIND_EVENTFREED(find));
3310 bucket = find->name_bucket;
3313 UNLOCK(&find->lock);
3316 * The find doesn't exist on any list, and nothing is locked.
3317 * Return the find to the memory pool, and decrement the adb's
3321 ai = ISC_LIST_HEAD(find->list);
3323 ISC_LIST_UNLINK(find->list, ai, publink);
3330 ai = ISC_LIST_HEAD(find->list);
3334 * WARNING: The find is freed with the adb locked. This is done
3335 * to avoid a race condition where we free the find, some other
3341 if (free_adbfind(adb, &find))
3347 dns_adb_cancelfind(dns_adbfind_t *find) {
3354 LOCK(&find->lock);
3356 DP(DEF_LEVEL, "dns_adb_cancelfind on find %p", find);
3358 adb = find->adb;
3361 REQUIRE(!FIND_EVENTFREED(find));
3362 REQUIRE(FIND_WANTEVENT(find));
3364 bucket = find->name_bucket;
3369 * We need to get the adbname's lock to unlink the find.
3372 violate_locking_hierarchy(&find->lock, &adb->namelocks[unlock_bucket]);
3373 bucket = find->name_bucket;
3375 ISC_LIST_UNLINK(find->adbname->finds, find, plink);
3376 find->adbname = NULL;
3377 find->name_bucket = DNS_ADB_INVALIDBUCKET;
3385 if (!FIND_EVENTSENT(find)) {
3386 ev = &find->event;
3388 ev->ev_sender = find;
3391 ev->ev_destroy_arg = find;
3392 find->result_v4 = ISC_R_CANCELED;
3393 find->result_v6 = ISC_R_CANCELED;
3395 DP(DEF_LEVEL, "sending event %p to task %p for find %p",
3396 ev, task, find);
3401 UNLOCK(&find->lock);
3574 dns_adb_dumpfind(dns_adbfind_t *find, FILE *f) {
3585 LOCK(&find->lock);
3587 fprintf(f, ";Find %p\n", find);
3589 find->query_pending, find->partial_result,
3590 find->options, find->flags);
3592 find->name_bucket, find->adbname, find->event.ev_sender);
3594 ai = ISC_LIST_HEAD(find->list);
3622 UNLOCK(&find->lock);
3668 dns_adbfind_t *find;
3670 find = ISC_LIST_HEAD(name->finds);
3671 while (find != NULL) {
3672 dns_adb_dumpfind(find, f);
3673 find = ISC_LIST_NEXT(find, plink);
4079 * XXXMLG Needs to take a find argument and an address info, no zone or adb,
4080 * since these can be extracted from the find itself.