cr_protocol.h revision 14d0566627e0dd5853cae37a1ae7b8e28a99e0f5
/* Copyright (c) 2001, Stanford University
* All rights reserved.
*
* See the file LICENSE.txt for information on redistributing this software.
*/
#ifndef CR_PROTOCOL_H
#define CR_PROTOCOL_H
#ifdef DEBUG_misha
#include "cr_error.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*For now guest is allowed to connect host opengl service if protocol version matches exactly*/
/*Note: that after any change to this file, or glapi_parser\apispec.txt version should be changed*/
#define CR_PROTOCOL_VERSION_MAJOR 9
#define CR_PROTOCOL_VERSION_MINOR 1
typedef enum {
/* first message types is 'wGL\001', so we can immediately
recognize bad message types */
CR_MESSAGE_OPCODES = 0x77474c01,
typedef union {
/* pointers are usually 4 bytes, but on 64-bit machines (Alpha,
* SGI-n64, etc.) they are 8 bytes. Pass network pointers around
* as an opaque array of bytes, since the interpretation & size of
* the pointer only matter to the machine which emitted the
* pointer (and will eventually receive the pointer back again) */
unsigned int ptrAlign[2];
unsigned char ptrSize[8];
/* hack to make this packet big */
/* unsigned int junk[512]; */
#ifdef DEBUG_misha
#define CRDBGPTR_CHECKZ(_p) do { \
CRNetworkPointer _ptr = {0}; \
} while (0)
#define CRDBGPTR_CHECKNZ(_p) do { \
CRNetworkPointer _ptr = {0}; \
} while (0)
# if 0
} while (0)
# else
# endif
#else
#define CRDBGPTR_SETZ(_p) do { } while (0)
#define CRDBGPTR_CHECKZ(_p) do { } while (0)
#define CRDBGPTR_CHECKNZ(_p) do { } while (0)
#endif
#ifdef VBOX_WITH_CRHGSMI
typedef struct CRVBOXHGSMI_CMDDATA {
struct VBOXVDMACMD_CHROMIUM_CMD *pCmd;
int *pCmdRc;
char *pWriteback;
unsigned int *pcbWriteback;
unsigned int cbWriteback;
#ifdef DEBUG
# define CRVBOXHGSMI_CMDDATA_ASSERT_CONSISTENT(_pData) do { \
if ((_pData)->pWriteback) \
{ \
} \
} while (0)
# define CRVBOXHGSMI_CMDDATA_ASSERT_CLEANED(_pData) do { \
} while (0)
# define CRVBOXHGSMI_CMDDATA_ASSERT_ISSET(_pData) do { \
} while (0)
# define CRVBOXHGSMI_CMDDATA_ASSERT_ISSETWB(_pData) do { \
} while (0)
#else
# define CRVBOXHGSMI_CMDDATA_ASSERT_CONSISTENT(_pData) do { } while (0)
# define CRVBOXHGSMI_CMDDATA_ASSERT_CLEANED(_pData) do { } while (0)
# define CRVBOXHGSMI_CMDDATA_ASSERT_ISSET(_pData) do { } while (0)
# define CRVBOXHGSMI_CMDDATA_ASSERT_ISSETWB(_pData) do { } while (0)
#endif
#define CRVBOXHGSMI_CMDDATA_CLEANUP(_pData) do { \
} while (0)
} while (0)
} while (0)
} while (0)
#endif
typedef struct {
unsigned int conn_id;
typedef struct CRMessageOpcodes {
unsigned int numOpcodes;
typedef struct CRMessageRedirPtr {
#ifdef VBOX_WITH_CRHGSMI
#endif
typedef struct CRMessageWriteback {
typedef struct CRMessageReadback {
typedef struct CRMessageMulti {
typedef struct CRMessageFlowControl {
unsigned int credits;
typedef struct CRMessageReadPixels {
unsigned int bytes_per_row;
unsigned int stride;
int alignment;
int skipRows;
int skipPixels;
int rowLength;
int format;
int type;
typedef struct CRMessageNewClient {
typedef struct CRMessageGather {
unsigned long offset;
unsigned long len;
typedef union {
} CRMessage;
#ifdef __cplusplus
}
#endif
#endif /* CR_PROTOCOL_H */