Reassembles fragmented network-layer packets. More...
#include <daemon/face/lp-reassembler.hpp>
Classes | |
struct | Options |
Options that control the behavior of LpReassembler. More... | |
Public Member Functions | |
LpReassembler (const Options &options, const LinkService *linkService=nullptr) | |
const LinkService * | getLinkService () const |
std::tuple< bool, Block, lp::Packet > | receiveFragment (const EndpointId &remoteEndpoint, const lp::Packet &packet) |
Adds received fragment to the buffer. More... | |
void | setOptions (const Options &options) |
Set options for reassembler. More... | |
size_t | size () const |
Count of partial packets. More... | |
Public Attributes | |
signal::Signal< LpReassembler, EndpointId, size_t > | beforeTimeout |
Notifies before a partial packet is dropped due to timeout. More... | |
Reassembles fragmented network-layer packets.
Definition at line 39 of file lp-reassembler.hpp.
|
explicit |
Definition at line 36 of file lp-reassembler.cpp.
|
inline |
This is only used for logging, and may be nullptr.
Definition at line 141 of file lp-reassembler.hpp.
std::tuple< bool, Block, lp::Packet > nfd::face::LpReassembler::receiveFragment | ( | const EndpointId & | remoteEndpoint, |
const lp::Packet & | packet | ||
) |
Adds received fragment to the buffer.
remoteEndpoint | endpoint that sent the packet |
packet | received fragment; must have Fragment field |
tlv::Error | packet is malformed |
Definition at line 43 of file lp-reassembler.cpp.
|
inline |
Set options for reassembler.
Definition at line 135 of file lp-reassembler.hpp.
|
inline |
Count of partial packets.
Definition at line 147 of file lp-reassembler.hpp.
signal::Signal<LpReassembler, EndpointId, size_t> nfd::face::LpReassembler::beforeTimeout |
Notifies before a partial packet is dropped due to timeout.
If a partial packet is incomplete and no new fragments are received within Options::reassemblyTimeout, the partial packet is dropped due to timeout. Before dropping the packet, this signal is emitted with the remote endpoint and the number of fragments being dropped.
Definition at line 97 of file lp-reassembler.hpp.