Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
BIND
Commits
48f929d3
Commit
48f929d3
authored
Jan 11, 2005
by
Mark Andrews
Browse files
1792. [func] New zone option "notify-delay". Specify a minimum
delay between sets of NOTIFY messages.
parent
e286a65f
Changes
7
Hide whitespace changes
Inline
Side-by-side
CHANGES
View file @
48f929d3
...
...
@@ -10,7 +10,8 @@
1793. [placeholder] rt13378
1792. [placeholder] rt13124
1792. [func] New zone option "notify-delay". Specify a minimum
delay between sets of NOTIFY messages.
1791. [placeholder] rt13230
...
...
bin/named/config.c
View file @
48f929d3
...
...
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: config.c,v 1.5
4
2005/01/1
0
23:
43:16
marka Exp $ */
/* $Id: config.c,v 1.5
5
2005/01/1
1
23:
10:04
marka Exp $ */
#include <config.h>
...
...
@@ -136,6 +136,7 @@ options {\n\
allow-transfer {any;};
\n
\
notify yes;
\n
\
# also-notify <none>
\n
\
notify-delay 5;
\n
\
dialup no;
\n
\
# forward <none>
\n
\
# forwarders <none>
\n
\
...
...
bin/named/named.conf.docbook
View file @
48f929d3
...
...
@@ -15,7 +15,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
<!-- $Id: named.conf.docbook,v 1.
5
200
4/1
1/11
01:08:23
marka Exp $ -->
<!-- $Id: named.conf.docbook,v 1.
6
200
5/0
1/11
23:10:04
marka Exp $ -->
<refentry>
<refentryinfo>
...
...
@@ -258,6 +258,7 @@ options {
notify
<replaceable>
notifytype
</replaceable>
;
notify-source (
<replaceable>
ipv4_address
</replaceable>
| * )
<optional>
port (
<replaceable>
integer
</replaceable>
| * )
</optional>
;
notify-source-v6 (
<replaceable>
ipv6_address
</replaceable>
| * )
<optional>
port (
<replaceable>
integer
</replaceable>
| * )
</optional>
;
notify-delay
<replaceable>
seconds
</replaceable>
;
also-notify
<optional>
port
<replaceable>
integer
</replaceable>
</optional>
{ (
<replaceable>
ipv4_address
</replaceable>
|
<replaceable>
ipv6_address
</replaceable>
)
<optional>
port
<replaceable>
integer
</replaceable>
</optional>
; ... };
allow-notify {
<replaceable>
address_match_element
</replaceable>
; ... };
...
...
@@ -387,6 +388,7 @@ view <replaceable>string</replaceable> <replaceable>optional_class</replaceable>
notify
<replaceable>
notifytype
</replaceable>
;
notify-source (
<replaceable>
ipv4_address
</replaceable>
| * )
<optional>
port (
<replaceable>
integer
</replaceable>
| * )
</optional>
;
notify-source-v6 (
<replaceable>
ipv6_address
</replaceable>
| * )
<optional>
port (
<replaceable>
integer
</replaceable>
| * )
</optional>
;
notify-delay
<replaceable>
seconds
</replaceable>
;
also-notify
<optional>
port
<replaceable>
integer
</replaceable>
</optional>
{ (
<replaceable>
ipv4_address
</replaceable>
|
<replaceable>
ipv6_address
</replaceable>
)
<optional>
port
<replaceable>
integer
</replaceable>
</optional>
; ... };
allow-notify {
<replaceable>
address_match_element
</replaceable>
; ... };
...
...
@@ -464,6 +466,7 @@ zone <replaceable>string</replaceable> <replaceable>optional_class</replaceable>
notify
<replaceable>
notifytype
</replaceable>
;
notify-source (
<replaceable>
ipv4_address
</replaceable>
| * )
<optional>
port (
<replaceable>
integer
</replaceable>
| * )
</optional>
;
notify-source-v6 (
<replaceable>
ipv6_address
</replaceable>
| * )
<optional>
port (
<replaceable>
integer
</replaceable>
| * )
</optional>
;
notify-delay
<replaceable>
seconds
</replaceable>
;
also-notify
<optional>
port
<replaceable>
integer
</replaceable>
</optional>
{ (
<replaceable>
ipv4_address
</replaceable>
|
<replaceable>
ipv6_address
</replaceable>
)
<optional>
port
<replaceable>
integer
</replaceable>
</optional>
; ... };
allow-notify {
<replaceable>
address_match_element
</replaceable>
; ... };
...
...
bin/named/zoneconf.c
View file @
48f929d3
...
...
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: zoneconf.c,v 1.11
7
2005/01/11
0
3:
46
:0
8
marka Exp $ */
/* $Id: zoneconf.c,v 1.11
8
2005/01/11
2
3:
10
:0
4
marka Exp $ */
#include <config.h>
...
...
@@ -561,6 +561,12 @@ ns_zone_configure(cfg_obj_t *config, cfg_obj_t *vconfig, cfg_obj_t *zconfig,
INSIST
(
0
);
dns_zone_setoption
(
zone
,
DNS_ZONEOPT_CHECKNAMES
,
check
);
dns_zone_setoption
(
zone
,
DNS_ZONEOPT_CHECKNAMESFAIL
,
fail
);
obj
=
NULL
;
result
=
ns_config_get
(
maps
,
"notify-delay"
,
&
obj
);
INSIST
(
result
==
ISC_R_SUCCESS
);
dns_zone_setnotifydelay
(
zone
,
cfg_obj_asuint32
(
obj
));
}
/*
...
...
lib/dns/include/dns/zone.h
View file @
48f929d3
...
...
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: zone.h,v 1.13
0
2005/01/1
0
23:
43:2
5 marka Exp $ */
/* $Id: zone.h,v 1.13
1
2005/01/1
1
23:
10:0
5 marka Exp $ */
#ifndef DNS_ZONE_H
#define DNS_ZONE_H 1
...
...
@@ -1446,6 +1446,24 @@ dns_zone_setacache(dns_zone_t *zone, dns_acache_t *acache);
* 'zone' will have a reference to 'acache'
*/
void
dns_zone_setnotifydelay
(
dns_zone_t
*
zone
,
isc_uint32_t
delay
);
/*
* Set the minimum delay between sets of notify messages.
*
* Requires:
* 'zone' to be valid.
*/
isc_uint32_t
dns_zone_getnotifydelay
(
dns_zone_t
*
zone
);
/*
* Get the minimum delay between sets of notify messages.
*
* Requires:
* 'zone' to be valid.
*/
ISC_LANG_ENDDECLS
#endif
/* DNS_ZONE_H */
lib/dns/zone.c
View file @
48f929d3
...
...
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: zone.c,v 1.42
8
2005/01/1
0
23:
43:22
marka Exp $ */
/* $Id: zone.c,v 1.42
9
2005/01/1
1
23:
10:05
marka Exp $ */
#include <config.h>
...
...
@@ -154,6 +154,7 @@ struct dns_zone {
isc_time_t
refreshtime
;
isc_time_t
dumptime
;
isc_time_t
loadtime
;
isc_time_t
notifytime
;
isc_uint32_t
serial
;
isc_uint32_t
refresh
;
isc_uint32_t
retry
;
...
...
@@ -220,7 +221,8 @@ struct dns_zone {
/*
* Optional per-zone statistics counters (NULL if not present).
*/
isc_uint64_t
*
counters
;
isc_uint64_t
*
counters
;
isc_uint32_t
notifydelay
;
};
#define DNS_ZONE_FLAG(z,f) (ISC_TF(((z)->flags & (f)) != 0))
...
...
@@ -443,7 +445,7 @@ static void forward_callback(isc_task_t *task, isc_event_t *event);
static
void
zone_saveunique
(
dns_zone_t
*
zone
,
const
char
*
path
,
const
char
*
templat
);
static
void
zone_maintenance
(
dns_zone_t
*
zone
);
static
void
zone_notify
(
dns_zone_t
*
zone
);
static
void
zone_notify
(
dns_zone_t
*
zone
,
isc_time_t
*
now
);
static
void
dump_done
(
void
*
arg
,
isc_result_t
result
);
#define ENTER zone_debuglog(zone, me, 1, "enter")
...
...
@@ -487,10 +489,12 @@ isc_result_t
dns_zone_create
(
dns_zone_t
**
zonep
,
isc_mem_t
*
mctx
)
{
isc_result_t
result
;
dns_zone_t
*
zone
;
isc_time_t
now
;
REQUIRE
(
zonep
!=
NULL
&&
*
zonep
==
NULL
);
REQUIRE
(
mctx
!=
NULL
);
TIME_NOW
(
&
now
);
zone
=
isc_mem_get
(
mctx
,
sizeof
(
*
zone
));
if
(
zone
==
NULL
)
return
(
ISC_R_NOMEMORY
);
...
...
@@ -530,6 +534,7 @@ dns_zone_create(dns_zone_t **zonep, isc_mem_t *mctx) {
isc_time_settoepoch
(
&
zone
->
refreshtime
);
isc_time_settoepoch
(
&
zone
->
dumptime
);
isc_time_settoepoch
(
&
zone
->
loadtime
);
zone
->
notifytime
=
now
;
zone
->
serial
=
0
;
zone
->
refresh
=
DNS_ZONE_DEFAULTREFRESH
;
zone
->
retry
=
DNS_ZONE_DEFAULTRETRY
;
...
...
@@ -580,6 +585,7 @@ dns_zone_create(dns_zone_t **zonep, isc_mem_t *mctx) {
ISC_LINK_INIT
(
zone
,
statelink
);
zone
->
statelist
=
NULL
;
zone
->
counters
=
NULL
;
zone
->
notifydelay
=
5
;
zone
->
magic
=
ZONE_MAGIC
;
...
...
@@ -2287,8 +2293,9 @@ zone_maintenance(dns_zone_t *zone) {
switch
(
zone
->
type
)
{
case
dns_zone_master
:
case
dns_zone_slave
:
if
(
DNS_ZONE_FLAG
(
zone
,
DNS_ZONEFLG_NEEDNOTIFY
))
zone_notify
(
zone
);
if
(
DNS_ZONE_FLAG
(
zone
,
DNS_ZONEFLG_NEEDNOTIFY
)
&&
isc_time_compare
(
&
now
,
&
zone
->
notifytime
)
>=
0
)
zone_notify
(
zone
,
&
now
);
break
;
default:
break
;
...
...
@@ -3016,7 +3023,7 @@ dns_zone_notify(dns_zone_t *zone) {
}
static
void
zone_notify
(
dns_zone_t
*
zone
)
{
zone_notify
(
dns_zone_t
*
zone
,
isc_time_t
*
now
)
{
dns_dbnode_t
*
node
=
NULL
;
dns_dbversion_t
*
version
=
NULL
;
dns_name_t
*
origin
=
NULL
;
...
...
@@ -3041,6 +3048,7 @@ zone_notify(dns_zone_t *zone) {
LOCK_ZONE
(
zone
);
DNS_ZONE_CLRFLAG
(
zone
,
DNS_ZONEFLG_NEEDNOTIFY
);
notifytype
=
zone
->
notifytype
;
DNS_ZONE_TIME_ADD
(
now
,
zone
->
notifydelay
,
&
zone
->
notifytime
);
UNLOCK_ZONE
(
zone
);
if
(
!
DNS_ZONE_FLAG
(
zone
,
DNS_ZONEFLG_LOADED
))
...
...
@@ -4460,7 +4468,7 @@ zone_settimer(dns_zone_t *zone, isc_time_t *now) {
switch
(
zone
->
type
)
{
case
dns_zone_master
:
if
(
DNS_ZONE_FLAG
(
zone
,
DNS_ZONEFLG_NEEDNOTIFY
))
next
=
*
now
;
next
=
zone
->
notifytime
;
if
(
DNS_ZONE_FLAG
(
zone
,
DNS_ZONEFLG_NEEDDUMP
)
&&
!
DNS_ZONE_FLAG
(
zone
,
DNS_ZONEFLG_DUMPING
))
{
INSIST
(
!
isc_time_isepoch
(
&
zone
->
dumptime
));
...
...
@@ -4472,7 +4480,7 @@ zone_settimer(dns_zone_t *zone, isc_time_t *now) {
case
dns_zone_slave
:
if
(
DNS_ZONE_FLAG
(
zone
,
DNS_ZONEFLG_NEEDNOTIFY
))
next
=
*
now
;
next
=
zone
->
notifytime
;
/*FALLTHROUGH*/
case
dns_zone_stub
:
...
...
@@ -6997,3 +7005,19 @@ dns_zone_checknames(dns_zone_t *zone, dns_name_t *name, dns_rdata_t *rdata) {
return
(
ISC_R_SUCCESS
);
}
void
dns_zone_setnotifydelay
(
dns_zone_t
*
zone
,
isc_uint32_t
delay
)
{
REQUIRE
(
DNS_ZONE_VALID
(
zone
));
LOCK_ZONE
(
zone
);
zone
->
notifydelay
=
delay
;
UNLOCK_ZONE
(
zone
);
}
isc_uint32_t
dns_zone_getnotifydelay
(
dns_zone_t
*
zone
)
{
REQUIRE
(
DNS_ZONE_VALID
(
zone
));
return
(
zone
->
notifydelay
);
}
lib/isccfg/namedconf.c
View file @
48f929d3
...
...
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: namedconf.c,v 1.4
4
2005/01/1
0
23:
43:27
marka Exp $ */
/* $Id: namedconf.c,v 1.4
5
2005/01/1
1
23:
10:06
marka Exp $ */
#include <config.h>
...
...
@@ -765,6 +765,7 @@ zone_clauses[] = {
{
"notify-source"
,
&
cfg_type_sockaddr4wild
,
0
},
{
"notify-source-v6"
,
&
cfg_type_sockaddr6wild
,
0
},
{
"also-notify"
,
&
cfg_type_portiplist
,
0
},
{
"notify-delay"
,
&
cfg_type_uint32
,
0
},
{
"dialup"
,
&
cfg_type_dialuptype
,
0
},
{
"forward"
,
&
cfg_type_forwardtype
,
0
},
{
"forwarders"
,
&
cfg_type_portiplist
,
0
},
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment