FACT++  1.0
static void request_dns_info ( int  id)
static

Definition at line 1245 of file dic.c.

References COMMAND, DIM_FATAL, DIMDNSUNDEF, dll_get_next(), Dns_dic_conn_id, dtq_start_timer(), error_handler(), id_get_ptr(), NOT_PENDING, ONCE_ONLY, open_dns(), dic_serv::pending, recv_dns_dic_rout(), request_dns_single_info(), dic_serv::serv_id, Service_pend_head, service_tmout(), SRC_DIC, Tmout_max, Tmout_min, dic_serv::type, and WAITING_DNS_UP.

Referenced by locate_service(), recv_dns_dic_rout(), recv_rout(), retry_bad_connection(), and send_service_command().

1246 {
1247  DIC_SERVICE *servp, *ptr;
1248  int n_pend = 0;
1250  extern int open_dns();
1251 
1252  DISABLE_AST
1253  if( Dns_dic_conn_id <= 0)
1254  {
1256  Tmout_min,
1257  Tmout_max,
1258  SRC_DIC);
1259  if(Dns_dic_conn_id == -2)
1260  error_handler(0, DIM_FATAL, DIMDNSUNDEF, "DIM_DNS_NODE undefined");
1261  }
1262  if( Dns_dic_conn_id > 0)
1263  {
1264  servp = Service_pend_head;
1265  if(id > 0)
1266  {
1267  ptr = (DIC_SERVICE *)id_get_ptr(id, SRC_DIC);
1268  if(ptr)
1269  {
1270  if((ptr->serv_id == id) && (ptr->pending != NOT_PENDING))
1271  servp = ptr;
1272  }
1273  }
1274 
1275  while( (servp = (DIC_SERVICE *) dll_get_next(
1276  (DLL *) Service_pend_head,
1277  (DLL *) servp)) )
1278  {
1279  if( servp->pending == WAITING_DNS_UP)
1280  {
1281  if(!request_dns_single_info( servp ))
1282  {
1283  ENABLE_AST
1284  return;
1285  }
1286  n_pend++;
1287  }
1288  if(n_pend == 1000)
1289  {
1291  ENABLE_AST
1292  return;
1293  }
1294  }
1295  }
1296  else
1297  {
1298  servp = Service_pend_head;
1299  while( (servp = (DIC_SERVICE *) dll_get_next(
1300  (DLL *) Service_pend_head,
1301  (DLL *) servp)) )
1302  {
1303  if( servp->pending == WAITING_DNS_UP)
1304  {
1305  if(( servp->type != COMMAND )&&( servp->type != ONCE_ONLY ))
1306  service_tmout( servp->serv_id );
1307  }
1308  }
1309  }
1310  ENABLE_AST
1311 }
static void error_handler(int conn_id, int severity, int errcode, char *reason)
Definition: dic.c:120
static int Dns_dic_conn_id
Definition: dic.c:46
static int Tmout_min
Definition: dic.c:49
#define COMMAND
Definition: dim_common.h:10
void * id_get_ptr(int id, SRC_TYPES type)
Definition: conn_handler.c:184
static void recv_dns_dic_rout(int conn_id, DNS_DIC_PACKET *packet, int size, int status)
Definition: dic.c:464
PENDING_STATES pending
Definition: dim.h:476
#define DIMDNSUNDEF
Definition: dim_common.h:282
int open_dns(dim_long dnsid, void(*recv_rout)(), void(*error_rout)(), int tmout_min, int tmout_max, SRC_TYPES src_type)
Definition: open_dns.c:313
int type
Definition: dim.h:465
Definition: dim.h:530
void dtq_start_timer(int time, void(*user_routine)(), dim_long tag)
Definition: dtq.c:790
Definition: dim.h:457
static int Tmout_max
Definition: dic.c:48
int request_dns_single_info(DIC_SERVICE *servp)
Definition: dic.c:1314
int serv_id
Definition: dim.h:461
static void request_dns_info(int id)
Definition: dic.c:1245
DLL * dll_get_next(DLL *head, DLL *item)
Definition: dll.c:66
void service_tmout(int serv_id)
Definition: dic.c:518
#define ONCE_ONLY
Definition: dim_common.h:7
static DIC_SERVICE * Service_pend_head
Definition: dic.c:41

+ Here is the call graph for this function:

+ Here is the caller graph for this function: