a00f9e2f50675bd43cc6a9fe2669709162a2ccb4Evan Hunt * Driver API implementation and main entry point for BIND.
a00f9e2f50675bd43cc6a9fe2669709162a2ccb4Evan Hunt * BIND calls dyndb_version() before loading, dyndb_init() during startup
a00f9e2f50675bd43cc6a9fe2669709162a2ccb4Evan Hunt * and dyndb_destroy() during shutdown.
a00f9e2f50675bd43cc6a9fe2669709162a2ccb4Evan Hunt * It is completely up to implementation what to do.
a00f9e2f50675bd43cc6a9fe2669709162a2ccb4Evan Hunt * dyndb <name> <driver> {} sections in named.conf are independent so
a00f9e2f50675bd43cc6a9fe2669709162a2ccb4Evan Hunt * driver init() and destroy() functions are called independently for
a00f9e2f50675bd43cc6a9fe2669709162a2ccb4Evan Hunt * each section even if they reference the same driver/library. It is
a00f9e2f50675bd43cc6a9fe2669709162a2ccb4Evan Hunt * up to driver implementation to detect and catch this situation if
a00f9e2f50675bd43cc6a9fe2669709162a2ccb4Evan Hunt * it is undesirable.
a00f9e2f50675bd43cc6a9fe2669709162a2ccb4Evan Hunt * Copyright (C) 2009-2015 Red Hat ; see COPYRIGHT for license
a00f9e2f50675bd43cc6a9fe2669709162a2ccb4Evan Hunt * Driver init is called for each dyndb section in named.conf
a00f9e2f50675bd43cc6a9fe2669709162a2ccb4Evan Hunt * once during startup and then again on every reload.
a00f9e2f50675bd43cc6a9fe2669709162a2ccb4Evan Hunt * dyndb example-name "sample.so" { param1 param2 };
ab598428c8bc10d75bb1ef5dff15f8848869cb1bMark Andrews * @param[in] name User-defined string from dyndb "name" {}; definition
ab598428c8bc10d75bb1ef5dff15f8848869cb1bMark Andrews * The example above will have name = "example-name".
ab598428c8bc10d75bb1ef5dff15f8848869cb1bMark Andrews * @param[in] parameters User-defined parameters from dyndb section as one
ab598428c8bc10d75bb1ef5dff15f8848869cb1bMark Andrews * string. The example above will have
ab598428c8bc10d75bb1ef5dff15f8848869cb1bMark Andrews * params = "param1 param2";
f503aa345b451f94875a5bab637223bcbbd93b6dEvan Hunt * @param[in] file The name of the file from which the parameters
f503aa345b451f94875a5bab637223bcbbd93b6dEvan Hunt * were read.
f503aa345b451f94875a5bab637223bcbbd93b6dEvan Hunt * @param[in] line The line number from which the parameters were read.
ab598428c8bc10d75bb1ef5dff15f8848869cb1bMark Andrews * @param[out] instp Pointer to instance-specific data
ab598428c8bc10d75bb1ef5dff15f8848869cb1bMark Andrews * (for one dyndb section).
a00f9e2f50675bd43cc6a9fe2669709162a2ccb4Evan Huntdyndb_init(isc_mem_t *mctx, const char *name, const char *parameters,
a00f9e2f50675bd43cc6a9fe2669709162a2ccb4Evan Hunt * Depending on how dlopen() was called, we may not have
a00f9e2f50675bd43cc6a9fe2669709162a2ccb4Evan Hunt * access to named's global namespace, in which case we need
a00f9e2f50675bd43cc6a9fe2669709162a2ccb4Evan Hunt * to initialize libisc/libdns
a00f9e2f50675bd43cc6a9fe2669709162a2ccb4Evan Hunt result = isc_commandline_strtoargv(mctx, s, &argc, &argv, 0);
f503aa345b451f94875a5bab637223bcbbd93b6dEvan Hunt "loading params for dyndb '%s' from %s:%lu",
a00f9e2f50675bd43cc6a9fe2669709162a2ccb4Evan Hunt /* Finally, create the instance. */
a00f9e2f50675bd43cc6a9fe2669709162a2ccb4Evan Hunt CHECK(new_sample_instance(mctx, name, argc, argv, dctx, &sample_inst));
a00f9e2f50675bd43cc6a9fe2669709162a2ccb4Evan Hunt * This is an example so we create and load zones
a00f9e2f50675bd43cc6a9fe2669709162a2ccb4Evan Hunt * right now. This step can be arbitrarily postponed.
a00f9e2f50675bd43cc6a9fe2669709162a2ccb4Evan Hunt * Driver destroy is called for every instance on every reload and then once
a00f9e2f50675bd43cc6a9fe2669709162a2ccb4Evan Hunt * during shutdown.
a00f9e2f50675bd43cc6a9fe2669709162a2ccb4Evan Hunt * @param[out] instp Pointer to instance-specific data (for one dyndb section).
a00f9e2f50675bd43cc6a9fe2669709162a2ccb4Evan Hunt destroy_sample_instance((sample_instance_t **)instp);
a00f9e2f50675bd43cc6a9fe2669709162a2ccb4Evan Hunt * Driver version is called when loading the driver to ensure there
a00f9e2f50675bd43cc6a9fe2669709162a2ccb4Evan Hunt * is no API mismatch betwen the driver and the caller.