|
@@ -25,6 +25,17 @@
|
|
|
namespace isc {
|
|
|
namespace nsas {
|
|
|
|
|
|
+/// \brief Empty \c NameserverEntry pointer exception
|
|
|
+///
|
|
|
+/// Thrown if the the \c NameservrEntry pointer in the \c boost::shared_ptr that passed
|
|
|
+/// into \c NameserverAddress' constructor is NULL
|
|
|
+class NullNameserverEntryPointer : public isc::Exception {
|
|
|
+public:
|
|
|
+ NullNameserverEntryPointer(const char* file, size_t line, const char* what) :
|
|
|
+ isc::Exception(file, line, what)
|
|
|
+ {}
|
|
|
+};
|
|
|
+
|
|
|
/// \brief Nameserver Address
|
|
|
///
|
|
|
/// This class implements the object that returned from NSAS when the resolver
|
|
@@ -48,6 +59,7 @@ public:
|
|
|
NameserverAddress(boost::shared_ptr<NameserverEntry>& nameserver, uint32_t index):
|
|
|
ns_(nameserver), index_(index)
|
|
|
{
|
|
|
+ if(!ns_.get()) isc_throw(NullNameserverEntryPointer, "NULL NameserverEntry pointer.");
|
|
|
}
|
|
|
|
|
|
/// \brief Destructor
|
|
@@ -59,9 +71,7 @@ public:
|
|
|
/// \brief Return address
|
|
|
///
|
|
|
asiolink::IOAddress getAddress() const {
|
|
|
- NameserverEntry *ne = ns_.get();
|
|
|
- assert(ne != NULL);
|
|
|
- return ne->getAddressAtIndex(index_);
|
|
|
+ return ns_.get()->getAddressAtIndex(index_);
|
|
|
}
|
|
|
|
|
|
/// \brief Update Round-trip Time
|