nfd::face::LpFragmenter Class Reference

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

#include <daemon/face/lp-fragmenter.hpp>

Classes

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

Public Member Functions

 LpFragmenter (const Options &options, const LinkService *linkService=nullptr)
 
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...
 
const LinkServicegetLinkService () const
 
void setOptions (const Options &options)
 set options for fragmenter More...
 

Detailed Description

fragments network-layer packets into NDNLPv2 link-layer packets

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

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

Constructor & Destructor Documentation

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

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

Member Function Documentation

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 79 of file lp-fragmenter.cpp.

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 73 of file lp-fragmenter.cpp.

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

set options for fragmenter

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