/*
* Copyright (C) 1999-2002, 2004-2007, 2011-2017 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/.
*/
/* $Id$ */
/*! \file */
#include <config.h>
#include <dns/rdataclass.h>
struct dns_zt {
/* Unlocked. */
unsigned int magic;
void * loaddone_arg;
/* Locked by lock. */
unsigned int loads_pending;
};
static void
auto_detach(void *, void *);
static isc_result_t
static isc_result_t
static isc_result_t
static isc_result_t
static isc_result_t
return (ISC_R_NOMEMORY);
if (result != ISC_R_SUCCESS)
goto cleanup_zt;
if (result != ISC_R_SUCCESS)
goto cleanup_rbt;
zt->loads_pending = 0;
return (ISC_R_SUCCESS);
return (result);
}
if (result == ISC_R_SUCCESS)
return (result);
}
return (result);
}
{
unsigned int rbtoptions = 0;
if ((options & DNS_ZTFIND_NOEXACT) != 0)
(void **) (void*)&dummy);
return (result);
}
void
zt->references++;
}
static isc_result_t
return (dns_zone_flush(zone));
}
static void
}
static void
zt->references--;
if (zt->references == 0)
if (need_flush)
if (destroy)
zt_destroy(zt);
}
void
}
void
}
return (result);
}
static isc_result_t
return (result);
}
int pending;
if (pending != 0) {
}
if (pending == 0)
return (result);
}
/*
* Initiates asynchronous loading of zone 'zone'. 'callback' is a
* pointer to a function which will be used to inform the caller when
* the zone loading is complete.
*/
static isc_result_t
zt->references++;
zt->loads_pending++;
if (result != ISC_R_SUCCESS) {
zt->references--;
zt->loads_pending--;
}
return (ISC_R_SUCCESS);
}
return (result);
}
static isc_result_t
result == DNS_R_DYNAMIC)
return (result);
}
if (tresult == ISC_R_NOTFOUND)
}
static isc_result_t
const char *vname;
const char *sep;
int level;
return (ISC_R_SUCCESS);
}
return (ISC_R_SUCCESS);
}
if (freeze) {
if (frozen)
if (result == ISC_R_SUCCESS)
if (result == ISC_R_SUCCESS)
} else {
if (frozen) {
if (result == DNS_R_CONTINUE ||
result == DNS_R_UPTODATE)
}
}
{
vname = "";
sep = "";
} else {
sep = " ";
}
sizeof(classstr));
level, "%s zone '%s/%s'%s%s: %s",
return (result);
}
void
&node);
}
}
}
void
&node);
}
}
}
{
}
{
if (result == ISC_R_NOTFOUND) {
/*
* The tree is empty.
*/
}
&node);
if (result == ISC_R_SUCCESS) {
goto cleanup; /* don't break */
} else if (result != ISC_R_SUCCESS &&
tresult == ISC_R_SUCCESS)
}
}
if (result == ISC_R_NOMORE)
return (result);
}
/*
* Decrement the loads_pending counter; when counter reaches
* zero, call the loaddone callback that was initially set by
* dns_zt_asyncload().
*/
static isc_result_t
zt->references--;
if (zt->references == 0)
zt->loads_pending--;
if (zt->loads_pending == 0) {
}
if (destroy)
zt_destroy(zt);
return (ISC_R_SUCCESS);
}
/***
*** Private
***/
static void
}