#include <packet.hpp>
Classes | |
class | Error |
Public Member Functions | |
Packet () | |
Packet (const Block &wire) | |
Block | wireEncode () const |
encode packet into wire format More... | |
void | wireDecode (const Block &wire) |
decode packet from wire format More... | |
bool | empty () const |
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 120 of file packet.cpp.
|
explicit |
Definition at line 125 of file packet.cpp.
References wireDecode().
Block ndn::lp::Packet::wireEncode | ( | ) | const |
encode packet into wire format
Definition at line 131 of file packet.cpp.
References ndn::Block::elements(), and ndn::Block::encode().
Referenced by nfd::face::LpFragmenter::fragmentPacket(), and nfd::face::LpReliability::piggyback().
void ndn::lp::Packet::wireDecode | ( | const Block & | wire | ) |
decode packet from wire format
Error | unknown TLV-TYPE |
Definition at line 145 of file packet.cpp.
References ndn::Block::begin(), ndn::tlv::Data, ndn::Block::elements(), ndn::Block::end(), ndn::tlv::Interest, ndn::lp::tlv::LpPacket, ndn::Block::parse(), ndn::to_string(), and ndn::Block::type().
Referenced by Packet().
|
inline |
true | packet has no field |
false | packet has one or more fields |
Definition at line 66 of file packet.hpp.
References ndn::Block::elements_size().
|
inline |
This is equivalent to count() > 0
Definition at line 78 of file packet.hpp.
Referenced by ndn::addTagFromField(), ndn::extractLpLocalFields(), nfd::face::LpFragmenter::fragmentPacket(), ns3::ndn::BlockHeader::Print(), nfd::face::LpReliability::processIncomingPacket(), and nfd::face::LpReassembler::receiveFragment().
|
inline |
Definition at line 88 of file packet.hpp.
References ndn::Block::elements_begin(), and ndn::Block::elements_end().
|
inline |
std::out_of_range | if index>=count() |
Definition at line 101 of file packet.hpp.
References count(), and ndn::Block::elements().
Referenced by ndn::addTagFromField(), ndn::extractLpLocalFields(), nfd::face::LpFragmenter::fragmentPacket(), ns3::ndn::BlockHeader::Print(), nfd::face::LpReliability::processIncomingPacket(), and nfd::face::LpReassembler::receiveFragment().
|
inline |
Definition at line 121 of file packet.hpp.
References ndn::Block::elements().
Referenced by nfd::face::LpReliability::processIncomingPacket().
|
inline |
remove all occurrences of FIELD, and add a FIELD with value
This equivalent to clear() followed by add(value)
Definition at line 141 of file packet.hpp.
Referenced by nfd::face::LpFragmenter::fragmentPacket().
|
inline |
add a FIELD with value
std::length_error | if field already exists and is not repeatable |
Definition at line 153 of file packet.hpp.
References ndn::Block::elements_begin(), ndn::Block::elements_end(), and ndn::Block::insert().
Referenced by ndn::addFieldFromTag(), face::Face::Impl::asyncPutNack(), nfd::face::LpFragmenter::fragmentPacket(), nfd::face::LpReliability::piggyback(), and ndn::util::DummyClientFace::receive().
|
inline |
remove the index-th occurrence of FIELD
std::out_of_range | if index>=count() |
Definition at line 178 of file packet.hpp.
References count(), ndn::Block::elements_begin(), ndn::Block::elements_end(), and ndn::Block::erase().
|
inline |
remove all occurrences of FIELD
Definition at line 199 of file packet.hpp.
References ndn::Block::remove().