rib-manager: deleting expired entries from the rib and fib.
refs #1326
Change-Id: I865bff19da766560f920b1818bdf3eaa91e7dbb1
diff --git a/rib/rib-entry.cpp b/rib/rib-entry.cpp
index 98c3b90..5043233 100644
--- a/rib/rib-entry.cpp
+++ b/rib/rib-entry.cpp
@@ -69,6 +69,9 @@
m_nFacesWithCaptureSet--;
}
+ //cancel any scheduled event
+ scheduler::cancel(it->getExpirationEvent());
+
m_faces.erase(it);
return true;
}
@@ -229,12 +232,17 @@
operator<<(std::ostream& os, const FaceEntry& entry)
{
os << "FaceEntry("
- << " faceid: " << entry.faceId
- << " origin: " << entry.origin
- << " cost: " << entry.cost
- << " flags: " << entry.flags
- << " expires in: " << (entry.expires - time::steady_clock::now())
- << ")";
+ << "faceid: " << entry.faceId
+ << ", origin: " << entry.origin
+ << ", cost: " << entry.cost
+ << ", flags: " << entry.flags;
+ if (entry.expires != time::steady_clock::TimePoint::max()) {
+ os << ", expires in: " << (entry.expires - time::steady_clock::now());
+ }
+ else {
+ os << ", never expires";
+ }
+ os << ")";
return os;
}
@@ -242,8 +250,8 @@
std::ostream&
operator<<(std::ostream& os, const RibEntry& entry)
{
- os << "RibEntry{\n";
- os << "\tName: " << entry.getName() << "\n";
+ os << "RibEntry {\n";
+ os << "\tName: " << entry.getName() << "\n";
for (RibEntry::FaceList::const_iterator faceIt = entry.cbegin(); faceIt != entry.cend(); ++faceIt)
{