reassembles fragmented network-layer packets More...
#include <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) | |
void | setOptions (const Options &options) |
set options for reassembler More... | |
const LinkService * | getLinkService () const |
std::tuple< bool, Block, lp::Packet > | receiveFragment (EndpointId remoteEndpoint, const lp::Packet &packet) |
adds received fragment to the buffer More... | |
size_t | size () const |
count of partial packets More... | |
Public Attributes | |
signal::Signal< LpReassembler, EndpointId, size_t > | beforeTimeout |
signals 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 37 of file lp-reassembler.cpp.
|
inline |
set options for reassembler
Definition at line 132 of file lp-reassembler.hpp.
Referenced by nfd::face::GenericLinkService::setOptions().
|
inline |
This is only used for logging, and may be nullptr.
Definition at line 138 of file lp-reassembler.hpp.
Referenced by nfd::face::operator<<().
std::tuple< bool, Block, lp::Packet > nfd::face::LpReassembler::receiveFragment | ( | 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 44 of file lp-reassembler.cpp.
References ndn::lp::Packet::get(), nfd::getScheduler(), ndn::lp::Packet::has(), nonstd::optional_lite::std11::move(), NFD_LOG_FACE_TRACE, NFD_LOG_FACE_WARN, nfd::face::LpReassembler::Options::nMaxFragments, and nfd::face::LpReassembler::Options::reassemblyTimeout.
|
inline |
count of partial packets
Definition at line 144 of file lp-reassembler.hpp.
signal::Signal<LpReassembler, EndpointId, size_t> nfd::face::LpReassembler::beforeTimeout |
signals before a partial packet is dropped due to timeout
If a partial packet is incomplete and no new fragment is received within Options::reassemblyTimeout, it would be dropped due to timeout. Before it's erased, this signal is emitted with the remote endpoint, and the number of fragments being dropped.
Definition at line 96 of file lp-reassembler.hpp.
Referenced by nfd::face::GenericLinkService::GenericLinkService().