[ndnSIM] Getting the node's object

Mateus Sousa mateus.aluufc at gmail.com
Sat Jun 3 06:12:36 PDT 2017


Hi,

I'm stuck on the following problem:
I'm creating a new forwarding method and I need to get the node's object to
make some decisions. My method seems much like this
(multicast-strategy.cpp):

#include "multicast-strategy.hpp"
#include "algorithm.hpp"

namespace nfd {
namespace fw {

const Name
MulticastStrategy::STRATEGY_NAME("ndn:/localhost/nfd/strategy/multicast/%FD%01");
NFD_REGISTER_STRATEGY(MulticastStrategy);

MulticastStrategy::MulticastStrategy(Forwarder& forwarder, const Name& name)
  : Strategy(forwarder, name)
{
}

void
MulticastStrategy::afterReceiveInterest(const Face& inFace, const Interest&
interest,
                                        const shared_ptr<pit::Entry>&
pitEntry)
{
  const fib::Entry& fibEntry = this->lookupFib(*pitEntry);
  const fib::NextHopList& nexthops = fibEntry.getNextHops();

  for (fib::NextHopList::const_iterator it = nexthops.begin(); it !=
nexthops.end(); ++it) {
    Face& outFace = it->getFace();
    if (!wouldViolateScope(inFace, interest, outFace) &&
        canForwardToLegacy(*pitEntry, outFace)) {
      this->sendInterest(pitEntry, outFace, interest);
    }
  }

  if (!hasPendingOutRecords(*pitEntry)) {
    this->rejectPendingInterest(pitEntry);
  }
}

} // namespace fw
} // namespace nfd

I need a way to return the node's object or the node's ID.

Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20170603/e977573f/attachment.html>


More information about the ndnSIM mailing list