1 | /* $Xorg: Xauth.h,v 1.4 2001/02/09 02:03:42 xorgcvs Exp $ */
|
---|
2 |
|
---|
3 | /*
|
---|
4 |
|
---|
5 | Copyright 1988, 1998 The Open Group
|
---|
6 |
|
---|
7 | Permission to use, copy, modify, distribute, and sell this software and its
|
---|
8 | documentation for any purpose is hereby granted without fee, provided that
|
---|
9 | the above copyright notice appear in all copies and that both that
|
---|
10 | copyright notice and this permission notice appear in supporting
|
---|
11 | documentation.
|
---|
12 |
|
---|
13 | The above copyright notice and this permission notice shall be included in
|
---|
14 | all copies or substantial portions of the Software.
|
---|
15 |
|
---|
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
---|
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
---|
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
---|
19 | OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
---|
20 | AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
---|
21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
---|
22 |
|
---|
23 | Except as contained in this notice, the name of The Open Group shall not be
|
---|
24 | used in advertising or otherwise to promote the sale, use or other dealings
|
---|
25 | in this Software without prior written authorization from The Open Group.
|
---|
26 |
|
---|
27 | */
|
---|
28 |
|
---|
29 | /* $XFree86: xc/lib/Xau/Xauth.h,v 1.5 2001/12/14 19:54:36 dawes Exp $ */
|
---|
30 |
|
---|
31 | #ifndef _Xauth_h
|
---|
32 | #define _Xauth_h
|
---|
33 |
|
---|
34 | typedef struct xauth {
|
---|
35 | unsigned short family;
|
---|
36 | unsigned short address_length;
|
---|
37 | char *address;
|
---|
38 | unsigned short number_length;
|
---|
39 | char *number;
|
---|
40 | unsigned short name_length;
|
---|
41 | char *name;
|
---|
42 | unsigned short data_length;
|
---|
43 | char *data;
|
---|
44 | } Xauth;
|
---|
45 |
|
---|
46 | #ifndef _XAUTH_STRUCT_ONLY
|
---|
47 |
|
---|
48 | # include <X11/Xfuncproto.h>
|
---|
49 | # include <X11/Xfuncs.h>
|
---|
50 |
|
---|
51 | # include <stdio.h>
|
---|
52 |
|
---|
53 | # define FamilyLocal (256) /* not part of X standard (i.e. X.h) */
|
---|
54 | # define FamilyWild (65535)
|
---|
55 | # define FamilyNetname (254) /* not part of X standard */
|
---|
56 | # define FamilyKrb5Principal (253) /* Kerberos 5 principal name */
|
---|
57 | # define FamilyLocalHost (252) /* for local non-net authentication */
|
---|
58 |
|
---|
59 |
|
---|
60 | _XFUNCPROTOBEGIN
|
---|
61 |
|
---|
62 | char *XauFileName(void);
|
---|
63 |
|
---|
64 | Xauth *XauReadAuth(
|
---|
65 | FILE* /* auth_file */
|
---|
66 | );
|
---|
67 |
|
---|
68 | int XauLockAuth(
|
---|
69 | _Xconst char* /* file_name */,
|
---|
70 | int /* retries */,
|
---|
71 | int /* timeout */,
|
---|
72 | long /* dead */
|
---|
73 | );
|
---|
74 |
|
---|
75 | int XauUnlockAuth(
|
---|
76 | _Xconst char* /* file_name */
|
---|
77 | );
|
---|
78 |
|
---|
79 | int XauWriteAuth(
|
---|
80 | FILE* /* auth_file */,
|
---|
81 | Xauth* /* auth */
|
---|
82 | );
|
---|
83 |
|
---|
84 | Xauth *XauGetAuthByName(
|
---|
85 | _Xconst char* /* display_name */
|
---|
86 | );
|
---|
87 |
|
---|
88 | Xauth *XauGetAuthByAddr(
|
---|
89 | #if NeedWidePrototypes
|
---|
90 | unsigned int /* family */,
|
---|
91 | unsigned int /* address_length */,
|
---|
92 | #else
|
---|
93 | unsigned short /* family */,
|
---|
94 | unsigned short /* address_length */,
|
---|
95 | #endif
|
---|
96 | _Xconst char* /* address */,
|
---|
97 | #if NeedWidePrototypes
|
---|
98 | unsigned int /* number_length */,
|
---|
99 | #else
|
---|
100 | unsigned short /* number_length */,
|
---|
101 | #endif
|
---|
102 | _Xconst char* /* number */,
|
---|
103 | #if NeedWidePrototypes
|
---|
104 | unsigned int /* name_length */,
|
---|
105 | #else
|
---|
106 | unsigned short /* name_length */,
|
---|
107 | #endif
|
---|
108 | _Xconst char* /* name */
|
---|
109 | );
|
---|
110 |
|
---|
111 | Xauth *XauGetBestAuthByAddr(
|
---|
112 | #if NeedWidePrototypes
|
---|
113 | unsigned int /* family */,
|
---|
114 | unsigned int /* address_length */,
|
---|
115 | #else
|
---|
116 | unsigned short /* family */,
|
---|
117 | unsigned short /* address_length */,
|
---|
118 | #endif
|
---|
119 | _Xconst char* /* address */,
|
---|
120 | #if NeedWidePrototypes
|
---|
121 | unsigned int /* number_length */,
|
---|
122 | #else
|
---|
123 | unsigned short /* number_length */,
|
---|
124 | #endif
|
---|
125 | _Xconst char* /* number */,
|
---|
126 | int /* types_length */,
|
---|
127 | char** /* type_names */,
|
---|
128 | _Xconst int* /* type_lengths */
|
---|
129 | );
|
---|
130 |
|
---|
131 | void XauDisposeAuth(
|
---|
132 | Xauth* /* auth */
|
---|
133 | );
|
---|
134 |
|
---|
135 | #ifdef K5AUTH
|
---|
136 | #include <krb5/krb5.h>
|
---|
137 | /* 9/93: krb5.h leaks some symbols */
|
---|
138 | #undef BITS32
|
---|
139 | #undef xfree
|
---|
140 |
|
---|
141 | int XauKrb5Encode(
|
---|
142 | krb5_principal /* princ */,
|
---|
143 | krb5_data * /* outbuf */
|
---|
144 | );
|
---|
145 |
|
---|
146 | int XauKrb5Decode(
|
---|
147 | krb5_data /* inbuf */,
|
---|
148 | krb5_principal * /* princ */
|
---|
149 | );
|
---|
150 | #endif /* K5AUTH */
|
---|
151 |
|
---|
152 | _XFUNCPROTOEND
|
---|
153 |
|
---|
154 | /* Return values from XauLockAuth */
|
---|
155 |
|
---|
156 | # define LOCK_SUCCESS 0 /* lock succeeded */
|
---|
157 | # define LOCK_ERROR 1 /* lock unexpectely failed, check errno */
|
---|
158 | # define LOCK_TIMEOUT 2 /* lock failed, timeouts expired */
|
---|
159 |
|
---|
160 | #endif /* _XAUTH_STRUCT_ONLY */
|
---|
161 |
|
---|
162 | #endif /* _Xauth_h */
|
---|