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