summaryrefslogtreecommitdiffstats
path: root/spice.proto
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2010-07-19 14:10:16 +0200
committerMarc-André Lureau <marcandre.lureau@gmail.com>2012-03-20 15:25:48 +0100
commitbdcfb2c83dd31e1a1fdd75944f632b76504cdb5d (patch)
tree30e64886294f2c66b679ca42525c7c2467739a9b /spice.proto
parentbfffc11787124bd85a363e7e5a5fd561ae6f2f7b (diff)
downloadspice-common-bdcfb2c83dd31e1a1fdd75944f632b76504cdb5d.tar.gz
spice-common-bdcfb2c83dd31e1a1fdd75944f632b76504cdb5d.tar.xz
spice-common-bdcfb2c83dd31e1a1fdd75944f632b76504cdb5d.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 'spice.proto')
-rw-r--r--spice.proto19
1 files changed, 7 insertions, 12 deletions
diff --git a/spice.proto b/spice.proto
index ca01c12..fbafd82 100644
--- a/spice.proto
+++ b/spice.proto
@@ -131,7 +131,6 @@ channel BaseChannel {
uint32 what; /* error_code/warn_code/info_code */
uint32 message_len;
uint8 message[message_len] @end @nomarshal;
- uint8 zero @end @ctype(uint8_t) @nomarshal;
} notify;
client:
@@ -166,13 +165,11 @@ channel MainChannel : BaseChannel {
message {
uint16 port;
uint16 sport;
- uint32 host_offset;
uint32 host_size;
+ uint8 *host_data[host_size] @zero_terminated @marshall @nonnull;
pubkey_type pub_key_type;
- uint32 pub_key_offset;
uint32 pub_key_size;
- uint8 host_data[host_size] @end @ctype(uint8_t) @zero_terminated @nomarshal;
- uint8 pub_key_data[pub_key_size] @end @ctype(uint8_t) @zero_terminated @nomarshal;
+ uint8 *pub_key_data[pub_key_size] @zero_terminated @marshall @nonnull;
} @ctype(SpiceMsgMainMigrationBegin) migrate_begin = 101;
Empty migrate_cancel;
@@ -217,12 +214,10 @@ channel MainChannel : BaseChannel {
message {
uint16 port;
uint16 sport;
- uint32 host_offset;
uint32 host_size;
- uint32 cert_subject_offset;
+ uint8 *host_data[host_size] @zero_terminated @marshall;
uint32 cert_subject_size;
- uint8 host_data[host_size] @end @ctype(uint8_t) @zero_terminated;
- uint8 cert_subject_data[cert_subject_size] @end @ctype(uint8_t) @zero_terminated;
+ uint8 *cert_subject_data[cert_subject_size] @zero_terminated @marshall;
} @ctype(SpiceMsgMainMigrationSwitchHost) migrate_switch_host;
client:
@@ -994,8 +989,8 @@ struct TunnelIpInfo {
tunnel_ip_type type;
switch (type) {
case IPv4:
- uint8 ipv4[4] @ctype(uint8_t);
- } u @end @nomarshal;
+ uint8 ipv4[4];
+ } u;
} @ctype(SpiceMsgTunnelIpInfo);
channel TunnelChannel : BaseChannel {
@@ -1049,7 +1044,7 @@ channel TunnelChannel : BaseChannel {
switch (type) {
case IPP:
TunnelIpInfo ip @ctype(SpiceMsgTunnelIpInfo);
- } u @end;
+ } u;
} @ctype(SpiceMsgcTunnelAddGenericService) service_add = 101;
message {