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-hip.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-hip.c')
-rw-r--r-- | epan/dissectors/packet-hip.c | 20 |
1 files changed, 10 insertions, 10 deletions
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 */ |