diff options
author | Michael Mann <mmann78@netscape.net> | 2013-09-15 01:48:30 +0000 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2013-09-15 01:48:30 +0000 |
commit | b38ee917b1953104c615056481d6df008ae94b53 (patch) | |
tree | 55024f9c53f083dc056540b6d887fc4550064008 /epan/dissectors/packet-mstp.c | |
parent | a17cf67635c6e190c174bc131707804edca5c8f4 (diff) |
Convert proto_tree_add_uint_format to proto_tree_add_uint_format_value if hf_ field name is the first part of the formatted string. This was 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
Diffstat (limited to 'epan/dissectors/packet-mstp.c')
-rw-r--r-- | epan/dissectors/packet-mstp.c | 16 |
1 files changed, 8 insertions, 8 deletions
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); |