Lines Matching defs:sdlz
76 #include <dns/sdlz.h>
109 dns_sdlz_db_t *sdlz;
315 dns_sdlz_db_t *sdlz = (dns_sdlz_db_t *) source;
317 REQUIRE(VALID_SDLZDB(sdlz));
319 LOCK(&sdlz->refcnt_lock);
320 REQUIRE(sdlz->references > 0);
321 sdlz->references++;
322 UNLOCK(&sdlz->refcnt_lock);
328 destroy(dns_sdlz_db_t *sdlz) {
330 mctx = sdlz->common.mctx;
332 sdlz->common.magic = 0;
333 sdlz->common.impmagic = 0;
335 (void)isc_mutex_destroy(&sdlz->refcnt_lock);
337 dns_name_free(&sdlz->common.origin, mctx);
339 isc_mem_put(mctx, sdlz, sizeof(dns_sdlz_db_t));
345 dns_sdlz_db_t *sdlz = (dns_sdlz_db_t *)(*dbp);
348 REQUIRE(VALID_SDLZDB(sdlz));
349 LOCK(&sdlz->refcnt_lock);
350 REQUIRE(sdlz->references > 0);
351 sdlz->references--;
352 if (sdlz->references == 0)
354 UNLOCK(&sdlz->refcnt_lock);
357 destroy(sdlz);
389 dns_sdlz_db_t *sdlz = (dns_sdlz_db_t *)db;
390 REQUIRE(VALID_SDLZDB(sdlz));
393 *versionp = (void *) &sdlz->dummy_version;
399 dns_sdlz_db_t *sdlz = (dns_sdlz_db_t *)db;
403 REQUIRE(VALID_SDLZDB(sdlz));
405 if (sdlz->dlzimp->methods->newversion == NULL)
408 dns_name_format(&sdlz->common.origin, origin, sizeof(origin));
410 result = sdlz->dlzimp->methods->newversion(origin,
411 sdlz->dlzimp->driverarg,
412 sdlz->dbdata, versionp);
415 "sdlz newversion on origin %s failed : %s",
420 sdlz->future_version = *versionp;
427 dns_sdlz_db_t *sdlz = (dns_sdlz_db_t *)db;
429 REQUIRE(VALID_SDLZDB(sdlz));
430 REQUIRE(source != NULL && source == (void *)&sdlz->dummy_version);
437 dns_sdlz_db_t *sdlz = (dns_sdlz_db_t *)db;
440 REQUIRE(VALID_SDLZDB(sdlz));
443 if (*versionp == (void *)&sdlz->dummy_version) {
448 REQUIRE(*versionp == sdlz->future_version);
449 REQUIRE(sdlz->dlzimp->methods->closeversion != NULL);
451 dns_name_format(&sdlz->common.origin, origin, sizeof(origin));
453 sdlz->dlzimp->methods->closeversion(origin, commit,
454 sdlz->dlzimp->driverarg,
455 sdlz->dbdata, versionp);
458 "sdlz closeversion on origin %s failed", origin);
460 sdlz->future_version = NULL;
464 createnode(dns_sdlz_db_t *sdlz, dns_sdlznode_t **nodep) {
468 node = isc_mem_get(sdlz->common.mctx, sizeof(dns_sdlznode_t));
472 node->sdlz = NULL;
473 attach((dns_db_t *)sdlz, (dns_db_t **)&node->sdlz);
483 isc_mem_put(sdlz->common.mctx, node, sizeof(dns_sdlznode_t));
499 dns_sdlz_db_t *sdlz;
503 sdlz = node->sdlz;
504 mctx = sdlz->common.mctx;
530 db = &sdlz->common;
539 dns_sdlz_db_t *sdlz = (dns_sdlz_db_t *)db;
549 REQUIRE(VALID_SDLZDB(sdlz));
552 if (sdlz->dlzimp->methods->newversion == NULL) {
557 if ((sdlz->dlzimp->flags & DNS_SDLZFLAG_RELATIVEOWNER) != 0) {
562 dns_name_countlabels(&sdlz->common.origin);
576 result = dns_name_totext(&sdlz->common.origin, ISC_TRUE, &b2);
581 result = createnode(sdlz, &node);
585 isorigin = dns_name_equal(name, &sdlz->common.origin);
591 MAYBE_LOCK(sdlz->dlzimp);
594 result = sdlz->dlzimp->methods->lookup(zonestr, namestr,
595 sdlz->dlzimp->driverarg,
596 sdlz->dbdata, node,
613 dlabels = nlabels - dns_name_countlabels(&sdlz->common.origin);
639 result = sdlz->dlzimp->methods->lookup(zonestr, wildstr,
640 sdlz->dlzimp->driverarg,
641 sdlz->dbdata, node,
648 MAYBE_UNLOCK(sdlz->dlzimp);
658 if (isorigin && sdlz->dlzimp->methods->authority != NULL) {
659 MAYBE_LOCK(sdlz->dlzimp);
660 authority = sdlz->dlzimp->methods->authority;
661 result = (*authority)(zonestr, sdlz->dlzimp->driverarg,
662 sdlz->dbdata, node);
663 MAYBE_UNLOCK(sdlz->dlzimp);
673 node->name = isc_mem_get(sdlz->common.mctx,
680 result = dns_name_dup(name, sdlz->common.mctx, node->name);
682 isc_mem_put(sdlz->common.mctx, node->name,
727 dns_sdlz_db_t *sdlz = (dns_sdlz_db_t *)db;
730 REQUIRE(VALID_SDLZDB(sdlz));
732 UNUSED(sdlz);
745 dns_sdlz_db_t *sdlz = (dns_sdlz_db_t *)db;
749 REQUIRE(VALID_SDLZDB(sdlz));
752 UNUSED(sdlz);
789 dns_sdlz_db_t *sdlz = (dns_sdlz_db_t *)db;
795 REQUIRE(VALID_SDLZDB(sdlz));
797 if (sdlz->dlzimp->methods->allnodes == NULL)
805 result = dns_name_totext(&sdlz->common.origin, ISC_TRUE, &b);
810 sdlziter = isc_mem_get(sdlz->common.mctx, sizeof(sdlz_dbiterator_t));
826 MAYBE_LOCK(sdlz->dlzimp);
827 result = sdlz->dlzimp->methods->allnodes(zonestr,
828 sdlz->dlzimp->driverarg,
829 sdlz->dbdata, sdlziter);
830 MAYBE_UNLOCK(sdlz->dlzimp);
888 dns_sdlz_db_t *sdlz = (dns_sdlz_db_t *)db;
897 REQUIRE(VALID_SDLZDB(sdlz));
900 version == (void*)&sdlz->dummy_version ||
901 version == sdlz->future_version);
903 UNUSED(sdlz);
1065 dns_sdlz_db_t *sdlz = (dns_sdlz_db_t *) db;
1068 REQUIRE(VALID_SDLZDB(sdlz));
1071 version == (void*)&sdlz->dummy_version ||
1072 version == sdlz->future_version);
1099 dns_sdlz_db_t *sdlz = (dns_sdlz_db_t *)db;
1108 REQUIRE(VALID_SDLZDB(sdlz));
1119 mctx = sdlz->common.mctx;
1146 MAYBE_LOCK(sdlz->dlzimp);
1147 result = mod_function(name, rdatastr, sdlz->dlzimp->driverarg,
1148 sdlz->dbdata, version);
1149 MAYBE_UNLOCK(sdlz->dlzimp);
1164 dns_sdlz_db_t *sdlz = (dns_sdlz_db_t *)db;
1169 REQUIRE(VALID_SDLZDB(sdlz));
1171 if (sdlz->dlzimp->methods->addrdataset == NULL)
1175 sdlz->dlzimp->methods->addrdataset);
1185 dns_sdlz_db_t *sdlz = (dns_sdlz_db_t *)db;
1189 REQUIRE(VALID_SDLZDB(sdlz));
1191 if (sdlz->dlzimp->methods->subtractrdataset == NULL) {
1196 sdlz->dlzimp->methods->subtractrdataset);
1204 dns_sdlz_db_t *sdlz = (dns_sdlz_db_t *)db;
1212 REQUIRE(VALID_SDLZDB(sdlz));
1214 if (sdlz->dlzimp->methods->delrdataset == NULL)
1221 MAYBE_LOCK(sdlz->dlzimp);
1222 result = sdlz->dlzimp->methods->delrdataset(name, b_type,
1223 sdlz->dlzimp->driverarg,
1224 sdlz->dbdata, version);
1225 MAYBE_UNLOCK(sdlz->dlzimp);
1268 dns_sdlz_db_t *sdlz = (dns_sdlz_db_t *)db;
1271 REQUIRE(VALID_SDLZDB(sdlz));
1272 if (sdlz->dlzimp->methods->newversion == NULL)
1275 result = getnodedata(db, &sdlz->common.origin, ISC_FALSE,
1278 sdlz_log(ISC_LOG_ERROR, "sdlz getoriginnode failed: %s",
1339 dns_sdlz_db_t *sdlz = (dns_sdlz_db_t *)sdlziter->common.db;
1349 isc_mem_put(sdlz->common.mctx, sdlziter, sizeof(sdlz_dbiterator_t));
1444 dns_db_t *db = (dns_db_t *) sdlznode->sdlz;
1454 dns_db_t *db = (dns_db_t *) sdlznode->sdlz;
1489 * The sdlz rdataset is an rdatalist with some additions.
1788 * Format the request elements. sdlz operates on strings, not
1858 mctx = lookup->sdlz->common.mctx;
1878 rdatalist->rdclass = lookup->sdlz->common.rdclass;
1899 if ((lookup->sdlz->dlzimp->flags & DNS_SDLZFLAG_RELATIVERDATA) != 0)
1900 origin = &lookup->sdlz->common.origin;
1964 dns_sdlz_db_t *sdlz = (dns_sdlz_db_t *)allnodes->common.db;
1966 isc_mem_t *mctx = sdlz->common.mctx;
1973 if ((sdlz->dlzimp->flags & DNS_SDLZFLAG_RELATIVERDATA) != 0)
1974 origin = &sdlz->common.origin;
1993 result = createnode(sdlz, &sdlznode);
2010 dns_name_equal(newname, &sdlz->common.origin))
2096 * register the DLZ driver. Pass in our "extra" sdlz information as