update.c revision fe37278859bce157001cca14cdfa3a761b0d5012
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * Copyright (C) 1999 Internet Software Consortium.
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * Permission to use, copy, modify, and distribute this software for any
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * purpose with or without fee is hereby granted, provided that the above
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * copyright notice and this permission notice appear in all copies.
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * This module implements dynamic update as in RFC2136.
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy - document strict minimality
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy/**************************************************************************/
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * Convenience macro of common isc_log_write() arguments
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * to use in reportings server errors.
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy ns_g_lctx, NS_LOGCATEGORY_UPDATE, NS_LOGMODULE_UPDATE, \
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * Convenience macro of common isc_log_write() arguments
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * to use in tracing dynamic update protocol requests.
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy ns_g_lctx, NS_LOGCATEGORY_UPDATE, NS_LOGMODULE_UPDATE, \
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * Convenience macro of common isc_log_write() arguments
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * to use in low-level debug tracing.
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy ns_g_lctx, NS_LOGCATEGORY_UPDATE, NS_LOGMODULE_UPDATE, \
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * Check an operation for failure. These macros all assume that
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * the function using them has a 'result' variable and a 'failure'
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy if (result != DNS_R_SUCCESS) goto failure; \
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * Fail unconditionally with result 'code', which must not
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * be DNS_R_SUCCESS. The reason for failure presumably has
1d32ba663e202c24a5a1f2e5aef83fffb447cb7fJohn Wren Kennedy * been logged already.
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * Fail unconditionally and log as a client error.
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy "dynamic update failed: %s (%s)", \
d583b39bfb4e2571d3e41097c5c357ffe353ad45John Wren Kennedy * Fail unconditionally and log as a server error.
goto failure; \
struct rr {
struct update_event {
static dns_result_t
return (result);
return (DNS_R_SUCCESS);
static dns_result_t
return (result);
void * rr_action_data;
static dns_result_t
return (result);
return (result);
return (DNS_R_SUCCESS);
static dns_result_t
void *action_data)
return (DNS_R_SUCCESS);
return (result);
goto cleanup_node;
goto cleanup_iterator;
return (result);
static dns_result_t
void *rr_action_data)
static dns_result_t
void *rr_action_data)
return (DNS_R_SUCCESS);
return (result);
goto cleanup_node;
goto cleanup_node;
goto cleanup_rdataset;
goto cleanup_rdataset;
return (result);
static dns_result_t
return (DNS_R_EXISTS);
#define RETURN_EXISTENCE_FLAG \
result));
static dns_result_t
static dns_result_t
return (DNS_R_EXISTS);
return (DNS_R_SUCCESS);
static dns_result_t
static dns_result_t
(*countp)++;
return (DNS_R_SUCCESS);
static dns_result_t
*countp = 0;
static dns_result_t
return (DNS_R_EXISTS);
return (DNS_R_SUCCESS);
static dns_result_t
static dns_result_t
return (DNS_R_EXISTS);
static dns_result_t
static dns_result_t
return (result);
static dns_result_t
return (DNS_R_NXRRSET);
return (DNS_R_NXRRSET);
return (DNS_R_SUCCESS);
static dns_result_t
dns_difftuple_t *t;
return (DNS_R_SUCCESS);
return (result);
while (t != NULL) {
return (DNS_R_NXRRSET);
return (result);
covers = 0;
return (DNS_R_NXRRSET);
goto failure;
goto failure;
goto failure;
while (t != NULL &&
t = next;
goto failure;
return (result);
return (DNS_R_SUCCESS);
static isc_boolean_t
static isc_boolean_t
return (ISC_TRUE);
static isc_boolean_t
static isc_boolean_t
return (ISC_FALSE);
return (ISC_TRUE);
return (ISC_TRUE);
return (ISC_TRUE);
return (ISC_FALSE);
static dns_result_t
return (result);
return (DNS_R_SUCCESS);
static dns_result_t
static dns_result_t
if (serial == 0)
return (result);
static dns_result_t
return (result);
return (DNS_R_SUCCESS);
static dns_result_t
return (result);
static dns_result_t
return (result);
static dns_result_t
return (DNS_R_EXISTS);
return (DNS_R_SUCCESS);
static dns_result_t
static dns_result_t
dns_difftuple_t *p, *q;
while (p != NULL) {
dns_difftuple_free(&q);
return (result);
static dns_result_t
return (DNS_R_SUCCESS);
return (DNS_R_SUCCESS);
return (DNS_R_SUCCESS);
return (result);
static dns_result_t
if (forward)
if (forward)
} while (! has_nxt);
return (result);
static dns_result_t
return (result);
static dns_result_t
isc_region_t r;
return (result);
static dns_result_t
return (result);
static dns_result_t
(isc_stdtime_t) 0,
for (i = 0; i < nkeys; i++) {
return (result);
static dns_result_t
dns_difftuple_t *t;
unsigned int nkeys = 0;
goto failure;
while (t != NULL) {
goto skip;
if (flag) {
skip:
while (t != NULL &&
t != NULL;
if (! flag) {
t != NULL;
t != NULL;
&existed));
&exists));
t != NULL;
if (! exists)
if (flag) {
if (! flag) {
t != NULL;
if (flag) {
t != NULL;
expire));
INSIST(0);
for (i = 0; i < nkeys; i++)
return (result);
static dns_result_t
return (result);
int msg_result;
&response);
goto msg_failure;
case dns_zone_master:
case dns_zone_slave:
if (ttl != 0)
if (! flag) {
if (! flag) {
if (flag) {
if (flag) {
/* "temp<rr.name, rr.type> += rr;" */
if (ttl != 0 ||
name,
&flag));
if (flag) {
&flag));
if (flag &&
&flag));
if (! flag) {
&ok));
if (! ok) {
&flag));
if (! flag) {
&diff));
&diff));
int count;
if (! soa_serial_changed) {
goto failure;
goto common;