diff options
-rw-r--r-- | spice/draw.h | 380 | ||||
-rw-r--r-- | spice/ipc_ring.h | 32 | ||||
-rw-r--r-- | spice/qxl_dev.h | 68 | ||||
-rw-r--r-- | spice/red.h | 858 | ||||
-rw-r--r-- | spice/reds_stat.h | 30 | ||||
-rw-r--r-- | spice/vdi_dev.h | 2 |
6 files changed, 685 insertions, 685 deletions
diff --git a/spice/draw.h b/spice/draw.h index d722eae..4e99456 100644 --- a/spice/draw.h +++ b/spice/draw.h @@ -35,338 +35,338 @@ #include <spice/start-packed.h> -#define GET_ADDRESS(addr) ((void *)(unsigned long)(addr)) -#define SET_ADDRESS(addr, val) ((addr) = (unsigned long)(val)) +#define SPICE_GET_ADDRESS(addr) ((void *)(unsigned long)(addr)) +#define SPICE_SET_ADDRESS(addr, val) ((addr) = (unsigned long)(val)) -typedef int32_t FIXED28_4; -typedef uint64_t ADDRESS; +typedef int32_t SPICE_FIXED28_4; +typedef uint64_t SPICE_ADDRESS; enum { - PATH_BEGIN = (1 << 0), - PATH_END = (1 << 1), - PATH_CLOSE = (1 << 3), - PATH_BEZIER = (1 << 4), + SPICE_PATH_BEGIN = (1 << 0), + SPICE_PATH_END = (1 << 1), + SPICE_PATH_CLOSE = (1 << 3), + SPICE_PATH_BEZIER = (1 << 4), }; enum { - LINE_ATTR_STARTGAP = (1 << 2), - LINE_ATTR_STYLED = (1 << 3), + SPICE_LINE_ATTR_STARTGAP = (1 << 2), + SPICE_LINE_ATTR_STYLED = (1 << 3), }; -typedef struct SPICE_ATTR_PACKED PointFix { - FIXED28_4 x; - FIXED28_4 y; -} PointFix; +typedef struct SPICE_ATTR_PACKED SpicePointFix { + SPICE_FIXED28_4 x; + SPICE_FIXED28_4 y; +} SpicePointFix; -typedef struct SPICE_ATTR_PACKED Point { +typedef struct SPICE_ATTR_PACKED SpicePoint { int32_t x; int32_t y; -} Point; +} SpicePoint; -typedef struct SPICE_ATTR_PACKED Point16 { +typedef struct SPICE_ATTR_PACKED SpicePoint16 { int16_t x; int16_t y; -} Point16; +} SpicePoint16; -typedef struct SPICE_ATTR_PACKED Rect { +typedef struct SPICE_ATTR_PACKED SpiceRect { int32_t top; int32_t left; int32_t bottom; int32_t right; -} Rect; +} SpiceRect; -typedef struct SPICE_ATTR_PACKED PathSeg { +typedef struct SPICE_ATTR_PACKED SpicePathSeg { uint32_t flags; uint32_t count; uint8_t data[0]; -} PathSeg; +} SpicePathSeg; -enum ClipType { - CLIP_TYPE_NONE, - CLIP_TYPE_RECTS, - CLIP_TYPE_PATH, +enum SpiceClipType { + SPICE_CLIP_TYPE_NONE, + SPICE_CLIP_TYPE_RECTS, + SPICE_CLIP_TYPE_PATH, }; -typedef struct SPICE_ATTR_PACKED Clip { +typedef struct SPICE_ATTR_PACKED SpiceClip { uint32_t type; - ADDRESS data; -} Clip; - -enum ROPDescriptor { - ROPD_INVERS_SRC = (1 << 0), - ROPD_INVERS_BRUSH = (1 << 1), - ROPD_INVERS_DEST = (1 << 2), - ROPD_OP_PUT = (1 << 3), - ROPD_OP_OR = (1 << 4), - ROPD_OP_AND = (1 << 5), - ROPD_OP_XOR = (1 << 6), - ROPD_OP_BLACKNESS = (1 << 7), - ROPD_OP_WHITENESS = (1 << 8), - ROPD_OP_INVERS = (1 << 9), - ROPD_INVERS_RES = (1 << 10), + SPICE_ADDRESS data; +} SpiceClip; + +enum SpiceROPDescriptor { + SPICE_ROPD_INVERS_SRC = (1 << 0), + SPICE_ROPD_INVERS_BRUSH = (1 << 1), + SPICE_ROPD_INVERS_DEST = (1 << 2), + SPICE_ROPD_OP_PUT = (1 << 3), + SPICE_ROPD_OP_OR = (1 << 4), + SPICE_ROPD_OP_AND = (1 << 5), + SPICE_ROPD_OP_XOR = (1 << 6), + SPICE_ROPD_OP_BLACKNESS = (1 << 7), + SPICE_ROPD_OP_WHITENESS = (1 << 8), + SPICE_ROPD_OP_INVERS = (1 << 9), + SPICE_ROPD_INVERS_RES = (1 << 10), }; -typedef struct SPICE_ATTR_PACKED Pattern { - ADDRESS pat; - Point pos; -} Pattern; +typedef struct SPICE_ATTR_PACKED SpicePattern { + SPICE_ADDRESS pat; + SpicePoint pos; +} SpicePattern; enum { - BRUSH_TYPE_NONE, - BRUSH_TYPE_SOLID, - BRUSH_TYPE_PATTERN, + SPICE_BRUSH_TYPE_NONE, + SPICE_BRUSH_TYPE_SOLID, + SPICE_BRUSH_TYPE_PATTERN, }; -typedef struct SPICE_ATTR_PACKED Brush { +typedef struct SPICE_ATTR_PACKED SpiceBrush { uint32_t type; union { uint32_t color; - Pattern pattern; + SpicePattern pattern; } u; -} Brush; +} SpiceBrush; enum { - MASK_INVERS = (1 << 0), + SPICE_MASK_FLAGS_INVERS = (1 << 0), }; -typedef struct SPICE_ATTR_PACKED QMask { +typedef struct SPICE_ATTR_PACKED SpiceQMask { uint8_t flags; - Point pos; - ADDRESS bitmap; -} QMask; + SpicePoint pos; + SPICE_ADDRESS bitmap; +} SpiceQMask; -typedef struct SPICE_ATTR_PACKED Fill { - Brush brush; +typedef struct SPICE_ATTR_PACKED SpiceFill { + SpiceBrush brush; uint16_t rop_decriptor; - QMask mask; -} Fill; + SpiceQMask mask; +} SpiceFill; -typedef struct SPICE_ATTR_PACKED Palette { +typedef struct SPICE_ATTR_PACKED SpicePalette { uint64_t unique; uint16_t num_ents; uint32_t ents[0]; -} Palette; +} SpicePalette; enum { - IMAGE_TYPE_BITMAP, - IMAGE_TYPE_QUIC, - IMAGE_TYPE_RESERVED, - IMAGE_TYPE_LZ_PLT = 100, - IMAGE_TYPE_LZ_RGB, - IMAGE_TYPE_GLZ_RGB, - IMAGE_TYPE_FROM_CACHE, + SPICE_IMAGE_TYPE_BITMAP, + SPICE_IMAGE_TYPE_QUIC, + SPICE_IMAGE_TYPE_RESERVED, + SPICE_IMAGE_TYPE_LZ_PLT = 100, + SPICE_IMAGE_TYPE_LZ_RGB, + SPICE_IMAGE_TYPE_GLZ_RGB, + SPICE_IMAGE_TYPE_FROM_CACHE, }; enum { - IMAGE_CACHE_ME = (1 << 0), + SPICE_IMAGE_FLAGS_CACHE_ME = (1 << 0), }; -typedef struct SPICE_ATTR_PACKED ImageDescriptor { +typedef struct SPICE_ATTR_PACKED SpiceImageDescriptor { uint64_t id; uint8_t type; uint8_t flags; uint32_t width; uint32_t height; -} ImageDescriptor; +} SpiceImageDescriptor; enum { - BITMAP_FMT_INVALID, - BITMAP_FMT_1BIT_LE, - BITMAP_FMT_1BIT_BE, - BITMAP_FMT_4BIT_LE, - BITMAP_FMT_4BIT_BE, - BITMAP_FMT_8BIT, - BITMAP_FMT_16BIT, - BITMAP_FMT_24BIT, - BITMAP_FMT_32BIT, - BITMAP_FMT_RGBA, + SPICE_BITMAP_FMT_INVALID, + SPICE_BITMAP_FMT_1BIT_LE, + SPICE_BITMAP_FMT_1BIT_BE, + SPICE_BITMAP_FMT_4BIT_LE, + SPICE_BITMAP_FMT_4BIT_BE, + SPICE_BITMAP_FMT_8BIT, + SPICE_BITMAP_FMT_16BIT, + SPICE_BITMAP_FMT_24BIT, + SPICE_BITMAP_FMT_32BIT, + SPICE_BITMAP_FMT_RGBA, }; enum { - BITMAP_PAL_CACHE_ME = (1 << 0), - BITMAP_PAL_FROM_CACHE = (1 << 1), - BITMAP_TOP_DOWN = (1 << 2), + SPICE_BITMAP_FLAGS_PAL_CACHE_ME = (1 << 0), + SPICE_BITMAP_FLAGS_PAL_FROM_CACHE = (1 << 1), + SPICE_BITMAP_FLAGS_TOP_DOWN = (1 << 2), }; -typedef struct SPICE_ATTR_PACKED Bitmap { +typedef struct SPICE_ATTR_PACKED SpiceBitmap { uint8_t format; uint8_t flags; uint32_t x; uint32_t y; uint32_t stride; - ADDRESS palette; - ADDRESS data; //data[0] ? -} Bitmap; + SPICE_ADDRESS palette; + SPICE_ADDRESS data; //data[0] ? +} SpiceBitmap; -typedef struct SPICE_ATTR_PACKED BitmapImage { - ImageDescriptor descriptor; - Bitmap bitmap; -} BitmapImage; +typedef struct SPICE_ATTR_PACKED SpiceBitmapImage { + SpiceImageDescriptor descriptor; + SpiceBitmap bitmap; +} SpiceBitmapImage; -typedef struct SPICE_ATTR_PACKED QUICData { +typedef struct SPICE_ATTR_PACKED SpiceQUICData { uint32_t data_size; uint8_t data[0]; -} QUICData, LZ_RGBData; +} SpiceQUICData, SpiceLZRGBData; -typedef struct SPICE_ATTR_PACKED QUICImage { - ImageDescriptor descriptor; - QUICData quic; -} QUICImage; +typedef struct SPICE_ATTR_PACKED SpiceQUICImage { + SpiceImageDescriptor descriptor; + SpiceQUICData quic; +} SpiceQUICImage; -typedef struct SPICE_ATTR_PACKED LZ_RGBImage { - ImageDescriptor descriptor; - LZ_RGBData lz_rgb; -} LZ_RGBImage; +typedef struct SPICE_ATTR_PACKED SpiceLZRGBImage { + SpiceImageDescriptor descriptor; + SpiceLZRGBData lz_rgb; +} SpiceLZRGBImage; -typedef struct SPICE_ATTR_PACKED LZ_PLTData { +typedef struct SPICE_ATTR_PACKED SpiceLZPLTData { uint8_t flags; uint32_t data_size; - ADDRESS palette; + SPICE_ADDRESS palette; uint8_t data[0]; -} LZ_PLTData; +} SpiceLZPLTData; -typedef struct SPICE_ATTR_PACKED LZ_PLTImage { - ImageDescriptor descriptor; - LZ_PLTData lz_plt; -} LZ_PLTImage; +typedef struct SPICE_ATTR_PACKED SpiceLZPLTImage { + SpiceImageDescriptor descriptor; + SpiceLZPLTData lz_plt; +} SpiceLZPLTImage; enum { - IMAGE_SCALE_INTERPOLATE, - IMAGE_SCALE_NEAREST, + SPICE_IMAGE_SCALE_MODE_INTERPOLATE, + SPICE_IMAGE_SCALE_MODE_NEAREST, }; -typedef struct SPICE_ATTR_PACKED Opaque { - ADDRESS src_bitmap; - Rect src_area; - Brush brush; +typedef struct SPICE_ATTR_PACKED SpiceOpaque { + SPICE_ADDRESS src_bitmap; + SpiceRect src_area; + SpiceBrush brush; uint16_t rop_decriptor; uint8_t scale_mode; - QMask mask; -} Opaque; + SpiceQMask mask; +} SpiceOpaque; -typedef struct SPICE_ATTR_PACKED Copy { - ADDRESS src_bitmap; - Rect src_area; +typedef struct SPICE_ATTR_PACKED SpiceCopy { + SPICE_ADDRESS src_bitmap; + SpiceRect src_area; uint16_t rop_decriptor; uint8_t scale_mode; - QMask mask; -} Copy, Blend; + SpiceQMask mask; +} SpiceCopy, SpiceBlend; -typedef struct SPICE_ATTR_PACKED Transparent { - ADDRESS src_bitmap; - Rect src_area; +typedef struct SPICE_ATTR_PACKED SpiceTransparent { + SPICE_ADDRESS src_bitmap; + SpiceRect src_area; uint32_t src_color; uint32_t true_color; -} Transparent; +} SpiceTransparent; -typedef struct SPICE_ATTR_PACKED AlphaBlnd { +typedef struct SPICE_ATTR_PACKED SpiceAlphaBlnd { uint8_t alpha; - ADDRESS src_bitmap; - Rect src_area; -} AlphaBlnd; - -typedef struct SPICE_ATTR_PACKED Rop3 { - ADDRESS src_bitmap; - Rect src_area; - Brush brush; + SPICE_ADDRESS src_bitmap; + SpiceRect src_area; +} SpiceAlphaBlnd; + +typedef struct SPICE_ATTR_PACKED SpiceRop3 { + SPICE_ADDRESS src_bitmap; + SpiceRect src_area; + SpiceBrush brush; uint8_t rop3; uint8_t scale_mode; - QMask mask; -} Rop3; + SpiceQMask mask; +} SpiceRop3; -typedef struct SPICE_ATTR_PACKED Blackness { - QMask mask; -} Blackness, Invers, Whiteness; +typedef struct SPICE_ATTR_PACKED SpiceBlackness { + SpiceQMask mask; +} SpiceBlackness, SpiceInvers, SpiceWhiteness; enum { - LINE_STYLED = (1 << 3), - LINE_START_WITH_GAP = (1 << 2), + SPICE_LINE_FLAGS_STYLED = (1 << 3), + SPICE_LINE_FLAGS_START_WITH_GAP = (1 << 2), }; enum { - LINE_CAP_ROUND, - LINE_CAP_SQUARE, - LINE_CAP_BUTT, + SPICE_LINE_CAP_ROUND, + SPICE_LINE_CAP_SQUARE, + SPICE_LINE_CAP_BUTT, }; enum { - LINE_JOIN_ROUND, - LINE_JOIN_BEVEL, - LINE_JOIN_MITER, + SPICE_LINE_JOIN_ROUND, + SPICE_LINE_JOIN_BEVEL, + SPICE_LINE_JOIN_MITER, }; -typedef struct SPICE_ATTR_PACKED LineAttr { +typedef struct SPICE_ATTR_PACKED SpiceLineAttr { uint8_t flags; uint8_t join_style; uint8_t end_style; uint8_t style_nseg; - FIXED28_4 width; - FIXED28_4 miter_limit; - ADDRESS style; //data[0] ? -} LineAttr; - -typedef struct SPICE_ATTR_PACKED Stroke { - ADDRESS path; - LineAttr attr; - Brush brush; + SPICE_FIXED28_4 width; + SPICE_FIXED28_4 miter_limit; + SPICE_ADDRESS style; //data[0] ? +} SpiceLineAttr; + +typedef struct SPICE_ATTR_PACKED SpiceStroke { + SPICE_ADDRESS path; + SpiceLineAttr attr; + SpiceBrush brush; uint16_t fore_mode; uint16_t back_mode; -} Stroke; +} SpiceStroke; -typedef struct SPICE_ATTR_PACKED RasterGlyph { - Point render_pos; - Point glyph_origin; +typedef struct SPICE_ATTR_PACKED SpiceRasterGlyph { + SpicePoint render_pos; + SpicePoint glyph_origin; uint16_t width; uint16_t height; uint8_t data[0]; -} RasterGlyph; +} SpiceRasterGlyph; -typedef struct SPICE_ATTR_PACKED VectotGlyph { - Point render_pos; +typedef struct SPICE_ATTR_PACKED SpiceVectorGlyph { + SpicePoint render_pos; uint32_t data_size; - uint8_t data[0]; //PathSeg[] -} VectotGlyph; + uint8_t data[0]; //SpicePathSeg[] +} SpiceVectorGlyph; enum { - STRING_RASTER_A1 = 1 << 0, - STRING_RASTER_A4 = 1 << 1, - STRING_RASTER_A8 = 1 << 2, - STRING_RASTER_TOP_DOWN = 1 << 3, + SPICE_STRING_FLAGS_RASTER_A1 = 1 << 0, + SPICE_STRING_FLAGS_RASTER_A4 = 1 << 1, + SPICE_STRING_FLAGS_RASTER_A8 = 1 << 2, + SPICE_STRING_FLAGS_RASTER_TOP_DOWN = 1 << 3, }; -typedef struct SPICE_ATTR_PACKED String { +typedef struct SPICE_ATTR_PACKED SpiceString { uint16_t length; uint16_t flags; uint8_t data[0]; -} String; +} SpiceString; -typedef struct SPICE_ATTR_PACKED Text { - ADDRESS str; - Rect back_area; - Brush fore_brush; - Brush back_brush; +typedef struct SPICE_ATTR_PACKED SpiceText { + SPICE_ADDRESS str; + SpiceRect back_area; + SpiceBrush fore_brush; + SpiceBrush back_brush; uint16_t fore_mode; uint16_t back_mode; -} Text; +} SpiceText; enum { - CURSOR_TYPE_ALPHA, - CURSOR_TYPE_MONO, - CURSOR_TYPE_COLOR4, - CURSOR_TYPE_COLOR8, - CURSOR_TYPE_COLOR16, - CURSOR_TYPE_COLOR24, - CURSOR_TYPE_COLOR32, + SPICE_CURSOR_TYPE_ALPHA, + SPICE_CURSOR_TYPE_MONO, + SPICE_CURSOR_TYPE_COLOR4, + SPICE_CURSOR_TYPE_COLOR8, + SPICE_CURSOR_TYPE_COLOR16, + SPICE_CURSOR_TYPE_COLOR24, + SPICE_CURSOR_TYPE_COLOR32, }; -typedef struct SPICE_ATTR_PACKED CursorHeader { +typedef struct SPICE_ATTR_PACKED SpiceCursorHeader { uint64_t unique; uint16_t type; uint16_t width; uint16_t height; uint16_t hot_spot_x; uint16_t hot_spot_y; -} CursorHeader; +} SpiceCursorHeader; #include <spice/end-packed.h> diff --git a/spice/ipc_ring.h b/spice/ipc_ring.h index 0011667..2de6470 100644 --- a/spice/ipc_ring.h +++ b/spice/ipc_ring.h @@ -68,7 +68,7 @@ -#define RING_DECLARE(name, el_type, size) \ +#define SPICE_RING_DECLARE(name, el_type, size) \ typedef struct SPICE_ATTR_PACKED name##_ring_el { \ union { \ el_type el; \ @@ -86,7 +86,7 @@ typedef struct SPICE_ATTR_PACKED name { \ } name; -#define RING_INIT(r) \ +#define SPICE_RING_INIT(r) \ (r)->num_items = sizeof((r)->items) >> \ PAWER2_TO_SHIFT(sizeof((r)->items[0])); \ (r)->prod = (r)->cons = 0; \ @@ -94,39 +94,39 @@ typedef struct SPICE_ATTR_PACKED name { \ (r)->notify_on_cons = 0; -#define RING_INDEX_MASK(r) ((r)->num_items - 1) +#define SPICE_RING_INDEX_MASK(r) ((r)->num_items - 1) -#define RING_IS_PACKED(r) (sizeof((r)->items[0]) == sizeof((r)->items[0]).el) +#define SPICE_RING_IS_PACKED(r) (sizeof((r)->items[0]) == sizeof((r)->items[0]).el) -#define RING_IS_EMPTY(r) ((r)->cons == (r)->prod) +#define SPICE_RING_IS_EMPTY(r) ((r)->cons == (r)->prod) -#define RING_IS_FULL(r) (((r)->prod - (r)->cons) == (r)->num_items) +#define SPICE_RING_IS_FULL(r) (((r)->prod - (r)->cons) == (r)->num_items) -#define RING_PROD_ITEM(r) (&(r)->items[(r)->prod & RING_INDEX_MASK(r)].el) +#define SPICE_RING_PROD_ITEM(r) (&(r)->items[(r)->prod & SPICE_RING_INDEX_MASK(r)].el) -#define RING_PROD_WAIT(r, wait) \ - if (((wait) = RING_IS_FULL(r))) { \ +#define SPICE_RING_PROD_WAIT(r, wait) \ + if (((wait) = SPICE_RING_IS_FULL(r))) { \ (r)->notify_on_cons = (r)->cons + 1; \ spice_mb(); \ - (wait) = RING_IS_FULL(r); \ + (wait) = SPICE_RING_IS_FULL(r); \ } -#define RING_PUSH(r, notify) \ +#define SPICE_RING_PUSH(r, notify) \ (r)->prod++; \ spice_mb(); \ (notify) = (r)->prod == (r)->notify_on_prod; -#define RING_CONS_ITEM(r) (&(r)->items[(r)->cons & RING_INDEX_MASK(r)].el) +#define SPICE_RING_CONS_ITEM(r) (&(r)->items[(r)->cons & SPICE_RING_INDEX_MASK(r)].el) -#define RING_CONS_WAIT(r, wait) \ - if (((wait) = RING_IS_EMPTY(r))) { \ +#define SPICE_RING_CONS_WAIT(r, wait) \ + if (((wait) = SPICE_RING_IS_EMPTY(r))) { \ (r)->notify_on_prod = (r)->prod + 1; \ spice_mb(); \ - (wait) = RING_IS_EMPTY(r); \ + (wait) = SPICE_RING_IS_EMPTY(r); \ } -#define RING_POP(r, notify) \ +#define SPICE_RING_POP(r, notify) \ (r)->cons++; \ spice_mb(); \ (notify) = (r)->cons == (r)->notify_on_cons; diff --git a/spice/qxl_dev.h b/spice/qxl_dev.h index 7a226ce..6b4fc11 100644 --- a/spice/qxl_dev.h +++ b/spice/qxl_dev.h @@ -110,7 +110,7 @@ typedef struct SPICE_ATTR_PACKED QXLModes { QXLMode modes[0]; } QXLModes; -typedef uint64_t PHYSICAL; +typedef uint64_t QXLPHYSICAL; typedef uint32_t QXLFIXED; //fixed 28.4 enum QXLCmdType { @@ -122,7 +122,7 @@ enum QXLCmdType { }; typedef struct SPICE_ATTR_PACKED QXLCommand { - PHYSICAL data; + QXLPHYSICAL data; uint32_t type; uint32_t ped; } QXLCommand; @@ -148,13 +148,13 @@ typedef struct SPICE_ATTR_PACKED QXLSurfaceCreate { uint32_t mouse_mode; uint32_t flags; uint32_t type; - PHYSICAL mem; + QXLPHYSICAL mem; } QXLSurfaceCreate; -RING_DECLARE(QXLCommandRing, QXLCommand, 32); -RING_DECLARE(QXLCursorRing, QXLCommand, 32); +SPICE_RING_DECLARE(QXLCommandRing, QXLCommand, 32); +SPICE_RING_DECLARE(QXLCursorRing, QXLCommand, 32); -RING_DECLARE(QXLReleaseRing, uint64_t, 8); +SPICE_RING_DECLARE(QXLReleaseRing, uint64_t, 8); #define QXL_LOG_BUF_SIZE 4096 @@ -169,7 +169,7 @@ typedef struct SPICE_ATTR_PACKED QXLRam { QXLCommandRing cmd_ring; QXLCursorRing cursor_ring; QXLReleaseRing release_ring; - Rect update_area; + SpiceRect update_area; QXLMemSlot mem_slot; QXLSurfaceCreate create_surface; uint64_t flags; @@ -187,8 +187,8 @@ typedef struct QXLReleaseInfoExt { typedef struct SPICE_ATTR_PACKED QXLDataChunk { uint32_t data_size; - PHYSICAL prev_chunk; - PHYSICAL next_chunk; + QXLPHYSICAL prev_chunk; + QXLPHYSICAL next_chunk; uint8_t data[0]; } QXLDataChunk; @@ -199,12 +199,12 @@ typedef struct SPICE_ATTR_PACKED QXLMessage { typedef struct SPICE_ATTR_PACKED QXLUpdateCmd { QXLReleaseInfo release_info; - Rect area; + SpiceRect area; uint32_t update_id; } QXLUpdateCmd; typedef struct SPICE_ATTR_PACKED QXLCursor { - CursorHeader header; + SpiceCursorHeader header; uint32_t data_size; QXLDataChunk chunk; } QXLCursor; @@ -223,15 +223,15 @@ typedef struct SPICE_ATTR_PACKED QXLCursorCmd { uint8_t type; union { struct SPICE_ATTR_PACKED { - Point16 position; + SpicePoint16 position; uint8_t visible; - PHYSICAL shape; + QXLPHYSICAL shape; } set; struct SPICE_ATTR_PACKED { uint16_t length; uint16_t frequency; } trail; - Point16 position; + SpicePoint16 position; } u; uint8_t device_data[QXL_CURSUR_DEVICE_DATA_SIZE]; //todo: dynamic size from rom } QXLCursorCmd; @@ -261,7 +261,7 @@ typedef struct SPICE_ATTR_PACKED QXLString { } QXLString; typedef struct SPICE_ATTR_PACKED QXLCopyBits { - Point src_pos; + SpicePoint src_pos; } QXLCopyBits; #define QXL_EFFECT_BLEND 0 @@ -278,24 +278,24 @@ typedef struct SPICE_ATTR_PACKED QXLDrawable { uint8_t effect; uint8_t type; uint8_t self_bitmap; - Rect self_bitmap_area; - Rect bbox; - Clip clip; + SpiceRect self_bitmap_area; + SpiceRect bbox; + SpiceClip clip; uint32_t mm_time; union { - Fill fill; - Opaque opaque; - Copy copy; - Transparent transparent; - AlphaBlnd alpha_blend; + SpiceFill fill; + SpiceOpaque opaque; + SpiceCopy copy; + SpiceTransparent transparent; + SpiceAlphaBlnd alpha_blend; QXLCopyBits copy_bits; - Blend blend; - Rop3 rop3; - Stroke stroke; - Text text; - Blackness blackness; - Invers invers; - Whiteness whiteness; + SpiceBlend blend; + SpiceRop3 rop3; + SpiceStroke stroke; + SpiceText text; + SpiceBlackness blackness; + SpiceInvers invers; + SpiceWhiteness whiteness; } u; } QXLDrawable; @@ -335,7 +335,7 @@ enum { enum { QXL_BITMAP_DIRECT = (1 << 0), QXL_BITMAP_UNSTABLE = (1 << 1), - QXL_BITMAP_TOP_DOWN = (1 << 2), // == BITMAP_TOP_DOWN + QXL_BITMAP_TOP_DOWN = (1 << 2), // == SPICE_BITMAP_FLAGS_TOP_DOWN }; #define QXL_SET_IMAGE_ID(image, _group, _unique) { \ @@ -346,10 +346,10 @@ enum { } typedef struct SPICE_ATTR_PACKED QXLImage { - ImageDescriptor descriptor; + SpiceImageDescriptor descriptor; union { // variable length - Bitmap bitmap; - QUICData quic; + SpiceBitmap bitmap; + SpiceQUICData quic; }; } QXLImage; diff --git a/spice/red.h b/spice/red.h index 7c78f4d..17ea953 100644 --- a/spice/red.h +++ b/spice/red.h @@ -37,185 +37,185 @@ #include <spice/start-packed.h> -#define RED_MAGIC (*(uint32_t*)"REDQ") -#define RED_VERSION_MAJOR (~(uint32_t)0 - 1) -#define RED_VERSION_MINOR 2 +#define SPICE_MAGIC (*(uint32_t*)"REDQ") +#define SPICE_VERSION_MAJOR (~(uint32_t)0 - 1) +#define SPICE_VERSION_MINOR 2 // Encryption & Ticketing Parameters -#define RED_MAX_PASSWORD_LENGTH 60 -#define RED_TICKET_KEY_PAIR_LENGTH 1024 -#define RED_TICKET_PUBKEY_BYTES (RED_TICKET_KEY_PAIR_LENGTH / 8 + 34) +#define SPICE_MAX_PASSWORD_LENGTH 60 +#define SPICE_TICKET_KEY_PAIR_LENGTH 1024 +#define SPICE_TICKET_PUBKEY_BYTES (SPICE_TICKET_KEY_PAIR_LENGTH / 8 + 34) enum { - RED_CHANNEL_MAIN = 1, - RED_CHANNEL_DISPLAY, - RED_CHANNEL_INPUTS, - RED_CHANNEL_CURSOR, - RED_CHANNEL_PLAYBACK, - RED_CHANNEL_RECORD, - RED_CHANNEL_TUNNEL, + SPICE_CHANNEL_MAIN = 1, + SPICE_CHANNEL_DISPLAY, + SPICE_CHANNEL_INPUTS, + SPICE_CHANNEL_CURSOR, + SPICE_CHANNEL_PLAYBACK, + SPICE_CHANNEL_RECORD, + SPICE_CHANNEL_TUNNEL, - RED_CHANNEL_END + SPICE_END_CHANNEL }; enum { - RED_ERR_OK, - RED_ERR_ERROR, - RED_ERR_INVALID_MAGIC, - RED_ERR_INVALID_DATA, - RED_ERR_VERSION_MISMATCH, - RED_ERR_NEED_SECURED, - RED_ERR_NEED_UNSECURED, - RED_ERR_PERMISSION_DENIED, - RED_ERR_BAD_CONNECTION_ID, - RED_ERR_CHANNEL_NOT_AVAILABLE, + SPICE_LINK_ERR_OK, + SPICE_LINK_ERR_ERROR, + SPICE_LINK_ERR_INVALID_MAGIC, + SPICE_LINK_ERR_INVALID_DATA, + SPICE_LINK_ERR_VERSION_MISMATCH, + SPICE_LINK_ERR_NEED_SECURED, + SPICE_LINK_ERR_NEED_UNSECURED, + SPICE_LINK_ERR_PERMISSION_DENIED, + SPICE_LINK_ERR_BAD_CONNECTION_ID, + SPICE_LINK_ERR_CHANNEL_NOT_AVAILABLE, }; enum { - RED_WARN_GENERAL, + SPICE_WARN_GENERAL, }; enum { - RED_INFO_GENERAL, + SPICE_INFO_GENERAL, }; -typedef struct SPICE_ATTR_PACKED RedLinkHeader { +typedef struct SPICE_ATTR_PACKED SpiceLinkHeader { uint32_t magic; uint32_t major_version; uint32_t minor_version; uint32_t size; -} RedLinkHeader; +} SpiceLinkHeader; -typedef struct SPICE_ATTR_PACKED RedLinkMess { +typedef struct SPICE_ATTR_PACKED SpiceLinkMess { uint32_t connection_id; uint8_t channel_type; uint8_t channel_id; uint32_t num_common_caps; uint32_t num_channel_caps; uint32_t caps_offset; -} RedLinkMess; +} SpiceLinkMess; -typedef struct SPICE_ATTR_PACKED RedLinkReply { +typedef struct SPICE_ATTR_PACKED SpiceLinkReply { uint32_t error; - uint8_t pub_key[RED_TICKET_PUBKEY_BYTES]; + uint8_t pub_key[SPICE_TICKET_PUBKEY_BYTES]; uint32_t num_common_caps; uint32_t num_channel_caps; uint32_t caps_offset; -} RedLinkReply; +} SpiceLinkReply; -typedef struct SPICE_ATTR_PACKED RedLinkEncryptedTicket { - uint8_t encrypted_data[RED_TICKET_KEY_PAIR_LENGTH / 8]; -} RedLinkEncryptedTicket; +typedef struct SPICE_ATTR_PACKED SpiceLinkEncryptedTicket { + uint8_t encrypted_data[SPICE_TICKET_KEY_PAIR_LENGTH / 8]; +} SpiceLinkEncryptedTicket; -typedef struct SPICE_ATTR_PACKED RedDataHeader { +typedef struct SPICE_ATTR_PACKED SpiceDataHeader { uint64_t serial; uint16_t type; uint32_t size; - uint32_t sub_list; //offset to RedSubMessageList[] -} RedDataHeader; + uint32_t sub_list; //offset to SpiceSubMessageList[] +} SpiceDataHeader; -typedef struct SPICE_ATTR_PACKED RedSubMessage { +typedef struct SPICE_ATTR_PACKED SpicedSubMessage { uint16_t type; uint32_t size; -} RedSubMessage; +} SpicedSubMessage; -typedef struct SPICE_ATTR_PACKED RedSubMessageList { +typedef struct SPICE_ATTR_PACKED SpiceSubMessageList { uint16_t size; - uint32_t sub_messages[0]; //offsets to RedSubMessage -} RedSubMessageList; + uint32_t sub_messages[0]; //offsets to SpicedSubMessage +} SpiceSubMessageList; enum { - RED_MIGRATE = 1, - RED_MIGRATE_DATA, - RED_SET_ACK, - RED_PING, - RED_WAIT_FOR_CHANNELS, - RED_DISCONNECTING, - RED_NOTIFY, + SPICE_MSG_MIGRATE = 1, + SPICE_MSG_MIGRATE_DATA, + SPICE_MSG_SET_ACK, + SPICE_MSG_PING, + SPICE_MSG_WAIT_FOR_CHANNELS, + SPICE_MSG_DISCONNECTING, + SPICE_MSG_NOTIFY, - RED_FIRST_AVAIL_MESSAGE = 101 + SPICE_MSG_FIRST_AVAIL = 101 }; enum { - REDC_ACK_SYNC = 1, - REDC_ACK, - REDC_PONG, - REDC_MIGRATE_FLUSH_MARK, - REDC_MIGRATE_DATA, - REDC_DISCONNECTING, + SPICE_MSGC_ACK_SYNC = 1, + SPICE_MSGC_ACK, + SPICE_MSGC_PONG, + SPICE_MSGC_MIGRATE_FLUSH_MARK, + SPICE_MSGC_MIGRATE_DATA, + SPICE_MSGC_DISCONNECTING, - REDC_FIRST_AVAIL_MESSAGE = 101, + SPICE_MSGC_FIRST_AVAIL = 101, }; enum { - RED_MIGRATE_BEGIN = RED_FIRST_AVAIL_MESSAGE, - RED_MIGRATE_CANCEL, - RED_INIT, - RED_CHANNELS_LIST, - RED_MOUSE_MODE, - RED_MULTI_MEDIA_TIME, + SPICE_MSG_MAIN_MIGRATE_BEGIN = SPICE_MSG_FIRST_AVAIL, + SPICE_MSG_MAIN_MIGRATE_CANCEL, + SPICE_MSG_MAIN_INIT, + SPICE_MSG_MAIN_CHANNELS_LIST, + SPICE_MSG_MAIN_MOUSE_MODE, + SPICE_MSG_MAIN_MULTI_MEDIA_TIME, - RED_AGENT_CONNECTED, - RED_AGENT_DISCONNECTED, - RED_AGENT_DATA, - RED_AGENT_TOKEN, + SPICE_MSG_MAIN_AGENT_CONNECTED, + SPICE_MSG_MAIN_AGENT_DISCONNECTED, + SPICE_MSG_MAIN_AGENT_DATA, + SPICE_MSG_MAIN_AGENT_TOKEN, - RED_MESSAGES_END, + SPICE_MSG_END_MAIN, }; enum { - REDC_CLIENT_INFO = REDC_FIRST_AVAIL_MESSAGE, - REDC_MIGRATE_CONNECTED, - REDC_MIGRATE_CONNECT_ERROR, - REDC_ATTACH_CHANNELS, - REDC_MOUSE_MODE_REQUEST, + SPICE_MSGC_MAIN_CLIENT_INFO = SPICE_MSGC_FIRST_AVAIL, + SPICE_MSGC_MAIN_MIGRATE_CONNECTED, + SPICE_MSGC_MAIN_MIGRATE_CONNECT_ERROR, + SPICE_MSGC_MAIN_ATTACH_CHANNELS, + SPICE_MSGC_MAIN_MOUSE_MODE_REQUEST, - REDC_AGENT_START, - REDC_AGENT_DATA, - REDC_AGENT_TOKEN, + SPICE_MSGC_MAIN_AGENT_START, + SPICE_MSGC_MAIN_AGENT_DATA, + SPICE_MSGC_MAIN_AGENT_TOKEN, }; -#define RED_MOTION_ACK_BUNCH 4 +#define SPICE_INPUT_MOTION_ACK_BUNCH 4 enum { - RED_INPUTS_INIT = RED_FIRST_AVAIL_MESSAGE, - RED_INPUTS_KEY_MODIFAIERS, + SPICE_MSG_INPUTS_INIT = SPICE_MSG_FIRST_AVAIL, + SPICE_MSG_INPUTS_KEY_MODIFAIERS, - RED_INPUTS_MOUSE_MOTION_ACK = RED_FIRST_AVAIL_MESSAGE + 10, + SPICE_MSG_INPUTS_MOUSE_MOTION_ACK = SPICE_MSG_FIRST_AVAIL + 10, - RED_INPUTS_MESSAGES_END, + SPICE_MSG_END_INPUTS, }; -#define RED_SCROLL_LOCK_MODIFIER (1 << 0) -#define RED_NUM_LOCK_MODIFIER (1 << 1) -#define RED_CAPS_LOCK_MODIFIER (1 << 2) +#define SPICE_SCROLL_LOCK_MODIFIER (1 << 0) +#define SPICE_NUM_LOCK_MODIFIER (1 << 1) +#define SPICE_CAPS_LOCK_MODIFIER (1 << 2) -typedef struct SPICE_ATTR_PACKED RedInputsInit { +typedef struct SPICE_ATTR_PACKED SpiceMsgInputsInit { uint32_t keyboard_modifiers; -} RedInputsInit; +} SpiceMsgInputsInit; -typedef struct SPICE_ATTR_PACKED RedKeyModifiers { +typedef struct SPICE_ATTR_PACKED SpiceMsgInputsKeyModifiers { uint32_t modifiers; -} RedKeyModifiers; +} SpiceMsgInputsKeyModifiers; -typedef struct SPICE_ATTR_PACKED RedMultiMediaTime { +typedef struct SPICE_ATTR_PACKED SpiceMsgMainMultiMediaTime { uint32_t time; -} RedMultiMediaTime; +} SpiceMsgMainMultiMediaTime; enum { - RED_PUBKEY_TYPE_INVALID, - RED_PUBKEY_TYPE_RSA, - RED_PUBKEY_TYPE_RSA2, - RED_PUBKEY_TYPE_DSA, - RED_PUBKEY_TYPE_DSA1, - RED_PUBKEY_TYPE_DSA2, - RED_PUBKEY_TYPE_DSA3, - RED_PUBKEY_TYPE_DSA4, - RED_PUBKEY_TYPE_DH, - RED_PUBKEY_TYPE_EC, + SPICE_PUBKEY_TYPE_INVALID, + SPICE_PUBKEY_TYPE_RSA, + SPICE_PUBKEY_TYPE_RSA2, + SPICE_PUBKEY_TYPE_DSA, + SPICE_PUBKEY_TYPE_DSA1, + SPICE_PUBKEY_TYPE_DSA2, + SPICE_PUBKEY_TYPE_DSA3, + SPICE_PUBKEY_TYPE_DSA4, + SPICE_PUBKEY_TYPE_DH, + SPICE_PUBKEY_TYPE_EC, }; -typedef struct SPICE_ATTR_PACKED RedMigrationBegin { +typedef struct SPICE_ATTR_PACKED SpiceMsgMainMigrationBegin { uint16_t port; uint16_t sport; uint32_t host_offset; @@ -223,54 +223,54 @@ typedef struct SPICE_ATTR_PACKED RedMigrationBegin { uint16_t pub_key_type; uint32_t pub_key_offset; uint32_t pub_key_size; -} RedMigrationBegin; +} SpiceMsgMainMigrationBegin; enum { - RED_MIGRATE_NEED_FLUSH = (1 << 0), - RED_MIGRATE_NEED_DATA_TRANSFER = (1 << 1), + SPICE_MIGRATE_NEED_FLUSH = (1 << 0), + SPICE_MIGRATE_NEED_DATA_TRANSFER = (1 << 1), }; -typedef struct SPICE_ATTR_PACKED RedMigrate { +typedef struct SPICE_ATTR_PACKED SpiceMsgMigrate { uint32_t flags; -} RedMigrate; +} SpiceMsgMigrate; enum { - RED_RES_TYPE_INVALID, - RED_RES_TYPE_PIXMAP, + SPICE_RES_TYPE_INVALID, + SPICE_RES_TYPE_PIXMAP, }; -typedef struct SPICE_ATTR_PACKED RedResorceID { +typedef struct SPICE_ATTR_PACKED SpiceResorceID { uint8_t type; uint64_t id; -} RedResorceID; +} SpiceResorceID; -typedef struct SPICE_ATTR_PACKED RedResorceList { +typedef struct SPICE_ATTR_PACKED SpiceResorceList { uint16_t count; - RedResorceID resorces[0]; -} RedResorceList; + SpiceResorceID resorces[0]; +} SpiceResorceList; -typedef struct SPICE_ATTR_PACKED RedSetAck { +typedef struct SPICE_ATTR_PACKED SpiceMsgSetAck { uint32_t generation; uint32_t window; -} RedSetAck; +} SpiceMsgSetAck; -typedef struct SPICE_ATTR_PACKED RedWaitForChannel { +typedef struct SPICE_ATTR_PACKED SpiceWaitForChannel { uint8_t channel_type; uint8_t channel_id; uint64_t message_serial; -} RedWaitForChannel; +} SpiceWaitForChannel; -typedef struct SPICE_ATTR_PACKED RedWaitForChannels { +typedef struct SPICE_ATTR_PACKED SpiceMsgWaitForChannels { uint8_t wait_count; - RedWaitForChannel wait_list[0]; -} RedWaitForChannels; + SpiceWaitForChannel wait_list[0]; +} SpiceMsgWaitForChannels; -typedef struct SPICE_ATTR_PACKED RedChannelInit { +typedef struct SPICE_ATTR_PACKED SpiceChannelId { uint8_t type; uint8_t id; -} RedChannelInit; +} SpiceChannelId; -typedef struct SPICE_ATTR_PACKED RedInit { +typedef struct SPICE_ATTR_PACKED SpiceMsgMainInit { uint32_t session_id; uint32_t display_channels_hint; uint32_t supported_mouse_modes; @@ -279,198 +279,198 @@ typedef struct SPICE_ATTR_PACKED RedInit { uint32_t agent_tokens; uint32_t multi_media_time; uint32_t ram_hint; -} RedInit; +} SpiceMsgMainInit; -typedef struct SPICE_ATTR_PACKED RedDisconnect { +typedef struct SPICE_ATTR_PACKED SpiceMsgDisconnect { uint64_t time_stamp; - uint32_t reason; // RED_ERR_? -} RedDisconnect; + uint32_t reason; // SPICE_ERR_? +} SpiceMsgDisconnect; enum { - RED_NOTIFY_SEVERITY_INFO, - RED_NOTIFY_SEVERITY_WARN, - RED_NOTIFY_SEVERITY_ERROR, + SPICE_NOTIFY_SEVERITY_INFO, + SPICE_NOTIFY_SEVERITY_WARN, + SPICE_NOTIFY_SEVERITY_ERROR, }; enum { - RED_NOTIFY_VISIBILITY_LOW, - RED_NOTIFY_VISIBILITY_MEDIUM, - RED_NOTIFY_VISIBILITY_HIGH, + SPICE_NOTIFY_VISIBILITY_LOW, + SPICE_NOTIFY_VISIBILITY_MEDIUM, + SPICE_NOTIFY_VISIBILITY_HIGH, }; -typedef struct SPICE_ATTR_PACKED RedNotify { +typedef struct SPICE_ATTR_PACKED SpiceMsgNotify { uint64_t time_stamp; uint32_t severty; uint32_t visibilty; uint32_t what; uint32_t message_len; uint8_t message[0]; -} RedNotify; +} SpiceMsgNotify; -typedef struct SPICE_ATTR_PACKED RedChannels { +typedef struct SPICE_ATTR_PACKED SpiceMsgChannels { uint32_t num_of_channels; - RedChannelInit channels[0]; -} RedChannels; + SpiceChannelId channels[0]; +} SpiceMsgChannels; -typedef struct SPICE_ATTR_PACKED RedMouseMode { +typedef struct SPICE_ATTR_PACKED SpiceMsgMainMouseMode { uint32_t supported_modes; uint32_t current_mode; -} RedMouseMode; +} SpiceMsgMainMouseMode; -typedef struct SPICE_ATTR_PACKED RedPing { +typedef struct SPICE_ATTR_PACKED SpiceMsgPing { uint32_t id; uint64_t timestamp; -} RedPing; +} SpiceMsgPing; -typedef struct SPICE_ATTR_PACKED RedAgentDisconnect { - uint32_t error_code; // RED_ERR_? -} RedAgentDisconnect; +typedef struct SPICE_ATTR_PACKED SpiceMsgMainAgentDisconnect { + uint32_t error_code; // SPICE_ERR_? +} SpiceMsgMainAgentDisconnect; -#define RED_AGENT_MAX_DATA_SIZE 2048 +#define SPICE_AGENT_MAX_DATA_SIZE 2048 -typedef struct SPICE_ATTR_PACKED RedAgentTokens { +typedef struct SPICE_ATTR_PACKED SpiceMsgMainAgentTokens { uint32_t num_tokens; -} RedAgentTokens, RedcAgentTokens, RedcAgentStart; +} SpiceMsgMainAgentTokens, SpiceMsgcMainAgentTokens, SpiceMsgcMainAgentStart; -typedef struct SPICE_ATTR_PACKED RedcClientInfo { +typedef struct SPICE_ATTR_PACKED SpiceMsgcClientInfo { uint64_t cache_size; -} RedcClientInfo; +} SpiceMsgcClientInfo; -typedef struct SPICE_ATTR_PACKED RedcMouseModeRequest { +typedef struct SPICE_ATTR_PACKED SpiceMsgcMainMouseModeRequest { uint32_t mode; -} RedcMouseModeRequest; +} SpiceMsgcMainMouseModeRequest; enum { - RED_DISPLAY_MODE = RED_FIRST_AVAIL_MESSAGE, - RED_DISPLAY_MARK, - RED_DISPLAY_RESET, - RED_DISPLAY_COPY_BITS, + SPICE_MSG_DISPLAY_MODE = SPICE_MSG_FIRST_AVAIL, + SPICE_MSG_DISPLAY_MARK, + SPICE_MSG_DISPLAY_RESET, + SPICE_MSG_DISPLAY_COPY_BITS, - RED_DISPLAY_INVAL_LIST, - RED_DISPLAY_INVAL_ALL_PIXMAPS, - RED_DISPLAY_INVAL_PALETTE, - RED_DISPLAY_INVAL_ALL_PALETTES, + SPICE_MSG_DISPLAY_INVAL_LIST, + SPICE_MSG_DISPLAY_INVAL_ALL_PIXMAPS, + SPICE_MSG_DISPLAY_INVAL_PALETTE, + SPICE_MSG_DISPLAY_INVAL_ALL_PALETTES, - RED_DISPLAY_STREAM_CREATE = RED_FIRST_AVAIL_MESSAGE + 21, - RED_DISPLAY_STREAM_DATA, - RED_DISPLAY_STREAM_CLIP, - RED_DISPLAY_STREAM_DESTROY, - RED_DISPLAY_STREAM_DESTROY_ALL, + SPICE_MSG_DISPLAY_STREAM_CREATE = SPICE_MSG_FIRST_AVAIL + 21, + SPICE_MSG_DISPLAY_STREAM_DATA, + SPICE_MSG_DISPLAY_STREAM_CLIP, + SPICE_MSG_DISPLAY_STREAM_DESTROY, + SPICE_MSG_DISPLAY_STREAM_DESTROY_ALL, - RED_DISPLAY_DRAW_FILL = RED_FIRST_AVAIL_MESSAGE + 201, - RED_DISPLAY_DRAW_OPAQUE, - RED_DISPLAY_DRAW_COPY, - RED_DISPLAY_DRAW_BLEND, - RED_DISPLAY_DRAW_BLACKNESS, - RED_DISPLAY_DRAW_WHITENESS, - RED_DISPLAY_DRAW_INVERS, - RED_DISPLAY_DRAW_ROP3, - RED_DISPLAY_DRAW_STROKE, - RED_DISPLAY_DRAW_TEXT, - RED_DISPLAY_DRAW_TRANSPARENT, - RED_DISPLAY_DRAW_ALPHA_BLEND, + SPICE_MSG_DISPLAY_DRAW_FILL = SPICE_MSG_FIRST_AVAIL + 201, + SPICE_MSG_DISPLAY_DRAW_OPAQUE, + SPICE_MSG_DISPLAY_DRAW_COPY, + SPICE_MSG_DISPLAY_DRAW_BLEND, + SPICE_MSG_DISPLAY_DRAW_BLACKNESS, + SPICE_MSG_DISPLAY_DRAW_WHITENESS, + SPICE_MSG_DISPLAY_DRAW_INVERS, + SPICE_MSG_DISPLAY_DRAW_ROP3, + SPICE_MSG_DISPLAY_DRAW_STROKE, + SPICE_MSG_DISPLAY_DRAW_TEXT, + SPICE_MSG_DISPLAY_DRAW_TRANSPARENT, + SPICE_MSG_DISPLAY_DRAW_ALPHA_BLEND, - RED_DISPLAY_MESSAGES_END, + SPICE_MSG_END_DISPLAY, }; enum { - RED_CURSOR_NONE = (1 << 0), - RED_CURSOR_CACHE_ME = (1 << 1), - RED_CURSOR_FROM_CACHE = (1 << 2), + SPICE_CURSOR_FLAGS_NONE = (1 << 0), + SPICE_CURSOR_FLAGS_CACHE_ME = (1 << 1), + SPICE_CURSOR_FLAGS_FROM_CACHE = (1 << 2), }; -typedef struct SPICE_ATTR_PACKED RedCursor { +typedef struct SPICE_ATTR_PACKED SpiceCursor { uint32_t flags; - CursorHeader header; + SpiceCursorHeader header; uint8_t data[0]; -} RedCursor; +} SpiceCursor; -typedef struct SPICE_ATTR_PACKED RedMode { +typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayMode { uint32_t x_res; uint32_t y_res; uint32_t bits; -} RedMode; - -typedef struct SPICE_ATTR_PACKED RedDrawBase { - Rect box; - Clip clip; -} RedDrawBase; - -typedef struct SPICE_ATTR_PACKED RedFill { - RedDrawBase base; - Fill data; -} RedFill; - -typedef struct SPICE_ATTR_PACKED RedOpaque { - RedDrawBase base; - Opaque data; -} RedOpaque; - -typedef struct SPICE_ATTR_PACKED RedCopy { - RedDrawBase base; - Copy data; -} RedCopy; - -typedef struct SPICE_ATTR_PACKED RedTransparent { - RedDrawBase base; - Transparent data; -} RedTransparent; - -typedef struct SPICE_ATTR_PACKED RedAlphaBlend { - RedDrawBase base; - AlphaBlnd data; -} RedAlphaBlend; - -typedef struct SPICE_ATTR_PACKED RedCopyBits { - RedDrawBase base; - Point src_pos; -} RedCopyBits; - -typedef RedCopy RedBlend; - -typedef struct SPICE_ATTR_PACKED RedRop3 { - RedDrawBase base; - Rop3 data; -} RedRop3; - -typedef struct SPICE_ATTR_PACKED RedBlackness { - RedDrawBase base; - Blackness data; -} RedBlackness; - -typedef struct SPICE_ATTR_PACKED RedWhiteness { - RedDrawBase base; - Whiteness data; -} RedWhiteness; - -typedef struct SPICE_ATTR_PACKED RedInvers { - RedDrawBase base; - Invers data; -} RedInvers; - -typedef struct SPICE_ATTR_PACKED RedStroke { - RedDrawBase base; - Stroke data; -} RedStroke; - -typedef struct SPICE_ATTR_PACKED RedText { - RedDrawBase base; - Text data; -} RedText; - -typedef struct SPICE_ATTR_PACKED RedInvalOne { +} SpiceMsgDisplayMode; + +typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayBase { + SpiceRect box; + SpiceClip clip; +} SpiceMsgDisplayBase; + +typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayDrawFill { + SpiceMsgDisplayBase base; + SpiceFill data; +} SpiceMsgDisplayDrawFill; + +typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayDrawOpaque { + SpiceMsgDisplayBase base; + SpiceOpaque data; +} SpiceMsgDisplayDrawOpaque; + +typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayDrawCopy { + SpiceMsgDisplayBase base; + SpiceCopy data; +} SpiceMsgDisplayDrawCopy; + +typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayDrawTransparent { + SpiceMsgDisplayBase base; + SpiceTransparent data; +} SpiceMsgDisplayDrawTransparent; + +typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayDrawAlphaBlend { + SpiceMsgDisplayBase base; + SpiceAlphaBlnd data; +} SpiceMsgDisplayDrawAlphaBlend; + +typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayCopyBits { + SpiceMsgDisplayBase base; + SpicePoint src_pos; +} SpiceMsgDisplayCopyBits; + +typedef SpiceMsgDisplayDrawCopy SpiceMsgDisplayDrawBlend; + +typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayDrawRop3 { + SpiceMsgDisplayBase base; + SpiceRop3 data; +} SpiceMsgDisplayDrawRop3; + +typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayDrawBlackness { + SpiceMsgDisplayBase base; + SpiceBlackness data; +} SpiceMsgDisplayDrawBlackness; + +typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayDrawWhiteness { + SpiceMsgDisplayBase base; + SpiceWhiteness data; +} SpiceMsgDisplayDrawWhiteness; + +typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayDrawInvers { + SpiceMsgDisplayBase base; + SpiceInvers data; +} SpiceMsgDisplayDrawInvers; + +typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayDrawStroke { + SpiceMsgDisplayBase base; + SpiceStroke data; +} SpiceMsgDisplayDrawStroke; + +typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayDrawText { + SpiceMsgDisplayBase base; + SpiceText data; +} SpiceMsgDisplayDrawText; + +typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayInvalOne { uint64_t id; -} RedInvalOne; +} SpiceMsgDisplayInvalOne; enum { - RED_VIDEO_CODEC_TYPE_MJPEG = 1, + SPICE_VIDEO_CODEC_TYPE_MJPEG = 1, }; enum { - STREAM_TOP_DOWN = (1 << 0), + SPICE_STREAM_FLAGS_TOP_DOWN = (1 << 0), }; -typedef struct SPICE_ATTR_PACKED RedStreamCreate { +typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayStreamCreate { uint32_t id; uint32_t flags; uint32_t codec_type; @@ -479,349 +479,349 @@ typedef struct SPICE_ATTR_PACKED RedStreamCreate { uint32_t stream_height; uint32_t src_width; uint32_t src_height; - Rect dest; - Clip clip; -} RedStreamCreate; + SpiceRect dest; + SpiceClip clip; +} SpiceMsgDisplayStreamCreate; -typedef struct SPICE_ATTR_PACKED RedStreamData { +typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayStreamData { uint32_t id; uint32_t multi_media_time; uint32_t data_size; uint32_t ped_size; uint8_t data[0]; -} RedStreamData; +} SpiceMsgDisplayStreamData; -typedef struct SPICE_ATTR_PACKED RedStreamClip { +typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayStreamClip { uint32_t id; - Clip clip; -} RedStreamClip; + SpiceClip clip; +} SpiceMsgDisplayStreamClip; -typedef struct SPICE_ATTR_PACKED RedStreamDestroy { +typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayStreamDestroy { uint32_t id; -} RedStreamDestroy; +} SpiceMsgDisplayStreamDestroy; enum { - RED_CURSOR_INIT = RED_FIRST_AVAIL_MESSAGE, - RED_CURSOR_RESET, - RED_CURSOR_SET, - RED_CURSOR_MOVE, - RED_CURSOR_HIDE, - RED_CURSOR_TRAIL, - RED_CURSOR_INVAL_ONE, - RED_CURSOR_INVAL_ALL, + SPICE_MSG_CURSOR_INIT = SPICE_MSG_FIRST_AVAIL, + SPICE_MSG_CURSOR_RESET, + SPICE_MSG_CURSOR_SET, + SPICE_MSG_CURSOR_MOVE, + SPICE_MSG_CURSOR_HIDE, + SPICE_MSG_CURSOR_TRAIL, + SPICE_MSG_CURSOR_INVAL_ONE, + SPICE_MSG_CURSOR_INVAL_ALL, - RED_CURSOR_MESSAGES_END, + SPICE_MSG_END_CURSOR, }; -typedef struct SPICE_ATTR_PACKED RedCursorInit { - Point16 position; +typedef struct SPICE_ATTR_PACKED SpiceMsgCursorInit { + SpicePoint16 position; uint16_t trail_length; uint16_t trail_frequency; uint8_t visible; - RedCursor cursor; -} RedCursorInit; + SpiceCursor cursor; +} SpiceMsgCursorInit; -typedef struct SPICE_ATTR_PACKED RedCursorSet { - Point16 postition; +typedef struct SPICE_ATTR_PACKED SpiceMsgCursorSet { + SpicePoint16 postition; uint8_t visible; - RedCursor cursor; -} RedCursorSet; + SpiceCursor cursor; +} SpiceMsgCursorSet; -typedef struct SPICE_ATTR_PACKED RedCursorMove { - Point16 postition; -} RedCursorMove; +typedef struct SPICE_ATTR_PACKED SpiceMsgCursorMove { + SpicePoint16 postition; +} SpiceMsgCursorMove; -typedef struct SPICE_ATTR_PACKED RedCursorTrail { +typedef struct SPICE_ATTR_PACKED SpiceMsgCursorTrail { uint16_t length; uint16_t frequency; -} RedCursorTrail; +} SpiceMsgCursorTrail; enum { - REDC_DISPLAY_INIT = REDC_FIRST_AVAIL_MESSAGE, + SPICE_MSGC_DISPLAY_INIT = SPICE_MSGC_FIRST_AVAIL, - REDC_DISPLAY_MESSGES_END, + SPICE_MSGC_END_DISPLAY, }; -typedef struct SPICE_ATTR_PACKED RedcDisplayInit { +typedef struct SPICE_ATTR_PACKED SpiceMsgcDisplayInit { uint8_t pixmap_cache_id; int64_t pixmap_cache_size; //in pixels uint8_t glz_dictionary_id; int glz_dictionary_window_size; // in pixels -} RedcDisplayInit; +} SpiceMsgcDisplayInit; enum { - REDC_INPUTS_KEY_DOWN = REDC_FIRST_AVAIL_MESSAGE, - REDC_INPUTS_KEY_UP, - REDC_INPUTS_KEY_MODIFAIERS, + SPICE_MSGC_INPUTS_KEY_DOWN = SPICE_MSGC_FIRST_AVAIL, + SPICE_MSGC_INPUTS_KEY_UP, + SPICE_MSGC_INPUTS_KEY_MODIFAIERS, - REDC_INPUTS_MOUSE_MOTION = REDC_FIRST_AVAIL_MESSAGE + 10, - REDC_INPUTS_MOUSE_POSITION, - REDC_INPUTS_MOUSE_PRESS, - REDC_INPUTS_MOUSE_RELEASE, + SPICE_MSGC_INPUTS_MOUSE_MOTION = SPICE_MSGC_FIRST_AVAIL + 10, + SPICE_MSGC_INPUTS_MOUSE_POSITION, + SPICE_MSGC_INPUTS_MOUSE_PRESS, + SPICE_MSGC_INPUTS_MOUSE_RELEASE, - REDC_INPUTS_MESSGES_END, + SPICE_MSGC_END_INPUTS_MESSGES, }; -typedef struct SPICE_ATTR_PACKED RedcKeyDown { +typedef struct SPICE_ATTR_PACKED SpiceMsgcKeyDown { uint32_t code; -} RedcKeyDown; +} SpiceMsgcKeyDown; -typedef struct SPICE_ATTR_PACKED RedcKeyUp { +typedef struct SPICE_ATTR_PACKED SpiceMsgcKeyUp { uint32_t code; -} RedcKeyUp; +} SpiceMsgcKeyUp; enum { - RED_MOUSE_MODE_SERVER = (1 << 0), - RED_MOUSE_MODE_CLIENT = (1 << 1), + SPICE_MOUSE_MODE_SERVER = (1 << 0), + SPICE_MOUSE_MODE_CLIENT = (1 << 1), }; -typedef struct SPICE_ATTR_PACKED RedcKeyModifiers { +typedef struct SPICE_ATTR_PACKED SpiceMsgcKeyModifiers { uint32_t modifiers; -} RedcKeyModifiers; +} SpiceMsgcKeyModifiers; -enum RedButton { - REDC_MOUSE_INVALID_BUTTON, - REDC_MOUSE_LBUTTON, - REDC_MOUSE_MBUTTON, - REDC_MOUSE_RBUTTON, - REDC_MOUSE_UBUTTON, - REDC_MOUSE_DBUTTON, +enum SpiceMouseButton { + SPICE_MOUSE_BUTTON_INVALID, + SPICE_MOUSE_BUTTON_LEFT, + SPICE_MOUSE_BUTTON_MIDDLE, + SPICE_MOUSE_BUTTON_RIGHT, + SPICE_MOUSE_BUTTON_UP, + SPICE_MOUSE_BUTTON_DOWN, }; -#define REDC_LBUTTON_MASK (1 << (REDC_MOUSE_LBUTTON - 1)) -#define REDC_MBUTTON_MASK (1 << (REDC_MOUSE_MBUTTON - 1)) -#define REDC_RBUTTON_MASK (1 << (REDC_MOUSE_RBUTTON - 1)) +#define SPICE_MOUSE_BUTTON_MASK_LEFT (1 << (SPICE_MOUSE_BUTTON_LEFT - 1)) +#define SPICE_MOUSE_BUTTON_MASK_MIDDLE (1 << (SPICE_MOUSE_BUTTON_MIDDLE - 1)) +#define SPICE_MOUSE_BUTTON_MASK_RIGHT (1 << (SPICE_MOUSE_BUTTON_RIGHT - 1)) -typedef struct SPICE_ATTR_PACKED RedcMouseMotion { +typedef struct SPICE_ATTR_PACKED SpiceMsgcMouseMotion { int32_t dx; int32_t dy; uint32_t buttons_state; -} RedcMouseMotion; +} SpiceMsgcMouseMotion; -typedef struct SPICE_ATTR_PACKED RedcMousePosition { +typedef struct SPICE_ATTR_PACKED SpiceMsgcMousePosition { uint32_t x; uint32_t y; uint32_t buttons_state; uint8_t display_id; -} RedcMousePosition; +} SpiceMsgcMousePosition; -typedef struct SPICE_ATTR_PACKED RedcMousePress { +typedef struct SPICE_ATTR_PACKED SpiceMsgcMousePress { int32_t button; int32_t buttons_state; -} RedcMousePress; +} SpiceMsgcMousePress; -typedef struct SPICE_ATTR_PACKED RedcMouseRelease { +typedef struct SPICE_ATTR_PACKED SpiceMsgcMouseRelease { int32_t button; int32_t buttons_state; -} RedcMouseRelease; +} SpiceMsgcMouseRelease; enum { - RED_AUDIO_FMT_INVALD, - RED_AUDIO_FMT_S16, + SPICE_AUDIO_FMT_INVALD, + SPICE_AUDIO_FMT_S16, }; enum { - RED_AUDIO_DATA_MODE_INVALD, - RED_AUDIO_DATA_MODE_RAW, - RED_AUDIO_DATA_MODE_CELT_0_5_1, + SPICE_AUDIO_DATA_MODE_INVALD, + SPICE_AUDIO_DATA_MODE_RAW, + SPICE_AUDIO_DATA_MODE_CELT_0_5_1, }; enum { - RED_PLAYBACK_DATA = RED_FIRST_AVAIL_MESSAGE, - RED_PLAYBACK_MODE, - RED_PLAYBACK_START, - RED_PLAYBACK_STOP, + SPICE_MSG_PLAYBACK_DATA = SPICE_MSG_FIRST_AVAIL, + SPICE_MSG_PLAYBACK_MODE, + SPICE_MSG_PLAYBACK_START, + SPICE_MSG_PLAYBACK_STOP, - RED_PLAYBACK_MESSAGES_END, + SPICE_MSG_END_PLAYBACK, }; enum { - RED_PLAYBACK_CAP_CELT_0_5_1, + SPICE_PLAYBACK_CAP_CELT_0_5_1, }; enum { - RED_RECORD_START = RED_FIRST_AVAIL_MESSAGE, - RED_RECORD_STOP, + SPICE_MSG_RECORD_START = SPICE_MSG_FIRST_AVAIL, + SPICE_MSG_RECORD_STOP, - RED_RECORD_MESSAGES_END, + SPICE_MSG_END_RECORD, }; enum { - REDC_RECORD_DATA = RED_FIRST_AVAIL_MESSAGE, - REDC_RECORD_MODE, - REDC_RECORD_START_MARK, + SPICE_MSGC_RECORD_DATA = SPICE_MSG_FIRST_AVAIL, + SPICE_MSGC_RECORD_MODE, + SPICE_MSGC_RECORD_START_MARK, - REDC_RECORD_MESSAGES_END, + SPICE_MSGC_END_RECORD, }; enum { - RED_RECORD_CAP_CELT_0_5_1, + SPICE_RECORD_CAP_CELT_0_5_1, }; -typedef struct SPICE_ATTR_PACKED RedPlaybackMode { +typedef struct SPICE_ATTR_PACKED SpiceMsgPlaybackMode { uint32_t time; - uint32_t mode; //RED_AUDIO_DATA_MODE_? + uint32_t mode; //SPICE_AUDIO_DATA_MODE_? uint8_t data[0]; -} RedPlaybackMode, RedcRecordMode; +} SpiceMsgPlaybackMode, SpiceMsgcRecordMode; -typedef struct SPICE_ATTR_PACKED RedPlaybackStart { +typedef struct SPICE_ATTR_PACKED SpiceMsgPlaybackStart { uint32_t channels; - uint32_t format; //RED_AUDIO_FMT_? + uint32_t format; //SPICE_AUDIO_FMT_? uint32_t frequency; uint32_t time; -} RedPlaybackStart; +} SpiceMsgPlaybackStart; -typedef struct SPICE_ATTR_PACKED RedPlaybackPacket { +typedef struct SPICE_ATTR_PACKED SpiceMsgPlaybackPacket { uint32_t time; uint8_t data[0]; -} RedPlaybackPacket, RedcRecordPacket; +} SpiceMsgPlaybackPacket, SpiceMsgcRecordPacket; -typedef struct SPICE_ATTR_PACKED RedRecordStart { +typedef struct SPICE_ATTR_PACKED SpiceMsgRecordStart { uint32_t channels; - uint32_t format; //RED_AUDIO_FMT_? + uint32_t format; //SPICE_AUDIO_FMT_? uint32_t frequency; -} RedRecordStart; +} SpiceMsgRecordStart; -typedef struct SPICE_ATTR_PACKED RedcRecordStartMark { +typedef struct SPICE_ATTR_PACKED SpiceMsgcRecordStartMark { uint32_t time; -} RedcRecordStartMark; +} SpiceMsgcRecordStartMark; enum { - RED_TUNNEL_SERVICE_TYPE_INVALID, - RED_TUNNEL_SERVICE_TYPE_GENERIC, - RED_TUNNEL_SERVICE_TYPE_IPP, + SPICE_TUNNEL_SERVICE_TYPE_INVALID, + SPICE_TUNNEL_SERVICE_TYPE_GENERIC, + SPICE_TUNNEL_SERVICE_TYPE_IPP, }; enum { - RED_TUNNEL_INIT = RED_FIRST_AVAIL_MESSAGE, - RED_TUNNEL_SERVICE_IP_MAP, - RED_TUNNEL_SOCKET_OPEN, - RED_TUNNEL_SOCKET_FIN, - RED_TUNNEL_SOCKET_CLOSE, - RED_TUNNEL_SOCKET_DATA, - RED_TUNNEL_SOCKET_CLOSED_ACK, - RED_TUNNEL_SOCKET_TOKEN, + SPICE_MSG_TUNNEL_INIT = SPICE_MSG_FIRST_AVAIL, + SPICE_MSG_TUNNEL_SERVICE_IP_MAP, + SPICE_MSG_TUNNEL_SOCKET_OPEN, + SPICE_MSG_TUNNEL_SOCKET_FIN, + SPICE_MSG_TUNNEL_SOCKET_CLOSE, + SPICE_MSG_TUNNEL_SOCKET_DATA, + SPICE_MSG_TUNNEL_SOCKET_CLOSED_ACK, + SPICE_MSG_TUNNEL_SOCKET_TOKEN, - RED_TUNNEL_MESSAGES_END, + SPICE_MSG_END_TUNNEL, }; -typedef struct SPICE_ATTR_PACKED RedTunnelInit { +typedef struct SPICE_ATTR_PACKED SpiceMsgTunnelInit { uint16_t max_num_of_sockets; uint32_t max_socket_data_size; -} RedTunnelInit; +} SpiceMsgTunnelInit; enum { - RED_TUNNEL_IP_TYPE_INVALID, - RED_TUNNEL_IP_TYPE_IPv4, + SPICE_TUNNEL_IP_TYPE_INVALID, + SPICE_TUNNEL_IP_TYPE_IPv4, }; -typedef struct SPICE_ATTR_PACKED RedTunnelIpInfo { +typedef struct SPICE_ATTR_PACKED SpiceMsgTunnelIpInfo { uint16_t type; uint8_t data[0]; -} RedTunnelIpInfo; +} SpiceMsgTunnelIpInfo; -typedef uint8_t RedTunnelIPv4[4]; +typedef uint8_t SpiceTunnelIPv4[4]; -typedef struct SPICE_ATTR_PACKED RedTunnelServiceIpMap { +typedef struct SPICE_ATTR_PACKED SpiceMsgTunnelServiceIpMap { uint32_t service_id; - RedTunnelIpInfo virtual_ip; -} RedTunnelServiceIpMap; + SpiceMsgTunnelIpInfo virtual_ip; +} SpiceMsgTunnelServiceIpMap; -typedef struct SPICE_ATTR_PACKED RedTunnelSocketOpen { +typedef struct SPICE_ATTR_PACKED SpiceMsgTunnelSocketOpen { uint16_t connection_id; uint32_t service_id; uint32_t tokens; -} RedTunnelSocketOpen; +} SpiceMsgTunnelSocketOpen; /* connection id must be the first field in msgs directed to a specific connection */ -typedef struct SPICE_ATTR_PACKED RedTunnelSocketFin { +typedef struct SPICE_ATTR_PACKED SpiceMsgTunnelSocketFin { uint16_t connection_id; -} RedTunnelSocketFin; +} SpiceMsgTunnelSocketFin; -typedef struct SPICE_ATTR_PACKED RedTunnelSocketClose { +typedef struct SPICE_ATTR_PACKED SpiceMsgTunnelSocketClose { uint16_t connection_id; -} RedTunnelSocketClose; +} SpiceMsgTunnelSocketClose; -typedef struct SPICE_ATTR_PACKED RedTunnelSocketData { +typedef struct SPICE_ATTR_PACKED SpiceMsgTunnelSocketData { uint16_t connection_id; uint8_t data[0]; -} RedTunnelSocketData; +} SpiceMsgTunnelSocketData; -typedef struct SPICE_ATTR_PACKED RedTunnelSocketTokens { +typedef struct SPICE_ATTR_PACKED SpiceMsgTunnelSocketTokens { uint16_t connection_id; uint32_t num_tokens; -} RedTunnelSocketTokens; +} SpiceMsgTunnelSocketTokens; -typedef struct SPICE_ATTR_PACKED RedTunnelSocketClosedAck { +typedef struct SPICE_ATTR_PACKED SpiceMsgTunnelSocketClosedAck { uint16_t connection_id; -} RedTunnelSocketClosedAck; +} SpiceMsgTunnelSocketClosedAck; enum { - REDC_TUNNEL_SERVICE_ADD = REDC_FIRST_AVAIL_MESSAGE, - REDC_TUNNEL_SERVICE_REMOVE, - REDC_TUNNEL_SOCKET_OPEN_ACK, - REDC_TUNNEL_SOCKET_OPEN_NACK, - REDC_TUNNEL_SOCKET_FIN, - REDC_TUNNEL_SOCKET_CLOSED, - REDC_TUNNEL_SOCKET_CLOSED_ACK, - REDC_TUNNEL_SOCKET_DATA, + SPICE_MSGC_TUNNEL_SERVICE_ADD = SPICE_MSGC_FIRST_AVAIL, + SPICE_MSGC_TUNNEL_SERVICE_REMOVE, + SPICE_MSGC_TUNNEL_SOCKET_OPEN_ACK, + SPICE_MSGC_TUNNEL_SOCKET_OPEN_NACK, + SPICE_MSGC_TUNNEL_SOCKET_FIN, + SPICE_MSGC_TUNNEL_SOCKET_CLOSED, + SPICE_MSGC_TUNNEL_SOCKET_CLOSED_ACK, + SPICE_MSGC_TUNNEL_SOCKET_DATA, - REDC_TUNNEL_SOCKET_TOKEN, + SPICE_MSGC_TUNNEL_SOCKET_TOKEN, - REDC_TUNNEL_MESSGES_END, + SPICE_MSGC_END_TUNNEL, }; -typedef struct SPICE_ATTR_PACKED RedcTunnelAddGenericService { +typedef struct SPICE_ATTR_PACKED SpiceMsgcTunnelAddGenericService { uint32_t type; uint32_t id; uint32_t group; uint32_t port; uint32_t name; uint32_t description; -} RedcTunnelAddGenericService; +} SpiceMsgcTunnelAddGenericService; -typedef struct SPICE_ATTR_PACKED RedcTunnelAddPrintService { - RedcTunnelAddGenericService base; - RedTunnelIpInfo ip; -} RedcTunnelAddPrintService; +typedef struct SPICE_ATTR_PACKED SpiceMsgcTunnelAddPrintService { + SpiceMsgcTunnelAddGenericService base; + SpiceMsgTunnelIpInfo ip; +} SpiceMsgcTunnelAddPrintService; -typedef struct SPICE_ATTR_PACKED RedcTunnelRemoveService { +typedef struct SPICE_ATTR_PACKED SpiceMsgcTunnelRemoveService { uint32_t id; -} RedcTunnelRemoveService; +} SpiceMsgcTunnelRemoveService; /* connection id must be the first field in msgs directed to a specific connection */ -typedef struct SPICE_ATTR_PACKED RedcTunnelSocketOpenAck { +typedef struct SPICE_ATTR_PACKED SpiceMsgcTunnelSocketOpenAck { uint16_t connection_id; uint32_t tokens; -} RedcTunnelSocketOpenAck; +} SpiceMsgcTunnelSocketOpenAck; -typedef struct SPICE_ATTR_PACKED RedcTunnelSocketOpenNack { +typedef struct SPICE_ATTR_PACKED SpiceMsgcTunnelSocketOpenNack { uint16_t connection_id; -} RedcTunnelSocketOpenNack; +} SpiceMsgcTunnelSocketOpenNack; -typedef struct SPICE_ATTR_PACKED RedcTunnelSocketData { +typedef struct SPICE_ATTR_PACKED SpiceMsgcTunnelSocketData { uint16_t connection_id; uint8_t data[0]; -} RedcTunnelSocketData; +} SpiceMsgcTunnelSocketData; -typedef struct SPICE_ATTR_PACKED RedcTunnelSocketFin { +typedef struct SPICE_ATTR_PACKED SpiceMsgcTunnelSocketFin { uint16_t connection_id; -} RedcTunnelSocketFin; +} SpiceMsgcTunnelSocketFin; -typedef struct SPICE_ATTR_PACKED RedcTunnelSocketClosed { +typedef struct SPICE_ATTR_PACKED SpiceMsgcTunnelSocketClosed { uint16_t connection_id; -} RedcTunnelSocketClosed; +} SpiceMsgcTunnelSocketClosed; -typedef struct SPICE_ATTR_PACKED RedcTunnelSocketClosedAck { +typedef struct SPICE_ATTR_PACKED SpiceMsgcTunnelSocketClosedAck { uint16_t connection_id; -} RedcTunnelSocketClosedAck; +} SpiceMsgcTunnelSocketClosedAck; -typedef struct SPICE_ATTR_PACKED RedcTunnelSocketTokens { +typedef struct SPICE_ATTR_PACKED SpiceMsgcTunnelSocketTokens { uint16_t connection_id; uint32_t num_tokens; -} RedcTunnelSocketTokens; +} SpiceMsgcTunnelSocketTokens; #include <spice/end-packed.h> diff --git a/spice/reds_stat.h b/spice/reds_stat.h index bbe4554..77733a8 100644 --- a/spice/reds_stat.h +++ b/spice/reds_stat.h @@ -33,36 +33,36 @@ #include <spice/types.h> -#define REDS_STAT_SHM_NAME "spice.%u" -#define REDS_STAT_NODE_NAME_MAX_LENGTH 20 -#define REDS_STAT_MAGIC (*(uint32_t*)"STAT") -#define REDS_STAT_VERSION 1 +#define SPICE_STAT_SHM_NAME "spice.%u" +#define SPICE_STAT_NODE_NAME_MAX 20 +#define SPICE_STAT_MAGIC (*(uint32_t*)"STAT") +#define SPICE_STAT_VERSION 1 enum { - STAT_NODE_FLAG_ENABLED = (1 << 0), - STAT_NODE_FLAG_VISIBLE = (1 << 1), - STAT_NODE_FLAG_VALUE = (1 << 2), + SPICE_STAT_NODE_FLAG_ENABLED = (1 << 0), + SPICE_STAT_NODE_FLAG_VISIBLE = (1 << 1), + SPICE_STAT_NODE_FLAG_VALUE = (1 << 2), }; -#define STAT_NODE_MASK_SHOW (STAT_NODE_FLAG_ENABLED | STAT_NODE_FLAG_VISIBLE) -#define STAT_NODE_MASK_SHOW_VALUE (STAT_NODE_MASK_SHOW | STAT_NODE_FLAG_VALUE) +#define SPICE_STAT_NODE_MASK_SHOW (SPICE_STAT_NODE_FLAG_ENABLED | SPICE_STAT_NODE_FLAG_VISIBLE) +#define SPICE_STAT_NODE_MASK_SHOW_VALUE (SPICE_STAT_NODE_MASK_SHOW | SPICE_STAT_NODE_FLAG_VALUE) -typedef struct StatNode { +typedef struct SpiceStatNode { uint64_t value; uint32_t flags; uint32_t next_sibling_index; uint32_t first_child_index; - char name[REDS_STAT_NODE_NAME_MAX_LENGTH]; -} StatNode; + char name[SPICE_STAT_NODE_NAME_MAX]; +} SpiceStatNode; -typedef struct RedsStat { +typedef struct SpiceStat { uint32_t magic; uint32_t version; uint32_t generation; uint32_t num_of_nodes; uint32_t root_index; - StatNode nodes[]; -} RedsStat; + SpiceStatNode nodes[]; +} SpiceStat; #endif diff --git a/spice/vdi_dev.h b/spice/vdi_dev.h index a5f60b0..247178f 100644 --- a/spice/vdi_dev.h +++ b/spice/vdi_dev.h @@ -53,7 +53,7 @@ typedef struct SPICE_ATTR_PACKED VDIPortPacket { uint8_t data[512 - 2 * sizeof(uint32_t)]; } VDIPortPacket; -RING_DECLARE(VDIPortRing, VDIPortPacket, 32); +SPICE_RING_DECLARE(VDIPortRing, VDIPortPacket, 32); enum { VDI_PORT_IO_RANGE_INDEX, |