2 Copyright (C) 2009 Red Hat, Inc.
4 Redistribution and use in source and binary forms, with or without
5 modification, are permitted provided that the following conditions are
8 * Redistributions of source code must retain the above copyright
9 notice, this list of conditions and the following disclaimer.
10 * Redistributions in binary form must reproduce the above copyright
11 notice, this list of conditions and the following disclaimer in
12 the documentation and/or other materials provided with the
14 * Neither the name of the copyright holder nor the names of its
15 contributors may be used to endorse or promote products derived
16 from this software without specific prior written permission.
18 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
19 IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
21 PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 #ifndef _H_SPICE_PROTOCOL
32 #define _H_SPICE_PROTOCOL
34 #include <spice/types.h>
35 #include <spice/enums.h>
36 #include <spice/start-packed.h>
38 #define SPICE_MAGIC (*(uint32_t*)"REDQ")
39 #define SPICE_VERSION_MAJOR 2
40 #define SPICE_VERSION_MINOR 2
42 // Encryption & Ticketing Parameters
43 #define SPICE_MAX_PASSWORD_LENGTH 60
44 #define SPICE_TICKET_KEY_PAIR_LENGTH 1024
45 #define SPICE_TICKET_PUBKEY_BYTES (SPICE_TICKET_KEY_PAIR_LENGTH / 8 + 34)
47 typedef struct SPICE_ATTR_PACKED SpiceLinkHeader {
49 uint32_t major_version;
50 uint32_t minor_version;
55 SPICE_COMMON_CAP_PROTOCOL_AUTH_SELECTION,
56 SPICE_COMMON_CAP_AUTH_SPICE,
57 SPICE_COMMON_CAP_AUTH_SASL,
58 SPICE_COMMON_CAP_MINI_HEADER,
61 typedef struct SPICE_ATTR_PACKED SpiceLinkMess {
62 uint32_t connection_id;
65 uint32_t num_common_caps;
66 uint32_t num_channel_caps;
70 typedef struct SPICE_ATTR_PACKED SpiceLinkReply {
72 uint8_t pub_key[SPICE_TICKET_PUBKEY_BYTES];
73 uint32_t num_common_caps;
74 uint32_t num_channel_caps;
78 typedef struct SPICE_ATTR_PACKED SpiceLinkEncryptedTicket {
79 uint8_t encrypted_data[SPICE_TICKET_KEY_PAIR_LENGTH / 8];
80 } SpiceLinkEncryptedTicket;
82 typedef struct SPICE_ATTR_PACKED SpiceLinkAuthMechanism {
83 uint32_t auth_mechanism;
84 } SpiceLinkAuthMechanism;
86 typedef struct SPICE_ATTR_PACKED SpiceDataHeader {
90 uint32_t sub_list; //offset to SpiceSubMessageList[]
93 typedef struct SPICE_ATTR_PACKED SpiceMiniDataHeader {
96 } SpiceMiniDataHeader;
98 typedef struct SPICE_ATTR_PACKED SpiceSubMessage {
103 typedef struct SPICE_ATTR_PACKED SpiceSubMessageList {
105 uint32_t sub_messages[0]; //offsets to SpicedSubMessage
106 } SpiceSubMessageList;
108 #define SPICE_INPUT_MOTION_ACK_BUNCH 4
111 SPICE_PLAYBACK_CAP_CELT_0_5_1,
112 SPICE_PLAYBACK_CAP_VOLUME,
113 SPICE_PLAYBACK_CAP_LATENCY,
117 SPICE_RECORD_CAP_CELT_0_5_1,
118 SPICE_RECORD_CAP_VOLUME,
122 SPICE_MAIN_CAP_SEMI_SEAMLESS_MIGRATE,
123 SPICE_MAIN_CAP_NAME_AND_UUID,
124 SPICE_MAIN_CAP_AGENT_CONNECTED_TOKENS,
125 SPICE_MAIN_CAP_SEAMLESS_MIGRATE,
129 SPICE_DISPLAY_CAP_SIZED_STREAM,
130 SPICE_DISPLAY_CAP_MONITORS_CONFIG,
131 SPICE_DISPLAY_CAP_COMPOSITE,
132 SPICE_DISPLAY_CAP_A8_SURFACE,
133 SPICE_DISPLAY_CAP_STREAM_REPORT,
137 SPICE_INPUTS_CAP_KEY_SCANCODE,
141 SPICE_PORT_EVENT_OPENED,
142 SPICE_PORT_EVENT_CLOSED,
143 SPICE_PORT_EVENT_BREAK,
146 #include <spice/end-packed.h>
148 #endif /* _H_SPICE_PROTOCOL */