db.c revision 3a34b87c878990c6303358efd22265c2c5980c65
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * Copyright (C) 1999, 2000 Internet Software Consortium.
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * Permission to use, copy, modify, and distribute this software for any
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * purpose with or without fee is hereby granted, provided that the above
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * copyright notice and this permission notice appear in all copies.
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
deaaf94332abbfdb3aff53675546acfed16e5eb6Mark Andrews/* $Id: db.c,v 1.55 2000/08/31 12:15:09 marka Exp $ */
deaaf94332abbfdb3aff53675546acfed16e5eb6Mark Andrews *** Private Types
3d5cad69ec20157912e95cf3b79316dfb0a314f3Mark Andrewstypedef struct {
deaaf94332abbfdb3aff53675546acfed16e5eb6Mark Andrews const char * name;
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews isc_result_t (*create)(isc_mem_t *mctx, dns_name_t *name,
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews *** Supported DB Implementations Registry
deaaf94332abbfdb3aff53675546acfed16e5eb6Mark Andrews * Supported database implementations must be registered here.
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * It might be nice to generate this automatically some day.
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews *** Basic DB Methods
bfb2a81b65579882a80855c279cedc45aebd62e8Mark Andrewsdns_db_create(isc_mem_t *mctx, const char *db_type, dns_name_t *origin,
3d5cad69ec20157912e95cf3b79316dfb0a314f3Mark Andrews unsigned int argc, char *argv[], dns_db_t **dbp)
bfb2a81b65579882a80855c279cedc45aebd62e8Mark Andrews * Create a new database using implementation 'db_type'.
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews for (impinfo = implementations; impinfo->name != NULL; impinfo++)
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews return ((impinfo->create)(mctx, origin, type, rdclass,
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrewsdns_db_attach(dns_db_t *source, dns_db_t **targetp) {
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * Attach *targetp to source.
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * Detach *dbp from its database.
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrewsdns_db_ondestroy(dns_db_t *db, isc_task_t *task, isc_event_t **eventp)
return (ISC_TRUE);
return (ISC_FALSE);
return (ISC_TRUE);
return (ISC_FALSE);
return (ISC_TRUE);
return (ISC_FALSE);
return (result);
return (result);
iteratorp));
newrdataset));
return (result);
goto freenode;
goto freerdataset;
return (result);