db.c revision fe12eb4fc27f49c6b3e42b1d7a6b40310e41e6df
/*
* Copyright (C) 1999, 2000 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
* INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: db.c,v 1.53 2000/08/18 18:25:25 bwelling Exp $ */
/***
*** Imports
***/
#include <config.h>
#include <dns/callbacks.h>
#include <dns/rdataset.h>
/***
*** Private Types
***/
typedef struct {
const char * name;
} impinfo_t;
/***
*** Supported DB Implementations Registry
***/
/*
* Supported database implementations must be registered here.
*
* It might be nice to generate this automatically some day.
*/
#include "rbtdb.h"
#include "rbtdb64.h"
static impinfo_t implementations[] = {
{ "rbt", dns_rbtdb_create },
{ "rbt64", dns_rbtdb64_create },
};
/***
*** Basic DB Methods
***/
{
/*
* Create a new database using implementation 'db_type'.
*/
"unsupported database type '%s'", db_type);
return (ISC_R_NOTFOUND);
}
void
/*
* Attach *targetp to source.
*/
}
void
/*
* Detach *dbp from its database.
*/
}
{
}
/*
* Does 'db' have cache semantics?
*/
return (ISC_TRUE);
return (ISC_FALSE);
}
/*
* Does 'db' have zone semantics?
*/
return (ISC_TRUE);
return (ISC_FALSE);
}
/*
* Does 'db' have stub semantics?
*/
return (ISC_TRUE);
return (ISC_FALSE);
}
/*
* Is 'db' secure?
*/
}
/*
* Is 'db' persistent?
*/
}
/*
* The origin of the database.
*/
}
/*
* The class of the database.
*/
}
dns_dbload_t **dbloadp) {
/*
* Begin loading 'db'.
*/
}
/*
* Finish loading 'db'.
*/
}
/*
* Load master file 'filename' into 'db'.
*/
if (result != ISC_R_SUCCESS)
return (result);
/*
* We always call dns_db_endload(), but we only want to return its
* result if dns_master_loadfile() succeeded. If dns_master_loadfile()
* failed, we want to return the result code it gave us.
*/
if (result == ISC_R_SUCCESS)
return (result);
}
/*
* Dump 'db' into master file 'filename'.
*/
}
/***
*** Version Methods
***/
void
/*
* Open the current version for reading.
*/
}
/*
* Open a new version for reading and writing.
*/
}
void
{
/*
* Attach '*targetp' to 'source'.
*/
}
void
{
/*
* Close version '*versionp'.
*/
}
/***
*** Node Methods
***/
{
/*
* Find the node with name 'name'.
*/
}
{
/*
* Find the best match for 'name' and 'type' in version 'version'
* of 'db'.
*/
}
{
/*
* Find the deepest known zonecut which encloses 'name' in 'db'.
*/
}
void
/*
* Attach *targetp to source.
*/
}
void
/*
* Detach *nodep from its node.
*/
}
/*
* Mark as stale all records at 'node' which expire at or before 'now'.
*/
}
void
/*
* Print a textual representation of the contents of the node to
* 'out'.
*/
}
/***
*** DB Iterator Creation
***/
{
/*
* Create an iterator for version 'version' of 'db'.
*/
}
/***
*** Rdataset Methods
***/
{
/*
* Search for an rdataset of type 'type' at 'node' that are in version
* 'version' of 'db'. If found, make 'rdataset' refer to it.
*/
}
{
/*
* Make '*iteratorp' an rdataset iteratator for all rdatasets at
* 'node' in version 'version' of 'db'.
*/
iteratorp));
}
{
/*
* Add 'rdataset' to 'node' in version 'version' of 'db'.
*/
options, addedrdataset));
}
{
/*
* Remove any rdata in 'rdataset' from 'node' in version 'version' of
* 'db'.
*/
newrdataset));
}
{
/*
* Make it so that no rdataset of type 'type' exists at 'node' in
* version version 'version' of 'db'.
*/
}
{
if (result != ISC_R_SUCCESS)
return (result);
if (result != ISC_R_SUCCESS)
goto freenode;
if (result != ISC_R_SUCCESS)
goto freerdataset;
return (result);
}
unsigned int
}