esp8266ndn
NDN Arduino library for ESP8266 and more
|
NDNLPv2 fragmenter. More...
#include <lp.hpp>
Inherits ndnph::WithRegion.
Public Member Functions | |
Reassembler (Region ®ion) | |
Constructor. More... | |
void | discard () |
Discard the reassembly buffer. More... | |
bool | add (const Fragment &frag) |
Add a fragment. More... | |
PacketClassify | reassemble () const |
Reassemble the packet if it's complete. More... | |
![]() | |
WithRegion (WithRegion &&)=default | |
Additional Inherited Members | |
![]() | |
WithRegion (Region ®ion) | |
WithRegion (const WithRegion &)=delete | |
WithRegion & | operator= (const WithRegion &)=delete |
![]() | |
Region & | region |
NDNLPv2 fragmenter.
|
inlineexplicit |
Constructor.
region | where to allocate memory for fragment payloads. This region may be shared with others fragmenters and reassemblers. |
|
inline |
Add a fragment.
If FragIndex is 0:
If frag
comes after the previous fragment:
Otherwise:
|
inline |
Discard the reassembly buffer.
When the region is reset elsewhere (e.g. in another fragmenter or reassembler sharing the region), this function should be invoked to discard the reassembly buffer. Otherwise, undefined behavior may occur.
|
inline |
Reassemble the packet if it's complete.
If the reassembly buffer contains a complete packet, return the reassembled packet. Otherwise, return a PacketClassify
with Type::None
.