<div dir="ltr"><div>Hi Alex,<br><br>That was the problem. Thanks a lot. I really appreciate your help.<br><br>Best Regards<br></div>Aadil<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Feb 15, 2014 at 4:08 AM, Alex Afanasyev <span dir="ltr"><<a href="mailto:alexander.afanasyev@ucla.edu" target="_blank">alexander.afanasyev@ucla.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Aadil,<br>
<br>
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.<br>

<br>
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:<br>
<br>
FwCBTag cbtag;<br>
Ptr<Packet> payload = ConstCast<Packet>(interest->GetPayload());<br>
payload->RemovePacketTag(cbtag);<br>
cbtag.Set(inFace->m_fs);<br>
payload->AddPacketTag(cbtag);<br>
<br>
---<br>
Alex<br>
<div class="HOEnZb"><div class="h5"><br>
On Feb 13, 2014, at 5:45 AM, Aadil Zia Khan <<a href="mailto:aadilziakhan@gmail.com">aadilziakhan@gmail.com</a>> wrote:<br>
<br>
> Hi,<br>
><br>
> Could you please guide me as to how I can modify an Interest packet's tag.<br>
><br>
> 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.<br>

><br>
> RemovePacketTag works on Ptr<Packet> type, however if I do something like the following:<br>
><br>
> interest->GetPayload ()->RemovePacketTag (cbtag);<br>
><br>
> It gives an error.<br>
><br>
> How can I get around this. Your help would be really appreciated. Thanks.<br>
><br>
> Best Regards<br>
> Aadil<br>
><br>
> My Code:<br>
><br>
>   FwCBTag cbtag;<br>
>   interest->GetPayload ()->RemovePacketTag (cbtag);<br>
>   cbtag.Set(inFace->m_fs);<br>
>   interest->GetPayload ()->AddPacketTag (cbtag);<br>
<br>
</div></div></blockquote></div><br></div>