Lines Matching defs:nta

26 #include <dns/nta.h>
53 * Obtain a reference to the nta object. Released by
57 nta_ref(dns_nta_t *nta) {
58 isc_refcount_increment(&nta->refcount, NULL);
64 dns_nta_t *nta = *ntap;
66 REQUIRE(VALID_NTA(nta));
69 isc_refcount_decrement(&nta->refcount, &refs);
71 nta->magic = 0;
72 if (nta->timer != NULL) {
73 (void) isc_timer_reset(nta->timer,
76 isc_timer_detach(&nta->timer);
78 isc_refcount_destroy(&nta->refcount);
79 if (dns_rdataset_isassociated(&nta->rdataset))
80 dns_rdataset_disassociate(&nta->rdataset);
81 if (dns_rdataset_isassociated(&nta->sigrdataset))
82 dns_rdataset_disassociate(&nta->sigrdataset);
83 if (nta->fetch != NULL) {
84 dns_resolver_cancelfetch(nta->fetch);
85 dns_resolver_destroyfetch(&nta->fetch);
87 isc_mem_put(mctx, nta, sizeof(dns_nta_t));
93 dns_nta_t *nta = (dns_nta_t *) data;
96 nta_detach(mctx, &nta);
200 dns_nta_t *nta = devent->ev_arg;
202 dns_ntatable_t *ntatable = nta->ntatable;
208 if (dns_rdataset_isassociated(&nta->rdataset))
209 dns_rdataset_disassociate(&nta->rdataset);
210 if (dns_rdataset_isassociated(&nta->sigrdataset))
211 dns_rdataset_disassociate(&nta->sigrdataset);
212 if (nta->fetch == devent->fetch)
213 nta->fetch = NULL;
230 if (nta->expiry > now)
231 nta->expiry = now;
241 if (nta->timer != NULL && nta->expiry - now < view->nta_recheck)
242 (void) isc_timer_reset(nta->timer, isc_timertype_inactive,
244 nta_detach(view->mctx, &nta);
249 dns_nta_t *nta = event->ev_arg;
250 dns_ntatable_t *ntatable = nta->ntatable;
254 if (nta->fetch != NULL) {
255 dns_resolver_cancelfetch(nta->fetch);
256 nta->fetch = NULL;
258 if (dns_rdataset_isassociated(&nta->rdataset))
259 dns_rdataset_disassociate(&nta->rdataset);
260 if (dns_rdataset_isassociated(&nta->sigrdataset))
261 dns_rdataset_disassociate(&nta->sigrdataset);
265 nta_ref(nta);
266 result = dns_resolver_createfetch(view->resolver, nta->name,
270 task, fetch_done, nta,
271 &nta->rdataset,
272 &nta->sigrdataset,
273 &nta->fetch);
275 nta_detach(view->mctx, &nta);
279 settimer(dns_ntatable_t *ntatable, dns_nta_t *nta, isc_uint32_t lifetime) {
285 REQUIRE(VALID_NTA(nta));
297 checkbogus, nta, &nta->timer);
304 dns_nta_t *nta = NULL;
312 nta = isc_mem_get(view->mctx, sizeof(dns_nta_t));
313 if (nta == NULL)
316 nta->ntatable = ntatable;
317 nta->expiry = 0;
318 nta->timer = NULL;
319 nta->fetch = NULL;
320 dns_rdataset_init(&nta->rdataset);
321 dns_rdataset_init(&nta->sigrdataset);
323 result = isc_refcount_init(&nta->refcount, 1);
325 isc_mem_put(view->mctx, nta, sizeof(dns_nta_t));
329 dns_fixedname_init(&nta->fn);
330 nta->name = dns_fixedname_name(&nta->fn);
331 dns_name_copy(name, nta->name, NULL);
333 nta->magic = NTA_MAGIC;
335 *target = nta;
345 dns_nta_t *nta = NULL;
353 result = nta_create(ntatable, name, &nta);
357 nta->expiry = now + lifetime;
358 nta->forced = force;
366 (void)settimer(ntatable, nta, lifetime);
367 node->data = nta;
368 nta = NULL;
373 (void)settimer(ntatable, nta, lifetime);
374 node->data = nta;
375 nta = NULL;
377 n->expiry = nta->expiry;
378 nta_detach(view->mctx, &nta);
385 if (nta != NULL)
386 nta_detach(view->mctx, &nta);
435 dns_nta_t *nta = NULL;
459 nta = (dns_nta_t *) node->data;
460 answer = ISC_TF(nta->expiry > now);
478 if (nta->timer != NULL) {
479 (void) isc_timer_reset(nta->timer,
482 isc_timer_detach(&nta->timer);