Remove hints
Change-Id: I537619fefad6ffb6b46c5dc618f0fdcc15884d6e
diff --git a/ndns.conf.sample.in b/ndns.conf.sample.in
index b2b968a..bb1cfa8 100644
--- a/ndns.conf.sample.in
+++ b/ndns.conf.sample.in
@@ -19,9 +19,3 @@
; omit cert to select the default certificate of above identity
; }
}
-
-hints
-{
- ; hint /ucla
- ; hint /att
-}
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();
diff --git a/src/daemon/name-server.cpp b/src/daemon/name-server.cpp
index 3170f79..15f77c3 100644
--- a/src/daemon/name-server.cpp
+++ b/src/daemon/name-server.cpp
@@ -75,7 +75,7 @@
NameServer::onInterest(const Name& prefix, const Interest& interest)
{
label::MatchResult re;
- if (!label::matchName(interest, "", m_zone.getName(), re))
+ if (!label::matchName(interest, m_zone.getName(), re))
return;
if (re.rrType == ndns::label::NDNS_UPDATE_LABEL) {
@@ -158,7 +158,7 @@
{
label::MatchResult re;
try {
- if (!label::matchName(*data, "", m_zone.getName(), re))
+ if (!label::matchName(*data, m_zone.getName(), re))
return;
}
catch (std::exception& e) {
diff --git a/src/daemon/name-server.hpp b/src/daemon/name-server.hpp
index 09c3101..aa75ade 100644
--- a/src/daemon/name-server.hpp
+++ b/src/daemon/name-server.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.
@@ -122,8 +122,6 @@
Zone m_zone;
DbMgr& m_dbMgr;
- // Name m_hint;
-
Name m_ndnsPrefix;
Name m_keyPrefix;
Name m_certName;
diff --git a/src/mgmt/management-tool.cpp b/src/mgmt/management-tool.cpp
index 9ade73f..6dd2cb9 100644
--- a/src/mgmt/management-tool.cpp
+++ b/src/mgmt/management-tool.cpp
@@ -376,8 +376,7 @@
// create response for the input data
Response re;
- Name hint;
- re.fromData(hint, zoneName, *data);
+ re.fromData(zoneName, *data);
Name label = re.getRrLabel();
name::Component type = re.getRrType();
@@ -417,8 +416,7 @@
for (Rrset& rrset : rrsets) {
Data data(rrset.getData());
Response re;
- Name hint;
- re.fromData(hint, zoneName, data);
+ re.fromData(zoneName, data);
if (rrset.getLabel().toUri().size() > labelWidth)
labelWidth = rrset.getLabel().toUri().size();
@@ -436,8 +434,7 @@
for (Rrset& rrset : rrsets) {
Data data(rrset.getData());
Response re;
- Name hint;
- re.fromData(hint, zoneName, data);
+ re.fromData(zoneName, data);
int iteration = re.getNdnsType() == NDNS_RAW || re.getNdnsType() == NDNS_AUTH ?
1 : re.getRrs().size();
const std::vector<Block> &rrs = re.getRrs();
diff --git a/src/ndns-label.cpp b/src/ndns-label.cpp
index 1b1cc80..9386452 100644
--- a/src/ndns-label.cpp
+++ b/src/ndns-label.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.
@@ -28,25 +28,13 @@
inline size_t
calculateSkip(const Name& name,
- const Name& hint, const Name& zone)
+ const Name& zone)
{
size_t skip = 0;
- if (!hint.empty()) {
- // These are only asserts. The caller should supply the right parameters
- skip = hint.size() + 1 + zone.size();
- BOOST_ASSERT(name.size() > skip);
-
- BOOST_ASSERT(name.getPrefix(hint.size()) == hint);
- BOOST_ASSERT(name.get(hint.size()) == FORWARDING_HINT_LABEL);
- BOOST_ASSERT(name.getSubName(hint.size() + 1, zone.size()) == zone);
-
- }
- else {
- skip = zone.size();
- BOOST_ASSERT(name.size() > skip);
- BOOST_ASSERT(name.getPrefix(zone.size()) == zone);
- }
+ skip = zone.size();
+ BOOST_ASSERT(name.size() > skip);
+ BOOST_ASSERT(name.getPrefix(zone.size()) == zone);
BOOST_ASSERT(name.get(skip) == NDNS_ITERATIVE_QUERY ||
name.get(skip) == NDNS_CERT_QUERY);
@@ -57,13 +45,13 @@
bool
matchName(const Interest& interest,
- const Name& hint, const Name& zone,
+ const Name& zone,
MatchResult& result)
{
- // [hint / FHLabel] / zoneName / <Update>|rrLabel / UPDATE|rrType / [VERSION]
+ // zoneName / <Update>|rrLabel / UPDATE|rrType / [VERSION]
const Name& name = interest.getName();
- size_t skip = calculateSkip(name, hint, zone);
+ size_t skip = calculateSkip(name, zone);
if (name.size() - skip < 1)
return false;
@@ -85,13 +73,13 @@
bool
matchName(const Data& data,
- const Name& hint, const Name& zone,
+ const Name& zone,
MatchResult& result)
{
- // [hint / FHLabel] / zoneName / <Update>|rrLabel / UPDATE|rrType
+ // zoneName / <Update>|rrLabel / UPDATE|rrType
const Name& name = data.getName();
- size_t skip = calculateSkip(name, hint, zone);
+ size_t skip = calculateSkip(name, zone);
if (name.size() - skip < 2)
return false;
diff --git a/src/ndns-label.hpp b/src/ndns-label.hpp
index 6641eca..63df2ad 100644
--- a/src/ndns-label.hpp
+++ b/src/ndns-label.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.
@@ -41,7 +41,8 @@
/**
* @brief NDNS recursive query type
*/
-const name::Component NDNS_RECURSIVE_QUERY("NDNS-R");
+// it is not supported now
+// const name::Component NDNS_RECURSIVE_QUERY("NDNS-R");
/**
* @brief NDNS ID-CERT query type
@@ -51,12 +52,6 @@
/////////////////////////////////////////////
/**
- * @brief label of forwarding hint
- * @todo not support forwarding hint yet, for future use
- */
-const name::Component FORWARDING_HINT_LABEL("\xF0.");
-
-/**
* @brief label of update message, located at the last component in Interest name
*/
const name::Component NDNS_UPDATE_LABEL("UPDATE");
@@ -96,8 +91,6 @@
* @brief match the Interest (NDNS query, NDNS update) name
*
* @param[in] interest Interest to parse
- * @param[in] hint Forwarding hint that is part of the Interest
- * (only the length will be taken into account)
* @param[in] zone Zone that the Interest is related to
* (only the length will be taken into account)
* @param[out] result The matching result
@@ -105,15 +98,13 @@
*/
bool
matchName(const Interest& interest,
- const Name& hint, const Name& zone,
+ const Name& zone,
MatchResult& result);
/**
* @brief match the Data (NDNS query response, NDNS update response) name
*
* @param[in] data Data to parse
- * @param[in] hint Forwarding hint that is part of the Data
- * (only the length will be taken into account)
* @param[in] zone Zone that the Data is related to
* (only the length will be taken into account)
* @param[out] result The matching result
@@ -121,7 +112,7 @@
*/
bool
matchName(const Data& data,
- const Name& hint, const Name& zone,
+ const Name& zone,
MatchResult& result);
diff --git a/tests/unit/clients/iterative-query-controller.cpp b/tests/unit/clients/iterative-query-controller.cpp
index 93bbb4e..16087e5 100644
--- a/tests/unit/clients/iterative-query-controller.cpp
+++ b/tests/unit/clients/iterative-query-controller.cpp
@@ -67,7 +67,6 @@
ndn::util::DummyClientFace producerFace;
ndn::util::DummyClientFace consumerFace;
- Name hint;
Validator validator;
ndns::NameServer top;
ndns::NameServer net;
@@ -82,7 +81,6 @@
using std::string;
using ndns::NameServer;
- string hint;
Name name = m_ndnsim.getName();
Name dstLabel(name.append("www"));
name::Component rrType("TXT");
diff --git a/tests/unit/clients/query.cpp b/tests/unit/clients/query.cpp
index 40fdfc3..0e4a1e4 100644
--- a/tests/unit/clients/query.cpp
+++ b/tests/unit/clients/query.cpp
@@ -31,13 +31,11 @@
{
Name zone("/net");
name::Component qType = ndns::label::NDNS_ITERATIVE_QUERY;
- Name hint;
- ndns::Query q(hint, zone, qType);
+ ndns::Query q(zone, qType);
q.setRrLabel(Name("/ndnsim/www"));
BOOST_CHECK_EQUAL(q.getRrLabel(), Name("ndnsim/www"));
BOOST_CHECK_EQUAL(q.getRrLabel(), Name("/ndnsim/www"));
- BOOST_CHECK_EQUAL(q.getHint(), hint);
BOOST_CHECK_EQUAL(q.getZone(), zone);
BOOST_CHECK_EQUAL(q.getQueryType(), qType);
@@ -46,23 +44,22 @@
Interest interest = q.toInterest();
- ndns::Query q2(hint, zone, qType);
- BOOST_CHECK_EQUAL(q2.fromInterest(hint, zone, interest), true);
+ ndns::Query q2(zone, qType);
+ BOOST_CHECK_EQUAL(q2.fromInterest(zone, interest), true);
ndns::Query q3;
- BOOST_CHECK_EQUAL(q3.fromInterest(hint, zone, interest), true);
+ BOOST_CHECK_EQUAL(q3.fromInterest(zone, interest), true);
BOOST_CHECK_EQUAL(q, q3);
BOOST_CHECK_EQUAL(q, q2);
- hint = Name("att");
- ndns::Query q4(hint, zone, qType);
+ ndns::Query q4(zone, qType);
q4.setRrLabel("/ndnsim/www");
q4.setRrType(ndns::label::TXT_RR_TYPE);
interest = q4.toInterest();
ndns::Query q5;
- BOOST_CHECK_EQUAL(q5.fromInterest(hint, zone, interest), true);
+ BOOST_CHECK_EQUAL(q5.fromInterest(zone, interest), true);
BOOST_CHECK_EQUAL(q4, q5);
BOOST_CHECK_NE(q2, q4);
}
diff --git a/tests/unit/clients/response.cpp b/tests/unit/clients/response.cpp
index 5950063..c575c85 100644
--- a/tests/unit/clients/response.cpp
+++ b/tests/unit/clients/response.cpp
@@ -29,7 +29,6 @@
BOOST_AUTO_TEST_CASE(Basic)
{
- Name hint;
Name zone("/net");
name::Component qType = ndns::label::NDNS_ITERATIVE_QUERY;
@@ -54,7 +53,7 @@
// m_keyChain.sign(*data);
ndns::Response r2;
- BOOST_CHECK_EQUAL(r2.fromData(hint, zone, *data), true);
+ BOOST_CHECK_EQUAL(r2.fromData(zone, *data), true);
BOOST_CHECK_EQUAL(r, r2);
ndns::Response r4(zone, qType);
@@ -76,7 +75,7 @@
ndns::Response r5(zone, qType);
- BOOST_CHECK_EQUAL(r5.fromData(hint, zone, *data), true);
+ BOOST_CHECK_EQUAL(r5.fromData(zone, *data), true);
BOOST_CHECK_EQUAL(r4, r5);
}
diff --git a/tests/unit/daemon/name-server.cpp b/tests/unit/daemon/name-server.cpp
index 820dbd2..c081103 100644
--- a/tests/unit/daemon/name-server.cpp
+++ b/tests/unit/daemon/name-server.cpp
@@ -53,7 +53,6 @@
public:
ndn::util::DummyClientFace face;
- Name hint;
const Name& zone;
Validator validator;
ndns::NameServer server;
@@ -63,7 +62,7 @@
BOOST_AUTO_TEST_CASE(NdnsQuery)
{
- Query q(hint, zone, ndns::label::NDNS_ITERATIVE_QUERY);
+ Query q(zone, ndns::label::NDNS_ITERATIVE_QUERY);
q.setRrLabel(Name("net"));
q.setRrType(ndns::label::NS_RR_TYPE);
@@ -75,7 +74,7 @@
BOOST_CHECK_EQUAL(data.getName().getPrefix(-1), q.toInterest().getName());
Response resp;
- BOOST_CHECK_NO_THROW(resp.fromData(hint, zone, data));
+ BOOST_CHECK_NO_THROW(resp.fromData(zone, data));
BOOST_CHECK_EQUAL(resp.getNdnsType(), NDNS_RESP);
});
@@ -88,7 +87,7 @@
BOOST_AUTO_TEST_CASE(KeyQuery)
{
- Query q(hint, zone, ndns::label::NDNS_ITERATIVE_QUERY);
+ Query q(zone, ndns::label::NDNS_ITERATIVE_QUERY);
q.setQueryType(ndns::label::NDNS_CERT_QUERY);
q.setRrType(ndns::label::CERT_RR_TYPE);
@@ -101,7 +100,7 @@
BOOST_CHECK_EQUAL(data.getName().getPrefix(-1), q.toInterest().getName());
Response resp;
- BOOST_CHECK_NO_THROW(resp.fromData(hint, zone, data));
+ BOOST_CHECK_NO_THROW(resp.fromData(zone, data));
BOOST_CHECK_EQUAL(resp.getNdnsType(), NDNS_NACK);
});
@@ -115,7 +114,7 @@
BOOST_CHECK_EQUAL(data.getName().getPrefix(-1), q.toInterest().getName());
Response resp;
- BOOST_CHECK_NO_THROW(resp.fromData(hint, zone, data));
+ BOOST_CHECK_NO_THROW(resp.fromData(zone, data));
BOOST_CHECK_EQUAL(resp.getNdnsType(), NDNS_RAW);
});
@@ -133,7 +132,7 @@
++nDataBack;
Response resp;
- BOOST_CHECK_NO_THROW(resp.fromData(hint, zone, data));
+ BOOST_CHECK_NO_THROW(resp.fromData(zone, data));
BOOST_CHECK_EQUAL(resp.getNdnsType(), NDNS_RAW);
});
@@ -147,7 +146,7 @@
++nDataBack;
Response resp;
- BOOST_CHECK_NO_THROW(resp.fromData(hint, zone, data));
+ BOOST_CHECK_NO_THROW(resp.fromData(zone, data));
BOOST_CHECK_EQUAL(resp.getNdnsType(), NDNS_NACK);
});
@@ -172,7 +171,7 @@
shared_ptr<Data> data = re.toData();
m_keyChain.sign(*data, m_certName);
- Query q(Name(hint), Name(zone), ndns::label::NDNS_ITERATIVE_QUERY);
+ Query q(Name(zone), ndns::label::NDNS_ITERATIVE_QUERY);
const Block& block = data->wireEncode();
Name name;
name.append(block);
@@ -188,7 +187,7 @@
BOOST_CHECK_EQUAL(data.getName().getPrefix(-1), q.toInterest().getName());
Response resp;
- BOOST_CHECK_NO_THROW(resp.fromData(hint, zone, data));
+ BOOST_CHECK_NO_THROW(resp.fromData(zone, data));
BOOST_CHECK_EQUAL(resp.getNdnsType(), NDNS_RESP); // by default NDNS_RAW is enough
BOOST_CHECK_GT(resp.getRrs().size(), 0);
Block block = resp.getRrs()[0];
@@ -224,7 +223,7 @@
shared_ptr<Data> data = re.toData();
m_keyChain.sign(*data, m_certName);
- Query q(Name(hint), Name(zone), ndns::label::NDNS_ITERATIVE_QUERY);
+ Query q(Name(zone), ndns::label::NDNS_ITERATIVE_QUERY);
const Block& block = data->wireEncode();
Name name;
name.append(block);
@@ -240,7 +239,7 @@
BOOST_CHECK_EQUAL(data.getName().getPrefix(-1), q.toInterest().getName());
Response resp;
- BOOST_CHECK_NO_THROW(resp.fromData(hint, zone, data));
+ BOOST_CHECK_NO_THROW(resp.fromData(zone, data));
BOOST_CHECK_EQUAL(resp.getNdnsType(), NDNS_RESP); // by default NDNS_RAW is enough
BOOST_CHECK_GT(resp.getRrs().size(), 0);
Block block = resp.getRrs()[0];
@@ -300,7 +299,7 @@
shared_ptr<Data> data = re.toData();
m_keyChain.sign(*data, dskCert->getName());
- Query q(Name(hint), Name(zone), ndns::label::NDNS_ITERATIVE_QUERY);
+ Query q(Name(zone), ndns::label::NDNS_ITERATIVE_QUERY);
const Block& block = data->wireEncode();
Name name;
name.append(block);
@@ -356,7 +355,6 @@
boost::asio::io_service io;
ndn::util::DummyClientFace face;
ndn::util::DummyClientFace validatorFace;
- Name hint;
const Name& zone;
Validator validator;
ndns::NameServer server;
@@ -403,7 +401,7 @@
shared_ptr<Data> data = re.toData();
m_keyChain.sign(*data, dskCert->getName());
- Query q(Name(hint), Name(zone), ndns::label::NDNS_ITERATIVE_QUERY);
+ Query q(Name(zone), ndns::label::NDNS_ITERATIVE_QUERY);
const Block& block = data->wireEncode();
Name name;
name.append(block);
@@ -428,7 +426,7 @@
BOOST_CHECK_EQUAL(data.getName().getPrefix(-1), q.toInterest().getName());
Response resp;
- BOOST_CHECK_NO_THROW(resp.fromData(hint, zone, data));
+ BOOST_CHECK_NO_THROW(resp.fromData(zone, data));
BOOST_CHECK_EQUAL(resp.getNdnsType(), NDNS_RESP); // by default NDNS_RAW is enough
BOOST_CHECK_GT(resp.getRrs().size(), 0);
Block block = resp.getRrs()[0];
diff --git a/tests/unit/mgmt/management-tool.cpp b/tests/unit/mgmt/management-tool.cpp
index b61ac86..5af6c33 100644
--- a/tests/unit/mgmt/management-tool.cpp
+++ b/tests/unit/mgmt/management-tool.cpp
@@ -188,7 +188,7 @@
Rrset rrset = findRrSet(zone, label, type);
Data data(rrset.getData());
Response resp;
- resp.fromData("", zone.getName(), data);
+ resp.fromData(zone.getName(), data);
return resp;
}
diff --git a/tests/unit/ndns-label.cpp b/tests/unit/ndns-label.cpp
index 719d786..cfd650c 100644
--- a/tests/unit/ndns-label.cpp
+++ b/tests/unit/ndns-label.cpp
@@ -30,19 +30,18 @@
BOOST_AUTO_TEST_CASE(MatchInterest)
{
using namespace label;
- Name hint("/att");
Name zone("/net/ndnsim");
- Interest interest1("/att/%F0./net/ndnsim/NDNS/www/dsk-111/NS");
- Interest interest2("/att/%F0./net/ndnsim/NDNS/www/dsk-111/NS/%FD%00");
+ Interest interest1("/net/ndnsim/NDNS/www/dsk-111/NS");
+ Interest interest2("/net/ndnsim/NDNS/www/dsk-111/NS/%FD%00");
MatchResult re;
- BOOST_CHECK_EQUAL(matchName(interest1, hint, zone, re), true);
+ BOOST_CHECK_EQUAL(matchName(interest1, zone, re), true);
BOOST_CHECK_EQUAL(re.rrLabel, Name("/www/dsk-111"));
BOOST_CHECK_EQUAL(re.rrType, name::Component("NS"));
BOOST_CHECK_EQUAL(re.version, name::Component());
- BOOST_CHECK_EQUAL(matchName(interest2, hint, zone, re), true);
+ BOOST_CHECK_EQUAL(matchName(interest2, zone, re), true);
BOOST_CHECK_EQUAL(re.rrLabel, Name("/www/dsk-111"));
BOOST_CHECK_EQUAL(re.rrType, name::Component("NS"));
BOOST_CHECK_EQUAL(re.version, name::Component::fromEscapedString("%FD%00"));
@@ -51,13 +50,12 @@
BOOST_AUTO_TEST_CASE(MatchData)
{
using namespace label;
- Name hint("/att");
Name zone("/net/ndnsim");
- Data data1("/att/%F0./net/ndnsim/NDNS/www/dsk-111/NS/%FD%00");
+ Data data1("/net/ndnsim/NDNS/www/dsk-111/NS/%FD%00");
MatchResult re;
- BOOST_CHECK_EQUAL(matchName(data1, hint, zone, re), true);
+ BOOST_CHECK_EQUAL(matchName(data1, zone, re), true);
BOOST_CHECK_EQUAL(re.rrLabel, Name("/www/dsk-111"));
BOOST_CHECK_EQUAL(re.rrType, name::Component("NS"));
BOOST_REQUIRE_NO_THROW(re.version.toVersion());
diff --git a/tools/ndns-daemon.cpp b/tools/ndns-daemon.cpp
index af68abd..65028ea 100644
--- a/tools/ndns-daemon.cpp
+++ b/tools/ndns-daemon.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.
@@ -50,8 +50,6 @@
config.addSectionHandler("zones",
bind(&NdnsDaemon::processZonesSection, this, _1, _3));
- config.addSectionHandler("hints",
- bind(&NdnsDaemon::processHintsSection, this, _1, _3));
config.parse(configFile, false);
@@ -70,13 +68,6 @@
}
void
- processHintsSection(const ndn::ndns::ConfigSection& section, const std::string& filename)
- {
- // hint is not supported yet
- ;
- }
-
- void
processZonesSection(const ndn::ndns::ConfigSection& section, const std::string& filename)
{
using namespace boost::filesystem;
diff --git a/tools/ndns-dig.cpp b/tools/ndns-dig.cpp
index bbe5ad3..f7f9af0 100644
--- a/tools/ndns-dig.cpp
+++ b/tools/ndns-dig.cpp
@@ -43,11 +43,10 @@
class NdnsDig
{
public:
- NdnsDig(const Name& hint, const Name& dstLabel,
+ NdnsDig(const Name& dstLabel,
const name::Component& rrType, bool shouldValidateIntermediate)
: m_dstLabel(dstLabel)
, m_rrType(rrType)
- , m_hint(hint)
, m_interestLifetime(DEFAULT_INTEREST_LIFETIME)
, m_validator(m_face)
, m_shouldValidateIntermediate(shouldValidateIntermediate)
@@ -199,7 +198,6 @@
Name m_dstLabel;
name::Component m_rrType;
- Name m_hint;
Name m_certName;
time::milliseconds m_interestLifetime;
@@ -305,7 +303,7 @@
}
try {
- ndn::ndns::NdnsDig dig("", dstLabel, ndn::name::Component(rrType), shouldValidateIntermediate);
+ ndn::ndns::NdnsDig dig(dstLabel, ndn::name::Component(rrType), shouldValidateIntermediate);
dig.setInterestLifetime(ndn::time::seconds(ttl));
dig.setDstFile(dstFile);
diff --git a/tools/ndns-update.cpp b/tools/ndns-update.cpp
index 0b56c55..9dbbb2c 100644
--- a/tools/ndns-update.cpp
+++ b/tools/ndns-update.cpp
@@ -48,9 +48,8 @@
class NdnsUpdate : noncopyable
{
public:
- NdnsUpdate(const Name& hint, const Name& zone, const shared_ptr<Data>& update, Face& face)
- : m_hint(hint)
- , m_zone(zone)
+ NdnsUpdate(const Name& zone, const shared_ptr<Data>& update, Face& face)
+ : m_zone(zone)
, m_interestLifetime(DEFAULT_INTEREST_LIFETIME)
, m_face(face)
, m_validator(face)
@@ -136,7 +135,7 @@
Interest
makeUpdateInterest()
{
- Query q(m_hint, m_zone, label::NDNS_ITERATIVE_QUERY);
+ Query q(m_zone, label::NDNS_ITERATIVE_QUERY);
q.setRrLabel(Name().append(m_update->wireEncode()));
q.setRrType(label::NDNS_UPDATE_LABEL);
q.setInterestLifetime(m_interestLifetime);
@@ -183,7 +182,6 @@
}
private:
- Name m_hint;
Name m_zone;
time::milliseconds m_interestLifetime;
@@ -207,7 +205,6 @@
using namespace ndn;
using namespace ndn::ndns;
- Name hint;
Name zone;
int ttl = 4;
Name rrLabel;
@@ -227,7 +224,6 @@
po::options_description config("Configuration");
config.add_options()
- ("hint,H", po::value<Name>(&hint), "forwarding hint")
("ttl,T", po::value<int>(&ttl), "TTL of query. default: 4 sec")
("rrtype,t", po::value<string>(&rrType), "set request RR Type. default: TXT")
("ndnsType,n", po::value<string>(&ndnsTypeStr), "Set the ndnsType of the resource record. "
@@ -255,7 +251,7 @@
config_file_options.add(config).add(hidden);
po::options_description visible("Usage: ndns-update zone rrLabel [-t rrType] [-T TTL] "
- "[-H hint] [-n NdnsType] [-c cert] "
+ "[-n NdnsType] [-c cert] "
"[-f contentFile]|[-o content]\n"
"Allowed options");
@@ -382,7 +378,7 @@
}
Response re;
- re.fromData(hint, zone, *update);
+ re.fromData(zone, *update);
if (vm.count("rrlabel") && rrLabel != re.getRrLabel()) {
std::cerr << "The loaded Data packet is supposed to have rrLabel: " << re.getRrLabel()
@@ -411,7 +407,7 @@
Face face;
try {
- NdnsUpdate updater(hint, zone, update, face);
+ NdnsUpdate updater(zone, update, face);
updater.setInterestLifetime(ndn::time::seconds(ttl));
updater.start();