Namespace defining NDN-TLV related constants and procedures. More...
Namespaces | |
nfd | |
security | |
Classes | |
class | Error |
represents an error in TLV encoding or decoding More... | |
Functions | |
template<class InputIterator > | |
bool | readVarNumber (InputIterator &begin, const InputIterator &end, uint64_t &number) |
Read VAR-NUMBER in NDN-TLV encoding. More... | |
template<class InputIterator > | |
bool | readType (InputIterator &begin, const InputIterator &end, uint32_t &type) |
Read TLV Type. More... | |
template<class InputIterator > | |
uint64_t | readVarNumber (InputIterator &begin, const InputIterator &end) |
Read VAR-NUMBER in NDN-TLV encoding. More... | |
template<class InputIterator > | |
uint32_t | readType (InputIterator &begin, const InputIterator &end) |
Read TLV Type. More... | |
size_t | sizeOfVarNumber (uint64_t varNumber) |
Get number of bytes necessary to hold value of VAR-NUMBER. More... | |
size_t | writeVarNumber (std::ostream &os, uint64_t varNumber) |
Write VAR-NUMBER to the specified stream. More... | |
template<class InputIterator > | |
uint64_t | readNonNegativeInteger (size_t size, InputIterator &begin, const InputIterator &end) |
Read nonNegativeInteger in NDN-TLV encoding. More... | |
size_t | sizeOfNonNegativeInteger (uint64_t varNumber) |
Get number of bytes necessary to hold value of nonNegativeInteger. More... | |
size_t | writeNonNegativeInteger (std::ostream &os, uint64_t varNumber) |
Write nonNegativeInteger to the specified stream. More... | |
template<> | |
bool | readVarNumber< std::istream_iterator< uint8_t > > (std::istream_iterator< uint8_t > &begin, const std::istream_iterator< uint8_t > &end, uint64_t &value) |
template<> | |
uint64_t | readNonNegativeInteger< std::istream_iterator< uint8_t > > (size_t size, std::istream_iterator< uint8_t > &begin, const std::istream_iterator< uint8_t > &end) |
Namespace defining NDN-TLV related constants and procedures.
anonymous enum |
anonymous enum |
TLV codes for SignatureInfo features.
Enumerator | |
---|---|
ValidityPeriod | |
NotBefore | |
NotAfter | |
AdditionalDescription | |
DescriptionEntry | |
DescriptionKey | |
DescriptionValue |
indicates a possible value of ContentType field
|
inline |
Read VAR-NUMBER in NDN-TLV encoding.
[in] | begin | Begin (pointer or iterator) of the buffer |
[in] | end | End (pointer or iterator) of the buffer |
[out] | number | Read number |
This | call never throws exception |
Definition at line 243 of file tlv.hpp.
Referenced by ndn::Block::Block(), ndn::Block::blockFromValue(), ndn::Block::encode(), ndn::Block::fromBuffer(), ndn::Block::fromStream(), ndn::Block::parse(), readType(), and readVarNumber().
|
inline |
Read TLV Type.
[in] | begin | Begin (pointer or iterator) of the buffer |
[in] | end | End (pointer or iterator) of the buffer |
[out] | type | Read type number |
This | call never throws exception |
This call is largely equivalent to tlv::readVarNumber, but exception will be thrown if type is larger than 2^32-1 (type in this library is implemented as uint32_t)
Definition at line 288 of file tlv.hpp.
References readVarNumber().
Referenced by ndn::Block::Block(), ndn::Block::blockFromValue(), ndn::Block::encode(), ndn::Block::fromBuffer(), ndn::Block::fromStream(), and ndn::Block::parse().
|
inline |
Read VAR-NUMBER in NDN-TLV encoding.
This | call will throw ndn::tlv::Error (aka std::runtime_error) if number cannot be read |
Note that after call finished, begin will point to the first byte after the read VAR-NUMBER
Definition at line 303 of file tlv.hpp.
References ndn::tlv::Error::Error(), and readVarNumber().
|
inline |
Read TLV Type.
This | call will throw ndn::tlv::Error (aka std::runtime_error) if number cannot be read |
This call is largely equivalent to tlv::readVarNumber, but exception will be thrown if type is larger than 2^32-1 (type in this library is implemented as uint32_t)
Definition at line 376 of file tlv.hpp.
References ndn::tlv::Error::Error(), and readVarNumber().
|
inline |
Get number of bytes necessary to hold value of VAR-NUMBER.
Definition at line 388 of file tlv.hpp.
Referenced by ndn::Block::Block().
|
inline |
Write VAR-NUMBER to the specified stream.
Definition at line 405 of file tlv.hpp.
Referenced by ndn::Block::encode().
|
inline |
Read nonNegativeInteger in NDN-TLV encoding.
This call will throw ndn::tlv::Error (aka std::runtime_error) if number cannot be read
Note that after call finished, begin will point to the first byte after the read VAR-NUMBER
How many bytes will be read is directly controlled by the size parameter, which can be either 1, 2, 4, or 8. If the value of size is different, then an exception will be thrown.
Definition at line 433 of file tlv.hpp.
References ndn::tlv::Error::Error().
Referenced by ndn::encoding::readNonNegativeInteger(), and ndn::name::Component::toNumberWithMarker().
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 478 of file tlv.hpp.
References ndn::tlv::Error::Error().