26 #ifndef NFD_DAEMON_FACE_FACE_HPP 27 #define NFD_DAEMON_FACE_FACE_HPP 33 #include <ndn-cxx/management/nfd-face-status.hpp> 57 class Face : noncopyable,
public enable_shared_from_this<Face>
63 class Error :
public std::runtime_error
68 :
std::runtime_error(what)
169 template<
typename FaceTraits>
189 fail(
const std::string& reason);
202 setId(FaceId faceId);
206 std::
string m_description;
210 const
bool m_isLocal;
212 const
bool m_isMultiAccess;
227 Face::setId(FaceId faceId)
232 inline const std::string&
235 return m_description;
241 m_description = description;
253 return m_persistency;
259 m_persistency = persistency;
265 return m_isMultiAccess;
314 #define NFD_LOG_FACE(level, msg) \ 315 NFD_LOG_##level("[id=" << this->getId() << \ 316 ",local=" << this->getLocalUri() << \ 317 ",remote=" << this->getRemoteUri() << \ 321 #define NFD_LOG_FACE_TRACE(msg) NFD_LOG_FACE(TRACE, msg) 324 #define NFD_LOG_FACE_DEBUG(msg) NFD_LOG_FACE(DEBUG, msg) 327 #define NFD_LOG_FACE_INFO(msg) NFD_LOG_FACE(INFO, msg) 330 #define NFD_LOG_FACE_WARN(msg) NFD_LOG_FACE(WARN, msg) 333 #define NFD_LOG_FACE_ERROR(msg) NFD_LOG_FACE(ERROR, msg) 339 #endif // NFD_DAEMON_FACE_FACE_HPP Copyright (c) 2011-2015 Regents of the University of California.
const std::string & getDescription() const
Get the description.
const FaceId FACEID_INTERNAL_FACE
identifies the InternalFace used in management
const FaceCounters & getCounters() const
virtual ndn::nfd::FaceStatus getFaceStatus() const
void copyStatusTo(FaceTraits &traits) const
virtual bool isUp() const
Get whether underlying communication is up.
const FaceId FACEID_RESERVED_MAX
upper bound of reserved FaceIds
ndn::nfd::FacePersistency getPersistency() const
Get the persistency setting.
signal::Signal< Face, Interest > onSendInterest
fires when an Interest is sent out
represents the underlying protocol and address used by a Face
void setPersistency(ndn::nfd::FacePersistency persistency)
Error(const std::string &what)
contains counters on face
bool decodeAndDispatchInput(const Block &element)
signal::Signal< Face, Data > onReceiveData
fires when a Data is received
Class representing a wire element of NDN-TLV packet format.
represents an Interest packet
provides a lightweight signal / event system
virtual void sendData(const Data &data)=0
send a Data
const FaceUri & getRemoteUri() const
signal::Signal< Face, Data > onSendData
fires when a Data is sent out
void fail(const std::string &reason)
fail the face and raise onFail event if it's UP; otherwise do nothing
Copyright (c) 2011-2015 Regents of the University of California.
void setMetric(uint64_t metric)
signal::Signal< Face, std::string > onFail
fires when face disconnects or fails to perform properly
FaceCounters & getMutableCounters()
#define PUBLIC_WITH_TESTS_ELSE_PROTECTED
#define DECLARE_SIGNAL_EMIT(signalName)
(implementation detail) declares a 'emit_signalName' method
const FaceId FACEID_NULL
identifies the NullFace that drops every packet
const FaceId FACEID_CONTENT_STORE
identifies a packet comes from the ContentStore, in LocalControlHeader incomingFaceId ...
const FaceId INVALID_FACEID
indicates an invalid FaceId
Face(const FaceUri &remoteUri, const FaceUri &localUri, bool isLocal=false, bool isMultiAccess=false)
bool isMultiAccess() const
Get whether packets sent by this face may reach multiple peers.
signal::Signal< Face, Interest > onReceiveInterest
fires when an Interest is received
void setDescription(const std::string &description)
Set the face description.
uint64_t getMetric() const
const FaceUri & getLocalUri() const
virtual void close()=0
Close the face.
bool isLocal() const
Get whether face is connected to a local app.
virtual void sendInterest(const Interest &interest)=0
send an Interest