/* * socktoa - return a numeric host name from a sockaddr_storage structure */ #include #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #include #include #include "ntp_fp.h" #include "lib_strbuf.h" #include "ntp_stdlib.h" #include "ntp.h" char * socktohost( const sockaddr_u *sock ) { register char *buffer; LIB_GETBUF(buffer); if (getnameinfo(&sock->sa, SOCKLEN(sock), buffer, LIB_BUFLENGTH, NULL, 0, 0)) return stoa(sock); return buffer; }