Finalizing PathWeight tracing
Now tracing is moved to CcnxConsumer
diff --git a/model/ccnx-local-face.cc b/model/ccnx-local-face.cc
index 404e38f..f3abba9 100644
--- a/model/ccnx-local-face.cc
+++ b/model/ccnx-local-face.cc
@@ -46,8 +46,6 @@
static TypeId tid = TypeId ("ns3::CcnxLocalFace")
.SetParent<CcnxFace> ()
.SetGroupName ("Ccnx")
- .AddTraceSource ("PathWeightsTrace", "PathWeightsTrace",
- MakeTraceSourceAccessor (&CcnxLocalFace::m_pathWeightsTrace))
;
return tid;
}
@@ -96,15 +94,6 @@
CcnxLocalFace::SendImpl (Ptr<Packet> p)
{
NS_LOG_FUNCTION (this << p);
- std::cout << Simulator::Now () << ", " << m_app->GetInstanceTypeId ().GetName () << "\n";
-
- // Notify trace about path weights vector (e.g., for path-stretch calculation)
- Ptr<const WeightsPathStretchTag> tag = p->RemovePacketTag<WeightsPathStretchTag> ();
- if (tag != 0)
- {
- m_pathWeightsTrace (tag->GetTotalWeight (), tag->GetSourceNode (), m_app->GetNode ());
- std::cout << boost::cref(*tag) << "\n";
- }
try
{
diff --git a/model/ccnx-local-face.h b/model/ccnx-local-face.h
index 507f8b1..327199d 100644
--- a/model/ccnx-local-face.h
+++ b/model/ccnx-local-face.h
@@ -76,8 +76,6 @@
private:
Ptr<CcnxApp> m_app;
-
- TracedCallback<uint32_t, Ptr<Node>, Ptr<Node> > m_pathWeightsTrace;
};
std::ostream& operator<< (std::ostream& os, const CcnxLocalFace &localFace);
diff --git a/model/ccnx-path-stretch-tag.cc b/model/ccnx-path-stretch-tag.cc
index b4b29e1..c8fc6dd 100644
--- a/model/ccnx-path-stretch-tag.cc
+++ b/model/ccnx-path-stretch-tag.cc
@@ -50,10 +50,10 @@
// return GetTypeId ();
// }
-uint32_t
+uint64_t
WeightsPathStretchTag::GetTotalWeight () const
{
- uint32_t total = 0;
+ uint64_t total = 0;
for (std::list<NodeWeightPair>::const_iterator info = m_infos.begin (); info != m_infos.end (); info++)
{
total += info->weight;
@@ -68,6 +68,13 @@
return m_infos.front ().node;
}
+Ptr<Node>
+WeightsPathStretchTag::GetDestinationNode () const
+{
+ NS_ASSERT (m_infos.size () > 0);
+ return m_infos.back ().node;
+}
+
uint32_t WeightsPathStretchTag::GetSerializedSize (void) const
{
return 0;
diff --git a/model/ccnx-path-stretch-tag.h b/model/ccnx-path-stretch-tag.h
index 71a4582..644871f 100644
--- a/model/ccnx-path-stretch-tag.h
+++ b/model/ccnx-path-stretch-tag.h
@@ -52,12 +52,15 @@
void
AddPathInfo (Ptr<Node> node, uint32_t weight);
- uint32_t
+ uint64_t
GetTotalWeight () const;
Ptr<Node>
GetSourceNode () const;
+ Ptr<Node>
+ GetDestinationNode () const;
+
const std::list<NodeWeightPair> &
GetInfos () const
{ return m_infos; }