FIXME;
typedef int (CALLBACK * FADDRTOSTR) (LPSOCKADDR lpsaAddress, DWORD dwAddressLength, LPWSAPROTOCOL_INFO lpProtocolInfo, OUT LPTSTR lpszAddressString, IN OUT LPDWORD lpdwAddressStringLength ); FADDRTOSTR fAddrToStr = NULL;  HINSTANCE dllWS2 = LoadLibrary("ws2_32.dll"); if (dllWS2) { fAddrToStr = (FADDRTOSTR)GetProcAddress(dllWS2, "WSAAddressToStringA"); if (fAddrToStr) { fAddrToStr(addr->ai->ai_addr, addr->ai->ai_addrlen, NULL, buf, &buflen); } else strncpy(buf, "IPv6", buflen); FreeLibrary(dllWS2); }
void sk_getaddr(SockAddr addr, char *buf, int buflen){#ifdef IPV6    if (addr->family == AF_INET6) {	FIXME; /* I don't know how to get a text form of an IPv6 address. */    } else#endif    if (addr->family == AF_INET) {	struct in_addr a;	a.s_addr = p_htonl(addr->address);	strncpy(buf, p_inet_ntoa(a), buflen);	buf[buflen-1] = '\0';    } else {	assert(addr->family == AF_UNSPEC);	strncpy(buf, addr->hostname, buflen);	buf[buflen-1] = '\0';    }}