NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
ndn::nfd::LocalControlHeader Class Reference

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 BlockgetPayload (const Block &wire)
 

Detailed Description

Member Enumeration Documentation

◆ EncodeFlags

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.

◆ CachingPolicy

Enumerator
INVALID_POLICY 
NO_CACHE 

Definition at line 58 of file nfd-local-control-header.hpp.

Constructor & Destructor Documentation

◆ LocalControlHeader() [1/2]

ndn::nfd::LocalControlHeader::LocalControlHeader ( )
inline

Definition at line 63 of file nfd-local-control-header.hpp.

◆ LocalControlHeader() [2/2]

ndn::nfd::LocalControlHeader::LocalControlHeader ( const Block wire,
uint8_t  encodeMask = ENCODE_ALL 
)
inlineexplicit

Create from wire encoding.

See also
wireDecode

Definition at line 76 of file nfd-local-control-header.hpp.

References wireDecode().

Member Function Documentation

◆ wireEncode()

template<class U >
Block ndn::nfd::LocalControlHeader::wireEncode ( const U &  payload,
uint8_t  encodeMask = ENCODE_ALL 
) const
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.

Exceptions
LocalControlHeader::Errorwhen empty LocalControlHeader be produced
Returns
Block, containing LocalControlHeader. Top-level length field of the returned LocalControlHeader includes payload length, but the memory block is independent of the payload's wire buffer. It is expected that both LocalControlHeader's and payload's wire will be send out together within a single send call.
See also
http://redmine.named-data.net/projects/nfd/wiki/LocalControlHeader

Definition at line 249 of file nfd-local-control-header.hpp.

References empty().

◆ wireDecode()

void ndn::nfd::LocalControlHeader::wireDecode ( const Block wire,
uint8_t  encodeMask = ENCODE_ALL 
)
inline

◆ getPayload()

const Block & ndn::nfd::LocalControlHeader::getPayload ( const Block wire)
inlinestatic

◆ empty()

bool ndn::nfd::LocalControlHeader::empty ( uint8_t  encodeMask) const
inline

◆ hasIncomingFaceId()

bool ndn::nfd::LocalControlHeader::hasIncomingFaceId ( ) const
inline

Definition at line 136 of file nfd-local-control-header.hpp.

References ndn::nfd::INVALID_FACE_ID.

Referenced by empty().

◆ getIncomingFaceId()

uint64_t ndn::nfd::LocalControlHeader::getIncomingFaceId ( ) const
inline

◆ setIncomingFaceId()

void ndn::nfd::LocalControlHeader::setIncomingFaceId ( uint64_t  incomingFaceId)
inline

◆ hasNextHopFaceId()

bool ndn::nfd::LocalControlHeader::hasNextHopFaceId ( ) const
inline

◆ getNextHopFaceId()

uint64_t ndn::nfd::LocalControlHeader::getNextHopFaceId ( ) const
inline

Definition at line 162 of file nfd-local-control-header.hpp.

Referenced by ndn::Interest::getNextHopFaceId().

◆ setNextHopFaceId()

void ndn::nfd::LocalControlHeader::setNextHopFaceId ( uint64_t  nextHopFaceId)
inline

Definition at line 168 of file nfd-local-control-header.hpp.

Referenced by ndn::Interest::setNextHopFaceId().

◆ hasCachingPolicy()

bool ndn::nfd::LocalControlHeader::hasCachingPolicy ( ) const
inline

Definition at line 176 of file nfd-local-control-header.hpp.

Referenced by empty().

◆ getCachingPolicy()

CachingPolicy ndn::nfd::LocalControlHeader::getCachingPolicy ( ) const
inline

Definition at line 182 of file nfd-local-control-header.hpp.

Referenced by ndn::Data::getCachingPolicy().

◆ setCachingPolicy()

void ndn::nfd::LocalControlHeader::setCachingPolicy ( CachingPolicy  cachingPolicy)
inline

Definition at line 188 of file nfd-local-control-header.hpp.

Referenced by ndn::Data::setCachingPolicy().


The documentation for this class was generated from the following file: