summaryrefslogtreecommitdiffstats
path: root/client/tunnel_channel.cpp
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2010-07-19 14:10:16 +0200
committerAlexander Larsson <alexl@redhat.com>2010-07-19 16:28:22 +0200
commit12b08f2c3e07cea617255bedfd97b2eedf0f180f (patch)
tree9a35ebbc31d6b61e94d3fbcd72feb70f0e9b9858 /client/tunnel_channel.cpp
parent2962bdaea056d7069303badc3d73ed9530fdbb15 (diff)
downloadspice-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 'client/tunnel_channel.cpp')
-rw-r--r--client/tunnel_channel.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/client/tunnel_channel.cpp b/client/tunnel_channel.cpp
index 7047d461..52587422 100644
--- a/client/tunnel_channel.cpp
+++ b/client/tunnel_channel.cpp
@@ -287,25 +287,20 @@ void TunnelChannel::send_service(TunnelService& service)
}
Message* service_msg = new Message(SPICE_MSGC_TUNNEL_SERVICE_ADD);
- SpiceMsgcTunnelAddPrintService add;
+ SpiceMsgcTunnelAddGenericService add;
SpiceMarshaller *name_out, *description_out;
- add.base.id = service.id;
- add.base.group = service.group;
- add.base.type = service.type;
- add.base.port = service.port;
+ add.id = service.id;
+ add.group = service.group;
+ add.type = service.type;
+ add.port = service.port;
if (service.type == SPICE_TUNNEL_SERVICE_TYPE_IPP) {
- add.ip.type = SPICE_TUNNEL_IP_TYPE_IPv4;
+ add.u.ip.type = SPICE_TUNNEL_IP_TYPE_IPv4;
}
- _marshallers->msgc_tunnel_service_add(service_msg->marshaller(), &add.base,
+ _marshallers->msgc_tunnel_service_add(service_msg->marshaller(), &add,
&name_out, &description_out);
- if (service.type == SPICE_TUNNEL_SERVICE_TYPE_IPP) {
- spice_marshaller_add(service_msg->marshaller(), (uint8_t *)&(service.ip.s_addr),
- sizeof(SpiceTunnelIPv4));
- }
-
spice_marshaller_add(name_out, (uint8_t *)service.name.c_str(), service.name.length() + 1);
spice_marshaller_add(description_out, (uint8_t *)service.description.c_str(), service.description.length() + 1);