isc_result_t
dns_db_getsize(dns_db_t *db, dns_dbversion_t *version, uint64_t *records,
- uint64_t *bytes);
+ uint64_t *xfrsize);
/*%<
* On success if 'records' is not NULL, it is set to the number of records
- * in the given version of the database. If 'bytes' is not NULL, it is
+ * in the given version of the database. If 'xfrisize' is not NULL, it is
* set to the approximate number of bytes needed to transfer the records,
* counting name, TTL, type, class, and rdata for each RR. (This is meant
* to be a rough approximation of the size of a full zone transfer, though
* \li 'db' is a valid zone database.
* \li 'version' is NULL or a valid version.
* \li 'records' is NULL or a pointer to return the record count in.
- * \li 'bytes' is NULL or a pointer to return the byte count in.
+ * \li 'xfrsize' is NULL or a pointer to return the byte count in.
*
* Returns:
* \li #ISC_R_SUCCESS
unsigned char salt[DNS_NSEC3_SALTSIZE];
/*
- * records and bytes are covered by rwlock.
+ * records and xfrsize are covered by rwlock.
*/
isc_rwlock_t rwlock;
uint64_t records;
- uint64_t bytes;
+ uint64_t xfrsize;
isc_rwlock_t glue_rwlock;
size_t glue_table_bits;
RWLOCK(&rbtdb->current_version->rwlock,
isc_rwlocktype_read);
version->records = rbtdb->current_version->records;
- version->bytes = rbtdb->current_version->bytes;
+ version->xfrsize = rbtdb->current_version->xfrsize;
RWUNLOCK(&rbtdb->current_version->rwlock,
isc_rwlocktype_read);
rbtdb->next_serial++;
}
static void
-update_recordsandbytes(bool add, rbtdb_version_t *rbtversion,
- rdatasetheader_t *header, unsigned int namelen) {
+update_recordsandxfrsize(bool add, rbtdb_version_t *rbtversion,
+ rdatasetheader_t *header, unsigned int namelen) {
unsigned char *hdr = (unsigned char *)header;
size_t hdrsize = sizeof(*header);
RWLOCK(&rbtversion->rwlock, isc_rwlocktype_write);
if (add) {
rbtversion->records += dns_rdataslab_count(hdr, hdrsize);
- rbtversion->bytes += recordsize(header, namelen);
+ rbtversion->xfrsize += recordsize(header, namelen);
} else {
rbtversion->records -= dns_rdataslab_count(hdr, hdrsize);
- rbtversion->bytes -= recordsize(header, namelen);
+ rbtversion->xfrsize -= recordsize(header, namelen);
}
RWUNLOCK(&rbtversion->rwlock, isc_rwlocktype_write);
}
}
newheader->next = topheader->next;
if (rbtversion != NULL && !header_nx) {
- update_recordsandbytes(false, rbtversion,
- header,
- nodename->length);
+ update_recordsandxfrsize(false, rbtversion,
+ header,
+ nodename->length);
}
free_rdataset(rbtdb, rbtdb->common.mctx, header);
} else {
}
}
if (rbtversion != NULL && !header_nx) {
- update_recordsandbytes(false, rbtversion,
- header,
- nodename->length);
+ update_recordsandxfrsize(false, rbtversion,
+ header,
+ nodename->length);
}
}
} else {
}
if (rbtversion != NULL && !newheader_nx) {
- update_recordsandbytes(true, rbtversion, newheader,
- nodename->length);
+ update_recordsandxfrsize(true, rbtversion, newheader,
+ nodename->length);
}
/*
* to additional info. We need to clear these fields
* to avoid having duplicated references.
*/
- update_recordsandbytes(true, rbtversion, newheader,
- nodename->length);
+ update_recordsandxfrsize(true, rbtversion, newheader,
+ nodename->length);
} else if (result == DNS_R_NXRRSET) {
/*
* This subtraction would remove all of the rdata;
* topheader.
*/
INSIST(rbtversion->serial >= topheader->serial);
- update_recordsandbytes(false, rbtversion, header,
- nodename->length);
+ update_recordsandxfrsize(false, rbtversion, header,
+ nodename->length);
if (topheader_prev != NULL) {
topheader_prev->next = newheader;
} else {
}
}
- update_recordsandbytes(true, rbtdb->current_version, header,
- rbtnode->fullnamelen);
+ update_recordsandxfrsize(true, rbtdb->current_version, header,
+ rbtnode->fullnamelen);
}
/* We're done deserializing; clear fullnamelen */
static isc_result_t
getsize(dns_db_t *db, dns_dbversion_t *version, uint64_t *records,
- uint64_t *bytes) {
+ uint64_t *xfrsize) {
dns_rbtdb_t *rbtdb;
isc_result_t result = ISC_R_SUCCESS;
rbtdb_version_t *rbtversion = version;
*records = rbtversion->records;
}
- if (bytes != NULL) {
- *bytes = rbtversion->bytes;
+ if (xfrsize != NULL) {
+ *xfrsize = rbtversion->xfrsize;
}
RWUNLOCK(&rbtversion->rwlock, isc_rwlocktype_read);
RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_read);
}
rbtdb->current_version->records = 0;
- rbtdb->current_version->bytes = 0;
+ rbtdb->current_version->xfrsize = 0;
rbtdb->future_version = NULL;
ISC_LIST_INIT(rbtdb->open_versions);
/*