unsigned int magic; /* XXX ? */
dns_rdatasetmethods_t * methods;
ISC_LINK(dns_rdataset_t) link;
+
/*
* XXX do we need these, or should they be retrieved by methods?
* Leaning towards the latter, since they are not frequently required
dns_rdataclass_t rdclass;
dns_rdatatype_t type;
dns_ttl_t ttl;
+ /*
+ * Stale ttl is used to see how long this RRset can still be used
+ * to serve to clients, after the TTL has expired.
+ */
+ dns_ttl_t stale_ttl;
dns_trust_t trust;
dns_rdatatype_t covers;
+
/*
* attributes
*/
unsigned int attributes;
+
/*%
* the counter provides the starting point in the "cyclic" order.
* The value UINT32_MAX has a special meaning of "picking up a
* increment the counter.
*/
uint32_t count;
+
/*
* This RRSIG RRset should be re-generated around this time.
* Only valid if DNS_RDATASETATTR_RESIGN is set in attributes.
*/
isc_stdtime_t resign;
+
/*@{*/
/*%
* These are for use by the rdataset implementation, and MUST NOT
*/
#define DNS_TOTEXT_LINEBREAK_MAXLEN 100
+/*% Does the rdataset 'r' contain a stale answer? */
+#define STALE(r) (((r)->attributes & DNS_RDATASETATTR_STALE) != 0)
+
/*%
* Context structure for a masterfile dump in progress.
*/
/* Omit negative cache entries */
} else {
isc_result_t result;
- if (rds->ttl < ctx->serve_stale_ttl)
- fprintf(f, "; stale\n");
+ if (STALE(rds)) {
+ fprintf(f, "; stale (for %u more seconds)\n",
+ (rds->stale_ttl -
+ ctx->serve_stale_ttl));
+ }
result = dump_rdataset(mctx, name, rds, ctx, buffer, f);
if (result != ISC_R_SUCCESS)
dumpresult = result;
dctx->do_date = dns_db_iscache(dctx->db);
if (dctx->do_date) {
- /*
- * Adjust the date backwards by the serve-stale TTL, if any.
- * This is so the TTL will be loaded correctly when next started.
- */
- (void)dns_db_getservestalettl(dctx->db,
- &dctx->tctx.serve_stale_ttl);
- dctx->now -= dctx->tctx.serve_stale_ttl;
+ /*
+ * Adjust the date backwards by the serve-stale TTL, if any.
+ * This is so the TTL will be loaded correctly when next
+ * started.
+ */
+ (void)dns_db_getservestalettl(dctx->db,
+ &dctx->tctx.serve_stale_ttl);
+ dctx->now -= dctx->tctx.serve_stale_ttl;
}
if (dctx->format == dns_masterformat_text &&
#define NOQNAME(r) (((r)->attributes & \
DNS_RDATASETATTR_NOQNAME) != 0)
-/*% Does the rdataset 'r' contains a stale answer? */
+/*% Does the rdataset 'r' contain a stale answer? */
#define STALE(r) (((r)->attributes & \
DNS_RDATASETATTR_STALE) != 0)