* SOFTWARE.
*/
-/* $Id: zoneconf.c,v 1.45 2000/07/21 23:13:59 mws Exp $ */
+/* $Id: zoneconf.c,v 1.46 2000/07/24 22:59:32 explorer Exp $ */
#include <config.h>
isc_result_t result;
isc_boolean_t boolean;
const char *filename = NULL;
+ dns_notifytype_t notifytype;
#ifdef notyet
dns_c_severity_t severity;
#endif
* acting as masters (type "slave"), but not to stubs.
*/
if (czone->ztype != dns_c_zone_stub) {
- result = dns_c_zone_getnotify(czone, &boolean);
+ result = dns_c_zone_getnotify(czone, ¬ifytype);
if (result != ISC_R_SUCCESS && cview != NULL)
- result = dns_c_view_getnotify(cview, &boolean);
+ result = dns_c_view_getnotify(cview, ¬ifytype);
if (result != ISC_R_SUCCESS)
- result = dns_c_ctx_getnotify(cctx, &boolean);
+ result = dns_c_ctx_getnotify(cctx, ¬ifytype);
if (result != ISC_R_SUCCESS)
- boolean = ISC_TRUE;
- dns_zone_setoption(zone, DNS_ZONEOPT_NOTIFY, boolean);
+ notifytype = dns_notifytype_yes;
+ dns_zone_setnotifytype(zone, notifytype);
iplist = NULL;
result = dns_c_zone_getalsonotify(czone, &iplist);
* SOFTWARE.
*/
-/* $Id: confctx.c,v 1.73 2000/07/11 19:09:04 brister Exp $ */
+/* $Id: confctx.c,v 1.74 2000/07/24 22:59:34 explorer Exp $ */
#include <config.h>
#define GETBOOL(FUNC, FIELD) GETBYTYPE(isc_boolean_t, FUNC, FIELD)
#define UNSETBOOL(FUNC, FIELD) UNSETBYTYPE(isc_boolean_t, FUNC, FIELD)
+#define SETNOTIFYTYPE(FUNC, FIELD) SETBYTYPE(dns_notifytype_t, FUNC, FIELD)
+#define GETNOTIFYTYPE(FUNC, FIELD) GETBYTYPE(dns_notifytype_t, FUNC, FIELD)
+#define UNSETNOTIFYTYPE(FUNC, FIELD) UNSETBYTYPE(dns_notifytype_t, FUNC, FIELD)
+
#define SETINT32(FUNC, FIELD) SETBYTYPE(isc_int32_t, FUNC, FIELD)
#define GETINT32(FUNC, FIELD) GETBYTYPE(isc_int32_t, FUNC, FIELD)
#define UNSETINT32(FUNC, FIELD) UNSETBYTYPE(isc_int32_t, FUNC, FIELD)
(unsigned long)(*options->FIELD / 60)); \
}
+#define PRINT_IF_EQUAL(VAL, STRVAL, FIELD, NAME) \
+ if (options->FIELD != NULL) { \
+ dns_c_printtabs(fp, indent + 1); \
+ fprintf(fp, "%s %s;\n", NAME, STRVAL); \
+ }
+
#define PRINT_AS_BOOLEAN(FIELD, NAME) \
if (options->FIELD != NULL) { \
dns_c_printtabs(fp, indent + 1); \
PRINT_AS_BOOLEAN(fake_iquery, "fake-iquery");
PRINT_AS_BOOLEAN(recursion, "recursion");
PRINT_AS_BOOLEAN(fetch_glue, "fetch-glue");
- PRINT_AS_BOOLEAN(notify, "notify");
+ PRINT_IF_EQUAL(dns_notifytype_no, "no", notify, "notify");
+ PRINT_IF_EQUAL(dns_notifytype_yes, "yes", notify, "notify");
+ PRINT_IF_EQUAL(dns_notifytype_explicit, "explicit", notify, "notify");
PRINT_AS_BOOLEAN(host_statistics, "host-statistics");
PRINT_AS_BOOLEAN(dealloc_on_exit, "deallocate-on-exit");
PRINT_AS_BOOLEAN(use_ixfr, "use-ixfr");
UNSETBOOL(fetchglue, fetch_glue)
-GETBOOL(notify, notify)
-SETBOOL(notify, notify)
-UNSETBOOL(notify, notify)
+GETNOTIFYTYPE(notify, notify)
+SETNOTIFYTYPE(notify, notify)
+UNSETNOTIFYTYPE(notify, notify)
GETBOOL(hoststatistics, host_statistics)
* SOFTWARE.
*/
-/* $Id: confparser.y,v 1.103 2000/07/21 21:24:57 brister Exp $ */
+/* $Id: confparser.y,v 1.104 2000/07/24 22:59:35 explorer Exp $ */
#include <config.h>
dns_severity_t severity;
dns_c_trans_t transport;
dns_transfer_format_t tformat;
+ dns_notifytype_t notifytype;
dns_c_ipmatchelement_t *ime;
dns_c_ipmatchlist_t *iml;
%token L_WILDCARD
%token L_YES
%token L_ZONE
+%token L_EXPLICIT
%type <addata> additional_data
%type <boolean> grantp
%type <boolean> yea_or_nay
+%type <notifytype> notify_setting
%type <forward> forward_opt
%type <forward> zone_forward_opt
%type <ime> address_match_element
YYABORT;
}
}
- | L_NOTIFY yea_or_nay
+ | L_NOTIFY notify_setting
{
tmpres = dns_c_ctx_setnotify(currcfg, $2);
if (tmpres == ISC_R_EXISTS) {
$$ = isc_boolean_true;
}
}
+
+notify_setting: L_YES
+ {
+ $$ = dns_notifytype_yes;
+ }
+ | L_TRUE
+ {
+ $$ = dns_notifytype_yes;
+ }
+ | L_NO
+ {
+ $$ = dns_notifytype_no;
+ }
+ | L_FALSE
+ {
+ $$ = dns_notifytype_no;
+ }
+ | L_EXPLICIT
+ {
+ $$ = dns_notifytype_explicit;
+ }
+ | L_INTEGER
+ {
+ if ($1 == 1) {
+ $$ = dns_notifytype_yes;
+ } else if ($1 == 0) {
+ $$ = dns_notifytype_no;
+ } else {
+ parser_warning(ISC_TRUE,
+ "number should be 0 or 1, assuming 1");
+ $$ = dns_notifytype_yes;
+ }
+ }
;
check_names_type: L_MASTER
YYABORT;
}
}
- | L_NOTIFY yea_or_nay
+ | L_NOTIFY notify_setting
{
dns_c_view_t *view = dns_c_ctx_getcurrview(currcfg);
YYABORT;
}
}
- | L_NOTIFY yea_or_nay
+ | L_NOTIFY notify_setting
{
dns_c_zone_t *zone = dns_c_ctx_getcurrzone(currcfg);
{ "warn", L_WARN },
{ "yes", L_YES },
{ "zone", L_ZONE },
+ { "explicit", L_EXPLICIT },
{ NULL, 0 }
};
* SOFTWARE.
*/
-/* $Id: confview.c,v 1.36 2000/06/09 22:13:23 brister Exp $ */
+/* $Id: confview.c,v 1.37 2000/07/24 22:59:37 explorer Exp $ */
#include <config.h>
#define GETBOOL(FUNC, FIELD) GETBYTYPE(isc_boolean_t, FUNC, FIELD)
#define UNSETBOOL(FUNC, FIELD) UNSETBYTYPE(isc_boolean_t, FUNC, FIELD)
+#define SETNOTIFYTYPE(FUNC, FIELD) SETBYTYPE(dns_notifytype_t, FUNC, FIELD)
+#define GETNOTIFYTYPE(FUNC, FIELD) GETBYTYPE(dns_notifytype_t, FUNC, FIELD)
+#define UNSETNOTIFYTYPE(FUNC, FIELD) UNSETBYTYPE(dns_notifytype_t, FUNC, FIELD)
+
#define SETUINT32(FUNC, FIELD) SETBYTYPE(isc_uint32_t, FUNC, FIELD)
#define GETUINT32(FUNC, FIELD) GETBYTYPE(isc_uint32_t, FUNC, FIELD)
#define UNSETUINT32(FUNC, FIELD) UNSETBYTYPE(isc_uint32_t, FUNC, FIELD)
dns_c_viewtable_checkviews(dns_c_viewtable_t *viewtable) {
dns_c_view_t *elem;
isc_boolean_t bbval;
+ dns_notifytype_t notifytype;
isc_uint32_t buival;
isc_result_t result = ISC_R_SUCCESS;
dns_c_rrsolist_t *boval;
"implemented");
- if (dns_c_view_getnotify(elem, &bbval) != ISC_R_NOTFOUND)
+ if (dns_c_view_getnotify(elem, ¬ifytype) != ISC_R_NOTFOUND)
isc_log_write(dns_lctx,DNS_LOGCATEGORY_CONFIG,
DNS_LOGMODULE_CONFIG, ISC_LOG_WARNING,
"view 'notify' is not yet "
GETBOOL(fetchglue, fetch_glue)
UNSETBOOL(fetchglue, fetch_glue)
-SETBOOL(notify, notify)
-GETBOOL(notify, notify)
-UNSETBOOL(notify, notify)
+GETNOTIFYTYPE(notify, notify)
+SETNOTIFYTYPE(notify, notify)
+UNSETNOTIFYTYPE(notify, notify)
SETBOOL(rfc2308type1, rfc2308_type1)
GETBOOL(rfc2308type1, rfc2308_type1)
* SOFTWARE.
*/
-/* $Id: confzone.c,v 1.48 2000/07/21 21:24:59 brister Exp $ */
+/* $Id: confzone.c,v 1.49 2000/07/24 22:59:38 explorer Exp $ */
#include <config.h>
case dns_c_zone_master:
master_zone_init(&newzone->u.mzone);
break;
-
+
case dns_c_zone_slave:
slave_zone_init(&newzone->u.szone);
break;
case dns_c_zone_stub:
stub_zone_init(&newzone->u.tzone);
break;
-
+
case dns_c_zone_hint:
hint_zone_init(&newzone->u.hzone);
break;
-
+
case dns_c_zone_forward:
forward_zone_init(&newzone->u.fzone);
break;
*/
isc_result_t
-dns_c_zone_setnotify(dns_c_zone_t *zone, isc_boolean_t newval) {
+dns_c_zone_setnotify(dns_c_zone_t *zone, dns_notifytype_t newval) {
isc_boolean_t existed = ISC_FALSE;
REQUIRE(DNS_C_ZONE_VALID(zone));
*/
isc_result_t
-dns_c_zone_getnotify(dns_c_zone_t *zone, isc_boolean_t *retval) {
+dns_c_zone_getnotify(dns_c_zone_t *zone, dns_notifytype_t *retval) {
isc_result_t res;
dns_c_setbits_t *bits = NULL;
- isc_boolean_t val = ISC_FALSE;
+ dns_notifytype_t val = dns_notifytype_no;
int bit = 0;
-
+
REQUIRE(DNS_C_ZONE_VALID(zone));
REQUIRE(retval != NULL);
bit = MZ_NOTIFY_BIT;
bits = &zone->u.mzone.setflags;
break;
-
+
case dns_c_zone_slave:
val = zone->u.szone.notify;
bit = SZ_NOTIFY_BIT;
bits = &zone->u.szone.setflags;
break;
-
+
case dns_c_zone_stub:
isc_log_write(dns_lctx, DNS_LOGCATEGORY_CONFIG,
DNS_LOGMODULE_CONFIG, ISC_LOG_CRITICAL,
"Stub zones do not have a notify field");
return (ISC_R_FAILURE);
-
+
case dns_c_zone_hint:
isc_log_write(dns_lctx, DNS_LOGCATEGORY_CONFIG,
DNS_LOGMODULE_CONFIG, ISC_LOG_CRITICAL,
"Hint zones do not have a notify field");
return (ISC_R_FAILURE);
-
+
case dns_c_zone_forward:
isc_log_write(dns_lctx, DNS_LOGCATEGORY_CONFIG,
DNS_LOGMODULE_CONFIG, ISC_LOG_CRITICAL,
} else {
res = ISC_R_NOTFOUND;
}
-
+
return (res);
}
if (DNS_C_CHECKBIT(MZ_NOTIFY_BIT, &mzone->setflags)) {
dns_c_printtabs(fp, indent);
- fprintf(fp, "notify %s;\n",
- (mzone->notify ? "true" : "false"));
+ if (mzone->notify == dns_notifytype_no)
+ fprintf(fp, "notify no;\n");
+ if (mzone->notify == dns_notifytype_yes)
+ fprintf(fp, "notify yes;\n");
+ if (mzone->notify == dns_notifytype_explicit)
+ fprintf(fp, "notify explicit;\n");
}
if (mzone->also_notify != NULL) {
if (DNS_C_CHECKBIT(SZ_NOTIFY_BIT, &szone->setflags)) {
dns_c_printtabs(fp, indent);
- fprintf(fp, "notify %s;\n",
- (szone->notify ? "true" : "false"));
+ if (szone->notify == dns_notifytype_no)
+ fprintf(fp, "notify no;\n");
+ if (szone->notify == dns_notifytype_yes)
+ fprintf(fp, "notify yes;\n");
+ if (szone->notify == dns_notifytype_explicit)
+ fprintf(fp, "notify explicit;\n");
}
if (szone->also_notify != NULL) {
* SOFTWARE.
*/
-/* $Id: confctx.h,v 1.43 2000/06/22 21:55:20 tale Exp $ */
+/* $Id: confctx.h,v 1.44 2000/07/24 22:59:39 explorer Exp $ */
#ifndef DNS_CONFCTX_H
#define DNS_CONFCTX_H 1
isc_boolean_t *fake_iquery;
isc_boolean_t *recursion;
isc_boolean_t *fetch_glue;
- isc_boolean_t *notify;
isc_boolean_t *host_statistics;
isc_boolean_t *dealloc_on_exit;
isc_boolean_t *use_ixfr;
isc_uint32_t tkeydhkeyi;
char *tkeydomain;
+ dns_notifytype_t *notify;
dns_c_iplist_t *also_notify;
dns_severity_t *check_names[DNS_C_TRANSCOUNT];
isc_result_t dns_c_ctx_unsetfetchglue(dns_c_ctx_t *cfg);
-isc_result_t dns_c_ctx_setnotify(dns_c_ctx_t *cfg, isc_boolean_t newval);
-isc_result_t dns_c_ctx_getnotify(dns_c_ctx_t *cfg, isc_boolean_t *retval);
+isc_result_t dns_c_ctx_setnotify(dns_c_ctx_t *cfg, dns_notifytype_t newval);
+isc_result_t dns_c_ctx_getnotify(dns_c_ctx_t *cfg, dns_notifytype_t *retval);
isc_result_t dns_c_ctx_unsetnotify(dns_c_ctx_t *cfg);
* SOFTWARE.
*/
-/* $Id: confview.h,v 1.30 2000/06/22 21:55:30 tale Exp $ */
+/* $Id: confview.h,v 1.31 2000/07/24 22:59:41 explorer Exp $ */
#ifndef DNS_CONFVIEW_H
#define DNS_CONFVIEW_H 1
-isc_result_t dns_c_view_getnotify(dns_c_view_t *view, isc_boolean_t *retval);
-isc_result_t dns_c_view_setnotify(dns_c_view_t *view, isc_boolean_t newval);
+isc_result_t dns_c_view_getnotify(dns_c_view_t *view, dns_notifytype_t *retval);
+isc_result_t dns_c_view_setnotify(dns_c_view_t *view, dns_notifytype_t newval);
isc_result_t dns_c_view_unsetnotify(dns_c_view_t *view);
* SOFTWARE.
*/
-/* $Id: confzone.h,v 1.36 2000/07/21 21:25:01 brister Exp $ */
+/* $Id: confzone.h,v 1.37 2000/07/24 22:59:42 explorer Exp $ */
#ifndef DNS_CONFZONE_H
#define DNS_CONFZONE_H 1
isc_result_t dns_c_zone_setnotify(dns_c_zone_t *zone,
- isc_boolean_t newval);
-isc_result_t dns_c_zone_getnotify(dns_c_zone_t *zone, isc_boolean_t *retval);
+ dns_notifytype_t newval);
+isc_result_t dns_c_zone_getnotify(dns_c_zone_t *zone,
+ dns_notifytype_t *retval);
isc_result_t dns_c_zone_setalsonotify(dns_c_zone_t *zone,
* SOFTWARE.
*/
-/* $Id: types.h,v 1.88 2000/06/23 02:59:05 tale Exp $ */
+/* $Id: types.h,v 1.89 2000/07/24 22:59:43 explorer Exp $ */
#ifndef DNS_TYPES_H
#define DNS_TYPES_H 1
dns_dbtype_zone = 0, dns_dbtype_cache = 1, dns_dbtype_stub = 3
} dns_dbtype_t;
+typedef enum {
+ dns_notifytype_no = 0,
+ dns_notifytype_yes = 1,
+ dns_notifytype_explicit = 2
+} dns_notifytype_t;
+
/*
* These are generated by gen.c.
*/
* SOFTWARE.
*/
-/* $Id: zone.h,v 1.60 2000/07/21 18:47:23 mws Exp $ */
+/* $Id: zone.h,v 1.61 2000/07/24 22:59:44 explorer Exp $ */
#ifndef DNS_ZONE_H
#define DNS_ZONE_H 1
* 'zone' to be a valid zone.
*/
+void
+dns_zone_setnotifytype(dns_zone_t *zone, dns_notifytype_t notifytype);
+/*
+ * Sets zone notify method to "notifytype"
+ */
+
isc_result_t
dns_zonemgr_create(isc_mem_t *mctx, isc_taskmgr_t *taskmgr,
isc_timermgr_t *timermgr, isc_socketmgr_t *socketmgr,
* SOFTWARE.
*/
-/* $Id: zone.c,v 1.165 2000/07/22 00:40:39 mws Exp $ */
+/* $Id: zone.c,v 1.166 2000/07/24 22:59:31 explorer Exp $ */
#include <config.h>
unsigned int masterscnt;
unsigned int curmaster;
isc_sockaddr_t masteraddr;
+ dns_notifytype_t notifytype;
isc_sockaddr_t *notify;
unsigned int notifycnt;
isc_sockaddr_t notifyfrom;
zone->masterscnt = 0;
zone->curmaster = 0;
zone->notify = NULL;
+ zone->notifytype = dns_notifytype_yes;
zone->notifycnt = 0;
zone->task = NULL;
zone->update_acl = NULL;
return (zone->rdclass);
}
+void
+dns_zone_setnotifytype(dns_zone_t *zone, dns_notifytype_t notifytype) {
+ REQUIRE(DNS_ZONE_VALID(zone));
+
+ LOCK(&zone->lock);
+ zone->notifytype = notifytype;
+ UNLOCK(&zone->lock);
+}
+
/*
* Single shot.
*/
unsigned int i;
isc_sockaddr_t dst;
isc_boolean_t isqueued;
+ dns_notifytype_t notifytype;
REQUIRE(DNS_ZONE_VALID(zone));
LOCK(&zone->lock);
zone->flags &= ~DNS_ZONEFLG_NEEDNOTIFY;
+ notifytype = zone->notifytype;
UNLOCK(&zone->lock);
- if (!DNS_ZONE_OPTION(zone, DNS_ZONEOPT_NOTIFY)) {
+ if (notifytype == dns_notifytype_no)
return;
- }
origin = &zone->origin;
}
UNLOCK(&zone->lock);
+ if (notifytype == dns_notifytype_explicit)
+ return;
+
/*
* Process NS RRset to generate notifies.
*/
* SOFTWARE.
*/
-/* $Id: zoneconf.c,v 1.45 2000/07/21 23:13:59 mws Exp $ */
+/* $Id: zoneconf.c,v 1.46 2000/07/24 22:59:32 explorer Exp $ */
#include <config.h>
isc_result_t result;
isc_boolean_t boolean;
const char *filename = NULL;
+ dns_notifytype_t notifytype;
#ifdef notyet
dns_c_severity_t severity;
#endif
* acting as masters (type "slave"), but not to stubs.
*/
if (czone->ztype != dns_c_zone_stub) {
- result = dns_c_zone_getnotify(czone, &boolean);
+ result = dns_c_zone_getnotify(czone, ¬ifytype);
if (result != ISC_R_SUCCESS && cview != NULL)
- result = dns_c_view_getnotify(cview, &boolean);
+ result = dns_c_view_getnotify(cview, ¬ifytype);
if (result != ISC_R_SUCCESS)
- result = dns_c_ctx_getnotify(cctx, &boolean);
+ result = dns_c_ctx_getnotify(cctx, ¬ifytype);
if (result != ISC_R_SUCCESS)
- boolean = ISC_TRUE;
- dns_zone_setoption(zone, DNS_ZONEOPT_NOTIFY, boolean);
+ notifytype = dns_notifytype_yes;
+ dns_zone_setnotifytype(zone, notifytype);
iplist = NULL;
result = dns_c_zone_getalsonotify(czone, &iplist);