pmdb.h revision b3078add
1
2/*
3Copyright 1996, 1998  The Open Group
4
5Permission to use, copy, modify, distribute, and sell this software and its
6documentation for any purpose is hereby granted without fee, provided that
7the above copyright notice appear in all copies and that both that
8copyright notice and this permission notice appear in supporting
9documentation.
10
11The above copyright notice and this permission notice shall be included
12in all copies or substantial portions of the Software.
13
14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
18OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20OTHER DEALINGS IN THE SOFTWARE.
21
22Except as contained in this notice, the name of The Open Group shall
23not be used in advertising or otherwise to promote the sale, use or
24other dealings in this Software without prior written authorization
25from The Open Group.
26*/
27
28
29#include <X11/ICE/ICElib.h>
30
31
32typedef struct _server_list {
33    char *serverAddress;
34    struct _server_list *next;
35} server_list;
36
37
38typedef struct _request_list {
39    char *serviceName;
40    char *serverAddress;
41    char *hostAddress;
42    char *startOptions;
43    PMconn *requestor;
44    char *listData;
45    int authLen;
46    char *authName;
47    char *authData;
48    struct _request_list *next;
49} request_list;
50
51
52typedef struct _running_proxy {
53    Bool active;
54    PMconn *pmConn;
55    request_list *requests;
56    server_list *servers;
57    Bool refused_service;
58    struct _running_proxy *next;
59} running_proxy;
60
61
62typedef struct _proxy_service {
63    char *serviceName;
64    int proxyCount;
65    running_proxy *proxyList;
66    struct _proxy_service *next;
67} proxy_service;
68
69
70typedef struct {
71    int count;
72    int current;
73    running_proxy **list;
74} running_proxy_list;
75
76
77
78proxy_service
79*FindProxyService (
80	char *serviceName,
81	Bool createIf);
82
83running_proxy *
84StartNewProxy (
85	char *serviceName,
86	char *startCommand);
87
88running_proxy *
89ConnectToProxy (
90	int pmOpcode,
91	char *serviceName,
92	char *proxyAddress);
93
94Status
95ActivateProxyService (
96	char *serviceName,
97	PMconn *proxy);
98
99void
100ProxyGone (
101    IceConn proxyIceConn,
102    Bool *activeReqs);
103
104running_proxy_list *
105GetRunningProxyList (
106	char *serviceName,
107	char *serverAddress);
108
109void
110FreeProxyList (
111	running_proxy_list *list);
112
113Status
114PushRequestorQueue (
115	running_proxy *proxy,
116	PMconn *requestor,
117	running_proxy_list *runList,
118	char *serviceName,
119	char *serverAddress,
120	char *hostAddress,
121	char *startOptions,
122	int authLen,
123	char *authName,
124	char *authData);
125
126
127Status
128PeekRequestorQueue (
129	PMconn *proxy,
130	PMconn **requestor,
131	running_proxy_list **runList,
132	char **serviceName,
133	char **serverAddress,
134	char **hostAddress,
135	char **startOptions,
136	int *authLen,
137	char **authName,
138	char **authData);
139
140PMconn*
141PopRequestorQueue (
142	PMconn *pmConn,
143	Bool addServer,
144	Bool freeProxyList);
145
146running_proxy *
147ProxyForPMconn(
148	PMconn *pmConn);
149