zone.c revision cd01c9716ff3d995b2be1f0d053dfe81ce9335b6
d3498432822fb487e58f8f72bb5f880dd8307d7dMichael Sawyer * Copyright (C) 1999, 2000 Internet Software Consortium.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * Permission to use, copy, modify, and distribute this software for any
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence * purpose with or without fee is hereby granted, provided that the above
ec5347e2c775f027573ce5648b910361aa926c01Automatic Updater * copyright notice and this permission notice appear in all copies.
d3498432822fb487e58f8f72bb5f880dd8307d7dMichael Sawyer * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
2534a73a5914470f7ffe00663b6bbaff5e411e57Mark Andrews/* $Id: zone.c,v 1.122 2000/05/22 17:23:11 gson Exp $ */
50105afc551903541608b11851d73278b23579a3Mark Andrews#define RANGE(a, b, c) (((a) < (b)) ? (b) : ((a) < (c) ? (a) : (c)))
50105afc551903541608b11851d73278b23579a3Mark Andrews * Implementation limits.
struct dns_zone {
unsigned int magic;
unsigned int erefs;
unsigned int irefs;
char *dbname;
char *journal;
unsigned int flags;
unsigned int options;
char *db_type;
unsigned int db_argc;
char **db_argv;
unsigned int masterscnt;
unsigned int curmaster;
unsigned int notifycnt;
/* XXX MPA these may need to go back into zone.h */
struct dns_zonemgr {
int refs;
int transfersin;
int transfersperns;
struct notify {
static isc_result_t
char *s = NULL; \
isc_result_t r; \
if (r == ISC_R_SUCCESS) { \
return (ISC_R_NOMEMORY);
return (ISC_R_UNEXPECTED);
return (ISC_R_SUCCESS);
return (result);
return (result);
return (result);
static isc_result_t
int len;
return (ISC_R_NOMEMORY);
return (ISC_R_SUCCESS);
return (result);
case dns_zone_master:
case dns_zone_slave:
case dns_zone_stub:
case dns_zone_hint:
case dns_zone_forward:
case dns_zone_cache:
unsigned int soacount = 0;
unsigned int nscount = 0;
case dns_zone_forward:
case dns_zone_none:
goto cleanup;
case dns_zone_master:
case dns_zone_slave:
case dns_zone_stub:
case dns_zone_hint:
case dns_zone_cache:
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
nscount = 0;
soacount = 0;
case dns_zone_master:
case dns_zone_slave:
case dns_zone_stub:
if (nscount == 0)
goto cleanup;
isc_time_t t;
case dns_zone_hint:
if (nscount == 0) {
goto cleanup;
case dns_zone_cache:
goto cleanup;
zone,
sizeof(isc_event_t));
goto cleanup;
if (soacount != 0)
return (result);
static isc_result_t
unsigned int *nscount)
unsigned int count;
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;
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) {
goto next_master;
goto next_master;
goto next_master;
goto next_master;
master);
goto tcp_transfer;
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);
&message);
goto cleanup;
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;
&buffer);
&buffer);
int count = 0;
count++;
return (count);
if (idlein == 0)
if (idleout == 0)
#ifdef notyet
record_serial() {
return (ISC_FALSE);
return (result);
static isc_result_t
goto fail;
if (dump) {
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);