daemon: add NameServer
Change-Id: I64b82a0e9351bcc15691279470c807399480a474
diff --git a/src/daemon/rrset.cpp b/src/daemon/rrset.cpp
index 4559479..96ffce7 100644
--- a/src/daemon/rrset.cpp
+++ b/src/daemon/rrset.cpp
@@ -32,7 +32,7 @@
operator<<(std::ostream& os, const Rrset& rrset)
{
os << "Rrset: Id=" << rrset.getId();
- if (rrset.getZone() != 0)
+ if (rrset.getZone() != nullptr)
os << " Zone=(" << *rrset.getZone() << ")";
os << " Label=" << rrset.getLabel()
@@ -41,5 +41,21 @@
return os;
}
+bool
+Rrset::operator==(const Rrset& other) const
+{
+ if (getZone() == nullptr && other.getZone() != nullptr)
+ return false;
+ else if (getZone() != nullptr && other.getZone() == nullptr)
+ return false;
+ else if (getZone() == nullptr && other.getZone() == nullptr)
+ return (getLabel() == other.getLabel() &&
+ getType() == other.getType() && getVersion() == other.getVersion());
+ else
+ return (*getZone() == *other.getZone() && getLabel() == other.getLabel() &&
+ getType() == other.getType() && getVersion() == other.getVersion());
+
+}
+
} // namespace ndns
} // namespace ndn