esp8266ndn
NDN Arduino library for ESP8266 and more
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Member Functions | List of all members
ndnph::Face Class Reference

Network layer face. More...

#include <face.hpp>

Inherits ndnph::WithRegion.

Classes

struct  PacketInfo
 

Public Member Functions

 Face (Region &region, Transport &transport)
 Constructor. More...
 
 Face (Transport &transport)
 
TransportgetTransport () const
 Access the underlying transport. More...
 
void setFragmenter (lp::Fragmenter &frag)
 Enable NDNLPv2 fragmentation. More...
 
void setReassembler (lp::Reassembler &reass)
 Enable NDNLPv2 reassembly. More...
 
bool addHandler (PacketHandler &h, int8_t prio=0)
 Add a packet handler. More...
 
bool removeHandler (PacketHandler &h)
 Remove a packet handler. More...
 
void loop ()
 Process periodical events. More...
 
const PacketInfogetCurrentPacketInfo () const
 
template<typename Packet >
bool send (Region &region, const Packet &packet, PacketInfo pi)
 Synchronously transmit a packet. More...
 
- Public Member Functions inherited from ndnph::WithRegion
 WithRegion (WithRegion &&)=default
 

Additional Inherited Members

- Protected Member Functions inherited from ndnph::WithRegion
 WithRegion (Region &region)
 
 WithRegion (const WithRegion &)=delete
 
WithRegionoperator= (const WithRegion &)=delete
 
- Protected Attributes inherited from ndnph::WithRegion
Regionregion
 

Detailed Description

Network layer face.

Constructor & Destructor Documentation

◆ Face() [1/2]

ndnph::Face::Face ( Region region,
Transport transport 
)
inlineexplicit

Constructor.

Parameters
regionwhere to allocate memory for packet objects (e.g. DataObj ) during RX. This region may be shared among multiple faces, but cannot be shared with the fragmenter or reassembler associated with this face. Face does not use this region for packet buffers, but it is passed to PacketHandler processing functions. If a packet processing function creates a new packet in this region and transmits that packet, that packet would be temporarily encoded in this region during TX.
transportunderlying transport.

◆ Face() [2/2]

ndnph::Face::Face ( Transport transport)
inlineexplicit

Member Function Documentation

◆ addHandler()

bool ndnph::Face::addHandler ( PacketHandler h,
int8_t  prio = 0 
)

Add a packet handler.

Parameters
priopriority, smaller number means higher priority.

◆ getCurrentPacketInfo()

const PacketInfo* ndnph::Face::getCurrentPacketInfo ( ) const
inline

◆ getTransport()

Transport& ndnph::Face::getTransport ( ) const
inline

Access the underlying transport.

◆ loop()

void ndnph::Face::loop ( )

Process periodical events.

This must be invoked periodically.

◆ removeHandler()

bool ndnph::Face::removeHandler ( PacketHandler h)

Remove a packet handler.

◆ send()

template<typename Packet >
bool ndnph::Face::send ( Region region,
const Packet &  packet,
PacketInfo  pi 
)

Synchronously transmit a packet.

See also
PacketHandler::send

◆ setFragmenter()

void ndnph::Face::setFragmenter ( lp::Fragmenter frag)
inline

Enable NDNLPv2 fragmentation.

Parameters
fragfragmenter. It must be kept until face is destructed.

If fragmentation is disabled (this function has not been invoked), the face would attempt to transmit each outgoing packet in full. Oversized packets may be rejected by the transport.

◆ setReassembler()

void ndnph::Face::setReassembler ( lp::Reassembler reass)
inline

Enable NDNLPv2 reassembly.

Parameters
reassreassembler. It must be kept until face is destructed.

If reassembly is disabled (this function has not been invoked), the face would drop incoming fragments.


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