<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">dear every onei want to cache some specific content like as /prefix1 in a specific router not in all routers. but other routers cache evry other contents like as /prefix2,/prefix3,...so, how can i do it<div dir="ltr">for chalanging this issue, i refered to the forwarder.cpp  but my attemption, was faild, because of this bellow results</div><div><br></div><div>in my first attempt, i insert two methode one is node-list.h  and another one is simulator.h</div><div><br></div><div>i want to get the nodeid , in my topology. in version2.3 by using the below code i could found the nodeid but in the version of 2.7 i cand reach the nodeid by this class can anybody help me how can i fix it</div><div><br></div><div>in  version 2.3:</div><div><div>#include "/home/nik/ndnSIM2.7/ns-3/src/core/model/simulator.h"</div><div>#include "/home/nik/ndnSIM2.7/ns-3/src/network/model/node-list.h"</div></div><div>/////////////////////////////////////</div><div><div>ns3::Ptr<ns3::Node> thisNode = ns3::NodeList::GetNode(ns3::Simulator::GetContext());</div><div>std::cout << "Node ID := " << thisNode->GetId() << "\n";</div></div><div>/////////////////////////////////////////</div><div>in version 2.7</div><div>by compiling the program below result is shown<br></div><div><br></div><div><div>../src/ndnSIM/NFD/daemon/fw/forwarder.cpp: In member function ‘void nfd::Forwarder::onIncomingData(nfd::face::Face&, const ndn::Data&)’:</div><div>../src/ndnSIM/NFD/daemon/fw/forwarder.cpp:302:39: error: invalid use of incomplete type ‘class ns3::Node’</div><div> std::cout << "Node ID := " << thisNode->GetId() << "\n";</div><div>                                       ^~</div><div>In file included from ../src/ndnSIM/NFD/daemon/fw/forwarder.cpp:39:0:</div><div>/home/nik/ndnSIM2.7/ns-3/src/network/model/node-list.h:29:7: note: forward declaration of ‘class ns3::Node’</div><div> class Node;</div><div>       ^~~~</div><div>In file included from ./ns3/event-id.h:24:0,</div><div>                 from ./ns3/simulator.h:24,</div><div>                 from ns3/ndnSIM/ndn-cxx/util/scheduler.hpp:29,</div><div>                 from ns3/ndnSIM/NFD/core/scheduler.hpp:31,</div><div>                 from ../src/ndnSIM/NFD/daemon/fw/forwarder.hpp:30,</div><div>                 from ../src/ndnSIM/NFD/daemon/fw/forwarder.cpp:26:</div><div>./ns3/ptr.h: In instantiation of ‘ns3::Ptr<T>::~Ptr() [with T = ns3::Node]’:</div><div>../src/ndnSIM/NFD/daemon/fw/forwarder.cpp:299:83:   required from here</div><div>./ns3/ptr.h:758:14: error: invalid use of incomplete type ‘class ns3::Node’</div><div>       m_ptr->Unref ();</div><div>       ~~~~~~~^~~~~</div><div>In file included from ../src/ndnSIM/NFD/daemon/fw/forwarder.cpp:39:0:</div><div>/home/nik/ndnSIM2.7/ns-3/src/network/model/node-list.h:29:7: note: forward declaration of ‘class ns3::Node’</div><div> class Node;</div><div>       ^~~~</div><div>In file included from ./ns3/event-id.h:24:0,</div><div>                 from ./ns3/simulator.h:24,</div><div>                 from ns3/ndnSIM/ndn-cxx/util/scheduler.hpp:29,</div><div>                 from ns3/ndnSIM/NFD/core/scheduler.hpp:31,</div><div>                 from ../src/ndnSIM/NFD/daemon/fw/forwarder.hpp:30,</div><div>                 from ../src/ndnSIM/NFD/daemon/fw/forwarder.cpp:26:</div><div>./ns3/ptr.h: In instantiation of ‘void ns3::Ptr<T>::Acquire() const [with T = ns3::Node]’:</div><div>./ns3/ptr.h:743:11:   required from ‘ns3::Ptr<T>::Ptr(const ns3::Ptr<T>&) [with T = ns3::Node]’</div><div>../src/ndnSIM/NFD/daemon/fw/forwarder.cpp:299:83:   required from here</div><div>./ns3/ptr.h:712:14: error: invalid use of incomplete type ‘class ns3::Node’</div><div>       m_ptr->Ref ();</div><div>       ~~~~~~~^~~</div><div>In file included from ../src/ndnSIM/NFD/daemon/fw/forwarder.cpp:39:0:</div><div>/home/nik/ndnSIM2.7/ns-3/src/network/model/node-list.h:29:7: note: forward declaration of ‘class ns3::Node’</div><div> class Node;</div><div>       ^~~~</div><div><br></div><div>Waf: Leaving directory `/home/nik/ndnSIM2.7/ns-3/build'</div><div>Build failed</div><div> -> task in 'ns3-ndnSIM' failed with exit status 1 (run with -v to display more information)</div></div><div><br></div></div></div></div></div></div></div></div></div></div>