diff options
author | Peter Wu <peter@lekensteyn.nl> | 2019-01-30 16:28:05 +0100 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2019-01-31 11:22:40 +0000 |
commit | 7b04a4f797ce6001f33df3cc99896b1fa53103ff (patch) | |
tree | af6303f296398371425ba1777e1c55e38eb71fc7 /epan/dissectors/packet-quic.c | |
parent | 74f18bd005b22bdd93fc0ace55daa6a3c0ad57d1 (diff) |
QUIC: put coalesced packets in separate trees
Make the output of "tshark -Tjson --no-duplicate-keys" more useful.
Note: connection information is only available under the first QUIC item
to avoid duplication of information.
Bug: 13881
Change-Id: I5e25b1f3936e259d621002151f4d76a3538c9aa4
Reviewed-on: https://code.wireshark.org/review/31817
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'epan/dissectors/packet-quic.c')
-rw-r--r-- | epan/dissectors/packet-quic.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/epan/dissectors/packet-quic.c b/epan/dissectors/packet-quic.c index 6d6669854f..da120fee97 100644 --- a/epan/dissectors/packet-quic.c +++ b/epan/dissectors/packet-quic.c @@ -2178,7 +2178,7 @@ static int dissect_quic(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { - proto_item *ti; + proto_item *quic_ti; proto_tree *quic_tree; guint offset = 0; guint32 header_form; @@ -2195,9 +2195,8 @@ dissect_quic(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, p_add_proto_data(wmem_file_scope(), pinfo, proto_quic, 0, dgram_info); } - ti = proto_tree_add_item(tree, proto_quic, tvb, 0, -1, ENC_NA); - - quic_tree = proto_item_add_subtree(ti, ett_quic); + quic_ti = proto_tree_add_item(tree, proto_quic, tvb, 0, -1, ENC_NA); + quic_tree = proto_item_add_subtree(quic_ti, ett_quic); if (!PINFO_FD_VISITED(pinfo)) { guint8 long_packet_type; @@ -2231,7 +2230,14 @@ dissect_quic(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, DISSECTOR_ASSERT(quic_packet); } + /* Ensure that coalesced QUIC packets end up separated. */ + if (offset > 0) { + quic_ti = proto_tree_add_item(tree, proto_quic, tvb, offset, -1, ENC_NA); + quic_tree = proto_item_add_subtree(quic_ti, ett_quic); + } + tvbuff_t *next_tvb = quic_get_message_tvb(tvb, offset); + proto_item_set_len(quic_ti, tvb_reported_length(next_tvb)); proto_tree_add_item_ret_uint(quic_tree, hf_quic_header_form, next_tvb, 0, 1, ENC_NA, &header_form); guint new_offset = 0; if (header_form) { |