[svn] commit: r714 - in /branches/parkinglot/src/lib/auth/cpp: data_source_static.cc data_source_static.h
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed Feb 3 19:01:43 UTC 2010
Author: jinmei
Date: Wed Feb 3 19:01:42 2010
New Revision: 714
Log:
chedk RRtype/class in findRRset()
additional clenaup and improvements:
- supported NS for the static names
- use 0 TTL to be compatible with the current behavior
Modified:
branches/parkinglot/src/lib/auth/cpp/data_source_static.cc
branches/parkinglot/src/lib/auth/cpp/data_source_static.h
Modified: branches/parkinglot/src/lib/auth/cpp/data_source_static.cc
==============================================================================
--- branches/parkinglot/src/lib/auth/cpp/data_source_static.cc (original)
+++ branches/parkinglot/src/lib/auth/cpp/data_source_static.cc Wed Feb 3 19:01:42 2010
@@ -15,14 +15,13 @@
namespace isc {
namespace dns {
-using namespace isc::dns;
using namespace isc::dns::rdata;
StaticDataSrc::StaticDataSrc() : authors_name("authors.bind"),
version_name("version.bind")
{
authors = RRsetPtr(new RRset(authors_name, RRClass::CH(),
- RRType::TXT(), RRTTL(3600)));
+ RRType::TXT(), RRTTL(0)));
authors->addRdata(generic::TXT("Evan Hunt"));
authors->addRdata(generic::TXT("Han Feng"));
authors->addRdata(generic::TXT("Jelte Jansen"));
@@ -32,12 +31,20 @@
authors->addRdata(generic::TXT("Kazunori Fujiwara"));
authors->addRdata(generic::TXT("Michael Graff"));
authors->addRdata(generic::TXT("Naoki Kambe"));
- authors->addRdata(generic::TXT("Shane Kerr"));
+ authors->addRdata(generic::TXT("Shane Kerr"));
authors->addRdata(generic::TXT("Zhang Likun"));
+ authors_ns = RRsetPtr(new RRset(authors_name, RRClass::CH(),
+ RRType::NS(), RRTTL(0)));
+ authors_ns->addRdata(generic::NS(authors_name));
+
version = RRsetPtr(new RRset(version_name, RRClass::CH(),
- RRType::TXT(), RRTTL(3600)));
+ RRType::TXT(), RRTTL(0)));
version->addRdata(generic::TXT("BIND10 0.0.0 (pre-alpha)"));
+
+ version_ns = RRsetPtr(new RRset(version_name, RRClass::CH(),
+ RRType::NS(), RRTTL(0)));
+ version_ns->addRdata(generic::NS(version_name));
}
const DataSrc*
@@ -91,13 +98,27 @@
const RRType& qtype,
RRsetList& target) const
{
- if (qname == version_name) {
+ if (qname == version_name &&
+ qclass == version->getClass() && qtype == version->getType()) {
target.push_back(version);
return SUCCESS;
- } else if (qname == authors_name) {
+ } else if (qname == version_name &&
+ qclass == version_ns->getClass() &&
+ qtype == version_ns->getType()) {
+ target.push_back(version_ns);
+ return SUCCESS;
+ } else if (qname == authors_name &&
+ qclass == authors->getClass() && qtype == authors->getType()) {
target.push_back(authors);
return SUCCESS;
+ } else if (qname == authors_name &&
+ qclass == authors_ns->getClass() &&
+ qtype == authors_ns->getType()) {
+ target.push_back(authors_ns);
+ return SUCCESS;
}
+ // XXX: this is not 100% correct.
+ // We should also support the nodata/noerror case.
return NAME_NOT_FOUND;
}
Modified: branches/parkinglot/src/lib/auth/cpp/data_source_static.h
==============================================================================
--- branches/parkinglot/src/lib/auth/cpp/data_source_static.h (original)
+++ branches/parkinglot/src/lib/auth/cpp/data_source_static.h Wed Feb 3 19:01:42 2010
@@ -56,7 +56,9 @@
const Name authors_name;
const Name version_name;
RRsetPtr authors;
+ RRsetPtr authors_ns;
RRsetPtr version;
+ RRsetPtr version_ns;
};
}
More information about the bind10-changes
mailing list