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

fragments network-layer packets into NDNLPv2 link-layer packets More...

#include <lp-fragmenter.hpp>

Classes

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

Public Member Functions

 LpFragmenter (const Options &options=Options(), const LinkService *linkService=nullptr)
 
void setOptions (const Options &options)
 set options for fragmenter More...
 
const LinkServicegetLinkService () const
 
std::tuple< bool, std::vector< lp::Packet > > fragmentPacket (const lp::Packet &packet, size_t mtu)
 fragments a network-layer packet into link-layer packets More...
 

Detailed Description

fragments network-layer packets into NDNLPv2 link-layer packets

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

Definition at line 41 of file lp-fragmenter.hpp.

Constructor & Destructor Documentation

◆ LpFragmenter()

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

Definition at line 64 of file lp-fragmenter.cpp.

Member Function Documentation

◆ setOptions()

void nfd::face::LpFragmenter::setOptions ( const Options options)

set options for fragmenter

Definition at line 71 of file lp-fragmenter.cpp.

◆ getLinkService()

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

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

Definition at line 77 of file lp-fragmenter.cpp.

◆ fragmentPacket()

std::tuple< bool, std::vector< lp::Packet > > nfd::face::LpFragmenter::fragmentPacket ( const lp::Packet packet,
size_t  mtu 
)

fragments a network-layer packet into link-layer packets

Parameters
packetan LpPacket that contains a network-layer packet; must have Fragment field, must not have FragIndex and FragCount fields
mtumaximum allowable LpPacket size after fragmentation and sequence number assignment
Returns
whether fragmentation succeeded, fragmented packets without sequence number

Definition at line 83 of file lp-fragmenter.cpp.

References ndn::lp::Packet::add(), ndn::Block::elements(), ndn::lp::tlv::Fragment, ndn::lp::Packet::get(), ndn::lp::Packet::has(), ndn::lp::tlv::LpPacket, nfd::face::MAX_FRAG_OVERHEAD, NFD_LOG_FACE_WARN, nfd::face::LpFragmenter::Options::nMaxFragments, ndn::lp::Packet::set(), ndn::Block::type(), and ndn::lp::Packet::wireEncode().

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


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