FACT++  1.0
int get_node_addr ( char *  node_addr)

Definition at line 98 of file utilities.c.

References MAX_NODE_NAME.

Referenced by rand_tmout_init(), register_services(), and unregister_service().

99 {
100 #ifndef VxWorks
101 struct hostent *host;
102 #endif
103 char node_name[MAX_NODE_NAME];
104 char *ptr;
105 
106 #ifdef WIN32
107  init_sock();
108 #endif
109  gethostname(node_name, MAX_NODE_NAME);
110 #ifndef VxWorks
111  if ((host = (struct hostent *)gethostbyname(node_name)) == (struct hostent *)0)
112  {
113  node_addr[0] = 0;
114  node_addr[1] = 0;
115  node_addr[2] = 0;
116  node_addr[3] = 0;
117  return(0);
118  }
119  ptr = (char *)host->h_addr;
120  node_addr[0] = *ptr++;
121  node_addr[1] = *ptr++;
122  node_addr[2] = *ptr++;
123  node_addr[3] = *ptr++;
124  return(1);
125 #else
126  node_addr[0] = 0;
127  node_addr[1] = 0;
128  node_addr[2] = 0;
129  node_addr[3] = 0;
130  return(0);
131 #endif
132 }
#define MAX_NODE_NAME
Definition: dim.h:180

+ Here is the caller graph for this function: