all: rename Tlv namespace to tlv for consistency
This commit renames the Tlv namespace defined in
tlv.hpp to tlv to be more consistent with tlv::security
and tlv::nfd. A Tlv namespace alias is provided for
backwards compatibility.
Change-Id: I21278d6a077afe7776802c3296997d4c1c44c6c6
diff --git a/src/interest.cpp b/src/interest.cpp
index f5ff57b..8bf60e3 100644
--- a/src/interest.cpp
+++ b/src/interest.cpp
@@ -49,7 +49,7 @@
std::memcpy(const_cast<uint8_t*>(m_nonce.value()), &nonce, sizeof(nonce));
}
else {
- m_nonce = dataBlock(Tlv::Nonce,
+ m_nonce = dataBlock(tlv::Nonce,
reinterpret_cast<const uint8_t*>(&nonce),
sizeof(nonce));
m_wire.reset();
@@ -168,7 +168,7 @@
if (!publisherPublicKeyLocator.empty()) {
const Signature& signature = data.getSignature();
const Block& signatureInfo = signature.getInfo();
- Block::element_const_iterator it = signatureInfo.find(Tlv::KeyLocator);
+ Block::element_const_iterator it = signatureInfo.find(tlv::KeyLocator);
if (it == signatureInfo.elements_end()) {
return false;
}
@@ -200,14 +200,14 @@
getInterestLifetime() != DEFAULT_INTEREST_LIFETIME)
{
totalLength += prependNonNegativeIntegerBlock(block,
- Tlv::InterestLifetime,
+ tlv::InterestLifetime,
getInterestLifetime().count());
}
// Scope
if (getScope() >= 0)
{
- totalLength += prependNonNegativeIntegerBlock(block, Tlv::Scope, getScope());
+ totalLength += prependNonNegativeIntegerBlock(block, tlv::Scope, getScope());
}
// Nonce
@@ -224,7 +224,7 @@
totalLength += getName().wireEncode(block);
totalLength += block.prependVarNumber(totalLength);
- totalLength += block.prependVarNumber(Tlv::Interest);
+ totalLength += block.prependVarNumber(tlv::Interest);
return totalLength;
}
@@ -259,14 +259,14 @@
// Scope?
// InterestLifetime?
- if (m_wire.type() != Tlv::Interest)
- throw Tlv::Error("Unexpected TLV number when decoding Interest");
+ if (m_wire.type() != tlv::Interest)
+ throw tlv::Error("Unexpected TLV number when decoding Interest");
// Name
- m_name.wireDecode(m_wire.get(Tlv::Name));
+ m_name.wireDecode(m_wire.get(tlv::Name));
// Selectors
- Block::element_const_iterator val = m_wire.find(Tlv::Selectors);
+ Block::element_const_iterator val = m_wire.find(tlv::Selectors);
if (val != m_wire.elements_end())
{
m_selectors.wireDecode(*val);
@@ -275,10 +275,10 @@
m_selectors = Selectors();
// Nonce
- m_nonce = m_wire.get(Tlv::Nonce);
+ m_nonce = m_wire.get(tlv::Nonce);
// Scope
- val = m_wire.find(Tlv::Scope);
+ val = m_wire.find(tlv::Scope);
if (val != m_wire.elements_end())
{
m_scope = readNonNegativeInteger(*val);
@@ -287,7 +287,7 @@
m_scope = -1;
// InterestLifetime
- val = m_wire.find(Tlv::InterestLifetime);
+ val = m_wire.find(tlv::InterestLifetime);
if (val != m_wire.elements_end())
{
m_interestLifetime = time::milliseconds(readNonNegativeInteger(*val));