NetAnim: Handle special case for Wimax forwarding
authorJohn Abraham <john.abraham@gatech.edu>
Sun, 01 Apr 2012 06:59:13 -0700
changeset 7808 993f0f62fae0
parent 7806 4c63c0278258
child 7809 4221da021797
NetAnim: Handle special case for Wimax forwarding
src/netanim/model/animation-interface.cc
--- a/src/netanim/model/animation-interface.cc	Sat Mar 31 22:54:27 2012 -0700
+++ b/src/netanim/model/animation-interface.cc	Sun Apr 01 06:59:13 2012 -0700
@@ -748,7 +748,19 @@
 uint64_t AnimationInterface::GetAnimUidFromPacket (Ptr <const Packet> p)
 {
   AnimByteTag tag;
-  if (p->FindFirstMatchingByteTag (tag))
+  TypeId tid = tag.GetInstanceTypeId ();
+  ByteTagIterator i = p->GetByteTagIterator ();
+  bool found = false;
+  while (i.HasNext ())
+    {
+      ByteTagIterator::Item item = i.Next ();
+      if (tid == item.GetTypeId ())
+        {
+          item.GetTag (tag);
+          found = true;
+        }
+    }
+  if (found)
     {
       return tag.Get ();
     }
@@ -927,7 +939,7 @@
   Ptr <Node> n = ndev->GetNode ();
   NS_ASSERT (n);
   uint64_t AnimUid = GetAnimUidFromPacket (p);
-  NS_LOG_INFO ("WimaxRxTrace for packet:" << gAnimUid);
+  NS_LOG_INFO ("WimaxRxTrace for packet:" << AnimUid);
   NS_ASSERT (WimaxPacketIsPending (AnimUid) == true);
   AnimPacketInfo& pktInfo = pendingWimaxPackets[AnimUid];
   pktInfo.ProcessRxBegin (ndev, Simulator::Now ());