Introduce zone functions dns_zone_(get|set)modded

Introduce new functions to set and get whether the zone configuration
has been modified with 'rndc modzone'.
This commit is contained in:
Matthijs Mekking 2026-03-24 17:01:26 +01:00
parent 13414c640b
commit e1bd1a4003
2 changed files with 40 additions and 0 deletions

View file

@ -2243,6 +2243,26 @@ dns_zone_getadded(dns_zone_t *zone);
* \li 'zone' to be valid.
*/
void
dns_zone_setmodded(dns_zone_t *zone, bool added);
/*%
* Sets the value of zone->modded, which should be true for
* zones that were modified by "rndc modzone".
*
* Requires:
* \li 'zone' to be valid.
*/
bool
dns_zone_getmodded(dns_zone_t *zone);
/*%
* Returns true if the zone was modified at runtime
* using "rndc modzone".
*
* Requires:
* \li 'zone' to be valid.
*/
void
dns_zone_setautomatic(dns_zone_t *zone, bool automatic);
/*%

View file

@ -422,6 +422,11 @@ struct dns_zone {
*/
bool added;
/*%
* True if modded by "rndc modzone"
*/
bool modded;
/*%
* True if added by automatically by named.
*/
@ -22636,6 +22641,21 @@ dns_zone_getadded(dns_zone_t *zone) {
return zone->added;
}
void
dns_zone_setmodded(dns_zone_t *zone, bool modded) {
REQUIRE(DNS_ZONE_VALID(zone));
LOCK_ZONE(zone);
zone->modded = modded;
UNLOCK_ZONE(zone);
}
bool
dns_zone_getmodded(dns_zone_t *zone) {
REQUIRE(DNS_ZONE_VALID(zone));
return zone->modded;
}
isc_result_t
dns_zone_dlzpostload(dns_zone_t *zone, dns_db_t *db) {
isc_time_t loadtime;