From b38ee917b1953104c615056481d6df008ae94b53 Mon Sep 17 00:00:00 2001 From: Michael Mann Date: Sun, 15 Sep 2013 01:48:30 +0000 Subject: 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 done with a perl script on the dissectors directory (packet-*.c), followed by manual inspection of the output. The manual inspection yielded a few cases that really should have been proto_tree_add_uint or proto_tree_add_item, so I updated them accordingly. The script didn't catch as many as I would have liked, but it's a start. The most common (ab)use of proto_tree_add_uint_format was for appending strings to CRC/checksum values to note good or bad CRC/checksum. svn path=/trunk/; revision=52045 --- epan/dissectors/packet-6lowpan.c | 12 +- epan/dissectors/packet-aol.c | 6 +- epan/dissectors/packet-assa_r3.c | 22 +-- epan/dissectors/packet-ccsds.c | 8 +- epan/dissectors/packet-cdp.c | 8 +- epan/dissectors/packet-classicstun.c | 4 +- epan/dissectors/packet-dcerpc.c | 4 +- epan/dissectors/packet-dcm.c | 24 ++-- epan/dissectors/packet-dhcpv6.c | 20 +-- epan/dissectors/packet-distcc.c | 2 +- epan/dissectors/packet-dmp.c | 201 +++++++++++----------------- epan/dissectors/packet-dnp.c | 12 +- epan/dissectors/packet-dns.c | 4 +- epan/dissectors/packet-dsi.c | 4 +- epan/dissectors/packet-dvb-s2-bb.c | 12 +- epan/dissectors/packet-edonkey.c | 16 +-- epan/dissectors/packet-erf.c | 2 +- epan/dissectors/packet-eth.c | 12 +- epan/dissectors/packet-fc.c | 26 ++-- epan/dissectors/packet-fcoe.c | 9 +- epan/dissectors/packet-fcoib.c | 9 +- epan/dissectors/packet-fcswils.c | 12 +- epan/dissectors/packet-fddi.c | 4 +- epan/dissectors/packet-ff.c | 184 ++++++++++++------------- epan/dissectors/packet-forces.c | 20 +-- epan/dissectors/packet-gnutella.c | 4 +- epan/dissectors/packet-gsm_a_dtap.c | 7 +- epan/dissectors/packet-gtp.c | 52 +++---- epan/dissectors/packet-h223.c | 20 +-- epan/dissectors/packet-hip.c | 20 +-- epan/dissectors/packet-hsr.c | 8 +- epan/dissectors/packet-hsrp.c | 28 ++-- epan/dissectors/packet-i2c.c | 8 +- epan/dissectors/packet-icmp.c | 25 ++-- epan/dissectors/packet-idp.c | 4 +- epan/dissectors/packet-ieee80211-airopeek.c | 7 +- epan/dissectors/packet-ieee80211-radio.c | 4 +- epan/dissectors/packet-ieee80211-radiotap.c | 4 +- epan/dissectors/packet-ieee80211.c | 18 ++- epan/dissectors/packet-igmp.c | 4 +- epan/dissectors/packet-ip.c | 12 +- epan/dissectors/packet-ipmi-se.c | 8 +- epan/dissectors/packet-ipmi.c | 12 +- epan/dissectors/packet-ipsi-ctl.c | 7 +- epan/dissectors/packet-ipv6.c | 38 +++--- epan/dissectors/packet-ipx.c | 8 +- epan/dissectors/packet-ipxwan.c | 16 +-- epan/dissectors/packet-isakmp.c | 28 ++-- epan/dissectors/packet-iscsi.c | 8 +- epan/dissectors/packet-isis-lsp.c | 12 +- epan/dissectors/packet-ismp.c | 4 +- epan/dissectors/packet-isns.c | 2 +- epan/dissectors/packet-isup.c | 104 +++++++------- epan/dissectors/packet-ixveriwave.c | 8 +- epan/dissectors/packet-kerberos4.c | 6 +- epan/dissectors/packet-kingfisher.c | 24 ++-- epan/dissectors/packet-lapd.c | 4 +- epan/dissectors/packet-ldp.c | 57 +++----- epan/dissectors/packet-lldp.c | 4 +- epan/dissectors/packet-miop.c | 4 +- epan/dissectors/packet-mip6.c | 24 ++-- epan/dissectors/packet-mpeg-descriptor.c | 2 +- epan/dissectors/packet-mpls-echo.c | 35 +++-- epan/dissectors/packet-msproxy.c | 8 +- epan/dissectors/packet-mstp.c | 16 +-- epan/dissectors/packet-nbns.c | 21 +-- epan/dissectors/packet-ncp-sss.c | 2 +- epan/dissectors/packet-nfs.c | 24 ++-- epan/dissectors/packet-nhrp.c | 4 +- epan/dissectors/packet-nlsp.c | 4 +- epan/dissectors/packet-nsip.c | 5 +- epan/dissectors/packet-nstrace.c | 4 +- epan/dissectors/packet-ntp.c | 8 +- epan/dissectors/packet-omron-fins.c | 16 +-- epan/dissectors/packet-p_mul.c | 18 ++- epan/dissectors/packet-pgm.c | 56 ++++---- epan/dissectors/packet-pim.c | 37 ++--- epan/dissectors/packet-portmap.c | 32 ++--- epan/dissectors/packet-ppi.c | 4 +- epan/dissectors/packet-ppp.c | 6 +- epan/dissectors/packet-pptp.c | 8 +- epan/dissectors/packet-pw-hdlc.c | 6 +- epan/dissectors/packet-q931.c | 24 ++-- epan/dissectors/packet-q933.c | 20 +-- epan/dissectors/packet-radius.c | 4 +- epan/dissectors/packet-rlm.c | 2 +- epan/dissectors/packet-rpc.c | 28 ++-- epan/dissectors/packet-rtcp.c | 12 +- epan/dissectors/packet-sasp.c | 4 +- epan/dissectors/packet-sbus.c | 8 +- epan/dissectors/packet-scop.c | 2 +- epan/dissectors/packet-scsi-osd.c | 2 +- epan/dissectors/packet-sctp.c | 42 +++--- epan/dissectors/packet-selfm.c | 2 +- epan/dissectors/packet-slsk.c | 3 +- epan/dissectors/packet-smb-browse.c | 12 +- epan/dissectors/packet-smb-logon.c | 4 +- epan/dissectors/packet-smb2.c | 2 +- epan/dissectors/packet-sna.c | 34 ++--- epan/dissectors/packet-spp.c | 4 +- epan/dissectors/packet-srp.c | 8 +- epan/dissectors/packet-stun.c | 8 +- epan/dissectors/packet-tacacs.c | 8 +- epan/dissectors/packet-tcp.c | 28 ++-- epan/dissectors/packet-trmac.c | 4 +- epan/dissectors/packet-turbocell.c | 3 +- epan/dissectors/packet-ua3g.c | 4 +- epan/dissectors/packet-umts_mac.c | 4 +- epan/dissectors/packet-v52.c | 8 +- epan/dissectors/packet-vj.c | 12 +- epan/dissectors/packet-windows-common.c | 4 +- epan/dissectors/packet-x25.c | 20 +-- epan/dissectors/packet-xdmcp.c | 4 +- epan/dissectors/packet-zep.c | 2 +- 114 files changed, 883 insertions(+), 999 deletions(-) (limited to 'epan/dissectors') diff --git a/epan/dissectors/packet-6lowpan.c b/epan/dissectors/packet-6lowpan.c index 90b3f752ae..559cf67244 100644 --- a/epan/dissectors/packet-6lowpan.c +++ b/epan/dissectors/packet-6lowpan.c @@ -1198,9 +1198,9 @@ dissect_6lowpan_hc1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint dg /* Parse the next header field. */ ipv6.ip6_nxt = tvb_get_bits8(tvb, bit_offset, LOWPAN_IPV6_NEXT_HEADER_BITS); if (tree) { - proto_tree_add_uint_format(tree, hf_6lowpan_next_header, tvb, bit_offset>>3, + proto_tree_add_uint_format_value(tree, hf_6lowpan_next_header, tvb, bit_offset>>3, BITS_TO_BYTE_LEN(bit_offset, LOWPAN_IPV6_NEXT_HEADER_BITS), ipv6.ip6_nxt, - "Next header: %s (0x%02x)", ipprotostr(ipv6.ip6_nxt), ipv6.ip6_nxt); + "%s (0x%02x)", ipprotostr(ipv6.ip6_nxt), ipv6.ip6_nxt); } bit_offset += LOWPAN_IPV6_NEXT_HEADER_BITS; } @@ -1493,8 +1493,8 @@ dissect_6lowpan_iphc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint d if (!(iphc_flags & LOWPAN_IPHC_FLAG_NHDR)) { ipv6.ip6_nxt = tvb_get_guint8(tvb, offset); if (tree) { - proto_tree_add_uint_format(tree, hf_6lowpan_next_header, tvb, offset, (int)sizeof(guint8), ipv6.ip6_nxt, - "Next header: %s (0x%02x)", ipprotostr(ipv6.ip6_nxt), ipv6.ip6_nxt); + proto_tree_add_uint_format_value(tree, hf_6lowpan_next_header, tvb, offset, (int)sizeof(guint8), ipv6.ip6_nxt, + "%s (0x%02x)", ipprotostr(ipv6.ip6_nxt), ipv6.ip6_nxt); } offset += (int)sizeof(guint8); } @@ -1842,8 +1842,8 @@ dissect_6lowpan_iphc_nhc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gi if (!(ext_flags & LOWPAN_NHC_EXT_NHDR)) { ipv6_ext.ip6e_nxt = tvb_get_guint8(tvb, offset); if (tree) { - proto_tree_add_uint_format(nhc_tree, hf_6lowpan_nhc_ext_next, tvb, offset, (int)sizeof(guint8), ipv6_ext.ip6e_nxt, - "Next header: %s (0x%02x)", ipprotostr(ipv6_ext.ip6e_nxt), ipv6_ext.ip6e_nxt); + proto_tree_add_uint_format_value(nhc_tree, hf_6lowpan_nhc_ext_next, tvb, offset, (int)sizeof(guint8), ipv6_ext.ip6e_nxt, + "%s (0x%02x)", ipprotostr(ipv6_ext.ip6e_nxt), ipv6_ext.ip6e_nxt); proto_item_set_end(ti, tvb, offset+(int)sizeof(guint8)); } offset += (int)sizeof(guint8); diff --git a/epan/dissectors/packet-aol.c b/epan/dissectors/packet-aol.c index d023a4e16d..a957255330 100644 --- a/epan/dissectors/packet-aol.c +++ b/epan/dissectors/packet-aol.c @@ -163,7 +163,7 @@ static guint dissect_aol_init(tvbuff_t *tvb, packet_info *pinfo _U_, guint offse proto_tree_add_item(data_tree,hf_aol_udo_timestamp,tvb,offset,4,ENC_LITTLE_ENDIAN); offset += 4; dos_ver = tvb_get_ntohs(tvb,offset); - proto_tree_add_uint_format(data_tree,hf_aol_dos_ver,tvb,offset,2,dos_ver,"DOS Version: %d.%d",(dos_ver & 0xFF00) >> 8,dos_ver & 0xFF); + proto_tree_add_uint_format_value(data_tree,hf_aol_dos_ver,tvb,offset,2,dos_ver,"%d.%d",(dos_ver & 0xFF00) >> 8,dos_ver & 0xFF); offset += 2; proto_tree_add_item(data_tree,hf_aol_sess_flags, tvb,offset,2,ENC_LITTLE_ENDIAN); offset += 2; @@ -173,7 +173,7 @@ static guint dissect_aol_init(tvbuff_t *tvb, packet_info *pinfo _U_, guint offse /* Windows version is a 32-bit value, but only the lower 16 bits are populated */ win_ver = tvb_get_ntohs(tvb,offset); - proto_tree_add_uint_format(data_tree,hf_aol_win_ver,tvb,offset,2,dos_ver,"Windows Version: %d.%d",(win_ver & 0xFF00) >> 8,win_ver & 0xFF); + proto_tree_add_uint_format_value(data_tree,hf_aol_win_ver,tvb,offset,2,dos_ver,"%d.%d",(win_ver & 0xFF00) >> 8,win_ver & 0xFF); offset += 4; proto_tree_add_item(data_tree,hf_aol_wmem_mode, tvb,offset,1,ENC_NA); offset += 1; @@ -266,7 +266,7 @@ static void dissect_aol_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* Add it */ col_append_fstr(pinfo->cinfo,COL_INFO," [Token: '%c%c']",(token & 0xFF00) >> 8,token & 0xFF); proto_item_append_text(ti," [Token: '%c%c']",(token & 0xFF00) >> 8,token & 0xFF); - proto_tree_add_uint_format(aol_tree,hf_aol_token,tvb,offset,2,token,"Token: '%c%c'",(token & 0xFF00) >> 8,token & 0xFF); + proto_tree_add_uint_format_value(aol_tree,hf_aol_token,tvb,offset,2,token,"'%c%c'",(token & 0xFF00) >> 8,token & 0xFF); offset += 2; pdu_len -= 2; } diff --git a/epan/dissectors/packet-assa_r3.c b/epan/dissectors/packet-assa_r3.c index 777781d30a..635abd33a7 100644 --- a/epan/dissectors/packet-assa_r3.c +++ b/epan/dissectors/packet-assa_r3.c @@ -5956,16 +5956,16 @@ dissect_r3_cmd_downloadfirmware (tvbuff_t *tvb, guint32 start_offset, guint32 le cmdLen - 2, 0x0000)) == packetCRC) - proto_tree_add_uint_format (dlfw_tree, hf_r3_firmwaredownload_crc, payload_tvb, + proto_tree_add_uint_format_value(dlfw_tree, hf_r3_firmwaredownload_crc, payload_tvb, cmdLen - 2 - 2, 2, - packetCRC, "CRC: 0x%04x (correct)", packetCRC); + packetCRC, "0x%04x (correct)", packetCRC); else { proto_item *tmp_item; - proto_tree_add_uint_format (dlfw_tree, hf_r3_firmwaredownload_crc, payload_tvb, + proto_tree_add_uint_format_value(dlfw_tree, hf_r3_firmwaredownload_crc, payload_tvb, cmdLen - 2 - 2, 2, - packetCRC, "CRC: 0x%04x (incorrect, should be 0x%04x)", calculatedCRC, packetCRC); + packetCRC, "0x%04x (incorrect, should be 0x%04x)", calculatedCRC, packetCRC); tmp_item = proto_tree_add_boolean (dlfw_tree, hf_r3_firmwaredownload_crc_bad, payload_tvb, cmdLen - 2 - 2, 2, TRUE); PROTO_ITEM_SET_GENERATED (tmp_item); @@ -6705,26 +6705,26 @@ dissect_r3_packet (tvbuff_t *tvb, packet_info *pinfo, proto_tree *r3_tree) guint32 calculatedCRC; if ((calculatedCRC = utilCrcCalculate (tvb_get_ptr (tvb, 1, packetLen - 3), packetLen - 3, 0x0000)) == packetCRC) - proto_tree_add_uint_format (tail_tree, hf_r3_crc, tvb, offset, 2, packetCRC, "CRC: 0x%04x (correct)", packetCRC); + proto_tree_add_uint_format_value(tail_tree, hf_r3_crc, tvb, offset, 2, packetCRC, "0x%04x (correct)", packetCRC); else { proto_item *tmp_item; - proto_tree_add_uint_format (tail_tree, hf_r3_crc, tvb, offset, 2, packetCRC, - "CRC: 0x%04x (incorrect, should be 0x%04x)", calculatedCRC, packetCRC); + proto_tree_add_uint_format_value(tail_tree, hf_r3_crc, tvb, offset, 2, packetCRC, + "0x%04x (incorrect, should be 0x%04x)", calculatedCRC, packetCRC); tmp_item = proto_tree_add_boolean (tail_tree, hf_r3_crc_bad, tvb, offset, 2, TRUE); PROTO_ITEM_SET_GENERATED (tmp_item); } if ((packetLen ^ 0xff) == packetXor) - proto_tree_add_uint_format (tail_tree, hf_r3_xor, tvb, offset + 2, 1, packetXor, - "XOR: 0x%02x (correct)", packetXor); + proto_tree_add_uint_format_value(tail_tree, hf_r3_xor, tvb, offset + 2, 1, packetXor, + "0x%02x (correct)", packetXor); else { proto_item *tmp_item; - proto_tree_add_uint_format (tail_tree, hf_r3_xor, tvb, offset + 7, 1, packetXor, - "XOR: 0x%02x (incorrect, should be 0x%02x)", packetXor, packetLen ^ 0xff); + proto_tree_add_uint_format_value(tail_tree, hf_r3_xor, tvb, offset + 7, 1, packetXor, + "0x%02x (incorrect, should be 0x%02x)", packetXor, packetLen ^ 0xff); tmp_item = proto_tree_add_boolean (tail_tree, hf_r3_xor_bad, tvb, offset + 7, 1, TRUE); PROTO_ITEM_SET_GENERATED (tmp_item); } diff --git a/epan/dissectors/packet-ccsds.c b/epan/dissectors/packet-ccsds.c index 77044c67e7..fee8d7f4ba 100644 --- a/epan/dissectors/packet-ccsds.c +++ b/epan/dissectors/packet-ccsds.c @@ -465,16 +465,16 @@ dissect_ccsds(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* Report checkword status */ if (checkword_sum == checkword_field) { - item = proto_tree_add_uint_format(ccsds_tree, hf_ccsds_checkword, tvb, offset, 2, checkword_field, - "CCSDS checkword: 0x%04x [correct]", checkword_field); + item = proto_tree_add_uint_format_value(ccsds_tree, hf_ccsds_checkword, tvb, offset, 2, checkword_field, + "0x%04x [correct]", checkword_field); checkword_tree = proto_item_add_subtree(item, ett_ccsds_checkword); item = proto_tree_add_boolean(checkword_tree, hf_ccsds_checkword_good, tvb, offset, 2, TRUE); PROTO_ITEM_SET_GENERATED(item); item = proto_tree_add_boolean(checkword_tree, hf_ccsds_checkword_bad, tvb, offset, 2, FALSE); PROTO_ITEM_SET_GENERATED(item); } else { - item = proto_tree_add_uint_format(ccsds_tree, hf_ccsds_checkword, tvb, offset, 2, checkword_field, - "CCSDS checkword: 0x%04x [incorrect, should be 0x%04x]", checkword_field, checkword_sum); + item = proto_tree_add_uint_format_value(ccsds_tree, hf_ccsds_checkword, tvb, offset, 2, checkword_field, + "0x%04x [incorrect, should be 0x%04x]", checkword_field, checkword_sum); checkword_tree = proto_item_add_subtree(item, ett_ccsds_checkword); item = proto_tree_add_boolean(checkword_tree, hf_ccsds_checkword_good, tvb, offset, 2, FALSE); PROTO_ITEM_SET_GENERATED(item); diff --git a/epan/dissectors/packet-cdp.c b/epan/dissectors/packet-cdp.c index c6329932f1..36be282927 100644 --- a/epan/dissectors/packet-cdp.c +++ b/epan/dissectors/packet-cdp.c @@ -269,13 +269,13 @@ dissect_cdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) checksum_good = (computed_checksum == 0); checksum_bad = !checksum_good; if (checksum_good) { - checksum_item = proto_tree_add_uint_format(cdp_tree, + checksum_item = proto_tree_add_uint_format_value(cdp_tree, hf_cdp_checksum, tvb, offset, 2, packet_checksum, - "Checksum: 0x%04x [correct]", packet_checksum); + "0x%04x [correct]", packet_checksum); } else { - checksum_item = proto_tree_add_uint_format(cdp_tree, + checksum_item = proto_tree_add_uint_format_value(cdp_tree, hf_cdp_checksum, tvb, offset, 2, packet_checksum, - "Checksum: 0x%04x [incorrect, should be 0x%04x]", + "0x%04x [incorrect, should be 0x%04x]", packet_checksum, in_cksum_shouldbe(packet_checksum, computed_checksum)); } diff --git a/epan/dissectors/packet-classicstun.c b/epan/dissectors/packet-classicstun.c index 4d39af5d0f..ed36cb52c5 100644 --- a/epan/dissectors/packet-classicstun.c +++ b/epan/dissectors/packet-classicstun.c @@ -385,10 +385,10 @@ dissect_classicstun(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d offset, 2, att_type); offset += 2; if (ATTR_HDR_LEN+att_length > msg_length) { - proto_tree_add_uint_format(att_tree, + proto_tree_add_uint_format_value(att_tree, classicstun_att_length, tvb, offset, 2, att_length, - "Attribute Length: %u (bogus, goes past the end of the message)", + "%u (bogus, goes past the end of the message)", att_length); break; } diff --git a/epan/dissectors/packet-dcerpc.c b/epan/dissectors/packet-dcerpc.c index 150b806813..c84f13a1d1 100644 --- a/epan/dissectors/packet-dcerpc.c +++ b/epan/dissectors/packet-dcerpc.c @@ -2604,9 +2604,9 @@ dcerpc_try_handoff(packet_info *pinfo, proto_tree *tree, name ? name : "Unknown operation", info->call_data->opnum); else - proto_tree_add_uint_format(sub_tree, hf_dcerpc_op, tvb, + proto_tree_add_uint_format_value(sub_tree, hf_dcerpc_op, tvb, 0, 0, info->call_data->opnum, - "Operation: %s (%u)", + "%s (%u)", name ? name : "Unknown operation", info->call_data->opnum); diff --git a/epan/dissectors/packet-dcm.c b/epan/dissectors/packet-dcm.c index 0ba6208acf..1dcc0b96db 100644 --- a/epan/dissectors/packet-dcm.c +++ b/epan/dissectors/packet-dcm.c @@ -4788,14 +4788,14 @@ dissect_dcm_assoc_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu break; } - proto_tree_add_uint_format(assoc_header_ptree, hf_dcm_assoc_reject_result, tvb, - offset , 1, reject_result, "Result: %s", reject_result_desc); + proto_tree_add_uint_format_value(assoc_header_ptree, hf_dcm_assoc_reject_result, tvb, + offset , 1, reject_result, "%s", reject_result_desc); - proto_tree_add_uint_format(assoc_header_ptree, hf_dcm_assoc_reject_source, tvb, - offset+1, 1, reject_source, "Source: %s", reject_source_desc); + proto_tree_add_uint_format_value(assoc_header_ptree, hf_dcm_assoc_reject_source, tvb, + offset+1, 1, reject_source, "%s", reject_source_desc); - proto_tree_add_uint_format(assoc_header_ptree, hf_dcm_assoc_reject_reason, tvb, - offset+2, 1, reject_reason, "Reason: %s", reject_reason_desc); + proto_tree_add_uint_format_value(assoc_header_ptree, hf_dcm_assoc_reject_reason, tvb, + offset+2, 1, reject_reason, "%s", reject_reason_desc); offset += 3; @@ -4848,11 +4848,11 @@ dissect_dcm_assoc_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu break; } - proto_tree_add_uint_format(assoc_header_ptree, hf_dcm_assoc_abort_source, - tvb, offset , 1, abort_source, "Source: %s", abort_source_desc); + proto_tree_add_uint_format_value(assoc_header_ptree, hf_dcm_assoc_abort_source, + tvb, offset , 1, abort_source, "%s", abort_source_desc); - proto_tree_add_uint_format(assoc_header_ptree, hf_dcm_assoc_abort_reason, - tvb, offset+1, 1, abort_reason, "Reason: %s", abort_reason_desc); + proto_tree_add_uint_format_value(assoc_header_ptree, hf_dcm_assoc_abort_reason, + tvb, offset+1, 1, abort_reason, "%s", abort_reason_desc); offset += 2; if (abort_source == 0) { @@ -6335,8 +6335,8 @@ dissect_dcm_tag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, --------------------------------------------------------------- */ - proto_tree_add_uint_format(tag_ptree, hf_dcm_tag, tvb, offset_tag, 4, - (grp << 16) | elm, "Tag: %04x,%04x (%s)", grp, elm, tag_def->description); + proto_tree_add_uint_format_value(tag_ptree, hf_dcm_tag, tvb, offset_tag, 4, + (grp << 16) | elm, "%04x,%04x (%s)", grp, elm, tag_def->description); /* Add VR to tag detail, except for dicom items */ if (!is_item) { diff --git a/epan/dissectors/packet-dhcpv6.c b/epan/dissectors/packet-dhcpv6.c index 060a0baaa8..e1e074bc73 100644 --- a/epan/dissectors/packet-dhcpv6.c +++ b/epan/dissectors/packet-dhcpv6.c @@ -1544,16 +1544,16 @@ dhcpv6_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, proto_tree_add_string(subtree, hf_iaid, tvb, off, 4, tvb_arphrdaddr_to_str(tvb, off, 4, opttype)); if (tvb_get_ntohl(tvb, off+4) == DHCPV6_LEASEDURATION_INFINITY) { - proto_tree_add_uint_format(subtree, hf_iaid_t1, tvb, off+4, - 4, DHCPV6_LEASEDURATION_INFINITY, "T1: infinity"); + proto_tree_add_uint_format_value(subtree, hf_iaid_t1, tvb, off+4, + 4, DHCPV6_LEASEDURATION_INFINITY, "infinity"); } else { proto_tree_add_item(subtree, hf_iaid_t1, tvb, off+4, 4, ENC_BIG_ENDIAN); } if (tvb_get_ntohl(tvb, off+8) == DHCPV6_LEASEDURATION_INFINITY) { - proto_tree_add_uint_format(subtree, hf_iaid_t2, tvb, off+8, - 4, DHCPV6_LEASEDURATION_INFINITY, "T2: infinity"); + proto_tree_add_uint_format_value(subtree, hf_iaid_t2, tvb, off+8, + 4, DHCPV6_LEASEDURATION_INFINITY, "infinity"); } else { proto_tree_add_item(subtree, hf_iaid_t2, tvb, off+8, 4, ENC_BIG_ENDIAN); @@ -1602,8 +1602,8 @@ dhcpv6_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, valid_lifetime = tvb_get_ntohl(tvb, off + 20); if (preferred_lifetime == DHCPV6_LEASEDURATION_INFINITY) { - proto_tree_add_uint_format(subtree, hf_iaaddr_pref_lifetime, tvb, off+16, - 4, DHCPV6_LEASEDURATION_INFINITY, "Preferred lifetime: infinity"); + proto_tree_add_uint_format_value(subtree, hf_iaaddr_pref_lifetime, tvb, off+16, + 4, DHCPV6_LEASEDURATION_INFINITY, "infinity"); } else { proto_tree_add_item(subtree, hf_iaaddr_pref_lifetime, tvb, off+16, 4, ENC_BIG_ENDIAN); @@ -1986,15 +1986,15 @@ dhcpv6_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, } if (tvb_get_ntohl(tvb, off) == DHCPV6_LEASEDURATION_INFINITY) { - proto_tree_add_uint_format(subtree, hf_iaprefix_pref_lifetime, tvb, off, - 4, DHCPV6_LEASEDURATION_INFINITY, "Preferred lifetime: infinity"); + proto_tree_add_uint_format_value(subtree, hf_iaprefix_pref_lifetime, tvb, off, + 4, DHCPV6_LEASEDURATION_INFINITY, "infinity"); } else { proto_tree_add_item(subtree, hf_iaprefix_pref_lifetime, tvb, off, 4, ENC_BIG_ENDIAN); } if (tvb_get_ntohl(tvb, off + 4) == DHCPV6_LEASEDURATION_INFINITY) { - proto_tree_add_uint_format(subtree, hf_iaprefix_valid_lifetime, tvb, off+4, - 4, DHCPV6_LEASEDURATION_INFINITY, "Valid lifetime: infinity"); + proto_tree_add_uint_format_value(subtree, hf_iaprefix_valid_lifetime, tvb, off+4, + 4, DHCPV6_LEASEDURATION_INFINITY, "infinity"); } else { proto_tree_add_item(subtree, hf_iaprefix_valid_lifetime, tvb, off+4, 4, ENC_BIG_ENDIAN); diff --git a/epan/dissectors/packet-distcc.c b/epan/dissectors/packet-distcc.c index 04f3d0462c..955ed82248 100644 --- a/epan/dissectors/packet-distcc.c +++ b/epan/dissectors/packet-distcc.c @@ -123,7 +123,7 @@ dissect_distcc_stat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int off static int dissect_distcc_argc(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint32 parameter) { - proto_tree_add_uint_format(tree, hf_distcc_argc, tvb, offset-12, 12, parameter, "ARGC: %d", parameter); + proto_tree_add_uint(tree, hf_distcc_argc, tvb, offset-12, 12, parameter); col_append_fstr(pinfo->cinfo, COL_INFO, "ARGC:%d ", parameter); diff --git a/epan/dissectors/packet-dmp.c b/epan/dissectors/packet-dmp.c index bde64035cb..e667cb4471 100644 --- a/epan/dissectors/packet-dmp.c +++ b/epan/dissectors/packet-dmp.c @@ -2055,9 +2055,8 @@ static gint dissect_dmp_ext_addr (tvbuff_t *tvb, packet_info *pinfo, if (value & 0x80) { addr_length_extended = TRUE; - en = proto_tree_add_uint_format (ext_tree, hf_addr_ext_length1, tvb, - offset, 1, value, - "Address Length (bits 4-0): %d", length); + en = proto_tree_add_uint(ext_tree, hf_addr_ext_length1, tvb, + offset, 1, value); addr_tree = proto_item_add_subtree (en, ett_address_ext_length); proto_tree_add_item (addr_tree, hf_addr_ext_length1, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; @@ -2074,17 +2073,14 @@ static gint dissect_dmp_ext_addr (tvbuff_t *tvb, packet_info *pinfo, addr_tree = proto_item_add_subtree (en, ett_address_ext_type); proto_tree_add_item (addr_tree, hf_addr_ext_type, tvb, offset, 1, ENC_BIG_ENDIAN); - en = proto_tree_add_uint_format (ext_tree, hf_addr_ext_length2, tvb, - offset, 1, value, - "Address Length (bits 9-5): %d", - value & 0x1F); + en = proto_tree_add_uint(ext_tree, hf_addr_ext_length2, tvb, + offset, 1, value); addr_tree = proto_item_add_subtree (en, ett_address_ext_length); proto_tree_add_item (addr_tree, hf_addr_ext_length2, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; } else { - en = proto_tree_add_uint_format (ext_tree, hf_addr_ext_length, tvb, - offset, 1, value, "Address Length: %d", - length); + en = proto_tree_add_uint(ext_tree, hf_addr_ext_length, tvb, + offset, 1, value); addr_tree = proto_item_add_subtree (en, ett_address_ext_length); proto_tree_add_item (addr_tree, hf_addr_ext_length1, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; @@ -2103,9 +2099,8 @@ static gint dissect_dmp_ext_addr (tvbuff_t *tvb, packet_info *pinfo, offset += length; if (addr_length_extended) { - en = proto_tree_add_uint_format (ext_tree, hf_addr_ext_length_generated, - tvb, offset, 0, length, - "Address Length: %d", length); + en = proto_tree_add_uint(ext_tree, hf_addr_ext_length_generated, + tvb, offset, 0, length); PROTO_ITEM_SET_GENERATED (en); } @@ -2299,16 +2294,14 @@ static gint dissect_dmp_direct_encoding (tvbuff_t *tvb, packet_info *pinfo, not_req = (value & 0x03); if (rep_req == 0x03) { - en = proto_tree_add_uint_format (field_tree, hf_addr_dir_rec_no1, + en = proto_tree_add_uint_format_value(field_tree, hf_addr_dir_rec_no1, tvb, offset, 1, value, - "Recipient Number (bits 3-0): %d" - " (offset from previous)", + "%d (offset from previous)", (value & 0xF0) >> 4); } else { - en = proto_tree_add_uint_format (field_tree, hf_addr_dir_rec_no, + en = proto_tree_add_uint_format_value(field_tree, hf_addr_dir_rec_no, tvb, offset, 1, value, - "Recipient Number Offset: %d" - " (offset from previous)", + "%d (offset from previous)", (value & 0xF0) >> 4); } rec_tree = proto_item_add_subtree (en, ett_address_rec_no); @@ -2321,15 +2314,11 @@ static gint dissect_dmp_direct_encoding (tvbuff_t *tvb, packet_info *pinfo, dir_addr = (value & 0x7F); action = (value & 0x80); if (not_req == 0x03) { - en = proto_tree_add_uint_format (field_tree, hf_addr_dir_address1, - tvb, offset, 1, value, - "Direct Address (bits 6-0): %d", - value & 0x7F); + en = proto_tree_add_uint(field_tree, hf_addr_dir_address1, + tvb, offset, 1, value); } else { - en = proto_tree_add_uint_format (field_tree, hf_addr_dir_address, - tvb, offset, 1, value, - "Direct Address: %d", - value & 0x7F); + en = proto_tree_add_uint(field_tree, hf_addr_dir_address, + tvb, offset, 1, value); } addr_tree = proto_item_add_subtree (en, ett_address_direct); proto_tree_add_item (addr_tree, hf_addr_dir_action, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -2343,10 +2332,9 @@ static gint dissect_dmp_direct_encoding (tvbuff_t *tvb, packet_info *pinfo, rec_ofs = rec_no; rep_req = (value & 0xC0) >> 6; - en = proto_tree_add_uint_format (field_tree, hf_addr_dir_rec_no2, + en = proto_tree_add_uint_format_value(field_tree, hf_addr_dir_rec_no2, tvb, offset, 1, value, - "Recipient Number (bits 9-4): %d" - " (offset from previous)", + "%d (offset from previous)", value & 0x3F); rec_tree = proto_item_add_subtree (en, ett_address_rec_no); proto_tree_add_item (rec_tree, hf_addr_dir_rep_req2, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -2360,10 +2348,9 @@ static gint dissect_dmp_direct_encoding (tvbuff_t *tvb, packet_info *pinfo, rec_ofs = rec_no; rep_req = (value & 0xC0) >> 6; - en = proto_tree_add_uint_format (field_tree, hf_addr_dir_rec_no3, + en = proto_tree_add_uint_format_value(field_tree, hf_addr_dir_rec_no3, tvb, offset, 1, value, - "Recipient Number (bits 14-10): %d" - " (offset from previous)", + "%d (offset from previous)", value & 0x1F); rec_tree = proto_item_add_subtree (en, ett_address_rec_no); proto_tree_add_item (rec_tree, hf_addr_dir_rep_req3, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -2383,10 +2370,8 @@ static gint dissect_dmp_direct_encoding (tvbuff_t *tvb, packet_info *pinfo, dir_addr |= ((value & 0x3F) << 7); not_req = (value & 0xC0) >> 6; - en = proto_tree_add_uint_format (field_tree, hf_addr_dir_address2, tvb, - offset, 1, value, - "Direct Address (bits 12-7): %d", - value & 0x3F); + en = proto_tree_add_uint(field_tree, hf_addr_dir_address2, tvb, + offset, 1, value); addr_tree = proto_item_add_subtree (en, ett_address_direct); proto_tree_add_item (addr_tree, hf_addr_dir_not_req2, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (addr_tree, hf_addr_dir_address2, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -2398,10 +2383,8 @@ static gint dissect_dmp_direct_encoding (tvbuff_t *tvb, packet_info *pinfo, dir_addr |= ((value & 0x3F) << 13); not_req = (value & 0xC0) >> 6; - en = proto_tree_add_uint_format (field_tree, hf_addr_dir_address3, tvb, - offset, 1, value, - "Direct Address (bits 18-13): %d", - value & 0x3F); + en = proto_tree_add_uint(field_tree, hf_addr_dir_address3, tvb, + offset, 1, value); addr_tree = proto_item_add_subtree (en, ett_address_direct); proto_tree_add_item (addr_tree, hf_addr_dir_not_req3, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item (addr_tree, hf_addr_dir_address3, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -2415,9 +2398,8 @@ static gint dissect_dmp_direct_encoding (tvbuff_t *tvb, packet_info *pinfo, } *prev_rec_no = rec_no; - en = proto_tree_add_uint_format (field_tree, hf_addr_dir_rec_no_generated, - tvb, offset, 0, rec_no, - "Recipient Number: %d", rec_no); + en = proto_tree_add_uint(field_tree, hf_addr_dir_rec_no_generated, + tvb, offset, 0, rec_no); if (rec_no > 32767) { proto_item_append_text (en, " (maximum 32767)"); expert_add_info(pinfo, en, &ei_addr_dir_rec_no_generated); @@ -2425,9 +2407,8 @@ static gint dissect_dmp_direct_encoding (tvbuff_t *tvb, packet_info *pinfo, PROTO_ITEM_SET_GENERATED (en); if (dir_addr_extended) { - en = proto_tree_add_uint_format (field_tree, hf_addr_dir_address_generated, - tvb, offset, 0, dir_addr, - "Direct Address: %d", dir_addr); + en = proto_tree_add_uint(field_tree, hf_addr_dir_address_generated, + tvb, offset, 0, dir_addr); PROTO_ITEM_SET_GENERATED (en); } @@ -2494,10 +2475,9 @@ static gint dissect_dmp_ext_encoding (tvbuff_t *tvb, packet_info *pinfo, value = tvb_get_guint8 (tvb, offset); rec_no = (value & 0x7F); if (value & 0x80) { - en = proto_tree_add_uint_format (field_tree, hf_addr_ext_rec_no1, tvb, + en = proto_tree_add_uint_format_value(field_tree, hf_addr_ext_rec_no1, tvb, offset, 1, value, - "Recipient Number (bits 6-0): %d" - " (offset from previous)", + "%d (offset from previous)", value & 0x7F); addr_tree = proto_item_add_subtree (en, ett_address_ext_rec_no); proto_tree_add_item (addr_tree, hf_addr_ext_rec_ext, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -2508,19 +2488,17 @@ static gint dissect_dmp_ext_encoding (tvbuff_t *tvb, packet_info *pinfo, value = tvb_get_guint8 (tvb, offset); rec_no |= (value << 7); rec_ofs = rec_no; - en = proto_tree_add_uint_format (field_tree, hf_addr_ext_rec_no2, tvb, + en = proto_tree_add_uint_format_value(field_tree, hf_addr_ext_rec_no2, tvb, offset, 1, value, - "Recipient Number (bits 14-7): %d" - " (offset from previous)", value); + "%d (offset from previous)", value); addr_tree = proto_item_add_subtree (en, ett_address_ext_rec_no); proto_tree_add_item (addr_tree, hf_addr_ext_rec_no2, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; } else { - en = proto_tree_add_uint_format (field_tree, hf_addr_ext_rec_no, tvb, + en = proto_tree_add_uint_format_value(field_tree, hf_addr_ext_rec_no, tvb, offset, 1, value, - "Recipient Number Offset: %d" - " (offset from previous)", + "%d (offset from previous)", value & 0x7F); addr_tree = proto_item_add_subtree (en, ett_address_ext_rec_no); proto_tree_add_item (addr_tree, hf_addr_ext_rec_ext, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -2535,9 +2513,8 @@ static gint dissect_dmp_ext_encoding (tvbuff_t *tvb, packet_info *pinfo, } *prev_rec_no = rec_no; - en = proto_tree_add_uint_format (field_tree, hf_addr_ext_rec_no_generated, - tvb, offset, 0, rec_no, - "Recipient Number: %d", rec_no); + en = proto_tree_add_uint(field_tree, hf_addr_ext_rec_no_generated, + tvb, offset, 0, rec_no); if (rec_no > 32767) { proto_item_append_text (en, " (maximum 32767)"); expert_add_info(pinfo, en, &ei_addr_ext_rec_no_generated); @@ -2721,10 +2698,8 @@ static gint dissect_ipm_identifier (tvbuff_t *tvb, packet_info *pinfo _U_, proto modifier = (length & 0xC0) >> 6; ipm_id_length = length & 0x3F; - tf = proto_tree_add_uint_format (tree, hf_envelope_ipm_id_length, - tvb, offset, 1, ipm_id_length, - "IPM Identifier Length: %u", - ipm_id_length); + tf = proto_tree_add_uint(tree, hf_envelope_ipm_id_length, + tvb, offset, 1, ipm_id_length); field_tree = proto_item_add_subtree (tf, ett_envelope_ipm_id_length); if ((dmp.msg_id_type == NAT_MSG_ID || modifier != IPM_MODIFIER_X400) && dmp_nat_decode == NAT_DECODE_THALES) { proto_tree_add_item (field_tree, hf_thales_ipm_id_modifier, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -2784,9 +2759,8 @@ static gint dissect_dmp_envelope (tvbuff_t *tvb, packet_info *pinfo, dmp.version = (envelope & 0x07) + 1; /* Protocol Version */ - tf = proto_tree_add_uint_format (envelope_tree, hf_envelope_version, - tvb, offset, 1, dmp.version, - "Protocol Version: %d", dmp.version); + tf = proto_tree_add_uint(envelope_tree, hf_envelope_version, + tvb, offset, 1, dmp.version); field_tree = proto_item_add_subtree (tf, ett_envelope_version); vf = proto_tree_add_item (field_tree, hf_envelope_protocol_id, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -2816,9 +2790,8 @@ static gint dissect_dmp_envelope (tvbuff_t *tvb, packet_info *pinfo, if (dmp.msg_type != ACK) { /* Hop count */ - tf = proto_tree_add_uint_format (envelope_tree, hf_envelope_hop_count, - tvb, offset, 1, envelope, - "Hop Count: %d", (envelope & 0xE0) >> 5); + tf = proto_tree_add_uint(envelope_tree, hf_envelope_hop_count, + tvb, offset, 1, envelope); field_tree = proto_item_add_subtree (tf, ett_envelope_hop_count); proto_tree_add_item (field_tree, hf_envelope_hop_count_value, tvb, offset, 1, ENC_BIG_ENDIAN); } else { @@ -2892,21 +2865,16 @@ static gint dissect_dmp_envelope (tvbuff_t *tvb, packet_info *pinfo, /* Message Identifier Type */ dmp.msg_id_type = (envelope & 0x60) >> 5; - tf = proto_tree_add_uint_format (envelope_tree, hf_envelope_msg_id_type, - tvb, offset, 1, envelope, - "Message Identifier Type: %s (%d)", - val_to_str_const (dmp.msg_id_type, msg_id_type_vals, "Unknown"), - dmp.msg_id_type); + tf = proto_tree_add_item (envelope_tree, hf_envelope_msg_id_type, + tvb, offset, 1, ENC_BIG_ENDIAN); field_tree = proto_item_add_subtree (tf, ett_envelope_msg_id_type); proto_tree_add_item (field_tree, hf_envelope_msg_id_type, tvb, offset, 1, ENC_BIG_ENDIAN); if (dmp.msg_id_type == X400_MSG_ID || dmp.msg_id_type == NAT_MSG_ID) { /* MTS Identifier Length */ dmp.mts_id_length = (envelope & 0x1F); - dmp.mts_id_item = proto_tree_add_uint_format (envelope_tree, hf_envelope_mts_id_length, - tvb, offset, 1, envelope, - "MTS Identifier Length: %u", - dmp.mts_id_length); + dmp.mts_id_item = proto_tree_add_item(envelope_tree, hf_envelope_mts_id_length, + tvb, offset, 1, ENC_BIG_ENDIAN); field_tree = proto_item_add_subtree (dmp.mts_id_item, ett_envelope_mts_id_length); proto_tree_add_item (field_tree, hf_envelope_mts_id_length, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; @@ -2951,9 +2919,9 @@ static gint dissect_dmp_envelope (tvbuff_t *tvb, packet_info *pinfo, subm_time = tvb_get_ntohs (tvb, offset); dmp.subm_time = dmp_dec_subm_time ((guint16)(subm_time & 0x7FFF), (gint32) pinfo->fd->abs_ts.secs); - tf = proto_tree_add_uint_format (envelope_tree, hf_envelope_subm_time, tvb, + tf = proto_tree_add_uint_format_value(envelope_tree, hf_envelope_subm_time, tvb, offset, 2, subm_time, - "Submission time: %s", + "%s", (subm_time & 0x7FFF) >= 0x7FF8 ? "Reserved" : abs_time_secs_to_str (dmp.subm_time, ABSOLUTE_TIME_LOCAL, TRUE)); @@ -3002,9 +2970,8 @@ static gint dissect_dmp_envelope (tvbuff_t *tvb, packet_info *pinfo, /* Recipient Count */ no_rec = (envelope & 0x1F); - tf = proto_tree_add_uint_format (envelope_tree, hf_envelope_recipients, - tvb, offset, 1, envelope, - "Recipient Count: %d", no_rec); + tf = proto_tree_add_uint(envelope_tree, hf_envelope_recipients, + tvb, offset, 1, envelope); field_tree = proto_item_add_subtree (tf, ett_envelope_recipients); proto_tree_add_item (field_tree, hf_envelope_recipients, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -3014,9 +2981,9 @@ static gint dissect_dmp_envelope (tvbuff_t *tvb, packet_info *pinfo, /* Extended Recipient Count */ value16 = tvb_get_ntohs (tvb, offset); no_rec = value16 & 0x7FFF; - tf = proto_tree_add_uint_format (envelope_tree,hf_envelope_ext_recipients, + tf = proto_tree_add_uint_format_value(envelope_tree,hf_envelope_ext_recipients, tvb, offset, 2, value16, - "Extended Recipient Count: %d%s", no_rec, + "%d%s", no_rec, (no_rec < 32 ? " (incorrect, reserved value)" : "")); @@ -3125,21 +3092,16 @@ static gint dissect_dmp_message (tvbuff_t *tvb, packet_info *pinfo, eit = (message & 0xE0) >> 5; compr_alg = (message & 0x18) >> 3; /* Encoded Information Type */ - tf = proto_tree_add_uint_format (message_tree, hf_message_eit, - tvb, offset, 1, message, "EIT: %s (%d)", - val_to_str_const (eit, eit_vals, "Unknown"), - eit); + tf = proto_tree_add_item (message_tree, hf_message_eit, + tvb, offset, 1, ENC_BIG_ENDIAN); field_tree = proto_item_add_subtree (tf, ett_message_eit); proto_tree_add_item (field_tree, hf_message_eit, tvb, offset, 1, ENC_BIG_ENDIAN); proto_item_append_text (en, ", Type: %s", val_to_str_const (eit, eit_vals, "Unknown")); /* Compression Algorithm */ - tf = proto_tree_add_uint_format (message_tree, hf_message_compr, - tvb, offset, 1, message, - "Compression Algorithm: %s (%d)", - val_to_str_const (compr_alg, compression_vals, "Unknown"), - compr_alg); + tf = proto_tree_add_item (message_tree, hf_message_compr, + tvb, offset, 1,ENC_BIG_ENDIAN); field_tree = proto_item_add_subtree (tf, ett_message_compr); tr = proto_tree_add_item (field_tree, hf_message_compr, tvb, offset, 1, ENC_BIG_ENDIAN); if (compr_alg == ALGORITHM_ZLIB) { @@ -3150,9 +3112,8 @@ static gint dissect_dmp_message (tvbuff_t *tvb, packet_info *pinfo, if (message & 0x07) { /* Reserved */ - tf = proto_tree_add_uint_format (message_tree, hf_reserved_0x07, - tvb, offset, 1, message, - "Reserved: %d", message & 0x07); + tf = proto_tree_add_item(message_tree, hf_reserved_0x07, + tvb, offset, 1, ENC_BIG_ENDIAN); field_tree = proto_item_add_subtree (tf, ett_message_body_reserved); tf = proto_tree_add_item (field_tree, hf_reserved_0x07, tvb, offset, 1, ENC_BIG_ENDIAN); expert_add_info(pinfo, tf, &ei_reserved_value); @@ -3264,9 +3225,8 @@ static gint dissect_dmp_report (tvbuff_t *tvb, packet_info *pinfo, if (report & 0x1F) { /* Reserved */ - tf = proto_tree_add_uint_format (report_tree, hf_reserved_0x1F, - tvb, offset, 1, report, - "Reserved: %d", report & 0x1F); + tf = proto_tree_add_item(report_tree, hf_reserved_0x1F, + tvb, offset, 1, ENC_BIG_ENDIAN); field_tree = proto_item_add_subtree (tf, ett_report_reserved); tf = proto_tree_add_item (field_tree, hf_reserved_0x1F, tvb, offset, 1, ENC_BIG_ENDIAN); expert_add_info(pinfo, tf, &ei_reserved_value); @@ -3619,9 +3579,8 @@ static gint dissect_dmp_content (tvbuff_t *tvb, packet_info *pinfo, if ((message & 0x20) >> 5) { /* Reserved */ - tf = proto_tree_add_uint_format (message_tree, hf_reserved_0x20, - tvb, offset, 1, message, - "Reserved: %d", (message & 0x20)>>5); + tf = proto_tree_add_item(message_tree, hf_reserved_0x20, + tvb, offset, 1, ENC_BIG_ENDIAN); field_tree = proto_item_add_subtree (tf, ett_message_reserved); tf = proto_tree_add_item (field_tree, hf_reserved_0x20, tvb, offset, 1, ENC_BIG_ENDIAN); expert_add_info(pinfo, tf, &ei_reserved_value); @@ -3629,20 +3588,16 @@ static gint dissect_dmp_content (tvbuff_t *tvb, packet_info *pinfo, /* Precedence */ dmp.prec = (message & 0x1C) >> 2; - tf = proto_tree_add_uint_format (message_tree, hf_message_precedence, - tvb, offset, 1, message, - "Precedence: %s (%d)", - val_to_str_const (dmp.prec, precedence, ""), - dmp.prec); + tf = proto_tree_add_item(message_tree, hf_message_precedence, + tvb, offset, 1,ENC_BIG_ENDIAN); field_tree = proto_item_add_subtree (tf, ett_message_precedence); proto_tree_add_item (field_tree, hf_message_precedence, tvb, offset, 1, ENC_BIG_ENDIAN); } else { if ((message & 0xE0) >> 5) { /* Reserved */ - tf = proto_tree_add_uint_format (message_tree, hf_reserved_0xE0, - tvb, offset, 1, message, - "Reserved: %d", (message & 0xE0)>>5); + tf = proto_tree_add_item(message_tree, hf_reserved_0xE0, + tvb, offset, 1, ENC_BIG_ENDIAN); field_tree = proto_item_add_subtree (tf, ett_message_reserved); tf = proto_tree_add_item (field_tree, hf_reserved_0xE0, tvb, offset, 1, ENC_BIG_ENDIAN); expert_add_info(pinfo, tf, &ei_reserved_value); @@ -3650,11 +3605,8 @@ static gint dissect_dmp_content (tvbuff_t *tvb, packet_info *pinfo, /* Importance */ dmp.prec = (message & 0x1C) >> 2; - tf = proto_tree_add_uint_format (message_tree, hf_message_importance, - tvb, offset, 1, message, - "Importance: %s (%d)", - val_to_str_const (dmp.prec, importance, ""), - dmp.prec); + tf = proto_tree_add_item(message_tree, hf_message_importance, + tvb, offset, 1, ENC_BIG_ENDIAN); field_tree = proto_item_add_subtree (tf, ett_message_importance); proto_tree_add_item (field_tree, hf_message_importance, tvb, offset, 1, ENC_BIG_ENDIAN); } @@ -3689,14 +3641,14 @@ static gint dissect_dmp_content (tvbuff_t *tvb, packet_info *pinfo, class_name = val_to_str_const (dmp_sec_class, sec_class, ""); } if (class_name && class_name[0]) { - tf = proto_tree_add_uint_format (message_tree, hf_message_sec_class_val, + tf = proto_tree_add_uint_format_value(message_tree, hf_message_sec_class_val, tvb, offset, 1, message, - "Security Classification: %s (%d)", + "%s (%d)", class_name, dmp_sec_class); } else { - tf = proto_tree_add_uint_format (message_tree, hf_message_sec_class_val, + tf = proto_tree_add_uint_format_value(message_tree, hf_message_sec_class_val, tvb, offset, 1, message, - "Security Classification: %d", + "%d", dmp_sec_class); } field_tree = proto_item_add_subtree (tf, ett_message_sec_class); @@ -3741,9 +3693,8 @@ static gint dissect_dmp_content (tvbuff_t *tvb, packet_info *pinfo, proto_tree_add_item (field_tree, hf_notif_type, tvb, offset, 1, ENC_BIG_ENDIAN); } else if (message & 0x02) { /* Reserved */ - tf = proto_tree_add_uint_format (message_tree, hf_reserved_0x02, - tvb, offset, 1, message, - "Reserved: %d", message & 0x02); + tf = proto_tree_add_item(message_tree, hf_reserved_0x02, + tvb, offset, 1, ENC_BIG_ENDIAN); field_tree = proto_item_add_subtree (tf, ett_message_reserved); tf = proto_tree_add_item (field_tree, hf_reserved_0x02, tvb, offset, 1, ENC_BIG_ENDIAN); expert_add_info(pinfo, tf, &ei_reserved_value); @@ -3763,9 +3714,9 @@ static gint dissect_dmp_content (tvbuff_t *tvb, packet_info *pinfo, /* Mission Policy Identifier */ message = tvb_get_guint8 (tvb, offset); if (message == 0xFF) { - proto_tree_add_uint_format (message_tree, hf_message_mission_policy_id, + proto_tree_add_uint_format_value(message_tree, hf_message_mission_policy_id, tvb, offset, 1, message, - "Mission Policy Identifier: Reserved (0xFF)"); + "Reserved (0xFF)"); } else { proto_tree_add_item (message_tree, hf_message_mission_policy_id, tvb, offset, 1, ENC_BIG_ENDIAN); } diff --git a/epan/dissectors/packet-dnp.c b/epan/dissectors/packet-dnp.c index 9c1c548ee1..6d8bdce4a2 100644 --- a/epan/dissectors/packet-dnp.c +++ b/epan/dissectors/packet-dnp.c @@ -2943,8 +2943,8 @@ dissect_dnp3_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) offset += 1; /* Add Control Byte Subtree */ - tc = proto_tree_add_uint_format(dl_tree, hf_dnp3_ctl, tvb, offset, 1, dl_ctl, - "Control: 0x%02x (", dl_ctl); + tc = proto_tree_add_uint_format_value(dl_tree, hf_dnp3_ctl, tvb, offset, 1, dl_ctl, + "0x%02x (", dl_ctl); /* Add Text to Control Byte Subtree Header */ if (dl_prm) { if (dl_ctl & DNP3_CTL_DIR) proto_item_append_text(tc, "DIR, "); @@ -2987,16 +2987,16 @@ dissect_dnp3_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) dl_crc = tvb_get_letohs(tvb, offset); calc_dl_crc = calculateCRC(tvb_get_ptr(tvb, 0, DNP_HDR_LEN - 2), DNP_HDR_LEN - 2); if (dl_crc == calc_dl_crc) - proto_tree_add_uint_format(dl_tree, hf_dnp_hdr_CRC, tvb, offset, 2, - dl_crc, "CRC: 0x%04x [correct]", dl_crc); + proto_tree_add_uint_format_value(dl_tree, hf_dnp_hdr_CRC, tvb, offset, 2, + dl_crc, "0x%04x [correct]", dl_crc); else { proto_item *hidden_item; hidden_item = proto_tree_add_boolean(dl_tree, hf_dnp_hdr_CRC_bad, tvb, offset, 2, TRUE); PROTO_ITEM_SET_HIDDEN(hidden_item); - proto_tree_add_uint_format(dl_tree, hf_dnp_hdr_CRC, tvb, offset, 2, - dl_crc, "CRC: 0x%04x [incorrect, should be 0x%04x]", + proto_tree_add_uint_format_value(dl_tree, hf_dnp_hdr_CRC, tvb, offset, 2, + dl_crc, "0x%04x [incorrect, should be 0x%04x]", dl_crc, calc_dl_crc); } offset += 2; diff --git a/epan/dissectors/packet-dns.c b/epan/dissectors/packet-dns.c index 091f572eab..a0ef6a206a 100644 --- a/epan/dissectors/packet-dns.c +++ b/epan/dissectors/packet-dns.c @@ -1399,8 +1399,8 @@ add_rr_to_tree(proto_item *trr, int rr_type, tvbuff_t *tvb, int offset, proto_tree_add_uint(rr_tree, hf_dns_rr_class, tvb, offset, 2, dns_class); } offset += 2; - ttl_tree = proto_tree_add_uint_format(rr_tree, hf_dns_rr_ttl, tvb, offset, 4, ttl, - "Time to live: %s", time_secs_to_str(ttl)); + ttl_tree = proto_tree_add_uint_format_value(rr_tree, hf_dns_rr_ttl, tvb, offset, 4, ttl, + "%s", time_secs_to_str(ttl)); if (ttl & 0x80000000) { expert_add_info(pinfo, ttl_tree, &ei_ttl_negative); } diff --git a/epan/dissectors/packet-dsi.c b/epan/dissectors/packet-dsi.c index 4b7f59fb5a..a763085d33 100644 --- a/epan/dissectors/packet-dsi.c +++ b/epan/dissectors/packet-dsi.c @@ -553,9 +553,9 @@ dissect_dsi_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) 4, 4, dsi_code); break; } - proto_tree_add_uint_format(dsi_tree, hf_dsi_length, tvb, + proto_tree_add_uint_format_value(dsi_tree, hf_dsi_length, tvb, 8, 4, dsi_length, - "Length: %u bytes", dsi_length); + "%u bytes", dsi_length); proto_tree_add_uint(dsi_tree, hf_dsi_reserved, tvb, 12, 4, dsi_reserved); } diff --git a/epan/dissectors/packet-dvb-s2-bb.c b/epan/dissectors/packet-dvb-s2-bb.c index 841a041e14..40fa0407ad 100644 --- a/epan/dissectors/packet-dvb-s2-bb.c +++ b/epan/dissectors/packet-dvb-s2-bb.c @@ -758,12 +758,12 @@ static int dissect_dvb_s2_bb(tvbuff_t *tvb, int cur_off, proto_tree *tree, packe input8 = tvb_get_guint8(tvb, cur_off + DVB_S2_BB_OFFS_MATYPE2); new_off += 1; if (flag_is_ms) { - proto_tree_add_uint_format(dvb_s2_bb_tree, hf_dvb_s2_bb_matype2, tvb, - cur_off + DVB_S2_BB_OFFS_MATYPE2, 1, input8, "MATYPE2: Input Stream Identifier (ISI): %d", + proto_tree_add_uint_format_value(dvb_s2_bb_tree, hf_dvb_s2_bb_matype2, tvb, + cur_off + DVB_S2_BB_OFFS_MATYPE2, 1, input8, "Input Stream Identifier (ISI): %d", input8); } else { - proto_tree_add_uint_format(dvb_s2_bb_tree, hf_dvb_s2_bb_matype2, tvb, - cur_off + DVB_S2_BB_OFFS_MATYPE2, 1, input8, "MATYPE2: reserved"); + proto_tree_add_uint_format_value(dvb_s2_bb_tree, hf_dvb_s2_bb_matype2, tvb, + cur_off + DVB_S2_BB_OFFS_MATYPE2, 1, input8, "reserved"); } input16 = tvb_get_ntohs(tvb, cur_off + DVB_S2_BB_OFFS_UPL); @@ -777,8 +777,8 @@ static int dissect_dvb_s2_bb(tvbuff_t *tvb, int cur_off, proto_tree *tree, packe bb_data_len /= 8; new_off += 2; - proto_tree_add_uint_format(dvb_s2_bb_tree, hf_dvb_s2_bb_dfl, tvb, - cur_off + DVB_S2_BB_OFFS_DFL, 2, input16, "DFL: %d bits (%d bytes)", input16, input16 / 8); + proto_tree_add_uint_format_value(dvb_s2_bb_tree, hf_dvb_s2_bb_dfl, tvb, + cur_off + DVB_S2_BB_OFFS_DFL, 2, input16, "%d bits (%d bytes)", input16, input16 / 8); new_off += 1; proto_tree_add_item(dvb_s2_bb_tree, hf_dvb_s2_bb_sync, tvb, cur_off + DVB_S2_BB_OFFS_SYNC, 1, ENC_BIG_ENDIAN); diff --git a/epan/dissectors/packet-edonkey.c b/epan/dissectors/packet-edonkey.c index ee64ca94f6..eba69162cc 100644 --- a/epan/dissectors/packet-edonkey.c +++ b/epan/dissectors/packet-edonkey.c @@ -2964,8 +2964,8 @@ static void dissect_edonkey_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tre offset, EDONKEY_TCP_HEADER_LENGTH + msg_len, ENC_NA); edonkey_msg_tree = proto_item_add_subtree(ti, ett_edonkey_message); - proto_tree_add_uint_format(edonkey_msg_tree, hf_edonkey_protocol, tvb, offset, 1, protocol, - "Protocol: %s (0x%02x)", protocol_name, protocol); + proto_tree_add_uint_format_value(edonkey_msg_tree, hf_edonkey_protocol, tvb, offset, 1, protocol, + "%s (0x%02x)", protocol_name, protocol); proto_tree_add_uint(edonkey_msg_tree, hf_edonkey_message_length, tvb, offset+1, 4, msg_len); } @@ -3010,8 +3010,8 @@ static void dissect_edonkey_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tre col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", message_name); if (edonkey_msg_tree) { - proto_tree_add_uint_format(edonkey_msg_tree, hf_edonkey_message_type, tvb, offset, 1, msg_type, - "Message Type: %s (0x%02x)", message_name, msg_type); + proto_tree_add_uint_format_value(edonkey_msg_tree, hf_edonkey_message_type, tvb, offset, 1, msg_type, + "%s (0x%02x)", message_name, msg_type); if (dissector && (msg_len > 1)) { if (!tvbraw) { (*dissector)(msg_type, tvb, pinfo, offset+1, msg_len-1, edonkey_msg_tree); @@ -3088,10 +3088,10 @@ static int dissect_edonkey_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr ti = proto_tree_add_item(edonkey_tree, hf_edonkey_message, tvb, offset, -1, ENC_NA); edonkey_msg_tree = proto_item_add_subtree(ti, ett_edonkey_message); - proto_tree_add_uint_format(edonkey_msg_tree, hf_edonkey_protocol, tvb, offset, 1, protocol, - "Protocol: %s (0x%02x)", protocol_name, protocol); - proto_tree_add_uint_format(edonkey_msg_tree, hf_edonkey_message_type, tvb, offset+1, 1, msg_type, - "Message Type: %s (0x%02x)", message_name, msg_type); + proto_tree_add_uint_format_value(edonkey_msg_tree, hf_edonkey_protocol, tvb, offset, 1, protocol, + "%s (0x%02x)", protocol_name, protocol); + proto_tree_add_uint_format_value(edonkey_msg_tree, hf_edonkey_message_type, tvb, offset+1, 1, msg_type, + "%s (0x%02x)", message_name, msg_type); offset += EDONKEY_UDP_HEADER_LENGTH; remainingLength = tvb_length_remaining( tvb, offset ); diff --git a/epan/dissectors/packet-erf.c b/epan/dissectors/packet-erf.c index 3c3ecd4895..418a03271b 100644 --- a/epan/dissectors/packet-erf.c +++ b/epan/dissectors/packet-erf.c @@ -805,7 +805,7 @@ dissect_channelised_ex_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr proto_tree_add_boolean(tree, hf_erf_ehdr_chan_morefrag, tvb, 0, 0, (guint8)((hdr >> 55) & 0x1)); proto_tree_add_uint(tree, hf_erf_ehdr_chan_seqnum, tvb, 0, 0, (guint16)((hdr >> 40) & 0x7FFF)); proto_tree_add_uint(tree, hf_erf_ehdr_chan_res, tvb, 0, 0, (guint8)((hdr >> 32) & 0xFF)); - proto_tree_add_uint_format(tree, hf_erf_ehdr_chan_virt_container_id, tvb, 0, 0, vc_id, "Virtual Container ID: 0x%.2x (g.707: %s)", vc_id, vc_id_string->str); + proto_tree_add_uint_format_value(tree, hf_erf_ehdr_chan_virt_container_id, tvb, 0, 0, vc_id, "0x%.2x (g.707: %s)", vc_id, vc_id_string->str); proto_tree_add_uint(tree, hf_erf_ehdr_chan_assoc_virt_container_size, tvb, 0, 0, vc_size); proto_tree_add_uint(tree, hf_erf_ehdr_chan_rate, tvb, 0, 0, line_rate); proto_tree_add_uint(tree, hf_erf_ehdr_chan_type, tvb, 0, 0, (guint8)((hdr >> 0) & 0xFF)); diff --git a/epan/dissectors/packet-eth.c b/epan/dissectors/packet-eth.c index 84778abfc6..57d78c4ad3 100644 --- a/epan/dissectors/packet-eth.c +++ b/epan/dissectors/packet-eth.c @@ -669,9 +669,9 @@ add_ethernet_trailer(packet_info *pinfo, proto_tree *tree, proto_tree *fh_tree, if(eth_check_fcs){ guint32 fcs = crc32_802_tvb(tvb, tvb_length(tvb) - 4); if (fcs == sent_fcs) { - item = proto_tree_add_uint_format(fh_tree, hf_eth_fcs, trailer_tvb, + item = proto_tree_add_uint_format_value(fh_tree, hf_eth_fcs, trailer_tvb, padding_length+trailer_length, 4, sent_fcs, - "Frame check sequence: 0x%08x [correct]", sent_fcs); + "0x%08x [correct]", sent_fcs); checksum_tree = proto_item_add_subtree(item, ett_eth_fcs); item = proto_tree_add_boolean(checksum_tree, hf_eth_fcs_good, trailer_tvb, padding_length+trailer_length, 4, TRUE); @@ -680,9 +680,9 @@ add_ethernet_trailer(packet_info *pinfo, proto_tree *tree, proto_tree *fh_tree, padding_length+trailer_length, 4, FALSE); PROTO_ITEM_SET_GENERATED(item); } else { - item = proto_tree_add_uint_format(fh_tree, hf_eth_fcs, trailer_tvb, + item = proto_tree_add_uint_format_value(fh_tree, hf_eth_fcs, trailer_tvb, padding_length+trailer_length, 4, sent_fcs, - "Frame check sequence: 0x%08x [incorrect, should be 0x%08x]", + "0x%08x [incorrect, should be 0x%08x]", sent_fcs, fcs); checksum_tree = proto_item_add_subtree(item, ett_eth_fcs); item = proto_tree_add_boolean(checksum_tree, hf_eth_fcs_good, trailer_tvb, @@ -695,9 +695,9 @@ add_ethernet_trailer(packet_info *pinfo, proto_tree *tree, proto_tree *fh_tree, col_append_str(pinfo->cinfo, COL_INFO, " [ETHERNET FRAME CHECK SEQUENCE INCORRECT]"); } }else{ - item = proto_tree_add_uint_format(fh_tree, hf_eth_fcs, trailer_tvb, + item = proto_tree_add_uint_format_value(fh_tree, hf_eth_fcs, trailer_tvb, padding_length+trailer_length, 4, sent_fcs, - "Frame check sequence: 0x%08x [validiation disabled]", sent_fcs); + "0x%08x [validiation disabled]", sent_fcs); checksum_tree = proto_item_add_subtree(item, ett_eth_fcs); item = proto_tree_add_boolean(checksum_tree, hf_eth_fcs_good, trailer_tvb, padding_length+trailer_length, 4, FALSE); diff --git a/epan/dissectors/packet-fc.c b/epan/dissectors/packet-fc.c index 5fd94a19b4..fcdaf9eb63 100644 --- a/epan/dissectors/packet-fc.c +++ b/epan/dissectors/packet-fc.c @@ -543,9 +543,8 @@ dissect_fc_vft(proto_tree *parent_tree, hop_ct = tvb_get_guint8(tvb, offset + 4); if (parent_tree) { - item = proto_tree_add_uint_format(parent_tree, hf_fc_vft, tvb, offset, - 8, vf_id, "VFT Header: " - "VF_ID %d Pri %d Hop Count %d", + item = proto_tree_add_uint_format_value(parent_tree, hf_fc_vft, tvb, offset, + 8, vf_id, "VF_ID %d Pri %d Hop Count %d", vf_id, pri, hop_ct); tree = proto_item_add_subtree(item, ett_fc_vft); } @@ -985,9 +984,9 @@ dissect_fc_helper (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean /* for F_BSY frames, the upper 4 bits of the type field specify the * reason for the BSY. */ - proto_tree_add_uint_format (fc_tree, hf_fc_type, tvb, + proto_tree_add_uint_format_value(fc_tree, hf_fc_type, tvb, offset+8, FC_TYPE_SIZE, - fchdr.type,"Type: 0x%x(%s)", fchdr.type, + fchdr.type,"0x%x(%s)", fchdr.type, fclctl_get_typestr ((guint8) (fchdr.r_ctl & 0x0F), fchdr.type)); } else { @@ -1018,9 +1017,9 @@ dissect_fc_helper (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean /* In all these cases of Link Ctl frame, the parameter field * encodes the detailed error message */ - proto_tree_add_uint_format (fc_tree, hf_fc_param, tvb, + proto_tree_add_uint_format_value(fc_tree, hf_fc_param, tvb, offset+20, 4, param, - "Parameter: 0x%x(%s)", param, + "0x%x(%s)", param, fclctl_get_paramstr ((fchdr.r_ctl & 0x0F), param)); } else { @@ -1028,9 +1027,9 @@ dissect_fc_helper (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean } } else if (ftype == FC_FTYPE_BLS) { if ((fchdr.r_ctl & 0x0F) == FC_BLS_ABTS) { - proto_tree_add_uint_format (fc_tree, hf_fc_param, tvb, + proto_tree_add_uint_format_value(fc_tree, hf_fc_param, tvb, offset+20, 4, param, - "Parameter: 0x%x(%s)", param, + "0x%x(%s)", param, ((param & 0x0F) == 1 ? "Abort Sequence" : "Abort Exchange")); } else { @@ -1291,14 +1290,13 @@ dissect_fcsof(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_tree_add_uint(fcsof_tree, hf_fcsof, tvb, sof_offset, 4, sof); if (crc == crc_computed) { - proto_tree_add_uint_format(fcsof_tree, hf_fccrc, tvb, + proto_tree_add_uint_format_value(fcsof_tree, hf_fccrc, tvb, crc_offset, 4, crc, - "CRC: %8.8x [valid]", crc); + "%8.8x [valid]", crc); } else { - it = proto_tree_add_uint_format(fcsof_tree, hf_fccrc, tvb, + it = proto_tree_add_uint_format_value(fcsof_tree, hf_fccrc, tvb, crc_offset, 4, crc, - "CRC: %8.8x " - "[error: should be %8.8x]", + "%8.8x [error: should be %8.8x]", crc, crc_computed); expert_add_info_format(pinfo, it, &ei_fccrc, diff --git a/epan/dissectors/packet-fcoe.c b/epan/dissectors/packet-fcoe.c index d963a25613..375460d99b 100644 --- a/epan/dissectors/packet-fcoe.c +++ b/epan/dissectors/packet-fcoe.c @@ -214,14 +214,13 @@ dissect_fcoe(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) */ if (crc_exists) { if (crc == crc_computed) { - item = proto_tree_add_uint_format(fcoe_tree, hf_fcoe_crc, tvb, + item = proto_tree_add_uint_format_value(fcoe_tree, hf_fcoe_crc, tvb, crc_offset, 4, crc, - "CRC: %8.8x [valid]", crc); + "%8.8x [valid]", crc); } else { - item = proto_tree_add_uint_format(fcoe_tree, hf_fcoe_crc, tvb, + item = proto_tree_add_uint_format_value(fcoe_tree, hf_fcoe_crc, tvb, crc_offset, 4, crc, - "CRC: %8.8x " - "[error: should be %8.8x]", + "%8.8x [error: should be %8.8x]", crc, crc_computed); expert_add_info_format(pinfo, item, &ei_fcoe_crc, "Bad FC CRC %8.8x %8.x", diff --git a/epan/dissectors/packet-fcoib.c b/epan/dissectors/packet-fcoib.c index 2adf0317fd..aed542cb47 100644 --- a/epan/dissectors/packet-fcoib.c +++ b/epan/dissectors/packet-fcoib.c @@ -282,14 +282,13 @@ dissect_fcoib(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U */ if (crc_exists) { if (crc == crc_computed) { - item = proto_tree_add_uint_format(fcoib_tree, hf_fcoib_crc, tvb, + item = proto_tree_add_uint_format_value(fcoib_tree, hf_fcoib_crc, tvb, crc_offset, 4, crc, - "CRC: %8.8x [valid]", crc); + "%8.8x [valid]", crc); } else { - item = proto_tree_add_uint_format(fcoib_tree, hf_fcoib_crc, tvb, + item = proto_tree_add_uint_format_value(fcoib_tree, hf_fcoib_crc, tvb, crc_offset, 4, crc, - "CRC: %8.8x " - "[error: should be %8.8x]", + "%8.8x [error: should be %8.8x]", crc, crc_computed); expert_add_info_format(pinfo, item, &ei_fcoib_crc, "Bad FC CRC %8.8x %8.x", diff --git a/epan/dissectors/packet-fcswils.c b/epan/dissectors/packet-fcswils.c index d9fbc25aa0..30ec31be76 100644 --- a/epan/dissectors/packet-fcswils.c +++ b/epan/dissectors/packet-fcswils.c @@ -718,11 +718,11 @@ dissect_swils_elp(tvbuff_t *tvb, proto_tree *elp_tree, guint8 isreq _U_) proto_tree_add_item(elp_tree, hf_swils_elp_rev, tvb, offset++, 1, ENC_BIG_ENDIAN); proto_tree_add_item(elp_tree, hf_swils_elp_flags, tvb, offset, 2, ENC_NA); offset += 3; - proto_tree_add_uint_format(elp_tree, hf_swils_elp_r_a_tov, tvb, offset, 4, - elp.r_a_tov, "R_A_TOV: %d msecs", elp.r_a_tov); + proto_tree_add_uint_format_value(elp_tree, hf_swils_elp_r_a_tov, tvb, offset, 4, + elp.r_a_tov, "%d msecs", elp.r_a_tov); offset += 4; - proto_tree_add_uint_format(elp_tree, hf_swils_elp_e_d_tov, tvb, offset, 4, - elp.e_d_tov, "E_D_TOV: %d msecs", elp.e_d_tov); + proto_tree_add_uint_format_value(elp_tree, hf_swils_elp_e_d_tov, tvb, offset, 4, + elp.e_d_tov, "%d msecs", elp.e_d_tov); offset += 4; proto_tree_add_string(elp_tree, hf_swils_elp_req_epn, tvb, offset, 8, fcwwn_to_str(elp.req_epname)); @@ -870,9 +870,9 @@ dissect_swils_efp(tvbuff_t *tvb, proto_tree *efp_tree, guint8 isreq _U_) efp.payload_len = tvb_get_ntohs(tvb, offset); if (efp.payload_len < FC_SWILS_EFP_SIZE) { if (efp_tree) - proto_tree_add_uint_format(efp_tree, hf_swils_efp_payload_len, + proto_tree_add_uint_format_value(efp_tree, hf_swils_efp_payload_len, tvb, offset, 2, efp.payload_len, - "Payload Len: %u (bogus, must be >= %u)", + "%u (bogus, must be >= %u)", efp.payload_len, FC_SWILS_EFP_SIZE); return; } diff --git a/epan/dissectors/packet-fddi.c b/epan/dissectors/packet-fddi.c index 71d7d51392..b73d6477b6 100644 --- a/epan/dissectors/packet-fddi.c +++ b/epan/dissectors/packet-fddi.c @@ -291,8 +291,8 @@ dissect_fddi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, ti = proto_tree_add_protocol_format(tree, proto_fddi, tvb, 0, FDDI_HEADER_SIZE+FDDI_PADDING, "Fiber Distributed Data Interface, %s", fc_str); fh_tree = proto_item_add_subtree(ti, ett_fddi); - ti = proto_tree_add_uint_format(fh_tree, hf_fddi_fc, tvb, FDDI_P_FC + FDDI_PADDING, 1, fddihdr->fc, - "Frame Control: 0x%02x (%s)", fddihdr->fc, fc_str); + ti = proto_tree_add_uint_format_value(fh_tree, hf_fddi_fc, tvb, FDDI_P_FC + FDDI_PADDING, 1, fddihdr->fc, + "0x%02x (%s)", fddihdr->fc, fc_str); fc_tree = proto_item_add_subtree(ti, ett_fddi_fc); proto_tree_add_uint(fc_tree, hf_fddi_fc_clf, tvb, FDDI_P_FC + FDDI_PADDING, 1, fddihdr->fc); switch ((fddihdr->fc) & FDDI_FC_CLFF) { diff --git a/epan/dissectors/packet-ff.c b/epan/dissectors/packet-ff.c index 37d16ece9e..01e71940b1 100644 --- a/epan/dissectors/packet-ff.c +++ b/epan/dissectors/packet-ff.c @@ -2035,9 +2035,9 @@ dissect_ff_msg_fda_open_sess_err(tvbuff_t *tvb, gint offset, ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, hf_ff_fda_open_sess_err_err_code, + proto_tree_add_uint_format_value(sub_tree, hf_ff_fda_open_sess_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -2153,9 +2153,9 @@ dissect_ff_msg_fda_idle_err(tvbuff_t *tvb, gint offset, ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, hf_ff_fda_idle_err_err_code, + proto_tree_add_uint_format_value(sub_tree, hf_ff_fda_idle_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -2845,9 +2845,9 @@ dissect_ff_msg_sm_id_err(tvbuff_t *tvb, gint offset, ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, hf_ff_sm_id_err_err_code, + proto_tree_add_uint_format_value(sub_tree, hf_ff_sm_id_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -2982,9 +2982,9 @@ dissect_ff_msg_sm_clear_addr_err(tvbuff_t *tvb, gint offset, ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, hf_ff_sm_clear_addr_err_err_code, + proto_tree_add_uint_format_value(sub_tree, hf_ff_sm_clear_addr_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -3240,10 +3240,10 @@ dissect_ff_msg_sm_set_assign_info_err(tvbuff_t *tvb, gint offset, ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, + proto_tree_add_uint_format_value(sub_tree, hf_ff_sm_set_assign_info_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -3372,10 +3372,10 @@ dissect_ff_msg_sm_clear_assign_info_err(tvbuff_t *tvb, gint offset, ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, + proto_tree_add_uint_format_value(sub_tree, hf_ff_sm_clear_assign_info_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -3920,9 +3920,9 @@ dissect_ff_msg_fms_init_err(tvbuff_t *tvb, gint offset, ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, hf_ff_fms_init_err_err_code, + proto_tree_add_uint_format_value(sub_tree, hf_ff_fms_init_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -4106,9 +4106,9 @@ dissect_ff_msg_fms_status_err(tvbuff_t *tvb, gint offset, ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, hf_ff_fms_status_err_err_code, + proto_tree_add_uint_format_value(sub_tree, hf_ff_fms_status_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -4290,9 +4290,9 @@ dissect_ff_msg_fms_id_err(tvbuff_t *tvb, gint offset, ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, hf_ff_fms_id_err_err_code, + proto_tree_add_uint_format_value(sub_tree, hf_ff_fms_id_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -4440,9 +4440,9 @@ dissect_ff_msg_fms_get_od_err(tvbuff_t *tvb, gint offset, ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, hf_ff_fms_get_od_err_err_code, + proto_tree_add_uint_format_value(sub_tree, hf_ff_fms_get_od_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -4568,9 +4568,9 @@ dissect_ff_msg_fms_init_put_od_err(tvbuff_t *tvb, gint offset, ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, hf_ff_fms_init_put_od_err_err_code, + proto_tree_add_uint_format_value(sub_tree, hf_ff_fms_init_put_od_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -4692,9 +4692,9 @@ dissect_ff_msg_fms_put_od_err(tvbuff_t *tvb, gint offset, ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, hf_ff_fms_put_od_err_err_code, + proto_tree_add_uint_format_value(sub_tree, hf_ff_fms_put_od_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -4815,10 +4815,10 @@ dissect_ff_msg_fms_terminate_put_od_err(tvbuff_t *tvb, gint offset, ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, + proto_tree_add_uint_format_value(sub_tree, hf_ff_fms_terminate_put_od_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -4945,10 +4945,10 @@ dissect_ff_msg_fms_generic_init_download_sequence_err( ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, + proto_tree_add_uint_format_value(sub_tree, hf_ff_fms_gen_init_download_seq_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -5084,10 +5084,10 @@ dissect_ff_msg_fms_generic_download_segment_err( ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, + proto_tree_add_uint_format_value(sub_tree, hf_ff_fms_gen_download_seg_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -5227,10 +5227,10 @@ dissect_ff_msg_fms_generic_terminate_download_sequence_err( ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, + proto_tree_add_uint_format_value(sub_tree, hf_ff_fms_gen_terminate_download_seq_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -5358,10 +5358,10 @@ dissect_ff_msg_fms_init_download_sequence_err( ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, + proto_tree_add_uint_format_value(sub_tree, hf_ff_fms_init_download_seq_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -5492,9 +5492,9 @@ dissect_ff_msg_fms_download_segment_err(tvbuff_t *tvb, gint offset, ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, hf_ff_fms_download_seg_err_err_code, + proto_tree_add_uint_format_value(sub_tree, hf_ff_fms_download_seg_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -5632,10 +5632,10 @@ dissect_ff_msg_fms_terminate_download_sequence_err( ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, + proto_tree_add_uint_format_value(sub_tree, hf_ff_fms_terminate_download_seq_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -5761,9 +5761,9 @@ dissect_ff_msg_fms_init_upload_seq_err( ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, hf_ff_fms_init_upload_seq_err_err_code, + proto_tree_add_uint_format_value(sub_tree, hf_ff_fms_init_upload_seq_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -5893,9 +5893,9 @@ dissect_ff_msg_fms_upload_segment_err(tvbuff_t *tvb, gint offset, ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, hf_ff_fms_upload_seg_err_err_code, + proto_tree_add_uint_format_value(sub_tree, hf_ff_fms_upload_seg_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -6021,10 +6021,10 @@ dissect_ff_msg_fms_terminate_upload_seq_err( ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, + proto_tree_add_uint_format_value(sub_tree, hf_ff_fms_terminate_upload_seq_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -6152,10 +6152,10 @@ dissect_ff_msg_fms_req_dom_download_err( ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, + proto_tree_add_uint_format_value(sub_tree, hf_ff_fms_req_dom_download_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -6282,9 +6282,9 @@ dissect_ff_msg_fms_req_dom_upload_err( ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, hf_ff_fms_req_dom_upload_err_err_code, + proto_tree_add_uint_format_value(sub_tree, hf_ff_fms_req_dom_upload_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -6463,9 +6463,9 @@ dissect_ff_msg_fms_create_pi_err(tvbuff_t *tvb, gint offset, ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, hf_ff_fms_create_pi_err_err_code, + proto_tree_add_uint_format_value(sub_tree, hf_ff_fms_create_pi_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -6590,9 +6590,9 @@ dissect_ff_msg_fms_del_pi_err(tvbuff_t *tvb, gint offset, ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, hf_ff_fms_del_pi_err_err_code, + proto_tree_add_uint_format_value(sub_tree, hf_ff_fms_del_pi_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -6721,9 +6721,9 @@ dissect_ff_msg_fms_start_pi_err(tvbuff_t *tvb, gint offset, ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, hf_ff_fms_start_err_err_code, + proto_tree_add_uint_format_value(sub_tree, hf_ff_fms_start_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -6851,9 +6851,9 @@ dissect_ff_msg_fms_stop_pi_err(tvbuff_t *tvb, gint offset, ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, hf_ff_fms_stop_err_err_code, + proto_tree_add_uint_format_value(sub_tree, hf_ff_fms_stop_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -6981,9 +6981,9 @@ dissect_ff_msg_fms_resume_pi_err(tvbuff_t *tvb, gint offset, ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, hf_ff_fms_resume_err_err_code, + proto_tree_add_uint_format_value(sub_tree, hf_ff_fms_resume_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -7111,9 +7111,9 @@ dissect_ff_msg_fms_reset_pi_err(tvbuff_t *tvb, gint offset, ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, hf_ff_fms_reset_err_err_code, + proto_tree_add_uint_format_value(sub_tree, hf_ff_fms_reset_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -7232,9 +7232,9 @@ dissect_ff_msg_fms_kill_pi_err(tvbuff_t *tvb, gint offset, ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, hf_ff_fms_kill_err_err_code, + proto_tree_add_uint_format_value(sub_tree, hf_ff_fms_kill_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -7350,9 +7350,9 @@ dissect_ff_msg_fms_read_err(tvbuff_t *tvb, gint offset, ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, hf_ff_fms_read_err_err_code, + proto_tree_add_uint_format_value(sub_tree, hf_ff_fms_read_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -7476,10 +7476,10 @@ dissect_ff_msg_fms_read_subindex_err(tvbuff_t *tvb, gint offset, ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, + proto_tree_add_uint_format_value(sub_tree, hf_ff_fms_read_with_subidx_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -7599,9 +7599,9 @@ dissect_ff_msg_fms_write_err(tvbuff_t *tvb, gint offset, ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, hf_ff_fms_write_err_err_code, + proto_tree_add_uint_format_value(sub_tree, hf_ff_fms_write_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -7727,10 +7727,10 @@ dissect_ff_msg_fms_write_subindex_err(tvbuff_t *tvb, gint offset, ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, + proto_tree_add_uint_format_value(sub_tree, hf_ff_fms_write_with_subidx_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -7894,10 +7894,10 @@ dissect_ff_msg_fms_def_variable_list_err(tvbuff_t *tvb, gint offset, ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, + proto_tree_add_uint_format_value(sub_tree, hf_ff_fms_def_variable_list_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -8019,10 +8019,10 @@ dissect_ff_msg_fms_del_variable_list_err(tvbuff_t *tvb, gint offset, ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, + proto_tree_add_uint_format_value(sub_tree, hf_ff_fms_del_variable_list_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -8364,10 +8364,10 @@ dissect_ff_msg_fms_alter_alter_ev_condition_monitoring_err( ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, + proto_tree_add_uint_format_value(sub_tree, hf_ff_fms_alter_ev_condition_monitoring_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -8499,10 +8499,10 @@ dissect_ff_msg_fms_ack_ev_notification_err( ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, + proto_tree_add_uint_format_value(sub_tree, hf_ff_fms_ack_ev_notification_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -8640,10 +8640,10 @@ dissect_ff_msg_lr_get_info_rsp( switch (MaxMsgNumDiff) { case 0: case 1: - proto_tree_add_uint_format(sub_tree, + proto_tree_add_uint_format_value(sub_tree, hf_ff_lr_get_info_rsp_lr_max_msg_num_diff, tvb, offset, 1, MaxMsgNumDiff, - "Max Message Number Difference: Do not detect a fault (%u)", + "Do not detect a fault (%u)", MaxMsgNumDiff); break; @@ -8741,9 +8741,9 @@ dissect_ff_msg_lr_get_info_err( ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, hf_ff_lr_get_info_err_err_code, + proto_tree_add_uint_format_value(sub_tree, hf_ff_lr_get_info_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -8848,10 +8848,10 @@ dissect_ff_msg_lr_put_info_req( switch (MaxMsgNumDiff) { case 0: case 1: - proto_tree_add_uint_format(sub_tree, + proto_tree_add_uint_format_value(sub_tree, hf_ff_lr_put_info_req_lr_max_msg_num_diff, tvb, offset, 1, MaxMsgNumDiff, - "Max Message Number Difference: Do not detect a fault (%u)", + "Do not detect a fault (%u)", MaxMsgNumDiff); break; @@ -8996,10 +8996,10 @@ dissect_ff_msg_lr_put_info_rsp( switch (MaxMsgNumDiff) { case 0: case 1: - proto_tree_add_uint_format(sub_tree, + proto_tree_add_uint_format_value(sub_tree, hf_ff_lr_put_info_rsp_lr_max_msg_num_diff, tvb, offset, 1, MaxMsgNumDiff, - "Max Message Number Difference: Do not detect a fault (%u)", + "Do not detect a fault (%u)", MaxMsgNumDiff); break; @@ -9097,9 +9097,9 @@ dissect_ff_msg_lr_put_info_err( ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, hf_ff_lr_put_info_err_err_code, + proto_tree_add_uint_format_value(sub_tree, hf_ff_lr_put_info_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -9299,10 +9299,10 @@ dissect_ff_msg_lr_get_statistics_err( ErrorCode = tvb_get_guint8(tvb, offset); error_code = val_to_str_err_code(ErrorClass, ErrorCode); - proto_tree_add_uint_format(sub_tree, + proto_tree_add_uint_format_value(sub_tree, hf_ff_lr_get_statistics_err_err_code, tvb, offset, 1, ErrorCode, - "Error Code: %s (%u)", error_code, ErrorCode); + "%s (%u)", error_code, ErrorCode); offset += 1; length -= 1; @@ -9507,10 +9507,10 @@ dissect_ff_msg_diagnostic_msg_req( proto_tree_add_item(sub_tree, hf_ff_lr_diagnostic_msg_req_dev_idx, tvb, offset, 2, ENC_BIG_ENDIAN); } else { - proto_tree_add_uint_format(sub_tree, + proto_tree_add_uint_format_value(sub_tree, hf_ff_lr_diagnostic_msg_req_dev_idx, tvb, offset, 2, DeviceIndex, - "Device Index: Index not assigned (%u)", DeviceIndex); + "Index not assigned (%u)", DeviceIndex); } offset += 2; length -= 2; diff --git a/epan/dissectors/packet-forces.c b/epan/dissectors/packet-forces.c index a652382798..7c1d447bd7 100644 --- a/epan/dissectors/packet-forces.c +++ b/epan/dissectors/packet-forces.c @@ -377,8 +377,8 @@ dissect_operation_tlv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint "Bogus: ForCES Operation TLV (Type:0x%04x) is not supported", type); length = tvb_get_ntohs(tvb, offset+2); - proto_tree_add_uint_format(oper_tree, hf_forces_lfbselect_tlv_type_operation_length, - tvb, offset+2, 2, length, "Length: %u Bytes", length); + proto_tree_add_uint_format_value(oper_tree, hf_forces_lfbselect_tlv_type_operation_length, + tvb, offset+2, 2, length, "%u Bytes", length); dissect_path_data_tlv(tvb, pinfo, oper_tree, offset+TLV_TL_LENGTH); if (length == 0) @@ -423,8 +423,8 @@ dissect_redirecttlv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint of proto_tree_add_item(meta_data_tree, hf_forces_redirect_tlv_meta_data_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN); length_meta = tvb_get_ntohs(tvb, offset+2); - proto_tree_add_uint_format(meta_data_tree, hf_forces_redirect_tlv_meta_data_tlv_length, tvb, offset+2, 2, - length_meta, "Length: %u Bytes", length_meta); + proto_tree_add_uint_format_value(meta_data_tree, hf_forces_redirect_tlv_meta_data_tlv_length, tvb, offset+2, 2, + length_meta, "%u Bytes", length_meta); proto_item_set_len(ti, length_meta); start_offset = offset; @@ -436,8 +436,8 @@ dissect_redirecttlv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint of proto_tree_add_item(meta_data_ilv_tree, hf_forces_redirect_tlv_meta_data_tlv_meta_data_ilv_id, tvb, offset+8, 4, ENC_BIG_ENDIAN); length_ilv = tvb_get_ntohl(tvb, offset+12); - proto_tree_add_uint_format(meta_data_ilv_tree, hf_forces_redirect_tlv_meta_data_tlv_meta_data_ilv_length, - tvb, offset+12, 4, length_ilv, "Length: %u Bytes", length_ilv); + proto_tree_add_uint_format_value(meta_data_ilv_tree, hf_forces_redirect_tlv_meta_data_tlv_meta_data_ilv_length, + tvb, offset+12, 4, length_ilv, "%u Bytes", length_ilv); if (length_ilv > 0) proto_tree_add_item(meta_data_ilv_tree, hf_forces_redirect_tlv_meta_data_tlv_meta_data_ilv, tvb, offset+8, length_ilv, ENC_NA); @@ -454,8 +454,8 @@ dissect_redirecttlv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint of proto_tree_add_item(redirect_data_tree, hf_forces_redirect_tlv_redirect_data_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN); length_redirect = tvb_get_ntohs(tvb, offset+2); - proto_tree_add_uint_format(redirect_data_tree, hf_forces_redirect_tlv_redirect_data_tlv_length, - tvb, offset+2, 2, length_redirect, "Length: %u Bytes", length_redirect); + proto_tree_add_uint_format_value(redirect_data_tree, hf_forces_redirect_tlv_redirect_data_tlv_length, + tvb, offset+2, 2, length_redirect, "%u Bytes", length_redirect); if (tvb_reported_length_remaining(tvb, offset) < length_redirect) { @@ -547,8 +547,8 @@ dissect_forces(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offs tlv_item = proto_tree_add_item(forces_tlv_tree, hf_forces_tlv_type, tvb, offset, 2, ENC_BIG_ENDIAN); length_count = tvb_get_ntohs(tvb, offset+2) * 4; proto_item_set_len(ti, length_count); - ti = proto_tree_add_uint_format(forces_tlv_tree, hf_forces_tlv_length, - tvb, offset+2, 2, length_count, "Length: %u Bytes", length_count); + ti = proto_tree_add_uint_format_value(forces_tlv_tree, hf_forces_tlv_length, + tvb, offset+2, 2, length_count, "%u Bytes", length_count); if (tvb_reported_length_remaining(tvb, offset) < length_count) expert_add_info_format(pinfo, ti, &ei_forces_tlv_length, "Bogus: Main TLV length (%u bytes) is wrong", length_count); diff --git a/epan/dissectors/packet-gnutella.c b/epan/dissectors/packet-gnutella.c index 8c1e794f14..a0a281ce3e 100644 --- a/epan/dissectors/packet-gnutella.c +++ b/epan/dissectors/packet-gnutella.c @@ -404,13 +404,13 @@ static void dissect_gnutella_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree * GNUTELLA_SERVENT_ID_LENGTH, ENC_NA); - proto_tree_add_uint_format(gnutella_header_tree, + proto_tree_add_uint_format_value(gnutella_header_tree, hf_gnutella_header_payload, tvb, GNUTELLA_HEADER_PAYLOAD_OFFSET, GNUTELLA_BYTE_LENGTH, payload_descriptor, - "Payload: %i (%s)", + "%i (%s)", payload_descriptor, payload_descriptor_text); diff --git a/epan/dissectors/packet-gsm_a_dtap.c b/epan/dissectors/packet-gsm_a_dtap.c index 9d6e9d55fc..fef43938cf 100644 --- a/epan/dissectors/packet-gsm_a_dtap.c +++ b/epan/dissectors/packet-gsm_a_dtap.c @@ -3452,16 +3452,15 @@ de_stream_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 of oct = tvb_get_guint8(tvb, curr_offset); if (oct == 0x00) { - proto_tree_add_uint_format(tree, hf_gsm_a_dtap_stream_identifier, tvb, curr_offset, 1, oct, - "Stream Identifier: No Bearer (%u)", oct); + proto_tree_add_uint_format_value(tree, hf_gsm_a_dtap_stream_identifier, tvb, curr_offset, 1, oct, + "No Bearer (%u)", oct); if (add_string) g_snprintf(add_string, string_len, " - (No Bearer)"); } else { - proto_tree_add_uint_format(tree, hf_gsm_a_dtap_stream_identifier, tvb, curr_offset, 1, oct, - "Stream Identifier: %u", oct); + proto_tree_add_item(tree, hf_gsm_a_dtap_stream_identifier, tvb, curr_offset, 1, ENC_NA); if (add_string) g_snprintf(add_string, string_len, " - (%u)", oct); diff --git a/epan/dissectors/packet-gtp.c b/epan/dissectors/packet-gtp.c index 05d4896328..f0d0da9d82 100644 --- a/epan/dissectors/packet-gtp.c +++ b/epan/dissectors/packet-gtp.c @@ -4428,41 +4428,41 @@ decode_qos_umts(tvbuff_t * tvb, int offset, proto_tree * tree, const gchar * qos proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_max_sdu_size, tvb, offset + (5 - 1) * utf8_type + 1, utf8_type, max_sdu_size); if ((max_sdu_size > 0) && (max_sdu_size <= 150)) { mss = max_sdu_size * 10; - proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_sdu_size, tvb, offset + (5 - 1) * utf8_type + 1, utf8_type, mss, - "Maximum SDU size: %u octets", mss); + proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_max_sdu_size, tvb, offset + (5 - 1) * utf8_type + 1, utf8_type, mss, + "%u octets", mss); } if (max_ul == 0 || max_ul == 255) proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (6 - 1) * utf8_type + 1, utf8_type, max_ul); if ((max_ul > 0) && (max_ul <= 63)) - proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (6 - 1) * utf8_type + 1, utf8_type, max_ul, - "Maximum bit rate for uplink: %u kbps", max_ul); + proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (6 - 1) * utf8_type + 1, utf8_type, max_ul, + "%u kbps", max_ul); if ((max_ul > 63) && (max_ul <= 127)) { mu = 64 + (max_ul - 64) * 8; - proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (6 - 1) * utf8_type + 1, utf8_type, mu, - "Maximum bit rate for uplink: %u kbps", mu); + proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (6 - 1) * utf8_type + 1, utf8_type, mu, + "%u kbps", mu); } if ((max_ul > 127) && (max_ul <= 254)) { mu = 576 + (max_ul - 128) * 64; - proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (6 - 1) * utf8_type + 1, utf8_type, mu, - "Maximum bit rate for uplink: %u kbps", mu); + proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (6 - 1) * utf8_type + 1, utf8_type, mu, + "%u kbps", mu); } if (max_dl == 0 || max_dl == 255) proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_max_dl, tvb, offset + (7 - 1) * utf8_type + 1, utf8_type, max_dl); if ((max_dl > 0) && (max_dl <= 63)) - proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_dl, tvb, offset + (7 - 1) * utf8_type + 1, utf8_type, max_dl, - "Maximum bit rate for downlink: %u kbps", max_dl); + proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_max_dl, tvb, offset + (7 - 1) * utf8_type + 1, utf8_type, max_dl, + "%u kbps", max_dl); if ((max_dl > 63) && (max_dl <= 127)) { md = 64 + (max_dl - 64) * 8; - proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_dl, tvb, offset + (7 - 1) * utf8_type + 1, utf8_type, md, - "Maximum bit rate for downlink: %u kbps", md); + proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_max_dl, tvb, offset + (7 - 1) * utf8_type + 1, utf8_type, md, + "%u kbps", md); } if ((max_dl > 127) && (max_dl <= 254)) { md = 576 + (max_dl - 128) * 64; - proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_dl, tvb, offset + (7 - 1) * utf8_type + 1, utf8_type, md, - "Maximum bit rate for downlink: %u kbps", md); + proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_max_dl, tvb, offset + (7 - 1) * utf8_type + 1, utf8_type, md, + "%u kbps", md); } proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_res_ber, tvb, offset + (8 - 1) * utf8_type + 1, utf8_type, res_ber); @@ -4473,34 +4473,34 @@ decode_qos_umts(tvbuff_t * tvb, int offset, proto_tree * tree, const gchar * qos if (guar_ul == 0 || guar_ul == 255) proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (10 - 1) * utf8_type + 1, utf8_type, guar_ul); if ((guar_ul > 0) && (guar_ul <= 63)) - proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (10 - 1) * utf8_type + 1, utf8_type, guar_ul, - "Guaranteed bit rate for uplink: %u kbps", guar_ul); + proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (10 - 1) * utf8_type + 1, utf8_type, guar_ul, + "%u kbps", guar_ul); if ((guar_ul > 63) && (guar_ul <= 127)) { gu = 64 + (guar_ul - 64) * 8; - proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (10 - 1) * utf8_type + 1, utf8_type, gu, - "Guaranteed bit rate for uplink: %u kbps", gu); + proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (10 - 1) * utf8_type + 1, utf8_type, gu, + "%u kbps", gu); } if ((guar_ul > 127) && (guar_ul <= 254)) { gu = 576 + (guar_ul - 128) * 64; - proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (10 - 1) * utf8_type + 1, utf8_type, gu, - "Guaranteed bit rate for uplink: %u kbps", gu); + proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (10 - 1) * utf8_type + 1, utf8_type, gu, + "%u kbps", gu); } /* Octet 13 */ if (guar_dl == 0 || guar_dl == 255) proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_guar_dl, tvb, offset + (11 - 1) * utf8_type + 1, utf8_type, guar_dl); if ((guar_dl > 0) && (guar_dl <= 63)) - proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_dl, tvb, offset + (11 - 1) * utf8_type + 1, utf8_type, guar_dl, - "Guaranteed bit rate for downlink: %u kbps", guar_dl); + proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_guar_dl, tvb, offset + (11 - 1) * utf8_type + 1, utf8_type, guar_dl, + "%u kbps", guar_dl); if ((guar_dl > 63) && (guar_dl <= 127)) { gd = 64 + (guar_dl - 64) * 8; - proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_dl, tvb, offset + (11 - 1) * utf8_type + 1, utf8_type, gd, - "Guaranteed bit rate for downlink: %u kbps", gd); + proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_guar_dl, tvb, offset + (11 - 1) * utf8_type + 1, utf8_type, gd, + "%u kbps", gd); } if ((guar_dl > 127) && (guar_dl <= 254)) { gd = 576 + (guar_dl - 128) * 64; - proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_dl, tvb, offset + (11 - 1) * utf8_type + 1, utf8_type, gd, - "Guaranteed bit rate for downlink: %u kbps", gd); + proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_guar_dl, tvb, offset + (11 - 1) * utf8_type + 1, utf8_type, gd, + "%u kbps", gd); } if(length > 13 ||((type == 2) && (length == 13))) { diff --git a/epan/dissectors/packet-h223.c b/epan/dissectors/packet-h223.c index 606a204bf2..7006d21be1 100644 --- a/epan/dissectors/packet-h223.c +++ b/epan/dissectors/packet-h223.c @@ -697,11 +697,11 @@ dissect_mux_al_pdu( tvbuff_t *tvb, packet_info *pinfo, proto_tree *vc_tree, real_checksum = tvb_get_guint8(tvb, len - 1); if( calc_checksum == real_checksum ) { - proto_tree_add_uint_format(al_tree, hf_h223_al2_crc, tvb, len - 1, 1, real_checksum, - "CRC: 0x%02x (correct)", real_checksum ); + proto_tree_add_uint_format_value(al_tree, hf_h223_al2_crc, tvb, len - 1, 1, real_checksum, + "0x%02x (correct)", real_checksum ); } else { - proto_tree_add_uint_format(al_tree, hf_h223_al2_crc, tvb, len - 1, 1, real_checksum, - "CRC: 0x%02x (incorrect, should be 0x%02x)", real_checksum, calc_checksum ); + proto_tree_add_uint_format_value(al_tree, hf_h223_al2_crc, tvb, len - 1, 1, real_checksum, + "0x%02x (incorrect, should be 0x%02x)", real_checksum, calc_checksum ); tmp_item = proto_tree_add_boolean( al_tree, hf_h223_al2_crc_bad, tvb, len - 1, 1, TRUE ); PROTO_ITEM_SET_GENERATED(tmp_item); @@ -1031,18 +1031,18 @@ dissect_mux_pdu( tvbuff_t *tvb, packet_info *pinfo, guint32 pkt_offset, case 2: if( errors == -1 ) { - proto_tree_add_uint_format(hdr_tree, hf_h223_mux_rawhdr, tvb, + proto_tree_add_uint_format_value(hdr_tree, hf_h223_mux_rawhdr, tvb, 0, 3, raw_hdr, - "Raw value: 0x%06x (uncorrectable errors)", raw_hdr ); + "0x%06x (uncorrectable errors)", raw_hdr ); } else { if( errors == 0 ) { - proto_tree_add_uint_format(hdr_tree, hf_h223_mux_rawhdr, tvb, + proto_tree_add_uint_format_value(hdr_tree, hf_h223_mux_rawhdr, tvb, 0, 3, raw_hdr, - "Raw value: 0x%06x (correct)", raw_hdr ); + "0x%06x (correct)", raw_hdr ); } else { - proto_tree_add_uint_format(hdr_tree, hf_h223_mux_rawhdr, tvb, + proto_tree_add_uint_format_value(hdr_tree, hf_h223_mux_rawhdr, tvb, 0, 3, raw_hdr, - "Raw value: 0x%06x (errors are 0x%06x)", raw_hdr, errors ); + "0x%06x (errors are 0x%06x)", raw_hdr, errors ); } item = proto_tree_add_uint(hdr_tree,hf_h223_mux_correctedhdr,tvb,0,3, correct_hdr); diff --git a/epan/dissectors/packet-hip.c b/epan/dissectors/packet-hip.c index 9865fb9bd6..3bdc472805 100644 --- a/epan/dissectors/packet-hip.c +++ b/epan/dissectors/packet-hip.c @@ -469,8 +469,8 @@ dissect_hip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) hiph_shim6_fixed_bit_p); proto_tree_add_uint(hip_tree, hf_hip_packet_type, tvb, offset+2, 1, hiph_packet_type); - proto_tree_add_uint_format(hip_tree, hf_hip_version, tvb, offset+3, 1, - hiph_version, "Version: %u, Reserved: %u", + proto_tree_add_uint_format_value(hip_tree, hf_hip_version, tvb, offset+3, 1, + hiph_version, "%u, Reserved: %u", hiph_version, hiph_reserved); proto_tree_add_uint_format(hip_tree, hf_hip_shim6_fixed_bit_s, tvb, offset+3, 1, hiph_shim6_fixed_bit_s, @@ -504,15 +504,15 @@ dissect_hip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) cksum_vec[3].ptr = tvb_get_ptr(tvb, 0, cksum_vec[3].len); computed_checksum = in_cksum(cksum_vec, 4); if (computed_checksum == 0) { - 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 (correct)", + "0x%04x (correct)", checksum_h); } else { if (checksum_h == 0 && pinfo->ipproto == IP_PROTO_UDP) { - 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 (correct)", + "0x%04x (correct)", checksum_h); } else { proto_tree_add_uint_format(hip_tree, hf_hip_checksum, tvb, @@ -525,9 +525,9 @@ dissect_hip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } } } 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 (unverified)", + "0x%04x (unverified)", checksum_h); } @@ -670,9 +670,9 @@ dissect_hip_tlv(tvbuff_t *tvb, int offset, proto_item *ti, int type, int tlv_len newoffset++; /* Reserved includes the Preferred bit */ reserved = tvb_get_guint8(tvb, newoffset); - proto_tree_add_uint_format(ti_loc, hf_hip_tlv_locator_reserved, tvb, + proto_tree_add_uint_format_value(ti_loc, hf_hip_tlv_locator_reserved, tvb, newoffset, 1, reserved, - "Reserved: 0x%x %s", reserved, + "0x%x %s", reserved, (reserved >> 31) ? "(Preferred)" : ""); newoffset++; /* Locator lifetime */ diff --git a/epan/dissectors/packet-hsr.c b/epan/dissectors/packet-hsr.c index f312cb0f22..9d5c80e8c5 100644 --- a/epan/dissectors/packet-hsr.c +++ b/epan/dissectors/packet-hsr.c @@ -104,13 +104,13 @@ dissect_hsr_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) lsdu_size = tvb_get_ntohs(tvb, HSR_PATH_OFFSET) & 0x0fff; lsdu_size_correct = tvb_reported_length_remaining(tvb, 0); if (lsdu_size == lsdu_size_correct) { - proto_tree_add_uint_format(hsr_tree, hf_hsr_lsdu_size, + proto_tree_add_uint_format_value(hsr_tree, hf_hsr_lsdu_size, tvb, HSR_PATH_OFFSET, HSR_LSDU_PATH_LENGTH, lsdu_size, - "LSDU size: %d [correct]", lsdu_size); + "%d [correct]", lsdu_size); } else { - proto_tree_add_uint_format(hsr_tree, hf_hsr_lsdu_size, + proto_tree_add_uint_format_value(hsr_tree, hf_hsr_lsdu_size, tvb, HSR_PATH_OFFSET, HSR_LSDU_PATH_LENGTH, lsdu_size, - "LSDU size: %d [WRONG, should be %d]", lsdu_size, lsdu_size_correct); + "%d [WRONG, should be %d]", lsdu_size, lsdu_size_correct); } proto_tree_add_item(hsr_tree, hf_hsr_sequence_nr, diff --git a/epan/dissectors/packet-hsrp.c b/epan/dissectors/packet-hsrp.c index a3390f862e..6af4e30a17 100644 --- a/epan/dissectors/packet-hsrp.c +++ b/epan/dissectors/packet-hsrp.c @@ -379,14 +379,14 @@ dissect_hsrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ proto_tree_add_uint(hsrp_tree, hf_hsrp_state, tvb, offset, 1, state); offset++; hellotime = tvb_get_guint8(tvb, offset); - proto_tree_add_uint_format(hsrp_tree, hf_hsrp_hellotime, tvb, offset, 1, hellotime, - "Hellotime: %sDefault (%u)", + proto_tree_add_uint_format_value(hsrp_tree, hf_hsrp_hellotime, tvb, offset, 1, hellotime, + "%sDefault (%u)", (hellotime == HSRP_DEFAULT_HELLOTIME) ? "" : "Non-", hellotime); offset++; holdtime = tvb_get_guint8(tvb, offset); - proto_tree_add_uint_format(hsrp_tree, hf_hsrp_holdtime, tvb, offset, 1, holdtime, - "Holdtime: %sDefault (%u)", + proto_tree_add_uint_format_value(hsrp_tree, hf_hsrp_holdtime, tvb, offset, 1, holdtime, + "%sDefault (%u)", (holdtime == HSRP_DEFAULT_HOLDTIME) ? "" : "Non-", holdtime); offset++; @@ -452,8 +452,8 @@ dissect_hsrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ proto_tree *group_state_tlv; if (tree) { - ti = proto_tree_add_uint_format(hsrp_tree, hf_hsrp2_group_state_tlv, tvb, offset, 2, type, - "Group State TLV: Type=%d Len=%d", type, len); + ti = proto_tree_add_uint_format_value(hsrp_tree, hf_hsrp2_group_state_tlv, tvb, offset, 2, type, + "Type=%d Len=%d", type, len); } offset+=2; @@ -485,14 +485,14 @@ dissect_hsrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ offset+=4; hellotime = tvb_get_ntohl(tvb, offset); - proto_tree_add_uint_format(group_state_tlv, hf_hsrp2_hellotime, tvb, offset, 4, hellotime, - "Hellotime: %sDefault (%u)", + proto_tree_add_uint_format_value(group_state_tlv, hf_hsrp2_hellotime, tvb, offset, 4, hellotime, + "%sDefault (%u)", (hellotime == HSRP2_DEFAULT_HELLOTIME) ? "" : "Non-", hellotime); offset+=4; holdtime = tvb_get_ntohl(tvb, offset); - proto_tree_add_uint_format(group_state_tlv, hf_hsrp2_holdtime, tvb, offset, 4, holdtime, - "Holdtime: %sDefault (%u)", + proto_tree_add_uint_format_value(group_state_tlv, hf_hsrp2_holdtime, tvb, offset, 4, holdtime, + "%sDefault (%u)", (holdtime == HSRP2_DEFAULT_HOLDTIME) ? "" : "Non-", holdtime); offset+=4; @@ -520,8 +520,8 @@ dissect_hsrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ if (tree) { proto_tree *interface_state_tlv; - ti = proto_tree_add_uint_format(hsrp_tree, hf_hsrp2_interface_state_tlv, tvb, offset, 1, type, - "Interface State TLV: Type=%d Len=%d", type, len); + ti = proto_tree_add_uint_format_value(hsrp_tree, hf_hsrp2_interface_state_tlv, tvb, offset, 1, type, + "Type=%d Len=%d", type, len); offset+=2; /* Making Interface State TLV subtree */ @@ -537,8 +537,8 @@ dissect_hsrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ proto_tree *text_auth_tlv; gchar auth_buf[8 + 1]; - ti = proto_tree_add_uint_format(hsrp_tree, hf_hsrp2_text_auth_tlv, tvb, offset, 1, type, - "Text Authentication TLV: Type=%d Len=%d", type, len); + ti = proto_tree_add_uint_format_value(hsrp_tree, hf_hsrp2_text_auth_tlv, tvb, offset, 1, type, + "Type=%d Len=%d", type, len); offset+=2; /* Making Text Authentication TLV subtree */ diff --git a/epan/dissectors/packet-i2c.c b/epan/dissectors/packet-i2c.c index 403ad80318..b3339a60f9 100644 --- a/epan/dissectors/packet-i2c.c +++ b/epan/dissectors/packet-i2c.c @@ -233,14 +233,14 @@ dissect_i2c(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) "Bus: I2C-%d", bus); if (is_event) { - proto_tree_add_uint_format(i2c_tree, hf_i2c_event, tvb, 0, 0, - flags, "Event: %s (0x%08x)", + proto_tree_add_uint_format_value(i2c_tree, hf_i2c_event, tvb, 0, 0, + flags, "%s (0x%08x)", i2c_get_event_desc(flags), flags); } else { proto_tree_add_uint_format_value(i2c_tree, hf_i2c_addr, tvb, 0, 1, addr, "0x%02x%s", addr, addr ? "" : " (General Call)"); - proto_tree_add_uint_format(i2c_tree, hf_i2c_flags, tvb, 0, 0, - flags, "Flags: 0x%08x", flags); + proto_tree_add_uint_format_value(i2c_tree, hf_i2c_flags, tvb, 0, 0, + flags, "0x%08x", flags); } } diff --git a/epan/dissectors/packet-icmp.c b/epan/dissectors/packet-icmp.c index 0c2a991ad9..d9cd166cbd 100644 --- a/epan/dissectors/packet-icmp.c +++ b/epan/dissectors/packet-icmp.c @@ -826,7 +826,6 @@ dissect_extensions(tvbuff_t * tvb, gint offset, proto_tree * tree) guint8 version; guint8 class_num; guint8 c_type; - guint16 reserved; guint16 cksum, computed_cksum; guint16 obj_length, obj_trunc_length; proto_item *ti, *tf_object, *hidden_item; @@ -864,10 +863,8 @@ dissect_extensions(tvbuff_t * tvb, gint offset, proto_tree * tree) version); /* Reserved */ - reserved = tvb_get_ntohs(tvb, offset) & 0x0fff; - proto_tree_add_uint_format(ext_tree, hf_icmp_ext_reserved, - tvb, offset, 2, reserved, - "Reserved: 0x%03x", reserved); + proto_tree_add_item(ext_tree, hf_icmp_ext_reserved, + tvb, offset, 2, ENC_BIG_ENDIAN); /* Checksum */ cksum = tvb_get_ntohs(tvb, offset + 2); @@ -877,18 +874,18 @@ dissect_extensions(tvbuff_t * tvb, gint offset, proto_tree * tree) reported_length); if (computed_cksum == 0) { - proto_tree_add_uint_format(ext_tree, hf_icmp_ext_checksum, + proto_tree_add_uint_format_value(ext_tree, hf_icmp_ext_checksum, tvb, offset + 2, 2, cksum, - "Checksum: 0x%04x [correct]", + "0x%04x [correct]", cksum); hidden_item = proto_tree_add_boolean(ext_tree, hf_icmp_ext_checksum_bad, tvb, offset + 2, 2, FALSE); } else { - proto_tree_add_uint_format(ext_tree, hf_icmp_ext_checksum, + proto_tree_add_uint_format_value(ext_tree, hf_icmp_ext_checksum, tvb, offset + 2, 2, cksum, - "Checksum: 0x%04x [incorrect, should be 0x%04x]", + "0x%04x [incorrect, should be 0x%04x]", cksum, in_cksum_shouldbe(cksum, computed_cksum)); hidden_item = @@ -1356,10 +1353,10 @@ dissect_icmp(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) ip_checksum(tvb_get_ptr(tvb, 0, reported_length), reported_length); if (computed_cksum == 0) { - proto_tree_add_uint_format(icmp_tree, + proto_tree_add_uint_format_value(icmp_tree, hf_icmp_checksum, tvb, 2, 2, cksum, - "Checksum: 0x%04x [correct]", + "0x%04x [correct]", cksum); item = proto_tree_add_boolean(icmp_tree, @@ -1367,10 +1364,10 @@ dissect_icmp(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) tvb, 2, 2, FALSE); PROTO_ITEM_SET_HIDDEN(item); } else { - proto_tree_add_uint_format(icmp_tree, + proto_tree_add_uint_format_value(icmp_tree, hf_icmp_checksum, tvb, 2, 2, cksum, - "Checksum: 0x%04x [incorrect, should be 0x%04x]", + "0x%04x [incorrect, should be 0x%04x]", cksum, in_cksum_shouldbe(cksum, computed_cksum)); @@ -1855,7 +1852,7 @@ void proto_register_icmp(void) {&hf_icmp_ext_reserved, {"Reserved", "icmp.ext.res", FT_UINT16, BASE_HEX, NULL, - 0x0, + 0x0fff, NULL, HFILL}}, {&hf_icmp_ext_checksum, diff --git a/epan/dissectors/packet-idp.c b/epan/dissectors/packet-idp.c index 5e08d8eaf5..6660436305 100644 --- a/epan/dissectors/packet-idp.c +++ b/epan/dissectors/packet-idp.c @@ -94,8 +94,8 @@ dissect_idp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_item(idp_tree, hf_idp_checksum, tvb, 0, 2, ENC_BIG_ENDIAN); length = tvb_get_ntohs(tvb, 2); - proto_tree_add_uint_format(idp_tree, hf_idp_len, tvb, 2, 2, length, - "Length: %u bytes", length); + proto_tree_add_uint_format_value(idp_tree, hf_idp_len, tvb, 2, 2, length, + "%u bytes", length); /* Adjust the tvbuff length to include only the IDP datagram. */ set_actual_length(tvb, length); proto_tree_add_item(idp_tree, hf_idp_hops, tvb, 4, 1, ENC_BIG_ENDIAN); diff --git a/epan/dissectors/packet-ieee80211-airopeek.c b/epan/dissectors/packet-ieee80211-airopeek.c index 5e0f579511..f962e58329 100644 --- a/epan/dissectors/packet-ieee80211-airopeek.c +++ b/epan/dissectors/packet-ieee80211-airopeek.c @@ -83,12 +83,11 @@ dissect_airopeek(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) * adapter was used to do the capture, we can't do the conversion. */ col_add_fstr(pinfo->cinfo, COL_RSSI, "%u%%", signal_level); - if (tree) { - proto_tree_add_uint_format(airopeek_tree, hf_signal_strength, tvb, 2, 1, + + proto_tree_add_uint_format_value(airopeek_tree, hf_signal_strength, tvb, 2, 1, signal_level, - "Signal Strength: %u%%", + "%u%%", signal_level); - } /* dissect the 802.11 header next */ pinfo->current_proto = "IEEE 802.11"; diff --git a/epan/dissectors/packet-ieee80211-radio.c b/epan/dissectors/packet-ieee80211-radio.c index b5069ef52f..8203a884d7 100644 --- a/epan/dissectors/packet-ieee80211-radio.c +++ b/epan/dissectors/packet-ieee80211-radio.c @@ -88,9 +88,9 @@ dissect_radio (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) proto_tree_add_uint(radio_tree, hf_channel, tvb, 0, 0, pinfo->pseudo_header->ieee_802_11.channel); - proto_tree_add_uint_format(radio_tree, hf_signal_strength, tvb, 0, 0, + proto_tree_add_uint_format_value(radio_tree, hf_signal_strength, tvb, 0, 0, pinfo->pseudo_header->ieee_802_11.signal_level, - "Signal Strength: %u%%", + "%u%%", pinfo->pseudo_header->ieee_802_11.signal_level); } diff --git a/epan/dissectors/packet-ieee80211-radiotap.c b/epan/dissectors/packet-ieee80211-radiotap.c index 9851444d20..96a221a928 100644 --- a/epan/dissectors/packet-ieee80211-radiotap.c +++ b/epan/dissectors/packet-ieee80211-radiotap.c @@ -1341,10 +1341,10 @@ dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) chan_str = ieee80211_mhz_to_str(freq); col_add_fstr(pinfo->cinfo, COL_FREQ_CHAN, "%s", chan_str); - proto_tree_add_uint_format(radiotap_tree, + proto_tree_add_uint_format_value(radiotap_tree, hf_radiotap_channel_frequency, tvb, offset, 2, freq, - "Channel frequency: %s", + "%s", chan_str); g_free(chan_str); /* We're already 2-byte aligned. */ diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c index 713701e300..d2dd586841 100644 --- a/epan/dissectors/packet-ieee80211.c +++ b/epan/dissectors/packet-ieee80211.c @@ -12859,7 +12859,7 @@ add_tagged_field(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset /*** Begin: BSSID Information ***/ offset += 6; bssid_info = tvb_get_letohl (tvb, offset); - parent_item = proto_tree_add_uint_format(tree, hf_ieee80211_tag_neighbor_report_bssid_info, tvb, offset, 4, bssid_info, "BSSID Information: 0x%08X", bssid_info); + parent_item = proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_bssid_info, tvb, offset, 4, ENC_LITTLE_ENDIAN); bssid_info_subtree = proto_item_add_subtree(parent_item, ett_tag_neighbor_report_bssid_info_tree); proto_tree_add_uint(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_reachability, tvb, offset, 1, bssid_info); @@ -12877,16 +12877,14 @@ add_tagged_field(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset /*** End: BSSID Information ***/ offset += 4; - info = tvb_get_guint8 (tvb, offset); - proto_tree_add_uint_format(tree, hf_ieee80211_tag_neighbor_report_reg_class, tvb, offset, 1, info, "Regulatory Class: 0x%02X", info); + proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_reg_class, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; - info = tvb_get_guint8 (tvb, offset); - proto_tree_add_uint_format(tree, hf_ieee80211_tag_neighbor_report_channel_number, tvb, offset, 1, info, "Channel Number: 0x%02X", info); + proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_channel_number, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; info = tvb_get_guint8 (tvb, offset); - proto_tree_add_uint_format(tree, hf_ieee80211_tag_neighbor_report_phy_type, tvb, offset, 1, info, "PHY Type: 0x%02X", info); + proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_phy_type, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; sub_tag_id = tvb_get_guint8 (tvb, offset); @@ -14653,10 +14651,10 @@ dissect_ieee80211_common (tvbuff_t *tvb, packet_info *pinfo, /* Davide Schiera (2006-11-21): added WEP or WPA separation */ if (algorithm == PROTECTION_ALG_WEP) { if (can_decrypt) - proto_tree_add_uint_format (wep_tree, hf_ieee80211_wep_icv, tvb, + proto_tree_add_uint_format_value(wep_tree, hf_ieee80211_wep_icv, tvb, hdr_len + ivlen + len, 4, tvb_get_ntohl(tvb, hdr_len + ivlen + len), - "WEP ICV: 0x%08x (not verified)", + "0x%08x (not verified)", tvb_get_ntohl(tvb, hdr_len + ivlen + len)); } else if (algorithm == PROTECTION_ALG_CCMP) { } else if (algorithm == PROTECTION_ALG_TKIP) { @@ -14673,10 +14671,10 @@ dissect_ieee80211_common (tvbuff_t *tvb, packet_info *pinfo, /* Davide Schiera (2006-11-21): added WEP or WPA separation */ if (algorithm == PROTECTION_ALG_WEP) { if (tree) - proto_tree_add_uint_format (wep_tree, hf_ieee80211_wep_icv, tvb, + proto_tree_add_uint_format_value(wep_tree, hf_ieee80211_wep_icv, tvb, hdr_len + ivlen + len, 4, tvb_get_ntohl(tvb, hdr_len + ivlen + len), - "WEP ICV: 0x%08x (correct)", + "0x%08x (correct)", tvb_get_ntohl(tvb, hdr_len + ivlen + len)); add_new_data_source(pinfo, next_tvb, "Decrypted WEP data"); diff --git a/epan/dissectors/packet-igmp.c b/epan/dissectors/packet-igmp.c index 59dc37b4e7..9506a6ca4b 100644 --- a/epan/dissectors/packet-igmp.c +++ b/epan/dissectors/packet-igmp.c @@ -782,8 +782,8 @@ dissect_igmp_mtrace(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int typ if (blocks) col_append_str(pinfo->cinfo, COL_INFO, blocks); - proto_tree_add_uint_format(tree, hf_type, tvb, offset, 1, type, - "Type: %s (0x%02x)", typestr, type); + proto_tree_add_uint_format_value(tree, hf_type, tvb, offset, 1, type, + "%s (0x%02x)", typestr, type); offset += 1; /* maximum number of hops that the requester wants to trace */ diff --git a/epan/dissectors/packet-ip.c b/epan/dissectors/packet-ip.c index cce3ad730d..280e1af39b 100644 --- a/epan/dissectors/packet-ip.c +++ b/epan/dissectors/packet-ip.c @@ -2136,9 +2136,9 @@ dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) ipsum = ip_checksum(tvb_get_ptr(tvb, offset, hlen), hlen); if (tree) { if (ipsum == 0) { - item = proto_tree_add_uint_format(ip_tree, hf_ip_checksum, tvb, + item = proto_tree_add_uint_format_value(ip_tree, hf_ip_checksum, tvb, offset + 10, 2, iph->ip_sum, - "Header checksum: 0x%04x [correct]", + "0x%04x [correct]", iph->ip_sum); checksum_tree = proto_item_add_subtree(item, ett_ip_checksum); item = proto_tree_add_boolean(checksum_tree, hf_ip_checksum_good, tvb, @@ -2148,9 +2148,9 @@ dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) offset + 10, 2, FALSE); PROTO_ITEM_SET_GENERATED(item); } else { - item = proto_tree_add_uint_format(ip_tree, hf_ip_checksum, tvb, + item = proto_tree_add_uint_format_value(ip_tree, hf_ip_checksum, tvb, offset + 10, 2, iph->ip_sum, - "Header checksum: 0x%04x " + "0x%04x" "[incorrect, should be 0x%04x " "(may be caused by \"IP checksum " "offload\"?)]", iph->ip_sum, @@ -2175,9 +2175,9 @@ dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) } else { ipsum = 0; if (tree) { - item = proto_tree_add_uint_format(ip_tree, hf_ip_checksum, tvb, + item = proto_tree_add_uint_format_value(ip_tree, hf_ip_checksum, tvb, offset + 10, 2, iph->ip_sum, - "Header checksum: 0x%04x [%s]", + "0x%04x [%s]", iph->ip_sum, ip_check_checksum ? (pinfo->flags.in_error_pkt ? diff --git a/epan/dissectors/packet-ipmi-se.c b/epan/dissectors/packet-ipmi-se.c index 43987c3e84..9e8709fcf1 100644 --- a/epan/dissectors/packet-ipmi-se.c +++ b/epan/dissectors/packet-ipmi-se.c @@ -2261,8 +2261,8 @@ rq12(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) } else { desc = "Reserved"; } - ti = proto_tree_add_uint_format(tree, hf_ipmi_se_12_byte1, tvb, 0, 1, - pno, "Parameter selector: %s (0x%02x)", desc, pno); + ti = proto_tree_add_uint_format_value(tree, hf_ipmi_se_12_byte1, tvb, 0, 1, + pno, "%s (0x%02x)", desc, pno); s_tree = proto_item_add_subtree(ti, ett_ipmi_se_12_byte1); proto_tree_add_uint_format(s_tree, hf_ipmi_se_12_param, tvb, 0, 1, pno, "%sParameter selector: %s (0x%02x)", @@ -2312,8 +2312,8 @@ rq13(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) } else { desc = "Reserved"; } - ti = proto_tree_add_uint_format(tree, hf_ipmi_se_13_byte1, tvb, 0, 1, - pno, "Parameter selector: %s (0x%02x)", desc, pno); + ti = proto_tree_add_uint_format_value(tree, hf_ipmi_se_13_byte1, tvb, 0, 1, + pno, "%s (0x%02x)", desc, pno); s_tree = proto_item_add_subtree(ti, ett_ipmi_se_13_byte1); proto_tree_add_item(s_tree, hf_ipmi_se_13_getrev, tvb, 0, 1, ENC_LITTLE_ENDIAN); proto_tree_add_uint_format(s_tree, hf_ipmi_se_13_param, tvb, 0, 1, diff --git a/epan/dissectors/packet-ipmi.c b/epan/dissectors/packet-ipmi.c index 00ad008526..d1924c5ffa 100644 --- a/epan/dissectors/packet-ipmi.c +++ b/epan/dissectors/packet-ipmi.c @@ -1283,8 +1283,8 @@ ipmi_do_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ipmi_tree, ipmi_d offs++; /* Command */ - proto_tree_add_uint_format(hdr_tree, hf_ipmi_header_command, tvb, offs++, 1, - hdr.cmd, "Command: %s (0x%02x)", cdesc, hdr.cmd); + proto_tree_add_uint_format_value(hdr_tree, hf_ipmi_header_command, tvb, offs++, 1, + hdr.cmd, "%s (0x%02x)", cdesc, hdr.cmd); /* Response code (if present) */ if (is_resp) { @@ -1316,14 +1316,14 @@ ipmi_do_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ipmi_tree, ipmi_d data_exp_crc = (0 - data_exp_crc) & 0xff; if (data_crc == data_exp_crc) { - proto_tree_add_uint_format(ipmi_tree, hf_ipmi_data_crc, tvb, len, 1, - data_crc, "Data checksum: 0x%02x (correct)", data_crc); + proto_tree_add_uint_format_value(ipmi_tree, hf_ipmi_data_crc, tvb, len, 1, + data_crc, "0x%02x (correct)", data_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(ipmi_tree, hf_ipmi_data_crc, tvb, len, 1, - data_crc, "Data checksum: 0x%02x (incorrect, expected 0x%02x)", + proto_tree_add_uint_format_value(ipmi_tree, hf_ipmi_data_crc, tvb, len, 1, + data_crc, "0x%02x (incorrect, expected 0x%02x)", data_crc, data_exp_crc); } } diff --git a/epan/dissectors/packet-ipsi-ctl.c b/epan/dissectors/packet-ipsi-ctl.c index ceaf196428..77b9099c40 100644 --- a/epan/dissectors/packet-ipsi-ctl.c +++ b/epan/dissectors/packet-ipsi-ctl.c @@ -117,9 +117,8 @@ static void dissect_ipsictl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (tree) { - ti = proto_tree_add_uint_format(ipsictl_tree, hf_ipsictl_pdu, tvb, - offset, (length+4), pdu, - "PDU: %d", pdu); + ti = proto_tree_add_uint(ipsictl_tree, hf_ipsictl_pdu, tvb, + offset, (length+4), pdu); pdu_tree = proto_item_add_subtree(ti, ett_ipsictl_pdu); } @@ -201,7 +200,7 @@ void proto_register_ipsictl(void) static hf_register_info hf[] = { { &hf_ipsictl_pdu, { "PDU", "ipsictl.pdu", - FT_UINT16, BASE_HEX, NULL, 0x0, + FT_UINT16, BASE_DEC, NULL, 0x0, "IPSICTL PDU", HFILL }}, { &hf_ipsictl_magic, { "Magic", "ipsictl.magic", diff --git a/epan/dissectors/packet-ipv6.c b/epan/dissectors/packet-ipv6.c index 5e0ae8792b..9a492d9b01 100644 --- a/epan/dissectors/packet-ipv6.c +++ b/epan/dissectors/packet-ipv6.c @@ -1333,8 +1333,7 @@ dissect_shimopts(tvbuff_t *tvb, int offset, proto_tree *tree, packet_info *pinfo /* Content Length */ proto_tree_add_item(opt_tree, hf_ipv6_shim6_opt_len, tvb, offset + 2, 2, ENC_BIG_ENDIAN); - ti = proto_tree_add_uint_format(opt_tree, hf_ipv6_shim6_opt_total_len, tvb, offset+2, 2, - total_len, "Total Length: %u", total_len); + ti = proto_tree_add_uint(opt_tree, hf_ipv6_shim6_opt_total_len, tvb, offset+2, 2, total_len); PROTO_ITEM_SET_GENERATED(ti); /* Option Type Specific */ @@ -1523,20 +1522,17 @@ dissect_shimctrl(tvbuff_t *tvb, gint offset, guint type, proto_tree *shim_tree) tmp = tvb_get_guint8(tvb, p); probes_sent = tmp & SHIM6_BITMASK_PSENT; probes_rcvd = (tmp & SHIM6_BITMASK_PRECVD) >> 4; - - proto_tree_add_uint_format(shim_tree, hf_ipv6_shim6_psent, tvb, - p, 1, probes_sent, - "Probes Sent: %u", probes_sent); - proto_tree_add_uint_format(shim_tree, hf_ipv6_shim6_precvd, tvb, - p, 1, probes_rcvd, - "Probes Received: %u", probes_rcvd); + proto_tree_add_item(shim_tree, hf_ipv6_shim6_psent, tvb, + p, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(shim_tree, hf_ipv6_shim6_precvd, tvb, + p, 1, ENC_BIG_ENDIAN); p++; sta = val_to_str_const((tvb_get_guint8(tvb, p) & SHIM6_BITMASK_STA) >> 6, shimreapstates, "Unknown REAP State"); - proto_tree_add_uint_format(shim_tree, hf_ipv6_shim6_reap, tvb, + proto_tree_add_uint_format_value(shim_tree, hf_ipv6_shim6_reap, tvb, p, 1, (tvb_get_guint8(tvb, p) & SHIM6_BITMASK_STA) >> 6, - "REAP State: %s", sta); + "%s", sta); proto_tree_add_text(shim_tree, tvb, p, 3, "Reserved2"); p += 3; @@ -1619,9 +1615,9 @@ dissect_shim6(tvbuff_t *tvb, int offset, proto_tree *tree, packet_info * pinfo) "Next header: %s (%u)", ipprotostr(shim.ip6s_nxt), shim.ip6s_nxt); /* Header Extension Length */ - proto_tree_add_uint_format(shim_tree, hf_ipv6_shim6_len, tvb, + proto_tree_add_uint_format_value(shim_tree, hf_ipv6_shim6_len, tvb, offset + (int)offsetof(struct ip6_shim, ip6s_len), 1, shim.ip6s_len, - "Header Ext Length: %u (%d bytes)", shim.ip6s_len, len); + "%u (%d bytes)", shim.ip6s_len, len); /* P Field */ proto_tree_add_item(shim_tree, hf_ipv6_shim6_p, tvb, @@ -1664,12 +1660,12 @@ dissect_shim6(tvbuff_t *tvb, int offset, proto_tree *tree, packet_info * pinfo) csum = shim_checksum(tvb_get_ptr(tvb, offset, len), len); if (csum == 0) { - ti = proto_tree_add_uint_format(shim_tree, hf_ipv6_shim6_checksum, tvb, p, 2, - tvb_get_ntohs(tvb, p), "Checksum: 0x%04x [correct]", tvb_get_ntohs(tvb, p)); + ti = proto_tree_add_uint_format_value(shim_tree, hf_ipv6_shim6_checksum, tvb, p, 2, + tvb_get_ntohs(tvb, p), "0x%04x [correct]", tvb_get_ntohs(tvb, p)); ipv6_shim6_checkum_additional_info(tvb, pinfo, ti, p, TRUE); } else { - ti = proto_tree_add_uint_format(shim_tree, hf_ipv6_shim6_checksum, tvb, p, 2, - tvb_get_ntohs(tvb, p), "Checksum: 0x%04x [incorrect: should be 0x%04x]", + ti = proto_tree_add_uint_format_value(shim_tree, hf_ipv6_shim6_checksum, tvb, p, 2, + tvb_get_ntohs(tvb, p), "0x%04x [incorrect: should be 0x%04x]", tvb_get_ntohs(tvb, p), in_cksum_shouldbe(tvb_get_ntohs(tvb, p), csum)); ipv6_shim6_checkum_additional_info(tvb, pinfo, ti, p, FALSE); } @@ -1766,10 +1762,10 @@ dissect_ipv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_item(ipv6_tree, hf_ipv6_plen, tvb, offset + (int)offsetof(struct ip6_hdr, ip6_plen), 2, ENC_BIG_ENDIAN); - proto_tree_add_uint_format(ipv6_tree, hf_ipv6_nxt, tvb, + proto_tree_add_uint_format_value(ipv6_tree, hf_ipv6_nxt, tvb, offset + (int)offsetof(struct ip6_hdr, ip6_nxt), 1, ipv6.ip6_nxt, - "Next header: %s (%u)", + "%s (%u)", ipprotostr(ipv6.ip6_nxt), ipv6.ip6_nxt); proto_tree_add_item(ipv6_tree, hf_ipv6_hlim, tvb, @@ -2685,12 +2681,12 @@ proto_register_ipv6(void) { &hf_ipv6_shim6_precvd, { "Probes Received", "ipv6.shim6.precvd", - FT_UINT8, BASE_DEC, NULL, 0x0, + FT_UINT8, BASE_DEC, NULL, SHIM6_BITMASK_PRECVD, NULL, HFILL }}, { &hf_ipv6_shim6_psent, { "Probes Sent", "ipv6.shim6.psent", - FT_UINT8, BASE_DEC, NULL, 0x0, + FT_UINT8, BASE_DEC, NULL, SHIM6_BITMASK_PSENT, NULL, HFILL }}, { &hf_ipv6_shim6_psrc, diff --git a/epan/dissectors/packet-ipx.c b/epan/dissectors/packet-ipx.c index d2bd02fbed..3d0dd9a4f4 100644 --- a/epan/dissectors/packet-ipx.c +++ b/epan/dissectors/packet-ipx.c @@ -303,8 +303,8 @@ dissect_ipx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) PROTO_ITEM_SET_HIDDEN(hidden_item); proto_tree_add_item(ipx_tree, hf_ipx_checksum, tvb, 0, 2, ENC_BIG_ENDIAN); - proto_tree_add_uint_format(ipx_tree, hf_ipx_len, tvb, 2, 2, ipxh->ipx_length, - "Length: %d bytes", ipxh->ipx_length); + proto_tree_add_uint_format_value(ipx_tree, hf_ipx_len, tvb, 2, 2, ipxh->ipx_length, + "%d bytes", ipxh->ipx_length); ipx_hops = tvb_get_guint8(tvb, 4); proto_tree_add_uint_format(ipx_tree, hf_ipx_hops, tvb, 4, 1, ipx_hops, "Transport Control: %d hops", ipx_hops); @@ -593,9 +593,9 @@ dissect_spx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) spx_msg_string = spx_conn_ctrl(conn_ctrl); col_append_fstr(pinfo->cinfo, COL_INFO, " %s", spx_msg_string); if (tree) { - ti = proto_tree_add_uint_format(spx_tree, hf_spx_connection_control, tvb, + ti = proto_tree_add_uint_format_value(spx_tree, hf_spx_connection_control, tvb, 0, 1, conn_ctrl, - "Connection Control: %s (0x%02X)", + "%s (0x%02X)", spx_msg_string, conn_ctrl); cc_tree = proto_item_add_subtree(ti, ett_spx_connctrl); proto_tree_add_boolean(cc_tree, hf_spx_connection_control_sys, tvb, diff --git a/epan/dissectors/packet-ipxwan.c b/epan/dissectors/packet-ipxwan.c index 98df5d5604..9650dfb532 100644 --- a/epan/dissectors/packet-ipxwan.c +++ b/epan/dissectors/packet-ipxwan.c @@ -213,10 +213,10 @@ dissect_ipxwan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } else { wan_link_delay = tvb_get_ntohs(tvb, offset); - proto_tree_add_uint_format(option_tree, + proto_tree_add_uint_format_value(option_tree, hf_ipxwan_wan_link_delay, tvb, offset, 2, wan_link_delay, - "WAN Link Delay: %ums", + "%ums", wan_link_delay); proto_tree_add_item(option_tree, hf_ipxwan_common_network_number, @@ -233,15 +233,15 @@ dissect_ipxwan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) "Bogus length: %u, should be 8", option_data_len); } else { delay = tvb_get_ntohl(tvb, offset); - proto_tree_add_uint_format(option_tree, + proto_tree_add_uint_format_value(option_tree, hf_ipxwan_delay, tvb, offset, 4, delay, - "Delay: %uus", delay); + "%uus", delay); throughput = tvb_get_ntohl(tvb, offset); - proto_tree_add_uint_format(option_tree, + proto_tree_add_uint_format_value(option_tree, hf_ipxwan_throughput, tvb, offset, 4, throughput, - "Throughput: %uus", + "%uus", throughput); } break; @@ -255,10 +255,10 @@ dissect_ipxwan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) hf_ipxwan_request_size, tvb, offset, 4, ENC_BIG_ENDIAN); delta_time = tvb_get_ntohl(tvb, offset); - proto_tree_add_uint_format(option_tree, + proto_tree_add_uint_format_value(option_tree, hf_ipxwan_delta_time, tvb, offset, 4, delta_time, - "Delta Time: %uus", + "%uus", delta_time); } break; diff --git a/epan/dissectors/packet-isakmp.c b/epan/dissectors/packet-isakmp.c index 738f1a2109..a4d496508a 100644 --- a/epan/dissectors/packet-isakmp.c +++ b/epan/dissectors/packet-isakmp.c @@ -2833,8 +2833,8 @@ dissect_isakmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) offset += 1; - vers_item = proto_tree_add_uint_format(isakmp_tree, hf_isakmp_version, tvb, offset, - 1, hdr.version, "Version: %u.%u", + vers_item = proto_tree_add_uint_format_value(isakmp_tree, hf_isakmp_version, tvb, offset, + 1, hdr.version, "%u.%u", hi_nibble(hdr.version), lo_nibble(hdr.version)); vers_tree = proto_item_add_subtree(vers_item, ett_isakmp_version); proto_tree_add_item(vers_tree, hf_isakmp_mjver, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -2880,8 +2880,8 @@ dissect_isakmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) offset += 4; if (hdr.length < ISAKMP_HDR_SIZE) { - proto_tree_add_uint_format(isakmp_tree, hf_isakmp_length, tvb, offset, 4, - hdr.length, "Length: (bogus, length is %u, should be at least %lu)", + proto_tree_add_uint_format_value(isakmp_tree, hf_isakmp_length, tvb, offset, 4, + hdr.length, "(bogus, length is %u, should be at least %lu)", hdr.length, (unsigned long)ISAKMP_HDR_SIZE); #ifdef HAVE_LIBGCRYPT if (pd_changed) pinfo->private_data = pd_save; @@ -2892,8 +2892,8 @@ dissect_isakmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) len = hdr.length - ISAKMP_HDR_SIZE; if (len < 0) { - proto_tree_add_uint_format(isakmp_tree, hf_isakmp_length, tvb, offset, 4, - hdr.length, "Length: (bogus, length is %u, which is too large)", + proto_tree_add_uint_format_value(isakmp_tree, hf_isakmp_length, tvb, offset, 4, + hdr.length, "(bogus, length is %u, which is too large)", hdr.length); #ifdef HAVE_LIBGCRYPT if (pd_changed) pinfo->private_data = pd_save; @@ -3659,8 +3659,8 @@ dissect_id(tvbuff_t *tvb, int offset, int length, proto_tree *tree, int isakmp_v protocol_id= tvb_get_guint8(tvb, offset); if (protocol_id == 0) - proto_tree_add_uint_format(tree, hf_isakmp_id_protoid, tvb, offset,1, - protocol_id, "Protocol ID: Unused"); + proto_tree_add_uint_format_value(tree, hf_isakmp_id_protoid, tvb, offset,1, + protocol_id, "Unused"); else proto_tree_add_item(tree, hf_isakmp_id_protoid, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -3669,8 +3669,8 @@ dissect_id(tvbuff_t *tvb, int offset, int length, proto_tree *tree, int isakmp_v port = tvb_get_ntohs(tvb, offset); if (port == 0) - proto_tree_add_uint_format(tree, hf_isakmp_id_port, tvb, offset, 2, - port, "Port: Unused"); + proto_tree_add_uint_format_value(tree, hf_isakmp_id_port, tvb, offset, 2, + port, "Unused"); else proto_tree_add_item(tree, hf_isakmp_id_port, tvb, offset, 2, ENC_BIG_ENDIAN); @@ -4498,8 +4498,8 @@ dissect_ts(tvbuff_t *tvb, int offset, int length, proto_tree *tree) case IKEV2_TS_IPV4_ADDR_RANGE: protocol_id = tvb_get_guint8(tvb, offset); if (protocol_id == 0) - proto_tree_add_uint_format(tree, hf_isakmp_ts_protoid, tvb, offset,1, - protocol_id, "Protocol ID: Unused"); + proto_tree_add_uint_format_value(tree, hf_isakmp_ts_protoid, tvb, offset,1, + protocol_id, "Unused"); else proto_tree_add_item(tree, hf_isakmp_ts_protoid, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; @@ -4527,8 +4527,8 @@ dissect_ts(tvbuff_t *tvb, int offset, int length, proto_tree *tree) case IKEV2_TS_IPV6_ADDR_RANGE: protocol_id = tvb_get_guint8(tvb, offset); if (protocol_id == 0) - proto_tree_add_uint_format(tree, hf_isakmp_ts_protoid, tvb, offset,1, - protocol_id, "Protocol ID: Unused"); + proto_tree_add_uint_format_value(tree, hf_isakmp_ts_protoid, tvb, offset,1, + protocol_id, "Unused"); else proto_tree_add_item(tree, hf_isakmp_ts_protoid, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; diff --git a/epan/dissectors/packet-iscsi.c b/epan/dissectors/packet-iscsi.c index 906f7516e5..9136b25903 100644 --- a/epan/dissectors/packet-iscsi.c +++ b/epan/dissectors/packet-iscsi.c @@ -636,9 +636,9 @@ handleHeaderDigest(iscsi_session_t *iscsi_session, proto_item *ti, tvbuff_t *tvb guint32 crc = ~crc32c_calculate(tvb_get_ptr(tvb, offset, headerLen), headerLen, CRC32C_PRELOAD); guint32 sent = tvb_get_ntohl(tvb, offset + headerLen); if(crc == sent) { - proto_tree_add_uint_format(ti, hf_iscsi_HeaderDigest32, tvb, offset + headerLen, 4, sent, "HeaderDigest: 0x%08x (Good CRC32)", sent); + proto_tree_add_uint_format_value(ti, hf_iscsi_HeaderDigest32, tvb, offset + headerLen, 4, sent, "0x%08x (Good CRC32)", sent); } else { - proto_tree_add_uint_format(ti, hf_iscsi_HeaderDigest32, tvb, offset + headerLen, 4, sent, "HeaderDigest: 0x%08x (Bad CRC32, should be 0x%08x)", sent, crc); + proto_tree_add_uint_format_value(ti, hf_iscsi_HeaderDigest32, tvb, offset + headerLen, 4, sent, "0x%08x (Bad CRC32, should be 0x%08x)", sent, crc); } } return offset + headerLen + 4; @@ -655,10 +655,10 @@ handleDataDigest(proto_item *ti, tvbuff_t *tvb, guint offset, int dataLen) { guint32 crc = ~crc32c_calculate(tvb_get_ptr(tvb, offset, dataLen), dataLen, CRC32C_PRELOAD); guint32 sent = tvb_get_ntohl(tvb, offset + dataLen); if(crc == sent) { - proto_tree_add_uint_format(ti, hf_iscsi_DataDigest32, tvb, offset + dataLen, 4, sent, "DataDigest: 0x%08x (Good CRC32)", sent); + proto_tree_add_uint_format_value(ti, hf_iscsi_DataDigest32, tvb, offset + dataLen, 4, sent, "0x%08x (Good CRC32)", sent); } else { - proto_tree_add_uint_format(ti, hf_iscsi_DataDigest32, tvb, offset + dataLen, 4, sent, "DataDigest: 0x%08x (Bad CRC32, should be 0x%08x)", sent, crc); + proto_tree_add_uint_format_value(ti, hf_iscsi_DataDigest32, tvb, offset + dataLen, 4, sent, "0x%08x (Bad CRC32, should be 0x%08x)", sent, crc); } } return offset + dataLen + 4; diff --git a/epan/dissectors/packet-isis-lsp.c b/epan/dissectors/packet-isis-lsp.c index 0247e68d32..129c502549 100644 --- a/epan/dissectors/packet-isis-lsp.c +++ b/epan/dissectors/packet-isis-lsp.c @@ -2727,8 +2727,8 @@ isis_dissect_isis_lsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o switch (check_and_get_checksum(tvb, offset_checksum, pdu_length-12, checksum, offset, &cacl_checksum)) { case NO_CKSUM : checksum = tvb_get_ntohs(tvb, offset); - proto_tree_add_uint_format(lsp_tree, hf_isis_lsp_checksum, tvb, offset, 2, checksum, - "Checksum: 0x%04x [unused]", checksum); + proto_tree_add_uint_format_value(lsp_tree, hf_isis_lsp_checksum, tvb, offset, 2, checksum, + "0x%04x [unused]", checksum); break; case DATA_MISSING : isis_dissect_unknown(tvb, tree, offset, @@ -2736,14 +2736,14 @@ isis_dissect_isis_lsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o tvb_length_remaining(tvb, offset_checksum)); break; case CKSUM_NOT_OK : - it_cksum = proto_tree_add_uint_format(lsp_tree, hf_isis_lsp_checksum, tvb, offset, 2, checksum, - "Checksum: 0x%04x [incorrect, should be 0x%04x]", + it_cksum = proto_tree_add_uint_format_value(lsp_tree, hf_isis_lsp_checksum, tvb, offset, 2, checksum, + "0x%04x [incorrect, should be 0x%04x]", checksum, cacl_checksum); isis_lsp_checkum_additional_info(tvb, pinfo, it_cksum, offset, FALSE); break; case CKSUM_OK : - it_cksum = proto_tree_add_uint_format(lsp_tree, hf_isis_lsp_checksum, tvb, offset, 2, checksum, - "Checksum: 0x%04x [correct]", checksum); + it_cksum = proto_tree_add_uint_format_value(lsp_tree, hf_isis_lsp_checksum, tvb, offset, 2, checksum, + "0x%04x [correct]", checksum); isis_lsp_checkum_additional_info(tvb, pinfo, it_cksum, offset, TRUE); break; default : diff --git a/epan/dissectors/packet-ismp.c b/epan/dissectors/packet-ismp.c index 2bee3d96cc..0fce351c6c 100644 --- a/epan/dissectors/packet-ismp.c +++ b/epan/dissectors/packet-ismp.c @@ -274,8 +274,8 @@ dissect_ismp_edp(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *ismp device_type = tvb_get_ntohs(tvb, offset); proto_tree_add_item(edp_tree, hf_ismp_edp_device_type, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; - proto_tree_add_uint_format(edp_tree, hf_ismp_edp_module_rev, tvb, offset, 4, tvb_get_ntohl(tvb, offset), - "Module Firmware Revision: %02x.%02x.%02x.%02x", tvb_get_guint8(tvb, offset), + proto_tree_add_uint_format_value(edp_tree, hf_ismp_edp_module_rev, tvb, offset, 4, tvb_get_ntohl(tvb, offset), + "%02x.%02x.%02x.%02x", tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1), tvb_get_guint8(tvb, offset+2), tvb_get_guint8(tvb, offset+3)); offset += 4; diff --git a/epan/dissectors/packet-isns.c b/epan/dissectors/packet-isns.c index fc235b976f..4937f22133 100644 --- a/epan/dissectors/packet-isns.c +++ b/epan/dissectors/packet-isns.c @@ -817,7 +817,7 @@ dissect_isns_attr_integer(tvbuff_t *tvb, guint offset, proto_tree *parent_tree, tree = proto_item_add_subtree(item, ett_isns_attribute); } else if((tag==ISNS_ATTR_TAG_PORTAL_GROUP_TAG)&&((function_id==ISNS_FUNC_DEVATTRREG)||(function_id==ISNS_FUNC_RSP_DEVATTRREG))){ /* 5.6.5.1 */ - item = proto_tree_add_uint_format(parent_tree, hf_isns_portal_group_tag, tvb, offset, 8, 0, "PG Tag: "); + item = proto_tree_add_uint_format_value(parent_tree, hf_isns_portal_group_tag, tvb, offset, 8, 0, ""); tree = proto_item_add_subtree(item, ett_isns_attribute); } else { item = proto_tree_add_text(parent_tree, tvb, offset, 8, "Oops, you surprised me here. a 0 byte integer."); diff --git a/epan/dissectors/packet-isup.c b/epan/dissectors/packet-isup.c index ee7995e8f8..dca129d9c8 100644 --- a/epan/dissectors/packet-isup.c +++ b/epan/dissectors/packet-isup.c @@ -9035,10 +9035,10 @@ dissect_isup_initial_address_message(tvbuff_t *message_tvb, proto_tree *isup_tre "Mandatory Parameter: %u (%s)", parameter_type, val_to_str_ext_const(parameter_type, &isup_parameter_type_value_ext, "unknown")); - proto_tree_add_uint_format(parameter_tree, hf_isup_mandatory_variable_parameter_pointer, message_tvb, offset, - PARAMETER_POINTER_LENGTH, parameter_pointer, "Pointer to Parameter: %u", parameter_pointer); - proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer, - PARAMETER_LENGTH_IND_LENGTH, parameter_length, "Parameter length: %u", parameter_length); + proto_tree_add_uint(parameter_tree, hf_isup_mandatory_variable_parameter_pointer, message_tvb, offset, + PARAMETER_POINTER_LENGTH, parameter_pointer); + proto_tree_add_uint(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer, + PARAMETER_LENGTH_IND_LENGTH, parameter_length); actual_length = tvb_ensure_length_remaining(message_tvb, offset); parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, @@ -9063,10 +9063,10 @@ dissect_isup_initial_address_message(tvbuff_t *message_tvb, proto_tree *isup_tre "Mandatory Parameter: %u (%s)", parameter_type, val_to_str_ext_const(parameter_type, &isup_parameter_type_value_ext, "unknown")); - proto_tree_add_uint_format(parameter_tree, hf_isup_mandatory_variable_parameter_pointer, message_tvb, offset, - PARAMETER_POINTER_LENGTH, parameter_pointer, "Pointer to Parameter: %u", parameter_pointer); - proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer, - PARAMETER_LENGTH_IND_LENGTH, parameter_length, "Parameter length: %u", parameter_length); + proto_tree_add_uint(parameter_tree, hf_isup_mandatory_variable_parameter_pointer, message_tvb, offset, + PARAMETER_POINTER_LENGTH, parameter_pointer); + proto_tree_add_uint(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer, + PARAMETER_LENGTH_IND_LENGTH, parameter_length); actual_length = tvb_ensure_length_remaining(message_tvb, offset); parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, @@ -9102,10 +9102,10 @@ static gint dissect_isup_subsequent_address_message(tvbuff_t *message_tvb, proto "Mandatory Parameter: %u (%s)", parameter_type, val_to_str_ext_const(parameter_type, &isup_parameter_type_value_ext, "unknown")); - proto_tree_add_uint_format(parameter_tree, hf_isup_mandatory_variable_parameter_pointer, message_tvb, offset, - PARAMETER_POINTER_LENGTH, parameter_pointer, "Pointer to Parameter: %u", parameter_pointer); - proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer, - PARAMETER_LENGTH_IND_LENGTH, parameter_length, "Parameter length: %u", parameter_length); + proto_tree_add_uint(parameter_tree, hf_isup_mandatory_variable_parameter_pointer, message_tvb, offset, + PARAMETER_POINTER_LENGTH, parameter_pointer); + proto_tree_add_uint(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer, + PARAMETER_LENGTH_IND_LENGTH, parameter_length); actual_length = tvb_ensure_length_remaining(message_tvb, offset); parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, @@ -9278,10 +9278,10 @@ dissect_isup_release_message(tvbuff_t *message_tvb, proto_tree *isup_tree) "Mandatory Parameter: %u (%s)", parameter_type, val_to_str_ext_const(parameter_type, &isup_parameter_type_value_ext, "unknown")); - proto_tree_add_uint_format(parameter_tree, hf_isup_mandatory_variable_parameter_pointer, message_tvb, offset, - PARAMETER_POINTER_LENGTH, parameter_pointer, "Pointer to Parameter: %u", parameter_pointer); - proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer, - PARAMETER_LENGTH_IND_LENGTH, parameter_length, "Parameter length: %u", parameter_length); + proto_tree_add_uint(parameter_tree, hf_isup_mandatory_variable_parameter_pointer, message_tvb, offset, + PARAMETER_POINTER_LENGTH, parameter_pointer); + proto_tree_add_uint(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer, + PARAMETER_LENGTH_IND_LENGTH, parameter_length); actual_length = tvb_ensure_length_remaining(message_tvb, offset); parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, @@ -9352,10 +9352,10 @@ dissect_isup_circuit_group_reset_query_message(tvbuff_t *message_tvb, proto_tree "Mandatory Parameter: %u (%s)", parameter_type, val_to_str_ext_const(parameter_type, &isup_parameter_type_value_ext, "unknown")); - proto_tree_add_uint_format(parameter_tree, hf_isup_mandatory_variable_parameter_pointer, message_tvb, offset, - PARAMETER_POINTER_LENGTH, parameter_pointer, "Pointer to Parameter: %u", parameter_pointer); - proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer, - PARAMETER_LENGTH_IND_LENGTH, parameter_length, "Parameter length: %u", parameter_length); + proto_tree_add_uint(parameter_tree, hf_isup_mandatory_variable_parameter_pointer, message_tvb, offset, + PARAMETER_POINTER_LENGTH, parameter_pointer); + proto_tree_add_uint(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer, + PARAMETER_LENGTH_IND_LENGTH, parameter_length); actual_length = tvb_ensure_length_remaining(message_tvb, offset); parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, @@ -9407,10 +9407,10 @@ dissect_isup_circuit_group_blocking_messages(tvbuff_t *message_tvb, proto_tree * "Mandatory Parameter: %u (%s)", parameter_type, val_to_str_ext_const(parameter_type, &isup_parameter_type_value_ext, "unknown")); - proto_tree_add_uint_format(parameter_tree, hf_isup_mandatory_variable_parameter_pointer, message_tvb, offset, - PARAMETER_POINTER_LENGTH, parameter_pointer, "Pointer to Parameter: %u", parameter_pointer); - proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer, - PARAMETER_LENGTH_IND_LENGTH, parameter_length, "Parameter length: %u", parameter_length); + proto_tree_add_uint(parameter_tree, hf_isup_mandatory_variable_parameter_pointer, message_tvb, offset, + PARAMETER_POINTER_LENGTH, parameter_pointer); + proto_tree_add_uint(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer, + PARAMETER_LENGTH_IND_LENGTH, parameter_length); actual_length = tvb_ensure_length_remaining(message_tvb, offset); parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, @@ -9490,10 +9490,10 @@ dissect_isup_facility_reject_message(tvbuff_t *message_tvb, proto_tree *isup_tre "Mandatory Parameter: %u (%s)", parameter_type, val_to_str_ext_const(parameter_type, &isup_parameter_type_value_ext, "unknown")); - proto_tree_add_uint_format(parameter_tree, hf_isup_mandatory_variable_parameter_pointer, message_tvb, - offset, PARAMETER_POINTER_LENGTH, parameter_pointer, "Pointer to Parameter: %u", parameter_pointer); - proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer, - PARAMETER_LENGTH_IND_LENGTH, parameter_length, "Parameter length: %u", parameter_length); + proto_tree_add_uint(parameter_tree, hf_isup_mandatory_variable_parameter_pointer, message_tvb, + offset, PARAMETER_POINTER_LENGTH, parameter_pointer); + proto_tree_add_uint(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer, + PARAMETER_LENGTH_IND_LENGTH, parameter_length); actual_length = tvb_ensure_length_remaining(message_tvb, offset); parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, @@ -9537,10 +9537,10 @@ dissect_isup_circuit_group_reset_acknowledgement_message(tvbuff_t *message_tvb, "Mandatory Parameter: %u (%s)", parameter_type, val_to_str_ext_const(parameter_type, &isup_parameter_type_value_ext, "unknown")); - proto_tree_add_uint_format(parameter_tree, hf_isup_mandatory_variable_parameter_pointer, message_tvb, offset, - PARAMETER_POINTER_LENGTH, parameter_pointer, "Pointer to Parameter: %u", parameter_pointer); - proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer, - PARAMETER_LENGTH_IND_LENGTH, parameter_length, "Parameter length: %u", parameter_length); + proto_tree_add_uint(parameter_tree, hf_isup_mandatory_variable_parameter_pointer, message_tvb, offset, + PARAMETER_POINTER_LENGTH, parameter_pointer); + proto_tree_add_uint(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer, + PARAMETER_LENGTH_IND_LENGTH, parameter_length); actual_length = tvb_ensure_length_remaining(message_tvb, offset); parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, @@ -9577,10 +9577,10 @@ dissect_isup_circuit_group_query_response_message(tvbuff_t *message_tvb, proto_t "Mandatory Parameter: %u (%s)", parameter_type, val_to_str_ext_const(parameter_type, &isup_parameter_type_value_ext, "unknown")); - proto_tree_add_uint_format(parameter_tree, hf_isup_mandatory_variable_parameter_pointer, message_tvb, offset, - PARAMETER_POINTER_LENGTH, parameter_pointer, "Pointer to Parameter: %u", parameter_pointer); - proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer, - PARAMETER_LENGTH_IND_LENGTH, parameter_length, "Parameter length: %u", parameter_length); + proto_tree_add_uint(parameter_tree, hf_isup_mandatory_variable_parameter_pointer, message_tvb, offset, + PARAMETER_POINTER_LENGTH, parameter_pointer); + proto_tree_add_uint(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer, + PARAMETER_LENGTH_IND_LENGTH, parameter_length); actual_length = tvb_ensure_length_remaining(message_tvb, offset); parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, @@ -9604,10 +9604,10 @@ dissect_isup_circuit_group_query_response_message(tvbuff_t *message_tvb, proto_t "Mandatory Parameter: %u (%s)", parameter_type, val_to_str_ext_const(parameter_type, &isup_parameter_type_value_ext, "unknown")); - proto_tree_add_uint_format(parameter_tree, hf_isup_mandatory_variable_parameter_pointer, message_tvb, offset, - PARAMETER_POINTER_LENGTH, parameter_pointer, "Pointer to Parameter: %u", parameter_pointer); - proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer, - PARAMETER_LENGTH_IND_LENGTH, parameter_length, "Parameter length: %u", parameter_length); + proto_tree_add_uint(parameter_tree, hf_isup_mandatory_variable_parameter_pointer, message_tvb, offset, + PARAMETER_POINTER_LENGTH, parameter_pointer); + proto_tree_add_uint(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer, + PARAMETER_LENGTH_IND_LENGTH, parameter_length); actual_length = tvb_ensure_length_remaining(message_tvb, offset); parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, @@ -9671,10 +9671,10 @@ dissect_isup_user_to_user_information_message(tvbuff_t *message_tvb, packet_info "Mandatory Parameter: %u (%s)", parameter_type, val_to_str_ext_const(parameter_type, &isup_parameter_type_value_ext, "unknown")); - proto_tree_add_uint_format(parameter_tree, hf_isup_mandatory_variable_parameter_pointer, message_tvb, offset, - PARAMETER_POINTER_LENGTH, parameter_pointer, "Pointer to Parameter: %u", parameter_pointer); - proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer, - PARAMETER_LENGTH_IND_LENGTH, parameter_length, "Parameter length: %u", parameter_length); + proto_tree_add_uint(parameter_tree, hf_isup_mandatory_variable_parameter_pointer, message_tvb, offset, + PARAMETER_POINTER_LENGTH, parameter_pointer); + proto_tree_add_uint(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer, + PARAMETER_LENGTH_IND_LENGTH, parameter_length); actual_length = tvb_ensure_length_remaining(message_tvb, offset); parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, @@ -9711,11 +9711,11 @@ dissect_isup_confusion_message(tvbuff_t *message_tvb, proto_tree *isup_tree) "Mandatory Parameter: %u (%s)", parameter_type, val_to_str_ext_const(parameter_type, &isup_parameter_type_value_ext, "unknown")); - proto_tree_add_uint_format(parameter_tree, hf_isup_mandatory_variable_parameter_pointer, message_tvb, offset, - PARAMETER_POINTER_LENGTH, parameter_pointer, "Pointer to Parameter: %u", parameter_pointer); - proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_length, + proto_tree_add_uint(parameter_tree, hf_isup_mandatory_variable_parameter_pointer, message_tvb, offset, + PARAMETER_POINTER_LENGTH, parameter_pointer); + proto_tree_add_uint(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer, PARAMETER_LENGTH_IND_LENGTH, - parameter_length, "Parameter length: %u", parameter_length); + parameter_length); actual_length = tvb_ensure_length_remaining(message_tvb, offset); parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, @@ -9888,10 +9888,10 @@ dissect_japan_chg_inf(tvbuff_t *message_tvb, proto_tree *isup_tree) "Mandatory Parameter: %u (%s)", parameter_type, val_to_str_ext_const(parameter_type, &japan_isup_parameter_type_value_ext, "unknown")); - proto_tree_add_uint_format(parameter_tree, hf_isup_mandatory_variable_parameter_pointer, message_tvb, offset, - PARAMETER_POINTER_LENGTH, parameter_pointer, "Pointer to Parameter: %u", parameter_pointer); - proto_tree_add_uint_format(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer, - PARAMETER_LENGTH_IND_LENGTH, parameter_length, "Parameter length: %u", parameter_length); + proto_tree_add_uint(parameter_tree, hf_isup_mandatory_variable_parameter_pointer, message_tvb, offset, + PARAMETER_POINTER_LENGTH, parameter_pointer); + proto_tree_add_uint(parameter_tree, hf_isup_parameter_length, message_tvb, offset + parameter_pointer, + PARAMETER_LENGTH_IND_LENGTH, parameter_length); actual_length = tvb_ensure_length_remaining(message_tvb, offset); parameter_tvb = tvb_new_subset(message_tvb, offset + parameter_pointer + PARAMETER_LENGTH_IND_LENGTH, diff --git a/epan/dissectors/packet-ixveriwave.c b/epan/dissectors/packet-ixveriwave.c index 37b36230d7..9d05123f74 100644 --- a/epan/dissectors/packet-ixveriwave.c +++ b/epan/dissectors/packet-ixveriwave.c @@ -765,15 +765,15 @@ wlantap_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree proto_tree_add_item(tap_tree, hf_radiotap_nss, tvb, offset - 1, 1, ENC_BIG_ENDIAN); - proto_tree_add_uint_format(tap_tree, hf_radiotap_datarate, + proto_tree_add_uint_format_value(tap_tree, hf_radiotap_datarate, tvb, offset - 5, 2, tvb_get_letohs(tvb, offset-5), - "Data rate: %.1f (MCS %d)", phyRate, mcs_index); + "%.1f (MCS %d)", phyRate, mcs_index); } } else { if (tree) { - proto_tree_add_uint_format(tap_tree, hf_radiotap_datarate, + proto_tree_add_uint_format_value(tap_tree, hf_radiotap_datarate, tvb, offset - 5, 2, tvb_get_letohs(tvb, offset-5), - "Data rate: %.1f Mb/s", phyRate); + "%.1f Mb/s", phyRate); } } col_add_fstr(pinfo->cinfo, COL_TX_RATE, "%.1f", phyRate); diff --git a/epan/dissectors/packet-kerberos4.c b/epan/dissectors/packet-kerberos4.c index f3f346c9ad..fffa6c773a 100644 --- a/epan/dissectors/packet-kerberos4.c +++ b/epan/dissectors/packet-kerberos4.c @@ -136,7 +136,7 @@ dissect_krb4_kdc_request(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, in /* lifetime */ lifetime=tvb_get_guint8(tvb, offset); - proto_tree_add_uint_format(tree, hf_krb4_lifetime, tvb, offset, 1, lifetime, "Lifetime: %d (%d minutes)", lifetime, lifetime*5); + proto_tree_add_uint_format_value(tree, hf_krb4_lifetime, tvb, offset, 1, lifetime, "%d (%d minutes)", lifetime, lifetime*5); offset++; /* service Name */ @@ -185,7 +185,7 @@ dissect_krb4_kdc_reply(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int /* length2 */ length=little_endian?tvb_get_letohs(tvb, offset):tvb_get_ntohs(tvb, offset); - proto_tree_add_uint_format(tree, hf_krb4_length, tvb, offset, 2, length, "Length: %d", length); + proto_tree_add_uint_format_value(tree, hf_krb4_length, tvb, offset, 2, length, "%d", length); offset+=2; /* encrypted blob */ @@ -236,7 +236,7 @@ dissect_krb4_appl_request(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, i /* lifetime */ lifetime=tvb_get_guint8(tvb, offset); - proto_tree_add_uint_format(tree, hf_krb4_lifetime, tvb, offset, 1, lifetime, "Lifetime: %d (%d minutes)", lifetime, lifetime*5); + proto_tree_add_uint_format_value(tree, hf_krb4_lifetime, tvb, offset, 1, lifetime, "%d (%d minutes)", lifetime, lifetime*5); offset++; /* service Name */ diff --git a/epan/dissectors/packet-kingfisher.c b/epan/dissectors/packet-kingfisher.c index 9f566d955c..3929992258 100644 --- a/epan/dissectors/packet-kingfisher.c +++ b/epan/dissectors/packet-kingfisher.c @@ -277,22 +277,22 @@ dissect_kingfisher(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean proto_tree_add_uint(kingfisher_tree, hf_kingfisher_version, tvb, 6, 1, kfp.version); /* system id */ - proto_tree_add_uint_format(kingfisher_tree, hf_kingfisher_system, tvb, 0, 1, kfp.system, "System Identifier: %u (0x%02X)", kfp.system, kfp.system); + proto_tree_add_uint(kingfisher_tree, hf_kingfisher_system, tvb, 0, 1, kfp.system); /* target rtu */ - proto_tree_add_uint_format(kingfisher_tree, hf_kingfisher_target, tvb, 1, 1, kfp.target, "Target RTU: %u (0x%02X)", kfp.target, kfp.target); + proto_tree_add_uint(kingfisher_tree, hf_kingfisher_target, tvb, 1, 1, kfp.target); /* length */ - proto_tree_add_uint_format(kingfisher_tree, hf_kingfisher_length, tvb, 2, 1, kfp.length, "Length: %u (0x%02X)", kfp.length, kfp.length); + proto_tree_add_uint(kingfisher_tree, hf_kingfisher_length, tvb, 2, 1, kfp.length); /* from rtu */ - proto_tree_add_uint_format(kingfisher_tree, hf_kingfisher_from, tvb, 3, 1, kfp.from, "From RTU: %u (0x%02X)", kfp.from, kfp.from); + proto_tree_add_uint(kingfisher_tree, hf_kingfisher_from, tvb, 3, 1, kfp.from); /* via rtu */ - proto_tree_add_uint_format(kingfisher_tree, hf_kingfisher_via, tvb, 4, 1, kfp.via, "Via RTU: %u (0x%02X)", kfp.via, kfp.via); + proto_tree_add_uint(kingfisher_tree, hf_kingfisher_via, tvb, 4, 1, kfp.via); /* message number */ - proto_tree_add_uint_format(kingfisher_tree, hf_kingfisher_message, tvb, 5, 1, kfp.message, "Message Number: %u (0x%02X, %s)", message, kfp.message, ((kfp.message & 0xf0)?"Response":"Request")); + proto_tree_add_uint_format_value(kingfisher_tree, hf_kingfisher_message, tvb, 5, 1, kfp.message, "%u (0x%02X, %s)", message, kfp.message, ((kfp.message & 0xf0)?"Response":"Request")); /* message function code */ proto_tree_add_uint_format(kingfisher_tree, hf_kingfisher_function, tvb, 6, 1, kfp.function, "Message Function Code: %u (0x%02X, %s)", kfp.function, kfp.function, func_string); @@ -303,7 +303,7 @@ dissect_kingfisher(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean } /* checksum */ - proto_tree_add_uint_format(kingfisher_tree, hf_kingfisher_checksum, tvb, kfp.length-1, 2, kfp.checksum, "Checksum: 0x%04X [%s]", kfp.checksum, ((checksum != kfp.checksum)?"incorrect":"correct")); + proto_tree_add_uint_format_value(kingfisher_tree, hf_kingfisher_checksum, tvb, kfp.length-1, 2, kfp.checksum, "0x%04X [%s]", kfp.checksum, ((checksum != kfp.checksum)?"incorrect":"correct")); @@ -346,11 +346,11 @@ proto_register_kingfisher( void ) static hf_register_info hf[] = { { &hf_kingfisher_version, { "Version", "kingfisher.version", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, - { &hf_kingfisher_system, { "System Identifier", "kingfisher.system", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, - { &hf_kingfisher_length, { "Length", "kingfisher.length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, - { &hf_kingfisher_from, { "From RTU", "kingfisher.from", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, - { &hf_kingfisher_target, { "Target RTU", "kingfisher.target", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, - { &hf_kingfisher_via, { "Via RTU", "kingfisher.via", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + { &hf_kingfisher_system, { "System Identifier", "kingfisher.system", FT_UINT8, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } }, + { &hf_kingfisher_length, { "Length", "kingfisher.length", FT_UINT8, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } }, + { &hf_kingfisher_from, { "From RTU", "kingfisher.from", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } }, + { &hf_kingfisher_target, { "Target RTU", "kingfisher.target", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } }, + { &hf_kingfisher_via, { "Via RTU", "kingfisher.via", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_kingfisher_message, { "Message Number", "kingfisher.message", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_kingfisher_function, { "Function Code", "kingfisher.function", FT_UINT8, BASE_DEC, VALS( function_code_vals ), 0x0, NULL, HFILL } }, { &hf_kingfisher_checksum, { "Checksum", "kingfisher.checksum", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, diff --git a/epan/dissectors/packet-lapd.c b/epan/dissectors/packet-lapd.c index 10eed8036a..f15f4cd908 100644 --- a/epan/dissectors/packet-lapd.c +++ b/epan/dissectors/packet-lapd.c @@ -545,13 +545,13 @@ dissect_lapd_full(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean 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(lapd_tree, hf_lapd_checksum, tvb, checksum_offset, 2, 0,"Checksum: 0x%04x [correct]", checksum); + checksum_ti = proto_tree_add_uint_format_value(lapd_tree, hf_lapd_checksum, tvb, checksum_offset, 2, 0,"0x%04x [correct]", checksum); checksum_tree = proto_item_add_subtree(checksum_ti, ett_lapd_checksum); proto_tree_add_boolean(checksum_tree, hf_lapd_checksum_good, tvb, checksum_offset, 2, TRUE); proto_tree_add_boolean(checksum_tree, hf_lapd_checksum_bad, tvb, checksum_offset, 2, FALSE); } else { proto_item *pi; - checksum_ti = proto_tree_add_uint_format(lapd_tree, hf_lapd_checksum, tvb, checksum_offset, 2, 0,"Checksum: 0x%04x [incorrect, should be 0x%04x]", checksum, checksum_calculated); + checksum_ti = proto_tree_add_uint_format_value(lapd_tree, hf_lapd_checksum, tvb, checksum_offset, 2, 0,"0x%04x [incorrect, should be 0x%04x]", checksum, checksum_calculated); checksum_tree = proto_item_add_subtree(checksum_ti, ett_lapd_checksum); proto_tree_add_boolean(checksum_tree, hf_lapd_checksum_good, tvb, checksum_offset, 2, FALSE); pi = proto_tree_add_boolean(checksum_tree, hf_lapd_checksum_bad, tvb, checksum_offset, 2, TRUE); diff --git a/epan/dissectors/packet-ldp.c b/epan/dissectors/packet-ldp.c index 93410538d9..03745a6577 100644 --- a/epan/dissectors/packet-ldp.c +++ b/epan/dissectors/packet-ldp.c @@ -1443,7 +1443,6 @@ static void dissect_tlv_atm_label(tvbuff_t *tvb, guint offset, proto_tree *tree, int rem) { proto_tree *ti, *val_tree; - guint16 id; if (rem != 4){ proto_tree_add_text(tree, tvb, offset, rem, @@ -1456,11 +1455,9 @@ dissect_tlv_atm_label(tvbuff_t *tvb, guint offset, proto_tree *tree, int rem) proto_tree_add_item(val_tree, hf_ldp_tlv_atm_label_vbits, tvb, offset, 1, ENC_BIG_ENDIAN); - id=tvb_get_ntohs(tvb, offset)&0x0FFF; - proto_tree_add_uint_format(val_tree, hf_ldp_tlv_atm_label_vpi, tvb, offset, 2, id, "VPI: %u", id); + proto_tree_add_item(val_tree, hf_ldp_tlv_atm_label_vpi, tvb, offset, 2, ENC_BIG_ENDIAN); - id=tvb_get_ntohs(tvb, offset+2); - proto_tree_add_uint_format(val_tree, hf_ldp_tlv_atm_label_vci, tvb, offset+2, 2, id, "VCI: %u", id); + proto_tree_add_item(val_tree, hf_ldp_tlv_atm_label_vci, tvb, offset+2, 2, ENC_BIG_ENDIAN); } /* Dissect FRAME RELAY Label TLV */ @@ -1470,7 +1467,6 @@ dissect_tlv_frame_label(tvbuff_t *tvb, guint offset, proto_tree *tree, int rem) { proto_tree *ti, *val_tree; guint8 len; - guint32 id; if (rem != 4){ proto_tree_add_text(tree, tvb, offset, rem, @@ -1485,9 +1481,8 @@ dissect_tlv_frame_label(tvbuff_t *tvb, guint offset, proto_tree *tree, int rem) 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); - id=tvb_get_ntoh24(tvb, offset+1)&0x7FFFFF; - proto_tree_add_uint_format(val_tree, - hf_ldp_tlv_fr_label_dlci, tvb, offset+1, 3, id, "DLCI: %u", id); + proto_tree_add_item(val_tree, + hf_ldp_tlv_fr_label_dlci, tvb, offset+1, 3, ENC_BIG_ENDIAN); } /* Dissect STATUS TLV */ @@ -1711,7 +1706,6 @@ dissect_tlv_atm_session_parms(tvbuff_t *tvb, guint offset, proto_tree *tree, int { proto_tree *ti, *val_tree, *lbl_tree; guint8 numlr, ix; - guint16 id; if (rem < 4) { proto_tree_add_text(tree, tvb, offset, rem, @@ -1748,27 +1742,20 @@ dissect_tlv_atm_session_parms(tvbuff_t *tvb, guint offset, proto_tree *tree, int "ATM Label Range Component %u", ix); lbl_tree=proto_item_add_subtree(ti, ett_ldp_tlv_val); - id=tvb_get_ntohs(tvb, offset)&0x0FFF; - proto_tree_add_uint_format(lbl_tree, + proto_tree_add_item(lbl_tree, hf_ldp_tlv_sess_atm_minvpi, tvb, offset, 2, - id, "Minimum VPI: %u", id); - id=tvb_get_ntohs(tvb, offset+4)&0x0FFF; - proto_tree_add_uint_format(lbl_tree, + ENC_BIG_ENDIAN); + proto_tree_add_item(lbl_tree, hf_ldp_tlv_sess_atm_maxvpi, - tvb, (offset+4), 2, id, - "Maximum VPI: %u", id); + tvb, (offset+4), 2, ENC_BIG_ENDIAN); - id=tvb_get_ntohs(tvb, offset+2); - proto_tree_add_uint_format(lbl_tree, + proto_tree_add_item(lbl_tree, hf_ldp_tlv_sess_atm_minvci, - tvb, offset+2, 2, - id, "Minimum VCI: %u", id); - id=tvb_get_ntohs(tvb, offset+6); - proto_tree_add_uint_format(lbl_tree, + tvb, offset+2, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(lbl_tree, hf_ldp_tlv_sess_atm_maxvci, - tvb, offset+6, 2, - id, "Maximum VCI: %u", id); + tvb, offset+6, 2, ENC_BIG_ENDIAN); offset += 8; } @@ -2417,12 +2404,12 @@ dissect_tlv(tvbuff_t *tvb, packet_info *pinfo, guint offset, proto_tree *tree, i switch (type) { case TLV_VENDOR_PRIVATE_START: - proto_tree_add_uint_format(tlv_tree, hf_ldp_tlv_type, tvb, offset, 2, - typebak, "TLV Type: Vendor Private (0x%X)", typebak); + proto_tree_add_uint_format_value(tlv_tree, hf_ldp_tlv_type, tvb, offset, 2, + typebak, "Vendor Private (0x%X)", typebak); break; case TLV_EXPERIMENTAL_START: - proto_tree_add_uint_format(tlv_tree, hf_ldp_tlv_type, tvb, offset, 2, - typebak, "TLV Type: Experimental (0x%X)", typebak); + proto_tree_add_uint_format_value(tlv_tree, hf_ldp_tlv_type, tvb, offset, 2, + typebak, "Experimental (0x%X)", typebak); break; default: proto_tree_add_uint_format(tlv_tree, hf_ldp_tlv_type, tvb, offset, 2, @@ -2462,8 +2449,8 @@ dissect_tlv(tvbuff_t *tvb, packet_info *pinfo, guint offset, proto_tree *tree, i else { guint32 label=tvb_get_ntohl(tvb, offset+4) & 0x000FFFFF; - proto_tree_add_uint_format(tlv_tree, hf_ldp_tlv_generic_label, - tvb, offset+4, length, label, "Generic Label: %u", label); + proto_tree_add_uint(tlv_tree, hf_ldp_tlv_generic_label, + tvb, offset+4, length, label); } break; @@ -2854,12 +2841,12 @@ dissect_msg(tvbuff_t *tvb, guint offset, packet_info *pinfo, proto_tree *tree) switch (type) { case LDP_VENDOR_PRIVATE_START: - proto_tree_add_uint_format(msg_tree, hf_ldp_msg_type, tvb, offset, 2, - typebak, "Message Type: Vendor Private (0x%X)", typebak); + proto_tree_add_uint_format_value(msg_tree, hf_ldp_msg_type, tvb, offset, 2, + typebak, "Vendor Private (0x%X)", typebak); break; case LDP_EXPERIMENTAL_MESSAGE_START: - proto_tree_add_uint_format(msg_tree, hf_ldp_msg_type, tvb, offset, 2, - typebak, "Message Type: Experimental (0x%X)", typebak); + proto_tree_add_uint_format_value(msg_tree, hf_ldp_msg_type, tvb, offset, 2, + typebak, "Experimental (0x%X)", typebak); break; default: proto_tree_add_uint_format(msg_tree, hf_ldp_msg_type, tvb, offset, 2, diff --git a/epan/dissectors/packet-lldp.c b/epan/dissectors/packet-lldp.c index ab9c474a71..5afa56847d 100644 --- a/epan/dissectors/packet-lldp.c +++ b/epan/dissectors/packet-lldp.c @@ -2520,8 +2520,8 @@ dissect_organizational_specific_tlv(tvbuff_t *tvb, packet_info *pinfo, proto_tre if (tempLen < 4) { if (tree) - proto_tree_add_uint_format(org_tlv_tree, hf_lldp_tlv_len, tvb, offset, 2, - tempShort, "TLV Length: %u (too short, must be >= 4)", tempLen); + proto_tree_add_uint_format_value(org_tlv_tree, hf_lldp_tlv_len, tvb, offset, 2, + tempShort, "%u (too short, must be >= 4)", tempLen); return tLength; } if (tree) diff --git a/epan/dissectors/packet-miop.c b/epan/dissectors/packet-miop.c index 662d15e0d6..118201af91 100644 --- a/epan/dissectors/packet-miop.c +++ b/epan/dissectors/packet-miop.c @@ -193,8 +193,8 @@ static void dissect_miop (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree /* XXX - Should we bail out if we don't have the right magic number? */ proto_tree_add_item(miop_tree, hf_miop_magic, tvb, offset, 4, ENC_ASCII|ENC_NA); offset += 4; - proto_tree_add_uint_format(miop_tree, hf_miop_hdr_version, tvb, offset, 1, hdr_version, - "Version: %u.%u", version_major, version_minor); + proto_tree_add_uint_format_value(miop_tree, hf_miop_hdr_version, tvb, offset, 1, hdr_version, + "%u.%u", version_major, version_minor); offset++; if (flags & 0x01) { ep_strbuf_printf(flags_strbuf, "little-endian"); diff --git a/epan/dissectors/packet-mip6.c b/epan/dissectors/packet-mip6.c index 1b88e2094c..7ed9c3f6d3 100644 --- a/epan/dissectors/packet-mip6.c +++ b/epan/dissectors/packet-mip6.c @@ -1324,10 +1324,10 @@ dissect_mip6_bu(tvbuff_t *tvb, proto_tree *mip6_tree, packet_info *pinfo _U_) proto_nemo = 1; lifetime = tvb_get_ntohs(tvb, MIP6_BU_LIFETIME_OFF); - proto_tree_add_uint_format(data_tree, hf_mip6_bu_lifetime, tvb, + proto_tree_add_uint_format_value(data_tree, hf_mip6_bu_lifetime, tvb, MIP6_BU_LIFETIME_OFF, MIP6_BU_LIFETIME_LEN, lifetime, - "Lifetime: %d (%ld seconds)", + "%d (%ld seconds)", lifetime, (long)lifetime * 4); } @@ -1365,10 +1365,10 @@ dissect_mip6_ba(tvbuff_t *tvb, proto_tree *mip6_tree, packet_info *pinfo _U_) MIP6_BA_SEQNR_OFF, MIP6_BA_SEQNR_LEN, ENC_BIG_ENDIAN); lifetime = tvb_get_ntohs(tvb, MIP6_BA_LIFETIME_OFF); - proto_tree_add_uint_format(data_tree, hf_mip6_ba_lifetime, tvb, + proto_tree_add_uint_format_value(data_tree, hf_mip6_ba_lifetime, tvb, MIP6_BA_LIFETIME_OFF, MIP6_BA_LIFETIME_LEN, lifetime, - "Lifetime: %d (%ld seconds)", + "%d (%ld seconds)", lifetime, (long)lifetime * 4); } @@ -1543,10 +1543,10 @@ dissect_fmip6_fbu(tvbuff_t *tvb, proto_tree *mip6_tree, packet_info *pinfo _U_) FMIP6_FBU_FLAGS_OFF, FMIP6_FBU_FLAGS_LEN, ENC_BIG_ENDIAN); lifetime = tvb_get_ntohs(tvb, FMIP6_FBU_LIFETIME_OFF); - proto_tree_add_uint_format(data_tree, hf_fmip6_fbu_lifetime, tvb, + proto_tree_add_uint_format_value(data_tree, hf_fmip6_fbu_lifetime, tvb, FMIP6_FBU_LIFETIME_OFF, FMIP6_FBU_LIFETIME_LEN, lifetime, - "Lifetime: %d (%ld seconds)", + "%d (%ld seconds)", lifetime, (long)lifetime * 4); } @@ -1572,10 +1572,10 @@ dissect_fmip6_fback(tvbuff_t *tvb, proto_tree *mip6_tree, packet_info *pinfo _U_ proto_tree_add_item(data_tree, hf_fmip6_fback_seqnr, tvb, FMIP6_FBACK_SEQNR_OFF, FMIP6_FBACK_SEQNR_LEN, ENC_BIG_ENDIAN); lifetime = tvb_get_ntohs(tvb, FMIP6_FBACK_LIFETIME_OFF); - proto_tree_add_uint_format(data_tree, hf_fmip6_fback_lifetime, tvb, + proto_tree_add_uint_format_value(data_tree, hf_fmip6_fback_lifetime, tvb, FMIP6_FBACK_LIFETIME_OFF, FMIP6_FBACK_LIFETIME_LEN, lifetime, - "Lifetime: %d (%ld seconds)", + "%d (%ld seconds)", lifetime, (long)lifetime * 4); } @@ -1878,9 +1878,9 @@ dissect_mip6_opt_bra(const mip6_opt *optp _U_, tvbuff_t *tvb, int offset, int ri; ri = tvb_get_ntohs(tvb, offset + MIP6_BRA_RI_OFF); - proto_tree_add_uint_format(opt_tree, hf_mip6_bra_interval, tvb, + proto_tree_add_uint_format_value(opt_tree, hf_mip6_bra_interval, tvb, offset, optlen, - ri, "Refresh interval: %d (%ld seconds)", + ri, "%d (%ld seconds)", ri, (long)ri * 4); } @@ -3483,10 +3483,10 @@ dissect_mip6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_item(mip6_tree, hf_mip6_proto, tvb, MIP6_PROTO_OFF, 1, ENC_BIG_ENDIAN); - proto_tree_add_uint_format(mip6_tree, hf_mip6_hlen, tvb, + proto_tree_add_uint_format_value(mip6_tree, hf_mip6_hlen, tvb, MIP6_HLEN_OFF, 1, tvb_get_guint8(tvb, MIP6_HLEN_OFF), - "Header length: %u (%u bytes)", + "%u (%u bytes)", tvb_get_guint8(tvb, MIP6_HLEN_OFF), len); diff --git a/epan/dissectors/packet-mpeg-descriptor.c b/epan/dissectors/packet-mpeg-descriptor.c index 1dc07e3122..69ef802604 100644 --- a/epan/dissectors/packet-mpeg-descriptor.c +++ b/epan/dissectors/packet-mpeg-descriptor.c @@ -2549,7 +2549,7 @@ proto_mpeg_descriptor_dissect_private_ciplus(tvbuff_t *tvb, guint offset, proto_ di = proto_tree_add_text(tree, tvb, offset_start, -1, "CI+ private descriptor Tag=0x%02x", tag); descriptor_tree = proto_item_add_subtree(di, ett_mpeg_descriptor); - proto_tree_add_uint_format(descriptor_tree, hf_mpeg_descriptor_tag, tvb, offset, 1, tag, "Descriptor Tag: %s (0x%x)", tag_str, tag); + proto_tree_add_item(descriptor_tree, hf_mpeg_descriptor_tag, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; len = tvb_get_guint8(tvb, offset); diff --git a/epan/dissectors/packet-mpls-echo.c b/epan/dissectors/packet-mpls-echo.c index 587b7c2d21..695781d13a 100644 --- a/epan/dissectors/packet-mpls-echo.c +++ b/epan/dissectors/packet-mpls-echo.c @@ -1032,20 +1032,19 @@ dissect_mpls_echo_tlv_ds_map(tvbuff_t *tvb, packet_info *pinfo, guint offset, pr tlv_ds_map_tree = proto_item_add_subtree(ti, ett_mpls_echo_tlv_ds_map); proto_item_append_text(ti, ", Label: %u", label); if (label <= MPLS_LABEL_MAX_RESERVED) { - proto_tree_add_uint_format(tlv_ds_map_tree, hf_mpls_echo_tlv_ds_map_mp_label, - tvb, offset, 3, label, "Downstream Label: %u (%s)", label, - val_to_str_const(label, special_labels, "Reserved - Unknown")); + proto_tree_add_uint(tlv_ds_map_tree, hf_mpls_echo_tlv_ds_map_mp_label, + tvb, offset, 3, label); proto_item_append_text(ti, " (%s)", val_to_str_const(label, special_labels, "Reserved - Unknown")); } else { - proto_tree_add_uint_format(tlv_ds_map_tree, hf_mpls_echo_tlv_ds_map_mp_label, - tvb, offset, 3, label, "Downstream Label: %u", label); + proto_tree_add_uint_format_value(tlv_ds_map_tree, hf_mpls_echo_tlv_ds_map_mp_label, + tvb, offset, 3, label, "%u", label); } proto_item_append_text(ti, ", Exp: %u, BOS: %u", exp, bos); - proto_tree_add_uint_format(tlv_ds_map_tree, hf_mpls_echo_tlv_ds_map_mp_exp, - tvb, offset + 2, 1, exp, "Downstream Exp: %u", exp); - proto_tree_add_uint_format(tlv_ds_map_tree, hf_mpls_echo_tlv_ds_map_mp_bos, - tvb, offset + 2, 1, bos, "Downstream BOS: %u", bos); + proto_tree_add_uint(tlv_ds_map_tree, hf_mpls_echo_tlv_ds_map_mp_exp, + tvb, offset + 2, 1, exp); + proto_tree_add_uint(tlv_ds_map_tree, hf_mpls_echo_tlv_ds_map_mp_bos, + tvb, offset + 2, 1, bos); proto_tree_add_item(tlv_ds_map_tree, hf_mpls_echo_tlv_ds_map_mp_proto, tvb, offset + 3, 1, ENC_BIG_ENDIAN); proto_item_append_text(ti, ", Protocol: %u (%s)", proto, @@ -1400,21 +1399,21 @@ dissect_mpls_echo_tlv_ilso(tvbuff_t *tvb, packet_info *pinfo, guint offset, prot tlv_ilso = proto_item_add_subtree(ti, ett_mpls_echo_tlv_ilso); proto_item_append_text(ti, ", Label: %u", label); if (label <= MPLS_LABEL_MAX_RESERVED) { - proto_tree_add_uint_format(tlv_ilso, hf_mpls_echo_tlv_ilso_label, - tvb, offset, 3, label, "Label: %u (%s)", label, + proto_tree_add_uint_format_value(tlv_ilso, hf_mpls_echo_tlv_ilso_label, + tvb, offset, 3, label, "%u (%s)", label, val_to_str_const(label, special_labels, "Reserved - Unknown")); proto_item_append_text(ti, " (%s)", val_to_str_const(label, special_labels, "Reserved - Unknown")); } else { - proto_tree_add_uint_format(tlv_ilso, hf_mpls_echo_tlv_ilso_label, - tvb, offset, 3, label, "Label: %u", label); + proto_tree_add_uint_format_value(tlv_ilso, hf_mpls_echo_tlv_ilso_label, + tvb, offset, 3, label, "%u", label); } proto_item_append_text(ti, ", Exp: %u, BOS: %u, TTL: %u", exp, bos, ttl); - proto_tree_add_uint_format(tlv_ilso, hf_mpls_echo_tlv_ilso_exp, - tvb, offset + 2, 1, exp, "Exp: %u", exp); - proto_tree_add_uint_format(tlv_ilso, hf_mpls_echo_tlv_ilso_bos, - tvb, offset + 2, 1, bos, "BOS: %u", bos); + proto_tree_add_uint(tlv_ilso, hf_mpls_echo_tlv_ilso_exp, + tvb, offset + 2, 1, exp); + proto_tree_add_uint(tlv_ilso, hf_mpls_echo_tlv_ilso_bos, + tvb, offset + 2, 1, bos); proto_tree_add_item(tlv_ilso, hf_mpls_echo_tlv_ilso_ttl, tvb, offset + 3, 1, ENC_BIG_ENDIAN); rem -= 4; @@ -2117,7 +2116,7 @@ proto_register_mpls_echo(void) FT_UINT24, BASE_DEC, VALS(special_labels), 0x0, "MPLS ECHO TLV Downstream Map Downstream Label", HFILL} }, { &hf_mpls_echo_tlv_ds_map_mp_exp, - { "Downstream Experimental", "mpls_echo.tlv.ds_map.mp_exp", + { "Downstream Exp", "mpls_echo.tlv.ds_map.mp_exp", FT_UINT8, BASE_DEC, NULL, 0x0, "MPLS ECHO TLV Downstream Map Downstream Experimental", HFILL} }, { &hf_mpls_echo_tlv_ds_map_mp_bos, diff --git a/epan/dissectors/packet-msproxy.c b/epan/dissectors/packet-msproxy.c index 36c7c9e6a2..3723dd53f9 100644 --- a/epan/dissectors/packet-msproxy.c +++ b/epan/dissectors/packet-msproxy.c @@ -686,8 +686,8 @@ static void dissect_msproxy_request(tvbuff_t *tvb, cmd = tvb_get_ntohs( tvb, offset); if ( tree) - proto_tree_add_uint_format( tree, hf_msproxy_cmd, tvb, offset, 2, - cmd, "Command: %s (0x%02x)", + proto_tree_add_uint_format_value( tree, hf_msproxy_cmd, tvb, offset, 2, + cmd, "%s (0x%02x)", get_msproxy_cmd_name( cmd, FROM_CLIENT), cmd); @@ -1006,8 +1006,8 @@ static void dissect_msproxy_response(tvbuff_t *tvb, packet_info *pinfo, cmd = tvb_get_ntohs( tvb, offset); - ti = proto_tree_add_uint_format( tree, hf_msproxy_cmd, tvb, offset, 2, - cmd, "Command: 0x%02x (%s)", cmd, + ti = proto_tree_add_uint_format_value( tree, hf_msproxy_cmd, tvb, offset, 2, + cmd, "0x%02x (%s)", cmd, get_msproxy_cmd_name( cmd, FROM_SERVER)); offset += 2; diff --git a/epan/dissectors/packet-mstp.c b/epan/dissectors/packet-mstp.c index 56a1e4f6bd..e15c4923ac 100644 --- a/epan/dissectors/packet-mstp.c +++ b/epan/dissectors/packet-mstp.c @@ -203,9 +203,9 @@ dissect_mstp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, crc8 = ~crc8; framecrc8 = tvb_get_guint8(tvb, offset+5); if (framecrc8 == crc8) { - item = proto_tree_add_uint_format(subtree, hf_mstp_frame_crc8, + item = proto_tree_add_uint_format_value(subtree, hf_mstp_frame_crc8, tvb, offset+5, 1, framecrc8, - "Header CRC: 0x%02x [correct]", framecrc8); + "0x%02x [correct]", framecrc8); checksum_tree = proto_item_add_subtree(item, ett_bacnet_mstp_checksum); item = proto_tree_add_boolean(checksum_tree, hf_mstp_frame_checksum_good, @@ -216,9 +216,9 @@ dissect_mstp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, tvb, offset+5, 1, FALSE); PROTO_ITEM_SET_GENERATED(item); } else { - item = proto_tree_add_uint_format(subtree, hf_mstp_frame_crc8, + item = proto_tree_add_uint_format_value(subtree, hf_mstp_frame_crc8, tvb, offset+5, 1, framecrc8, - "Header CRC: 0x%02x [incorrect, should be 0x%02x]", + "0x%02x [incorrect, should be 0x%02x]", framecrc8, crc8); checksum_tree = proto_item_add_subtree(item, ett_bacnet_mstp_checksum); item = proto_tree_add_boolean(checksum_tree, @@ -276,9 +276,9 @@ dissect_mstp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /* get the actual CRC from the frame */ framecrc16 = tvb_get_ntohs(tvb, offset+mstp_frame_pdu_len); if (framecrc16 == crc16) { - item = proto_tree_add_uint_format(subtree, hf_mstp_frame_crc16, + item = proto_tree_add_uint_format_value(subtree, hf_mstp_frame_crc16, tvb, offset+mstp_frame_pdu_len, 2, framecrc16, - "Data CRC: 0x%04x [correct]", framecrc16); + "0x%04x [correct]", framecrc16); checksum_tree = proto_item_add_subtree(item, ett_bacnet_mstp_checksum); item = proto_tree_add_boolean(checksum_tree, @@ -290,9 +290,9 @@ dissect_mstp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, tvb, offset+mstp_frame_pdu_len, 2, FALSE); PROTO_ITEM_SET_GENERATED(item); } else { - item = proto_tree_add_uint_format(subtree, hf_mstp_frame_crc16, + item = proto_tree_add_uint_format_value(subtree, hf_mstp_frame_crc16, tvb, offset+mstp_frame_pdu_len, 2, framecrc16, - "Data CRC: 0x%04x [incorrect, should be 0x%04x]", + "0x%04x [incorrect, should be 0x%04x]", framecrc16, crc16); checksum_tree = proto_item_add_subtree(item, ett_bacnet_mstp_checksum); diff --git a/epan/dissectors/packet-nbns.c b/epan/dissectors/packet-nbns.c index 9020cb9b37..266793b74c 100644 --- a/epan/dissectors/packet-nbns.c +++ b/epan/dissectors/packet-nbns.c @@ -519,8 +519,8 @@ nbns_add_nbns_flags(column_info *cinfo, proto_tree *nbns_tree, tvbuff_t *tvb, in g_strlcat(buf, val_to_str_const(flags & F_RCODE, rcode_vals, "Unknown error"), MAX_BUF_SIZE); buf[MAX_BUF_SIZE-1] = '\0'; } - tf = proto_tree_add_uint_format(nbns_tree, hf_nbns_flags, - tvb, offset, 2, flags, "Flags: 0x%04x (%s)", flags, buf); + tf = proto_tree_add_uint_format_value(nbns_tree, hf_nbns_flags, + tvb, offset, 2, flags, "0x%04x (%s)", flags, buf); field_tree = proto_item_add_subtree(tf, ett_nbns_flags); proto_tree_add_item(field_tree, hf_nbns_flags_response, tvb, offset, 2, ENC_BIG_ENDIAN); @@ -1500,19 +1500,15 @@ dissect_nbss_packet(tvbuff_t *tvb, int offset, packet_info *pinfo, msg_type = tvb_get_guint8(tvb, offset); - if (tree) { - ti = proto_tree_add_item(tree, proto_nbss, tvb, offset, length + 4, ENC_NA); - nbss_tree = proto_item_add_subtree(ti, ett_nbss); + ti = proto_tree_add_item(tree, proto_nbss, tvb, offset, length + 4, ENC_NA); + nbss_tree = proto_item_add_subtree(ti, ett_nbss); - proto_tree_add_item(nbss_tree, hf_nbss_type, tvb, offset, 1, ENC_NA); - } + proto_tree_add_item(nbss_tree, hf_nbss_type, tvb, offset, 1, ENC_NA); offset += 1; if (is_cifs) { - if (tree) { - proto_tree_add_item(nbss_tree, hf_nbss_cifs_length, tvb, offset, 3, ENC_BIG_ENDIAN); - } + proto_tree_add_item(nbss_tree, hf_nbss_cifs_length, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; } else { if (tree) { @@ -1522,10 +1518,7 @@ dissect_nbss_packet(tvbuff_t *tvb, int offset, packet_info *pinfo, } offset += 1; - if (tree) { - proto_tree_add_uint_format(nbss_tree, hf_nbss_length, tvb, offset, 2, - length, "Length: %u", length); - } + proto_tree_add_uint(nbss_tree, hf_nbss_length, tvb, offset, 2, length); offset += 2; } diff --git a/epan/dissectors/packet-ncp-sss.c b/epan/dissectors/packet-ncp-sss.c index 66f5a5eaf7..d25d194e73 100644 --- a/epan/dissectors/packet-ncp-sss.c +++ b/epan/dissectors/packet-ncp-sss.c @@ -290,7 +290,7 @@ process_flags(proto_tree *sss_tree, tvbuff_t *tvb, guint32 foffset) bvalue = bvalue*2; } - tinew = proto_tree_add_uint_format(sss_tree, hf_flags, tvb, foffset, 4, flags, "%s 0x%08x", "Flags:", flags); + tinew = proto_tree_add_uint(sss_tree, hf_flags, tvb, foffset, 4, flags); flags_tree = proto_item_add_subtree(tinew, ett_nds); bvalue = 0x00000001; diff --git a/epan/dissectors/packet-nfs.c b/epan/dissectors/packet-nfs.c index 96218b3a85..ced348c862 100644 --- a/epan/dissectors/packet-nfs.c +++ b/epan/dissectors/packet-nfs.c @@ -1914,12 +1914,10 @@ dissect_fhandle_data_NETAPP_GX_v3(tvbuff_t* tvb, packet_info *pinfo _U_, proto_t offset+11, 1, flags); proto_tree_add_boolean(field_tree, hf_nfs3_gxfh_sfhflags_streamdir, tvb, offset+11, 1, flags); - proto_tree_add_uint_format(field_tree, hf_nfs3_gxfh_spinfid, tvb, - offset+12, 4, spinfile_id, - "spin file id: 0x%08x (%u)", spinfile_id, spinfile_id); - proto_tree_add_uint_format(field_tree, hf_nfs3_gxfh_spinfuid, tvb, - offset+16, 4, spinfile_id, - "spin file unique id: 0x%08x (%u)", spinfile_uid, spinfile_uid); + proto_tree_add_uint(field_tree, hf_nfs3_gxfh_spinfid, tvb, + offset+12, 4, spinfile_id); + proto_tree_add_uint(field_tree, hf_nfs3_gxfh_spinfuid, tvb, + offset+16, 4, spinfile_id); /* = spin file handle (mount point) = */ local_dsid = tvb_get_letohl(tvb, offset+20); @@ -1971,12 +1969,10 @@ dissect_fhandle_data_NETAPP_GX_v3(tvbuff_t* tvb, packet_info *pinfo _U_, proto_t offset+27, 1, flags); proto_tree_add_boolean(field_tree, hf_nfs3_gxfh_sfhflags_streamdir, tvb, offset+27, 1, flags); - proto_tree_add_uint_format(field_tree, hf_nfs3_gxfh_spinfid, tvb, - offset+28, 4, spinfile_id, - "spin file id: 0x%08x (%u)", spinfile_id, spinfile_id); - proto_tree_add_uint_format(field_tree, hf_nfs3_gxfh_spinfuid, tvb, - offset+32, 4, spinfile_id, - "spin file unique id: 0x%08x (%u)", spinfile_uid, spinfile_uid); + proto_tree_add_uint(field_tree, hf_nfs3_gxfh_spinfid, tvb, + offset+28, 4, spinfile_id); + proto_tree_add_uint(field_tree, hf_nfs3_gxfh_spinfuid, tvb, + offset+32, 4, spinfile_id); /* = export point id = */ export_id = tvb_get_letohl(tvb, offset+36); proto_tree_add_uint_format(tree, hf_nfs3_gxfh_exportptid, tvb, @@ -11779,11 +11775,11 @@ proto_register_nfs(void) TFS(&tfs_set_notset), SPINNP_FH_FLAG_STREAMDIR_MASK, NULL, HFILL }}, { &hf_nfs3_gxfh_spinfid, { - "spin file id", "nfs.gxfh3.spinfid", FT_UINT32, BASE_HEX, + "spin file id", "nfs.gxfh3.spinfid", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL }}, { &hf_nfs3_gxfh_spinfuid, { - "spin file unique id", "nfs.gxfh3.spinfuid", FT_UINT32, BASE_HEX, + "spin file unique id", "nfs.gxfh3.spinfuid", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL }}, { &hf_nfs3_gxfh_exportptid, { diff --git a/epan/dissectors/packet-nhrp.c b/epan/dissectors/packet-nhrp.c index 7e390c5a03..94bbab6a3b 100644 --- a/epan/dissectors/packet-nhrp.c +++ b/epan/dissectors/packet-nhrp.c @@ -335,8 +335,8 @@ void dissect_nhrp_hdr(tvbuff_t *tvb, pro_type_str = val_to_str_const(hdr->ar_pro_type, etype_vals, "Unknown Ethertype"); } - proto_tree_add_uint_format(nhrp_tree, hf_nhrp_hdr_pro_type, tvb, offset, 2, - hdr->ar_pro_type, "Protocol Type (short form): %s (0x%04x)", + proto_tree_add_uint_format_value(nhrp_tree, hf_nhrp_hdr_pro_type, tvb, offset, 2, + hdr->ar_pro_type, "%s (0x%04x)", pro_type_str, hdr->ar_pro_type); offset += 2; diff --git a/epan/dissectors/packet-nlsp.c b/epan/dissectors/packet-nlsp.c index 9a05b820ae..e369753903 100644 --- a/epan/dissectors/packet-nlsp.c +++ b/epan/dissectors/packet-nlsp.c @@ -467,9 +467,9 @@ nlsp_dissect_nlsp_hello(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if (tree) { holding_timer = tvb_get_ntohs(tvb, offset); - proto_tree_add_uint_format(tree, hf_nlsp_hello_holding_timer, + proto_tree_add_uint_format_value(tree, hf_nlsp_hello_holding_timer, tvb, offset, 2, holding_timer, - "Holding Timer: %us", holding_timer); + "%us", holding_timer); } offset += 2; diff --git a/epan/dissectors/packet-nsip.c b/epan/dissectors/packet-nsip.c index f96f6daa46..b91ac2f2b7 100644 --- a/epan/dissectors/packet-nsip.c +++ b/epan/dissectors/packet-nsip.c @@ -425,9 +425,8 @@ decode_ip_element(nsip_ip_element_info_t *element, build_info_t *bi, proto_tree if (bi->nsip_tree) { /* UDP port value */ udp_port = tvb_get_ntohs(bi->tvb, bi->offset); - proto_tree_add_uint_format(field_tree, hf_nsip_ip_element_udp_port, - bi->tvb, bi->offset, 2, udp_port, - "UDP Port: %u", udp_port); + proto_tree_add_item(field_tree, hf_nsip_ip_element_udp_port, + bi->tvb, bi->offset, 2, ENC_BIG_ENDIAN); proto_item_append_text(tf, ", UDP Port: %u", udp_port); } bi->offset += 2; diff --git a/epan/dissectors/packet-nstrace.c b/epan/dissectors/packet-nstrace.c index b3e2ab47e2..75c151b378 100644 --- a/epan/dissectors/packet-nstrace.c +++ b/epan/dissectors/packet-nstrace.c @@ -211,8 +211,8 @@ dissect_nstrace(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_item(ns_tree, hf_ns_snode, tvb, pnstr->srcnodeid_offset, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(ns_tree, hf_ns_dnode, tvb, pnstr->destnodeid_offset, 2, ENC_LITTLE_ENDIAN); - flagitem = proto_tree_add_uint_format(ns_tree, hf_ns_clflags, tvb, flagoffset, 1, flagval, - "Cluster Flags: 0x%02x (%s)", flagval, flags_strbuf->str); + flagitem = proto_tree_add_uint_format_value(ns_tree, hf_ns_clflags, tvb, flagoffset, 1, flagval, + "0x%02x (%s)", flagval, flags_strbuf->str); flagtree = proto_item_add_subtree(flagitem, ett_ns_flags); proto_tree_add_boolean(flagtree, hf_ns_clflags_res, tvb, flagoffset, 1, flagval); diff --git a/epan/dissectors/packet-ntp.c b/epan/dissectors/packet-ntp.c index 824fc29329..eee6257514 100644 --- a/epan/dissectors/packet-ntp.c +++ b/epan/dissectors/packet-ntp.c @@ -781,15 +781,15 @@ dissect_ntp_std(tvbuff_t *tvb, proto_tree *ntp_tree, guint8 flags) */ ppoll = tvb_get_guint8(tvb, 2); if ((ppoll >= 4) && (ppoll <= 17)) { - proto_tree_add_uint_format(ntp_tree, hf_ntp_ppoll, tvb, 2, 1, + proto_tree_add_uint_format_value(ntp_tree, hf_ntp_ppoll, tvb, 2, 1, ppoll, - "Peer Polling Interval: %u (%u sec)", + "%u (%u sec)", ppoll, 1 << ppoll); } else { - proto_tree_add_uint_format(ntp_tree, hf_ntp_ppoll, tvb, 2, 1, + proto_tree_add_uint_format_value(ntp_tree, hf_ntp_ppoll, tvb, 2, 1, ppoll, - "Peer Polling Interval: invalid (%u)", + "invalid (%u)", ppoll); } diff --git a/epan/dissectors/packet-omron-fins.c b/epan/dissectors/packet-omron-fins.c index 147fd32443..425f8f8837 100644 --- a/epan/dissectors/packet-omron-fins.c +++ b/epan/dissectors/packet-omron-fins.c @@ -2656,8 +2656,8 @@ dissect_omron_fins(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da proto_tree_add_item(omron_disk_data_tree, hf_omron_volume_label, tvb, (offset+2), 12, ENC_ASCII|ENC_NA); omron_byte = tvb_get_guint8(tvb, (offset+14)); - proto_tree_add_uint_format(omron_disk_data_tree, hf_omron_date_year, tvb, (offset+14), 1, omron_byte, - "Year: %d", ((omron_byte>>1)+1980)); + proto_tree_add_uint_format_value(omron_disk_data_tree, hf_omron_date_year, tvb, (offset+14), 1, omron_byte, + "%d", ((omron_byte>>1)+1980)); proto_tree_add_item(omron_disk_data_tree, hf_omron_date_month, tvb, (offset+14), 4, ENC_BIG_ENDIAN); proto_tree_add_item(omron_disk_data_tree, hf_omron_date_day, tvb, (offset+14), 4, ENC_BIG_ENDIAN); @@ -2665,8 +2665,8 @@ dissect_omron_fins(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da proto_tree_add_item(omron_disk_data_tree, hf_omron_date_minute, tvb, (offset+14), 4, ENC_BIG_ENDIAN); omron_byte = tvb_get_guint8(tvb, (offset+17)); - proto_tree_add_uint_format(omron_disk_data_tree, hf_omron_date_second, tvb, (offset+17), 1, omron_byte, - "Second: %d", ((omron_byte&0x1F)*2)); + proto_tree_add_uint_format_value(omron_disk_data_tree, hf_omron_date_second, tvb, (offset+17), 1, omron_byte, + "%d", ((omron_byte&0x1F)*2)); proto_tree_add_item(omron_disk_data_tree, hf_omron_total_capacity, tvb, (offset+18), 4, ENC_BIG_ENDIAN); proto_tree_add_item(omron_disk_data_tree, hf_omron_unused_capacity, tvb, (offset+22), 4, ENC_BIG_ENDIAN); @@ -2684,8 +2684,8 @@ dissect_omron_fins(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da proto_tree_add_item(omron_file_data_tree, hf_omron_filename, tvb, offset, 12, ENC_ASCII|ENC_NA); omron_byte = tvb_get_guint8(tvb, (offset+12)); - proto_tree_add_uint_format(omron_file_data_tree, hf_omron_date_year, tvb, (offset+12), 1, omron_byte, - "Year: %d", ((omron_byte>>1)+1980)); + proto_tree_add_uint_format_value(omron_file_data_tree, hf_omron_date_year, tvb, (offset+12), 1, omron_byte, + "%d", ((omron_byte>>1)+1980)); proto_tree_add_item(omron_file_data_tree, hf_omron_date_month, tvb, (offset+12), 4, ENC_BIG_ENDIAN); proto_tree_add_item(omron_file_data_tree, hf_omron_date_day, tvb, (offset+12), 4, ENC_BIG_ENDIAN); @@ -2693,8 +2693,8 @@ dissect_omron_fins(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da proto_tree_add_item(omron_file_data_tree, hf_omron_date_minute, tvb, (offset+12), 4, ENC_BIG_ENDIAN); omron_byte = tvb_get_guint8(tvb, (offset+15)); - proto_tree_add_uint_format(omron_file_data_tree, hf_omron_date_second, tvb, (offset+15), 1, omron_byte, - "Second: %d", ((omron_byte&0x1F)*2)); + proto_tree_add_uint_format_value(omron_file_data_tree, hf_omron_date_second, tvb, (offset+15), 1, omron_byte, + "%d", ((omron_byte&0x1F)*2)); proto_tree_add_item(omron_file_data_tree, hf_omron_file_capacity, tvb, (offset+16), 4, ENC_BIG_ENDIAN); diff --git a/epan/dissectors/packet-p_mul.c b/epan/dissectors/packet-p_mul.c index 693904c836..4a3097cf76 100644 --- a/epan/dissectors/packet-p_mul.c +++ b/epan/dissectors/packet-p_mul.c @@ -842,8 +842,8 @@ static void dissect_p_mul (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) offset += 1; /* MAP / PDU_Type */ - en = proto_tree_add_uint_format (p_mul_tree, hf_pdu_type, tvb, offset, 1, - pdu_type, "PDU Type: %s (0x%02x)", + en = proto_tree_add_uint_format_value(p_mul_tree, hf_pdu_type, tvb, offset, 1, + pdu_type, "%s (0x%02x)", get_type (pdu_type), pdu_type); field_tree = proto_item_add_subtree (en, ett_pdu_type); @@ -963,9 +963,8 @@ static void dissect_p_mul (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) message_id_offset = message_id; } message_id -= message_id_offset; - proto_tree_add_uint_format (p_mul_tree, hf_message_id, tvb, offset, 4, - message_id, "Message ID (MSID): %u" - " (relative message id)", message_id); + proto_tree_add_uint_format_value(p_mul_tree, hf_message_id, tvb, offset, 4, + message_id, "%u (relative message id)", message_id); } else { proto_tree_add_item (p_mul_tree, hf_message_id, tvb, offset, 4, ENC_BIG_ENDIAN); } @@ -1102,9 +1101,8 @@ static void dissect_p_mul (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) message_id_offset = message_id; } message_id -= message_id_offset; - proto_tree_add_uint_format (field_tree, hf_message_id, tvb, offset, 4, - message_id, "Message ID (MSID): %u" - " (relative message id)", message_id); + proto_tree_add_uint_format_value(field_tree, hf_message_id, tvb, offset, 4, + message_id, "%u (relative message id)", message_id); } else { proto_tree_add_item (field_tree, hf_message_id, tvb, offset, 4, ENC_BIG_ENDIAN); } @@ -1140,9 +1138,9 @@ static void dissect_p_mul (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) missing_tree = proto_item_add_subtree (en, ett_range_entry); for (sno = ack_seq_no; sno <= end_seq_no; sno++) { - en = proto_tree_add_uint_format (missing_tree, hf_miss_seq_no, + en = proto_tree_add_uint_format_value(missing_tree, hf_miss_seq_no, tvb, offset, 6, sno, - "Missing Data PDU Seq Number: %d", sno); + "%d", sno); PROTO_ITEM_SET_GENERATED (en); } tot_no_missing += (end_seq_no - ack_seq_no + 1); diff --git a/epan/dissectors/packet-pgm.c b/epan/dissectors/packet-pgm.c index e1f334af50..65f49f18e0 100644 --- a/epan/dissectors/packet-pgm.c +++ b/epan/dissectors/packet-pgm.c @@ -420,9 +420,9 @@ dissect_pgmopts(ptvcursor_t* cursor, const char *pktname) ptvcursor_add(cursor, hf_pgm_genopt_type, 1, ENC_BIG_ENDIAN); if (genopts_len < PGM_OPT_JOIN_SIZE) { - proto_tree_add_uint_format(opt_tree, hf_pgm_genopt_len, tvb, + proto_tree_add_uint_format_value(opt_tree, hf_pgm_genopt_len, tvb, ptvcursor_current_offset(cursor), 1, genopts_len, - "Length: %u (bogus, must be >= %u)", + "%u (bogus, must be >= %u)", genopts_len, PGM_OPT_JOIN_SIZE); break; } @@ -444,17 +444,17 @@ dissect_pgmopts(ptvcursor_t* cursor, const char *pktname) if (genopts_len < PGM_OPT_PARITY_PRM_SIZE) { - proto_tree_add_uint_format(opt_tree, hf_pgm_genopt_len, ptvcursor_tvbuff(cursor), + proto_tree_add_uint_format_value(opt_tree, hf_pgm_genopt_len, ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor), 1, genopts_len, - "Length: %u (bogus, must be >= %u)", + "%u (bogus, must be >= %u)", genopts_len, PGM_OPT_PARITY_PRM_SIZE); break; } ptvcursor_add(cursor, hf_pgm_genopt_len, 1, ENC_BIG_ENDIAN); ptvcursor_add(cursor, hf_pgm_genopt_opx, 1, ENC_BIG_ENDIAN); optdata_po = tvb_get_guint8(tvb, ptvcursor_current_offset(cursor)); - proto_tree_add_uint_format(opt_tree, hf_pgm_opt_parity_prm_po, tvb, - ptvcursor_current_offset(cursor), 1, optdata_po, "Parity Parameters: %s (0x%x)", + proto_tree_add_uint_format_value(opt_tree, hf_pgm_opt_parity_prm_po, tvb, + ptvcursor_current_offset(cursor), 1, optdata_po, "%s (0x%x)", paritystr(optdata_po), optdata_po); ptvcursor_advance(cursor, 1); @@ -470,9 +470,9 @@ dissect_pgmopts(ptvcursor_t* cursor, const char *pktname) ptvcursor_add(cursor, hf_pgm_genopt_type, 1, ENC_BIG_ENDIAN); if (genopts_len < PGM_OPT_PARITY_GRP_SIZE) { - proto_tree_add_uint_format(opt_tree, hf_pgm_genopt_len, tvb, + proto_tree_add_uint_format_value(opt_tree, hf_pgm_genopt_len, tvb, ptvcursor_current_offset(cursor), 1, genopts_len, - "Length: %u (bogus, must be >= %u)", + "%u (bogus, must be >= %u)", genopts_len, PGM_OPT_PARITY_GRP_SIZE); break; } @@ -556,9 +556,9 @@ dissect_pgmopts(ptvcursor_t* cursor, const char *pktname) ptvcursor_add(cursor, hf_pgm_genopt_type, 1, ENC_BIG_ENDIAN); if (genopts_len < PGM_OPT_PGMCC_DATA_SIZE) { - proto_tree_add_uint_format(opt_tree, hf_pgm_genopt_len, tvb, + proto_tree_add_uint_format_value(opt_tree, hf_pgm_genopt_len, tvb, ptvcursor_current_offset(cursor), 1, genopts_len, - "Length: %u (bogus, must be >= %u)", + "%u (bogus, must be >= %u)", genopts_len, PGM_OPT_PGMCC_DATA_SIZE); break; } @@ -598,9 +598,9 @@ dissect_pgmopts(ptvcursor_t* cursor, const char *pktname) ptvcursor_add(cursor, hf_pgm_genopt_type, 1, ENC_BIG_ENDIAN); if (genopts_len < PGM_OPT_PGMCC_FEEDBACK_SIZE) { - proto_tree_add_uint_format(opt_tree, hf_pgm_genopt_len, tvb, + proto_tree_add_uint_format_value(opt_tree, hf_pgm_genopt_len, tvb, ptvcursor_current_offset(cursor), 1, genopts_len, - "Length: %u (bogus, must be >= %u)", + "%u (bogus, must be >= %u)", genopts_len, PGM_OPT_PGMCC_FEEDBACK_SIZE); break; } @@ -638,9 +638,9 @@ dissect_pgmopts(ptvcursor_t* cursor, const char *pktname) ptvcursor_add(cursor, hf_pgm_genopt_type, 1, ENC_BIG_ENDIAN); if (genopts_len < PGM_OPT_NAK_BO_IVL_SIZE) { - proto_tree_add_uint_format(opt_tree, hf_pgm_genopt_len, tvb, + proto_tree_add_uint_format_value(opt_tree, hf_pgm_genopt_len, tvb, ptvcursor_current_offset(cursor), 1, genopts_len, - "Length: %u (bogus, must be >= %u)", + "%u (bogus, must be >= %u)", genopts_len, PGM_OPT_NAK_BO_IVL_SIZE); break; } @@ -660,9 +660,9 @@ dissect_pgmopts(ptvcursor_t* cursor, const char *pktname) ptvcursor_add(cursor, hf_pgm_genopt_type, 1, ENC_BIG_ENDIAN); if (genopts_len < PGM_OPT_NAK_BO_RNG_SIZE) { - proto_tree_add_uint_format(opt_tree, hf_pgm_genopt_len, tvb, + proto_tree_add_uint_format_value(opt_tree, hf_pgm_genopt_len, tvb, ptvcursor_current_offset(cursor), 1, genopts_len, - "Length: %u (bogus, must be >= %u)", + "%u (bogus, must be >= %u)", genopts_len, PGM_OPT_NAK_BO_RNG_SIZE); break; } @@ -684,9 +684,9 @@ dissect_pgmopts(ptvcursor_t* cursor, const char *pktname) ptvcursor_add(cursor, hf_pgm_genopt_type, 1, ENC_BIG_ENDIAN); if (genopts_len < PGM_OPT_REDIRECT_SIZE) { - proto_tree_add_uint_format(opt_tree, hf_pgm_genopt_len, tvb, + proto_tree_add_uint_format_value(opt_tree, hf_pgm_genopt_len, tvb, ptvcursor_current_offset(cursor), 1, genopts_len, - "Length: %u (bogus, must be >= %u)", + "%u (bogus, must be >= %u)", genopts_len, PGM_OPT_REDIRECT_SIZE); break; } @@ -723,9 +723,9 @@ dissect_pgmopts(ptvcursor_t* cursor, const char *pktname) ptvcursor_add(cursor, hf_pgm_genopt_type, 1, ENC_BIG_ENDIAN); if (genopts_len < PGM_OPT_FRAGMENT_SIZE) { - proto_tree_add_uint_format(opt_tree, hf_pgm_genopt_len, tvb, + proto_tree_add_uint_format_value(opt_tree, hf_pgm_genopt_len, tvb, ptvcursor_current_offset(cursor), 1, genopts_len, - "Length: %u (bogus, must be >= %u)", + "%u (bogus, must be >= %u)", genopts_len, PGM_OPT_FRAGMENT_SIZE); break; } @@ -900,8 +900,8 @@ dissect_pgm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) ptvcursor_add(cursor, hf_pgm_main_dport, 2, ENC_BIG_ENDIAN); ptvcursor_add(cursor, hf_pgm_main_type, 1, ENC_BIG_ENDIAN); - tf = proto_tree_add_uint_format(pgm_tree, hf_pgm_main_opts, tvb, - ptvcursor_current_offset(cursor), 1, pgmhdr_opts, "Options: %s (0x%x)", + tf = proto_tree_add_uint_format_value(pgm_tree, hf_pgm_main_opts, tvb, + ptvcursor_current_offset(cursor), 1, pgmhdr_opts, "%s (0x%x)", optsstr(pgmhdr_opts), pgmhdr_opts); opt_tree = proto_item_add_subtree(tf, ett_pgm_optbits); ptvcursor_set_tree(cursor, opt_tree); @@ -916,8 +916,8 @@ dissect_pgm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if ((pgmhdr_type != PGM_RDATA_PCKT) && (pgmhdr_type != PGM_ODATA_PCKT) && (pgmhdr_cksum == 0)) { - proto_tree_add_uint_format(pgm_tree, hf_pgm_main_cksum, tvb, - ptvcursor_current_offset(cursor), 2, pgmhdr_cksum, "Checksum: not available"); + proto_tree_add_uint_format_value(pgm_tree, hf_pgm_main_cksum, tvb, + ptvcursor_current_offset(cursor), 2, pgmhdr_cksum, "not available"); } else { reportedlen = tvb_reported_length(tvb); pgmlen = tvb_length(tvb); @@ -929,14 +929,14 @@ dissect_pgm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) cksum_vec[0].len = pgmlen; computed_cksum = in_cksum(&cksum_vec[0], 1); if (computed_cksum == 0) { - proto_tree_add_uint_format(pgm_tree, hf_pgm_main_cksum, tvb, - ptvcursor_current_offset(cursor), 2, pgmhdr_cksum, "Checksum: 0x%04x [correct]", pgmhdr_cksum); + proto_tree_add_uint_format_value(pgm_tree, hf_pgm_main_cksum, tvb, + ptvcursor_current_offset(cursor), 2, pgmhdr_cksum, "0x%04x [correct]", pgmhdr_cksum); } else { hidden_item = proto_tree_add_boolean(pgm_tree, hf_pgm_main_cksum_bad, tvb, ptvcursor_current_offset(cursor), 2, TRUE); PROTO_ITEM_SET_HIDDEN(hidden_item); - proto_tree_add_uint_format(pgm_tree, hf_pgm_main_cksum, tvb, - ptvcursor_current_offset(cursor), 2, pgmhdr_cksum, "Checksum: 0x%04x [incorrect, should be 0x%04x]", + proto_tree_add_uint_format_value(pgm_tree, hf_pgm_main_cksum, tvb, + ptvcursor_current_offset(cursor), 2, pgmhdr_cksum, "0x%04x [incorrect, should be 0x%04x]", pgmhdr_cksum, in_cksum_shouldbe(pgmhdr_cksum, computed_cksum)); } } else { diff --git a/epan/dissectors/packet-pim.c b/epan/dissectors/packet-pim.c index 0113e4aa86..38c555d9c5 100644 --- a/epan/dissectors/packet-pim.c +++ b/epan/dissectors/packet-pim.c @@ -247,14 +247,14 @@ dissect_pimv1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, cksum_vec[0].len = pim_length; computed_cksum = in_cksum(&cksum_vec[0], 1); if (computed_cksum == 0) { - proto_tree_add_uint_format(pim_tree, hf_pim_cksum, tvb, + proto_tree_add_uint_format_value(pim_tree, hf_pim_cksum, tvb, offset, 2, pim_cksum, - "Checksum: 0x%04x [correct]", + "0x%04x [correct]", pim_cksum); } else { - proto_tree_add_uint_format(pim_tree, hf_pim_cksum, tvb, + proto_tree_add_uint_format_value(pim_tree, hf_pim_cksum, tvb, offset, 2, pim_cksum, - "Checksum: 0x%04x [incorrect, should be 0x%04x]", + "0x%04x [incorrect, should be 0x%04x]", pim_cksum, in_cksum_shouldbe(pim_cksum, computed_cksum)); } } else { @@ -464,7 +464,6 @@ dissect_pimv1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, case 5: /* assert */ { - guint32 pref; proto_tree_add_item(pimopt_tree, hf_pim_group_address_ip4, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; @@ -473,10 +472,8 @@ dissect_pimv1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, offset += 4; proto_tree_add_item(pimopt_tree, hf_pim_rpt, tvb, offset, 1, ENC_BIG_ENDIAN); - pref = tvb_get_ntohl(tvb, offset) & 0x7fffffff; - proto_tree_add_uint_format(pimopt_tree, hf_pim_metric_pref, tvb, - offset, 4, pref, - "Metric Preference: %u", pref); + proto_tree_add_item(pimopt_tree, hf_pim_metric_pref, tvb, + offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(pimopt_tree, hf_pim_metric, tvb, offset, 4, ENC_BIG_ENDIAN); @@ -780,14 +777,14 @@ dissect_pim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { } if (computed_cksum == 0) { - proto_tree_add_uint_format(pim_tree, hf_pim_cksum, tvb, + proto_tree_add_uint_format_value(pim_tree, hf_pim_cksum, tvb, offset + 2, 2, pim_cksum, - "Checksum: 0x%04x [correct]", + "0x%04x [correct]", pim_cksum); } else { - proto_tree_add_uint_format(pim_tree, hf_pim_cksum, tvb, + proto_tree_add_uint_format_value(pim_tree, hf_pim_cksum, tvb, offset + 2, 2, pim_cksum, - "Checksum: 0x%04x [incorrect, should be 0x%04x]", + "0x%04x [incorrect, should be 0x%04x]", pim_cksum, in_cksum_shouldbe(pim_cksum, computed_cksum)); } } else { @@ -1115,7 +1112,6 @@ dissect_pim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { case 5: /* assert */ { int advance; - guint32 pref; if (!dissect_pim_addr(pimopt_tree, tvb, offset, pimv2_group, NULL, NULL, @@ -1130,10 +1126,8 @@ dissect_pim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { offset += advance; proto_tree_add_item(pimopt_tree, hf_pim_rpt, tvb, offset, 1, ENC_BIG_ENDIAN); - pref = tvb_get_ntohl(tvb, offset) & 0x7fffffff; - proto_tree_add_uint_format(pimopt_tree, hf_pim_metric_pref, tvb, - offset, 4, pref, - "Metric Preference: %u", pref); + proto_tree_add_item(pimopt_tree, hf_pim_metric_pref, tvb, + offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(pimopt_tree, hf_pim_metric, tvb, offset, 4, ENC_BIG_ENDIAN); @@ -1180,7 +1174,6 @@ dissect_pim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { case 9: /* State-Refresh */ { int advance; - guint32 pref; if (!dissect_pim_addr(pimopt_tree, tvb, offset, pimv2_group, NULL, NULL, @@ -1201,10 +1194,8 @@ dissect_pim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { offset += advance; proto_tree_add_item(pimopt_tree, hf_pim_rpt, tvb, offset, 1, ENC_BIG_ENDIAN); - pref = tvb_get_ntohl(tvb, offset) & 0x7fffffff; - proto_tree_add_uint_format(pimopt_tree, hf_pim_metric_pref, tvb, - offset, 4, pref, - "Metric Preference: %u", pref); + proto_tree_add_item(pimopt_tree, hf_pim_metric_pref, tvb, + offset, 4, ENC_BIG_ENDIAN); offset += 4; proto_tree_add_item(pimopt_tree, hf_pim_metric, tvb, offset, 4, ENC_BIG_ENDIAN); diff --git a/epan/dissectors/packet-portmap.c b/epan/dissectors/packet-portmap.c index a8d6bf7997..9d7b642c67 100644 --- a/epan/dissectors/packet-portmap.c +++ b/epan/dissectors/packet-portmap.c @@ -92,8 +92,8 @@ dissect_getport_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, /* program */ prog = tvb_get_ntohl(tvb, offset+0); prog_name = rpc_prog_name(prog); - proto_tree_add_uint_format(tree, hf_portmap_prog, tvb, - offset, 4, prog, "Program: %s (%u)", + proto_tree_add_uint_format_value(tree, hf_portmap_prog, tvb, + offset, 4, prog, "%s (%u)", prog_name, prog); col_append_fstr(pinfo->cinfo, COL_INFO, " %s(%u)", prog_name, prog); @@ -175,8 +175,8 @@ dissect_set_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, if ( tree ) { prog = tvb_get_ntohl(tvb, offset+0); - proto_tree_add_uint_format(tree, hf_portmap_prog, tvb, - offset, 4, prog, "Program: %s (%d)", + proto_tree_add_uint_format_value(tree, hf_portmap_prog, tvb, + offset, 4, prog, "%s (%d)", rpc_prog_name(prog), prog); proto_tree_add_item(tree, hf_portmap_version, tvb, offset+4, 4, ENC_BIG_ENDIAN); @@ -203,8 +203,8 @@ dissect_unset_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, if ( tree ) { prog = tvb_get_ntohl(tvb, offset+0); - proto_tree_add_uint_format(tree, hf_portmap_prog, tvb, - offset, 4, prog, "Program: %s (%d)", + proto_tree_add_uint_format_value(tree, hf_portmap_prog, tvb, + offset, 4, prog, "%s (%d)", rpc_prog_name(prog), prog); proto_tree_add_item(tree, hf_portmap_version, tvb, offset+4, 4, ENC_BIG_ENDIAN); @@ -247,14 +247,14 @@ dissect_dump_entry(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, rpc_prog_name(prog), prog, version); subtree = proto_item_add_subtree(ti, ett_portmap_entry); - proto_tree_add_uint_format(subtree, hf_portmap_prog, tvb, + proto_tree_add_uint_format_value(subtree, hf_portmap_prog, tvb, offset+0, 4, prog, - "Program: %s (%u)", rpc_prog_name(prog), prog); + "%s (%u)", rpc_prog_name(prog), prog); proto_tree_add_uint(subtree, hf_portmap_version, tvb, offset+4, 4, version); - proto_tree_add_uint_format(subtree, hf_portmap_proto, tvb, + proto_tree_add_uint_format_value(subtree, hf_portmap_proto, tvb, offset+8, 4, proto, - "Protocol: %s (0x%02x)", ipprotostr(proto), proto); + "%s (0x%02x)", ipprotostr(proto), proto); proto_tree_add_uint(subtree, hf_portmap_port, tvb, offset+12, 4, port); } @@ -281,8 +281,8 @@ dissect_callit_call(tvbuff_t *tvb, int offset, packet_info *pinfo, prog = tvb_get_ntohl(tvb, offset+0); if ( tree ) { - proto_tree_add_uint_format(tree, hf_portmap_prog, tvb, - offset, 4, prog, "Program: %s (%u)", + proto_tree_add_uint_format_value(tree, hf_portmap_prog, tvb, + offset, 4, prog, "%s (%u)", rpc_prog_name(prog), prog); } @@ -296,8 +296,8 @@ dissect_callit_call(tvbuff_t *tvb, int offset, packet_info *pinfo, proc = tvb_get_ntohl(tvb, offset+8); if ( tree ) { - proto_tree_add_uint_format(tree, hf_portmap_proc, tvb, - offset+8, 4, proc, "Procedure: %s (%u)", + proto_tree_add_uint_format_value(tree, hf_portmap_proc, tvb, + offset+8, 4, proc, "%s (%u)", rpc_proc_name(prog, vers, proc), proc); } @@ -403,9 +403,9 @@ dissect_rpcb(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree prog = tvb_get_ntohl(tvb, offset); if (rpcb_tree) - proto_tree_add_uint_format(rpcb_tree, hf_portmap_rpcb_prog, tvb, + proto_tree_add_uint_format_value(rpcb_tree, hf_portmap_rpcb_prog, tvb, offset, 4, prog, - "Program: %s (%u)", rpc_prog_name(prog), prog); + "%s (%u)", rpc_prog_name(prog), prog); offset += 4; offset = dissect_rpc_uint32(tvb, rpcb_tree, diff --git a/epan/dissectors/packet-ppi.c b/epan/dissectors/packet-ppi.c index 97d23584f1..2ef89b1ce2 100644 --- a/epan/dissectors/packet-ppi.c +++ b/epan/dissectors/packet-ppi.c @@ -521,8 +521,8 @@ dissect_80211_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int of common_frequency = tvb_get_letohs(ptvcursor_tvbuff(csr), ptvcursor_current_offset(csr)); chan_str = ieee80211_mhz_to_str(common_frequency); - proto_tree_add_uint_format(ptvcursor_tree(csr), hf_80211_common_chan_freq, ptvcursor_tvbuff(csr), - ptvcursor_current_offset(csr), 2, common_frequency, "Channel frequency: %s", chan_str); + proto_tree_add_uint_format_value(ptvcursor_tree(csr), hf_80211_common_chan_freq, ptvcursor_tvbuff(csr), + ptvcursor_current_offset(csr), 2, common_frequency, "%s", chan_str); col_add_fstr(pinfo->cinfo, COL_FREQ_CHAN, "%s", chan_str); g_free(chan_str); ptvcursor_advance(csr, 2); diff --git a/epan/dissectors/packet-ppp.c b/epan/dissectors/packet-ppp.c index b39c472f38..7cb9329b18 100644 --- a/epan/dissectors/packet-ppp.c +++ b/epan/dissectors/packet-ppp.c @@ -5317,10 +5317,8 @@ dissect_chap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* Length - make sure it's valid */ length = tvb_get_ntohs(tvb, 2); if (length < 4) { - if (tree) { - proto_tree_add_uint_format(fh_tree, hf_chap_length, tvb, 2, 2, - length, "Length: %u (invalid, must be >= 4)", length); - } + proto_tree_add_uint_format_value(fh_tree, hf_chap_length, tvb, 2, 2, + length, "%u (invalid, must be >= 4)", length); return; } proto_item_set_len(ti, length); diff --git a/epan/dissectors/packet-pptp.c b/epan/dissectors/packet-pptp.c index cfec22a447..606eb4833e 100644 --- a/epan/dissectors/packet-pptp.c +++ b/epan/dissectors/packet-pptp.c @@ -224,8 +224,8 @@ dissect_cntrl_req(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree if (!tree) return; - proto_tree_add_uint_format(tree, hf_pptp_protocol_version, tvb, offset, - 2, tvb_get_ntohs(tvb, offset), "Protocol version: %u.%u", + proto_tree_add_uint_format_value(tree, hf_pptp_protocol_version, tvb, offset, + 2, tvb_get_ntohs(tvb, offset), "%u.%u", tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset + 1)); offset += 2; @@ -256,8 +256,8 @@ dissect_cntrl_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tre if (!tree) return; - proto_tree_add_uint_format(tree, hf_pptp_protocol_version, tvb, offset, - 2, tvb_get_ntohs(tvb, offset), "Protocol version: %u.%u", + proto_tree_add_uint_format_value(tree, hf_pptp_protocol_version, tvb, offset, + 2, tvb_get_ntohs(tvb, offset), "%u.%u", tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset + 1)); offset += 2; diff --git a/epan/dissectors/packet-pw-hdlc.c b/epan/dissectors/packet-pw-hdlc.c index 5b16c25e68..3d84b8eaa4 100644 --- a/epan/dissectors/packet-pw-hdlc.c +++ b/epan/dissectors/packet-pw-hdlc.c @@ -107,13 +107,13 @@ static void dissect_pw_hdlc_nocw_hdlc_ppp( tvbuff_t * tvb, packet_info * pinfo, tr = proto_item_add_subtree( item, ett_pw_hdlc ); - item_address = proto_tree_add_uint( tr, hf_pw_hdlc_address_field, tvb, 0, 1, addr ); - item_control = proto_tree_add_uint_format( tr, hf_pw_hdlc_control_field, tvb, 1, 1, control, "Control field: 0x%x", control ); + item_address = proto_tree_add_item( tr, hf_pw_hdlc_address_field, tvb, 0, 1, ENC_NA ); + item_control = proto_tree_add_item( tr, hf_pw_hdlc_control_field, tvb, 1, 1, ENC_NA ); tr = proto_item_add_subtree( item_address, ett_pw_hdlc ); if ( 0x3F == (( addr & 0xFC ) >> 2 )) - proto_tree_add_uint_format( tr, hf_pw_hdlc_address, tvb, 0, 1, 0xFC, "Address: 0x%x (All stations)", 0x3F ); + proto_tree_add_uint_format_value( tr, hf_pw_hdlc_address, tvb, 0, 1, 0xFC, "0x%x (All stations)", 0x3F ); else proto_tree_add_uint( tr, hf_pw_hdlc_address, tvb, 0, 1, ( addr & 0xFC ) >> 2 ); diff --git a/epan/dissectors/packet-q931.c b/epan/dissectors/packet-q931.c index 737cdf7fa5..baed359e2c 100644 --- a/epan/dissectors/packet-q931.c +++ b/epan/dissectors/packet-q931.c @@ -711,32 +711,32 @@ dissect_q931_protocol_discriminator(tvbuff_t *tvb, int offset, proto_tree *tree) unsigned int discriminator = tvb_get_guint8(tvb, offset); if (discriminator == NLPID_DMS) { - proto_tree_add_uint_format(tree, hf_q931_discriminator, + proto_tree_add_uint_format_value(tree, hf_q931_discriminator, tvb, offset, 1, discriminator, - "Protocol discriminator: Maintenance messages"); + "Maintenance messages"); } else if (discriminator == NLPID_Q_931) { - proto_tree_add_uint_format(tree, hf_q931_discriminator, + proto_tree_add_uint_format_value(tree, hf_q931_discriminator, tvb, offset, 1, discriminator, - "Protocol discriminator: Q.931"); + "Q.931"); } else if (discriminator == NLPID_Q_2931) { - proto_tree_add_uint_format(tree, hf_q931_discriminator, + proto_tree_add_uint_format_value(tree, hf_q931_discriminator, tvb, offset, 1, discriminator, - "Protocol discriminator: Q.2931"); + "Q.2931"); } else if ((discriminator >= 16 && discriminator < 63) || ((discriminator >= 80) && (discriminator < 254))) { - proto_tree_add_uint_format(tree, hf_q931_discriminator, + proto_tree_add_uint_format_value(tree, hf_q931_discriminator, tvb, offset, 1, discriminator, - "Protocol discriminator: Network layer or layer 3 protocol (0x%02X)", + "Network layer or layer 3 protocol (0x%02X)", discriminator); } else if (discriminator >= 64 && discriminator <= 79) { - proto_tree_add_uint_format(tree, hf_q931_discriminator, + proto_tree_add_uint_format_value(tree, hf_q931_discriminator, tvb, offset, 1, discriminator, - "Protocol discriminator: National use (0x%02X)", + "National use (0x%02X)", discriminator); } else { - proto_tree_add_uint_format(tree, hf_q931_discriminator, + proto_tree_add_uint_format_value(tree, hf_q931_discriminator, tvb, offset, 1, discriminator, - "Protocol discriminator: Reserved (0x%02X)", + "Reserved (0x%02X)", discriminator); } } diff --git a/epan/dissectors/packet-q933.c b/epan/dissectors/packet-q933.c index 99e75067f2..31cbb47269 100644 --- a/epan/dissectors/packet-q933.c +++ b/epan/dissectors/packet-q933.c @@ -437,28 +437,28 @@ dissect_q933_protocol_discriminator(tvbuff_t *tvb, int offset, proto_tree *tree) unsigned int discriminator = tvb_get_guint8(tvb, offset); if (discriminator == NLPID_Q_933) { - proto_tree_add_uint_format(tree, hf_q933_discriminator, + proto_tree_add_uint_format_value(tree, hf_q933_discriminator, tvb, offset, 1, discriminator, - "Protocol discriminator: Q.933"); + "Q.933"); } else if (discriminator == NLPID_Q_2931) { - proto_tree_add_uint_format(tree, hf_q933_discriminator, + proto_tree_add_uint_format_value(tree, hf_q933_discriminator, tvb, offset, 1, discriminator, - "Protocol discriminator: Q.2931"); + "Q.2931"); } else if ((discriminator >= 16 && discriminator < 63) || ((discriminator >= 80) && (discriminator < 254))) { - proto_tree_add_uint_format(tree, hf_q933_discriminator, + proto_tree_add_uint_format_value(tree, hf_q933_discriminator, tvb, offset, 1, discriminator, - "Protocol discriminator: Network layer or layer 3 protocol (0x%02X)", + "Network layer or layer 3 protocol (0x%02X)", discriminator); } else if (discriminator >= 64 && discriminator <= 79) { - proto_tree_add_uint_format(tree, hf_q933_discriminator, + proto_tree_add_uint_format_value(tree, hf_q933_discriminator, tvb, offset, 1, discriminator, - "Protocol discriminator: National use (0x%02X)", + "National use (0x%02X)", discriminator); } else { - proto_tree_add_uint_format(tree, hf_q933_discriminator, + proto_tree_add_uint_format_value(tree, hf_q933_discriminator, tvb, offset, 1, discriminator, - "Protocol discriminator: Reserved (0x%02X)", + "Reserved (0x%02X)", discriminator); } } diff --git a/epan/dissectors/packet-radius.c b/epan/dissectors/packet-radius.c index aa902c55b4..d650d9232a 100644 --- a/epan/dissectors/packet-radius.c +++ b/epan/dissectors/packet-radius.c @@ -1449,8 +1449,8 @@ dissect_radius(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _ { if (tree) { - proto_tree_add_uint_format(radius_tree, hf_radius_length, - tvb, 2, 2, rh.rh_pktlength, "Length: %u (bogus, < %u)", + proto_tree_add_uint_format_value(radius_tree, hf_radius_length, + tvb, 2, 2, rh.rh_pktlength, "%u (bogus, < %u)", rh.rh_pktlength, HDR_LENGTH); } return tvb_length(tvb); diff --git a/epan/dissectors/packet-rlm.c b/epan/dissectors/packet-rlm.c index 95b2519436..271b6bbd97 100644 --- a/epan/dissectors/packet-rlm.c +++ b/epan/dissectors/packet-rlm.c @@ -164,7 +164,7 @@ dissect_rlm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) ti = proto_tree_add_item(tree, proto_rlm, tvb, 0, 8, ENC_NA); rlm_tree = proto_item_add_subtree(ti, ett_rlm); proto_tree_add_item(rlm_tree, hf_rlm_version, tvb, 0, 1, ENC_BIG_ENDIAN); - proto_tree_add_uint_format(rlm_tree, hf_rlm_type, tvb, 1, 1, rlm_type, "Type: %u (%s)", rlm_type, type_str); + proto_tree_add_uint_format_value(rlm_tree, hf_rlm_type, tvb, 1, 1, rlm_type, "%u (%s)", rlm_type, type_str); proto_tree_add_item(rlm_tree, hf_rlm_unknown, tvb, 2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rlm_tree, hf_rlm_tid, tvb, 4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(rlm_tree, hf_rlm_unknown2, tvb, 6, 2, ENC_BIG_ENDIAN); diff --git a/epan/dissectors/packet-rpc.c b/epan/dissectors/packet-rpc.c index f2d1080c69..eb7d340392 100644 --- a/epan/dissectors/packet-rpc.c +++ b/epan/dissectors/packet-rpc.c @@ -2119,10 +2119,8 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, } xid = tvb_get_ntohl(tvb, offset); - if (rpc_tree) { - proto_tree_add_uint_format(rpc_tree,hf_rpc_xid, tvb, - offset, 4, xid, "XID: 0x%x (%u)", xid, xid); - } + proto_tree_add_item(rpc_tree,hf_rpc_xid, tvb, + offset, 4, ENC_BIG_ENDIAN); msg_type_name = val_to_str(msg_type,rpc_msg_type,"%u"); if (rpc_tree) { @@ -2152,9 +2150,9 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, prog = tvb_get_ntohl(tvb, offset + 4); if (rpc_tree) { - proto_tree_add_uint_format(rpc_tree, + proto_tree_add_uint_format_value(rpc_tree, hf_rpc_program, tvb, offset+4, 4, prog, - "Program: %s (%u)", progname, prog); + "%s (%u)", progname, prog); } /* Set the protocol name to the underlying @@ -2240,9 +2238,9 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, } if (rpc_tree) { - proto_tree_add_uint_format(rpc_tree, + proto_tree_add_uint_format_value(rpc_tree, hf_rpc_procedure, tvb, offset+12, 4, proc, - "Procedure: %s (%u)", procname, proc); + "%s (%u)", procname, proc); } /* Print the program version, procedure name, and message type (call or reply). */ @@ -2467,16 +2465,16 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if (rpc_tree) { proto_item *tmp_item; - tmp_item=proto_tree_add_uint_format(rpc_tree, + tmp_item=proto_tree_add_uint_format_value(rpc_tree, hf_rpc_program, tvb, 0, 0, prog, - "Program: %s (%u)", progname, prog); + "%s (%u)", progname, prog); PROTO_ITEM_SET_GENERATED(tmp_item); tmp_item=proto_tree_add_uint(rpc_tree, hf_rpc_programversion, tvb, 0, 0, vers); PROTO_ITEM_SET_GENERATED(tmp_item); - tmp_item=proto_tree_add_uint_format(rpc_tree, + tmp_item=proto_tree_add_uint_format_value(rpc_tree, hf_rpc_procedure, tvb, 0, 0, proc, - "Procedure: %s (%u)", procname, proc); + "%s (%u)", procname, proc); PROTO_ITEM_SET_GENERATED(tmp_item); } @@ -2711,9 +2709,9 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, procedure_hf, tvb, 0, 0, proc); PROTO_ITEM_SET_GENERATED(tmp_item); } else { - tmp_item=proto_tree_add_uint_format(ptree, + tmp_item=proto_tree_add_uint_format_value(ptree, hf_rpc_procedure, tvb, 0, 0, proc, - "Procedure: %s (%u)", procname, proc); + "%s (%u)", procname, proc); PROTO_ITEM_SET_GENERATED(tmp_item); } } @@ -3787,7 +3785,7 @@ proto_register_rpc(void) "Fragment Length", "rpc.fraglen", FT_UINT32, BASE_DEC, NULL, RPC_RM_FRAGLEN, NULL, HFILL }}, { &hf_rpc_xid, { - "XID", "rpc.xid", FT_UINT32, BASE_HEX, + "XID", "rpc.xid", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL }}, { &hf_rpc_msgtype, { "Message Type", "rpc.msgtyp", FT_UINT32, BASE_DEC, diff --git a/epan/dissectors/packet-rtcp.c b/epan/dissectors/packet-rtcp.c index 59c2dc6e7a..72cf0292c6 100644 --- a/epan/dissectors/packet-rtcp.c +++ b/epan/dissectors/packet-rtcp.c @@ -1731,10 +1731,10 @@ dissect_rtcp_sdes( tvbuff_t *tvb, int offset, proto_tree *tree, */ prefix_len = tvb_get_guint8( tvb, offset ); if ( prefix_len + 1 > item_len ) { - proto_tree_add_uint_format( sdes_item_tree, + proto_tree_add_uint_format_value( sdes_item_tree, hf_rtcp_sdes_prefix_len, tvb, offset, 1, prefix_len, - "Prefix length: %u (bogus, must be <= %u)", + "%u (bogus, must be <= %u)", prefix_len, item_len - 1); offset += item_len; continue; @@ -1896,8 +1896,8 @@ dissect_rtcp_xr(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tree, /* Loss Rate */ fraction_rate = tvb_get_guint8(tvb, offset); - proto_tree_add_uint_format(content_tree, hf_rtcp_ssrc_fraction, tvb, offset, 1, - fraction_rate, "Fraction lost: %u / 256", fraction_rate); + proto_tree_add_uint_format_value(content_tree, hf_rtcp_ssrc_fraction, tvb, offset, 1, + fraction_rate, "%u / 256", fraction_rate); offset++; /* Discard Rate */ @@ -2373,8 +2373,8 @@ dissect_rtcp_rr( packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *tree /* Fraction lost, 8bits */ rr_flt = tvb_get_guint8( tvb, offset ); - proto_tree_add_uint_format( ssrc_sub_tree, hf_rtcp_ssrc_fraction, tvb, - offset, 1, rr_flt, "Fraction lost: %u / 256", rr_flt ); + proto_tree_add_uint_format_value( ssrc_sub_tree, hf_rtcp_ssrc_fraction, tvb, + offset, 1, rr_flt, "%u / 256", rr_flt ); offset++; /* Cumulative number of packets lost, 24 bits */ diff --git a/epan/dissectors/packet-sasp.c b/epan/dissectors/packet-sasp.c index 64b528708e..ec83ffd0b0 100644 --- a/epan/dissectors/packet-sasp.c +++ b/epan/dissectors/packet-sasp.c @@ -358,8 +358,8 @@ dissect_sasp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) sasp_tree = proto_item_add_subtree(ti, ett_sasp_header); hdr_type = tvb_get_ntohs(tvb, offset); - hti = proto_tree_add_uint_format(sasp_tree, hf_sasp_type, tvb, offset, 2, hdr_type, - "Type: %s", (hdr_type == SASP_HDR_TYPE) ? "SASP" : "[Invalid]"); + hti = proto_tree_add_uint_format_value(sasp_tree, hf_sasp_type, tvb, offset, 2, hdr_type, + "%s", (hdr_type == SASP_HDR_TYPE) ? "SASP" : "[Invalid]"); if (hdr_type != SASP_HDR_TYPE) { expert_add_info_format(pinfo, hti, &ei_msg_type_invalid, diff --git a/epan/dissectors/packet-sbus.c b/epan/dissectors/packet-sbus.c index acc733dd45..e0179fd275 100644 --- a/epan/dissectors/packet-sbus.c +++ b/epan/dissectors/packet-sbus.c @@ -1870,13 +1870,13 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ /*Show CRC and add hidden item for wrong CRC*/ sbus_helper = tvb_get_ntohs(tvb, offset); if (sbus_helper == sbus_crc_calc) { - proto_tree_add_uint_format(sbus_tree, + proto_tree_add_uint_format_value(sbus_tree, hf_sbus_crc, tvb, offset, 2, sbus_helper, - "Checksum: 0x%04x (correct)", sbus_helper); + "0x%04x (correct)", sbus_helper); } else { - cs = proto_tree_add_uint_format(sbus_tree, + cs = proto_tree_add_uint_format_value(sbus_tree, hf_sbus_crc, tvb, offset, 2, sbus_helper, - "Checksum: 0x%04x (NOT correct)", sbus_helper); + "0x%04x (NOT correct)", sbus_helper); expert_add_info(pinfo, cs, &ei_sbus_crc_bad); hi = proto_tree_add_boolean(sbus_tree, hf_sbus_crc_bad, tvb, offset, 2, TRUE); diff --git a/epan/dissectors/packet-scop.c b/epan/dissectors/packet-scop.c index 123f9d1c7b..06de234059 100644 --- a/epan/dissectors/packet-scop.c +++ b/epan/dissectors/packet-scop.c @@ -279,7 +279,7 @@ dissect_scop_zip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (type == SCOP_CMD_HELLO_RESP) { status = tvb_get_ntohs(tvb, 1); - proto_tree_add_uint_format(tree, hf_scop_status, tvb, offset, 2, status, "Status: %s", (status==0x0000)?"Success":"Failure"); + proto_tree_add_uint_format_value(tree, hf_scop_status, tvb, offset, 2, status, "%s", (status==0x0000)?"Success":"Failure"); offset += 2; } diff --git a/epan/dissectors/packet-scsi-osd.c b/epan/dissectors/packet-scsi-osd.c index 323b487aa9..c8adfb548d 100644 --- a/epan/dissectors/packet-scsi-osd.c +++ b/epan/dissectors/packet-scsi-osd.c @@ -3420,7 +3420,7 @@ dissect_osd_opcode(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, val_to_str_const(svcaction, scsi_osd_svcaction_vals, "Unknown OSD Service Action")); if(svcaction){ proto_item *it; - it=proto_tree_add_uint_format(tree, hf_scsi_osd_svcaction, tvb, 0, 0, svcaction, "Service Action: 0x%04x", svcaction); + it=proto_tree_add_uint_format_value(tree, hf_scsi_osd_svcaction, tvb, 0, 0, svcaction, "0x%04x", svcaction); PROTO_ITEM_SET_GENERATED(it); } dissector=find_svcaction_dissector(svcaction); diff --git a/epan/dissectors/packet-sctp.c b/epan/dissectors/packet-sctp.c index 0e44e66a35..7d0fe69d81 100644 --- a/epan/dissectors/packet-sctp.c +++ b/epan/dissectors/packet-sctp.c @@ -3733,8 +3733,8 @@ dissect_sctp_chunk(tvbuff_t *chunk_tvb, if (length < CHUNK_HEADER_LENGTH) { if (tree) { - proto_tree_add_uint_format(chunk_tree, hf_chunk_length, chunk_tvb, CHUNK_LENGTH_OFFSET, CHUNK_LENGTH_LENGTH, length, - "Chunk length: %u (invalid, should be >= %u)", length, CHUNK_HEADER_LENGTH); + proto_tree_add_uint_format_value(chunk_tree, hf_chunk_length, chunk_tvb, CHUNK_LENGTH_OFFSET, CHUNK_LENGTH_LENGTH, length, + "%u (invalid, should be >= %u)", length, CHUNK_HEADER_LENGTH); proto_item_append_text(chunk_item, ", bogus chunk length %u < %u)", length, CHUNK_HEADER_LENGTH); } @@ -3979,15 +3979,15 @@ dissect_sctp_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolea switch(sctp_checksum) { case SCTP_CHECKSUM_NONE: - proto_tree_add_uint_format(sctp_tree, hf_checksum, tvb, CHECKSUM_OFFSET, CHECKSUM_LENGTH, checksum, "Checksum: 0x%08x (not verified)", checksum); + proto_tree_add_uint_format_value(sctp_tree, hf_checksum, tvb, CHECKSUM_OFFSET, CHECKSUM_LENGTH, checksum, "0x%08x (not verified)", checksum); break; case SCTP_CHECKSUM_ADLER32: if (adler32_correct) - proto_tree_add_uint_format(sctp_tree, hf_checksum, tvb, CHECKSUM_OFFSET, CHECKSUM_LENGTH, - checksum, "Checksum: 0x%08x [correct Adler32]", checksum); + proto_tree_add_uint_format_value(sctp_tree, hf_checksum, tvb, CHECKSUM_OFFSET, CHECKSUM_LENGTH, + checksum, "0x%08x [correct Adler32]", checksum); else { - item = proto_tree_add_uint_format(sctp_tree, hf_checksum, tvb, CHECKSUM_OFFSET, CHECKSUM_LENGTH, checksum, - "Checksum: 0x%08x [incorrect Adler32, should be 0x%08x]", + item = proto_tree_add_uint_format_value(sctp_tree, hf_checksum, tvb, CHECKSUM_OFFSET, CHECKSUM_LENGTH, checksum, + "0x%08x [incorrect Adler32, should be 0x%08x]", checksum, calculated_adler32); expert_add_info(pinfo, item, &ei_sctp_bad_sctp_checksum); } @@ -3996,11 +3996,11 @@ dissect_sctp_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolea break; case SCTP_CHECKSUM_CRC32C: if (crc32c_correct) - proto_tree_add_uint_format(sctp_tree, hf_checksum, tvb, CHECKSUM_OFFSET, CHECKSUM_LENGTH, - checksum, "Checksum: 0x%08x [correct CRC32C]", checksum); + proto_tree_add_uint_format_value(sctp_tree, hf_checksum, tvb, CHECKSUM_OFFSET, CHECKSUM_LENGTH, + checksum, "0x%08x [correct CRC32C]", checksum); else { - item = proto_tree_add_uint_format(sctp_tree, hf_checksum, tvb, CHECKSUM_OFFSET, CHECKSUM_LENGTH, checksum, - "Checksum: 0x%08x [incorrect CRC32C, should be 0x%08x]", + item = proto_tree_add_uint_format_value(sctp_tree, hf_checksum, tvb, CHECKSUM_OFFSET, CHECKSUM_LENGTH, checksum, + "0x%08x [incorrect CRC32C, should be 0x%08x]", checksum, calculated_crc32c); expert_add_info(pinfo, item, &ei_sctp_bad_sctp_checksum); } @@ -4009,17 +4009,17 @@ dissect_sctp_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolea break; case SCTP_CHECKSUM_AUTOMATIC: if ((adler32_correct) && !(crc32c_correct)) - proto_tree_add_uint_format(sctp_tree, hf_checksum, tvb, CHECKSUM_OFFSET, CHECKSUM_LENGTH, - checksum, "Checksum: 0x%08x [correct Adler32]", checksum); + proto_tree_add_uint_format_value(sctp_tree, hf_checksum, tvb, CHECKSUM_OFFSET, CHECKSUM_LENGTH, + checksum, "0x%08x [correct Adler32]", checksum); else if ((!adler32_correct) && (crc32c_correct)) - proto_tree_add_uint_format(sctp_tree, hf_checksum, tvb, CHECKSUM_OFFSET, CHECKSUM_LENGTH, - checksum, "Checksum: 0x%08x [correct CRC32C]", checksum); + proto_tree_add_uint_format_value(sctp_tree, hf_checksum, tvb, CHECKSUM_OFFSET, CHECKSUM_LENGTH, + checksum, "0x%08x [correct CRC32C]", checksum); else if ((adler32_correct) && (crc32c_correct)) - proto_tree_add_uint_format(sctp_tree, hf_checksum, tvb, CHECKSUM_OFFSET, CHECKSUM_LENGTH, - checksum, "Checksum: 0x%08x [correct Adler32 and CRC32C]", checksum); + proto_tree_add_uint_format_value(sctp_tree, hf_checksum, tvb, CHECKSUM_OFFSET, CHECKSUM_LENGTH, + checksum, "0x%08x [correct Adler32 and CRC32C]", checksum); else { - item = proto_tree_add_uint_format(sctp_tree, hf_checksum, tvb, CHECKSUM_OFFSET, CHECKSUM_LENGTH, checksum, - "Checksum: 0x%08x [incorrect, should be 0x%08x (Adler32) or 0x%08x (CRC32C)]", + item = proto_tree_add_uint_format_value(sctp_tree, hf_checksum, tvb, CHECKSUM_OFFSET, CHECKSUM_LENGTH, checksum, + "0x%08x [incorrect, should be 0x%08x (Adler32) or 0x%08x (CRC32C)]", checksum, calculated_adler32, calculated_crc32c); expert_add_info(pinfo, item, &ei_sctp_bad_sctp_checksum); } @@ -4029,8 +4029,8 @@ dissect_sctp_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolea } } else { /* We don't have the whole packet so we can't verify the checksum */ - proto_tree_add_uint_format(sctp_tree, hf_checksum, tvb, CHECKSUM_OFFSET, CHECKSUM_LENGTH, - checksum, "Checksum: 0x%08x [unchecked, not all data available]", checksum); + proto_tree_add_uint_format_value(sctp_tree, hf_checksum, tvb, CHECKSUM_OFFSET, CHECKSUM_LENGTH, + checksum, "0x%08x [unchecked, not all data available]", checksum); } /* add all chunks of the sctp datagram to the protocol tree */ diff --git a/epan/dissectors/packet-selfm.c b/epan/dissectors/packet-selfm.c index 9c3aa54080..b42915d375 100644 --- a/epan/dissectors/packet-selfm.c +++ b/epan/dissectors/packet-selfm.c @@ -1785,7 +1785,7 @@ dissect_fastser_frame(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int o seq_fir = seq & FAST_SER_SEQ_FIR; seq_fin = seq & FAST_SER_SEQ_FIN; - fastser_seq_item = proto_tree_add_uint_format(fastser_tree, hf_selfm_fastser_seq, tvb, offset, 1, seq, "Sequence Byte: 0x%02x (", seq); + fastser_seq_item = proto_tree_add_uint_format_value(fastser_tree, hf_selfm_fastser_seq, tvb, offset, 1, seq, "0x%02x (", seq); if (seq_fir) proto_item_append_text(fastser_seq_item, "FIR, "); if (seq_fin) proto_item_append_text(fastser_seq_item, "FIN, "); proto_item_append_text(fastser_seq_item, "Count %u)", seq_cnt); diff --git a/epan/dissectors/packet-slsk.c b/epan/dissectors/packet-slsk.c index 72ce48ac82..eac8ea8523 100644 --- a/epan/dissectors/packet-slsk.c +++ b/epan/dissectors/packet-slsk.c @@ -2180,8 +2180,7 @@ 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=0; j = tvb_get_letohl(tvb, offset); - proto_tree_add_uint_format(slsk_tree, hf_slsk_number_of_users, tvb, offset, 4, tvb_get_letohl(tvb, offset), - "Number of Users: %d", tvb_get_letohl(tvb, offset)); + proto_tree_add_item(slsk_tree, hf_slsk_number_of_users, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; while (inet_dst, AT_SNA, SNA_FID2_ADDR_LEN, ptr); SET_ADDRESS(&pinfo->dst, AT_SNA, SNA_FID2_ADDR_LEN, ptr); - if (tree) { - /* Byte 3 */ - proto_tree_add_uint_format(tree, hf_sna_th_oaf, tvb, 3, 1, oaf, - "Origin Address Field: 0x%02x", oaf); - } + /* Byte 3 */ + proto_tree_add_item(tree, hf_sna_th_oaf, tvb, 3, 1, ENC_NA); /* Set SRC addr */ ptr = tvb_get_ptr(tvb, 3, SNA_FID2_ADDR_LEN); @@ -1825,17 +1818,16 @@ dissect_fid2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, SET_ADDRESS(&pinfo->src, AT_SNA, SNA_FID2_ADDR_LEN, ptr); id = tvb_get_ntohs(tvb, 4); - if (tree) - proto_tree_add_uint(tree, hf_sna_th_snf, tvb, 4, 2, id); + proto_tree_add_item(tree, hf_sna_th_snf, tvb, 4, 2, ENC_BIG_ENDIAN); if (mpf != MPF_WHOLE_BIU && !sna_defragment) { if (mpf == MPF_FIRST_SEGMENT) { *continue_dissecting = rh_only; - } else { + } else { *continue_dissecting = stop_here; - } + } - } + } else if (sna_defragment) { *rh_tvb_ptr = defragment_by_sequence(pinfo, tvb, bytes_in_header, mpf, id); diff --git a/epan/dissectors/packet-spp.c b/epan/dissectors/packet-spp.c index c2d59d9557..bdb2ce153f 100644 --- a/epan/dissectors/packet-spp.c +++ b/epan/dissectors/packet-spp.c @@ -128,9 +128,9 @@ dissect_spp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) spp_msg_string = spp_conn_ctrl(conn_ctrl); col_append_fstr(pinfo->cinfo, COL_INFO, " %s", spp_msg_string); if (tree) { - ti = proto_tree_add_uint_format(spp_tree, hf_spp_connection_control, tvb, + ti = proto_tree_add_uint_format_value(spp_tree, hf_spp_connection_control, tvb, 0, 1, conn_ctrl, - "Connection Control: %s (0x%02X)", + "%s (0x%02X)", spp_msg_string, conn_ctrl); cc_tree = proto_item_add_subtree(ti, ett_spp_connctrl); proto_tree_add_boolean(cc_tree, hf_spp_connection_control_sys, tvb, diff --git a/epan/dissectors/packet-srp.c b/epan/dissectors/packet-srp.c index b3dd164746..3f3b55afe5 100644 --- a/epan/dissectors/packet-srp.c +++ b/epan/dissectors/packet-srp.c @@ -154,16 +154,16 @@ static void dissect_srp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) calc_crc = crc16_ccitt_tvb(tvb,crc_offset); if( crc == calc_crc ) { - proto_tree_add_uint_format(srp_tree, hf_srp_crc, tvb, + proto_tree_add_uint_format_value(srp_tree, hf_srp_crc, tvb, crc_offset, 2, crc, - "CRC: 0x%04x (correct)", crc); + "0x%04x (correct)", crc); } else { hidden_item = proto_tree_add_boolean(srp_tree, hf_srp_crc_bad, tvb, crc_offset, 2, TRUE); PROTO_ITEM_SET_HIDDEN(hidden_item); - proto_tree_add_uint_format(srp_tree, hf_srp_crc, tvb, + proto_tree_add_uint_format_value(srp_tree, hf_srp_crc, tvb, crc_offset, 2, crc, - "CRC: 0x%04x (incorrect, should be 0x%04x)", + "0x%04x (incorrect, should be 0x%04x)", crc, calc_crc); } diff --git a/epan/dissectors/packet-stun.c b/epan/dissectors/packet-stun.c index c183c9206a..3ab74b2edb 100644 --- a/epan/dissectors/packet-stun.c +++ b/epan/dissectors/packet-stun.c @@ -585,8 +585,8 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboole } } - ti = proto_tree_add_uint_format(stun_tree, hf_stun_type, tvb, 0, 2, - msg_type, "Message Type: 0x%04x (%s %s)", msg_type, msg_method_str, msg_class_str); + ti = proto_tree_add_uint_format_value(stun_tree, hf_stun_type, tvb, 0, 2, + msg_type, "0x%04x (%s %s)", msg_type, msg_method_str, msg_class_str); stun_type_tree = proto_item_add_subtree(ti, ett_stun_type); proto_tree_add_uint(stun_type_tree, hf_stun_type_class, tvb, 0, 2, msg_type); ti = proto_tree_add_text(stun_type_tree, tvb, 0, 2, "%s (%d)", msg_class_str, msg_type_class); @@ -640,10 +640,10 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboole PROTO_ITEM_SET_GENERATED(ti); if ((offset+ATTR_HDR_LEN+att_length) > (STUN_HDR_LEN+msg_length)) { - proto_tree_add_uint_format(att_tree, + proto_tree_add_uint_format_value(att_tree, stun_att_length, tvb, offset+2, 2, att_length, - "Attribute Length: %u (bogus, goes past the end of the message)", + "%u (bogus, goes past the end of the message)", att_length); break; } diff --git a/epan/dissectors/packet-tacacs.c b/epan/dissectors/packet-tacacs.c index a453074472..14babdc45e 100644 --- a/epan/dissectors/packet-tacacs.c +++ b/epan/dissectors/packet-tacacs.c @@ -938,9 +938,9 @@ dissect_tacplus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) PROTO_ITEM_SET_HIDDEN(hidden_item); version = tvb_get_guint8(tvb,0); - proto_tree_add_uint_format(tacplus_tree, hf_tacplus_majvers, tvb, 0, 1, + proto_tree_add_uint_format_value(tacplus_tree, hf_tacplus_majvers, tvb, 0, 1, version, - "Major version: %s", + "%s", (version&0xf0)==0xc0?"TACACS+":"Unknown Version"); proto_tree_add_uint(tacplus_tree, hf_tacplus_minvers, tvb, 0, 1, version&0xf); @@ -949,9 +949,9 @@ dissect_tacplus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_item(tacplus_tree, hf_tacplus_seqno, tvb, 2, 1, ENC_BIG_ENDIAN); flags = tvb_get_guint8(tvb,3); - tf = proto_tree_add_uint_format(tacplus_tree, hf_tacplus_flags, + tf = proto_tree_add_uint_format_value(tacplus_tree, hf_tacplus_flags, tvb, 3, 1, flags, - "Flags: 0x%02x (%s payload, %s)", flags, + "0x%02x (%s payload, %s)", flags, (flags&FLAGS_UNENCRYPTED) ? "Unencrypted" : "Encrypted", (flags&FLAGS_SINGLE) ? "Single connection" : "Multiple Connections" ); flags_tree = proto_item_add_subtree(tf, ett_tacplus_flags); diff --git a/epan/dissectors/packet-tcp.c b/epan/dissectors/packet-tcp.c index b258263bac..56d1d9a44d 100644 --- a/epan/dissectors/packet-tcp.c +++ b/epan/dissectors/packet-tcp.c @@ -4256,7 +4256,7 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_item_append_text(ti, ", Seq: %u", tcph->th_seq); } if(tcp_relative_seq) { - proto_tree_add_uint_format(tcp_tree, hf_tcp_seq, tvb, offset + 4, 4, tcph->th_seq, "Sequence number: %u (relative sequence number)", tcph->th_seq); + proto_tree_add_uint_format_value(tcp_tree, hf_tcp_seq, tvb, offset + 4, 4, tcph->th_seq, "%u (relative sequence number)", tcph->th_seq); } else { proto_tree_add_uint(tcp_tree, hf_tcp_seq, tvb, offset + 4, 4, tcph->th_seq); } @@ -4289,7 +4289,7 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (tcph->th_have_seglen) { if (nxtseq != tcph->th_seq) { if(tcp_relative_seq) { - tf=proto_tree_add_uint_format(tcp_tree, hf_tcp_nxtseq, tvb, offset, 0, nxtseq, "Next sequence number: %u (relative sequence number)", nxtseq); + tf=proto_tree_add_uint_format_value(tcp_tree, hf_tcp_nxtseq, tvb, offset, 0, nxtseq, "%u (relative sequence number)", nxtseq); } else { tf=proto_tree_add_uint(tcp_tree, hf_tcp_nxtseq, tvb, offset, 0, nxtseq); } @@ -4313,8 +4313,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); - tf = proto_tree_add_uint_format(tcp_tree, hf_tcp_flags, tvb, offset + 12, 2, - tcph->th_flags, "Flags: 0x%03x (%s)", tcph->th_flags, wmem_strbuf_get_str(flags_strbuf)); + 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); proto_tree_add_boolean(field_tree, hf_tcp_flags_res, tvb, offset + 12, 1, tcph->th_flags); proto_tree_add_boolean(field_tree, hf_tcp_flags_ns, tvb, offset + 12, 1, tcph->th_flags); @@ -4442,9 +4442,9 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) cksum_vec[3].len = reported_len; computed_cksum = in_cksum(cksum_vec, 4); if (computed_cksum == 0 && th_sum == 0xffff) { - item = proto_tree_add_uint_format(tcp_tree, hf_tcp_checksum, tvb, + item = proto_tree_add_uint_format_value(tcp_tree, hf_tcp_checksum, tvb, offset + 16, 2, th_sum, - "Checksum: 0x%04x [should be 0x0000 (see RFC 1624)]", th_sum); + "0x%04x [should be 0x0000 (see RFC 1624)]", th_sum); checksum_tree = proto_item_add_subtree(item, ett_tcp_checksum); item = proto_tree_add_boolean(checksum_tree, hf_tcp_checksum_good, tvb, @@ -4460,8 +4460,8 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* Checksum is treated as valid on most systems, so we're willing to desegment it. */ desegment_ok = TRUE; } else if (computed_cksum == 0) { - item = proto_tree_add_uint_format(tcp_tree, hf_tcp_checksum, tvb, - offset + 16, 2, th_sum, "Checksum: 0x%04x [correct]", th_sum); + item = proto_tree_add_uint_format_value(tcp_tree, hf_tcp_checksum, tvb, + offset + 16, 2, th_sum, "0x%04x [correct]", th_sum); checksum_tree = proto_item_add_subtree(item, ett_tcp_checksum); item = proto_tree_add_boolean(checksum_tree, hf_tcp_checksum_good, tvb, @@ -4474,9 +4474,9 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* Checksum is valid, so we're willing to desegment it. */ desegment_ok = TRUE; } else { - item = proto_tree_add_uint_format(tcp_tree, hf_tcp_checksum, tvb, + item = proto_tree_add_uint_format_value(tcp_tree, hf_tcp_checksum, tvb, offset + 16, 2, th_sum, - "Checksum: 0x%04x [incorrect, should be 0x%04x (maybe caused by \"TCP checksum offload\"?)]", th_sum, + "0x%04x [incorrect, should be 0x%04x (maybe caused by \"TCP checksum offload\"?)]", th_sum, in_cksum_shouldbe(th_sum, computed_cksum)); checksum_tree = proto_item_add_subtree(item, ett_tcp_checksum); @@ -4495,8 +4495,8 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) pinfo->noreassembly_reason = " [incorrect TCP checksum]"; } } else { - item = proto_tree_add_uint_format(tcp_tree, hf_tcp_checksum, tvb, - offset + 16, 2, th_sum, "Checksum: 0x%04x [validation disabled]", th_sum); + item = proto_tree_add_uint_format_value(tcp_tree, hf_tcp_checksum, tvb, + offset + 16, 2, th_sum, "0x%04x [validation disabled]", th_sum); checksum_tree = proto_item_add_subtree(item, ett_tcp_checksum); item = proto_tree_add_boolean(checksum_tree, hf_tcp_checksum_good, tvb, @@ -4512,8 +4512,8 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } } else { /* We don't have all the packet data, so we can't checksum it... */ - item = proto_tree_add_uint_format(tcp_tree, hf_tcp_checksum, tvb, - offset + 16, 2, th_sum, "Checksum: 0x%04x [unchecked, not all data available]", th_sum); + item = proto_tree_add_uint_format_value(tcp_tree, hf_tcp_checksum, tvb, + offset + 16, 2, th_sum, "0x%04x [unchecked, not all data available]", th_sum); checksum_tree = proto_item_add_subtree(item, ett_tcp_checksum); item = proto_tree_add_boolean(checksum_tree, hf_tcp_checksum_good, tvb, diff --git a/epan/dissectors/packet-trmac.c b/epan/dissectors/packet-trmac.c index a2df352243..737b7f3861 100644 --- a/epan/dissectors/packet-trmac.c +++ b/epan/dissectors/packet-trmac.c @@ -498,8 +498,8 @@ dissect_trmac(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) mac_tree = proto_item_add_subtree(ti, ett_tr_mac); proto_tree_add_uint(mac_tree, hf_trmac_mv, tvb, 3, 1, mv_val); - proto_tree_add_uint_format(mac_tree, hf_trmac_length, tvb, 0, 2, mv_length, - "Total Length: %d bytes", mv_length); + proto_tree_add_uint_format_value(mac_tree, hf_trmac_length, tvb, 0, 2, mv_length, + "%d bytes", mv_length); proto_tree_add_uint(mac_tree, hf_trmac_srcclass, tvb, 2, 1, tvb_get_guint8(tvb, 2) & 0x0f); proto_tree_add_uint(mac_tree, hf_trmac_dstclass, tvb, 2, 1, tvb_get_guint8(tvb, 2) >> 4 ); diff --git a/epan/dissectors/packet-turbocell.c b/epan/dissectors/packet-turbocell.c index 4cef24a7e8..8c5322b36b 100644 --- a/epan/dissectors/packet-turbocell.c +++ b/epan/dissectors/packet-turbocell.c @@ -221,8 +221,7 @@ static void dissect_turbocell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre subframe_tree = proto_item_add_subtree(parent_item, ett_msdu_aggregation_subframe_tree); j++; - proto_tree_add_uint_format(subframe_tree, hf_turbocell_aggregate_msdu_len, next_tvb, msdu_offset, 2, - msdu_length, "MSDU length: %u (0x%04X)", msdu_length,msdu_length); + proto_tree_add_item(subframe_tree, hf_turbocell_aggregate_msdu_len, next_tvb, msdu_offset, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(subframe_tree, hf_turbocell_aggregate_unknown2, next_tvb, msdu_offset+1, 1, ENC_BIG_ENDIAN); msdu_offset += 0x02; diff --git a/epan/dissectors/packet-ua3g.c b/epan/dissectors/packet-ua3g.c index dfb0c4d23e..f0629539d2 100644 --- a/epan/dissectors/packet-ua3g.c +++ b/epan/dissectors/packet-ua3g.c @@ -3214,8 +3214,8 @@ decode_cs_ip_device_routing(proto_tree *tree _U_, tvbuff_t *tvb, break; case 0x20: /* Jitter Depth Distribution */ for (i = 0; i < parameter_length / 4; i+=4) { - proto_tree_add_uint_format(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_jitter_depth_distribution, - tvb, offset+i, 4, tvb_get_ntohl(tvb, offset+i), "Jitter Depth Distribution: +/- %3d ms: %d", + proto_tree_add_uint_format_value(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_jitter_depth_distribution, + tvb, offset+i, 4, tvb_get_ntohl(tvb, offset+i), "+/- %3d ms: %d", ((2 * i/4) + 1) * framing_rtp / 2, tvb_get_ntohl(tvb, offset+i)); } break; diff --git a/epan/dissectors/packet-umts_mac.c b/epan/dissectors/packet-umts_mac.c index 6f77239e26..db066acd36 100644 --- a/epan/dissectors/packet-umts_mac.c +++ b/epan/dissectors/packet-umts_mac.c @@ -720,9 +720,9 @@ static tvbuff_t * add_to_tree(tvbuff_t * tvb, packet_info * pinfo, proto_tree * proto_tree_add_text(tree, new_tvb, 0, -1, "[Reassembled MAC-is SDU]"); while (f) { - proto_tree_add_uint_format(tree, hf_mac_is_fraglink, new_tvb, + proto_tree_add_uint_format_value(tree, hf_mac_is_fraglink, new_tvb, counter, f->length, f->frame_num, - "Frame: %u, payload: %u-%u (%u bytes) (TSN: %u)", + "%u, payload: %u-%u (%u bytes) (TSN: %u)", f->frame_num, counter, counter+f->length-1, f->length, f->tsn); counter += f->length; diff --git a/epan/dissectors/packet-v52.c b/epan/dissectors/packet-v52.c index c72663fd98..8d08c6c484 100644 --- a/epan/dissectors/packet-v52.c +++ b/epan/dissectors/packet-v52.c @@ -132,13 +132,13 @@ dissect_v52_protocol_discriminator(tvbuff_t *tvb, int offset, proto_tree *tree) if (discriminator == 0x48) { - proto_tree_add_uint_format(tree, hf_v52_discriminator, tvb, offset, 1, discriminator, - "Protocol discriminator: V5.2 (0x%02X)", + proto_tree_add_uint_format_value(tree, hf_v52_discriminator, tvb, offset, 1, discriminator, + "V5.2 (0x%02X)", discriminator); } else { - proto_tree_add_uint_format(tree, hf_v52_discriminator, + proto_tree_add_uint_format_value(tree, hf_v52_discriminator, tvb, offset, 1, discriminator, - "Protocol discriminator: Reserved (0x%02X)", + "Reserved (0x%02X)", discriminator); } } diff --git a/epan/dissectors/packet-vj.c b/epan/dissectors/packet-vj.c index ae47e75fd8..5937c077a4 100644 --- a/epan/dissectors/packet-vj.c +++ b/epan/dissectors/packet-vj.c @@ -547,16 +547,16 @@ vjc_process(tvbuff_t *src_tvb, packet_info *pinfo, proto_tree *tree, switch (changes & SPECIALS_MASK) { case SPECIAL_I: - ti = proto_tree_add_uint_format(tree, hf_vj_change_mask, src_tvb, + ti = proto_tree_add_uint_format_value(tree, hf_vj_change_mask, src_tvb, offset, 1, changes, - "Change mask: 0x%02x (echoed interactive traffic)", + "0x%02x (echoed interactive traffic)", changes); break; case SPECIAL_D: - ti = proto_tree_add_uint_format(tree, hf_vj_change_mask, src_tvb, + ti = proto_tree_add_uint_format_value(tree, hf_vj_change_mask, src_tvb, offset, 1, changes, - "Change mask: 0x%02x (unidirectional data)", + "0x%02x (unidirectional data)", changes); break; @@ -564,9 +564,9 @@ vjc_process(tvbuff_t *src_tvb, packet_info *pinfo, proto_tree *tree, /* * XXX - summarize bits? */ - ti = proto_tree_add_uint_format(tree, hf_vj_change_mask, src_tvb, + ti = proto_tree_add_uint_format_value(tree, hf_vj_change_mask, src_tvb, offset, 1, changes, - "Change mask: 0x%02x", changes); + "0x%02x", changes); break; } changes_tree = proto_item_add_subtree(ti, ett_vj_changes); diff --git a/epan/dissectors/packet-windows-common.c b/epan/dissectors/packet-windows-common.c index e985e0b891..2ca22a9ae1 100644 --- a/epan/dissectors/packet-windows-common.c +++ b/epan/dissectors/packet-windows-common.c @@ -2282,8 +2282,8 @@ dissect_nt_v2_ace(tvbuff_t *tvb, int offset, packet_info *pinfo, * BOGUS - the size includes the ACE header length, * which is 4. */ - proto_tree_add_uint_format(tree, hf_nt_ace_size, tvb, offset, 2, - size, "Size: %u (bogus, must be >= 4)", size); + proto_tree_add_uint_format_value(tree, hf_nt_ace_size, tvb, offset, 2, + size, "%u (bogus, must be >= 4)", size); return old_offset; /* our caller quits in this case */ } proto_tree_add_uint(tree, hf_nt_ace_size, tvb, offset, 2, size); diff --git a/epan/dissectors/packet-x25.c b/epan/dissectors/packet-x25.c index 18e474f545..5278d7a384 100644 --- a/epan/dissectors/packet-x25.c +++ b/epan/dissectors/packet-x25.c @@ -1380,8 +1380,8 @@ dissect_x25_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if (x25_tree) { proto_tree_add_uint(x25_tree, hf_x25_lcn, tvb, 0, 2, bytes0_1); - proto_tree_add_uint_format(x25_tree, hf_x25_type, tvb, 2, 1, - X25_CALL_REQUEST, "Packet Type: %s", long_name); + proto_tree_add_uint_format_value(x25_tree, hf_x25_type, tvb, 2, 1, + X25_CALL_REQUEST, "%s", long_name); } localoffset = 3; if (localoffset < x25_pkt_len) { /* calling/called addresses */ @@ -1660,8 +1660,8 @@ dissect_x25_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, col_add_fstr(pinfo->cinfo, COL_INFO, "%s VC:%d", short_name, vc); if (x25_tree) { proto_tree_add_uint(x25_tree, hf_x25_lcn, tvb, 0, 2, bytes0_1); - proto_tree_add_uint_format(x25_tree, hf_x25_type, tvb, 2, 1, - X25_CALL_ACCEPTED, "Packet Type: %s", long_name); + proto_tree_add_uint_format_value(x25_tree, hf_x25_type, tvb, 2, 1, + X25_CALL_ACCEPTED, "%s", long_name); } localoffset = 3; if (localoffset < x25_pkt_len) { /* calling/called addresses */ @@ -1698,8 +1698,8 @@ dissect_x25_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, x25_hash_add_proto_end(vc, pinfo->fd->num); if (x25_tree) { proto_tree_add_uint(x25_tree, hf_x25_lcn, tvb, 0, 2, bytes0_1); - proto_tree_add_uint_format(x25_tree, hf_x25_type, tvb, - localoffset+2, 1, X25_CLEAR_REQUEST, "Packet Type: %s", + proto_tree_add_uint_format_value(x25_tree, hf_x25_type, tvb, + localoffset+2, 1, X25_CLEAR_REQUEST, "%s", long_name); proto_tree_add_text(x25_tree, tvb, 3, 1, "Cause: %s", clear_code(tvb_get_guint8(tvb, 3))); @@ -1779,8 +1779,8 @@ dissect_x25_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, x25_hash_add_proto_end(vc, pinfo->fd->num); if (x25_tree) { proto_tree_add_uint(x25_tree, hf_x25_lcn, tvb, 0, 2, bytes0_1); - proto_tree_add_uint_format(x25_tree, hf_x25_type, tvb, 2, 1, - X25_RESET_REQUEST, "Packet Type: %s", long_name); + proto_tree_add_uint_format_value(x25_tree, hf_x25_type, tvb, 2, 1, + X25_RESET_REQUEST, "%s", long_name); proto_tree_add_text(x25_tree, tvb, 3, 1, "Cause: %s", reset_code(tvb_get_guint8(tvb, 3))); proto_tree_add_text(x25_tree, tvb, 4, 1, @@ -1820,8 +1820,8 @@ dissect_x25_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, restart_code(tvb_get_guint8(tvb, 3)), (int)tvb_get_guint8(tvb, 4)); if (x25_tree) { - proto_tree_add_uint_format(x25_tree, hf_x25_type, tvb, 2, 1, - X25_RESTART_REQUEST, "Packet Type: %s", long_name); + proto_tree_add_uint_format_value(x25_tree, hf_x25_type, tvb, 2, 1, + X25_RESTART_REQUEST, "%s", long_name); proto_tree_add_text(x25_tree, tvb, 3, 1, "Cause: %s", restart_code(tvb_get_guint8(tvb, 3))); proto_tree_add_text(x25_tree, tvb, 4, 1, diff --git a/epan/dissectors/packet-xdmcp.c b/epan/dissectors/packet-xdmcp.c index 7535b614e9..9048315e06 100644 --- a/epan/dissectors/packet-xdmcp.c +++ b/epan/dissectors/packet-xdmcp.c @@ -432,8 +432,8 @@ static int dissect_xdmcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo case XDMCP_ALIVE: { guint8 session_running = tvb_get_guint8(tvb, offset); - proto_tree_add_uint_format(xdmcp_tree, hf_xdmcp_session_running, tvb, - offset, 1, session_running, "Session running: %s", session_running ? "Yes" : "No"); + proto_tree_add_uint_format_value(xdmcp_tree, hf_xdmcp_session_running, tvb, + offset, 1, session_running, "%s", session_running ? "Yes" : "No"); offset++; proto_tree_add_item(xdmcp_tree, hf_xdmcp_session_id, tvb, diff --git a/epan/dissectors/packet-zep.c b/epan/dissectors/packet-zep.c index 770af77754..29041792af 100644 --- a/epan/dissectors/packet-zep.c +++ b/epan/dissectors/packet-zep.c @@ -223,7 +223,7 @@ static void dissect_zep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_uint(zep_tree, hf_zep_seqno, tvb, 17, 4, zep_data.seqno); } } - if (!((zep_data.version==2) && (zep_data.type==ZEP_V2_TYPE_ACK))) proto_tree_add_uint_format(zep_tree, hf_zep_ieee_length, tvb, zep_header_len - 1, 1, ieee_packet_len, "Length: %i %s", ieee_packet_len, (ieee_packet_len==1)?"Byte":"Bytes"); + if (!((zep_data.version==2) && (zep_data.type==ZEP_V2_TYPE_ACK))) proto_tree_add_uint_format_value(zep_tree, hf_zep_ieee_length, tvb, zep_header_len - 1, 1, ieee_packet_len, "%i %s", ieee_packet_len, (ieee_packet_len==1)?"Byte":"Bytes"); } /* Determine which dissector to call next. */ -- cgit v1.2.3