MIDAS
Loading...
Searching...
No Matches
mserver.cxx
Go to the documentation of this file.
1/********************************************************************\
2
3 Name: mserver.c
4 Created by: Stefan Ritt
5
6 Contents: Server program for midas RPC calls
7
8 $Id$
9
10\********************************************************************/
11
12#undef NDEBUG // midas required assert() to be always enabled
13
14#include "midas.h"
15#include "msystem.h"
16#include "mstrlcpy.h"
17
18#ifdef OS_UNIX
19#include <sys/types.h>
20#endif
21
23
25
26INT rpc_server_dispatch(INT index, void *prpc_param[]);
27
28/*---- debug_print -------------------------------------------------*/
29
30void debug_print(const char *msg)
31{
32 std::string file_name;
33 static std::string client_name;
34 static DWORD start_time = 0;
35
36 if (!start_time)
37 start_time = ss_millitime();
38
39 /* print message to file */
40#ifdef OS_LINUX
41 file_name = "/tmp/mserver.log";
42#else
45 file_name += DIR_SEPARATOR_STRING;
46 }
47 file_name += "mserver.log";
48#endif
49
50 FILE *f = fopen(file_name.c_str(), "a");
51
52 if (!f) {
53 fprintf(stderr, "Cannot open \"%s\", errno %d (%s)\n", file_name.c_str(), errno, strerror(errno));
54 return;
55 }
56
57 if (client_name.empty())
58 client_name = cm_get_client_name();
59
60 std::string str = msprintf("%10.3lf [%d,%s,%s] ", (ss_millitime() - start_time) / 1000.0,
61 ss_getpid(), callback.host_name.c_str(), client_name.c_str());
62 str += msg;
63 str += "\n";
64
65 fputs(str.c_str(), f);
66 fclose(f);
67}
68
69/*---- main --------------------------------------------------------*/
70
71int main(int argc, char **argv)
72/********************************************************************\
73
74 Routine: main (server.exe)
75
76 Purpose: Main routine for MIDAS server process. If called one
77 parameter, it listens for a connection under
78 MIDAS_TCP_PORT. If a connection is requested, the action
79 depends on the parameter:
80
81 0: Single process server: This process executes RPC calls
82 even if there are several connections.
83
84 1: Multi thread server (only Windows NT): For each conn-
85 ection, a seperate thread is started which servers this
86 connection.
87
88 2: Multi process server (Not MS-DOS): For each conn-
89 ection, a seperate subprocess is started which servers
90 this connection. The subprocess is again server.exe, now
91 with four parameters: the IP address of the calling
92 host, the two port numbers used by the calling
93 host and optionally the name of the experiment to connect
94 to. With this information it calles back the client.
95
96 This technique is necessary since the usual fork() doesn't
97 work on some of the supported systems.
98
99 Input:
100 int argc Number of parameters in command line
101 char **argv Command line parameters:
102
103 ip-addr callback address as longword
104 port-no port number
105 program program name as string
106 experiment experiment name as string
107
108
109 Output:
110 none
111
112 Function value:
113 BM_SUCCESS Successful completion
114
115\********************************************************************/
116{
117 int i, flag;
118 socklen_t size;
119 //char name[256];
120 char str[1000];
121 BOOL inetd, daemon, debug;
122
123#if defined(SIGPIPE) && defined(SIG_IGN)
124 signal(SIGPIPE, SIG_IGN);
125#endif
126
127 setbuf(stdout, NULL);
128 setbuf(stderr, NULL);
129
131 //if (argv[0] == NULL || argv[0][0] == 0)
132 // mstrlcpy(name, "mserver", sizeof(name));
133 //else
134 // mstrlcpy(name, argv[0], sizeof(name));
135
136#ifdef OS_UNIX
138 //if (strchr(name, '/') == 0) {
139 // mstrlcpy(str, "/usr/local/bin/", sizeof(str));
140 // mstrlcat(str, name, sizeof(str));
141 // mstrlcpy(name, str, sizeof(name));
142 //}
143#endif
144
145#if 0
146 printf("mserver main, name [%s]\n", name);
147 for (i=0; i<=argc; i++)
148 printf("argv[%d] is [%s]\n", i, argv[i]);
149 system("/bin/ls -la /proc/self/fd");
150#endif
151
152 if (getenv("MIDAS_MSERVER_DO_NOT_USE_CALLBACK_ADDR"))
154
155 //rpc_set_mserver_path(name);
156
157 /* find out if we were started by inetd */
158 size = sizeof(int);
159 inetd = (getsockopt(0, SOL_SOCKET, SO_TYPE, (void *) &flag, &size) == 0);
160
161 /* check for debug flag */
162 debug = FALSE;
163 for (i = 1; i < argc; i++)
164 if (argv[i][0] == '-' && argv[i][1] == 'd')
165 debug = TRUE;
166
167 if (debug) {
168 debug_print("mserver startup");
169 for (i = 0; i < argc; i++)
170 debug_print(argv[i]);
172 }
173
174 if (argc < 7 && inetd) {
175 /* accept connection from stdin */
177 return 0;
178 }
179
180 if (!inetd && argc < 7)
181 printf("%s started interactively\n", argv[0]);
182
183 debug = daemon = FALSE;
184
185 if (argc < 7 || argv[1][0] == '-') {
186 int status;
188 int port = 0;
189
190 /* Get if existing the pre-defined experiment */
191 expt_name[0] = 0;
192 cm_get_environment(NULL, 0, expt_name, sizeof(expt_name));
193
194 /* parse command line parameters */
195 for (i = 1; i < argc; i++) {
196 if (strncmp(argv[i], "-e", 2) == 0) {
197 mstrlcpy(expt_name, argv[++i], sizeof(expt_name));
198 } else if (argv[i][0] == '-' && argv[i][1] == 'd')
199 debug = TRUE;
200 else if (argv[i][0] == '-' && argv[i][1] == 'D')
201 daemon = TRUE;
202 else if (argv[i][0] == '-' && argv[i][1] == 'p')
203 port = strtoul(argv[++i], NULL, 0);
204 else if (argv[i][0] == '-') {
205 if (i + 1 >= argc || argv[i + 1][0] == '-')
206 goto usage;
207 else {
208 usage:
209 printf("usage: mserver [-e Experiment] [-s][-t][-m][-d][-p port]\n");
210 printf(" -e experiment to connect to\n");
211 printf(" -m Multi process server (default)\n");
212 printf(" -p port Listen for connections on specifed tcp port. Default value is taken from ODB \"/Experiment/midas server port\"\n");
213#ifdef OS_LINUX
214 printf(" -D Become a daemon\n");
215 printf(" -d Write debug info to stdout or to \"/tmp/mserver.log\"\n\n");
216#else
217 printf(" -d Write debug info\"\n\n");
218#endif
219 return 0;
220 }
221 }
222 }
223
224 /* turn on debugging */
225 if (debug) {
226 if (daemon || inetd)
228 else
229 rpc_set_debug((void (*)(const char *)) puts, 1);
230
231 sprintf(str, "Arguments: ");
232 for (i = 0; i < argc; i++)
233 sprintf(str + strlen(str), " %s", argv[i]);
235
236 rpc_debug_printf("Debugging mode is on");
237 }
238
239 /* become a daemon */
240 if (daemon) {
241 printf("Becoming a daemon...\n");
243 }
244
245 /* connect to experiment */
246 status = cm_connect_experiment(NULL, expt_name, "mserver", 0);
247 if (status != CM_SUCCESS) {
248 printf("cannot connect to experiment \"%s\", status %d\n", expt_name, status);
249 exit(1);
250 }
251
252 HNDLE hDB;
254
256 assert(status == CM_SUCCESS);
257
258 int odb_port = MIDAS_TCP_PORT;
259 int size = sizeof(odb_port);
260
261 status = db_get_value(hDB, 0, "/Experiment/Midas server port", &odb_port, &size, TID_DWORD, TRUE);
262 assert(status == DB_SUCCESS);
263
264 if (port == 0)
265 port = odb_port;
266
267 if (port == 0)
268 port = MIDAS_TCP_PORT;
269
270 printf("mserver will listen on TCP port %d\n", port);
271
272 int lsock = 0; // mserver main listener socket
273 int lport = 0; // mserver listener port number
274
275 /* register server */
276 status = rpc_register_listener(port, rpc_server_dispatch, &lsock, &lport);
277 if (status != RPC_SUCCESS) {
278 printf("Cannot start server, rpc_register_server() status %d\n", status);
279 return 1;
280 }
281
282 /* register path of mserver executable */
283 rpc_set_mserver_path(argv[0]);
284
285 /* register MIDAS library functions */
287
289
290 /* run forever */
291 while (1) {
292 status = cm_yield(1000);
293 //printf("status %d\n", status);
294 if (status == RPC_SHUTDOWN)
295 break;
296 }
297
298 closesocket(lsock);
299
301 } else {
302
303 /* here we come if this program is started as a subprocess */
304
305 callback.clear();
306
307 /* extract callback arguments and start receiver */
308#ifdef OS_VMS
309 mstrlcpy(callback.host_name, argv[2], sizeof(callback.host_name));
310 callback.host_port1 = atoi(argv[3]);
311 callback.host_port2 = atoi(argv[4]);
312 callback.host_port3 = atoi(argv[5]);
313 callback.debug = atoi(argv[6]);
314 if (argc > 7)
315 mstrlcpy(callback.experiment, argv[7], sizeof(callback.experiment));
316 if (argc > 8)
317 mstrlcpy(callback.directory, argv[8], sizeof(callback.directory));
318 if (argc > 9)
319 mstrlcpy(callback.user, argv[9], sizeof(callback.user));
320#else
321 callback.host_name = argv[1];
322 callback.host_port1 = atoi(argv[2]);
323 callback.host_port2 = atoi(argv[3]);
324 callback.host_port3 = atoi(argv[4]);
325 callback.debug = atoi(argv[5]);
326 if (argc > 6)
327 callback.experiment = argv[6];
328 if (argc > 7)
329 callback.directory = argv[7];
330 if (argc > 8)
331 callback.user = argv[8];
332#endif
333 //callback.index = 0;
334
335 if (callback.debug) {
337 if (callback.directory[0]) {
338 if (callback.user[0])
339 rpc_debug_printf("Start subprocess in %s under user %s", callback.directory.c_str(), callback.user.c_str());
340 else
341 rpc_debug_printf("Start subprocess in %s", callback.directory.c_str());
342
343 } else
344 rpc_debug_printf("Start subprocess in current directory");
345 }
346
347 /* change the directory and uid */
348 if (callback.directory.length() > 0)
349 if (chdir(callback.directory.c_str()) != 0)
350 rpc_debug_printf("Cannot change to directory \"%s\"", callback.directory.c_str());
351
353
354 /* set the experiment name and expt path name */
355
356 if (callback.directory.length() > 0)
358
359 if (callback.experiment.length() > 0)
361
362 /* must be done after cm_set_path() */
364
365 /* register system functions */
367
368 /* register MIDAS library functions */
370
372
373 if (status != RPC_SUCCESS) {
375 printf("Cannot start mserver, rpc_server_callback() status %d\n", status);
376 return 1;
377 }
378
379 /* create alarm and elog semaphores */
380 int semaphore_alarm, semaphore_elog, semaphore_history, semaphore_msg;
381 ss_semaphore_create("ALARM", &semaphore_alarm);
382 ss_semaphore_create("ELOG", &semaphore_elog);
383 ss_semaphore_create("HISTORY", &semaphore_history);
384 ss_semaphore_create("MSG", &semaphore_msg);
385 cm_set_experiment_semaphore(semaphore_alarm, semaphore_elog, semaphore_history, semaphore_msg);
386
389
391 }
392
393 return 0;
394}
395
396/*------------------------------------------------------------------*/
397
398/* just a small test routine which doubles numbers */
399INT rpc_test(BYTE b, WORD w, INT i, float f, double d, BYTE * b1, WORD * w1, INT * i1, float *f1, double *d1)
400{
401 printf("rpc_test: %d %d %d %1.1f %1.1lf\n", b, w, i, f, d);
402
403 *b1 = b * 2;
404 *w1 = w * 2;
405 *i1 = i * 2;
406 *f1 = f * 2;
407 *d1 = d * 2;
408
409 return 1;
410}
411
412static int test2(INT routine_id, void *prpc_param[])
413{
414 int status = RPC_SUCCESS;
415
416 if (CINT(0) != 123) {
417 cm_msg(MERROR, "rpc_test2", "CINT(0) mismatch");
418 status = 0;
419 }
420
421 CINT(1) = 789;
422
423 if (CINT(2) != 456) {
424 cm_msg(MERROR, "rpc_test2", "CINT(2) mismatch");
425 status = 0;
426 }
427
428 CINT(2) = 2*CINT(2);
429
430 if (strcmp(CSTRING(3), "test string") != 0) {
431 cm_msg(MERROR, "rpc_test2", "CSTRING(3) mismatch");
432 status = 0;
433 }
434
435 if (CINT(5) != 33) {
436 cm_msg(MERROR, "rpc_test2", "CINT(5) string_out size mismatch");
437 status = 0;
438 }
439
440 strcpy(CSTRING(4), "string_out");
441
442 if (CINT(7) != 49) {
443 cm_msg(MERROR, "rpc_test2", "CINT(7) string2_out size mismatch");
444 status = 0;
445 }
446
447 strcpy(CSTRING(6), "second string_out");
448
449 if (CINT(9) != 25) {
450 cm_msg(MERROR, "rpc_test2", "CINT(9) string_inout size mismatch");
451 status = 0;
452 }
453
454 if (strcmp(CSTRING(8), "string_inout") != 0) {
455 cm_msg(MERROR, "rpc_test2", "CSTRING(8) mismatch");
456 status = 0;
457 }
458
459 strcpy(CSTRING(8), "return string_inout");
460
461 // 10, 11, 12 is TID_STRUCT of type KEY
462
463 KEY *pkey;
464
465 pkey = (KEY*)CARRAY(10);
466
467 if (pkey->type != 111 || pkey->num_values != 222 || strcmp(pkey->name, "name") || pkey->last_written != 333) {
468 printf("CKEY(10): type %d, num_values %d, name [%s], last_written %d\n", pkey->type, pkey->num_values, pkey->name, pkey->last_written);
469
470 cm_msg(MERROR, "rpc_test2", "CARRAY(10) KEY mismatch");
471 status = 0;
472 }
473
474 pkey = (KEY*)CARRAY(11);
475
476 pkey->type = 444;
477 pkey->num_values = 555;
478 strcpy(pkey->name, "out_name");
479 pkey->last_written = 666;
480
481 //printf("CKEY(11): type %d, num_values %d, name [%s], last_written %d\n", pkey->type, pkey->num_values, pkey->name, pkey->last_written);
482
483 pkey = (KEY*)CARRAY(12);
484
485 if (pkey->type != 111111 || pkey->num_values != 222222 || strcmp(pkey->name, "name_name") || pkey->last_written != 333333) {
486 printf("CKEY(10): type %d, num_values %d, name [%s], last_written %d\n", pkey->type, pkey->num_values, pkey->name, pkey->last_written);
487
488 cm_msg(MERROR, "rpc_test2", "CARRAY(12) KEY mismatch");
489 status = 0;
490 }
491
492 pkey->type = 444444;
493 pkey->num_values = 555555;
494 strcpy(pkey->name, "inout_name");
495 pkey->last_written = 666666;
496
497 //printf("CKEY(10): type %d, num_values %d, name [%s], last_written %d\n", pkey->type, pkey->num_values, pkey->name, pkey->last_written);
498
499 int iarg = 13;
500
501#if 1
502 if (CINT(iarg+1) != 36) {
503 cm_msg(MERROR, "rpc_test2", "CINT(%d) array_in size mismatch", iarg+1);
504 status = 0;
505 } else {
506 //printf("CARRAY(13): %p, 0x%08x [%s]\n", CARRAY(9), *(uint32_t*)CARRAY(9), (char*)CARRAY(9));
507
508 uint32_t size = CINT(iarg+1)/4;
509 for (uint32_t i=0; i<size; i++) {
510 if (((uint32_t*)CARRAY(iarg))[i] != i*10) {
511 cm_msg(MERROR, "rpc_test2", "CARRAY(%d) dwordarray_inout mismatch at %d, %d vs %d", iarg, i, ((uint32_t*)CARRAY(iarg))[i], i*10);
512 status = 0;
513 }
514 }
515 }
516
517 for (int i=0; i<5; i++) {
518 ((uint32_t*)CARRAY(iarg))[i] = i*10 + i;
519 }
520
521 CINT(iarg+1) = 20;
522
523 //printf("CINT(%d) ptr %p\n", iarg+1, &CINT(iarg+1));
524
525 iarg += 2;
526#endif
527
528#if 1
529 if (CINT(iarg+1) != 10) {
530 cm_msg(MERROR, "rpc_test2", "CINT(%d) array_in size mismatch", iarg+1);
531 status = 0;
532 } else {
533 //printf("CARRAY(15): %p, 0x%08x [%s]\n", CARRAY(15), *(uint32_t*)CARRAY(15), (char*)CARRAY(15));
534
535 for (int i=0; i<CINT(iarg+1); i++) {
536 if (((char*)CARRAY(iarg))[i] != 'a'+i) {
537 cm_msg(MERROR, "rpc_test2", "CARRAY(%d) array_in data mismatch at %d, %d vs %d", iarg, i, ((char*)CARRAY(iarg))[i], 'a'+i);
538 status = 0;
539 }
540 }
541 }
542
543 iarg += 2;
544#endif
545
546#if 1
547 if (CINT(iarg+1) != 16) {
548 cm_msg(MERROR, "rpc_test2", "CINT(%d) array_out size mismatch", iarg+1);
549 status = 0;
550 }
551
552 strcpy((char*)CARRAY(iarg), "test test test");
553 CINT(iarg+1) = 1 + strlen((char*)CARRAY(iarg));
554
555 iarg += 2;
556#endif
557
558 return status;
559}
560
561static int test2_cxx(INT routine_id, void *prpc_param[])
562{
563 int status = RPC_SUCCESS;
564
565 if (CINT(0) != 123) {
566 cm_msg(MERROR, "rpc_test2_cxx", "CINT(0) mismatch");
567 status = 0;
568 }
569
570 CINT(1) = 789;
571
572 if (CINT(2) != 456) {
573 cm_msg(MERROR, "rpc_test2_cxx", "CINT(2) mismatch");
574 status = 0;
575 }
576
577 CINT(2) = 2*CINT(2);
578
579 if (strcmp(CSTRING(3), "test string") != 0) {
580 cm_msg(MERROR, "rpc_test2_cxx", "CSTRING(3) mismatch");
581 status = 0;
582 }
583
584 if (CINT(5) != 33) {
585 cm_msg(MERROR, "rpc_test2_cxx", "CINT(5) string_out size mismatch");
586 status = 0;
587 }
588
589 strcpy(CSTRING(4), "string_out");
590
591 if (CINT(7) != 48) {
592 cm_msg(MERROR, "rpc_test2_cxx", "CINT(7) string2_out size mismatch");
593 status = 0;
594 }
595
596 CSTDSTRING(6) = "second string_out";
597
598 if (CINT(9) != 25) {
599 cm_msg(MERROR, "rpc_test2_cxx", "CINT(9) string_inout size mismatch");
600 status = 0;
601 }
602
603 if (CSTDSTRING(8) != "string_inout") {
604 cm_msg(MERROR, "rpc_test2_cxx", "CSTDSTRING(8) mismatch");
605 status = 0;
606 }
607
608 CSTDSTRING(8) = "return string_inout";
609
610 // 10, 11, 12 is TID_STRUCT of type KEY
611
612 KEY *pkey;
613
614 pkey = (KEY*)CARRAY(10);
615
616 if (pkey->type != 111 || pkey->num_values != 222 || strcmp(pkey->name, "name") || pkey->last_written != 333) {
617 printf("CKEY(10): type %d, num_values %d, name [%s], last_written %d\n", pkey->type, pkey->num_values, pkey->name, pkey->last_written);
618
619 cm_msg(MERROR, "rpc_test2_cxx", "CARRAY(10) KEY mismatch");
620 status = 0;
621 }
622
623 pkey = (KEY*)CARRAY(11);
624
625 pkey->type = 444;
626 pkey->num_values = 555;
627 strcpy(pkey->name, "out_name");
628 pkey->last_written = 666;
629
630 //printf("CKEY(11): type %d, num_values %d, name [%s], last_written %d\n", pkey->type, pkey->num_values, pkey->name, pkey->last_written);
631
632 pkey = (KEY*)CARRAY(12);
633
634 if (pkey->type != 111111 || pkey->num_values != 222222 || strcmp(pkey->name, "name_name") || pkey->last_written != 333333) {
635 printf("CKEY(10): type %d, num_values %d, name [%s], last_written %d\n", pkey->type, pkey->num_values, pkey->name, pkey->last_written);
636
637 cm_msg(MERROR, "rpc_test2_cxx", "CARRAY(12) KEY mismatch");
638 status = 0;
639 }
640
641 pkey->type = 444444;
642 pkey->num_values = 555555;
643 strcpy(pkey->name, "inout_name");
644 pkey->last_written = 666666;
645
646 //printf("CKEY(10): type %d, num_values %d, name [%s], last_written %d\n", pkey->type, pkey->num_values, pkey->name, pkey->last_written);
647
648 int iarg = 13;
649
650#if 1
651 if (CINT(iarg+1) != 36) {
652 cm_msg(MERROR, "rpc_test2_cxx", "CINT(%d) dwordarray_inout size mismatch", iarg+1);
653 status = 0;
654 } else {
655 //printf("CARRAY(13): %p, 0x%08x [%s]\n", CARRAY(9), *(uint32_t*)CARRAY(9), (char*)CARRAY(9));
656
657 uint32_t size = CINT(iarg+1)/4;
658 for (uint32_t i=0; i<size; i++) {
659 if (((uint32_t*)CARRAY(iarg))[i] != i*10) {
660 cm_msg(MERROR, "rpc_test2_cxx", "CARRAY(%d) dwordarray_inout mismatch at %d, %d vs %d", iarg, i, ((uint32_t*)CARRAY(iarg))[i], i*10);
661 status = 0;
662 }
663 }
664 }
665
666 for (int i=0; i<5; i++) {
667 ((uint32_t*)CARRAY(iarg))[i] = i*10 + i;
668 }
669
670 CINT(iarg+1) = 20;
671
672 //printf("CINT(%d) ptr %p\n", iarg+1, &CINT(iarg+1));
673
674 iarg += 2;
675#endif
676
677#if 1
678 if (CSTDVECTOR(iarg).size() != 10) {
679 cm_msg(MERROR, "rpc_test2_cxx", "CSTDVECTOR(%d) array_in size mismatch, %zu vs expected %d", iarg, CSTDVECTOR(iarg).size(), 10);
680 status = 0;
681 } else {
682 //printf("CARRAY(15): %p, 0x%08x [%s]\n", CARRAY(15), *(uint32_t*)CARRAY(15), (char*)CARRAY(15));
683
684 for (size_t i=0; i<CSTDVECTOR(iarg).size(); i++) {
685 if (((char*)CSTDVECTOR(iarg).data())[i] != ('a'+(int)i)) {
686 cm_msg(MERROR, "rpc_test2_cxx", "CSTDVECTOR(%d) array_in data mismatch at %zu, %d vs %d", iarg, i, ((char*)CSTDVECTOR(iarg).data())[i], 'a'+(int)i);
687 status = 0;
688 }
689 }
690 }
691
692 iarg += 2;
693#endif
694
695#if 1
696 if (CINT(iarg+1) != 16) {
697 cm_msg(MERROR, "rpc_test2_cxx", "CINT(%d) array_out size mismatch", iarg+1);
698 status = 0;
699 }
700
701 const char* array_out_string = "test test test";
702 size_t array_out_string_size = 1 + strlen(array_out_string);
703 CSTDVECTOR(iarg).insert(CSTDVECTOR(iarg).end(), array_out_string, array_out_string + array_out_string_size);
704 CINT(iarg+1) = array_out_string_size;
705
706 iarg += 2;
707#endif
708
709 return status;
710}
711
712static int test3_cxx(INT routine_id, void *prpc_param[])
713{
714 int status = RPC_SUCCESS;
715
716 if (CINT(0) != 123) {
717 cm_msg(MERROR, "rpc_test3_cxx", "CINT(0) mismatch");
718 status = 0;
719 }
720
721 CINT(1) = 789;
722
723 if (CINT(2) != 456) {
724 cm_msg(MERROR, "rpc_test3_cxx", "CINT(2) mismatch");
725 status = 0;
726 }
727
728 CINT(2) = 2*CINT(2);
729
730 if (strcmp(CSTRING(3), "test string") != 0) {
731 cm_msg(MERROR, "rpc_test3_cxx", "CSTRING(3) mismatch");
732 status = 0;
733 }
734
735 if (CINT(5) != 33) {
736 cm_msg(MERROR, "rpc_test3_cxx", "CINT(5) string_out size mismatch");
737 status = 0;
738 }
739
740 strcpy(CSTRING(4), "string_out");
741
742 if (CSTDSTRING(6).length() != 0) {
743 cm_msg(MERROR, "rpc_test3_cxx", "CSTDSTRING(6) string2_out size mismatch");
744 status = 0;
745 }
746
747 CSTDSTRING(6) = "second string_out";
748
749 if (CSTDSTRING(7) != "string_inout") {
750 cm_msg(MERROR, "rpc_test3_cxx", "CSTDSTRING(6) mismatch");
751 status = 0;
752 }
753
754 CSTDSTRING(7) = "return string_inout";
755
756 // 8, 9, 10 is TID_STRUCT of type KEY
757
758 int iarg = 8;
759
760 KEY *pkey;
761
762 pkey = (KEY*)CARRAY(iarg);
763
764 if (pkey->type != 111 || pkey->num_values != 222 || strcmp(pkey->name, "name") || pkey->last_written != 333) {
765 printf("CKEY(%d): type %d, num_values %d, name [%s], last_written %d\n", iarg, pkey->type, pkey->num_values, pkey->name, pkey->last_written);
766
767 cm_msg(MERROR, "rpc_test3_cxx", "CARRAY(%d) KEY mismatch", iarg);
768 status = 0;
769 }
770
771 iarg++;
772
773 pkey = (KEY*)CARRAY(iarg);
774
775 pkey->type = 444;
776 pkey->num_values = 555;
777 strcpy(pkey->name, "out_name");
778 pkey->last_written = 666;
779
780 //printf("CKEY(%d): type %d, num_values %d, name [%s], last_written %d\n", iarg, pkey->type, pkey->num_values, pkey->name, pkey->last_written);
781
782 iarg++;
783
784 pkey = (KEY*)CARRAY(iarg);
785
786 if (pkey->type != 111111 || pkey->num_values != 222222 || strcmp(pkey->name, "name_name") || pkey->last_written != 333333) {
787 printf("CKEY(%d): type %d, num_values %d, name [%s], last_written %d\n", iarg, pkey->type, pkey->num_values, pkey->name, pkey->last_written);
788
789 cm_msg(MERROR, "rpc_test3_cxx", "CARRAY(%d) KEY mismatch", iarg);
790 status = 0;
791 }
792
793 pkey->type = 444444;
794 pkey->num_values = 555555;
795 strcpy(pkey->name, "inout_name");
796 pkey->last_written = 666666;
797
798 //printf("CKEY(%d): type %d, num_values %d, name [%s], last_written %d\n", iarg, pkey->type, pkey->num_values, pkey->name, pkey->last_written);
799
800 iarg++;
801
802#if 1
803 if (CINT(iarg+1) != 36) {
804 cm_msg(MERROR, "rpc_test3_cxx", "CINT(%d) dwordarray_inout size mismatch", iarg+1);
805 status = 0;
806 } else {
807 //printf("CARRAY(13): %p, 0x%08x [%s]\n", CARRAY(9), *(uint32_t*)CARRAY(9), (char*)CARRAY(9));
808
809 uint32_t size = CINT(iarg+1)/4;
810 for (uint32_t i=0; i<size; i++) {
811 if (((uint32_t*)CARRAY(iarg))[i] != i*10) {
812 cm_msg(MERROR, "rpc_test3_cxx", "CARRAY(%d) dwordarray_inout mismatch at %d, %d vs %d", iarg, i, ((uint32_t*)CARRAY(iarg))[i], i*10);
813 status = 0;
814 }
815 }
816 }
817
818 for (int i=0; i<5; i++) {
819 ((uint32_t*)CARRAY(iarg))[i] = i*10 + i;
820 }
821
822 CINT(iarg+1) = 20;
823
824 //printf("CINT(%d) ptr %p\n", iarg+1, &CINT(iarg+1));
825
826 iarg += 2;
827#endif
828
829#if 1
830 if (CSTDVECTOR(iarg).size() != 10) {
831 cm_msg(MERROR, "rpc_test3_cxx", "CSTDVECTOR(%d) array_in size mismatch, %zu vs expected %d", iarg, CSTDVECTOR(iarg).size(), 10);
832 status = 0;
833 } else {
834 //printf("CARRAY(15): %p, 0x%08x [%s]\n", CARRAY(15), *(uint32_t*)CARRAY(15), (char*)CARRAY(15));
835
836 for (size_t i=0; i<CSTDVECTOR(iarg).size(); i++) {
837 if (((char*)CSTDVECTOR(iarg).data())[i] != ('a'+(int)i)) {
838 cm_msg(MERROR, "rpc_test3_cxx", "CSTDVECTOR(%d) array_in data mismatch at %zu, %d vs %d", iarg, i, ((char*)CSTDVECTOR(iarg).data())[i], 'a'+(int)i);
839 status = 0;
840 }
841 }
842 }
843
844 iarg += 1;
845#endif
846
847#if 1
848 if (CSTDVECTOR(iarg).size() != 0) {
849 cm_msg(MERROR, "rpc_test3_cxx", "CSTDVECTOR(%d) array_out size mismatch", iarg);
850 status = 0;
851 }
852
853 const char* array_out_string = "test test test";
854 size_t array_out_string_size = 1 + strlen(array_out_string);
855 CSTDVECTOR(iarg).insert(CSTDVECTOR(iarg).end(), array_out_string, array_out_string + array_out_string_size);
856
857 iarg += 1;
858#endif
859
860 return status;
861}
862
863static int test4_cxx(INT routine_id, void *prpc_param[])
864{
865 int status = RPC_SUCCESS;
866
867 if (CINT(0) != 123) {
868 cm_msg(MERROR, "rpc_test4_cxx", "CINT(0) mismatch");
869 status = 0;
870 }
871
872 CINT(1) = 789;
873
874 if (CINT(2) != 456) {
875 cm_msg(MERROR, "rpc_test4_cxx", "CINT(2) mismatch");
876 status = 0;
877 }
878
879 CINT(2) = 2*CINT(2);
880
881 if (CSTDSTRING(3) != "test string") {
882 cm_msg(MERROR, "rpc_test4_cxx", "CSTDSTRING(3) mismatch");
883 status = 0;
884 }
885
886 CSTDSTRING(4) = "return string_out";
887
888 if (CSTDSTRING(5) != "string_inout") {
889 cm_msg(MERROR, "rpc_test4_cxx", "CSTDSTRING(5) mismatch");
890 status = 0;
891 }
892
893 CSTDSTRING(5) = "return string_inout";
894
895 int iarg = 6;
896
897#if 1
898 if (CSTDVECTOR(iarg).size() != 10) {
899 cm_msg(MERROR, "rpc_test4_cxx", "CSTDVECTOR(%d) array_in size mismatch, %zu vs expected %d", iarg, CSTDVECTOR(iarg).size(), 10);
900 status = 0;
901 } else {
902 //printf("CARRAY(15): %p, 0x%08x [%s]\n", CARRAY(15), *(uint32_t*)CARRAY(15), (char*)CARRAY(15));
903
904 for (size_t i=0; i<CSTDVECTOR(iarg).size(); i++) {
905 if (((char*)CSTDVECTOR(iarg).data())[i] != ('a'+(int)i)) {
906 cm_msg(MERROR, "rpc_test4_cxx", "CSTDVECTOR(%d) array_in data mismatch at %zu, %d vs %d", iarg, i, ((char*)CSTDVECTOR(iarg).data())[i], 'a'+(int)i);
907 status = 0;
908 }
909 }
910 }
911
912 iarg += 1;
913#endif
914
915#if 1
916 if (CSTDVECTOR(iarg).size() != 0) {
917 cm_msg(MERROR, "rpc_test4_cxx", "CSTDVECTOR(%d) array_out size mismatch", iarg);
918 status = 0;
919 }
920
921 const char* array_out_string = "test test test";
922 size_t array_out_string_size = 1 + strlen(array_out_string);
923 CSTDVECTOR(iarg).insert(CSTDVECTOR(iarg).end(), array_out_string, array_out_string + array_out_string_size);
924
925 iarg += 1;
926#endif
927
928#if 1
929 if (CSTDVECTOR(iarg).size() != 6) {
930 cm_msg(MERROR, "rpc_test4_cxx", "CSTDVECTOR(%d) array_inout size mismatch, %zu vs expected %d", iarg, CSTDVECTOR(iarg).size(), 6);
931 status = 0;
932 } else {
933 //printf("CARRAY(15): %p, 0x%08x [%s]\n", CARRAY(15), *(uint32_t*)CARRAY(15), (char*)CARRAY(15));
934
935 for (size_t i=0; i<CSTDVECTOR(iarg).size(); i++) {
936 if (((char*)CSTDVECTOR(iarg).data())[i] != ('0'+(int)i)) {
937 cm_msg(MERROR, "rpc_test4_cxx", "CSTDVECTOR(%d) array_in data mismatch at %zu, %d vs %d", iarg, i, ((char*)CSTDVECTOR(iarg).data())[i], 'a'+(int)i);
938 status = 0;
939 }
940 }
941
942 for (size_t i=0; i<6; i++) {
943 CSTDVECTOR(iarg).push_back(2*CSTDVECTOR(iarg)[i]);
944 }
945 }
946
947 iarg += 1;
948#endif
949
950 return status;
951}
952
953/*----- rpc_server_dispatch ----------------------------------------*/
954
955INT rpc_server_dispatch(INT routine_id, void *prpc_param[])
956/********************************************************************\
957
958 Routine: rpc_server_dispatch
959
960 Purpose: This routine gets registered as the callback function
961 for all RPC calls via rpc_server_register. It acts as a
962 stub to call the local midas subroutines. It uses the
963 Cxxx(i) macros to cast parameters in prpc_param to
964 their appropriate types.
965
966 Input:
967 int routine_id RPC index defined in RPC.H
968 void *prpc_param pointer to rpc parameter array
969
970 Output:
971 none
972
973 Function value:
974 status status returned from local midas function
975
976\********************************************************************/
977{
978 INT status = 0;
979
980 int convert_flags = rpc_get_convert_flags();
981
982 switch (routine_id) {
983 /* common functions */
984
987 CSTRING(3), CINT(4), CSTRING(5), CINT(6));
988 break;
989
992 break;
993
996 break;
997
998 case RPC_CM_CLEANUP:
999 status = cm_cleanup(CSTRING(0), CBOOL(1));
1000 break;
1001
1004 break;
1005
1006 case RPC_CM_MSG:
1007 status = cm_msg(CINT(0), CSTRING(1), CINT(2), CSTRING(3), "%s", CSTRING(4));
1008 break;
1009
1010 case RPC_CM_MSG_LOG:
1011 status = cm_msg_log(CINT(0), CSTRING(1), CSTRING(2));
1012 break;
1013
1014 case RPC_CM_EXECUTE:
1015 status = cm_execute(CSTRING(0), CSTRING(1), CINT(2));
1016 break;
1017
1018 case RPC_CM_EXIST:
1019 status = cm_exist(CSTRING(0), CBOOL(1));
1020 break;
1021
1022 case RPC_CM_SYNCHRONIZE:
1024 break;
1025
1026 case RPC_CM_ASCTIME: {
1027 std::string now = cm_asctime();
1028 mstrlcpy(CSTRING(0), now.c_str(), CINT(1));
1030 break;
1031 }
1032
1033 case RPC_CM_TIME:
1034 status = cm_time(CPDWORD(0));
1035 break;
1036
1038 status = cm_msg_retrieve(CINT(0), CSTRING(1), CINT(2));
1039 break;
1040
1041 /* buffer manager functions */
1042
1043 case RPC_BM_OPEN_BUFFER:
1044 status = bm_open_buffer(CSTRING(0), CINT(1), CPINT(2));
1045 break;
1046
1048 //printf("RPC_BM_CLOSE_BUFFER(%d)!\n", CINT(0));
1050 break;
1051
1053 //printf("RPC_BM_CLOSE_ALL_BUFFERS!\n");
1055 break;
1056
1059 if (convert_flags) {
1060 BUFFER_HEADER *pb;
1061
1062 /* convert event header */
1063 pb = (BUFFER_HEADER *) CARRAY(1);
1064 rpc_convert_single(&pb->num_clients, TID_INT, RPC_OUTGOING, convert_flags);
1066 rpc_convert_single(&pb->size, TID_INT, RPC_OUTGOING, convert_flags);
1067 rpc_convert_single(&pb->read_pointer, TID_INT, RPC_OUTGOING, convert_flags);
1071 }
1072 break;
1073
1076 break;
1077
1080 break;
1081
1083 status = bm_set_cache_size(CINT(0), CINT(1), CINT(2));
1084 break;
1085
1088 CSHORT(2), CINT(3), (void (*)(HNDLE, HNDLE, EVENT_HEADER *, void *))
1089 (POINTER_T)
1090 CINT(4), CINT(5));
1091 break;
1092
1095 break;
1096
1097 case RPC_BM_SEND_EVENT:
1098 if (convert_flags) {
1099 EVENT_HEADER *pevent;
1100
1101 /* convert event header */
1102 pevent = (EVENT_HEADER *) CARRAY(1);
1103 rpc_convert_single(&pevent->event_id, TID_SHORT, 0, convert_flags);
1104 rpc_convert_single(&pevent->trigger_mask, TID_SHORT, 0, convert_flags);
1105 rpc_convert_single(&pevent->serial_number, TID_DWORD, 0, convert_flags);
1106 rpc_convert_single(&pevent->time_stamp, TID_DWORD, 0, convert_flags);
1107 rpc_convert_single(&pevent->data_size, TID_DWORD, 0, convert_flags);
1108 }
1109
1110 status = bm_send_event(CINT(0), (const EVENT_HEADER*)(CARRAY(1)), CINT(2), CINT(3));
1111 break;
1112
1114 status = bm_receive_event(CINT(0), CARRAY(1), CPINT(2), CINT(3));
1115 break;
1116
1119 break;
1120
1121 case RPC_BM_SKIP_EVENT:
1123 break;
1124
1125 case RPC_BM_FLUSH_CACHE:
1126 //printf("RPC_BM_FLUSH_CACHE(%d,%d)!\n", CINT(0), CINT(1));
1127 if (CINT(0) == 0) {
1129 } else {
1130 status = bm_flush_cache(CINT(0), CINT(1));
1131 }
1132 break;
1133
1136 break;
1137
1140 break;
1141
1142 /* database functions */
1143
1146 break;
1147
1150 break;
1151
1154 break;
1155
1158 break;
1159
1160 case RPC_DB_CREATE_KEY:
1161 status = db_create_key(CHNDLE(0), CHNDLE(1), CSTRING(2), CDWORD(3));
1162 break;
1163
1164 case RPC_DB_CREATE_LINK:
1166 break;
1167
1168 case RPC_DB_SET_VALUE:
1169 rpc_convert_data(CARRAY(3), CDWORD(6), RPC_FIXARRAY, CINT(4), convert_flags);
1170 status = db_set_value(CHNDLE(0), CHNDLE(1), CSTRING(2), CARRAY(3), CINT(4), CINT(5), CDWORD(6));
1171 break;
1172
1173 case RPC_DB_GET_VALUE:
1174 rpc_convert_data(CARRAY(3), CDWORD(5), RPC_FIXARRAY, CINT(4), convert_flags);
1175 status = db_get_value(CHNDLE(0), CHNDLE(1), CSTRING(2), CARRAY(3), CPINT(4), CDWORD(5), CBOOL(6));
1176 rpc_convert_data(CARRAY(3), CDWORD(5), RPC_FIXARRAY | RPC_OUTGOING, CINT(4), convert_flags);
1177 break;
1178
1179 case RPC_DB_FIND_KEY:
1180 status = db_find_key(CHNDLE(0), CHNDLE(1), CSTRING(2), CPHNDLE(3));
1181 break;
1182
1183 case RPC_DB_FIND_LINK:
1184 status = db_find_link(CHNDLE(0), CHNDLE(1), CSTRING(2), CPHNDLE(3));
1185 break;
1186
1187 case RPC_DB_GET_PATH: {
1188 std::string path = db_get_path(CHNDLE(0), CHNDLE(1));
1189 mstrlcpy(CSTRING(2), path.c_str(), CINT(3));
1191 break;
1192 }
1193
1194 case RPC_DB_GET_PARENT:
1196 break;
1197
1198 case RPC_DB_DELETE_KEY:
1200 break;
1201
1202 case RPC_DB_ENUM_KEY:
1203 status = db_enum_key(CHNDLE(0), CHNDLE(1), CINT(2), CPHNDLE(3));
1204 break;
1205
1206 case RPC_DB_ENUM_LINK:
1207 status = db_enum_link(CHNDLE(0), CHNDLE(1), CINT(2), CPHNDLE(3));
1208 break;
1209
1212 break;
1213
1214 case RPC_DB_GET_KEY:
1215 status = db_get_key(CHNDLE(0), CHNDLE(1), (KEY*)CARRAY(2));
1216 if (convert_flags) {
1217 KEY *pkey;
1218
1219 pkey = (KEY *) CARRAY(2);
1220 rpc_convert_single(&pkey->type, TID_DWORD, RPC_OUTGOING, convert_flags);
1221 rpc_convert_single(&pkey->num_values, TID_INT, RPC_OUTGOING, convert_flags);
1222 rpc_convert_single(&pkey->data, TID_INT, RPC_OUTGOING, convert_flags);
1223 rpc_convert_single(&pkey->total_size, TID_INT, RPC_OUTGOING, convert_flags);
1224 rpc_convert_single(&pkey->item_size, TID_INT, RPC_OUTGOING, convert_flags);
1225 rpc_convert_single(&pkey->access_mode, TID_WORD, RPC_OUTGOING, convert_flags);
1226 rpc_convert_single(&pkey->notify_count, TID_WORD, RPC_OUTGOING, convert_flags);
1227 rpc_convert_single(&pkey->next_key, TID_INT, RPC_OUTGOING, convert_flags);
1228 rpc_convert_single(&pkey->parent_keylist, TID_INT, RPC_OUTGOING, convert_flags);
1229 rpc_convert_single(&pkey->last_written, TID_INT, RPC_OUTGOING, convert_flags);
1230 }
1231 break;
1232
1233 case RPC_DB_GET_LINK:
1234 status = db_get_link(CHNDLE(0), CHNDLE(1), (KEY*)CARRAY(2));
1235 if (convert_flags) {
1236 KEY *pkey;
1237
1238 pkey = (KEY *) CARRAY(2);
1239 rpc_convert_single(&pkey->type, TID_DWORD, RPC_OUTGOING, convert_flags);
1240 rpc_convert_single(&pkey->num_values, TID_INT, RPC_OUTGOING, convert_flags);
1241 rpc_convert_single(&pkey->data, TID_INT, RPC_OUTGOING, convert_flags);
1242 rpc_convert_single(&pkey->total_size, TID_INT, RPC_OUTGOING, convert_flags);
1243 rpc_convert_single(&pkey->item_size, TID_INT, RPC_OUTGOING, convert_flags);
1244 rpc_convert_single(&pkey->access_mode, TID_WORD, RPC_OUTGOING, convert_flags);
1245 rpc_convert_single(&pkey->notify_count, TID_WORD, RPC_OUTGOING, convert_flags);
1246 rpc_convert_single(&pkey->next_key, TID_INT, RPC_OUTGOING, convert_flags);
1247 rpc_convert_single(&pkey->parent_keylist, TID_INT, RPC_OUTGOING, convert_flags);
1248 rpc_convert_single(&pkey->last_written, TID_INT, RPC_OUTGOING, convert_flags);
1249 }
1250 break;
1251
1253 status = db_get_key_info(CHNDLE(0), CHNDLE(1), CSTRING(2), CINT(3), CPINT(4), CPINT(5), CPINT(6));
1254 break;
1255
1258 break;
1259
1260 case RPC_DB_RENAME_KEY:
1262 break;
1263
1264 case RPC_DB_REORDER_KEY:
1265 status = db_reorder_key(CHNDLE(0), CHNDLE(1), CINT(2));
1266 break;
1267
1268 case RPC_DB_GET_DATA:
1269 status = db_get_data(CHNDLE(0), CHNDLE(1), CARRAY(2), CPINT(3), CDWORD(4));
1270 rpc_convert_data(CARRAY(2), CDWORD(4), RPC_FIXARRAY | RPC_OUTGOING, CINT(3), convert_flags);
1271 break;
1272
1274 status = db_get_link_data(CHNDLE(0), CHNDLE(1), CARRAY(2), CPINT(3), CDWORD(4));
1275 rpc_convert_data(CARRAY(2), CDWORD(4), RPC_FIXARRAY | RPC_OUTGOING, CINT(3), convert_flags);
1276 break;
1277
1278 case RPC_DB_GET_DATA1:
1279 status = db_get_data1(CHNDLE(0), CHNDLE(1), CARRAY(2), CPINT(3), CDWORD(4), CPINT(5));
1280 rpc_convert_data(CARRAY(2), CDWORD(4), RPC_FIXARRAY | RPC_OUTGOING, CINT(3), convert_flags);
1281 break;
1282
1284 status = db_get_data_index(CHNDLE(0), CHNDLE(1), CARRAY(2), CPINT(3), CINT(4), CDWORD(5));
1285 rpc_convert_single(CARRAY(2), CDWORD(5), RPC_OUTGOING, convert_flags);
1286 break;
1287
1288 case RPC_DB_SET_DATA:
1289 rpc_convert_data(CARRAY(2), CDWORD(5), RPC_FIXARRAY, CINT(3), convert_flags);
1290 status = db_set_data(CHNDLE(0), CHNDLE(1), CARRAY(2), CINT(3), CINT(4), CDWORD(5));
1291 break;
1292
1293 case RPC_DB_SET_DATA1:
1294 rpc_convert_data(CARRAY(2), CDWORD(5), RPC_FIXARRAY, CINT(3), convert_flags);
1295 status = db_set_data1(CHNDLE(0), CHNDLE(1), CARRAY(2), CINT(3), CINT(4), CDWORD(5));
1296 break;
1297
1299 rpc_convert_data(CARRAY(1), CINT(2), RPC_FIXARRAY, TID_DWORD, convert_flags);
1301 break;
1302
1304 rpc_convert_data(CARRAY(2), CDWORD(5), RPC_FIXARRAY, CINT(3), convert_flags);
1305 status = db_set_link_data(CHNDLE(0), CHNDLE(1), CARRAY(2), CINT(3), CINT(4), CDWORD(5));
1306 break;
1307
1309 rpc_convert_single(CARRAY(2), CDWORD(5), 0, convert_flags);
1310 status = db_set_data_index(CHNDLE(0), CHNDLE(1), CARRAY(2), CINT(3), CINT(4), CDWORD(5));
1311 break;
1312
1314 rpc_convert_single(CARRAY(2), CDWORD(5), 0, convert_flags);
1315 status = db_set_link_data_index(CHNDLE(0), CHNDLE(1), CARRAY(2), CINT(3), CINT(4), CDWORD(5));
1316 break;
1317
1319 rpc_convert_single(CARRAY(2), CDWORD(5), 0, convert_flags);
1320 status = db_set_data_index1(CHNDLE(0), CHNDLE(1), CARRAY(2), CINT(3), CINT(4), CDWORD(5), CBOOL(6));
1321 break;
1322
1325 break;
1326
1327 case RPC_DB_SET_MODE:
1328 status = db_set_mode(CHNDLE(0), CHNDLE(1), CWORD(2), CBOOL(3));
1329 break;
1330
1331 case RPC_DB_GET_RECORD:
1332 status = db_get_record(CHNDLE(0), CHNDLE(1), CARRAY(2), CPINT(3), CINT(4));
1333 break;
1334
1335 case RPC_DB_SET_RECORD:
1336 status = db_set_record(CHNDLE(0), CHNDLE(1), CARRAY(2), CINT(3), CINT(4));
1337 break;
1338
1340 status = db_get_record_size(CHNDLE(0), CHNDLE(1), CINT(2), CPINT(3));
1341 break;
1342
1345 break;
1346
1348 status = db_check_record(CHNDLE(0), CHNDLE(1), CSTRING(2), CSTRING(3), CBOOL(4));
1349 break;
1350
1353 break;
1354
1357 break;
1358
1359 case RPC_DB_LOAD:
1360 status = db_load(CHNDLE(0), CHNDLE(1), CSTRING(2), CBOOL(3));
1361 break;
1362
1363 case RPC_DB_SAVE:
1364 status = db_save(CHNDLE(0), CHNDLE(1), CSTRING(2), CBOOL(3));
1365 break;
1366
1369 break;
1370
1373 break;
1374
1375 case RPC_DB_COPY_XML:
1376 status = db_copy_xml(CHNDLE(0), CHNDLE(1), CSTRING(2), CPINT(3), CBOOL(4));
1377 break;
1378
1379 case RPC_EL_SUBMIT:
1380 status = el_submit(CINT(0), CSTRING(1), CSTRING(2), CSTRING(3), CSTRING(4),
1381 CSTRING(5), CSTRING(6), CSTRING(7),
1382 CSTRING(8), (char*)CARRAY(9), CINT(10),
1383 CSTRING(11), (char*)CARRAY(12), CINT(13),
1384 CSTRING(14), (char*)CARRAY(15), CINT(16), CSTRING(17), CINT(18));
1385 break;
1386
1387 case RPC_AL_CHECK:
1388 status = al_check();
1389 break;
1390
1393 break;
1394
1395 /* exit functions */
1396 case RPC_ID_EXIT:
1397 //printf("RPC_ID_EXIT!\n");
1399 break;
1400
1401 case RPC_ID_SHUTDOWN:
1403 break;
1404
1405 /* various functions */
1406
1407 case RPC_TEST:
1408 status = rpc_test(CBYTE(0), CWORD(1), CINT(2), CFLOAT(3), CDOUBLE(4),
1409 CPBYTE(5), CPWORD(6), CPINT(7), CPFLOAT(8), CPDOUBLE(9));
1410 break;
1411
1412 case RPC_TEST2: {
1413 status = test2(routine_id, prpc_param);
1414 break;
1415 }
1416
1417 case RPC_TEST2_CXX: {
1418 status = test2_cxx(routine_id, prpc_param);
1419 break;
1420 }
1421
1422 case RPC_TEST3_CXX: {
1423 status = test3_cxx(routine_id, prpc_param);
1424 break;
1425 }
1426
1427 case RPC_TEST4_CXX: {
1428 status = test4_cxx(routine_id, prpc_param);
1429 break;
1430 }
1431
1432 default:
1433 cm_msg(MERROR, "rpc_server_dispatch", "received unknown RPC %d", routine_id);
1435 }
1436
1437 return status;
1438}
1439
1440/* emacs
1441 * Local Variables:
1442 * tab-width: 8
1443 * c-basic-offset: 3
1444 * indent-tabs-mode: nil
1445 * End:
1446 */
#define FALSE
Definition cfortran.h:309
static void usage()
INT al_trigger_alarm(const char *alarm_name, const char *alarm_message, const char *default_class, const char *cond_str, INT type)
Definition alarm.cxx:283
INT al_check()
Definition alarm.cxx:631
INT bm_open_buffer(const char *buffer_name, INT buffer_size, INT *buffer_handle)
Definition midas.cxx:6728
INT bm_send_event(INT buffer_handle, const EVENT_HEADER *pevent, int unused, int timeout_msec)
Definition midas.cxx:9689
static int bm_skip_event(BUFFER *pbuf)
Definition midas.cxx:10972
INT bm_close_all_buffers(void)
Definition midas.cxx:7254
INT bm_add_event_request(INT buffer_handle, short int event_id, short int trigger_mask, INT sampling_type, EVENT_HANDLER *func, INT request_id)
Definition midas.cxx:8325
INT bm_receive_event_vec(INT buffer_handle, std::vector< char > *pvec, int timeout_msec)
Definition midas.cxx:10948
INT bm_empty_buffers()
Definition midas.cxx:11379
INT bm_set_cache_size(INT buffer_handle, size_t read_size, size_t write_size)
Definition midas.cxx:8151
INT bm_receive_event(INT buffer_handle, void *destination, INT *buf_size, int timeout_msec)
Definition midas.cxx:10789
INT bm_remove_event_request(INT buffer_handle, INT request_id)
Definition midas.cxx:8529
INT bm_close_buffer(INT buffer_handle)
Definition midas.cxx:7107
INT bm_flush_cache(int buffer_handle, int timeout_msec)
Definition midas.cxx:10233
INT cm_set_path(const char *path)
Definition midas.cxx:1513
INT cm_yield(INT millisec)
Definition midas.cxx:5660
INT cm_get_experiment_database(HNDLE *hDB, HNDLE *hKeyClient)
Definition midas.cxx:3027
INT cm_connect_experiment(const char *host_name, const char *exp_name, const char *client_name, void(*func)(char *))
Definition midas.cxx:2294
std::string cm_asctime()
Definition midas.cxx:1428
INT cm_check_client(HNDLE hDB, HNDLE hKeyClient)
Definition midas.cxx:1885
INT cm_execute(const char *command, char *result, INT bufsize)
Definition midas.cxx:5741
INT cm_get_watchdog_info(HNDLE hDB, const char *client_name, DWORD *timeout, DWORD *last)
Definition midas.cxx:3360
INT cm_cleanup(const char *client_name, BOOL ignore_timeout)
Definition midas.cxx:7621
std::string cm_get_client_name()
Definition midas.cxx:2075
INT cm_set_client_info(HNDLE hDB, HNDLE *hKeyClient, const char *host_name, char *client_name, INT hw_type, const char *password, DWORD watchdog_timeout)
Definition midas.cxx:1909
INT cm_disconnect_experiment(void)
Definition midas.cxx:2862
INT cm_synchronize(DWORD *seconds)
Definition midas.cxx:1385
INT cm_get_environment(char *host_name, int host_name_size, char *exp_name, int exp_name_size)
Definition midas.cxx:2150
INT cm_time(DWORD *t)
Definition midas.cxx:1450
INT cm_set_watchdog_params(BOOL call_watchdog, DWORD timeout)
Definition midas.cxx:3299
INT cm_exist(const char *name, BOOL bUnique)
Definition midas.cxx:7531
INT cm_set_experiment_semaphore(INT semaphore_alarm, INT semaphore_elog, INT semaphore_history, INT semaphore_msg)
Definition midas.cxx:2974
INT cm_set_experiment_name(const char *name)
Definition midas.cxx:1574
INT el_submit(int run, const char *author, const char *type, const char *syst, const char *subject, const char *text, const char *reply_to, const char *encoding, const char *afilename1, const char *buffer1, INT buffer_size1, const char *afilename2, const char *buffer2, INT buffer_size2, const char *afilename3, const char *buffer3, INT buffer_size3, char *tag, INT tag_size)
Definition elog.cxx:126
#define CM_SUCCESS
Definition midas.h:582
#define BM_SUCCESS
Definition midas.h:605
#define DB_SUCCESS
Definition midas.h:632
#define RPC_SHUTDOWN
Definition midas.h:708
#define RPC_SUCCESS
Definition midas.h:699
#define RPC_INVALID_ID
Definition midas.h:707
unsigned short int WORD
Definition mcstd.h:49
unsigned char BYTE
Definition mcstd.h:48
unsigned int DWORD
Definition mcstd.h:51
#define TID_SHORT
Definition midas.h:334
#define TID_WORD
Definition midas.h:332
#define MERROR
Definition midas.h:559
#define TID_INT
Definition midas.h:338
#define TID_DWORD
Definition midas.h:336
RPC_LIST * rpc_get_internal_list(INT flag)
Definition mrpc.cxx:787
INT ss_suspend_init_odb_port()
Definition system.cxx:4377
DWORD ss_millitime()
Definition system.cxx:3465
INT ss_semaphore_create(const char *name, HNDLE *semaphore_handle)
Definition system.cxx:2532
std::string ss_getcwd()
Definition system.cxx:5848
INT ss_getpid(void)
Definition system.cxx:1379
INT ss_daemon_init(BOOL keep_stdout)
Definition system.cxx:2073
INT ss_suspend_exit()
Definition system.cxx:4298
INT ss_suspend_set_server_listener(int listen_socket)
Definition system.cxx:4349
int cm_msg_early_init(void)
Definition midas.cxx:481
INT cm_msg_log(INT message_type, const char *facility, const char *message)
Definition midas.cxx:678
INT cm_msg_flush_buffer()
Definition midas.cxx:881
INT cm_msg(INT message_type, const char *filename, INT line, const char *routine, const char *format,...)
Definition midas.cxx:931
INT cm_msg_retrieve(INT n_message, char *message, INT buf_size)
Definition midas.cxx:1350
INT db_flush_database(HNDLE hDB)
Definition odb.cxx:2306
INT db_remove_open_record(HNDLE hDB, HNDLE hKey, BOOL lock)
Definition odb.cxx:12528
INT db_get_data_index(HNDLE hDB, HNDLE hKey, void *data, INT *buf_size, INT idx, DWORD type)
Definition odb.cxx:6917
INT db_delete_key(HNDLE hDB, HNDLE hKey, BOOL follow_links)
Definition odb.cxx:3933
INT db_find_link(HNDLE hDB, HNDLE hKey, const char *key_name, HNDLE *subhKey)
Definition odb.cxx:4293
INT db_get_value(HNDLE hDB, HNDLE hKeyRoot, const char *key_name, void *data, INT *buf_size, DWORD type, BOOL create)
Definition odb.cxx:5185
INT db_reorder_key(HNDLE hDB, HNDLE hKey, INT idx)
Definition odb.cxx:6385
static const KEY * db_get_parent(const DATABASE_HEADER *pheader, const KEY *pkey, int *pstatus, const char *caller, db_err_msg **msg)
Definition odb.cxx:1057
INT db_open_database(const char *xdatabase_name, INT database_size, HNDLE *hDB, const char *client_name)
Definition odb.cxx:1820
INT db_get_open_records(HNDLE hDB, HNDLE hKey, char *str, INT buf_size, BOOL fix)
Definition odb.cxx:4955
INT db_set_link_data(HNDLE hDB, HNDLE hKey, const void *data, INT buf_size, INT num_values, DWORD type)
Definition odb.cxx:7449
INT db_get_path(HNDLE hDB, HNDLE hKey, char *path, INT buf_size)
Definition odb.cxx:4775
INT db_set_link_data_index(HNDLE hDB, HNDLE hKey, const void *data, INT data_size, INT idx, DWORD type)
Definition odb.cxx:7773
INT db_get_record_size(HNDLE hDB, HNDLE hKey, INT align, INT *buf_size)
Definition odb.cxx:11640
INT db_get_data(HNDLE hDB, HNDLE hKey, void *data, INT *buf_size, DWORD type)
Definition odb.cxx:6563
INT db_create_key(HNDLE hDB, HNDLE hKey, const char *key_name, DWORD type)
Definition odb.cxx:3392
INT db_check_record(HNDLE hDB, HNDLE hKey, const char *keyname, const char *rec_str, BOOL correct)
Definition odb.cxx:13003
INT db_copy_xml(HNDLE hDB, HNDLE hKey, char *buffer, int *buffer_size, bool header)
Definition odb.cxx:9055
INT db_get_record(HNDLE hDB, HNDLE hKey, void *data, INT *buf_size, INT align)
Definition odb.cxx:11736
INT db_set_mode(HNDLE hDB, HNDLE hKey, WORD mode, BOOL recurse)
Definition odb.cxx:8040
INT db_get_next_link(HNDLE hDB, HNDLE hKey, HNDLE *subkey_handle)
Definition odb.cxx:5586
INT db_save(HNDLE hDB, HNDLE hKey, const char *filename, BOOL bRemote)
Definition odb.cxx:9263
INT db_get_key(HNDLE hDB, HNDLE hKey, KEY *key)
Definition odb.cxx:6043
INT db_get_link(HNDLE hDB, HNDLE hKey, KEY *key)
Definition odb.cxx:6096
INT db_load(HNDLE hDB, HNDLE hKeyRoot, const char *filename, BOOL bRemote)
Definition odb.cxx:8139
INT db_set_data_index(HNDLE hDB, HNDLE hKey, const void *data, INT data_size, INT idx, DWORD type)
Definition odb.cxx:7668
INT db_get_key_info(HNDLE hDB, HNDLE hKey, char *name, INT name_size, INT *type, INT *num_values, INT *item_size)
Definition odb.cxx:6215
INT db_close_all_databases(void)
Definition odb.cxx:2398
INT db_set_data(HNDLE hDB, HNDLE hKey, const void *data, INT buf_size, INT num_values, DWORD type)
Definition odb.cxx:7239
INT db_enum_link(HNDLE hDB, HNDLE hKey, INT idx, HNDLE *subkey_handle)
Definition odb.cxx:5495
INT db_set_data1(HNDLE hDB, HNDLE hKey, const void *data, INT buf_size, INT num_values, DWORD type)
Definition odb.cxx:7337
INT db_get_data1(HNDLE hDB, HNDLE hKey, void *data, INT *buf_size, DWORD type, INT *num_values)
Definition odb.cxx:6780
INT db_set_value(HNDLE hDB, HNDLE hKeyRoot, const char *key_name, const void *data, INT data_size, INT num_values, DWORD type)
Definition odb.cxx:5028
INT db_find_key(HNDLE hDB, HNDLE hKey, const char *key_name, HNDLE *subhKey)
Definition odb.cxx:4256
INT db_get_link_data(HNDLE hDB, HNDLE hKey, void *data, INT *buf_size, DWORD type)
Definition odb.cxx:6680
INT db_rename_key(HNDLE hDB, HNDLE hKey, const char *name)
Definition odb.cxx:6285
INT db_get_key_time(HNDLE hDB, HNDLE hKey, DWORD *delta)
Definition odb.cxx:6156
INT db_set_client_name(HNDLE hDB, const char *client_name)
Definition odb.cxx:2440
INT db_notify_clients_array(HNDLE hDB, HNDLE hKeys[], INT size)
Definition odb.cxx:12654
INT db_set_record(HNDLE hDB, HNDLE hKey, void *data, INT buf_size, INT align)
Definition odb.cxx:12320
INT db_set_data_index1(HNDLE hDB, HNDLE hKey, const void *data, INT data_size, INT idx, DWORD type, BOOL bNotify)
Definition odb.cxx:7844
INT db_enum_key(HNDLE hDB, HNDLE hKey, INT idx, HNDLE *subkey_handle)
Definition odb.cxx:5357
INT db_create_record(HNDLE hDB, HNDLE hKey, const char *orig_key_name, const char *init_str)
Definition odb.cxx:12831
INT db_add_open_record(HNDLE hDB, HNDLE hKey, WORD access_mode)
Definition odb.cxx:12393
INT db_set_num_values(HNDLE hDB, HNDLE hKey, INT num_values)
Definition odb.cxx:7523
INT db_create_link(HNDLE hDB, HNDLE hKey, const char *link_name, const char *destination)
Definition odb.cxx:3688
INT db_close_database(HNDLE hDB)
Definition odb.cxx:2190
#define RPC_DB_ADD_OPEN_RECORD
Definition mrpc.h:73
#define RPC_EL_SUBMIT
Definition mrpc.h:112
#define RPC_TEST3_CXX
Definition mrpc.h:126
#define RPC_DB_SET_DATA_INDEX
Definition mrpc.h:68
void rpc_convert_data(void *data, INT tid, INT flags, INT total_size, INT convert_flags)
Definition midas.cxx:11837
#define RPC_DB_CLOSE_DATABASE
Definition mrpc.h:54
#define RPC_CM_TIME
Definition mrpc.h:29
#define RPC_BM_ADD_EVENT_REQUEST
Definition mrpc.h:43
#define RPC_DB_CREATE_RECORD
Definition mrpc.h:81
#define RPC_CM_EXIST
Definition mrpc.h:31
#define RPC_DB_LOAD
Definition mrpc.h:76
#define RPC_TEST2
Definition mrpc.h:124
#define RPC_CM_CHECK_CLIENT
Definition mrpc.h:34
#define RPC_DB_CREATE_LINK
Definition mrpc.h:57
#define RPC_DB_NOTIFY_CLIENTS_ARRAY
Definition mrpc.h:97
#define RPC_BM_MARK_READ_WAITING
Definition mrpc.h:48
#define RPC_CM_ASCTIME
Definition mrpc.h:28
#define RPC_DB_ENUM_LINK
Definition mrpc.h:79
#define RPC_BM_SEND_EVENT
Definition mrpc.h:45
INT rpc_register_functions(const RPC_LIST *new_list, RPC_HANDLER func)
Definition midas.cxx:11958
INT rpc_server_callback(struct callback_addr *pcallback)
Definition midas.cxx:17061
#define RPC_DB_DELETE_KEY
Definition mrpc.h:63
#define RPC_CM_SYNCHRONIZE
Definition mrpc.h:27
#define RPC_TEST4_CXX
Definition mrpc.h:127
#define RPC_DB_SET_NUM_VALUES
Definition mrpc.h:89
#define RPC_BM_GET_BUFFER_INFO
Definition mrpc.h:39
#define RPC_CM_SET_CLIENT_INFO
Definition mrpc.h:21
#define RPC_DB_COPY_XML
Definition mrpc.h:99
#define RPC_DB_ENUM_KEY
Definition mrpc.h:64
#define RPC_BM_REMOVE_EVENT_REQUEST
Definition mrpc.h:44
void rpc_debug_printf(const char *format,...)
Definition midas.cxx:13292
#define RPC_TEST2_CXX
Definition mrpc.h:125
#define RPC_DB_SET_VALUE
Definition mrpc.h:58
#define RPC_ID_EXIT
Definition mrpc.h:141
INT rpc_server_loop(void)
Definition midas.cxx:17202
#define RPC_DB_SET_CLIENT_NAME
Definition mrpc.h:77
#define RPC_CM_MSG
Definition mrpc.h:30
#define RPC_DB_GET_DATA1
Definition mrpc.h:88
#define RPC_DB_REMOVE_OPEN_RECORD
Definition mrpc.h:74
#define RPC_DB_CLOSE_ALL_DATABASES
Definition mrpc.h:55
INT rpc_set_mserver_path(const char *path)
Definition midas.cxx:13195
#define RPC_DB_SET_LINK_DATA_INDEX
Definition mrpc.h:95
#define RPC_BM_CLOSE_BUFFER
Definition mrpc.h:37
#define RPC_DB_RENAME_KEY
Definition mrpc.h:78
#define RPC_AL_TRIGGER_ALARM
Definition mrpc.h:115
#define RPC_DB_GET_NEXT_LINK
Definition mrpc.h:91
#define RPC_DB_GET_DATA
Definition mrpc.h:66
#define RPC_BM_SET_CACHE_SIZE
Definition mrpc.h:42
#define RPC_ID_SHUTDOWN
Definition mrpc.h:140
#define RPC_DB_SET_MODE
Definition mrpc.h:69
#define RPC_DB_FIND_LINK
Definition mrpc.h:61
#define RPC_DB_GET_LINK
Definition mrpc.h:92
#define RPC_DB_GET_KEY
Definition mrpc.h:65
#define RPC_DB_SET_DATA
Definition mrpc.h:67
#define RPC_BM_CLOSE_ALL_BUFFERS
Definition mrpc.h:38
INT rpc_server_shutdown(void)
Definition midas.cxx:17572
#define RPC_DB_SET_LINK_DATA
Definition mrpc.h:94
int rpc_flush_event_socket(int timeout_msec)
Definition midas.cxx:17525
#define RPC_DB_GET_LINK_DATA
Definition mrpc.h:93
#define RPC_DB_SET_DATA_INDEX1
Definition mrpc.h:86
#define RPC_DB_GET_PARENT
Definition mrpc.h:98
INT rpc_set_debug(void(*func)(const char *), INT mode)
Definition midas.cxx:13265
#define RPC_DB_REORDER_KEY
Definition mrpc.h:80
#define RPC_DB_OPEN_DATABASE
Definition mrpc.h:53
#define RPC_DB_CHECK_RECORD
Definition mrpc.h:90
#define RPC_BM_RECEIVE_EVENT_CXX
Definition mrpc.h:51
#define RPC_BM_GET_BUFFER_LEVEL
Definition mrpc.h:40
#define RPC_DB_GET_DATA_INDEX
Definition mrpc.h:82
#define RPC_DB_GET_VALUE
Definition mrpc.h:59
INT rpc_register_listener(int port, RPC_HANDLER func, int *plsock, int *pport)
Definition midas.cxx:15025
#define RPC_BM_OPEN_BUFFER
Definition mrpc.h:36
#define RPC_DB_GET_KEY_INFO
Definition mrpc.h:87
#define RPC_BM_EMPTY_BUFFERS
Definition mrpc.h:49
INT rpc_server_accept(int lsock)
Definition midas.cxx:16700
#define RPC_DB_FLUSH_DATABASE
Definition mrpc.h:85
#define RPC_CM_SET_WATCHDOG_PARAMS
Definition mrpc.h:22
#define RPC_CM_MSG_LOG
Definition mrpc.h:25
#define RPC_BM_RECEIVE_EVENT
Definition mrpc.h:47
#define RPC_CM_MSG_RETRIEVE
Definition mrpc.h:32
#define RPC_BM_SKIP_EVENT
Definition mrpc.h:50
#define RPC_DB_SAVE
Definition mrpc.h:75
#define RPC_DB_GET_PATH
Definition mrpc.h:62
#define RPC_BM_INIT_BUFFER_COUNTERS
Definition mrpc.h:41
#define RPC_DB_GET_KEY_TIME
Definition mrpc.h:83
#define RPC_CM_EXECUTE
Definition mrpc.h:26
#define RPC_DB_SET_RECORD
Definition mrpc.h:72
#define RPC_DB_GET_RECORD_SIZE
Definition mrpc.h:70
#define RPC_BM_FLUSH_CACHE
Definition mrpc.h:46
#define RPC_CM_CLEANUP
Definition mrpc.h:23
#define RPC_DB_FIND_KEY
Definition mrpc.h:60
#define RPC_DB_GET_OPEN_RECORDS
Definition mrpc.h:84
#define RPC_AL_CHECK
Definition mrpc.h:114
#define RPC_CM_GET_WATCHDOG_INFO
Definition mrpc.h:24
INT rpc_get_convert_flags(void)
Definition midas.cxx:13161
#define RPC_TEST
Definition mrpc.h:123
void rpc_convert_single(void *data, INT tid, INT flags, INT convert_flags)
Definition midas.cxx:11812
#define RPC_DB_SET_DATA1
Definition mrpc.h:96
#define RPC_DB_CREATE_KEY
Definition mrpc.h:56
#define RPC_DB_GET_RECORD
Definition mrpc.h:71
int main()
Definition hwtest.cxx:23
INT index
Definition mana.cxx:271
void * data
Definition mana.cxx:268
BOOL debug
debug printouts
Definition mana.cxx:254
BOOL daemon
Definition mana.cxx:258
HNDLE hDB
main ODB handle
Definition mana.cxx:207
INT i
Definition mdump.cxx:32
#define closesocket(s)
Definition melog.cxx:29
char expt_name[NAME_LENGTH]
Definition mevb.cxx:44
HNDLE hClient
Definition mfe.cxx:59
INT bm_get_buffer_info(INT buffer_handle, BUFFER_HEADER *buffer_header)
Definition midas.cxx:7802
bool ends_with_char(const std::string &s, char c)
Definition midas.cxx:412
INT bm_get_buffer_level(INT buffer_handle, INT *n_bytes)
Definition midas.cxx:7849
std::string msprintf(const char *format,...)
Definition midas.cxx:419
INT bm_init_buffer_counters(INT buffer_handle)
Definition midas.cxx:8074
#define CFLOAT(_i)
Definition midas.h:1640
#define DIR_SEPARATOR
Definition midas.h:193
INT HNDLE
Definition midas.h:132
#define CINT(_i)
Definition midas.h:1622
#define CSHORT(_i)
Definition midas.h:1619
DWORD BOOL
Definition midas.h:105
#define CDOUBLE(_i)
Definition midas.h:1643
#define CSTDVECTOR(_i)
Definition midas.h:1683
int INT
Definition midas.h:129
#define CHNDLE(_i)
Definition midas.h:1634
#define CDWORD(_i)
Definition midas.h:1631
#define CSTDSTRING(_i)
Definition midas.h:1682
#define RPC_OUTGOING
Definition midas.h:1584
#define CBOOL(_i)
Definition midas.h:1637
#define MIDAS_TCP_PORT
Definition midas.h:283
#define CSTRING(_i)
Definition midas.h:1646
#define CPWORD(_i)
Definition midas.h:1626
#define CPINT(_i)
Definition midas.h:1623
#define CWORD(_i)
Definition midas.h:1625
#define CPSTDVECTOR(_i)
Definition midas.h:1686
#define TRUE
Definition midas.h:182
#define CARRAY(_i)
Definition midas.h:1647
#define CBYTE(_i)
Definition midas.h:1616
#define POINTER_T
Definition midas.h:166
#define RPC_FIXARRAY
Definition midas.h:1582
#define CPFLOAT(_i)
Definition midas.h:1641
#define CPHNDLE(_i)
Definition midas.h:1635
#define NAME_LENGTH
Definition midas.h:272
#define CPBYTE(_i)
Definition midas.h:1617
#define CPDOUBLE(_i)
Definition midas.h:1644
#define CPDWORD(_i)
Definition midas.h:1632
#define end
#define name(x)
Definition midas_macro.h:24
static int test3_cxx(INT routine_id, void *prpc_param[])
Definition mserver.cxx:712
static int test2_cxx(INT routine_id, void *prpc_param[])
Definition mserver.cxx:561
static int test4_cxx(INT routine_id, void *prpc_param[])
Definition mserver.cxx:863
struct callback_addr callback
Definition mserver.cxx:22
INT rpc_server_dispatch(INT index, void *prpc_param[])
Definition mserver.cxx:955
INT rpc_test(BYTE b, WORD w, INT i, float f, double d, BYTE *b1, WORD *w1, INT *i1, float *f1, double *d1)
Definition mserver.cxx:399
void debug_print(const char *msg)
Definition mserver.cxx:30
BOOL use_callback_addr
Definition mserver.cxx:24
static int test2(INT routine_id, void *prpc_param[])
Definition mserver.cxx:412
char str[256]
Definition odbhist.cxx:33
char file_name[256]
Definition odbhist.cxx:41
DWORD status
Definition odbhist.cxx:39
INT num_in_events
Definition midas.h:965
INT write_pointer
Definition midas.h:964
INT num_clients
Definition midas.h:960
INT max_client_index
Definition midas.h:961
INT num_out_events
Definition midas.h:966
INT read_pointer
Definition midas.h:963
short int event_id
Definition midas.h:853
DWORD data_size
Definition midas.h:857
DWORD serial_number
Definition midas.h:855
DWORD time_stamp
Definition midas.h:856
short int trigger_mask
Definition midas.h:854
Definition midas.h:1027
INT num_values
Definition midas.h:1029
DWORD type
Definition midas.h:1028
WORD notify_count
Definition midas.h:1035
INT total_size
Definition midas.h:1032
WORD access_mode
Definition midas.h:1034
INT last_written
Definition midas.h:1038
INT parent_keylist
Definition midas.h:1037
char name[NAME_LENGTH]
Definition midas.h:1030
INT next_key
Definition midas.h:1036
INT item_size
Definition midas.h:1033
INT data
Definition midas.h:1031
unsigned short host_port1
Definition msystem.h:319
std::string user
Definition msystem.h:325
void clear()
Definition msystem.h:327
unsigned short host_port2
Definition msystem.h:320
std::string experiment
Definition msystem.h:323
unsigned short host_port3
Definition msystem.h:321
std::string directory
Definition msystem.h:324
std::string host_name
Definition msystem.h:318
double d
Definition system.cxx:1313