diff options
-rw-r--r-- | common/Makefile.am | 2 | ||||
-rw-r--r-- | common/client_demarshallers.h | 28 | ||||
-rw-r--r-- | common/client_marshallers.h | 74 |
3 files changed, 104 insertions, 0 deletions
diff --git a/common/Makefile.am b/common/Makefile.am index e264db5..10750e2 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -7,6 +7,8 @@ NULL = noinst_LTLIBRARIES = libspice-common.la libspice_common_la_SOURCES = \ bitops.h \ + client_marshallers.h \ + client_demarshallers.h \ canvas_utils.c \ canvas_utils.h \ draw.h \ diff --git a/common/client_demarshallers.h b/common/client_demarshallers.h new file mode 100644 index 0000000..fc2f75a --- /dev/null +++ b/common/client_demarshallers.h @@ -0,0 +1,28 @@ +/* + Copyright (C) 2010 Red Hat, Inc. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, see <http://www.gnu.org/licenses/>. +*/ +#ifndef _H_DEMARSHAL +#define _H_DEMARSHAL + +typedef void (*message_destructor_t)(uint8_t *message); +typedef uint8_t * (*spice_parse_channel_func_t)(uint8_t *message_start, uint8_t *message_end, uint16_t message_type, int minor, + size_t *size_out, message_destructor_t *free_message); + +spice_parse_channel_func_t spice_get_server_channel_parser(uint32_t channel, unsigned int *max_message_type); +spice_parse_channel_func_t spice_get_server_channel_parser1(uint32_t channel, unsigned int *max_message_type); + +#endif + diff --git a/common/client_marshallers.h b/common/client_marshallers.h new file mode 100644 index 0000000..c192d5b --- /dev/null +++ b/common/client_marshallers.h @@ -0,0 +1,74 @@ +/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +/* + Copyright (C) 2010 Red Hat, Inc. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef _H_MARSHALLERS +#define _H_MARSHALLERS + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <spice/protocol.h> +#include <marshaller.h> +#include <messages.h> + +typedef struct { + void (*msg_SpiceMsgEmpty)(SpiceMarshaller *m, SpiceMsgEmpty *msg); + void (*msg_SpiceMsgData)(SpiceMarshaller *m, SpiceMsgData *msg); + void (*msg_SpiceMsgAudioVolume)(SpiceMarshaller *m, SpiceMsgAudioVolume *msg); + void (*msg_SpiceMsgAudioMute)(SpiceMarshaller *m, SpiceMsgAudioMute *msg); + void (*msgc_ack_sync)(SpiceMarshaller *m, SpiceMsgcAckSync *msg); + void (*msgc_pong)(SpiceMarshaller *m, SpiceMsgPing *msg); + void (*msgc_disconnecting)(SpiceMarshaller *m, SpiceMsgDisconnect *msg); + void (*msgc_main_client_info)(SpiceMarshaller *m, SpiceMsgcClientInfo *msg); + void (*msgc_main_mouse_mode_request)(SpiceMarshaller *m, SpiceMsgcMainMouseModeRequest *msg); + void (*msgc_main_agent_start)(SpiceMarshaller *m, SpiceMsgcMainAgentStart *msg); + void (*msgc_main_agent_token)(SpiceMarshaller *m, SpiceMsgcMainAgentTokens *msg); + void (*msgc_display_init)(SpiceMarshaller *m, SpiceMsgcDisplayInit *msg); + void (*msgc_inputs_key_down)(SpiceMarshaller *m, SpiceMsgcKeyDown *msg); + void (*msgc_inputs_key_up)(SpiceMarshaller *m, SpiceMsgcKeyUp *msg); + void (*msgc_inputs_key_modifiers)(SpiceMarshaller *m, SpiceMsgcKeyModifiers *msg); + void (*msgc_inputs_mouse_motion)(SpiceMarshaller *m, SpiceMsgcMouseMotion *msg); + void (*msgc_inputs_mouse_position)(SpiceMarshaller *m, SpiceMsgcMousePosition *msg); + void (*msgc_inputs_mouse_press)(SpiceMarshaller *m, SpiceMsgcMousePress *msg); + void (*msgc_inputs_mouse_release)(SpiceMarshaller *m, SpiceMsgcMouseRelease *msg); + void (*msgc_record_data)(SpiceMarshaller *m, SpiceMsgcRecordPacket *msg); + void (*msgc_record_mode)(SpiceMarshaller *m, SpiceMsgcRecordMode *msg); + void (*msgc_record_start_mark)(SpiceMarshaller *m, SpiceMsgcRecordStartMark *msg); + void (*msgc_tunnel_service_add)(SpiceMarshaller *m, SpiceMsgcTunnelAddGenericService *msg, SpiceMarshaller **name_out, SpiceMarshaller **description_out); + void (*msgc_tunnel_service_remove)(SpiceMarshaller *m, SpiceMsgcTunnelRemoveService *msg); + void (*msgc_tunnel_socket_open_ack)(SpiceMarshaller *m, SpiceMsgcTunnelSocketOpenAck *msg); + void (*msgc_tunnel_socket_open_nack)(SpiceMarshaller *m, SpiceMsgcTunnelSocketOpenNack *msg); + void (*msgc_tunnel_socket_fin)(SpiceMarshaller *m, SpiceMsgcTunnelSocketFin *msg); + void (*msgc_tunnel_socket_closed)(SpiceMarshaller *m, SpiceMsgcTunnelSocketClosed *msg); + void (*msgc_tunnel_socket_closed_ack)(SpiceMarshaller *m, SpiceMsgcTunnelSocketClosedAck *msg); + void (*msgc_tunnel_socket_data)(SpiceMarshaller *m, SpiceMsgcTunnelSocketData *msg); + void (*msgc_tunnel_socket_token)(SpiceMarshaller *m, SpiceMsgcTunnelSocketTokens *msg); +#ifdef USE_SMARTCARD + void (*msgc_smartcard_atr)(SpiceMarshaller *m, VSCMsgATR *msg); + void (*msgc_smartcard_error)(SpiceMarshaller *m, VSCMsgError *msg); + void (*msgc_smartcard_header)(SpiceMarshaller *m, VSCMsgHeader *msg); + void (*msgc_smartcard_msg)(SpiceMarshaller *m, SpiceMsgcSmartcard *msg, SpiceMarshaller **reader_name_out); + void (*msgc_smartcard_reader_add)(SpiceMarshaller *m, VSCMsgReaderAdd *msg); +#endif +} SpiceMessageMarshallers; + +SpiceMessageMarshallers *spice_message_marshallers_get(void); +SpiceMessageMarshallers *spice_message_marshallers_get1(void); + +#endif |