[ndnSIM] how to add private member variable in class Intererst

lahmer ilyas ilyaslahmer93 at gmail.com
Tue Mar 28 02:19:27 PDT 2017


Hi, I had the same problem, but I added a string rather than int in the interest. My solution was to recreate the interest at each hop with the new string value. I don't know why but this fixed the problem.

⁣

Sent from BlueMail

​

On Mar 28, 2017, 3:26 AM, at 3:26 AM, gc199211 <gc199211 at mail.ustc.edu.cn> wrote:
>
>Hi sir :
>I find  out that my last email is incomplete in maillist, so I  finish
>it  and send again.  
>I am  trying to add  hop information in Interest recently on ndnSIM
>2.2. Here is my code.
>1). I add a private member variable  which is named hop in
>ndnSIM/ndn-cxx/src/interest.h 
>            private:
>                          Name m_name;
>                                      ......
>                         mutable Block m_wire;
>int hop;           // a new private member variable                    
>  
>                   
>2). I increace the value of hop in the
>nfd::Forwarder::onOutgoingInterest(shared_ptr<pit::Entry> pitEntry,
>Face& outFace,bool  wantNewNonce),so as to caculate the hop .
>  
>               int tmpHop=interest->getHop();
>               tmpHop++;
>               interest->setHop(tmpHop);                 
>
>Here is my problem,It seems that the hop value is always 0 no matter
>how many nodes it is forwarded.How to solve the problem? I know there
>is a ns3::ndn::FwHopCountTag a to caculate the hop in
>ns3::ndn::NetDeviceLinkService ,But I want to caculate the hop value
>directly in Interest. If it works ,I can add other member variable in
>Interest  which is quite important for my research.Thank you very much
>.
>                                                                       
>2016-12-20
>
>
>gc199211 
>
>------------------------------------------------------------------------
>
>_______________________________________________
>ndnSIM mailing list
>ndnSIM at lists.cs.ucla.edu
>http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20170328/aefa4b2d/attachment.html>


More information about the ndnSIM mailing list