FACT++  1.0
int web_get_node_name ( char *  node,
char *  name 
)

Definition at line 278 of file webTcpip.c.

Referenced by getNodeLabel().

279 {
280  int a,b,c,d;
281 /* Fix for gcc 4.6 "dereferencing type-punned pointer will break strict-aliasing rules"?!*/
282  unsigned char ipaddr_buff[4];
283  unsigned char *ipaddr = ipaddr_buff;
284  struct hostent *host;
285 
286  strcpy(name, node);
287  if(isdigit(node[0]))
288  {
289  sscanf(node,"%d.%d.%d.%d",&a, &b, &c, &d);
290  ipaddr[0] = (unsigned char)a;
291  ipaddr[1] = (unsigned char)b;
292  ipaddr[2] = (unsigned char)c;
293  ipaddr[3] = (unsigned char)d;
294  if( (host = gethostbyaddr(ipaddr, sizeof(ipaddr), AF_INET)) == (struct hostent *)0 )
295  {
296  return(0);
297  }
298  else
299  {
300  strcpy(name,host->h_name);
301  return(1);
302  }
303  }
304  return(0);
305 }
Definition: dns.c:26

+ Here is the caller graph for this function: