NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: 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

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.

Enumerator
INVALID_POLICY 
NO_CACHE 

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

Constructor & Destructor Documentation

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

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

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 ENCODE_ALL, getPayload(), wireDecode(), and wireEncode().

Member Function Documentation

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(), and ndn::nfd::LocalControlHeader::Error::Error().

Referenced by LocalControlHeader(), and setCachingPolicy().

void ndn::nfd::LocalControlHeader::wireDecode ( const Block wire,
uint8_t  encodeMask = ENCODE_ALL 
)
inline
const Block & ndn::nfd::LocalControlHeader::getPayload ( const Block wire)
inlinestatic
bool ndn::nfd::LocalControlHeader::empty ( uint8_t  encodeMask) const
inline
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(), and setCachingPolicy().

uint64_t ndn::nfd::LocalControlHeader::getIncomingFaceId ( ) const
inline
void ndn::nfd::LocalControlHeader::setIncomingFaceId ( uint64_t  incomingFaceId)
inline
bool ndn::nfd::LocalControlHeader::hasNextHopFaceId ( ) const
inline
uint64_t ndn::nfd::LocalControlHeader::getNextHopFaceId ( ) const
inline
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().

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

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

Referenced by empty(), and setCachingPolicy().

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

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

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


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