represents a face More...
#include <face.hpp>
Classes | |
class | Error |
Face-related error. More... | |
Public Member Functions | |
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 FaceCounters & | getCounters () const |
const FaceUri & | getRemoteUri () const |
const FaceUri & | getLocalUri () const |
template<typename FaceTraits > | |
void | copyStatusTo (FaceTraits &traits) const |
virtual ndn::nfd::FaceStatus | getFaceStatus () const |
Public Attributes | |
signal::Signal< Face, Interest > | onReceiveInterest |
fires when an Interest is received More... | |
signal::Signal< Face, Data > | onReceiveData |
fires when a Data is received More... | |
signal::Signal< Face, Interest > | onSendInterest |
fires when an Interest is sent out More... | |
signal::Signal< Face, Data > | onSendData |
fires when a Data is sent out More... | |
signal::Signal< Face, std::string > | onFail |
fires when face disconnects or fails to perform properly More... | |
Protected Member Functions | |
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... | |
FaceCounters & | getMutableCounters () |
Friends | |
class | FaceTable |
nfd::Face::Face | ( | const FaceUri & | remoteUri, |
const FaceUri & | localUri, | ||
bool | isLocal = false , |
||
bool | isMultiAccess = false |
||
) |
Definition at line 32 of file face.cpp.
References nfd::NetworkLayerCounters::getNInDatas(), nfd::NetworkLayerCounters::getNInInterests(), nfd::NetworkLayerCounters::getNOutDatas(), nfd::NetworkLayerCounters::getNOutInterests(), onReceiveData, onReceiveInterest, onSendData, and onSendInterest.
|
pure virtual |
send an Interest
Implemented in ndn::Face::Impl::NfdFace, nfd::EthernetFace, nfd::InternalFace, nfd::WebSocketFace, nfd::DatagramFace< Protocol, Addressing >, nfd::DatagramFace< boost::asio::ip::udp >, nfd::DatagramFace< boost::asio::ip::udp, Multicast >, nfd::MulticastUdpFace, nfd::StreamFace< boost::asio::ip::tcp >, nfd::StreamFace< boost::asio::local::stream_protocol, LocalFace >, nfd::StreamFace< boost::asio::ip::tcp, LocalFace >, and nfd::NullFace.
|
pure virtual |
send a Data
Implemented in ndn::Face::Impl::NfdFace, nfd::EthernetFace, nfd::InternalFace, nfd::WebSocketFace, nfd::DatagramFace< Protocol, Addressing >, nfd::DatagramFace< boost::asio::ip::udp >, nfd::DatagramFace< boost::asio::ip::udp, Multicast >, nfd::MulticastUdpFace, nfd::StreamFace< boost::asio::ip::tcp >, nfd::StreamFace< boost::asio::local::stream_protocol, LocalFace >, nfd::StreamFace< boost::asio::ip::tcp, LocalFace >, and nfd::NullFace.
|
pure virtual |
Close the face.
This terminates all communication on the face and cause onFail() method event to be invoked
Implemented in ndn::Face::Impl::NfdFace, nfd::EthernetFace, nfd::InternalFace, nfd::WebSocketFace, nfd::DatagramFace< Protocol, Addressing >, nfd::DatagramFace< boost::asio::ip::udp >, nfd::DatagramFace< boost::asio::ip::udp, Multicast >, nfd::StreamFace< boost::asio::ip::tcp >, nfd::StreamFace< boost::asio::local::stream_protocol, LocalFace >, nfd::StreamFace< boost::asio::ip::tcp, LocalFace >, and nfd::NullFace.
|
inline |
Definition at line 221 of file face.hpp.
Referenced by nfd::fw::BestRouteStrategy2::afterReceiveInterest(), nfd::fw::AccessStrategy::afterReceiveInterest(), nfd::fw::AccessStrategy::beforeSatisfyInterest(), nfd::fw::Strategy::beforeSatisfyInterest(), and copyStatusTo().
|
inline |
|
inline |
|
inline |
Get whether face is connected to a local app.
Definition at line 245 of file face.hpp.
Referenced by copyStatusTo(), and nfd::pit::Entry::violatesScope().
|
inline |
Get the persistency setting.
Definition at line 251 of file face.hpp.
Referenced by copyStatusTo(), nfd::UdpFace::getFaceStatus(), nfd::DatagramFace< boost::asio::ip::udp, Multicast >::processErrorCode(), and nfd::UdpFace::UdpFace().
|
inline |
Get whether packets sent by this face may reach multiple peers.
Definition at line 263 of file face.hpp.
Referenced by copyStatusTo().
|
virtual |
|
inline |
Definition at line 269 of file face.hpp.
Referenced by getFaceStatus().
|
inline |
Definition at line 281 of file face.hpp.
Referenced by copyStatusTo().
|
inline |
Definition at line 287 of file face.hpp.
Referenced by copyStatusTo(), and nfd::face::operator<<().
void nfd::Face::copyStatusTo | ( | FaceTraits & | traits | ) | const |
Definition at line 99 of file face.cpp.
References ndn::nfd::FACE_SCOPE_LOCAL, ndn::nfd::FACE_SCOPE_NON_LOCAL, getId(), getLocalUri(), getPersistency(), getRemoteUri(), isLocal(), isMultiAccess(), ndn::nfd::LINK_TYPE_MULTI_ACCESS, ndn::nfd::LINK_TYPE_POINT_TO_POINT, and ndn::time::toString().
Referenced by getFaceStatus().
|
virtual |
Reimplemented in nfd::UdpFace.
Definition at line 118 of file face.cpp.
References copyStatusTo(), nfd::FaceCounters::copyTo(), and getCounters().
Referenced by nfd::UdpFace::getFaceStatus().
|
inlineprotected |
Definition at line 257 of file face.hpp.
Referenced by nfd::UdpFace::UdpFace(), and nfd::WebSocketFace::WebSocketFace().
|
protected |
Definition at line 59 of file face.cpp.
References ndn::tlv::Data, ndn::tlv::Interest, onReceiveData, onReceiveInterest, and ndn::Block::type().
Referenced by nfd::WebSocketFace::handleReceive(), and nfd::DatagramFace< boost::asio::ip::udp, Multicast >::receiveDatagram().
|
protected |
fail the face and raise onFail event if it's UP; otherwise do nothing
Definition at line 87 of file face.cpp.
References onFail.
Referenced by nfd::NullFace::close(), nfd::DatagramFace< boost::asio::ip::udp, Multicast >::close(), nfd::WebSocketFace::close(), nfd::EthernetFace::close(), ndn::Face::Impl::NfdFace::close(), and nfd::DatagramFace< boost::asio::ip::udp, Multicast >::processErrorCode().
|
inlineprotected |
Definition at line 275 of file face.hpp.
Referenced by nfd::WebSocketFace::handleReceive(), nfd::DatagramFace< boost::asio::ip::udp, Multicast >::handleSend(), nfd::DatagramFace< boost::asio::ip::udp, Multicast >::receiveDatagram(), nfd::WebSocketFace::sendData(), and nfd::WebSocketFace::sendInterest().
signal::Signal<Face, Interest> nfd::Face::onReceiveInterest |
fires when an Interest is received
Definition at line 80 of file face.hpp.
Referenced by nfd::LocalFace::decodeAndDispatchInput(), decodeAndDispatchInput(), and Face().
signal::Signal<Face, Data> nfd::Face::onReceiveData |
fires when a Data is received
Definition at line 83 of file face.hpp.
Referenced by nfd::LocalFace::decodeAndDispatchInput(), decodeAndDispatchInput(), Face(), and nfd::InternalFace::put().
signal::Signal<Face, Interest> nfd::Face::onSendInterest |
fires when an Interest is sent out
Definition at line 86 of file face.hpp.
Referenced by Face(), nfd::MulticastUdpFace::sendInterest(), nfd::DatagramFace< boost::asio::ip::udp, Multicast >::sendInterest(), nfd::WebSocketFace::sendInterest(), nfd::InternalFace::sendInterest(), and nfd::EthernetFace::sendInterest().
signal::Signal<Face, Data> nfd::Face::onSendData |
fires when a Data is sent out
Definition at line 89 of file face.hpp.
Referenced by Face(), nfd::MulticastUdpFace::sendData(), nfd::DatagramFace< boost::asio::ip::udp, Multicast >::sendData(), nfd::WebSocketFace::sendData(), nfd::InternalFace::sendData(), and nfd::EthernetFace::sendData().
signal::Signal<Face, std::string> nfd::Face::onFail |