2 * numtohost - convert network number to host name.
7 #include "ntp_stdlib.h"
8 #include "lib_strbuf.h"
10 #define LOOPBACKNET 0x7f000000
11 #define LOOPBACKHOST 0x7f000001
12 #define LOOPBACKNETMASK 0xff000000
23 * This is really gross, but saves lots of hanging looking for
24 * hostnames for the radio clocks. Don't bother looking up
25 * addresses on the loopback network except for the loopback
28 if ((((ntohl(netnum) & LOOPBACKNETMASK) == LOOPBACKNET)
29 && (ntohl(netnum) != LOOPBACKHOST))
30 || ((hp = gethostbyaddr((char *)&netnum, sizeof netnum, AF_INET))
32 return numtoa(netnum);
36 bp[LIB_BUFLENGTH-1] = '\0';
37 (void) strncpy(bp, hp->h_name, LIB_BUFLENGTH-1);