Add new "mirror" slave zone option

Add a new slave-only boolean configuration option, "mirror", along with
its corresponding dns_zoneopt_t enum and a helper function for checking
whether that option was set for a given zone.  This commit does not
introduce any behavior changes yet.
This commit is contained in:
Michał Kępień 2018-06-28 13:38:39 +02:00
parent be38c1f041
commit 49201f10cb
4 changed files with 26 additions and 1 deletions

View file

@ -1724,6 +1724,13 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
}
dns_zone_setoption(mayberaw, DNS_ZONEOPT_MULTIMASTER, multi);
obj = NULL;
(void)cfg_map_get(zoptions, "mirror", &obj);
if (obj != NULL) {
dns_zone_setoption(mayberaw, DNS_ZONEOPT_MIRROR,
cfg_obj_asboolean(obj));
}
obj = NULL;
result = named_config_get(maps, "max-transfer-time-in", &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);

View file

@ -79,8 +79,10 @@ typedef enum {
DNS_ZONEOPT_CHECKDUPRRFAIL = 1<<26, /*%< fatal check-dup-records failures */
DNS_ZONEOPT_CHECKSPF = 1<<27, /*%< check SPF records */
DNS_ZONEOPT_CHECKTTL = 1<<28, /*%< check max-zone-ttl */
DNS_ZONEOPT_AUTOEMPTY = 1<<29 /*%< automatic empty zone */
DNS_ZONEOPT_AUTOEMPTY = 1<<29, /*%< automatic empty zone */
DNS_ZONEOPT_MIRROR = 1<<30, /*%< mirror zone */
} dns_zoneopt_t;
/*
* Zone key maintenance options
*/
@ -2478,4 +2480,10 @@ dns_zone_getgluecachestats(dns_zone_t *zone);
* otherwise NULL.
*/
isc_boolean_t
dns_zone_ismirror(const dns_zone_t *zone);
/*%<
* Return ISC_TRUE if 'zone' is a mirror zone, return ISC_FALSE otherwise.
*/
#endif /* DNS_ZONE_H */

View file

@ -19323,3 +19323,10 @@ dns_zone_getgluecachestats(dns_zone_t *zone) {
return (zone->gluecachestats);
}
isc_boolean_t
dns_zone_ismirror(const dns_zone_t *zone) {
REQUIRE(DNS_ZONE_VALID(zone));
return (DNS_ZONE_OPTION(zone, DNS_ZONEOPT_MIRROR));
}

View file

@ -2147,6 +2147,9 @@ zone_clauses[] = {
{ "min-retry-time", &cfg_type_uint32,
CFG_ZONE_SLAVE | CFG_ZONE_STUB
},
{ "mirror", &cfg_type_boolean,
CFG_ZONE_SLAVE
},
{ "multi-master", &cfg_type_boolean,
CFG_ZONE_SLAVE | CFG_ZONE_STUB
},