Class to handle work with LocalControlHeader. More...
#include <nfd-local-control-header.hpp>
Classes | |
class | Error |
Public Types | |
enum | EncodeFlags : uint8_t { ENCODE_NONE = 0, ENCODE_INCOMING_FACE_ID = (1 << 0), ENCODE_NEXT_HOP = (1 << 1), ENCODE_CACHING_POLICY = (1 << 2), ENCODE_ALL = 0xff } |
enum | CachingPolicy : uint8_t { INVALID_POLICY = 0, NO_CACHE = 1 } |
Public Member Functions | |
LocalControlHeader () | |
LocalControlHeader (const Block &wire, uint8_t encodeMask=ENCODE_ALL) | |
Create from wire encoding. More... | |
template<class U > | |
Block | wireEncode (const U &payload, uint8_t encodeMask=ENCODE_ALL) const |
Create wire encoding with options LocalControlHeader and the supplied item. More... | |
void | wireDecode (const Block &wire, uint8_t encodeMask=ENCODE_ALL) |
Decode from the wire format and set LocalControlHeader on the supplied item. More... | |
bool | empty (uint8_t encodeMask) const |
bool | hasIncomingFaceId () const |
uint64_t | getIncomingFaceId () const |
void | setIncomingFaceId (uint64_t incomingFaceId) |
bool | hasNextHopFaceId () const |
uint64_t | getNextHopFaceId () const |
void | setNextHopFaceId (uint64_t nextHopFaceId) |
bool | hasCachingPolicy () const |
CachingPolicy | getCachingPolicy () const |
void | setCachingPolicy (CachingPolicy cachingPolicy) |
Static Public Member Functions | |
static const Block & | getPayload (const Block &wire) |
Class to handle work with LocalControlHeader.
Definition at line 37 of file nfd-local-control-header.hpp.
enum ndn::nfd::LocalControlHeader::EncodeFlags : uint8_t |
Enumerator | |
---|---|
ENCODE_NONE | |
ENCODE_INCOMING_FACE_ID | |
ENCODE_NEXT_HOP | |
ENCODE_CACHING_POLICY | |
ENCODE_ALL |
Definition at line 50 of file nfd-local-control-header.hpp.
enum ndn::nfd::LocalControlHeader::CachingPolicy : uint8_t |
Enumerator | |
---|---|
INVALID_POLICY | |
NO_CACHE |
Definition at line 58 of file nfd-local-control-header.hpp.
|
inline |
Definition at line 63 of file nfd-local-control-header.hpp.
|
inlineexplicit |
Create from wire encoding.
Definition at line 76 of file nfd-local-control-header.hpp.
References ENCODE_ALL, getPayload(), wireDecode(), and wireEncode().
|
inline |
Create wire encoding with options LocalControlHeader and the supplied item.
The caller is responsible of checking whether LocalControlHeader contains any information.
!It is an error to call this method if none of IncomingFaceId, NextHopFaceId and CachingPolicy are set, or neither of them are enabled.
LocalControlHeader::Error | when empty LocalControlHeader be produced |
Definition at line 249 of file nfd-local-control-header.hpp.
References empty(), and ndn::nfd::LocalControlHeader::Error::Error().
Referenced by LocalControlHeader(), and setCachingPolicy().
|
inline |
Decode from the wire format and set LocalControlHeader on the supplied item.
The supplied wire MUST contain LocalControlHeader. Determination whether the optional LocalControlHeader should be done before calling this method.
Definition at line 266 of file nfd-local-control-header.hpp.
References ndn::tlv::nfd::CachingPolicy, ndn::Block::elements_begin(), ndn::Block::elements_end(), ENCODE_CACHING_POLICY, ENCODE_INCOMING_FACE_ID, ENCODE_NEXT_HOP, ndn::nfd::LocalControlHeader::Error::Error(), ndn::tlv::nfd::IncomingFaceId, ndn::nfd::INVALID_FACE_ID, ndn::tlv::nfd::LocalControlHeader, ndn::tlv::nfd::NextHopFaceId, ndn::tlv::nfd::NoCache, ndn::Block::parse(), ndn::encoding::readNonNegativeInteger(), and ndn::Block::type().
Referenced by LocalControlHeader().
Definition at line 313 of file nfd-local-control-header.hpp.
References ndn::Block::elements(), ndn::Block::elements_size(), ndn::tlv::nfd::LocalControlHeader, ndn::Block::parse(), and ndn::Block::type().
Referenced by nfd::LocalFace::decodeAndDispatchInput(), and LocalControlHeader().
|
inline |
Definition at line 122 of file nfd-local-control-header.hpp.
References ENCODE_CACHING_POLICY, ENCODE_INCOMING_FACE_ID, ENCODE_NEXT_HOP, hasCachingPolicy(), hasIncomingFaceId(), and hasNextHopFaceId().
Referenced by nfd::LocalFace::isEmptyFilteredLocalControlHeader(), and wireEncode().
|
inline |
Definition at line 136 of file nfd-local-control-header.hpp.
References ndn::nfd::INVALID_FACE_ID.
Referenced by empty(), and setCachingPolicy().
|
inline |
Definition at line 142 of file nfd-local-control-header.hpp.
Referenced by ndn::Interest::getIncomingFaceId(), ndn::Data::getIncomingFaceId(), and setCachingPolicy().
|
inline |
Definition at line 148 of file nfd-local-control-header.hpp.
Referenced by ndn::Interest::setIncomingFaceId(), and ndn::Data::setIncomingFaceId().
|
inline |
Definition at line 156 of file nfd-local-control-header.hpp.
References ndn::nfd::INVALID_FACE_ID.
Referenced by nfd::fw::ClientControlStrategy::afterReceiveInterest(), empty(), and setCachingPolicy().
|
inline |
Definition at line 162 of file nfd-local-control-header.hpp.
Referenced by ndn::Interest::getNextHopFaceId(), and setCachingPolicy().
|
inline |
Definition at line 168 of file nfd-local-control-header.hpp.
Referenced by ndn::Interest::setNextHopFaceId().
|
inline |
Definition at line 176 of file nfd-local-control-header.hpp.
Referenced by empty(), and setCachingPolicy().
|
inline |
Definition at line 182 of file nfd-local-control-header.hpp.
Referenced by ndn::Data::getCachingPolicy().
|
inline |
Definition at line 188 of file nfd-local-control-header.hpp.
References ndn::tlv::nfd::CachingPolicy, ENCODE_CACHING_POLICY, ENCODE_INCOMING_FACE_ID, ENCODE_NEXT_HOP, getIncomingFaceId(), getNextHopFaceId(), hasCachingPolicy(), hasIncomingFaceId(), hasNextHopFaceId(), ndn::tlv::nfd::IncomingFaceId, ndn::tlv::nfd::LocalControlHeader, ndn::tlv::nfd::NextHopFaceId, ndn::tlv::nfd::NoCache, ndn::encoding::prependNonNegativeIntegerBlock(), and wireEncode().
Referenced by ndn::Data::setCachingPolicy().