Don't pack the message structures

This commit is contained in:
Alexander Larsson 2010-06-18 15:10:57 +02:00
parent 07fdec53e1
commit 2aafd286be

View File

@ -33,29 +33,27 @@
#include <spice/protocol.h>
#include <spice/start-packed.h>
typedef struct SPICE_ATTR_PACKED SpiceMsgData {
typedef struct SpiceMsgData {
uint32_t data_size;
uint8_t data[0];
} SpiceMsgData;
typedef struct SPICE_ATTR_PACKED SpiceMsgEmpty {
typedef struct SpiceMsgEmpty {
} SpiceMsgEmpty;
typedef struct SPICE_ATTR_PACKED SpiceMsgInputsInit {
typedef struct SpiceMsgInputsInit {
uint32_t keyboard_modifiers;
} SpiceMsgInputsInit;
typedef struct SPICE_ATTR_PACKED SpiceMsgInputsKeyModifiers {
typedef struct SpiceMsgInputsKeyModifiers {
uint32_t modifiers;
} SpiceMsgInputsKeyModifiers;
typedef struct SPICE_ATTR_PACKED SpiceMsgMainMultiMediaTime {
typedef struct SpiceMsgMainMultiMediaTime {
uint32_t time;
} SpiceMsgMainMultiMediaTime;
typedef struct SPICE_ATTR_PACKED SpiceMsgMainMigrationBegin {
typedef struct SpiceMsgMainMigrationBegin {
uint16_t port;
uint16_t sport;
uint32_t host_offset;
@ -65,7 +63,7 @@ typedef struct SPICE_ATTR_PACKED SpiceMsgMainMigrationBegin {
uint32_t pub_key_size;
} SpiceMsgMainMigrationBegin;
typedef struct SPICE_ATTR_PACKED SpiceMsgMainMigrationSwitchHost {
typedef struct SpiceMsgMainMigrationSwitchHost {
uint16_t port;
uint16_t sport;
uint32_t host_offset;
@ -75,46 +73,46 @@ typedef struct SPICE_ATTR_PACKED SpiceMsgMainMigrationSwitchHost {
} SpiceMsgMainMigrationSwitchHost;
typedef struct SPICE_ATTR_PACKED SpiceMsgMigrate {
typedef struct SpiceMsgMigrate {
uint32_t flags;
} SpiceMsgMigrate;
typedef struct SPICE_ATTR_PACKED SpiceResourceID {
typedef struct SpiceResourceID {
uint8_t type;
uint64_t id;
} SpiceResourceID;
typedef struct SPICE_ATTR_PACKED SpiceResourceList {
typedef struct SpiceResourceList {
uint16_t count;
SpiceResourceID resources[0];
} SpiceResourceList;
typedef struct SPICE_ATTR_PACKED SpiceMsgSetAck {
typedef struct SpiceMsgSetAck {
uint32_t generation;
uint32_t window;
} SpiceMsgSetAck;
typedef struct SPICE_ATTR_PACKED SpiceMsgcAckSync {
typedef struct SpiceMsgcAckSync {
uint32_t generation;
} SpiceMsgcAckSync;
typedef struct SPICE_ATTR_PACKED SpiceWaitForChannel {
typedef struct SpiceWaitForChannel {
uint8_t channel_type;
uint8_t channel_id;
uint64_t message_serial;
} SpiceWaitForChannel;
typedef struct SPICE_ATTR_PACKED SpiceMsgWaitForChannels {
typedef struct SpiceMsgWaitForChannels {
uint8_t wait_count;
SpiceWaitForChannel wait_list[0];
} SpiceMsgWaitForChannels;
typedef struct SPICE_ATTR_PACKED SpiceChannelId {
typedef struct SpiceChannelId {
uint8_t type;
uint8_t id;
} SpiceChannelId;
typedef struct SPICE_ATTR_PACKED SpiceMsgMainInit {
typedef struct SpiceMsgMainInit {
uint32_t session_id;
uint32_t display_channels_hint;
uint32_t supported_mouse_modes;
@ -125,12 +123,12 @@ typedef struct SPICE_ATTR_PACKED SpiceMsgMainInit {
uint32_t ram_hint;
} SpiceMsgMainInit;
typedef struct SPICE_ATTR_PACKED SpiceMsgDisconnect {
typedef struct SpiceMsgDisconnect {
uint64_t time_stamp;
uint32_t reason; // SPICE_ERR_?
} SpiceMsgDisconnect;
typedef struct SPICE_ATTR_PACKED SpiceMsgNotify {
typedef struct SpiceMsgNotify {
uint64_t time_stamp;
uint32_t severity;
uint32_t visibilty;
@ -139,52 +137,52 @@ typedef struct SPICE_ATTR_PACKED SpiceMsgNotify {
uint8_t message[0];
} SpiceMsgNotify;
typedef struct SPICE_ATTR_PACKED SpiceMsgChannels {
typedef struct SpiceMsgChannels {
uint32_t num_of_channels;
SpiceChannelId channels[0];
} SpiceMsgChannels;
typedef struct SPICE_ATTR_PACKED SpiceMsgMainMouseMode {
typedef struct SpiceMsgMainMouseMode {
uint32_t supported_modes;
uint32_t current_mode;
} SpiceMsgMainMouseMode;
typedef struct SPICE_ATTR_PACKED SpiceMsgPing {
typedef struct SpiceMsgPing {
uint32_t id;
uint64_t timestamp;
} SpiceMsgPing;
typedef struct SPICE_ATTR_PACKED SpiceMsgMainAgentDisconnect {
typedef struct SpiceMsgMainAgentDisconnect {
uint32_t error_code; // SPICE_ERR_?
} SpiceMsgMainAgentDisconnect;
#define SPICE_AGENT_MAX_DATA_SIZE 2048
typedef struct SPICE_ATTR_PACKED SpiceMsgMainAgentTokens {
typedef struct SpiceMsgMainAgentTokens {
uint32_t num_tokens;
} SpiceMsgMainAgentTokens, SpiceMsgcMainAgentTokens, SpiceMsgcMainAgentStart;
typedef struct SPICE_ATTR_PACKED SpiceMsgcClientInfo {
typedef struct SpiceMsgcClientInfo {
uint64_t cache_size;
} SpiceMsgcClientInfo;
typedef struct SPICE_ATTR_PACKED SpiceMsgcMainMouseModeRequest {
typedef struct SpiceMsgcMainMouseModeRequest {
uint32_t mode;
} SpiceMsgcMainMouseModeRequest;
typedef struct SPICE_ATTR_PACKED SpiceCursor {
typedef struct SpiceCursor {
uint32_t flags;
SpiceCursorHeader header;
uint8_t data[0];
} SpiceCursor;
typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayMode {
typedef struct SpiceMsgDisplayMode {
uint32_t x_res;
uint32_t y_res;
uint32_t bits;
} SpiceMsgDisplayMode;
typedef struct SPICE_ATTR_PACKED SpiceMsgSurfaceCreate {
typedef struct SpiceMsgSurfaceCreate {
uint32_t surface_id;
uint32_t width;
uint32_t height;
@ -192,83 +190,83 @@ typedef struct SPICE_ATTR_PACKED SpiceMsgSurfaceCreate {
uint32_t flags;
} SpiceMsgSurfaceCreate;
typedef struct SPICE_ATTR_PACKED SpiceMsgSurfaceDestroy {
typedef struct SpiceMsgSurfaceDestroy {
uint32_t surface_id;
} SpiceMsgSurfaceDestroy;
typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayBase {
typedef struct SpiceMsgDisplayBase {
uint32_t surface_id;
SpiceRect box;
SpiceClip clip;
} SpiceMsgDisplayBase;
typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayDrawFill {
typedef struct SpiceMsgDisplayDrawFill {
SpiceMsgDisplayBase base;
SpiceFill data;
} SpiceMsgDisplayDrawFill;
typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayDrawOpaque {
typedef struct SpiceMsgDisplayDrawOpaque {
SpiceMsgDisplayBase base;
SpiceOpaque data;
} SpiceMsgDisplayDrawOpaque;
typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayDrawCopy {
typedef struct SpiceMsgDisplayDrawCopy {
SpiceMsgDisplayBase base;
SpiceCopy data;
} SpiceMsgDisplayDrawCopy;
typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayDrawTransparent {
typedef struct SpiceMsgDisplayDrawTransparent {
SpiceMsgDisplayBase base;
SpiceTransparent data;
} SpiceMsgDisplayDrawTransparent;
typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayDrawAlphaBlend {
typedef struct SpiceMsgDisplayDrawAlphaBlend {
SpiceMsgDisplayBase base;
SpiceAlphaBlnd data;
} SpiceMsgDisplayDrawAlphaBlend;
typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayCopyBits {
typedef struct SpiceMsgDisplayCopyBits {
SpiceMsgDisplayBase base;
SpicePoint src_pos;
} SpiceMsgDisplayCopyBits;
typedef SpiceMsgDisplayDrawCopy SpiceMsgDisplayDrawBlend;
typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayDrawRop3 {
typedef struct SpiceMsgDisplayDrawRop3 {
SpiceMsgDisplayBase base;
SpiceRop3 data;
} SpiceMsgDisplayDrawRop3;
typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayDrawBlackness {
typedef struct SpiceMsgDisplayDrawBlackness {
SpiceMsgDisplayBase base;
SpiceBlackness data;
} SpiceMsgDisplayDrawBlackness;
typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayDrawWhiteness {
typedef struct SpiceMsgDisplayDrawWhiteness {
SpiceMsgDisplayBase base;
SpiceWhiteness data;
} SpiceMsgDisplayDrawWhiteness;
typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayDrawInvers {
typedef struct SpiceMsgDisplayDrawInvers {
SpiceMsgDisplayBase base;
SpiceInvers data;
} SpiceMsgDisplayDrawInvers;
typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayDrawStroke {
typedef struct SpiceMsgDisplayDrawStroke {
SpiceMsgDisplayBase base;
SpiceStroke data;
} SpiceMsgDisplayDrawStroke;
typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayDrawText {
typedef struct SpiceMsgDisplayDrawText {
SpiceMsgDisplayBase base;
SpiceText data;
} SpiceMsgDisplayDrawText;
typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayInvalOne {
typedef struct SpiceMsgDisplayInvalOne {
uint64_t id;
} SpiceMsgDisplayInvalOne;
typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayStreamCreate {
typedef struct SpiceMsgDisplayStreamCreate {
uint32_t surface_id;
uint32_t id;
uint32_t flags;
@ -282,7 +280,7 @@ typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayStreamCreate {
SpiceClip clip;
} SpiceMsgDisplayStreamCreate;
typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayStreamData {
typedef struct SpiceMsgDisplayStreamData {
uint32_t id;
uint32_t multi_media_time;
uint32_t data_size;
@ -290,16 +288,16 @@ typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayStreamData {
uint8_t data[0];
} SpiceMsgDisplayStreamData;
typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayStreamClip {
typedef struct SpiceMsgDisplayStreamClip {
uint32_t id;
SpiceClip clip;
} SpiceMsgDisplayStreamClip;
typedef struct SPICE_ATTR_PACKED SpiceMsgDisplayStreamDestroy {
typedef struct SpiceMsgDisplayStreamDestroy {
uint32_t id;
} SpiceMsgDisplayStreamDestroy;
typedef struct SPICE_ATTR_PACKED SpiceMsgCursorInit {
typedef struct SpiceMsgCursorInit {
SpicePoint16 position;
uint16_t trail_length;
uint16_t trail_frequency;
@ -307,109 +305,109 @@ typedef struct SPICE_ATTR_PACKED SpiceMsgCursorInit {
SpiceCursor cursor;
} SpiceMsgCursorInit;
typedef struct SPICE_ATTR_PACKED SpiceMsgCursorSet {
typedef struct SpiceMsgCursorSet {
SpicePoint16 position;
uint8_t visible;
SpiceCursor cursor;
} SpiceMsgCursorSet;
typedef struct SPICE_ATTR_PACKED SpiceMsgCursorMove {
typedef struct SpiceMsgCursorMove {
SpicePoint16 position;
} SpiceMsgCursorMove;
typedef struct SPICE_ATTR_PACKED SpiceMsgCursorTrail {
typedef struct SpiceMsgCursorTrail {
uint16_t length;
uint16_t frequency;
} SpiceMsgCursorTrail;
typedef struct SPICE_ATTR_PACKED SpiceMsgcDisplayInit {
typedef struct SpiceMsgcDisplayInit {
uint8_t pixmap_cache_id;
int64_t pixmap_cache_size; //in pixels
uint8_t glz_dictionary_id;
int32_t glz_dictionary_window_size; // in pixels
} SpiceMsgcDisplayInit;
typedef struct SPICE_ATTR_PACKED SpiceMsgcKeyDown {
typedef struct SpiceMsgcKeyDown {
uint32_t code;
} SpiceMsgcKeyDown;
typedef struct SPICE_ATTR_PACKED SpiceMsgcKeyUp {
typedef struct SpiceMsgcKeyUp {
uint32_t code;
} SpiceMsgcKeyUp;
typedef struct SPICE_ATTR_PACKED SpiceMsgcKeyModifiers {
typedef struct SpiceMsgcKeyModifiers {
uint32_t modifiers;
} SpiceMsgcKeyModifiers;
typedef struct SPICE_ATTR_PACKED SpiceMsgcMouseMotion {
typedef struct SpiceMsgcMouseMotion {
int32_t dx;
int32_t dy;
uint32_t buttons_state;
} SpiceMsgcMouseMotion;
typedef struct SPICE_ATTR_PACKED SpiceMsgcMousePosition {
typedef struct SpiceMsgcMousePosition {
uint32_t x;
uint32_t y;
uint32_t buttons_state;
uint8_t display_id;
} SpiceMsgcMousePosition;
typedef struct SPICE_ATTR_PACKED SpiceMsgcMousePress {
typedef struct SpiceMsgcMousePress {
int32_t button;
int32_t buttons_state;
} SpiceMsgcMousePress;
typedef struct SPICE_ATTR_PACKED SpiceMsgcMouseRelease {
typedef struct SpiceMsgcMouseRelease {
int32_t button;
int32_t buttons_state;
} SpiceMsgcMouseRelease;
typedef struct SPICE_ATTR_PACKED SpiceMsgPlaybackMode {
typedef struct SpiceMsgPlaybackMode {
uint32_t time;
uint32_t mode; //SPICE_AUDIO_DATA_MODE_?
uint8_t data[0];
} SpiceMsgPlaybackMode, SpiceMsgcRecordMode;
typedef struct SPICE_ATTR_PACKED SpiceMsgPlaybackStart {
typedef struct SpiceMsgPlaybackStart {
uint32_t channels;
uint32_t format; //SPICE_AUDIO_FMT_?
uint32_t frequency;
uint32_t time;
} SpiceMsgPlaybackStart;
typedef struct SPICE_ATTR_PACKED SpiceMsgPlaybackPacket {
typedef struct SpiceMsgPlaybackPacket {
uint32_t time;
uint8_t data[0];
} SpiceMsgPlaybackPacket, SpiceMsgcRecordPacket;
typedef struct SPICE_ATTR_PACKED SpiceMsgRecordStart {
typedef struct SpiceMsgRecordStart {
uint32_t channels;
uint32_t format; //SPICE_AUDIO_FMT_?
uint32_t frequency;
} SpiceMsgRecordStart;
typedef struct SPICE_ATTR_PACKED SpiceMsgcRecordStartMark {
typedef struct SpiceMsgcRecordStartMark {
uint32_t time;
} SpiceMsgcRecordStartMark;
typedef struct SPICE_ATTR_PACKED SpiceMsgTunnelInit {
typedef struct SpiceMsgTunnelInit {
uint16_t max_num_of_sockets;
uint32_t max_socket_data_size;
} SpiceMsgTunnelInit;
typedef struct SPICE_ATTR_PACKED SpiceMsgTunnelIpInfo {
typedef struct SpiceMsgTunnelIpInfo {
uint16_t type;
uint8_t data[0];
} SpiceMsgTunnelIpInfo;
typedef uint8_t SpiceTunnelIPv4[4];
typedef struct SPICE_ATTR_PACKED SpiceMsgTunnelServiceIpMap {
typedef struct SpiceMsgTunnelServiceIpMap {
uint32_t service_id;
SpiceMsgTunnelIpInfo virtual_ip;
} SpiceMsgTunnelServiceIpMap;
typedef struct SPICE_ATTR_PACKED SpiceMsgTunnelSocketOpen {
typedef struct SpiceMsgTunnelSocketOpen {
uint16_t connection_id;
uint32_t service_id;
uint32_t tokens;
@ -417,29 +415,29 @@ typedef struct SPICE_ATTR_PACKED SpiceMsgTunnelSocketOpen {
/* connection id must be the first field in msgs directed to a specific connection */
typedef struct SPICE_ATTR_PACKED SpiceMsgTunnelSocketFin {
typedef struct SpiceMsgTunnelSocketFin {
uint16_t connection_id;
} SpiceMsgTunnelSocketFin;
typedef struct SPICE_ATTR_PACKED SpiceMsgTunnelSocketClose {
typedef struct SpiceMsgTunnelSocketClose {
uint16_t connection_id;
} SpiceMsgTunnelSocketClose;
typedef struct SPICE_ATTR_PACKED SpiceMsgTunnelSocketData {
typedef struct SpiceMsgTunnelSocketData {
uint16_t connection_id;
uint8_t data[0];
} SpiceMsgTunnelSocketData;
typedef struct SPICE_ATTR_PACKED SpiceMsgTunnelSocketTokens {
typedef struct SpiceMsgTunnelSocketTokens {
uint16_t connection_id;
uint32_t num_tokens;
} SpiceMsgTunnelSocketTokens;
typedef struct SPICE_ATTR_PACKED SpiceMsgTunnelSocketClosedAck {
typedef struct SpiceMsgTunnelSocketClosedAck {
uint16_t connection_id;
} SpiceMsgTunnelSocketClosedAck;
typedef struct SPICE_ATTR_PACKED SpiceMsgcTunnelAddGenericService {
typedef struct SpiceMsgcTunnelAddGenericService {
uint32_t type;
uint32_t id;
uint32_t group;
@ -448,50 +446,48 @@ typedef struct SPICE_ATTR_PACKED SpiceMsgcTunnelAddGenericService {
uint32_t description;
} SpiceMsgcTunnelAddGenericService;
typedef struct SPICE_ATTR_PACKED SpiceMsgcTunnelAddPrintService {
typedef struct SpiceMsgcTunnelAddPrintService {
SpiceMsgcTunnelAddGenericService base;
SpiceMsgTunnelIpInfo ip;
} SpiceMsgcTunnelAddPrintService;
typedef struct SPICE_ATTR_PACKED SpiceMsgcTunnelRemoveService {
typedef struct SpiceMsgcTunnelRemoveService {
uint32_t id;
} SpiceMsgcTunnelRemoveService;
/* connection id must be the first field in msgs directed to a specific connection */
typedef struct SPICE_ATTR_PACKED SpiceMsgcTunnelSocketOpenAck {
typedef struct SpiceMsgcTunnelSocketOpenAck {
uint16_t connection_id;
uint32_t tokens;
} SpiceMsgcTunnelSocketOpenAck;
typedef struct SPICE_ATTR_PACKED SpiceMsgcTunnelSocketOpenNack {
typedef struct SpiceMsgcTunnelSocketOpenNack {
uint16_t connection_id;
} SpiceMsgcTunnelSocketOpenNack;
typedef struct SPICE_ATTR_PACKED SpiceMsgcTunnelSocketData {
typedef struct SpiceMsgcTunnelSocketData {
uint16_t connection_id;
uint8_t data[0];
} SpiceMsgcTunnelSocketData;
typedef struct SPICE_ATTR_PACKED SpiceMsgcTunnelSocketFin {
typedef struct SpiceMsgcTunnelSocketFin {
uint16_t connection_id;
} SpiceMsgcTunnelSocketFin;
typedef struct SPICE_ATTR_PACKED SpiceMsgcTunnelSocketClosed {
typedef struct SpiceMsgcTunnelSocketClosed {
uint16_t connection_id;
} SpiceMsgcTunnelSocketClosed;
typedef struct SPICE_ATTR_PACKED SpiceMsgcTunnelSocketClosedAck {
typedef struct SpiceMsgcTunnelSocketClosedAck {
uint16_t connection_id;
} SpiceMsgcTunnelSocketClosedAck;
typedef struct SPICE_ATTR_PACKED SpiceMsgcTunnelSocketTokens {
typedef struct SpiceMsgcTunnelSocketTokens {
uint16_t connection_id;
uint32_t num_tokens;
} SpiceMsgcTunnelSocketTokens;
#include <spice/end-packed.h>
#endif /* _H_SPICE_PROTOCOL */