Adding PIT printout capability
diff --git a/model/ccnx-pit-entry.cc b/model/ccnx-pit-entry.cc
index 0cc6509..80135fd 100644
--- a/model/ccnx-pit-entry.cc
+++ b/model/ccnx-pit-entry.cc
@@ -144,4 +144,35 @@
m_maxRetxCount++;
}
+std::ostream& operator<< (std::ostream& os, const CcnxPitEntry &entry)
+{
+ os << "Prefix: " << *entry.m_prefix << "\n";
+ os << "In: ";
+ bool first = true;
+ BOOST_FOREACH (const CcnxPitEntryIncomingFace &face, entry.m_incoming)
+ {
+ if (!first)
+ os << ",";
+ else
+ first = false;
+
+ os << *face.m_face;
+ }
+
+ os << "\nOut: ";
+ first = true;
+ BOOST_FOREACH (const CcnxPitEntryOutgoingFace &face, entry.m_outgoing)
+ {
+ if (!first)
+ os << ",";
+ else
+ first = false;
+
+ os << *face.m_face;
+ }
+
+ return os;
+}
+
+
}
diff --git a/model/ccnx-pit-entry.h b/model/ccnx-pit-entry.h
index 12ffa91..de58470 100644
--- a/model/ccnx-pit-entry.h
+++ b/model/ccnx-pit-entry.h
@@ -257,6 +257,8 @@
uint32_t m_maxRetxCount; ///< @brief Maximum allowed number of retransmissions via outgoing faces
};
+std::ostream& operator<< (std::ostream& os, const CcnxPitEntry &entry);
+
} // namespace ns3
#endif // _CCNX_PIT_ENTRY_H_
diff --git a/model/ccnx-pit.cc b/model/ccnx-pit.cc
index ca2c3f3..c3c9fd2 100644
--- a/model/ccnx-pit.cc
+++ b/model/ccnx-pit.cc
@@ -196,4 +196,14 @@
return make_tuple (cref(*entry), isNew, isDuplicate);
}
+std::ostream& operator<< (std::ostream& os, const CcnxPit &pit)
+{
+ BOOST_FOREACH (const CcnxPitEntry &entry, pit)
+ {
+ os << entry;
+ }
+
+ return os;
+}
+
} // namespace ns3
diff --git a/model/ccnx-pit.h b/model/ccnx-pit.h
index 565026a..84cd0d5 100644
--- a/model/ccnx-pit.h
+++ b/model/ccnx-pit.h
@@ -184,23 +184,12 @@
Time m_PitEntryDefaultLifetime;
Ptr<CcnxFib> m_fib; ///< \brief Link to FIB table
- // PitBucket m_bucketsPerFace; ///< \brief pending interface counter per face
-
- // /**
- // * \brief maximum number of buckets. Automatically computed based on link capacity
- // * averaging over 1 second (bandwidth * 1second)
- // */
- // PitBucket maxBucketsPerFace;
-
- // PitBucket leakSize; ///< size of a periodic bucket leak
};
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
-std::ostream& operator<< (std::ostream& os, const CcnxPit &fib);
-std::ostream& operator<< (std::ostream& os, const CcnxPitEntry &entry);
-// std::ostream& operator<< (std::ostream& os, const CcnxFibFaceMetric &metric);
+std::ostream& operator<< (std::ostream& os, const CcnxPit &pit);
class CcnxPitEntryNotFound {};