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 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 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... | |
Variables | |
constexpr int | NameComponent = GenericNameComponent |
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 |
anonymous enum |
TLV-TYPE numbers for SignatureInfo features.
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 32 of file tlv.cpp.
References DigestSha256, SignatureHmacWithSha256, SignatureSha256WithEcdsa, and SignatureSha256WithRsa.
std::ostream & ndn::tlv::operator<< | ( | std::ostream & | os, |
ContentTypeValue | ct | ||
) |
Definition at line 48 of file tlv.cpp.
References ContentType_Blob, ContentType_Flic, ContentType_Key, ContentType_Link, ContentType_Manifest, ContentType_Nack, and ContentType_PrefixAnn.
|
constexpr |
Determine whether a TLV-TYPE is "critical" for evolvability purpose.
Definition at line 174 of file tlv.hpp.
Referenced by ndn::PrefixAnnouncement::PrefixAnnouncement(), ndn::Interest::wireDecode(), and ndn::Data::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 389 of file tlv.hpp.
Referenced by ndn::Block::Block(), ndn::Block::fromBuffer(), ndn::Block::fromStream(), 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 408 of file tlv.hpp.
References Invalid, and readVarNumber().
Referenced by ndn::Block::Block(), ndn::Block::fromBuffer(), ndn::Block::fromStream(), 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 422 of file tlv.hpp.
References 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 439 of file tlv.hpp.
References Invalid, NDN_THROW, readVarNumber(), and ndn::to_string().
|
constexprnoexcept |
Get the number of bytes necessary to hold the value of number
encoded as VAR-NUMBER.
Definition at line 450 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, | ||
Iterator | end | ||
) |
Read 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 486 of file tlv.hpp.
References NDN_THROW, and ndn::to_string().
Referenced by ndn::encoding::readNonNegativeInteger(), and ndn::name::Component::toNumberWithMarker().
|
constexprnoexcept |
|
inline |
|
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 389 of file tlv.hpp.
Referenced by ndn::Block::Block(), ndn::Block::fromBuffer(), ndn::Block::fromStream(), 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 408 of file tlv.hpp.
References Invalid, and readVarNumber().
Referenced by ndn::Block::Block(), ndn::Block::fromBuffer(), ndn::Block::fromStream(), and ndn::Block::parse().
|
constexpr |