tag -> packet tag

This commit is contained in:
Mathieu Lacage
2009-03-23 20:41:12 +01:00
parent 84c80b6e2e
commit efec0cd2d0
2 changed files with 7 additions and 7 deletions

View File

@@ -101,19 +101,19 @@ int main (int argc, char *argv[])
// store the tag in a packet.
Ptr<Packet> p = Create<Packet> (100);
p->AddTag (tag);
p->AddPacketTag (tag);
// create a copy of the packet
Ptr<Packet> aCopy = p->Copy ();
// read the tag from the packet copy
MyTag tagCopy;
p->FindFirstMatchingTag (tagCopy);
p->PeekPacketTag (tagCopy);
// the copy and the original are the same !
NS_ASSERT (tagCopy.GetSimpleValue () == tag.GetSimpleValue ());
aCopy->PrintTags (std::cout);
aCopy->PrintPacketTags (std::cout);
std::cout << std::endl;
return 0;

View File

@@ -168,14 +168,14 @@ benchD (uint32_t n)
for (uint32_t i = 0; i < n; i++) {
Ptr<Packet> p = Create<Packet> (2000);
p->AddTag (tag1);
p->AddPacketTag (tag1);
p->AddHeader (udp);
p->FindFirstMatchingTag (tag1);
p->AddTag (tag2);
p->RemovePacketTag (tag1);
p->AddPacketTag (tag2);
p->AddHeader (ipv4);
Ptr<Packet> o = p->Copy ();
o->RemoveHeader (ipv4);
p->FindFirstMatchingTag (tag2);
p->RemovePacketTag (tag2);
o->RemoveHeader (udp);
}
}