[ndnSIM] Add a tag to packet

Fatemeh Goudarzi fatemeh.university at gmail.com
Tue Dec 27 11:15:07 PST 2016


Hi,

I want to access the packet in the cache policy (for example
random-policy.hpp ) for adding  a tag to it. I create a new tag to record
node-Id and If the node cache the content, it will add this tag to the
content packet. In the *insert()* method, I have the following code: "Ptr<const
Packet> pkt = item->payload()->GetPacket ();" to access packet and
then "pkt->AddPacketTag
(tag_id); " but I get this error:
*error: ‘class
ns3::ndn::cs::EntryImpl<ns3::ndn::cs::ContentStoreImpl<ns3::ndn::ndnSIM::rand2_policy_traits>
>’ has no member named ‘GetPacket’*

I also try the following code:

auto data = item->payload()->GetData(); auto dataTag = data-> getTag
<ns3::ndn::Ns3PacketTag> (); bool hasTag =
dataTag->getPacket()->PeekPacketTag(tag);

and also get this error:

* error: expected primary-expression before ‘>’ token         auto dataTag
= data-> getTag <ns3::ndn::Ns3PacketTag> ();*

could you give me some hint?

Regards,

Fatemeh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20161227/e80b0068/attachment-0001.html>


More information about the ndnSIM mailing list