encoding/tlv.hpp File Reference
#include "buffer.hpp"
#include "endian.hpp"
#include <cstring>
#include <iterator>
#include <ostream>
#include <type_traits>
+ Include dependency graph for encoding/tlv.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  ndn::tlv::Error
 represents an error in TLV encoding or decoding More...
 
class  ndn::tlv::detail::ReadNumber< Iterator >
 
class  ndn::tlv::detail::ReadNumberFast< Iterator >
 Function object to read a number from ContiguousIterator. More...
 
class  ndn::tlv::detail::ReadNumberSlow< Iterator >
 Function object to read a number from InputIterator. More...
 

Namespaces

 ndn
 Copyright (c) 2013-2017 Regents of the University of California.
 
 ndn::tlv
 Namespace defining NDN-TLV related constants and procedures.
 
 ndn::tlv::detail
 

Enumerations

enum  {
  ndn::tlv::Interest = 5,
  ndn::tlv::Data = 6,
  ndn::tlv::Name = 7,
  ndn::tlv::ImplicitSha256DigestComponent = 1,
  ndn::tlv::NameComponent = 8,
  ndn::tlv::Selectors = 9,
  ndn::tlv::Nonce = 10,
  ndn::tlv::InterestLifetime = 12,
  ndn::tlv::ForwardingHint = 30,
  ndn::tlv::MinSuffixComponents = 13,
  ndn::tlv::MaxSuffixComponents = 14,
  ndn::tlv::PublisherPublicKeyLocator = 15,
  ndn::tlv::Exclude = 16,
  ndn::tlv::ChildSelector = 17,
  ndn::tlv::MustBeFresh = 18,
  ndn::tlv::Any = 19,
  ndn::tlv::MetaInfo = 20,
  ndn::tlv::Content = 21,
  ndn::tlv::SignatureInfo = 22,
  ndn::tlv::SignatureValue = 23,
  ndn::tlv::ContentType = 24,
  ndn::tlv::FreshnessPeriod = 25,
  ndn::tlv::FinalBlockId = 26,
  ndn::tlv::SignatureType = 27,
  ndn::tlv::KeyLocator = 28,
  ndn::tlv::KeyDigest = 29,
  ndn::tlv::LinkPreference = 30,
  ndn::tlv::LinkDelegation = 31,
  ndn::tlv::AppPrivateBlock1 = 128,
  ndn::tlv::AppPrivateBlock2 = 32767
}
 TLV-TYPE numbers defined in NDN Packet Format. More...
 
enum  {
  ndn::tlv::ValidityPeriod = 253,
  ndn::tlv::NotBefore = 254,
  ndn::tlv::NotAfter = 255,
  ndn::tlv::AdditionalDescription = 258,
  ndn::tlv::DescriptionEntry = 512,
  ndn::tlv::DescriptionKey = 513,
  ndn::tlv::DescriptionValue = 514
}
 TLV-TYPE numbers for SignatureInfo features. More...
 
enum  ndn::tlv::ContentTypeValue {
  ndn::tlv::ContentType_Blob = 0,
  ndn::tlv::ContentType_Link = 1,
  ndn::tlv::ContentType_Key = 2,
  ndn::tlv::ContentType_Nack = 3
}
 indicates a possible value of ContentType field More...
 
enum  ndn::tlv::SignatureTypeValue : uint16_t {
  ndn::tlv::DigestSha256 = 0,
  ndn::tlv::SignatureSha256WithRsa = 1,
  ndn::tlv::SignatureSha256WithEcdsa = 3
}
 

Functions

std::ostream & ndn::tlv::operator<< (std::ostream &os, SignatureTypeValue signatureType)
 
template<typename Iterator >
uint64_t ndn::tlv::readNonNegativeInteger (size_t size, Iterator &begin, const Iterator &end)
 Read nonNegativeInteger in NDN-TLV encoding. More...
 
template<typename Iterator >
bool ndn::tlv::readType (Iterator &begin, const Iterator &end, uint32_t &type)
 Read TLV-TYPE. More...
 
template<typename Iterator >
uint32_t ndn::tlv::readType (Iterator &begin, const Iterator &end)
 Read TLV Type. More...
 
template<typename Iterator >
bool ndn::tlv::readVarNumber (Iterator &begin, const Iterator &end, uint64_t &number)
 Read VAR-NUMBER in NDN-TLV encoding. More...
 
template<typename Iterator >
uint64_t ndn::tlv::readVarNumber (Iterator &begin, const Iterator &end)
 Read VAR-NUMBER in NDN-TLV encoding. More...
 
template<typename Iterator , typename DecayedIterator = typename std::decay<Iterator>::type, typename ValueType = typename std::iterator_traits<DecayedIterator>::value_type>
constexpr bool ndn::tlv::detail::shouldSelectContiguousReadNumber ()
 Determine whether to select ReadNumber implementation for ContiguousIterator. More...
 
constexpr size_t ndn::tlv::sizeOfNonNegativeInteger (uint64_t integer)
 Get number of bytes necessary to hold value of nonNegativeInteger. More...
 
constexpr size_t ndn::tlv::sizeOfVarNumber (uint64_t number)
 Get number of bytes necessary to hold value of VAR-NUMBER. More...
 
size_t ndn::tlv::writeNonNegativeInteger (std::ostream &os, uint64_t integer)
 Write nonNegativeInteger to the specified stream. More...
 
size_t ndn::tlv::writeVarNumber (std::ostream &os, uint64_t number)
 Write VAR-NUMBER to the specified stream. More...
 

Variables

const size_t ndn::MAX_NDN_PACKET_SIZE = 8800
 practical limit of network layer packet size More...