Browse Source

[1431] defined the interface of findNSEC3 and provided minimal implementation
to make it compile.

JINMEI Tatuya 13 years ago
parent
commit
0e93f4c179

+ 5 - 0
src/bin/auth/tests/query_unittest.cc

@@ -216,6 +216,11 @@ public:
                                std::vector<ConstRRsetPtr>& target,
                                const FindOptions options = FIND_DEFAULT);
 
+    virtual pair<bool, ConstRRsetPtr>
+    findNSEC3(const Name& /*name*/, bool /*recursive*/) {
+        throw 42;                // temporary
+    }
+
     // If false is passed, it makes the zone broken as if it didn't have the
     // SOA.
     void setSOAFlag(bool on) { has_SOA_ = on; }

+ 6 - 0
src/lib/datasrc/database.cc

@@ -892,6 +892,12 @@ DatabaseClient::Finder::findInternal(const isc::dns::Name& name,
     }
 }
 
+pair<bool, isc::dns::ConstRRsetPtr>
+DatabaseClient::Finder::findNSEC3(const isc::dns::Name&, bool) {
+    isc_throw(NotImplemented, "findNSEC3 is not yet implemented for database "
+              "data source");
+}
+
 Name
 DatabaseClient::Finder::findPreviousName(const Name& name) const {
     const string str(accessor_->findPreviousName(zone_id_,

+ 4 - 0
src/lib/datasrc/database.h

@@ -754,6 +754,10 @@ public:
         virtual isc::dns::Name findPreviousName(const isc::dns::Name& query)
             const;
 
+        /// TBD
+	virtual std::pair<bool, isc::dns::ConstRRsetPtr>
+		findNSEC3(const isc::dns::Name& name, bool recursive);
+
         /// \brief The zone ID
         ///
         /// This function provides the stored zone ID as passed to the

+ 6 - 0
src/lib/datasrc/memory_datasrc.cc

@@ -641,6 +641,12 @@ InMemoryZoneFinder::findAll(const Name& name,
     return (impl_->find(name, RRType::ANY(), &target, options));
 }
 
+pair<bool, isc::dns::ConstRRsetPtr>
+InMemoryZoneFinder::findNSEC3(const isc::dns::Name&, bool) {
+    isc_throw(NotImplemented, "findNSEC3 is not yet implemented for in memory "
+              "data source");
+}
+
 result::Result
 InMemoryZoneFinder::add(const ConstRRsetPtr& rrset) {
     return (impl_->add(rrset, &impl_->domains_));

+ 4 - 0
src/lib/datasrc/memory_datasrc.h

@@ -83,6 +83,10 @@ public:
                                std::vector<isc::dns::ConstRRsetPtr>& target,
                                const FindOptions options = FIND_DEFAULT);
 
+    /// TBD
+    virtual std::pair<bool, isc::dns::ConstRRsetPtr>
+    findNSEC3(const isc::dns::Name& name, bool recursive);
+
     /// \brief Imelementation of the ZoneFinder::findPreviousName method
     ///
     /// This one throws NotImplemented exception, as InMemory doesn't

+ 7 - 0
src/lib/datasrc/zone.h

@@ -15,6 +15,9 @@
 #ifndef __ZONE_H
 #define __ZONE_H 1
 
+#include <utility>
+#include <vector>
+
 #include <dns/rrset.h>
 #include <dns/rrsetlist.h>
 
@@ -306,6 +309,10 @@ public:
                                std::vector<isc::dns::ConstRRsetPtr> &target,
                                const FindOptions options = FIND_DEFAULT) = 0;
 
+    /// TBD
+    virtual std::pair<bool, isc::dns::ConstRRsetPtr>
+    findNSEC3(const isc::dns::Name& name, bool recursive) = 0;
+
     /// \brief Get previous name in the zone
     ///
     /// Gets the previous name in the DNSSEC order. This can be used