|
NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
|
API Documentation
|
Go to the documentation of this file.
43 NDN_THROW(std::invalid_argument(
"RandomStrategy does not accept parameters"));
55 static Name strategyName(
"/localhost/nfd/strategy/random/%FD%01");
61 const shared_ptr<pit::Entry>& pitEntry)
68 [&] (
const auto& nh) { return isNextHopEligible(inFace, interest, nh, pitEntry); });
71 NFD_LOG_DEBUG(interest <<
" from=" << ingress <<
" no nexthop");
74 nackHeader.
setReason(lp::NackReason::NO_ROUTE);
75 this->
sendNack(pitEntry, ingress, nackHeader);
86 const shared_ptr<pit::Entry>& pitEntry)
void sendInterest(const shared_ptr< pit::Entry > &pitEntry, const FaceEndpoint &egress, const Interest &interest)
send Interest to egress
Randomly chooses a nexthop.
void afterReceiveNack(const FaceEndpoint &ingress, const lp::Nack &nack, const shared_ptr< pit::Entry > &pitEntry) override
trigger after Nack is received
NFD_REGISTER_STRATEGY(AccessStrategy)
Represents an absolute name.
Copyright (c) 2011-2015 Regents of the University of California.
RandomNumberEngine & getRandomNumberEngine()
Returns a reference to a thread-local instance of a properly seeded PRNG.
generalization of a network interface
void setInstanceName(const Name &name)
set strategy instance name
RandomStrategy(Forwarder &forwarder, const Name &name=getStrategyName())
void sendNack(const shared_ptr< pit::Entry > &pitEntry, const FaceEndpoint &egress, const lp::NackHeader &header)
send Nack to egress
const NextHopList & getNextHops() const
static const Name & getStrategyName()
Represents a face-endpoint pair in the forwarder.
const fib::Entry & lookupFib(const pit::Entry &pitEntry) const
performs a FIB lookup, considering Link object if present
Represents an Interest packet.
static ParsedInstanceName parseInstanceName(const Name &input)
parse a strategy instance name
void rejectPendingInterest(const shared_ptr< pit::Entry > &pitEntry)
schedule the PIT entry for immediate deletion
std::vector< NextHop > NextHopList
void afterReceiveInterest(const FaceEndpoint &ingress, const Interest &interest, const shared_ptr< pit::Entry > &pitEntry) override
trigger after Interest is received
represents a forwarding strategy
Main class of NFD's forwarding engine.
void processNack(const Face &inFace, const lp::Nack &nack, const shared_ptr< pit::Entry > &pitEntry)
represents a Network Nack
std::string to_string(const T &val)
static Name makeInstanceName(const Name &input, const Name &strategyName)
construct a strategy instance name
optional< uint64_t > version
whether strategyName contains a version component
PartialName parameters
parameter components
#define NFD_LOG_INIT(name)