Browse Source

Comments and documentation

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/trac455@4043 e5f2f494-b856-4b98-b285-d166d9295462
Michal Vaner 14 years ago
parent
commit
ad3f6dc02e
2 changed files with 19 additions and 2 deletions
  1. 2 0
      src/bin/auth/query.cc
  2. 17 2
      src/bin/auth/query.h

+ 2 - 0
src/bin/auth/query.cc

@@ -77,10 +77,12 @@ Query::process() const {
                 // TODO : add NS to authority section, fill in additional section.
                 // TODO : add NS to authority section, fill in additional section.
                 break;
                 break;
             case Zone::NXDOMAIN:
             case Zone::NXDOMAIN:
+                // Just empty answer with SOA in authority section
                 response_.setRcode(Rcode::NXDOMAIN());
                 response_.setRcode(Rcode::NXDOMAIN());
                 putSOA(*result.zone);
                 putSOA(*result.zone);
                 break;
                 break;
             case Zone::NXRRSET:
             case Zone::NXRRSET:
+                // Just empty answer with SOA in authority section
                 response_.setRcode(Rcode::NOERROR());
                 response_.setRcode(Rcode::NOERROR());
                 putSOA(*result.zone);
                 putSOA(*result.zone);
                 break;
                 break;

+ 17 - 2
src/bin/auth/query.h

@@ -103,16 +103,25 @@ public:
     /// providing compatible behavior may have its own benefit, so this point
     /// providing compatible behavior may have its own benefit, so this point
     /// should be revisited later.
     /// should be revisited later.
     ///
     ///
-    /// Right now this method never throws an exception, but it may in a
-    /// future version.
+    /// This might throw BadZone or any of its specific subclasses.
     void process() const;
     void process() const;
 
 
+    /// \short Bad zone data encountered.
+    ///
+    /// This is thrown when process encounteres misconfigured zone in a way
+    /// it can't continue. This throws, not sets the Rcode, because such
+    /// misconfigured zone should not be present in the data source and
+    /// should have been rejected sooner.
     struct BadZone : public isc::Exception {
     struct BadZone : public isc::Exception {
         BadZone(const char* file, size_t line, const char* what) :
         BadZone(const char* file, size_t line, const char* what) :
             Exception(file, line, what)
             Exception(file, line, what)
         { }
         { }
     };
     };
 
 
+    /// \short Zone is missing its SOA record.
+    ///
+    /// We tried to add a SOA into the authoritative section, but the zone
+    /// does not contain one.
     struct NoSOA : public BadZone {
     struct NoSOA : public BadZone {
         NoSOA(const char* file, size_t line, const char* what) :
         NoSOA(const char* file, size_t line, const char* what) :
             BadZone(file, line, what)
             BadZone(file, line, what)
@@ -124,6 +133,12 @@ private:
     const isc::dns::Name& qname_;
     const isc::dns::Name& qname_;
     const isc::dns::RRType& qtype_;
     const isc::dns::RRType& qtype_;
     isc::dns::Message& response_;
     isc::dns::Message& response_;
+    /**
+     * \short Adds a SOA.
+     *
+     * Adds a SOA of the zone into the authority zone of response_.
+     * Can throw NoSOA.
+     */
     void putSOA(const isc::datasrc::Zone& zone) const;
     void putSOA(const isc::datasrc::Zone& zone) const;
 };
 };