ICEproto.h revision 266e564d
1/* $Xorg: ICEproto.h,v 1.5 2001/02/09 02:03:26 xorgcvs Exp $ */
2/******************************************************************************
3
4
5Copyright 1993, 1998  The Open Group
6
7Permission to use, copy, modify, distribute, and sell this software and its
8documentation for any purpose is hereby granted without fee, provided that
9the above copyright notice appear in all copies and that both that
10copyright notice and this permission notice appear in supporting
11documentation.
12
13The above copyright notice and this permission notice shall be included in
14all copies or substantial portions of the Software.
15
16THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
19OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
20AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
23Except as contained in this notice, the name of The Open Group shall not be
24used in advertising or otherwise to promote the sale, use or other dealings
25in this Software without prior written authorization from The Open Group.
26
27Author: Ralph Mor, X Consortium
28******************************************************************************/
29
30#ifndef _ICEPROTO_H_
31#define _ICEPROTO_H_
32
33#include <X11/Xmd.h>
34
35typedef struct {
36    CARD8	majorOpcode;
37    CARD8	minorOpcode;
38    CARD8	data[2];
39    CARD32	length B32;
40} iceMsg;
41
42typedef struct {
43    CARD8	majorOpcode;
44    CARD8	minorOpcode;
45    CARD16	errorClass B16;
46    CARD32	length B32;
47    CARD8	offendingMinorOpcode;
48    CARD8	severity;
49    CARD16	unused B16;
50    CARD32	offendingSequenceNum B32;
51    /* n	varying values */
52    /* p	p = pad (n, 8) */
53} iceErrorMsg;
54
55typedef struct {
56    CARD8	majorOpcode;
57    CARD8	minorOpcode;
58    CARD8	byteOrder;
59    CARD8	unused;
60    CARD32	length B32;
61} iceByteOrderMsg;
62
63typedef struct {
64    CARD8	majorOpcode;
65    CARD8	minorOpcode;
66    CARD8	versionCount;
67    CARD8	authCount;
68    CARD32	length B32;
69    CARD8	mustAuthenticate;
70    CARD8	unused[7];
71    /* i	STRING		vendor */
72    /* j	STRING		release */
73    /* k	LIST of STRING	authentication-protocol-names */
74    /* m	LIST of VERSION version-list */
75    /* p	p = pad (i+j+k+m, 8) */
76} iceConnectionSetupMsg;
77
78typedef struct {
79    CARD8	majorOpcode;
80    CARD8	minorOpcode;
81    CARD8	authIndex;
82    CARD8	unused1;
83    CARD32	length B32;
84    CARD16	authDataLength B16;
85    CARD8	unused2[6];
86    /* n	varying data */
87    /* p	p = pad (n, 8) */
88} iceAuthRequiredMsg;
89
90typedef struct {
91    CARD8	majorOpcode;
92    CARD8	minorOpcode;
93    CARD8	unused1[2];
94    CARD32	length B32;
95    CARD16	authDataLength B16;
96    CARD8	unused2[6];
97    /* n	varying data */
98    /* p	p = pad (n, 8) */
99} iceAuthReplyMsg;
100
101typedef struct {
102    CARD8	majorOpcode;
103    CARD8	minorOpcode;
104    CARD8	unused1[2];
105    CARD32	length B32;
106    CARD16	authDataLength B16;
107    CARD8	unused2[6];
108    /* n	varying data */
109    /* p	p = pad (n, 8) */
110} iceAuthNextPhaseMsg;
111
112typedef struct {
113    CARD8	majorOpcode;
114    CARD8	minorOpcode;
115    CARD8	versionIndex;
116    CARD8	unused;
117    CARD32	length B32;
118    /* i	STRING		vendor */
119    /* j	STRING		release */
120    /* p	p = pad (i+j, 8) */
121} iceConnectionReplyMsg;
122
123typedef struct {
124    CARD8	majorOpcode;
125    CARD8	minorOpcode;
126    CARD8	protocolOpcode;
127    CARD8	mustAuthenticate;
128    CARD32	length B32;
129    CARD8	versionCount;
130    CARD8	authCount;
131    CARD8	unused[6];
132    /* i	STRING		protocol-name */
133    /* j	STRING		vendor */
134    /* k	STRING		release */
135    /* m	LIST of STRING	authentication-protocol-names */
136    /* n	LIST of VERSION version-list */
137    /* p        p = pad (i+j+k+m+n, 8) */
138} iceProtocolSetupMsg;
139
140typedef struct {
141    CARD8	majorOpcode;
142    CARD8	minorOpcode;
143    CARD8	versionIndex;
144    CARD8	protocolOpcode;
145    CARD32	length B32;
146    /* i	STRING		vendor */
147    /* j	STRING		release */
148    /* p	p = pad (i+j, 8) */
149} iceProtocolReplyMsg;
150
151typedef iceMsg  icePingMsg;
152typedef iceMsg  icePingReplyMsg;
153typedef iceMsg  iceWantToCloseMsg;
154typedef iceMsg  iceNoCloseMsg;
155
156
157/*
158 * SIZEOF values.  These better be multiples of 8.
159 */
160
161#define sz_iceMsg			8
162#define sz_iceErrorMsg			16
163#define sz_iceByteOrderMsg		8
164#define sz_iceConnectionSetupMsg        16
165#define sz_iceAuthRequiredMsg		16
166#define sz_iceAuthReplyMsg		16
167#define sz_iceAuthNextPhaseMsg		16
168#define sz_iceConnectionReplyMsg	8
169#define sz_iceProtocolSetupMsg		16
170#define sz_iceProtocolReplyMsg		8
171#define sz_icePingMsg			8
172#define sz_icePingReplyMsg		8
173#define sz_iceWantToCloseMsg		8
174#define sz_iceNoCloseMsg		8
175
176#endif /* _ICEPROTO_H_ */
177