14642e01fSmrg/************************************************************
24642e01fSmrg
36747b715SmrgAuthor: Eamon Walsh <ewalsh@tycho.nsa.gov>
44642e01fSmrg
54642e01fSmrgPermission to use, copy, modify, distribute, and sell this software and its
64642e01fSmrgdocumentation for any purpose is hereby granted without fee, provided that
74642e01fSmrgthis permission notice appear in supporting documentation.  This permission
84642e01fSmrgnotice shall be included in all copies or substantial portions of the
94642e01fSmrgSoftware.
104642e01fSmrg
114642e01fSmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
124642e01fSmrgIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
134642e01fSmrgFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
144642e01fSmrgAUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
154642e01fSmrgAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
164642e01fSmrgCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
174642e01fSmrg
184642e01fSmrg********************************************************/
194642e01fSmrg
204642e01fSmrg#ifndef _XSELINUX_H
214642e01fSmrg#define _XSELINUX_H
224642e01fSmrg
234642e01fSmrg/* Extension info */
244642e01fSmrg#define SELINUX_EXTENSION_NAME		"SELinux"
254642e01fSmrg#define SELINUX_MAJOR_VERSION		1
266747b715Smrg#define SELINUX_MINOR_VERSION		1
274642e01fSmrg#define SELinuxNumberEvents		0
284642e01fSmrg#define SELinuxNumberErrors		0
294642e01fSmrg
304642e01fSmrg/* Extension protocol */
314642e01fSmrg#define X_SELinuxQueryVersion			0
324642e01fSmrg#define X_SELinuxSetDeviceCreateContext		1
334642e01fSmrg#define X_SELinuxGetDeviceCreateContext		2
344642e01fSmrg#define X_SELinuxSetDeviceContext		3
354642e01fSmrg#define X_SELinuxGetDeviceContext		4
366747b715Smrg#define X_SELinuxSetDrawableCreateContext	5
376747b715Smrg#define X_SELinuxGetDrawableCreateContext	6
386747b715Smrg#define X_SELinuxGetDrawableContext		7
394642e01fSmrg#define X_SELinuxSetPropertyCreateContext	8
404642e01fSmrg#define X_SELinuxGetPropertyCreateContext	9
414642e01fSmrg#define X_SELinuxSetPropertyUseContext		10
424642e01fSmrg#define X_SELinuxGetPropertyUseContext		11
434642e01fSmrg#define X_SELinuxGetPropertyContext		12
444642e01fSmrg#define X_SELinuxGetPropertyDataContext		13
454642e01fSmrg#define X_SELinuxListProperties			14
464642e01fSmrg#define X_SELinuxSetSelectionCreateContext	15
474642e01fSmrg#define X_SELinuxGetSelectionCreateContext	16
484642e01fSmrg#define X_SELinuxSetSelectionUseContext		17
494642e01fSmrg#define X_SELinuxGetSelectionUseContext		18
504642e01fSmrg#define X_SELinuxGetSelectionContext		19
514642e01fSmrg#define X_SELinuxGetSelectionDataContext	20
524642e01fSmrg#define X_SELinuxListSelections			21
534642e01fSmrg#define X_SELinuxGetClientContext		22
544642e01fSmrg
554642e01fSmrgtypedef struct {
5635c4bbdfSmrg    CARD8 reqType;
5735c4bbdfSmrg    CARD8 SELinuxReqType;
5835c4bbdfSmrg    CARD16 length;
5935c4bbdfSmrg    CARD8 client_major;
6035c4bbdfSmrg    CARD8 client_minor;
614642e01fSmrg} SELinuxQueryVersionReq;
624642e01fSmrg
634642e01fSmrgtypedef struct {
6435c4bbdfSmrg    CARD8 type;
6535c4bbdfSmrg    CARD8 pad1;
6635c4bbdfSmrg    CARD16 sequenceNumber;
6735c4bbdfSmrg    CARD32 length;
6835c4bbdfSmrg    CARD16 server_major;
6935c4bbdfSmrg    CARD16 server_minor;
7035c4bbdfSmrg    CARD32 pad2;
7135c4bbdfSmrg    CARD32 pad3;
7235c4bbdfSmrg    CARD32 pad4;
7335c4bbdfSmrg    CARD32 pad5;
7435c4bbdfSmrg    CARD32 pad6;
754642e01fSmrg} SELinuxQueryVersionReply;
764642e01fSmrg
774642e01fSmrgtypedef struct {
7835c4bbdfSmrg    CARD8 reqType;
7935c4bbdfSmrg    CARD8 SELinuxReqType;
8035c4bbdfSmrg    CARD16 length;
8135c4bbdfSmrg    CARD32 context_len;
824642e01fSmrg} SELinuxSetCreateContextReq;
834642e01fSmrg
844642e01fSmrgtypedef struct {
8535c4bbdfSmrg    CARD8 reqType;
8635c4bbdfSmrg    CARD8 SELinuxReqType;
8735c4bbdfSmrg    CARD16 length;
884642e01fSmrg} SELinuxGetCreateContextReq;
894642e01fSmrg
904642e01fSmrgtypedef struct {
9135c4bbdfSmrg    CARD8 reqType;
9235c4bbdfSmrg    CARD8 SELinuxReqType;
9335c4bbdfSmrg    CARD16 length;
9435c4bbdfSmrg    CARD32 id;
9535c4bbdfSmrg    CARD32 context_len;
964642e01fSmrg} SELinuxSetContextReq;
974642e01fSmrg
984642e01fSmrgtypedef struct {
9935c4bbdfSmrg    CARD8 reqType;
10035c4bbdfSmrg    CARD8 SELinuxReqType;
10135c4bbdfSmrg    CARD16 length;
10235c4bbdfSmrg    CARD32 id;
1034642e01fSmrg} SELinuxGetContextReq;
1044642e01fSmrg
1054642e01fSmrgtypedef struct {
10635c4bbdfSmrg    CARD8 reqType;
10735c4bbdfSmrg    CARD8 SELinuxReqType;
10835c4bbdfSmrg    CARD16 length;
10935c4bbdfSmrg    CARD32 window;
11035c4bbdfSmrg    CARD32 property;
1114642e01fSmrg} SELinuxGetPropertyContextReq;
1124642e01fSmrg
1134642e01fSmrgtypedef struct {
11435c4bbdfSmrg    CARD8 type;
11535c4bbdfSmrg    CARD8 pad1;
11635c4bbdfSmrg    CARD16 sequenceNumber;
11735c4bbdfSmrg    CARD32 length;
11835c4bbdfSmrg    CARD32 context_len;
11935c4bbdfSmrg    CARD32 pad2;
12035c4bbdfSmrg    CARD32 pad3;
12135c4bbdfSmrg    CARD32 pad4;
12235c4bbdfSmrg    CARD32 pad5;
12335c4bbdfSmrg    CARD32 pad6;
1244642e01fSmrg} SELinuxGetContextReply;
1254642e01fSmrg
1264642e01fSmrgtypedef struct {
12735c4bbdfSmrg    CARD8 type;
12835c4bbdfSmrg    CARD8 pad1;
12935c4bbdfSmrg    CARD16 sequenceNumber;
13035c4bbdfSmrg    CARD32 length;
13135c4bbdfSmrg    CARD32 count;
13235c4bbdfSmrg    CARD32 pad2;
13335c4bbdfSmrg    CARD32 pad3;
13435c4bbdfSmrg    CARD32 pad4;
13535c4bbdfSmrg    CARD32 pad5;
13635c4bbdfSmrg    CARD32 pad6;
1374642e01fSmrg} SELinuxListItemsReply;
1384642e01fSmrg
13935c4bbdfSmrg#endif                          /* _XSELINUX_H */
140