aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2013-09-16 10:39:06 +0000
committerMichael Mann <mmann78@netscape.net>2013-09-16 10:39:06 +0000
commit346f803d42ac477109e02df2578eb8c86ccf4c4f (patch)
tree4277e1e48aeb6d492ceb835af645460070fb04ec /epan/dissectors
parent58e4750ecbf593fb678c713da398979b7fb2ed5d (diff)
Convert proto_tree_add_uint_format to proto_tree_add_uint_format_value if hf_ field name is the first part of the formatted string. This was all manual inspection and most cases were either:
1. Case sensitivity differences between hf_ field name and formatted string. 2. Unnecessary whitespace between hf_ field name and colon in formatted string There are cases where the hf_ field name doesn't quite match the proto_tree_add_uint_format, but it's close enough that one of them should be "right", I'm just not sure which is, I just know the string in proto_tree_add_uint_format is the one displayed. svn path=/trunk/; revision=52098
Diffstat (limited to 'epan/dissectors')
-rw-r--r--epan/dissectors/packet-ayiya.c4
-rw-r--r--epan/dissectors/packet-cisco-sm.c19
-rw-r--r--epan/dissectors/packet-clnp.c12
-rw-r--r--epan/dissectors/packet-dhcpv6.c4
-rw-r--r--epan/dissectors/packet-dua.c8
-rw-r--r--epan/dissectors/packet-e212.c18
-rw-r--r--epan/dissectors/packet-erf.c6
-rw-r--r--epan/dissectors/packet-esis.c8
-rw-r--r--epan/dissectors/packet-fc.c28
-rw-r--r--epan/dissectors/packet-gsm_a_dtap.c4
-rw-r--r--epan/dissectors/packet-gsm_a_gm.c4
-rw-r--r--epan/dissectors/packet-gsmtap.c4
-rw-r--r--epan/dissectors/packet-gtpv2.c4
-rw-r--r--epan/dissectors/packet-hip.c5
-rw-r--r--epan/dissectors/packet-hsrp.c10
-rw-r--r--epan/dissectors/packet-iapp.c6
-rw-r--r--epan/dissectors/packet-ieee80211-radiotap.c12
-rw-r--r--epan/dissectors/packet-igap.c8
-rw-r--r--epan/dissectors/packet-igmp.c8
-rw-r--r--epan/dissectors/packet-ip.c27
-rw-r--r--epan/dissectors/packet-ipmi-app.c4
-rw-r--r--epan/dissectors/packet-ipmi-picmg.c4
-rw-r--r--epan/dissectors/packet-ipmi.c12
-rw-r--r--epan/dissectors/packet-ipv6.c4
-rw-r--r--epan/dissectors/packet-ipx.c10
-rw-r--r--epan/dissectors/packet-isakmp.c16
-rw-r--r--epan/dissectors/packet-isup.c17
-rw-r--r--epan/dissectors/packet-iua.c8
-rw-r--r--epan/dissectors/packet-juniper.c4
-rw-r--r--epan/dissectors/packet-lapb.c11
-rw-r--r--epan/dissectors/packet-ldp.c36
-rw-r--r--epan/dissectors/packet-m2tp.c4
-rw-r--r--epan/dissectors/packet-m2ua.c4
-rw-r--r--epan/dissectors/packet-m3ua.c16
-rw-r--r--epan/dissectors/packet-mpls-echo.c12
-rw-r--r--epan/dissectors/packet-msdp.c8
-rw-r--r--epan/dissectors/packet-nas_eps.c54
-rw-r--r--epan/dissectors/packet-nettl.c28
-rw-r--r--epan/dissectors/packet-nfs.c80
-rw-r--r--epan/dissectors/packet-nhrp.c36
-rw-r--r--epan/dissectors/packet-nsip.c35
-rw-r--r--epan/dissectors/packet-nt-tpcp.c11
-rw-r--r--epan/dissectors/packet-ntp.c12
-rw-r--r--epan/dissectors/packet-quake2.c6
-rw-r--r--epan/dissectors/packet-quake3.c6
-rw-r--r--epan/dissectors/packet-quakeworld.c6
-rw-r--r--epan/dissectors/packet-rtcp.c4
-rw-r--r--epan/dissectors/packet-rtp.c21
-rw-r--r--epan/dissectors/packet-simulcrypt.c4
-rw-r--r--epan/dissectors/packet-slsk.c10
-rw-r--r--epan/dissectors/packet-spp.c12
-rw-r--r--epan/dissectors/packet-sua.c6
-rw-r--r--epan/dissectors/packet-tcp.c16
-rw-r--r--epan/dissectors/packet-udp.c44
-rw-r--r--epan/dissectors/packet-v52.c15
-rw-r--r--epan/dissectors/packet-v5dl.c8
-rw-r--r--epan/dissectors/packet-v5ua.c32
-rw-r--r--epan/dissectors/packet-x11.c5
-rw-r--r--epan/dissectors/packet-xmcp.c9
-rw-r--r--epan/dissectors/packet-zep.c8
60 files changed, 374 insertions, 463 deletions
diff --git a/epan/dissectors/packet-ayiya.c b/epan/dissectors/packet-ayiya.c
index 74e44c3f43..aa179d628f 100644
--- a/epan/dissectors/packet-ayiya.c
+++ b/epan/dissectors/packet-ayiya.c
@@ -119,9 +119,9 @@ dissect_ayiya(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_bits_item(ayiya_tree, hf_hash_method, tvb, 12, 4, ENC_BIG_ENDIAN);
proto_tree_add_bits_item(ayiya_tree, hf_auth_method, tvb, 16, 4, ENC_BIG_ENDIAN);
proto_tree_add_bits_item(ayiya_tree, hf_opcode, tvb, 20, 4, ENC_BIG_ENDIAN);
- proto_tree_add_uint_format(ayiya_tree, hf_next_header, tvb,
+ proto_tree_add_uint_format_value(ayiya_tree, hf_next_header, tvb,
3, 1, next_header,
- "Next header: %s (0x%02x)",
+ "%s (0x%02x)",
ipprotostr(next_header), next_header);
tv.secs = tvb_get_ntohl(tvb, 4);
tv.nsecs = 0;
diff --git a/epan/dissectors/packet-cisco-sm.c b/epan/dissectors/packet-cisco-sm.c
index 6f8fec590a..5575eb9dc5 100644
--- a/epan/dissectors/packet-cisco-sm.c
+++ b/epan/dissectors/packet-cisco-sm.c
@@ -293,8 +293,8 @@ dissect_sm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ti = proto_tree_add_item(tree, proto_sm, tvb, offset, 0, ENC_NA);
sm_tree = proto_item_add_subtree(ti, ett_sm);
- proto_tree_add_uint_format(sm_tree, hf_sm_sm_msg_type, tvb, offset, 4, sm_message_type,
- "SM Message type: %s (0x%0x)", val_to_str_const(sm_message_type, sm_message_type_value, "reserved"), sm_message_type);
+ proto_tree_add_uint_format_value(sm_tree, hf_sm_sm_msg_type, tvb, offset, 4, sm_message_type,
+ "%s (0x%0x)", val_to_str_const(sm_message_type, sm_message_type_value, "reserved"), sm_message_type);
offset = offset + 4;
if (sm_message_type == MESSAGE_TYPE_PDU) {
@@ -310,8 +310,8 @@ dissect_sm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(sm_tree, hf_sm_msg_id, tvb, offset, 2, ENC_BIG_ENDIAN);
offset = offset +2;
msg_type = tvb_get_ntohs(tvb,offset);
- proto_tree_add_uint_format(sm_tree, hf_sm_msg_type, tvb, offset, 2, msg_type,
- "Message type: %s (0x%0x)", val_to_str_const(msg_type, sm_pdu_type_value, "reserved"),
+ proto_tree_add_uint_format_value(sm_tree, hf_sm_msg_type, tvb, offset, 2, msg_type,
+ "%s (0x%0x)", val_to_str_const(msg_type, sm_pdu_type_value, "reserved"),
msg_type);
msg_type = tvb_get_ntohs(tvb,offset);
offset = offset + 2;
@@ -426,8 +426,8 @@ dissect_sm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(sm_tree, hf_sm_msg_id, tvb, offset, 2, ENC_BIG_ENDIAN);
offset = offset +2;
msg_type = tvb_get_ntohs(tvb,offset);
- proto_tree_add_uint_format(sm_tree, hf_sm_msg_type, tvb, offset, 2, msg_type,
- "Message type: %s (0x%0x)", val_to_str_const(msg_type, sm_pdu_type_value, "reserved"),
+ proto_tree_add_uint_format_value(sm_tree, hf_sm_msg_type, tvb, offset, 2, msg_type,
+ "%s (0x%0x)", val_to_str_const(msg_type, sm_pdu_type_value, "reserved"),
msg_type);
msg_type = tvb_get_ntohs(tvb,offset);
offset = offset + 2;
@@ -462,8 +462,7 @@ dissect_sm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (msg_type == PDU_RETRIEVAL_CONFIRM && tvb_get_ntohl(tvb,offset) == 0x01) {
offset += 4;
bsn_num = tvb_get_ntohl(tvb,offset);
- proto_tree_add_uint_format(sm_tree, hf_sm_bsn_num, tvb, offset, 4,
- bsn_num, "BSN: %d", bsn_num);
+ proto_tree_add_item(sm_tree, hf_sm_bsn_num, tvb, offset, 4, ENC_BIG_ENDIAN);
}
break;
case PDU_LSC_REQUEST:
@@ -593,8 +592,8 @@ proto_register_sm(void)
NULL, HFILL }
},
{ &hf_sm_bsn_num,
- { "BSN Number","sm.bsn_num",
- FT_UINT32, BASE_HEX, NULL, 0x0,
+ { "BSN","sm.bsn_num",
+ FT_UINT32, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
diff --git a/epan/dissectors/packet-clnp.c b/epan/dissectors/packet-clnp.c
index 5fefc60725..4497c41545 100644
--- a/epan/dissectors/packet-clnp.c
+++ b/epan/dissectors/packet-clnp.c
@@ -332,10 +332,8 @@ dissect_clnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* No checksum present, or not enough of the header present to
* checksum it.
*/
- proto_tree_add_uint_format(clnp_tree, hf_clnp_checksum, tvb,
+ proto_tree_add_uint(clnp_tree, hf_clnp_checksum, tvb,
P_CLNP_CKSUM, 2,
- cnf_cksum,
- "Checksum : 0x%04x",
cnf_cksum);
break;
@@ -343,10 +341,10 @@ dissect_clnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/*
* Checksum is correct.
*/
- proto_tree_add_uint_format(clnp_tree, hf_clnp_checksum, tvb,
+ proto_tree_add_uint_format_value(clnp_tree, hf_clnp_checksum, tvb,
P_CLNP_CKSUM, 2,
cnf_cksum,
- "Checksum : 0x%04x (correct)",
+ "0x%04x (correct)",
cnf_cksum);
break;
@@ -354,10 +352,10 @@ dissect_clnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/*
* Checksum is not correct.
*/
- proto_tree_add_uint_format(clnp_tree, hf_clnp_checksum, tvb,
+ proto_tree_add_uint_format_value(clnp_tree, hf_clnp_checksum, tvb,
P_CLNP_CKSUM, 2,
cnf_cksum,
- "Checksum : 0x%04x (incorrect)",
+ "0x%04x (incorrect)",
cnf_cksum);
break;
}
diff --git a/epan/dissectors/packet-dhcpv6.c b/epan/dissectors/packet-dhcpv6.c
index e1e074bc73..e1d61e895b 100644
--- a/epan/dissectors/packet-dhcpv6.c
+++ b/epan/dissectors/packet-dhcpv6.c
@@ -1648,8 +1648,8 @@ dhcpv6_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree,
}
temp_optlen = tvb_get_ntohs(tvb, off);
- proto_tree_add_uint_format(subtree, hf_elapsed_time, tvb, off,
- 2, temp_optlen*10, "Elapsed-time: %u ms", temp_optlen*10);
+ proto_tree_add_uint_format_value(subtree, hf_elapsed_time, tvb, off,
+ 2, temp_optlen*10, "%u ms", temp_optlen*10);
break;
case OPTION_RELAY_MSG:
if (optlen == 0) {
diff --git a/epan/dissectors/packet-dua.c b/epan/dissectors/packet-dua.c
index f4975ca4f7..bd791754fe 100644
--- a/epan/dissectors/packet-dua.c
+++ b/epan/dissectors/packet-dua.c
@@ -310,8 +310,8 @@ dissect_status_type_identification_parameter(tvbuff_t *parameter_tvb, proto_tree
proto_tree_add_item(parameter_tree, hf_status_type,
parameter_tvb, STATUS_TYPE_OFFSET, STATUS_TYPE_LENGTH, ENC_BIG_ENDIAN);
- proto_tree_add_uint_format(parameter_tree, hf_status_id, parameter_tvb, STATUS_IDENT_OFFSET, STATUS_IDENT_LENGTH,
- status_id, "Status identification: %u (%s)", status_id,
+ proto_tree_add_uint_format_value(parameter_tree, hf_status_id, parameter_tvb, STATUS_IDENT_OFFSET, STATUS_IDENT_LENGTH,
+ status_id, "%u (%s)", status_id,
val_to_str_const(status_type * 256 * 256 + status_id, status_type_id_values, "unknown"));
proto_item_append_text(parameter_item, " (%s)",
@@ -694,9 +694,9 @@ dissect_common_header(tvbuff_t *common_header_tvb, packet_info *pinfo, proto_tre
proto_tree_add_item(dua_tree, hf_reserved, common_header_tvb, RESERVED_OFFSET, RESERVED_LENGTH, ENC_BIG_ENDIAN);
proto_tree_add_item(dua_tree, hf_message_class,
common_header_tvb, MESSAGE_CLASS_OFFSET, MESSAGE_CLASS_LENGTH, ENC_BIG_ENDIAN);
- proto_tree_add_uint_format(dua_tree, hf_message_type,
+ proto_tree_add_uint_format_value(dua_tree, hf_message_type,
common_header_tvb, MESSAGE_TYPE_OFFSET, MESSAGE_TYPE_LENGTH,
- message_type, "Message type: %u (%s)",
+ message_type, "%u (%s)",
message_type, val_to_str_const(message_class * 256 + message_type,
message_class_type_values,
"reserved"));
diff --git a/epan/dissectors/packet-e212.c b/epan/dissectors/packet-e212.c
index e9401f49ef..1632131f50 100644
--- a/epan/dissectors/packet-e212.c
+++ b/epan/dissectors/packet-e212.c
@@ -2545,8 +2545,8 @@ dissect_e212_mcc_mnc_packet_str(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
expert_add_info(pinfo, item, &ei_E212_mcc_non_decimal);
if (long_mnc) {
- item = proto_tree_add_uint_format(tree, hf_E212_mnc , tvb, start_offset + 1, 2, mnc,
- "Mobile Network Code (MNC): %s (%03u)",
+ item = proto_tree_add_uint_format_value(tree, hf_E212_mnc , tvb, start_offset + 1, 2, mnc,
+ "%s (%03u)",
val_to_str_ext_const(mcc * 1000 + mnc, &mcc_mnc_codes_ext, "Unknown"),
mnc);
/* Prepare a string with the MCC and MNC including the country and Operator if
@@ -2558,8 +2558,8 @@ dissect_e212_mcc_mnc_packet_str(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
mnc,
val_to_str_ext_const(mcc * 1000 + mnc, &mcc_mnc_codes_ext, ""));
} else {
- item = proto_tree_add_uint_format(tree, hf_E212_mnc , tvb, start_offset + 1, 2, mnc,
- "Mobile Network Code (MNC): %s (%02u)",
+ item = proto_tree_add_uint_format_value(tree, hf_E212_mnc , tvb, start_offset + 1, 2, mnc,
+ "%s (%02u)",
val_to_str_ext_const(mcc * 1000 + 10 * mnc, &mcc_mnc_codes_ext, "Unknown"),
mnc);
/* Prepare a string with the MCC and MNC including the country and Operator if
@@ -2668,13 +2668,13 @@ dissect_e212_mcc_mnc_in_address(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
expert_add_info(pinfo, item, &ei_E212_mcc_non_decimal);
if (long_mnc)
- item = proto_tree_add_uint_format(tree, hf_E212_mnc , tvb, start_offset + 1, 2, mnc,
- "Mobile Network Code (MNC): %s (%03u)",
+ item = proto_tree_add_uint_format_value(tree, hf_E212_mnc , tvb, start_offset + 1, 2, mnc,
+ "%s (%03u)",
val_to_str_ext_const(mcc * 1000 + mnc, &mcc_mnc_codes_ext, "Unknown"),
mnc);
else
- item = proto_tree_add_uint_format(tree, hf_E212_mnc , tvb, start_offset + 1, 2, mnc,
- "Mobile Network Code (MNC): %s (%02u)",
+ item = proto_tree_add_uint_format_value(tree, hf_E212_mnc , tvb, start_offset + 1, 2, mnc,
+ "%s (%02u)",
val_to_str_ext_const(mcc * 1000 + 10 * mnc, &mcc_mnc_codes_ext, "Unknown"),
mnc);
@@ -2707,7 +2707,7 @@ proto_register_e212(void)
"Mobile Country Code MCC", HFILL }
},
{ &hf_E212_mnc,
- { "Mobile network code (MNC)","e212.mnc",
+ { "Mobile Network Code (MNC)","e212.mnc",
FT_UINT16, BASE_DEC, NULL, 0x0,
"Mobile network code", HFILL }
},
diff --git a/epan/dissectors/packet-erf.c b/epan/dissectors/packet-erf.c
index 4ba744d4c3..286124ce78 100644
--- a/epan/dissectors/packet-erf.c
+++ b/epan/dissectors/packet-erf.c
@@ -1067,8 +1067,8 @@ dissect_erf_pseudo_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_uint64(tree, hf_erf_ts, tvb, 0, 0, pinfo->pseudo_header->erf.phdr.ts);
- rectype_item = proto_tree_add_uint_format(tree, hf_erf_rectype, tvb, 0, 0, pinfo->pseudo_header->erf.phdr.type,
- "Record type: 0x%02x (Type %d: %s)",
+ rectype_item = proto_tree_add_uint_format_value(tree, hf_erf_rectype, tvb, 0, 0, pinfo->pseudo_header->erf.phdr.type,
+ "0x%02x (Type %d: %s)",
pinfo->pseudo_header->erf.phdr.type,
pinfo->pseudo_header->erf.phdr.type & ERF_HDR_TYPE_MASK,
val_to_str_const(pinfo->pseudo_header->erf.phdr.type & ERF_HDR_TYPE_MASK,
@@ -1513,7 +1513,7 @@ proto_register_erf(void)
{ "Timestamp", "erf.ts",
FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL } },
{ &hf_erf_rectype,
- { "Type", "erf.types",
+ { "Record type", "erf.types",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } },
{ &hf_erf_type,
{ "Type", "erf.types.type",
diff --git a/epan/dissectors/packet-esis.c b/epan/dissectors/packet-esis.c
index 1c3bef7c06..099ca93890 100644
--- a/epan/dissectors/packet-esis.c
+++ b/epan/dissectors/packet-esis.c
@@ -327,8 +327,8 @@ dissect_esis(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
(ehdr.esis_type&BIT_6) ? "1" : "0");
tmp_uint = pntohs( ehdr.esis_holdtime );
- proto_tree_add_uint_format(esis_tree, hf_esis_holdtime, tvb, 5, 2,
- tmp_uint, "Holding Time : %u seconds",
+ proto_tree_add_uint_format_value(esis_tree, hf_esis_holdtime, tvb, 5, 2,
+ tmp_uint, "%u seconds",
tmp_uint );
tmp_uint = pntohs( ehdr.esis_checksum );
@@ -355,8 +355,8 @@ dissect_esis(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
cksum_status = NULL;
DISSECTOR_ASSERT_NOT_REACHED();
}
- proto_tree_add_uint_format( esis_tree, hf_esis_checksum, tvb, 7, 2,
- tmp_uint, "Checksum : 0x%x ( %s )",
+ proto_tree_add_uint_format_value( esis_tree, hf_esis_checksum, tvb, 7, 2,
+ tmp_uint, "0x%x ( %s )",
tmp_uint, cksum_status );
}
diff --git a/epan/dissectors/packet-fc.c b/epan/dissectors/packet-fc.c
index fcdaf9eb63..d2fd3db82b 100644
--- a/epan/dissectors/packet-fc.c
+++ b/epan/dissectors/packet-fc.c
@@ -871,9 +871,9 @@ dissect_fc_helper (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean
case FC_RCTL_LINK_DATA:
case FC_RCTL_VIDEO:
/* the lower 4 bits of R_CTL are the information category */
- proto_tree_add_uint_format (fc_tree, hf_fc_rctl, tvb, offset,
+ proto_tree_add_uint_format_value(fc_tree, hf_fc_rctl, tvb, offset,
FC_RCTL_SIZE, fchdr.r_ctl,
- "R_CTL: 0x%x(%s/%s)",
+ "0x%x(%s/%s)",
fchdr.r_ctl,
val_to_str ((fchdr.r_ctl & 0xF0),
fc_routing_val, "0x%x"),
@@ -883,9 +883,9 @@ dissect_fc_helper (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean
case FC_RCTL_LINK_CTL:
/* the lower 4 bits of R_CTL indicate the type of link ctl frame */
- proto_tree_add_uint_format (fc_tree, hf_fc_rctl, tvb, offset,
+ proto_tree_add_uint_format_value(fc_tree, hf_fc_rctl, tvb, offset,
FC_RCTL_SIZE, fchdr.r_ctl,
- "R_CTL: 0x%x(%s/%s)",
+ "0x%x(%s/%s)",
fchdr.r_ctl,
val_to_str ((fchdr.r_ctl & 0xF0),
fc_routing_val, "0x%x"),
@@ -898,9 +898,9 @@ dissect_fc_helper (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean
case 0x00:
/* the lower 4 bits of R_CTL indicate the type of BLS frame */
- proto_tree_add_uint_format (fc_tree, hf_fc_rctl, tvb, offset,
+ proto_tree_add_uint_format_value(fc_tree, hf_fc_rctl, tvb, offset,
FC_RCTL_SIZE, fchdr.r_ctl,
- "R_CTL: 0x%x(%s/%s)",
+ "0x%x(%s/%s)",
fchdr.r_ctl,
val_to_str ((fchdr.r_ctl & 0xF0),
fc_routing_val, "0x%x"),
@@ -909,9 +909,9 @@ dissect_fc_helper (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean
break;
default:
- proto_tree_add_uint_format (fc_tree, hf_fc_rctl, tvb, offset,
+ proto_tree_add_uint_format_value(fc_tree, hf_fc_rctl, tvb, offset,
FC_RCTL_SIZE, fchdr.r_ctl,
- "R_CTL: 0x%x(%s/0x%x)",
+ "0x%x(%s/0x%x)",
fchdr.r_ctl,
val_to_str ((fchdr.r_ctl & 0xF0),
fc_routing_val, "0x%x"),
@@ -925,9 +925,9 @@ dissect_fc_helper (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean
case 0x01:
/* the lower 4 bits of R_CTL indicate the type of ELS frame */
- proto_tree_add_uint_format (fc_tree, hf_fc_rctl, tvb, offset,
+ proto_tree_add_uint_format_value(fc_tree, hf_fc_rctl, tvb, offset,
FC_RCTL_SIZE, fchdr.r_ctl,
- "R_CTL: 0x%x(%s/%s)",
+ "0x%x(%s/%s)",
fchdr.r_ctl,
val_to_str ((fchdr.r_ctl & 0xF0),
fc_routing_val, "0x%x"),
@@ -936,9 +936,9 @@ dissect_fc_helper (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean
break;
default:
- proto_tree_add_uint_format (fc_tree, hf_fc_rctl, tvb, offset,
+ proto_tree_add_uint_format_value(fc_tree, hf_fc_rctl, tvb, offset,
FC_RCTL_SIZE, fchdr.r_ctl,
- "R_CTL: 0x%x(%s/0x%x)",
+ "0x%x(%s/0x%x)",
fchdr.r_ctl,
val_to_str ((fchdr.r_ctl & 0xF0),
fc_routing_val, "0x%x"),
@@ -948,9 +948,9 @@ dissect_fc_helper (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean
break;
default:
- proto_tree_add_uint_format (fc_tree, hf_fc_rctl, tvb, offset,
+ proto_tree_add_uint_format_value(fc_tree, hf_fc_rctl, tvb, offset,
FC_RCTL_SIZE, fchdr.r_ctl,
- "R_CTL: 0x%x(%s/0x%x)",
+ "0x%x(%s/0x%x)",
fchdr.r_ctl,
val_to_str ((fchdr.r_ctl & 0xF0),
fc_routing_val, "0x%x"),
diff --git a/epan/dissectors/packet-gsm_a_dtap.c b/epan/dissectors/packet-gsm_a_dtap.c
index fef43938cf..7c6000fc23 100644
--- a/epan/dissectors/packet-gsm_a_dtap.c
+++ b/epan/dissectors/packet-gsm_a_dtap.c
@@ -3515,8 +3515,8 @@ de_ca_of_no_cli(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32
curr_offset = offset;
oct = tvb_get_guint8(tvb, curr_offset);
- proto_tree_add_uint_format(tree, hf_gsm_a_dtap_cause_of_no_cli, tvb, curr_offset, 1, oct,
- "Cause of no CLI: %s (%u)",
+ proto_tree_add_uint_format_value(tree, hf_gsm_a_dtap_cause_of_no_cli, tvb, curr_offset, 1, oct,
+ "%s (%u)",
val_to_str_const(oct, gsm_a_cause_of_no_cli_values, "Unavailable"),
oct);
diff --git a/epan/dissectors/packet-gsm_a_gm.c b/epan/dissectors/packet-gsm_a_gm.c
index 2caa05fe0b..56c1a31402 100644
--- a/epan/dissectors/packet-gsm_a_gm.c
+++ b/epan/dissectors/packet-gsm_a_gm.c
@@ -4005,8 +4005,8 @@ de_sm_pco(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, g
*/
prot = tvb_get_ntohs(tvb, curr_offset);
- pco_item = proto_tree_add_uint_format(tree, hf_gsm_a_gm_pco_pid, tvb, curr_offset, 2, (guint32)prot,
- "Protocol or Container ID: %s (0x%04x)",
+ pco_item = proto_tree_add_uint_format_value(tree, hf_gsm_a_gm_pco_pid, tvb, curr_offset, 2, (guint32)prot,
+ "%s (0x%04x)",
link_dir ?
rval_to_str((guint32)prot, gsm_a_sm_pco_net2ms_prot_vals, val_to_str_ext_const(prot, &ppp_vals_ext, "Unknown")) :
rval_to_str((guint32)prot, gsm_a_sm_pco_ms2net_prot_vals, val_to_str_ext_const(prot, &ppp_vals_ext, "Unknown")),
diff --git a/epan/dissectors/packet-gsmtap.c b/epan/dissectors/packet-gsmtap.c
index f3c9475711..b67d5d3a65 100644
--- a/epan/dissectors/packet-gsmtap.c
+++ b/epan/dissectors/packet-gsmtap.c
@@ -557,9 +557,9 @@ dissect_gsmtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
gsmtap_tree = proto_item_add_subtree(ti, ett_gsmtap);
proto_tree_add_item(gsmtap_tree, hf_gsmtap_version,
tvb, offset, 1, ENC_BIG_ENDIAN);
- proto_tree_add_uint_format(gsmtap_tree, hf_gsmtap_hdrlen,
+ proto_tree_add_uint_format_value(gsmtap_tree, hf_gsmtap_hdrlen,
tvb, offset+1, 1, hdr_len,
- "Header length: %u bytes", hdr_len);
+ "%u bytes", hdr_len);
proto_tree_add_item(gsmtap_tree, hf_gsmtap_type,
tvb, offset+2, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(gsmtap_tree, hf_gsmtap_timeslot,
diff --git a/epan/dissectors/packet-gtpv2.c b/epan/dissectors/packet-gtpv2.c
index 8ab2d1d00c..a191fd4bcc 100644
--- a/epan/dissectors/packet-gtpv2.c
+++ b/epan/dissectors/packet-gtpv2.c
@@ -4894,14 +4894,14 @@ dissect_gtpv2_mmbr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, prot
guint32 max_dl;
max_ul = tvb_get_ntohl(tvb, offset);
- proto_tree_add_uint_format(tree, hf_gtpv2_mmbr_ul, tvb, offset, 4, max_ul, "Max MBR/APN-AMBR for uplink : %u %s",
+ proto_tree_add_uint_format_value(tree, hf_gtpv2_mmbr_ul, tvb, offset, 4, max_ul, "%u %s",
(max_ul) > 1000 ? max_ul/1000 : max_ul,
(max_ul) > 1000 ? "Mbps" : "kbps");
offset += 4;
max_dl = tvb_get_ntohl(tvb, offset);
- proto_tree_add_uint_format(tree, hf_gtpv2_mmbr_dl, tvb, offset, 4, max_dl, "Max MBR/APN-AMBR for downlink : %u %s",
+ proto_tree_add_uint_format_value(tree, hf_gtpv2_mmbr_dl, tvb, offset, 4, max_dl, "%u %s",
(max_dl) > 1000 ? max_dl/1000 : max_dl,
(max_dl) > 1000 ? "Mbps" : "kbps");
}
diff --git a/epan/dissectors/packet-hip.c b/epan/dissectors/packet-hip.c
index 3bdc472805..33088cf2c2 100644
--- a/epan/dissectors/packet-hip.c
+++ b/epan/dissectors/packet-hip.c
@@ -515,10 +515,9 @@ dissect_hip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
"0x%04x (correct)",
checksum_h);
} else {
- proto_tree_add_uint_format(hip_tree, hf_hip_checksum, tvb,
+ proto_tree_add_uint_format_value(hip_tree, hf_hip_checksum, tvb,
offset+4, 2, checksum_h,
- "Checksum: 0x%04x (incorrect, "
- "should be 0x%04x)",
+ "0x%04x (incorrect, should be 0x%04x)",
checksum_h,
in_cksum_shouldbe(checksum_h,
computed_checksum));
diff --git a/epan/dissectors/packet-hsrp.c b/epan/dissectors/packet-hsrp.c
index 6af4e30a17..8b2d6e3d3b 100644
--- a/epan/dissectors/packet-hsrp.c
+++ b/epan/dissectors/packet-hsrp.c
@@ -172,7 +172,7 @@ static gint hf_hsrp2_state = -1;
static gint hf_hsrp2_group_state_tlv = -1;
static gint hf_hsrp2_interface_state_tlv = -1;
static gint hf_hsrp2_text_auth_tlv = -1;
-/* static gint hf_hsrp2_md5_auth_tlv = -1; */
+static gint hf_hsrp2_md5_auth_tlv = -1;
static gint hf_hsrp2_ipversion = -1;
static gint hf_hsrp2_hellotime = -1;
static gint hf_hsrp2_holdtime = -1;
@@ -553,12 +553,12 @@ dissect_hsrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
/* offset += 8; */
}
} else if (type == 4 && len == 28) {
- /* Text Authentication TLV */
+ /* MD5 Authentication TLV */
if (tree) {
proto_tree *md5_auth_tlv;
- ti = proto_tree_add_uint_format(hsrp_tree, hf_hsrp2_text_auth_tlv, tvb, offset, 1, type,
- "MD5 Authentication TLV: Type=%d Len=%d", type, len);
+ ti = proto_tree_add_uint_format_value(hsrp_tree, hf_hsrp2_md5_auth_tlv, tvb, offset, 1, type,
+ "Type=%d Len=%d", type, len);
offset+=2;
/* Making MD5 Authentication TLV subtree */
@@ -709,12 +709,10 @@ void proto_register_hsrp(void)
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL }},
-#if 0
{ &hf_hsrp2_md5_auth_tlv,
{ "MD5 Authentication TLV", "hsrp2.md5_auth_tlv",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL }},
-#endif
{ &hf_hsrp2_ipversion,
{ "IP Ver.", "hsrp2.ipversion",
diff --git a/epan/dissectors/packet-iapp.c b/epan/dissectors/packet-iapp.c
index 660edded1b..1330bf5452 100644
--- a/epan/dissectors/packet-iapp.c
+++ b/epan/dissectors/packet-iapp.c
@@ -427,8 +427,8 @@ dissect_iapp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_uint(iapp_tree, hf_iapp_version, tvb, 0, 1,
ih.ia_version);
- proto_tree_add_uint_format(iapp_tree, hf_iapp_type, tvb, 1, 1,
- ih.ia_type, "Type: %s(%d)", codestrval, ia_type);
+ proto_tree_add_uint_format_value(iapp_tree, hf_iapp_type, tvb, 1, 1,
+ ih.ia_type, "%s(%d)", codestrval, ia_type);
pdutf = proto_tree_add_text(iapp_tree, tvb, 2, -1,
"Protocol data units");
@@ -459,7 +459,7 @@ proto_register_iapp(void)
{ "Version", "iapp.version", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }
},
{ &hf_iapp_type,
- { "type", "iapp.type", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }
+ { "Type", "iapp.type", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }
},
};
diff --git a/epan/dissectors/packet-ieee80211-radiotap.c b/epan/dissectors/packet-ieee80211-radiotap.c
index 96a221a928..ce7eb1306b 100644
--- a/epan/dissectors/packet-ieee80211-radiotap.c
+++ b/epan/dissectors/packet-ieee80211-radiotap.c
@@ -1475,10 +1475,10 @@ dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
db = tvb_get_guint8(tvb, offset);
col_add_fstr(pinfo->cinfo, COL_RSSI, "%u dB", db);
if (tree) {
- proto_tree_add_uint_format(radiotap_tree,
+ proto_tree_add_uint_format_value(radiotap_tree,
hf_radiotap_db_antsignal,
tvb, offset, 1, db,
- "SSI Signal: %u dB",
+ "%u dB",
db);
}
break;
@@ -1486,10 +1486,10 @@ dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
case IEEE80211_RADIOTAP_DB_ANTNOISE:
db = tvb_get_guint8(tvb, offset);
if (tree) {
- proto_tree_add_uint_format(radiotap_tree,
+ proto_tree_add_uint_format_value(radiotap_tree,
hf_radiotap_db_antnoise,
tvb, offset, 1, db,
- "SSI Noise: %u dB",
+ "%u dB",
db);
}
break;
@@ -2400,7 +2400,7 @@ void proto_register_radiotap(void)
" arbitrary value in decibels from one milliwatt", HFILL}},
{&hf_radiotap_db_antsignal,
- {"SSI Signal (dB)", "radiotap.db_antsignal",
+ {"SSI Signal", "radiotap.db_antsignal",
FT_UINT32, BASE_DEC, NULL, 0x0,
"RF signal power at the antenna from a fixed, arbitrary value in decibels", HFILL}},
@@ -2411,7 +2411,7 @@ void proto_register_radiotap(void)
" in decibels per one milliwatt", HFILL}},
{&hf_radiotap_db_antnoise,
- {"SSI Noise (dB)", "radiotap.db_antnoise",
+ {"SSI Noise", "radiotap.db_antnoise",
FT_UINT32, BASE_DEC, NULL, 0x0,
"RF noise power at the antenna from a fixed, arbitrary value"
" in decibels", HFILL}},
diff --git a/epan/dissectors/packet-igap.c b/epan/dissectors/packet-igap.c
index a83c62765e..13ff8e1c7d 100644
--- a/epan/dissectors/packet-igap.c
+++ b/epan/dissectors/packet-igap.c
@@ -154,8 +154,8 @@ dissect_igap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int off
offset += 1;
tsecs = tvb_get_guint8(tvb, offset);
- proto_tree_add_uint_format(tree, hf_max_resp, tvb, offset, 1, tsecs,
- "Max Response Time: %.1f sec (0x%02x)", tsecs * 0.1, tsecs);
+ proto_tree_add_uint_format_value(tree, hf_max_resp, tvb, offset, 1, tsecs,
+ "%.1f sec (0x%02x)", tsecs * 0.1, tsecs);
offset += 1;
igmp_checksum(tree, tvb, hf_checksum, hf_checksum_bad, pinfo, 0);
@@ -260,8 +260,8 @@ proto_register_igap(void)
},
{ &hf_max_resp,
- { "Max Resp Time", "igap.max_resp", FT_UINT8, BASE_DEC,
- NULL, 0, "Max Response Time", HFILL }
+ { "Max Response Time", "igap.max_resp", FT_UINT8, BASE_DEC,
+ NULL, 0, NULL, HFILL }
},
{ &hf_checksum,
diff --git a/epan/dissectors/packet-igmp.c b/epan/dissectors/packet-igmp.c
index 9506a6ca4b..2e9f3634bd 100644
--- a/epan/dissectors/packet-igmp.c
+++ b/epan/dissectors/packet-igmp.c
@@ -409,8 +409,8 @@ dissect_v3_max_resp(tvbuff_t *tvb, proto_tree *parent_tree, int offset)
tsecs = bits;
}
- item = proto_tree_add_uint_format(parent_tree, hf_max_resp, tvb,
- offset, 1, tsecs, "Max Response Time: %.1f sec (0x%02x)",tsecs*0.1,bits);
+ item = proto_tree_add_uint_format_value(parent_tree, hf_max_resp, tvb,
+ offset, 1, tsecs, "%.1f sec (0x%02x)",tsecs*0.1,bits);
if (bits&0x80) {
tree = proto_item_add_subtree(item, ett_max_resp);
@@ -662,8 +662,8 @@ dissect_igmp_v2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int type, i
/* max resp time */
tsecs = tvb_get_guint8(tvb, offset);
- proto_tree_add_uint_format(tree, hf_max_resp, tvb,
- offset, 1, tsecs, "Max Response Time: %.1f sec (0x%02x)", tsecs*0.1,tsecs);
+ proto_tree_add_uint_format_value(tree, hf_max_resp, tvb,
+ offset, 1, tsecs, "%.1f sec (0x%02x)", tsecs*0.1,tsecs);
offset += 1;
/* checksum */
diff --git a/epan/dissectors/packet-ip.c b/epan/dissectors/packet-ip.c
index 280e1af39b..9f3d5407d5 100644
--- a/epan/dissectors/packet-ip.c
+++ b/epan/dissectors/packet-ip.c
@@ -1978,16 +1978,15 @@ dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
"Bogus IP header length (%u, must be at least %u)",
hlen, IPH_MIN_LEN);
if (tree) {
- proto_tree_add_uint_format(ip_tree, hf_ip_hdr_len, tvb, offset, 1, hlen,
- "Header length: %u bytes (bogus, must be "
- "at least %u)", hlen, IPH_MIN_LEN);
+ proto_tree_add_uint_format_value(ip_tree, hf_ip_hdr_len, tvb, offset, 1, hlen,
+ "%u bytes (bogus, must be at least %u)", hlen, IPH_MIN_LEN);
}
return;
}
if (tree) {
- proto_tree_add_uint_format(ip_tree, hf_ip_hdr_len, tvb, offset, 1, hlen,
- "Header length: %u bytes", hlen);
+ proto_tree_add_uint_format_value(ip_tree, hf_ip_hdr_len, tvb, offset, 1, hlen,
+ "%u bytes", hlen);
}
iph->ip_tos = tvb_get_guint8(tvb, offset + 1);
@@ -1998,9 +1997,8 @@ dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
if (tree) {
if (g_ip_dscp_actif) {
- tf = proto_tree_add_uint_format(ip_tree, hf_ip_dsfield, tvb, offset + 1,
- 1, iph->ip_tos, "Differentiated Services Field: 0x%02x "
- "(DSCP 0x%02x: %s; ECN: 0x%02x: %s)", iph->ip_tos,
+ tf = proto_tree_add_uint_format_value(ip_tree, hf_ip_dsfield, tvb, offset + 1,
+ 1, iph->ip_tos, "0x%02x (DSCP 0x%02x: %s; ECN: 0x%02x: %s)", iph->ip_tos,
IPDSFIELD_DSCP(iph->ip_tos), val_to_str_ext_const(IPDSFIELD_DSCP(iph->ip_tos),
&dscp_vals_ext, "Unknown DSCP"),
IPDSFIELD_ECN(iph->ip_tos), val_to_str_const(IPDSFIELD_ECN(iph->ip_tos),
@@ -2010,9 +2008,9 @@ dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
proto_tree_add_item(field_tree, hf_ip_dsfield_dscp, tvb, offset + 1, 1, ENC_NA);
proto_tree_add_item(field_tree, hf_ip_dsfield_ecn, tvb, offset + 1, 1, ENC_NA);
} else {
- tf = proto_tree_add_uint_format(ip_tree, hf_ip_tos, tvb, offset + 1, 1,
+ tf = proto_tree_add_uint_format_value(ip_tree, hf_ip_tos, tvb, offset + 1, 1,
iph->ip_tos,
- "Type of service: 0x%02x (%s)",
+ "0x%02x (%s)",
iph->ip_tos,
val_to_str_const(IPTOS_TOS(iph->ip_tos),
iptos_vals, "Unknown"));
@@ -2053,13 +2051,10 @@ dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
col_add_fstr(pinfo->cinfo, COL_INFO,
"Bogus IP length (%u, less than header length %u)",
iph->ip_len, hlen);
- tf = NULL;
- if (tree) {
- tf = proto_tree_add_uint_format(ip_tree, hf_ip_len, tvb, offset + 2, 2,
+ tf = proto_tree_add_uint_format_value(ip_tree, hf_ip_len, tvb, offset + 2, 2,
iph->ip_len,
- "Total length: %u bytes (bogus, less than header length %u)",
+ "%u bytes (bogus, less than header length %u)",
iph->ip_len, hlen);
- }
expert_add_info(pinfo, tf, &ei_ip_bogus_ip_length);
/* Can't dissect any further */
return;
@@ -2536,7 +2531,7 @@ proto_register_ip(void)
NULL, 0x0, NULL, HFILL }},
{ &hf_ip_dsfield,
- { "Differentiated Services field", "ip.dsfield", FT_UINT8, BASE_DEC,
+ { "Differentiated Services Field", "ip.dsfield", FT_UINT8, BASE_DEC,
NULL, 0x0, NULL, HFILL }},
{ &hf_ip_dsfield_dscp,
diff --git a/epan/dissectors/packet-ipmi-app.c b/epan/dissectors/packet-ipmi-app.c
index f575780163..a05ccbca16 100644
--- a/epan/dissectors/packet-ipmi-app.c
+++ b/epan/dissectors/packet-ipmi-app.c
@@ -456,8 +456,8 @@ rs04(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
res = tvb_get_guint8(tvb, 0);
fail = tvb_get_guint8(tvb, 1);
- proto_tree_add_uint_format(tree, hf_ipmi_app_04_result, tvb, 0, 1,
- res, "Self test result: %s (0x%02x)",
+ proto_tree_add_uint_format_value(tree, hf_ipmi_app_04_result, tvb, 0, 1,
+ res, "%s (0x%02x)",
val_to_str_const(res, vals_04_result, "Device-specific internal failure"),
res);
diff --git a/epan/dissectors/packet-ipmi-picmg.c b/epan/dissectors/packet-ipmi-picmg.c
index 3ee4d27e59..55459af3f5 100644
--- a/epan/dissectors/packet-ipmi-picmg.c
+++ b/epan/dissectors/packet-ipmi-picmg.c
@@ -1523,8 +1523,8 @@ rs36(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
res = tvb_get_guint8(tvb, 0);
fail = tvb_get_guint8(tvb, 1);
- proto_tree_add_uint_format(tree, hf_ipmi_picmg_36_result, tvb, 0, 1,
- res, "Self test result: %s (0x%02x)",
+ proto_tree_add_uint_format_value(tree, hf_ipmi_picmg_36_result, tvb, 0, 1,
+ res, "%s (0x%02x)",
val_to_str_const(res, vals_36_result, "Device-specific internal failure"),
res);
diff --git a/epan/dissectors/packet-ipmi.c b/epan/dissectors/packet-ipmi.c
index d1924c5ffa..ca57ffff83 100644
--- a/epan/dissectors/packet-ipmi.c
+++ b/epan/dissectors/packet-ipmi.c
@@ -1255,14 +1255,14 @@ ipmi_do_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ipmi_tree, ipmi_d
/* Header checksum */
if (hdr_crc == hdr_exp_crc) {
- proto_tree_add_uint_format(hdr_tree, hf_ipmi_header_crc, tvb, offs++, 1,
- hdr_crc, "Header checksum: 0x%02x (correct)", hdr_crc);
+ proto_tree_add_uint_format_value(hdr_tree, hf_ipmi_header_crc, tvb, offs++, 1,
+ hdr_crc, "0x%02x (correct)", hdr_crc);
}
else {
ti = proto_tree_add_boolean(hdr_tree, hf_ipmi_bad_checksum, tvb, 0, 0, TRUE);
PROTO_ITEM_SET_HIDDEN(ti);
- proto_tree_add_uint_format(hdr_tree, hf_ipmi_header_crc, tvb, offs++, 1,
- hdr_crc, "Header checksum: 0x%02x (incorrect, expected 0x%02x)",
+ proto_tree_add_uint_format_value(hdr_tree, hf_ipmi_header_crc, tvb, offs++, 1,
+ hdr_crc, "0x%02x (incorrect, expected 0x%02x)",
hdr_crc, hdr_exp_crc);
}
@@ -1288,8 +1288,8 @@ ipmi_do_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ipmi_tree, ipmi_d
/* Response code (if present) */
if (is_resp) {
- proto_tree_add_uint_format(hdr_tree, hf_ipmi_header_completion, tvb, offs++, 1,
- hdr.ccode, "Completion code: %s (0x%02x)", ccdesc, hdr.ccode);
+ proto_tree_add_uint_format_value(hdr_tree, hf_ipmi_header_completion, tvb, offs++, 1,
+ hdr.ccode, "%s (0x%02x)", ccdesc, hdr.ccode);
}
/* Defining body signature (if present) */
diff --git a/epan/dissectors/packet-ipv6.c b/epan/dissectors/packet-ipv6.c
index 7ab61a22ab..58cd324dad 100644
--- a/epan/dissectors/packet-ipv6.c
+++ b/epan/dissectors/packet-ipv6.c
@@ -1611,9 +1611,9 @@ dissect_shim6(tvbuff_t *tvb, int offset, proto_tree *tree, packet_info * pinfo)
shim_tree = proto_item_add_subtree(ti, ett_ipv6_shim6);
/* Next Header */
- proto_tree_add_uint_format(shim_tree, hf_ipv6_shim6_nxt, tvb,
+ proto_tree_add_uint_format_value(shim_tree, hf_ipv6_shim6_nxt, tvb,
offset + (int)offsetof(struct ip6_shim, ip6s_nxt), 1, shim.ip6s_nxt,
- "Next header: %s (%u)", ipprotostr(shim.ip6s_nxt), shim.ip6s_nxt);
+ "%s (%u)", ipprotostr(shim.ip6s_nxt), shim.ip6s_nxt);
/* Header Extension Length */
proto_tree_add_uint_format_value(shim_tree, hf_ipv6_shim6_len, tvb,
diff --git a/epan/dissectors/packet-ipx.c b/epan/dissectors/packet-ipx.c
index b873a3ac8d..9e74acaec4 100644
--- a/epan/dissectors/packet-ipx.c
+++ b/epan/dissectors/packet-ipx.c
@@ -616,15 +616,15 @@ dissect_spx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (tree) {
if (datastream_type_string != NULL) {
- proto_tree_add_uint_format(spx_tree, hf_spx_datastream_type, tvb,
+ proto_tree_add_uint_format_value(spx_tree, hf_spx_datastream_type, tvb,
1, 1, datastream_type,
- "Datastream Type: %s (0x%02X)",
+ "%s (0x%02X)",
datastream_type_string,
datastream_type);
} else {
- proto_tree_add_uint_format(spx_tree, hf_spx_datastream_type, tvb,
+ proto_tree_add_uint_format_value(spx_tree, hf_spx_datastream_type, tvb,
1, 1, datastream_type,
- "Datastream Type: 0x%02X",
+ "0x%02X",
datastream_type);
}
proto_tree_add_item(spx_tree, hf_spx_src_id, tvb, 2, 2, ENC_BIG_ENDIAN);
@@ -1368,7 +1368,7 @@ proto_register_ipx(void)
NULL, HFILL }},
{ &hf_spx_datastream_type,
- { "Datastream type", "spx.type",
+ { "Datastream Type", "spx.type",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }},
diff --git a/epan/dissectors/packet-isakmp.c b/epan/dissectors/packet-isakmp.c
index 3e4a64af58..c34136e6dc 100644
--- a/epan/dissectors/packet-isakmp.c
+++ b/epan/dissectors/packet-isakmp.c
@@ -3523,23 +3523,23 @@ _U_
transform_id = tvb_get_guint8(tvb, offset);
switch (protocol_id) {
case 1: /* ISAKMP */
- proto_tree_add_uint_format(tree, hf_isakmp_trans_id, tvb, offset, 1,
- transform_id, "Transform ID: %s (%u)",
+ proto_tree_add_uint_format_value(tree, hf_isakmp_trans_id, tvb, offset, 1,
+ transform_id, "%s (%u)",
val_to_str_const(transform_id, vs_v1_trans_isakmp, "UNKNOWN-TRANS-TYPE"), transform_id);
break;
case 2: /* AH */
- proto_tree_add_uint_format(tree, hf_isakmp_trans_id, tvb, offset, 1,
- transform_id, "Transform ID: %s (%u)",
+ proto_tree_add_uint_format_value(tree, hf_isakmp_trans_id, tvb, offset, 1,
+ transform_id, "%s (%u)",
val_to_str_const(transform_id, vs_v1_trans_ah, "UNKNOWN-AH-TRANS-TYPE"), transform_id);
break;
case 3: /* ESP */
- proto_tree_add_uint_format(tree, hf_isakmp_trans_id, tvb, offset, 1,
- transform_id, "Transform ID: %s (%u)",
+ proto_tree_add_uint_format_value(tree, hf_isakmp_trans_id, tvb, offset, 1,
+ transform_id, "%s (%u)",
val_to_str_const(transform_id, vs_v1_trans_esp, "UNKNOWN-ESP-TRANS-TYPE"), transform_id);
break;
case 4: /* IPCOMP */
- proto_tree_add_uint_format(tree, hf_isakmp_trans_id, tvb, offset, 1,
- transform_id, "Transform ID: %s (%u)",
+ proto_tree_add_uint_format_value(tree, hf_isakmp_trans_id, tvb, offset, 1,
+ transform_id, "%s (%u)",
val_to_str_const(transform_id, transform_id_ipcomp, "UNKNOWN-IPCOMP-TRANS-TYPE"), transform_id);
break;
default:
diff --git a/epan/dissectors/packet-isup.c b/epan/dissectors/packet-isup.c
index d8598cbc86..7c265a1cf3 100644
--- a/epan/dissectors/packet-isup.c
+++ b/epan/dissectors/packet-isup.c
@@ -3930,8 +3930,8 @@ dissect_isup_event_information_parameter(tvbuff_t *parameter_tvb, proto_tree *pa
guint8 indicators;
indicators = tvb_get_guint8(parameter_tvb, 0);
- proto_tree_add_uint_format(parameter_tree, hf_isup_event_ind, parameter_tvb, 0, EVENT_INFO_LENGTH, indicators,
- "Event indicator: %s (%u)",
+ proto_tree_add_uint_format_value(parameter_tree, hf_isup_event_ind, parameter_tvb, 0, EVENT_INFO_LENGTH, indicators,
+ "%s (%u)",
val_to_str_const(indicators & GFEDCBA_8BIT_MASK, isup_event_ind_value, "spare"),
indicators & GFEDCBA_8BIT_MASK);
proto_tree_add_boolean(parameter_tree, hf_isup_event_presentation_restricted_ind, parameter_tvb, 0, EVENT_INFO_LENGTH, indicators);
@@ -4836,8 +4836,8 @@ dissect_bat_ase_Encapsulated_Application_Information(tvbuff_t *parameter_tvb, pa
} /* end if */
Local_BCU_ID = tvb_get_letohl(parameter_tvb, offset);
- proto_tree_add_uint_format(bat_ase_element_tree, hf_Local_BCU_ID , parameter_tvb, offset, 4,
- Local_BCU_ID , "Local BCU ID : 0x%08x", Local_BCU_ID);
+ proto_tree_add_uint_format_value(bat_ase_element_tree, hf_Local_BCU_ID , parameter_tvb, offset, 4,
+ Local_BCU_ID , "0x%08x", Local_BCU_ID);
offset = offset + 4;
break;
case SIGNAL :
@@ -8222,8 +8222,8 @@ dissect_isup_optional_parameter(tvbuff_t *optional_parameters_tvb,packet_info *p
octet = tvb_get_guint8(optional_parameters_tvb,offset);
- proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_length, optional_parameters_tvb, offset,
- PARAMETER_LENGTH_IND_LENGTH, parameter_length, "Parameter length: %u", parameter_length);
+ proto_tree_add_uint(parameter_tree, hf_isup_parameter_length, optional_parameters_tvb, offset,
+ PARAMETER_LENGTH_IND_LENGTH, parameter_length);
offset += PARAMETER_LENGTH_IND_LENGTH;
if (octet == 0)
continue;
@@ -8580,9 +8580,8 @@ dissect_ansi_isup_optional_parameter(tvbuff_t *optional_parameters_tvb,packet_in
octet = tvb_get_guint8(optional_parameters_tvb,offset);
- proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_length, optional_parameters_tvb, offset,
- PARAMETER_LENGTH_IND_LENGTH, parameter_length,
- "Parameter length: %u", parameter_length);
+ proto_tree_add_uint(parameter_tree, hf_isup_parameter_length, optional_parameters_tvb, offset,
+ PARAMETER_LENGTH_IND_LENGTH, parameter_length);
offset += PARAMETER_LENGTH_IND_LENGTH;
if (octet == 0)
continue;
diff --git a/epan/dissectors/packet-iua.c b/epan/dissectors/packet-iua.c
index e42492bbe6..dd88d8cc90 100644
--- a/epan/dissectors/packet-iua.c
+++ b/epan/dissectors/packet-iua.c
@@ -403,8 +403,8 @@ dissect_status_type_identification_parameter(tvbuff_t *parameter_tvb, proto_tree
status_id = tvb_get_ntohs(parameter_tvb, STATUS_IDENT_OFFSET);
proto_tree_add_item(parameter_tree, hf_status_type, parameter_tvb, STATUS_TYPE_OFFSET, STATUS_TYPE_LENGTH, ENC_BIG_ENDIAN);
- proto_tree_add_uint_format(parameter_tree, hf_status_id, parameter_tvb, STATUS_IDENT_OFFSET, STATUS_IDENT_LENGTH,
- status_id, "Status identification: %u (%s)", status_id,
+ proto_tree_add_uint_format_value(parameter_tree, hf_status_id, parameter_tvb, STATUS_IDENT_OFFSET, STATUS_IDENT_LENGTH,
+ status_id, "%u (%s)", status_id,
val_to_str_const(status_type * 256 * 256 + status_id, support_IG?status_type_id_ig_values:status_type_id_values, "unknown"));
proto_item_append_text(parameter_item, " (%s)",
@@ -873,9 +873,9 @@ dissect_common_header(tvbuff_t *common_header_tvb, packet_info *pinfo, proto_tre
proto_tree_add_item(iua_tree, hf_version, common_header_tvb, VERSION_OFFSET, VERSION_LENGTH, ENC_BIG_ENDIAN);
proto_tree_add_item(iua_tree, hf_reserved, common_header_tvb, RESERVED_OFFSET, RESERVED_LENGTH, ENC_BIG_ENDIAN);
proto_tree_add_item(iua_tree, hf_message_class, common_header_tvb, MESSAGE_CLASS_OFFSET, MESSAGE_CLASS_LENGTH, ENC_BIG_ENDIAN);
- proto_tree_add_uint_format(iua_tree, hf_message_type,
+ proto_tree_add_uint_format_value(iua_tree, hf_message_type,
common_header_tvb, MESSAGE_TYPE_OFFSET, MESSAGE_TYPE_LENGTH,
- message_type, "Message type: %u (%s)",
+ message_type, "%u (%s)",
message_type, val_to_str_const(message_class * 256 + message_type, support_IG?message_class_type_ig_values:message_class_type_values, "reserved"));
proto_tree_add_item(iua_tree, hf_message_length, common_header_tvb, MESSAGE_LENGTH_OFFSET, MESSAGE_LENGTH_LENGTH, ENC_BIG_ENDIAN);
}
diff --git a/epan/dissectors/packet-juniper.c b/epan/dissectors/packet-juniper.c
index da9dcd3614..7f4d34df48 100644
--- a/epan/dissectors/packet-juniper.c
+++ b/epan/dissectors/packet-juniper.c
@@ -526,9 +526,7 @@ dissect_juniper_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, prot
proto_tree_add_text (juniper_subtree, tvb, 0, 3,
"Magic-Number: 0x%06x", magic_number);
- proto_tree_add_uint_format (juniper_subtree, hf_juniper_direction, tvb, 3, 1,
- direction, "Direction: %s",
- val_to_str_const(direction,juniper_direction_vals,"Unknown"));
+ proto_tree_add_item(juniper_subtree, hf_juniper_direction, tvb, 3, 1, ENC_NA);
proto_tree_add_uint_format (juniper_subtree, hf_juniper_l2hdr_presence, tvb, 3, 1,
l2hdr_presence, "L2-header: %s",
diff --git a/epan/dissectors/packet-lapb.c b/epan/dissectors/packet-lapb.c
index e6ecc0e68f..860eba23b2 100644
--- a/epan/dissectors/packet-lapb.c
+++ b/epan/dissectors/packet-lapb.c
@@ -128,15 +128,10 @@ dissect_lapb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
}
- if (tree) {
ti = proto_tree_add_protocol_format(tree, proto_lapb, tvb, 0, 2,
"LAPB");
lapb_tree = proto_item_add_subtree(ti, ett_lapb);
- proto_tree_add_uint_format(lapb_tree, hf_lapb_address, tvb, 0, 1, byte0,
- "Address: 0x%02X", byte0);
- }
- else
- lapb_tree = NULL;
+ proto_tree_add_uint(lapb_tree, hf_lapb_address, tvb, 0, 1, byte0);
control = dissect_xdlc_control(tvb, 1, pinfo, lapb_tree, hf_lapb_control,
ett_lapb_control, &lapb_cf_items, NULL, NULL, NULL,
@@ -164,8 +159,8 @@ proto_register_lapb(void)
{
static hf_register_info hf[] = {
{ &hf_lapb_address,
- { "Address Field", "lapb.address", FT_UINT8, BASE_HEX, NULL, 0x0,
- "Address", HFILL }},
+ { "Address", "lapb.address", FT_UINT8, BASE_HEX, NULL, 0x0,
+ NULL, HFILL }},
{ &hf_lapb_control,
{ "Control Field", "lapb.control", FT_UINT8, BASE_HEX, NULL, 0x0,
diff --git a/epan/dissectors/packet-ldp.c b/epan/dissectors/packet-ldp.c
index 7cde6e2435..e9bcd4c21f 100644
--- a/epan/dissectors/packet-ldp.c
+++ b/epan/dissectors/packet-ldp.c
@@ -1478,8 +1478,8 @@ dissect_tlv_frame_label(tvbuff_t *tvb, guint offset, proto_tree *tree, int rem)
val_tree=proto_item_add_subtree(ti, ett_ldp_tlv_val);
len=(guint8)(tvb_get_ntohs(tvb, offset)>>7) & 0x03;
- proto_tree_add_uint_format(val_tree, hf_ldp_tlv_fr_label_len, tvb, offset, 2, len,
- "Number of DLCI bits: %s (%u)", val_to_str_const(len, tlv_fr_len_vals, "Unknown Length"), len);
+ proto_tree_add_uint_format_value(val_tree, hf_ldp_tlv_fr_label_len, tvb, offset, 2, len,
+ "%s (%u)", val_to_str_const(len, tlv_fr_len_vals, "Unknown Length"), len);
proto_tree_add_item(val_tree,
hf_ldp_tlv_fr_label_dlci, tvb, offset+1, 3, ENC_BIG_ENDIAN);
@@ -1507,8 +1507,8 @@ dissect_tlv_status(tvbuff_t *tvb, guint offset, proto_tree *tree, int rem)
proto_tree_add_item(val_tree, hf_ldp_tlv_status_fbit, tvb, offset, 1, ENC_BIG_ENDIAN);
data=tvb_get_ntohl(tvb, offset)&0x3FFFFFFF;
- proto_tree_add_uint_format(val_tree, hf_ldp_tlv_status_data, tvb, offset, 4,
- data, "Status Data: %s (0x%X)", val_to_str_const(data, tlv_status_data, "Unknown Status Data"), data);
+ proto_tree_add_uint_format_value(val_tree, hf_ldp_tlv_status_data, tvb, offset, 4,
+ data, "%s (0x%X)", val_to_str_const(data, tlv_status_data, "Unknown Status Data"), data);
proto_tree_add_item(val_tree, hf_ldp_tlv_status_msg_id, tvb, offset+4, 4, ENC_BIG_ENDIAN);
proto_tree_add_item(val_tree, hf_ldp_tlv_status_msg_type, tvb, offset+8, 2, ENC_BIG_ENDIAN);
@@ -1771,7 +1771,6 @@ dissect_tlv_frame_relay_session_parms(tvbuff_t *tvb, guint offset,proto_tree *tr
{
proto_tree *ti, *val_tree, *lbl_tree;
guint8 numlr, ix, len;
- guint32 id;
if(rem < 4) {
proto_tree_add_text(tree, tvb, offset, rem,
@@ -1814,15 +1813,11 @@ dissect_tlv_frame_relay_session_parms(tvbuff_t *tvb, guint offset,proto_tree *tr
lbl_tree=proto_item_add_subtree(ti, ett_ldp_tlv_val);
len=(guint8)(tvb_get_ntohs(tvb, offset)>>7) & 0x03;
- proto_tree_add_uint_format(lbl_tree, hf_ldp_tlv_sess_fr_len, tvb, offset, 2, len,
- "Number of DLCI bits: %s (%u)", val_to_str_const(len, tlv_fr_len_vals, "Unknown Length"), len);
+ proto_tree_add_uint_format_value(lbl_tree, hf_ldp_tlv_sess_fr_len, tvb, offset, 2, len,
+ "%s (%u)", val_to_str_const(len, tlv_fr_len_vals, "Unknown Length"), len);
- id=tvb_get_ntoh24(tvb, offset+1)&0x7FFFFF;
- proto_tree_add_uint_format(lbl_tree,
- hf_ldp_tlv_sess_fr_mindlci, tvb, offset+1, 3, id, "Minimum DLCI %u", id);
- id=tvb_get_ntoh24(tvb, offset+5)&0x7FFFFF;
- proto_tree_add_uint_format(lbl_tree,
- hf_ldp_tlv_sess_fr_maxdlci, tvb, offset+5, 3, id, "Maximum DLCI %u", id);
+ proto_tree_add_item(lbl_tree, hf_ldp_tlv_sess_fr_mindlci, tvb, offset+1, 3, ENC_BIG_ENDIAN);
+ proto_tree_add_item(lbl_tree, hf_ldp_tlv_sess_fr_maxdlci, tvb, offset+5, 3, ENC_BIG_ENDIAN);
offset += 8;
}
@@ -2961,16 +2956,15 @@ dissect_tlv_pw_status(tvbuff_t *tvb, guint offset, proto_tree *tree, int rem)
}
data=tvb_get_ntohl(tvb, offset);
- ti = proto_tree_add_uint_format(tree, hf_ldp_tlv_pw_status_data, tvb, offset , rem,
- data, "PW Status: 0x%08x ", data);
+ ti = proto_tree_add_item(tree, hf_ldp_tlv_pw_status_data, tvb, offset, rem, ENC_BIG_ENDIAN);
val_tree=proto_item_add_subtree(ti, ett_ldp_tlv_val);
/* Display the bits 0-4 if they are set or not set */
- proto_tree_add_boolean(val_tree, hf_ldp_tlv_pw_not_forwarding, tvb, offset , 4, data);
- proto_tree_add_boolean(val_tree, hf_ldp_tlv_pw_lac_ingress_recv_fault, tvb, offset , 4, data);
- proto_tree_add_boolean(val_tree, hf_ldp_tlv_pw_lac_egress_recv_fault, tvb, offset , 4, data);
- proto_tree_add_boolean(val_tree, hf_ldp_tlv_pw_psn_pw_ingress_recv_fault, tvb, offset , 4, data);
- proto_tree_add_boolean(val_tree, hf_ldp_tlv_pw_psn_pw_egress_recv_fault, tvb, offset , 4, data);
+ proto_tree_add_item(val_tree, hf_ldp_tlv_pw_not_forwarding, tvb, offset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(val_tree, hf_ldp_tlv_pw_lac_ingress_recv_fault, tvb, offset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(val_tree, hf_ldp_tlv_pw_lac_egress_recv_fault, tvb, offset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(val_tree, hf_ldp_tlv_pw_psn_pw_ingress_recv_fault, tvb, offset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(val_tree, hf_ldp_tlv_pw_psn_pw_egress_recv_fault, tvb, offset, 4, ENC_BIG_ENDIAN);
}
static void
@@ -4045,7 +4039,7 @@ proto_register_ldp(void)
NULL, 0x0, "Attachment Individual Identifier AC Id", HFILL}},
{ &hf_ldp_tlv_pw_status_data,
- { "Status Code", "ldp.msg.tlv.pwstatus.code", FT_UINT32, BASE_HEX,
+ { "PW Status", "ldp.msg.tlv.pwstatus.code", FT_UINT32, BASE_HEX,
NULL, 0, NULL, HFILL }},
{ &hf_ldp_tlv_pw_not_forwarding,
diff --git a/epan/dissectors/packet-m2tp.c b/epan/dissectors/packet-m2tp.c
index e82884dab8..5753e2eb41 100644
--- a/epan/dissectors/packet-m2tp.c
+++ b/epan/dissectors/packet-m2tp.c
@@ -276,9 +276,9 @@ dissect_m2tp_common_header(tvbuff_t *common_header_tvb, packet_info *pinfo, prot
proto_tree_add_uint(m2tp_tree, hf_m2tp_version, common_header_tvb, VERSION_OFFSET, VERSION_LENGTH, version);
proto_tree_add_uint(m2tp_tree, hf_m2tp_reserved, common_header_tvb, RESERVED_OFFSET, RESERVED_LENGTH, reserved);
proto_tree_add_uint(m2tp_tree, hf_m2tp_message_class, common_header_tvb, MESSAGE_CLASS_OFFSET, MESSAGE_CLASS_LENGTH, message_class);
- proto_tree_add_uint_format(m2tp_tree, hf_m2tp_message_type,
+ proto_tree_add_uint_format_value(m2tp_tree, hf_m2tp_message_type,
common_header_tvb, MESSAGE_TYPE_OFFSET, MESSAGE_TYPE_LENGTH,
- message_type, "Message type: %u (%s)",
+ message_type, "%u (%s)",
message_type, val_to_str_const(message_class * 256 + message_type, m2tp_message_class_type_values, "reserved"));
proto_tree_add_uint(m2tp_tree, hf_m2tp_message_length, common_header_tvb, MESSAGE_LENGTH_OFFSET, MESSAGE_LENGTH_LENGTH, message_length);
};
diff --git a/epan/dissectors/packet-m2ua.c b/epan/dissectors/packet-m2ua.c
index 5f9d1a5611..33684d9ce8 100644
--- a/epan/dissectors/packet-m2ua.c
+++ b/epan/dissectors/packet-m2ua.c
@@ -247,8 +247,8 @@ dissect_common_header(tvbuff_t *common_header_tvb, packet_info *pinfo, proto_tre
proto_tree_add_item(m2ua_tree, hf_version, common_header_tvb, VERSION_OFFSET, VERSION_LENGTH, ENC_BIG_ENDIAN);
proto_tree_add_item(m2ua_tree, hf_reserved, common_header_tvb, RESERVED_OFFSET, RESERVED_LENGTH, ENC_BIG_ENDIAN);
proto_tree_add_item(m2ua_tree, hf_message_class, common_header_tvb, MESSAGE_CLASS_OFFSET, MESSAGE_CLASS_LENGTH, ENC_BIG_ENDIAN);
- proto_tree_add_uint_format(m2ua_tree, hf_message_type, common_header_tvb, MESSAGE_TYPE_OFFSET, MESSAGE_TYPE_LENGTH, message_type,
- "Message type: %s (%u)",
+ proto_tree_add_uint_format_value(m2ua_tree, hf_message_type, common_header_tvb, MESSAGE_TYPE_OFFSET, MESSAGE_TYPE_LENGTH, message_type,
+ "%s (%u)",
val_to_str_const(message_class * 256 + message_type, message_class_type_values, "reserved"), message_type);
proto_tree_add_item(m2ua_tree, hf_message_length, common_header_tvb, MESSAGE_LENGTH_OFFSET, MESSAGE_LENGTH_LENGTH, ENC_BIG_ENDIAN);
}
diff --git a/epan/dissectors/packet-m3ua.c b/epan/dissectors/packet-m3ua.c
index 84479d695f..697be634a7 100644
--- a/epan/dissectors/packet-m3ua.c
+++ b/epan/dissectors/packet-m3ua.c
@@ -345,8 +345,8 @@ dissect_v5_common_header(tvbuff_t *common_header_tvb, packet_info *pinfo, proto_
proto_tree_add_item(m3ua_tree, hf_version, common_header_tvb, VERSION_OFFSET, VERSION_LENGTH, ENC_BIG_ENDIAN);
proto_tree_add_item(m3ua_tree, hf_reserved, common_header_tvb, RESERVED_OFFSET, RESERVED_LENGTH, ENC_BIG_ENDIAN);
proto_tree_add_item(m3ua_tree, hf_v5_message_class, common_header_tvb, MESSAGE_CLASS_OFFSET, MESSAGE_CLASS_LENGTH, ENC_BIG_ENDIAN);
- proto_tree_add_uint_format(m3ua_tree, hf_message_type, common_header_tvb, MESSAGE_TYPE_OFFSET, MESSAGE_TYPE_LENGTH, message_type,
- "Message type: %s (%u)", val_to_str_const(message_class * 256 + message_type, v5_message_class_type_values, "reserved"), message_type);
+ proto_tree_add_uint_format_value(m3ua_tree, hf_message_type, common_header_tvb, MESSAGE_TYPE_OFFSET, MESSAGE_TYPE_LENGTH, message_type,
+ "%s (%u)", val_to_str_const(message_class * 256 + message_type, v5_message_class_type_values, "reserved"), message_type);
proto_tree_add_item(m3ua_tree, hf_message_length, common_header_tvb, MESSAGE_LENGTH_OFFSET, MESSAGE_LENGTH_LENGTH, ENC_BIG_ENDIAN);
}
}
@@ -367,8 +367,8 @@ dissect_common_header(tvbuff_t *common_header_tvb, packet_info *pinfo, proto_tre
proto_tree_add_item(m3ua_tree, hf_version, common_header_tvb, VERSION_OFFSET, VERSION_LENGTH, ENC_BIG_ENDIAN);
proto_tree_add_item(m3ua_tree, hf_reserved, common_header_tvb, RESERVED_OFFSET, RESERVED_LENGTH, ENC_BIG_ENDIAN);
proto_tree_add_item(m3ua_tree, hf_message_class, common_header_tvb, MESSAGE_CLASS_OFFSET, MESSAGE_CLASS_LENGTH, ENC_BIG_ENDIAN);
- proto_tree_add_uint_format(m3ua_tree, hf_message_type, common_header_tvb, MESSAGE_TYPE_OFFSET, MESSAGE_TYPE_LENGTH, message_type,
- "Message type: %s (%u)", val_to_str_const(message_class * 256 + message_type, message_class_type_values, "reserved"), message_type);
+ proto_tree_add_uint_format_value(m3ua_tree, hf_message_type, common_header_tvb, MESSAGE_TYPE_OFFSET, MESSAGE_TYPE_LENGTH, message_type,
+ "%s (%u)", val_to_str_const(message_class * 256 + message_type, message_class_type_values, "reserved"), message_type);
proto_tree_add_item(m3ua_tree, hf_message_length, common_header_tvb, MESSAGE_LENGTH_OFFSET, MESSAGE_LENGTH_LENGTH, ENC_BIG_ENDIAN);
}
}
@@ -753,8 +753,8 @@ dissect_v567_status_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tre
status_info = tvb_get_ntohs(parameter_tvb, STATUS_INFO_OFFSET);
proto_tree_add_item(parameter_tree, hf_status_type, parameter_tvb, STATUS_TYPE_OFFSET, STATUS_TYPE_LENGTH, ENC_BIG_ENDIAN);
- proto_tree_add_uint_format(parameter_tree, hf_status_info, parameter_tvb, STATUS_INFO_OFFSET, STATUS_INFO_LENGTH, status_info,
- "Status info: %s (%u)", val_to_str_const(status_type * 256 * 256 + status_info, v567_status_type_info_values, "unknown"), status_info);
+ proto_tree_add_uint_format_value(parameter_tree, hf_status_info, parameter_tvb, STATUS_INFO_OFFSET, STATUS_INFO_LENGTH, status_info,
+ "%s (%u)", val_to_str_const(status_type * 256 * 256 + status_info, v567_status_type_info_values, "unknown"), status_info);
proto_item_append_text(parameter_item, " (%s)", val_to_str_const(status_type * 256 * 256 + status_info, v567_status_type_info_values, "unknown status information"));
}
@@ -778,8 +778,8 @@ dissect_status_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, pr
status_info = tvb_get_ntohs(parameter_tvb, STATUS_INFO_OFFSET);
proto_tree_add_item(parameter_tree, hf_status_type, parameter_tvb, STATUS_TYPE_OFFSET, STATUS_TYPE_LENGTH, ENC_BIG_ENDIAN);
- proto_tree_add_uint_format(parameter_tree, hf_status_info, parameter_tvb, STATUS_INFO_OFFSET, STATUS_INFO_LENGTH, status_info,
- "Status info: %s (%u)", val_to_str_const(status_type * 256 * 256 + status_info, status_type_info_values, "unknown"), status_info);
+ proto_tree_add_uint_format_value(parameter_tree, hf_status_info, parameter_tvb, STATUS_INFO_OFFSET, STATUS_INFO_LENGTH, status_info,
+ "%s (%u)", val_to_str_const(status_type * 256 * 256 + status_info, status_type_info_values, "unknown"), status_info);
proto_item_append_text(parameter_item, " (%s)", val_to_str_const(status_type * 256 * 256 + status_info, status_type_info_values, "unknown status information"));
}
diff --git a/epan/dissectors/packet-mpls-echo.c b/epan/dissectors/packet-mpls-echo.c
index 695781d13a..98ec155a60 100644
--- a/epan/dissectors/packet-mpls-echo.c
+++ b/epan/dissectors/packet-mpls-echo.c
@@ -539,8 +539,8 @@ dissect_mpls_echo_tlv_fec(tvbuff_t *tvb, packet_info *pinfo, guint offset, proto
tlv_fec_tree = proto_item_add_subtree(ti, ett_mpls_echo_tlv_fec);
/* FEC sub-TLV Type and Length */
- proto_tree_add_uint_format(tlv_fec_tree, hf_mpls_echo_tlv_fec_type, tvb,
- offset, 2, saved_type, "Type: %s (%u)",
+ proto_tree_add_uint_format_value(tlv_fec_tree, hf_mpls_echo_tlv_fec_type, tvb,
+ offset, 2, saved_type, "%s (%u)",
val_to_str_ext_const(type, &mpls_echo_tlv_fec_names_ext,
"Unknown sub-TLV type"), saved_type);
@@ -1480,13 +1480,13 @@ dissect_mpls_echo_tlv(tvbuff_t *tvb, packet_info *pinfo, guint offset, proto_tre
/* MPLS Echo TLV Type and Length */
if (in_errored) {
- proto_tree_add_uint_format(mpls_echo_tlv_tree, hf_mpls_echo_tlv_errored_type, tvb,
- offset, 2, saved_type, "Errored TLV Type: %s (%u)",
+ proto_tree_add_uint_format_value(mpls_echo_tlv_tree, hf_mpls_echo_tlv_errored_type, tvb,
+ offset, 2, saved_type, "%s (%u)",
val_to_str_ext_const(type, &mpls_echo_tlv_type_names_ext,
"Unknown TLV type"), saved_type);
} else {
- proto_tree_add_uint_format(mpls_echo_tlv_tree, hf_mpls_echo_tlv_type, tvb,
- offset, 2, saved_type, "Type: %s (%u)",
+ proto_tree_add_uint_format_value(mpls_echo_tlv_tree, hf_mpls_echo_tlv_type, tvb,
+ offset, 2, saved_type, "%s (%u)",
val_to_str_ext_const(type, &mpls_echo_tlv_type_names_ext,
"Unknown TLV type"), saved_type);
}
diff --git a/epan/dissectors/packet-msdp.c b/epan/dissectors/packet-msdp.c
index b697457602..40ebafba18 100644
--- a/epan/dissectors/packet-msdp.c
+++ b/epan/dissectors/packet-msdp.c
@@ -375,8 +375,8 @@ static void dissect_msdp_notification(tvbuff_t *tvb, packet_info *pinfo, proto_t
}
error_sub = tvb_get_guint8(tvb, *offset);
- proto_tree_add_uint_format(tree, hf_msdp_not_error_sub, tvb, *offset, 1,
- error_sub, "Error subcode: %s (%u)",
+ proto_tree_add_uint_format_value(tree, hf_msdp_not_error_sub, tvb, *offset, 1,
+ error_sub, "%s (%u)",
val_to_str_const(error_sub, vals, "<Unknown Error subcode>"),
error_sub);
*offset += 1;
@@ -517,9 +517,9 @@ proto_register_msdp(void)
"Indicates the type of Notification", HFILL }
},
{ &hf_msdp_not_error_sub,
- { "Error subode", "msdp.not.error_sub",
+ { "Error subcode", "msdp.not.error_sub",
FT_UINT8, BASE_DEC, NULL, 0,
- "Error subcode", HFILL }
+ NULL, HFILL }
},
{ &hf_msdp_not_ipv4,
{ "IPv4 address", "msdp.not.ipv4",
diff --git a/epan/dissectors/packet-nas_eps.c b/epan/dissectors/packet-nas_eps.c
index 9ed4db3eb3..e17e7d45e7 100644
--- a/epan/dissectors/packet-nas_eps.c
+++ b/epan/dissectors/packet-nas_eps.c
@@ -2195,8 +2195,8 @@ de_esm_apn_aggr_max_br(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
} else {
bitrate = calc_bitrate(octet);
dl_total += bitrate;
- proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_dl, tvb, curr_offset, 1, octet,
- "APN-AMBR for downlink : %u kbps", bitrate);
+ proto_tree_add_uint_format_value(tree, hf_nas_eps_emm_apn_ambr_dl, tvb, curr_offset, 1, octet,
+ "%u kbps", bitrate);
}
curr_offset++;
@@ -2208,8 +2208,8 @@ de_esm_apn_aggr_max_br(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
} else {
bitrate = calc_bitrate(octet);
ul_total += bitrate;
- proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_ul, tvb, curr_offset, 1, octet,
- "APN-AMBR for uplink : %u kbps", bitrate);
+ proto_tree_add_uint_format_value(tree, hf_nas_eps_emm_apn_ambr_ul, tvb, curr_offset, 1, octet,
+ "%u kbps", bitrate);
}
curr_offset++;
if ((curr_offset - offset) >= len)
@@ -2222,10 +2222,8 @@ de_esm_apn_aggr_max_br(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
} else {
bitrate = calc_bitrate_ext(octet);
dl_total += (octet > 0x4a) ? bitrate*1000 : bitrate;
- proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_dl_ext, tvb, curr_offset, 1, octet,
- "APN-AMBR for downlink (extended) : %u %s",
- bitrate,
- (octet > 0x4a) ? "Mbps" : "kbps");
+ proto_tree_add_uint_format_value(tree, hf_nas_eps_emm_apn_ambr_dl_ext, tvb, curr_offset, 1, octet,
+ "%u %s", bitrate, (octet > 0x4a) ? "Mbps" : "kbps");
}
if (len < 5) {
/* APN-AMBR for downlink (extended-2) is not present; display total now */
@@ -2250,10 +2248,8 @@ de_esm_apn_aggr_max_br(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
} else {
bitrate = calc_bitrate_ext(octet);
ul_total += (octet > 0x4a) ? bitrate*1000 : bitrate;
- proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_ul_ext, tvb, curr_offset, 1, octet,
- "APN-AMBR for uplink (extended) : %u %s",
- bitrate,
- (octet > 0x4a) ? "Mbps" : "kbps");
+ proto_tree_add_uint_format_value(tree, hf_nas_eps_emm_apn_ambr_ul_ext, tvb, curr_offset, 1, octet,
+ "%u %s", bitrate, (octet > 0x4a) ? "Mbps" : "kbps");
}
if (len < 6) {
/* APN-AMBR for uplink (extended-2) is not present; display total now */
@@ -2277,9 +2273,8 @@ de_esm_apn_aggr_max_br(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
"Use the value indicated by the APN-AMBR for downlink and APN-AMBR for downlink (extended)");
} else {
dl_total += octet*256*1000;
- proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_dl_ext2, tvb, curr_offset, 1, octet,
- "APN-AMBR for downlink (extended-2) : %u Mbps",
- (octet* 256));
+ proto_tree_add_uint_format_value(tree, hf_nas_eps_emm_apn_ambr_dl_ext2, tvb, curr_offset, 1, octet,
+ "%u Mbps", (octet* 256));
}
proto_tree_add_text(tree, tvb, curr_offset, 1,"Total APN-AMBR for downlink : %.3f Mbps", (gfloat)dl_total / 1000);
curr_offset++;
@@ -2292,9 +2287,8 @@ de_esm_apn_aggr_max_br(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
"Use the value indicated by the APN-AMBR for uplink and APN-AMBR for uplink (extended)");
} else {
ul_total += octet*256*1000;
- proto_tree_add_uint_format(tree, hf_nas_eps_emm_apn_ambr_ul_ext2, tvb, curr_offset, 1, octet,
- "APN-AMBR for uplink (extended-2) : %u Mbps",
- (octet* 256));
+ proto_tree_add_uint_format_value(tree, hf_nas_eps_emm_apn_ambr_ul_ext2, tvb, curr_offset, 1, octet,
+ "%u Mbps", (octet* 256));
}
proto_tree_add_text(tree, tvb, curr_offset, 1,"Total APN-AMBR for uplink : %.3f Mbps", (gfloat)ul_total / 1000);
curr_offset++;
@@ -2351,8 +2345,8 @@ de_esm_qos(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
proto_tree_add_uint_format(tree, hf_nas_eps_mbr_ul, tvb, curr_offset, 1, octet,
"UE->NW Subscribed maximum bit rate for uplink/ NW->UE Reserved");
} else {
- proto_tree_add_uint_format(tree, hf_nas_eps_mbr_ul, tvb, curr_offset, 1, octet,
- "Maximum bit rate for uplink : %u kbps", calc_bitrate(octet));
+ proto_tree_add_uint_format_value(tree, hf_nas_eps_mbr_ul, tvb, curr_offset, 1, octet,
+ "%u kbps", calc_bitrate(octet));
}
curr_offset++;
if ((curr_offset - offset) >= len)
@@ -2363,24 +2357,24 @@ de_esm_qos(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
proto_tree_add_uint_format(tree, hf_nas_eps_mbr_dl, tvb, curr_offset, 1, octet,
"UE->NW Subscribed maximum bit rate for downlink/ NW->UE Reserved");
} else {
- proto_tree_add_uint_format(tree, hf_nas_eps_mbr_dl, tvb, curr_offset, 1, octet,
- "Maximum bit rate for downlink : %u kbps", calc_bitrate(octet));
+ proto_tree_add_uint_format_value(tree, hf_nas_eps_mbr_dl, tvb, curr_offset, 1, octet,
+ "%u kbps", calc_bitrate(octet));
}
curr_offset++;
if ((curr_offset - offset) >= len)
return(len);
/* Guaranteed bit rate for uplink octet 6 */
octet = tvb_get_guint8(tvb,curr_offset);
- proto_tree_add_uint_format(tree, hf_nas_eps_gbr_ul, tvb, curr_offset, 1, octet,
- "Guaranteed bit rate for uplink : %u kbps", calc_bitrate(octet));
+ proto_tree_add_uint_format_value(tree, hf_nas_eps_gbr_ul, tvb, curr_offset, 1, octet,
+ "%u kbps", calc_bitrate(octet));
curr_offset++;
if ((curr_offset - offset) >= len)
return(len);
/* Guaranteed bit rate for downlink octet 7 */
octet = tvb_get_guint8(tvb,curr_offset);
- proto_tree_add_uint_format(tree, hf_nas_eps_gbr_dl, tvb, curr_offset, 1, octet,
- "Guaranteed bit rate for downlink : %u kbps", calc_bitrate(octet));
+ proto_tree_add_uint_format_value(tree, hf_nas_eps_gbr_dl, tvb, curr_offset, 1, octet,
+ "%u kbps", calc_bitrate(octet));
curr_offset++;
if ((curr_offset - offset) >= len)
@@ -5556,22 +5550,22 @@ proto_register_nas_eps(void) {
NULL, HFILL }
},
{ &hf_nas_eps_emm_apn_ambr_ul_ext,
- { "APN-AMBR for uplink(Extended)","nas_eps.emm.apn_ambr_ul_ext",
+ { "APN-AMBR for uplink (extended)","nas_eps.emm.apn_ambr_ul_ext",
FT_UINT8,BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_nas_eps_emm_apn_ambr_dl_ext,
- { "APN-AMBR for downlink(Extended)","nas_eps.emm.apn_ambr_dl_ext",
+ { "APN-AMBR for downlink (extended)","nas_eps.emm.apn_ambr_dl_ext",
FT_UINT8,BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_nas_eps_emm_apn_ambr_ul_ext2,
- { "APN-AMBR for uplink(Extended-2)","nas_eps.emm.apn_ambr_ul_ext2",
+ { "APN-AMBR for uplink (extended-2)","nas_eps.emm.apn_ambr_ul_ext2",
FT_UINT8,BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_nas_eps_emm_apn_ambr_dl_ext2,
- { "APN-AMBR for downlink(Extended-2)","nas_eps.emm.apn_ambr_dl_ext2",
+ { "APN-AMBR for downlink (extended-2)","nas_eps.emm.apn_ambr_dl_ext2",
FT_UINT8,BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
diff --git a/epan/dissectors/packet-nettl.c b/epan/dissectors/packet-nettl.c
index 87f890defd..1ef61f70c0 100644
--- a/epan/dissectors/packet-nettl.c
+++ b/epan/dissectors/packet-nettl.c
@@ -215,21 +215,19 @@ dissect_nettl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
nettl_item = proto_tree_add_protocol_format(tree, proto_nettl, tvb,
0, -1, "HP-UX Network Tracing and Logging (nettl) header");
nettl_tree = proto_item_add_subtree(nettl_item, ett_nettl);
- proto_tree_add_uint_format(nettl_tree, hf_nettl_subsys, tvb,
- 0, 0, pinfo->pseudo_header->nettl.subsys,
- "Subsystem: %d (%s)", pinfo->pseudo_header->nettl.subsys,
- val_to_str_const(pinfo->pseudo_header->nettl.subsys, subsystem, "Unknown"));
- proto_tree_add_int(nettl_tree, hf_nettl_devid, tvb,
- 0, 0, pinfo->pseudo_header->nettl.devid);
- proto_tree_add_uint_format(nettl_tree, hf_nettl_kind, tvb,
- 0, 0, pinfo->pseudo_header->nettl.kind,
- "Trace Kind: 0x%08x (%s)", pinfo->pseudo_header->nettl.kind,
- val_to_str_const(pinfo->pseudo_header->nettl.kind & ~NETTL_HDR_SUBSYSTEM_BITS_MASK, trace_kind, "Unknown"));
- proto_tree_add_int(nettl_tree, hf_nettl_pid, tvb,
- 0, 0, pinfo->pseudo_header->nettl.pid);
- proto_tree_add_uint(nettl_tree, hf_nettl_uid, tvb,
- 0, 0, pinfo->pseudo_header->nettl.uid);
-
+ proto_tree_add_uint_format_value(nettl_tree, hf_nettl_subsys, tvb,
+ 0, 0, pinfo->pseudo_header->nettl.subsys, "%d (%s)", pinfo->pseudo_header->nettl.subsys,
+ val_to_str_const(pinfo->pseudo_header->nettl.subsys, subsystem, "Unknown"));
+ proto_tree_add_int(nettl_tree, hf_nettl_devid, tvb,
+ 0, 0, pinfo->pseudo_header->nettl.devid);
+ proto_tree_add_uint_format_value(nettl_tree, hf_nettl_kind, tvb,
+ 0, 0, pinfo->pseudo_header->nettl.kind,
+ "0x%08x (%s)", pinfo->pseudo_header->nettl.kind,
+ val_to_str_const(pinfo->pseudo_header->nettl.kind & ~NETTL_HDR_SUBSYSTEM_BITS_MASK, trace_kind, "Unknown"));
+ proto_tree_add_int(nettl_tree, hf_nettl_pid, tvb,
+ 0, 0, pinfo->pseudo_header->nettl.pid);
+ proto_tree_add_uint(nettl_tree, hf_nettl_uid, tvb,
+ 0, 0, pinfo->pseudo_header->nettl.uid);
}
switch (pinfo->fd->lnk_t) {
diff --git a/epan/dissectors/packet-nfs.c b/epan/dissectors/packet-nfs.c
index 9a293d41f2..0ea5597e5e 100644
--- a/epan/dissectors/packet-nfs.c
+++ b/epan/dissectors/packet-nfs.c
@@ -1758,10 +1758,8 @@ dissect_fhandle_data_NETAPP_V4(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree
tvb, offset + 4, 4, snapgen);
item = proto_tree_add_text(tree, tvb, offset + 8, 16, "file (inode %u)", inum);
subtree = proto_item_add_subtree(item, ett_nfs4_fh_file);
- item = proto_tree_add_uint_format(subtree, hf_nfs_fh_flags,
- tvb, offset + 8, 2, flags,
- "Flags: %#02x%s", flags,
- flag_string);
+ item = proto_tree_add_uint_format_value(subtree, hf_nfs_fh_flags,
+ tvb, offset + 8, 2, flags, "%#02x%s", flags, flag_string);
flag_tree = proto_item_add_subtree(item, ett_nfs4_fh_file_flags);
proto_tree_add_uint(flag_tree, hf_nfs_fh_file_flag_mntpoint, tvb, offset+8, 2, flags);
proto_tree_add_uint(flag_tree, hf_nfs_fh_file_flag_snapdir, tvb, offset+8, 2, flags);
@@ -1789,9 +1787,9 @@ dissect_fhandle_data_NETAPP_V4(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree
offset + 16, 4, generation);
proto_tree_add_uint(subtree, hf_nfs_fh_fsid, tvb,
offset + 20, 4, fsid);
- proto_tree_add_uint_format(tree, hf_nfs_fh_handle_type,
+ proto_tree_add_uint_format_value(tree, hf_nfs_fh_handle_type,
tvb, offset+24, 4, handle_type,
- "Handle type: %s(%#02x)", handle_string, handle_type);
+ "%s(%#02x)", handle_string, handle_type);
}
}
@@ -1829,9 +1827,9 @@ dissect_fhandle_data_NETAPP_GX_v3(tvbuff_t* tvb, packet_info *pinfo _U_, proto_t
if (tree) {
/* = utility = */
utility = tvb_get_guint8(tvb, offset);
- tf = proto_tree_add_uint_format(tree, hf_nfs3_gxfh_utlfield, tvb,
+ tf = proto_tree_add_uint_format_value(tree, hf_nfs3_gxfh_utlfield, tvb,
offset, 1, utility,
- " utility: 0x%02x",utility);
+ "0x%02x",utility);
field_tree = proto_item_add_subtree(tf, ett_nfs3_gxfh_utlfield);
@@ -1856,14 +1854,10 @@ dissect_fhandle_data_NETAPP_GX_v3(tvbuff_t* tvb, packet_info *pinfo _U_, proto_t
/* = volume count== */
volcnt = tvb_get_guint8(tvb, offset+1);
- proto_tree_add_uint_format(tree, hf_nfs3_gxfh_volcnt, tvb,
- offset+1, 1, volcnt,
- " volume count: 0x%02x (%d)", volcnt, volcnt);
+ proto_tree_add_uint(tree, hf_nfs3_gxfh_volcnt, tvb, offset+1, 1, volcnt);
/* = epoch = */
epoch = tvb_get_letohs(tvb, offset+2);
- proto_tree_add_uint_format(tree, hf_nfs3_gxfh_epoch, tvb,
- offset+2, 2, epoch,
- " epoch: 0x%04x (%u)", epoch, epoch);
+ proto_tree_add_uint(tree, hf_nfs3_gxfh_epoch, tvb, offset+2, 2, epoch);
/* = spin file handle = */
local_dsid = tvb_get_letohl(tvb, offset+4);
cluster_id = tvb_get_letohs(tvb, offset+8);
@@ -1876,16 +1870,9 @@ dissect_fhandle_data_NETAPP_GX_v3(tvbuff_t* tvb, packet_info *pinfo _U_, proto_t
" spin file handle");
field_tree = proto_item_add_subtree(tf, ett_nfs3_gxfh_sfhfield);
- proto_tree_add_uint_format(field_tree, hf_nfs3_gxfh_ldsid, tvb,
- offset+4, 4, local_dsid,
- " local dsid: 0x%08x (%u)", local_dsid, local_dsid);
- proto_tree_add_uint_format(field_tree, hf_nfs3_gxfh_cid, tvb,
- offset+8, 2, cluster_id,
- " cluster id: 0x%04x (%u)", cluster_id, cluster_id);
- proto_tree_add_uint_format(field_tree, hf_nfs3_gxfh_resv, tvb,
- offset+10, 1, reserved,
- " reserved: 0x%02x (%u)", reserved, reserved);
-
+ proto_tree_add_item(field_tree, hf_nfs3_gxfh_ldsid, tvb, offset+4, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(field_tree, hf_nfs3_gxfh_cid, tvb, offset+8, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(field_tree, hf_nfs3_gxfh_resv, tvb, offset+10, 1, ENC_BIG_ENDIAN);
tf = proto_tree_add_uint_format(field_tree, hf_nfs3_gxfh_sfhflags, tvb,
offset+11, 1, utility,
@@ -1931,16 +1918,9 @@ dissect_fhandle_data_NETAPP_GX_v3(tvbuff_t* tvb, packet_info *pinfo _U_, proto_t
" spin (mount point) file handle");
field_tree = proto_item_add_subtree(tf, ett_nfs3_gxfh_sfhfield);
- proto_tree_add_uint_format(field_tree, hf_nfs3_gxfh_ldsid, tvb,
- offset+20, 4, local_dsid,
- " local dsid: 0x%08x (%u)", local_dsid, local_dsid);
- proto_tree_add_uint_format(field_tree, hf_nfs3_gxfh_cid, tvb,
- offset+24, 2, cluster_id,
- " cluster id: 0x%04x (%u)", cluster_id, cluster_id);
- proto_tree_add_uint_format(field_tree, hf_nfs3_gxfh_resv, tvb,
- offset+26, 1, reserved,
- " reserved: 0x%02x (%u)", reserved, reserved);
-
+ proto_tree_add_item(field_tree, hf_nfs3_gxfh_ldsid, tvb, offset+20, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(field_tree, hf_nfs3_gxfh_cid, tvb, offset+24, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(field_tree, hf_nfs3_gxfh_resv, tvb, offset+26, 1, ENC_BIG_ENDIAN);
tf = proto_tree_add_uint_format(field_tree, hf_nfs3_gxfh_sfhflags, tvb,
offset+27, 1, utility,
@@ -1975,14 +1955,14 @@ dissect_fhandle_data_NETAPP_GX_v3(tvbuff_t* tvb, packet_info *pinfo _U_, proto_t
offset+32, 4, spinfile_uid);
/* = export point id = */
export_id = tvb_get_letohl(tvb, offset+36);
- proto_tree_add_uint_format(tree, hf_nfs3_gxfh_exportptid, tvb,
+ proto_tree_add_uint_format_value(tree, hf_nfs3_gxfh_exportptid, tvb,
offset+36, 4, spinfile_id,
- " export point id: 0x%08x (%u)", export_id, export_id);
+ "0x%08x (%u)", export_id, export_id);
/* = export point unique id = */
export_uid = tvb_get_letohl(tvb, offset+40);
- proto_tree_add_uint_format(tree, hf_nfs3_gxfh_exportptuid, tvb,
+ proto_tree_add_uint_format_value(tree, hf_nfs3_gxfh_exportptuid, tvb,
offset+40, 4, spinfile_id,
- " export point unique id: 0x%08x (%u)", export_uid, export_uid);
+ "0x%08x (%u)", export_uid, export_uid);
} /* end of (tree) */
}
@@ -7067,8 +7047,8 @@ dissect_nfs4_fattrs(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *t
/*
* Display the current Attr_mask bitmap (as of RFC 5661 NVSv4.1, there are up to 3) */
if (no_idx)
- bitmap_item = proto_tree_add_uint_format(tree, hf_nfs4_attr_mask, tvb,
- attr_mask_offset, 4, bitmap, "Attr mask: 0x%08x", bitmap);
+ bitmap_item = proto_tree_add_uint_format_value(tree, hf_nfs4_attr_mask, tvb,
+ attr_mask_offset, 4, bitmap, "0x%08x", bitmap);
else
bitmap_item = proto_tree_add_uint_format(tree, hf_nfs4_attr_mask, tvb,
attr_mask_offset, 4, bitmap, "Attr mask[%u]: 0x%08x", i, bitmap);
@@ -10543,7 +10523,7 @@ proto_register_nfs(void)
"generation", "nfs.fh.mount.generation", FT_UINT32, BASE_HEX,
NULL, 0, "mount point generation", HFILL }},
{ &hf_nfs_fh_flags, {
- "flags", "nfs.fh.flags", FT_UINT16, BASE_HEX,
+ "Flags", "nfs.fh.flags", FT_UINT16, BASE_HEX,
NULL, 0, "file handle flags", HFILL }},
{ &hf_nfs_fh_snapid, {
"snapid", "nfs.fh.snapid", FT_UINT8, BASE_DEC,
@@ -10570,7 +10550,7 @@ proto_register_nfs(void)
"snapid", "nfs.fh.export.snapid", FT_UINT8, BASE_DEC,
NULL, 0, "export point snapid", HFILL }},
{ &hf_nfs_fh_handle_type, {
- "handletype", "nfs.fh.handletype", FT_UINT32, BASE_DEC,
+ "Handle type", "nfs.fh.handletype", FT_UINT32, BASE_DEC,
NULL, 0, "v4 handle type", HFILL }},
{ &hf_nfs_fh_file_flag_mntpoint, {
"mount point", "nfs.fh.file.flag.mntpoint", FT_UINT16, BASE_HEX,
@@ -11198,7 +11178,7 @@ proto_register_nfs(void)
VALS(fattr4_names), 0, "Recommended Attribute", HFILL }},
{ &hf_nfs4_attr_mask, {
- "attr_mask", "nfs.attr_mask", FT_UINT32, BASE_HEX,
+ "Attr mask", "nfs.attr_mask", FT_UINT32, BASE_HEX,
NULL, 0, "ACL attribute mask", HFILL }},
{ &hf_nfs4_time_how, {
@@ -11715,23 +11695,23 @@ proto_register_nfs(void)
NULL, NFS3GX_FH_VER_MASK, NULL, HFILL }},
{ &hf_nfs3_gxfh_volcnt, {
- "volume count", "nfs.gxfh3.volcnt", FT_UINT8, BASE_HEX,
+ "volume count", "nfs.gxfh3.volcnt", FT_UINT8, BASE_HEX_DEC,
NULL, 0, NULL, HFILL }},
{ &hf_nfs3_gxfh_epoch, {
- "epoch", "nfs.gxfh3.epoch", FT_UINT16, BASE_HEX,
+ "epoch", "nfs.gxfh3.epoch", FT_UINT16, BASE_HEX_DEC,
NULL, 0, NULL, HFILL }},
{ &hf_nfs3_gxfh_ldsid, {
- "local dsid", "nfs.gxfh3.ldsid", FT_UINT32, BASE_HEX,
+ "local dsid", "nfs.gxfh3.ldsid", FT_UINT32, BASE_HEX_DEC,
NULL, 0, NULL, HFILL }},
{ &hf_nfs3_gxfh_cid, {
- "cluster id", "nfs.gxfh3.cid", FT_UINT16, BASE_HEX,
+ "cluster id", "nfs.gxfh3.cid", FT_UINT16, BASE_HEX_DEC,
NULL, 0, NULL, HFILL }},
{ &hf_nfs3_gxfh_resv, {
- "reserved", "nfs.gxfh3.reserved", FT_UINT16, BASE_HEX,
+ "reserved", "nfs.gxfh3.reserved", FT_UINT16, BASE_HEX_DEC,
NULL, 0, NULL, HFILL }},
{ &hf_nfs3_gxfh_sfhflags, {
@@ -11783,11 +11763,11 @@ proto_register_nfs(void)
NULL, 0, NULL, HFILL }},
{ &hf_nfs3_gxfh_exportptid, {
- "export point id", "nfs.gxfh3.exportptid", FT_UINT32, BASE_HEX,
+ "export point id", "nfs.gxfh3.exportptid", FT_UINT32, BASE_HEX_DEC,
NULL, 0, NULL, HFILL }},
{ &hf_nfs3_gxfh_exportptuid, {
- "export point unique id", "nfs.gxfh3.exportptuid", FT_UINT32, BASE_HEX,
+ "export point unique id", "nfs.gxfh3.exportptuid", FT_UINT32, BASE_HEX_DEC,
NULL, 0, NULL, HFILL }},
{ &hf_nfs4_length_minlength, {
diff --git a/epan/dissectors/packet-nhrp.c b/epan/dissectors/packet-nhrp.c
index 94bbab6a3b..fac16a6a7b 100644
--- a/epan/dissectors/packet-nhrp.c
+++ b/epan/dissectors/packet-nhrp.c
@@ -381,16 +381,16 @@ void dissect_nhrp_hdr(tvbuff_t *tvb,
ipcsum = nhrp_checksum(tvb_get_ptr(tvb, 0, total_len),
total_len);
if (ipcsum == 0) {
- proto_tree_add_uint_format(nhrp_tree, hf_nhrp_hdr_chksum, tvb, offset, 2, rx_chksum,
- "NHRP Packet checksum: 0x%04x [correct]", rx_chksum);
+ proto_tree_add_uint_format_value(nhrp_tree, hf_nhrp_hdr_chksum, tvb, offset, 2, rx_chksum,
+ "0x%04x [correct]", rx_chksum);
} else {
- proto_tree_add_uint_format(nhrp_tree, hf_nhrp_hdr_chksum, tvb, offset, 2, rx_chksum,
- "NHRP Packet checksum: 0x%04x [incorrect, should be 0x%04x]", rx_chksum,
+ proto_tree_add_uint_format_value(nhrp_tree, hf_nhrp_hdr_chksum, tvb, offset, 2, rx_chksum,
+ "0x%04x [incorrect, should be 0x%04x]", rx_chksum,
in_cksum_shouldbe(rx_chksum, ipcsum));
}
} else {
- proto_tree_add_uint_format(nhrp_tree, hf_nhrp_hdr_chksum, tvb, offset, 2, rx_chksum,
- "NHRP Packet checksum: 0x%04x [not all data available]", rx_chksum);
+ proto_tree_add_uint_format_value(nhrp_tree, hf_nhrp_hdr_chksum, tvb, offset, 2, rx_chksum,
+ "0x%04x [not all data available]", rx_chksum);
}
offset += 2;
@@ -402,16 +402,16 @@ void dissect_nhrp_hdr(tvbuff_t *tvb,
offset += 2;
hdr->ar_op_version = tvb_get_guint8(tvb, offset);
- proto_tree_add_uint_format(nhrp_tree, hf_nhrp_hdr_version, tvb, offset, 1,
- hdr->ar_op_version, "Version : %u (%s)", hdr->ar_op_version,
+ proto_tree_add_uint_format_value(nhrp_tree, hf_nhrp_hdr_version, tvb, offset, 1,
+ hdr->ar_op_version, "%u (%s)", hdr->ar_op_version,
(hdr->ar_op_version == 1) ? "NHRP - rfc2332" : "Unknown");
offset += 1;
proto_tree_add_item(nhrp_tree, hf_nhrp_hdr_op_type, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
hdr->ar_shtl = tvb_get_guint8(tvb, offset);
- shtl_tree_item = proto_tree_add_uint_format(nhrp_tree, hf_nhrp_hdr_shtl,
- tvb, offset, 1, hdr->ar_shtl, "Source Address Type/Len: %s/%u",
+ shtl_tree_item = proto_tree_add_uint_format_value(nhrp_tree, hf_nhrp_hdr_shtl,
+ tvb, offset, 1, hdr->ar_shtl, "%s/%u",
val_to_str_const(NHRP_SHTL_TYPE(hdr->ar_shtl), nhrp_shtl_type_vals, "Unknown Type"),
NHRP_SHTL_LEN(hdr->ar_shtl));
shtl_tree = proto_item_add_subtree(shtl_tree_item, ett_nhrp_hdr_shtl);
@@ -420,8 +420,8 @@ void dissect_nhrp_hdr(tvbuff_t *tvb,
offset += 1;
hdr->ar_sstl = tvb_get_guint8(tvb, offset);
- sstl_tree_item = proto_tree_add_uint_format(nhrp_tree, hf_nhrp_hdr_sstl,
- tvb, offset, 1, hdr->ar_sstl, "Source SubAddress Type/Len: %s/%u",
+ sstl_tree_item = proto_tree_add_uint_format_value(nhrp_tree, hf_nhrp_hdr_sstl,
+ tvb, offset, 1, hdr->ar_sstl, "%s/%u",
val_to_str_const(NHRP_SHTL_TYPE(hdr->ar_sstl), nhrp_shtl_type_vals, "Unknown Type"),
NHRP_SHTL_LEN(hdr->ar_sstl));
sstl_tree = proto_item_add_subtree(sstl_tree_item, ett_nhrp_hdr_sstl);
@@ -501,9 +501,8 @@ void dissect_cie_list(tvbuff_t *tvb,
offset += 2;
val = tvb_get_guint8(tvb, offset);
- cli_addr_tree_item = proto_tree_add_uint_format(cie_tree,
- hf_nhrp_cli_addr_tl, tvb, offset, 1, val,
- "Client Address Type/Len: %s/%u",
+ cli_addr_tree_item = proto_tree_add_uint_format_value(cie_tree,
+ hf_nhrp_cli_addr_tl, tvb, offset, 1, val, "%s/%u",
val_to_str_const(NHRP_SHTL_TYPE(val), nhrp_shtl_type_vals, "Unknown Type"),
NHRP_SHTL_LEN(val));
cli_addr_tree = proto_item_add_subtree(cli_addr_tree_item, ett_nhrp_cie_cli_addr_tl);
@@ -512,9 +511,8 @@ void dissect_cie_list(tvbuff_t *tvb,
offset += 1;
val = tvb_get_guint8(tvb, offset);
- cli_saddr_tree_item = proto_tree_add_uint_format(cie_tree,
- hf_nhrp_cli_saddr_tl, tvb, offset, 1, val,
- "Client Sub Address Type/Len: %s/%u",
+ cli_saddr_tree_item = proto_tree_add_uint_format_value(cie_tree,
+ hf_nhrp_cli_saddr_tl, tvb, offset, 1, val, "%s/%u",
val_to_str_const(NHRP_SHTL_TYPE(val), nhrp_shtl_type_vals, "Unknown Type"),
NHRP_SHTL_LEN(val));
cli_saddr_tree = proto_item_add_subtree(cli_saddr_tree_item, ett_nhrp_cie_cli_saddr_tl);
@@ -1062,7 +1060,7 @@ proto_register_nhrp(void)
NULL, HFILL }
},
{ &hf_nhrp_hdr_chksum,
- { "Packet Checksum", "nhrp.hdr.chksum",
+ { "NHRP Packet Checksum", "nhrp.hdr.chksum",
FT_UINT16, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
diff --git a/epan/dissectors/packet-nsip.c b/epan/dissectors/packet-nsip.c
index b91ac2f2b7..9bffadf1de 100644
--- a/epan/dissectors/packet-nsip.c
+++ b/epan/dissectors/packet-nsip.c
@@ -301,12 +301,9 @@ decode_iei_cause(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) {
if (bi->nsip_tree) {
cause = tvb_get_guint8(bi->tvb, bi->offset);
- proto_tree_add_uint_format(bi->nsip_tree, hf_nsip_cause,
+ proto_tree_add_uint(bi->nsip_tree, hf_nsip_cause,
bi->tvb, ie_start_offset, ie->total_length,
- cause,
- "Cause: %s (%#02x)",
- val_to_str_const(cause, tab_nsip_cause_values,
- "Unknown"), cause);
+ cause);
col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP,
"Cause: %s",
val_to_str(cause, tab_nsip_cause_values, "Unknown (0x%02x)"));
@@ -324,10 +321,9 @@ decode_iei_ns_vci(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) {
if (bi->nsip_tree) {
ns_vci = tvb_get_ntohs(bi->tvb, bi->offset);
- proto_tree_add_uint_format(bi->nsip_tree, hf_nsip_ns_vci,
+ proto_tree_add_uint(bi->nsip_tree, hf_nsip_ns_vci,
bi->tvb, ie_start_offset, ie->total_length,
- ns_vci,
- "NS VCI: %#04x", ns_vci);
+ ns_vci);
col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, NSIP_SEP,
"NS VCI: %#04x", ns_vci);
proto_item_append_text(bi->ti, ", NS VCI: %#04x", ns_vci);
@@ -473,10 +469,9 @@ decode_iei_max_num_ns_vc(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) {
if (bi->nsip_tree) {
num_ns_vc = tvb_get_ntohs(bi->tvb, bi->offset);
- proto_tree_add_uint_format(bi->nsip_tree, hf_nsip_max_num_ns_vc,
+ proto_tree_add_uint(bi->nsip_tree, hf_nsip_max_num_ns_vc,
bi->tvb, ie_start_offset, ie->total_length,
- num_ns_vc,
- "Maximum Number of NS-VCs: %u", num_ns_vc);
+ num_ns_vc);
}
bi->offset += 2;
}
@@ -488,10 +483,9 @@ decode_iei_num_ip4_endpoints(nsip_ie_t *ie, build_info_t *bi, int ie_start_offse
if (bi->nsip_tree) {
num_endpoints = tvb_get_ntohs(bi->tvb, bi->offset);
- proto_tree_add_uint_format(bi->nsip_tree, hf_nsip_num_ip4_endpoints,
+ proto_tree_add_uint(bi->nsip_tree, hf_nsip_num_ip4_endpoints,
bi->tvb, ie_start_offset, ie->total_length,
- num_endpoints,
- "Number of IP4 Endpoints: %u", num_endpoints);
+ num_endpoints);
}
bi->offset += 2;
}
@@ -503,10 +497,9 @@ decode_iei_num_ip6_endpoints(nsip_ie_t *ie, build_info_t *bi, int ie_start_offse
if (bi->nsip_tree) {
num_endpoints = tvb_get_ntohs(bi->tvb, bi->offset);
- proto_tree_add_uint_format(bi->nsip_tree, hf_nsip_num_ip6_endpoints,
+ proto_tree_add_uint(bi->nsip_tree, hf_nsip_num_ip6_endpoints,
bi->tvb, ie_start_offset, ie->total_length,
- num_endpoints,
- "Number of IP6 Endpoints: %u", num_endpoints);
+ num_endpoints);
}
bi->offset += 2;
}
@@ -993,11 +986,7 @@ dissect_nsip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
bi.ti = proto_tree_add_item(tree, proto_nsip, tvb, 0, -1,
ENC_NA);
nsip_tree = proto_item_add_subtree(bi.ti, ett_nsip);
- proto_tree_add_uint_format(nsip_tree, hf_nsip_pdu_type, tvb, 0, 1,
- pdu_type,
- "PDU type: %s (%#02x)",
- val_to_str_const(pdu_type, tab_nsip_pdu_types,
- "Unknown"), pdu_type);
+ proto_tree_add_item(nsip_tree, hf_nsip_pdu_type, tvb, 0, 1, ENC_NA);
proto_item_append_text(bi.ti, ", PDU type: %s",
val_to_str_const(pdu_type, tab_nsip_pdu_types, "Unknown"));
bi.nsip_tree = nsip_tree;
@@ -1019,7 +1008,7 @@ proto_register_nsip(void)
},
{ &hf_nsip_ns_vci,
{ "NS-VCI", "nsip.ns_vci",
- FT_UINT16, BASE_DEC, NULL, 0x0,
+ FT_UINT16, BASE_HEX, NULL, 0x0,
"Network Service Virtual Link Identifier", HFILL }
},
{ &hf_nsip_pdu_type,
diff --git a/epan/dissectors/packet-nt-tpcp.c b/epan/dissectors/packet-nt-tpcp.c
index 301d67ae1f..2b08a159fa 100644
--- a/epan/dissectors/packet-nt-tpcp.c
+++ b/epan/dissectors/packet-nt-tpcp.c
@@ -144,10 +144,7 @@ dissect_tpcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tpcp_tree = proto_item_add_subtree(ti, ett_tpcp);
proto_tree_add_uint(tpcp_tree, hf_tpcp_version, tvb, 0, 1, tpcph.version);
-
- proto_tree_add_uint_format(tpcp_tree, hf_tpcp_type, tvb, 1, 1, tpcph.type,
- "Type: %s (%d)",
- val_to_str_const(tpcph.type, type_vals, "Unknown"), tpcph.type);
+ proto_tree_add_uint(tpcp_tree, hf_tpcp_type, tvb, 1, 1, tpcph.type);
/* flags next , i'll do that when I can work out how to do it :-( */
tf = proto_tree_add_text(tpcp_tree, tvb, 2, 2, "Flags: 0x%04x",tpcph.flags);
@@ -160,8 +157,8 @@ dissect_tpcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_uint(tpcp_tree, hf_tpcp_id, tvb, 4, 2, tpcph.id);
- proto_tree_add_uint_format(tpcp_tree, hf_tpcp_cport, tvb, 6, 2, tpcph.cport,
- "Client Source port: %s", get_udp_port(tpcph.cport));
+ proto_tree_add_uint_format_value(tpcp_tree, hf_tpcp_cport, tvb, 6, 2, tpcph.cport,
+ "%s", get_udp_port(tpcph.cport));
proto_tree_add_ipv4(tpcp_tree, hf_tpcp_caddr, tvb, 8, 4, tpcph.caddr);
@@ -185,7 +182,7 @@ proto_register_tpcp(void)
"TPCP version", HFILL }},
{ &hf_tpcp_type,
- { "Type", "tpcp.type", FT_UINT8, BASE_DEC,NULL, 0x0,
+ { "Type", "tpcp.type", FT_UINT8, BASE_DEC, VALS(type_vals), 0x0,
"PDU type", HFILL }},
{ &hf_tpcp_flags_tcp,
diff --git a/epan/dissectors/packet-ntp.c b/epan/dissectors/packet-ntp.c
index eee6257514..a9fee7b227 100644
--- a/epan/dissectors/packet-ntp.c
+++ b/epan/dissectors/packet-ntp.c
@@ -763,17 +763,17 @@ dissect_ntp_std(tvbuff_t *tvb, proto_tree *ntp_tree, guint8 flags)
*/
stratum = tvb_get_guint8(tvb, 1);
if (stratum == 0) {
- buffc="Peer Clock Stratum: unspecified or invalid (%u)";
+ buffc="unspecified or invalid (%u)";
} else if (stratum == 1) {
- buffc="Peer Clock Stratum: primary reference (%u)";
+ buffc="primary reference (%u)";
} else if ((stratum >= 2) && (stratum <= 15)) {
- buffc="Peer Clock Stratum: secondary reference (%u)";
+ buffc="secondary reference (%u)";
} else if (stratum == 16) {
- buffc="Peer Clock Stratum: unsynchronized (%u)";
+ buffc="unsynchronized (%u)";
} else {
- buffc="Peer Clock Stratum: reserved: %u";
+ buffc="reserved: %u";
}
- proto_tree_add_uint_format(ntp_tree, hf_ntp_stratum, tvb, 1, 1,
+ proto_tree_add_uint_format_value(ntp_tree, hf_ntp_stratum, tvb, 1, 1,
stratum, buffc, stratum);
/* Poll interval, 1byte field indicating the maximum interval
* between successive messages, in seconds to the nearest
diff --git a/epan/dissectors/packet-quake2.c b/epan/dissectors/packet-quake2.c
index bcacd1c536..a4e277d62f 100644
--- a/epan/dissectors/packet-quake2.c
+++ b/epan/dissectors/packet-quake2.c
@@ -703,8 +703,7 @@ dissect_quake2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tvb_get_ntohl(tvb, 0) == 0xffffffff) {
col_append_str(pinfo->cinfo, COL_INFO, " Connectionless");
- if (quake2_tree)
- proto_tree_add_uint_format(quake2_tree,
+ proto_tree_add_uint_format(quake2_tree,
hf_quake2_connectionless,
tvb, 0, 0, 1,
"Type: Connectionless");
@@ -713,8 +712,7 @@ dissect_quake2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
else {
col_append_str(pinfo->cinfo, COL_INFO, " Game");
- if (quake2_tree)
- proto_tree_add_uint_format(quake2_tree,
+ proto_tree_add_uint_format(quake2_tree,
hf_quake2_game,
tvb, 0, 0, 1,
"Type: Game");
diff --git a/epan/dissectors/packet-quake3.c b/epan/dissectors/packet-quake3.c
index e8bc42be93..598e24d2fc 100644
--- a/epan/dissectors/packet-quake3.c
+++ b/epan/dissectors/packet-quake3.c
@@ -477,8 +477,7 @@ dissect_quake3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tvb_get_ntohl(tvb, 0) == 0xffffffff) {
col_set_str(pinfo->cinfo, COL_INFO, "Connectionless ");
- if (quake3_tree)
- proto_tree_add_uint_format(quake3_tree,
+ proto_tree_add_uint_format(quake3_tree,
hf_quake3_connectionless,
tvb, 0, 0, 1,
"Type: Connectionless");
@@ -487,8 +486,7 @@ dissect_quake3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
else {
col_set_str(pinfo->cinfo, COL_INFO, "Game ");
- if (quake3_tree)
- proto_tree_add_uint_format(quake3_tree,
+ proto_tree_add_uint_format(quake3_tree,
hf_quake3_game,
tvb, 0, 0, 1,
"Type: Game");
diff --git a/epan/dissectors/packet-quakeworld.c b/epan/dissectors/packet-quakeworld.c
index 53ece18dcd..377cbaa5d9 100644
--- a/epan/dissectors/packet-quakeworld.c
+++ b/epan/dissectors/packet-quakeworld.c
@@ -693,8 +693,7 @@ dissect_quakeworld(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tvb_get_ntohl(tvb, 0) == 0xffffffff) {
col_append_str(pinfo->cinfo, COL_INFO, " Connectionless");
- if (quakeworld_tree)
- proto_tree_add_uint_format(quakeworld_tree,
+ proto_tree_add_uint_format(quakeworld_tree,
hf_quakeworld_connectionless,
tvb, 0, 0, 1,
"Type: Connectionless");
@@ -703,8 +702,7 @@ dissect_quakeworld(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
else {
col_append_str(pinfo->cinfo, COL_INFO, " Game");
- if (quakeworld_tree)
- proto_tree_add_uint_format(quakeworld_tree,
+ proto_tree_add_uint_format(quakeworld_tree,
hf_quakeworld_game,
tvb, 0, 0, 1,
"Type: Game");
diff --git a/epan/dissectors/packet-rtcp.c b/epan/dissectors/packet-rtcp.c
index efbf16edd4..2ce8902391 100644
--- a/epan/dissectors/packet-rtcp.c
+++ b/epan/dissectors/packet-rtcp.c
@@ -1902,8 +1902,8 @@ dissect_rtcp_xr(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tree,
/* Discard Rate */
fraction_rate = tvb_get_guint8(tvb, offset);
- proto_tree_add_uint_format(content_tree, hf_rtcp_ssrc_discarded, tvb, offset, 1,
- fraction_rate, "Fraction Discarded: %u / 256", fraction_rate);
+ proto_tree_add_uint_format_value(content_tree, hf_rtcp_ssrc_discarded, tvb, offset, 1,
+ fraction_rate, "%u / 256", fraction_rate);
offset++;
/* Burst Density */
diff --git a/epan/dissectors/packet-rtp.c b/epan/dissectors/packet-rtp.c
index 029a100097..6281a31768 100644
--- a/epan/dissectors/packet-rtp.c
+++ b/epan/dissectors/packet-rtp.c
@@ -1311,8 +1311,8 @@ dissect_rtp_rfc2198(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ti = proto_tree_add_text(rfc2198_tree, tvb, offset, (hdr_follow)?4:1, "Header %u", cnt);
rfc2198_hdr_tree = proto_item_add_subtree(ti, ett_rtp_rfc2198_hdr);
proto_tree_add_item(rfc2198_hdr_tree, hf_rtp_rfc2198_follow, tvb, offset, 1, ENC_BIG_ENDIAN );
- proto_tree_add_uint_format(rfc2198_hdr_tree, hf_rtp_payload_type, tvb,
- offset, 1, octet1, "Payload type: %s (%u)",
+ proto_tree_add_uint_format_value(rfc2198_hdr_tree, hf_rtp_payload_type, tvb,
+ offset, 1, octet1, "%s (%u)",
payload_type_str ? payload_type_str : val_to_str_ext_const(hdr_new->pt, &rtp_payload_type_vals_ext, "Unknown"),
hdr_new->pt);
proto_item_append_text(ti, ": PT=%s",
@@ -1682,8 +1682,8 @@ dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
proto_tree_add_boolean( rtp_tree, hf_rtp_marker, tvb, offset,
1, octet2 );
- proto_tree_add_uint_format( rtp_tree, hf_rtp_payload_type, tvb,
- offset, 1, octet2, "Payload type: %s (%u)",
+ proto_tree_add_uint_format_value( rtp_tree, hf_rtp_payload_type, tvb,
+ offset, 1, octet2, "%s (%u)",
payload_type_str ? payload_type_str : val_to_str_ext_const( payload_type, &rtp_payload_type_vals_ext,"Unknown"),
payload_type);
@@ -1709,15 +1709,14 @@ dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
}
/* CSRC list*/
if ( csrc_count > 0 ) {
- if ( tree ) {
- ti = proto_tree_add_item(rtp_tree, hf_rtp_csrc_items, tvb, offset,
+ ti = proto_tree_add_item(rtp_tree, hf_rtp_csrc_items, tvb, offset,
csrc_count * 4, ENC_NA);
- proto_item_append_text(ti, " (%u items)", csrc_count);
- rtp_csrc_tree = proto_item_add_subtree( ti, ett_csrc_list );
- }
- for (i = 0; i < csrc_count; i++ ) {
+ proto_item_append_text(ti, " (%u items)", csrc_count);
+ rtp_csrc_tree = proto_item_add_subtree( ti, ett_csrc_list );
+
+ for (i = 0; i < csrc_count; i++ ) {
csrc_item = tvb_get_ntohl( tvb, offset );
- if ( tree ) proto_tree_add_uint_format( rtp_csrc_tree,
+ proto_tree_add_uint_format( rtp_csrc_tree,
hf_rtp_csrc_item, tvb, offset, 4,
csrc_item,
"CSRC item %d: 0x%X",
diff --git a/epan/dissectors/packet-simulcrypt.c b/epan/dissectors/packet-simulcrypt.c
index 6a368a60bc..69f33e87f5 100644
--- a/epan/dissectors/packet-simulcrypt.c
+++ b/epan/dissectors/packet-simulcrypt.c
@@ -1240,8 +1240,8 @@ dissect_simulcrypt_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Message Type 2 Bytes */
proto_tree_add_item(simulcrypt_header_tree, hf_simulcrypt_message_type, tvb, offset, 2, ENC_BIG_ENDIAN);
- simulcrypt_item = proto_tree_add_uint_format(simulcrypt_header_tree, hf_simulcrypt_interface, tvb, offset, 2, iftype,
- "Interface: %s", val_to_str_const(iftype, interfacenames, "Unknown"));
+ simulcrypt_item = proto_tree_add_uint_format_value(simulcrypt_header_tree, hf_simulcrypt_interface, tvb, offset, 2, iftype,
+ "%s", val_to_str_const(iftype, interfacenames, "Unknown"));
PROTO_ITEM_SET_GENERATED (simulcrypt_item);
offset+=2;
diff --git a/epan/dissectors/packet-slsk.c b/epan/dissectors/packet-slsk.c
index eac8ea8523..4bb7ba49fa 100644
--- a/epan/dissectors/packet-slsk.c
+++ b/epan/dissectors/packet-slsk.c
@@ -372,8 +372,8 @@ static void dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
"Message Type: %s (Code: %02d)", message_type, msg_code);
offset += 4;
i=tvb_get_guint8(tvb, offset);
- proto_tree_add_uint_format(slsk_tree, hf_slsk_login_successful, tvb, offset, 1, tvb_get_guint8(tvb, offset),
- "Login successful: %s (Byte: %d)", val_to_str_const(tvb_get_guint8(tvb, offset), slsk_yes_no, "Unknown"), tvb_get_guint8(tvb, offset));
+ proto_tree_add_uint_format_value(slsk_tree, hf_slsk_login_successful, tvb, offset, 1, tvb_get_guint8(tvb, offset),
+ "%s (Byte: %d)", val_to_str_const(tvb_get_guint8(tvb, offset), slsk_yes_no, "Unknown"), tvb_get_guint8(tvb, offset));
offset += 1;
proto_tree_add_uint(slsk_tree, hf_slsk_string_length, tvb, offset, 4, tvb_get_letohl(tvb, offset));
proto_tree_add_item(slsk_tree, hf_slsk_login_message, tvb, offset+4, tvb_get_letohl(tvb, offset), ENC_ASCII|ENC_NA);
@@ -444,8 +444,8 @@ static void dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
proto_tree_add_uint(slsk_tree, hf_slsk_string_length, tvb, offset, 4, tvb_get_letohl(tvb, offset));
proto_tree_add_item(slsk_tree, hf_slsk_username, tvb, offset+4, tvb_get_letohl(tvb, offset), ENC_ASCII|ENC_NA);
offset += 4+tvb_get_letohl(tvb, offset);
- proto_tree_add_uint_format(slsk_tree, hf_slsk_user_exists, tvb, offset, 1, tvb_get_guint8(tvb, offset),
- "User exists: %s (Byte: %d)", val_to_str_const(tvb_get_guint8(tvb, offset), slsk_yes_no, "Unknown"), tvb_get_guint8(tvb, offset));
+ proto_tree_add_uint_format_value(slsk_tree, hf_slsk_user_exists, tvb, offset, 1, tvb_get_guint8(tvb, offset),
+ "%s (Byte: %d)", val_to_str_const(tvb_get_guint8(tvb, offset), slsk_yes_no, "Unknown"), tvb_get_guint8(tvb, offset));
offset += 1;
}
else if (check_slsk_format(tvb, offset, "is")) {
@@ -2448,7 +2448,7 @@ proto_register_slsk(void)
{ "IP Address", "slsk.ip.address",
FT_IPv4, BASE_NONE, NULL, 0, NULL, HFILL } },
{ &hf_slsk_user_exists,
- { "user exists", "slsk.user.exists",
+ { "User exists", "slsk.user.exists",
FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } },
{ &hf_slsk_status_code,
{ "Status Code", "slsk.status.code",
diff --git a/epan/dissectors/packet-spp.c b/epan/dissectors/packet-spp.c
index bdb2ce153f..745c7b1425 100644
--- a/epan/dissectors/packet-spp.c
+++ b/epan/dissectors/packet-spp.c
@@ -150,16 +150,14 @@ dissect_spp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (tree) {
if (datastream_type_string != NULL) {
- proto_tree_add_uint_format(spp_tree, hf_spp_datastream_type, tvb,
+ proto_tree_add_uint_format_value(spp_tree, hf_spp_datastream_type, tvb,
1, 1, datastream_type,
- "Datastream Type: %s (0x%02X)",
+ "%s (0x%02X)",
datastream_type_string,
datastream_type);
} else {
- proto_tree_add_uint_format(spp_tree, hf_spp_datastream_type, tvb,
- 1, 1, datastream_type,
- "Datastream Type: 0x%02X",
- datastream_type);
+ proto_tree_add_uint(spp_tree, hf_spp_datastream_type, tvb,
+ 1, 1, datastream_type);
}
proto_tree_add_item(spp_tree, hf_spp_src_id, tvb, 2, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(spp_tree, hf_spp_dst_id, tvb, 4, 2, ENC_BIG_ENDIAN);
@@ -222,7 +220,7 @@ proto_register_spp(void)
NULL, HFILL }},
{ &hf_spp_datastream_type,
- { "Datastream type", "spp.type",
+ { "Datastream Type", "spp.type",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }},
diff --git a/epan/dissectors/packet-sua.c b/epan/dissectors/packet-sua.c
index 5f7cc5305f..eded3c25e7 100644
--- a/epan/dissectors/packet-sua.c
+++ b/epan/dissectors/packet-sua.c
@@ -542,7 +542,7 @@ dissect_common_header(tvbuff_t *common_header_tvb, packet_info *pinfo, proto_tre
proto_tree_add_item(sua_tree, hf_sua_version, common_header_tvb, VERSION_OFFSET, VERSION_LENGTH, ENC_BIG_ENDIAN);
proto_tree_add_item(sua_tree, hf_sua_reserved, common_header_tvb, RESERVED_OFFSET, RESERVED_LENGTH, ENC_NA);
proto_tree_add_item(sua_tree, hf_sua_message_class, common_header_tvb, MESSAGE_CLASS_OFFSET, MESSAGE_CLASS_LENGTH, ENC_BIG_ENDIAN);
- proto_tree_add_uint_format(sua_tree, hf_sua_message_type, common_header_tvb, MESSAGE_TYPE_OFFSET, MESSAGE_TYPE_LENGTH, message_type, "Message Type: %s (%u)",
+ proto_tree_add_uint_format_value(sua_tree, hf_sua_message_type, common_header_tvb, MESSAGE_TYPE_OFFSET, MESSAGE_TYPE_LENGTH, message_type, "%s (%u)",
val_to_str_const(message_class * 256 + message_type, message_class_type_values, "reserved"), message_type);
proto_tree_add_item(sua_tree, hf_sua_message_length, common_header_tvb, MESSAGE_LENGTH_OFFSET, MESSAGE_LENGTH_LENGTH, ENC_BIG_ENDIAN);
};
@@ -730,8 +730,8 @@ dissect_status_type_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tre
status_info = tvb_get_ntohs(parameter_tvb, STATUS_INFO_OFFSET);
proto_tree_add_item(parameter_tree, hf_sua_status_type, parameter_tvb, STATUS_TYPE_OFFSET, STATUS_TYPE_LENGTH, ENC_BIG_ENDIAN);
- proto_tree_add_uint_format(parameter_tree, hf_sua_status_info, parameter_tvb, STATUS_INFO_OFFSET, STATUS_INFO_LENGTH,
- status_info, "Status info: %s (%u)", val_to_str_const(status_type * 256 * 256 + status_info, status_type_info_values, "unknown"), status_info);
+ proto_tree_add_uint_format_value(parameter_tree, hf_sua_status_info, parameter_tvb, STATUS_INFO_OFFSET, STATUS_INFO_LENGTH,
+ status_info, "%s (%u)", val_to_str_const(status_type * 256 * 256 + status_info, status_type_info_values, "unknown"), status_info);
proto_item_append_text(parameter_item, " (%s)", val_to_str_const(status_type * 256 * 256 + status_info, status_type_info_values, "unknown"));
}
diff --git a/epan/dissectors/packet-tcp.c b/epan/dissectors/packet-tcp.c
index 56d1d9a44d..34b7f71cbe 100644
--- a/epan/dissectors/packet-tcp.c
+++ b/epan/dissectors/packet-tcp.c
@@ -4063,10 +4063,10 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tcp_tree = proto_item_add_subtree(ti, ett_tcp);
pinfo->tcp_tree=tcp_tree;
- proto_tree_add_uint_format(tcp_tree, hf_tcp_srcport, tvb, offset, 2, tcph->th_sport,
- "Source port: %s (%u)", get_tcp_port(tcph->th_sport), tcph->th_sport);
- proto_tree_add_uint_format(tcp_tree, hf_tcp_dstport, tvb, offset + 2, 2, tcph->th_dport,
- "Destination port: %s (%u)", get_tcp_port(tcph->th_dport), tcph->th_dport);
+ proto_tree_add_uint_format_value(tcp_tree, hf_tcp_srcport, tvb, offset, 2, tcph->th_sport,
+ "%s (%u)", get_tcp_port(tcph->th_sport), tcph->th_sport);
+ proto_tree_add_uint_format_value(tcp_tree, hf_tcp_dstport, tvb, offset + 2, 2, tcph->th_dport,
+ "%s (%u)", get_tcp_port(tcph->th_dport), tcph->th_dport);
hidden_item = proto_tree_add_uint(tcp_tree, hf_tcp_port, tvb, offset, 2, tcph->th_sport);
PROTO_ITEM_SET_HIDDEN(hidden_item);
hidden_item = proto_tree_add_uint(tcp_tree, hf_tcp_port, tvb, offset + 2, 2, tcph->th_dport);
@@ -4270,8 +4270,8 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_append_fstr(pinfo->cinfo, COL_INFO, ", bogus TCP header length (%u, must be at least %u)",
tcph->th_hlen, TCPH_MIN_LEN);
if (tree) {
- proto_tree_add_uint_format(tcp_tree, hf_tcp_hdr_len, tvb, offset + 12, 1, tcph->th_hlen,
- "Header length: %u bytes (bogus, must be at least %u)", tcph->th_hlen,
+ proto_tree_add_uint_format_value(tcp_tree, hf_tcp_hdr_len, tvb, offset + 12, 1, tcph->th_hlen,
+ "%u bytes (bogus, must be at least %u)", tcph->th_hlen,
TCPH_MIN_LEN);
}
return;
@@ -4311,8 +4311,8 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (tree) {
- proto_tree_add_uint_format(tcp_tree, hf_tcp_hdr_len, tvb, offset + 12, 1, tcph->th_hlen,
- "Header length: %u bytes", tcph->th_hlen);
+ proto_tree_add_uint_format_value(tcp_tree, hf_tcp_hdr_len, tvb, offset + 12, 1, tcph->th_hlen,
+ "%u bytes", tcph->th_hlen);
tf = proto_tree_add_uint_format_value(tcp_tree, hf_tcp_flags, tvb, offset + 12, 2,
tcph->th_flags, "0x%03x (%s)", tcph->th_flags, wmem_strbuf_get_str(flags_strbuf));
field_tree = proto_item_add_subtree(tf, ett_tcp_flags);
diff --git a/epan/dissectors/packet-udp.c b/epan/dissectors/packet-udp.c
index eeb35a579f..1bccf88d13 100644
--- a/epan/dissectors/packet-udp.c
+++ b/epan/dissectors/packet-udp.c
@@ -399,8 +399,8 @@ dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 ip_proto)
}
udp_tree = proto_item_add_subtree(ti, ett_udp);
- port_item = proto_tree_add_uint_format(udp_tree, hfi_udp_srcport.id, tvb, offset, 2, udph->uh_sport,
- "Source port: %s (%u)", get_udp_port(udph->uh_sport), udph->uh_sport);
+ port_item = proto_tree_add_uint_format_value(udp_tree, hfi_udp_srcport.id, tvb, offset, 2, udph->uh_sport,
+ "%s (%u)", get_udp_port(udph->uh_sport), udph->uh_sport);
/* The beginning port number, 32768 + 666 (33434), is from LBL's traceroute.c source code and this code
* further assumes that 3 attempts are made per hop */
if(udph->uh_sport > 32768 + 666 && udph->uh_sport <= 32768 + 666 + 30)
@@ -409,8 +409,8 @@ dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 ip_proto)
((udph->uh_sport - 32768 - 666 - 1) % 3) + 1
);
- port_item = proto_tree_add_uint_format(udp_tree, hfi_udp_dstport.id, tvb, offset + 2, 2, udph->uh_dport,
- "Destination port: %s (%u)", get_udp_port(udph->uh_dport), udph->uh_dport);
+ port_item = proto_tree_add_uint_format_value(udp_tree, hfi_udp_dstport.id, tvb, offset + 2, 2, udph->uh_dport,
+ "%s (%u)", get_udp_port(udph->uh_dport), udph->uh_dport);
if(udph->uh_dport > 32768 + 666 && udph->uh_dport <= 32768 + 666 + 30)
expert_add_info_format(pinfo, port_item, &ei_udp_possible_traceroute, "Possible traceroute: hop #%u, attempt #%u",
((udph->uh_dport - 32768 - 666 - 1) / 3) + 1,
@@ -428,16 +428,16 @@ dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 ip_proto)
if (udph->uh_ulen < 8) {
/* Bogus length - it includes the header, so it must be >= 8. */
/* XXX - should handle IPv6 UDP jumbograms (RFC 2675), where the length is zero */
- item = proto_tree_add_uint_format(udp_tree, hfi_udp_length.id, tvb, offset + 4, 2,
- udph->uh_ulen, "Length: %u (bogus, must be >= 8)", udph->uh_ulen);
+ item = proto_tree_add_uint_format_value(udp_tree, hfi_udp_length.id, tvb, offset + 4, 2,
+ udph->uh_ulen, "%u (bogus, must be >= 8)", udph->uh_ulen);
expert_add_info_format(pinfo, item, &ei_udp_length, "Bad length value %u < 8", udph->uh_ulen);
col_append_fstr(pinfo->cinfo, COL_INFO, " [BAD UDP LENGTH %u < 8]", udph->uh_ulen);
return;
}
if ((udph->uh_ulen > tvb_reported_length(tvb)) && ! pinfo->fragmented && ! pinfo->flags.in_error_pkt) {
/* Bogus length - it goes past the end of the IP payload */
- item = proto_tree_add_uint_format(udp_tree, hfi_udp_length.id, tvb, offset + 4, 2,
- udph->uh_ulen, "Length: %u (bogus, payload length %u)", udph->uh_ulen, tvb_reported_length(tvb));
+ item = proto_tree_add_uint_format_value(udp_tree, hfi_udp_length.id, tvb, offset + 4, 2,
+ udph->uh_ulen, "%u (bogus, payload length %u)", udph->uh_ulen, tvb_reported_length(tvb));
expert_add_info_format(pinfo, item, &ei_udp_length, "Bad length value %u > IP payload length", udph->uh_ulen);
col_append_fstr(pinfo->cinfo, COL_INFO, " [BAD UDP LENGTH %u > IP PAYLOAD LENGTH]", udph->uh_ulen);
} else {
@@ -460,8 +460,8 @@ dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 ip_proto)
hidden_item = proto_tree_add_uint(udp_tree, &hfi_udp_length, tvb, offset + 4, 0, udph->uh_ulen);
PROTO_ITEM_SET_HIDDEN(hidden_item);
}
- item = proto_tree_add_uint_format(udp_tree, hfi_udplite_checksum_coverage.id, tvb, offset + 4, 2,
- udph->uh_sum_cov, "Checksum coverage: %u (bogus, must be >= 8 and <= %u (ip.len-ip.hdr_len))",
+ item = proto_tree_add_uint_format_value(udp_tree, hfi_udplite_checksum_coverage.id, tvb, offset + 4, 2,
+ udph->uh_sum_cov, "%u (bogus, must be >= 8 and <= %u (ip.len-ip.hdr_len))",
udph->uh_sum_cov, udph->uh_ulen);
expert_add_info_format(pinfo, item, &ei_udplite_checksum_coverage, "Bad checksum coverage length value %u < 8 or > %u",
udph->uh_sum_cov, udph->uh_ulen);
@@ -485,8 +485,8 @@ dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 ip_proto)
if (udph->uh_sum == 0) {
/* No checksum supplied in the packet. */
if ((ip_proto == IP_PROTO_UDP) && (pinfo->src.type == AT_IPv4)) {
- item = proto_tree_add_uint_format(udp_tree, hfi_udp_checksum.id, tvb, offset + 6, 2, 0,
- "Checksum: 0x%04x (none)", 0);
+ item = proto_tree_add_uint_format_value(udp_tree, hfi_udp_checksum.id, tvb, offset + 6, 2, 0,
+ "0x%04x (none)", 0);
checksum_tree = proto_item_add_subtree(item, ett_udp_checksum);
item = proto_tree_add_boolean(checksum_tree, &hfi_udp_checksum_good, tvb,
@@ -496,8 +496,8 @@ dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 ip_proto)
offset + 6, 2, FALSE);
PROTO_ITEM_SET_GENERATED(item);
} else {
- item = proto_tree_add_uint_format(udp_tree, hfi_udp_checksum.id, tvb, offset + 6, 2, 0,
- "Checksum: 0x%04x (Illegal)", 0);
+ item = proto_tree_add_uint_format_value(udp_tree, hfi_udp_checksum.id, tvb, offset + 6, 2, 0,
+ "0x%04x (Illegal)", 0);
expert_add_info(pinfo, item, &ei_udp_checksum_zero);
col_append_fstr(pinfo->cinfo, COL_INFO, " [ILLEGAL CHECKSUM (0)]");
@@ -553,8 +553,8 @@ dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 ip_proto)
cksum_vec[3].len = udph->uh_sum_cov;
computed_cksum = in_cksum(&cksum_vec[0], 4);
if (computed_cksum == 0) {
- item = proto_tree_add_uint_format(udp_tree, hfi_udp_checksum.id, tvb,
- offset + 6, 2, udph->uh_sum, "Checksum: 0x%04x [correct]", udph->uh_sum);
+ item = proto_tree_add_uint_format_value(udp_tree, hfi_udp_checksum.id, tvb,
+ offset + 6, 2, udph->uh_sum, "0x%04x [correct]", udph->uh_sum);
checksum_tree = proto_item_add_subtree(item, ett_udp_checksum);
item = proto_tree_add_boolean(checksum_tree, &hfi_udp_checksum_good, tvb,
@@ -564,9 +564,9 @@ dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 ip_proto)
offset + 6, 2, FALSE);
PROTO_ITEM_SET_GENERATED(item);
} else {
- item = proto_tree_add_uint_format(udp_tree, hfi_udp_checksum.id, tvb,
+ item = proto_tree_add_uint_format_value(udp_tree, hfi_udp_checksum.id, tvb,
offset + 6, 2, udph->uh_sum,
- "Checksum: 0x%04x [incorrect, should be 0x%04x (maybe caused by \"UDP checksum offload\"?)]", udph->uh_sum,
+ "0x%04x [incorrect, should be 0x%04x (maybe caused by \"UDP checksum offload\"?)]", udph->uh_sum,
in_cksum_shouldbe(udph->uh_sum, computed_cksum));
checksum_tree = proto_item_add_subtree(item, ett_udp_checksum);
@@ -581,8 +581,8 @@ dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 ip_proto)
col_append_fstr(pinfo->cinfo, COL_INFO, " [UDP CHECKSUM INCORRECT]");
}
} else {
- item = proto_tree_add_uint_format(udp_tree, hfi_udp_checksum.id, tvb,
- offset + 6, 2, udph->uh_sum, "Checksum: 0x%04x [validation disabled]", udph->uh_sum);
+ item = proto_tree_add_uint_format_value(udp_tree, hfi_udp_checksum.id, tvb,
+ offset + 6, 2, udph->uh_sum, "0x%04x [validation disabled]", udph->uh_sum);
checksum_tree = proto_item_add_subtree(item, ett_udp_checksum);
item = proto_tree_add_boolean(checksum_tree, &hfi_udp_checksum_good, tvb,
offset + 6, 2, FALSE);
@@ -592,8 +592,8 @@ dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 ip_proto)
PROTO_ITEM_SET_GENERATED(item);
}
} else {
- item = proto_tree_add_uint_format(udp_tree, hfi_udp_checksum.id, tvb,
- offset + 6, 2, udph->uh_sum, "Checksum: 0x%04x [unchecked, not all data available]", udph->uh_sum);
+ item = proto_tree_add_uint_format_value(udp_tree, hfi_udp_checksum.id, tvb,
+ offset + 6, 2, udph->uh_sum, "0x%04x [unchecked, not all data available]", udph->uh_sum);
checksum_tree = proto_item_add_subtree(item, ett_udp_checksum);
item = proto_tree_add_boolean(checksum_tree, &hfi_udp_checksum_good, tvb,
diff --git a/epan/dissectors/packet-v52.c b/epan/dissectors/packet-v52.c
index 8d08c6c484..4cb4561f77 100644
--- a/epan/dissectors/packet-v52.c
+++ b/epan/dissectors/packet-v52.c
@@ -332,10 +332,9 @@ static const value_string steady_signal_values [] = {
{ 0x1e, "Ramp to normal polarity" },
{ 0, NULL } };
-static const value_string digit_ack_values [] = {
- { 0x0, "No ending acknowledgement requested" },
- { 0x1, "Ending acknowledgement requested when digit transmission is finished" },
- { 0, NULL } };
+const true_false_string tfs_digit_ack_values = {
+ "Ending acknowledgement requested when digit transmission is finished",
+ "No ending acknowledgement requested" };
static const value_string line_info_values [] = {
{ 0x00, "Impedance marker reset" },
@@ -860,11 +859,7 @@ dissect_digit_signal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int of
proto_tree_add_item(info_tree, hf_v52_info_length, info_tvb, info_offset+1, info_element_length, ENC_BIG_ENDIAN);
proto_item_append_text(ti_info, " %s (0x%x)",val_to_str_const(info_element, info_element_values, "unknown info element"),info_element);
- buffer = tvb_get_guint8(info_tvb, info_offset+2)>>6;
- buffer = buffer&0x01;
-
- proto_tree_add_uint_format(info_tree, hf_v52_digit_ack, info_tvb, info_offset+2, 1, buffer,
- "Digit ack request indication: %s",val_to_str_const(buffer,digit_ack_values,"unknown"));
+ proto_tree_add_item(info_tree, hf_v52_digit_ack, info_tvb, info_offset+2, 1, ENC_NA);
buffer = tvb_get_guint8(info_tvb, info_offset+2)>>4;
buffer = buffer&0x03;
@@ -2373,7 +2368,7 @@ proto_register_v52(void)
NULL, HFILL } },
{&hf_v52_digit_ack,
{ "Digit ack request indication","v52.digit_ack",
- FT_UINT8, BASE_HEX, VALS(digit_ack_values), 0x40,
+ FT_BOOLEAN, 8, TFS(&tfs_digit_ack_values), 0x40,
NULL, HFILL } },
{&hf_v52_digit_spare,
{ "Digit spare","v52.digit_spare",
diff --git a/epan/dissectors/packet-v5dl.c b/epan/dissectors/packet-v5dl.c
index 39e38abd9d..8d4f06af3f 100644
--- a/epan/dissectors/packet-v5dl.c
+++ b/epan/dissectors/packet-v5dl.c
@@ -253,17 +253,17 @@ dissect_v5dl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
checksum_calculated = g_htons(checksum_calculated); /* Note: g_htons() macro may eval arg multiple times */
if (checksum == checksum_calculated) {
- checksum_ti = proto_tree_add_uint_format(v5dl_tree, hf_v5dl_checksum, tvb, checksum_offset,
+ checksum_ti = proto_tree_add_uint_format_value(v5dl_tree, hf_v5dl_checksum, tvb, checksum_offset,
2, 0,
- "Checksum: 0x%04x [correct]",
+ "0x%04x [correct]",
checksum);
checksum_tree = proto_item_add_subtree(checksum_ti, ett_v5dl_checksum);
proto_tree_add_boolean(checksum_tree, hf_v5dl_checksum_good, tvb, checksum_offset, 2, TRUE);
proto_tree_add_boolean(checksum_tree, hf_v5dl_checksum_bad, tvb, checksum_offset, 2, FALSE);
} else {
- checksum_ti = proto_tree_add_uint_format(v5dl_tree, hf_v5dl_checksum, tvb, checksum_offset,
+ checksum_ti = proto_tree_add_uint_format_value(v5dl_tree, hf_v5dl_checksum, tvb, checksum_offset,
2, 0,
- "Checksum: 0x%04x [incorrect, should be 0x%04x]",
+ "0x%04x [incorrect, should be 0x%04x]",
checksum, checksum_calculated);
checksum_tree = proto_item_add_subtree(checksum_ti, ett_v5dl_checksum);
proto_tree_add_boolean(checksum_tree, hf_v5dl_checksum_good, tvb, checksum_offset, 2, FALSE);
diff --git a/epan/dissectors/packet-v5ua.c b/epan/dissectors/packet-v5ua.c
index 45cd9aa1cf..5d35fb0ac6 100644
--- a/epan/dissectors/packet-v5ua.c
+++ b/epan/dissectors/packet-v5ua.c
@@ -260,18 +260,18 @@ dissect_dlci_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, prot
else if (dlci_efa == 8180) { col_append_str(pinfo->cinfo, COL_INFO, " | LinkCtrl"); }
if(efa <= 8175) {
- proto_tree_add_uint_format(parameter_tree, hf_efa, parameter_tvb, offset, EFA_LENGTH, efa,
- "Envelope function address: ISDN (%u)", efa);
+ proto_tree_add_uint_format_value(parameter_tree, hf_efa, parameter_tvb, offset, EFA_LENGTH, efa,
+ "ISDN (%u)", efa);
proto_item_append_text(parameter_item, " (SAPI:%u TEI:%u EFA:ISDN (%u))",sapi,tei,efa);
}
else if (efa > 8175 && efa <= 8180){
- proto_tree_add_uint_format(parameter_tree, hf_efa, parameter_tvb, offset, EFA_LENGTH, efa,
- "Envelope function address: %s (%u)", val_to_str_const(efa, efa_values, "unknown EFA"),tvb_get_ntohs(parameter_tvb, offset));
+ proto_tree_add_uint_format_value(parameter_tree, hf_efa, parameter_tvb, offset, EFA_LENGTH, efa,
+ "%s (%u)", val_to_str_const(efa, efa_values, "unknown EFA"),tvb_get_ntohs(parameter_tvb, offset));
proto_item_append_text(parameter_item, " (SAPI:%u TEI:%u EFA:%s (%u))",sapi,tei,val_to_str_const(efa, efa_values, "unknown EFA-value"),efa);
}
else {
- proto_tree_add_uint_format(parameter_tree, hf_efa, parameter_tvb, offset, EFA_LENGTH, efa,
- "Envelope function address: RESERVED (%u)", efa);
+ proto_tree_add_uint_format_value(parameter_tree, hf_efa, parameter_tvb, offset, EFA_LENGTH, efa,
+ "RESERVED (%u)", efa);
proto_item_append_text(parameter_item, " (SAPI:%u TEI:%u EFA:RESERVED (%u))",sapi,tei,efa);
}
}
@@ -289,20 +289,20 @@ dissect_dlci_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, prot
else if (dlci_efa == 8180) { col_append_str(pinfo->cinfo, COL_INFO, " | LinkCtrl"); }
if (efa <= 8175) {
- proto_tree_add_uint_format(parameter_tree, hf_efa, parameter_tvb, offset, EFA_LENGTH, efa,
- "Envelope function address: ISDN (%u)", efa);
+ proto_tree_add_uint_format_value(parameter_tree, hf_efa, parameter_tvb, offset, EFA_LENGTH, efa,
+ "ISDN (%u)", efa);
proto_item_append_text(parameter_item, " (SAPI:%u TEI:%u EFA:ISDN (%u))",sapi,tei,efa);
}
else if (efa > 8175 && efa <= 8180){
- proto_tree_add_uint_format(parameter_tree, hf_efa, parameter_tvb, offset, EFA_LENGTH, efa,
- "Envelope function address: %s (%u)", val_to_str_const(efa, efa_values, "unknown EFA"),tvb_get_ntohs(parameter_tvb, offset));
+ proto_tree_add_uint_format_value(parameter_tree, hf_efa, parameter_tvb, offset, EFA_LENGTH, efa,
+ "%s (%u)", val_to_str_const(efa, efa_values, "unknown EFA"),tvb_get_ntohs(parameter_tvb, offset));
proto_item_append_text(parameter_item, " (SAPI:%u TEI:%u EFA:%s (%u))",sapi,tei,val_to_str_const(efa, efa_values, "unknown EFA-value"),efa);
}
else {
- proto_tree_add_uint_format(parameter_tree, hf_efa, parameter_tvb, offset, EFA_LENGTH, efa,
- "Envelope function address: RESERVED (%u)", efa);
+ proto_tree_add_uint_format_value(parameter_tree, hf_efa, parameter_tvb, offset, EFA_LENGTH, efa,
+ "RESERVED (%u)", efa);
proto_item_append_text(parameter_item, " (SAPI:%u TEI:%u EFA:RESERVED (%u))",sapi,tei,efa);
}
}
@@ -441,8 +441,8 @@ dissect_status_type_identification_parameter(tvbuff_t *parameter_tvb, proto_tree
status_id = tvb_get_ntohs(parameter_tvb, NTFY_STATUS_IDENT_OFFSET);
proto_tree_add_item(parameter_tree, hf_status_type, parameter_tvb, NTFY_STATUS_TYPE_OFFSET, NTFY_STATUS_TYPE_LENGTH, ENC_BIG_ENDIAN);
- proto_tree_add_uint_format(parameter_tree, hf_status_id, parameter_tvb, NTFY_STATUS_IDENT_OFFSET, NTFY_STATUS_IDENT_LENGTH,
- status_id, "Status identification: %u (%s)", status_id,
+ proto_tree_add_uint_format_value(parameter_tree, hf_status_id, parameter_tvb, NTFY_STATUS_IDENT_OFFSET, NTFY_STATUS_IDENT_LENGTH,
+ status_id, "%u (%s)", status_id,
val_to_str_const(status_type * 256 * 256 + status_id, status_type_id_values, "unknown"));
proto_item_append_text(parameter_item, " (%s)",
@@ -1324,9 +1324,9 @@ dissect_common_header(tvbuff_t *common_header_tvb, packet_info *pinfo, proto_tre
proto_tree_add_item(common_header_tree, hf_version, common_header_tvb, COMMON_HEADER_VERSION_OFFSET, COMMON_HEADER_VERSION_LENGTH, ENC_BIG_ENDIAN);
proto_tree_add_item(common_header_tree, hf_reserved, common_header_tvb, COMMON_HEADER_RESERVED_OFFSET, COMMON_HEADER_RESERVED_LENGTH, ENC_BIG_ENDIAN);
proto_tree_add_item(common_header_tree, hf_msg_class, common_header_tvb, COMMON_HEADER_MSG_CLASS_OFFSET, COMMON_HEADER_MSG_CLASS_LENGTH, ENC_BIG_ENDIAN);
- proto_tree_add_uint_format(common_header_tree, hf_msg_type,
+ proto_tree_add_uint_format_value(common_header_tree, hf_msg_type,
common_header_tvb, COMMON_HEADER_MSG_TYPE_OFFSET, COMMON_HEADER_MSG_TYPE_LENGTH,
- message_type, "Message type: %s ( %u )",
+ message_type, "%s ( %u )",
val_to_str_const(message_class * 256 + message_type, msg_class_type_values, "reserved"), message_type);
proto_tree_add_item(common_header_tree, hf_msg_length, common_header_tvb, COMMON_HEADER_MSG_LENGTH_OFFSET, COMMON_HEADER_MSG_LENGTH_LENGTH, ENC_BIG_ENDIAN);
diff --git a/epan/dissectors/packet-x11.c b/epan/dissectors/packet-x11.c
index 2e26f6f37a..d92fb303c8 100644
--- a/epan/dissectors/packet-x11.c
+++ b/epan/dissectors/packet-x11.c
@@ -1186,9 +1186,8 @@ static const value_string zero_is_none_vals[] = {
#define LISTofTEXTITEM16(name) { listOfTextItem(tvb, offsetp, t, hf_x11_##name, TRUE, next_offset, byte_order); }
#define OPCODE() { \
opcode = VALUE8(tvb, *offsetp); \
- proto_tree_add_uint_format(t, hf_x11_opcode, tvb, *offsetp, \
- 1, opcode, "opcode: %u (%s)", opcode, \
- val_to_str_const(opcode, state->opcode_vals, "Unknown")); \
+ proto_tree_add_uint(t, hf_x11_opcode, tvb, *offsetp, \
+ 1, opcode); \
*offsetp += 1; \
}
diff --git a/epan/dissectors/packet-xmcp.c b/epan/dissectors/packet-xmcp.c
index 4c3a803fbc..0355a8fc72 100644
--- a/epan/dissectors/packet-xmcp.c
+++ b/epan/dissectors/packet-xmcp.c
@@ -478,11 +478,8 @@ decode_xmcp_attr_value (proto_tree *attr_tree, guint16 attr_type,
} else {
/* Error code = error class + (error num % 100) */
error_code = (error_class * 100) + error_number;
- it = proto_tree_add_uint_format(attr_tree, xmcp_attr_error_code, tvb,
- (offset+2), 2, error_code,
- "Error Code: %d (%s)", error_code,
- val_to_str_const(error_code, error_codes,
- "Unknown"));
+ it = proto_tree_add_uint(attr_tree, xmcp_attr_error_code, tvb,
+ (offset+2), 2, error_code);
PROTO_ITEM_SET_GENERATED(it);
proto_item_append_text(attr_tree, ": %d", error_code);
col_append_fstr(pinfo->cinfo, COL_INFO, ", error %d (%s)", error_code,
@@ -1185,7 +1182,7 @@ proto_register_xmcp(void)
},
{ &xmcp_attr_error_code,
{ "Error Code", "xmcp.attr.error",
- FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
+ FT_UINT16, BASE_DEC, VALS(error_codes), 0x0, NULL, HFILL}
},
{ &xmcp_attr_error_reason,
{ "Error Reason Phrase", "xmcp.attr.error.reason",
diff --git a/epan/dissectors/packet-zep.c b/epan/dissectors/packet-zep.c
index 29041792af..0c61dc7d86 100644
--- a/epan/dissectors/packet-zep.c
+++ b/epan/dissectors/packet-zep.c
@@ -66,7 +66,7 @@ void proto_reg_handoff_zep(void);
/* Initialize protocol and registered fields. */
static int proto_zep = -1;
static int hf_zep_version = -1;
-/* static int hf_zep_type = -1; */
+static int hf_zep_type = -1;
static int hf_zep_channel_id = -1;
static int hf_zep_device_id = -1;
static int hf_zep_lqi_mode = -1;
@@ -207,11 +207,11 @@ static void dissect_zep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
else {
proto_tree_add_uint(zep_tree, hf_zep_version, tvb, 2, 1, zep_data.version);
if (zep_data.type == ZEP_V2_TYPE_ACK) {
- proto_tree_add_uint_format(zep_tree, hf_zep_version, tvb, 3, 1, zep_data.type, "Type: %i (Ack)", ZEP_V2_TYPE_ACK);
+ proto_tree_add_uint_format_value(zep_tree, hf_zep_type, tvb, 3, 1, zep_data.type, "%i (Ack)", ZEP_V2_TYPE_ACK);
proto_tree_add_uint(zep_tree, hf_zep_seqno, tvb, 4, 4, zep_data.seqno);
}
else {
- proto_tree_add_uint_format(zep_tree, hf_zep_version, tvb, 3, 1, zep_data.type, "Type: %i (%s)", zep_data.type, (zep_data.type==ZEP_V2_TYPE_DATA)?"Data":"Reserved");
+ proto_tree_add_uint_format_value(zep_tree, hf_zep_type, tvb, 3, 1, zep_data.type, "%i (%s)", zep_data.type, (zep_data.type==ZEP_V2_TYPE_DATA)?"Data":"Reserved");
proto_tree_add_uint(zep_tree, hf_zep_channel_id, tvb, 4, 1, zep_data.channel_id);
proto_tree_add_uint(zep_tree, hf_zep_device_id, tvb, 5, 2, zep_data.device_id);
proto_tree_add_boolean_format(zep_tree, hf_zep_lqi_mode, tvb, 7, 1, zep_data.lqi_mode, "LQI/CRC Mode: %s", zep_data.lqi_mode?"CRC":"LQI");
@@ -267,11 +267,9 @@ void proto_register_zep(void)
{ "Protocol Version", "zep.version", FT_UINT8, BASE_DEC, NULL, 0x0,
"The version of the sniffer.", HFILL }},
-#if 0
{ &hf_zep_type,
{ "Type", "zep.type", FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL }},
-#endif
{ &hf_zep_channel_id,
{ "Channel ID", "zep.channel_id", FT_UINT8, BASE_DEC, NULL, 0x0,