nrd<->rib: removing rib entries on face removal
refs #1327
Change-Id: I5abc10b3ab14fbf9b3bc6af64e896753c2cf5946
diff --git a/src/rib.cpp b/src/rib.cpp
index 3fc9399..ce8d7a2 100644
--- a/src/rib.cpp
+++ b/src/rib.cpp
@@ -62,5 +62,19 @@
}
}
+void
+Rib::erase(uint64_t faceId)
+{
+ //Keep it simple for now, with Trie this will be changed.
+ RibTable::iterator it = m_rib.begin();
+ while (it != m_rib.end())
+ {
+ if (it->getFaceId() == faceId)
+ it = m_rib.erase(it);
+ else
+ ++it;
+ }
+}
+
} // namespace nrd
} // namespace ndn