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

represents a face More...

#include <local-face.hpp>

Inheritance diagram for nfd::LocalFace:
Collaboration diagram for nfd::LocalFace:

Public Member Functions

 LocalFace (const FaceUri &remoteUri, const FaceUri &localUri)
 
bool isLocalControlHeaderEnabled () const
 get whether any LocalControlHeader feature is enabled More...
 
bool isLocalControlHeaderEnabled (LocalControlFeature feature) const
 get whether a specific LocalControlHeader feature is enabled More...
 
void setLocalControlHeaderFeature (LocalControlFeature feature, bool enabled=true)
 enable or disable a LocalControlHeader feature More...
 
- Public Member Functions inherited from nfd::Face
 Face (const FaceUri &remoteUri, const FaceUri &localUri, bool isLocal=false, bool isMultiAccess=false)
 
virtual ~Face ()
 
virtual void sendInterest (const Interest &interest)=0
 send an Interest More...
 
virtual void sendData (const Data &data)=0
 send a Data More...
 
virtual void close ()=0
 Close the face. More...
 
FaceId getId () const
 
const std::string & getDescription () const
 Get the description. More...
 
void setDescription (const std::string &description)
 Set the face description. More...
 
void setMetric (uint64_t metric)
 
uint64_t getMetric () const
 
bool isLocal () const
 Get whether face is connected to a local app. More...
 
ndn::nfd::FacePersistency getPersistency () const
 Get the persistency setting. More...
 
bool isMultiAccess () const
 Get whether packets sent by this face may reach multiple peers. More...
 
virtual bool isUp () const
 Get whether underlying communication is up. More...
 
const FaceCountersgetCounters () const
 
const FaceUrigetRemoteUri () const
 
const FaceUrigetLocalUri () const
 
template<typename FaceTraits >
void copyStatusTo (FaceTraits &traits) const
 
virtual ndn::nfd::FaceStatus getFaceStatus () const
 

Static Public Attributes

static const size_t LOCAL_CONTROL_FEATURE_MAX = 3
 
static const size_t LOCAL_CONTROL_FEATURE_ANY = 0
 upper bound of LocalControlFeature enum More...
 

Protected Member Functions

bool decodeAndDispatchInput (const Block &element)
 any feature More...
 
bool isEmptyFilteredLocalControlHeader (const ndn::nfd::LocalControlHeader &header) const
 Check if LocalControlHeader needs to be included, taking into account both set parameters in supplied LocalControlHeader and features enabled on the local face. More...
 
template<class Packet >
Block filterAndEncodeLocalControlHeader (const Packet &packet)
 Create LocalControlHeader, considering enabled features. More...
 
- Protected Member Functions inherited from nfd::Face
void setPersistency (ndn::nfd::FacePersistency persistency)
 
bool decodeAndDispatchInput (const Block &element)
 
void fail (const std::string &reason)
 fail the face and raise onFail event if it's UP; otherwise do nothing More...
 
FaceCountersgetMutableCounters ()
 

Additional Inherited Members

- Public Attributes inherited from nfd::Face
signal::Signal< Face, InterestonReceiveInterest
 fires when an Interest is received More...
 
signal::Signal< Face, DataonReceiveData
 fires when a Data is received More...
 
signal::Signal< Face, InterestonSendInterest
 fires when an Interest is sent out More...
 
signal::Signal< Face, DataonSendData
 fires when a Data is sent out More...
 
signal::Signal< Face, std::string > onFail
 fires when face disconnects or fails to perform properly More...
 

Detailed Description

represents a face

Definition at line 40 of file local-face.hpp.

Constructor & Destructor Documentation

nfd::LocalFace::LocalFace ( const FaceUri remoteUri,
const FaceUri localUri 
)
inline

Definition at line 104 of file local-face.hpp.

Member Function Documentation

bool nfd::LocalFace::isLocalControlHeaderEnabled ( ) const
inline

get whether any LocalControlHeader feature is enabled

Returns
true if any feature is enabled.

Definition at line 111 of file local-face.hpp.

References LOCAL_CONTROL_FEATURE_ANY.

Referenced by decodeAndDispatchInput(), filterAndEncodeLocalControlHeader(), and isEmptyFilteredLocalControlHeader().

bool nfd::LocalFace::isLocalControlHeaderEnabled ( LocalControlFeature  feature) const
inline

get whether a specific LocalControlHeader feature is enabled

Parameters
featureThe feature.
Returns
true if the specified feature is enabled.

Definition at line 117 of file local-face.hpp.

void nfd::LocalFace::setLocalControlHeaderFeature ( LocalControlFeature  feature,
bool  enabled = true 
)
inline

enable or disable a LocalControlHeader feature

Parameters
featureThe feature. Cannot be LOCAL_CONTROL_FEATURE_ANY or LOCAL_CONTROL_FEATURE_MAX

Definition at line 125 of file local-face.hpp.

References LOCAL_CONTROL_FEATURE_ANY.

bool nfd::LocalFace::decodeAndDispatchInput ( const Block element)
inlineprotected

any feature

Decode block into Interest/Data, considering potential LocalControlHeader

If LocalControlHeader is present, the encoded data is filtered out, based on enabled features on the face.

Definition at line 140 of file local-face.hpp.

References ndn::tlv::Data, emitSignal, ndn::nfd::LocalControlHeader::ENCODE_NEXT_HOP, ndn::nfd::LocalControlHeader::getPayload(), ndn::tlv::Interest, isLocalControlHeaderEnabled(), ndn::nfd::LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID, nfd::Face::onReceiveData, nfd::Face::onReceiveInterest, and ndn::Block::type().

bool nfd::LocalFace::isEmptyFilteredLocalControlHeader ( const ndn::nfd::LocalControlHeader header) const
inlineprotected

Check if LocalControlHeader needs to be included, taking into account both set parameters in supplied LocalControlHeader and features enabled on the local face.

Definition at line 193 of file local-face.hpp.

References ndn::nfd::LocalControlHeader::empty(), ndn::nfd::LocalControlHeader::ENCODE_INCOMING_FACE_ID, isLocalControlHeaderEnabled(), and ndn::nfd::LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID.

template<class Packet >
Block nfd::LocalFace::filterAndEncodeLocalControlHeader ( const Packet &  packet)
inlineprotected

Create LocalControlHeader, considering enabled features.

Definition at line 207 of file local-face.hpp.

References ndn::nfd::LocalControlHeader::ENCODE_INCOMING_FACE_ID, isLocalControlHeaderEnabled(), and ndn::nfd::LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID.

Member Data Documentation

const size_t nfd::LocalFace::LOCAL_CONTROL_FEATURE_MAX = 3
static

Definition at line 70 of file local-face.hpp.

const size_t nfd::LocalFace::LOCAL_CONTROL_FEATURE_ANY = 0
static

upper bound of LocalControlFeature enum

Definition at line 71 of file local-face.hpp.

Referenced by isLocalControlHeaderEnabled(), and setLocalControlHeaderFeature().


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