NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
tlv.hpp File Reference
#include <stdexcept>
#include <iostream>
#include <iterator>
#include <limits>
#include "buffer.hpp"
#include "endian.hpp"
Include dependency graph for 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...
 

Namespaces

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

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::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::SelectedDelegation = 32,
  ndn::tlv::AppPrivateBlock1 = 128, ndn::tlv::AppPrivateBlock2 = 32767
}
 
enum  ndn::tlv::SignatureTypeValue { ndn::tlv::DigestSha256 = 0, ndn::tlv::SignatureSha256WithRsa = 1, ndn::tlv::SignatureSha256WithEcdsa = 3 }
 
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 codes 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...
 

Functions

template<class InputIterator >
bool ndn::tlv::readVarNumber (InputIterator &begin, const InputIterator &end, uint64_t &number)
 Read VAR-NUMBER in NDN-TLV encoding. More...
 
template<class InputIterator >
bool ndn::tlv::readType (InputIterator &begin, const InputIterator &end, uint32_t &type)
 Read TLV Type. More...
 
template<class InputIterator >
uint64_t ndn::tlv::readVarNumber (InputIterator &begin, const InputIterator &end)
 Read VAR-NUMBER in NDN-TLV encoding. More...
 
template<class InputIterator >
uint32_t ndn::tlv::readType (InputIterator &begin, const InputIterator &end)
 Read TLV Type. More...
 
size_t ndn::tlv::sizeOfVarNumber (uint64_t varNumber)
 Get number of bytes necessary to hold value of VAR-NUMBER. More...
 
size_t ndn::tlv::writeVarNumber (std::ostream &os, uint64_t varNumber)
 Write VAR-NUMBER to the specified stream. More...
 
template<class InputIterator >
uint64_t ndn::tlv::readNonNegativeInteger (size_t size, InputIterator &begin, const InputIterator &end)
 Read nonNegativeInteger in NDN-TLV encoding. More...
 
size_t ndn::tlv::sizeOfNonNegativeInteger (uint64_t varNumber)
 Get number of bytes necessary to hold value of nonNegativeInteger. More...
 
size_t ndn::tlv::writeNonNegativeInteger (std::ostream &os, uint64_t varNumber)
 Write nonNegativeInteger to the specified stream. More...
 
template<>
bool ndn::tlv::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 ndn::tlv::readNonNegativeInteger< std::istream_iterator< uint8_t > > (size_t size, std::istream_iterator< uint8_t > &begin, const std::istream_iterator< uint8_t > &end)
 

Variables

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