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

Implementation of Face abstraction that uses raw Ethernet frames as underlying transport mechanism. More...

#include <ethernet-face.hpp>

Inheritance diagram for nfd::EthernetFace:
Collaboration diagram for nfd::EthernetFace:

Classes

struct  Error
 EthernetFace-related error. More...
 

Public Member Functions

 EthernetFace (boost::asio::posix::stream_descriptor socket, const NetworkInterfaceInfo &interface, const ethernet::Address &address)
 
void sendInterest (const Interest &interest) 1
 send an Interest More...
 
void sendData (const Data &data) 1
 send a Data More...
 
void close () 1
 Closes the face. More...
 
- Public Member Functions inherited from nfd::Face
 Face (const FaceUri &remoteUri, const FaceUri &localUri, bool isLocal=false, bool isMultiAccess=false)
 
virtual ~Face ()
 
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
 

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...
 
- 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 ()
 

Detailed Description

Implementation of Face abstraction that uses raw Ethernet frames as underlying transport mechanism.

Definition at line 52 of file ethernet-face.hpp.

Constructor & Destructor Documentation

◆ EthernetFace()

nfd::EthernetFace::EthernetFace ( boost::asio::posix::stream_descriptor  socket,
const NetworkInterfaceInfo interface,
const ethernet::Address address 
)

Member Function Documentation

◆ sendInterest()

void nfd::EthernetFace::sendInterest ( const Interest interest)
virtual

send an Interest

Implements nfd::Face.

Definition at line 121 of file ethernet-face.cpp.

References emitSignal, NFD_LOG_FACE_TRACE, nfd::Face::onSendInterest, and ndn::Interest::wireEncode().

◆ sendData()

void nfd::EthernetFace::sendData ( const Data data)
virtual

send a Data

Implements nfd::Face.

Definition at line 134 of file ethernet-face.cpp.

References emitSignal, NFD_LOG_FACE_TRACE, nfd::Face::onSendData, and ndn::Data::wireEncode().

◆ close()

void nfd::EthernetFace::close ( )
virtual

Closes the face.

This terminates all communication on the face and triggers the onFail() event.

Implements nfd::Face.

Definition at line 147 of file ethernet-face.cpp.

References nfd::Face::fail(), and NFD_LOG_FACE_INFO.


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