db.c revision a1014b72b0340a071f4c59c153b02c538bfd6b9f
d3498432822fb487e58f8f72bb5f880dd8307d7dMichael Sawyer * Copyright (C) 1999, 2000 Internet Software Consortium.
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * Permission to use, copy, modify, and distribute this software for any
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * purpose with or without fee is hereby granted, provided that the above
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * copyright notice and this permission notice appear in all copies.
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews/* $Id: db.c,v 1.63 2000/11/17 01:06:37 bwelling Exp $ */
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews *** Private Types
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews const char * name;
bd334e0366c0f21bf15de9282b02f1bed4ccde14Michael Sawyer *** Supported DB Implementations Registry
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews * Built in database implementations are registered here.
bd334e0366c0f21bf15de9282b02f1bed4ccde14Michael Sawyerstatic ISC_LIST(dns_dbimplementation_t) implementations;
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews RUNTIME_CHECK(isc_rwlock_init(&implock, 0, 0) == ISC_R_SUCCESS);
bd334e0366c0f21bf15de9282b02f1bed4ccde14Michael Sawyer ISC_LIST_APPEND(implementations, &rbtimp, link);
813d6c9781d1fb48bb5c1d6d3415e65f7be5eeb0Andreas Gustafsson ISC_LIST_APPEND(implementations, &rbt64imp, link);
d0dc01dd9de4c90e0adb01c3e8a51d74bc3d3559Brian Wellington *** Basic DB Methods
c6eb92beb1951b0634c349b24891522c273e9f69Mark Andrewsdns_db_create(isc_mem_t *mctx, const char *db_type, dns_name_t *origin,
c6eb92beb1951b0634c349b24891522c273e9f69Mark Andrews unsigned int argc, char *argv[], dns_db_t **dbp)
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews RUNTIME_CHECK(isc_once_do(&once, initialize) == ISC_R_SUCCESS);
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews * Create a new database using implementation 'db_type'.
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews result = ((impinfo->create)(mctx, origin, type,
2da036f2315fe375ee83fe79893bd52cbf07a8a1Mark Andrews isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
return (ISC_TRUE);
return (ISC_FALSE);
return (ISC_TRUE);
return (ISC_FALSE);
return (ISC_TRUE);
return (ISC_FALSE);
return (result);
return (result);
iteratorp));
return (result);
goto freenode;
goto freerdataset;
return (result);
return (ISC_R_EXISTS);
return (ISC_R_NOMEMORY);
return (ISC_R_SUCCESS);