QUIC: Enhance *BLOCKED* frame

Add new offset field in BLOCKED and STREAM_BLOCKED frame
Add new stream_id field in STREAM_ID_BLOCKED

Bug: 13881
Change-Id: If030728c46607ea9ea3a500d925b30aaf9a841a8
Reviewed-on: https://code.wireshark.org/review/25121
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Alexis La Goutte 2018-01-03 08:30:08 +01:00 committed by Anders Broman
parent f1c87809de
commit a3857b2f6f
1 changed files with 44 additions and 6 deletions

View File

@ -110,7 +110,10 @@ static int hf_quic_frame_type_md_maximum_data = -1;
static int hf_quic_frame_type_msd_stream_id = -1; static int hf_quic_frame_type_msd_stream_id = -1;
static int hf_quic_frame_type_msd_maximum_stream_data = -1; static int hf_quic_frame_type_msd_maximum_stream_data = -1;
static int hf_quic_frame_type_msi_stream_id = -1; static int hf_quic_frame_type_msi_stream_id = -1;
static int hf_quic_frame_type_blocked_offset = -1;
static int hf_quic_frame_type_sb_stream_id = -1; static int hf_quic_frame_type_sb_stream_id = -1;
static int hf_quic_frame_type_sb_offset = -1;
static int hf_quic_frame_type_sib_stream_id = -1;
static int hf_quic_frame_type_nci_sequence = -1; static int hf_quic_frame_type_nci_sequence = -1;
static int hf_quic_frame_type_nci_connection_id = -1; static int hf_quic_frame_type_nci_connection_id = -1;
static int hf_quic_frame_type_nci_stateless_reset_token = -1; static int hf_quic_frame_type_nci_stateless_reset_token = -1;
@ -777,37 +780,55 @@ dissect_quic_frame_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *quic_
} }
break; break;
case FT_BLOCKED:{ case FT_BLOCKED:{
guint32 len_offset;
/* No Payload */ if (quic_info->version <= 0xff000007) {
/* No Payload */
len_offset = 0;
} else {
proto_tree_add_item_ret_varint(ft_tree, hf_quic_frame_type_blocked_offset, tvb, offset, -1, ENC_VARINT_QUIC, NULL, &len_offset);
offset += len_offset;
}
proto_item_set_len(ti_ft, 1); proto_item_set_len(ti_ft, 1 + len_offset);
col_prepend_fstr(pinfo->cinfo, COL_INFO, "Blocked"); col_prepend_fstr(pinfo->cinfo, COL_INFO, "Blocked");
} }
break; break;
case FT_STREAM_BLOCKED:{ case FT_STREAM_BLOCKED:{
guint32 len_streamid; guint32 len_streamid, len_offset;
if (quic_info->version <= 0xff000007) { if (quic_info->version <= 0xff000007) {
proto_tree_add_item(ft_tree, hf_quic_frame_type_sb_stream_id, tvb, offset, 4, ENC_BIG_ENDIAN); proto_tree_add_item(ft_tree, hf_quic_frame_type_sb_stream_id, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4; offset += 4;
len_streamid = 4; len_streamid = 4;
len_offset = 0;
} else { } else {
proto_tree_add_item_ret_varint(ft_tree, hf_quic_frame_type_sb_stream_id, tvb, offset, -1, ENC_VARINT_QUIC, NULL, &len_streamid); proto_tree_add_item_ret_varint(ft_tree, hf_quic_frame_type_sb_stream_id, tvb, offset, -1, ENC_VARINT_QUIC, NULL, &len_streamid);
offset += len_streamid; offset += len_streamid;
proto_tree_add_item_ret_varint(ft_tree, hf_quic_frame_type_sb_offset, tvb, offset, -1, ENC_VARINT_QUIC, NULL, &len_offset);
offset += len_offset;
} }
proto_item_set_len(ti_ft, 1 + len_streamid); proto_item_set_len(ti_ft, 1 + len_streamid + len_offset);
col_prepend_fstr(pinfo->cinfo, COL_INFO, "Stream Blocked"); col_prepend_fstr(pinfo->cinfo, COL_INFO, "Stream Blocked");
} }
break; break;
case FT_STREAM_ID_BLOCKED:{ case FT_STREAM_ID_BLOCKED:{
guint32 len_streamid;
/* No Payload */ if (quic_info->version <= 0xff000007) {
/* No Payload */
len_streamid = 0;
} else {
proto_tree_add_item_ret_varint(ft_tree, hf_quic_frame_type_sib_stream_id, tvb, offset, -1, ENC_VARINT_QUIC, NULL, &len_streamid);
offset += len_streamid;
}
proto_item_set_len(ti_ft, 1); proto_item_set_len(ti_ft, 1 + len_streamid);
col_prepend_fstr(pinfo->cinfo, COL_INFO, "Stream ID Blocked"); col_prepend_fstr(pinfo->cinfo, COL_INFO, "Stream ID Blocked");
} }
@ -1740,12 +1761,29 @@ proto_register_quic(void)
FT_UINT64, BASE_DEC, NULL, 0x0, FT_UINT64, BASE_DEC, NULL, 0x0,
"ID of the maximum peer-initiated stream ID for the connection", HFILL } "ID of the maximum peer-initiated stream ID for the connection", HFILL }
}, },
/* BLOCKED */
{ &hf_quic_frame_type_blocked_offset,
{ "Offset", "quic.frame_type.sb.offset",
FT_UINT64, BASE_DEC, NULL, 0x0,
"Indicating the connection-level offset at which the blocking occurred", HFILL }
},
/* STREAM_BLOCKED */ /* STREAM_BLOCKED */
{ &hf_quic_frame_type_sb_stream_id, { &hf_quic_frame_type_sb_stream_id,
{ "Stream ID", "quic.frame_type.sb.stream_id", { "Stream ID", "quic.frame_type.sb.stream_id",
FT_UINT64, BASE_DEC, NULL, 0x0, FT_UINT64, BASE_DEC, NULL, 0x0,
"Indicating the stream which is flow control blocked", HFILL } "Indicating the stream which is flow control blocked", HFILL }
}, },
{ &hf_quic_frame_type_sb_offset,
{ "Offset", "quic.frame_type.sb.offset",
FT_UINT64, BASE_DEC, NULL, 0x0,
"Indicating the offset of the stream at which the blocking occurred", HFILL }
},
/* STREAM_ID_BLOCKED */
{ &hf_quic_frame_type_sib_stream_id,
{ "Stream ID", "quic.frame_type.sib.stream_id",
FT_UINT64, BASE_DEC, NULL, 0x0,
"Indicating the highest stream ID that the sender was permitted to open", HFILL }
},
/* NEW_CONNECTION_ID */ /* NEW_CONNECTION_ID */
{ &hf_quic_frame_type_nci_sequence, { &hf_quic_frame_type_nci_sequence,
{ "Sequence", "quic.frame_type.nci.sequence", { "Sequence", "quic.frame_type.nci.sequence",