39 const shared_ptr<pit::Entry>& pitEntry)
47 for (
const auto& nexthop : fibEntry.
getNextHops()) {
48 Face& outFace = nexthop.getFace();
66 BOOST_THROW_EXCEPTION(std::invalid_argument(
"BestRouteStrategy does not accept parameters"));
69 BOOST_THROW_EXCEPTION(std::invalid_argument(
70 "BestRouteStrategy does not support version " +
to_string(*parsed.
version)));
78 static Name strategyName(
"/localhost/nfd/strategy/best-route/%FD%01");
bool canForwardToLegacy(const pit::Entry &pitEntry, const Face &face)
decide whether Interest can be forwarded to face
static ParsedInstanceName parseInstanceName(const Name &input)
parse a strategy instance name
generalization of a network interface
PartialName parameters
parameter components
void setInstanceName(const Name &name)
set strategy instance name
Represents an Interest packet.
BestRouteStrategy(Forwarder &forwarder, const Name &name=getStrategyName())
static const Name & getStrategyName()
Copyright (c) 2011-2015 Regents of the University of California.
Best Route strategy version 1.
NFD_REGISTER_STRATEGY(AccessStrategy)
void rejectPendingInterest(const shared_ptr< pit::Entry > &pitEntry)
schedule the PIT entry for immediate deletion
Represents an absolute name.
bool hasPendingOutRecords(const pit::Entry &pitEntry)
determine whether pitEntry has any pending out-records
represents a forwarding strategy
optional< uint64_t > version
whether strategyName contains a version component
This file contains common algorithms used by forwarding strategies.
const fib::Entry & lookupFib(const pit::Entry &pitEntry) const
performs a FIB lookup, considering Link object if present
BestRouteStrategyBase(Forwarder &forwarder)
static Name makeInstanceName(const Name &input, const Name &strategyName)
construct a strategy instance name
std::string to_string(const V &v)
const NextHopList & getNextHops() const
void sendInterest(const shared_ptr< pit::Entry > &pitEntry, Face &outFace, const Interest &interest)
send Interest to outFace
bool wouldViolateScope(const Face &inFace, const Interest &interest, const Face &outFace)
determine whether forwarding the Interest in pitEntry to outFace would violate scope
void afterReceiveInterest(const Face &inFace, const Interest &interest, const shared_ptr< pit::Entry > &pitEntry) override
trigger after Interest is received