From 49e2069467dff4d56536151e2486b60e922e9371 Mon Sep 17 00:00:00 2001 From: Yonit Halperin Date: Wed, 28 Dec 2011 11:26:03 +0200 Subject: Add support for mini header: an header without sub list & without serial -Add SpiceMiniDataHeader. -Introduce capability SPICE_COMMON_CAP_MINI_HEADER. The advantage of using a header without sub list is to spare the 4 bytes that were sent for a lot of messages without sublist. Instead, messages that previously contained sub lists, will be split to two msgs. The first one will be SPICE_MSG_LIST, holding the sub list, and the second will be the main msg. When most of the messages do not contain sub lists, the overhead of the additional 10 bytes for the header of SPICE_MSG_LIST is negligible. In addition, if there is only one message in the list, it can be sent independently. Instead of sending the serial number of the messages, the client and the server will increment local counters upon sending/receiving a message. --- spice/protocol.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/spice/protocol.h b/spice/protocol.h index ddfe84b..5c7f286 100644 --- a/spice/protocol.h +++ b/spice/protocol.h @@ -37,7 +37,7 @@ #define SPICE_MAGIC (*(uint32_t*)"REDQ") #define SPICE_VERSION_MAJOR 2 -#define SPICE_VERSION_MINOR 1 +#define SPICE_VERSION_MINOR 2 // Encryption & Ticketing Parameters #define SPICE_MAX_PASSWORD_LENGTH 60 @@ -55,6 +55,7 @@ enum { SPICE_COMMON_CAP_PROTOCOL_AUTH_SELECTION, SPICE_COMMON_CAP_AUTH_SPICE, SPICE_COMMON_CAP_AUTH_SASL, + SPICE_COMMON_CAP_MINI_HEADER, }; typedef struct SPICE_ATTR_PACKED SpiceLinkMess { @@ -89,6 +90,11 @@ typedef struct SPICE_ATTR_PACKED SpiceDataHeader { uint32_t sub_list; //offset to SpiceSubMessageList[] } SpiceDataHeader; +typedef struct SPICE_ATTR_PACKED SpiceMiniDataHeader { + uint16_t type; + uint32_t size; +} SpiceMiniDataHeader; + typedef struct SPICE_ATTR_PACKED SpiceSubMessage { uint16_t type; uint32_t size; -- cgit v1.2.3