[ndnSIM] ndnSIM Help modifying an Interest packet's tag

Aadil Zia Khan aadilziakhan at gmail.com
Sat Feb 15 10:07:24 PST 2014


Hi Alex,

That was the problem. Thanks a lot. I really appreciate your help.

Best Regards
Aadil


On Sat, Feb 15, 2014 at 4:08 AM, Alex Afanasyev <
alexander.afanasyev at ucla.edu> wrote:

> Hi Aadil,
>
> It would be easier to figure out the problem, if you had included the
> actual error.  From what I can guess, you're getting compilation error,
> complaining that cannot call RemovePacketTag because it is not marked const.
>
> Basically, you're trying to remove tag from the const packet.  Since
> you're not doing anything wrong here, you can trick the compiler in the
> following way:
>
> FwCBTag cbtag;
> Ptr<Packet> payload = ConstCast<Packet>(interest->GetPayload());
> payload->RemovePacketTag(cbtag);
> cbtag.Set(inFace->m_fs);
> payload->AddPacketTag(cbtag);
>
> ---
> Alex
>
> On Feb 13, 2014, at 5:45 AM, Aadil Zia Khan <aadilziakhan at gmail.com>
> wrote:
>
> > Hi,
> >
> > Could you please guide me as to how I can modify an Interest packet's
> tag.
> >
> > I am trying to modify the OnInterest function of
> ndn-forwarding-strategy.cc. I want to read the interest packet's tag and
> modify it. I checked the mailing list and found out that I need to call the
> RemovePacketTag function first.
> >
> > RemovePacketTag works on Ptr<Packet> type, however if I do something
> like the following:
> >
> > interest->GetPayload ()->RemovePacketTag (cbtag);
> >
> > It gives an error.
> >
> > How can I get around this. Your help would be really appreciated. Thanks.
> >
> > Best Regards
> > Aadil
> >
> > My Code:
> >
> >   FwCBTag cbtag;
> >   interest->GetPayload ()->RemovePacketTag (cbtag);
> >   cbtag.Set(inFace->m_fs);
> >   interest->GetPayload ()->AddPacketTag (cbtag);
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20140215/c9f65099/attachment.html>


More information about the ndnSIM mailing list