4 * socktoa - return a numeric host name from a sockaddr_storage structure
11 #include <sys/types.h>
12 #ifdef HAVE_SYS_SOCKET_H
13 #include <sys/socket.h>
15 #ifdef HAVE_NETINET_IN_H
16 #include <netinet/in.h>
19 #include <arpa/inet.h>
21 #ifdef ISC_PLATFORM_NEEDNTOP
28 #include "lib_strbuf.h"
29 #include "ntp_stdlib.h"
37 register char *buffer
;
42 strncpy(buffer
, "(null)", LIB_BUFLENGTH
);
48 inet_ntop(AF_INET
, PSOCK_ADDR4(sock
), buffer
,
53 inet_ntop(AF_INET6
, PSOCK_ADDR6(sock
), buffer
,
58 snprintf(buffer
, LIB_BUFLENGTH
,
59 "(socktoa unknown family %d)",