From 6ed79c5de77b3f6be5c297cb5432d123ff1ff177 Mon Sep 17 00:00:00 2001 From: oroborus Date: Sat, 5 Jul 2008 15:56:13 +0000 Subject: - miny sa nezobrazuju na radare - tux moze chodit strielat a zmenit zbran sucastne - master server sa pouziga ten na "ms.tuxanci.org" - AI sa nastavuje v GUI ako v TFG git-svn-id: http://opensvn.csie.org/tuxanci_ng@93 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e --- src/net_unix/dns.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/net_unix/dns.c (limited to 'src/net_unix/dns.c') diff --git a/src/net_unix/dns.c b/src/net_unix/dns.c new file mode 100644 index 0000000..f4036a2 --- /dev/null +++ b/src/net_unix/dns.c @@ -0,0 +1,19 @@ + +#include +#include + +#include "base/main.h" + +char* getIPFormDNS(char *domain) +{ + struct hostent *host; + + host = gethostbyname(domain); + + if( host == NULL || host->h_addr_list[0] == NULL ) + { + return NULL; + } + + return strdup( inet_ntoa( * ( (struct in_addr *) host->h_addr_list[0] ) ) ); +} -- cgit v1.2.3