[Spice-devel] [PATCH v5 09/41] proto: Decorate protocol file with attributes for wireshark

Frediano Ziglio fziglio at redhat.com
Fri Aug 7 08:00:38 PDT 2015


Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 spice.proto | 416 ++++++++++++++++++++++++++++++++----------------------------
 1 file changed, 219 insertions(+), 197 deletions(-)

diff --git a/spice.proto b/spice.proto
index 3bca900..389955d 100644
--- a/spice.proto
+++ b/spice.proto
@@ -5,14 +5,14 @@
 typedef fixed28_4 int32 @ctype(SPICE_FIXED28_4);
 
 struct Point {
-    int32 x;
-    int32 y;
-};
+    int32 x @ws("x", point32.x);
+    int32 y @ws("y", point32.y);
+} @ws_txt("POINT (%d, %d)", x, y);
 
 struct Point16 {
-    int16 x;
-    int16 y;
-};
+    int16 x @ws("x", point16.x);
+    int16 y @ws("y", point16.y);
+} @ws_txt("POINT16 (%d, %d)", x, y);
 
 struct PointFix {
     fixed28_4 x;
@@ -20,11 +20,14 @@ struct PointFix {
 };
 
 struct Rect {
-    int32 top;
-    int32 left;
-    int32 bottom;
-    int32 right;
-};
+    int32 top @ws("top", rect.top);
+    int32 left @ws("left", rect.left);
+    int32 bottom @ws("bottom", rect.bottom);
+    int32 right @ws("right", rect.right);
+}
+ at ws_txt("RECT: (%d-%d, %d-%d)", left, top, right, bottom)
+ at ws_txt_n("RECT %u: (%d-%d, %d-%d)", INDEX, left, top, right, bottom)
+;
 
 struct Transform {
     uint32 t00;
@@ -96,10 +99,15 @@ enum32 notify_visibility {
 };
 
 flags16 mouse_mode {
-    SERVER,
-    CLIENT,
+    SERVER @ws_desc("Server mode"),
+    CLIENT @ws_desc("Client mode"),
 };
 
+flags32 mouse_mode32 {
+    SERVER @ws_desc("Server mode"),
+    CLIENT @ws_desc("Client mode"),
+} @ws("Supported mouse modes", supported_mouse_modes);
+
 enum16 pubkey_type {
     INVALID,
     RSA,
@@ -117,12 +125,12 @@ message Empty {
 };
 
 message Data {
-    uint8 data[] @end @ctype(uint8_t);
+    uint8 data[] @end @ctype(uint8_t) @ws("data", data) @ws_type(BYTES);
 } @nocopy;
 
 struct ChannelWait {
     uint8 channel_type;
-    uint8 channel_id;
+    uint8 channel_id @ws_desc("Channel ID");
     uint64 message_serial;
 } @ctype(SpiceWaitForChannel);
 
@@ -135,14 +143,14 @@ channel BaseChannel {
     Data migrate_data;
 
     message {
-	uint32 generation;
-	uint32 window;
+	uint32 generation @ws("Set ACK generation", red_set_ack_generation);
+	uint32 window @ws("Set ACK window (messages)", red_set_ack_window);
     } set_ack;
 
     message {
-	uint32 id;
-	uint64 timestamp;
-	uint8 data[] @ctype(uint8_t) @as_ptr(data_len);
+	uint32 id @ws("Ping ID", ping_id);
+	uint64 timestamp @ws("timestamp", timestamp);
+	uint8 data[] @ctype(uint8_t) @as_ptr(data_len) @ws_txt("PING DATA (%d bytes)", data.nelements);
     } ping;
 
     message {
@@ -156,12 +164,12 @@ channel BaseChannel {
     } @ctype(SpiceMsgDisconnect) disconnecting;
 
     message {
-	uint64 time_stamp;
-	notify_severity severity;
-	notify_visibility visibilty;
-	uint32 what; /* error_code/warn_code/info_code */
-	uint32 message_len;
-	uint8 message[message_len] @end @nomarshal;
+	uint64 time_stamp @ws("timestamp", timestamp);
+	notify_severity severity @ws("Severity", notify_severity);
+	notify_visibility visibilty  @ws("Visibility", notify_visibility);
+	uint32 what @ws("error/warn/info code", notify_code); /* error_code/warn_code/info_code */
+	uint32 message_len @ws("Message length", notify_message_length);
+	uint8 message[message_len] @end @nomarshal @ws("Message", notify_message) @ws_type(STRING);
     } notify;
 
     Data list; /* the msg body is SpiceSubMessageList */
@@ -170,14 +178,14 @@ channel BaseChannel {
 
  client:
     message {
-	uint32 generation;
+	uint32 generation  @ws("Set ACK generation", red_set_ack_generation);
     } ack_sync;
 
     Empty ack;
 
     message {
-	uint32 id;
-	uint64 timestamp;
+	uint32 id @ws("Ping ID", ping_id);
+	uint64 timestamp @ws("timestamp", timestamp);
     } @ctype(SpiceMsgPing) pong;
 
     Empty migrate_flush_mark;
@@ -191,17 +199,17 @@ channel BaseChannel {
 };
 
 struct ChannelId {
-    uint8 type;
-    uint8 id;
-};
+    uint8 type @ws("Channel type", channel_type);
+    uint8 id @ws("Channel ID", channel_id);
+} @ws_txt_n("channels[%u]", INDEX);
 
 struct DstInfo {
-	uint16 port;
-	uint16 sport;
+	uint16 port @ws("Migrate Dest Port", migrate_dest_port);
+	uint16 sport @ws("Migrate Dest Secure Port", migrate_dest_sport);
 	uint32 host_size;
-	uint8 *host_data[host_size] @zero_terminated @marshall @nonnull;
+	uint8 *host_data[host_size] @zero_terminated @marshall @nonnull @ws("data", data) @ws_type(BYTES);
 	uint32 cert_subject_size;
-	uint8 *cert_subject_data[cert_subject_size] @zero_terminated @marshall;
+	uint8 *cert_subject_data[cert_subject_size] @zero_terminated @marshall @ws("data", data) @ws_type(BYTES);
 } @ctype(SpiceMigrationDstInfo);
 
 channel MainChannel : BaseChannel {
@@ -213,69 +221,69 @@ channel MainChannel : BaseChannel {
     Empty migrate_cancel;
 
     message {
-	uint32 session_id;
-	uint32 display_channels_hint;
-	uint32 supported_mouse_modes;
-	uint32 current_mouse_mode;
-	uint32 agent_connected;
-	uint32 agent_tokens;
-	uint32 multi_media_time;
-	uint32 ram_hint;
+	uint32 session_id @ws("Session ID", main_session_id);
+	uint32 display_channels_hint @ws("Number of display channels", display_channels_hint);
+	mouse_mode32 supported_mouse_modes;
+	mouse_mode32 current_mouse_mode @ws("Current mouse mode", current_mouse_mode);
+	uint32 agent_connected @ws("Agent", agent);
+	uint32 agent_tokens @ws("Agent tokens", agent_tokens);
+	uint32 multi_media_time @ws("Current server multimedia time", multimedia_time);
+	uint32 ram_hint @ws("RAM hint", ram_hint);
     } init;
 
     message {
-	uint32 num_of_channels;
-	ChannelId channels[num_of_channels] @end;
+	uint32 num_of_channels @ws("Number of Channels", main_num_channels) @ws_base(DEC_HEX);
+	ChannelId channels[num_of_channels] @end @ws_desc("Channel Array");
     } @ctype(SpiceMsgChannels) channels_list;
 
     message {
 	mouse_mode supported_modes;
-	mouse_mode current_mode @unique_flag;
+	mouse_mode current_mode @unique_flag @ws("Current mouse mode", current_mouse_mode_flags);
     } mouse_mode;
 
     message {
-	uint32 time;
+	uint32 time @ws("Current server multimedia time", multimedia_time);
     } @ctype(SpiceMsgMainMultiMediaTime) multi_media_time;
 
     Empty agent_connected;
 
     message {
-	link_err error_code;
+	link_err error_code @ws("spice ERROR", error_code);
     } @ctype(SpiceMsgMainAgentDisconnect) agent_disconnected;
 
     Data agent_data;
 
     message {
-	uint32 num_tokens;
+	uint32 num_tokens @ws("Agent token", main_agent_token);
     } @ctype(SpiceMsgMainAgentTokens) agent_token;
 
     message {
-      uint16 port;
-      uint16 sport;
+      uint16 port @ws("Migrate Dest Port", migrate_dest_port);
+      uint16 sport @ws("Migrate Dest Secure Port", migrate_dest_sport);
       uint32 host_size;
-      uint8 *host_data[host_size] @zero_terminated @marshall;
+      uint8 *host_data[host_size] @zero_terminated @marshall @ws("data", data) @ws_type(BYTES);
       uint32 cert_subject_size;
-      uint8 *cert_subject_data[cert_subject_size] @zero_terminated  @marshall;
+      uint8 *cert_subject_data[cert_subject_size] @zero_terminated  @marshall @ws("data", data) @ws_type(BYTES);
     } @ctype(SpiceMsgMainMigrationSwitchHost) migrate_switch_host;
 
     Empty migrate_end;
 
     message {
-       uint32 name_len;
-       uint8 name[name_len] @end;
+       uint32 name_len @ws("Name length", main_name_length);
+       uint8 name[name_len] @end @ws("Name", main_name) @ws_type(STRINGZ);
     } name;
 
     message {
-       uint8 uuid[16];
+       uint8 uuid[16] @ws("UUID", main_uuid) @ws_type(GUID);
     } uuid;
 
     message {
-        uint32 num_tokens;
+        uint32 num_tokens @ws("Agent token", main_agent_token);
     } agent_connected_tokens;
 
     message {
         DstInfo dst_info;
-        uint32 src_mig_version;
+        uint32 src_mig_version @ws("Migrate Source Migration Version", migrate_src_version);
     } migrate_begin_seamless;
 
     Empty migrate_dst_seamless_ack;
@@ -293,17 +301,17 @@ channel MainChannel : BaseChannel {
     Empty attach_channels;
 
     message {
-	mouse_mode mode;
+	mouse_mode mode @ws("Current mouse mode", current_mouse_mode_flags);
     } mouse_mode_request;
 
     message {
-	uint32 num_tokens;
+	uint32 num_tokens @ws("Agent tokens", main_agent_tokens);
     } agent_start;
 
     Data agent_data;
 
     message {
-        uint32 num_tokens;
+        uint32 num_tokens @ws("Agent token", main_agent_token);
     } @ctype(SpiceMsgcMainAgentTokens) agent_token;
 
     Empty migrate_end;
@@ -318,7 +326,7 @@ channel MainChannel : BaseChannel {
 enum8 clip_type {
     NONE,
     RECTS
-};
+} @ws("Clip type", clip_type);
 
 flags8 path_flags { /* TODO: C enum names changes */
     BEGIN = 0,
@@ -329,21 +337,21 @@ flags8 path_flags { /* TODO: C enum names changes */
 
 enum8 video_codec_type {
     MJPEG = 1,
-};
+} @ws("Stream codec type", display_stream_codec_type);
 
 flags8 stream_flags {
     TOP_DOWN = 0,
-};
+} @ws("Stream flags", display_stream_flags) @ws_base(DEC);
 
 enum8 brush_type {
     NONE,
     SOLID,
     PATTERN,
-};
+} @ws("Brush type", brush_type);
 
 flags8 mask_flags {
     INVERS,
-};
+} @ws("Mask flag", mask_flag) @ws_base(DEC);
 
 enum8 image_type {
     BITMAP,
@@ -359,7 +367,7 @@ enum8 image_type {
     ZLIB_GLZ_RGB,
     JPEG_ALPHA,
     LZ4,
-};
+} @ws("Image type", image_type);
 
 enum8 image_compression {
     INVALID  = 0,
@@ -376,7 +384,7 @@ flags8 image_flags {
     CACHE_ME,
     HIGH_BITS_SET,
     CACHE_REPLACE_ME,
-};
+} @ws("Flags", image_flags);
 
 enum8 bitmap_fmt {
     INVALID,
@@ -390,13 +398,13 @@ enum8 bitmap_fmt {
     32BIT /* 4 byte, xrgb in little endian format */,
     RGBA /* 4 byte, argb in little endian format */,
     8BIT_A /* 1 byte, alpha */
-};
+} @ws("Pixmap format", pixmap_format);
 
 flags8 bitmap_flags {
     PAL_CACHE_ME,
     PAL_FROM_CACHE,
     TOP_DOWN,
-};
+} @ws("Pixmap flags", pixmap_flags);
 
 flags8 jpeg_alpha_flags {
     TOP_DOWN,
@@ -405,7 +413,7 @@ flags8 jpeg_alpha_flags {
 enum8 image_scale_mode {
     INTERPOLATE,
     NEAREST,
-};
+} @ws("Scale mode", scale_mode);
 
 flags16 ropd {
     INVERS_SRC,
@@ -419,7 +427,7 @@ flags16 ropd {
     OP_WHITENESS,
     OP_INVERS,
     INVERS_RES,
-};
+} @ws("ROP descriptor", display_rop_descriptor);
 
 /* This *must* remain with values identical to api/winddi.h
    LA_STYLED == 0x8 (log_2)=> 3
@@ -436,13 +444,13 @@ flags8 string_flags {
     RASTER_A4,
     RASTER_A8,
     RASTER_TOP_DOWN,
-};
+} @ws_desc("Glyph flags");
 
 flags32 surface_flags {
     /* Adding flags requires some caps check, since old clients only
        treat the value as an enum and not as a flag (flag == PRIMARY) */
     PRIMARY
-};
+} @ws_base(DEC) @ws("Surface flags", surface_flags);
 
 enum32 surface_fmt {
     INVALID,
@@ -452,7 +460,7 @@ enum32 surface_fmt {
     16_565  = 80,
     32_xRGB = 32,
     32_ARGB = 96
-};
+} @ws("Surface format", surface_format);
 
 flags8 alpha_flags {
     DEST_HAS_ALPHA,
@@ -465,9 +473,9 @@ enum8 resource_type {
 } @prefix(SPICE_RES_TYPE_);
 
 struct ClipRects {
-    uint32 num_rects;
+    uint32 num_rects @ws("RectList size", rectlist_size);
     Rect rects[num_rects] @end;
-};
+} @ws_txt("RectList (%d rects)", num_rects);
 
 struct PathSegment {
     path_flags flags;
@@ -486,18 +494,18 @@ struct Clip {
     case RECTS:
         ClipRects rects @outvar(cliprects) @to_ptr;
     } u @anon;
-};
+} @ws_desc("SpiceClip");
 
 struct DisplayBase {
-    uint32 surface_id;
-    Rect box;
+    uint32 surface_id @ws("Surface ID", surface_id);
+    Rect box @ws_inline;
     Clip clip;
-} @ctype(SpiceMsgDisplayBase);
+} @ctype(SpiceMsgDisplayBase) @ws_txt("SpiceMsgDisplayBase - SpiceRect box (%u-%u, %u-%u)", box.left, box.top, box.right, box.bottom);
 
 struct ResourceID {
-    uint8 type;
-    uint64 id;
-};
+    uint8 type @ws("Type", resource_type);
+    uint64 id @ws("id", resource_id);
+} @ws_txt_n("Resource #%d", INDEX);
 
 struct WaitForChannel {
     uint8 channel_type;
@@ -511,20 +519,21 @@ struct Palette {
     uint32 ents[num_ents] @end;
 };
 
+/* TODO "Pixmap pixels (%d bytes)" */
 struct BitmapData {
     bitmap_fmt format;
     bitmap_flags flags;
-    uint32 x;
-    uint32 y;
-    uint32 stride;
+    uint32 x @ws("Pixmap width", pixmap_width);
+    uint32 y @ws("Pixmap height", pixmap_height);
+    uint32 stride @ws("Pixmap stride", pixmap_stride);
     switch (flags) {
     case PAL_FROM_CACHE:
 	uint64 palette_id;
     default:
-	Palette *palette @outvar(bitmap);
+	Palette * @ws("Pixmap palette pointer", pixmap_palette_address) palette @outvar(bitmap);
     } pal @anon;
     uint8 data[image_size(8, stride, y)] @chunk @nomarshal;
-} @ctype(SpiceBitmap);
+} @ctype(SpiceBitmap) @ws_desc("Pixmap") @ws_txt("Pixmap pixels (%ux%u)", x, y);
 
 struct BinaryData {
     uint32 data_size;
@@ -558,17 +567,17 @@ struct JPEGAlphaData {
 
 struct Surface {
     uint32 surface_id;
-};
+} @ws_txt("Surface ID: %u", surface_id);
 
 
 struct Image {
     struct ImageDescriptor {
-        uint64 id;
+        uint64 id @ws("Image ID", image_id) @ws_base(HEX);
         image_type type;
         image_flags flags;
-        uint32 width;
-        uint32 height;
-    } descriptor;
+        uint32 width @ws("Width", image_width);
+        uint32 height @ws("Height", image_height);
+    } descriptor @ws_inline @ws_desc("Image Descriptor");
 
     switch (descriptor.type) {
     case BITMAP:
@@ -594,25 +603,32 @@ struct Image {
 };
 
 struct Pattern {
-    Image *pat @nonnull;
+    Image * @ws("Image address", ref_image) @ws_base(HEX_DEC) pat @nonnull;
     Point pos;
 };
 
+/*
+TODO
+"Brush - SOLID"
+"Brush - PATTERN"
+"Brush - NONE"
+"Invalid Brush type"
+*/
 struct Brush {
     brush_type type;
     switch (type) {
     case SOLID:
-        uint32 color;
+        uint32 color @ws("Brush color", brush_rgb) @ws_base(HEX);
     case PATTERN:
         Pattern pattern;
     } u;
-};
+} @ws_txt("Brush - %u", type);
 
 struct QMask {
     mask_flags flags;
     Point pos;
-    Image *bitmap;
-};
+    Image * @ws("Image address", ref_image) @ws_base(HEX_DEC) bitmap;
+} @ws_desc("Mask");
 
 struct LineAttr {
     line_flags flags;
@@ -651,7 +667,7 @@ struct RasterGlyphA8 {
 } @ctype(SpiceRasterGlyph);
 
 struct String {
-    uint16 length;
+    uint16 length @ws("Number of glyphs", num_glyphs);
     string_flags flags; /* Special: Only one of a1/a4/a8 set */
     switch (flags) {
     case RASTER_A1:
@@ -664,26 +680,26 @@ struct String {
 };
 
 struct StreamDataHeader {
-	uint32 id;
-	uint32 multi_media_time;
+	uint32 id @ws("Stream ID", display_stream_id);
+	uint32 multi_media_time @ws("Current server multimedia time", multimedia_time);
 };
 
 struct Head {
-    uint32 id;
-    uint32 surface_id;
-    uint32 width;
-    uint32 height;
-    uint32 x;
-    uint32 y;
-    uint32 flags;
-};
+    uint32 id @ws("Head ID", display_head_id);
+    uint32 surface_id @ws("Head surface ID", display_head_surface_id);
+    uint32 width @ws("Head width", display_head_width);
+    uint32 height @ws("Head height", display_head_height);
+    uint32 x @ws("Head X coordinate", display_head_x);
+    uint32 y @ws("Head Y coordinate", display_head_y);
+    uint32 flags @ws("Head flags", display_head_flags);
+} @ws_txt_n("Display Head #%u", INDEX);
 
 channel DisplayChannel : BaseChannel {
  server:
     message {
-	uint32 x_res;
-	uint32 y_res;
-	uint32 bits;
+	uint32 x_res @ws("Display Width", display_width);
+	uint32 y_res @ws("Display Height", display_height);
+	uint32 bits @ws("Color depth", display_depth);
     } mode = 101;
 
     Empty mark;
@@ -694,7 +710,7 @@ channel DisplayChannel : BaseChannel {
     } copy_bits;
 
     message {
-	uint16 count;
+	uint16 count @ws("count", display_inval_list_count);
 	ResourceID resources[count] @end;
     } @ctype(SpiceResourceList) inval_list;
 
@@ -710,32 +726,32 @@ channel DisplayChannel : BaseChannel {
     Empty inval_all_palettes;
 
     message {
-	uint32 surface_id;
-	uint32 id;
+	uint32 surface_id @ws("Surface ID", surface_id);
+	uint32 id @ws("Stream ID", display_stream_id);
 	stream_flags flags;
 	video_codec_type codec_type;
-	uint64 stamp;
-	uint32 stream_width;
-	uint32 stream_height;
-	uint32 src_width;
-	uint32 src_height;
+	uint64 stamp @ws("Stream stamp", display_stream_stamp);
+	uint32 stream_width @ws("Stream width", stream_width);
+	uint32 stream_height @ws("Stream height", stream_height);
+	uint32 src_width @ws("Stream source width", stream_src_width);
+	uint32 src_height @ws("Stream source height", stream_src_height);
 	Rect dest;
 	Clip clip;
     } stream_create = 122;
 
     message {
 	StreamDataHeader base;
-	uint32 data_size;
-	uint8 data[data_size] @end @nomarshal;
+	uint32 data_size @ws("Stream data size", display_stream_data_size);
+	uint8 data[data_size] @end @nomarshal @ws_desc("Stream data");
     } stream_data;
 
     message {
-	uint32 id;
+	uint32 id @ws("Stream ID", display_stream_id);
 	Clip clip;
     } stream_clip;
 
     message {
-	uint32 id;
+	uint32 id @ws("Stream ID", display_stream_id);
     } stream_destroy;
 
     Empty stream_destroy_all;
@@ -752,7 +768,7 @@ channel DisplayChannel : BaseChannel {
     message {
 	DisplayBase base;
 	struct Opaque {
-	    Image *src_bitmap;
+	    Image * @ws("Image address", ref_image) @ws_base(HEX_DEC) src_bitmap;
 	    Rect src_area;
 	    Brush brush;
 	    ropd rop_descriptor;
@@ -764,7 +780,7 @@ channel DisplayChannel : BaseChannel {
     message {
 	DisplayBase base;
 	struct Copy {
-	    Image *src_bitmap;
+	    Image * @ws("Image address", ref_image) @ws_base(HEX_DEC) src_bitmap;
 	    Rect src_area;
 	    ropd rop_descriptor;
 	    image_scale_mode scale_mode;
@@ -775,7 +791,7 @@ channel DisplayChannel : BaseChannel {
     message {
 	DisplayBase base;
 	struct Blend {
-	    Image *src_bitmap;
+	    Image * @ws("Image address", ref_image) @ws_base(HEX_DEC) src_bitmap;
 	    Rect src_area;
 	    ropd rop_descriptor;
 	    image_scale_mode scale_mode;
@@ -807,10 +823,10 @@ channel DisplayChannel : BaseChannel {
     message {
 	DisplayBase base;
 	struct Rop3 {
-	    Image *src_bitmap;
+	    Image * @ws("Image address", ref_image) @ws_base(HEX_DEC) src_bitmap;
 	    Rect src_area;
 	    Brush brush;
-	    uint8 rop3;
+	    uint8 rop3 @ws_desc("ROP3");
 	    image_scale_mode scale_mode;
 	    QMask mask @outvar(mask);
 	} data;
@@ -830,22 +846,22 @@ channel DisplayChannel : BaseChannel {
     message {
 	DisplayBase base;
 	struct Text {
-	    String *str @marshall @nonnull;
+	    String * @ws("String address", ref_string) @ws_base(HEX_DEC) str @marshall @nonnull;
 	    Rect back_area;
 	    Brush fore_brush @outvar(fore_brush);
 	    Brush back_brush @outvar(back_brush);
-	    uint16 fore_mode;
-	    uint16 back_mode;
+	    uint16 fore_mode @ws("Text foreground mode", draw_text_fore_mode);
+	    uint16 back_mode @ws("Text background mode", draw_text_back_mode);
 	} data;
     } draw_text;
 
     message {
 	DisplayBase base;
 	struct Transparent {
-	    Image *src_bitmap;
+	    Image * @ws("Image address", ref_image) @ws_base(HEX_DEC) src_bitmap;
 	    Rect src_area;
-	    uint32 src_color;
-	    uint32 true_color;
+	    uint32 src_color @ws("Transparent source color", display_transparent_src_color) @ws_base(HEX);
+	    uint32 true_color @ws("Transparent true color", display_transparent_true_color) @ws_base(HEX);
 	} data;
     } draw_transparent;
 
@@ -854,35 +870,35 @@ channel DisplayChannel : BaseChannel {
 	struct AlphaBlend {
 	    alpha_flags alpha_flags;
 	    uint8 alpha;
-	    Image *src_bitmap;
+	    Image * @ws("Image address", ref_image) @ws_base(HEX_DEC) src_bitmap;
 	    Rect src_area;
 	} data;
     } draw_alpha_blend;
 
     message {
-	uint32 surface_id;
-	uint32 width;
-	uint32 height;
+	uint32 surface_id @ws("Surface ID", surface_id);
+	uint32 width @ws("Surface width", surface_width);
+	uint32 height @ws("Surface height", surface_height);
 	surface_fmt format;
 	surface_flags flags;
     } @ctype(SpiceMsgSurfaceCreate) surface_create;
 
     message {
-	uint32 surface_id;
+	uint32 surface_id @ws("Surface ID", surface_id);
     } @ctype(SpiceMsgSurfaceDestroy) surface_destroy;
 
     message {
 	StreamDataHeader base;
-	uint32 width;
-	uint32 height;
+	uint32 width @ws("Stream width", stream_width);
+	uint32 height @ws("Stream height", stream_height);
 	Rect dest;
-	uint32 data_size;
+	uint32 data_size @ws("Stream data size", display_stream_data_size);
 	uint8 data[data_size] @end @nomarshal;
     } stream_data_sized;
 
     message {
-	uint16 count;
-    uint16 max_allowed;
+	uint16 count @ws("Monitor count", monitor_config_count);
+    uint16 max_allowed @ws("Max.allowed monitors", monitor_config_max_allowed);
 	Head heads[count] @end;
     } monitors_config;
 
@@ -909,23 +925,23 @@ channel DisplayChannel : BaseChannel {
     } draw_composite;
 
     message {
-        uint32 stream_id;
-        uint32 unique_id;
-        uint32 max_window_size;
-        uint32 timeout_ms;
+        uint32 stream_id @ws("Stream ID", display_stream_id);
+        uint32 unique_id @ws("Unique ID", display_stream_report_unique_id);
+        uint32 max_window_size @ws("Max window size", display_stream_report_max_window_size);
+        uint32 timeout_ms @ws("Timeout (ms)", display_stream_report_timeout);
     } stream_activate_report;
 
  client:
     message {
-	uint8 pixmap_cache_id;
-	int64 pixmap_cache_size; //in pixels
-	uint8 glz_dictionary_id;
-	int32 glz_dictionary_window_size;  // in pixels
+	uint8 pixmap_cache_id @ws("Cache ID", display_init_cache_id);
+	int64 pixmap_cache_size @ws("Cache size (pixels)", display_init_cache_size); //in pixels
+	uint8 glz_dictionary_id @ws("GLZ Dictionary ID", display_init_glz_dict_id);
+	int32 glz_dictionary_window_size @ws("Dictionary window size", display_init_dict_window_size);  // in pixels
     } init = 101;
 
     message {
         uint32 stream_id;
-        uint32 unique_id;
+        uint32 unique_id @ws("Unique ID", display_stream_report_unique_id);
         uint32 start_frame_mm_time;
         uint32 end_frame_mm_time;
         uint32 num_frames;
@@ -940,10 +956,10 @@ channel DisplayChannel : BaseChannel {
 };
 
 flags16 keyboard_modifier_flags {
-    SCROLL_LOCK,
-    NUM_LOCK,
-    CAPS_LOCK
-};
+    SCROLL_LOCK @ws_desc("Scroll Lock"),
+    NUM_LOCK @ws_desc("Num Lock"),
+    CAPS_LOCK @ws_desc("Caps Lock")
+} @ws("Keyboard modifiers", keyboard_modifiers);
 
 enum8 mouse_button {
     INVALID,
@@ -958,16 +974,22 @@ flags16 mouse_button_mask {
     LEFT,
     MIDDLE,
     RIGHT
+} @ws("Mouse button state", button_state) @ws_base(DEC);
+
+struct WSMousePosition {
+    Point pt;
+    mouse_button_mask buttons_state;
+    uint8 display_id @ws("Mouse display ID", mouse_display_id);
 };
 
 channel InputsChannel : BaseChannel {
  client:
     message {
-	uint32 code;
+	uint32 code  @ws("Key scan code", keyboard_key_code) @ws_base(DEC_HEX);
     } @ctype(SpiceMsgcKeyDown) key_down = 101;
 
     message {
-	uint32 code;
+	uint32 code @ws("Key scan code", keyboard_key_code) @ws_base(DEC_HEX);
     } @ctype(SpiceMsgcKeyUp) key_up;
 
     message {
@@ -986,8 +1008,8 @@ channel InputsChannel : BaseChannel {
 	uint32 x;
 	uint32 y;
 	mouse_button_mask buttons_state;
-	uint8 display_id;
-    } @ctype(SpiceMsgcMousePosition) mouse_position;
+	uint8 display_id @ws("Mouse display ID", mouse_display_id);
+    } @ctype(SpiceMsgcMousePosition) @ws_as(WSMousePosition) mouse_position;
 
     message {
 	mouse_button button;
@@ -1019,22 +1041,22 @@ enum8 cursor_type {
     COLOR16,
     COLOR24,
     COLOR32,
-};
+} @ws("Cursor type", cursor_type) @ws_base(HEX);
 
 flags16 cursor_flags {
     NONE, /* Means no cursor */
     CACHE_ME,
     FROM_CACHE,
-};
+} @ws("Cursor flags", cursor_flags);
 
 struct CursorHeader {
-    uint64 unique;
+    uint64 unique @ws("Cursor unique ID", cursor_unique) @ws_base(HEX);
     cursor_type type;
-    uint16 width;
-    uint16 height;
-    uint16 hot_spot_x;
-    uint16 hot_spot_y;
-};
+    uint16 width @ws("Cursor width", cursor_width);
+    uint16 height @ws("Cursor height", cursor_height);
+    uint16 hot_spot_x @ws("Cursor hotspot X", cursor_hotspot_x);
+    uint16 hot_spot_y @ws("Cursor hotspot Y", cursor_hotspot_y);
+} @ws_desc("Cursor Header");
 
 struct Cursor {
     cursor_flags flags;
@@ -1042,16 +1064,16 @@ struct Cursor {
     case !NONE:
         CursorHeader header;
     } u @anon;
-    uint8 data[] @as_ptr(data_size);
-};
+    uint8 data[] @as_ptr(data_size) @ws_txt("Cursor data (%u bytes)", data.nelements);
+} @ws_desc("RedCursor");
 
 channel CursorChannel : BaseChannel {
  server:
     message {
 	Point16 position;
-	uint16 trail_length;
-	uint16 trail_frequency;
-	uint8 visible;
+	uint16 trail_length @ws("Cursor trail length", cursor_trail_len);
+	uint16 trail_frequency @ws("Cursor trail frequency", cursor_trail_freq);
+	uint8 visible; /* TODO strange...*/
 	Cursor cursor;
     } init = 101;
 
@@ -1070,12 +1092,12 @@ channel CursorChannel : BaseChannel {
     Empty hide;
 
     message {
-	uint16 length;
-	uint16 frequency;
+	uint16 length @ws("Cursor trail length", cursor_trail_len);
+	uint16 frequency @ws("Cursor trail frequency", cursor_trail_freq);
     } trail;
 
     message {
-	uint64 id;
+	uint64 id @ws("Cursor ID", cursor_id);
     } @ctype(SpiceMsgDisplayInvalOne) inval_one;
 
     Empty inval_all;
@@ -1086,40 +1108,40 @@ enum16 audio_data_mode {
     RAW,
     CELT_0_5_1,
     OPUS,
-};
+} @ws("Mode", audio_mode);
 
 enum16 audio_fmt {
     INVALID,
     S16,
-};
+} @ws("Format", audio_format);
 
 message AudioVolume {
-    uint8 nchannels;
-    uint16 volume[nchannels] @end;
+    uint8 nchannels @ws("Channels", audio_channels);
+    uint16 @ws("Volume", audio_volume) volume[nchannels] @end @ws_desc("Volume Array");
 };
 
 message AudioMute {
-    uint8 mute;
+    uint8 mute @ws("Mute", audio_mute);
 };
 
 channel PlaybackChannel : BaseChannel {
  server:
     message {
-	uint32 time;
-	uint8 data[] @as_ptr(data_size);
+	uint32 time @ws("Timestamp", audio_timestamp);
+	uint8 data[] @as_ptr(data_size) @ws("data", data) @ws_type(BYTES);
     } @ctype(SpiceMsgPlaybackPacket) data = 101;
 
     message {
-	uint32 time;
+	uint32 time @ws("Timestamp", audio_timestamp);
 	audio_data_mode mode;
 	uint8 data[] @as_ptr(data_size);
     } mode;
 
     message {
-       uint32 channels;
+       uint32 channels @ws("Channels", audio_channels);
        audio_fmt format;
-       uint32 frequency;
-       uint32 time;
+       uint32 frequency @ws("Frequency", audio_frequency);
+       uint32 time @ws("Timestamp", audio_timestamp);
     } start;
 
     Empty stop;
@@ -1127,7 +1149,7 @@ channel PlaybackChannel : BaseChannel {
     AudioMute mute;
 
     message {
-        uint32 latency_ms;
+        uint32 latency_ms @ws("Latency (ms)", audio_latency);
     } latency;
 };
 
@@ -1149,7 +1171,7 @@ channel RecordChannel : BaseChannel {
     } @ctype(SpiceMsgcRecordPacket) data = 101;
 
     message {
-	uint32 time;
+	uint32 time @ws("Timestamp", audio_timestamp);
 	audio_data_mode mode;
 	uint8 data[] @as_ptr(data_size);
     } mode;
@@ -1357,16 +1379,16 @@ channel UsbredirChannel : SpicevmcChannel {
 channel PortChannel : SpicevmcChannel {
  client:
     message {
-	uint8 event;
+	uint8 event @ws("Event", port_event);
     } event = 201;
  server:
     message {
 	uint32 name_size;
-	uint8 *name[name_size] @zero_terminated @marshall @nonnull;
-	uint8 opened;
+	uint8 *name[name_size] @zero_terminated @marshall @nonnull @ws("Name", main_name) @ws_type(STRINGZ);
+	uint8 opened @ws("Opened", port_opened);
     } init = 201;
     message {
-	uint8 event;
+	uint8 event @ws("Event", port_event);
     } event;
 };
 
-- 
2.1.0



More information about the Spice-devel mailing list