Browse Source

Comment out sendTo for now.
Add basic usage output.
Used wrong argv, fixed.


git-svn-id: svn://bind10.isc.org/svn/bind10/branches/f2f200910@150 e5f2f494-b856-4b98-b285-d166d9295462

Jeremy C. Reed 15 years ago
parent
commit
d813041453
1 changed files with 8 additions and 6 deletions
  1. 8 6
      src/bin/host/host.cc

+ 8 - 6
src/bin/host/host.cc

@@ -21,16 +21,18 @@ main(int argc, char* argv[])
 {
 {
     Message msg;
     Message msg;
 
 
-    if (argc) {
-
-        cout << argv[0]; 
+    if (argc < 2) {
+        cout << "Usage: host _hostname_\n";
+    }
+    else {
 
 
+        cout << argv[1] << "\n";
         msg.setQid(0); // does this matter?
         msg.setQid(0); // does this matter?
 
 
 // TODO: add switch for this
 // TODO: add switch for this
           msg.setRD(true);    // set recursive bit
           msg.setRD(true);    // set recursive bit
 
 
-        msg.addQuestion(Name(argv[0]),
+        msg.addQuestion(Name(argv[1]),
             RRClass::IN,    // IN class only for now
             RRClass::IN,    // IN class only for now
             RRType(dns_type));
             RRType(dns_type));
 
 
@@ -46,8 +48,8 @@ main(int argc, char* argv[])
         char* sin_addr;
         char* sin_addr;
         inet_pton(AF_INET, "127.0.0.1", sin_addr);
         inet_pton(AF_INET, "127.0.0.1", sin_addr);
         int size = sizeof(sin_addr);
         int size = sizeof(sin_addr);
-        
-        msg.SingleBuffer().sendTo(s, sin_addr, size);
+
+//        msg.SingleBuffer().sendTo(s, sin_addr, size);
 
 
     }
     }
 }
 }