#include <packet.hpp>
Classes | |
class | Error |
Public Member Functions | |
Packet () | |
Packet (const Block &wire) | |
template<encoding::Tag TAG> | |
size_t | wireEncode (EncodingImpl< TAG > &encoder) const |
append packet to encoder More... | |
Block | wireEncode () const |
encode packet into wire format More... | |
void | wireDecode (const Block &wire) |
decode packet from wire format More... | |
template<typename FIELD > | |
bool | has () const |
template<typename FIELD > | |
size_t | count () const |
template<typename FIELD > | |
FIELD::ValueType | get (size_t index=0) const |
template<typename FIELD > | |
std::vector< typename FIELD::ValueType > | list () const |
template<typename FIELD > | |
Packet & | set (const typename FIELD::ValueType &value) |
remove all occurrences of FIELD, and add a FIELD with value More... | |
template<typename FIELD > | |
Packet & | add (const typename FIELD::ValueType &value) |
add a FIELD with value More... | |
template<typename FIELD > | |
Packet & | remove (size_t index=0) |
remove the index-th occurrence of FIELD More... | |
template<typename FIELD > | |
Packet & | clear () |
remove all occurrences of FIELD More... | |
Definition at line 30 of file packet.hpp.
ndn::lp::Packet::Packet | ( | ) |
Definition at line 30 of file packet.cpp.
Referenced by ndn::lp::Packet::Error::Error().
|
explicit |
Definition at line 35 of file packet.cpp.
References wireDecode().
size_t ndn::lp::Packet::wireEncode | ( | EncodingImpl< TAG > & | encoder | ) | const |
append packet to encoder
Definition at line 42 of file packet.cpp.
References ndn::Block::elements(), ndn::Block::hasWire(), ndn::lp::tlv::LpPacket, and ndn::Block::size().
Referenced by face::Face::Impl::asyncExpressInterest(), nfd::face::LpFragmenter::fragmentPacket(), and ndn::Face::put().
Block ndn::lp::Packet::wireEncode | ( | ) | const |
encode packet into wire format
Definition at line 67 of file packet.cpp.
References ndn::Block::elements(), and ndn::Block::hasWire().
Referenced by ndn::lp::Packet::Error::Error().
void ndn::lp::Packet::wireDecode | ( | const Block & | wire | ) |
decode packet from wire format
Error | unknown TLV-TYPE |
Definition at line 92 of file packet.cpp.
References ndn::Block::begin(), ndn::lp::detail::compareFieldSortOrder(), ndn::tlv::Data, ndn::Block::elements(), ndn::Block::end(), ndn::tlv::Interest, ndn::lp::tlv::LpPacket, ndn::Block::parse(), ndn::lp::detail::FieldInfo::tlvType, ndn::to_string(), and ndn::Block::type().
Referenced by ndn::lp::Packet::Error::Error(), and Packet().
|
inline |
This is equivalent to count() > 0
Definition at line 75 of file packet.hpp.
Referenced by ndn::extractLpLocalFields(), nfd::face::LpFragmenter::fragmentPacket(), nfd::face::GenericLinkService::GenericLinkService(), ns3::ndn::BlockHeader::Print(), and nfd::face::LpReassembler::receiveFragment().
|
inline |
Definition at line 85 of file packet.hpp.
|
inline |
std::out_of_range | if index>=count() |
Definition at line 100 of file packet.hpp.
References count(), and ndn::Block::elements().
Referenced by ndn::extractLpLocalFields(), nfd::face::LpFragmenter::fragmentPacket(), nfd::face::GenericLinkService::GenericLinkService(), ns3::ndn::BlockHeader::Print(), and nfd::face::LpReassembler::receiveFragment().
|
inline |
Definition at line 122 of file packet.hpp.
References ndn::Block::elements().
|
inline |
remove all occurrences of FIELD, and add a FIELD with value
This equivalent to clear() followed by add(value)
Definition at line 144 of file packet.hpp.
Referenced by nfd::face::LpFragmenter::fragmentPacket(), and nfd::face::GenericLinkService::GenericLinkService().
|
inline |
add a FIELD with value
std::length_error | if field already exists and is not repeatable |
Definition at line 156 of file packet.hpp.
References ndn::Block::insert().
Referenced by ndn::util::addFieldFromTag(), face::Face::Impl::asyncExpressInterest(), ndn::util::DummyClientFace::receive< lp::Nack >(), nfd::face::LpFragmenter::fragmentPacket(), nfd::face::GenericLinkService::GenericLinkService(), and ndn::Face::put().
|
inline |
remove the index-th occurrence of FIELD
std::out_of_range | if index>=count() |
Definition at line 183 of file packet.hpp.
References count().
Referenced by clear().
|
inline |