[ndnSIM] how to add private member variable in class Intererst
gc199211
gc199211 at mail.ustc.edu.cn
Mon Mar 27 19:25:42 PDT 2017
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20170328/96dab388/attachment-0001.html>
More information about the ndnSIM
mailing list