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