NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
nfd::face::LpReassembler Class Reference

reassembles fragmented network-layer packets More...

#include <lp-reassembler.hpp>

Inheritance diagram for nfd::face::LpReassembler:
Collaboration diagram for nfd::face::LpReassembler:

Classes

class  Options
 Options that control the behavior of LpReassembler. More...
 

Public Member Functions

 LpReassembler (const Options &options=Options(), const LinkService *linkService=nullptr)
 
void setOptions (const Options &options)
 set options for reassembler More...
 
const LinkServicegetLinkService () const
 
std::tuple< bool, Block, lp::PacketreceiveFragment (Transport::EndpointId remoteEndpoint, const lp::Packet &packet)
 adds received fragment to buffer More...
 
size_t size () const
 count of partial packets More...
 

Public Attributes

signal::Signal< LpReassembler, Transport::EndpointId, size_t > beforeTimeout
 signals before a partial packet is dropped due to timeout More...
 

Detailed Description

reassembles fragmented network-layer packets

See also
http://redmine.named-data.net/projects/nfd/wiki/NDNLPv2

Definition at line 43 of file lp-reassembler.hpp.

Constructor & Destructor Documentation

◆ LpReassembler()

nfd::face::LpReassembler::LpReassembler ( const Options options = Options(),
const LinkService linkService = nullptr 
)
explicit

Definition at line 41 of file lp-reassembler.cpp.

Member Function Documentation

◆ setOptions()

void nfd::face::LpReassembler::setOptions ( const Options options)
inline

set options for reassembler

Definition at line 140 of file lp-reassembler.hpp.

Referenced by nfd::face::GenericLinkService::setOptions().

◆ getLinkService()

const LinkService * nfd::face::LpReassembler::getLinkService ( ) const
inline
Returns
LinkService that owns this instance

This is only used for logging, and may be nullptr.

Definition at line 146 of file lp-reassembler.hpp.

◆ receiveFragment()

std::tuple< bool, Block, lp::Packet > nfd::face::LpReassembler::receiveFragment ( Transport::EndpointId  remoteEndpoint,
const lp::Packet packet 
)

adds received fragment to buffer

Parameters
remoteEndpointendpoint whose sends the packet
packetreceived fragment; must have Fragment field
Returns
whether network-layer packet has been completely received, the reassembled network-layer packet, and the first fragment for inspecting other NDNLPv2 headers
Exceptions
tlv::Errorpacket is malformed

Definition at line 48 of file lp-reassembler.cpp.

References ndn::lp::Packet::get(), ndn::lp::Packet::has(), NFD_LOG_FACE_TRACE, NFD_LOG_FACE_WARN, nfd::face::LpReassembler::Options::nMaxFragments, nfd::face::LpReassembler::Options::reassemblyTimeout, and nfd::scheduler::schedule().

◆ size()

size_t nfd::face::LpReassembler::size ( ) const
inline

count of partial packets

Definition at line 152 of file lp-reassembler.hpp.

Member Data Documentation

◆ beforeTimeout

signal::Signal<LpReassembler, Transport::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 104 of file lp-reassembler.hpp.

Referenced by nfd::face::GenericLinkService::GenericLinkService().


The documentation for this class was generated from the following files: