FACT++  1.0
dim_long dic_add_dns ( char *  node_name,
int  port_number 
)

Definition at line 258 of file open_dns.c.

References dns_ent::conn_id, dns_ent::connecting, dll_insert_queue(), DNS_PORT, find_dns(), init_dns_list(), Memory::malloc(), dns_ent::node_name, dns_ent::pending, dns_ent::port_number, SRC_DIC, and dns_ent::src_type.

Referenced by init_dns_list().

259 {
260  DNS_CONN *connp;
261 
262  init_dns_list();
263  if(!(connp = find_dns(node_name, port_number, SRC_DIC)))
264  {
265  connp = (DNS_CONN *)malloc(sizeof(DNS_CONN));
266  strcpy(connp->node_name, node_name);
267  connp->port_number = DNS_PORT;
268  if(port_number != 0)
269  connp->port_number = port_number;
270  connp->src_type = SRC_DIC;
271  connp->pending = 0;
272  connp->conn_id = 0;
273  connp->connecting = 0;
274  dll_insert_queue( (DLL *) DNS_conn_head, (DLL *) connp );
275  }
276  return (dim_long)connp;
277 }
DNS_CONN * find_dns(char *node_name, int port_number, SRC_TYPES src_type)
Definition: open_dns.c:219
void dll_insert_queue(DLL *head, DLL *item)
Definition: dll.c:23
void * malloc()
Definition: EventBuilder.cc:99
void init_dns_list()
Definition: open_dns.c:171
int connecting
Definition: open_dns.c:36
SRC_TYPES src_type
Definition: open_dns.c:33
Definition: dim.h:530
int conn_id
Definition: open_dns.c:34
long dim_long
Definition: dim_common.h:57
int port_number
Definition: open_dns.c:29
char node_name[MAX_DNS_NODE]
Definition: open_dns.c:27
int pending
Definition: open_dns.c:35
static DNS_CONN * DNS_conn_head
Definition: open_dns.c:41
#define DNS_PORT
Definition: dim.h:139

+ Here is the call graph for this function:

+ Here is the caller graph for this function: