]> git.sesse.net Git - rdpsrv/blob - Xserver/include/extensions/recordstr.h
Support RDP5 logon packets.
[rdpsrv] / Xserver / include / extensions / recordstr.h
1 /*
2 #ifndef lint
3 $XConsortium: recordstr.h /main/2 1996/01/09 18:15:19 gildea $
4 static char sccsid[ ] = "@(#) recordstr.h 1.5 6/5/95 12:37:44";
5 #endif
6 */
7
8 /***************************************************************************
9  * Copyright 1995 Network Computing Devices
10  *
11  * Permission to use, copy, modify, distribute, and sell this software and
12  * its documentation for any purpose is hereby granted without fee, provided
13  * that the above copyright notice appear in all copies and that both that
14  * copyright notice and this permission notice appear in supporting
15  * documentation, and that the name of Network Computing Devices
16  * not be used in advertising or publicity pertaining to distribution
17  * of the software without specific, written prior permission.
18  *
19  * NETWORK COMPUTING DEVICES DISCLAIMs ALL WARRANTIES WITH REGARD TO
20  * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
21  * AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES BE LIABLE
22  * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
23  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
24  * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
25  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
26  **************************************************************************/
27
28 #include "record.h"
29
30 #define RECORD_NAME                     "RECORD"
31 #define RECORD_MAJOR_VERSION            1
32 #define RECORD_MINOR_VERSION            13
33 #define RECORD_LOWEST_MAJOR_VERSION     1
34 #define RECORD_LOWEST_MINOR_VERSION     12
35 /* only difference between 1.12 and 1.13 is byte order of device events,
36    which the library doesn't deal with. */
37
38 /*********************************************************
39  *
40  * Protocol request constants
41  *
42  */
43 #define X_RecordQueryVersion    0     /* First request from client */
44 #define X_RecordCreateContext   1     /* Create client RC */
45 #define X_RecordRegisterClients 2     /* Add to client RC */
46 #define X_RecordUnregisterClients 3   /* Delete from client RC */
47 #define X_RecordGetContext      4     /* Query client RC */
48 #define X_RecordEnableContext   5     /* Enable interception and reporting */
49 #define X_RecordDisableContext  6     /* Disable interception and reporting */
50 #define X_RecordFreeContext     7     /* Free client RC */
51
52 #define RecordNumErrors         (XRecordBadContext + 1) 
53 #define RecordNumEvents         0L
54
55 #define sz_XRecordRange         32
56 #define sz_XRecordClientInfo    12
57 #define sz_XRecordState         16
58 #define sz_XRecordDatum         32
59
60
61 #define XRecordGlobaldef
62 #define XRecordGlobalref extern
63
64 #define RecordMaxEvent          (128L-1L)
65 #define RecordMinDeviceEvent    (2L)
66 #define RecordMaxDeviceEvent    (6L)
67 #define RecordMaxError          (256L-1L)
68 #define RecordMaxCoreRequest    (128L-1L)
69 #define RecordMaxExtRequest     (256L-1L)
70 #define RecordMinExtRequest     (129L-1L)
71
72 #define RECORD_RC               CARD32
73 #define RECORD_XIDBASE          CARD32
74 #define RECORD_CLIENTSPEC       CARD32
75 #define RECORD_ELEMENT_HEADER   CARD8
76
77 typedef RECORD_CLIENTSPEC RecordClientSpec, *RecordClientSpecPtr;
78
79 typedef struct
80 {
81     CARD8       first;
82     CARD8       last;
83 } RECORD_RANGE8;
84
85 typedef struct
86 {
87     CARD16      first B16;
88     CARD16      last B16;
89 } RECORD_RANGE16;
90
91 typedef struct
92 {
93     RECORD_RANGE8       majorCode;
94     RECORD_RANGE16      minorCode;
95 } RECORD_EXTRANGE;
96
97 typedef struct
98 {
99     RECORD_RANGE8       coreRequests;
100     RECORD_RANGE8       coreReplies;
101     RECORD_EXTRANGE     extRequests;
102     RECORD_EXTRANGE     extReplies;
103     RECORD_RANGE8       deliveredEvents;
104     RECORD_RANGE8       deviceEvents;
105     RECORD_RANGE8       errors;
106     BOOL                clientStarted;
107     BOOL                clientDied;
108 } RECORDRANGE;
109 #define sz_RECORDRANGE  24
110
111 /* typedef RECORDRANGE xRecordRange, *xRecordRangePtr;
112 #define sz_xRecordRange 24 */
113
114 /* Cannot have structures within structures going over the wire */
115 typedef struct
116 {
117     CARD8               coreRequestsFirst;
118     CARD8               coreRequestsLast;
119     CARD8               coreRepliesFirst;
120     CARD8               coreRepliesLast;
121     CARD8               extRequestsMajorFirst;
122     CARD8               extRequestsMajorLast;
123     CARD16              extRequestsMinorFirst B16;
124     CARD16              extRequestsMinorLast B16;
125     CARD8               extRepliesMajorFirst;
126     CARD8               extRepliesMajorLast;
127     CARD16              extRepliesMinorFirst B16;
128     CARD16              extRepliesMinorLast B16;
129     CARD8               deliveredEventsFirst;
130     CARD8               deliveredEventsLast;
131     CARD8               deviceEventsFirst;
132     CARD8               deviceEventsLast;
133     CARD8               errorsFirst;
134     CARD8               errorsLast;
135     BOOL                clientStarted;
136     BOOL                clientDied;
137 } xRecordRange;
138 #define sz_xRecordRange 24
139
140 typedef struct
141 {
142     RECORD_CLIENTSPEC   clientResource B32;
143     CARD32              nRanges B32;
144 /* LISTofRECORDRANGE */
145 } RECORD_CLIENT_INFO;
146
147 typedef RECORD_CLIENT_INFO xRecordClientInfo;
148
149 /*
150  * Initialize
151  */
152 typedef struct {
153     CARD8       reqType;
154     CARD8       recordReqType;
155     CARD16      length B16;
156     CARD16      majorVersion B16;
157     CARD16      minorVersion B16;
158 } xRecordQueryVersionReq;
159 #define sz_xRecordQueryVersionReq       8
160
161 typedef struct
162 {
163     CARD8   type;
164     CARD8   pad0;
165     CARD16  sequenceNumber B16;
166     CARD32  length       B32;
167     CARD16  majorVersion B16;
168     CARD16  minorVersion B16;
169     CARD32  pad1         B32;
170     CARD32  pad2         B32;
171     CARD32  pad3         B32;
172     CARD32  pad4         B32;
173     CARD32  pad5         B32;
174  } xRecordQueryVersionReply;
175 #define sz_xRecordQueryVersionReply     32
176
177 /*
178  * Create RC
179  */
180 typedef struct
181 {
182     CARD8               reqType;
183     CARD8               recordReqType;
184     CARD16              length B16;
185     RECORD_RC           context B32;
186     RECORD_ELEMENT_HEADER elementHeader;
187     CARD8               pad;
188     CARD16              pad0 B16;
189     CARD32              nClients B32;
190     CARD32              nRanges B32;
191 /* LISTofRECORD_CLIENTSPEC */
192 /* LISTofRECORDRANGE */
193 } xRecordCreateContextReq;
194 #define sz_xRecordCreateContextReq      20
195
196 /*
197  * Add to  RC
198  */
199 typedef struct
200 {
201     CARD8               reqType;
202     CARD8               recordReqType;
203     CARD16              length B16;
204     RECORD_RC           context B32;
205     RECORD_ELEMENT_HEADER elementHeader;
206     CARD8               pad;
207     CARD16              pad0 B16;
208     CARD32              nClients B32;
209     CARD32              nRanges B32;
210 /* LISTofRECORD_CLIENTSPEC */
211 /* LISTofRECORDRANGE */
212 } xRecordRegisterClientsReq;
213 #define sz_xRecordRegisterClientsReq    20
214
215 /*
216  * Delete from RC
217  */
218 typedef struct
219 {
220     CARD8               reqType;
221     CARD8               recordReqType;
222     CARD16              length B16;
223     RECORD_RC           context B32;
224     CARD32              nClients B32;
225 /* LISTofRECORD_CLIENTSPEC */
226 } xRecordUnregisterClientsReq;
227 #define sz_xRecordUnregisterClientsReq  12
228
229 /*
230  * Query RC
231  */
232 typedef struct
233 {
234     CARD8       reqType;
235     CARD8       recordReqType;
236     CARD16      length B16;
237     RECORD_RC   context B32;
238 } xRecordGetContextReq;
239 #define sz_xRecordGetContextReq                 8
240
241 typedef struct
242 {
243     CARD8       type;
244     BOOL        enabled;
245     CARD16      sequenceNumber B16;
246     CARD32      length   B32;
247     RECORD_ELEMENT_HEADER  elementHeader;
248     CARD8       pad;
249     CARD16      pad0 B16;
250     CARD32      nClients B32;
251     CARD32      pad1 B32;
252     CARD32      pad2 B32;
253     CARD32      pad3 B32;
254     CARD32      pad4 B32;
255 /* LISTofCLIENT_INFO */                 /* intercepted-clients */
256 } xRecordGetContextReply;
257 #define sz_xRecordGetContextReply       32
258
259 /*
260  * Enable data interception
261  */
262 typedef struct
263 {
264     CARD8       reqType;
265     CARD8       recordReqType;
266     CARD16      length B16;
267     RECORD_RC   context B32;
268 } xRecordEnableContextReq;
269 #define sz_xRecordEnableContextReq      8
270
271 typedef struct
272 {
273     CARD8               type;
274     CARD8               category;
275     CARD16              sequenceNumber B16;
276     CARD32              length B32;
277     RECORD_ELEMENT_HEADER  elementHeader;
278     BOOL                clientSwapped;
279     CARD16              pad1 B16;
280     RECORD_XIDBASE      idBase B32;
281     CARD32              serverTime B32;
282     CARD32              recordedSequenceNumber B32;
283     CARD32              pad3 B32;
284     CARD32              pad4 B32;
285     /* BYTE             data; */
286 } xRecordEnableContextReply;
287 #define sz_xRecordEnableContextReply    32
288
289 /*
290  * Disable data interception
291  */
292 typedef struct
293 {
294     CARD8       reqType;
295     CARD8       recordReqType;
296     CARD16      length B16;
297     RECORD_RC   context B32;
298 } xRecordDisableContextReq;
299 #define sz_xRecordDisableContextReq     8
300
301 /*
302  * Free RC
303  */
304 typedef struct
305 {
306     CARD8       reqType;
307     CARD8       recordReqType;
308     CARD16      length B16;
309     RECORD_RC   context B32;
310 } xRecordFreeContextReq;
311 #define sz_xRecordFreeContextReq        8
312
313 #undef RECORD_RC
314 #undef RECORD_XIDBASE
315 #undef RECORD_ELEMENT_HEADER
316 #undef RECORD_CLIENTSPEC
317
318