represents a face More...
#include <face.hpp>
Classes | |
class | Impl |
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.
Referenced by nfd::Face::Error::Error().
|
virtual |
Definition at line 48 of file face.cpp.
Referenced by nfd::Face::Error::Error().
|
pure virtual |
send an Interest
Implemented in nfd::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.
Referenced by nfd::compare_pickInterest().
|
pure virtual |
send a Data
Implemented in nfd::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.
Referenced by nfd::compare_pickInterest().
|
pure virtual |
Close the face.
This terminates all communication on the face and cause onFail() method event to be invoked
Implemented in nfd::Face::Impl::NfdFace, ns3::ndn::AppFace, nfd::EthernetFace, nfd::InternalFace, ns3::ndn::NetDeviceFace, 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(), nfd::compare_pickInterest(), copyStatusTo(), and nfd::Forwarder::~Forwarder().
|
inline |
|
inline |
|
inline |
Get whether face is connected to a local app.
Definition at line 245 of file face.hpp.
Referenced by nfd::compare_pickInterest(), copyStatusTo(), nfd::Face::Error::Error(), nfd::pit::Entry::violatesScope(), and nfd::Forwarder::~Forwarder().
|
inline |
Get the persistency setting.
Definition at line 251 of file face.hpp.
Referenced by copyStatusTo(), nfd::UdpFace::getFaceStatus(), 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(), and nfd::Face::Error::Error().
|
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::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::EthernetFace::close(), and nfd::WebSocketFace::handleReceive().
|
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::WebSocketFace::close(), ns3::ndn::NetDeviceFace::close(), nfd::EthernetFace::close(), ns3::ndn::AppFace::close(), and nfd::Face::Impl::NfdFace::close().
|
inlineprotected |
Definition at line 275 of file face.hpp.
Referenced by nfd::EthernetFace::close(), nfd::WebSocketFace::handleReceive(), 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::Face::Impl::asyncExpressInterest(), nfd::LocalFace::decodeAndDispatchInput(), decodeAndDispatchInput(), Face(), and ns3::ndn::NetDeviceFace::sendData().
signal::Signal<Face, Data> nfd::Face::onReceiveData |
fires when a Data is received
Definition at line 83 of file face.hpp.
Referenced by nfd::Face::Impl::asyncPutData(), nfd::LocalFace::decodeAndDispatchInput(), decodeAndDispatchInput(), Face(), nfd::InternalFace::put(), and ns3::ndn::NetDeviceFace::sendData().
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::WebSocketFace::sendInterest(), ns3::ndn::AppFace::sendInterest(), ns3::ndn::NetDeviceFace::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::WebSocketFace::sendData(), ns3::ndn::NetDeviceFace::sendData(), ns3::ndn::AppFace::sendData(), nfd::InternalFace::sendData(), and nfd::EthernetFace::sendData().
signal::Signal<Face, std::string> nfd::Face::onFail |