Beispiel #1
0
isc_boolean_t
dns_db_ispersistent(dns_db_t *db) {

	/*
	 * Is 'db' persistent?
	 */

	REQUIRE(DNS_DB_VALID(db));

	return ((db->methods->ispersistent)(db));
}
Beispiel #2
0
isc_result_t
dns_db_endload(dns_db_t *db, dns_dbload_t **dbloadp) {
	/*
	 * Finish loading 'db'.
	 */

	REQUIRE(DNS_DB_VALID(db));
	REQUIRE(dbloadp != NULL && *dbloadp != NULL);

	return ((db->methods->endload)(db, dbloadp));
}
Beispiel #3
0
isc_result_t
dns_db_getoriginnode(dns_db_t *db, dns_dbnode_t **nodep) {
	REQUIRE(DNS_DB_VALID(db));
	REQUIRE(dns_db_iszone(db) == ISC_TRUE);
	REQUIRE(nodep != NULL && *nodep == NULL);

	if (db->methods->getoriginnode != NULL)
		return ((db->methods->getoriginnode)(db, nodep));

	return (ISC_R_NOTFOUND);
}
isc_result_t
dns_db_beginload(dns_db_t *db, dns_rdatacallbacks_t *callbacks) {
	/*
	 * Begin loading 'db'.
	 */

	REQUIRE(DNS_DB_VALID(db));
	REQUIRE(DNS_CALLBACK_VALID(callbacks));

	return ((db->methods->beginload)(db, callbacks));
}
Beispiel #5
0
void
dns_db_printnode(dns_db_t *db, dns_dbnode_t *node, FILE *out) {
	/*
	 * Print a textual representation of the contents of the node to
	 * 'out'.
	 */

	REQUIRE(DNS_DB_VALID(db));
	REQUIRE(node != NULL);

	(db->methods->printnode)(db, node, out);
}
Beispiel #6
0
isc_result_t
dns_db_endload(dns_db_t *db, dns_rdatacallbacks_t *callbacks) {
	/*
	 * Finish loading 'db'.
	 */

	REQUIRE(DNS_DB_VALID(db));
	REQUIRE(DNS_CALLBACK_VALID(callbacks));
	REQUIRE(callbacks->add_private != NULL);

	return ((db->methods->endload)(db, callbacks));
}
Beispiel #7
0
isc_result_t
dns_db_getsize(dns_db_t *db, dns_dbversion_t *version, isc_uint64_t *records,
	       isc_uint64_t *bytes)
{
	REQUIRE(DNS_DB_VALID(db));
	REQUIRE(dns_db_iszone(db) == ISC_TRUE);

	if (db->methods->getsize != NULL)
		return ((db->methods->getsize)(db, version, records, bytes));

	return (ISC_R_NOTFOUND);
}
Beispiel #8
0
isc_boolean_t
dns_db_issecure(dns_db_t *db) {

	/*
	 * Is 'db' secure?
	 */

	REQUIRE(DNS_DB_VALID(db));
	REQUIRE((db->attributes & DNS_DBATTR_CACHE) == 0);

	return ((db->methods->issecure)(db));
}
Beispiel #9
0
isc_result_t
dns_db_createiterator(dns_db_t *db, isc_boolean_t relative_names,
		      dns_dbiterator_t **iteratorp)
{
	/*
	 * Create an iterator for version 'version' of 'db'.
	 */

	REQUIRE(DNS_DB_VALID(db));
	REQUIRE(iteratorp != NULL && *iteratorp == NULL);

	return (db->methods->createiterator(db, relative_names, iteratorp));
}
Beispiel #10
0
isc_result_t
dns_db_dump2(dns_db_t *db, dns_dbversion_t *version, const char *filename,
	     dns_masterformat_t masterformat) {
	/*
	 * Dump 'db' into master file 'filename' in the 'masterformat' format.
	 * XXXJT: is it okay to modify the interface to the existing "dump"
	 * method?
	 */

	REQUIRE(DNS_DB_VALID(db));

	return ((db->methods->dump)(db, version, filename, masterformat));
}
Beispiel #11
0
isc_result_t
dns_db_createiterator(dns_db_t *db, unsigned int flags,
		      dns_dbiterator_t **iteratorp)
{
	/*
	 * Create an iterator for version 'version' of 'db'.
	 */

	REQUIRE(DNS_DB_VALID(db));
	REQUIRE(iteratorp != NULL && *iteratorp == NULL);

	return (db->methods->createiterator(db, flags, iteratorp));
}
Beispiel #12
0
isc_result_t
dns_db_expirenode(dns_db_t *db, dns_dbnode_t *node, isc_stdtime_t now) {

	/*
	 * Mark as stale all records at 'node' which expire at or before 'now'.
	 */

	REQUIRE(DNS_DB_VALID(db));
	REQUIRE((db->attributes & DNS_DBATTR_CACHE) != 0);
	REQUIRE(node != NULL);

	return ((db->methods->expirenode)(db, node, now));
}
Beispiel #13
0
void
dns_db_attachnode(dns_db_t *db, dns_dbnode_t *source, dns_dbnode_t **targetp) {

	/*
	 * Attach *targetp to source.
	 */

	REQUIRE(DNS_DB_VALID(db));
	REQUIRE(source != NULL);
	REQUIRE(targetp != NULL && *targetp == NULL);

	(db->methods->attachnode)(db, source, targetp);
}
Beispiel #14
0
isc_result_t
dns_db_newversion(dns_db_t *db, dns_dbversion_t **versionp) {

	/*
	 * Open a new version for reading and writing.
	 */

	REQUIRE(DNS_DB_VALID(db));
	REQUIRE((db->attributes & DNS_DBATTR_CACHE) == 0);
	REQUIRE(versionp != NULL && *versionp == NULL);

	return ((db->methods->newversion)(db, versionp));
}
Beispiel #15
0
isc_result_t
dns_db_beginload(dns_db_t *db, dns_addrdatasetfunc_t *addp,
		 dns_dbload_t **dbloadp) {
	/*
	 * Begin loading 'db'.
	 */

	REQUIRE(DNS_DB_VALID(db));
	REQUIRE(addp != NULL && *addp == NULL);
	REQUIRE(dbloadp != NULL && *dbloadp == NULL);

	return ((db->methods->beginload)(db, addp, dbloadp));
}
Beispiel #16
0
void
dns_db_currentversion(dns_db_t *db, dns_dbversion_t **versionp) {

	/*
	 * Open the current version for reading.
	 */

	REQUIRE(DNS_DB_VALID(db));
	REQUIRE((db->attributes & DNS_DBATTR_CACHE) == 0);
	REQUIRE(versionp != NULL && *versionp == NULL);

	(db->methods->currentversion)(db, versionp);
}
Beispiel #17
0
void
dns_db_detachnode(dns_db_t *db, dns_dbnode_t **nodep) {

	/*
	 * Detach *nodep from its node.
	 */

	REQUIRE(DNS_DB_VALID(db));
	REQUIRE(nodep != NULL && *nodep != NULL);

	(db->methods->detachnode)(db, nodep);

	ENSURE(*nodep == NULL);
}
Beispiel #18
0
isc_result_t
dns_db_findnsec3node(dns_db_t *db, dns_name_t *name,
		     isc_boolean_t create, dns_dbnode_t **nodep)
{

	/*
	 * Find the node with name 'name'.
	 */

	REQUIRE(DNS_DB_VALID(db));
	REQUIRE(nodep != NULL && *nodep == NULL);

	return ((db->methods->findnsec3node)(db, name, create, nodep));
}
Beispiel #19
0
isc_boolean_t
dns_db_isstub(dns_db_t *db) {

	/*
	 * Does 'db' have stub semantics?
	 */

	REQUIRE(DNS_DB_VALID(db));

	if ((db->attributes & DNS_DBATTR_STUB) != 0)
		return (ISC_TRUE);

	return (ISC_FALSE);
}
Beispiel #20
0
void
dns_db_detach(dns_db_t **dbp) {

	/*
	 * Detach *dbp from its database.
	 */

	REQUIRE(dbp != NULL);
	REQUIRE(DNS_DB_VALID(*dbp));

	((*dbp)->methods->detach)(dbp);

	ENSURE(*dbp == NULL);
}
Beispiel #21
0
isc_boolean_t
dns_db_iscache(dns_db_t *db) {

	/*
	 * Does 'db' have cache semantics?
	 */

	REQUIRE(DNS_DB_VALID(db));

	if ((db->attributes & DNS_DBATTR_CACHE) != 0)
		return (ISC_TRUE);

	return (ISC_FALSE);
}
Beispiel #22
0
isc_boolean_t
dns_db_isdnssec(dns_db_t *db) {

	/*
	 * Is 'db' secure or partially secure?
	 */

	REQUIRE(DNS_DB_VALID(db));
	REQUIRE((db->attributes & DNS_DBATTR_CACHE) == 0);

	if (db->methods->isdnssec != NULL)
		return ((db->methods->isdnssec)(db));
	return ((db->methods->issecure)(db));
}
Beispiel #23
0
void
dns_db_attach(dns_db_t *source, dns_db_t **targetp) {

	/*
	 * Attach *targetp to source.
	 */

	REQUIRE(DNS_DB_VALID(source));
	REQUIRE(targetp != NULL && *targetp == NULL);

	(source->methods->attach)(source, targetp);

	ENSURE(*targetp == source);
}
Beispiel #24
0
isc_boolean_t
dns_db_iszone(dns_db_t *db) {

	/*
	 * Does 'db' have zone semantics?
	 */

	REQUIRE(DNS_DB_VALID(db));

	if ((db->attributes & (DNS_DBATTR_CACHE|DNS_DBATTR_STUB)) == 0)
		return (ISC_TRUE);

	return (ISC_FALSE);
}
Beispiel #25
0
isc_result_t
dns_db_allrdatasets(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
		    isc_stdtime_t now, dns_rdatasetiter_t **iteratorp)
{
	/*
	 * Make '*iteratorp' an rdataset iteratator for all rdatasets at
	 * 'node' in version 'version' of 'db'.
	 */

	REQUIRE(DNS_DB_VALID(db));
	REQUIRE(iteratorp != NULL && *iteratorp == NULL);

	return ((db->methods->allrdatasets)(db, node, version, now,
					    iteratorp));
}
Beispiel #26
0
isc_result_t
dns_db_getnsec3parameters(dns_db_t *db, dns_dbversion_t *version,
			  dns_hash_t *hash, isc_uint8_t *flags,
			  isc_uint16_t *iterations,
			  unsigned char *salt, size_t *salt_length)
{
	REQUIRE(DNS_DB_VALID(db));
	REQUIRE(dns_db_iszone(db) == ISC_TRUE);

	if (db->methods->getnsec3parameters != NULL)
		return ((db->methods->getnsec3parameters)(db, version, hash,
							  flags, iterations,
							  salt, salt_length));

	return (ISC_R_NOTFOUND);
}
Beispiel #27
0
void
dns_db_attachversion(dns_db_t *db, dns_dbversion_t *source,
		     dns_dbversion_t **targetp)
{
	/*
	 * Attach '*targetp' to 'source'.
	 */

	REQUIRE(DNS_DB_VALID(db));
	REQUIRE((db->attributes & DNS_DBATTR_CACHE) == 0);
	REQUIRE(source != NULL);
	REQUIRE(targetp != NULL && *targetp == NULL);

	(db->methods->attachversion)(db, source, targetp);

	ENSURE(*targetp != NULL);
}
Beispiel #28
0
void
dns_db_closeversion(dns_db_t *db, dns_dbversion_t **versionp,
		    isc_boolean_t commit)
{

	/*
	 * Close version '*versionp'.
	 */

	REQUIRE(DNS_DB_VALID(db));
	REQUIRE((db->attributes & DNS_DBATTR_CACHE) == 0);
	REQUIRE(versionp != NULL && *versionp != NULL);

	(db->methods->closeversion)(db, versionp, commit);

	ENSURE(*versionp == NULL);
}
Beispiel #29
0
isc_result_t
dns_db_deleterdataset(dns_db_t *db, dns_dbnode_t *node,
		      dns_dbversion_t *version, dns_rdatatype_t type,
		      dns_rdatatype_t covers)
{
	/*
	 * Make it so that no rdataset of type 'type' exists at 'node' in
	 * version version 'version' of 'db'.
	 */

	REQUIRE(DNS_DB_VALID(db));
	REQUIRE(node != NULL);
	REQUIRE(((db->attributes & DNS_DBATTR_CACHE) == 0 && version != NULL)||
		((db->attributes & DNS_DBATTR_CACHE) != 0 && version == NULL));

	return ((db->methods->deleterdataset)(db, node, version,
					      type, covers));
}
Beispiel #30
0
isc_result_t
dns_db_findnodeext(dns_db_t *db, dns_name_t *name,
		   isc_boolean_t create, dns_clientinfomethods_t *methods,
		   dns_clientinfo_t *clientinfo, dns_dbnode_t **nodep)
{
	/*
	 * Find the node with name 'name', passing 'arg' to the database
	 * implementation.
	 */

	REQUIRE(DNS_DB_VALID(db));
	REQUIRE(nodep != NULL && *nodep == NULL);

	if (db->methods->findnodeext != NULL)
		return ((db->methods->findnodeext)(db, name, create,
						   methods, clientinfo, nodep));
	else
		return ((db->methods->findnode)(db, name, create, nodep));
}