Namespace defining NDN Packet Format 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, SignatureTypeValue st) |
| std::ostream & | operator<< (std::ostream &os, ContentTypeValue ct) |
| constexpr bool | isCriticalType (uint32_t type) |
| Determine whether a TLV-TYPE is "critical" for evolvability purpose. More... | |
| template<typename Iterator > | |
| NDN_CXX_NODISCARD bool | readVarNumber (Iterator &begin, Iterator end, uint64_t &number) noexcept |
| Read VAR-NUMBER in NDN-TLV encoding. More... | |
| template<typename Iterator > | |
| NDN_CXX_NODISCARD bool | readType (Iterator &begin, Iterator end, uint32_t &type) noexcept |
| Read TLV-TYPE. More... | |
| template<typename Iterator > | |
| uint64_t | readVarNumber (Iterator &begin, Iterator end) |
| Read VAR-NUMBER in NDN-TLV encoding. More... | |
| template<typename Iterator > | |
| uint32_t | readType (Iterator &begin, Iterator end) |
| Read TLV-TYPE. More... | |
| constexpr size_t | sizeOfVarNumber (uint64_t number) noexcept |
Get the number of bytes necessary to hold the value of number encoded as 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, Iterator end) |
| Read a NonNegativeInteger in NDN-TLV encoding. More... | |
| constexpr size_t | sizeOfNonNegativeInteger (uint64_t integer) noexcept |
Get the number of bytes necessary to hold the value of integer encoded as NonNegativeInteger. More... | |
| size_t | writeNonNegativeInteger (std::ostream &os, uint64_t integer) |
| Write a NonNegativeInteger to the specified stream. More... | |
| template<typename Iterator > | |
| bool | readVarNumber (Iterator &begin, Iterator end, uint64_t &number) noexcept |
| Read VAR-NUMBER in NDN-TLV encoding. More... | |
| template<typename Iterator > | |
| bool | readType (Iterator &begin, Iterator end, uint32_t &type) noexcept |
| Read TLV-TYPE. More... | |
Namespace defining NDN Packet Format related constants and procedures.
| anonymous enum : uint32_t |
TLV-TYPE numbers defined in NDN Packet Format v0.3.
| anonymous enum : uint32_t |
| anonymous enum : uint32_t |
| enum ndn::tlv::SignatureTypeValue : uint16_t |
SignatureType values.
| Enumerator | |
|---|---|
| DigestSha256 | |
| SignatureSha256WithRsa | |
| SignatureSha256WithEcdsa | |
| SignatureHmacWithSha256 | |
| NullSignature | |
| anonymous enum : uint32_t |
TLV-TYPE numbers for SignatureInfo extensions.
| Enumerator | |
|---|---|
| ValidityPeriod | |
| NotBefore | |
| NotAfter | |
| AdditionalDescription | |
| DescriptionEntry | |
| DescriptionKey | |
| DescriptionValue | |
| enum ndn::tlv::ContentTypeValue : uint32_t |
ContentType values.
| std::ostream & ndn::tlv::operator<< | ( | std::ostream & | os, |
| SignatureTypeValue | st | ||
| ) |
Definition at line 33 of file tlv.cpp.
References DigestSha256, NullSignature, SignatureHmacWithSha256, SignatureSha256WithEcdsa, and SignatureSha256WithRsa.
| std::ostream & ndn::tlv::operator<< | ( | std::ostream & | os, |
| ContentTypeValue | ct | ||
| ) |
Definition at line 51 of file tlv.cpp.
References ContentType_Blob, ContentType_Flic, ContentType_Key, ContentType_Link, ContentType_Manifest, ContentType_Nack, and ContentType_PrefixAnn.
| constexpr bool ndn::tlv::isCriticalType | ( | uint32_t | type | ) |
Determine whether a TLV-TYPE is "critical" for evolvability purpose.
Definition at line 178 of file tlv.hpp.
References NDN_CXX_NODISCARD, readNonNegativeInteger(), readType(), readVarNumber(), nonstd::span_lite::size(), sizeOfNonNegativeInteger(), sizeOfVarNumber(), writeNonNegativeInteger(), and writeVarNumber().
Referenced by ndn::security::detail::CertificateBundleDecoder::append(), ndn::PrefixAnnouncement::PrefixAnnouncement(), ndn::Link::wireDecode(), ndn::SignatureInfo::wireDecode(), ndn::Data::wireDecode(), and ndn::Interest::wireDecode().
|
noexcept |
Read VAR-NUMBER in NDN-TLV encoding.
| Iterator | an iterator or pointer that dereferences to uint8_t or compatible type |
| [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 393 of file tlv.hpp.
Referenced by ndn::Block::Block(), ndn::Block::fromBuffer(), ndn::Block::fromStream(), isCriticalType(), ndn::Block::parse(), readType(), and readVarNumber().
|
noexcept |
Read TLV-TYPE.
| Iterator | an iterator or pointer that dereferences to uint8_t or compatible type |
| [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 412 of file tlv.hpp.
References Invalid, and readVarNumber().
Referenced by ndn::Block::Block(), ndn::Block::fromBuffer(), ndn::Block::fromStream(), isCriticalType(), and ndn::Block::parse().
| uint64_t ndn::tlv::readVarNumber | ( | Iterator & | begin, |
| Iterator | end | ||
| ) |
Read VAR-NUMBER in NDN-TLV encoding.
| Iterator | an iterator or pointer that dereferences to uint8_t or compatible type |
| [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 426 of file tlv.hpp.
References ndn::tlv::Error::Error(), NDN_THROW, and readVarNumber().
| uint32_t ndn::tlv::readType | ( | Iterator & | begin, |
| Iterator | end | ||
| ) |
Read TLV-TYPE.
| Iterator | an iterator or pointer that dereferences to uint8_t or compatible type |
| [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 | TLV-TYPE cannot be read |
Definition at line 443 of file tlv.hpp.
References ndn::tlv::Error::Error(), Invalid, NDN_THROW, readVarNumber(), and ndn::to_string().
|
noexcept |
Get the number of bytes necessary to hold the value of number encoded as VAR-NUMBER.
Definition at line 454 of file tlv.hpp.
Referenced by ndn::encoding::Estimator::appendVarNumber(), ndn::Block::Block(), ndn::Block::fromStream(), isCriticalType(), nfd::face::LpReliability::piggyback(), and ndn::encoding::Estimator::prependVarNumber().
|
inline |
Write VAR-NUMBER to the specified stream.
Definition at line 462 of file tlv.hpp.
Referenced by isCriticalType().
| uint64_t ndn::tlv::readNonNegativeInteger | ( | size_t | size, |
| Iterator & | begin, | ||
| Iterator | end | ||
| ) |
Read a NonNegativeInteger in NDN-TLV encoding.
| Iterator | an iterator or pointer that dereferences to uint8_t or compatible type |
| [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 490 of file tlv.hpp.
References ndn::tlv::Error::Error(), NDN_THROW, and ndn::to_string().
Referenced by isCriticalType(), ndn::encoding::readNonNegativeInteger(), and ndn::name::Component::toNumberWithMarker().
|
noexcept |
Get the number of bytes necessary to hold the value of integer encoded as NonNegativeInteger.
Definition at line 506 of file tlv.hpp.
Referenced by ndn::encoding::Estimator::appendNonNegativeInteger(), isCriticalType(), and ndn::encoding::Estimator::prependNonNegativeInteger().
|
inline |
Write a NonNegativeInteger to the specified stream.
Definition at line 514 of file tlv.hpp.
Referenced by isCriticalType().
|
noexcept |
Read VAR-NUMBER in NDN-TLV encoding.
| Iterator | an iterator or pointer that dereferences to uint8_t or compatible type |
| [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 393 of file tlv.hpp.
Referenced by ndn::Block::Block(), ndn::Block::fromBuffer(), ndn::Block::fromStream(), isCriticalType(), ndn::Block::parse(), readType(), and readVarNumber().
|
noexcept |
Read TLV-TYPE.
| Iterator | an iterator or pointer that dereferences to uint8_t or compatible type |
| [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 412 of file tlv.hpp.
References Invalid, and readVarNumber().
Referenced by ndn::Block::Block(), ndn::Block::fromBuffer(), ndn::Block::fromStream(), isCriticalType(), and ndn::Block::parse().