fragments network-layer packets into NDNLPv2 link-layer packets More...
#include <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) | |
void | setOptions (const Options &options) |
set options for fragmenter More... | |
const LinkService * | getLinkService () 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... | |
fragments network-layer packets into NDNLPv2 link-layer packets
Definition at line 39 of file lp-fragmenter.hpp.
|
explicit |
Definition at line 60 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.
const LinkService * nfd::face::LpFragmenter::getLinkService | ( | ) | const |
This is only used for logging, and may be nullptr.
Definition at line 73 of file lp-fragmenter.cpp.
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
packet | an LpPacket that contains a network-layer packet; must have Fragment field, must not have FragIndex and FragCount fields |
mtu | maximum allowable LpPacket size after fragmentation and sequence number assignment |
Definition at line 79 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::size(), ndn::Block::type(), and ndn::lp::Packet::wireEncode().