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::lp::Fragmenter Class Reference

NDNLPv2 fragmenter. More...

#include <lp.hpp>

Inherits ndnph::WithRegion.

Classes

class  Fragment
 Singly linked list of encodable fragments. More...
 

Public Member Functions

 Fragmenter (Region &region, uint16_t mtu)
 Constructor. More...
 
template<typename L3 >
const Fragmentfragment (Encodable< L3 > packet)
 Fragment an LP 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

NDNLPv2 fragmenter.

Constructor & Destructor Documentation

◆ Fragmenter()

ndnph::lp::Fragmenter::Fragmenter ( Region region,
uint16_t  mtu 
)
inlineexplicit

Constructor.

Parameters
regionwhere to allocate memory for fragment payloads. This region may be shared with others fragmenters and reassemblers.
mtumaximum output packet size including NDNLPv2 headers.

Member Function Documentation

◆ fragment()

template<typename L3 >
const Fragment* ndnph::lp::Fragmenter::fragment ( Encodable< L3 >  packet)
inline

Fragment an LP packet.

Template Parameters
L3Interest, Data, or their signed variants.
Returns
singly linked list of fragments, or nullptr on failure.

Each fragment() invocation resets the region passed to the constructor. If the region is shared with a reassembler, Reassembler::discard should be invoked to clear the reassembler buffer.

When the region is reset by any means, previously returned fragments are invalidated.


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