Esempio n. 1
0
VISIBLE isc_result_t
dynamic_driver_init(isc_mem_t *mctx, const char *name, const char * const *argv,
		    dns_dyndb_arguments_t *dyndb_args)
{
	dns_dbimplementation_t *ldapdb_imp_new = NULL;
	isc_result_t result;

	REQUIRE(name != NULL);
	REQUIRE(argv != NULL);
	REQUIRE(dyndb_args != NULL);

	log_debug(2, "registering dynamic ldap driver for %s.", name);

	/*
	 * We need to discover what rdataset methods does
	 * dns_rdatalist_tordataset use. We then make a copy for ourselves
	 * with the exception that we modify the disassociate method to free
	 * the rdlist we allocate for it in clone_rdatalist_to_rdataset().
	 */

	/* Register new DNS DB implementation. */
	result = dns_db_register(ldapdb_impname, &ldapdb_associate, NULL, mctx,
				 &ldapdb_imp_new);
	if (result != ISC_R_SUCCESS && result != ISC_R_EXISTS)
		return result;
	else if (result == ISC_R_SUCCESS)
		ldapdb_imp = ldapdb_imp_new;

	/* Finally, create the instance. */
	result = manager_create_db_instance(mctx, name, argv, dyndb_args);

	return result;
}
Esempio n. 2
0
isc_result_t
dns_ecdb_register(isc_mem_t *mctx, dns_dbimplementation_t **dbimp) {
	REQUIRE(mctx != NULL);
	REQUIRE(dbimp != NULL && *dbimp == NULL);

	return (dns_db_register("ecdb", dns_ecdb_create, NULL, mctx, dbimp));
}