nta.c revision 0c27b3fe77ac1d5094ba3521e8142d9e7973133f
/*
* Copyright (C) 2014-2016 Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/*! \file */
#include <config.h>
#include <dns/fixedname.h>
#include <dns/rdataset.h>
#include <dns/resolver.h>
struct dns_nta {
unsigned int magic;
};
/*
* Obtain a reference to the nta object. Released by
* nta_detach.
*/
static void
}
static void
unsigned int refs;
if (refs == 0) {
}
}
}
}
static void
}
{
return (ISC_R_NOMEMORY);
if (result != ISC_R_SUCCESS)
goto cleanup_ntatable;
if (result != ISC_R_SUCCESS)
goto cleanup_task;
if (result != ISC_R_SUCCESS)
goto cleanup_rbt;
return (ISC_R_SUCCESS);
return (result);
}
void
source->references++;
}
void
ntatable->references--;
if (ntatable->references == 0)
if (destroy) {
}
}
static void
switch (eresult) {
case ISC_R_SUCCESS:
case DNS_R_NCACHENXDOMAIN:
case DNS_R_NXDOMAIN:
case DNS_R_NCACHENXRRSET:
case DNS_R_NXRRSET:
break;
default:
break;
}
/*
* If we're expiring before the next recheck, we might
* as well stop the timer now.
*/
}
static void
}
&nta->sigrdataset,
if (result != ISC_R_SUCCESS)
}
static isc_result_t
return (ISC_R_SUCCESS);
return (ISC_R_SUCCESS);
return (result);
}
static isc_result_t
return (ISC_R_NOMEMORY);
if (result != ISC_R_SUCCESS) {
return (result);
}
return (ISC_R_SUCCESS);
}
{
if (result != ISC_R_SUCCESS)
return (result);
if (result == ISC_R_SUCCESS) {
if (!force)
} else if (result == ISC_R_EXISTS) {
if (n == NULL) {
if (!force)
} else {
}
}
return (result);
}
/*
* Caller must hold a write lock on rwlock.
*/
static isc_result_t
if (result == ISC_R_SUCCESS) {
else
} else if (result == DNS_R_PARTIALMATCH)
return (result);
}
return (result);
}
{
return (ISC_FALSE);
if (result == DNS_R_PARTIALMATCH) {
}
if (result == ISC_R_SUCCESS) {
}
/* Deal with expired NTA */
char nb[DNS_NAME_FORMATSIZE];
if (locktype == isc_rwlocktype_read) {
goto relock;
}
"deleting expired NTA at %s", nb);
}
if (result != ISC_R_SUCCESS) {
"deleting NTA failed: %s",
}
goto again;
}
return (answer);
}
static isc_result_t
if (result != ISC_R_SUCCESS)
return (result);
isc_buffer_putstr(*b, str);
return (ISC_R_SUCCESS);
}
if (result == ISC_R_NOTFOUND)
goto cleanup;
}
for (;;) {
char nbuf[DNS_NAME_FORMATSIZE];
char tbuf[ISC_FORMATHTTPTIMESTAMP_SIZE];
char obuf[DNS_NAME_FORMATSIZE +
sizeof("expired: \n")];
isc_time_t t;
isc_time_set(&t, n->expiry, 0);
tbuf);
if (result != ISC_R_SUCCESS)
goto cleanup;
}
if (result == ISC_R_NOMORE)
break;
}
}
return (result);
}
#if 0
goto cleanup;
for (;;) {
isc_time_t t;
isc_time_set(&t, n->expiry, 0);
tbuf);
}
if (result == ISC_R_NOMORE)
break;
}
}
return (result);
}
#endif
int len = 4096;
if (result != ISC_R_SUCCESS)
return (result);
if (isc_buffer_usedlength(text) != 0) {
} else if (result == ISC_R_SUCCESS) {
} else {
}
(char *) isc_buffer_base(text));
return (result);
}
goto cleanup;
for (;;) {
isc_buffer_t b;
if (result != ISC_R_SUCCESS)
goto skip;
/* Zero terminate. */
isc_buffer_putuint8(&b, 0);
dns_time32_totext(n->expiry, &b);
/* Zero terminate. */
isc_buffer_putuint8(&b, 0);
tbuf);
}
}
skip:
if (result == ISC_R_NOMORE)
break;
}
}
if (result != ISC_R_SUCCESS)
return (result);
else
}