Remove hints
Change-Id: I537619fefad6ffb6b46c5dc618f0fdcc15884d6e
diff --git a/src/clients/iterative-query-controller.cpp b/src/clients/iterative-query-controller.cpp
index be3f9f8..3c25505 100644
--- a/src/clients/iterative-query-controller.cpp
+++ b/src/clients/iterative-query-controller.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2014, Regents of the University of California.
+ * Copyright (c) 2014-2016, Regents of the University of California.
*
* This file is part of NDNS (Named Data Networking Domain Name Service).
* See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -177,7 +177,7 @@
{
Response re;
Name zone = m_dstLabel.getPrefix(m_nFinishedComps);
- re.fromData("", zone, data);
+ re.fromData(zone, data);
return re;
}
diff --git a/src/clients/iterative-query-controller.hpp b/src/clients/iterative-query-controller.hpp
index 714a504..dba1635 100644
--- a/src/clients/iterative-query-controller.hpp
+++ b/src/clients/iterative-query-controller.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2014, Regents of the University of California.
+ * Copyright (c) 2014-2016, Regents of the University of California.
*
* This file is part of NDNS (Named Data Networking Domain Name Service).
* See AUTHORS.md for complete list of NDNS authors and contributors.
diff --git a/src/clients/query.cpp b/src/clients/query.cpp
index f890ad1..4e7621b 100644
--- a/src/clients/query.cpp
+++ b/src/clients/query.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2014, Regents of the University of California.
+ * Copyright (c) 2014-2016, Regents of the University of California.
*
* This file is part of NDNS (Named Data Networking Domain Name Service).
* See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -27,9 +27,8 @@
{
}
-Query::Query(const Name& hint, const Name& zone, const name::Component& queryType)
- : m_hint(hint)
- , m_zone(zone)
+Query::Query(const Name& zone, const name::Component& queryType)
+ : m_zone(zone)
, m_queryType(queryType)
, m_interestLifetime(ndn::DEFAULT_INTEREST_LIFETIME)
{
@@ -37,21 +36,18 @@
bool
-Query::fromInterest(const Name& hint, const Name& zone, const Interest& interest)
+Query::fromInterest(const Name& zone, const Interest& interest)
{
label::MatchResult re;
- if (!matchName(interest, hint, zone, re))
+ if (!matchName(interest, zone, re))
return false;
m_rrLabel = re.rrLabel;
m_rrType = re.rrType;
- m_hint = hint;
m_zone = zone;
size_t len = zone.size();
- if (!hint.empty())
- len += hint.size() + 1;
m_queryType = interest.getName().get(len);
return true;
@@ -60,12 +56,8 @@
Interest
Query::toInterest() const
{
- // <hint> /xF0. <zone> [<KEY>|<NDNS>|<NDNS-R>] <rrLabel> <rrType>
+ // <zone> [<KEY>|<NDNS>|<NDNS-R>] <rrLabel> <rrType>
Name name;
- if (!m_hint.empty()) {
- name.append(m_hint)
- .append(ndn::ndns::label::FORWARDING_HINT_LABEL);
- }
name.append(this->m_zone)
.append(this->m_queryType)
@@ -79,7 +71,6 @@
operator<<(std::ostream& os, const Query& query)
{
os << "Query: zone=" << query.getZone()
- << " hint=" << query.getHint()
<< " queryType=" << query.getQueryType()
<< " rrLabel=" << query.getRrLabel()
<< " rrType=" << query.getRrType()
diff --git a/src/clients/query.hpp b/src/clients/query.hpp
index d1bba0b..bf76684 100644
--- a/src/clients/query.hpp
+++ b/src/clients/query.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2014, Regents of the University of California.
+ * Copyright (c) 2014-2016, Regents of the University of California.
*
* This file is part of NDNS (Named Data Networking Domain Name Service).
* See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -33,14 +33,14 @@
*
* Query is an Interest whose name follows the format:
*
- * <hint> /xF0. <zone> [<KEY>|<NDNS>|<NDNS-R>] <rrLabel> <rrType>
+ * <zone> [<KEY>|<NDNS>|<NDNS-R>] <rrLabel> <rrType>
*/
class Query : noncopyable
{
public:
Query();
- Query(const Name& hint, const Name& zone, const name::Component& queryType);
+ Query(const Name& zone, const name::Component& queryType);
/**
* @brief construct an Interest according to the query abstraction
@@ -51,18 +51,17 @@
/**
* @brief extract the query information (rrLabel, rrType) from a Interest
*
- * @param hint Forwarding hint
* @param zone NDNS zone
- * @param interest The Interest to parse; the Interest must have correct hint and zone,
+ * @param interest The Interest to parse; the Interest must have correct zone,
* otherwise it's undefined behavior
*/
bool
- fromInterest(const Name& hint, const Name& zone, const Interest& interest);
+ fromInterest(const Name& zone, const Interest& interest);
bool
operator==(const Query& other) const
{
- return (getHint() == other.getHint() && getZone() == other.getZone() &&
+ return (getZone() == other.getZone() &&
getQueryType() == other.getQueryType() && getRrLabel() == other.getRrLabel() &&
getRrType() == other.getRrType());
}
@@ -76,27 +75,6 @@
public:
/**
- * @brief get forwarding hint. default empty hint (empty() == True),
- * hint won't add to the name
- */
- const Name&
- getHint() const
- {
- return m_hint;
- }
-
- /**
- * @brief set forwarding hint. default empty hint (empty() == True),
- * hint won't add to the name
- */
- void
- setHint(const Name& hint)
- {
- m_hint = hint;
- }
-
-
- /**
* @brief get name of authoritative zone
*/
const Name&
@@ -188,7 +166,6 @@
}
private:
- Name m_hint;
Name m_zone;
name::Component m_queryType;
Name m_rrLabel;
diff --git a/src/clients/response.cpp b/src/clients/response.cpp
index 3cc719b..fc14346 100644
--- a/src/clients/response.cpp
+++ b/src/clients/response.cpp
@@ -94,10 +94,10 @@
}
bool
-Response::fromData(const Name& hint, const Name& zone, const Data& data)
+Response::fromData(const Name& zone, const Data& data)
{
label::MatchResult re;
- if (!matchName(data, hint, zone, re))
+ if (!matchName(data, zone, re))
return false;
m_rrLabel = re.rrLabel;
@@ -106,8 +106,6 @@
m_zone = zone;
size_t len = zone.size();
- if (!hint.empty())
- len += hint.size() + 1;
m_queryType = data.getName().get(len);
MetaInfo info = data.getMetaInfo();
diff --git a/src/clients/response.hpp b/src/clients/response.hpp
index 63f90e7..c6a2779 100644
--- a/src/clients/response.hpp
+++ b/src/clients/response.hpp
@@ -57,15 +57,14 @@
/**
* @brief fill the attributes from Data packet.
*
- * @param hint Forwarding hint
* @param zone NDNS zone name
- * @param data Data.getName() must the same hint (if has) and zone as its prefix,
+ * @param data Data.getName() must the same zone as its prefix,
* otherwise it's undefined behavior
* @return false if Data.getName() does not follow the structure of NDNS Response without
* changing any attributes, otherwise return true and fill the attributes
*/
bool
- fromData(const Name& hint, const Name& zone, const Data& data);
+ fromData(const Name& zone, const Data& data);
shared_ptr<Data>
toData();