34 : nReassembling(reassembler)
39 : allowLocalFields(false)
40 , allowFragmentation(false)
41 , allowReassembly(false)
56 GenericLinkService::doSendInterest(
const Interest& interest)
61 encodeLocalFields(interest, lpPacket);
64 this->sendNetPacket(std::move(lpPacket));
68 GenericLinkService::doSendData(
const Data& data)
73 encodeLocalFields(data, lpPacket);
76 this->sendNetPacket(std::move(lpPacket));
80 GenericLinkService::doSendNack(
const lp::Nack& nack)
86 encodeLocalFields(nack, lpPacket);
89 this->sendNetPacket(std::move(lpPacket));
96 if (incomingFaceIdTag !=
nullptr) {
102 GenericLinkService::sendNetPacket(
lp::Packet&& pkt)
104 std::vector<lp::Packet> frags;
116 frags.push_back(pkt);
119 if (frags.size() > 1) {
121 this->assignSequences(frags);
126 BOOST_ASSERT(frags.size() > 0);
133 if (mtu !=
MTU_UNLIMITED && tp.packet.size() >
static_cast<size_t>(mtu)) {
143 GenericLinkService::assignSequence(
lp::Packet& pkt)
149 GenericLinkService::assignSequences(std::vector<lp::Packet>& pkts)
151 std::for_each(pkts.begin(), pkts.end(), bind(&GenericLinkService::assignSequence,
this, _1));
171 bool isReassembled =
false;
174 std::tie(isReassembled, netPkt, firstPkt) = m_reassembler.
receiveFragment(packet.remoteEndpoint,
177 this->decodeNetPacket(netPkt, firstPkt);
187 GenericLinkService::decodeNetPacket(
const Block& netPkt,
const lp::Packet& firstPkt)
190 switch (netPkt.
type()) {
193 this->decodeNack(netPkt, firstPkt);
196 this->decodeInterest(netPkt, firstPkt);
200 this->decodeData(netPkt, firstPkt);
215 GenericLinkService::decodeInterest(
const Block& netPkt,
const lp::Packet& firstPkt)
221 auto interest = make_shared<Interest>(netPkt);
247 GenericLinkService::decodeData(
const Block& netPkt,
const lp::Packet& firstPkt)
252 auto data = make_shared<Data>(netPkt);
285 GenericLinkService::decodeNack(
const Block& netPkt,
const lp::Packet& firstPkt)
LpFragmenter::Options fragmenterOptions
options for fragmentation
void setTag(shared_ptr< T > tag) const
set a tag item
signal::Signal< LpReassembler, Transport::EndpointId, size_t > beforeTimeout
signals before a partial packet is dropped due to timeout
shared_ptr< T > getTag() const
get a tag item
bool allowReassembly
enables reassembly
#define NFD_LOG_FACE_TRACE(msg)
Log a message at TRACE level.
bool allowLocalFields
enables encoding of IncomingFaceId, and decoding of NextHopFaceId and CachePolicy ...
Packet & set(const typename FIELD::ValueType &value)
remove all occurrences of FIELD, and add a FIELD with value
const ssize_t MTU_UNLIMITED
indicates the transport has no limit on payload size
Base class to store tag information (e.g., inside Interest and Data packets)
Packet & add(const typename FIELD::ValueType &value)
add a FIELD with value
Nack & setHeader(const NackHeader &header)
const Transport * getTransport() const
stores a packet along with the remote endpoint
PacketCounter nReassemblyTimeouts
count of dropped partial network-layer packets due to reassembly timeout
Class representing a wire element of NDN-TLV packet format.
represents an Interest packet
const NackHeader & getHeader() const
void sendPacket(Transport::Packet &&packet)
sends a lower-layer packet via Transport
GenericLinkServiceCounters(const LpReassembler &reassembler)
represents a Network Nack
provides a tag type for simple types
FIELD::ValueType get(size_t index=0) const
PacketCounter nOutOverMtu
count of outgoing LpPackets dropped due to exceeding MTU limit
Copyright (c) 2011-2015 Regents of the University of California.
void receiveNack(const lp::Nack &nack)
delivers received Nack to forwarding
reassembles fragmented network-layer packets
counters provided by GenericLinkService
Options that control the behavior of GenericLinkService.
size_t wireEncode(EncodingImpl< TAG > &encoder) const
Fast encoding or block size estimation.
#define NFD_LOG_INIT(name)
void receiveData(const Data &data)
delivers received Data to forwarding
size_t wireEncode(EncodingImpl< TAG > &encoder, bool wantUnsignedPortionOnly=false) const
Fast encoding or block size estimation.
std::tuple< bool, Block, lp::Packet > receiveFragment(Transport::EndpointId remoteEndpoint, const lp::Packet &packet)
adds received fragment to buffer
PacketCounter nInNetInvalid
count of invalid reassembled network-layer packets dropped
std::tuple< bool, std::vector< lp::Packet > > fragmentPacket(const lp::Packet &packet, size_t mtu)
fragments a network-layer packet into link-layer packets
LpReassembler::Options reassemblerOptions
options for reassembly
GenericLinkService(const Options &options=Options())
const Interest & getInterest() const
represents an error in TLV encoding or decoding
#define NFD_LOG_FACE_WARN(msg)
Log a message at WARN level.
PacketCounter nInLpInvalid
count of invalid LpPackets dropped before reassembly
void receiveInterest(const Interest &interest)
delivers received Interest to forwarding
PacketCounter nFragmentationErrors
count of failed fragmentations
bool allowFragmentation
enables fragmentation