Main class of NFD's forwarding engine. More...
#include <forwarder.hpp>
Public Attributes | |
signal::Signal< Forwarder, pit::Entry, Face, Data > | beforeSatisfyInterest |
trigger before PIT entry is satisfied More... | |
signal::Signal< Forwarder, pit::Entry > | beforeExpirePendingInterest |
trigger before PIT entry expires More... | |
signal::Signal< Forwarder, Interest, Data > | afterCsHit |
Signals when the incoming interest pipeline gets a hit from the content store. More... | |
signal::Signal< Forwarder, Interest > | afterCsMiss |
Signals when the incoming interest pipeline gets a miss from the content store. More... | |
NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE | __pad0__: NFD_VIRTUAL_WITH_TESTS void onIncomingInterest(const Interest& interest |
NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE const FaceEndpoint & | ingress |
Friends | |
class | fw::Strategy |
Main class of NFD's forwarding engine.
The Forwarder class owns all tables and implements the forwarding pipelines.
Definition at line 53 of file forwarder.hpp.
|
explicit |
Definition at line 53 of file forwarder.cpp.
References nfd::FaceTable::addReserved(), nfd::FaceTable::afterAdd, nfd::fib::Fib::afterNewNextHop, nfd::fw::Strategy::afterReceiveLoopedInterest(), nfd::FaceTable::beforeRemove, nfd::cleanupOnFaceRemoval(), nfd::fw::DUPLICATE_NONCE_IN_SAME, nfd::fw::DUPLICATE_NONCE_NONE, Face, nfd::FaceEndpoint::face, ndn::nfd::FACE_SCOPE_NON_LOCAL, nfd::face::FACEID_CONTENT_STORE, nfd::cs::Cs::find(), nfd::fw::findDuplicateNonce(), nfd::strategy_choice::StrategyChoice::findEffectiveStrategy(), nfd::getDefaultStrategyName(), ndn::Interest::getForwardingHint(), ndn::Interest::getHopLimit(), ndn::Interest::getName(), ndn::Interest::getNonce(), nfd::DeadNonceList::has(), ingress, nfd::pit::Pit::insert(), nfd::NetworkRegionTable::isInProducerRegion(), ndn::Name::isPrefixOf(), ndn::nfd::LINK_TYPE_POINT_TO_POINT, nfd::scope_prefix::LOCALHOST, NFD_LOG_DEBUG, nfd::ForwarderCounters::nInInterests, onContentStoreHit(), onContentStoreMiss(), onDroppedInterest(), onIncomingData(), onIncomingNack(), onInterestLoop(), onNewNextHop(), nfd::strategy_choice::StrategyChoice::setDefaultStrategy(), ndn::TagHost::setTag(), and ~Forwarder().
|
default |
Referenced by Forwarder().
|
inline |
Definition at line 63 of file forwarder.hpp.
Referenced by nfd::ForwarderStatusManager::ForwarderStatusManager().
|
inline |
Definition at line 69 of file forwarder.hpp.
|
inline |
Definition at line 75 of file forwarder.hpp.
References nonstd::optional_lite::std11::move().
Referenced by nfd::TablesConfigSection::ensureConfigured().
|
inline |
Definition at line 82 of file forwarder.hpp.
Referenced by nfd::ForwarderStatusManager::ForwarderStatusManager(), and onNewNextHop().
|
inline |
Definition at line 88 of file forwarder.hpp.
Referenced by nfd::ForwarderStatusManager::ForwarderStatusManager(), and nfd::fw::Strategy::lookupFib().
|
inline |
Definition at line 94 of file forwarder.hpp.
Referenced by nfd::ForwarderStatusManager::ForwarderStatusManager().
|
inline |
Definition at line 100 of file forwarder.hpp.
Referenced by nfd::TablesConfigSection::ensureConfigured(), and nfd::ForwarderStatusManager::ForwarderStatusManager().
|
inline |
Definition at line 106 of file forwarder.hpp.
Referenced by nfd::ForwarderStatusManager::ForwarderStatusManager().
|
inline |
Definition at line 112 of file forwarder.hpp.
Referenced by nfd::TablesConfigSection::ensureConfigured().
|
inline |
Definition at line 118 of file forwarder.hpp.
|
inline |
Definition at line 124 of file forwarder.hpp.
References nfd::general::setConfigFile().
Referenced by nfd::TablesConfigSection::ensureConfigured(), and nfd::fw::Strategy::lookupFib().
void nfd::Forwarder::setConfigFile | ( | ConfigFile & | configFile | ) |
register handler for forwarder section of NFD configuration file
Definition at line 621 of file forwarder.cpp.
References nfd::ConfigFile::addSectionHandler(), nfd::CFG_FORWARDER, and NDN_THROW.
void nfd::Forwarder::onInterestLoop | ( | const Interest & | interest, |
const FaceEndpoint & | ingress | ||
) |
Interest loop pipeline.
Definition at line 171 of file forwarder.cpp.
References nfd::FaceEndpoint::face, ndn::Interest::getName(), ndn::nfd::LINK_TYPE_POINT_TO_POINT, and NFD_LOG_DEBUG.
Referenced by Forwarder().
void nfd::Forwarder::onContentStoreMiss | ( | const Interest & | interest, |
const FaceEndpoint & | ingress, | ||
const shared_ptr< pit::Entry > & | pitEntry | ||
) |
Content Store miss pipeline.
Definition at line 191 of file forwarder.cpp.
References afterCsMiss, nfd::fw::Strategy::afterReceiveInterest(), Face, nfd::FaceEndpoint::face, nfd::strategy_choice::StrategyChoice::findEffectiveStrategy(), nfd::FaceTable::get(), ndn::Interest::getHopLimit(), ndn::Interest::getName(), ndn::TagHost::getTag(), nfd::ForwarderCounters::nCsMisses, NFD_LOG_DEBUG, ndn::time::steady_clock::now(), and onOutgoingInterest().
Referenced by Forwarder().
void nfd::Forwarder::onContentStoreHit | ( | const Interest & | interest, |
const FaceEndpoint & | ingress, | ||
const shared_ptr< pit::Entry > & | pitEntry, | ||
const Data & | data | ||
) |
Content Store hit pipeline.
Definition at line 235 of file forwarder.cpp.
References nfd::fw::Strategy::afterContentStoreHit(), afterCsHit, beforeSatisfyInterest, nfd::fw::Strategy::beforeSatisfyInterest(), nfd::face::FACEID_CONTENT_STORE, nfd::strategy_choice::StrategyChoice::findEffectiveStrategy(), ndn::Data::getFreshnessPeriod(), ndn::Interest::getName(), ndn::TagHost::getTag(), nfd::ForwarderCounters::nCsHits, NFD_LOG_DEBUG, and ndn::TagHost::setTag().
Referenced by Forwarder().
pit::OutRecord * nfd::Forwarder::onOutgoingInterest | ( | const Interest & | interest, |
Face & | egress, | ||
const shared_ptr< pit::Entry > & | pitEntry | ||
) |
outgoing Interest pipeline
Definition at line 260 of file forwarder.cpp.
References ndn::nfd::FACE_SCOPE_NON_LOCAL, ndn::Interest::getHopLimit(), NFD_LOG_DEBUG, and nfd::ForwarderCounters::nOutInterests.
Referenced by onContentStoreMiss(), and nfd::fw::Strategy::sendInterest().
void nfd::Forwarder::onInterestFinalize | ( | const shared_ptr< pit::Entry > & | pitEntry | ) |
Interest finalize pipeline.
Definition at line 284 of file forwarder.cpp.
References beforeExpirePendingInterest, nfd::pit::Pit::erase(), NFD_LOG_DEBUG, nfd::ForwarderCounters::nSatisfiedInterests, and nfd::ForwarderCounters::nUnsatisfiedInterests.
Referenced by onNewNextHop().
void nfd::Forwarder::onIncomingData | ( | const Data & | data, |
const FaceEndpoint & | ingress | ||
) |
incoming Data pipeline
data | the incoming Data, must be well-formed and created with make_shared |
ingress | face on which data was received and endpoint of the sender |
Definition at line 310 of file forwarder.cpp.
References beforeSatisfyInterest, nfd::FaceEndpoint::endpoint, nfd::FaceEndpoint::face, ndn::nfd::FACE_SCOPE_NON_LOCAL, nfd::pit::Pit::findAllDataMatches(), nfd::strategy_choice::StrategyChoice::findEffectiveStrategy(), ndn::Data::getFreshnessPeriod(), ndn::Data::getName(), nfd::cs::Cs::insert(), ndn::Name::isPrefixOf(), ndn::nfd::LINK_TYPE_AD_HOC, nfd::scope_prefix::LOCALHOST, NFD_LOG_DEBUG, nfd::ForwarderCounters::nInData, onDataUnsolicited(), onOutgoingData(), nfd::fw::Strategy::satisfyInterest(), and ndn::TagHost::setTag().
Referenced by Forwarder().
void nfd::Forwarder::onDataUnsolicited | ( | const Data & | data, |
const FaceEndpoint & | ingress | ||
) |
Data unsolicited pipeline.
Definition at line 404 of file forwarder.cpp.
References nfd::fw::CACHE, nfd::FaceEndpoint::face, ndn::Data::getName(), nfd::cs::Cs::insert(), NFD_LOG_DEBUG, and nfd::ForwarderCounters::nUnsolicitedData.
Referenced by onIncomingData().
outgoing Data pipeline
Definition at line 419 of file forwarder.cpp.
References ndn::nfd::FACE_SCOPE_NON_LOCAL, ndn::Data::getName(), nfd::face::INVALID_FACEID, ndn::Name::isPrefixOf(), nfd::scope_prefix::LOCALHOST, NFD_LOG_DEBUG, NFD_LOG_WARN, and nfd::ForwarderCounters::nOutData.
Referenced by onIncomingData(), and nfd::fw::Strategy::sendData().
void nfd::Forwarder::onIncomingNack | ( | const lp::Nack & | nack, |
const FaceEndpoint & | ingress | ||
) |
incoming Nack pipeline
nack | the incoming Nack, must be well-formed |
ingress | face on which nack is received and endpoint of the sender |
Definition at line 447 of file forwarder.cpp.
References nfd::fw::Strategy::afterReceiveNack(), nfd::FaceEndpoint::face, nfd::pit::Pit::find(), nfd::strategy_choice::StrategyChoice::findEffectiveStrategy(), ndn::lp::Nack::getInterest(), ndn::Interest::getName(), ndn::Interest::getNonce(), ndn::lp::Nack::getReason(), nfd::fw::hasPendingOutRecords(), ndn::nfd::LINK_TYPE_POINT_TO_POINT, NFD_LOG_DEBUG, nfd::ForwarderCounters::nInNacks, and ndn::TagHost::setTag().
Referenced by Forwarder().
bool nfd::Forwarder::onOutgoingNack | ( | const lp::NackHeader & | nack, |
Face & | egress, | ||
const shared_ptr< pit::Entry > & | pitEntry | ||
) |
outgoing Nack pipeline
Definition at line 503 of file forwarder.cpp.
References ndn::lp::NackHeader::getReason(), nfd::face::INVALID_FACEID, ndn::nfd::LINK_TYPE_POINT_TO_POINT, NFD_LOG_DEBUG, NFD_LOG_WARN, nfd::ForwarderCounters::nOutNacks, and ndn::lp::Nack::setHeader().
Referenced by nfd::fw::Strategy::sendNack().
Definition at line 550 of file forwarder.cpp.
References nfd::strategy_choice::StrategyChoice::findEffectiveStrategy(), and ndn::Interest::getName().
Referenced by Forwarder().
void nfd::Forwarder::onNewNextHop | ( | const Name & | prefix, |
const fib::NextHop & | nextHop | ||
) |
Definition at line 556 of file forwarder.cpp.
References nfd::DeadNonceList::add(), nfd::fw::Strategy::afterNewNextHop(), nfd::pit::Entry::dataFreshnessPeriod, Face, nfd::strategy_choice::StrategyChoice::findEffectiveStrategy(), nfd::name_tree::Entry::getFibEntry(), nfd::pit::Entry::getInterest(), nfd::DeadNonceList::getLifetime(), ndn::Interest::getMustBeFresh(), nfd::name_tree::Entry::getName(), nfd::pit::Entry::getName(), getNameTree(), nfd::pit::Entry::getOutRecord(), nfd::pit::Entry::getOutRecords(), nfd::name_tree::Entry::getPitEntries(), nfd::getScheduler(), nfd::name_tree::Entry::hasPitEntries(), nfd::pit::Entry::isSatisfied, onInterestFinalize(), nfd::name_tree::NameTree::partialEnumerate(), and ndn::Name::size().
Referenced by Forwarder().
|
friend |
Definition at line 274 of file forwarder.hpp.
signal::Signal<Forwarder, pit::Entry, Face, Data> nfd::Forwarder::beforeSatisfyInterest |
trigger before PIT entry is satisfied
Definition at line 138 of file forwarder.hpp.
Referenced by onContentStoreHit(), and onIncomingData().
signal::Signal<Forwarder, pit::Entry> nfd::Forwarder::beforeExpirePendingInterest |
trigger before PIT entry expires
Definition at line 143 of file forwarder.hpp.
Referenced by onInterestFinalize().
signal::Signal<Forwarder, Interest, Data> nfd::Forwarder::afterCsHit |
Signals when the incoming interest pipeline gets a hit from the content store.
Definition at line 147 of file forwarder.hpp.
Referenced by onContentStoreHit().
signal::Signal<Forwarder, Interest> nfd::Forwarder::afterCsMiss |
Signals when the incoming interest pipeline gets a miss from the content store.
Definition at line 151 of file forwarder.hpp.
Referenced by onContentStoreMiss().
NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE nfd::Forwarder::__pad0__ |
Definition at line 159 of file forwarder.hpp.
NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE const FaceEndpoint& nfd::Forwarder::ingress |
Definition at line 159 of file forwarder.hpp.
Referenced by Forwarder().