+3164. [func] Enable DLZ modules to retrieve client information,
+ so that responses can be changed depending on the
+ source address of the query. [RT #25768]
+
3163. [bug] Use finer-grained locking in client.c to address
concurrency problems with large numbers of threads.
[RT #26044]
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: client.c,v 1.278 2011/10/10 22:57:13 each Exp $ */
+/* $Id: client.c,v 1.279 2011/10/11 00:09:01 each Exp $ */
#include <config.h>
client->query.qname = name;
UNLOCK(&client->query.fetchlock);
}
+
+isc_result_t
+ns_client_sourceip(dns_clientinfo_t *ci, isc_sockaddr_t **addrp) {
+ ns_client_t *client = (ns_client_t *) ci->data;
+
+ REQUIRE(NS_CLIENT_VALID(client));
+ REQUIRE(addrp != NULL);
+
+ *addrp = &client->peeraddr;
+ return (ISC_R_SUCCESS);
+}
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: client.h,v 1.92 2011/10/10 22:57:13 each Exp $ */
+/* $Id: client.h,v 1.93 2011/10/11 00:09:01 each Exp $ */
#ifndef NAMED_CLIENT_H
#define NAMED_CLIENT_H 1
#include <isc/quota.h>
#include <isc/queue.h>
+#include <dns/db.h>
#include <dns/fixedname.h>
#include <dns/name.h>
#include <dns/rdataclass.h>
* Isself callback.
*/
+isc_result_t
+ns_client_sourceip(dns_clientinfo_t *ci, isc_sockaddr_t **addrp);
+
#endif /* NAMED_CLIENT_H */
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: query.c,v 1.369 2011/09/02 23:46:31 tbox Exp $ */
+/* $Id: query.c,v 1.370 2011/10/11 00:09:01 each Exp $ */
/*! \file */
isc_boolean_t added_something, need_addname;
dns_zone_t *zone;
dns_rdatatype_t type;
+ dns_clientinfomethods_t cm;
+ dns_clientinfo_t ci;
REQUIRE(NS_CLIENT_VALID(client));
REQUIRE(qtype != dns_rdatatype_any);
need_addname = ISC_FALSE;
zone = NULL;
+ dns_clientinfomethods_init(&cm, ns_client_sourceip);
+ dns_clientinfo_init(&ci, client);
+
/*
* We treat type A additional section processing as if it
* were "any address type" additional section processing.
* necessarily in the same database.
*/
node = NULL;
- result = dns_db_find(db, name, version, type, client->query.dboptions,
- client->now, &node, fname, rdataset,
- sigrdataset);
+ result = dns_db_findext(db, name, version, type,
+ client->query.dboptions,
+ client->now, &node, fname, &cm, &ci,
+ rdataset, sigrdataset);
if (result == ISC_R_SUCCESS) {
if (sigrdataset != NULL && !dns_db_issecure(db) &&
dns_rdataset_isassociated(sigrdataset))
if (sigrdataset == NULL)
goto cleanup;
}
- result = dns_db_find(db, name, version, type,
- client->query.dboptions |
- DNS_DBFIND_GLUEOK | DNS_DBFIND_ADDITIONALOK,
- client->now, &node, fname, rdataset,
- sigrdataset);
+ result = dns_db_findext(db, name, version, type,
+ client->query.dboptions |
+ DNS_DBFIND_GLUEOK | DNS_DBFIND_ADDITIONALOK,
+ client->now, &node, fname, &cm, &ci,
+ rdataset, sigrdataset);
if (result == DNS_R_GLUE &&
validate(client, db, fname, rdataset, sigrdataset))
result = ISC_R_SUCCESS;
goto cleanup;
dns_db_attach(client->query.gluedb, &db);
- result = dns_db_find(db, name, version, type,
- client->query.dboptions | DNS_DBFIND_GLUEOK,
- client->now, &node, fname, rdataset,
- sigrdataset);
+ result = dns_db_findext(db, name, version, type,
+ client->query.dboptions | DNS_DBFIND_GLUEOK,
+ client->now, &node, fname, &cm, &ci,
+ rdataset, sigrdataset);
if (!(result == ISC_R_SUCCESS ||
result == DNS_R_ZONECUT ||
result == DNS_R_GLUE))
}
result = dns_db_findrdataset(db, node, version,
dns_rdatatype_a, 0,
- client->now, rdataset,
- sigrdataset);
+ client->now,
+ rdataset, sigrdataset);
if (result == DNS_R_NCACHENXDOMAIN)
goto addname;
if (result == DNS_R_NCACHENXRRSET) {
}
result = dns_db_findrdataset(db, node, version,
dns_rdatatype_aaaa, 0,
- client->now, rdataset,
- sigrdataset);
+ client->now,
+ rdataset, sigrdataset);
if (result == DNS_R_NCACHENXDOMAIN)
goto addname;
if (result == DNS_R_NCACHENXRRSET) {
dns_zone_t *zone;
dns_rdatatype_t type;
dns_rdatasetadditional_t additionaltype;
+ dns_clientinfomethods_t cm;
+ dns_clientinfo_t ci;
if (qtype != dns_rdatatype_a) {
/*
POST(needadditionalcache);
additionaltype = dns_rdatasetadditional_fromauth;
dns_name_init(&cfname, NULL);
+ dns_clientinfomethods_init(&cm, ns_client_sourceip);
+ dns_clientinfo_init(&ci, client);
CTRACE("query_addadditional2");
* necessarily in the same database.
*/
node = NULL;
- result = dns_db_find(db, name, version, type, client->query.dboptions,
- client->now, &node, fname, NULL, NULL);
+ result = dns_db_findext(db, name, version, type,
+ client->query.dboptions,
+ client->now, &node, fname, &cm, &ci,
+ NULL, NULL);
if (result == ISC_R_SUCCESS)
goto found;
*/
goto try_glue;
- result = dns_db_find(db, name, version, type,
- client->query.dboptions |
- DNS_DBFIND_GLUEOK | DNS_DBFIND_ADDITIONALOK,
- client->now, &node, fname, NULL, NULL);
+ result = dns_db_findext(db, name, version, type,
+ client->query.dboptions |
+ DNS_DBFIND_GLUEOK | DNS_DBFIND_ADDITIONALOK,
+ client->now, &node, fname, &cm, &ci,
+ NULL, NULL);
if (result == ISC_R_SUCCESS)
goto found;
findglue:
dns_db_attach(client->query.gluedb, &db);
- result = dns_db_find(db, name, version, type,
- client->query.dboptions | DNS_DBFIND_GLUEOK,
- client->now, &node, fname, NULL, NULL);
+ result = dns_db_findext(db, name, version, type,
+ client->query.dboptions | DNS_DBFIND_GLUEOK,
+ client->now, &node, fname, &cm, &ci,
+ NULL, NULL);
if (!(result == ISC_R_SUCCESS ||
result == DNS_R_ZONECUT ||
result == DNS_R_GLUE)) {
isc_result_t result, eresult;
dns_rdataset_t *rdataset = NULL, *sigrdataset = NULL;
dns_rdataset_t **sigrdatasetp = NULL;
+ dns_clientinfomethods_t cm;
+ dns_clientinfo_t ci;
CTRACE("query_addsoa");
/*
rdataset = NULL;
node = NULL;
+ dns_clientinfomethods_init(&cm, ns_client_sourceip);
+ dns_clientinfo_init(&ci, client);
+
/*
* Don't add the SOA record for test which set "-T nosoa".
*/
result = dns_db_getoriginnode(db, &node);
if (result == ISC_R_SUCCESS) {
result = dns_db_findrdataset(db, node, version,
- dns_rdatatype_soa,
- 0, client->now, rdataset,
- sigrdataset);
+ dns_rdatatype_soa, 0, client->now,
+ rdataset, sigrdataset);
} else {
dns_fixedname_t foundname;
dns_name_t *fname;
dns_fixedname_init(&foundname);
fname = dns_fixedname_name(&foundname);
- result = dns_db_find(db, name, version, dns_rdatatype_soa,
- client->query.dboptions, 0, &node,
- fname, rdataset, sigrdataset);
+ result = dns_db_findext(db, name, version, dns_rdatatype_soa,
+ client->query.dboptions, 0, &node,
+ fname, &cm, &ci, rdataset, sigrdataset);
}
if (result != ISC_R_SUCCESS) {
/*
dns_fixedname_t foundname;
dns_rdataset_t *rdataset = NULL, *sigrdataset = NULL;
dns_rdataset_t **sigrdatasetp = NULL;
+ dns_clientinfomethods_t cm;
+ dns_clientinfo_t ci;
CTRACE("query_addns");
/*
node = NULL;
dns_fixedname_init(&foundname);
fname = dns_fixedname_name(&foundname);
+ dns_clientinfomethods_init(&cm, ns_client_sourceip);
+ dns_clientinfo_init(&ci, client);
/*
* Get resources and make 'name' be the database origin.
result = dns_db_getoriginnode(db, &node);
if (result == ISC_R_SUCCESS) {
result = dns_db_findrdataset(db, node, version,
- dns_rdatatype_ns,
- 0, client->now, rdataset,
- sigrdataset);
+ dns_rdatatype_ns, 0, client->now,
+ rdataset, sigrdataset);
} else {
CTRACE("query_addns: calling dns_db_find");
- result = dns_db_find(db, name, NULL, dns_rdatatype_ns,
- client->query.dboptions, 0, &node,
- fname, rdataset, sigrdataset);
+ result = dns_db_findext(db, name, NULL, dns_rdatatype_ns,
+ client->query.dboptions, 0, &node,
+ fname, &cm, &ci, rdataset, sigrdataset);
CTRACE("query_addns: dns_db_find complete");
}
if (result != ISC_R_SUCCESS) {
{
isc_result_t result;
dns_dbnode_t *node = NULL;
+ dns_clientinfomethods_t cm;
+ dns_clientinfo_t ci;
rdataset->trust = dns_trust_secure;
sigrdataset->trust = dns_trust_secure;
+ dns_clientinfomethods_init(&cm, ns_client_sourceip);
+ dns_clientinfo_init(&ci, client);
/*
* Save the updated secure state. Ignore failures.
*/
- result = dns_db_findnode(db, name, ISC_TRUE, &node);
+ result = dns_db_findnodeext(db, name, ISC_TRUE, &cm, &ci, &node);
if (result != ISC_R_SUCCESS)
return;
/*
isc_result_t result;
dns_dbnode_t *node = NULL;
isc_boolean_t secure = ISC_FALSE;
+ dns_clientinfomethods_t cm;
+ dns_clientinfo_t ci;
+
+ dns_clientinfomethods_init(&cm, ns_client_sourceip);
+ dns_clientinfo_init(&ci, client);
if (!dns_rdataset_isassociated(keyrdataset)) {
- result = dns_db_findnode(db, &rrsig->signer, ISC_FALSE, &node);
+ result = dns_db_findnodeext(db, &rrsig->signer, ISC_FALSE,
+ &cm, &ci, &node);
if (result != ISC_R_SUCCESS)
return (ISC_FALSE);
dns_dbversion_t *version;
dns_zone_t *zone;
isc_buffer_t b;
+ dns_clientinfomethods_t cm;
+ dns_clientinfo_t ci;
CTRACE("query_addbestns");
fname = NULL;
is_zone = ISC_FALSE;
use_zone = ISC_FALSE;
+ dns_clientinfomethods_init(&cm, ns_client_sourceip);
+ dns_clientinfo_init(&ci, client);
+
/*
* Find the right database.
*/
* Now look for the zonecut.
*/
if (is_zone) {
- result = dns_db_find(db, client->query.qname, version,
- dns_rdatatype_ns, client->query.dboptions,
- client->now, &node, fname,
- rdataset, sigrdataset);
+ result = dns_db_findext(db, client->query.qname, version,
+ dns_rdatatype_ns,
+ client->query.dboptions,
+ client->now, &node, fname,
+ &cm, &ci, rdataset, sigrdataset);
if (result != DNS_R_DELEGATION)
goto cleanup;
if (USECACHE(client)) {
int order;
dns_fixedname_t cfixed;
dns_name_t *cname;
+ dns_clientinfomethods_t cm;
+ dns_clientinfo_t ci;
CTRACE("query_addwildcardproof");
fname = NULL;
sigrdataset = NULL;
node = NULL;
+ dns_clientinfomethods_init(&cm, ns_client_sourceip);
+ dns_clientinfo_init(&ci, client);
+
/*
* Get the NOQNAME proof then if !ispositive
* get the NOWILDCARD proof.
if (fname == NULL || rdataset == NULL || sigrdataset == NULL)
goto cleanup;
- result = dns_db_find(db, name, version, dns_rdatatype_nsec, options,
- 0, &node, fname, rdataset, sigrdataset);
+ result = dns_db_findext(db, name, version, dns_rdatatype_nsec,
+ options, 0, &node, fname, &cm, &ci,
+ rdataset, sigrdataset);
if (node != NULL)
dns_db_detachnode(db, &node);
while (result == DNS_R_NXDOMAIN) {
labels = dns_name_countlabels(cname) - 1;
dns_name_split(cname, labels, NULL, cname);
- result = dns_db_find(db, cname, version,
- dns_rdatatype_nsec,
- options, 0, NULL, fname,
- NULL, NULL);
+ result = dns_db_findext(db, cname, version,
+ dns_rdatatype_nsec,
+ options, 0, NULL, fname,
+ &cm, &ci, NULL, NULL);
}
/*
* Add closest (provable) encloser NSEC3.
dns_fixedname_t fixed;
dns_name_t *found;
isc_result_t result;
+ dns_clientinfomethods_t cm;
+ dns_clientinfo_t ci;
+
+ dns_clientinfomethods_init(&cm, ns_client_sourceip);
+ dns_clientinfo_init(&ci, client);
st = client->query.rpz_st;
if ((st->state & DNS_RPZ_RECURSING) != 0) {
node = NULL;
dns_fixedname_init(&fixed);
found = dns_fixedname_name(&fixed);
- result = dns_db_find(*dbp, name, version, type, 0, client->now, &node,
- found, *rdatasetp, NULL);
+ result = dns_db_findext(*dbp, name, version, type, 0, client->now,
+ &node, found, &cm, &ci, *rdatasetp, NULL);
if (result == DNS_R_DELEGATION && is_zone && USECACHE(client)) {
/*
* Try the cache if we're authoritative for an
rpz_clean(NULL, dbp, &node, rdatasetp);
version = NULL;
dns_db_attach(client->view->cachedb, dbp);
- result = dns_db_find(*dbp, name, version, dns_rdatatype_ns,
- 0, client->now, &node, found,
- *rdatasetp, NULL);
+ result = dns_db_findext(*dbp, name, version, dns_rdatatype_ns,
+ 0, client->now, &node, found,
+ &cm, &ci, *rdatasetp, NULL);
}
rpz_clean(NULL, dbp, &node, NULL);
if (result == DNS_R_DELEGATION) {
dns_fixedname_t fixed;
dns_name_t *found;
isc_result_t result;
+ dns_clientinfomethods_t cm;
+ dns_clientinfo_t ci;
+
+ dns_clientinfomethods_init(&cm, ns_client_sourceip);
+ dns_clientinfo_init(&ci, client);
result = rpz_ready(client, zonep, dbp, nodep, rdatasetp);
if (result != ISC_R_SUCCESS) {
dns_fixedname_init(&fixed);
found = dns_fixedname_name(&fixed);
- result = dns_db_find(*dbp, qnamef, version, dns_rdatatype_any, 0,
- client->now, nodep, found, *rdatasetp, NULL);
+ result = dns_db_findext(*dbp, qnamef, version, dns_rdatatype_any, 0,
+ client->now, nodep, found, &cm, &ci,
+ *rdatasetp, NULL);
if (result == ISC_R_SUCCESS) {
dns_rdatasetiter_t *rdsiter;
qtype == dns_rdatatype_sig)
result = DNS_R_NXRRSET;
else
- result = dns_db_find(*dbp, qnamef, version,
- qtype, 0, client->now,
- nodep, found, *rdatasetp,
- NULL);
+ result = dns_db_findext(*dbp, qnamef, version,
+ qtype, 0, client->now,
+ nodep, found, &cm, &ci,
+ *rdatasetp, NULL);
}
}
switch (result) {
dns_rdata_nsec3_t nsec3;
dns_rdata_t rdata = DNS_RDATA_INIT;
isc_boolean_t optout;
+ dns_clientinfomethods_t cm;
+ dns_clientinfo_t ci;
salt_length = sizeof(salt);
result = dns_db_getnsec3parameters(db, version, &hash, NULL,
dns_name_init(&name, NULL);
dns_name_clone(qname, &name);
+ dns_clientinfomethods_init(&cm, ns_client_sourceip);
+ dns_clientinfo_init(&ci, client);
/*
* Map unknown algorithm to known value.
return;
dboptions = client->query.dboptions | DNS_DBFIND_FORCENSEC3;
- result = dns_db_find(db, dns_fixedname_name(&fixed), version,
- dns_rdatatype_nsec3, dboptions, client->now,
- NULL, fname, rdataset, sigrdataset);
+ result = dns_db_findext(db, dns_fixedname_name(&fixed), version,
+ dns_rdatatype_nsec3, dboptions, client->now,
+ NULL, fname, &cm, &ci, rdataset, sigrdataset);
if (result == DNS_R_NXDOMAIN) {
if (!dns_rdataset_isassociated(rdataset)) {
dns_rdataset_t trdataset;
isc_result_t result;
dns_rdatatype_t type;
+ dns_clientinfomethods_t cm;
+ dns_clientinfo_t ci;
CTRACE("redirect");
found = dns_fixedname_name(&fixed);
dns_rdataset_init(&trdataset);
+ dns_clientinfomethods_init(&cm, ns_client_sourceip);
+ dns_clientinfo_init(&ci, client);
+
if (WANTDNSSEC(client) && dns_db_iszone(*dbp) && dns_db_issecure(*dbp))
return (ISC_FALSE);
/*
* Lookup the requested data in the redirect zone.
*/
- result = dns_db_find(db, client->query.qname, NULL, qtype, 0,
- client->now, &node, found, &trdataset, NULL);
+ result = dns_db_findext(db, client->query.qname, NULL, qtype, 0,
+ client->now, &node, found, &cm, &ci,
+ &trdataset, NULL);
if (result != ISC_R_SUCCESS) {
if (dns_rdataset_isassociated(&trdataset))
dns_rdataset_disassociate(&trdataset);
isc_boolean_t resuming;
int line = -1;
isc_boolean_t dns64_exclude, dns64;
+ dns_clientinfomethods_t cm;
+ dns_clientinfo_t ci;
CTRACE("query_find");
is_zone = ISC_FALSE;
is_staticstub_zone = ISC_FALSE;
+ dns_clientinfomethods_init(&cm, ns_client_sourceip);
+ dns_clientinfo_init(&ci, client);
+
if (event != NULL) {
/*
* We're returning from recursion. Restore the query context
/*
* Now look for an answer in the database.
*/
- result = dns_db_find(db, client->query.qname, version, type,
- client->query.dboptions, client->now,
- &node, fname, rdataset, sigrdataset);
+ result = dns_db_findext(db, client->query.qname, version, type,
+ client->query.dboptions, client->now,
+ &node, fname, &cm, &ci, rdataset, sigrdataset);
resume:
CTRACE("query_find: resume");
result = ISC_R_FAILURE;
} else {
dns_db_attach(client->view->hints, &db);
- result = dns_db_find(db, dns_rootname,
- NULL, dns_rdatatype_ns,
- 0, client->now, &node, fname,
- rdataset, sigrdataset);
+ result = dns_db_findext(db, dns_rootname,
+ NULL, dns_rdatatype_ns,
+ 0, client->now, &node,
+ fname, &cm, &ci,
+ rdataset, sigrdataset);
}
if (result != ISC_R_SUCCESS) {
/*
if (qtype == dns_rdatatype_aaaa) {
trdataset = query_newrdataset(client);
result = dns_db_findrdataset(db, node, version,
- dns_rdatatype_a, 0,
- client->now,
- trdataset, NULL);
+ dns_rdatatype_a, 0,
+ client->now,
+ trdataset, NULL);
if (dns_rdataset_isassociated(trdataset))
dns_rdataset_disassociate(trdataset);
query_putrdataset(client, &trdataset);
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: server.c,v 1.620 2011/09/23 18:08:01 each Exp $ */
+/* $Id: server.c,v 1.621 2011/10/11 00:09:01 each Exp $ */
/*! \file */
result = dns_zonemgr_managezone(ns_g_server->zonemgr, zone);
if (result != ISC_R_SUCCESS)
- return result;
+ return (result);
dns_zone_setstats(zone, ns_g_server->zonestats);
- return ns_zone_configure_writeable_dlz(view->dlzdatabase,
- zone, zclass, origin);
+ return (ns_zone_configure_writeable_dlz(view->dlzdatabase,
+ zone, zclass, origin));
}
static isc_result_t
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dlz_dlopen_driver.c,v 1.4 2011/03/17 09:25:53 fdupont Exp $ */
+/* $Id: dlz_dlopen_driver.c,v 1.5 2011/10/11 00:09:01 each Exp $ */
#include <config.h>
static isc_result_t
dlopen_dlz_authority(const char *zone, void *driverarg, void *dbdata,
- dns_sdlzlookup_t *lookup)
+ dns_sdlzlookup_t *lookup)
{
dlopen_data_t *cd = (dlopen_data_t *) dbdata;
isc_result_t result;
static isc_result_t
dlopen_dlz_lookup(const char *zone, const char *name, void *driverarg,
- void *dbdata, dns_sdlzlookup_t *lookup)
+ void *dbdata, dns_sdlzlookup_t *lookup,
+ dns_clientinfomethods_t *methods,
+ dns_clientinfo_t *clientinfo)
{
dlopen_data_t *cd = (dlopen_data_t *) dbdata;
isc_result_t result;
UNUSED(driverarg);
MAYBE_LOCK(cd);
- result = cd->dlz_lookup(zone, name, cd->dbdata, lookup);
+ result = cd->dlz_lookup(zone, name, cd->dbdata, lookup,
+ methods, clientinfo);
MAYBE_UNLOCK(cd);
return (result);
}
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: zoneconf.c,v 1.182 2011/09/06 22:29:32 smann Exp $ */
+/* $Id: zoneconf.c,v 1.183 2011/10/11 00:09:01 each Exp $ */
/*% */
dns_zone_settype(zone, dns_zone_dlz);
result = dns_sdlz_setdb(dlzdatabase, rdclass, name, &db);
if (result != ISC_R_SUCCESS)
- return result;
+ return (result);
result = dns_zone_dlzpostload(zone, db);
dns_db_detach(&db);
- return result;
+ return (result);
}
isc_boolean_t
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: driver.c,v 1.5 2011/03/21 00:30:18 marka Exp $ */
+/* $Id: driver.c,v 1.6 2011/10/11 00:09:01 each Exp $ */
/*
* This provides a very simple example of an external loadable DLZ
return (ISC_R_SUCCESS);
}
+static isc_result_t
+fmt_address(isc_sockaddr_t *addr, char *buffer, size_t size) {
+ char addr_buf[100];
+ const char *ret;
+ isc_uint16_t port = 0;
+
+ switch (addr->type.sa.sa_family) {
+ case AF_INET:
+ port = ntohs(addr->type.sin.sin_port);
+ ret = inet_ntop(AF_INET, &addr->type.sin.sin_addr, addr_buf,
+ sizeof(addr_buf));
+ break;
+ case AF_INET6:
+ port = ntohs(addr->type.sin6.sin6_port);
+ ret = inet_ntop(AF_INET6, &addr->type.sin6.sin6_addr, addr_buf,
+ sizeof(addr_buf));
+ default:
+ return (ISC_R_FAILURE);
+ }
+
+ if (ret == NULL)
+ return (ISC_R_FAILURE);
+ snprintf(buffer, size, "%s#%u", addr_buf, port);
+ return (ISC_R_SUCCESS);
+}
/*
* Return the version of the API
return (ISC_R_NOTFOUND);
}
-
-
/*
* Look up one record
*/
isc_result_t
dlz_lookup(const char *zone, const char *name, void *dbdata,
- dns_sdlzlookup_t *lookup)
+ dns_sdlzlookup_t *lookup, dns_clientinfomethods_t *methods,
+ dns_clientinfo_t *clientinfo)
{
+ isc_result_t result;
struct dlz_example_data *state = (struct dlz_example_data *)dbdata;
isc_boolean_t found = ISC_FALSE;
+ isc_sockaddr_t *src;
char full_name[100];
int i;
else
sprintf(full_name, "%s.%s", name, state->zone_name);
+ if (strcmp(name, "source-addr") == 0) {
+ char buf[100];
+ strcpy(buf, "unknown");
+ if (methods != NULL &&
+ methods->version - methods->age >=
+ DNS_CLIENTINFOMETHODS_VERSION)
+ {
+ methods->sourceip(clientinfo, &src);
+ fmt_address(src, buf, sizeof(buf));
+ }
+
+ fprintf(stderr, "connection from: %s\n", buf);
+
+ found = ISC_TRUE;
+ result = state->putrr(lookup, "TXT", 0, buf);
+ if (result != ISC_R_SUCCESS)
+ return (result);
+ }
+
for (i = 0; i < MAX_RECORDS; i++) {
if (strcasecmp(state->current[i].name, full_name) == 0) {
- isc_result_t result;
found = ISC_TRUE;
result = state->putrr(lookup, state->current[i].type,
state->current[i].ttl,
state->current[i].data);
- if (result != ISC_R_SUCCESS) {
+ if (result != ISC_R_SUCCESS)
return (result);
- }
}
}
if (!found)
return (ISC_R_NOTFOUND);
+
return (ISC_R_SUCCESS);
}
test_update deny.example.nil. TXT "86400 TXT helloworld" "helloworld" should_fail && ret=1
status=`expr $status + $ret`
+echo "I:testing passing client info into DLZ driver"
+ret=0
+out=`$DIG $DIGOPTS +short -t txt -q source-addr.example.nil`
+addr=`eval echo $out | cut -f1 -d'#'`
+[ "$addr" = "10.53.0.1" ] || ret=1
+[ "$ret" -eq 0 ] || echo "I:failed"
+status=`expr $status + $ret`
+
exit $status
static isc_result_t
bdb_lookup(const char *zone, const char *name, void *driverarg,
- void *dbdata, dns_sdlzlookup_t *lookup)
+ void *dbdata, dns_sdlzlookup_t *lookup,
+ dns_clientinfomethods_t *methods, dns_clientinfo_t *clientinfo)
{
isc_result_t result = ISC_R_NOTFOUND;
char *tmp = NULL;
UNUSED(driverarg);
+ UNUSED(methods);
+ UNUSED(clientinfo);
memset(&key, 0, sizeof(DBT));
memset(&data, 0, sizeof(DBT));
static isc_result_t
bdbhpt_lookup(const char *zone, const char *name, void *driverarg,
- void *dbdata, dns_sdlzlookup_t *lookup)
+ void *dbdata, dns_sdlzlookup_t *lookup,
+ dns_clientinfomethods_t *methods, dns_clientinfo_t *clientinfo)
{
isc_result_t result = ISC_R_NOTFOUND;
char *keyStr = NULL;
UNUSED(driverarg);
+ UNUSED(methods);
+ UNUSED(clientinfo);
memset(&key, 0, sizeof(DBT));
memset(&data, 0, sizeof(DBT));
static isc_result_t
fs_lookup(const char *zone, const char *name, void *driverarg,
- void *dbdata, dns_sdlzlookup_t *lookup)
+ void *dbdata, dns_sdlzlookup_t *lookup,
+ dns_clientinfomethods_t *methods, dns_clientinfo_t *clientinfo)
{
isc_result_t result;
char *path;
UNUSED(driverarg);
UNUSED(lookup);
+ UNUSED(methods);
+ UNUSED(clientinfo);
if (strcmp(name, "*") == 0)
/*
static isc_result_t
dlz_ldap_lookup(const char *zone, const char *name, void *driverarg,
- void *dbdata, dns_sdlzlookup_t *lookup)
+ void *dbdata, dns_sdlzlookup_t *lookup,
+ dns_clientinfomethods_t *methods, dns_clientinfo_t *clientinfo)
{
isc_result_t result;
+
UNUSED(driverarg);
+ UNUSED(methods);
+ UNUSED(clientinfo);
if (strcmp(name, "*") == 0)
result = ldap_get_results(zone, "~", NULL, LOOKUP,
/*% if zone is supported, lookup up a (or multiple) record(s) in it */
static isc_result_t
mysql_lookup(const char *zone, const char *name, void *driverarg,
- void *dbdata, dns_sdlzlookup_t *lookup)
+ void *dbdata, dns_sdlzlookup_t *lookup,
+ dns_clientinfomethods_t *methods, dns_clientinfo_t *clientinfo)
{
isc_result_t result;
MYSQL_RES *rs = NULL;
UNUSED(driverarg);
+ UNUSED(methods);
+ UNUSED(clientinfo);
/* run the query and get the result set from the database. */
result = mysql_get_resultset(zone, name, NULL, LOOKUP, dbdata, &rs);
static isc_result_t
odbc_lookup(const char *zone, const char *name, void *driverarg,
- void *dbdata, dns_sdlzlookup_t *lookup)
+ void *dbdata, dns_sdlzlookup_t *lookup,
+ dns_clientinfomethods_t *methods, dns_clientinfo_t *clientinfo)
{
isc_result_t result;
dbinstance_t *dbi = NULL;
UNUSED(driverarg);
+ UNUSED(methods);
+ UNUSED(clientinfo);
/* run the query and get the result set from the database. */
result = odbc_get_resultset(zone, name, NULL, LOOKUP, dbdata, &dbi);
/*% if zone is supported, lookup up a (or multiple) record(s) in it */
static isc_result_t
postgres_lookup(const char *zone, const char *name, void *driverarg,
- void *dbdata, dns_sdlzlookup_t *lookup)
+ void *dbdata, dns_sdlzlookup_t *lookup,
+ dns_clientinfomethods_t *methods, dns_clientinfo_t *clientinfo)
{
isc_result_t result;
PGresult *rs = NULL;
UNUSED(driverarg);
+ UNUSED(methods);
+ UNUSED(clientinfo);
/* run the query and get the result set from the database. */
result = postgres_get_resultset(zone, name, NULL, LOOKUP, dbdata, &rs);
static isc_result_t
stub_dlz_lookup(const char *zone, const char *name, void *driverarg,
- void *dbdata, dns_sdlzlookup_t *lookup)
+ void *dbdata, dns_sdlzlookup_t *lookup,
+ dns_clientinfomethods_t *methods, dns_clientinfo_t *clientinfo)
{
isc_result_t result;
config_data_t *cd;
UNUSED(zone);
UNUSED(driverarg);
+ UNUSED(methods);
+ UNUSED(clientinfo);
cd = (config_data_t *) dbdata;
typedef bool isc_boolean_t;
typedef uint32_t dns_ttl_t;
-#define DLZ_DLOPEN_VERSION 1
+#define DLZ_DLOPEN_VERSION 2
/* return this in flags to dlz_version() if thread safe */
#define DNS_SDLZFLAG_THREADSAFE 0x00000001U
typedef void *dns_sdlzlookup_t;
typedef void *dns_sdlzallnodes_t;
typedef void *dns_view_t;
+typedef void *dns_dlzclientcallback_t;
/*
* prototypes for the functions you can include in your driver
* dlz_version() is required for all DLZ external drivers. It should
* return DLZ_DLOPEN_VERSION
*/
-int dlz_version(unsigned int *flags);
+int
+dlz_version(unsigned int *flags);
/*
* dlz_create() is required for all DLZ external drivers.
*/
-isc_result_t dlz_create(const char *dlzname, unsigned int argc, char *argv[], void **dbdata, ...);
+isc_result_t
+dlz_create(const char *dlzname, unsigned int argc, char *argv[],
+ void **dbdata, ...);
/*
* dlz_destroy() is optional, and will be called when the driver is
* unloaded if supplied
*/
-void dlz_destroy(void *dbdata);
+void
+dlz_destroy(void *dbdata);
/*
- dlz_findzonedb is required for all DLZ external drivers
+ * dlz_findzonedb is required for all DLZ external drivers
*/
-isc_result_t dlz_findzonedb(void *dbdata, const char *name);
+isc_result_t
+dlz_findzonedb(void *dbdata, const char *name);
/*
- dlz_lookup is required for all DLZ external drivers
+ * dlz_lookup is required for all DLZ external drivers
*/
-isc_result_t dlz_lookup(const char *zone, const char *name,
- void *dbdata, dns_sdlzlookup_t *lookup);
+isc_result_t
+dlz_lookup(const char *zone, const char *name, void *dbdata,
+ dns_sdlzlookup_t *lookup);
/*
- dlz_allowzonexfr() is optional, and should be supplied if you want
- to support zone transfers
+ * dlz_allowzonexfr() is optional, and should be supplied if you want to
+ * support zone transfers
*/
-isc_result_t dlz_allowzonexfr(void *dbdata, const char *name, const char *client);
+isc_result_t
+dlz_allowzonexfr(void *dbdata, const char *name, const char *client);
/*
- dlz_allnodes() is optional, but must be supplied if supply a
- dlz_allowzonexfr() function
+ * dlz_allnodes() is optional, but must be supplied if supply a
+ * dlz_allowzonexfr() function
*/
-isc_result_t dlz_allnodes(const char *zone, void *dbdata, dns_sdlzallnodes_t *allnodes);
+isc_result_t
+dlz_allnodes(const char *zone, void *dbdata, dns_sdlzallnodes_t *allnodes);
/*
- dlz_newversion() is optional. It should be supplied if you want to
- support dynamic updates.
+ * dlz_newversion() is optional. It should be supplied if you want to
+ * support dynamic updates.
*/
-isc_result_t dlz_newversion(const char *zone, void *dbdata, void **versionp);
+isc_result_t
+dlz_newversion(const char *zone, void *dbdata, void **versionp);
/*
- dlz_closeversion() is optional, but must be supplied if you supply
- a dlz_newversion() function
+ * dlz_closeversion() is optional, but must be supplied if you supply a
+ * dlz_newversion() function
*/
-void dlz_closeversion(const char *zone, isc_boolean_t commit, void *dbdata, void **versionp);
+void
+dlz_closeversion(const char *zone, isc_boolean_t commit, void *dbdata,
+ void **versionp);
/*
- dlz_configure() is optional, but must be supplied if you want to
- support dynamic updates
+ * dlz_configure() is optional, but must be supplied if you want to support
+ * dynamic updates
*/
-isc_result_t dlz_configure(dns_view_t *view, void *dbdata);
+isc_result_t
+dlz_configure(dns_view_t *view, void *dbdata);
/*
- dlz_ssumatch() is optional, but must be supplied if you want to
- support dynamic updates
+ * dlz_setclientcallback() is optional, but must be supplied if you want
+ * to retrieve information about the client before sending a reply.
*/
-isc_boolean_t dlz_ssumatch(const char *signer, const char *name, const char *tcpaddr,
- const char *type, const char *key, uint32_t keydatalen, uint8_t *keydata,
- void *dbdata);
+isc_result_t
+dlz_setclientcallback(dns_dlzclientcallback_t callback);
/*
- dlz_addrdataset() is optional, but must be supplied if you want to
- support dynamic updates
+ * dlz_ssumatch() is optional, but must be supplied if you want to support
+ * dynamic updates
*/
-isc_result_t dlz_addrdataset(const char *name, const char *rdatastr, void *dbdata, void *version);
+
+isc_boolean_t
+dlz_ssumatch(const char *signer, const char *name, const char *tcpaddr,
+ const char *type, const char *key, uint32_t keydatalen,
+ uint8_t *keydata, void *dbdata);
/*
- dlz_subrdataset() is optional, but must be supplied if you want to
- support dynamic updates
+ * dlz_addrdataset() is optional, but must be supplied if you want to
+ * support dynamic updates
+ */
+isc_result_t
+dlz_addrdataset(const char *name, const char *rdatastr, void *dbdata,
+ void *version);
+
+/* dlz_subrdataset() is optional, but must be supplied if you want to
+ * support dynamic updates
*/
-isc_result_t dlz_subrdataset(const char *name, const char *rdatastr, void *dbdata, void *version);
+isc_result_t
+dlz_subrdataset(const char *name, const char *rdatastr, void *dbdata,
+ void *version);
/*
- dlz_delrdataset() is optional, but must be supplied if you want to
- support dynamic updates
+ * dlz_delrdataset() is optional, but must be supplied if you want to
+ * support dynamic updates
*/
-isc_result_t dlz_delrdataset(const char *name, const char *type, void *dbdata, void *version);
+isc_result_t
+dlz_delrdataset(const char *name, const char *type, void *dbdata,
+ void *version);
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: bdb.c,v 1.1 2002/05/16 04:25:22 marka Exp $ */
+/* $Id: bdb.c,v 1.2 2011/10/11 00:09:02 each Exp $ */
/*
* BIND 9.1.x simple database driver
}
static isc_result_t
+#ifdef DNS_CLIENTINFO_VERSION
+bdb_lookup(const char *zone, const char *name, void *dbdata,
+ dns_sdblookup_t *l, dns_clientinfomethods_t *methods,
+ dns_clientinfo_t *clientinfo)
+#else
bdb_lookup(const char *zone, const char *name, void *dbdata,
dns_sdblookup_t *l)
+#endif /* DNS_CLIENTINFO_VERSION */
{
int ret;
char *type, *rdata;
DBT key, data;
UNUSED(zone);
+#ifdef DNS_CLIENTINFO_VERSION
+ UNUSED(methods);
+ UNUSED(clientinfo);
+#endif /* DNS_CLIENTINFO_VERSION */
if ((ret = ((DB *)dbdata)->cursor((DB *)dbdata, NULL, &c, 0)) != 0) {
isc_log_iwrite(dns_lctx, DNS_LOGCATEGORY_DATABASE,
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dirdb.c,v 1.12 2007/06/19 23:47:07 tbox Exp $ */
+/* $Id: dirdb.c,v 1.13 2011/10/11 00:09:02 each Exp $ */
/*
* A simple database driver that returns basic information about
* Any name will be interpreted as a pathname offset from the directory
* specified in the configuration file.
*/
+#ifdef DNS_CLIENTINFO_VERSION
+static isc_result_t
+dirdb_lookup(const char *zone, const char *name, void *dbdata,
+ dns_sdblookup_t *lookup, dns_clientinfomethods_t *methods,
+ dns_clientinfo_t *clientinfo)
+#else
static isc_result_t
dirdb_lookup(const char *zone, const char *name, void *dbdata,
dns_sdblookup_t *lookup)
+#endif /* DNS_CLIENTINFO_VERSION */
{
char filename[255];
char filename2[255];
UNUSED(zone);
UNUSED(dbdata);
+#ifdef DNS_CLIENTINFO_VERSION
+ UNUSED(methods);
+ UNUSED(clientinfo);
+#endif /* DNS_CLIENTINFO_VERSION */
if (strcmp(name, "@") == 0)
snprintf(filename, sizeof(filename), "%s", (char *)dbdata);
}
}
+#ifdef DNS_CLIENTINFO_VERSION
static isc_result_t
-ldapdb_search(const char *zone, const char *name, void *dbdata, void *retdata)
+ldapdb_search(const char *zone, const char *name, void *dbdata, void *retdata,
+ dns_clientinfomethods_t *methods, dns_clientinfo_t *clientinfo)
+#else
+static isc_result_t
+ldapdb_search(const char *zone, const char *name, void *dbdata, void *retdata,
+ void *methods, void *clientinfo)
+#endif /* DNS_CLIENTINFO_VERSION */
{
struct ldapdb_data *data = dbdata;
isc_result_t result = ISC_R_NOTFOUND;
#endif
int i, j, errno, msgid;
+ UNUSED(methods);
+ UNUSED(clientinfo);
+
ldp = ldapdb_getconn(data);
if (ldp == NULL)
return (ISC_R_FAILURE);
/* callback routines */
+#ifdef DNS_CLIENTINFO_VERSION
+static isc_result_t
+ldapdb_lookup(const char *zone, const char *name, void *dbdata,
+ dns_sdblookup_t *lookup, dns_clientinfomethods_t *methods,
+ dns_clientinfo_t *clientinfo)
+{
+ return (ldapdb_search(zone, name, dbdata, lookup, NULL, NULL));
+}
+#else
static isc_result_t
ldapdb_lookup(const char *zone, const char *name, void *dbdata,
dns_sdblookup_t *lookup)
{
- return ldapdb_search(zone, name, dbdata, lookup);
+ return (ldapdb_search(zone, name, dbdata, lookup, methods,
+ clientinfo));
}
+#endif /* DNS_CLIENTINFO_VERSION */
static isc_result_t
ldapdb_allnodes(const char *zone, void *dbdata,
dns_sdballnodes_t *allnodes)
{
- return ldapdb_search(zone, NULL, dbdata, allnodes);
+ return (ldapdb_search(zone, NULL, dbdata, allnodes, NULL, NULL));
}
static char *
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: pgsqldb.c,v 1.15 2007/06/19 23:47:07 tbox Exp $ */
+/* $Id: pgsqldb.c,v 1.16 2011/10/11 00:09:02 each Exp $ */
#include <config.h>
* Queries are converted into SQL queries and issued synchronously. Errors
* are handled really badly.
*/
+#ifdef DNS_CLIENTINFO_VERSION
+static isc_result_t
+pgsqldb_lookup(const char *zone, const char *name, void *dbdata,
+ dns_sdblookup_t *lookup, dns_clientinfomethods_t *methods,
+ dns_clientinfo_t *clientinfo)
+#else
static isc_result_t
pgsqldb_lookup(const char *zone, const char *name, void *dbdata,
dns_sdblookup_t *lookup)
+#endif /* DNS_CLIENTINFO_VERSION */
{
isc_result_t result;
struct dbinfo *dbi = dbdata;
int i;
UNUSED(zone);
+#ifdef DNS_CLIENTINFO_VERSION
+ UNUSED(methods);
+ UNUSED(clientinfo);
+#endif /* DNS_CLIENTINFO_VERSION */
canonname = isc_mem_get(ns_g_mctx, strlen(name) * 2 + 1);
if (canonname == NULL)
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: sqlitedb.c,v 1.1 2007/03/05 05:30:22 marka Exp $ */
+/* $Id: sqlitedb.c,v 1.2 2011/10/11 00:09:02 each Exp $ */
#include <config.h>
}
+#ifdef DNS_CLIENTINFO_VERSION
static isc_result_t
-sqlitedb_lookup(const char *zone,
- const char *name, void *dbdata,
+sqlitedb_lookup(const char *zone, const char *name, void *dbdata,
+ dns_sdblookup_t *lookup, dns_clientinfomethods_t *methods,
+ dns_clientinfo_t *clientinfo)
+#else
+static isc_result_t
+sqlitedb_lookup(const char *zone, const char *name, void *dbdata,
dns_sdblookup_t *lookup)
+#endif /* DNS_CLIENTINFO_VERSION */
/*
* synchronous absolute name lookup
*/
int result;
UNUSED(zone);
+#ifdef DNS_CLIENTINFO_VERSION
+ UNUSED(methods);
+ UNUSED(clientinfo);
+#endif /* DNS_CLIENTINFO_VERSION */
sql = sqlite3_mprintf(
"SELECT TTL,RDTYPE,RDATA FROM \"%q\" WHERE "
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: tcldb.c,v 1.10 2007/06/19 23:47:10 tbox Exp $ */
+/* $Id: tcldb.c,v 1.11 2011/10/11 00:09:02 each Exp $ */
/*
* A simple database driver that calls a Tcl procedure to define
/*
* Perform a lookup, by invoking the Tcl procedure "lookup".
*/
+#ifdef DNS_CLIENTINFO_VERSION
+static isc_result_t
+tcldb_lookup(const char *zone, const char *name, void *dbdata,
+ dns_sdblookup_t *lookup, dns_clientinfomethods_t *methods,
+ dns_clientinfo_t *clientinfo)
+#else
static isc_result_t
tcldb_lookup(const char *zone, const char *name, void *dbdata,
dns_sdblookup_t *lookup)
+#endif /* DNS_CLIENTINFO_VERSION */
{
isc_result_t result = ISC_R_SUCCESS;
int tclres;
char *cmdv[3];
char *cmd;
+#ifdef DNS_CLIENTINFO_VERSION
+ UNUSED(methods);
+ UNUSED(clientinfo);
+#endif /* DNS_CLIENTINFO_VERSION */
+
tcldb_driver_t *driver = (tcldb_driver_t *) dbdata;
cmdv[0] = "lookup";
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: timedb.c,v 1.10 2007/06/19 23:47:10 tbox Exp $ */
+/* $Id: timedb.c,v 1.11 2011/10/11 00:09:03 each Exp $ */
/*
* A simple database driver that enables the server to return the
* "clock" is a CNAME to "time"
* "current" is a DNAME to "@" (try time.current.time)
*/
+#ifdef DNS_CLIENTINFO_VERSION
+static isc_result_t
+timedb_lookup(const char *zone, const char *name, void *dbdata,
+ dns_sdblookup_t *lookup, dns_clientinfomethods_t *methods,
+ dns_clientinfo_t *clientinfo)
+#else
static isc_result_t
timedb_lookup(const char *zone, const char *name, void *dbdata,
dns_sdblookup_t *lookup)
+#endif /* DNS_CLIENTINFO_VERSION */
{
isc_result_t result;
UNUSED(zone);
UNUSED(dbdata);
+#ifdef DNS_CLIENTINFO_VERSION
+ UNUSED(methods);
+ UNUSED(clientinfo);
+#endif /* DNS_CLIENTINFO_VERSION */
if (strcmp(name, "@") == 0 || strcmp(name, "time") == 0) {
time_t now = time(NULL);
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.179 2011/07/01 02:25:47 marka Exp $
+# $Id: Makefile.in,v 1.180 2011/10/11 00:09:03 each Exp $
srcdir = @srcdir@
VPATH = @srcdir@
# Alphabetically
DNSOBJS = acache.@O@ acl.@O@ adb.@O@ byaddr.@O@ \
- cache.@O@ callbacks.@O@ compress.@O@ \
+ cache.@O@ callbacks.@O@ clientinfo.@O@ compress.@O@ \
db.@O@ dbiterator.@O@ dbtable.@O@ diff.@O@ dispatch.@O@ \
dlz.@O@ dns64.@O@ dnssec.@O@ ds.@O@ forward.@O@ iptable.@O@ \
journal.@O@ keydata.@O@ keytable.@O@ \
hmac_link.c key.c
DNSSRCS = acache.c acl.c adb.c byaddr.c \
- cache.c callbacks.c compress.c \
+ cache.c callbacks.c clientinfo.c compress.c \
db.c dbiterator.c dbtable.c diff.c dispatch.c \
dlz.c dns64.c dnssec.c ds.c forward.c iptable.c journal.c \
keydata.c keytable.c lib.c log.c lookup.c \
--- /dev/null
+/*
+ * Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC 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: clientinfo.c,v 1.2 2011/10/11 00:09:03 each Exp $ */
+
+/*! \file */
+
+#include <dns/clientinfo.h>
+
+void
+dns_clientinfomethods_init(dns_clientinfomethods_t *methods,
+ dns_clientinfo_sourceip_t sourceip)
+{
+ methods->version = DNS_CLIENTINFOMETHODS_VERSION;
+ methods->age = DNS_CLIENTINFOMETHODS_AGE;
+ methods->sourceip = sourceip;
+}
+
+void
+dns_clientinfo_init(dns_clientinfo_t *ci, void *data) {
+ ci->version = DNS_CLIENTINFO_VERSION;
+ ci->data = data;
+}
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: db.c,v 1.97 2011/01/13 04:59:25 tbox Exp $ */
+/* $Id: db.c,v 1.98 2011/10/11 00:09:03 each Exp $ */
/*! \file */
#include <isc/util.h>
#include <dns/callbacks.h>
+#include <dns/clientinfo.h>
#include <dns/db.h>
#include <dns/dbiterator.h>
#include <dns/log.h>
REQUIRE(DNS_DB_VALID(db));
REQUIRE(nodep != NULL && *nodep == NULL);
- return ((db->methods->findnode)(db, name, create, nodep));
+ if (db->methods->findnode != NULL)
+ return ((db->methods->findnode)(db, name, create, nodep));
+ else
+ return ((db->methods->findnodeext)(db, name, create,
+ NULL, NULL, nodep));
+}
+
+isc_result_t
+dns_db_findnodeext(dns_db_t *db, dns_name_t *name,
+ isc_boolean_t create, dns_clientinfomethods_t *methods,
+ dns_clientinfo_t *clientinfo, dns_dbnode_t **nodep)
+{
+ /*
+ * Find the node with name 'name', passing 'arg' to the database
+ * implementation.
+ */
+
+ REQUIRE(DNS_DB_VALID(db));
+ REQUIRE(nodep != NULL && *nodep == NULL);
+
+ if (db->methods->findnodeext != NULL)
+ return ((db->methods->findnodeext)(db, name, create,
+ methods, clientinfo, nodep));
+ else
+ return ((db->methods->findnode)(db, name, create, nodep));
}
isc_result_t
dns_dbnode_t **nodep, dns_name_t *foundname,
dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset)
{
-
/*
* Find the best match for 'name' and 'type' in version 'version'
* of 'db'.
(DNS_RDATASET_VALID(sigrdataset) &&
! dns_rdataset_isassociated(sigrdataset)));
- return ((db->methods->find)(db, name, version, type, options, now,
- nodep, foundname, rdataset, sigrdataset));
+ if (db->methods->find != NULL)
+ return ((db->methods->find)(db, name, version, type,
+ options, now, nodep, foundname,
+ rdataset, sigrdataset));
+ else
+ return ((db->methods->findext)(db, name, version, type,
+ options, now, nodep, foundname,
+ NULL, NULL,
+ rdataset, sigrdataset));
+}
+
+isc_result_t
+dns_db_findext(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version,
+ dns_rdatatype_t type, unsigned int options, isc_stdtime_t now,
+ dns_dbnode_t **nodep, dns_name_t *foundname,
+ dns_clientinfomethods_t *methods, dns_clientinfo_t *clientinfo,
+ dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset)
+{
+
+ /*
+ * Find the best match for 'name' and 'type' in version 'version'
+ * of 'db', passing in 'arg'.
+ */
+
+ REQUIRE(DNS_DB_VALID(db));
+ REQUIRE(type != dns_rdatatype_rrsig);
+ REQUIRE(nodep == NULL || (nodep != NULL && *nodep == NULL));
+ REQUIRE(dns_name_hasbuffer(foundname));
+ REQUIRE(rdataset == NULL ||
+ (DNS_RDATASET_VALID(rdataset) &&
+ ! dns_rdataset_isassociated(rdataset)));
+ REQUIRE(sigrdataset == NULL ||
+ (DNS_RDATASET_VALID(sigrdataset) &&
+ ! dns_rdataset_isassociated(sigrdataset)));
+
+ if (db->methods->findext != NULL)
+ return ((db->methods->findext)(db, name, version, type,
+ options, now, nodep, foundname,
+ methods, clientinfo,
+ rdataset, sigrdataset));
+ else
+ return ((db->methods->find)(db, name, version, type,
+ options, now, nodep, foundname,
+ rdataset, sigrdataset));
}
isc_result_t
isc_stdtime_t now, dns_rdataset_t *rdataset,
dns_rdataset_t *sigrdataset)
{
- /*
- * Search for an rdataset of type 'type' at 'node' that are in version
- * 'version' of 'db'. If found, make 'rdataset' refer to it.
- */
-
REQUIRE(DNS_DB_VALID(db));
REQUIRE(node != NULL);
REQUIRE(DNS_RDATASET_VALID(rdataset));
(DNS_RDATASET_VALID(sigrdataset) &&
! dns_rdataset_isassociated(sigrdataset)));
- return ((db->methods->findrdataset)(db, node, version, type, covers,
- now, rdataset, sigrdataset));
+ return ((db->methods->findrdataset)(db, node, version, type,
+ covers, now, rdataset,
+ sigrdataset));
}
isc_result_t
--- /dev/null
+/*
+ * Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or 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 ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL ISC 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: clientinfo.h,v 1.2 2011/10/11 00:09:03 each Exp $ */
+
+#ifndef DNS_CLIENTINFO_H
+#define DNS_CLIENTINFO_H 1
+
+/*****
+ ***** Module Info
+ *****/
+
+/*! \file dns/clientinfo.h
+ * \brief
+ * The DNS clientinfo interface allows libdns to retrieve information
+ * about the client from the caller.
+ *
+ * The clientinfo interface is used by the DNS DB and DLZ interfaces;
+ * it allows databases to modify their answers on the basis of information
+ * about the client, such as source IP address.
+ *
+ * dns_clientinfo_t contains a pointer to an opaque structure containing
+ * client information in some form. dns_clientinfomethods_t contains a
+ * list of methods which operate on that opaque structure to return
+ * potentially useful data. Both structures also contain versioning
+ * information.
+ */
+
+/*****
+ ***** Imports
+ *****/
+
+#include <isc/sockaddr.h>
+#include <isc/types.h>
+
+ISC_LANG_BEGINDECLS
+
+/*****
+ ***** Types
+ *****/
+
+#define DNS_CLIENTINFO_VERSION 1
+typedef struct dns_clientinfo {
+ isc_uint16_t version;
+ void *data;
+} dns_clientinfo_t;
+
+typedef isc_result_t (*dns_clientinfo_sourceip_t)(dns_clientinfo_t *client,
+ isc_sockaddr_t **addrp);
+
+#define DNS_CLIENTINFOMETHODS_VERSION 1
+#define DNS_CLIENTINFOMETHODS_AGE 0
+
+typedef struct dns_clientinfomethods {
+ isc_uint16_t version;
+ isc_uint16_t age;
+ dns_clientinfo_sourceip_t sourceip;
+} dns_clientinfomethods_t;
+
+/*****
+ ***** Methods
+ *****/
+void
+dns_clientinfomethods_init(dns_clientinfomethods_t *methods,
+ dns_clientinfo_sourceip_t sourceip);
+
+void
+dns_clientinfo_init(dns_clientinfo_t *ci, void *data);
+
+ISC_LANG_ENDDECLS
+
+#endif /* DNS_CLIENTINFO_H */
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: db.h,v 1.105 2011/05/19 00:31:57 smann Exp $ */
+/* $Id: db.h,v 1.106 2011/10/11 00:09:03 each Exp $ */
#ifndef DNS_DB_H
#define DNS_DB_H 1
#include <isc/ondestroy.h>
#include <isc/stdtime.h>
+#include <dns/clientinfo.h>
#include <dns/fixedname.h>
#include <dns/name.h>
#include <dns/rdata.h>
dns_dbversion_t *version,
dns_rdataset_t *ardataset,
dns_rpz_st_t *st);
+ isc_result_t (*findnodeext)(dns_db_t *db, dns_name_t *name,
+ isc_boolean_t create,
+ dns_clientinfomethods_t *methods,
+ dns_clientinfo_t *clientinfo,
+ dns_dbnode_t **nodep);
+ isc_result_t (*findext)(dns_db_t *db, dns_name_t *name,
+ dns_dbversion_t *version,
+ dns_rdatatype_t type, unsigned int options,
+ isc_stdtime_t now,
+ dns_dbnode_t **nodep, dns_name_t *foundname,
+ dns_clientinfomethods_t *methods,
+ dns_clientinfo_t *clientinfo,
+ dns_rdataset_t *rdataset,
+ dns_rdataset_t *sigrdataset);
} dns_dbmethods_t;
typedef isc_result_t
isc_result_t
dns_db_findnode(dns_db_t *db, dns_name_t *name, isc_boolean_t create,
dns_dbnode_t **nodep);
+
+isc_result_t
+dns_db_findnodeext(dns_db_t *db, dns_name_t *name, isc_boolean_t create,
+ dns_clientinfomethods_t *methods,
+ dns_clientinfo_t *clientinfo, dns_dbnode_t **nodep);
/*%<
* Find the node with name 'name'.
*
+ * dns_db_findnodeext() (findnode extended) also accepts parameters
+ * 'methods' and 'clientinfo', which, when provided, enable the database to
+ * retreive information about the client from the caller, and modify its
+ * response on the basis of that information.
+ *
* Notes:
* \li If 'create' is ISC_TRUE and no node with name 'name' exists, then
* such a node will be created.
dns_rdatatype_t type, unsigned int options, isc_stdtime_t now,
dns_dbnode_t **nodep, dns_name_t *foundname,
dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset);
+
+isc_result_t
+dns_db_findext(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version,
+ dns_rdatatype_t type, unsigned int options, isc_stdtime_t now,
+ dns_dbnode_t **nodep, dns_name_t *foundname,
+ dns_clientinfomethods_t *methods, dns_clientinfo_t *clientinfo,
+ dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset);
/*%<
* Find the best match for 'name' and 'type' in version 'version' of 'db'.
*
+ * dns_db_findext() (find extended) also accepts parameters 'methods'
+ * and 'clientinfo', which when provided enable the database to retreive
+ * information about the client from the caller, and modify its response
+ * on the basis of this information.
+ *
* Notes:
*
* \li If type == dns_rdataset_any, then rdataset will not be bound.
dns_rdatatype_t type, dns_rdatatype_t covers,
isc_stdtime_t now, dns_rdataset_t *rdataset,
dns_rdataset_t *sigrdataset);
+
/*%<
* Search for an rdataset of type 'type' at 'node' that are in version
* 'version' of 'db'. If found, make 'rdataset' refer to it.
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dlz_dlopen.h,v 1.2 2011/03/17 09:25:54 fdupont Exp $ */
+/* $Id: dlz_dlopen.h,v 1.3 2011/10/11 00:09:03 each Exp $ */
/*! \file dns/dlz_open.h */
* for the entry points of an external DLZ module for bind9.
*/
-#define DLZ_DLOPEN_VERSION 1
+#define DLZ_DLOPEN_VERSION 2
/*
* dlz_dlopen_version() is required for all DLZ external drivers. It
typedef isc_result_t dlz_dlopen_lookup_t (const char *zone,
const char *name,
void *dbdata,
- dns_sdlzlookup_t *lookup);
+ dns_sdlzlookup_t *lookup,
+ dns_clientinfomethods_t *methods,
+ dns_clientinfo_t *clientinfo);
/*
* dlz_dlopen_authority is optional() if dlz_dlopen_lookup()
typedef isc_result_t dlz_dlopen_configure_t (dns_view_t *view,
void *dbdata);
+/*
+ * dlz_dlopen_setclientcallback() is optional, but must be supplied if you
+ * want to retrieve information about the client (e.g., source address)
+ * before sending a replay.
+ */
+typedef isc_result_t dlz_dlopen_setclientcallback_t (dns_view_t *view,
+ void *dbdata);
+
+
/*
* dlz_dlopen_ssumatch() is optional, but must be supplied if you want
* to support dynamic updates
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: sdb.h,v 1.23 2009/01/17 23:47:43 tbox Exp $ */
+/* $Id: sdb.h,v 1.24 2011/10/11 00:09:03 each Exp $ */
#ifndef DNS_SDB_H
#define DNS_SDB_H 1
#include <isc/lang.h>
+#include <dns/clientinfo.h>
#include <dns/types.h>
/***
typedef isc_result_t
(*dns_sdblookupfunc_t)(const char *zone, const char *name, void *dbdata,
- dns_sdblookup_t *);
+ dns_sdblookup_t *lookup,
+ dns_clientinfomethods_t *methods,
+ dns_clientinfo_t *clientinfo);
typedef isc_result_t
(*dns_sdbauthorityfunc_t)(const char *zone, void *dbdata, dns_sdblookup_t *);
* USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: sdlz.h,v 1.16 2011/03/17 23:47:30 tbox Exp $ */
+/* $Id: sdlz.h,v 1.17 2011/10/11 00:09:03 each Exp $ */
/*! \file dns/sdlz.h */
#ifndef SDLZ_H
#define SDLZ_H 1
+#include <dns/clientinfo.h>
#include <dns/dlz.h>
ISC_LANG_BEGINDECLS
typedef isc_result_t
(*dns_sdlzlookupfunc_t)(const char *zone, const char *name, void *driverarg,
- void *dbdata, dns_sdlzlookup_t *lookup);
+ void *dbdata, dns_sdlzlookup_t *lookup,
+ dns_clientinfomethods_t *methods,
+ dns_clientinfo_t *clientinfo);
/*%<
* Method prototype. Drivers implementing the SDLZ interface MUST
- * supply a lookup method. This method is called when the DNS server
- * is performing a query, after the find zone and before any other
- * methods have been called. This function returns record DNS record
+ * supply a lookup method. This method is called when the
+ * DNS server is performing a query, after the find zone and before any
+ * other methods have been called. This function returns DNS record
* information using the dns_sdlz_putrr and dns_sdlz_putsoa functions.
* If this function supplies authority information for the DNS record
* the authority method is not required. If it does not, the
- * authority function is required. A SDLZ driver must implement a
- * lookup method.
+ * authority function is required.
+ *
+ * The 'methods' and 'clientinfo' args allow an SDLZ driver to retrieve
+ * information about the querying client (such as source IP address)
+ * from the caller.
*/
typedef isc_result_t (*dns_sdlznewversion_t)(const char *zone,
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rbtdb.c,v 1.316 2011/08/23 00:59:23 each Exp $ */
+/* $Id: rbtdb.c,v 1.317 2011/10/11 00:09:03 each Exp $ */
/*! \file */
NULL,
#ifdef BIND9
get_rpz_enabled,
- rpz_findips
+ rpz_findips,
#else
NULL,
- NULL
+ NULL,
#endif
+ NULL,
+ NULL
};
static dns_dbmethods_t cache_methods = {
isdnssec,
getrrsetstats,
NULL,
+ NULL,
+ NULL,
NULL
};
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: sdb.c,v 1.78 2011/03/14 13:40:52 fdupont Exp $ */
+/* $Id: sdb.c,v 1.79 2011/10/11 00:09:03 each Exp $ */
/*! \file */
}
static isc_result_t
-findnode(dns_db_t *db, dns_name_t *name, isc_boolean_t create,
- dns_dbnode_t **nodep)
+findnodeext(dns_db_t *db, dns_name_t *name, isc_boolean_t create,
+ dns_clientinfomethods_t *methods, dns_clientinfo_t *clientinfo,
+ dns_dbnode_t **nodep)
{
dns_sdb_t *sdb = (dns_sdb_t *)db;
dns_sdbnode_t *node = NULL;
isorigin = dns_name_equal(name, &sdb->common.origin);
MAYBE_LOCK(sdb);
- result = imp->methods->lookup(sdb->zone, namestr, sdb->dbdata, node);
+ result = imp->methods->lookup(sdb->zone, namestr, sdb->dbdata,
+ node, methods, clientinfo);
MAYBE_UNLOCK(sdb);
if (result != ISC_R_SUCCESS &&
!(result == ISC_R_NOTFOUND &&
}
static isc_result_t
-find(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version,
- dns_rdatatype_t type, unsigned int options, isc_stdtime_t now,
- dns_dbnode_t **nodep, dns_name_t *foundname,
- dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset)
+findext(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version,
+ dns_rdatatype_t type, unsigned int options, isc_stdtime_t now,
+ dns_dbnode_t **nodep, dns_name_t *foundname,
+ dns_clientinfomethods_t *methods, dns_clientinfo_t *clientinfo,
+ dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset)
{
dns_sdb_t *sdb = (dns_sdb_t *)db;
dns_dbnode_t *node = NULL;
* Look up the next label.
*/
dns_name_getlabelsequence(name, nlabels - i, i, xname);
- result = findnode(db, xname, ISC_FALSE, &node);
+ result = findnodeext(db, xname, ISC_FALSE, methods,
+ clientinfo, &node);
if (result != ISC_R_SUCCESS) {
result = DNS_R_NXDOMAIN;
continue;
newversion,
attachversion,
closeversion,
- findnode,
- find,
+ NULL,
+ NULL,
findzonecut,
attachnode,
detachnode,
ispersistent,
overmem,
settask,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
+ NULL, /* getoriginnode */
+ NULL, /* transfernode */
+ NULL, /* getnsec3parameters */
+ NULL, /* findnsec3node */
+ NULL, /* setsigningtime */
+ NULL, /* getsigningtime */
+ NULL, /* resigned */
+ NULL, /* isdnssec */
+ NULL, /* getrrsetstats */
+ NULL, /* rpz_enabled */
+ NULL, /* rpz_findips */
+ findnodeext,
+ findext
};
static isc_result_t
* USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: sdlz.c,v 1.33 2011/03/21 19:54:03 each Exp $ */
+/* $Id: sdlz.c,v 1.34 2011/10/11 00:09:03 each Exp $ */
/*! \file */
}
static isc_result_t
-findnode(dns_db_t *db, dns_name_t *name, isc_boolean_t create,
- dns_dbnode_t **nodep)
+findnodeext(dns_db_t *db, dns_name_t *name, isc_boolean_t create,
+ dns_clientinfomethods_t *methods, dns_clientinfo_t *clientinfo,
+ dns_dbnode_t **nodep)
{
dns_sdlz_db_t *sdlz = (dns_sdlz_db_t *)db;
dns_sdlznode_t *node = NULL;
/* try to lookup the host (namestr) */
result = sdlz->dlzimp->methods->lookup(zonestr, namestr,
sdlz->dlzimp->driverarg,
- sdlz->dbdata, node);
+ sdlz->dbdata, node,
+ methods, clientinfo);
/*
* if the host (namestr) was not found, try to lookup a
* "wildcard" host.
*/
- if (result != ISC_R_SUCCESS && !create) {
+ if (result != ISC_R_SUCCESS && !create)
result = sdlz->dlzimp->methods->lookup(zonestr, "*",
sdlz->dlzimp->driverarg,
- sdlz->dbdata, node);
- }
+ sdlz->dbdata, node,
+ methods, clientinfo);
MAYBE_UNLOCK(sdlz->dlzimp);
return (ISC_R_SUCCESS);
}
+static isc_result_t
+findnode(dns_db_t *db, dns_name_t *name, isc_boolean_t create,
+ dns_dbnode_t **nodep)
+{
+ return (findnodeext(db, name, create, NULL, NULL, nodep));
+}
+
static isc_result_t
findzonecut(dns_db_t *db, dns_name_t *name, unsigned int options,
isc_stdtime_t now, dns_dbnode_t **nodep, dns_name_t *foundname,
}
static isc_result_t
-find(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version,
- dns_rdatatype_t type, unsigned int options, isc_stdtime_t now,
- dns_dbnode_t **nodep, dns_name_t *foundname,
- dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset)
+findext(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version,
+ dns_rdatatype_t type, unsigned int options, isc_stdtime_t now,
+ dns_dbnode_t **nodep, dns_name_t *foundname,
+ dns_clientinfomethods_t *methods, dns_clientinfo_t *clientinfo,
+ dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset)
{
dns_sdlz_db_t *sdlz = (dns_sdlz_db_t *)db;
dns_dbnode_t *node = NULL;
* Look up the next label.
*/
dns_name_getlabelsequence(name, nlabels - i, i, xname);
- result = findnode(db, xname, ISC_FALSE, &node);
+ result = findnodeext(db, xname, ISC_FALSE,
+ methods, clientinfo, &node);
if (result != ISC_R_SUCCESS) {
result = DNS_R_NXDOMAIN;
continue;
*/
if (i < nlabels) {
result = findrdataset(db, node, version,
- dns_rdatatype_dname,
- 0, now, rdataset, sigrdataset);
+ dns_rdatatype_dname, 0, now,
+ rdataset, sigrdataset);
if (result == ISC_R_SUCCESS) {
result = DNS_R_DNAME;
break;
*/
if (i != olabels && (options & DNS_DBFIND_GLUEOK) == 0) {
result = findrdataset(db, node, version,
- dns_rdatatype_ns,
- 0, now, rdataset, sigrdataset);
+ dns_rdatatype_ns, 0, now,
+ rdataset, sigrdataset);
if (result == ISC_R_SUCCESS) {
if (i == nlabels && type == dns_rdatatype_any)
{
/*
* Look for the qtype.
*/
- result = findrdataset(db, node, version, type,
- 0, now, rdataset, sigrdataset);
+ result = findrdataset(db, node, version, type, 0, now,
+ rdataset, sigrdataset);
if (result == ISC_R_SUCCESS)
break;
*/
if (type != dns_rdatatype_cname) {
result = findrdataset(db, node, version,
- dns_rdatatype_cname,
- 0, now, rdataset, sigrdataset);
+ dns_rdatatype_cname, 0, now,
+ rdataset, sigrdataset);
if (result == ISC_R_SUCCESS) {
result = DNS_R_CNAME;
break;
return (result);
}
+static isc_result_t
+find(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version,
+ dns_rdatatype_t type, unsigned int options, isc_stdtime_t now,
+ dns_dbnode_t **nodep, dns_name_t *foundname,
+ dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset)
+{
+ return (findext(db, name, version, type, options, now, nodep,
+ foundname, NULL, NULL, rdataset, sigrdataset));
+}
+
static isc_result_t
allrdatasets(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
isc_stdtime_t now, dns_rdatasetiter_t **iteratorp)
if (sdlz->dlzimp->methods->newversion == NULL)
return (ISC_R_NOTIMPLEMENTED);
- result = findnode(db, &sdlz->common.origin, ISC_FALSE, nodep);
+ result = findnodeext(db, &sdlz->common.origin, ISC_FALSE,
+ NULL, NULL, nodep);
if (result != ISC_R_SUCCESS)
sdlz_log(ISC_LOG_ERROR, "sdlz getoriginnode failed : %s",
isc_result_totext(result));
overmem,
settask,
getoriginnode,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
+ NULL, /* transfernode */
+ NULL, /* getnsec3parameters */
+ NULL, /* findnsec3node */
+ NULL, /* setsigningtime */
+ NULL, /* getsigningtime */
+ NULL, /* resigned */
+ NULL, /* isdnssec */
+ NULL, /* getrrsetstats */
+ NULL, /* rpz_enabled */
+ NULL, /* rpz_findips */
+ findnodeext,
+ findext
};
/*