[ndnSIM] custom cache placment

babak nikmard babak.nikmard at gmail.com
Mon Jul 29 12:39:36 PDT 2019


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
for chalanging this issue, i refered to the forwarder.cpp  but my
attemption, was faild, because of this bellow results

in my first attempt, i insert two methode one is node-list.h  and another
one is simulator.h

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

in  version 2.3:
#include "/home/nik/ndnSIM2.7/ns-3/src/core/model/simulator.h"
#include "/home/nik/ndnSIM2.7/ns-3/src/network/model/node-list.h"
/////////////////////////////////////
ns3::Ptr<ns3::Node> thisNode =
ns3::NodeList::GetNode(ns3::Simulator::GetContext());
std::cout << "Node ID := " << thisNode->GetId() << "\n";
/////////////////////////////////////////
in version 2.7
by compiling the program below result is shown

../src/ndnSIM/NFD/daemon/fw/forwarder.cpp: In member function ‘void
nfd::Forwarder::onIncomingData(nfd::face::Face&, const ndn::Data&)’:
../src/ndnSIM/NFD/daemon/fw/forwarder.cpp:302:39: error: invalid use of
incomplete type ‘class ns3::Node’
 std::cout << "Node ID := " << thisNode->GetId() << "\n";
                                       ^~
In file included from ../src/ndnSIM/NFD/daemon/fw/forwarder.cpp:39:0:
/home/nik/ndnSIM2.7/ns-3/src/network/model/node-list.h:29:7: note: forward
declaration of ‘class ns3::Node’
 class Node;
       ^~~~
In file included from ./ns3/event-id.h:24:0,
                 from ./ns3/simulator.h:24,
                 from ns3/ndnSIM/ndn-cxx/util/scheduler.hpp:29,
                 from ns3/ndnSIM/NFD/core/scheduler.hpp:31,
                 from ../src/ndnSIM/NFD/daemon/fw/forwarder.hpp:30,
                 from ../src/ndnSIM/NFD/daemon/fw/forwarder.cpp:26:
./ns3/ptr.h: In instantiation of ‘ns3::Ptr<T>::~Ptr() [with T = ns3::Node]’:
../src/ndnSIM/NFD/daemon/fw/forwarder.cpp:299:83:   required from here
./ns3/ptr.h:758:14: error: invalid use of incomplete type ‘class ns3::Node’
       m_ptr->Unref ();
       ~~~~~~~^~~~~
In file included from ../src/ndnSIM/NFD/daemon/fw/forwarder.cpp:39:0:
/home/nik/ndnSIM2.7/ns-3/src/network/model/node-list.h:29:7: note: forward
declaration of ‘class ns3::Node’
 class Node;
       ^~~~
In file included from ./ns3/event-id.h:24:0,
                 from ./ns3/simulator.h:24,
                 from ns3/ndnSIM/ndn-cxx/util/scheduler.hpp:29,
                 from ns3/ndnSIM/NFD/core/scheduler.hpp:31,
                 from ../src/ndnSIM/NFD/daemon/fw/forwarder.hpp:30,
                 from ../src/ndnSIM/NFD/daemon/fw/forwarder.cpp:26:
./ns3/ptr.h: In instantiation of ‘void ns3::Ptr<T>::Acquire() const [with T
= ns3::Node]’:
./ns3/ptr.h:743:11:   required from ‘ns3::Ptr<T>::Ptr(const ns3::Ptr<T>&)
[with T = ns3::Node]’
../src/ndnSIM/NFD/daemon/fw/forwarder.cpp:299:83:   required from here
./ns3/ptr.h:712:14: error: invalid use of incomplete type ‘class ns3::Node’
       m_ptr->Ref ();
       ~~~~~~~^~~
In file included from ../src/ndnSIM/NFD/daemon/fw/forwarder.cpp:39:0:
/home/nik/ndnSIM2.7/ns-3/src/network/model/node-list.h:29:7: note: forward
declaration of ‘class ns3::Node’
 class Node;
       ^~~~

Waf: Leaving directory `/home/nik/ndnSIM2.7/ns-3/build'
Build failed
 -> task in 'ns3-ndnSIM' failed with exit status 1 (run with -v to display
more information)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20190730/76859c05/attachment.html>


More information about the ndnSIM mailing list