result.insert(RRType::CNAME());
result.insert(RRType::NS());
initialized = true;
- }
+ }
return (result);
}
{
const bool need_nsec3 = (((options & FIND_DNSSEC) != 0) && isNSEC3());
if ((need_nsec3 == true) && (isNSEC() == true)){
- isc_throw(DataSourceError, "nsec and nsec3 coexist");
+ isc_throw(DataSourceError, "nsec and nsec3 coexist");
}
- // If the zone is signed with NSEC3, need to add RESULT_NSEC3_SIGNED to the flags
- // in FindContext when NXRRSET NXDOMAIN or WILDCARD in the DNSSEC query, no need
- // NSEC RRset at the same time.
+ // If the zone is signed with NSEC3, need to add RESULT_NSEC3_SIGNED to the
+ // flags in FindContext when NXRRSET NXDOMAIN or WILDCARD in the DNSSEC
+ // query, no need NSEC RRset at the same time.
return (ZoneFinderContextPtr(new Context(*this, options,
- findInternal(name, RRType::ANY(), &target,
- options, need_nsec3),target)));
+ findInternal(name, RRType::ANY(),
+ &target, options,
+ need_nsec3),
+ target)));
}
ZoneFinderContextPtr
if (type == RRType::ANY()) {
isc_throw(isc::Unexpected, "Use findAll to answer ANY");
}
- // If the zone is signed with NSEC3, need to add RESULT_NSEC3_SIGNED to the flags
- // in FindContext when NXRRSET NXDOMAIN or WILDCARD in the DNSSEC query, no need
- // NSEC RRset at the same time.
+ // If the zone is signed with NSEC3, need to add RESULT_NSEC3_SIGNED to the
+ // flags in FindContext when NXRRSET NXDOMAIN or WILDCARD in the DNSSEC
+ // query, no need NSEC RRset at the same time.
const bool need_nsec3 = (((options & FIND_DNSSEC) != 0) && isNSEC3());
if ((need_nsec3 == true) && (isNSEC() == true)){
- isc_throw(DataSourceError, "nsec and nsec3 coexist");
+ isc_throw(DataSourceError, "nsec and nsec3 coexist");
}
return (ZoneFinderContextPtr(new Context(*this, options,
- findInternal(name, type,
- NULL, options,need_nsec3))));
+ findInternal(name, type, NULL,
+ options,
+ need_nsec3))));
}
DatabaseClient::Finder::DelegationSearchResult
DATASRC_DATABASE_WILDCARD_CANCEL_NS).
arg(accessor_->getDBName()).arg(wildcard).
arg(dresult.first_ns->getName());
- return (ResultContext(DELEGATION, dresult.first_ns));
+ return (ResultContext(DELEGATION, dresult.first_ns));
} else if (!hasSubdomains(name.split(i - 1).toText())) {
// The wildcard match is the best one, find the final result
// at it. Note that wildcard should never be the zone origin.
RESULT_NSEC_SIGNED));
}
}
- return (ResultContext(NXRRSET, ConstRRsetPtr(), need_nsec3 ?
- (RESULT_WILDCARD | RESULT_NSEC3_SIGNED) : RESULT_WILDCARD));
+ return (ResultContext(NXRRSET, ConstRRsetPtr(), need_nsec3 ?
+ (RESULT_WILDCARD | RESULT_NSEC3_SIGNED) :
+ RESULT_WILDCARD));
}
}
const bool wild = (wildname != NULL);
FindResultFlags flags;
if (need_nsec3) {
- flags = wild ? (RESULT_WILDCARD | RESULT_NSEC3_SIGNED) :
+ flags = wild ? (RESULT_WILDCARD | RESULT_NSEC3_SIGNED) :
RESULT_DEFAULT;
} else {
flags = wild ? RESULT_WILDCARD : RESULT_DEFAULT;
}
bool
-DatabaseClient::Finder::isNSEC3()
-{
+DatabaseClient::Finder::isNSEC3() {
// If an NSEC3PARAM RR exists at the zone apex, it's quite likely that
// the zone is signed with NSEC3. (If not the zone is more or less broken,
// but it's caller's responsibility how to handle such cases).
}
bool
-DatabaseClient::Finder::isNSEC()
-{
+DatabaseClient::Finder::isNSEC() {
// If an NSEC RRsets exists at the zone apex, it's quite likely that
// the zone is signed with NSEC. (If not the zone is more or less broken,
// but it's caller's responsibility how to handle such cases)
ZoneFinder::ResultContext
DatabaseClient::Finder::findInternal(const Name& name, const RRType& type,
std::vector<ConstRRsetPtr>* target,
- const FindOptions options, const bool is_nsec3)
+ const FindOptions options,
+ const bool is_nsec3)
{
LOG_DEBUG(logger, DBG_TRACE_DETAILED, DATASRC_DATABASE_FIND_RECORDS)
.arg(accessor_->getDBName()).arg(name).arg(type).arg(getClass());
const isc::dns::Name& expected_name =
isc::dns::Name::ROOT_NAME(),
const ZoneFinder::FindOptions options =
- ZoneFinder::FIND_DEFAULT,
+ ZoneFinder::FIND_DEFAULT,
ZoneFinder::FindResultFlags expected_flags =
ZoneFinder::RESULT_DEFAULT)
{
"FAKEFAKEFAKE");
doFindTest(*finder, isc::dns::Name("b.a.wild.example.org"),
isc::dns::RRType::A(), isc::dns::RRType::A(),
- this->rrttl_, ZoneFinder::SUCCESS, this->expected_rdatas_,
+ this->rrttl_, ZoneFinder::SUCCESS, this->expected_rdatas_,
this->expected_sig_rdatas_,
(ZoneFinder::RESULT_WILDCARD | ZoneFinder::RESULT_NSEC_SIGNED),
isc::dns::Name("b.a.wild.example.org"), ZoneFinder::FIND_DNSSEC);
try {
this->expected_rdatas_.clear();
this->expected_sig_rdatas_.clear();
- doFindTest(this->updater_->getFinder(), isc::dns::Name("www1.example.org."),
- this->qtype_, this->qtype_, this->rrttl_, ZoneFinder::NXDOMAIN,
- this->expected_rdatas_, this->expected_sig_rdatas_,
- ZoneFinder::RESULT_NSEC3_SIGNED, isc::dns::Name::ROOT_NAME(),
- ZoneFinder::FIND_DNSSEC);
+ doFindTest(this->updater_->getFinder(), Name("www1.example.org."),
+ this->qtype_, this->qtype_, this->rrttl_,
+ ZoneFinder::NXDOMAIN, this->expected_rdatas_,
+ this->expected_sig_rdatas_, ZoneFinder::RESULT_NSEC3_SIGNED,
+ Name::ROOT_NAME(), ZoneFinder::FIND_DNSSEC);
} catch (const DataSourceError&) {}
// The following test should be tested in zone which is signed by NSEC3
#if 0
// test.
this->updater_ = this->client_->getUpdater(this->zname_, false);
this->rrset_.reset(new RRset(this->zname_, this->qclass_,
- isc::dns::RRType::NSEC3PARAM(),
- this->rrttl_));
+ RRType::NSEC3PARAM(), this->rrttl_));
this->rrset_->addRdata(rdata::createRdata(this->rrset_->getType(),
this->rrset_->getClass(),
"1 0 12 aabbccdd"));
doFindTest(this->updater_->getFinder(),
isc::dns::Name("www1.example.org."), this->qtype_, this->qtype_,
this->rrttl_, ZoneFinder::NXDOMAIN, this->expected_rdatas_,
- this->expected_sig_rdatas_, ZoneFinder::RESULT_NSEC3_SIGNED,
+ this->expected_sig_rdatas_, ZoneFinder::RESULT_NSEC3_SIGNED,
isc::dns::Name::ROOT_NAME(), ZoneFinder::FIND_DNSSEC);
// check NXRRSET
this->expected_rdatas_.clear();
this->expected_sig_rdatas_.clear();
- doFindTest(this->updater_->getFinder(), isc::dns::Name("www.example.org."),
- isc::dns::RRType::TXT(), isc::dns::RRType::TXT(), this->rrttl_,
+ doFindTest(this->updater_->getFinder(), Name("www.example.org."),
+ RRType::TXT(), RRType::TXT(), this->rrttl_,
ZoneFinder::NXRRSET, this->expected_rdatas_,
this->expected_sig_rdatas_, ZoneFinder::RESULT_NSEC3_SIGNED,
isc::dns::Name::ROOT_NAME(), ZoneFinder::FIND_DNSSEC);
this->expected_sig_rdatas_.push_back("A 5 3 3600 20000101000000 "
"20000201000000 12345 example.org. "
"FAKEFAKEFAKE");
- doFindTest(this->updater_->getFinder(), isc::dns::Name("b.a.wild.example.org"),
+ doFindTest(this->updater_->getFinder(), Name("b.a.wild.example.org"),
this->qtype_, this->qtype_, this->rrttl_, ZoneFinder::SUCCESS,
this->expected_rdatas_, this->expected_sig_rdatas_,
ZoneFinder::RESULT_WILDCARD | ZoneFinder::RESULT_NSEC3_SIGNED,
- isc::dns::Name::ROOT_NAME(), ZoneFinder::FIND_DNSSEC);
+ Name::ROOT_NAME(), ZoneFinder::FIND_DNSSEC);
// check flags if NXRRSET in wildcard case
this->expected_rdatas_.clear();
this->expected_sig_rdatas_.clear();
- doFindTest(this->updater_->getFinder(), isc::dns::Name("b.a.wild.example.org"),
- isc::dns::RRType::TXT(), isc::dns::RRType::TXT(),
- this->rrttl_, ZoneFinder::NXRRSET, this->expected_rdatas_,
- this->empty_rdatas_, (ZoneFinder::RESULT_WILDCARD |
+ doFindTest(this->updater_->getFinder(), Name("b.a.wild.example.org"),
+ RRType::TXT(), RRType::TXT(), this->rrttl_,
+ ZoneFinder::NXRRSET, this->expected_rdatas_,
+ this->empty_rdatas_, (ZoneFinder::RESULT_WILDCARD |
ZoneFinder::RESULT_NSEC3_SIGNED),
- isc::dns::Name::ROOT_NAME(), ZoneFinder::FIND_DNSSEC);
+ Name::ROOT_NAME(), ZoneFinder::FIND_DNSSEC);
#endif
}