tag -> packet tag
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user