-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathremoteObjects.h
101 lines (71 loc) · 2.28 KB
/
remoteObjects.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
// hskymon from HDS OPE file Editor
// New SkyMonitor for Subaru Gen2
// remoteObjects.h --- communication w/Gen2
//
// 2012.10.22 A.Tajitsu
/*
* remoteObjects.h -- remoteObjects wrapper for XML-RPC transport
*
* Eric Jeschke Last edit: Wed Oct 22 14:21:38 HST 2008
*
* This is the include file for the C-library interface to the remoteObjects
* XML-RPC wrapper. remoteObjects provides host-transparent service lookup
* and failover capabilities.
*
*/
#include <stdlib.h>
#include <stdlib.h>
#include <stdio.h>
#include <xmlrpc-c/base.h>
#include <xmlrpc-c/client.h>
/* Fundamental error return constants. */
#define ro_OK 0
#define ro_ERR 1
/* These can be read from a config file... */
#define ro_managerServicePort 7070
#define ro_nameServicePort 7075
#define ro_useDefaultAuth TRUE
#define ro_nsAuthUser "names"
#define ro_nsAuthPass "names"
typedef struct {
xmlrpc_env env;
xmlrpc_client * clientP;
xmlrpc_server_info *server;
xmlrpc_value * resultP;
xmlrpc_value * paramsP;
} remoteObjectClient;
typedef struct {
char svcname[128];
remoteObjectClient * client;
xmlrpc_value * hostlist;
int index;
int length;
} remoteObjectProxy;
/* These are the library client calls. */
int
get_status (xmlrpc_env *env);
int
ro_makeClient(remoteObjectClient **clientPP, char *host, int port,
char *auth_user, char *auth_pass);
int
ro_callClient_arg(remoteObjectClient *ro_clientP,
xmlrpc_value **resultPP, char *methodName, xmlrpc_value *paramsP);
int
ro_callClient(remoteObjectClient *ro_clientP,
xmlrpc_value ** resultPP, char *methodName, char *fmt, ...);
int
ro_freeClient(remoteObjectClient *ro_clientP);
int
ro_makeProxyAuth(remoteObjectProxy **proxyPP, char *svcname,
char *auth_user, char* auth_pass);
int
ro_makeProxy(remoteObjectProxy **proxyPP, char *svcname);
int
ro_callProxy_arg(remoteObjectProxy *ro_proxyP,
xmlrpc_value **resultPP, char *methodName, xmlrpc_value *paramsP);
int
ro_callProxy(remoteObjectProxy *ro_proxyP,
xmlrpc_value **resultPP, char *methodName, char *fmt, ...);
int
ro_freeProxy(remoteObjectProxy *ro_proxyP, gboolean clear_flag);
/* END */