FACT++  1.0
void do_dis_stop_serving_dns ( DIS_DNS_CONN dnsp)

Definition at line 2010 of file dis_old.c.

References close_dns(), dim_stop_threads(), dis_dns_ent::dis_dns_packet, dis_dns_ent::dis_first_time, dis_hash_service_get_next(), dis_init(), dis_dns_ent::dis_n_services, dis_no_dns(), dis_remove_service(), dis_stop_serving(), Dis_timer_q, dna_close(), dis_dns_ent::dns_dis_conn_id, dis_dns_ent::dns_timr_ent, dis_dns_ent::dnsid, serv::dnsp, dtq_rem_entry(), serv::id, dis_dns_ent::serving, DIS_DNS_PACKET::size, SRC_DIS, and DIS_DNS_PACKET::src_type.

Referenced by dis_remove_service(), dis_stop_serving_dns(), and recv_dns_dis_rout().

2011 {
2012 register SERVICE *servp, *prevp;
2013 void dim_stop_threads(void);
2014 int dis_no_dns();
2015 int hash_index, old_index;
2016 extern int close_dns(long, int);
2017 
2018  dnsp->serving = 0;
2019  dis_init();
2020 /*
2021  dis_hash_service_init();
2022  prevp = 0;
2023  if(Dis_conn_id)
2024  {
2025  dna_close(Dis_conn_id);
2026  Dis_conn_id = 0;
2027  }
2028 */
2029  {
2030  DISABLE_AST
2031  if(dnsp->dns_timr_ent)
2032  {
2034  dnsp->dns_timr_ent = NULL;
2035  }
2036  if(dnsp->dns_dis_conn_id)
2037  {
2038  dna_close(dnsp->dns_dis_conn_id);
2039  dnsp->dns_dis_conn_id = 0;
2040  }
2041  ENABLE_AST
2042  }
2043  {
2044  DISABLE_AST
2045  prevp = 0;
2046  hash_index = -1;
2047  old_index = -1;
2048  while( (servp = dis_hash_service_get_next(&hash_index, prevp, 0)) )
2049  {
2050  if(servp->dnsp == dnsp)
2051  {
2052  dis_remove_service(servp->id);
2053  if(old_index != hash_index)
2054  prevp = 0;
2055  }
2056  else
2057  {
2058  prevp = servp;
2059  old_index = hash_index;
2060  }
2061  }
2062  ENABLE_AST
2063  }
2064  dnsp->dis_first_time = 1;
2065  dnsp->dis_n_services = 0;
2066  dnsp->dis_dns_packet.size = 0;
2067  dnsp->dis_dns_packet.src_type = 0;
2068  close_dns(dnsp->dnsid, SRC_DIS);
2069 /*
2070  if(dnsp != Default_DNS)
2071  {
2072  dll_remove(dnsp);
2073  free(dnsp);
2074  }
2075 */
2076 /*
2077  if(dll_empty(DNS_head))
2078 */
2079  if(dis_no_dns())
2080  dis_stop_serving();
2081 }
int dis_no_dns()
Definition: dis_old.c:2977
int close_dns(dim_long dnsid, SRC_TYPES src_type)
Definition: open_dns.c:298
DIS_DNS_CONN * dnsp
Definition: dis.c:87
int serving
Definition: dis.c:46
int dns_dis_conn_id
Definition: dis.c:44
static int Dis_timer_q
Definition: dis_old.c:141
SERVICE * dis_hash_service_get_next(int *curr_index, SERVICE *prevp, int new_entries)
Definition: dis_old.c:2920
int dna_close(int conn_id)
Definition: dna.c:835
int dis_n_services
Definition: dis.c:43
void dis_stop_serving()
Definition: dis_old.c:2091
SRC_TYPES src_type
Definition: dim.h:271
dim_long dnsid
Definition: dis.c:39
static void dis_init()
Definition: dis_old.c:216
Definition: dis.c:69
int dtq_rem_entry(int queue_id, TIMR_ENT *entry)
Definition: dtq.c:503
TIMR_ENT * dns_timr_ent
Definition: dis.c:41
int dis_first_time
Definition: dis.c:45
int size
Definition: dim.h:270
int dis_remove_service(unsigned service_id)
Definition: dis_old.c:1919
DIS_DNS_PACKET dis_dns_packet
Definition: dis.c:42
void dim_stop_threads()
Definition: dim_thr.c:404
int id
Definition: dis.c:73

+ Here is the call graph for this function:

+ Here is the caller graph for this function: