zone.c revision 05fff5d905c8236a4da86e9debdf858f0aa733de
754cb8a2b33fa6cfaa15d6470f66e5fb0eab4764Automatic Updater * Copyright (C) 1999, 2000 Internet Software Consortium.
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt * Permission to use, copy, modify, and distribute this software for any
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt * purpose with or without fee is hereby granted, provided that the above
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt * copyright notice and this permission notice appear in all copies.
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt/* $Id: zone.c,v 1.202 2000/09/07 01:06:45 marka Exp $ */
#define RANGE(a, b, c) (((a) < (b)) ? (b) : ((a) < (c) ? (a) : (c)))
#ifndef DNS_MAX_EXPIRE
struct dns_zone {
unsigned int magic;
unsigned int erefs;
unsigned int irefs;
char *dbname;
char *journal;
unsigned int flags;
unsigned int options;
unsigned int db_argc;
char **db_argv;
#ifndef NOMINUM_PUBLIC
#ifndef NOMINUM_PUBLIC
unsigned int masterscnt;
unsigned int curmaster;
unsigned int notifycnt;
#ifndef NOMINUM_PUBLIC
/* XXX MPA these may need to go back into zone.h */
struct dns_zonemgr {
unsigned int magic;
int transfersin;
int transfersperns;
struct dns_notify {
#ifndef NOMINUM_PUBLIC
unsigned int flags;
#ifndef NOMINUM_PUBLIC
struct dns_stub {
struct dns_load {
#ifndef NOMINUM_PUBLIC
#ifdef NOMINUM_PUBLIC
unsigned int flags,
static isc_result_t
return (ISC_R_NOMEMORY);
return (ISC_R_UNEXPECTED);
#ifndef NOMINUM_PUBLIC
#ifndef NOMINUM_PUBLIC
#ifndef NOMINUM_PUBLIC
goto free_mutex;
return (ISC_R_SUCCESS);
return (ISC_R_NOMEMORY);
#ifndef NOMINUM_PUBLIC
#ifndef NOMINUM_PUBLIC
goto nomem;
for (i = 0; i < dbargc; i++)
for (i = 0; i < dbargc; i++) {
goto nomem;
goto unlock;
for (i = 0; i < dbargc; i++) {
return (result);
return (result);
return (result);
static isc_result_t
int len;
return (ISC_R_NOMEMORY);
return (ISC_R_SUCCESS);
return (result);
goto cleanup;
goto cleanup;
goto cleanup;
&db);
goto cleanup;
goto cleanup;
return (result);
static isc_result_t
return (ISC_R_NOMEMORY);
goto cleanup;
return (result);
return (result);
static isc_result_t
unsigned int soacount = 0;
unsigned int nscount = 0;
goto cleanup;
goto cleanup;
goto cleanup;
nscount = 0;
soacount = 0;
case dns_zone_master:
case dns_zone_slave:
case dns_zone_stub:
goto cleanup;
if (nscount == 0)
isc_time_t t;
goto cleanup;
zone,
sizeof(isc_event_t));
goto cleanup;
return (result);
static isc_result_t
unsigned int *nscount)
unsigned int count;
*nscount = 0;
goto invalidate_rdataset;
goto invalidate_rdataset;
count = 0;
count++;
return (result);
static isc_result_t
unsigned int *soacount,
unsigned int count;
goto invalidate_rdataset;
count = 0;
count++;
if (count > 0) {
return (result);
static isc_result_t
goto closeversion;
minimum);
return (answer);
if (free_now)
if (value)
if (value)
return (ISC_R_SUCCESS);
return (ISC_R_SUCCESS);
goto unlock;
return (ISC_R_NOMEMORY);
return (ISC_R_SUCCESS);
#ifndef NOMINUM_PUBLIC
return (result);
#ifndef NOMINUM_PUBLIC
#ifndef NOMINUM_PUBLIC
#ifndef NOMINUM_PUBLIC
sizeof(dns_name_t));
if (count == 0)
goto unlock;
goto unlock;
#ifndef NOMINUM_PUBLIC
goto unlock;
for (i = 0; i < count; i++)
for (i = 0; i < count; i++) {
sizeof(dns_name_t));
goto allocfail;
newname[i]);
for (i = 0; i < count; i++)
newname[i],
goto unlock;
return (result);
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);
#ifndef NOMINUM_PUBLIC
#ifndef NOMINUM_PUBLIC
static isc_boolean_t
return (ISC_TRUE);
return (ISC_TRUE);
return (ISC_FALSE);
static isc_result_t
return (ISC_R_NOMEMORY);
#ifndef NOMINUM_PUBLIC
return (ISC_R_SUCCESS);
goto detach;
goto detach;
unsigned int options;
goto destroy;
goto destroy;
goto detach;
goto detach;
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;
#ifdef NOMINUM_PUBLIC
goto cleanup;
goto cleanup;
goto cleanup;
#ifndef NOMINUM_PUBLIC
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 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 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
#ifdef NOMINUM_PUBLIC
isc_region_t r;
&message);
goto fail;
goto cleanup;
goto cleanup;
#ifndef NOMINUM_PUBLIC
goto done;
goto done;
goto soa_cleanup;
goto soa_cleanup;
goto soa_cleanup;
goto soa_cleanup;
goto soa_cleanup;
NULL);
goto soa_cleanup;
goto soa_cleanup;
goto soa_cleanup;
isc_buffer_usedregion(b, &r);
goto soa_cleanup;
goto soa_cleanup;
done:
fail:
return (result);
#ifndef NOMINUM_PUBLIC
int match = 0;
return (DNS_R_FORMERR);
return (DNS_R_NOTIMP);
return (ISC_R_SUCCESS);
#ifndef NOMINUM_PUBLIC
return (DNS_R_REFUSED);
&rdataset);
fromtext);
return (ISC_R_SUCCESS);
#ifndef NOMINUM_PUBLIC
if (forward) {
return (ISC_R_SUCCESS);
fromtext);
return (ISC_R_SUCCESS);
fromtext);
return (ISC_R_SUCCESS);
#ifndef NOMINUM_PUBLIC
#ifndef NOMINUM_PUBLIC
#ifndef NOMINUM_PUBLIC
int len;
int count = 0;
count++;
return (count);
if (idlein == 0)
if (idleout == 0)
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)
#ifndef NOMINUM_PUBLIC
case DNS_R_ZONETOOLARGE:
goto cleanup;
#ifndef NOMINUM_PUBLIC
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);