summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2014-06-20 18:50:00 +0200
committerStig Bjørlykke <stig@bjorlykke.org>2014-06-20 17:05:17 +0000
commit6a369cfa457109263f2fdfcdcc4d4d5b5550ec1b (patch)
tree50b3b7ade1f45d0a3f06f98e180527c1f337c20f
parentb1da5099dbb7b94f362bcc3e2b6e057b6763df71 (diff)
downloadwireshark-6a369cfa457109263f2fdfcdcc4d4d5b5550ec1b.tar.gz
Revert part of svn revision 52045 (git b38ee917)
This fix does change the format printed for values using bitmasks (because the bit values are printed first) and is not always wanted in this dissectors (because of readability). We should have a better way of doing what I want in this dissectors, so I'll have a look at this later. Change-Id: I2477aa6b1d0c42a7ad5848bba3cb74dce3bba1f0 Reviewed-on: https://code.wireshark.org/review/2485 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org> (cherry picked from commit 2ab2921c7d146ae453770e14ea3a4a11f2bdc2fd) Reviewed-on: https://code.wireshark.org/review/2486
-rw-r--r--epan/dissectors/packet-dmp.c203
-rw-r--r--epan/dissectors/packet-p_mul.c4
2 files changed, 128 insertions, 79 deletions
diff --git a/epan/dissectors/packet-dmp.c b/epan/dissectors/packet-dmp.c
index 8717cad6a8..fbc2e9aac1 100644
--- a/epan/dissectors/packet-dmp.c
+++ b/epan/dissectors/packet-dmp.c
@@ -2052,8 +2052,9 @@ static gint dissect_dmp_ext_addr (tvbuff_t *tvb, packet_info *pinfo,
if (value & 0x80) {
addr_length_extended = TRUE;
- en = proto_tree_add_uint(ext_tree, hf_addr_ext_length1, tvb,
- offset, 1, value);
+ en = proto_tree_add_uint_format (ext_tree, hf_addr_ext_length1, tvb,
+ offset, 1, value,
+ "Address Length (bits 4-0): %d", length);
addr_tree = proto_item_add_subtree (en, ett_address_ext_length);
proto_tree_add_item (addr_tree, hf_addr_ext_length1, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
@@ -2070,14 +2071,17 @@ static gint dissect_dmp_ext_addr (tvbuff_t *tvb, packet_info *pinfo,
addr_tree = proto_item_add_subtree (en, ett_address_ext_type);
proto_tree_add_item (addr_tree, hf_addr_ext_type, tvb, offset, 1, ENC_BIG_ENDIAN);
- en = proto_tree_add_uint(ext_tree, hf_addr_ext_length2, tvb,
- offset, 1, value);
+ en = proto_tree_add_uint_format (ext_tree, hf_addr_ext_length2, tvb,
+ offset, 1, value,
+ "Address Length (bits 9-5): %d",
+ value & 0x1F);
addr_tree = proto_item_add_subtree (en, ett_address_ext_length);
proto_tree_add_item (addr_tree, hf_addr_ext_length2, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
} else {
- en = proto_tree_add_uint(ext_tree, hf_addr_ext_length, tvb,
- offset, 1, value);
+ en = proto_tree_add_uint_format (ext_tree, hf_addr_ext_length, tvb,
+ offset, 1, value, "Address Length: %d",
+ length);
addr_tree = proto_item_add_subtree (en, ett_address_ext_length);
proto_tree_add_item (addr_tree, hf_addr_ext_length1, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
@@ -2096,8 +2100,9 @@ static gint dissect_dmp_ext_addr (tvbuff_t *tvb, packet_info *pinfo,
offset += length;
if (addr_length_extended) {
- en = proto_tree_add_uint(ext_tree, hf_addr_ext_length_generated,
- tvb, offset, 0, length);
+ en = proto_tree_add_uint_format (ext_tree, hf_addr_ext_length_generated,
+ tvb, offset, 0, length,
+ "Address Length: %d", length);
PROTO_ITEM_SET_GENERATED (en);
}
@@ -2291,14 +2296,16 @@ static gint dissect_dmp_direct_encoding (tvbuff_t *tvb, packet_info *pinfo,
not_req = (value & 0x03);
if (rep_req == 0x03) {
- en = proto_tree_add_uint_format_value(field_tree, hf_addr_dir_rec_no1,
+ en = proto_tree_add_uint_format (field_tree, hf_addr_dir_rec_no1,
tvb, offset, 1, value,
- "%d (offset from previous)",
+ "Recipient Number (bits 3-0): %d"
+ " (offset from previous)",
(value & 0xF0) >> 4);
} else {
- en = proto_tree_add_uint_format_value(field_tree, hf_addr_dir_rec_no,
+ en = proto_tree_add_uint_format (field_tree, hf_addr_dir_rec_no,
tvb, offset, 1, value,
- "%d (offset from previous)",
+ "Recipient Number Offset: %d"
+ " (offset from previous)",
(value & 0xF0) >> 4);
}
rec_tree = proto_item_add_subtree (en, ett_address_rec_no);
@@ -2311,11 +2318,15 @@ static gint dissect_dmp_direct_encoding (tvbuff_t *tvb, packet_info *pinfo,
dir_addr = (value & 0x7F);
action = (value & 0x80);
if (not_req == 0x03) {
- en = proto_tree_add_uint(field_tree, hf_addr_dir_address1,
- tvb, offset, 1, value);
+ en = proto_tree_add_uint_format (field_tree, hf_addr_dir_address1,
+ tvb, offset, 1, value,
+ "Direct Address (bits 6-0): %d",
+ value & 0x7F);
} else {
- en = proto_tree_add_uint(field_tree, hf_addr_dir_address,
- tvb, offset, 1, value);
+ en = proto_tree_add_uint_format (field_tree, hf_addr_dir_address,
+ tvb, offset, 1, value,
+ "Direct Address: %d",
+ value & 0x7F);
}
addr_tree = proto_item_add_subtree (en, ett_address_direct);
proto_tree_add_item (addr_tree, hf_addr_dir_action, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -2329,9 +2340,10 @@ static gint dissect_dmp_direct_encoding (tvbuff_t *tvb, packet_info *pinfo,
rec_ofs = rec_no;
rep_req = (value & 0xC0) >> 6;
- en = proto_tree_add_uint_format_value(field_tree, hf_addr_dir_rec_no2,
+ en = proto_tree_add_uint_format (field_tree, hf_addr_dir_rec_no2,
tvb, offset, 1, value,
- "%d (offset from previous)",
+ "Recipient Number (bits 9-4): %d"
+ " (offset from previous)",
value & 0x3F);
rec_tree = proto_item_add_subtree (en, ett_address_rec_no);
proto_tree_add_item (rec_tree, hf_addr_dir_rep_req2, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -2345,9 +2357,10 @@ static gint dissect_dmp_direct_encoding (tvbuff_t *tvb, packet_info *pinfo,
rec_ofs = rec_no;
rep_req = (value & 0xC0) >> 6;
- en = proto_tree_add_uint_format_value(field_tree, hf_addr_dir_rec_no3,
+ en = proto_tree_add_uint_format (field_tree, hf_addr_dir_rec_no3,
tvb, offset, 1, value,
- "%d (offset from previous)",
+ "Recipient Number (bits 14-10): %d"
+ " (offset from previous)",
value & 0x1F);
rec_tree = proto_item_add_subtree (en, ett_address_rec_no);
proto_tree_add_item (rec_tree, hf_addr_dir_rep_req3, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -2367,8 +2380,10 @@ static gint dissect_dmp_direct_encoding (tvbuff_t *tvb, packet_info *pinfo,
dir_addr |= ((value & 0x3F) << 7);
not_req = (value & 0xC0) >> 6;
- en = proto_tree_add_uint(field_tree, hf_addr_dir_address2, tvb,
- offset, 1, value);
+ en = proto_tree_add_uint_format (field_tree, hf_addr_dir_address2, tvb,
+ offset, 1, value,
+ "Direct Address (bits 12-7): %d",
+ value & 0x3F);
addr_tree = proto_item_add_subtree (en, ett_address_direct);
proto_tree_add_item (addr_tree, hf_addr_dir_not_req2, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (addr_tree, hf_addr_dir_address2, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -2380,8 +2395,10 @@ static gint dissect_dmp_direct_encoding (tvbuff_t *tvb, packet_info *pinfo,
dir_addr |= ((value & 0x3F) << 13);
not_req = (value & 0xC0) >> 6;
- en = proto_tree_add_uint(field_tree, hf_addr_dir_address3, tvb,
- offset, 1, value);
+ en = proto_tree_add_uint_format (field_tree, hf_addr_dir_address3, tvb,
+ offset, 1, value,
+ "Direct Address (bits 18-13): %d",
+ value & 0x3F);
addr_tree = proto_item_add_subtree (en, ett_address_direct);
proto_tree_add_item (addr_tree, hf_addr_dir_not_req3, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (addr_tree, hf_addr_dir_address3, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -2395,8 +2412,9 @@ static gint dissect_dmp_direct_encoding (tvbuff_t *tvb, packet_info *pinfo,
}
*prev_rec_no = rec_no;
- en = proto_tree_add_uint(field_tree, hf_addr_dir_rec_no_generated,
- tvb, offset, 0, rec_no);
+ en = proto_tree_add_uint_format (field_tree, hf_addr_dir_rec_no_generated,
+ tvb, offset, 0, rec_no,
+ "Recipient Number: %d", rec_no);
if (rec_no > 32767) {
proto_item_append_text (en, " (maximum 32767)");
expert_add_info(pinfo, en, &ei_addr_dir_rec_no_generated);
@@ -2404,8 +2422,9 @@ static gint dissect_dmp_direct_encoding (tvbuff_t *tvb, packet_info *pinfo,
PROTO_ITEM_SET_GENERATED (en);
if (dir_addr_extended) {
- en = proto_tree_add_uint(field_tree, hf_addr_dir_address_generated,
- tvb, offset, 0, dir_addr);
+ en = proto_tree_add_uint_format (field_tree, hf_addr_dir_address_generated,
+ tvb, offset, 0, dir_addr,
+ "Direct Address: %d", dir_addr);
PROTO_ITEM_SET_GENERATED (en);
}
@@ -2472,9 +2491,10 @@ static gint dissect_dmp_ext_encoding (tvbuff_t *tvb, packet_info *pinfo,
value = tvb_get_guint8 (tvb, offset);
rec_no = (value & 0x7F);
if (value & 0x80) {
- en = proto_tree_add_uint_format_value(field_tree, hf_addr_ext_rec_no1, tvb,
+ en = proto_tree_add_uint_format (field_tree, hf_addr_ext_rec_no1, tvb,
offset, 1, value,
- "%d (offset from previous)",
+ "Recipient Number (bits 6-0): %d"
+ " (offset from previous)",
value & 0x7F);
addr_tree = proto_item_add_subtree (en, ett_address_ext_rec_no);
proto_tree_add_item (addr_tree, hf_addr_ext_rec_ext, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -2485,17 +2505,19 @@ static gint dissect_dmp_ext_encoding (tvbuff_t *tvb, packet_info *pinfo,
value = tvb_get_guint8 (tvb, offset);
rec_no |= (value << 7);
rec_ofs = rec_no;
- en = proto_tree_add_uint_format_value(field_tree, hf_addr_ext_rec_no2, tvb,
+ en = proto_tree_add_uint_format (field_tree, hf_addr_ext_rec_no2, tvb,
offset, 1, value,
- "%d (offset from previous)", value);
+ "Recipient Number (bits 14-7): %d"
+ " (offset from previous)", value);
addr_tree = proto_item_add_subtree (en, ett_address_ext_rec_no);
proto_tree_add_item (addr_tree, hf_addr_ext_rec_no2, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
} else {
- en = proto_tree_add_uint_format_value(field_tree, hf_addr_ext_rec_no, tvb,
+ en = proto_tree_add_uint_format (field_tree, hf_addr_ext_rec_no, tvb,
offset, 1, value,
- "%d (offset from previous)",
+ "Recipient Number Offset: %d"
+ " (offset from previous)",
value & 0x7F);
addr_tree = proto_item_add_subtree (en, ett_address_ext_rec_no);
proto_tree_add_item (addr_tree, hf_addr_ext_rec_ext, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -2510,8 +2532,9 @@ static gint dissect_dmp_ext_encoding (tvbuff_t *tvb, packet_info *pinfo,
}
*prev_rec_no = rec_no;
- en = proto_tree_add_uint(field_tree, hf_addr_ext_rec_no_generated,
- tvb, offset, 0, rec_no);
+ en = proto_tree_add_uint_format (field_tree, hf_addr_ext_rec_no_generated,
+ tvb, offset, 0, rec_no,
+ "Recipient Number: %d", rec_no);
if (rec_no > 32767) {
proto_item_append_text (en, " (maximum 32767)");
expert_add_info(pinfo, en, &ei_addr_ext_rec_no_generated);
@@ -2695,8 +2718,10 @@ static gint dissect_ipm_identifier (tvbuff_t *tvb, packet_info *pinfo _U_, proto
modifier = (length & 0xC0) >> 6;
ipm_id_length = length & 0x3F;
- tf = proto_tree_add_uint(tree, hf_envelope_ipm_id_length,
- tvb, offset, 1, ipm_id_length);
+ tf = proto_tree_add_uint_format (tree, hf_envelope_ipm_id_length,
+ tvb, offset, 1, ipm_id_length,
+ "IPM Identifier Length: %u",
+ ipm_id_length);
field_tree = proto_item_add_subtree (tf, ett_envelope_ipm_id_length);
if ((dmp.msg_id_type == NAT_MSG_ID || modifier != IPM_MODIFIER_X400) && dmp_nat_decode == NAT_DECODE_THALES) {
proto_tree_add_item (field_tree, hf_thales_ipm_id_modifier, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -2756,8 +2781,9 @@ static gint dissect_dmp_envelope (tvbuff_t *tvb, packet_info *pinfo,
dmp.version = (envelope & 0x07) + 1;
/* Protocol Version */
- tf = proto_tree_add_uint(envelope_tree, hf_envelope_version,
- tvb, offset, 1, dmp.version);
+ tf = proto_tree_add_uint_format (envelope_tree, hf_envelope_version,
+ tvb, offset, 1, dmp.version,
+ "Protocol Version: %d", dmp.version);
field_tree = proto_item_add_subtree (tf, ett_envelope_version);
vf = proto_tree_add_item (field_tree, hf_envelope_protocol_id, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -2787,8 +2813,9 @@ static gint dissect_dmp_envelope (tvbuff_t *tvb, packet_info *pinfo,
if (dmp.msg_type != ACK) {
/* Hop count */
- tf = proto_tree_add_uint(envelope_tree, hf_envelope_hop_count,
- tvb, offset, 1, envelope);
+ tf = proto_tree_add_uint_format (envelope_tree, hf_envelope_hop_count,
+ tvb, offset, 1, envelope,
+ "Hop Count: %d", (envelope & 0xE0) >> 5);
field_tree = proto_item_add_subtree (tf, ett_envelope_hop_count);
proto_tree_add_item (field_tree, hf_envelope_hop_count_value, tvb, offset, 1, ENC_BIG_ENDIAN);
} else {
@@ -2862,16 +2889,21 @@ static gint dissect_dmp_envelope (tvbuff_t *tvb, packet_info *pinfo,
/* Message Identifier Type */
dmp.msg_id_type = (envelope & 0x60) >> 5;
- tf = proto_tree_add_item (envelope_tree, hf_envelope_msg_id_type,
- tvb, offset, 1, ENC_BIG_ENDIAN);
+ tf = proto_tree_add_uint_format (envelope_tree, hf_envelope_msg_id_type,
+ tvb, offset, 1, envelope,
+ "Message Identifier Type: %s (%d)",
+ val_to_str_const (dmp.msg_id_type, msg_id_type_vals, "Unknown"),
+ dmp.msg_id_type);
field_tree = proto_item_add_subtree (tf, ett_envelope_msg_id_type);
proto_tree_add_item (field_tree, hf_envelope_msg_id_type, tvb, offset, 1, ENC_BIG_ENDIAN);
if (dmp.msg_id_type == X400_MSG_ID || dmp.msg_id_type == NAT_MSG_ID) {
/* MTS Identifier Length */
dmp.mts_id_length = (envelope & 0x1F);
- dmp.mts_id_item = proto_tree_add_item(envelope_tree, hf_envelope_mts_id_length,
- tvb, offset, 1, ENC_BIG_ENDIAN);
+ dmp.mts_id_item = proto_tree_add_uint_format (envelope_tree, hf_envelope_mts_id_length,
+ tvb, offset, 1, envelope,
+ "MTS Identifier Length: %u",
+ dmp.mts_id_length);
field_tree = proto_item_add_subtree (dmp.mts_id_item, ett_envelope_mts_id_length);
proto_tree_add_item (field_tree, hf_envelope_mts_id_length, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
@@ -2916,9 +2948,9 @@ static gint dissect_dmp_envelope (tvbuff_t *tvb, packet_info *pinfo,
subm_time = tvb_get_ntohs (tvb, offset);
dmp.subm_time = dmp_dec_subm_time ((guint16)(subm_time & 0x7FFF),
(gint32) pinfo->fd->abs_ts.secs);
- tf = proto_tree_add_uint_format_value(envelope_tree, hf_envelope_subm_time, tvb,
+ tf = proto_tree_add_uint_format (envelope_tree, hf_envelope_subm_time, tvb,
offset, 2, subm_time,
- "%s",
+ "Submission time: %s",
(subm_time & 0x7FFF) >= 0x7FF8 ?
"Reserved" :
abs_time_secs_to_ep_str (dmp.subm_time, ABSOLUTE_TIME_LOCAL, TRUE));
@@ -2967,8 +2999,9 @@ static gint dissect_dmp_envelope (tvbuff_t *tvb, packet_info *pinfo,
/* Recipient Count */
no_rec = (envelope & 0x1F);
- tf = proto_tree_add_uint(envelope_tree, hf_envelope_recipients,
- tvb, offset, 1, envelope);
+ tf = proto_tree_add_uint_format (envelope_tree, hf_envelope_recipients,
+ tvb, offset, 1, envelope,
+ "Recipient Count: %d", no_rec);
field_tree = proto_item_add_subtree (tf, ett_envelope_recipients);
proto_tree_add_item (field_tree, hf_envelope_recipients, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -2978,9 +3011,9 @@ static gint dissect_dmp_envelope (tvbuff_t *tvb, packet_info *pinfo,
/* Extended Recipient Count */
value16 = tvb_get_ntohs (tvb, offset);
no_rec = value16 & 0x7FFF;
- tf = proto_tree_add_uint_format_value(envelope_tree,hf_envelope_ext_recipients,
+ tf = proto_tree_add_uint_format (envelope_tree,hf_envelope_ext_recipients,
tvb, offset, 2, value16,
- "%d%s", no_rec,
+ "Extended Recipient Count: %d%s", no_rec,
(no_rec < 32 ?
" (incorrect, reserved value)" : ""));
@@ -3089,16 +3122,21 @@ static gint dissect_dmp_message (tvbuff_t *tvb, packet_info *pinfo,
eit = (message & 0xE0) >> 5;
compr_alg = (message & 0x18) >> 3;
/* Encoded Information Type */
- tf = proto_tree_add_item (message_tree, hf_message_eit,
- tvb, offset, 1, ENC_BIG_ENDIAN);
+ tf = proto_tree_add_uint_format (message_tree, hf_message_eit,
+ tvb, offset, 1, message, "EIT: %s (%d)",
+ val_to_str_const (eit, eit_vals, "Unknown"),
+ eit);
field_tree = proto_item_add_subtree (tf, ett_message_eit);
proto_tree_add_item (field_tree, hf_message_eit, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_item_append_text (en, ", Type: %s",
val_to_str_const (eit, eit_vals, "Unknown"));
/* Compression Algorithm */
- tf = proto_tree_add_item (message_tree, hf_message_compr,
- tvb, offset, 1,ENC_BIG_ENDIAN);
+ tf = proto_tree_add_uint_format (message_tree, hf_message_compr,
+ tvb, offset, 1, message,
+ "Compression Algorithm: %s (%d)",
+ val_to_str_const (compr_alg, compression_vals, "Unknown"),
+ compr_alg);
field_tree = proto_item_add_subtree (tf, ett_message_compr);
tr = proto_tree_add_item (field_tree, hf_message_compr, tvb, offset, 1, ENC_BIG_ENDIAN);
if (compr_alg == ALGORITHM_ZLIB) {
@@ -3109,8 +3147,9 @@ static gint dissect_dmp_message (tvbuff_t *tvb, packet_info *pinfo,
if (message & 0x07) {
/* Reserved */
- tf = proto_tree_add_item(message_tree, hf_reserved_0x07,
- tvb, offset, 1, ENC_BIG_ENDIAN);
+ tf = proto_tree_add_uint_format (message_tree, hf_reserved_0x07,
+ tvb, offset, 1, message,
+ "Reserved: %d", message & 0x07);
field_tree = proto_item_add_subtree (tf, ett_message_body_reserved);
tf = proto_tree_add_item (field_tree, hf_reserved_0x07, tvb, offset, 1, ENC_BIG_ENDIAN);
expert_add_info(pinfo, tf, &ei_reserved_value);
@@ -3230,8 +3269,9 @@ static gint dissect_dmp_report (tvbuff_t *tvb, packet_info *pinfo,
if (report & 0x1F) {
/* Reserved */
- tf = proto_tree_add_item(report_tree, hf_reserved_0x1F,
- tvb, offset, 1, ENC_BIG_ENDIAN);
+ tf = proto_tree_add_uint_format (report_tree, hf_reserved_0x1F,
+ tvb, offset, 1, report,
+ "Reserved: %d", report & 0x1F);
field_tree = proto_item_add_subtree (tf, ett_report_reserved);
tf = proto_tree_add_item (field_tree, hf_reserved_0x1F, tvb, offset, 1, ENC_BIG_ENDIAN);
expert_add_info(pinfo, tf, &ei_reserved_value);
@@ -3584,8 +3624,9 @@ static gint dissect_dmp_content (tvbuff_t *tvb, packet_info *pinfo,
if ((message & 0x20) >> 5) {
/* Reserved */
- tf = proto_tree_add_item(message_tree, hf_reserved_0x20,
- tvb, offset, 1, ENC_BIG_ENDIAN);
+ tf = proto_tree_add_uint_format (message_tree, hf_reserved_0x20,
+ tvb, offset, 1, message,
+ "Reserved: %d", (message & 0x20)>>5);
field_tree = proto_item_add_subtree (tf, ett_message_reserved);
tf = proto_tree_add_item (field_tree, hf_reserved_0x20, tvb, offset, 1, ENC_BIG_ENDIAN);
expert_add_info(pinfo, tf, &ei_reserved_value);
@@ -3593,16 +3634,20 @@ static gint dissect_dmp_content (tvbuff_t *tvb, packet_info *pinfo,
/* Precedence */
dmp.prec = (message & 0x1C) >> 2;
- tf = proto_tree_add_item(message_tree, hf_message_precedence,
- tvb, offset, 1,ENC_BIG_ENDIAN);
+ tf = proto_tree_add_uint_format (message_tree, hf_message_precedence,
+ tvb, offset, 1, message,
+ "Precedence: %s (%d)",
+ val_to_str_const (dmp.prec, precedence, ""),
+ dmp.prec);
field_tree = proto_item_add_subtree (tf, ett_message_precedence);
proto_tree_add_item (field_tree, hf_message_precedence, tvb, offset, 1, ENC_BIG_ENDIAN);
} else {
if ((message & 0xE0) >> 5) {
/* Reserved */
- tf = proto_tree_add_item(message_tree, hf_reserved_0xE0,
- tvb, offset, 1, ENC_BIG_ENDIAN);
+ tf = proto_tree_add_uint_format (message_tree, hf_reserved_0xE0,
+ tvb, offset, 1, message,
+ "Reserved: %d", (message & 0xE0)>>5);
field_tree = proto_item_add_subtree (tf, ett_message_reserved);
tf = proto_tree_add_item (field_tree, hf_reserved_0xE0, tvb, offset, 1, ENC_BIG_ENDIAN);
expert_add_info(pinfo, tf, &ei_reserved_value);
@@ -3610,8 +3655,11 @@ static gint dissect_dmp_content (tvbuff_t *tvb, packet_info *pinfo,
/* Importance */
dmp.prec = (message & 0x1C) >> 2;
- tf = proto_tree_add_item(message_tree, hf_message_importance,
- tvb, offset, 1, ENC_BIG_ENDIAN);
+ tf = proto_tree_add_uint_format (message_tree, hf_message_importance,
+ tvb, offset, 1, message,
+ "Importance: %s (%d)",
+ val_to_str_const (dmp.prec, importance, ""),
+ dmp.prec);
field_tree = proto_item_add_subtree (tf, ett_message_importance);
proto_tree_add_item (field_tree, hf_message_importance, tvb, offset, 1, ENC_BIG_ENDIAN);
}
@@ -3646,14 +3694,14 @@ static gint dissect_dmp_content (tvbuff_t *tvb, packet_info *pinfo,
class_name = val_to_str_const (dmp_sec_class, sec_class, "");
}
if (class_name && class_name[0]) {
- tf = proto_tree_add_uint_format_value(message_tree, hf_message_sec_class_val,
+ tf = proto_tree_add_uint_format (message_tree, hf_message_sec_class_val,
tvb, offset, 1, message,
- "%s (%d)",
+ "Security Classification: %s (%d)",
class_name, dmp_sec_class);
} else {
- tf = proto_tree_add_uint_format_value(message_tree, hf_message_sec_class_val,
+ tf = proto_tree_add_uint_format (message_tree, hf_message_sec_class_val,
tvb, offset, 1, message,
- "%d",
+ "Security Classification: %d",
dmp_sec_class);
}
field_tree = proto_item_add_subtree (tf, ett_message_sec_class);
@@ -3698,8 +3746,9 @@ static gint dissect_dmp_content (tvbuff_t *tvb, packet_info *pinfo,
proto_tree_add_item (field_tree, hf_notif_type, tvb, offset, 1, ENC_BIG_ENDIAN);
} else if (message & 0x02) {
/* Reserved */
- tf = proto_tree_add_item(message_tree, hf_reserved_0x02,
- tvb, offset, 1, ENC_BIG_ENDIAN);
+ tf = proto_tree_add_uint_format (message_tree, hf_reserved_0x02,
+ tvb, offset, 1, message,
+ "Reserved: %d", message & 0x02);
field_tree = proto_item_add_subtree (tf, ett_message_reserved);
tf = proto_tree_add_item (field_tree, hf_reserved_0x02, tvb, offset, 1, ENC_BIG_ENDIAN);
expert_add_info(pinfo, tf, &ei_reserved_value);
@@ -3719,9 +3768,9 @@ static gint dissect_dmp_content (tvbuff_t *tvb, packet_info *pinfo,
/* Mission Policy Identifier */
message = tvb_get_guint8 (tvb, offset);
if (message == 0xFF) {
- proto_tree_add_uint_format_value(message_tree, hf_message_mission_policy_id,
- tvb, offset, 1, message,
- "Reserved (0xFF)");
+ proto_tree_add_uint_format_value (message_tree, hf_message_mission_policy_id,
+ tvb, offset, 1, message,
+ "Reserved (0xFF)");
} else {
proto_tree_add_item (message_tree, hf_message_mission_policy_id, tvb, offset, 1, ENC_BIG_ENDIAN);
}
diff --git a/epan/dissectors/packet-p_mul.c b/epan/dissectors/packet-p_mul.c
index 3b73b2c8ed..196e267137 100644
--- a/epan/dissectors/packet-p_mul.c
+++ b/epan/dissectors/packet-p_mul.c
@@ -842,8 +842,8 @@ static void dissect_p_mul (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += 1;
/* MAP / PDU_Type */
- en = proto_tree_add_uint_format_value(p_mul_tree, hf_pdu_type, tvb, offset, 1,
- pdu_type, "%s (0x%02x)",
+ en = proto_tree_add_uint_format (p_mul_tree, hf_pdu_type, tvb, offset, 1,
+ pdu_type, "PDU Type: %s (0x%02x)",
get_type (pdu_type), pdu_type);
field_tree = proto_item_add_subtree (en, ett_pdu_type);