diff options
Diffstat (limited to 'spice')
-rw-r--r-- | spice/Makefile.am | 1 | ||||
-rw-r--r-- | spice/draw.h | 134 | ||||
-rw-r--r-- | spice/enums.h | 513 | ||||
-rw-r--r-- | spice/protocol.h | 307 |
4 files changed, 516 insertions, 439 deletions
diff --git a/spice/Makefile.am b/spice/Makefile.am index d5dea6a..7b03b36 100644 --- a/spice/Makefile.am +++ b/spice/Makefile.am @@ -6,6 +6,7 @@ spice_protocol_include_HEADERS= \ barrier.h \ draw.h \ end-packed.h \ + enums.h \ error_codes.h \ ipc_ring.h \ protocol.h \ diff --git a/spice/draw.h b/spice/draw.h index 36d5246..ff70e7b 100644 --- a/spice/draw.h +++ b/spice/draw.h @@ -32,6 +32,7 @@ #define _H_SPICE_DRAW #include <spice/types.h> +#include <spice/enums.h> #include <spice/start-packed.h> @@ -41,18 +42,6 @@ typedef int32_t SPICE_FIXED28_4; typedef uint64_t SPICE_ADDRESS; -enum { - SPICE_PATH_BEGIN = (1 << 0), - SPICE_PATH_END = (1 << 1), - SPICE_PATH_CLOSE = (1 << 3), - SPICE_PATH_BEZIER = (1 << 4), -}; - -enum { - SPICE_LINE_ATTR_STARTGAP = (1 << 2), - SPICE_LINE_ATTR_STYLED = (1 << 3), -}; - typedef struct SPICE_ATTR_PACKED SpicePointFix { SPICE_FIXED28_4 x; SPICE_FIXED28_4 y; @@ -86,12 +75,6 @@ typedef struct SPICE_ATTR_PACKED SpicePath { uint8_t segments[0]; } SpicePath; -enum SpiceClipType { - SPICE_CLIP_TYPE_NONE, - SPICE_CLIP_TYPE_RECTS, - SPICE_CLIP_TYPE_PATH, -}; - typedef struct SPICE_ATTR_PACKED SpiceClipRects { uint32_t num_rects; SpiceRect rects[0]; @@ -102,31 +85,11 @@ typedef struct SPICE_ATTR_PACKED SpiceClip { 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 SpicePattern { SPICE_ADDRESS pat; SpicePoint pos; } SpicePattern; -enum { - SPICE_BRUSH_TYPE_NONE, - SPICE_BRUSH_TYPE_SOLID, - SPICE_BRUSH_TYPE_PATTERN, -}; - typedef struct SPICE_ATTR_PACKED SpiceBrush { uint32_t type; union { @@ -135,10 +98,6 @@ typedef struct SPICE_ATTR_PACKED SpiceBrush { } u; } SpiceBrush; -enum { - SPICE_MASK_FLAGS_INVERS = (1 << 0), -}; - typedef struct SPICE_ATTR_PACKED SpiceQMask { uint8_t flags; SpicePoint pos; @@ -157,36 +116,8 @@ typedef struct SPICE_ATTR_PACKED SpicePalette { uint32_t ents[0]; } SpicePalette; -enum { - SPICE_SURFACE_FMT_INVALID, - SPICE_SURFACE_FMT_1_A = 1, - SPICE_SURFACE_FMT_8_A = 8, - SPICE_SURFACE_FMT_16_555 = 16 + (0 << 6), - SPICE_SURFACE_FMT_16_565 = 16 + (1 << 6), - SPICE_SURFACE_FMT_32_xRGB = 32 + (0 << 6), - SPICE_SURFACE_FMT_32_ARGB = 32 + (1 << 6), -}; #define SPICE_SURFACE_FMT_DEPTH(_d) ((_d) & 0x3f) -enum { - 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, - SPICE_IMAGE_TYPE_SURFACE, - SPICE_IMAGE_TYPE_JPEG, - SPICE_IMAGE_TYPE_FROM_CACHE_LOSSLESS, -}; - -enum { - SPICE_IMAGE_FLAGS_CACHE_ME = (1 << 0), - SPICE_IMAGE_FLAGS_HIGH_BITS_SET = (1 << 1), - SPICE_IMAGE_FLAGS_CACHE_REPLACE_ME = (1 << 2), -}; - typedef struct SPICE_ATTR_PACKED SpiceImageDescriptor { uint64_t id; uint8_t type; @@ -195,25 +126,6 @@ typedef struct SPICE_ATTR_PACKED SpiceImageDescriptor { uint32_t height; } SpiceImageDescriptor; -enum { - SPICE_BITMAP_FMT_INVALID, - SPICE_BITMAP_FMT_1BIT_LE /* unused */, - SPICE_BITMAP_FMT_1BIT_BE, - SPICE_BITMAP_FMT_4BIT_LE /* unused */, - SPICE_BITMAP_FMT_4BIT_BE, - SPICE_BITMAP_FMT_8BIT /* 8bit indexed mode */, - SPICE_BITMAP_FMT_16BIT /* 555 format */, - SPICE_BITMAP_FMT_24BIT /* 3 byte, brg */, - SPICE_BITMAP_FMT_32BIT /* 4 byte, xrgb in little endian format */, - SPICE_BITMAP_FMT_RGBA /* 4 byte, argb in little endian format */, -}; - -enum { - 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 SpiceBitmap { uint8_t format; uint8_t flags; @@ -270,11 +182,6 @@ typedef struct SPICE_ATTR_PACKED SpiceJPEGImage { SpiceJPEGData jpeg; } SpiceJPEGImage; -enum { - SPICE_IMAGE_SCALE_MODE_INTERPOLATE, - SPICE_IMAGE_SCALE_MODE_NEAREST, -}; - typedef struct SPICE_ATTR_PACKED SpiceOpaque { SPICE_ADDRESS src_bitmap; SpiceRect src_area; @@ -299,11 +206,6 @@ typedef struct SPICE_ATTR_PACKED SpiceTransparent { uint32_t true_color; } SpiceTransparent; -enum { - SPICE_ALPHA_FLAGS_DEST_HAS_ALPHA = (1 << 0), - SPICE_ALPHA_FLAGS_SRC_SURFACE_HAS_ALPHA = (1 << 1), -}; - typedef struct SPICE_ATTR_PACKED SpiceAlphaBlnd { uint16_t alpha_flags; uint8_t alpha; @@ -324,23 +226,6 @@ typedef struct SPICE_ATTR_PACKED SpiceBlackness { SpiceQMask mask; } SpiceBlackness, SpiceInvers, SpiceWhiteness; -enum { - SPICE_LINE_FLAGS_STYLED = (1 << 3), - SPICE_LINE_FLAGS_START_WITH_GAP = (1 << 2), -}; - -enum { - SPICE_LINE_CAP_ROUND, - SPICE_LINE_CAP_SQUARE, - SPICE_LINE_CAP_BUTT, -}; - -enum { - SPICE_LINE_JOIN_ROUND, - SPICE_LINE_JOIN_BEVEL, - SPICE_LINE_JOIN_MITER, -}; - typedef struct SPICE_ATTR_PACKED SpiceLineAttr { uint8_t flags; uint8_t join_style; @@ -373,13 +258,6 @@ typedef struct SPICE_ATTR_PACKED SpiceVectorGlyph { uint8_t data[0]; //SpicePathSeg[] } SpiceVectorGlyph; -enum { - 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 SpiceString { uint16_t length; uint16_t flags; @@ -395,16 +273,6 @@ typedef struct SPICE_ATTR_PACKED SpiceText { uint16_t back_mode; } SpiceText; -enum { - 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 SpiceCursorHeader { uint64_t unique; uint16_t type; diff --git a/spice/enums.h b/spice/enums.h new file mode 100644 index 0000000..0ea4e79 --- /dev/null +++ b/spice/enums.h @@ -0,0 +1,513 @@ +#ifndef _H_SPICE_ENUMS +#define _H_SPICE_ENUMS + +/* Generated from spice.proto, don't edit */ + +enum SpiceLinkErr { + 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, + + SPICE_LINK_ERR_ENUM_END +}; + +enum SpiceWarnCode { + SPICE_WARN_GENERAL, + + SPICE_WARN_CODE_ENUM_END +}; + +enum SpiceInfoCode { + SPICE_INFO_GENERAL, + + SPICE_INFO_CODE_ENUM_END +}; + +enum SpiceMigrateFlags { + SPICE_MIGRATE_NEED_FLUSH = (1 << 0), + SPICE_MIGRATE_NEED_DATA_TRANSFER = (1 << 1), + + SPICE_MIGRATE_FLAGS_MASK = 0x3 +}; + +enum SpiceNotifySeverity { + SPICE_NOTIFY_SEVERITY_INFO, + SPICE_NOTIFY_SEVERITY_WARN, + SPICE_NOTIFY_SEVERITY_ERROR, + + SPICE_NOTIFY_SEVERITY_ENUM_END +}; + +enum SpiceNotifyVisibility { + SPICE_NOTIFY_VISIBILITY_LOW, + SPICE_NOTIFY_VISIBILITY_MEDIUM, + SPICE_NOTIFY_VISIBILITY_HIGH, + + SPICE_NOTIFY_VISIBILITY_ENUM_END +}; + +enum SpiceMouseMode { + SPICE_MOUSE_MODE_SERVER = (1 << 0), + SPICE_MOUSE_MODE_CLIENT = (1 << 1), + + SPICE_MOUSE_MODE_MASK = 0x3 +}; + +enum SpicePubkeyType { + 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, + + SPICE_PUBKEY_TYPE_ENUM_END +}; + +enum SpiceClipType { + SPICE_CLIP_TYPE_NONE, + SPICE_CLIP_TYPE_RECTS, + SPICE_CLIP_TYPE_PATH, + + SPICE_CLIP_TYPE_ENUM_END +}; + +enum SpicePathFlags { + SPICE_PATH_BEGIN = (1 << 0), + SPICE_PATH_END = (1 << 1), + SPICE_PATH_CLOSE = (1 << 3), + SPICE_PATH_BEZIER = (1 << 4), + + SPICE_PATH_FLAGS_MASK = 0x1b +}; + +enum SpiceVideoCodecType { + SPICE_VIDEO_CODEC_TYPE_MJPEG = 1, + + SPICE_VIDEO_CODEC_TYPE_ENUM_END +}; + +enum SpiceStreamFlags { + SPICE_STREAM_FLAGS_TOP_DOWN = (1 << 0), + + SPICE_STREAM_FLAGS_MASK = 0x1 +}; + +enum SpiceBrushType { + SPICE_BRUSH_TYPE_NONE, + SPICE_BRUSH_TYPE_SOLID, + SPICE_BRUSH_TYPE_PATTERN, + + SPICE_BRUSH_TYPE_ENUM_END +}; + +enum SpiceMaskFlags { + SPICE_MASK_FLAGS_INVERS = (1 << 0), + + SPICE_MASK_FLAGS_MASK = 0x1 +}; + +enum SpiceImageType { + 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, + SPICE_IMAGE_TYPE_SURFACE, + SPICE_IMAGE_TYPE_JPEG, + SPICE_IMAGE_TYPE_FROM_CACHE_LOSSLESS, + + SPICE_IMAGE_TYPE_ENUM_END +}; + +enum SpiceImageFlags { + SPICE_IMAGE_FLAGS_CACHE_ME = (1 << 0), + SPICE_IMAGE_FLAGS_HIGH_BITS_SET = (1 << 1), + SPICE_IMAGE_FLAGS_CACHE_REPLACE_ME = (1 << 2), + + SPICE_IMAGE_FLAGS_MASK = 0x7 +}; + +enum SpiceBitmapFmt { + 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, + + SPICE_BITMAP_FMT_ENUM_END +}; + +enum SpiceBitmapFlags { + SPICE_BITMAP_FLAGS_PAL_CACHE_ME = (1 << 0), + SPICE_BITMAP_FLAGS_PAL_FROM_CACHE = (1 << 1), + SPICE_BITMAP_FLAGS_TOP_DOWN = (1 << 2), + + SPICE_BITMAP_FLAGS_MASK = 0x7 +}; + +enum SpiceImageScaleMode { + SPICE_IMAGE_SCALE_MODE_INTERPOLATE, + SPICE_IMAGE_SCALE_MODE_NEAREST, + + SPICE_IMAGE_SCALE_MODE_ENUM_END +}; + +enum SpiceRopd { + 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), + + SPICE_ROPD_MASK = 0x7ff +}; + +enum SpiceLineFlags { + SPICE_LINE_FLAGS_START_WITH_GAP = (1 << 2), + SPICE_LINE_FLAGS_STYLED = (1 << 3), + + SPICE_LINE_FLAGS_MASK = 0xc +}; + +enum SpiceLineCap { + SPICE_LINE_CAP_ROUND, + SPICE_LINE_CAP_SQUARE, + SPICE_LINE_CAP_BUTT, + + SPICE_LINE_CAP_ENUM_END +}; + +enum SpiceLineJoin { + SPICE_LINE_JOIN_ROUND, + SPICE_LINE_JOIN_BEVEL, + SPICE_LINE_JOIN_MITER, + + SPICE_LINE_JOIN_ENUM_END +}; + +enum SpiceStringFlags { + 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), + + SPICE_STRING_FLAGS_MASK = 0xf +}; + +enum SpiceSurfaceFlags { + SPICE_SURFACE_FLAGS_PRIMARY = (1 << 0), + + SPICE_SURFACE_FLAGS_MASK = 0x1 +}; + +enum SpiceSurfaceFmt { + SPICE_SURFACE_FMT_INVALID, + SPICE_SURFACE_FMT_1_A, + SPICE_SURFACE_FMT_8_A = 8, + SPICE_SURFACE_FMT_16_555 = 16, + SPICE_SURFACE_FMT_32_xRGB = 32, + SPICE_SURFACE_FMT_16_565 = 80, + SPICE_SURFACE_FMT_32_ARGB = 96, + + SPICE_SURFACE_FMT_ENUM_END +}; + +enum SpiceAlphaFlags { + SPICE_ALPHA_FLAGS_DEST_HAS_ALPHA = (1 << 0), + SPICE_ALPHA_FLAGS_SRC_SURFACE_HAS_ALPHA = (1 << 1), + + SPICE_ALPHA_FLAGS_MASK = 0x3 +}; + +enum SpiceResourceType { + SPICE_RES_TYPE_INVALID, + SPICE_RES_TYPE_PIXMAP, + + SPICE_RESOURCE_TYPE_ENUM_END +}; + +enum SpiceKeyboardModifierFlags { + SPICE_KEYBOARD_MODIFIER_FLAGS_SCROLL_LOCK = (1 << 0), + SPICE_KEYBOARD_MODIFIER_FLAGS_NUM_LOCK = (1 << 1), + SPICE_KEYBOARD_MODIFIER_FLAGS_CAPS_LOCK = (1 << 2), + + SPICE_KEYBOARD_MODIFIER_FLAGS_MASK = 0x7 +}; + +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, + + SPICE_MOUSE_BUTTON_ENUM_END +}; + +enum SpiceMouseButtonMask { + SPICE_MOUSE_BUTTON_MASK_LEFT = (1 << 0), + SPICE_MOUSE_BUTTON_MASK_MIDDLE = (1 << 1), + SPICE_MOUSE_BUTTON_MASK_RIGHT = (1 << 2), + + SPICE_MOUSE_BUTTON_MASK_MASK = 0x7 +}; + +enum SpiceCursorType { + 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, + + SPICE_CURSOR_TYPE_ENUM_END +}; + +enum SpiceCursorFlags { + SPICE_CURSOR_FLAGS_NONE = (1 << 0), + SPICE_CURSOR_FLAGS_CACHE_ME = (1 << 1), + SPICE_CURSOR_FLAGS_FROM_CACHE = (1 << 2), + + SPICE_CURSOR_FLAGS_MASK = 0x7 +}; + +enum SpiceAudioDataMode { + SPICE_AUDIO_DATA_MODE_INVALID, + SPICE_AUDIO_DATA_MODE_RAW, + SPICE_AUDIO_DATA_MODE_CELT_0_5_1, + + SPICE_AUDIO_DATA_MODE_ENUM_END +}; + +enum SpiceAudioFmt { + SPICE_AUDIO_FMT_INVALID, + SPICE_AUDIO_FMT_S16, + + SPICE_AUDIO_FMT_ENUM_END +}; + +enum SpiceTunnelServiceType { + SPICE_TUNNEL_SERVICE_TYPE_INVALID, + SPICE_TUNNEL_SERVICE_TYPE_GENERIC, + SPICE_TUNNEL_SERVICE_TYPE_IPP, + + SPICE_TUNNEL_SERVICE_TYPE_ENUM_END +}; + +enum SpiceTunnelIpType { + SPICE_TUNNEL_IP_TYPE_INVALID, + SPICE_TUNNEL_IP_TYPE_IPv4, + + SPICE_TUNNEL_IP_TYPE_ENUM_END +}; + +enum { + SPICE_CHANNEL_MAIN = 1, + SPICE_CHANNEL_DISPLAY, + SPICE_CHANNEL_INPUTS, + SPICE_CHANNEL_CURSOR, + SPICE_CHANNEL_PLAYBACK, + SPICE_CHANNEL_RECORD, + SPICE_CHANNEL_TUNNEL, + + SPICE_END_CHANNEL +}; + +enum { + 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, +}; + +enum { + SPICE_MSGC_ACK_SYNC = 1, + SPICE_MSGC_ACK, + SPICE_MSGC_PONG, + SPICE_MSGC_MIGRATE_FLUSH_MARK, + SPICE_MSGC_MIGRATE_DATA, + SPICE_MSGC_DISCONNECTING, +}; + +enum { + SPICE_MSG_MAIN_MIGRATE_BEGIN = 101, + 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, + SPICE_MSG_MAIN_AGENT_CONNECTED, + SPICE_MSG_MAIN_AGENT_DISCONNECTED, + SPICE_MSG_MAIN_AGENT_DATA, + SPICE_MSG_MAIN_AGENT_TOKEN, + SPICE_MSG_MAIN_MIGRATE_SWITCH_HOST, + + SPICE_MSG_END_MAIN +}; + +enum { + SPICE_MSGC_MAIN_CLIENT_INFO = 101, + SPICE_MSGC_MAIN_MIGRATE_CONNECTED, + SPICE_MSGC_MAIN_MIGRATE_CONNECT_ERROR, + SPICE_MSGC_MAIN_ATTACH_CHANNELS, + SPICE_MSGC_MAIN_MOUSE_MODE_REQUEST, + SPICE_MSGC_MAIN_AGENT_START, + SPICE_MSGC_MAIN_AGENT_DATA, + SPICE_MSGC_MAIN_AGENT_TOKEN, + + SPICE_MSGC_END_MAIN +}; + +enum { + SPICE_MSG_DISPLAY_MODE = 101, + SPICE_MSG_DISPLAY_MARK, + SPICE_MSG_DISPLAY_RESET, + SPICE_MSG_DISPLAY_COPY_BITS, + SPICE_MSG_DISPLAY_INVAL_LIST, + SPICE_MSG_DISPLAY_INVAL_ALL_PIXMAPS, + SPICE_MSG_DISPLAY_INVAL_PALETTE, + SPICE_MSG_DISPLAY_INVAL_ALL_PALETTES, + SPICE_MSG_DISPLAY_STREAM_CREATE = 122, + SPICE_MSG_DISPLAY_STREAM_DATA, + SPICE_MSG_DISPLAY_STREAM_CLIP, + SPICE_MSG_DISPLAY_STREAM_DESTROY, + SPICE_MSG_DISPLAY_STREAM_DESTROY_ALL, + SPICE_MSG_DISPLAY_DRAW_FILL = 302, + 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, + SPICE_MSG_DISPLAY_SURFACE_CREATE, + SPICE_MSG_DISPLAY_SURFACE_DESTROY, + + SPICE_MSG_END_DISPLAY +}; + +enum { + SPICE_MSGC_DISPLAY_INIT = 101, + + SPICE_MSGC_END_DISPLAY +}; + +enum { + SPICE_MSG_INPUTS_INIT = 101, + SPICE_MSG_INPUTS_KEY_MODIFIERS, + SPICE_MSG_INPUTS_MOUSE_MOTION_ACK = 111, + + SPICE_MSG_END_INPUTS +}; + +enum { + SPICE_MSGC_INPUTS_KEY_DOWN = 101, + SPICE_MSGC_INPUTS_KEY_UP, + SPICE_MSGC_INPUTS_KEY_MODIFIERS, + SPICE_MSGC_INPUTS_MOUSE_MOTION = 111, + SPICE_MSGC_INPUTS_MOUSE_POSITION, + SPICE_MSGC_INPUTS_MOUSE_PRESS, + SPICE_MSGC_INPUTS_MOUSE_RELEASE, + + SPICE_MSGC_END_INPUTS +}; + +enum { + SPICE_MSG_CURSOR_INIT = 101, + 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, + + SPICE_MSG_END_CURSOR +}; + +enum { + SPICE_MSG_PLAYBACK_DATA = 101, + SPICE_MSG_PLAYBACK_MODE, + SPICE_MSG_PLAYBACK_START, + SPICE_MSG_PLAYBACK_STOP, + + SPICE_MSG_END_PLAYBACK +}; + +enum { + SPICE_MSG_RECORD_START = 101, + SPICE_MSG_RECORD_STOP, + + SPICE_MSG_END_RECORD +}; + +enum { + SPICE_MSGC_RECORD_DATA = 101, + SPICE_MSGC_RECORD_MODE, + SPICE_MSGC_RECORD_START_MARK, + + SPICE_MSGC_END_RECORD +}; + +enum { + SPICE_MSG_TUNNEL_INIT = 101, + 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, + + SPICE_MSG_END_TUNNEL +}; + +enum { + SPICE_MSGC_TUNNEL_SERVICE_ADD = 101, + 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, + SPICE_MSGC_TUNNEL_SOCKET_TOKEN, + + SPICE_MSGC_END_TUNNEL +}; + +#endif /* _H_SPICE_ENUMS */ diff --git a/spice/protocol.h b/spice/protocol.h index a89716c..353102b 100644 --- a/spice/protocol.h +++ b/spice/protocol.h @@ -32,6 +32,7 @@ #define _H_SPICE_PROTOCOL #include <spice/types.h> +#include <spice/enums.h> #include <spice/draw.h> #include <spice/start-packed.h> @@ -44,39 +45,6 @@ #define SPICE_TICKET_KEY_PAIR_LENGTH 1024 #define SPICE_TICKET_PUBKEY_BYTES (SPICE_TICKET_KEY_PAIR_LENGTH / 8 + 34) -enum { - SPICE_CHANNEL_MAIN = 1, - SPICE_CHANNEL_DISPLAY, - SPICE_CHANNEL_INPUTS, - SPICE_CHANNEL_CURSOR, - SPICE_CHANNEL_PLAYBACK, - SPICE_CHANNEL_RECORD, - SPICE_CHANNEL_TUNNEL, - - SPICE_END_CHANNEL -}; - -enum { - 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 { - SPICE_WARN_GENERAL, -}; - -enum { - SPICE_INFO_GENERAL, -}; - typedef struct SPICE_ATTR_PACKED SpiceLinkHeader { uint32_t magic; uint32_t major_version; @@ -130,70 +98,9 @@ typedef struct SPICE_ATTR_PACKED SpiceMsgData { typedef struct SPICE_ATTR_PACKED SpiceMsgEmpty { } SpiceMsgEmpty; -enum { - 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, - - SPICE_MSG_FIRST_AVAIL = 101 -}; - -enum { - SPICE_MSGC_ACK_SYNC = 1, - SPICE_MSGC_ACK, - SPICE_MSGC_PONG, - SPICE_MSGC_MIGRATE_FLUSH_MARK, - SPICE_MSGC_MIGRATE_DATA, - SPICE_MSGC_DISCONNECTING, - - SPICE_MSGC_FIRST_AVAIL = 101, -}; - -enum { - 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, - - SPICE_MSG_MAIN_AGENT_CONNECTED, - SPICE_MSG_MAIN_AGENT_DISCONNECTED, - SPICE_MSG_MAIN_AGENT_DATA, - SPICE_MSG_MAIN_AGENT_TOKEN, - - SPICE_MSG_MAIN_MIGRATE_SWITCH_HOST, - - SPICE_MSG_END_MAIN, -}; - -enum { - 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, - - SPICE_MSGC_MAIN_AGENT_START, - SPICE_MSGC_MAIN_AGENT_DATA, - SPICE_MSGC_MAIN_AGENT_TOKEN, -}; #define SPICE_INPUT_MOTION_ACK_BUNCH 4 -enum { - SPICE_MSG_INPUTS_INIT = SPICE_MSG_FIRST_AVAIL, - SPICE_MSG_INPUTS_KEY_MODIFIERS, - - SPICE_MSG_INPUTS_MOUSE_MOTION_ACK = SPICE_MSG_FIRST_AVAIL + 10, - - SPICE_MSG_END_INPUTS, -}; - #define SPICE_SCROLL_LOCK_MODIFIER (1 << 0) #define SPICE_NUM_LOCK_MODIFIER (1 << 1) #define SPICE_CAPS_LOCK_MODIFIER (1 << 2) @@ -210,19 +117,6 @@ typedef struct SPICE_ATTR_PACKED SpiceMsgMainMultiMediaTime { uint32_t time; } SpiceMsgMainMultiMediaTime; -enum { - 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 SpiceMsgMainMigrationBegin { uint16_t port; uint16_t sport; @@ -242,20 +136,11 @@ typedef struct SPICE_ATTR_PACKED SpiceMsgMainMigrationSwitchHost { uint32_t cert_subject_size; } SpiceMsgMainMigrationSwitchHost; -enum { - SPICE_MIGRATE_NEED_FLUSH = (1 << 0), - SPICE_MIGRATE_NEED_DATA_TRANSFER = (1 << 1), -}; typedef struct SPICE_ATTR_PACKED SpiceMsgMigrate { uint32_t flags; } SpiceMsgMigrate; -enum { - SPICE_RES_TYPE_INVALID, - SPICE_RES_TYPE_PIXMAP, -}; - typedef struct SPICE_ATTR_PACKED SpiceResourceID { uint8_t type; uint64_t id; @@ -307,18 +192,6 @@ typedef struct SPICE_ATTR_PACKED SpiceMsgDisconnect { uint32_t reason; // SPICE_ERR_? } SpiceMsgDisconnect; -enum { - SPICE_NOTIFY_SEVERITY_INFO, - SPICE_NOTIFY_SEVERITY_WARN, - SPICE_NOTIFY_SEVERITY_ERROR, -}; - -enum { - SPICE_NOTIFY_VISIBILITY_LOW, - SPICE_NOTIFY_VISIBILITY_MEDIUM, - SPICE_NOTIFY_VISIBILITY_HIGH, -}; - typedef struct SPICE_ATTR_PACKED SpiceMsgNotify { uint64_t time_stamp; uint32_t severity; @@ -361,48 +234,6 @@ typedef struct SPICE_ATTR_PACKED SpiceMsgcMainMouseModeRequest { uint32_t mode; } SpiceMsgcMainMouseModeRequest; -enum { - SPICE_MSG_DISPLAY_MODE = SPICE_MSG_FIRST_AVAIL, - SPICE_MSG_DISPLAY_MARK, - SPICE_MSG_DISPLAY_RESET, - SPICE_MSG_DISPLAY_COPY_BITS, - - SPICE_MSG_DISPLAY_INVAL_LIST, - SPICE_MSG_DISPLAY_INVAL_ALL_PIXMAPS, - SPICE_MSG_DISPLAY_INVAL_PALETTE, - SPICE_MSG_DISPLAY_INVAL_ALL_PALETTES, - - 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, - - 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, - - SPICE_MSG_DISPLAY_SURFACE_CREATE, - SPICE_MSG_DISPLAY_SURFACE_DESTROY, - - SPICE_MSG_END_DISPLAY, -}; - -enum { - 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 SpiceCursor { uint32_t flags; SpiceCursorHeader header; @@ -415,10 +246,6 @@ typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayMode { uint32_t bits; } SpiceMsgDisplayMode; -enum { - SPICE_SURFACE_FLAGS_PRIMARY = (1 << 0), -}; - typedef struct SPICE_ATTR_PACKED SpiceMsgSurfaceCreate { uint32_t surface_id; uint32_t width; @@ -503,14 +330,6 @@ typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayInvalOne { uint64_t id; } SpiceMsgDisplayInvalOne; -enum { - SPICE_VIDEO_CODEC_TYPE_MJPEG = 1, -}; - -enum { - SPICE_STREAM_FLAGS_TOP_DOWN = (1 << 0), -}; - typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayStreamCreate { uint32_t surface_id; uint32_t id; @@ -542,19 +361,6 @@ typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayStreamDestroy { uint32_t id; } SpiceMsgDisplayStreamDestroy; -enum { - 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, - - SPICE_MSG_END_CURSOR, -}; - typedef struct SPICE_ATTR_PACKED SpiceMsgCursorInit { SpicePoint16 position; uint16_t trail_length; @@ -578,12 +384,6 @@ typedef struct SPICE_ATTR_PACKED SpiceMsgCursorTrail { uint16_t frequency; } SpiceMsgCursorTrail; -enum { - SPICE_MSGC_DISPLAY_INIT = SPICE_MSGC_FIRST_AVAIL, - - SPICE_MSGC_END_DISPLAY, -}; - typedef struct SPICE_ATTR_PACKED SpiceMsgcDisplayInit { uint8_t pixmap_cache_id; int64_t pixmap_cache_size; //in pixels @@ -591,19 +391,6 @@ typedef struct SPICE_ATTR_PACKED SpiceMsgcDisplayInit { int32_t glz_dictionary_window_size; // in pixels } SpiceMsgcDisplayInit; -enum { - SPICE_MSGC_INPUTS_KEY_DOWN = SPICE_MSGC_FIRST_AVAIL, - SPICE_MSGC_INPUTS_KEY_UP, - SPICE_MSGC_INPUTS_KEY_MODIFIERS, - - 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, - - SPICE_MSGC_END_INPUTS_MESSGES, -}; - typedef struct SPICE_ATTR_PACKED SpiceMsgcKeyDown { uint32_t code; } SpiceMsgcKeyDown; @@ -612,28 +399,10 @@ typedef struct SPICE_ATTR_PACKED SpiceMsgcKeyUp { uint32_t code; } SpiceMsgcKeyUp; -enum { - SPICE_MOUSE_MODE_SERVER = (1 << 0), - SPICE_MOUSE_MODE_CLIENT = (1 << 1), -}; - typedef struct SPICE_ATTR_PACKED SpiceMsgcKeyModifiers { uint32_t modifiers; } SpiceMsgcKeyModifiers; -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 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 SpiceMsgcMouseMotion { int32_t dx; int32_t dy; @@ -658,45 +427,10 @@ typedef struct SPICE_ATTR_PACKED SpiceMsgcMouseRelease { } SpiceMsgcMouseRelease; enum { - SPICE_AUDIO_FMT_INVALD, - SPICE_AUDIO_FMT_S16, -}; - -enum { - SPICE_AUDIO_DATA_MODE_INVALD, - SPICE_AUDIO_DATA_MODE_RAW, - SPICE_AUDIO_DATA_MODE_CELT_0_5_1, -}; - -enum { - SPICE_MSG_PLAYBACK_DATA = SPICE_MSG_FIRST_AVAIL, - SPICE_MSG_PLAYBACK_MODE, - SPICE_MSG_PLAYBACK_START, - SPICE_MSG_PLAYBACK_STOP, - - SPICE_MSG_END_PLAYBACK, -}; - -enum { SPICE_PLAYBACK_CAP_CELT_0_5_1, }; enum { - SPICE_MSG_RECORD_START = SPICE_MSG_FIRST_AVAIL, - SPICE_MSG_RECORD_STOP, - - SPICE_MSG_END_RECORD, -}; - -enum { - SPICE_MSGC_RECORD_DATA = SPICE_MSG_FIRST_AVAIL, - SPICE_MSGC_RECORD_MODE, - SPICE_MSGC_RECORD_START_MARK, - - SPICE_MSGC_END_RECORD, -}; - -enum { SPICE_RECORD_CAP_CELT_0_5_1, }; @@ -728,35 +462,11 @@ typedef struct SPICE_ATTR_PACKED SpiceMsgcRecordStartMark { uint32_t time; } SpiceMsgcRecordStartMark; -enum { - SPICE_TUNNEL_SERVICE_TYPE_INVALID, - SPICE_TUNNEL_SERVICE_TYPE_GENERIC, - SPICE_TUNNEL_SERVICE_TYPE_IPP, -}; - -enum { - 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, - - SPICE_MSG_END_TUNNEL, -}; - typedef struct SPICE_ATTR_PACKED SpiceMsgTunnelInit { uint16_t max_num_of_sockets; uint32_t max_socket_data_size; } SpiceMsgTunnelInit; -enum { - SPICE_TUNNEL_IP_TYPE_INVALID, - SPICE_TUNNEL_IP_TYPE_IPv4, -}; - typedef struct SPICE_ATTR_PACKED SpiceMsgTunnelIpInfo { uint16_t type; uint8_t data[0]; @@ -799,21 +509,6 @@ typedef struct SPICE_ATTR_PACKED SpiceMsgTunnelSocketClosedAck { uint16_t connection_id; } SpiceMsgTunnelSocketClosedAck; -enum { - 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, - - SPICE_MSGC_TUNNEL_SOCKET_TOKEN, - - SPICE_MSGC_END_TUNNEL, -}; - typedef struct SPICE_ATTR_PACKED SpiceMsgcTunnelAddGenericService { uint32_t type; uint32_t id; |