Change in CcnxApp API.  Now callbacks also contain pointer of original
packet (useful to get packet tags, if they exist)

Reflecting changes in PackegTag API

Rescanning bindings

More work on packet-path-weight tracers
diff --git a/model/ccnx-forwarding-strategy.cc b/model/ccnx-forwarding-strategy.cc
index 1253571..45e0fd7 100644
--- a/model/ccnx-forwarding-strategy.cc
+++ b/model/ccnx-forwarding-strategy.cc
@@ -22,14 +22,17 @@
 #include "ns3/assert.h"
 
 #include "ccnx-forwarding-strategy.h"
+#include "ns3/ptr.h"
 #include "ns3/log.h"
 #include "ns3/simulator.h"
 #include "ns3/double.h"
+#include "ns3/boolean.h"
 
 #include "ccnx-pit.h"
 #include "ccnx-pit-entry.h"
 
 #include "ccnx-interest-header.h"
+#include "ccnx-path-stretch-tag.h"
 
 #include <boost/ref.hpp>
 #include <boost/foreach.hpp>
@@ -51,6 +54,11 @@
     .SetGroupName ("Ccnx")
     .SetParent<Object> ()
 
+    .AddAttribute ("MetricTagging", "Enable metric tagging (path-stretch calculation)",
+                   BooleanValue (false),
+                   MakeBooleanAccessor (&CcnxForwardingStrategy::m_enableMetricTagging),
+                   MakeBooleanChecker ())
+
     .AddTraceSource ("OutInterests", "Interests that were transmitted",
                     MakeTraceSourceAccessor (&CcnxForwardingStrategy::m_transmittedInterestsTrace))
 
@@ -59,6 +67,7 @@
 }
 
 CcnxForwardingStrategy::CcnxForwardingStrategy ()
+  : m_enableMetricTagging (false)
 {
 }
 
@@ -109,31 +118,43 @@
         }
 
       m_pit->modify (m_pit->iterator_to (pitEntry),
-                     ll::bind(&CcnxPitEntry::AddOutgoing, ll::_1, metricFace.m_face));
+                     ll::bind (&CcnxPitEntry::AddOutgoing, ll::_1, metricFace.m_face));
 
-      //update path stretch
-      WeightsPathStretchTag pathStretch;
-      //packet->PeekPacketTag(pathStretch);
-      
-      pathStretch.AddNewHop(metricFace.m_routingCost);
-      packet->AddPacketTag(pathStretch);
+      Ptr<Packet> packetToSend = packet->Copy ();
+      TagPacket (packetToSend, metricFace);
 
       //transmission
-      metricFace.m_face->Send (packet->Copy ());
+      metricFace.m_face->Send (packetToSend);
       m_transmittedInterestsTrace (header, metricFace.m_face);
       
       propagatedCount++;
       break; // propagate only one interest
     }
 
-  // if (Simulator::GetContext ()==1)
-  //   {
-  //     if (propagatedCount > 0)
-  //       NS_LOG_DEBUG ("Propagate via a green face");
-  //     else 
-  //       NS_LOG_DEBUG ("Can't :(");
-  //   }
   return propagatedCount > 0;
 }
 
+void
+CcnxForwardingStrategy::TagPacket (Ptr<Packet> packet, const CcnxFibFaceMetric &metricFace)
+{
+  // if (m_enableMetricTagging)
+    {
+      // update path information
+
+      Ptr<const WeightsPathStretchTag> origTag = packet->RemovePacketTag<WeightsPathStretchTag> ();
+      Ptr<WeightsPathStretchTag> tag;
+      if (origTag == 0)
+        {
+          tag = CreateObject<WeightsPathStretchTag> (); // create a new tag
+        }
+      else
+        {
+          tag = CreateObject<WeightsPathStretchTag> (*origTag); // will update existing tag
+        }
+
+      tag->AddPathInfo (metricFace.m_face->GetNode (), metricFace.m_routingCost);
+      packet->AddPacketTag (tag);
+    }
+}
+
 } //namespace ns3