More progress with buffers
diff --git a/model/pit/ndn-pit-entry-impl.h b/model/pit/ndn-pit-entry-impl.h
index 85c94f1..6af9cc5 100644
--- a/model/pit/ndn-pit-entry-impl.h
+++ b/model/pit/ndn-pit-entry-impl.h
@@ -62,6 +62,15 @@
CONTAINER.RescheduleCleaning ();
}
+ virtual void
+ OffsetLifetime (const Time &offsetTime)
+ {
+ CONTAINER.i_time.erase (Pit::time_index::s_iterator_to (*this));
+ super::OffsetLifetime (offsetTime);
+ CONTAINER.i_time.insert (*this);
+
+ CONTAINER.RescheduleCleaning ();
+ }
// to make sure policies work
void
diff --git a/model/pit/ndn-pit-entry.cc b/model/pit/ndn-pit-entry.cc
index 4dcf6d0..af66570 100644
--- a/model/pit/ndn-pit-entry.cc
+++ b/model/pit/ndn-pit-entry.cc
@@ -70,6 +70,18 @@
NS_LOG_INFO ("Updated lifetime to " << m_expireTime.ToDouble (Time::S));
}
+void
+Entry::OffsetLifetime (const Time &offsetTime)
+{
+ m_expireTime += offsetTime;
+ if (m_expireTime < Simulator::Now ())
+ {
+ m_expireTime = Simulator::Now ();
+ }
+ NS_LOG_INFO ("Offsetting lifetime to " << m_expireTime.ToDouble (Time::S));
+}
+
+
const NameComponents &
Entry::GetPrefix () const
{
diff --git a/model/pit/ndn-pit-entry.h b/model/pit/ndn-pit-entry.h
index ecec2a6..7f4ef0e 100644
--- a/model/pit/ndn-pit-entry.h
+++ b/model/pit/ndn-pit-entry.h
@@ -119,12 +119,21 @@
* This function will update PIT entry lifetime to the maximum of the current lifetime and
* the lifetime Simulator::Now () + offsetTime
*
- * @param offsetTime Relative time to the current moment, representing PIT entry lifetime
+ * @param lifetime Relative time to the current moment, representing PIT entry lifetime
*/
virtual void
- UpdateLifetime (const Time &offsetTime);
+ UpdateLifetime (const Time &lifetime);
/**
+ * @brief Offset the currently set PIT lifetime (allowed both negative and positive offsets)
+ * @param offsetTime positive or negative offset for the PIT lifetime.
+ *
+ * If PIT expire time becomes less than Simulator::Now, then it is adjusted to Simulator::Now.
+ */
+ virtual void
+ OffsetLifetime (const Time &offsetTime);
+
+ /**
* @brief Get prefix of the PIT entry
*/
const NameComponents &