26 #ifndef NFD_DAEMON_FACE_LP_REASSEMBLER_HPP
27 #define NFD_DAEMON_FACE_LP_REASSEMBLER_HPP
31 #include <ndn-cxx/lp/packet.hpp>
32 #include <ndn-cxx/lp/sequence.hpp>
33 #include <ndn-cxx/util/scheduler.hpp>
97 std::tuple<bool, Block, lp::Packet>
106 return m_partialPackets.size();
125 std::vector<lp::Packet> fragments;
127 size_t nReceivedFragments;
128 ndn::scheduler::ScopedEventId dropTimer;
134 using Key = std::tuple<
140 doReassembly(
const Key& key);
143 timeoutPartialPacket(
const Key& key);
148 std::map<Key, PartialPacket> m_partialPackets;
152 operator<<(std::ostream& os,
const FaceLogHelper<LpReassembler>& flh);
The upper half of a Face.
Reassembles fragmented network-layer packets.
size_t size() const noexcept
Count of partial packets.
std::tuple< bool, Block, lp::Packet > receiveFragment(const EndpointId &remoteEndpoint, const lp::Packet &packet)
Adds received fragment to the buffer.
signal::Signal< LpReassembler, EndpointId, size_t > beforeTimeout
Notifies before a partial packet is dropped due to timeout.
LpReassembler(const Options &options, const LinkService *linkService=nullptr)
const LinkService * getLinkService() const noexcept
Returns the LinkService that owns this instance.
void setOptions(const Options &options)
Set options for reassembler.
std::ostream & operator<<(std::ostream &os, const FaceLogHelper< Face > &flh)
std::variant< std::monostate, ethernet::Address, udp::Endpoint > EndpointId
Identifies a remote endpoint on the link.
Options that control the behavior of LpReassembler.
time::nanoseconds reassemblyTimeout
Timeout before a partially reassembled packet is dropped.
size_t nMaxFragments
Maximum number of fragments in a packet.