mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 14:07:59 +00:00
DNS_ZONE_F_???? -> DNS_ZONEFLG_????
DNS_ZONE_O_???? -> DNS_ZONEOPT_???? Add various missing REQUIRE's Add / cleanup comments in zone.h Remove dns_zone_unmount() never implemented.
This commit is contained in:
@@ -164,7 +164,7 @@ dns_zone_configure(dns_c_ctx_t *cctx, dns_c_view_t *cview,
|
||||
result = dns_c_ctx_getdialup(cctx, &boolean);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
boolean = ISC_FALSE;
|
||||
dns_zone_setoption(zone, DNS_ZONE_O_DIALUP, boolean);
|
||||
dns_zone_setoption(zone, DNS_ZONEOPT_DIALUP, boolean);
|
||||
|
||||
/*
|
||||
* Configure master functionality. This applies
|
||||
@@ -179,7 +179,7 @@ dns_zone_configure(dns_c_ctx_t *cctx, dns_c_view_t *cview,
|
||||
result = dns_c_ctx_getnotify(cctx, &boolean);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
boolean = ISC_TRUE;
|
||||
dns_zone_setoption(zone, DNS_ZONE_O_NOTIFY, boolean);
|
||||
dns_zone_setoption(zone, DNS_ZONEOPT_NOTIFY, boolean);
|
||||
|
||||
iplist = NULL;
|
||||
result = dns_c_zone_getalsonotify(czone, &iplist);
|
||||
|
@@ -36,11 +36,11 @@ typedef enum {
|
||||
dns_zone_stub
|
||||
} dns_zonetype_t;
|
||||
|
||||
#define DNS_ZONE_O_SERVERS 0x00000001U /* perform server checks */
|
||||
#define DNS_ZONE_O_PARENTS 0x00000002U /* perform parent checks */
|
||||
#define DNS_ZONE_O_CHILDREN 0x00000004U /* perform child checks */
|
||||
#define DNS_ZONE_O_DIALUP 0x00000008U /* zone xfr over dialup link */
|
||||
#define DNS_ZONE_O_NOTIFY 0x00000010U /* perform NOTIFY */
|
||||
#define DNS_ZONEOPT_SERVERS 0x00000001U /* perform server checks */
|
||||
#define DNS_ZONEOPT_PARENTS 0x00000002U /* perform parent checks */
|
||||
#define DNS_ZONEOPT_CHILDREN 0x00000004U /* perform child checks */
|
||||
#define DNS_ZONEOPT_DIALUP 0x00000008U /* zone xfr over dialup link */
|
||||
#define DNS_ZONEOPT_NOTIFY 0x00000010U /* perform NOTIFY */
|
||||
|
||||
ISC_LANG_BEGINDECLS
|
||||
|
||||
@@ -73,9 +73,9 @@ dns_zone_setclass(dns_zone_t *zone, dns_rdataclass_t rdclass);
|
||||
* once on a zone.
|
||||
*
|
||||
* Require:
|
||||
* 'zone' to be a valid initalised zone.
|
||||
* 'zone' to be a valid zone.
|
||||
* dns_zone_setclass() not to have been called since the zone was
|
||||
* initalised.
|
||||
* created.
|
||||
* 'rdclass' != dns_rdataclass_none.
|
||||
*/
|
||||
|
||||
@@ -85,7 +85,7 @@ dns_zone_getclass(dns_zone_t *zone);
|
||||
* Returns the current zone class.
|
||||
*
|
||||
* Requires:
|
||||
* 'zone' to be a valid initalised zone.
|
||||
* 'zone' to be a valid zone.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -95,9 +95,9 @@ dns_zone_settype(dns_zone_t *zone, dns_zonetype_t type);
|
||||
* a zone.
|
||||
*
|
||||
* Requires:
|
||||
* 'zone' to be a valid initalised zone.
|
||||
* 'zone' to be a valid zone.
|
||||
* dns_zone_settype() not to have been called since the zone was
|
||||
* initalised.
|
||||
* created.
|
||||
* 'type' != dns_zone_none
|
||||
*/
|
||||
|
||||
@@ -107,7 +107,7 @@ dns_zone_setview(dns_zone_t *zone, dns_view_t *view);
|
||||
* Associate the zone with a view.
|
||||
*
|
||||
* Require:
|
||||
* 'zone' to be a valid initalised zone.
|
||||
* 'zone' to be a valid zone.
|
||||
*/
|
||||
|
||||
dns_view_t *
|
||||
@@ -116,7 +116,7 @@ dns_zone_getview(dns_zone_t *zone);
|
||||
* Returns the zone's associated view.
|
||||
*
|
||||
* Requires:
|
||||
* 'zone' to be a valid initalised zone.
|
||||
* 'zone' to be a valid zone.
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
@@ -125,7 +125,7 @@ dns_zone_setorigin(dns_zone_t *zone, dns_name_t *origin);
|
||||
* Sets the zones origin to 'origin'.
|
||||
*
|
||||
* Require:
|
||||
* 'zone' to be a valid initalised zone.
|
||||
* 'zone' to be a valid zone.
|
||||
* 'origin' to be non NULL.
|
||||
*
|
||||
* Returns:
|
||||
@@ -139,7 +139,7 @@ dns_zone_getorigin(dns_zone_t *zone);
|
||||
* Returns the value of the origin.
|
||||
*
|
||||
* Require:
|
||||
* 'zone' to be a valid initalised zone.
|
||||
* 'zone' to be a valid zone.
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
@@ -150,7 +150,7 @@ dns_zone_setdatabase(dns_zone_t *zone, const char *database);
|
||||
* file name of the MASTER file.
|
||||
*
|
||||
* Require:
|
||||
* 'zone' to be a valid initalised zone.
|
||||
* 'zone' to be a valid zone.
|
||||
* 'database' to be non NULL.
|
||||
*
|
||||
* Returns:
|
||||
@@ -166,7 +166,7 @@ dns_zone_load(dns_zone_t *zone);
|
||||
* met, otherwise DNS_R_BADZONE is return.
|
||||
*
|
||||
* Require:
|
||||
* 'zone' to be a valid initalised zone.
|
||||
* 'zone' to be a valid zone.
|
||||
*
|
||||
* Returns:
|
||||
* ISC_R_UNEXPECTED
|
||||
@@ -182,7 +182,7 @@ dns_zone_attach(dns_zone_t *source, dns_zone_t **target);
|
||||
* reference count.
|
||||
*
|
||||
* Require:
|
||||
* 'zone' to be a valid initalised zone.
|
||||
* 'zone' to be a valid zone.
|
||||
* 'target' to be non NULL and '*target' to be NULL.
|
||||
*/
|
||||
|
||||
@@ -194,7 +194,7 @@ dns_zone_detach(dns_zone_t **zonep);
|
||||
* shut down and eventually freed.
|
||||
*
|
||||
* Require:
|
||||
* 'zonep' to point to a valid initalised zone.
|
||||
* 'zonep' to point to a valid zone.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -207,7 +207,7 @@ dns_zone_iattach(dns_zone_t *source, dns_zone_t **target);
|
||||
*
|
||||
* Require:
|
||||
* The caller is running in the context of the zone's task.
|
||||
* 'zone' to be a valid initalised zone.
|
||||
* 'zone' to be a valid zone.
|
||||
* 'target' to be non NULL and '*target' to be NULL.
|
||||
*/
|
||||
|
||||
@@ -220,7 +220,7 @@ dns_zone_idetach(dns_zone_t **zonep);
|
||||
*
|
||||
* Require:
|
||||
* The caller is running in the context of the zone's task.
|
||||
* 'zonep' to point to a valid initalised zone.
|
||||
* 'zonep' to point to a valid zone.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -230,7 +230,7 @@ dns_zone_setflag(dns_zone_t *zone, unsigned int flags, isc_boolean_t value);
|
||||
* zone flags. Valid flag bits are DNS_ZONE_F_*.
|
||||
*
|
||||
* Requires
|
||||
* 'zone' to be a valid initalised zone.
|
||||
* 'zone' to be a valid zone.
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
@@ -240,7 +240,7 @@ dns_zone_adddbarg(dns_zone_t *zone, char *arg);
|
||||
* No attempt in made to validate the arguements.
|
||||
*
|
||||
* Require:
|
||||
* 'zone' to be a valid initalised zone.
|
||||
* 'zone' to be a valid zone.
|
||||
* 'arg' to be non NULL.
|
||||
*
|
||||
* Returns:
|
||||
@@ -254,7 +254,7 @@ dns_zone_cleardbargs(dns_zone_t *zone);
|
||||
* Clear all database arguements.
|
||||
*
|
||||
* Require:
|
||||
* 'zone' to be a valid initalised zone.
|
||||
* 'zone' to be a valid zone.
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
@@ -264,7 +264,7 @@ dns_zone_getdb(dns_zone_t *zone, dns_db_t **dbp);
|
||||
* return DNS_R_NOTLOADED.
|
||||
*
|
||||
* Require:
|
||||
* 'zone' to be a valid initalised zone.
|
||||
* 'zone' to be a valid zone.
|
||||
* 'dbp' to be != NULL && '*dbp' == NULL.
|
||||
*
|
||||
* Returns:
|
||||
@@ -279,7 +279,7 @@ dns_zone_setdbtype(dns_zone_t *zone, const char *db_type);
|
||||
* 'db_type' is not checked to see if it is a valid database type.
|
||||
*
|
||||
* Require:
|
||||
* 'zone' to be a valid initalised zone.
|
||||
* 'zone' to be a valid zone.
|
||||
* 'database' to be non NULL.
|
||||
*
|
||||
* Returns:
|
||||
@@ -295,7 +295,7 @@ dns_zone_expire(dns_zone_t *zone);
|
||||
* values and unload the zone.
|
||||
*
|
||||
* Require
|
||||
* 'zone' to be a valid initalised zone.
|
||||
* 'zone' to be a valid zone.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -305,7 +305,7 @@ dns_zone_refresh(dns_zone_t *zone);
|
||||
* managed.
|
||||
*
|
||||
* Require
|
||||
* 'zone' to be a valid initalised zone.
|
||||
* 'zone' to be a valid zone.
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
@@ -314,7 +314,7 @@ dns_zone_dump(dns_zone_t *zone);
|
||||
* Write the zone to database.
|
||||
*
|
||||
* Require:
|
||||
* 'zone' to be a valid initalised zone.
|
||||
* 'zone' to be a valid zone.
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
@@ -323,7 +323,7 @@ dns_zone_dumptostream(dns_zone_t *zone, FILE *fd);
|
||||
* Write the zone to stream 'fd'.
|
||||
*
|
||||
* Require:
|
||||
* 'zone' to be a valid initalised zone.
|
||||
* 'zone' to be a valid zone.
|
||||
* 'fd' to be a stream open for writing.
|
||||
*/
|
||||
|
||||
@@ -334,7 +334,7 @@ dns_zone_maintenance(dns_zone_t *zone);
|
||||
* result of a zone being managed.
|
||||
*
|
||||
* Require
|
||||
* 'zone' to be a valid initalised zone.
|
||||
* 'zone' to be a valid zone.
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
@@ -344,7 +344,7 @@ dns_zone_setmasters(dns_zone_t *zone, isc_sockaddr_t *masters,
|
||||
* Set the list of master servers for the zone.
|
||||
*
|
||||
* Require:
|
||||
* 'zone' to be a valid initalised zone.
|
||||
* 'zone' to be a valid zone.
|
||||
* 'masters' array of isc_sockaddr_t with port set or NULL.
|
||||
* 'count' the number of masters.
|
||||
*
|
||||
@@ -364,7 +364,7 @@ dns_zone_setalsonotify(dns_zone_t *zone, isc_sockaddr_t *notify,
|
||||
* and 'count = 0'.
|
||||
*
|
||||
* Require:
|
||||
* 'zone' to be a valid initalised zone.
|
||||
* 'zone' to be a valid zone.
|
||||
* 'notify' to be non NULL.
|
||||
* 'count' the number of notify.
|
||||
*
|
||||
@@ -375,17 +375,13 @@ dns_zone_setalsonotify(dns_zone_t *zone, isc_sockaddr_t *notify,
|
||||
* ISC_R_NOMEMORY
|
||||
*/
|
||||
|
||||
void
|
||||
dns_zone_unmount(dns_zone_t *zone);
|
||||
/* XXX MPA */
|
||||
|
||||
void
|
||||
dns_zone_unload(dns_zone_t *zone);
|
||||
/*
|
||||
* detach the database from the zone structure.
|
||||
*
|
||||
* Require:
|
||||
* 'zone' to be a valid initalised zone.
|
||||
* 'zone' to be a valid zone.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -395,7 +391,7 @@ dns_zone_setoption(dns_zone_t *zone, unsigned int option, isc_boolean_t value);
|
||||
* ISC_FALSE).
|
||||
*
|
||||
* Require:
|
||||
* 'zone' to be a valid initalised zone.
|
||||
* 'zone' to be a valid zone.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -405,7 +401,7 @@ dns_zone_clearoption(dns_zone_t *zone, unsigned int option);
|
||||
* to be used.
|
||||
*
|
||||
* Require:
|
||||
* 'zone' to be a valid initalised zone.
|
||||
* 'zone' to be a valid zone.
|
||||
*/
|
||||
|
||||
unsigned int
|
||||
@@ -414,7 +410,7 @@ dns_zone_getoptions(dns_zone_t *zone);
|
||||
* Return which options a set.
|
||||
*
|
||||
* Require:
|
||||
* 'zone' to be a valid initalised zone.
|
||||
* 'zone' to be a valid zone.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -425,7 +421,7 @@ dns_zone_setrefresh(dns_zone_t *zone, isc_uint32_t refresh,
|
||||
* result of loading the zone (dns_zone_load).
|
||||
*
|
||||
* Require:
|
||||
* 'zone' to be a valid initalised zone.
|
||||
* 'zone' to be a valid zone.
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
@@ -434,7 +430,7 @@ dns_zone_setxfrsource4(dns_zone_t *zone, isc_sockaddr_t *xfrsource);
|
||||
* Set the source address to be used in IPv4 zone transfers.
|
||||
*
|
||||
* Require:
|
||||
* 'zone' to be a valid initalised zone.
|
||||
* 'zone' to be a valid zone.
|
||||
* 'xfrsource' to contain the address.
|
||||
*
|
||||
* Returns:
|
||||
@@ -448,7 +444,7 @@ dns_zone_getxfrsource4(dns_zone_t *zone);
|
||||
* call, or the default of inaddr_any, port 0.
|
||||
*
|
||||
* Require:
|
||||
* 'zone' to be a valid initalised zone.
|
||||
* 'zone' to be a valid zone.
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
@@ -457,7 +453,7 @@ dns_zone_setxfrsource6(dns_zone_t *zone, isc_sockaddr_t *xfrsource);
|
||||
* Set the source address to be used in IPv6 zone transfers.
|
||||
*
|
||||
* Require:
|
||||
* 'zone' to be a valid initalised zone.
|
||||
* 'zone' to be a valid zone.
|
||||
* 'xfrsource' to contain the address.
|
||||
*
|
||||
* Returns:
|
||||
@@ -471,7 +467,7 @@ dns_zone_getxfrsource6(dns_zone_t *zone);
|
||||
* call, or the default of in6addr_any, port 0.
|
||||
*
|
||||
* Require:
|
||||
* 'zone' to be a valid initalised zone.
|
||||
* 'zone' to be a valid zone.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -480,8 +476,8 @@ dns_zone_setqueryacl(dns_zone_t *zone, dns_acl_t *acl);
|
||||
* Sets the query acl list for the zone.
|
||||
*
|
||||
* Require:
|
||||
* 'zone' to be initalised.
|
||||
* 'acl' to be initalised.
|
||||
* 'zone' to be a valid zone.
|
||||
* 'acl' to be a valid acl.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -490,8 +486,8 @@ dns_zone_setupdateacl(dns_zone_t *zone, dns_acl_t *acl);
|
||||
* Sets the update acl list for the zone.
|
||||
*
|
||||
* Require:
|
||||
* 'zone' to be initalised.
|
||||
* 'acl' to be initalised.
|
||||
* 'zone' to be a valid zone.
|
||||
* 'acl' to be valid acl.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -500,8 +496,8 @@ dns_zone_setxfracl(dns_zone_t *zone, dns_acl_t *acl);
|
||||
* Sets the transfer acl list for the zone.
|
||||
*
|
||||
* Require:
|
||||
* 'zone' to be initalised.
|
||||
* 'acl' to be initalised.
|
||||
* 'zone' to be a valid zone.
|
||||
* 'acl' to be valid acl.
|
||||
*/
|
||||
|
||||
dns_acl_t *
|
||||
@@ -510,7 +506,7 @@ dns_zone_getqueryacl(dns_zone_t *zone);
|
||||
* Returns the current query acl or NULL.
|
||||
*
|
||||
* Require:
|
||||
* 'zone' to be initalised.
|
||||
* 'zone' to be a valid zone.
|
||||
*
|
||||
* Returns:
|
||||
* acl a pointer to the acl.
|
||||
@@ -523,7 +519,7 @@ dns_zone_getupdateacl(dns_zone_t *zone);
|
||||
* Returns the current update acl or NULL.
|
||||
*
|
||||
* Require:
|
||||
* 'zone' to be initalised.
|
||||
* 'zone' to be a valid zone.
|
||||
*
|
||||
* Returns:
|
||||
* acl a pointer to the acl.
|
||||
@@ -536,7 +532,7 @@ dns_zone_getxfracl(dns_zone_t *zone);
|
||||
* Returns the current transfer acl or NULL.
|
||||
*
|
||||
* Require:
|
||||
* 'zone' to be initalised.
|
||||
* 'zone' to be a valid zone.
|
||||
*
|
||||
* Returns:
|
||||
* acl a pointer to the acl.
|
||||
@@ -549,7 +545,7 @@ dns_zone_clearupdateacl(dns_zone_t *zone);
|
||||
* Clear the current update acl.
|
||||
*
|
||||
* Require:
|
||||
* 'zone' to be initalised.
|
||||
* 'zone' to be a valid zone.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -558,7 +554,7 @@ dns_zone_clearqueryacl(dns_zone_t *zone);
|
||||
* Clear the current query acl.
|
||||
*
|
||||
* Require:
|
||||
* 'zone' to be initalised.
|
||||
* 'zone' to be a valid zone.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -567,7 +563,7 @@ dns_zone_clearxfracl(dns_zone_t *zone);
|
||||
* Clear the current transfer acl.
|
||||
*
|
||||
* Require:
|
||||
* 'zone' to be initalised.
|
||||
* 'zone' to be a valid zone.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -576,7 +572,7 @@ dns_zone_setchecknames(dns_zone_t *zone, dns_severity_t severity);
|
||||
* Set the severity of name checking when loading a zone.
|
||||
*
|
||||
* Require:
|
||||
* 'zone' to be initalised.
|
||||
* 'zone' to be a valid zone.
|
||||
*/
|
||||
|
||||
dns_severity_t
|
||||
@@ -585,7 +581,7 @@ dns_zone_getchecknames(dns_zone_t *zone);
|
||||
* Return the current severity of name checking.
|
||||
*
|
||||
* Require:
|
||||
* 'zone' to be initalised.
|
||||
* 'zone' to be a valid zone.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -594,7 +590,7 @@ dns_zone_setjournalsize(dns_zone_t *zone, isc_int32_t size);
|
||||
* Sets the journal size for the zone.
|
||||
*
|
||||
* Requires:
|
||||
* 'zone' to be initalised.
|
||||
* 'zone' to be a valid zone.
|
||||
*/
|
||||
|
||||
isc_int32_t
|
||||
@@ -604,7 +600,7 @@ dns_zone_getjournalsize(dns_zone_t *zone);
|
||||
* dns_zone_setjournalsize().
|
||||
*
|
||||
* Requires:
|
||||
* 'zone' to be initalised.
|
||||
* 'zone' to be a valid zone.
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
@@ -615,7 +611,7 @@ dns_zone_notifyreceive(dns_zone_t *zone, isc_sockaddr_t *from,
|
||||
* server. This may cause some zone maintainence activity to occur.
|
||||
*
|
||||
* Requires:
|
||||
* 'zone' to be initalised.
|
||||
* 'zone' to be a valid zone.
|
||||
* '*from' to contain the address of the server from which 'msg'
|
||||
* was recieved.
|
||||
* 'msg' a message with opcode NOTIFY and qr clear.
|
||||
@@ -679,7 +675,7 @@ dns_zone_setjournal(dns_zone_t *zone, const char *journal);
|
||||
* "database.jnl".
|
||||
*
|
||||
* Requires:
|
||||
* 'zone' to be initalised.
|
||||
* 'zone' to be a valid zone.
|
||||
* 'journal' to be non NULL.
|
||||
*
|
||||
* Returns:
|
||||
@@ -782,7 +778,8 @@ dns_zone_equal(dns_zone_t *oldzone, dns_zone_t *newzone);
|
||||
isc_uint32_t
|
||||
dns_zone_getidlein(dns_zone_t *zone);
|
||||
/*
|
||||
* Requires 'zone' to be valid.
|
||||
* Requires:
|
||||
* 'zone' to be a valid zone.
|
||||
*
|
||||
* Returns:
|
||||
* number of seconds of idle time before we abort the transfer in.
|
||||
@@ -794,13 +791,16 @@ dns_zone_setidlein(dns_zone_t *zone, isc_uint32_t idlein);
|
||||
* Set the idle timeout for transfer the.
|
||||
* Zero set the default value, 1 hour.
|
||||
*
|
||||
* Requires 'zone' to be valid.
|
||||
* Requires:
|
||||
* 'zone' to be a valid zone.
|
||||
*/
|
||||
|
||||
isc_uint32_t
|
||||
dns_zone_getidleout(dns_zone_t *zone);
|
||||
/*
|
||||
* Requires 'zone' to be valid.
|
||||
*
|
||||
* Requires:
|
||||
* 'zone' to be a valid zone.
|
||||
*
|
||||
* Returns:
|
||||
* number of seconds of idle time before we abort a transfer out.
|
||||
@@ -812,19 +812,26 @@ dns_zone_setidleout(dns_zone_t *zone, isc_uint32_t idleout);
|
||||
* Set the idle timeout for transfers out.
|
||||
* Zero set the default value, 1 hour.
|
||||
*
|
||||
* Requires 'zone' to be valid.
|
||||
* Requires:
|
||||
* 'zone' to be a valid zone.
|
||||
*/
|
||||
|
||||
void
|
||||
dns_zone_getssutable(dns_zone_t *zone, dns_ssutable_t **table);
|
||||
/*
|
||||
* Set the simple-secure-update policy table.
|
||||
*
|
||||
* Requires:
|
||||
* 'zone' to be a valid zone.
|
||||
*/
|
||||
|
||||
void
|
||||
dns_zone_setssutable(dns_zone_t *zone, dns_ssutable_t *table);
|
||||
/*
|
||||
* Get the simple-secure-update policy table.
|
||||
*
|
||||
* Requires:
|
||||
* 'zone' to be a valid zone.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -837,6 +844,9 @@ isc_mem_t *
|
||||
dns_zone_getmctx(dns_zone_t *zone);
|
||||
/*
|
||||
* Get the memory context of a zone.
|
||||
*
|
||||
* Requires:
|
||||
* 'zone' to be a valid zone.
|
||||
*/
|
||||
|
||||
dns_zonemgr_t *
|
||||
@@ -845,7 +855,7 @@ dns_zone_getmgr(dns_zone_t *zone);
|
||||
* If 'zone' is managed return the zone manager otherwise NULL.
|
||||
*
|
||||
* Requires:
|
||||
* 'zone' to be initalised.
|
||||
* 'zone' to be a valid zone.
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -854,12 +864,18 @@ dns_zone_setsigvalidityinterval(dns_zone_t *zone, isc_uint32_t interval);
|
||||
* Set the zone's SIG validity interval. This is the length of time
|
||||
* for which DNSSEC signatures created as a result of dynamic updates
|
||||
* to secure zones will remain valid, in seconds.
|
||||
*
|
||||
* Requires:
|
||||
* 'zone' to be a valid zone.
|
||||
*/
|
||||
|
||||
isc_uint32_t
|
||||
dns_zone_getsigvalidityinterval(dns_zone_t *zone);
|
||||
/*
|
||||
* Get the zone's SIG validity interval.
|
||||
*
|
||||
* Requires:
|
||||
* 'zone' to be a valid zone.
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
@@ -883,7 +899,7 @@ dns_zonemgr_managezone(dns_zonemgr_t *zmgr, dns_zone_t *zone);
|
||||
*
|
||||
* Require:
|
||||
* 'zmgr' to be a valid zone manager.
|
||||
* 'zone' to be a valid initalised zone.
|
||||
* 'zone' to be a valid zone.
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
@@ -896,13 +912,16 @@ dns_zonemgr_forcemaint(dns_zonemgr_t *zmgr);
|
||||
void
|
||||
dns_zonemgr_shutdown(dns_zonemgr_t *zmgr);
|
||||
/*
|
||||
* Shut down the zone manager.
|
||||
* Shut down the zone manager.
|
||||
*
|
||||
* Requires:
|
||||
* 'zmgr' to be a valid zone manager.
|
||||
*/
|
||||
|
||||
void
|
||||
dns_zonemgr_detach(dns_zonemgr_t **zmgrp);
|
||||
/*
|
||||
* Detach from a zone manager.
|
||||
* Detach from a zone manager.
|
||||
*
|
||||
* Requires:
|
||||
* '*zmgrp' is a valid, non-NULL zone manager pointer.
|
||||
@@ -913,18 +932,57 @@ dns_zonemgr_detach(dns_zonemgr_t **zmgrp);
|
||||
|
||||
void
|
||||
dns_zonemgr_releasezone(dns_zonemgr_t *zmgr, dns_zone_t *zone);
|
||||
/*
|
||||
* Release 'zone' from the managed by 'zmgr'. 'zmgr' is implicitly
|
||||
* detached from 'zone'.
|
||||
*
|
||||
* Requires:
|
||||
* 'zmgr' to be a valid zone manager.
|
||||
* 'zone' to be a valid zone.
|
||||
* 'zmgr' == 'zone->zmgr'
|
||||
*
|
||||
* Ensures:
|
||||
* 'zone->zmgr' == NULL;
|
||||
*/
|
||||
|
||||
void
|
||||
dns_zonemgr_lockconf(dns_zonemgr_t *zmgr, isc_rwlocktype_t type);
|
||||
/*
|
||||
* Lock the zone manager lock.
|
||||
* 'type' specifies if this is a read or write lock.
|
||||
*
|
||||
* Requires:
|
||||
* 'zmgr' to be a valid zone manager.
|
||||
*/
|
||||
|
||||
void
|
||||
dns_zonemgr_unlockconf(dns_zonemgr_t *zmgr, isc_rwlocktype_t type);
|
||||
/*
|
||||
* Unlock the zone manager lock. 'type' must be the same as the
|
||||
* preceeding call to dns_zonemgr_lockconf() for this 'zmgr'.
|
||||
*
|
||||
* Requires:
|
||||
* 'zmgr' to be a valid zone manager.
|
||||
*/
|
||||
|
||||
void
|
||||
dns_zonemgr_settransfersin(dns_zonemgr_t *zmgr, int value);
|
||||
/*
|
||||
* Set the maximum number of simultanious transfers in allowed by
|
||||
* the zone manager.
|
||||
*
|
||||
* Requires:
|
||||
* 'zmgr' to be a valid zone manager.
|
||||
*/
|
||||
|
||||
int
|
||||
dns_zonemgr_getttransfersin(dns_zonemgr_t *zmgr);
|
||||
/*
|
||||
* Return the the maximum number of simultanious transfers in allowed.
|
||||
*
|
||||
* Requires:
|
||||
* 'zmgr' to be a valid zone manager.
|
||||
*/
|
||||
|
||||
void
|
||||
dns_zonemgr_settransfersperns(dns_zonemgr_t *zmgr, int value);
|
||||
@@ -932,7 +990,7 @@ dns_zonemgr_settransfersperns(dns_zonemgr_t *zmgr, int value);
|
||||
* Set the number of zone transfers allowed per nameserver.
|
||||
*
|
||||
* Requires:
|
||||
* 'zmgr' to be initalised.
|
||||
* 'zmgr' to be a valid zone manager
|
||||
*/
|
||||
|
||||
int
|
||||
@@ -941,7 +999,7 @@ dns_zonemgr_getttransfersperns(dns_zonemgr_t *zmgr);
|
||||
* Return the number of transfers allowed per nameserver.
|
||||
*
|
||||
* Requires:
|
||||
* 'zmgr' to be initalised.
|
||||
* 'zmgr' to be a valid zone manager.
|
||||
*/
|
||||
|
||||
ISC_LANG_ENDDECLS
|
||||
|
193
lib/dns/zone.c
193
lib/dns/zone.c
@@ -15,7 +15,7 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: zone.c,v 1.144 2000/06/07 06:14:52 marka Exp $ */
|
||||
/* $Id: zone.c,v 1.145 2000/06/09 06:16:18 marka Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
#define ZONE_MAGIC 0x5a4f4e45U /* ZONE */
|
||||
#define NOTIFY_MAGIC 0x4e746679U /* Ntfy */
|
||||
#define STUB_MAGIC 0x53747562U /* Stub */
|
||||
#define ZONEMGR_MAGIC 0x5a6d6772U /* Zmgr */
|
||||
|
||||
#define DNS_ZONE_VALID(zone) \
|
||||
ISC_MAGIC_VALID(zone, ZONE_MAGIC)
|
||||
@@ -59,6 +60,8 @@
|
||||
ISC_MAGIC_VALID(notify, NOTIFY_MAGIC)
|
||||
#define DNS_STUB_VALID(stub) \
|
||||
ISC_MAGIC_VALID(stub, STUB_MAGIC)
|
||||
#define DNS_ZONEMGR_VALID(stub) \
|
||||
ISC_MAGIC_VALID(stub, ZONEMGR_MAGIC)
|
||||
|
||||
#define RANGE(a, b, c) (((a) < (b)) ? (b) : ((a) < (c) ? (a) : (c)))
|
||||
|
||||
@@ -158,28 +161,29 @@ struct dns_zone {
|
||||
|
||||
#define DNS_ZONE_FLAG(z,f) (((z)->flags & (f)) != 0)
|
||||
/* XXX MPA these may need to go back into zone.h */
|
||||
#define DNS_ZONE_F_REFRESH 0x00000001U /* refresh check in progress */
|
||||
#define DNS_ZONE_F_NEEDDUMP 0x00000002U /* zone need consolidation */
|
||||
#define DNS_ZONE_F_USEVC 0x00000004U /* use tcp for refresh query */
|
||||
/* #define DNS_ZONE_F_UNUSED 0x00000008U */ /* unused */
|
||||
/* #define DNS_ZONE_F_UNUSED 0x00000010U */ /* unused */
|
||||
#define DNS_ZONE_F_LOADED 0x00000020U /* database has loaded */
|
||||
#define DNS_ZONE_F_EXITING 0x00000040U /* zone is being destroyed */
|
||||
#define DNS_ZONE_F_EXPIRED 0x00000080U /* zone has expired */
|
||||
#define DNS_ZONE_F_NEEDREFRESH 0x00000100U /* refresh check needed */
|
||||
#define DNS_ZONE_F_UPTODATE 0x00000200U /* zone contents are
|
||||
#define DNS_ZONEFLG_REFRESH 0x00000001U /* refresh check in progress */
|
||||
#define DNS_ZONEFLG_NEEDDUMP 0x00000002U /* zone need consolidation */
|
||||
#define DNS_ZONEFLG_USEVC 0x00000004U /* use tcp for refresh query */
|
||||
/* #define DNS_ZONEFLG_UNUSED 0x00000008U */ /* unused */
|
||||
/* #define DNS_ZONEFLG_UNUSED 0x00000010U */ /* unused */
|
||||
#define DNS_ZONEFLG_LOADED 0x00000020U /* database has loaded */
|
||||
#define DNS_ZONEFLG_EXITING 0x00000040U /* zone is being destroyed */
|
||||
#define DNS_ZONEFLG_EXPIRED 0x00000080U /* zone has expired */
|
||||
#define DNS_ZONEFLG_NEEDREFRESH 0x00000100U /* refresh check needed */
|
||||
#define DNS_ZONEFLG_UPTODATE 0x00000200U /* zone contents are
|
||||
* uptodate */
|
||||
#define DNS_ZONE_F_NEEDNOTIFY 0x00000400U /* need to send out notify
|
||||
#define DNS_ZONEFLG_NEEDNOTIFY 0x00000400U /* need to send out notify
|
||||
* messages */
|
||||
#define DNS_ZONE_F_DIFFONRELOAD 0x00000800U /* generate a journal diff on
|
||||
#define DNS_ZONEFLG_DIFFONRELOAD 0x00000800U /* generate a journal diff on
|
||||
* reload */
|
||||
#define DNS_ZONE_F_NOMASTERS 0x00001000U /* an attempt to refresh a
|
||||
#define DNS_ZONEFLG_NOMASTERS 0x00001000U /* an attempt to refresh a
|
||||
* zone with no masters
|
||||
* occured */
|
||||
|
||||
#define DNS_ZONE_OPTION(z,o) (((z)->options & (o)) != 0)
|
||||
|
||||
struct dns_zonemgr {
|
||||
unsigned int magic;
|
||||
isc_mem_t * mctx;
|
||||
int refs;
|
||||
isc_taskmgr_t * taskmgr;
|
||||
@@ -702,7 +706,7 @@ dns_zone_load(dns_zone_t *zone) {
|
||||
"dns_journal_rollforward: %s",
|
||||
dns_result_totext(result));
|
||||
if (result == ISC_R_SUCCESS)
|
||||
zone->flags |= DNS_ZONE_F_NEEDDUMP;
|
||||
zone->flags |= DNS_ZONEFLG_NEEDDUMP;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -792,7 +796,7 @@ dns_zone_load(dns_zone_t *zone) {
|
||||
goto cleanup;
|
||||
} else {
|
||||
dns_db_attach(db, &zone->db);
|
||||
zone->flags |= DNS_ZONE_F_LOADED|DNS_ZONE_F_NEEDNOTIFY;
|
||||
zone->flags |= DNS_ZONEFLG_LOADED|DNS_ZONEFLG_NEEDNOTIFY;
|
||||
}
|
||||
result = ISC_R_SUCCESS;
|
||||
|
||||
@@ -805,11 +809,11 @@ dns_zone_load(dns_zone_t *zone) {
|
||||
|
||||
static void
|
||||
exit_check(dns_zone_t *zone) {
|
||||
if (DNS_ZONE_FLAG(zone, DNS_ZONE_F_EXITING) &&
|
||||
if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_EXITING) &&
|
||||
zone->irefs == 0)
|
||||
{
|
||||
/*
|
||||
* DNS_ZONE_F_EXITING can only be set if erefs == 0.
|
||||
* DNS_ZONEFLG_EXITING can only be set if erefs == 0.
|
||||
*/
|
||||
INSIST(zone->erefs == 0);
|
||||
zone_free(zone);
|
||||
@@ -1040,11 +1044,15 @@ dns_zone_print(dns_zone_t *zone) {
|
||||
|
||||
isc_mem_t *
|
||||
dns_zone_getmctx(dns_zone_t *zone) {
|
||||
REQUIRE(DNS_ZONE_VALID(zone));
|
||||
|
||||
return (zone->mctx);
|
||||
}
|
||||
|
||||
dns_zonemgr_t *
|
||||
dns_zone_getmgr(dns_zone_t *zone) {
|
||||
REQUIRE(DNS_ZONE_VALID(zone));
|
||||
|
||||
return (zone->zmgr);
|
||||
}
|
||||
|
||||
@@ -1262,7 +1270,7 @@ dns_zone_setmasters(dns_zone_t *zone, isc_sockaddr_t *masters,
|
||||
memcpy(new, masters, count * sizeof *new);
|
||||
zone->masters = new;
|
||||
zone->masterscnt = count;
|
||||
zone->flags &= ~DNS_ZONE_F_NOMASTERS;
|
||||
zone->flags &= ~DNS_ZONEFLG_NOMASTERS;
|
||||
|
||||
unlock:
|
||||
UNLOCK(&zone->lock);
|
||||
@@ -1308,7 +1316,7 @@ dns_zone_maintenance(dns_zone_t *zone) {
|
||||
case dns_zone_stub:
|
||||
LOCK(&zone->lock);
|
||||
if (now >= zone->expiretime &&
|
||||
DNS_ZONE_FLAG(zone, DNS_ZONE_F_LOADED)) {
|
||||
DNS_ZONE_FLAG(zone, DNS_ZONEFLG_LOADED)) {
|
||||
zone_expire(zone);
|
||||
zone->refreshtime = now;
|
||||
}
|
||||
@@ -1339,8 +1347,8 @@ dns_zone_maintenance(dns_zone_t *zone) {
|
||||
LOCK(&zone->lock);
|
||||
if (zone->dbname != NULL &&
|
||||
now >= zone->dumptime &&
|
||||
DNS_ZONE_FLAG(zone, DNS_ZONE_F_LOADED) &&
|
||||
DNS_ZONE_FLAG(zone, DNS_ZONE_F_NEEDDUMP)) {
|
||||
DNS_ZONE_FLAG(zone, DNS_ZONEFLG_LOADED) &&
|
||||
DNS_ZONE_FLAG(zone, DNS_ZONEFLG_NEEDDUMP)) {
|
||||
result = zone_dump(zone);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
zone_log(zone, "zone_dump", ISC_LOG_WARNING,
|
||||
@@ -1359,14 +1367,14 @@ dns_zone_maintenance(dns_zone_t *zone) {
|
||||
switch (zone->type) {
|
||||
case dns_zone_master:
|
||||
case dns_zone_slave:
|
||||
if (DNS_ZONE_FLAG(zone, DNS_ZONE_F_LOADED) &&
|
||||
DNS_ZONE_FLAG(zone, DNS_ZONE_F_NEEDNOTIFY)) {
|
||||
if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_LOADED) &&
|
||||
DNS_ZONE_FLAG(zone, DNS_ZONEFLG_NEEDNOTIFY)) {
|
||||
dns_zone_notify(zone);
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (!DNS_ZONE_FLAG(zone, DNS_ZONE_F_EXITING))
|
||||
if (!DNS_ZONE_FLAG(zone, DNS_ZONEFLG_EXITING))
|
||||
(void) zone_settimer(zone, now);
|
||||
}
|
||||
|
||||
@@ -1386,13 +1394,13 @@ zone_expire(dns_zone_t *zone) {
|
||||
/*
|
||||
* 'zone' locked by caller.
|
||||
*/
|
||||
if (DNS_ZONE_FLAG(zone, DNS_ZONE_F_NEEDDUMP)) {
|
||||
if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_NEEDDUMP)) {
|
||||
result = zone_dump(zone);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
zone_log(zone, "zone_dump", ISC_LOG_WARNING,
|
||||
"failure: %s", dns_result_totext(result));
|
||||
}
|
||||
zone->flags |= DNS_ZONE_F_EXPIRED;
|
||||
zone->flags |= DNS_ZONEFLG_EXPIRED;
|
||||
dns_zone_setrefresh(zone, DEFAULT_REFRESH, DEFAULT_RETRY);
|
||||
zone_unload(zone);
|
||||
}
|
||||
@@ -1404,29 +1412,29 @@ dns_zone_refresh(dns_zone_t *zone) {
|
||||
|
||||
REQUIRE(DNS_ZONE_VALID(zone));
|
||||
|
||||
if (DNS_ZONE_FLAG(zone, DNS_ZONE_F_EXITING))
|
||||
if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_EXITING))
|
||||
return;
|
||||
|
||||
isc_stdtime_get(&now);
|
||||
|
||||
/*
|
||||
* Set DNS_ZONE_F_REFRESH so that there is only one refresh operation
|
||||
* Set DNS_ZONEFLG_REFRESH so that there is only one refresh operation
|
||||
* in progress at a time.
|
||||
*/
|
||||
|
||||
LOCK(&zone->lock);
|
||||
oldflags = zone->flags;
|
||||
if (zone->masterscnt == 0) {
|
||||
zone->flags |= DNS_ZONE_F_NOMASTERS;
|
||||
if ((oldflags & DNS_ZONE_F_NOMASTERS) == 0)
|
||||
zone->flags |= DNS_ZONEFLG_NOMASTERS;
|
||||
if ((oldflags & DNS_ZONEFLG_NOMASTERS) == 0)
|
||||
zone_log(zone, "dns_zone_refresh", ISC_LOG_ERROR,
|
||||
"no masters");
|
||||
UNLOCK(&zone->lock);
|
||||
return;
|
||||
}
|
||||
zone->flags |= DNS_ZONE_F_REFRESH;
|
||||
zone->flags |= DNS_ZONEFLG_REFRESH;
|
||||
UNLOCK(&zone->lock);
|
||||
if ((oldflags & DNS_ZONE_F_REFRESH) != 0)
|
||||
if ((oldflags & DNS_ZONEFLG_REFRESH) != 0)
|
||||
return;
|
||||
|
||||
/*
|
||||
@@ -1502,7 +1510,7 @@ zone_dump(dns_zone_t *zone) {
|
||||
(void)remove(buf);
|
||||
result = ISC_R_UNEXPECTED;
|
||||
} else {
|
||||
zone->flags &= ~DNS_ZONE_F_NEEDDUMP;
|
||||
zone->flags &= ~DNS_ZONEFLG_NEEDDUMP;
|
||||
}
|
||||
} else
|
||||
(void)remove(buf);
|
||||
@@ -1541,14 +1549,7 @@ static void
|
||||
zone_unload(dns_zone_t *zone) {
|
||||
/* caller to lock */
|
||||
dns_db_detach(&zone->db);
|
||||
zone->flags &= ~DNS_ZONE_F_LOADED;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
dns_zone_unmount(dns_zone_t *zone) {
|
||||
REQUIRE(DNS_ZONE_VALID(zone));
|
||||
/*XXX MPA*/
|
||||
zone->flags &= ~DNS_ZONEFLG_LOADED;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1556,6 +1557,7 @@ dns_zone_setrefresh(dns_zone_t *zone, isc_uint32_t refresh,
|
||||
isc_uint32_t retry)
|
||||
{
|
||||
REQUIRE(DNS_ZONE_VALID(zone));
|
||||
|
||||
zone->refresh = refresh;
|
||||
zone->retry = retry;
|
||||
}
|
||||
@@ -1627,7 +1629,7 @@ notify_create(isc_mem_t *mctx, dns_notify_t **notifyp) {
|
||||
}
|
||||
|
||||
/*
|
||||
* XXXAG should check for DNS_ZONE_F_EXITING
|
||||
* XXXAG should check for DNS_ZONEFLG_EXITING
|
||||
*/
|
||||
static void
|
||||
process_adb_event(isc_task_t *task, isc_event_t *ev) {
|
||||
@@ -1740,7 +1742,7 @@ notify_send_toaddr(isc_task_t *task, isc_event_t *event) {
|
||||
LOCK(¬ify->zone->lock);
|
||||
dns_zone_iattach(notify->zone, &zone);
|
||||
if ((event->ev_attributes & ISC_EVENTATTR_CANCELED) != 0 ||
|
||||
DNS_ZONE_FLAG(notify->zone, DNS_ZONE_F_EXITING)) {
|
||||
DNS_ZONE_FLAG(notify->zone, DNS_ZONEFLG_EXITING)) {
|
||||
result = ISC_R_CANCELED;
|
||||
goto cleanup;
|
||||
}
|
||||
@@ -1839,10 +1841,10 @@ dns_zone_notify(dns_zone_t *zone) {
|
||||
REQUIRE(DNS_ZONE_VALID(zone));
|
||||
|
||||
LOCK(&zone->lock);
|
||||
zone->flags &= ~DNS_ZONE_F_NEEDNOTIFY;
|
||||
zone->flags &= ~DNS_ZONEFLG_NEEDNOTIFY;
|
||||
UNLOCK(&zone->lock);
|
||||
|
||||
if (!DNS_ZONE_OPTION(zone, DNS_ZONE_O_NOTIFY)) {
|
||||
if (!DNS_ZONE_OPTION(zone, DNS_ZONEOPT_NOTIFY)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2138,7 +2140,7 @@ stub_callback(isc_task_t *task, isc_event_t *event) {
|
||||
goto next_master;
|
||||
}
|
||||
LOCK(&zone->lock);
|
||||
zone->flags |= DNS_ZONE_F_USEVC;
|
||||
zone->flags |= DNS_ZONEFLG_USEVC;
|
||||
UNLOCK(&zone->lock);
|
||||
goto same_master;
|
||||
}
|
||||
@@ -2210,7 +2212,7 @@ stub_callback(isc_task_t *task, isc_event_t *event) {
|
||||
dns_request_destroy(&zone->request);
|
||||
zone->curmaster++;
|
||||
if (zone->curmaster >= zone->masterscnt) {
|
||||
zone->flags &= ~DNS_ZONE_F_REFRESH;
|
||||
zone->flags &= ~DNS_ZONEFLG_REFRESH;
|
||||
|
||||
zone_settimer(zone, now);
|
||||
UNLOCK(&zone->lock);
|
||||
@@ -2320,7 +2322,7 @@ refresh_callback(isc_task_t *task, isc_event_t *event) {
|
||||
goto next_master;
|
||||
}
|
||||
LOCK(&zone->lock);
|
||||
zone->flags |= DNS_ZONE_F_USEVC;
|
||||
zone->flags |= DNS_ZONEFLG_USEVC;
|
||||
UNLOCK(&zone->lock);
|
||||
goto same_master;
|
||||
}
|
||||
@@ -2407,7 +2409,7 @@ refresh_callback(isc_task_t *task, isc_event_t *event) {
|
||||
|
||||
zone_log(zone, me, ISC_LOG_DEBUG(1), "Serial: new %u, old %u",
|
||||
serial, zone->serial);
|
||||
if (!DNS_ZONE_FLAG(zone, DNS_ZONE_F_LOADED) ||
|
||||
if (!DNS_ZONE_FLAG(zone, DNS_ZONEFLG_LOADED) ||
|
||||
isc_serial_gt(serial, zone->serial)) {
|
||||
tcp_transfer:
|
||||
isc_event_free(&event);
|
||||
@@ -2450,9 +2452,9 @@ refresh_callback(isc_task_t *task, isc_event_t *event) {
|
||||
dns_request_destroy(&zone->request);
|
||||
zone->curmaster++;
|
||||
if (zone->curmaster >= zone->masterscnt) {
|
||||
zone->flags &= ~DNS_ZONE_F_REFRESH;
|
||||
if (DNS_ZONE_FLAG(zone, DNS_ZONE_F_NEEDREFRESH)) {
|
||||
zone->flags &= ~DNS_ZONE_F_NEEDREFRESH;
|
||||
zone->flags &= ~DNS_ZONEFLG_REFRESH;
|
||||
if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_NEEDREFRESH)) {
|
||||
zone->flags &= ~DNS_ZONEFLG_NEEDREFRESH;
|
||||
zone->refreshtime = now;
|
||||
}
|
||||
zone_settimer(zone, now);
|
||||
@@ -2483,7 +2485,7 @@ queue_soa_query(dns_zone_t *zone) {
|
||||
|
||||
DNS_ENTER;
|
||||
|
||||
if (DNS_ZONE_FLAG(zone, DNS_ZONE_F_EXITING)) {
|
||||
if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_EXITING)) {
|
||||
cancel_refresh(zone);
|
||||
return;
|
||||
}
|
||||
@@ -2578,8 +2580,8 @@ soa_query(isc_task_t *task, isc_event_t *event) {
|
||||
DNS_ENTER;
|
||||
|
||||
if (((event->ev_attributes & ISC_EVENTATTR_CANCELED) != 0) ||
|
||||
DNS_ZONE_FLAG(zone, DNS_ZONE_F_EXITING)) {
|
||||
if (!DNS_ZONE_FLAG(zone, DNS_ZONE_F_EXITING))
|
||||
DNS_ZONE_FLAG(zone, DNS_ZONEFLG_EXITING)) {
|
||||
if (!DNS_ZONE_FLAG(zone, DNS_ZONEFLG_EXITING))
|
||||
cancel_refresh(zone);
|
||||
isc_event_free(&event);
|
||||
dns_zone_idetach(&zone);
|
||||
@@ -2612,7 +2614,7 @@ soa_query(isc_task_t *task, isc_event_t *event) {
|
||||
zone->view->dynamickeys);
|
||||
}
|
||||
|
||||
options = DNS_ZONE_FLAG(zone, DNS_ZONE_F_USEVC) ?
|
||||
options = DNS_ZONE_FLAG(zone, DNS_ZONEFLG_USEVC) ?
|
||||
DNS_REQUESTOPT_TCP : 0;
|
||||
result = dns_request_create(zone->view->requestmgr, message,
|
||||
&zone->masteraddr, options, key,
|
||||
@@ -2790,7 +2792,7 @@ zone_shutdown(isc_task_t *task, isc_event_t *event) {
|
||||
INSIST(zone->erefs == 0);
|
||||
zone_log(zone, "zone_shutdown", ISC_LOG_DEBUG(3), "shutting down");
|
||||
LOCK(&zone->lock);
|
||||
zone->flags |= DNS_ZONE_F_EXITING;
|
||||
zone->flags |= DNS_ZONEFLG_EXITING;
|
||||
UNLOCK(&zone->lock);
|
||||
|
||||
/*
|
||||
@@ -2860,22 +2862,22 @@ zone_settimer(dns_zone_t *zone, isc_stdtime_t now) {
|
||||
|
||||
switch (zone->type) {
|
||||
case dns_zone_master:
|
||||
if (DNS_ZONE_FLAG(zone, DNS_ZONE_F_NEEDNOTIFY))
|
||||
if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_NEEDNOTIFY))
|
||||
next = now;
|
||||
if (DNS_ZONE_FLAG(zone, DNS_ZONE_F_NEEDDUMP) &&
|
||||
if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_NEEDDUMP) &&
|
||||
(zone->dumptime < next || next == 0))
|
||||
next = zone->dumptime;
|
||||
break;
|
||||
case dns_zone_slave:
|
||||
if (DNS_ZONE_FLAG(zone, DNS_ZONE_F_NEEDNOTIFY))
|
||||
if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_NEEDNOTIFY))
|
||||
next = now;
|
||||
/*FALLTHROUGH*/
|
||||
case dns_zone_stub:
|
||||
if (!DNS_ZONE_FLAG(zone, DNS_ZONE_F_REFRESH) &&
|
||||
!DNS_ZONE_FLAG(zone, DNS_ZONE_F_NOMASTERS) &&
|
||||
if (!DNS_ZONE_FLAG(zone, DNS_ZONEFLG_REFRESH) &&
|
||||
!DNS_ZONE_FLAG(zone, DNS_ZONEFLG_NOMASTERS) &&
|
||||
(zone->refreshtime < next || next == 0))
|
||||
next = zone->refreshtime;
|
||||
if (DNS_ZONE_FLAG(zone, DNS_ZONE_F_LOADED)) {
|
||||
if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_LOADED)) {
|
||||
if (zone->expiretime < next || next == 0)
|
||||
next = zone->expiretime;
|
||||
}
|
||||
@@ -2917,9 +2919,9 @@ cancel_refresh(dns_zone_t *zone) {
|
||||
|
||||
DNS_ENTER;
|
||||
|
||||
zone->flags &= ~DNS_ZONE_F_REFRESH;
|
||||
zone->flags &= ~DNS_ZONEFLG_REFRESH;
|
||||
isc_stdtime_get(&now);
|
||||
if (!DNS_ZONE_FLAG(zone, DNS_ZONE_F_EXITING))
|
||||
if (!DNS_ZONE_FLAG(zone, DNS_ZONEFLG_EXITING))
|
||||
zone_settimer(zone, now);
|
||||
}
|
||||
|
||||
@@ -2978,7 +2980,7 @@ notify_createmessage(dns_zone_t *zone, dns_message_t **messagep)
|
||||
* If the zone is dialup we are done as we don't want to send
|
||||
* the current soa so as to force a refresh query.
|
||||
*/
|
||||
if (DNS_ZONE_OPTION(zone, DNS_ZONE_O_DIALUP))
|
||||
if (DNS_ZONE_OPTION(zone, DNS_ZONEOPT_DIALUP))
|
||||
goto done;
|
||||
|
||||
result = dns_message_gettempname(message, &tempname);
|
||||
@@ -3149,8 +3151,8 @@ dns_zone_notifyreceive(dns_zone_t *zone, isc_sockaddr_t *from,
|
||||
* to trigger a refresh check.
|
||||
*/
|
||||
if (msg->counts[DNS_SECTION_ANSWER] > 0 &&
|
||||
DNS_ZONE_FLAG(zone, DNS_ZONE_F_LOADED) &&
|
||||
!DNS_ZONE_OPTION(zone, DNS_ZONE_O_DIALUP)) {
|
||||
DNS_ZONE_FLAG(zone, DNS_ZONEFLG_LOADED) &&
|
||||
!DNS_ZONE_OPTION(zone, DNS_ZONEOPT_DIALUP)) {
|
||||
result = dns_message_findname(msg, DNS_SECTION_ANSWER,
|
||||
&zone->origin,
|
||||
dns_rdatatype_soa,
|
||||
@@ -3180,8 +3182,8 @@ dns_zone_notifyreceive(dns_zone_t *zone, isc_sockaddr_t *from,
|
||||
* let it complete. Record where we got the notify from so we
|
||||
* can perform a refresh check when the current one completes
|
||||
*/
|
||||
if (DNS_ZONE_FLAG(zone, DNS_ZONE_F_REFRESH)) {
|
||||
zone->flags |= DNS_ZONE_F_NEEDREFRESH;
|
||||
if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_REFRESH)) {
|
||||
zone->flags |= DNS_ZONEFLG_NEEDREFRESH;
|
||||
zone->notifyfrom = *from;
|
||||
UNLOCK(&zone->lock);
|
||||
zone_log(zone, me, ISC_LOG_DEBUG(3),
|
||||
@@ -3651,7 +3653,7 @@ zone_replacedb(dns_zone_t *zone, dns_db_t *db, isc_boolean_t dump) {
|
||||
if (zone->db != NULL)
|
||||
dns_db_detach(&zone->db);
|
||||
dns_db_attach(db, &zone->db);
|
||||
zone->flags |= DNS_ZONE_F_LOADED|DNS_ZONE_F_NEEDNOTIFY;
|
||||
zone->flags |= DNS_ZONEFLG_LOADED|DNS_ZONEFLG_NEEDNOTIFY;
|
||||
return (ISC_R_SUCCESS);
|
||||
|
||||
fail:
|
||||
@@ -3673,13 +3675,13 @@ zone_xfrdone(dns_zone_t *zone, isc_result_t result) {
|
||||
zone_log(zone, me, ISC_LOG_DEBUG(1), "%s", dns_result_totext(result));
|
||||
|
||||
LOCK(&zone->lock);
|
||||
INSIST((zone->flags & DNS_ZONE_F_REFRESH) != 0);
|
||||
zone->flags &= ~DNS_ZONE_F_REFRESH;
|
||||
INSIST((zone->flags & DNS_ZONEFLG_REFRESH) != 0);
|
||||
zone->flags &= ~DNS_ZONEFLG_REFRESH;
|
||||
|
||||
isc_stdtime_get(&now);
|
||||
switch (result) {
|
||||
case ISC_R_SUCCESS:
|
||||
zone->flags |= DNS_ZONE_F_NEEDNOTIFY;
|
||||
zone->flags |= DNS_ZONEFLG_NEEDNOTIFY;
|
||||
/*FALLTHROUGH*/
|
||||
case DNS_R_UPTODATE:
|
||||
/*
|
||||
@@ -3730,8 +3732,8 @@ zone_xfrdone(dns_zone_t *zone, isc_result_t result) {
|
||||
/*
|
||||
* Set our next update/expire times.
|
||||
*/
|
||||
if (DNS_ZONE_FLAG(zone, DNS_ZONE_F_NEEDREFRESH)) {
|
||||
zone->flags &= ~DNS_ZONE_F_NEEDREFRESH;
|
||||
if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_NEEDREFRESH)) {
|
||||
zone->flags &= ~DNS_ZONEFLG_NEEDREFRESH;
|
||||
zone->refreshtime = now;
|
||||
zone->expiretime = now + zone->expire;
|
||||
} else {
|
||||
@@ -3746,7 +3748,7 @@ zone_xfrdone(dns_zone_t *zone, isc_result_t result) {
|
||||
if (zone->curmaster >= zone->masterscnt)
|
||||
zone->curmaster = 0;
|
||||
else {
|
||||
zone->flags |= DNS_ZONE_F_REFRESH;
|
||||
zone->flags |= DNS_ZONEFLG_REFRESH;
|
||||
again = ISC_TRUE;
|
||||
}
|
||||
break;
|
||||
@@ -3771,14 +3773,14 @@ zone_xfrdone(dns_zone_t *zone, isc_result_t result) {
|
||||
RWLOCK(&zone->zmgr->rwlock, isc_rwlocktype_write);
|
||||
ISC_LIST_UNLINK(zone->zmgr->xfrin_in_progress, zone, statelink);
|
||||
zone->statelist = NULL;
|
||||
if (!DNS_ZONE_FLAG(zone, DNS_ZONE_F_EXITING))
|
||||
if (!DNS_ZONE_FLAG(zone, DNS_ZONEFLG_EXITING))
|
||||
zmgr_resume_xfrs(zone->zmgr);
|
||||
RWUNLOCK(&zone->zmgr->rwlock, isc_rwlocktype_write);
|
||||
|
||||
/*
|
||||
* Retry with a different server if necessary.
|
||||
*/
|
||||
if (again && !DNS_ZONE_FLAG(zone, DNS_ZONE_F_EXITING))
|
||||
if (again && !DNS_ZONE_FLAG(zone, DNS_ZONEFLG_EXITING))
|
||||
queue_soa_query(zone);
|
||||
}
|
||||
|
||||
@@ -3858,7 +3860,7 @@ got_transfer_quota(isc_task_t *task, isc_event_t *event) {
|
||||
|
||||
INSIST(task == zone->task);
|
||||
|
||||
if (DNS_ZONE_FLAG(zone, DNS_ZONE_F_EXITING)) {
|
||||
if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_EXITING)) {
|
||||
result = ISC_R_CANCELED;
|
||||
goto cleanup;
|
||||
}
|
||||
@@ -4006,6 +4008,7 @@ dns_zonemgr_create(isc_mem_t *mctx, isc_taskmgr_t *taskmgr,
|
||||
result = isc_ratelimiter_setinterval(zmgr->rl, &interval);
|
||||
RUNTIME_CHECK(result == ISC_R_SUCCESS);
|
||||
isc_ratelimiter_setpertic(zmgr->rl, 10);
|
||||
zmgr->magic = ZONEMGR_MAGIC;
|
||||
|
||||
*zmgrp = zmgr;
|
||||
return (ISC_R_SUCCESS);
|
||||
@@ -4029,6 +4032,7 @@ dns_zonemgr_managezone(dns_zonemgr_t *zmgr, dns_zone_t *zone) {
|
||||
isc_result_t result;
|
||||
|
||||
REQUIRE(DNS_ZONE_VALID(zone));
|
||||
REQUIRE(DNS_ZONEMGR_VALID(zmgr));
|
||||
|
||||
RWLOCK(&zmgr->rwlock, isc_rwlocktype_write);
|
||||
LOCK(&zone->lock);
|
||||
@@ -4075,6 +4079,8 @@ dns_zonemgr_releasezone(dns_zonemgr_t *zmgr, dns_zone_t *zone) {
|
||||
isc_boolean_t free_now = ISC_FALSE;
|
||||
|
||||
REQUIRE(DNS_ZONE_VALID(zone));
|
||||
REQUIRE(DNS_ZONEMGR_VALID(zmgr));
|
||||
REQUIRE(zone->zmgr == zmgr);
|
||||
|
||||
RWLOCK(&zmgr->rwlock, isc_rwlocktype_write);
|
||||
LOCK(&zone->lock);
|
||||
@@ -4090,13 +4096,18 @@ dns_zonemgr_releasezone(dns_zonemgr_t *zmgr, dns_zone_t *zone) {
|
||||
|
||||
if (free_now)
|
||||
zonemgr_free(zmgr);
|
||||
ENSURE(zone->zmgr == NULL);
|
||||
}
|
||||
|
||||
void
|
||||
dns_zonemgr_detach(dns_zonemgr_t **zmgrp) {
|
||||
dns_zonemgr_t *zmgr = *zmgrp;
|
||||
dns_zonemgr_t *zmgr;
|
||||
isc_boolean_t free_now = ISC_FALSE;
|
||||
|
||||
REQUIRE(zmgrp != NULL);
|
||||
zmgr = *zmgrp;
|
||||
REQUIRE(DNS_ZONEMGR_VALID(zmgr));
|
||||
|
||||
RWLOCK(&zmgr->rwlock, isc_rwlocktype_write);
|
||||
zmgr->refs--;
|
||||
if (zmgr->refs == 0)
|
||||
@@ -4111,6 +4122,8 @@ isc_result_t
|
||||
dns_zonemgr_forcemaint(dns_zonemgr_t *zmgr) {
|
||||
dns_zone_t *p;
|
||||
|
||||
REQUIRE(DNS_ZONEMGR_VALID(zmgr));
|
||||
|
||||
RWLOCK(&zmgr->rwlock, isc_rwlocktype_read);
|
||||
for (p = ISC_LIST_HEAD(zmgr->zones);
|
||||
p != NULL;
|
||||
@@ -4124,6 +4137,8 @@ dns_zonemgr_forcemaint(dns_zonemgr_t *zmgr) {
|
||||
|
||||
void
|
||||
dns_zonemgr_shutdown(dns_zonemgr_t *zmgr) {
|
||||
REQUIRE(DNS_ZONEMGR_VALID(zmgr));
|
||||
|
||||
isc_ratelimiter_shutdown(zmgr->rl);
|
||||
}
|
||||
|
||||
@@ -4134,6 +4149,8 @@ zonemgr_free(dns_zonemgr_t *zmgr) {
|
||||
INSIST(zmgr->refs == 0);
|
||||
INSIST(ISC_LIST_EMPTY(zmgr->zones));
|
||||
|
||||
zmgr->magic = 0;
|
||||
|
||||
if (zmgr->task != NULL)
|
||||
isc_task_destroy(&zmgr->task);
|
||||
if (zmgr->zonetasks != NULL)
|
||||
@@ -4150,31 +4167,43 @@ zonemgr_free(dns_zonemgr_t *zmgr) {
|
||||
|
||||
void
|
||||
dns_zonemgr_lockconf(dns_zonemgr_t *zmgr, isc_rwlocktype_t type) {
|
||||
REQUIRE(DNS_ZONEMGR_VALID(zmgr));
|
||||
|
||||
RWLOCK(&zmgr->conflock, type);
|
||||
}
|
||||
|
||||
void
|
||||
dns_zonemgr_unlockconf(dns_zonemgr_t *zmgr, isc_rwlocktype_t type) {
|
||||
REQUIRE(DNS_ZONEMGR_VALID(zmgr));
|
||||
|
||||
RWUNLOCK(&zmgr->conflock, type);
|
||||
}
|
||||
|
||||
void
|
||||
dns_zonemgr_settransfersin(dns_zonemgr_t *zmgr, int value) {
|
||||
REQUIRE(DNS_ZONEMGR_VALID(zmgr));
|
||||
|
||||
zmgr->transfersin = value;
|
||||
}
|
||||
|
||||
int
|
||||
dns_zonemgr_getttransfersin(dns_zonemgr_t *zmgr) {
|
||||
REQUIRE(DNS_ZONEMGR_VALID(zmgr));
|
||||
|
||||
return (zmgr->transfersin);
|
||||
}
|
||||
|
||||
void
|
||||
dns_zonemgr_settransfersperns(dns_zonemgr_t *zmgr, int value) {
|
||||
REQUIRE(DNS_ZONEMGR_VALID(zmgr));
|
||||
|
||||
zmgr->transfersperns = value;
|
||||
}
|
||||
|
||||
int
|
||||
dns_zonemgr_getttransfersperns(dns_zonemgr_t *zmgr) {
|
||||
REQUIRE(DNS_ZONEMGR_VALID(zmgr));
|
||||
|
||||
return (zmgr->transfersperns);
|
||||
}
|
||||
|
||||
|
@@ -164,7 +164,7 @@ dns_zone_configure(dns_c_ctx_t *cctx, dns_c_view_t *cview,
|
||||
result = dns_c_ctx_getdialup(cctx, &boolean);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
boolean = ISC_FALSE;
|
||||
dns_zone_setoption(zone, DNS_ZONE_O_DIALUP, boolean);
|
||||
dns_zone_setoption(zone, DNS_ZONEOPT_DIALUP, boolean);
|
||||
|
||||
/*
|
||||
* Configure master functionality. This applies
|
||||
@@ -179,7 +179,7 @@ dns_zone_configure(dns_c_ctx_t *cctx, dns_c_view_t *cview,
|
||||
result = dns_c_ctx_getnotify(cctx, &boolean);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
boolean = ISC_TRUE;
|
||||
dns_zone_setoption(zone, DNS_ZONE_O_NOTIFY, boolean);
|
||||
dns_zone_setoption(zone, DNS_ZONEOPT_NOTIFY, boolean);
|
||||
|
||||
iplist = NULL;
|
||||
result = dns_c_zone_getalsonotify(czone, &iplist);
|
||||
|
Reference in New Issue
Block a user