BIND 10 master, updated. 93e596c474ed1c637da7d6653eaa8c499b0b6a6d [master] Merge branch 'trac2284'
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Oct 4 21:48:19 UTC 2012
The branch, master has been updated
via 93e596c474ed1c637da7d6653eaa8c499b0b6a6d (commit)
via f037ebb23cb966f86d11c07bb0f4a80b6043c9b0 (commit)
via b1d4ff896a7781d98513fab8d171090ac3d6a1e4 (commit)
from 41538b7ce9d6ab4131b572b79d84292884cf4a11 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 93e596c474ed1c637da7d6653eaa8c499b0b6a6d
Merge: 41538b7 f037ebb
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Thu Oct 4 14:33:56 2012 -0700
[master] Merge branch 'trac2284'
-----------------------------------------------------------------------
Summary of changes:
src/lib/datasrc/memory/zone_finder.cc | 4 +-
.../datasrc/tests/zone_finder_context_unittest.cc | 33 ---------
src/lib/datasrc/zone.h | 72 --------------------
src/lib/datasrc/zone_finder_context.cc | 20 ------
4 files changed, 2 insertions(+), 127 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/memory/zone_finder.cc b/src/lib/datasrc/memory/zone_finder.cc
index 7b36521..86dd874 100644
--- a/src/lib/datasrc/memory/zone_finder.cc
+++ b/src/lib/datasrc/memory/zone_finder.cc
@@ -538,14 +538,14 @@ public:
const RRClass& rrclass, const ZoneFinderResultContext& result) :
ZoneFinder::Context(options, ResultContext(result.code, result.rrset,
result.flags)),
- finder_(finder), // NOTE: when #2284 is done we won't need this
+ finder_(finder), // NOTE: when entire #2283 is done we won't need this
rrclass_(rrclass), zone_data_(result.zone_data),
found_node_(result.found_node),
found_rdset_(result.found_rdset)
{}
protected:
- // When #2284 is done this can simply return NULL.
+ // When all tickets in #2283 are done this can simply return NULL.
virtual ZoneFinder* getFinder() { return (&finder_); }
// We don't use the default protected methods that rely on this method,
diff --git a/src/lib/datasrc/tests/zone_finder_context_unittest.cc b/src/lib/datasrc/tests/zone_finder_context_unittest.cc
index 564de94..14429ae 100644
--- a/src/lib/datasrc/tests/zone_finder_context_unittest.cc
+++ b/src/lib/datasrc/tests/zone_finder_context_unittest.cc
@@ -416,37 +416,4 @@ TEST_P(ZoneFinderContextTest, getAdditionalForAny) {
result_sets_.begin(), result_sets_.end());
}
-TEST_P(ZoneFinderContextTest, getAtOrigin) {
- ConstRRsetPtr expected_ns_rrset =
- textToRRset("example.org. 3600 IN NS ns1.example.org.\n"
- "example.org. 3600 IN NS ns2.example.org.\n");
-
- // Try getAtOrigin for an existing type (NS) record at the origin that
- // has RRSIG. The RRSIG will be associated iff the original query
- // has the FIND_DNSSEC option.
- ZoneFinderContextPtr ctx = finder_->find(Name("ns1.example.org"),
- RRType::A());
- EXPECT_EQ(ZoneFinder::SUCCESS, ctx->code);
- ConstRRsetPtr ns_rrset = ctx->getAtOrigin(RRType::NS());
- ASSERT_TRUE(ns_rrset);
- rrsetCheck(expected_ns_rrset, ns_rrset);
- EXPECT_FALSE(ns_rrset->getRRsig());
-
- ctx = finder_->find(Name("ns1.example.org"), RRType::A(),
- ZoneFinder::FIND_DNSSEC);
- ns_rrset = ctx->getAtOrigin(RRType::NS());
- ASSERT_TRUE(ns_rrset);
- rrsetCheck(expected_ns_rrset, ns_rrset);
- ASSERT_TRUE(ns_rrset->getRRsig());
- rrsetCheck(textToRRset("example.org. 3600 IN RRSIG NS 7 3 3600 "
- "20150420235959 20051021000000 40430 "
- "example.org. FAKEFAKEFAKE"), ns_rrset->getRRsig());
-
- // For non-existing type we simply get NULL.
- EXPECT_FALSE(ctx->getAtOrigin(RRType::TXT()));
-
- // Type ANY query isn't allowed.
- EXPECT_THROW(ctx->getAtOrigin(RRType::ANY()), isc::InvalidParameter);
-}
-
}
diff --git a/src/lib/datasrc/zone.h b/src/lib/datasrc/zone.h
index 3885aee..36a1cff 100644
--- a/src/lib/datasrc/zone.h
+++ b/src/lib/datasrc/zone.h
@@ -268,67 +268,6 @@ public:
getAdditionalImpl(requested_types, result);
}
- /// \brief Find and return given type of RRset at the zone origin.
- ///
- /// DNS query processing often requires supplemental RRsets at the
- /// zone origin; for example, for some negative answers we need to
- /// provide the zone's SOA record; a full positive response normally
- /// includes the zone's NS RRset. The application can easily get
- /// these using the generic \c ZoneFinder::find() interface, but
- /// depending on the underlying data source implementation, the generic
- /// version could be more expensive and/or it might be possible to
- /// substantially improve this particular case.
- ///
- /// This method allows the underlying implementation to do such
- /// optimization. The interface is simplified; it just takes
- /// an `RRType` and returns the corresponding RRset if found;
- /// if not found it returns NULL.
- ///
- /// This method tries to find and return RRSIGs of the found RRset
- /// if and only if the original lookup by \c ZoneFinder::find() has
- /// the \c FIND_DNSSEC option.
- ///
- /// Type ANY must not be specified for this method. It will result
- /// in \c isc::InvalidParameter exception. If the application
- /// needs to get all types of RRsets at the origin, it should use
- /// the \c ZoneFinder::findAll() method with the zone name.
- ///
- /// Note that the origin name should always exist, so there
- /// shouldn't be the case where the name itself is not found
- /// in the zone (i.e., the NXDOMAIN) case. But in any event
- /// it does not distinguish such a hypothetical case from the
- /// case where the specified type isn't found at the origin.
- /// It simply returns NULL when the required type isn't found.
- /// This also means it doesn't provide a DNSSEC proof of the
- /// non-existence. If the application needs that proof, it must use
- /// the generic \c find() method.
- ///
- /// A CNAME RR shouldn't exist at the zone origin at any sanely
- /// configured zone (because there should be at least SOA there and
- /// CNAME cannot coexist with it), and it's generally expected
- /// the underlying implementation rejects the case where a CNAME
- /// somehow exists at the zone origin. Even if such a situation
- /// happens, this method does not return the CNAME when the given
- /// type of RRset isn't found; it will just return NULL like in the
- /// normal case.
- ///
- /// \throw isc::InvalidParameter Type ANY is specified
- /// \throw std::bad_alloc Internal resource allocation failure
- ///
- /// \param type The RR type for which an RRset at the origin is to be
- /// found.
- /// \return A shared pointer to the requested type of RRset or NULL
- /// if not found.
- dns::ConstRRsetPtr getAtOrigin(const dns::RRType& type) {
- // Perform common check, then delegate the actual work to
- // derived class implementation, if provided.
- if (type == dns::RRType::ANY()) {
- isc_throw(isc::InvalidParameter,
- "Type ANY isn't allowed for getAtOrigin");
- }
- return (getAtOriginImpl(type));
- }
-
protected:
/// \brief Return the \c ZoneFinder that created this \c Context.
///
@@ -372,18 +311,7 @@ public:
const std::vector<isc::dns::RRType>& requested_types,
std::vector<isc::dns::ConstRRsetPtr>& result);
- /// \brief Actual implementation of getAtOrigin().
- ///
- /// This base class defines a default implementation that can be
- /// used for any type of data sources. A data source implementation
- /// can override it.
- ///
- /// The default version of this implementation requires
- /// \c getFinder() return a valid result.
- virtual dns::ConstRRsetPtr getAtOriginImpl(const dns::RRType& type);
-
private:
-
const FindResultFlags flags_;
protected:
const FindOptions options_;
diff --git a/src/lib/datasrc/zone_finder_context.cc b/src/lib/datasrc/zone_finder_context.cc
index f661e98..482eb65 100644
--- a/src/lib/datasrc/zone_finder_context.cc
+++ b/src/lib/datasrc/zone_finder_context.cc
@@ -109,25 +109,5 @@ ZoneFinder::Context::getAdditionalImpl(const vector<RRType>& requested_types,
}
}
-ConstRRsetPtr
-ZoneFinder::Context::getAtOriginImpl(const dns::RRType& type) {
- const ZoneFinder::FindOptions options =
- (options_ & ZoneFinder::FIND_DNSSEC) != 0 ?
- ZoneFinder::FIND_DNSSEC : ZoneFinder::FIND_DEFAULT;
-
- ZoneFinder* finder = getFinder();
- if (finder == NULL) {
- // This is a bug of the derived class implementation.
- isc_throw(isc::Unexpected, "NULL ZoneFinder in finder Context");
- }
-
- ConstZoneFinderContextPtr ctx = finder->find(finder->getOrigin(), type,
- options);
- if (ctx->code == ZoneFinder::SUCCESS) {
- return (ctx->rrset);
- }
- return (ConstRRsetPtr());
-}
-
} // namespace datasrc
} // datasrc isc
More information about the bind10-changes
mailing list