From 12b08f2c3e07cea617255bedfd97b2eedf0f180f Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Mon, 19 Jul 2010 14:10:16 +0200 Subject: 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. --- common/messages.h | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'common') 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; -- cgit