encoding: Remove SCOPE from Interests and all references to it in the related code
Change-Id: I2b19d0bb7ea5fdcea0da3996b946bb7797a9ea2d
Refs: #2345
diff --git a/src/encoding/tlv.hpp b/src/encoding/tlv.hpp
index da7b8ea..78564d8 100644
--- a/src/encoding/tlv.hpp
+++ b/src/encoding/tlv.hpp
@@ -65,7 +65,7 @@
NameComponent = 8,
Selectors = 9,
Nonce = 10,
- Scope = 11, // deprecated
+ // <Unassigned> = 11,
InterestLifetime = 12,
MinSuffixComponents = 13,
MaxSuffixComponents = 14,
@@ -95,6 +95,7 @@
enum SignatureTypeValue {
DigestSha256 = 0,
SignatureSha256WithRsa = 1,
+ // <Unassigned> = 2,
SignatureSha256WithEcdsa = 3
};
diff --git a/src/interest.cpp b/src/interest.cpp
index 017711a..a7ba973 100644
--- a/src/interest.cpp
+++ b/src/interest.cpp
@@ -34,15 +34,13 @@
"Interest::Error must inherit from tlv::Error");
Interest::Interest()
- : m_scope(-1)
- , m_interestLifetime(time::milliseconds::min())
+ : m_interestLifetime(time::milliseconds::min())
, m_selectedDelegationIndex(INVALID_SELECTED_DELEGATION_INDEX)
{
}
Interest::Interest(const Name& name)
: m_name(name)
- , m_scope(-1)
, m_interestLifetime(time::milliseconds::min())
, m_selectedDelegationIndex(INVALID_SELECTED_DELEGATION_INDEX)
{
@@ -50,28 +48,11 @@
Interest::Interest(const Name& name, const time::milliseconds& interestLifetime)
: m_name(name)
- , m_scope(-1)
, m_interestLifetime(interestLifetime)
, m_selectedDelegationIndex(INVALID_SELECTED_DELEGATION_INDEX)
{
}
-Interest::Interest(const Name& name,
- const Selectors& selectors,
- int scope,
- const time::milliseconds& interestLifetime,
- uint32_t nonce)
- : m_name(name)
- , m_selectors(selectors)
- , m_scope(scope)
- , m_interestLifetime(interestLifetime)
- , m_selectedDelegationIndex(INVALID_SELECTED_DELEGATION_INDEX)
-{
- if (nonce > 0) {
- setNonce(nonce);
- }
-}
-
Interest::Interest(const Block& wire)
{
wireDecode(wire);
@@ -241,7 +222,6 @@
// Name
// Selectors?
// Nonce
- // Scope?
// InterestLifetime?
// Link?
// SelectedDelegation?
@@ -269,12 +249,6 @@
getInterestLifetime().count());
}
- // Scope
- if (getScope() >= 0)
- {
- totalLength += prependNonNegativeIntegerBlock(block, tlv::Scope, getScope());
- }
-
// Nonce
getNonce(); // to ensure that Nonce is properly set
totalLength += block.prependBlock(m_nonce);
@@ -327,7 +301,6 @@
// Name
// Selectors?
// Nonce
- // Scope?
// InterestLifetime?
// Link?
// SelectedDelegation?
@@ -350,15 +323,6 @@
// Nonce
m_nonce = m_wire.get(tlv::Nonce);
- // Scope
- val = m_wire.find(tlv::Scope);
- if (val != m_wire.elements_end())
- {
- m_scope = readNonNegativeInteger(*val);
- }
- else
- m_scope = -1;
-
// InterestLifetime
val = m_wire.find(tlv::InterestLifetime);
if (val != m_wire.elements_end())
@@ -502,10 +466,6 @@
os << delim << "ndn.MustBeFresh=" << interest.getMustBeFresh();
delim = '&';
}
- if (interest.getScope() >= 0) {
- os << delim << "ndn.Scope=" << interest.getScope();
- delim = '&';
- }
if (interest.getInterestLifetime() >= time::milliseconds::zero()
&& interest.getInterestLifetime() != DEFAULT_INTEREST_LIFETIME) {
os << delim << "ndn.InterestLifetime=" << interest.getInterestLifetime().count();
diff --git a/src/interest.hpp b/src/interest.hpp
index 1e064fb..41e3848 100644
--- a/src/interest.hpp
+++ b/src/interest.hpp
@@ -77,16 +77,6 @@
*/
Interest(const Name& name, const time::milliseconds& interestLifetime);
- /** @brief Create a new Interest for the given name, selectors, and guiders
- * @warning In certain contexts that use Interest::shared_from_this(), Interest must be created
- * using `make_shared`. Otherwise, .shared_from_this() will throw an exception.
- */
- Interest(const Name& name,
- const Selectors& selectors,
- int scope,
- const time::milliseconds& interestLifetime,
- uint32_t nonce = 0);
-
/** @brief Create from wire encoding
* @warning In certain contexts that use Interest::shared_from_this(), Interest must be created
* using `make_shared`. Otherwise, .shared_from_this() will throw an exception.
@@ -236,20 +226,6 @@
return *this;
}
- int
- getScope() const
- {
- return m_scope;
- }
-
- Interest&
- setScope(int scope)
- {
- m_scope = scope;
- m_wire.reset();
- return *this;
- }
-
const time::milliseconds&
getInterestLifetime() const
{
@@ -463,7 +439,6 @@
Name m_name;
Selectors m_selectors;
mutable Block m_nonce;
- int m_scope;
time::milliseconds m_interestLifetime;
mutable Block m_link;