14 char *buf = (
char *)bufp;
35 memcpy(t->
itsData, buf, (
size_t)*size);
123 int len = 0, new_len;
132 new_len = (int)strlen(def)+1;
137 itsFormat =
new char[(int)strlen(def)+1];
168 itsName =
new char[(int)strlen(name)+1];
255 itsName =
new char[(int)strlen(name)+1];
315 itsName =
new char[(int)strlen(name)+1];
346 char *buf = (
char *)bufp;
365 memcpy(t->
itsData, buf, (
size_t)*size);
406 itsName =
new char[(int)strlen(name)+1];
521 char *buf = (
char *)bufp;
572 memcpy(t->
itsData, buf, (
size_t)size);
635 memcpy(
itsData, buf, (
size_t)size);
683 void *nolink,
int nolinksize,
int timeout)
690 itsName =
new char[(int)strlen(name)+1];
705 itsNameOut =
new char[(int)strlen(name)+1+10];
706 strcpy(itsNameOut,name);
707 strcat(itsNameOut,(
char *)
"/RpcIn");
708 itsNameIn =
new char[(int)strlen(name)+1+10];
709 strcpy(itsNameIn,name);
710 strcat(itsNameIn,(
char *)
"/RpcOut");
711 itsTimeout = timeout;
745 itsDataOut =
new char[
size];
746 itsDataOutSize =
size;
748 else if(itsDataOutSize < size)
750 delete[] (
char *)itsDataOut;
751 itsDataOut =
new char[
size];
752 itsDataOutSize =
size;
754 memcpy(itsDataOut, data, (
size_t)size);
818 delete[] (
char *)itsDataOut;
851 return getServices(serviceName, 0);
862 browserRpc =
new DimRpcInfo((
char *)
"DIS_DNS/SERVICE_INFO",timeout,(
char *)
"\0");
863 browserRpc->setData((
char *)serviceName);
864 str = browserRpc->getString();
871 return(
itsData[0]->getNTokens((
char *)
"\n") + 1);
876 return getServers(0);
883 DimCurrentInfo srv((
char *)
"DIS_DNS/SERVER_LIST", timeout, (
char *)
"\0");
885 size = (int)strlen(str)+1;
896 pid_str = str + (int)strlen(str) + 1;
901 return(
itsData[1]->getNTokens((
char *)
"|") +1);
906 return getServerServices(serverName, 0);
912 char *name =
new char[(int)strlen(serverName) + 20];
913 strcpy(name,(
char *)serverName);
914 strcat(name,(
char *)
"/SERVICE_LIST");
924 return(
itsData[2]->getNTokens((
char *)
"\n") + 1);
929 return getServerClients(serverName, 0);
935 char *name =
new char[(int)strlen(serverName) + 20];
936 strcpy(name,(
char *)serverName);
937 strcat(name,(
char *)
"/CLIENT_LIST");
945 return(
itsData[3]->getNTokens((
char *)
"@") );
952 service = format = &none;
953 ret =
itsData[0]->getToken(currToken);
956 ret =
itsData[0]->getToken(currToken);
957 if(!
itsData[0]->cmpToken((
char *)
"|"))
959 ret =
itsData[0]->getToken(currToken);
960 if(!
itsData[0]->cmpToken((
char *)
"|"))
963 ret =
itsData[0]->getToken(currToken);
964 if(!
itsData[0]->cmpToken((
char *)
"|"))
967 ret =
itsData[0]->getToken(currToken);
969 if(!
itsData[0]->cmpToken((
char *)
"\n"))
971 if(
itsData[0]->cmpToken((
char *)
"CMD"))
973 if(
itsData[0]->cmpToken((
char *)
"RPC"))
975 ret =
itsData[0]->getToken(currToken);
976 if(!
itsData[0]->cmpToken((
char *)
"\n"))
986 server = node = &none;
987 ret =
itsData[1]->getToken(currToken);
990 ret =
itsData[1]->getToken(currToken);
991 if(!
itsData[1]->cmpToken((
char *)
"@"))
995 ret =
itsData[1]->getToken(currToken);
998 ret =
itsData[1]->getToken(currToken);
999 if(
itsData[1]->cmpToken((
char *)
"@"))
1002 strcat(server,node);
1007 if(!
itsData[1]->cmpToken((
char *)
"|"))
1017 ret = getNextServer(server, node);
1020 ret =
itsData[4]->getToken(tok);
1023 sscanf(tok,
"%d",&lpid);
1029 ret =
itsData[4]->getToken(tok);
1037 service = format = &none;
1038 ret =
itsData[2]->getToken(currToken);
1040 service = currToken;
1041 ret =
itsData[2]->getToken(currToken);
1042 if(!
itsData[2]->cmpToken((
char *)
"|"))
1044 ret =
itsData[2]->getToken(currToken);
1045 if(!
itsData[2]->cmpToken((
char *)
"|"))
1048 ret =
itsData[2]->getToken(currToken);
1049 if(!
itsData[2]->cmpToken((
char *)
"|"))
1052 ret =
itsData[2]->getToken(currToken);
1054 if(!
itsData[2]->cmpToken((
char *)
"\n"))
1056 if(
itsData[2]->cmpToken((
char *)
"CMD"))
1058 if(
itsData[2]->cmpToken((
char *)
"RPC"))
1060 ret =
itsData[2]->getToken(currToken);
1061 if(!
itsData[2]->cmpToken((
char *)
"\n"))
1071 client = node = &none;
1072 ret =
itsData[3]->getToken(currToken);
1075 ret =
itsData[3]->getToken(currToken);
1076 if(!
itsData[3]->cmpToken((
char *)
"@"))
1078 ret =
itsData[3]->getToken(currToken);
1081 ret =
itsData[3]->getToken(currToken);
1082 if(!
itsData[3]->cmpToken((
char *)
"|"))
1095 delete[] dimDnsNode;
1101 return a.
send((
char *)name, &data,
sizeof(
int));
1107 return a.
send((
char *)name, &data,
sizeof(
float));
1113 return a.
send((
char *)name, &data,
sizeof(
double));
1125 return a.
send((
char *)name, &data,
sizeof(
short));
1131 return a.
send((
char *)name, (
char *)data, (
int)strlen(data)+1);
1137 return a.
send((
char *)name, data, datasize);
1143 a.
sendNB((
char *)name, &data,
sizeof(
int));
1149 a.
sendNB((
char *)name, &data,
sizeof(
float));
1155 a.
sendNB((
char *)name, &data,
sizeof(
double));
1167 a.
sendNB((
char *)name, &data,
sizeof(
short));
1173 a.
sendNB((
char *)name, data, (
int)strlen(data)+1);
1179 a.
sendNB((
char *)name, data, datasize);
1186 char *name =
new char[(int)strlen(srvName) + 20];
1187 strcpy(name,(
char *)srvName);
1188 strcat(name,
"/SET_EXIT_HANDLER");
1189 ret = a.
send(name, &tag,
sizeof(
int));
1198 char *name =
new char[(int)strlen(srvName) + 20];
1199 strcpy(name,(
char *)srvName);
1200 strcat(name,
"/EXIT");
1201 ret = a.
send(name, &tag,
sizeof(
int));
1224 dimDnsNode =
new char[256];
1252 if(DimClient::itsCltError != 0)
1253 DimClient::itsCltError->
errorHandler(severity, code, msg);
1263 DimClient::itsCltError = 0;
1267 DimClient::itsCltError =
handler;
1274 DimClient::itsCltError =
this;
1322 int id, len = 0, index = 0;
1324 static char** list = 0;
1344 list =
new char*[len];
1353 list =
new char*[1];
int getServerClients(const char *serverName)
static int getServerPid()
static int sendCommand(const char *name, int data)
unsigned dic_info_service_stamped(char *serv_name, int req_type, int req_timeout, void *serv_address, int serv_size, void(*usr_routine)(), dim_long tag, void *fill_addr, int fill_size)
void dic_add_error_handler(void(*user_routine)())
unsigned dic_info_service(char *serv_name, int req_type, int req_timeout, void *serv_address, int serv_size, void(*usr_routine)(), dim_long tag, void *fill_addr, int fill_size)
virtual void rpcInfoHandler()
virtual ~DimCurrentInfo()
static void data_user_routine(void *tagp, void *bufp, int *size)
int getNextServerClient(char *&client, char *&node)
static char * getDnsNode()
void subscribe(char *name, void *nolink, int nolinksize, int time)
virtual ~DimStampedInfo()
virtual void infoHandler()=0
static int killServer(const char *serverName)
int getServices(const char *serviceName)
static DimErrorHandler * itsCltError
int dic_set_dns_node(char *node)
void doIt(void *data, int size)
static void rpc_user_routine(void *tagp, void *bufp, int *sizep)
int dic_get_server(char *name)
int dic_get_quality(unsigned serv_id)
int getTimestampMillisecs()
static void clt_error_user_routine(int severity, int code, char *msg)
int dic_set_dns_port(int port)
virtual void infoHandler()
int send(char *name, void *data, int datasize)
int dic_get_server_pid(int *pid)
char * dic_get_server_services(int conn_id)
int getToken(char *&token)
int dic_cmnd_service(char *serv_name, void *serv_address, int serv_size)
void subscribe(char *name, void *nolink, int nolinksize, int time, DimInfoHandler *handler)
int dic_get_dns_node(char *node)
static void sendCommandNB(const char *name, int data)
static int setDnsNode(const char *node)
virtual void errorHandler(int severity, int code, char *msg)=0
static int getNoDataCopy()
static int setExitHandler(const char *serverName)
Warning because the service this data corrsponds to might have been last updated longer ago than Local time
DimInfoHandler * itsHandler
static char * getServerName()
int getServerServices(const char *serverName)
int getNextServerService(char *&service, char *&format)
virtual void subscribe(char *name, int time, void *nolink, int nolinksize, DimInfoHandler *handler)
int getNextServer(char *&server, char *&node)
static void handler(int conn_id, char *packet, int size, int status)
static char ** getServerServices()
void sendNB(char *name, void *data, int datasize)
void subscribe(char *name, void *data, int size, void *nolink, int nolinksize, int timeout)
void dic_release_service(unsigned service_id)
static void setNoDataCopy()
char * dic_get_format(unsigned serv_id)
static void cmnd_done(void *tagp, int *result)
void subscribe(char *name, void *nolink, int nolinksize, int time, DimInfoHandler *handler)
static void user_routine(void *tagp, void *bufp, int *size)
int getNextService(char *&service, char *&format)
virtual ~DimUpdatedInfo()
int dic_cmnd_callback(char *serv_name, void *serv_address, int serv_size, void(*usr_routine)(), dim_long tag)
int dic_get_timestamp(unsigned serv_id, int *secs, int *milisecs)