Commit 03265efc authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[1307] added a new accessor method, getNextName(), to rdata::generic::NSEC.

this is necessary for NSEC query handling.
parent f546d730
......@@ -178,6 +178,11 @@ NSEC::toWire(AbstractMessageRenderer& renderer) const {
renderer.writeData(&impl_->typebits_[0], impl_->typebits_.size());
}
const Name&
NSEC::getNextName() const {
return (impl_->nextname_);
}
int
NSEC::compare(const Rdata& other) const {
const NSEC& other_nsec = dynamic_cast<const NSEC&>(other);
......
......@@ -38,6 +38,16 @@ public:
// END_COMMON_MEMBERS
NSEC& operator=(const NSEC& source);
~NSEC();
// specialized methods
/// Return the next domain name.
///
/// \exception std::bad_alloc Resource allocation failure in name copy.
///
/// \return The next domain name field in the form of \c Name object.
const Name& getNextName() const;
private:
NSECImpl* impl_;
};
......
......@@ -89,4 +89,10 @@ TEST_F(Rdata_NSEC_Test, assign) {
EXPECT_EQ(0, rdata_nsec.compare(rdata_nsec2));
}
TEST_F(Rdata_NSEC_Test, getNextName) {
// The implementation is quite trivial, so we simply check it's actually
// defined and does work as intended in a simple case.
EXPECT_EQ(Name("www2.isc.org"), generic::NSEC((nsec_txt)).getNextName());
}
}
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