29 if(strstr(server,
"DIS_DNS") != 0)
32 cout <<
"received from " << server <<
" size = " << srv_size << endl;
33 if(strstr(srv_name,
"DIS_DNS") == 0)
50 srv =
new DimService(srv_name, srv_format, srv_data, srv_size);
52 srv->
setData(srv_data, srv_size);
63 srv->
setData(srv_data, srv_size);
78 strcpy(srv_format, format);
79 strcpy(srv_name, name);
87 strcpy(srv_format, format);
88 strcpy(srv_name, name);
108 void set() {found = 1;};
116 char srv_format[256];
137 strcpy(srv_name, name);
142 void set() {found = 1;};
149 cout <<
"Usage: DimBridge [from_node] to_node services [time_interval] [-copy]" << endl;
150 cout <<
" from_node - by default DIM_DNS_NODE" << endl;
151 cout <<
" to_node - the complete node name of the new DNS" << endl;
152 cout <<
" services - the list of service names (wildcards allowed)" << endl;
153 cout <<
" time_interval - the interval in seconds to be used for updating the services" << endl;
154 cout <<
" -copy - copy internally the service data" << endl;
157 int main(
int argc,
char **argv)
161 char *service, *format, *p;
179 strcpy(services, argv[2]);
183 if(sscanf(argv[3],
"%d", &rate))
187 strcpy(services, argv[2]);
189 else if(argv[3][0] ==
'-')
194 strcpy(services, argv[2]);
202 strcpy(services, argv[3]);
207 if(sscanf(argv[4],
"%d", &rate))
211 strcpy(services, argv[3]);
213 else if(argv[4][0] ==
'-')
216 if(sscanf(argv[3],
"%d", &rate))
220 strcpy(services, argv[2]);
227 strcpy(services, argv[3]);
235 strcpy(services, argv[3]);
236 sscanf(argv[4],
"%d", &rate);
241 cout <<
"Bad parameters" << endl;
245 cout <<
"Starting DimBridge from "<<
from_node<<
" to "<<
to_node<<
" for "<< services;
247 cout <<
" interval=" << rate;
249 cout <<
" (internal data copy)";
284 if(!strcmp(ptrs->
getName(), service))
295 if(!strcmp(ptrc->
getName(), service))
303 if(strstr(service,
"DIS_DNS"))
static char from_node[64]
static char * getDnsNode()
int getServices(const char *serviceName)
BridgeService(char *name, char *format, int copy)
BridgeService(char *name, char *format, int rate, int copy)
void add(SLLItem *itemptr)
BridgeCommand(char *name, char *format)
static void sendCommandNB(const char *name, int data)
static int setDnsNode(const char *node)
static char bridge_name[64]
void setData(void *data, int size)
static int setDnsNode(const char *node)
static char * getServerName()
void dim_print_date_time()
sprintf(name1,"NewService%d", i)
void remove(SLLItem *itemptr)
int getNextService(char *&service, char *&format)
int main(int argc, char **argv)