FACT++  1.0
int request_dns_single_info ( DIC_SERVICE servp)

Definition at line 1314 of file dic.c.

References Debug_on, dim_print_date_time(), dna_write(), Dns_dic_conn_id, dic_serv::pending, dic_serv::serv_id, dic_serv::serv_name, DIC_DNS_PACKET::service, SERVICE_REQ::service_id, SERVICE_REQ::service_name, DIC_DNS_PACKET::size, SRC_DIC, DIC_DNS_PACKET::src_type, and WAITING_DNS_ANSWER.

Referenced by request_dns_info().

1315 {
1316  static DIC_DNS_PACKET Dic_dns_packet;
1317  static SERVICE_REQ *serv_reqp;
1318  int ret = 1;
1319 
1320  if( Dns_dic_conn_id > 0)
1321  {
1322  if(Debug_on)
1323  {
1325  printf("Requesting DNS Info for %s, id %d\n",
1326  servp->serv_name, servp->serv_id);
1327  }
1328 
1329  Dic_dns_packet.src_type = htovl(SRC_DIC);
1330  serv_reqp = &Dic_dns_packet.service;
1331  strcpy( serv_reqp->service_name, servp->serv_name );
1332  serv_reqp->service_id = htovl(servp->serv_id);
1333  servp->pending = WAITING_DNS_ANSWER;
1334  Dic_dns_packet.size = htovl(sizeof(DIC_DNS_PACKET));
1335  if(!dna_write( Dns_dic_conn_id, &Dic_dns_packet,
1336  sizeof(DIC_DNS_PACKET) ) )
1337  {
1338  ret = 0;
1339  }
1340 
1341  }
1342  return ret;
1343 }
static int Dns_dic_conn_id
Definition: dic.c:46
int dna_write(int conn_id, void *buffer, int size)
Definition: dna.c:455
SERVICE_REQ service
Definition: dim.h:302
int service_id
Definition: dim.h:296
PENDING_STATES pending
Definition: dim.h:476
SRC_TYPES src_type
Definition: dim.h:301
int size
Definition: dim.h:300
int serv_id
Definition: dim.h:461
char service_name[MAX_NAME]
Definition: dim.h:295
char serv_name[MAX_NAME]
Definition: dim.h:460
void dim_print_date_time()
Definition: utilities.c:134
static int Debug_on
Definition: dic.c:59

+ Here is the call graph for this function:

+ Here is the caller graph for this function: