update.c revision 911ed0d3bee586b3bec42cb6c376d5cc6c0e1e24
7d32c065c7bb56f281651ae3dd2888f32ce4f1d9Bob Halley * Copyright (C) 1999, 2000 Internet Software Consortium.
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews * Permission to use, copy, modify, and distribute this software for any
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews * purpose with or without fee is hereby granted, provided that the above
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews * copyright notice and this permission notice appear in all copies.
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
6324997211a5e2d82528dcde98e8981190a35faeMichael Graff/* $Id: update.c,v 1.77 2000/12/09 02:17:03 bwelling Exp $ */
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews * This module implements dynamic update as in RFC2136.
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews - document strict minimality
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews/**************************************************************************/
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson * Convenience macro of common isc_log_write() arguments
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson * to use in reportings server errors.
c363150ad598e7a8ce03efe2776b8e6950f0de7bBrian Wellington ns_g_lctx, NS_LOGCATEGORY_UPDATE, NS_LOGMODULE_UPDATE, \
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews * Convenience macro of common isc_log_write() arguments
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews * to use in tracing dynamic update protocol requests.
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews ns_g_lctx, NS_LOGCATEGORY_UPDATE, NS_LOGMODULE_UPDATE, \
3ddd814a97de1d152ba0913c592d6e6dc83d38a6Michael Graff * Convenience macro of common isc_log_write() arguments
d981ca645597116d227a48bf37cc5edc061c854dBob Halley * to use in low-level debug tracing.
0e8cf9a887c70f96ac448b06c069d90b830215ccMark Andrews ns_g_lctx, NS_LOGCATEGORY_UPDATE, NS_LOGMODULE_UPDATE, \
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews * Check an operation for failure. These macros all assume that
d0fe07af9cd5278b86bfba65c9a8391e007cd8c9Brian Wellington * the function using them has a 'result' variable and a 'failure'
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews * Fail unconditionally with result 'code', which must not
c363150ad598e7a8ce03efe2776b8e6950f0de7bBrian Wellington * be ISC_R_SUCCESS. The reason for failure presumably has
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews * been logged already.
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews * The test against ISC_R_SUCCESS is there to keep the Solaris compiler
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews * from complaining about "end-of-loop code not reached".
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews * Fail unconditionally and log as a client error.
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews * The test against ISC_R_SUCCESS is there to keep the Solaris compiler
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews * from complaining about "end-of-loop code not reached".
d981ca645597116d227a48bf37cc5edc061c854dBob Halley "dynamic update failed: %s (%s)", \
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews * Fail unconditionally and log as a server error.
d0fe07af9cd5278b86bfba65c9a8391e007cd8c9Brian Wellington * The test against ISC_R_SUCCESS is there to keep the Solaris compiler
1c3191528684f3dd93ebb122298c2f8ebfc6d397Mark Andrews * from complaining about "end-of-loop code not reached".
c363150ad598e7a8ce03efe2776b8e6950f0de7bBrian Wellington "dynamic update error: %s: %s", \
419590499823ce15b5d2ad4fe71eaf04bd5a86c0Michael Graff/**************************************************************************/
94a3bcd132e515b4baa0884ba9dd0f361d2e17bcMark Andrews /* dns_name_t name; */
d981ca645597116d227a48bf37cc5edc061c854dBob Halley/**************************************************************************/
3ddd814a97de1d152ba0913c592d6e6dc83d38a6Michael Graff * Forward declarations.
e27a69f8bd9538e08f775265167ba6cc5f47c587Bob Halleystatic void update_action(isc_task_t *task, isc_event_t *event);
e27a69f8bd9538e08f775265167ba6cc5f47c587Bob Halleystatic void updatedone_action(isc_task_t *task, isc_event_t *event);
e27a69f8bd9538e08f775265167ba6cc5f47c587Bob Halleystatic isc_result_t send_forward_event(ns_client_t *client, dns_zone_t *zone);
e27a69f8bd9538e08f775265167ba6cc5f47c587Bob Halley/**************************************************************************/
e27a69f8bd9538e08f775265167ba6cc5f47c587Bob Halley * Update a single RR in version 'ver' of 'db' and log the
854d0238dbc2908490197984b3b9d558008a53dfMark Andrews * update in 'diff'.
static isc_result_t
return (result);
return (ISC_R_SUCCESS);
static isc_result_t
return (result);
void * rr_action_data;
static isc_result_t
return (result);
return (result);
return (ISC_R_SUCCESS);
static isc_result_t
void *action_data)
return (ISC_R_SUCCESS);
return (result);
goto cleanup_node;
goto cleanup_iterator;
return (result);
static isc_result_t
void *rr_action_data)
static isc_result_t
void *rr_action_data)
return (ISC_R_SUCCESS);
return (result);
goto cleanup_node;
goto cleanup_node;
goto cleanup_rdataset;
goto cleanup_rdataset;
return (result);
static isc_result_t
return (ISC_R_EXISTS);
#define RETURN_EXISTENCE_FLAG \
result))
static isc_result_t
static isc_result_t
return (ISC_R_EXISTS);
return (ISC_R_SUCCESS);
static isc_result_t
static isc_result_t
(*countp)++;
return (ISC_R_SUCCESS);
static isc_result_t
*countp = 0;
static isc_result_t
return (ISC_R_EXISTS);
return (ISC_R_SUCCESS);
static isc_result_t
static isc_result_t
return (ISC_R_EXISTS);
static isc_result_t
} ssu_check_t;
static isc_result_t
return (ISC_TRUE);
static isc_boolean_t
static isc_result_t
return (result);
static isc_result_t
return (DNS_R_NXRRSET);
return (DNS_R_NXRRSET);
return (ISC_R_SUCCESS);
static isc_result_t
dns_difftuple_t *t;
return (ISC_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 (ISC_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_TRUE);
return (ISC_FALSE);
static isc_result_t
return (result);
return (ISC_R_SUCCESS);
static isc_result_t
static isc_result_t
if (serial == 0)
return (result);
static isc_result_t
return (result);
return (ISC_R_SUCCESS);
static isc_result_t
return (result);
static isc_result_t
return (result);
static isc_result_t
return (ISC_R_EXISTS);
return (ISC_R_SUCCESS);
static isc_result_t
static isc_result_t
dns_difftuple_t *p, *q;
while (p != NULL) {
dns_difftuple_free(&q);
return (result);
static isc_result_t
return (ISC_R_SUCCESS);
return (ISC_R_SUCCESS);
return (ISC_R_SUCCESS);
return (result);
static isc_result_t
unsigned int wraps = 0;
if (forward)
if (forward)
wraps++;
goto failure;
} while (! has_nxt);
return (result);
static isc_result_t
return (result);
static isc_result_t
isc_region_t r;
return (result);
static isc_result_t
return (result);
static isc_result_t
(isc_stdtime_t) 0,
for (i = 0; i < nkeys; i++) {
return (result);
static isc_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;
&ns_existed));
&dname_existed));
&ns_exists));
&dname_exists));
t != NULL;
if (! exists)
if (flag) {
if (! flag) {
diff);
t != NULL;
if (flag) {
t != NULL;
INSIST(0);
for (i = 0; i < nkeys; i++)
return (result);
static isc_result_t
return (result);
goto msg_failure;
&zone);
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;
0, &count));
if (! soa_serial_changed) {
goto failure;
goto common;
static isc_result_t
return (result);