|
INET Framework for OMNeT++/OMNEST
|
This class provides functionality for reassembling out of order data chunks for protocols supporting fragmentation. More...
#include <ReassemblyBuffer.h>
Public Member Functions | |
| ReassemblyBuffer (b expectedLength=b(-1)) | |
| ReassemblyBuffer (const ReassemblyBuffer &other) | |
| b | getExpectedLength () const |
| Returns the expected data length. More... | |
| void | setExpectedLength (b expectedLength) |
| Changes the expected data length. More... | |
| bool | isComplete () const |
| Returns true if all data is present for reassembling the data chunk. More... | |
| const Ptr< const Chunk > | getReassembledData () const |
| Returns the reassembled data chunk if all data is present in the buffer, otherwise throws an exception. More... | |
Public Member Functions inherited from inet::ChunkBuffer | |
| ChunkBuffer (const char *name=nullptr) | |
| ChunkBuffer (const ChunkBuffer &other) | |
| virtual ChunkBuffer * | dup () const override |
| bool | isEmpty () const |
| Returns true if the buffer is completely empty. More... | |
| int | getNumRegions () const |
| Returns the number non-overlapping, non-connecting but continuous regions. More... | |
| b | getRegionLength (int index) const |
| Returns the length of the given region. More... | |
| b | getRegionStartOffset (int index) const |
| Returns the start offset of the given region. More... | |
| b | getRegionEndOffset (int index) const |
| Returns the end offset of the given region. More... | |
| const Ptr< const Chunk > & | getRegionData (int index) const |
| Returns the data of the given region in its current representation. More... | |
| void | replace (b offset, const Ptr< const Chunk > &chunk) |
| Replaces the stored data at the provided offset with the data in the chunk. More... | |
| void | clear (b offset, b length) |
| Erases the stored data at the provided offset and length. More... | |
| void | clear () |
| Erases all of the stored data. More... | |
| virtual std::string | str () const override |
| Returns a human readable string representation. More... | |
Protected Attributes | |
| b | expectedLength |
| The total length of the reassembled data chunk. More... | |
Protected Attributes inherited from inet::ChunkBuffer | |
| std::vector< Region > | regions |
| The list of non-overlapping, non-connecting but continuous regions. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from inet::ChunkBuffer | |
| Region * | getRegion (int i) const |
| void | eraseEmptyRegions (std::vector< Region >::iterator begin, std::vector< Region >::iterator end) |
| void | sliceRegions (Region &newRegion) |
| void | mergeRegions (Region &previousRegion, Region &nextRegion) |
This class provides functionality for reassembling out of order data chunks for protocols supporting fragmentation.
The reassembling algorithm requires the expected length of the non-fragmented data chunk. It assumes that the non-fragmented data chunk starts at 0 offset. If all data becomes available up to the expected length, then the defragmentation is considered complete.
|
inline |
|
inline |
Returns the expected data length.
|
inline |
Returns the reassembled data chunk if all data is present in the buffer, otherwise throws an exception.
Referenced by inet::Ipv4FragBuf::addFragment(), and inet::Ipv6FragBuf::addFragment().
|
inline |
Returns true if all data is present for reassembling the data chunk.
Referenced by inet::Ipv4FragBuf::addFragment(), and inet::Ipv6FragBuf::addFragment().
|
inline |
Changes the expected data length.
Referenced by inet::Ipv4FragBuf::addFragment(), and inet::Ipv6FragBuf::addFragment().
|
protected |
The total length of the reassembled data chunk.