Browse Source

[1604b] Make (Const)RRsetPtr point to an AbstractRRset

To allow for future optimization, the RRset pointer classes now
point to the base of the RRset inheritance hierarchy.
Stephen Morris 13 years ago
parent
commit
6afe3a0422

+ 16 - 16
src/bin/auth/query.cc

@@ -34,7 +34,7 @@ namespace isc {
 namespace auth {
 
 void
-Query::addAdditional(ZoneFinder& zone, const RRset& rrset) {
+Query::addAdditional(ZoneFinder& zone, const AbstractRRset& rrset) {
     RdataIteratorPtr rdata_iterator(rrset.getRdataIterator());
     for (; !rdata_iterator->isLast(); rdata_iterator->next()) {
         const Rdata& rdata(rdata_iterator->getCurrent());
@@ -73,7 +73,7 @@ Query::addAdditionalAddrs(ZoneFinder& zone, const Name& qname,
                                                     options | dnssec_opt_);
         if (a_result.code == ZoneFinder::SUCCESS) {
             response_.addRRset(Message::SECTION_ADDITIONAL,
-                    boost::const_pointer_cast<RRset>(a_result.rrset), dnssec_);
+                    boost::const_pointer_cast<AbstractRRset>(a_result.rrset), dnssec_);
         }
     }
 
@@ -83,7 +83,7 @@ Query::addAdditionalAddrs(ZoneFinder& zone, const Name& qname,
                                                        options | dnssec_opt_);
         if (aaaa_result.code == ZoneFinder::SUCCESS) {
             response_.addRRset(Message::SECTION_ADDITIONAL,
-                    boost::const_pointer_cast<RRset>(aaaa_result.rrset),
+                    boost::const_pointer_cast<AbstractRRset>(aaaa_result.rrset),
                     dnssec_);
         }
     }
@@ -104,7 +104,7 @@ Query::addSOA(ZoneFinder& finder) {
          * to insist.
          */
         response_.addRRset(Message::SECTION_AUTHORITY,
-            boost::const_pointer_cast<RRset>(soa_result.rrset), dnssec_);
+            boost::const_pointer_cast<AbstractRRset>(soa_result.rrset), dnssec_);
     }
 }
 
@@ -124,7 +124,7 @@ Query::addNXDOMAINProof(ZoneFinder& finder, ConstRRsetPtr nsec) {
 
     // Add the NSEC proving NXDOMAIN to the authority section.
     response_.addRRset(Message::SECTION_AUTHORITY,
-                       boost::const_pointer_cast<RRset>(nsec), dnssec_);
+                       boost::const_pointer_cast<AbstractRRset>(nsec), dnssec_);
 
     // Next, identify the best possible wildcard name that would match
     // the query name.  It's the longer common suffix with the qname
@@ -162,7 +162,7 @@ Query::addNXDOMAINProof(ZoneFinder& finder, ConstRRsetPtr nsec) {
     // for some optimized data source implementations.
     if (nsec->getName() != fresult.rrset->getName()) {
         response_.addRRset(Message::SECTION_AUTHORITY,
-                           boost::const_pointer_cast<RRset>(fresult.rrset),
+                           boost::const_pointer_cast<AbstractRRset>(fresult.rrset),
                            dnssec_);
     }
 }
@@ -180,7 +180,7 @@ Query::addWildcardProof(ZoneFinder& finder) {
         isc_throw(BadNSEC, "Unexpected result for wildcard proof");
     }
     response_.addRRset(Message::SECTION_AUTHORITY,
-                       boost::const_pointer_cast<RRset>(fresult.rrset),
+                       boost::const_pointer_cast<AbstractRRset>(fresult.rrset),
                        dnssec_);
 }
 
@@ -203,7 +203,7 @@ Query::addWildcardNXRRSETProof(ZoneFinder& finder, ConstRRsetPtr nsec) {
     if (nsec->getName() != fresult.rrset->getName()) {
         // one NSEC RR proves wildcard_nxrrset that no matched QNAME.
         response_.addRRset(Message::SECTION_AUTHORITY,
-                           boost::const_pointer_cast<RRset>(fresult.rrset),
+                           boost::const_pointer_cast<AbstractRRset>(fresult.rrset),
                            dnssec_);
     }
 }
@@ -214,7 +214,7 @@ Query::addDS(ZoneFinder& finder, const Name& dname) {
         finder.find(dname, RRType::DS(), dnssec_opt_);
     if (ds_result.code == ZoneFinder::SUCCESS) {
         response_.addRRset(Message::SECTION_AUTHORITY,
-                           boost::const_pointer_cast<RRset>(ds_result.rrset),
+                           boost::const_pointer_cast<AbstractRRset>(ds_result.rrset),
                            dnssec_);
     } else if (ds_result.code == ZoneFinder::NXRRSET) {
         addNXRRsetProof(finder, ds_result);
@@ -230,7 +230,7 @@ Query::addNXRRsetProof(ZoneFinder& finder,
 {
     if (db_result.isNSECSigned() && db_result.rrset) {
         response_.addRRset(Message::SECTION_AUTHORITY,
-                           boost::const_pointer_cast<RRset>(
+                           boost::const_pointer_cast<AbstractRRset>(
                                db_result.rrset),
                            dnssec_);
         if (db_result.isWildcard()) {
@@ -251,7 +251,7 @@ Query::addAuthAdditional(ZoneFinder& finder) {
                 finder.getOrigin().toText());
     } else {
         response_.addRRset(Message::SECTION_AUTHORITY,
-            boost::const_pointer_cast<RRset>(ns_result.rrset), dnssec_);
+            boost::const_pointer_cast<AbstractRRset>(ns_result.rrset), dnssec_);
         // Handle additional for authority section
         addAdditional(finder, *ns_result.rrset);
     }
@@ -294,7 +294,7 @@ Query::process() {
         case ZoneFinder::DNAME: {
             // First, put the dname into the answer
             response_.addRRset(Message::SECTION_ANSWER,
-                boost::const_pointer_cast<RRset>(db_result.rrset),
+                boost::const_pointer_cast<AbstractRRset>(db_result.rrset),
                 dnssec_);
             /*
              * Empty DNAME should never get in, as it is impossible to
@@ -345,7 +345,7 @@ Query::process() {
              * So, just put it there.
              */
             response_.addRRset(Message::SECTION_ANSWER,
-                boost::const_pointer_cast<RRset>(db_result.rrset),
+                boost::const_pointer_cast<AbstractRRset>(db_result.rrset),
                 dnssec_);
 
             // If the answer is a result of wildcard substitution,
@@ -360,13 +360,13 @@ Query::process() {
                 // into answer section.
                 BOOST_FOREACH(ConstRRsetPtr rrset, target) {
                     response_.addRRset(Message::SECTION_ANSWER,
-                        boost::const_pointer_cast<RRset>(rrset), dnssec_);
+                        boost::const_pointer_cast<AbstractRRset>(rrset), dnssec_);
                     // Handle additional for answer section
                     addAdditional(*result.zone_finder, *rrset.get());
                 }
             } else {
                 response_.addRRset(Message::SECTION_ANSWER,
-                    boost::const_pointer_cast<RRset>(db_result.rrset),
+                    boost::const_pointer_cast<AbstractRRset>(db_result.rrset),
                     dnssec_);
                 // Handle additional for answer section
                 addAdditional(*result.zone_finder, *db_result.rrset);
@@ -391,7 +391,7 @@ Query::process() {
         case ZoneFinder::DELEGATION:
             response_.setHeaderFlag(Message::HEADERFLAG_AA, false);
             response_.addRRset(Message::SECTION_AUTHORITY,
-                boost::const_pointer_cast<RRset>(db_result.rrset),
+                boost::const_pointer_cast<AbstractRRset>(db_result.rrset),
                 dnssec_);
             // If DNSSEC is requested, see whether there is a DS
             // record for this delegation.

+ 1 - 1
src/bin/auth/query.h

@@ -135,7 +135,7 @@ private:
     /// \param rrset The RRset (i.e., NS or MX rrset) which require additional
     /// processing.
     void addAdditional(isc::datasrc::ZoneFinder& zone,
-                       const isc::dns::RRset& rrset);
+                       const isc::dns::AbstractRRset& rrset);
 
     /// \brief Find address records for a specified name.
     ///

+ 1 - 1
src/bin/auth/tests/query_unittest.cc

@@ -389,7 +389,7 @@ private:
 // A helper function that generates a new RRset based on "wild_rrset",
 // replacing its owner name with 'real_name'.
 ConstRRsetPtr
-substituteWild(const RRset& wild_rrset, const Name& real_name) {
+substituteWild(const AbstractRRset& wild_rrset, const Name& real_name) {
     RRsetPtr rrset(new RRset(real_name, wild_rrset.getClass(),
                              wild_rrset.getType(), wild_rrset.getTTL()));
     // For simplicity we only consider the case with one RDATA (for now)

+ 1 - 1
src/lib/cache/local_zone_data.cc

@@ -43,7 +43,7 @@ LocalZoneData::lookup(const isc::dns::Name& name,
 }
 
 void
-LocalZoneData::update(const isc::dns::RRset& rrset) {
+LocalZoneData::update(const isc::dns::AbstractRRset& rrset) {
     //TODO Do we really need to recreate the rrset again?
     string key = genCacheEntryName(rrset.getName(), rrset.getType());
     LOG_DEBUG(logger, DBG_TRACE_DATA, CACHE_LOCALZONE_UPDATE).arg(key);

+ 1 - 1
src/lib/cache/local_zone_data.h

@@ -47,7 +47,7 @@ public:
     /// Otherwise, the existed one will be overwritten.
     ///
     /// \param rrset The rrset to update
-    void update(const isc::dns::RRset& rrset);
+    void update(const isc::dns::AbstractRRset& rrset);
 
 private:
     std::map<std::string, isc::dns::RRsetPtr> rrsets_map_; // RRsets of the zone

+ 1 - 1
src/lib/cache/rrset_cache.cc

@@ -70,7 +70,7 @@ RRsetCache::lookup(const isc::dns::Name& qname,
 }
 
 RRsetEntryPtr
-RRsetCache::update(const isc::dns::RRset& rrset,
+RRsetCache::update(const isc::dns::AbstractRRset& rrset,
                    const RRsetTrustLevel& level)
 {
     LOG_DEBUG(logger, DBG_TRACE_DATA, CACHE_RRSET_UPDATE).arg(rrset.getName()).

+ 1 - 1
src/lib/cache/rrset_cache.h

@@ -73,7 +73,7 @@ public:
     /// \param level trustworthiness of the rrset.
     /// \return return the rrset entry in the cache, it may be the
     /// new added rrset entry or existed one if it is not replaced.
-    RRsetEntryPtr update(const isc::dns::RRset& rrset,
+    RRsetEntryPtr update(const isc::dns::AbstractRRset& rrset,
                          const RRsetTrustLevel& level);
 
     /// \short Protected memebers, so they can be accessed by tests.

+ 1 - 1
src/lib/cache/rrset_copy.cc

@@ -20,7 +20,7 @@ namespace isc {
 namespace cache {
 
 void
-rrsetCopy(const isc::dns::RRset& src, isc::dns::RRset& dst) {
+rrsetCopy(const isc::dns::AbstractRRset& src, isc::dns::AbstractRRset& dst) {
     RdataIteratorPtr rdata_itor = src.getRdataIterator();
     rdata_itor->first();
     while(!rdata_itor->isLast()){

+ 1 - 1
src/lib/cache/rrset_copy.h

@@ -33,7 +33,7 @@ namespace cache {
 ///       we have to do the copy.
 
 void
-rrsetCopy(const isc::dns::RRset& src, isc::dns::RRset& dst);
+rrsetCopy(const isc::dns::AbstractRRset& src, isc::dns::AbstractRRset& dst);
 
 } // namespace cache
 } // namespace isc

+ 2 - 1
src/lib/cache/rrset_entry.cc

@@ -25,7 +25,8 @@ using namespace isc::dns;
 namespace isc {
 namespace cache {
 
-RRsetEntry::RRsetEntry(const isc::dns::RRset& rrset, const RRsetTrustLevel& level):
+RRsetEntry::RRsetEntry(const isc::dns::AbstractRRset& rrset,
+                       const RRsetTrustLevel& level):
     entry_name_(genCacheEntryName(rrset.getName(), rrset.getType())),
     expire_time_(time(NULL) + rrset.getTTL().getValue()),
     trust_level_(level),

+ 2 - 1
src/lib/cache/rrset_entry.h

@@ -75,7 +75,8 @@ public:
     /// \brief Constructor
     /// \param rrset The RRset used to initialize the RRset entry.
     /// \param level trustworthiness of the RRset.
-    RRsetEntry(const isc::dns::RRset& rrset, const RRsetTrustLevel& level);
+    RRsetEntry(const isc::dns::AbstractRRset& rrset,
+               const RRsetTrustLevel& level);
 
     /// The destructor.
     ~RRsetEntry() {}

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

@@ -1120,8 +1120,8 @@ public:
 
     virtual ZoneFinder& getFinder() { return (*finder_); }
 
-    virtual void addRRset(const RRset& rrset);
-    virtual void deleteRRset(const RRset& rrset);
+    virtual void addRRset(const AbstractRRset& rrset);
+    virtual void deleteRRset(const AbstractRRset& rrset);
     virtual void commit();
 
 private:
@@ -1148,14 +1148,15 @@ private:
     // This is a set of validation checks commonly used for addRRset() and
     // deleteRRset to minimize duplicate code logic and to make the main
     // code concise.
-    void validateAddOrDelete(const char* const op_str, const RRset& rrset,
+    void validateAddOrDelete(const char* const op_str,
+                             const AbstractRRset& rrset,
                              DiffPhase prev_phase,
                              DiffPhase current_phase) const;
 };
 
 void
 DatabaseUpdater::validateAddOrDelete(const char* const op_str,
-                                     const RRset& rrset,
+                                     const AbstractRRset& rrset,
                                      DiffPhase prev_phase,
                                      DiffPhase current_phase) const
 {
@@ -1193,7 +1194,7 @@ DatabaseUpdater::validateAddOrDelete(const char* const op_str,
 }
 
 void
-DatabaseUpdater::addRRset(const RRset& rrset) {
+DatabaseUpdater::addRRset(const AbstractRRset& rrset) {
     validateAddOrDelete("add", rrset, DELETE, ADD);
 
     // It's guaranteed rrset has at least one RDATA at this point.
@@ -1239,7 +1240,7 @@ DatabaseUpdater::addRRset(const RRset& rrset) {
 }
 
 void
-DatabaseUpdater::deleteRRset(const RRset& rrset) {
+DatabaseUpdater::deleteRRset(const AbstractRRset& rrset) {
     // If this is the first operation, pretend we are starting a new delete
     // sequence after adds.  This will simplify the validation below.
     if (diff_phase_ == NOT_STARTED) {

+ 1 - 1
src/lib/datasrc/memory_datasrc.cc

@@ -286,7 +286,7 @@ struct InMemoryZoneFinder::InMemoryZoneFinderImpl {
         // Note: there's a slight chance of getting an exception.
         // As noted in add(), we give up strong exception guarantee in such
         // cases.
-        boost::const_pointer_cast<RRset>(it->second)->addRRsig(sig_rrset);
+        boost::const_pointer_cast<AbstractRRset>(it->second)->addRRsig(sig_rrset);
 
         return (result::SUCCESS);
     }

+ 2 - 2
src/lib/datasrc/zone.h

@@ -667,7 +667,7 @@ public:
     /// \exception std::bad_alloc Resource allocation failure
     ///
     /// \param rrset The RRset to be added
-    virtual void addRRset(const isc::dns::RRset& rrset) = 0;
+    virtual void addRRset(const isc::dns::AbstractRRset& rrset) = 0;
 
     /// Delete an RRset from a zone via the updater
     ///
@@ -739,7 +739,7 @@ public:
     /// \exception std::bad_alloc Resource allocation failure
     ///
     /// \param rrset The RRset to be deleted
-    virtual void deleteRRset(const isc::dns::RRset& rrset) = 0;
+    virtual void deleteRRset(const isc::dns::AbstractRRset& rrset) = 0;
 
     /// Commit the updates made in the updater to the zone
     ///

+ 1 - 1
src/lib/dns/python/message_python.cc

@@ -433,7 +433,7 @@ private:
 };
 
 typedef SectionInserter<ConstQuestionPtr, Question> QuestionInserter;
-typedef SectionInserter<ConstRRsetPtr, RRset> RRsetInserter;
+typedef SectionInserter<ConstRRsetPtr, AbstractRRset> RRsetInserter;
 
 // TODO use direct iterators for these? (or simply lists for now?)
 PyObject*

+ 2 - 2
src/lib/dns/python/rrset_python.cc

@@ -415,7 +415,7 @@ PyTypeObject rrset_type = {
 };
 
 PyObject*
-createRRsetObject(const RRset& source) {
+createRRsetObject(const AbstractRRset& source) {
 
     // RRsets are noncopyable, so as a workaround we recreate a new one
     // and copy over all content
@@ -450,7 +450,7 @@ PyRRset_Check(PyObject* obj) {
     return (PyObject_TypeCheck(obj, &rrset_type));
 }
 
-RRset&
+AbstractRRset&
 PyRRset_ToRRset(PyObject* rrset_obj) {
     s_RRset* rrset = static_cast<s_RRset*>(rrset_obj);
     return (*rrset->cppobj);

+ 2 - 2
src/lib/dns/python/rrset_python.h

@@ -36,7 +36,7 @@ extern PyTypeObject rrset_type;
 /// returns a NULL pointer).
 /// This function is expected to be called within a try block
 /// followed by necessary setup for python exception.
-PyObject* createRRsetObject(const RRset& source);
+PyObject* createRRsetObject(const AbstractRRset& source);
 
 /// \brief Checks if the given python object is a RRset object
 ///
@@ -56,7 +56,7 @@ bool PyRRset_Check(PyObject* obj);
 /// may be destroyed, the caller must copy it itself.
 ///
 /// \param rrset_obj The rrset object to convert
-RRset& PyRRset_ToRRset(PyObject* rrset_obj);
+AbstractRRset& PyRRset_ToRRset(PyObject* rrset_obj);
 
 /// \brief Returns the shared_ptr of the RRset object contained within the
 ///        given Python object.

+ 180 - 7
src/lib/dns/rrset.h

@@ -58,14 +58,14 @@ class RRset;
 ///
 /// This type is commonly used as an argument of various functions defined
 /// in this library in order to handle RRsets in a polymorphic manner.
-typedef boost::shared_ptr<RRset> RRsetPtr;
+typedef boost::shared_ptr<AbstractRRset> RRsetPtr;
 
 /// \brief A pointer-like type pointing to an (immutable) \c RRset
 /// object.
 ///
 /// This type is commonly used as an argument of various functions defined
 /// in this library in order to handle RRsets in a polymorphic manner.
-typedef boost::shared_ptr<const RRset> ConstRRsetPtr;
+typedef boost::shared_ptr<const AbstractRRset> ConstRRsetPtr;
 
 /// \brief A pointer-like type point to an \c RdataIterator object.
 typedef boost::shared_ptr<RdataIterator> RdataIteratorPtr;
@@ -400,6 +400,82 @@ public:
     /// object.
     virtual RdataIteratorPtr getRdataIterator() const = 0;
     //@}
+
+    ///
+    /// \name Associated RRSIG methods
+    ///
+    /// These methods access an "associated" RRset, that containing the DNSSEC
+    /// signatures for this RRset.  It can be argued that this is not a
+    /// fundamental part of the RRset abstraction, since RFC 2181 defined an
+    /// RRset as a group of records with the same label, class and type but
+    /// different data.  However, BIND 10 has to deal with DNSSEC and in
+    /// practice, including the information at the AbstractRRset level makes
+    /// implementation easier.  (If a class is ever needed that must be
+    /// ignorant of the idea of an associated RRSIG RRset - e.g. a specialised
+    /// RRSIG RRset class - these methods can just throw a "NotImplemented"
+    /// exception.)
+    //@{
+    /// \brief Return pointer to this RRset's RRSIG RRset
+    ///
+    /// \return Pointer to the associated RRSIG RRset or null if there is none.
+    virtual RRsetPtr getRRsig() const = 0;
+
+    /// \brief Adds RRSIG RRset RRs to the associated RRSIG RRset
+    ///
+    /// Adds the (assumed) RRSIG rdata the RRSIG RRset associated with this
+    /// RRset.  If one does not exist, it is created using the data given.
+    ///
+    /// \param rdata Pointer to RRSIG rdata to be added.
+    virtual void addRRsig(const rdata::ConstRdataPtr rdata) = 0;
+
+    /// \brief Adds RRSIG RRset RRs to the associated RRSIG RRset
+    ///
+    /// Adds the (assumed) RRSIG rdata the RRSIG RRset associated with this
+    /// RRset.  If one does not exist, it is created using the data given.
+    ///
+    /// (This overload is for an older version of boost that doesn't support
+    /// conversion from shared_ptr<X> to shared_ptr<const X>.)
+    ///
+    /// \param rdata Pointer to RRSIG rdata to be added.
+    virtual void addRRsig(const rdata::RdataPtr rdata) = 0;
+
+    /// \brief Adds RRSIG RRset RRs to the associated RRSIG RRset
+    ///
+    /// Adds the signatures in the given (assumed) RRSIG RRset to the RRSIG
+    /// RRset associated with this RRset.  If one does not exist, it is created
+    /// using the data given.
+    ///
+    /// \param sigs RRSIG RRset containing signatures to be added to the
+    ///             RRSIG RRset associated with this class.
+    virtual void addRRsig(const AbstractRRset& sigs) = 0;
+
+    /// \brief Adds RRSIG RRset RRs to the associated RRSIG RRset
+    ///
+    /// Adds the signatures in the given (assumed) RRSIG RRset to the RRSIG
+    /// RRset associated with this RRset.  If one does not exist, it is created
+    /// using the data given.
+    ///
+    /// \param sigs Pointer to a RRSIG RRset containing signatures to be added
+    ///             to the RRSIG RRset associated with this class.
+    virtual void addRRsig(ConstRRsetPtr sigs) = 0;
+
+    /// \brief Adds RRSIG RRset RRs to the associated RRSIG RRset
+    ///
+    /// Adds the signatures in the given (assumed) RRSIG RRset to the RRSIG
+    /// RRset associated with this RRset.  If one does not exist, it is created
+    /// using the data given.
+    ///
+    /// (This overload is for an older version of boost that doesn't support
+    /// conversion from shared_ptr<X> to shared_ptr<const X>.)
+    ///
+    /// \param sigs Pointer to a RRSIG RRset containing signatures to be added
+    ///             to the RRSIG RRset associated with this class.
+    virtual void addRRsig(RRsetPtr sigs) = 0;
+
+    /// \brief Clear the RRSIGs for this RRset
+    virtual void removeRRsig() = 0;
+
+    //@}
 };
 
 /// \brief The \c RdataIterator class is an abstract base class that
@@ -660,6 +736,103 @@ public:
     /// object for the \c BasicRRset class.
     virtual RdataIteratorPtr getRdataIterator() const;
     //@}
+
+    ///
+    /// \name Associated RRSIG methods
+    ///
+    /// The associated RRSIG RRset is not supported in BasicRRset, so these
+    /// methods throw a NotImplemented exception.
+    //@{
+    /// \brief Return pointer to this RRset's RRSIG RRset
+    ///
+    /// \exception NotImplemented Always thrown.  Associated RRSIG RRsets are
+    ///            not supported in this class.
+    ///
+    /// \return Never returns normally - always throws a NotImplemented
+    ///         exception.
+    virtual RRsetPtr getRRsig() const {
+        isc_throw(NotImplemented,
+                  "BasicRRset does not implement the getRRsig() method");
+    }
+
+    /// \brief Adds RRSIG RRset RRs to the associated RRSIG RRset
+    ///
+    /// Not implemented in this class.
+    ///
+    /// \param rdata RRSIG rdata to be added to this RRset
+    ///
+    /// \exception NotImplemented Always thrown.  Associated RRSIG RRsets are
+    ///            not supported in this class.
+    virtual void addRRsig(const rdata::ConstRdataPtr) {
+        isc_throw(NotImplemented,
+                  "BasicRRset does not implement the addRRsig() method");
+    }
+
+    /// \brief Adds RRSIG RRset RRs to the associated RRSIG RRset
+    ///
+    /// Not implemented in this class.
+    /// (This overload is for an older version of boost that doesn't support
+    /// conversion from shared_ptr<X> to shared_ptr<const X>.)
+    ///
+    /// \param rdata RRSIG rdata to be added to this RRset
+    ///
+    /// \exception NotImplemented Always thrown.  Associated RRSIG RRsets are
+    ///            not supported in this class.
+    virtual void addRRsig(const rdata::RdataPtr) {
+        isc_throw(NotImplemented,
+                  "BasicRRset does not implement the addRRsig() method");
+    }
+
+    /// \brief Adds RRSIG RRset RRs to the associated RRSIG RRset
+    ///
+    /// Not implemented in this class.
+    ///
+    /// \param sigs RRSIG RRset containing signatures to be added to the
+    ///             RRSIG RRset associated with this class.
+    ///
+    /// \exception NotImplemented Always thrown.  Associated RRSIG RRsets are
+    ///            not supported in this class.
+    virtual void addRRsig(const AbstractRRset&) {
+        isc_throw(NotImplemented,
+                  "BasicRRset does not implement the addRRsig() method");
+    }
+
+    /// \brief Adds RRSIG RRset RRs to the associated RRSIG RRset
+    ///
+    /// Not implemented in this class.
+    ///
+    /// \param sigs Pointer to a RRSIG RRset containing signatures to be added
+    ///             to the RRSIG RRset associated with this class.
+    ///
+    /// \exception NotImplemented Always thrown.  Associated RRSIG RRsets are
+    ///            not supported in this class.
+    virtual void addRRsig(ConstRRsetPtr) {
+        isc_throw(NotImplemented,
+                  "BasicRRset does not implement the addRRsig() method");
+    }
+
+    /// \brief Adds RRSIG RRset RRs to the associated RRSIG RRset
+    ///
+    /// Not implemented in this class.
+    /// (This overload is for an older version of boost that doesn't support
+    /// conversion from shared_ptr<X> to shared_ptr<const X>.)
+    ///
+    /// \param sigs Pointer to a RRSIG RRset containing signatures to be added
+    ///             to the RRSIG RRset associated with this class.
+    ///
+    /// \exception NotImplemented Always thrown.  Associated RRSIG RRsets are
+    ///            not supported in this class.
+    virtual void addRRsig(RRsetPtr) {
+        isc_throw(NotImplemented,
+                  "BasicRRset does not implement the addRRsig() method");
+    }
+
+    /// \brief Clear the RRSIGs for this RRset
+    virtual void removeRRsig() {
+        isc_throw(NotImplemented,
+                  "BasicRRset does not implement the removeRRsig() method");
+    }
+    //@}
 private:
     BasicRRsetImpl* impl_;
 };
@@ -705,12 +878,12 @@ public:
     // conversion from shared_ptr<X> to shared_ptr<const X>.  Note: we should
     // revisit the interface of managing RRset signatures, at which point this
     // problem may go away.
-    void addRRsig(const rdata::RdataPtr rdata) {
+    virtual void addRRsig(const rdata::RdataPtr rdata) {
         addRRsig(static_cast<rdata::ConstRdataPtr>(rdata));
     }
 
     /// \brief Adds an RRSIG RRset to this RRset
-    void addRRsig(const AbstractRRset& sigs) {
+    virtual void addRRsig(const AbstractRRset& sigs) {
         RdataIteratorPtr it = sigs.getRdataIterator();
 
         if (!rrsig_) {
@@ -723,13 +896,13 @@ public:
         }
     }
 
-    void addRRsig(ConstRRsetPtr sigs) { addRRsig(*sigs); }
+    virtual void addRRsig(ConstRRsetPtr sigs) { addRRsig(*sigs); }
 
     // Another workaround for older boost (see above)
-    void addRRsig(RRsetPtr sigs) { addRRsig(*sigs); }
+    virtual void addRRsig(RRsetPtr sigs) { addRRsig(*sigs); }
 
     /// \brief Clear the RRSIGs for this RRset
-    void removeRRsig() { rrsig_ = RRsetPtr(); }
+    virtual void removeRRsig() { rrsig_ = RRsetPtr(); }
 
     /// \brief Return a pointer to this RRset's RRSIG RRset
     RRsetPtr getRRsig() const { return (rrsig_); }

+ 1 - 1
src/lib/nsas/tests/nameserver_address_store_unittest.cc

@@ -475,7 +475,7 @@ TEST_F(NameserverAddressStoreTest, updateRTT) {
     // for ns.example.com (the nameserver set for example.net in the class
     // initialization).  We'll set two addresses.
     Name ns_example_com(ns_name);
-    RRsetPtr ns_address = boost::shared_ptr<RRset>(new RRset(
+    isc::dns::RRsetPtr ns_address = boost::shared_ptr<RRset>(new RRset(
         ns_example_com, RRClass::IN(), RRType::A(), RRTTL(300)));
     BOOST_FOREACH(string addr, address) {
         ns_address->addRdata(rdata::in::A(addr));