[svn] commit: r862 - in /branches/each-ds/src/lib: auth/cpp/ dns/cpp/ dns/cpp/rdata/generic/

BIND 10 source code commits bind10-changes at lists.isc.org
Thu Feb 18 06:18:37 UTC 2010


Author: each
Date: Thu Feb 18 06:18:36 2010
New Revision: 862

Log:
- add support for DNSKEY rdata type (and DNSKEY queries)
- add support for DS rdata type (but not DS queries; that will require
  some special-case code in the data source)

Added:
    branches/each-ds/src/lib/dns/cpp/hex.cc
    branches/each-ds/src/lib/dns/cpp/hex.h
    branches/each-ds/src/lib/dns/cpp/rdata/generic/dnskey_48.cc
    branches/each-ds/src/lib/dns/cpp/rdata/generic/dnskey_48.h
    branches/each-ds/src/lib/dns/cpp/rdata/generic/ds_43.cc
    branches/each-ds/src/lib/dns/cpp/rdata/generic/ds_43.h
Modified:
    branches/each-ds/src/lib/auth/cpp/data_source.cc
    branches/each-ds/src/lib/auth/cpp/data_source.h
    branches/each-ds/src/lib/dns/cpp/Makefile.am

Modified: branches/each-ds/src/lib/auth/cpp/data_source.cc
==============================================================================
--- branches/each-ds/src/lib/auth/cpp/data_source.cc (original)
+++ branches/each-ds/src/lib/auth/cpp/data_source.cc Thu Feb 18 06:18:36 2010
@@ -26,9 +26,6 @@
         if (rrset->getType() == RRType::NS()) {
             const generic::NS& ns = dynamic_cast<const generic::NS&>(rd);
 
-            // XXX: For smaller responses, we should try to omit A/AAAA
-            // in the additional section if they are already in the answer
-            // section, but for now we don't.
             t = new QueryTask(ns.getNSName(), q.qclass(), Section::ADDITIONAL(),
                               QueryTask::ADDR_QUERY, QueryTask::GETADDITIONAL); 
         } else if (rrset->getType() == RRType::MX()) {
@@ -147,6 +144,9 @@
         findClosestEnclosure(match);
         const DataSrc* ds = match.bestDataSrc();
         const Name* zone = match.closestName();
+
+        // XXX: we need to special-case queries of type RRType::DS(),
+        // because they only come from the parent zone.
 
         if (ds == NULL) {
             task.flags = NO_SUCH_ZONE;
@@ -297,7 +297,12 @@
                     if (rrset->getType() == RRType::DNAME()) {
                         continue;
                     }
-                    m.addRRset(Section::AUTHORITY(), rrset, q.wantDnssec());
+                    if (rrset->getType() == RRType::DS() &&
+                        task.qtype == RRType::DS()) {
+                        m.addRRset(Section::ANSWER(), rrset, q.wantDnssec());
+                    } else {
+                        m.addRRset(Section::AUTHORITY(), rrset, q.wantDnssec());
+                    }
                     getAdditional(q, rrset);
                 }
             }
@@ -347,10 +352,6 @@
                     // answer: if a CNAME, chase the target, otherwise
                     // add authority.
                     if (found) {
-                        // XXX: since this is a SIMPLE_QUERY, there can
-                        // only be one rrset returned in wild.  But
-                        // eventually this will need to handle ANY queries,
-                        // so wrap it in a BOOST_FOREACH statement anyway.
                         if (rflags & CNAME_FOUND) {
                             if (RRsetPtr rrset = wild[RRType::CNAME()]) {
                                 rrset->setName(task.qname);
@@ -359,6 +360,10 @@
                                 chaseCname(q, task, rrset);
                             }
                         } else {
+                            // XXX: since this is a SIMPLE_QUERY, there can
+                            // only be one rrset returned in wild.  But
+                            // eventually this will need to handle ANY queries,
+                            // so wrap it in a BOOST_FOREACH statement anyway.
                             BOOST_FOREACH (RRsetPtr rrset, wild) {
                                 rrset->setName(task.qname);
                                 m.addRRset(Section::ANSWER(), rrset,

Modified: branches/each-ds/src/lib/auth/cpp/data_source.h
==============================================================================
--- branches/each-ds/src/lib/auth/cpp/data_source.h (original)
+++ branches/each-ds/src/lib/auth/cpp/data_source.h Thu Feb 18 06:18:36 2010
@@ -181,8 +181,6 @@
             return (SUCCESS);
         }
 
-        // XXX: The following code requires new rdata type implementation.
-#if 0
         flags = 0;
         r = findExactRRset(q, qname, qclass, RRType::DS(), target, flags);
         if (r == SUCCESS && flags == 0) {
@@ -190,7 +188,6 @@
         } else if ((flags & (NO_SUCH_ZONE|NAME_NOT_FOUND))) {
             return (SUCCESS);
         }
-#endif
 
         flags = 0;
         r = findExactRRset(q, qname, qclass, RRType::DNAME(), target, flags);

Modified: branches/each-ds/src/lib/dns/cpp/Makefile.am
==============================================================================
--- branches/each-ds/src/lib/dns/cpp/Makefile.am (original)
+++ branches/each-ds/src/lib/dns/cpp/Makefile.am Thu Feb 18 06:18:36 2010
@@ -17,6 +17,7 @@
 libdns_la_SOURCES += question.h question.cc
 libdns_la_SOURCES += message.h message.cc
 libdns_la_SOURCES += base64.h base64.cc
+libdns_la_SOURCES += hex.h hex.cc
 
 rrclass.h: rrclass-placeholder.h
 rrtype.h: rrtype-placeholder.h
@@ -38,6 +39,7 @@
 run_unittests_SOURCES += rrparamregistry_unittest.cc
 run_unittests_SOURCES += message_unittest.cc
 run_unittests_SOURCES += base64_unittest.cc
+#run_unittests_SOURCES += hex_unittest.cc
 run_unittests_SOURCES += run_unittests.cc
 run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
 run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)




More information about the bind10-changes mailing list