Logo
~Sockets~
~Examples~
~Contact~


dig.cpp

Go to the documentation of this file.
00001 #include <Socket.h>
00002 #include <SocketHandler.h>
00003 #include <StdoutLog.h>
00004 
00005 
00006 int main(int argc,char *argv[])
00007 {
00008         if (argc < 2)
00009         {
00010                 printf("Usage: %s <host name(s) to resolve>\n",*argv);
00011                 exit(-1);
00012         }
00013         SocketHandler h;
00014         StdoutLog log;
00015         h.RegStdLog(&log);
00016         Socket s(h);
00017 
00018         s.SetIpv6();
00019 
00020         for (int i = 1; i < argc; i++)
00021         {
00022                 struct in6_addr a;
00023                 if (s.u2ip(argv[i], a))
00024                 {
00025                         std::string tmp;
00026                         s.l2ip(a, tmp);
00027 
00028                         printf("%s\n",tmp.c_str());
00029                 }
00030                 else
00031                 {
00032                         printf("%s: failed\n",argv[i]);
00033                 }
00034         }
00035 }
00036 
00037 
Page, code, and content Copyright (C) 2006 by Anders Hedström
Generated on Mon Aug 29 20:21:47 2005 for C++ Sockets by  doxygen 1.4.4