FACT++  1.0
int check_node_addr ( char *  node,
unsigned char *  ipaddr 
)

Definition at line 973 of file tcpip.c.

Referenced by tcpip_open_client().

974 {
975 unsigned char *ptr;
976 int ret;
977 
978  ptr = (unsigned char *)node+(int)strlen(node)+1;
979  ipaddr[0] = *ptr++;
980  ipaddr[1] = *ptr++;
981  ipaddr[2] = *ptr++;
982  ipaddr[3] = *ptr++;
983  if( (ipaddr[0] == 0xff) &&
984  (ipaddr[1] == 0xff) &&
985  (ipaddr[2] == 0xff) &&
986  (ipaddr[3] == 0xff) )
987  {
988  errno = ECONNREFUSED; /* fake an error code */
989 #ifdef WIN32
990  WSASetLastError(errno);
991 #endif
992  return(0);
993  }
994  if( gethostbyaddr(ipaddr, sizeof(ipaddr), AF_INET) == (struct hostent *)0 )
995  {
996 #ifndef WIN32
997  ret = h_errno;
998 #else
999  ret = WSAGetLastError();
1000 #endif
1001  if((ret == HOST_NOT_FOUND) || (ret == NO_DATA))
1002  return(0);
1003 /*
1004  errno = ECONNREFUSED;
1005 #ifdef WIN32
1006  WSASetLastError(errno);
1007 #endif
1008  return(0);
1009 */
1010  }
1011  return(1);
1012 }
Definition: dns.c:26

+ Here is the caller graph for this function: