Category reorganization
[openwrt/svn-archive/archive.git] / XOrg / headers / native / src / X11 / Xauth.h
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 *XauGetAuthByAddr(
85 #if NeedWidePrototypes
86 unsigned int /* family */,
87 unsigned int /* address_length */,
88 #else
89 unsigned short /* family */,
90 unsigned short /* address_length */,
91 #endif
92 _Xconst char* /* address */,
93 #if NeedWidePrototypes
94 unsigned int /* number_length */,
95 #else
96 unsigned short /* number_length */,
97 #endif
98 _Xconst char* /* number */,
99 #if NeedWidePrototypes
100 unsigned int /* name_length */,
101 #else
102 unsigned short /* name_length */,
103 #endif
104 _Xconst char* /* name */
105 );
106
107 Xauth *XauGetBestAuthByAddr(
108 #if NeedWidePrototypes
109 unsigned int /* family */,
110 unsigned int /* address_length */,
111 #else
112 unsigned short /* family */,
113 unsigned short /* address_length */,
114 #endif
115 _Xconst char* /* address */,
116 #if NeedWidePrototypes
117 unsigned int /* number_length */,
118 #else
119 unsigned short /* number_length */,
120 #endif
121 _Xconst char* /* number */,
122 int /* types_length */,
123 char** /* type_names */,
124 _Xconst int* /* type_lengths */
125 );
126
127 void XauDisposeAuth(
128 Xauth* /* auth */
129 );
130
131 #ifdef K5AUTH
132 #include <krb5/krb5.h>
133 /* 9/93: krb5.h leaks some symbols */
134 #undef BITS32
135 #undef xfree
136
137 int XauKrb5Encode(
138 krb5_principal /* princ */,
139 krb5_data * /* outbuf */
140 );
141
142 int XauKrb5Decode(
143 krb5_data /* inbuf */,
144 krb5_principal * /* princ */
145 );
146 #endif /* K5AUTH */
147
148 _XFUNCPROTOEND
149
150 /* Return values from XauLockAuth */
151
152 # define LOCK_SUCCESS 0 /* lock succeeded */
153 # define LOCK_ERROR 1 /* lock unexpectely failed, check errno */
154 # define LOCK_TIMEOUT 2 /* lock failed, timeouts expired */
155
156 #endif /* _XAUTH_STRUCT_ONLY */
157
158 #endif /* _Xauth_h */