FACT++  1.0
dim_long dns_get_dnsid ( int  conn_id,
SRC_TYPES  src_type 
)

Definition at line 426 of file open_dns.c.

References dns_ent::conn_id, dns_ent::connecting, dll_get_next(), and DNS_conn_head.

Referenced by find_dns_by_conn_id().

427 {
428  DNS_CONN *connp;
429  int found = 0;
430 
431  connp = DNS_conn_head;
432  while( (connp = (DNS_CONN *)dll_get_next( (DLL *) DNS_conn_head,
433  (DLL*) connp)) )
434  {
435  if(connp->conn_id == conn_id)
436  {
437  found = 1;
438  break;
439  }
440  else if((connp->conn_id == 0) && (connp->connecting))
441  {
442  connp->conn_id = conn_id;
443  found = 1;
444  break;
445  }
446  }
447  if(found)
448  {
449  if(connp == DNS_ids[src_type])
450  {
451  return (dim_long)0;
452  }
453  else
454  {
455  return (dim_long)connp;
456  }
457  }
458  return (dim_long)-1;
459 }
int connecting
Definition: open_dns.c:36
Definition: dim.h:530
int conn_id
Definition: open_dns.c:34
long dim_long
Definition: dim_common.h:57
DLL * dll_get_next(DLL *head, DLL *item)
Definition: dll.c:66
static DNS_CONN * DNS_ids[3]
Definition: open_dns.c:40
static DNS_CONN * DNS_conn_head
Definition: open_dns.c:41

+ Here is the call graph for this function:

+ Here is the caller graph for this function: