2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-09-03 07:25:18 +00:00

[1579] editorial cleanup, mostly per the guidelines.

- folded long lines
- removed white space at EOL
- spacing consistency.  in particular, add one space after comma
- alignment
This commit is contained in:
JINMEI Tatuya
2012-03-30 15:01:35 -07:00
parent fa4aa9c87c
commit ad0ce258df
3 changed files with 47 additions and 43 deletions

View File

@@ -427,12 +427,14 @@ DatabaseClient::Finder::findAll(const isc::dns::Name& name,
if ((need_nsec3 == true) && (isNSEC() == true)){ 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 // If the zone is signed with NSEC3, need to add RESULT_NSEC3_SIGNED to the
// in FindContext when NXRRSET NXDOMAIN or WILDCARD in the DNSSEC query, no need // flags in FindContext when NXRRSET NXDOMAIN or WILDCARD in the DNSSEC
// NSEC RRset at the same time. // query, no need NSEC RRset at the same time.
return (ZoneFinderContextPtr(new Context(*this, options, return (ZoneFinderContextPtr(new Context(*this, options,
findInternal(name, RRType::ANY(), &target, findInternal(name, RRType::ANY(),
options, need_nsec3),target))); &target, options,
need_nsec3),
target)));
} }
ZoneFinderContextPtr ZoneFinderContextPtr
@@ -443,16 +445,17 @@ DatabaseClient::Finder::find(const isc::dns::Name& name,
if (type == RRType::ANY()) { if (type == RRType::ANY()) {
isc_throw(isc::Unexpected, "Use findAll to answer 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 // If the zone is signed with NSEC3, need to add RESULT_NSEC3_SIGNED to the
// in FindContext when NXRRSET NXDOMAIN or WILDCARD in the DNSSEC query, no need // flags in FindContext when NXRRSET NXDOMAIN or WILDCARD in the DNSSEC
// NSEC RRset at the same time. // query, no need NSEC RRset at the same time.
const bool need_nsec3 = (((options & FIND_DNSSEC) != 0) && isNSEC3()); const bool need_nsec3 = (((options & FIND_DNSSEC) != 0) && isNSEC3());
if ((need_nsec3 == true) && (isNSEC() == true)){ 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, return (ZoneFinderContextPtr(new Context(*this, options,
findInternal(name, type, findInternal(name, type, NULL,
NULL, options,need_nsec3)))); options,
need_nsec3))));
} }
DatabaseClient::Finder::DelegationSearchResult DatabaseClient::Finder::DelegationSearchResult
@@ -686,7 +689,8 @@ DatabaseClient::Finder::findWildcardMatch(
} }
} }
return (ResultContext(NXRRSET, ConstRRsetPtr(), need_nsec3 ? return (ResultContext(NXRRSET, ConstRRsetPtr(), need_nsec3 ?
(RESULT_WILDCARD | RESULT_NSEC3_SIGNED) : RESULT_WILDCARD)); (RESULT_WILDCARD | RESULT_NSEC3_SIGNED) :
RESULT_WILDCARD));
} }
} }
@@ -893,8 +897,7 @@ DatabaseClient::Finder::findNoNameResult(const Name& name, const RRType& type,
} }
bool bool
DatabaseClient::Finder::isNSEC3() DatabaseClient::Finder::isNSEC3() {
{
// If an NSEC3PARAM RR exists at the zone apex, it's quite likely that // 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, // 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). // but it's caller's responsibility how to handle such cases).
@@ -905,8 +908,7 @@ DatabaseClient::Finder::isNSEC3()
} }
bool bool
DatabaseClient::Finder::isNSEC() DatabaseClient::Finder::isNSEC() {
{
// If an NSEC RRsets exists at the zone apex, it's quite likely that // 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, // 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) // but it's caller's responsibility how to handle such cases)
@@ -919,7 +921,8 @@ DatabaseClient::Finder::isNSEC()
ZoneFinder::ResultContext ZoneFinder::ResultContext
DatabaseClient::Finder::findInternal(const Name& name, const RRType& type, DatabaseClient::Finder::findInternal(const Name& name, const RRType& type,
std::vector<ConstRRsetPtr>* target, 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) LOG_DEBUG(logger, DBG_TRACE_DETAILED, DATASRC_DATABASE_FIND_RECORDS)
.arg(accessor_->getDBName()).arg(name).arg(type).arg(getClass()); .arg(accessor_->getDBName()).arg(name).arg(type).arg(getClass());

View File

@@ -712,11 +712,13 @@ public:
/// searches the NSEC3PARAM RRset in the zone apex, if it exists, the /// searches the NSEC3PARAM RRset in the zone apex, if it exists, the
/// zone looks signed with nsec3 /// zone looks signed with nsec3
bool isNSEC3(); bool isNSEC3();
/// \brief check whether zone is signed with nsec /// \brief check whether zone is signed with nsec
/// ///
/// searches the NSEC RRset in the zone apex, if it exists, the /// searches the NSEC RRset in the zone apex, if it exists, the
/// zone looks signed with nsec /// zone looks signed with nsec
bool isNSEC(); bool isNSEC();
/// \brief Find an RRset in the datasource /// \brief Find an RRset in the datasource
/// ///
/// Searches the datasource for an RRset of the given name and /// Searches the datasource for an RRset of the given name and

View File

@@ -2356,11 +2356,11 @@ TYPED_TEST(DatabaseClientTest, dbNegativeCaseFind) {
try { try {
this->expected_rdatas_.clear(); this->expected_rdatas_.clear();
this->expected_sig_rdatas_.clear(); this->expected_sig_rdatas_.clear();
doFindTest(this->updater_->getFinder(), isc::dns::Name("www1.example.org."), doFindTest(this->updater_->getFinder(), Name("www1.example.org."),
this->qtype_, this->qtype_, this->rrttl_, ZoneFinder::NXDOMAIN, this->qtype_, this->qtype_, this->rrttl_,
this->expected_rdatas_, this->expected_sig_rdatas_, ZoneFinder::NXDOMAIN, this->expected_rdatas_,
ZoneFinder::RESULT_NSEC3_SIGNED, isc::dns::Name::ROOT_NAME(), this->expected_sig_rdatas_, ZoneFinder::RESULT_NSEC3_SIGNED,
ZoneFinder::FIND_DNSSEC); Name::ROOT_NAME(), ZoneFinder::FIND_DNSSEC);
} catch (const DataSourceError&) {} } catch (const DataSourceError&) {}
// The following test should be tested in zone which is signed by NSEC3 // The following test should be tested in zone which is signed by NSEC3
#if 0 #if 0
@@ -2372,8 +2372,7 @@ TYPED_TEST(DatabaseClientTest, dbNegativeCaseFind) {
// test. // test.
this->updater_ = this->client_->getUpdater(this->zname_, false); this->updater_ = this->client_->getUpdater(this->zname_, false);
this->rrset_.reset(new RRset(this->zname_, this->qclass_, this->rrset_.reset(new RRset(this->zname_, this->qclass_,
isc::dns::RRType::NSEC3PARAM(), RRType::NSEC3PARAM(), this->rrttl_));
this->rrttl_));
this->rrset_->addRdata(rdata::createRdata(this->rrset_->getType(), this->rrset_->addRdata(rdata::createRdata(this->rrset_->getType(),
this->rrset_->getClass(), this->rrset_->getClass(),
"1 0 12 aabbccdd")); "1 0 12 aabbccdd"));
@@ -2389,8 +2388,8 @@ TYPED_TEST(DatabaseClientTest, dbNegativeCaseFind) {
// check NXRRSET // check NXRRSET
this->expected_rdatas_.clear(); this->expected_rdatas_.clear();
this->expected_sig_rdatas_.clear(); this->expected_sig_rdatas_.clear();
doFindTest(this->updater_->getFinder(), isc::dns::Name("www.example.org."), doFindTest(this->updater_->getFinder(), Name("www.example.org."),
isc::dns::RRType::TXT(), isc::dns::RRType::TXT(), this->rrttl_, RRType::TXT(), RRType::TXT(), this->rrttl_,
ZoneFinder::NXRRSET, this->expected_rdatas_, ZoneFinder::NXRRSET, 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); isc::dns::Name::ROOT_NAME(), ZoneFinder::FIND_DNSSEC);
@@ -2399,20 +2398,20 @@ TYPED_TEST(DatabaseClientTest, dbNegativeCaseFind) {
this->expected_sig_rdatas_.push_back("A 5 3 3600 20000101000000 " this->expected_sig_rdatas_.push_back("A 5 3 3600 20000101000000 "
"20000201000000 12345 example.org. " "20000201000000 12345 example.org. "
"FAKEFAKEFAKE"); "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->qtype_, this->qtype_, this->rrttl_, ZoneFinder::SUCCESS,
this->expected_rdatas_, this->expected_sig_rdatas_, this->expected_rdatas_, this->expected_sig_rdatas_,
ZoneFinder::RESULT_WILDCARD | ZoneFinder::RESULT_NSEC3_SIGNED, 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 // check flags if NXRRSET in wildcard case
this->expected_rdatas_.clear(); this->expected_rdatas_.clear();
this->expected_sig_rdatas_.clear(); this->expected_sig_rdatas_.clear();
doFindTest(this->updater_->getFinder(), isc::dns::Name("b.a.wild.example.org"), doFindTest(this->updater_->getFinder(), Name("b.a.wild.example.org"),
isc::dns::RRType::TXT(), isc::dns::RRType::TXT(), RRType::TXT(), RRType::TXT(), this->rrttl_,
this->rrttl_, ZoneFinder::NXRRSET, this->expected_rdatas_, ZoneFinder::NXRRSET, this->expected_rdatas_,
this->empty_rdatas_, (ZoneFinder::RESULT_WILDCARD | this->empty_rdatas_, (ZoneFinder::RESULT_WILDCARD |
ZoneFinder::RESULT_NSEC3_SIGNED), ZoneFinder::RESULT_NSEC3_SIGNED),
isc::dns::Name::ROOT_NAME(), ZoneFinder::FIND_DNSSEC); Name::ROOT_NAME(), ZoneFinder::FIND_DNSSEC);
#endif #endif
} }