FACT++  1.0
int send_dns_update_packet ( DIS_DNS_CONN dnsp)

Definition at line 777 of file dis.c.

References Debug_on, dim_print_date_time(), DIS_DNS_HEADER, dis_dns_ent::dis_dns_packet, dna_write(), dis_dns_ent::dns_dis_conn_id, DIS_DNS_PACKET::n_services, release_conn(), SERVICE_REG::service_name, DIS_DNS_PACKET::services, and DIS_DNS_PACKET::size.

Referenced by register_services().

778 {
779  DIS_DNS_PACKET *dis_dns_p = &(dnsp->dis_dns_packet);
780  int n_services;
781  SERVICE_REG *serv_regp;
782 
783  n_services = 1;
784  dis_dns_p->n_services = htovl(n_services);
785  dis_dns_p->size = htovl(DIS_DNS_HEADER +
786  n_services * (int)sizeof(SERVICE_REG));
787  serv_regp = dis_dns_p->services;
788  strcpy( serv_regp->service_name, "DUMMY_UPDATE_PACKET" );
789  if(dnsp->dns_dis_conn_id > 0)
790  {
791 if(Debug_on)
792 {
794  printf("Sending UpdatePacket to dns %d as %s@%s, %d services\n",
795  dnsp->dns_dis_conn_id,
796  (&(dnsp->dis_dns_packet))->task_name, (&(dnsp->dis_dns_packet))->node_name, n_services);
797 }
798  if( !dna_write(dnsp->dns_dis_conn_id, &(dnsp->dis_dns_packet),
799  DIS_DNS_HEADER + n_services * (int)sizeof(SERVICE_REG)))
800  {
801  release_conn(dnsp->dns_dis_conn_id, 0, 1);
802  }
803  }
804  return(1);
805 }
int dns_dis_conn_id
Definition: dis.c:44
int dna_write(int conn_id, void *buffer, int size)
Definition: dna.c:455
static int release_conn(int conn_id, int print_flg, int dns_flag)
Definition: dis.c:2684
char service_name[MAX_NAME]
Definition: dim.h:264
int n_services
Definition: dim.h:279
int size
Definition: dim.h:270
void dim_print_date_time()
Definition: utilities.c:134
static int Debug_on
Definition: dis.c:156
#define DIS_DNS_HEADER
Definition: dim.h:283
SERVICE_REG services[MAX_SERVICE_UNIT]
Definition: dim.h:280
DIS_DNS_PACKET dis_dns_packet
Definition: dis.c:42

+ Here is the call graph for this function:

+ Here is the caller graph for this function: