/*
* Driver API implementation and main entry point for BIND.
*
* BIND calls dyndb_version() before loading, dyndb_init() during startup
* and dyndb_destroy() during shutdown.
*
* It is completely up to implementation what to do.
*
* dyndb <name> <driver> {} sections in named.conf are independent so
* driver init() and destroy() functions are called independently for
* up to driver implementation to detect and catch this situation if
* it is undesirable.
*
* Copyright (C) 2009-2015 Red Hat ; see COPYRIGHT for license
*/
#include <config.h>
#include <isc/commandline.h>
#include "db.h"
#include "log.h"
#include "instance.h"
#include "util.h"
/*
* Driver init is called for each dyndb section in named.conf
* once during startup and then again on every reload.
*
* @code
* dyndb example-name "sample.so" { param1 param2 };
* @endcode
*
* @param[in] name User-defined string from dyndb "name" {}; definition
* in named.conf.
* The example above will have name = "example-name".
* @param[in] parameters User-defined parameters from dyndb section as one
* string. The example above will have
* params = "param1 param2";
* @param[in] file The name of the file from which the parameters
* were read.
* @param[in] line The line number from which the parameters were read.
* @param[out] instp Pointer to instance-specific data
* (for one dyndb section).
*/
{
unsigned int argc;
char *s = NULL;
/*
* Depending on how dlopen() was called, we may not have
* access to named's global namespace, in which case we need
*/
}
if (s == NULL) {
goto cleanup;
}
if (result != ISC_R_SUCCESS)
goto cleanup;
"loading params for dyndb '%s' from %s:%lu",
/* Finally, create the instance. */
/*
* This is an example so we create and load zones
* right now. This step can be arbitrarily postponed.
*/
*instp = sample_inst;
if (s != NULL)
isc_mem_free(mctx, s);
return (result);
}
/*
* Driver destroy is called for every instance on every reload and then once
* during shutdown.
*
* @param[out] instp Pointer to instance-specific data (for one dyndb section).
*/
void
}
/*
* Driver version is called when loading the driver to ensure there
* is no API mismatch betwen the driver and the caller.
*/
int
return (DNS_DYNDB_VERSION);
}