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