represents a Network NACK header More...
#include <nack-header.hpp>
Public Member Functions | |
NackHeader () | |
NackHeader (const Block &block) | |
template<encoding::Tag TAG> | |
size_t | wireEncode (EncodingImpl< TAG > &encoder) const |
const Block & | wireEncode () const |
void | wireDecode (const Block &wire) |
NackReason | getReason () const |
NackHeader & | setReason (NackReason reason) |
set reason code More... | |
represents a Network NACK header
Definition at line 57 of file nack-header.hpp.
ndn::lp::NackHeader::NackHeader | ( | ) |
Definition at line 57 of file nack-header.cpp.
|
explicit |
Definition at line 62 of file nack-header.cpp.
References wireDecode().
size_t ndn::lp::NackHeader::wireEncode | ( | EncodingImpl< TAG > & | encoder | ) | const |
Definition at line 69 of file nack-header.cpp.
References ndn::lp::tlv::Nack, ndn::lp::tlv::NackReason, ndn::lp::NDN_CXX_DEFINE_WIRE_ENCODE_INSTANTIATIONS(), and ndn::encoding::prependNonNegativeIntegerBlock().
const Block & ndn::lp::NackHeader::wireEncode | ( | ) | const |
Definition at line 81 of file nack-header.cpp.
References ndn::Block::hasWire().
void ndn::lp::NackHeader::wireDecode | ( | const Block & | wire | ) |
Definition at line 99 of file nack-header.cpp.
References ndn::Block::elements_begin(), ndn::Block::elements_size(), ndn::lp::tlv::Nack, ndn::lp::tlv::NackReason, NDN_THROW, ndn::lp::NONE, ndn::Block::parse(), and ndn::Block::type().
Referenced by NackHeader().
NackReason ndn::lp::NackHeader::getReason | ( | ) | const |
NackReason::NONE | if NackReason element does not exist or has an unknown code |
Definition at line 121 of file nack-header.cpp.
References ndn::lp::CONGESTION, ndn::lp::DUPLICATE, ndn::lp::NO_ROUTE, and ndn::lp::NONE.
Referenced by ndn::lp::Nack::getReason(), nfd::Forwarder::onOutgoingNack(), ns3::ndn::BlockHeader::Print(), nfd::fw::ProcessNackTraitsBase::processNack(), and ndn::Face::Impl::putNack().
NackHeader & ndn::lp::NackHeader::setReason | ( | NackReason | reason | ) |
set reason code
reason | a reason code; NackReason::NONE clears the reason |
Definition at line 134 of file nack-header.cpp.
References ndn::Block::reset().
Referenced by nfd::fw::RandomStrategy::afterReceiveInterest(), nfd::fw::BestRouteStrategy::afterReceiveInterest(), nfd::fw::SelfLearningStrategy::afterReceiveInterest(), nfd::fw::asf::FaceStatsCompare::operator()(), nfd::fw::ProcessNackTraitsBase::processNack(), and ndn::lp::Nack::setReason().