notify.c revision 40f53fa8d9c6a4fc38c0014495e7a42b08f52481
/*
* Copyright (C) 1999, 2000 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
* INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: notify.c,v 1.20 2000/08/01 01:11:54 tale Exp $ */
#include <config.h>
#include <dns/rdataset.h>
/*
* This module implements notify as in RFC 1996.
*/
/**************************************************************************/
/*
* Convenience macro of common isc_log_write() arguments
* to use in reportings server errors.
*/
#define NOTIFY_ERROR_LOGARGS \
/*
* Convenience macro of common isc_log_write() arguments
* to use in tracing notify protocol requests.
*/
#define NOTIFY_PROTOCOL_LOGARGS \
/*
* Convenience macro of common isc_log_write() arguments
* to use in low-level debug tracing.
*/
#define NOTIFY_DEBUG_LOGARGS \
/*
* Check an operation for failure. These macros all assume that
* the function using them has a 'result' variable and a 'failure'
* label.
*/
} while (0)
/*
* Fail unconditionally with result 'code', which must not
* be ISC_R_SUCCESS. The reason for failure presumably has
* been logged already.
*
* The test is there to keep the Solaris compiler from complaining
* about "end-of-loop code not reached".
*/
do { \
} while (0)
/*
* Fail unconditionally and log as a client error.
* The test against ISC_R_SUCCESS is there to keep the Solaris compiler
* from complaining about "end-of-loop code not reached".
*/
do { \
"notify failed: %s (%s)", \
} while (0)
/*
* Fail unconditionally and log as a server error.
* The test against ISC_R_SUCCESS is there to keep the Solaris compiler
* from complaining about "end-of-loop code not reached".
*/
do { \
"notify error: %s: %s", \
} while (0)
/**************************************************************************/
static void
if (msg_result != ISC_R_SUCCESS)
if (msg_result != ISC_R_SUCCESS) {
return;
}
if (rcode == dns_rcode_noerror)
else
}
void
/*
* Interpret the question section.
*/
if (result != ISC_R_SUCCESS)
"notify question section empty");
/*
* The question section must contain exactly one question.
*/
"notify question section contains multiple RRs");
/* The zone section must have exactly one name. */
if (result != ISC_R_NOMORE)
"notify question section contains multiple RRs");
&zone);
if (result != ISC_R_SUCCESS)
"not authoritative for notify zone");
switch(dns_zone_gettype(zone)) {
case dns_zone_master:
case dns_zone_slave:
break;
default:
"not authoritative for notify zone");
}
return;
}