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

  1. /* $XConsortium: Xauth.h,v 1.17 95/07/10 21:18:07 gildea Exp $ */
  2.  
  3. /*
  4.  
  5. Copyright (c) 1988  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. */
  29.  
  30. #ifndef _Xauth_h
  31. #define _Xauth_h
  32.  
  33. # include   <X11/Xfuncproto.h>
  34. # include   <X11/Xfuncs.h>
  35.  
  36. # include   <stdio.h>
  37.  
  38. # define FamilyLocal (256)    /* not part of X standard (i.e. X.h) */
  39. # define FamilyWild  (65535)
  40. # define FamilyNetname    (254)   /* not part of X standard */
  41. # define FamilyKrb5Principal (253) /* Kerberos 5 principal name */
  42. # define FamilyLocalHost (252)    /* for local non-net authentication */
  43.  
  44. typedef struct xauth {
  45.     unsigned short   family;
  46.     unsigned short   address_length;
  47.     char            *address;
  48.     unsigned short   number_length;
  49.     char            *number;
  50.     unsigned short   name_length;
  51.     char            *name;
  52.     unsigned short   data_length;
  53.     char           *data;
  54. } Xauth;
  55.  
  56. _XFUNCPROTOBEGIN
  57.  
  58. char *XauFileName();
  59.  
  60. Xauth *XauReadAuth(
  61. #if NeedFunctionPrototypes
  62. FILE*    /* auth_file */
  63. #endif
  64. );
  65.  
  66. int XauLockAuth(
  67. #if NeedFunctionPrototypes
  68. _Xconst char*    /* file_name */,
  69. int        /* retries */,
  70. int        /* timeout */,
  71. long        /* dead */
  72. #endif
  73. );
  74.  
  75. int XauUnlockAuth(
  76. #if NeedFunctionPrototypes
  77. _Xconst char*    /* file_name */
  78. #endif
  79. );
  80.  
  81. int XauWriteAuth(
  82. #if NeedFunctionPrototypes
  83. FILE*        /* auth_file */,
  84. Xauth*        /* auth */
  85. #endif
  86. );
  87.  
  88. Xauth *XauGetAuthByName(
  89. #if NeedFunctionPrototypes
  90. _Xconst char*    /* display_name */
  91. #endif
  92. );
  93.  
  94. Xauth *XauGetAuthByAddr(
  95. #if NeedFunctionPrototypes
  96. #if NeedWidePrototypes
  97. unsigned int    /* family */,
  98. unsigned int    /* address_length */,
  99. #else
  100. unsigned short    /* family */,
  101. unsigned short    /* address_length */,
  102. #endif
  103. _Xconst char*    /* address */,
  104. #if NeedWidePrototypes
  105. unsigned int    /* number_length */,
  106. #else
  107. unsigned short    /* number_length */,
  108. #endif
  109. _Xconst char*    /* number */,
  110. #if NeedWidePrototypes
  111. unsigned int    /* name_length */,
  112. #else
  113. unsigned short    /* name_length */,
  114. #endif
  115. _Xconst char*    /* name */
  116. #endif
  117. );
  118.  
  119. Xauth *XauGetBestAuthByAddr(
  120. #if NeedFunctionPrototypes
  121. #if NeedWidePrototypes
  122. unsigned int    /* family */,
  123. unsigned int    /* address_length */,
  124. #else
  125. unsigned short    /* family */,
  126. unsigned short    /* address_length */,
  127. #endif
  128. _Xconst char*    /* address */,
  129. #if NeedWidePrototypes
  130. unsigned int    /* number_length */,
  131. #else
  132. unsigned short    /* number_length */,
  133. #endif
  134. _Xconst char*    /* number */,
  135. int        /* types_length */,
  136. char**        /* type_names */,
  137. _Xconst int*    /* type_lengths */
  138. #endif
  139. );
  140.  
  141. void XauDisposeAuth(
  142. #if NeedFunctionPrototypes
  143. Xauth*        /* auth */
  144. #endif
  145. );
  146.  
  147. #ifdef K5AUTH
  148. #include <krb5/krb5.h>
  149. /* 9/93: krb5.h leaks some symbols */
  150. #undef BITS32
  151. #undef xfree
  152.  
  153. int XauKrb5Encode(
  154. #if NeedFunctionPrototypes
  155.      krb5_principal    /* princ */,
  156.      krb5_data *    /* outbuf */
  157. #endif
  158. );
  159.  
  160. int XauKrb5Decode(
  161. #if NeedFunctionPrototypes
  162.      krb5_data        /* inbuf */,
  163.      krb5_principal *    /* princ */
  164. #endif
  165. );
  166. #endif /* K5AUTH */
  167.  
  168. _XFUNCPROTOEND
  169.  
  170. /* Return values from XauLockAuth */
  171.  
  172. # define LOCK_SUCCESS    0    /* lock succeeded */
  173. # define LOCK_ERROR    1    /* lock unexpectely failed, check errno */
  174. # define LOCK_TIMEOUT    2    /* lock failed, timeouts expired */
  175.  
  176. #endif /* _Xauth_h */
  177.