FACT++  1.0
void unregister_service ( DIS_DNS_CONN dnsp,
SERVICE servp 
)

Definition at line 895 of file dis_old.c.

References serv::def, DIS_DNS_HEADER, dis_dns_ent::dis_dns_packet, dis_dns_ent::dis_service_id, dis_update_service(), dna_write(), dis_dns_ent::dns_dis_conn_id, DIS_DNS_PACKET::format, get_node_addr(), get_node_name(), serv::id, MAX_TASK_NAME, DIS_DNS_PACKET::n_services, serv::name, DIS_DNS_PACKET::node_addr, DIS_DNS_PACKET::node_name, DIS_DNS_PACKET::port, Port_number, Protocol, DIS_DNS_PACKET::protocol, serv::registered, release_conn(), SERVICE_REG::service_def, SERVICE_REG::service_id, SERVICE_REG::service_name, DIS_DNS_PACKET::services, DIS_DNS_PACKET::size, SRC_DIS, DIS_DNS_PACKET::src_type, dis_dns_ent::task_name, and DIS_DNS_PACKET::task_name.

Referenced by dis_remove_service().

896 {
897  register DIS_DNS_PACKET *dis_dns_p = &(dnsp->dis_dns_packet);
898  register int n_services;
899  register SERVICE_REG *serv_regp;
900  extern int get_node_addr();
901 
902  if(dnsp->dns_dis_conn_id > 0)
903  {
904  if(!dis_dns_p->src_type)
905  {
906  get_node_name( dis_dns_p->node_name );
907 /*
908  strcpy( dis_dns_p->task_name, Task_name );
909 */
910  strncpy( dis_dns_p->task_name, dnsp->task_name,
911  MAX_TASK_NAME-4 );
912  dis_dns_p->task_name[MAX_TASK_NAME-4-1] = '\0';
913  get_node_addr( dis_dns_p->node_addr );
914  dis_dns_p->port = htovl(Port_number);
915  dis_dns_p->protocol = htovl(Protocol);
916  dis_dns_p->src_type = htovl(SRC_DIS);
917  dis_dns_p->format = htovl(MY_FORMAT);
918  }
919  serv_regp = dis_dns_p->services;
920  strcpy( serv_regp->service_name, servp->name );
921  strcpy( serv_regp->service_def, servp->def );
922  serv_regp->service_id = htovl( servp->id | 0x80000000);
923  serv_regp++;
924  n_services = 1;
925  servp->registered = 0;
926  dis_dns_p->n_services = htovl(n_services);
927  dis_dns_p->size = htovl(DIS_DNS_HEADER +
928  n_services * sizeof(SERVICE_REG));
929 
930  if( !dna_write(dnsp->dns_dis_conn_id, &(dnsp->dis_dns_packet),
931  DIS_DNS_HEADER + n_services * sizeof(SERVICE_REG)) )
932  {
933  release_conn(dnsp->dns_dis_conn_id, 0, 1);
934  }
935  if(dnsp->dis_service_id)
937  }
938 }
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 Port_number
Definition: dis_old.c:121
char task_name[MAX_NAME]
Definition: dis.c:40
int registered
Definition: dis.c:81
char name[MAX_NAME]
Definition: dis.c:72
char node_addr[4]
Definition: dim.h:274
char task_name[MAX_TASK_NAME-4]
Definition: dim.h:273
int protocol
Definition: dim.h:277
int service_id
Definition: dim.h:265
int get_node_addr(char *node_addr)
Definition: utilities.c:98
static int Protocol
Definition: dis_old.c:120
char service_name[MAX_NAME]
Definition: dim.h:264
int n_services
Definition: dim.h:279
int format
Definition: dim.h:278
char node_name[MAX_NODE_NAME]
Definition: dim.h:272
SRC_TYPES src_type
Definition: dim.h:271
char service_def[MAX_NAME]
Definition: dim.h:266
#define MAX_TASK_NAME
Definition: dim.h:181
int dis_update_service(unsigned service_id)
Definition: dis_old.c:1517
int size
Definition: dim.h:270
int port
Definition: dim.h:276
char def[MAX_NAME]
Definition: dis.c:75
unsigned int dis_service_id
Definition: dis.c:47
static int release_conn(int conn_id, int print_flg, int dns_flag)
Definition: dis_old.c:2374
#define DIS_DNS_HEADER
Definition: dim.h:283
SERVICE_REG services[MAX_SERVICE_UNIT]
Definition: dim.h:280
int get_node_name(char *node_name)
Definition: utilities.c:33
DIS_DNS_PACKET dis_dns_packet
Definition: dis.c:42
int id
Definition: dis.c:73

+ Here is the call graph for this function:

+ Here is the caller graph for this function: