spice: immediately display channel type in the tree label

This makes important information available without having to expand it:

    Channel Array
      channels[0]: DISPLAY
        Channel type: DISPLAY (2)
        Channel ID: 0
      channels[1]: CURSOR
        Channel type: CURSOR (4)
        Channel ID: 0
      channels[2]: INPUTS
        Channel type: INPUTS (3)
        Channel ID: 0

Change-Id: I9b5db64f48453f367cfca14e9ad0822c01d91196
Reviewed-on: https://code.wireshark.org/review/29386
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
This commit is contained in:
Peter Wu 2018-09-01 12:27:53 +02:00 committed by Alexis La Goutte
parent 7348fe3289
commit 51c2f5b9de
1 changed files with 2 additions and 1 deletions

View File

@ -2384,7 +2384,8 @@ dissect_spice_main_server(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, c
for (i = 0; i < num_channels; i++ ) {
proto_tree *subsubtree;
subsubtree = proto_tree_add_subtree_format(subtree, tvb, offset, 2, ett_main_client, NULL, "channels[%u]", i);
subsubtree = proto_tree_add_subtree_format(subtree, tvb, offset, 2, ett_main_client, NULL, "channels[%u]: %s", i,
val_to_str_const(tvb_get_guint8(tvb, offset), channel_types_vs, "Unknown"));
proto_tree_add_item(subsubtree, hf_channel_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;