EVS: Fix display of A.2.1.3 Special case for 56 bit payload size

Change-Id: I5557e9d2efffaa1ff747f1132b065fe202222ad6
Reviewed-on: https://code.wireshark.org/review/36126
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Anders Broman 2020-02-18 10:45:21 +01:00 committed by Anders Broman
parent 498644ef61
commit 645f05bafa
1 changed files with 14 additions and 6 deletions

View File

@ -517,7 +517,7 @@ dissect_evs_cmr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *evs_tree, int
break;
}
col_append_fstr(pinfo->cinfo, COL_INFO, ", %s ", str);
col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", str);
}
/* Code to actually dissect the packets */
@ -533,6 +533,7 @@ dissect_evs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
guint8 oct, h_bit, toc_f_bit, evs_mode_b;
int num_toc, num_data;
guint64 value;
gboolean is_compact = FALSE;
/* Make entries in Protocol column and Info column on summary display */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "EVS");
@ -551,22 +552,27 @@ dissect_evs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
if (oct == 0) {
/* EVS Primary 2.8 kbps */
str = "EVS Primary 2.8 kbps";
col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", str);
is_compact = TRUE;
} else {
/* EVS AMR-WB IO SID */
str = "EVS AMR-WB IO SID";
}
} else {
str = try_val_to_str_idx(num_bits, evs_protected_payload_sizes_value, &idx);
if (str) {
is_compact = TRUE;
}
}
ti = proto_tree_add_item(tree, proto_evs, tvb, 0, -1, ENC_NA);
evs_tree = proto_item_add_subtree(ti, ett_evs);
if (str) {
if (is_compact) {
/* A.2.1 EVS codec Compact Format */
proto_tree_add_subtree(evs_tree, tvb, offset, -1, ett_evs_header, &ti, "Framing Mode: Compact");
proto_item_set_generated(ti);
/* One of the protected payload sizes, no further dissection currently. XXX add handling of "Special case"*/
col_append_fstr(pinfo->cinfo, COL_INFO, ", %s ", str);
/* One of the protected payload sizes, no further dissection currently.*/
col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", str);
proto_tree_add_int_format(evs_tree, hf_evs_packet_length, tvb, offset, 1, packet_len * 8, " %s, packet_len %i bits", str, packet_len * 8);
if (strncmp(str, "EVS A", 5) == 0) {
/* A.2.1.2 Compact format for EVS AMR-WB IO mode */
@ -685,7 +691,7 @@ dissect_evs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
evs_mode_b = (oct & 0x20) >> 5;
num_toc++;
sub_tree = proto_tree_add_subtree_format(evs_tree, tvb, offset, 1, ett_evs_header, NULL, "TOC # %u",
sub_tree = proto_tree_add_subtree_format(evs_tree, tvb, offset, 1, ett_evs_header, NULL, " TOC # %u",
num_toc);
if (evs_mode_b == 0) {
@ -699,6 +705,7 @@ dissect_evs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
};
proto_tree_add_bitmask_list(sub_tree, tvb, offset, 1, flags_toc_mode_0, ENC_BIG_ENDIAN);
str = val_to_str_const((oct & 0x0f), evs_bit_rate_mode_0_values, "Unknown value");
} else {
static const int * flags_toc_mode_1[] = {
&hf_evs_h_bit,
@ -708,9 +715,10 @@ dissect_evs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
&hf_evs_bit_rate_mode_1,
NULL
};
proto_tree_add_bitmask_list(sub_tree, tvb, offset, 1, flags_toc_mode_1, ENC_BIG_ENDIAN);
str = val_to_str_const((oct & 0x0f), evs_bit_rate_mode_1_values, "Unknown value");
}
col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", str);
offset++;
} while (toc_f_bit == 1);