Introduce the `dns_zone_isexpired()` API which returns `true` when a
secondary, mirror, etc. zone is expired.
This internally use the `DNS_ZONEFLG_EXPIRED` which was already set when
the zone gets expired, but never used.
The flag `DNS_ZONEFLG_EXPIRED` is also now cleared when the expiration
time of the zone is updated and in the future.
* \li 'zone' to be a valid zone.
*/
+bool
+dns_zone_isexpired(dns_zone_t *zone);
+/*%<
+ * Return true if a (secondary, mirror, etc.) zone is expired
+ *
+ * Requires:
+ * \li 'zone\ to be a valid zone.
+ */
+
#if DNS_ZONE_TRACE
#define dns_zone_ref(ptr) dns_zone__ref(ptr, __func__, __FILE__, __LINE__)
#define dns_zone_unref(ptr) dns_zone__unref(ptr, __func__, __FILE__, __LINE__)
isc_time_compare(&expiretime, &zone->expiretime) > 0)
{
zone->expiretime = expiretime;
+ DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_EXPIRED);
}
/*
return zone->cfg;
}
+
+bool
+dns_zone_isexpired(dns_zone_t *zone) {
+ REQUIRE(DNS_ZONE_VALID(zone));
+
+ return DNS_ZONE_FLAG(zone, DNS_ZONEFLG_EXPIRED);
+}