aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexis La Goutte <alexis.lagoutte@gmail.com>2014-05-13 17:49:24 +0200
committerAnders Broman <a.broman58@gmail.com>2014-05-13 16:38:38 +0000
commit218b8c9ad935ac701ed3aec807283478a529c688 (patch)
treeba3bbc089175c62921b6dd67cc174290226f3c83
parent3157bf6ba5e4896b28316695ecd3a4659631c8c2 (diff)
HTTP2 enhance display when priority flag is set
* Add bitmask and fix length for exclusive flag * Add missing bitmask for stream dependency * Add fielder with calcultated weight value (weight+1, see spec for more information) Change-Id: I7a6e97be068a80caa7355f593d9497c431c681ed Reviewed-on: https://code.wireshark.org/review/1625 Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r--epan/dissectors/packet-http2.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/epan/dissectors/packet-http2.c b/epan/dissectors/packet-http2.c
index 5189c11661..fd8d9ef73a 100644
--- a/epan/dissectors/packet-http2.c
+++ b/epan/dissectors/packet-http2.c
@@ -81,6 +81,7 @@ static int hf_http2_pad_low = -1;
static int hf_http2_pad_length = -1;
static int hf_http2_weight = -1;
+static int hf_http2_weight_real = -1;
static int hf_http2_stream_dependency = -1;
static int hf_http2_excl_dependency = -1;
/* Data */
@@ -341,12 +342,19 @@ dissect_frame_padding(tvbuff_t *tvb, guint16 *padding, proto_tree *http2_tree,
static guint
dissect_frame_prio(tvbuff_t *tvb, proto_tree *http2_tree, guint offset, guint8 flags)
{
+ proto_tree *ti;
+ guint8 weight;
+
if(flags & HTTP2_FLAGS_PRIORITY)
{
- proto_tree_add_item(http2_tree, hf_http2_excl_dependency, tvb, offset, 1, ENC_NA);
+ proto_tree_add_item(http2_tree, hf_http2_excl_dependency, tvb, offset, 4, ENC_NA);
proto_tree_add_item(http2_tree, hf_http2_stream_dependency, tvb, offset, 4, ENC_NA);
offset += 4;
proto_tree_add_item(http2_tree, hf_http2_weight, tvb, offset, 1, ENC_NA);
+ weight = tvb_get_guint8(tvb, offset);
+ /* 6.2: Weight: An 8-bit weight for the stream; Add one to the value to obtain a weight between 1 and 256 */
+ ti = proto_tree_add_uint(http2_tree, hf_http2_weight_real, tvb, offset, 1, weight+1);
+ PROTO_ITEM_SET_GENERATED(ti);
offset++;
}
@@ -818,6 +826,11 @@ proto_register_http2(void)
FT_UINT8, BASE_DEC, NULL, 0x0,
"An 8-bit weight for the identified priority", HFILL }
},
+ { &hf_http2_weight_real,
+ { "Weight real", "http2.headers.weight_real",
+ FT_UINT8, BASE_DEC, NULL, 0x0,
+ "Real Weight value (Add one to value)", HFILL }
+ },
{ &hf_http2_streamid,
{ "Stream Identifier", "http2.streamid",
FT_UINT32, BASE_DEC, NULL, MASK_HTTP2_STREAMID,
@@ -927,12 +940,12 @@ proto_register_http2(void)
},
{ &hf_http2_excl_dependency,
{ "Exclusive", "http2.exclusive",
- FT_BOOLEAN, BASE_NONE, NULL, 0x0,
+ FT_BOOLEAN, 32, NULL, 0x80000000,
"A single bit flag indicates that the stream dependency is exclusive", HFILL }
},
{ &hf_http2_stream_dependency,
{ "Stream Dependency", "http2.stream_dependency",
- FT_UINT32, BASE_DEC, NULL, 0x0,
+ FT_UINT32, BASE_DEC, NULL, 0x7FFFFFFF,
"An identifier for the stream that this stream depends on", HFILL }
},