-#ifdef NS_ENABLE_GETADDRINFO
- int rv = 0;
- struct addrinfo hints, *servinfo, *p;
- struct sockaddr_in *h = NULL;
-
- memset(&hints, 0, sizeof hints);
- hints.ai_family = AF_INET;
- hints.ai_socktype = SOCK_STREAM;
-
- if((rv = getaddrinfo(host, NULL , NULL, &servinfo)) != 0) {
- DBG(("getaddrinfo(%s) failed: %s", host, strerror(errno)));
- return 0;
- }
-
- for(p = servinfo; p != NULL; p = p->ai_next) {
- memcpy(&h, &p->ai_addr, sizeof(struct sockaddr_in *));
- memcpy(ina, &h->sin_addr, sizeof(ina));
- }
-
- freeaddrinfo(servinfo);
- return 1;
-#else