}
TRY0(xmlTextWriterEndElement(writer)); /* serial */
+ /*
+ * Export zone timers to the statistics channel in XML format. For
+ * master zones, only include the loaded time. For slave zones, also
+ * include the expires and refresh times.
+ */
+ isc_time_t timestamp;
+
+ result = dns_zone_getloadtime(zone, ×tamp);
+ if (result != ISC_R_SUCCESS) {
+ goto error;
+ }
+
+ isc_time_formatISO8601(×tamp, buf, 64);
+ TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "loaded"));
+ TRY0(xmlTextWriterWriteString(writer, ISC_XMLCHAR buf));
+ TRY0(xmlTextWriterEndElement(writer));
+
+ if (dns_zone_gettype(zone) == dns_zone_slave) {
+ result = dns_zone_getexpiretime(zone, ×tamp);
+ if (result != ISC_R_SUCCESS) {
+ goto error;
+ }
+ isc_time_formatISO8601(×tamp, buf, 64);
+ TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "expires"));
+ TRY0(xmlTextWriterWriteString(writer, ISC_XMLCHAR buf));
+ TRY0(xmlTextWriterEndElement(writer));
+
+ result = dns_zone_getrefreshtime(zone, ×tamp);
+ if (result != ISC_R_SUCCESS) {
+ goto error;
+ }
+ isc_time_formatISO8601(×tamp, buf, 64);
+ TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "refresh"));
+ TRY0(xmlTextWriterWriteString(writer, ISC_XMLCHAR buf));
+ TRY0(xmlTextWriterEndElement(writer));
+ }
+
if (statlevel == dns_zonestat_full) {
isc_stats_t *zonestats;
isc_stats_t *gluecachestats;
return (ISC_R_NOMEMORY);
}
+ /*
+ * Export zone timers to the statistics channel in JSON format. For
+ * master zones, only include the loaded time. For slave zones, also
+ * include the expires and refresh times.
+ */
+
+ isc_time_t timestamp;
+
+ result = dns_zone_getloadtime(zone, ×tamp);
+ if (result != ISC_R_SUCCESS) {
+ goto error;
+ }
+
+ isc_time_formatISO8601(×tamp, buf, 64);
+ json_object_object_add(zoneobj, "loaded", json_object_new_string(buf));
+
+ if (dns_zone_gettype(zone) == dns_zone_slave) {
+ result = dns_zone_getexpiretime(zone, ×tamp);
+ if (result != ISC_R_SUCCESS) {
+ goto error;
+ }
+ isc_time_formatISO8601(×tamp, buf, 64);
+ json_object_object_add(zoneobj, "expires",
+ json_object_new_string(buf));
+
+ result = dns_zone_getrefreshtime(zone, ×tamp);
+ if (result != ISC_R_SUCCESS) {
+ goto error;
+ }
+ isc_time_formatISO8601(×tamp, buf, 64);
+ json_object_object_add(zoneobj, "refresh",
+ json_object_new_string(buf));
+ }
+
if (statlevel == dns_zonestat_full) {
isc_stats_t *zonestats;
isc_stats_t *gluecachestats;