home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-bin / x11r6.1 / include / x11 / ice / iceproto.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-10-17  |  4.7 KB  |  176 lines

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