<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Alice,<div><br></div><div>I made a typo </div><div>...</div><div>       newheader->SetName ("/bbbb");<br>...</div><div><br></div><div>---</div><div>Alex</div><div><br><div><div>On May 21, 2013, at 4:10 AM, 1116 lypp <<a href="mailto:lypp1116@gmail.com">lypp1116@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div>Hi Alex,</div><div> </div><div>I re-configured the code according to your advice, however, there is an error as following:</div><div> </div><div>../src/ndnSIM/model/fw/ndn-forwarding-strategy.cc:231:29: error: passing ‘const ns3::ndn::ContentObject’ as ‘this’ argument of ‘void ns3::ndn::ContentObject::SetName(const ns3::ndn::Name&)’ discards qualifiers [-fpermissive]<br>
</div><div>I try to modify but it doesn't work.</div><div>How can I solve this problem?</div><div> </div><div>Thanks,</div><div>My Regards,</div><div>Alice</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
2013/5/21 Alex Afanasyev <span dir="ltr"><<a href="mailto:alexander.afanasyev@ucla.edu" target="_blank">alexander.afanasyev@ucla.edu</a>></span><br><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto; ">
<div style="word-wrap:break-word"><div>Hi Alice,</div><div><br></div><div>I'm not sure what is the behavior you're trying to achieve.  Even if a node replaces content name (which is OK for the simulator, but would violate data packet signature in a real systems), the node to which you going to forward this packet would simply drop it, since there will be no corresponding PIT entry.</div>
<div><br></div><div>If you really want to do replacement, you can try to create a custom forwarding strategy (here is an example <a href="http://ndnsim.net/fw.html#example-of-using-custom-strategy" target="_blank">http://ndnsim.net/fw.html#example-of-using-custom-strategy</a>), overriding OnData method something like this:</div>
<div><br></div><div>void</div><div>YourStrategy::OnData (Ptr<Face> inFace,</div>                      Ptr<const ContentObject> header,<br>                      Ptr<Packet> payload,<br>                      Ptr<const Packet> origPacket)<div>
{</div><div>   if (header->GetName () == Name ("/aaaa"))</div><div>   {</div><div>       Ptr<ContentObject> newheader = Create<ContentObject> (*header);</div><div>       header->SetName ("/bbbb");</div>
<div>       Ptr<Packet> newPacket = Create<Packet> (*payload);</div><div>       newPacket->AddHeader (*newheader);</div><div><br></div><div>       return your_base_strategy::OnData (inFace, header, payload, newPacket);</div>
<div>   }</div><div>}</div><div><br></div><div>---</div><div>Alex</div><div><div class="h5"><br><div><div>On May 20, 2013, at 8:22 PM, 1116 lypp <<a href="mailto:lypp1116@gmail.com" target="_blank">lypp1116@gmail.com</a>> wrote:</div>
<br><blockquote type="cite"><div dir="ltr"><div>Hi Alex,</div><div> </div><div>There is a topology running in my ndnsim, I want to replace the content name when the node received the data packet.</div><div> </div><div>For example, when the node received the data with the prefix "/aaaaa", I want to replace the name with "/bbbbb".</div>

<div> </div><div>Could you tell me how to do this?</div><div> </div><div>Thanks</div><div> </div><div>Best regards,</div><div>Alice</div></div>
</blockquote></div><br></div></div></div></blockquote></div><br></div>
</blockquote></div><br></div></body></html>