zone.c revision 21eaa048582b19d3fe7a2c9f9b3455256dbae77b
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer * Copyright (C) 1999, 2000 Internet Software Consortium.
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer * Permission to use, copy, modify, and distribute this software for any
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer * purpose with or without fee is hereby granted, provided that the above
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer * copyright notice and this permission notice appear in all copies.
15a44745412679c30a6d022733925af70a38b715David Lawrence * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
15a44745412679c30a6d022733925af70a38b715David Lawrence * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
15a44745412679c30a6d022733925af70a38b715David Lawrence * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
15a44745412679c30a6d022733925af70a38b715David Lawrence * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
15a44745412679c30a6d022733925af70a38b715David Lawrence * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15a44745412679c30a6d022733925af70a38b715David Lawrence * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
15a44745412679c30a6d022733925af70a38b715David Lawrence * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
b266f8fc42702debc6bd89365273223fa89cd8ddBrian Wellington/* $Id: zone.c,v 1.147 2000/06/15 16:11:49 gson Exp $ */
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer#define RANGE(a, b, c) (((a) < (b)) ? (b) : ((a) < (c) ? (a) : (c)))
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer * Implementation limits.
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer#define DNS_MAX_EXPIRE 14515200 /* 24 weeks */
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer * Default values.
b266f8fc42702debc6bd89365273223fa89cd8ddBrian Wellington#define DNS_DEFAULT_IDLEOUT 3600 /* 1 hour */
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer#define MAX_XFER_TIME (2*3600) /* Documented default is 2 hours */
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer /* Unlocked */
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer unsigned int magic;
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer ISC_LINK(dns_zone_t) link; /* Used by zmgr. */
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer unsigned int erefs;
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer unsigned int irefs;
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer unsigned int flags;
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer /* Access Control Lists */
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer * Zones in certain states such as "waiting for zone transfer"
cd720113a2fc8a781d4e33350b8a2b62857b31d8David Lawrence * or "zone transfer in progress" are kept on per-state linked lists
37e6e0ca1337351642798b1a6aa24ae40bf86399Andreas Gustafsson * in the zone manager using the 'statelink' field. The 'statelist'
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence * field points at the list the zone is currently on. It the zone
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer * is not on any such list, statelist is NULL.
cc48bb397fa6ba889f25157840492e68114dec8fBrian Wellington#define DNS_ZONE_FLAG(z,f) (((z)->flags & (f)) != 0)
b266f8fc42702debc6bd89365273223fa89cd8ddBrian Wellington /* XXX MPA these may need to go back into zone.h */
b266f8fc42702debc6bd89365273223fa89cd8ddBrian Wellington#define DNS_ZONEFLG_REFRESH 0x00000001U /* refresh check in progress */
b266f8fc42702debc6bd89365273223fa89cd8ddBrian Wellington#define DNS_ZONEFLG_NEEDDUMP 0x00000002U /* zone need consolidation */
b266f8fc42702debc6bd89365273223fa89cd8ddBrian Wellington#define DNS_ZONEFLG_USEVC 0x00000004U /* use tcp for refresh query */
b266f8fc42702debc6bd89365273223fa89cd8ddBrian Wellington/* #define DNS_ZONEFLG_UNUSED 0x00000008U */ /* unused */
b266f8fc42702debc6bd89365273223fa89cd8ddBrian Wellington/* #define DNS_ZONEFLG_UNUSED 0x00000010U */ /* unused */
b266f8fc42702debc6bd89365273223fa89cd8ddBrian Wellington#define DNS_ZONEFLG_LOADED 0x00000020U /* database has loaded */
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer#define DNS_ZONEFLG_EXITING 0x00000040U /* zone is being destroyed */
cc48bb397fa6ba889f25157840492e68114dec8fBrian Wellington#define DNS_ZONEFLG_EXPIRED 0x00000080U /* zone has expired */
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer#define DNS_ZONEFLG_NEEDREFRESH 0x00000100U /* refresh check needed */
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer#define DNS_ZONEFLG_UPTODATE 0x00000200U /* zone contents are
37e6e0ca1337351642798b1a6aa24ae40bf86399Andreas Gustafsson#define DNS_ZONEFLG_NEEDNOTIFY 0x00000400U /* need to send out notify
37e6e0ca1337351642798b1a6aa24ae40bf86399Andreas Gustafsson#define DNS_ZONEFLG_DIFFONRELOAD 0x00000800U /* generate a journal diff on
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer#define DNS_ZONEFLG_NOMASTERS 0x00001000U /* an attempt to refresh a
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer * zone with no masters
37e6e0ca1337351642798b1a6aa24ae40bf86399Andreas Gustafsson#define DNS_ZONE_OPTION(z,o) (((z)->options & (o)) != 0)
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer unsigned int magic;
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer /* Locked by rwlock. */
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer /* Locked by conflock. */
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer * Hold notify state.
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer * dns_stub holds state while performing a 'stub' transfer.
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer * 'db' is the zone's 'db' or a new one if this is the initial
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyerstatic isc_result_t zone_settimer(dns_zone_t *, isc_stdtime_t);
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyerstatic void zone_log(dns_zone_t *zone, const char *, int, const char *msg,
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyerstatic isc_result_t dns_zone_tostr(dns_zone_t *zone, isc_mem_t *mctx,
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyerstatic isc_result_t zone_replacedb(dns_zone_t *zone, dns_db_t *db,
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyerstatic isc_result_t default_journal(dns_zone_t *zone);
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyerstatic void zone_xfrdone(dns_zone_t *zone, isc_result_t result);
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyerstatic void zone_shutdown(isc_task_t *, isc_event_t *);
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer/* ondestroy example */
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyerstatic void dns_zonemgr_dbdestroyed(isc_task_t *task, isc_event_t *event);
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyerstatic void refresh_callback(isc_task_t *, isc_event_t *);
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyerstatic void stub_callback(isc_task_t *, isc_event_t *);
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyerstatic void queue_soa_query(dns_zone_t *zone);
a5ed46c9fd270775c39770bfd0250a52d374ebf2Michael Sawyerstatic void soa_query(isc_task_t *, isc_event_t *);
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyerstatic void ns_query(dns_zone_t *zone, dns_rdataset_t *soardataset,
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyerstatic int message_count(dns_message_t *msg, dns_section_t section,
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyerstatic void notify_find_address(dns_notify_t *notify);
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyerstatic void notify_send(dns_notify_t *notify);
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyerstatic isc_result_t notify_createmessage(dns_zone_t *zone,
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyerstatic void notify_done(isc_task_t *task, isc_event_t *event);
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyerstatic void notify_send_toaddr(isc_task_t *task, isc_event_t *event);
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyerstatic void got_transfer_quota(isc_task_t *task, isc_event_t *event);
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyerstatic isc_result_t zmgr_start_xfrin_ifquota(dns_zonemgr_t *zmgr,
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyerstatic void zmgr_resume_xfrs(dns_zonemgr_t *zmgr);
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyerstatic void zonemgr_free(dns_zonemgr_t *zmgr);
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyerzone_get_from_db(dns_db_t *db, dns_name_t *origin, unsigned int *nscount,
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer unsigned int *soacount, isc_uint32_t *serial,
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer isc_uint32_t *expire, isc_uint32_t *minimum);
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer printf("%p: %s: erefs=%d irefs=%d\n", zone, s, \
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer#define ZONE_LOG(x,y) zone_log(zone, me, ISC_LOG_DEBUG(x), y)
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer#define DNS_ENTER zone_log(zone, me, ISC_LOG_DEBUG(1), "enter")
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer#define DNS_LEAVE zone_log(zone, me, ISC_LOG_DEBUG(1), "leave")
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer *** Public functions.
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyerdns_zone_create(dns_zone_t **zonep, isc_mem_t *mctx) {
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence "isc_mutex_init() failed: %s",
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer /* XXX MPA check that all elements are initialised */
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer ISC_EVENT_INIT(&zone->ctlevent, sizeof(zone->ctlevent), 0, NULL,
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer DNS_EVENT_ZONECONTROL, zone_shutdown, zone, zone,
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer * Free a zone. Because we require that there be no more
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer * outstanding events or references, no locking is necessary.
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer * Managed objects. Order is important.
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer dns_request_destroy(&zone->request); /* XXXMPA */
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer /* Unmanaged objects */
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer /* last stuff */
37e6e0ca1337351642798b1a6aa24ae40bf86399Andreas Gustafsson * Single shot.
37e6e0ca1337351642798b1a6aa24ae40bf86399Andreas Gustafssondns_zone_setclass(dns_zone_t *zone, dns_rdataclass_t rdclass) {
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer * Test and set.
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer REQUIRE(zone->rdclass == dns_rdataclass_none ||
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer * Single shot.
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyerdns_zone_settype(dns_zone_t *zone, dns_zonetype_t type) {
37e6e0ca1337351642798b1a6aa24ae40bf86399Andreas Gustafsson * Test and set.
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer REQUIRE(zone->type == dns_zone_none || zone->type == type);
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyerdns_zone_setdbtype(dns_zone_t *zone, const char *db_type) {
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer zone->db_type = isc_mem_strdup(zone->mctx, db_type);
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyerdns_zone_setview(dns_zone_t *zone, dns_view_t *view) {
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyerdns_zone_setorigin(dns_zone_t *zone, dns_name_t *origin) {
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer result = dns_name_dup(origin, zone->mctx, &zone->origin);
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyerdns_zone_setdatabase(dns_zone_t *zone, const char *dbname) {
844eaa56d6d647b38b2a5cf08f7ea5ab7b752690Michael Sawyer zone->dbname = isc_mem_strdup(zone->mctx, dbname);
d821f1cd7e97552401296e880e7518c98c9ebea1Michael Sawyer len = strlen(zone->dbname) + sizeof ".jnl"; /* includes '\0' */
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer zone->journal = isc_mem_allocate(zone->mctx, len);
aa6054ec74819f754bcf19442ca9b39d948171adMichael Sawyerdns_zone_setjournal(dns_zone_t *zone, const char *journal) {
aa6054ec74819f754bcf19442ca9b39d948171adMichael Sawyer zone->journal = isc_mem_strdup(zone->mctx, journal);
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer unsigned int soacount = 0;
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer unsigned int nscount = 0;
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer isc_uint32_t serial, refresh, retry, expire, minimum;
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer * The zone has no master file (maybe it is the built-in
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer * version.bind. CH zone). Do nothing.
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer zone_log(zone, me, ISC_LOG_DEBUG(1), "start");
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer * Don't do the load if the file that stores the zone is older
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer * than the last time the zone was loaded. If the zone has not
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer * been loaded yet, zone->loadtime will be the epoch.
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer result = isc_file_getmodtime(zone->dbname, &filetime);
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer if (result == ISC_R_SUCCESS && ! isc_time_isepoch(&zone->loadtime) &&
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer isc_time_compare(&filetime, &zone->loadtime) < 0) {
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer "skipping: database file older than last load");
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer * Store the current time before the zone is loaded, so that if the
d821f1cd7e97552401296e880e7518c98c9ebea1Michael Sawyer * file changes between the time of the load and the time that
d821f1cd7e97552401296e880e7518c98c9ebea1Michael Sawyer * zone->loadtime is set, then the file will still be reloaded
d821f1cd7e97552401296e880e7518c98c9ebea1Michael Sawyer * the next time dns_zone_load is called.
48674819ebf9176b5d5582ae851e485c324c1159Michael Sawyer result = dns_db_create(zone->mctx, zone->db_type,
48674819ebf9176b5d5582ae851e485c324c1159Michael Sawyer &zone->origin, (zone->type == dns_zone_stub) ?
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer * Initiate zone transfer? We may need a error code that
37e6e0ca1337351642798b1a6aa24ae40bf86399Andreas Gustafsson * indicates that the "permanent" form does not exist.
aa6054ec74819f754bcf19442ca9b39d948171adMichael Sawyer * XXX better error feedback to log.
aa6054ec74819f754bcf19442ca9b39d948171adMichael Sawyer "no database file");
aa6054ec74819f754bcf19442ca9b39d948171adMichael Sawyer /* Mark the zone for immediate refresh. */
cd720113a2fc8a781d4e33350b8a2b62857b31d8David Lawrence "database %s: dns_db_load failed: %s",
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer zone_log(zone, me, ISC_LOG_DEBUG(1), "loaded");
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer * Apply update log, if any.
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer result = dns_journal_rollforward(zone->mctx, db,
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer if (result != ISC_R_SUCCESS && result != ISC_R_NOTFOUND &&
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer result != DNS_R_UPTODATE && result != DNS_R_NOJOURNAL)
48674819ebf9176b5d5582ae851e485c324c1159Michael Sawyer "journal out of sync with zone");
cd720113a2fc8a781d4e33350b8a2b62857b31d8David Lawrence "dns_journal_rollforward: %s",
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer * Obtain ns and soa counts for top of zone.
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer result = zone_get_from_db(db, &zone->origin, &nscount,
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer "could not find NS and/or SOA records");
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer * Master / Slave / Stub zones require both NS and SOA records at
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer * the top of the zone.
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer "no NS records");
5f01e77fc23fe9665fa2b8acd0a0c5bfbf61d61dBrian Wellington if (!isc_serial_ge(serial, zone->serial)) {
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer "zone serial has gone backwards");
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer zone->refresh = RANGE(refresh, DNS_MIN_REFRESH,
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence zone->retry = RANGE(retry, DNS_MIN_REFRESH, DNS_MAX_REFRESH);
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer zone->expire = RANGE(expire, zone->refresh + zone->retry,
5f01e77fc23fe9665fa2b8acd0a0c5bfbf61d61dBrian Wellington result = isc_file_getmodtime(zone->dbname, &t);
37e6e0ca1337351642798b1a6aa24ae40bf86399Andreas Gustafsson /* destroy notification example. */
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer isc_event_t *e = isc_event_allocate(zone->mctx, NULL,
19c8df90f1f23c3df870c1771c89c1acdb15020eMichael Sawyer result = zone_replacedb(zone, db, ISC_FALSE);
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer zone->flags |= DNS_ZONEFLG_LOADED|DNS_ZONEFLG_NEEDNOTIFY;
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_EXITING) &&
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer * DNS_ZONEFLG_EXITING can only be set if erefs == 0.
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyerzone_count_ns_rr(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer unsigned int *nscount)
6fe03d6c83ec02d4494edc870f5e892d419b6885Michael Sawyer unsigned int count;
e715e011788a529446b8013239c33599542ece32Michael Sawyer result = dns_db_findrdataset(db, node, version, dns_rdatatype_ns,
b266f8fc42702debc6bd89365273223fa89cd8ddBrian Wellingtonzone_load_soa_rr(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
b266f8fc42702debc6bd89365273223fa89cd8ddBrian Wellington unsigned int *soacount,
b266f8fc42702debc6bd89365273223fa89cd8ddBrian Wellington isc_uint32_t *serial, isc_uint32_t *refresh,
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer result = dns_db_findrdataset(db, node, version, dns_rdatatype_soa,
static isc_result_t
goto closeversion;
goto detachnode;
minimum);
goto detachnode;
return (result);
if (free_now)
static isc_result_t
if (value)
if (value)
goto cleanup;
goto cleanup;
return (ISC_R_SUCCESS);
return (ISC_R_NOMEMORY);
return (ISC_R_SUCCESS);
return (ISC_R_SUCCESS);
goto unlock;
return (ISC_R_NOMEMORY);
return (ISC_R_SUCCESS);
goto unlock;
return (ISC_R_NOMEMORY);
return (ISC_R_SUCCESS);
return (result);
case dns_zone_slave:
case dns_zone_stub:
case dns_zone_slave:
case dns_zone_stub:
case dns_zone_master:
case dns_zone_master:
case dns_zone_slave:
return (result);
static isc_result_t
char *buf;
int buflen;
return (ISC_R_NOMEMORY);
goto cleanup;
goto cleanup;
&dns_master_style_default, f);
n = fflush(f);
n = ferror(f);
n = fclose(f);
return (result);
return (result);
static isc_boolean_t
return (ISC_TRUE);
return (ISC_TRUE);
return (ISC_FALSE);
static isc_result_t
return (ISC_R_NOMEMORY);
return (ISC_R_SUCCESS);
goto detach;
goto detach;
unsigned int options;
static isc_result_t
isc_event_t *e;
if (e == NULL)
return (ISC_R_NOMEMORY);
isc_event_free(&e);
return (result);
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup1;
goto cleanup2;
goto cleanup3;
goto cleanup3;
if (isqueued) {
static inline isc_result_t
goto fail;
goto fail;
goto fail;
&rdataset);
goto fail;
goto fail;
&rdataset);
goto fail;
goto fail;
&rdataset);
goto fail;
goto fail;
goto fail;
return (ISC_R_SUCCESS);
fail:
return (result);
goto next_master;
goto next_master;
goto next_master;
goto next_master;
goto next_master;
goto same_master;
goto next_master;
if (cnamecnt != 0) {
goto next_master;
if (nscnt == 0) {
goto next_master;
goto next_master;
goto free_stub;
goto free_stub;
goto detach;
goto next_master;
goto next_master;
goto next_master;
goto next_master;
master);
goto tcp_transfer;
master);
goto next_master;
goto same_master;
goto next_master;
if (cnamecnt != 0) {
goto next_master;
goto next_master;
goto next_master;
goto next_master;
goto next_master;
goto next_master;
goto next_master;
isc_time_t t;
goto next_master;
goto next_master;
isc_event_t *e;
if (e == NULL) {
isc_event_free(&e);
static inline isc_result_t
&message);
goto cleanup;
goto cleanup;
goto cleanup;
return (ISC_R_SUCCESS);
return (result);
goto cleanup;
DNS_REQUESTOPT_TCP : 0;
goto cleanup;
goto cleanup;
goto cleanup;
&node);
goto cleanup;
goto cleanup;
goto cleanup;
static isc_result_t
case dns_zone_master:
case dns_zone_slave:
case dns_zone_stub:
if (next == 0) {
return (result);
return (ISC_R_SUCCESS);
static isc_result_t
isc_region_t r;
&message);
goto fail;
goto cleanup;
goto cleanup;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
NULL);
goto done;
goto done;
goto done;
isc_buffer_usedregion(b, &r);
goto done;
goto done;
done:
fail:
return (result);
return (DNS_R_FORMERR);
return (DNS_R_NOTIMP);
return (ISC_R_SUCCESS);
return (DNS_R_REFUSED);
&rdataset);
return (ISC_R_SUCCESS);
return (ISC_R_SUCCESS);
return (ISC_R_SUCCESS);
int len;
int count = 0;
count++;
return (count);
if (idlein == 0)
if (idleout == 0)
return (ISC_FALSE);
return (result);
static isc_result_t
goto fail;
goto fail;
return (ISC_R_SUCCESS);
fail:
return (result);
unsigned int soacount;
unsigned int nscount;
switch (result) {
case ISC_R_SUCCESS:
case DNS_R_UPTODATE:
isc_time_t t;
nscount = 0;
soacount = 0;
if (nscount == 0)
goto cleanup;
goto cleanup;
return (ISC_R_NOMEMORY);
goto free_mem;
goto free_rwlock;
goto free_conflock;
goto free_taskpool;
goto free_task;
return (ISC_R_SUCCESS);
return (result);
goto cleanup_task;
goto unlock;
return (result);
if (free_now)
if (free_now)
dns_zone_t *p;
p != NULL;
return (ISC_R_SUCCESS);
static isc_result_t
dns_zone_t *x;
isc_event_t *e;
x != NULL;
nxfrsin++;
nxfrsperns++;
return (ISC_R_QUOTA);
return (ISC_R_QUOTA);
sizeof(isc_event_t));
if (e == NULL)
return (ISC_R_NOMEMORY);
return (ISC_R_SUCCESS);