1 /* $NetBSD: socktohost.c,v 1.2 2003/12/04 16:23:37 drochner Exp $ */
4 * socktoa - return a numeric host name from a sockaddr_storage structure
7 #include <sys/socket.h>
8 #include <netinet/in.h>
10 #include <arpa/inet.h>
15 #include "lib_strbuf.h"
16 #include "ntp_stdlib.h"
22 struct sockaddr_storage
* sock
25 register char *buffer
;
28 if (getnameinfo((struct sockaddr
*)sock
, SOCKLEN(sock
), buffer
,
29 LIB_BUFLENGTH
/* NI_MAXHOST*/, NULL
, 0, 0))