diff options
Diffstat (limited to 'src/network/core/host.cpp')
-rw-r--r-- | src/network/core/host.cpp | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/src/network/core/host.cpp b/src/network/core/host.cpp index bcd317f8c..4f83c1b37 100644 --- a/src/network/core/host.cpp +++ b/src/network/core/host.cpp @@ -204,50 +204,4 @@ void NetworkFindBroadcastIPs(uint32 *broadcast, int limit) } } - -/** - * Resolve a hostname to an ip. - * @param hsotname the hostname to resolve - * @return the IP belonging to that hostname, or 0 on failure. - */ -uint32 NetworkResolveHost(const char *hostname) -{ - /* Is this an IP address? */ - in_addr_t ip = inet_addr(hostname); - - if (ip != INADDR_NONE) return ip; - - /* No, try to resolve the name */ - struct in_addr addr; -#if !defined(PSP) - struct hostent *he = gethostbyname(hostname); - if (he == NULL) { - DEBUG(net, 0, "[NET] Cannot resolve %s", hostname); - return 0; - } - addr = *(struct in_addr *)he->h_addr_list[0]; -#else - int rid = -1; - char buf[1024]; - - /* Create a resolver */ - if (sceNetResolverCreate(&rid, buf, sizeof(buf)) < 0) { - DEBUG(net, 0, "[NET] Error connecting resolver"); - return 0; - } - - /* Try to resolve the name */ - if (sceNetResolverStartNtoA(rid, hostname, &addr, 2, 3) < 0) { - DEBUG(net, 0, "[NET] Cannot resolve %s", hostname); - sceNetResolverDelete(rid); - return 0; - } - sceNetResolverDelete(rid); -#endif /* PSP */ - - DEBUG(net, 1, "[NET] Resolved %s to %s", hostname, inet_ntoa(addr)); - ip = addr.s_addr; - return ip; -} - #endif /* ENABLE_NETWORK */ |