[ndnSIM] How to create new interest from existing one

Spyridon (Spyros) Mastorakis mastorakis at cs.ucla.edu
Thu Mar 29 09:17:44 PDT 2018


Hi,

use the Interest constructor that accepts a Block and pass the wire format of the existing Interest using the wireEncode method.

Then, use the setName method to set the name of the new Interest.

Thanks,

Spyridon (Spyros) Mastorakis
Personal Website: http://cs.ucla.edu/~mastorakis/ <http://cs.ucla.edu/~mastorakis/>
Internet Research Laboratory
Computer Science Department
UCLA

> On Mar 29, 2018, at 7:37 AM, Mudasir Qazi <mudasirqazi00 at gmail.com> wrote:
> 
> Hi, 
> 
> I'm trying to create new Interest packet from an existing one. The function will be passed existing Interest in parameter e.g.,
> 
> Interest& createTemporaryInterest(const Interest& interest){
>           shared_ptr<Interest> tempInterest = Interest(interest);
>           const Name& tempName = "...";
>           tempInterest->setName(tempName);
>           return tempInterest;
> }
> 
> Basically I need all properties of an Interest copied to another interest. Then I'll set custom name of newly created Interest. So, In short, the newly created Interest will have all properties of existing one but the name.
> 
> How can I achieve this? Please help.
> 
> -- 
> Regards,
> Mudasir Qazi
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20180329/7ebb6477/attachment.html>


More information about the ndnSIM mailing list