Browse Source

Commit code for non-verbose for A first.

THIS IS BROKEN.



git-svn-id: svn://bind10.isc.org/svn/bind10/branches/f2f200910@243 e5f2f494-b856-4b98-b285-d166d9295462
Jeremy C. Reed 15 years ago
parent
commit
aa1c824500
1 changed files with 19 additions and 1 deletions
  1. 19 1
      src/bin/host/host.cc

+ 19 - 1
src/bin/host/host.cc

@@ -85,7 +85,25 @@ host_lookup(char* name, std::string type)
         try {
             rmsg.fromWire();
 
-            if (verbose) {
+            if (!verbose) {
+
+                  std::vector<RRsetPtr>answers =
+                     rmsg.getSection(SECTION_ANSWER);
+                  std::vector<RRsetPtr>::const_iterator it;
+                  for (it = answers.begin(); it != answers.end(); ++it) {
+                      if ((*it)->getType() != RRType::A) {
+                          continue;
+                      }
+                      vector<Rdata::IN::A> addresses;
+                      (*it)->getRdatalist<Rdata::IN::A>(addresses);
+                      for (vector<Rdata::IN::A>::const_iterator ait =
+                          addresses.begin(); ait != addresses.end(); ++ait) {
+
+                          ait->getAddress();  //this should return in_addr&
+                      }
+                  }
+
+            } else {
                 gettimeofday(&after_time, NULL);
 
                 // HEADER and QUESTION, ANSWER, AUTHORITY, and ADDITIONAL