model: (Re-)Implementing ability to keep PIT records after Interest is getting satisfied
Default behavior remained the same.
As part of this commit, a small extension (and bug fix) in trie data
structure, allowing search with predicates (e.g., used to lookup a
non-empty PIT entry during Lookup on ContentObject header).
diff --git a/model/pit/ndn-pit-entry.cc b/model/pit/ndn-pit-entry.cc
index 77c7578..accfcf1 100644
--- a/model/pit/ndn-pit-entry.cc
+++ b/model/pit/ndn-pit-entry.cc
@@ -62,12 +62,12 @@
Entry::UpdateLifetime (const Time &offsetTime)
{
NS_LOG_FUNCTION (offsetTime.ToDouble (Time::S));
-
+
Time newExpireTime = Simulator::Now () + offsetTime;
if (newExpireTime > m_expireTime)
m_expireTime = newExpireTime;
-
- NS_LOG_INFO ("Updated lifetime to " << m_expireTime.ToDouble (Time::S));
+
+ NS_LOG_INFO (this->GetPrefix () << ", Updated lifetime to " << m_expireTime.ToDouble (Time::S) << "s, " << (m_expireTime-Simulator::Now ()).ToDouble (Time::S) << "s left");
}
void
@@ -78,7 +78,7 @@
{
m_expireTime = Simulator::Now ();
}
- NS_LOG_INFO ("Offsetting lifetime to " << m_expireTime.ToDouble (Time::S));
+ NS_LOG_INFO (this->GetPrefix () << ", Offsetting lifetime to " << m_expireTime.ToDouble (Time::S) << "s, " << (m_expireTime-Simulator::Now ()).ToDouble (Time::S) << "s left");
}
@@ -110,7 +110,7 @@
Entry::in_iterator
Entry::AddIncoming (Ptr<Face> face)
{
- std::pair<in_iterator,bool> ret =
+ std::pair<in_iterator,bool> ret =
m_incoming.insert (IncomingFace (face));
// NS_ASSERT_MSG (ret.second, "Something is wrong");
@@ -277,7 +277,7 @@
os << ",";
else
first = false;
-
+
os << *face.m_face;
}
@@ -289,7 +289,7 @@
os << ",";
else
first = false;
-
+
os << *face.m_face;
}
os << "\nNonces: ";
@@ -300,7 +300,7 @@
os << ",";
else
first = false;
-
+
os << nonce;
}