diff options
author | Alexander Larsson <alexl@redhat.com> | 2010-07-19 14:10:16 +0200 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2010-07-19 16:28:22 +0200 |
commit | 12b08f2c3e07cea617255bedfd97b2eedf0f180f (patch) | |
tree | 9a35ebbc31d6b61e94d3fbcd72feb70f0e9b9858 /common | |
parent | 2962bdaea056d7069303badc3d73ed9530fdbb15 (diff) | |
download | spice-12b08f2c3e07cea617255bedfd97b2eedf0f180f.tar.gz spice-12b08f2c3e07cea617255bedfd97b2eedf0f180f.tar.xz spice-12b08f2c3e07cea617255bedfd97b2eedf0f180f.zip |
codegen: Various cleanups
Remove all uses of @end in the marshaller, instead just using
the C struct array-at-end-of-struct. To make this work we also remove
all use of @end for switches (making them C unions).
We drop the zero member of the notify message so that we can avoid this
use of @end for a primitive in the marshaller (plus its useless to send
over the wire).
We change the offsets and stuff in the migration messages to real pointers.
Diffstat (limited to 'common')
-rw-r--r-- | common/messages.h | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/common/messages.h b/common/messages.h index 65541c51..8af38f59 100644 --- a/common/messages.h +++ b/common/messages.h @@ -57,20 +57,20 @@ typedef struct SpiceMsgMainMultiMediaTime { typedef struct SpiceMsgMainMigrationBegin { uint16_t port; uint16_t sport; - uint32_t host_offset; uint32_t host_size; + uint8_t *host_data; uint16_t pub_key_type; - uint32_t pub_key_offset; uint32_t pub_key_size; + uint8_t *pub_key_data; } SpiceMsgMainMigrationBegin; typedef struct SpiceMsgMainMigrationSwitchHost { uint16_t port; uint16_t sport; - uint32_t host_offset; uint32_t host_size; - uint32_t cert_subject_offset; + uint8_t *host_data; uint32_t cert_subject_size; + uint8_t *cert_subject_data; } SpiceMsgMainMigrationSwitchHost; @@ -401,13 +401,16 @@ typedef struct SpiceMsgTunnelInit { uint32_t max_socket_data_size; } SpiceMsgTunnelInit; +typedef uint8_t SpiceTunnelIPv4[4]; + typedef struct SpiceMsgTunnelIpInfo { uint16_t type; + union { + SpiceTunnelIPv4 ipv4; + } u; uint8_t data[0]; } SpiceMsgTunnelIpInfo; -typedef uint8_t SpiceTunnelIPv4[4]; - typedef struct SpiceMsgTunnelServiceIpMap { uint32_t service_id; SpiceMsgTunnelIpInfo virtual_ip; @@ -450,13 +453,11 @@ typedef struct SpiceMsgcTunnelAddGenericService { uint32_t port; uint64_t name; uint64_t description; + union { + SpiceMsgTunnelIpInfo ip; + } u; } SpiceMsgcTunnelAddGenericService; -typedef struct SpiceMsgcTunnelAddPrintService { - SpiceMsgcTunnelAddGenericService base; - SpiceMsgTunnelIpInfo ip; -} SpiceMsgcTunnelAddPrintService; - typedef struct SpiceMsgcTunnelRemoveService { uint32_t id; } SpiceMsgcTunnelRemoveService; |