nlsr: implement NameLsa::isEqualContent
Change-Id: Ibf9021144f5ff253515875ac61de97740a1fecd7
refs: #2962
diff --git a/src/name-prefix-list.cpp b/src/name-prefix-list.cpp
index 37c66dc..ec52068 100644
--- a/src/name-prefix-list.cpp
+++ b/src/name-prefix-list.cpp
@@ -77,6 +77,12 @@
return false;
}
+bool
+NamePrefixList::operator==(const NamePrefixList& other) const
+{
+ return m_nameList == other.getNameList();
+}
+
void
NamePrefixList::sort()
{
@@ -95,4 +101,14 @@
}
}
+std::ostream&
+operator<<(std::ostream& os, const NamePrefixList& list) {
+ os << "Name prefix list: {\n";
+ for (const auto& name : list.getNameList()) {
+ os << name << "\n";
+ }
+ os << "}" << std::endl;
+ return os;
+}
+
} // namespace nlsr