Commit 26c7bfe8 authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

[1177] Function definiton for finding previous name

It will be needed for DNSSEC logic. Not implemented nor tested:
* The InMemory just throws NotImplemented
* The Database one will be done in next commits
parent f5239632
......@@ -564,6 +564,11 @@ DatabaseClient::Finder::find(const isc::dns::Name& name,
return (FindResult(result_status, result_rrset));
}
Name
DatabaseClient::Finder::findPreviousName(const Name&) const {
return (Name::ROOT_NAME()); // TODO Implement
}
Name
DatabaseClient::Finder::getOrigin() const {
return (origin_);
......
......@@ -589,6 +589,12 @@ public:
isc::dns::RRsetList* target = NULL,
const FindOptions options = FIND_DEFAULT);
/**
* \brief Implementation of ZoneFinder::findPreviousName method.
*/
virtual isc::dns::Name findPreviousName(const isc::dns::Name& query)
const;
/**
* \brief The zone ID
*
......
......@@ -661,6 +661,12 @@ InMemoryZoneFinder::getFileName() const {
return (impl_->file_name_);
}
isc::dns::Name
InMemoryZoneFinder::findPreviousName(const isc::dns::Name&) const {
isc_throw(NotImplemented, "InMemory data source doesn't support DNSSEC "
"yet, can't find previous name");
}
/// Implementation details for \c InMemoryClient hidden from the public
/// interface.
///
......
......@@ -75,6 +75,12 @@ public:
isc::dns::RRsetList* target = NULL,
const FindOptions options = FIND_DEFAULT);
/// \brief Imelementation of the ZoneFinder::findPreviousName method
///
/// This one throws NotImplemented exception, as InMemory doesn't
/// support DNSSEC currently.
virtual isc::dns::Name findPreviousName(const isc::dns::Name& query) const;
/// \brief Inserts an rrset into the zone.
///
/// It puts another RRset into the zone.
......
......@@ -394,6 +394,14 @@ public:
void doCancelWildcardTest();
};
/**
* \brief Check that findPreviousName throws as it should now.
*/
TEST_F(InMemoryZoneFinderTest, findPreviousName) {
EXPECT_THROW(zone_finder_.findPreviousName(Name("www.example.org")),
isc::NotImplemented);
}
/**
* \brief Test InMemoryZoneFinder::InMemoryZoneFinder constructor.
*
......
......@@ -145,7 +145,7 @@ public:
//@}
///
/// \name Search Method
/// \name Search Methods
///
//@{
/// Search the zone for a given pair of domain name and RR type.
......@@ -208,6 +208,28 @@ public:
isc::dns::RRsetList* target = NULL,
const FindOptions options
= FIND_DEFAULT) = 0;
/// \brief Get previous name in the zone
///
/// Gets the previous name in the DNSSEC order. This can be used
/// to find the correct NSEC or NSEC3 records for proving nonexistenc
/// of domains.
///
/// The concrete implementation might throw anything it thinks appropriate,
/// however it is recommended to stick to the ones listed here. The user
/// of this method should be able to handle any exceptions.
///
/// \param query The name for which one we look for a previous one. The
/// queried name doesn't have to exist in the zone.
/// \return The preceding name
///
/// \throw NotImplemented in case the data source backend doesn't support
/// DNSSEC.
/// \throw DataSourceError for low-level or internal datasource errors
/// (like broken connection to database, wrong data living there).
/// \throw std::bad_alloc For allocation errors.
virtual isc::dns::Name findPreviousName(const isc::dns::Name& query)
const = 0;
//@}
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment