Class representing a wire element of NDN-TLV packet format. More...
#include <block.hpp>
Classes | |
class | Error |
Public Types | |
typedef std::vector< Block > | element_container |
typedef element_container::iterator | element_iterator |
typedef element_container::const_iterator | element_const_iterator |
Public Member Functions | |
Block () | |
Create an empty Block. More... | |
Block (const EncodingBuffer &buffer) | |
Create a Block based on EncodingBuffer object. More... | |
Block (const ConstBufferPtr &buffer) | |
Create a Block from the raw buffer with Type-Length parsing. More... | |
Block (const ConstBufferPtr &buffer, const Buffer::const_iterator &begin, const Buffer::const_iterator &end, bool verifyLength=true) | |
Create a Block from a buffer, directly specifying boundaries of the block within the buffer. More... | |
Block (const Block &block, const Buffer::const_iterator &begin, const Buffer::const_iterator &end, bool verifyLength=true) | |
Create a Block from existing block (reusing the underlying buffer), directly specifying boundaries of the block within the buffer. More... | |
Block (const uint8_t *buffer, size_t maxlength) | |
Create a Block from the raw buffer with Type-Length parsing. More... | |
Block (const void *buffer, size_t maxlength) | |
Create a Block from the raw buffer with Type-Length parsing. More... | |
Block (const ConstBufferPtr &wire, uint32_t type, const Buffer::const_iterator &begin, const Buffer::const_iterator &end, const Buffer::const_iterator &valueBegin, const Buffer::const_iterator &valueEnd) | |
Create a Block from the wire buffer (no parsing) More... | |
Block (uint32_t type) | |
Create Block of a specific type with empty wire buffer. More... | |
Block (uint32_t type, const ConstBufferPtr &value) | |
Create a Block of a specific type with the specified value. More... | |
Block (uint32_t type, const Block &value) | |
Create a nested Block of a specific type with the specified value. More... | |
bool | empty () const |
Check if the Block is empty. More... | |
bool | hasWire () const |
Check if the Block has fully encoded wire. More... | |
void | reset () |
Reset wire buffer of the element. More... | |
void | resetWire () |
Reset wire buffer but keep sub elements (if any) More... | |
Buffer::const_iterator | begin () const |
Buffer::const_iterator | end () const |
const uint8_t * | wire () const |
size_t | size () const |
uint32_t | type () const |
bool | hasValue () const |
Check if the Block has value block (no type and length are encoded) More... | |
Buffer::const_iterator | value_begin () const |
Buffer::const_iterator | value_end () const |
const uint8_t * | value () const |
size_t | value_size () const |
void | parse () const |
Parse wire buffer into subblocks. More... | |
void | encode () |
Encode subblocks into wire buffer. More... | |
const Block & | get (uint32_t type) const |
Get the first subelement of the requested type. More... | |
element_const_iterator | find (uint32_t type) const |
void | remove (uint32_t type) |
remove all subelements of type More... | |
element_iterator | erase (element_const_iterator position) |
element_iterator | erase (element_const_iterator first, element_const_iterator last) |
void | push_back (const Block &element) |
element_iterator | insert (element_const_iterator pos, const Block &element) |
insert Insert a new element in a specific position More... | |
const element_container & | elements () const |
Get all subelements. More... | |
element_const_iterator | elements_begin () const |
element_const_iterator | elements_end () const |
size_t | elements_size () const |
Block | blockFromValue () const |
shared_ptr< const Buffer > | getBuffer () const |
Get underlying buffer. More... | |
bool | operator== (const Block &other) const |
bool | operator!= (const Block &other) const |
operator boost::asio::const_buffer () const | |
Static Public Member Functions | |
static Block | fromStream (std::istream &is) |
Create a Block from an input stream. More... | |
static std::tuple< bool, Block > | fromBuffer (ConstBufferPtr buffer, size_t offset) |
Try to construct block from Buffer. More... | |
static std::tuple< bool, Block > | fromBuffer (const uint8_t *buffer, size_t maxSize) |
Try to construct block from raw buffer. More... | |
Protected Attributes | |
shared_ptr< const Buffer > | m_buffer |
uint32_t | m_type |
Buffer::const_iterator | m_begin |
Buffer::const_iterator | m_end |
uint32_t | m_size |
Buffer::const_iterator | m_value_begin |
Buffer::const_iterator | m_value_end |
element_container | m_subBlocks |
Class representing a wire element of NDN-TLV packet format.
typedef std::vector<Block> ndn::Block::element_container |
typedef element_container::iterator ndn::Block::element_iterator |
typedef element_container::const_iterator ndn::Block::element_const_iterator |
ndn::Block::Block | ( | ) |
Create an empty Block.
Definition at line 48 of file block.cpp.
Referenced by blockFromValue(), fromBuffer(), ndn::name::Component::fromImplicitSha256Digest(), and parse().
|
explicit |
Create a Block based on EncodingBuffer object.
Definition at line 53 of file block.cpp.
References m_begin, m_end, m_type, m_value_begin, m_value_end, ndn::tlv::readType(), and ndn::tlv::readVarNumber().
|
explicit |
Create a Block from the raw buffer with Type-Length parsing.
Definition at line 84 of file block.cpp.
References m_begin, m_end, m_type, m_value_begin, m_value_end, ndn::tlv::readType(), and ndn::tlv::readVarNumber().
ndn::Block::Block | ( | const ConstBufferPtr & | buffer, |
const Buffer::const_iterator & | begin, | ||
const Buffer::const_iterator & | end, | ||
bool | verifyLength = true |
||
) |
Create a Block from a buffer, directly specifying boundaries of the block within the buffer.
This overload will automatically detect type and position of the value within the block
Definition at line 102 of file block.cpp.
References m_begin, m_end, m_type, m_value_begin, m_value_end, ndn::tlv::readType(), and ndn::tlv::readVarNumber().
ndn::Block::Block | ( | const Block & | block, |
const Buffer::const_iterator & | begin, | ||
const Buffer::const_iterator & | end, | ||
bool | verifyLength = true |
||
) |
Create a Block from existing block (reusing the underlying buffer), directly specifying boundaries of the block within the buffer.
This overload will automatically detect type and position of the value within the block
Definition at line 122 of file block.cpp.
References m_begin, m_buffer, m_end, m_type, m_value_begin, m_value_end, ndn::tlv::readType(), and ndn::tlv::readVarNumber().
ndn::Block::Block | ( | const uint8_t * | buffer, |
size_t | maxlength | ||
) |
Create a Block from the raw buffer with Type-Length parsing.
Definition at line 147 of file block.cpp.
References m_begin, m_buffer, m_end, m_size, m_type, m_value_begin, m_value_end, ndn::tlv::readType(), and ndn::tlv::readVarNumber().
ndn::Block::Block | ( | const void * | buffer, |
size_t | maxlength | ||
) |
Create a Block from the raw buffer with Type-Length parsing.
Definition at line 170 of file block.cpp.
References m_begin, m_buffer, m_end, m_size, m_type, m_value_begin, m_value_end, ndn::tlv::readType(), and ndn::tlv::readVarNumber().
ndn::Block::Block | ( | const ConstBufferPtr & | wire, |
uint32_t | type, | ||
const Buffer::const_iterator & | begin, | ||
const Buffer::const_iterator & | end, | ||
const Buffer::const_iterator & | valueBegin, | ||
const Buffer::const_iterator & | valueEnd | ||
) |
|
explicit |
ndn::Block::Block | ( | uint32_t | type, |
const ConstBufferPtr & | value | ||
) |
Create a Block of a specific type with the specified value.
The underlying buffer holds only value Additional operations are needed to construct wire encoding, one need to prepend the wire buffer with type and value-length VAR-NUMBERs
Definition at line 200 of file block.cpp.
References m_size, m_type, ndn::tlv::sizeOfVarNumber(), and value_size().
ndn::Block::Block | ( | uint32_t | type, |
const Block & | value | ||
) |
Create a nested Block of a specific type with the specified value.
The underlying buffer holds only value. Additional operations are needed to construct wire encoding, one need to prepend the wire buffer with type and value-length VAR-NUMBERs
Definition at line 211 of file block.cpp.
References m_size, m_type, ndn::tlv::sizeOfVarNumber(), and value_size().
|
static |
Create a Block from an input stream.
Definition at line 223 of file block.cpp.
References begin(), end(), ndn::encoding::makeBinaryBlock(), ndn::encoding::makeEmptyBlock(), ndn::MAX_SIZE_OF_BLOCK_FROM_STREAM, ndn::tlv::readType(), ndn::tlv::readVarNumber(), and type().
Referenced by ns3::ndn::BlockHeader::Deserialize().
|
static |
Try to construct block from Buffer.
buffer | the buffer to construct block from |
offset | offset from beginning of buffer to construct Block from |
This method does not throw upon decoding error. This method does not copy the bytes.
Definition at line 253 of file block.cpp.
References Block(), ndn::tlv::readType(), ndn::tlv::readVarNumber(), and type().
Referenced by nfd::face::EthernetTransport::doClose(), ndn::nfd::parseDatasetVector(), ndn::StreamTransportImpl< BaseTransport, Protocol >::processAllReceived(), and nfd::face::WebSocketTransport::receiveMessage().
|
static |
Try to construct block from raw buffer.
buffer | the raw buffer to copy bytes from |
maxSize | the maximum size of constructed block; buffer must have a size of at least maxSize |
This method does not throw upon decoding error. This method copies the bytes into a new Buffer.
Definition at line 276 of file block.cpp.
References Block(), ndn::tlv::readType(), ndn::tlv::readVarNumber(), and type().
bool ndn::Block::empty | ( | ) | const |
Check if the Block is empty.
Definition at line 465 of file block.cpp.
References m_type.
Referenced by ndn::Data::getContent().
bool ndn::Block::hasWire | ( | ) | const |
Check if the Block has fully encoded wire.
Definition at line 471 of file block.cpp.
References m_begin, m_buffer, and m_end.
Referenced by ndn::encoding::Encoder::appendBlock(), begin(), ndn::name::Component::compare(), ndn::security::v1::PublicKey::computeDigest(), encode(), end(), ndn::Data::getContent(), ndn::Data::getFullName(), ndn::Interest::getNonce(), ndn::Interest::hasLink(), ndn::encoding::Encoder::prependBlock(), ndn::encoding::Estimator::prependBlock(), ndn::Interest::setLink(), ndn::Interest::setNonce(), size(), wire(), ndn::security::v2::AdditionalDescription::wireDecode(), ndn::security::ValidityPeriod::wireDecode(), ndn::SignatureInfo::wireDecode(), ndn::lp::Packet::wireEncode(), ndn::nfd::FaceStatus::wireEncode(), ndn::nfd::ChannelStatus::wireEncode(), ndn::nfd::StrategyChoice::wireEncode(), ndn::nfd::FaceEventNotification::wireEncode(), ndn::nfd::FaceQueryFilter::wireEncode(), ndn::lp::NackHeader::wireEncode(), ndn::nfd::ForwarderStatus::wireEncode(), ndn::Selectors::wireEncode(), ndn::mgmt::ControlResponse::wireEncode(), ndn::nfd::NextHopRecord::wireEncode(), ndn::lp::CachePolicy::wireEncode(), ndn::MetaInfo::wireEncode(), ndn::KeyLocator::wireEncode(), ndn::Interest::wireEncode(), ndn::security::v2::AdditionalDescription::wireEncode(), ndn::nfd::ControlParameters::wireEncode(), ndn::security::ValidityPeriod::wireEncode(), ndn::Data::wireEncode(), ndn::Name::wireEncode(), ndn::SignatureInfo::wireEncode(), ndn::nfd::FibEntry::wireEncode(), ndn::name::Component::wireEncode(), ndn::nfd::Route::wireEncode(), and ndn::nfd::RibEntry::wireEncode().
void ndn::Block::reset | ( | ) |
Reset wire buffer of the element.
Definition at line 302 of file block.cpp.
References m_begin, m_buffer, m_end, m_subBlocks, m_type, m_value_begin, and m_value_end.
Referenced by ndn::MetaInfo::addAppMetaInfo(), ndn::nfd::FibEntry::addNextHopRecord(), ndn::SignatureInfo::appendTypeSpecificTlv(), ndn::KeyLocator::clear(), ndn::Data::onChanged(), ndn::MetaInfo::removeAppMetaInfo(), ndn::MetaInfo::setAppMetaInfo(), ndn::mgmt::ControlResponse::setBody(), ndn::Selectors::setChildSelector(), ndn::mgmt::ControlResponse::setCode(), ndn::nfd::NextHopRecord::setCost(), ndn::nfd::ForwarderStatus::setCurrentTimestamp(), ndn::Selectors::setExclude(), ndn::nfd::FaceStatus::setExpirationPeriod(), ndn::nfd::NextHopRecord::setFaceId(), ndn::nfd::FaceQueryFilter::setFaceId(), ndn::nfd::FaceQueryFilter::setFacePersistency(), ndn::nfd::FaceQueryFilter::setFaceScope(), ndn::MetaInfo::setFinalBlockId(), ndn::MetaInfo::setFreshnessPeriod(), ndn::SignatureInfo::setKeyLocator(), ndn::nfd::FaceEventNotification::setKind(), ndn::Interest::setLink(), ndn::nfd::FaceQueryFilter::setLinkType(), ndn::nfd::ChannelStatus::setLocalUri(), ndn::nfd::FaceQueryFilter::setLocalUri(), ndn::Selectors::setMaxSuffixComponents(), ndn::Selectors::setMinSuffixComponents(), ndn::Selectors::setMustBeFresh(), ndn::nfd::StrategyChoice::setName(), ndn::nfd::ForwarderStatus::setNCsEntries(), ndn::nfd::ForwarderStatus::setNfdVersion(), ndn::nfd::ForwarderStatus::setNFibEntries(), ndn::nfd::FaceStatus::setNInBytes(), ndn::nfd::FaceStatus::setNInDatas(), ndn::nfd::ForwarderStatus::setNInDatas(), ndn::nfd::FaceStatus::setNInInterests(), ndn::nfd::ForwarderStatus::setNInInterests(), ndn::nfd::FaceStatus::setNInNacks(), ndn::nfd::ForwarderStatus::setNInNacks(), ndn::nfd::ForwarderStatus::setNMeasurementsEntries(), ndn::nfd::ForwarderStatus::setNNameTreeEntries(), ndn::Interest::setNonce(), ndn::nfd::FaceStatus::setNOutBytes(), ndn::nfd::FaceStatus::setNOutDatas(), ndn::nfd::ForwarderStatus::setNOutDatas(), ndn::nfd::FaceStatus::setNOutInterests(), ndn::nfd::ForwarderStatus::setNOutInterests(), ndn::nfd::FaceStatus::setNOutNacks(), ndn::nfd::ForwarderStatus::setNOutNacks(), ndn::nfd::ForwarderStatus::setNPitEntries(), ndn::security::ValidityPeriod::setPeriod(), ndn::lp::CachePolicy::setPolicy(), ndn::nfd::FibEntry::setPrefix(), ndn::Selectors::setPublisherPublicKeyLocator(), ndn::lp::NackHeader::setReason(), ndn::nfd::FaceQueryFilter::setRemoteUri(), ndn::Interest::setSelectedDelegation(), ndn::SignatureInfo::setSignatureType(), ndn::nfd::ForwarderStatus::setStartTimestamp(), ndn::nfd::StrategyChoice::setStrategy(), ndn::mgmt::ControlResponse::setText(), ndn::MetaInfo::setType(), ndn::nfd::FaceQueryFilter::setUriScheme(), ndn::nfd::FaceQueryFilter::unsetFaceId(), ndn::nfd::FaceQueryFilter::unsetFacePersistency(), ndn::nfd::FaceQueryFilter::unsetFaceScope(), ndn::SignatureInfo::unsetKeyLocator(), ndn::Interest::unsetLink(), ndn::nfd::FaceQueryFilter::unsetLinkType(), ndn::nfd::FaceQueryFilter::unsetLocalUri(), ndn::nfd::FaceQueryFilter::unsetRemoteUri(), ndn::Interest::unsetSelectedDelegation(), ndn::nfd::FaceQueryFilter::unsetUriScheme(), ndn::SignatureInfo::unsetValidityPeriod(), ndn::nfd::FaceEventNotification::wireReset(), and ndn::nfd::FaceStatus::wireReset().
void ndn::Block::resetWire | ( | ) |
Reset wire buffer but keep sub elements (if any)
Definition at line 312 of file block.cpp.
References m_begin, m_buffer, m_end, m_value_begin, and m_value_end.
Referenced by ndn::Name::deepCopy(), erase(), insert(), push_back(), and remove().
Buffer::const_iterator ndn::Block::begin | ( | ) | const |
Definition at line 477 of file block.cpp.
References hasWire(), and m_begin.
Referenced by blockFromValue(), fromStream(), operator==(), parse(), ndn::Face::put(), and ndn::lp::Packet::wireDecode().
Buffer::const_iterator ndn::Block::end | ( | ) | const |
Definition at line 486 of file block.cpp.
References hasWire(), and m_end.
Referenced by blockFromValue(), ndn::RegexTopMatcher::expand(), fromStream(), operator==(), parse(), ndn::Face::put(), and ndn::lp::Packet::wireDecode().
const uint8_t * ndn::Block::wire | ( | ) | const |
Definition at line 495 of file block.cpp.
References hasWire(), and m_begin.
Referenced by nfd::DeadNonceList::add(), ndn::mgmt::StatusDatasetContext::append(), ndn::encoding::Encoder::appendBlock(), ndn::util::Sqlite3Statement::bind(), ndn::name::Component::compare(), nfd::name_tree::computeHash(), ndn::name::Component::Error::Error(), ndn::Data::getFullName(), ndn::security::Identity::getName(), operator boost::asio::const_buffer(), ndn::util::Digest< Hash >::operator<<(), ndn::encoding::Encoder::prependBlock(), ndn::io::saveBlock(), ndn::util::DummyClientFace::Transport::send(), nfd::face::InternalClientTransport::send(), and ndn::name::Component::wireDecode().
size_t ndn::Block::size | ( | ) | const |
Definition at line 504 of file block.cpp.
References hasValue(), hasWire(), and m_size.
Referenced by nfd::DeadNonceList::add(), ndn::mgmt::StatusDatasetContext::append(), ndn::encoding::Encoder::appendBlock(), ndn::util::Sqlite3Statement::bind(), ndn::WireEncodable< X >::BOOST_CONCEPT_USAGE(), ndn::name::Component::compare(), nfd::name_tree::computeHash(), nfd::face::EthernetTransport::doClose(), ndn::name::Component::fromEscapedString(), ndn::Data::getFullName(), ndn::security::Identity::getName(), ndn::name::Component::getSuccessor(), nfd::face::StreamTransport< boost::asio::local::stream_protocol >::handleReceive(), operator boost::asio::const_buffer(), ndn::util::Digest< Hash >::operator<<(), operator==(), ndn::nfd::parseDatasetVector(), ndn::encoding::Encoder::prependBlock(), ndn::encoding::Estimator::prependBlock(), ndn::StreamTransportImpl< BaseTransport, Protocol >::processAllReceived(), ndn::Face::put(), nfd::face::DatagramTransport< boost::asio::ip::udp, Multicast >::receiveDatagram(), ndn::io::saveBlock(), ndn::util::DummyClientFace::Transport::send(), nfd::face::InternalClientTransport::send(), ndn::security::Validator::verifySignature(), ndn::lp::Packet::wireEncode(), and ndn::Data::wireEncode().
|
inline |
Definition at line 324 of file block.hpp.
Referenced by ndn::MetaInfo::addAppMetaInfo(), ndn::Name::append(), ndn::encoding::Encoder::appendBlock(), blockFromValue(), ndn::name::Component::compare(), ndn::lp::detail::DecodeHelper< TlvType, std::pair< Buffer::const_iterator, Buffer::const_iterator > >::decode(), ndn::lp::detail::FieldDecl< LOCATION, VALUE, TYPE, REPEATABLE >::decode(), encode(), ndn::name::Component::equals(), find(), nfd::face::LpFragmenter::fragmentPacket(), fromBuffer(), fromStream(), nfd::face::GenericLinkService::GenericLinkService(), ndn::Link::getDelegationFromWire(), ndn::name::Component::getSuccessor(), ndn::name::Component::isGeneric(), ndn::name::Component::isImplicitSha256Digest(), parse(), ndn::encoding::Encoder::prependBlock(), ndn::encoding::Estimator::prependBlock(), remove(), ndn::Data::setContent(), ndn::KeyLocator::setKeyDigest(), ndn::Signature::setValue(), ndn::name::Component::toUri(), ndn::nfd::FaceStatus::wireDecode(), ndn::nfd::ChannelStatus::wireDecode(), ndn::nfd::StrategyChoice::wireDecode(), ndn::lp::Packet::wireDecode(), ndn::lp::NackHeader::wireDecode(), ndn::nfd::FaceEventNotification::wireDecode(), ndn::nfd::FaceQueryFilter::wireDecode(), ndn::mgmt::ControlResponse::wireDecode(), ndn::nfd::ForwarderStatus::wireDecode(), ndn::Selectors::wireDecode(), ndn::nfd::NextHopRecord::wireDecode(), ndn::Exclude::wireDecode(), ndn::MetaInfo::wireDecode(), ndn::lp::CachePolicy::wireDecode(), ndn::security::SafeBag::wireDecode(), ndn::KeyLocator::wireDecode(), ndn::Interest::wireDecode(), ndn::nfd::ControlParameters::wireDecode(), ndn::security::v2::AdditionalDescription::wireDecode(), ndn::security::ValidityPeriod::wireDecode(), ndn::Name::wireDecode(), ndn::SignatureInfo::wireDecode(), ndn::nfd::FibEntry::wireDecode(), ndn::nfd::Route::wireDecode(), ndn::nfd::RibEntry::wireDecode(), and ndn::name::Component::wireEncode().
bool ndn::Block::hasValue | ( | ) | const |
|
inline |
Definition at line 330 of file block.hpp.
Referenced by blockFromValue(), ndn::lp::detail::DecodeHelper< TlvType, std::pair< Buffer::const_iterator, Buffer::const_iterator > >::decode(), ndn::name::Component::equals(), parse(), ndn::encoding::readNonNegativeInteger(), and ndn::name::Component::toNumberWithMarker().
|
inline |
Definition at line 336 of file block.hpp.
Referenced by blockFromValue(), ndn::lp::detail::DecodeHelper< TlvType, std::pair< Buffer::const_iterator, Buffer::const_iterator > >::decode(), ndn::name::Component::equals(), parse(), ndn::encoding::readNonNegativeInteger(), and ndn::name::Component::toNumberWithMarker().
const uint8_t * ndn::Block::value | ( | ) | const |
Definition at line 520 of file block.cpp.
References hasValue(), and m_value_begin.
Referenced by ndn::encoding::Encoder::appendBlock(), ndn::name::Component::compare(), encode(), ndn::name::Component::fromEscapedString(), ndn::name::Component::fromTimestamp(), ndn::Interest::getNonce(), ndn::name::Component::getSuccessor(), ndn::name::Component::isNumberWithMarker(), ndn::encoding::Estimator::prependBlock(), ndn::encoding::Encoder::prependBlock(), ndn::encoding::readString(), ndn::Interest::setNonce(), ndn::name::Component::toTimestamp(), ndn::name::Component::toUri(), ndn::security::Validator::verifySignature(), ndn::security::SecuredBag::wireDecode(), and ndn::name::Component::wireEncode().
size_t ndn::Block::value_size | ( | ) | const |
Definition at line 529 of file block.cpp.
References hasValue(), m_value_begin, and m_value_end.
Referenced by ndn::encoding::Encoder::appendBlock(), Block(), blockFromValue(), ndn::name::Component::compare(), ndn::lp::detail::DecodeHelper< TlvType, std::pair< Buffer::const_iterator, Buffer::const_iterator > >::decode(), ndn::name::Component::empty(), encode(), ndn::name::Component::equals(), ndn::Interest::getNonce(), ndn::name::Component::getSuccessor(), ndn::name::Component::isImplicitSha256Digest(), ndn::name::Component::isNumber(), ndn::name::Component::isNumberWithMarker(), ndn::operator<<(), parse(), ndn::encoding::Encoder::prependBlock(), ndn::encoding::Estimator::prependBlock(), ndn::encoding::readNonNegativeInteger(), ndn::encoding::readString(), ndn::Interest::setNonce(), ndn::name::Component::toNumberWithMarker(), ndn::name::Component::toUri(), ndn::security::Validator::verifySignature(), ndn::security::SecuredBag::wireDecode(), and ndn::name::Component::wireEncode().
void ndn::Block::parse | ( | ) | const |
Parse wire buffer into subblocks.
This method is not really const, but it does not modify any data. It simply parses contents of the buffer into subblocks
Definition at line 322 of file block.cpp.
References begin(), Block(), end(), m_buffer, m_subBlocks, ndn::tlv::readType(), ndn::tlv::readVarNumber(), type(), value_begin(), value_end(), and value_size().
Referenced by ndn::Link::countDelegationsFromWire(), ndn::Link::decodeContent(), ndn::Link::findDelegationFromWire(), nfd::ForwarderStatusManager::ForwarderStatusManager(), ndn::Link::getDelegationFromWire(), ndn::Name::Name(), ndn::security::SecuredBag::wireDecode(), ndn::nfd::FaceStatus::wireDecode(), ndn::nfd::ChannelStatus::wireDecode(), ndn::nfd::StrategyChoice::wireDecode(), ndn::lp::Packet::wireDecode(), ndn::nfd::FaceQueryFilter::wireDecode(), ndn::nfd::FaceEventNotification::wireDecode(), ndn::lp::NackHeader::wireDecode(), ndn::nfd::ForwarderStatus::wireDecode(), ndn::mgmt::ControlResponse::wireDecode(), ndn::Selectors::wireDecode(), ndn::nfd::NextHopRecord::wireDecode(), ndn::Exclude::wireDecode(), ndn::MetaInfo::wireDecode(), ndn::lp::CachePolicy::wireDecode(), ndn::security::SafeBag::wireDecode(), ndn::KeyLocator::wireDecode(), ndn::Interest::wireDecode(), ndn::nfd::ControlParameters::wireDecode(), ndn::security::v2::AdditionalDescription::wireDecode(), ndn::security::ValidityPeriod::wireDecode(), ndn::Name::wireDecode(), ndn::SignatureInfo::wireDecode(), ndn::Data::wireDecode(), ndn::nfd::FibEntry::wireDecode(), ndn::nfd::Route::wireDecode(), ndn::nfd::RibEntry::wireDecode(), ndn::security::v2::AdditionalDescription::wireEncode(), ndn::security::ValidityPeriod::wireEncode(), and ndn::Name::wireEncode().
void ndn::Block::encode | ( | ) |
Encode subblocks into wire buffer.
Definition at line 355 of file block.cpp.
References ndn::OBufferStream::buf(), hasValue(), hasWire(), m_begin, m_buffer, m_end, m_size, m_subBlocks, m_value_begin, m_value_end, ndn::tlv::readType(), ndn::tlv::readVarNumber(), type(), value(), value_size(), and ndn::tlv::writeVarNumber().
Referenced by ndn::security::v1::PublicKey::computeDigest(), ndn::Data::getContent(), ndn::security::KeyChain::getDefaultKeyParamsForIdentity(), ndn::Signature::getValue(), ndn::util::DummyClientFace::Transport::receive(), ndn::mgmt::ControlResponse::setBody(), ndn::security::KeyChain::signWithSha256(), ndn::security::SecuredBag::wireEncode(), and ndn::mgmt::ControlResponse::wireEncode().
const Block & ndn::Block::get | ( | uint32_t | type | ) | const |
Get the first subelement of the requested type.
Definition at line 409 of file block.cpp.
References find(), and m_subBlocks.
Referenced by ndn::Link::countDelegationsFromWire(), ndn::util::SegmentFetcher::fetch(), ndn::Link::findDelegationFromWire(), ndn::Link::getDelegationFromWire(), ndn::security::SecuredBag::wireDecode(), ndn::Interest::wireDecode(), and ndn::Data::wireDecode().
Block::element_const_iterator ndn::Block::find | ( | uint32_t | type | ) | const |
Definition at line 420 of file block.cpp.
References m_subBlocks, and type().
Referenced by get(), ndn::Interest::matchesData(), ndn::Selectors::wireDecode(), ndn::Interest::wireDecode(), ndn::nfd::ControlParameters::wireDecode(), and ndn::Data::wireDecode().
void ndn::Block::remove | ( | uint32_t | type | ) |
remove all subelements of type
type | TLV-TYPE of subelements to remove |
Definition at line 427 of file block.cpp.
References m_subBlocks, resetWire(), and type().
Block::element_iterator ndn::Block::erase | ( | Block::element_const_iterator | position | ) |
Definition at line 538 of file block.cpp.
References m_subBlocks, and resetWire().
Block::element_iterator ndn::Block::erase | ( | Block::element_const_iterator | first, |
Block::element_const_iterator | last | ||
) |
Definition at line 552 of file block.cpp.
References m_subBlocks, and resetWire().
void ndn::Block::push_back | ( | const Block & | element | ) |
Definition at line 568 of file block.cpp.
References m_subBlocks, and resetWire().
Referenced by ndn::Name::appendImplicitSha256Digest(), ndn::Name::appendNumber(), ndn::Name::appendNumberWithMarker(), ndn::Name::appendSegment(), ndn::Name::appendSegmentOffset(), ndn::Name::appendSequenceNumber(), ndn::Name::appendTimestamp(), ndn::Name::appendVersion(), ndn::security::SecuredBag::SecuredBag(), and ndn::mgmt::ControlResponse::wireEncode().
Block::element_iterator ndn::Block::insert | ( | Block::element_const_iterator | pos, |
const Block & | element | ||
) |
insert Insert a new element in a specific position
pos | Position to insert the new element |
element | Element to be inserted |
Definition at line 575 of file block.cpp.
References m_subBlocks, and resetWire().
Referenced by ndn::lp::Packet::add().
|
inline |
Get all subelements.
Definition at line 342 of file block.hpp.
Referenced by ndn::Link::decodeContent(), ndn::Link::findDelegationFromWire(), nfd::ForwarderStatusManager::ForwarderStatusManager(), nfd::face::LpFragmenter::fragmentPacket(), ndn::lp::Packet::get(), ndn::Link::getDelegationFromWire(), ndn::lp::Packet::list(), ndn::lp::Packet::wireDecode(), ndn::MetaInfo::wireDecode(), ndn::KeyLocator::wireDecode(), ndn::security::v2::AdditionalDescription::wireDecode(), ndn::security::ValidityPeriod::wireDecode(), and ndn::lp::Packet::wireEncode().
Block::element_const_iterator ndn::Block::elements_begin | ( | ) | const |
Definition at line 589 of file block.cpp.
References m_subBlocks.
Referenced by ndn::nfd::FaceStatus::wireDecode(), ndn::nfd::ChannelStatus::wireDecode(), ndn::nfd::StrategyChoice::wireDecode(), ndn::nfd::FaceQueryFilter::wireDecode(), ndn::lp::NackHeader::wireDecode(), ndn::nfd::FaceEventNotification::wireDecode(), ndn::mgmt::ControlResponse::wireDecode(), ndn::nfd::ForwarderStatus::wireDecode(), ndn::nfd::NextHopRecord::wireDecode(), ndn::MetaInfo::wireDecode(), ndn::lp::CachePolicy::wireDecode(), ndn::security::SafeBag::wireDecode(), ndn::KeyLocator::wireDecode(), ndn::security::v2::AdditionalDescription::wireDecode(), ndn::SignatureInfo::wireDecode(), ndn::nfd::FibEntry::wireDecode(), ndn::nfd::Route::wireDecode(), and ndn::nfd::RibEntry::wireDecode().
Block::element_const_iterator ndn::Block::elements_end | ( | ) | const |
Definition at line 595 of file block.cpp.
References m_subBlocks.
Referenced by ndn::Interest::matchesData(), ndn::nfd::FaceStatus::wireDecode(), ndn::nfd::ChannelStatus::wireDecode(), ndn::nfd::StrategyChoice::wireDecode(), ndn::nfd::FaceEventNotification::wireDecode(), ndn::nfd::FaceQueryFilter::wireDecode(), ndn::nfd::ForwarderStatus::wireDecode(), ndn::mgmt::ControlResponse::wireDecode(), ndn::Selectors::wireDecode(), ndn::nfd::NextHopRecord::wireDecode(), ndn::MetaInfo::wireDecode(), ndn::lp::CachePolicy::wireDecode(), ndn::security::SafeBag::wireDecode(), ndn::Interest::wireDecode(), ndn::nfd::ControlParameters::wireDecode(), ndn::security::v2::AdditionalDescription::wireDecode(), ndn::SignatureInfo::wireDecode(), ndn::Data::wireDecode(), ndn::nfd::FibEntry::wireDecode(), ndn::nfd::Route::wireDecode(), and ndn::nfd::RibEntry::wireDecode().
size_t ndn::Block::elements_size | ( | ) | const |
Definition at line 601 of file block.cpp.
References m_subBlocks.
Referenced by ndn::Link::countDelegationsFromWire(), ndn::lp::NackHeader::wireDecode(), ndn::security::v2::AdditionalDescription::wireDecode(), and ndn::security::ValidityPeriod::wireDecode().
Block ndn::Block::blockFromValue | ( | ) | const |
Definition at line 437 of file block.cpp.
References begin(), Block(), end(), m_buffer, ndn::tlv::readType(), ndn::tlv::readVarNumber(), type(), value_begin(), value_end(), and value_size().
Referenced by ndn::nfd::Controller::Controller(), ndn::util::DummyClientFace::DummyClientFace(), nfd::ManagerBase::extractRequester(), ndn::security::SecuredBag::wireDecode(), and ndn::MetaInfo::wireDecode().
|
inline |
bool ndn::Block::operator== | ( | const Block & | other | ) | const |
bool ndn::Block::operator!= | ( | const Block & | other | ) | const |
Definition at line 607 of file block.cpp.
References operator==().
ndn::Block::operator boost::asio::const_buffer | ( | ) | const |
|
protected |
Definition at line 299 of file block.hpp.
Referenced by Block(), blockFromValue(), encode(), hasValue(), hasWire(), parse(), reset(), and resetWire().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Definition at line 307 of file block.hpp.
Referenced by Block(), encode(), reset(), resetWire(), value(), and value_size().
|
protected |
Definition at line 308 of file block.hpp.
Referenced by Block(), encode(), reset(), resetWire(), and value_size().
|
mutableprotected |
Definition at line 310 of file block.hpp.
Referenced by elements_begin(), elements_end(), elements_size(), encode(), erase(), find(), get(), insert(), parse(), push_back(), remove(), and reset().