2 * socktoa - return a numeric host name from a sockaddr_storage structure
8 #include <sys/socket.h>
9 #include <netinet/in.h>
11 #include <arpa/inet.h>
13 #ifdef ISC_PLATFORM_NEEDNTOP
20 #include "lib_strbuf.h"
21 #include "ntp_stdlib.h"
26 struct sockaddr_storage* sock
29 register char *buffer;
34 strcpy(buffer, "null");
38 switch(sock->ss_family) {
42 inet_ntop(AF_INET, &GET_INADDR(*sock), buffer,
47 inet_ntop(AF_INET6, &GET_INADDR6(*sock), buffer,
51 strcpy(buffer, "unknown");