zone.c revision 403cc93b27c43da09faf0e53d31709e2d5d9cbba
93ca5ee4c4c77aca8d3bcffd70216f30ef398387Mark Andrews * Copyright (C) 1999, 2000 Internet Software Consortium.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * Permission to use, copy, modify, and distribute this software for any
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * purpose with or without fee is hereby granted, provided that the above
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * copyright notice and this permission notice appear in all copies.
93ca5ee4c4c77aca8d3bcffd70216f30ef398387Mark Andrews * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
d6357f09aacf518df14875fffa819607daa05d17Mark Andrews * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
d6357f09aacf518df14875fffa819607daa05d17Mark Andrews * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
d6357f09aacf518df14875fffa819607daa05d17Mark Andrews * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
d6357f09aacf518df14875fffa819607daa05d17Mark Andrews * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
d6357f09aacf518df14875fffa819607daa05d17Mark Andrews * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
/* $Id: zone.c,v 1.156 2000/07/11 22:44:33 gson Exp $ */
#include <config.h>
#define RANGE(a, b, c) (((a) < (b)) ? (b) : ((a) < (c) ? (a) : (c)))
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 {
unsigned int magic;
int transfersin;
int transfersperns;
struct dns_notify {
struct dns_stub {
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);
unsigned int soacount = 0;
unsigned int nscount = 0;
goto cleanup;
goto cleanup;
goto cleanup;
&db);
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;
goto cleanup;
zone,
sizeof(isc_event_t));
goto cleanup;
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;
minimum);
return (answer);
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);