From b7f4e250599d7ea0452711d388c161fd4ef61c60 Mon Sep 17 00:00:00 2001 From: Michael Mann Date: Tue, 13 Dec 2016 14:26:27 -0500 Subject: Adjust proto_tree_add_uint_format_value calls to use unit string Several calls to proto_tree_add_uint_format_value could be better served using BASE_UNIT_STRING with a "unit string" in hf_ field. There also a few cases where proto_tree_add_uint_format_value could just be proto_tree_add_uint. Added a few more "common" unit string values to unit_strings.[ch] Change-Id: Iaedff82c515269c9c31ab9100dff19f5563c932d Reviewed-on: https://code.wireshark.org/review/19242 Petri-Dish: Michael Mann Reviewed-by: Michael Mann --- epan/dissectors/packet-dnp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'epan/dissectors/packet-dnp.c') diff --git a/epan/dissectors/packet-dnp.c b/epan/dissectors/packet-dnp.c index 8b6b078af0..e29a9bef7e 100644 --- a/epan/dissectors/packet-dnp.c +++ b/epan/dissectors/packet-dnp.c @@ -2654,8 +2654,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, case AL_OBJ_TDELAYF: /* Time Delay - Fine (Obj:52, Var:02) */ - al_val_uint16 = tvb_get_letohs(tvb, data_pos); - proto_tree_add_uint_format_value(object_tree, hf_dnp3_al_time_delay, tvb, data_pos, 2, al_val_uint16, "%u ms", al_val_uint16); + proto_tree_add_item(object_tree, hf_dnp3_al_time_delay, tvb, data_pos, 2, ENC_LITTLE_ENDIAN); data_pos += 2; proto_item_set_len(point_item, data_pos - offset); @@ -4541,7 +4540,7 @@ proto_register_dnp3(void) { &hf_dnp3_al_count, { "Count", "dnp3.al.count", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_dnp3_al_on_time, { "On Time", "dnp3.al.on_time", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_dnp3_al_off_time, { "Off Time", "dnp3.al.off_time", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, - { &hf_dnp3_al_time_delay, { "Time Delay", "dnp3.al.time_delay", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_dnp3_al_time_delay, { "Time Delay", "dnp3.al.time_delay", FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_milliseconds, 0x0, NULL, HFILL }}, { &hf_dnp3_al_file_string_offset, { "File String Offset", "dnp3.al.file_string_offset", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_dnp3_al_file_string_length, { "File String Length", "dnp3.al.file_string_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_dnp3_al_file_name, { "File Name", "dnp3.al.file_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, -- cgit v1.2.3