Namespace defining NDN-TLV related constants and procedures. More...
Namespaces | |
detail | |
nfd | |
security | |
Classes | |
class | Error |
represents an error in TLV encoding or decoding More... | |
Functions | |
std::ostream & | operator<< (std::ostream &os, const SignatureTypeValue &signatureType) |
template<typename Iterator > | |
bool | readVarNumber (Iterator &begin, const Iterator &end, uint64_t &number) |
Read VAR-NUMBER in NDN-TLV encoding. More... | |
template<typename Iterator > | |
bool | readType (Iterator &begin, const Iterator &end, uint32_t &type) |
Read TLV-TYPE. More... | |
template<typename Iterator > | |
uint64_t | readVarNumber (Iterator &begin, const Iterator &end) |
Read VAR-NUMBER in NDN-TLV encoding. More... | |
template<typename Iterator > | |
uint32_t | readType (Iterator &begin, const Iterator &end) |
Read TLV Type. More... | |
constexpr size_t | sizeOfVarNumber (uint64_t number) |
Get number of bytes necessary to hold value of VAR-NUMBER. More... | |
size_t | writeVarNumber (std::ostream &os, uint64_t number) |
Write VAR-NUMBER to the specified stream. More... | |
template<typename Iterator > | |
uint64_t | readNonNegativeInteger (size_t size, Iterator &begin, const Iterator &end) |
Read nonNegativeInteger in NDN-TLV encoding. More... | |
constexpr size_t | sizeOfNonNegativeInteger (uint64_t integer) |
Get number of bytes necessary to hold value of nonNegativeInteger. More... | |
size_t | writeNonNegativeInteger (std::ostream &os, uint64_t integer) |
Write nonNegativeInteger to the specified stream. More... | |
Namespace defining NDN-TLV related constants and procedures.
anonymous enum |
TLV-TYPE numbers defined in NDN Packet Format.
anonymous enum |
TLV-TYPE numbers for SignatureInfo features.
Enumerator | |
---|---|
ValidityPeriod | |
NotBefore | |
NotAfter | |
AdditionalDescription | |
DescriptionEntry | |
DescriptionKey | |
DescriptionValue |
indicates a possible value of ContentType field
std::ostream & ndn::tlv::operator<< | ( | std::ostream & | os, |
const SignatureTypeValue & | signatureType | ||
) |
Definition at line 28 of file tlv.cpp.
References DigestSha256, SignatureSha256WithEcdsa, and SignatureSha256WithRsa.
bool ndn::tlv::readVarNumber | ( | Iterator & | begin, |
const Iterator & | end, | ||
uint64_t & | number | ||
) |
Read VAR-NUMBER in NDN-TLV encoding.
Iterator | an iterator or pointer whose value is assignable to uint8_t |
[in,out] | begin | Begin of the buffer, will be incremented to point to the first byte after the read VAR-NUMBER |
[in] | end | End of the buffer |
[out] | number | Read VAR-NUMBER |
Definition at line 356 of file tlv.hpp.
Referenced by ndn::Block::Block(), ndn::Block::fromBuffer(), ndn::Block::fromStream(), ndn::Block::parse(), readType(), and readVarNumber().
bool ndn::tlv::readType | ( | Iterator & | begin, |
const Iterator & | end, | ||
uint32_t & | type | ||
) |
Read TLV-TYPE.
Iterator | an iterator or pointer whose value is assignable to uint8_t |
[in,out] | begin | Begin of the buffer, will be incremented to point to the first byte after the read TLV-TYPE |
[in] | end | End of the buffer |
[out] | type | Read TLV-TYPE |
Definition at line 375 of file tlv.hpp.
References readVarNumber().
Referenced by ndn::Block::Block(), ndn::Block::fromBuffer(), ndn::Block::fromStream(), and ndn::Block::parse().
uint64_t ndn::tlv::readVarNumber | ( | Iterator & | begin, |
const Iterator & | end | ||
) |
Read VAR-NUMBER in NDN-TLV encoding.
Iterator | an iterator or pointer whose value is assignable to uint8_t |
[in,out] | begin | Begin of the buffer, will be incremented to point to the first byte after the read VAR-NUMBER |
[in] | end | End of the buffer |
tlv::Error | VAR-NUMBER cannot be read |
Definition at line 389 of file tlv.hpp.
References ndn::tlv::Error::Error(), and readVarNumber().
uint32_t ndn::tlv::readType | ( | Iterator & | begin, |
const Iterator & | end | ||
) |
Read TLV Type.
Iterator | an iterator or pointer whose value is assignable to uint8_t |
[in,out] | begin | Begin of the buffer, will be incremented to point to the first byte after the read TLV-TYPE |
[in] | end | End of the buffer |
tlv::Error | VAR-NUMBER cannot be read |
Definition at line 405 of file tlv.hpp.
References ndn::tlv::Error::Error(), and readVarNumber().
constexpr size_t ndn::tlv::sizeOfVarNumber | ( | uint64_t | number | ) |
Get number of bytes necessary to hold value of VAR-NUMBER.
Definition at line 416 of file tlv.hpp.
Referenced by ndn::Block::Block(), ndn::Block::fromStream(), and nfd::face::LpReliability::piggyback().
|
inline |
uint64_t ndn::tlv::readNonNegativeInteger | ( | size_t | size, |
Iterator & | begin, | ||
const Iterator & | end | ||
) |
Read nonNegativeInteger in NDN-TLV encoding.
Iterator | an iterator or pointer whose value is assignable to uint8_t |
[in] | size | size of the nonNegativeInteger |
[in,out] | begin | Begin of the buffer, will be incremented to point to the first byte after the read nonNegativeInteger |
[in] | end | End of the buffer |
tlv::Error | number cannot be read |
size
, which can be either 1, 2, 4, or 8. If size
differs from std::distance(begin, end)
, tlv::Error exception will be thrown. Definition at line 452 of file tlv.hpp.
References ndn::tlv::Error::Error().
Referenced by ndn::encoding::readNonNegativeInteger(), and ndn::name::Component::toNumberWithMarker().
constexpr size_t ndn::tlv::sizeOfNonNegativeInteger | ( | uint64_t | integer | ) |
Get number of bytes necessary to hold value of nonNegativeInteger.
Definition at line 469 of file tlv.hpp.
Referenced by nfd::face::LpReliability::piggyback().