![]() |
dig.cpp File Reference#include <Socket.h> #include <SocketHandler.h> #include <StdoutLog.h> Include dependency graph for dig.cpp: ![]() Go to the source code of this file.
Function Documentation
Definition at line 6 of file dig.cpp. 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 }
|