Obsolete VTE pre-2.91 ABI
[oi-userland.git] / components / x11 / libXtsol / srcs / Xtsol.h
blob1fd737a3c3251afdc9a5ae6a5e15980be121336d
1 /* Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved.
3 * Permission is hereby granted, free of charge, to any person obtaining a
4 * copy of this software and associated documentation files (the "Software"),
5 * to deal in the Software without restriction, including without limitation
6 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 * and/or sell copies of the Software, and to permit persons to whom the
8 * Software is furnished to do so, subject to the following conditions:
10 * The above copyright notice and this permission notice (including the next
11 * paragraph) shall be included in all copies or substantial portions of the
12 * Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */
24 #ifndef _XTSOL_H_
25 #define _XTSOL_H_
27 #include <sys/types.h>
28 #include <bsm/audit.h>
29 #include <X11/Xmd.h>
30 #include <tsol/label.h>
32 #ifndef _XTSOL_SERVER
33 #include <X11/Xlib.h>
34 #endif /* _XTSOL_SERVER */
36 #include <X11/Xfuncproto.h>
38 _XFUNCPROTOBEGIN
40 typedef enum { IsWindow, IsPixmap, IsColormap } ResourceType;
43 * Name of the Trusted Solaris extension
45 #define TSOLNAME "SUN_TSOL"
47 /*
48 * Resource value masks
49 * The following resource masks are obsolete:
50 * RES_IL 2 # information label
51 * RES_IIL 4 # input info label
54 #define RES_SL 1 /* sensitivity label */
55 #define RES_UID 8 /* user id */
56 #define RES_OUID 16 /* owner uid */
57 #define RES_STRIPE 32 /* screen stripe */
58 #define RES_LABEL (RES_SL)
59 #define RES_ALL (RES_SL|RES_UID|RES_OUID)
62 typedef struct _XTsolResAttributes {
63 CARD32 ouid; /* owner uid */
64 CARD32 uid;
65 m_label_t *sl; /* sensitivity label */
66 } XTsolResAttributes;
68 typedef struct _XTsolPropAttributes {
69 CARD32 uid;
70 m_label_t *sl; /* sensitivity label */
71 } XTsolPropAttributes;
74 * Client Attributes
76 typedef struct _XTsolClientAttributes {
77 int trustflag; /* true, if client masked as trusted */
78 uid_t uid; /* owner uid */
79 gid_t gid; /* group id */
80 pid_t pid; /* process id */
81 u_long sessionid; /* session id */
82 au_id_t auditid; /* audit id */
83 u_long iaddr; /* internet addr */
84 } XTsolClientAttributes;
87 * Trusted X Server Interfaces
88 * Status value 0 means failure, else success
89 * Status is defined in Xlib.h for user includes.
92 #ifndef Status
93 #define Status int
94 #endif
96 #ifndef _XTSOL_SERVER
98 extern Bool XTSOLIsWindowTrusted(
99 #if NeedFunctionPrototypes
100 Display *dpy,
101 Window win
102 #endif
105 extern Status XTSOLsetPolyInstInfo(
106 #if NeedFunctionPrototypes
107 Display *dpy,
108 m_label_t *sl,
109 uid_t *uidp,
110 int enabled
111 #endif
114 extern Status XTSOLsetPropLabel(
115 #if NeedFunctionPrototypes
116 Display *dpy,
117 Window win,
118 Atom property,
119 m_label_t *sl
120 #endif
123 extern Status XTSOLsetPropUID(
124 #if NeedFunctionPrototypes
125 Display *dpy,
126 Window win,
127 Atom property,
128 uid_t *uidp
129 #endif
132 extern Status XTSOLsetResLabel(
133 #if NeedFunctionPrototypes
134 Display *dpy,
135 XID object,
136 ResourceType resourceFlag,
137 m_label_t *sl
138 #endif
141 extern Status XTSOLsetResUID(
142 #if NeedFunctionPrototypes
143 Display *dpy,
144 XID object,
145 ResourceType resourceFlag,
146 uid_t *uidp
147 #endif
150 extern Status XTSOLsetSSHeight(
151 #if NeedFunctionPrototypes
152 Display *dpy,
153 int screen_num,
154 int newHeight
155 #endif
158 extern Status XTSOLgetSSHeight(
159 #if NeedFunctionPrototypes
160 Display *dpy,
161 int screen_num,
162 int *newHeight
163 #endif
166 extern Status XTSOLsetSessionHI(
167 #if NeedFunctionPrototypes
168 Display *dpy,
169 bclear_t *sl
170 #endif
173 extern Status XTSOLsetSessionLO(
174 #if NeedFunctionPrototypes
175 Display *dpy,
176 m_label_t *sl
177 #endif
180 extern Status XTSOLsetWorkstationOwner(
181 #if NeedFunctionPrototypes
182 Display *dpy,
183 uid_t *uidp
184 #endif
187 extern Status XTSOLgetClientAttributes(
188 #if NeedFunctionPrototypes
189 Display *dpy,
190 XID xid,
191 XTsolClientAttributes *clientattr
192 #endif
195 extern Status XTSOLgetClientLabel(
196 #if NeedFunctionPrototypes
197 Display *dpy,
198 XID xid,
199 m_label_t *sl
200 #endif
203 extern Status XTSOLgetPropAttributes(
204 #if NeedFunctionPrototypes
205 Display *dpy,
206 Window window,
207 Atom property,
208 XTsolPropAttributes *propattrp
209 #endif
212 extern Status XTSOLgetPropLabel(
213 #if NeedFunctionPrototypes
214 Display *dpy,
215 Window win,
216 Atom property,
217 m_label_t *sl
218 #endif
221 extern Status XTSOLgetPropUID(
222 #if NeedFunctionPrototypes
223 Display *dpy,
224 Window win,
225 Atom property,
226 uid_t *uidp
227 #endif
230 extern Status XTSOLgetResAttributes(
231 #if NeedFunctionPrototypes
232 Display *dpy,
233 XID object,
234 ResourceType resourceFlag,
235 XTsolResAttributes *resattrp
236 #endif
239 extern Status XTSOLgetResLabel(
240 #if NeedFunctionPrototypes
241 Display *dpy,
242 XID object,
243 ResourceType resourceFlag,
244 m_label_t *sl
245 #endif
248 extern Status XTSOLgetResUID(
249 #if NeedFunctionPrototypes
250 Display *dpy,
251 XID object,
252 ResourceType resourceFlag,
253 uid_t *uidp
254 #endif
257 extern Status XTSOLgetWorkstationOwner(
258 #if NeedFunctionPrototypes
259 Display *dpy,
260 uid_t *uidp
261 #endif
264 extern Status XTSOLMakeTPWindow(
265 #if NeedFunctionPrototypes
266 Display *dpy,
267 Window win
268 #endif
271 extern Status XTSOLMakeTrustedWindow(
272 #if NeedFunctionPrototypes
273 Display *dpy,
274 Window win
275 #endif
278 extern Status XTSOLMakeUntrustedWindow(
279 #if NeedFunctionPrototypes
280 Display *dpy,
281 Window win
282 #endif
285 #endif /* _XTSOL_SERVER */
287 _XFUNCPROTOEND
289 #endif /* _XTSOL_H_ */