open-src/lib/libXtsol/sun-src/Xtsolproto.h
author Alan Coopersmith <Alan.Coopersmith@Sun.COM>
Thu, 18 Feb 2010 16:03:08 -0800
changeset 907 3c35d611cdaa
parent 499 8670a6ee6406
child 919 425233ae7236
permissions -rw-r--r--
6927784 Remove SCCS ident tags from X gate

/* Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, and/or sell copies of the Software, and to permit persons
 * to whom the Software is furnished to do so, provided that the above
 * copyright notice(s) and this permission notice appear in all copies of
 * the Software and that both the above copyright notice(s) and this
 * permission notice appear in supporting documentation.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
 * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
 * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
 * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 *
 * Except as contained in this notice, the name of a copyright holder
 * shall not be used in advertising or otherwise to promote the sale, use
 * or other dealings in this Software without prior written authorization
 * of the copyright holder.
 */ 


/*
 * X Server Trusted Extensions
 */

#ifndef _XTSOLPROTO_H
#define _XTSOLPROTO_H

#define TSOL_NUM_EVENTS		0	/* New events defined by this extension */
#define TSOL_NUM_ERRORS		0	/* New errors defined by this extension */

/* extension request minor codes */
#define X_SetClearance            2
#define X_SetPolyInstInfo         3
#define X_SetPropLabel            4
#define X_SetPropUID              5
#define X_SetResLabel             6    
#define X_SetResUID               7
#define X_SetTrusted              8
#define X_GetClientAttributes     9
#define X_GetClientLabel         10
#define X_GetPropAttributes      11
#define X_GetResAttributes       12
#define X_MakeTPWindow           13
#define X_MakeTrustedWindow      14
#define X_MakeUntrustedWindow    15
#define X_TSOLIntern             16

/* extension request sizes */
#define sz_xSetClearanceReq           0
#define sz_xSetPolyInstInfoReq       16
#define sz_xSetPropLabelReq          20
#define sz_xSetPropUIDReq            16
#define sz_xSetResLabelReq           16
#define sz_xSetResUIDReq             16
#define sz_xSetTrustedReq             0
#define sz_xGetClientAttributesReq    8
#define sz_xGetClientLabelReq        12
#define sz_xGetPropAttributesReq     16
#define sz_xGetResAttributesReq      12
#define sz_xMakeTPWindowReq           8
#define sz_xMakeTrustedWindowReq      8
#define sz_xMakeUntrustedWindowReq    8
#define sz_xTSOLInternReq             0


/* extension reply sizes */
#define sz_xGetClientAttributesReply  32
#define sz_xGetPropAttributesReply    32
#define sz_xGetResAttributesReply     32
#define sz_xTSOLInternReply            0


/* extension request encoding format */
typedef struct {
    CARD8  reqType;                      /* extension major code */
    BYTE   minorCode;                    /* = 3                  */
    CARD16 length                B16;    /* = 18; packet size=72 */
    CARD32 uid                   B32;    /* user id              */
    CARD32 enabled               B32;    /* enable matching      */
    CARD16 sllength              B16;    /* length of SL         */
    CARD16 pad1                  B16;    /* padding              */
} xSetPolyInstInfoReq;

typedef struct {
    CARD8  reqType;                      /* extension major code */
    BYTE   minorCode;                    /* = 4                  */
    CARD16 length                B16;    /* = 18; packet size=72 */
    CARD32 id                    B32;    /* resource ID          */
    CARD32 atom                  B32;    /* atom ID              */
    CARD16 labelType             B16;
    CARD16 pad1                  B16;
    CARD16 sllength              B16;    /* length of SL         */
    CARD16 illength              B16;    /* length of IL         */
} xSetPropLabelReq;

typedef struct {
    CARD8  reqType;                      /* extension major code */
    BYTE   minorCode;                    /* = 5                  */
    CARD16 length                B16;    /* = 4; packet size= 16 */
    CARD32 id                    B32;    /* resource ID          */
    CARD32 atom                  B32;    /* atom  ID             */
    CARD32 uid                   B16;    /* UID                  */
} xSetPropUIDReq;

typedef struct {
    CARD8  reqType;                      /* extension major code */
    BYTE   minorCode;                    /* = 6                  */
    CARD16 length                B16;    /* = 17; packet size=68 */
    CARD32 id                    B32;    /* resource ID          */
    CARD16 resourceType          B16;    /* 0:window, 1:pixmap   */
    CARD16 labelType             B16;    /*                      */
    CARD16 sllength              B16;    /* length of SL         */
    CARD16 illength              B16;    /* length of IL or IIL  */
} xSetResLabelReq;

typedef struct {
    CARD8  reqType;                      /* extension major code */
    BYTE   minorCode;                    /* = 7                  */
    CARD16 length                B16;    /* = 4; packet size= 16 */
    CARD32 id                    B32;    /* resource ID          */
    CARD16 resourceType          B16;    /* 0:window, 1:pixmap   */
    CARD16 pad1                  B16;    /* not used             */
    CARD32 uid                   B16;
} xSetResUIDReq;

typedef struct {
    CARD8  reqType;                      /* Extension major code */
    BYTE   minorCode;                    /* = 9                  */
    CARD16 length                B16;    /* = 4; packet size=16  */
    CARD32 id                    B32;    /* Client ID            */
} xGetClientAttributesReq;

typedef struct {
    CARD8  reqType;                      /* extension major code */
    BYTE   minorCode;                    /* = 10                 */
    CARD16 length                B16;    /* = 4; packet size= 16 */
    CARD32 id                    B32;    /* client ID            */
    CARD16 mask                  B16;
    CARD16 pad;
} xGetClientLabelReq;

typedef struct {
    CARD8  reqType;                      /* Extension major code */
    BYTE   minorCode;                    /* = 11                 */
    CARD16 length                B16;    /* = 4; packet size=16  */
    CARD32 id                    B32;    /* resource ID          */
    CARD32 atom                  B32;    /* resource ID          */
    CARD16 mask                  B16;
    CARD16 pad                   B16;    /* not used             */
} xGetPropAttributesReq;

typedef struct {
    CARD8  reqType;                      /* Extension major code */
    BYTE   minorCode;                    /* = 12                 */
    CARD16 length                B16;    /* = 3; packet size=12  */
    CARD32 id                    B32;    /* resource ID          */
    CARD16 resourceType          B16;    /* 0:window; 1:pixmap   */
    CARD16 mask                  B16;
} xGetResAttributesReq;

typedef struct {
    CARD8  reqType;                      /* extension major code */
    BYTE   minorCode;                    /* = 13                 */
    CARD16 length                B16;    /* = 4; packet size= 16 */
    CARD32 id                    B32;    /* resource ID          */
} xMakeTPWindowReq;

typedef struct {
    CARD8  reqType;                      /* extension major code */
    BYTE   minorCode;                    /* = 14                 */
    CARD16 length                B16;    /* = 4; packet size= 16 */
    CARD32 id                    B32;    /* resource ID          */
} xMakeTrustedWindowReq;

typedef struct {
    CARD8  reqType;                      /* extension major code */
    BYTE   minorCode;                    /* = 15                 */
    CARD16 length                B16;    /* = 4; packet size= 16 */
    CARD32 id                    B32;    /* resource ID          */
} xMakeUntrustedWindowReq;
 
/* extension reply encoding format */
typedef struct {
    BYTE   type;                         /* = X_Reply            */
    BYTE   trustflag;                    /* set if client masked as trusted */
    CARD16 sequenceNumber        B16;
    CARD32 length                B32;    /* = 4;                 */
    CARD32 uid                   B32;
    CARD32 pid                   B32;
    CARD32 gid                   B32;
    CARD32 auditid               B32;
    CARD32 sessionid             B32;
    CARD32 iaddr;                        /* internet address    */
} xGetClientAttributesReply;

typedef struct {
    BYTE   type;                         /* = X_Reply            */
    BYTE   pad1;                         /* not used             */
    CARD16 sequenceNumber        B16;
    CARD32 length                B32;    /* = 4;                 */
    CARD32 uid                   B32;
    CARD16 sllength              B16;
    CARD16 illength              B16;
    CARD32 pad2                  B32;
    CARD32 pad3                  B32;
    CARD32 pad4                  B32;
    CARD32 pad5                  B32;
} xGetPropAttributesReply;

typedef struct {
    BYTE   type;                         /* = X_Reply            */
    BYTE   pad1;                         /* not used             */
    CARD16 sequenceNumber        B16;
    CARD32 length                B32;    /* = 4;                 */
    CARD32 uid                   B32;
    CARD32 owneruid              B32;
    CARD16 sllength              B16;
    CARD16 illength              B16;
    CARD16 iillength             B16;
    CARD16 pad2                  B16;
    CARD32 pad3                  B32;
    CARD32 pad4                  B32;
} xGetResAttributesReply;


#define DOOWNERUID       1000
#define SESSIONHI        1010
#define SESSIONLO        1020
#define STRIPEHEIGHT     1030
#define INPUTIL          1040

#endif /* _XTSOLPROTO_H */