Small progress on pit/fib interaction
diff --git a/model/ccnx-content-store.cc b/model/ccnx-content-store.cc
index 57bb414..bb8c613 100644
--- a/model/ccnx-content-store.cc
+++ b/model/ccnx-content-store.cc
@@ -53,8 +53,6 @@
return tid;
}
-CcnxContentObjectTail CcnxContentStoreEntry::m_tail;
-
//////////////////////////////////////////////////////////////////////
// Helper classes
//////////////////////////////////////////////////////////////////////
@@ -103,17 +101,21 @@
CcnxContentStoreEntry::CcnxContentStoreEntry (Ptr<CcnxContentObjectHeader> header, Ptr<const Packet> packet)
: m_header (header)
{
+ static CcnxContentObjectTail tail; ///< \internal for optimization purposes
+
m_packet = packet->Copy ();
m_packet->RemoveHeader (*header);
- m_packet->RemoveTrailer (m_tail);
+ m_packet->RemoveTrailer (tail);
}
Ptr<Packet>
CcnxContentStoreEntry::GetFullyFormedCcnxPacket () const
{
+ static CcnxContentObjectTail tail; ///< \internal for optimization purposes
+
Ptr<Packet> packet = m_packet->Copy ();
packet->AddHeader (*m_header);
- packet->AddTrailer (m_tail);
+ packet->AddTrailer (tail);
return packet;
}
diff --git a/model/ccnx-content-store.h b/model/ccnx-content-store.h
index 7f75e92..0bd8fb9 100644
--- a/model/ccnx-content-store.h
+++ b/model/ccnx-content-store.h
@@ -106,8 +106,6 @@
private:
Ptr<CcnxContentObjectHeader> m_header; ///< \brief non-modifiable CcnxContentObjectHeader
Ptr<Packet> m_packet; ///< \brief non-modifiable content of the ContentObject packet
-
- static CcnxContentObjectTail m_tail; ///< \internal for optimization purposes
};
/**
diff --git a/model/ccnx-fib.h b/model/ccnx-fib.h
index ef5d5ad..23e5323 100644
--- a/model/ccnx-fib.h
+++ b/model/ccnx-fib.h
@@ -291,7 +291,7 @@
* \todo Implement exclude filters
*
* \param interest Interest packet header
- * \returns If entry found a pair <valid_iterator, true> will be returned, otherwise <invalid_iterator, false>
+ * \returns If entry found a valid iterator will be returned, otherwise end ()
*/
CcnxFibEntryContainer::type::iterator
LongestPrefixMatch (const CcnxInterestHeader &interest) const;
diff --git a/model/ccnx-pit-entry.cc b/model/ccnx-pit-entry.cc
index a79f6b7..ddc471e 100644
--- a/model/ccnx-pit-entry.cc
+++ b/model/ccnx-pit-entry.cc
@@ -123,9 +123,12 @@
entry.m_incoming.clear ();
}
-CcnxPitEntry::UpdateFibStatus::UpdateFibStatus (Ptr<CcnxFace> face, CcnxFibFaceMetric::Status status)
+CcnxPitEntry::UpdateFibStatus::UpdateFibStatus (Ptr<CcnxFace> face,
+ CcnxFibFaceMetric::Status status,
+ Ptr<CcnxFib> fib)
: m_face (face)
, m_status (status)
+ , m_fib (fib)
{
}
@@ -133,7 +136,8 @@
CcnxPitEntry::UpdateFibStatus::operator() (CcnxPitEntry &entry)
{
NS_ASSERT_MSG (false, "Broken");
- // entry.m_fib->UpdateStatus (m_face, m_status);
+ m_fib->modify (m_fib->iterator_to (entry.m_fibEntry),
+ CcnxFibEntry::UpdateStatus (m_face, m_status));
}
void
diff --git a/model/ccnx-pit-entry.h b/model/ccnx-pit-entry.h
index ac16c21..fa89b5e 100644
--- a/model/ccnx-pit-entry.h
+++ b/model/ccnx-pit-entry.h
@@ -189,11 +189,12 @@
*/
struct UpdateFibStatus
{
- UpdateFibStatus (Ptr<CcnxFace> face, CcnxFibFaceMetric::Status status);
+ UpdateFibStatus (Ptr<CcnxFace> face, CcnxFibFaceMetric::Status status, Ptr<CcnxFib> fib);
void operator() (CcnxPitEntry &entry);
private:
Ptr<CcnxFace> m_face;
CcnxFibFaceMetric::Status m_status;
+ Ptr<CcnxFib> m_fib;
};
/**