diff options
Diffstat (limited to 'epan/dissectors/packet-cipmotion.c')
-rw-r--r-- | epan/dissectors/packet-cipmotion.c | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/epan/dissectors/packet-cipmotion.c b/epan/dissectors/packet-cipmotion.c index 780f942a29..2bd2d04ff2 100644 --- a/epan/dissectors/packet-cipmotion.c +++ b/epan/dissectors/packet-cipmotion.c @@ -1520,7 +1520,6 @@ static void dissect_var_inst_header(tvbuff_t* tvb, proto_tree* tree, guint32 offset, guint8* inst_number, guint32* cyc_size, guint32* cyc_blk_size, guint32* evnt_size, guint32* servc_size) { - guint8 temp_data; proto_tree *header_tree; /* Create the tree for the entire instance data header */ @@ -1536,34 +1535,26 @@ dissect_var_inst_header(tvbuff_t* tvb, proto_tree* tree, guint32 offset, guint8* * block uses since all blocks should pad up to 32-bits so to convert to bytes each is multiplied by 4 */ /* Read the instance block size field in bytes from the instance data header */ - temp_data = tvb_get_guint8(tvb, offset + 2); - proto_tree_add_uint_format_value(header_tree, hf_var_devce_instance_block_size, - tvb, offset + 2, 1, temp_data, "%d words", temp_data); + proto_tree_add_item(header_tree, hf_var_devce_instance_block_size, tvb, offset + 2, 1, ENC_NA); /* Read the cyclic block size field in bytes from the instance data header */ - temp_data = tvb_get_guint8(tvb, offset + 3); - proto_tree_add_uint_format_value(header_tree, hf_var_devce_cyclic_block_size, - tvb, offset + 3, 1, temp_data, "%d words", temp_data); + proto_tree_add_item(header_tree, hf_var_devce_cyclic_block_size, tvb, offset + 3, 1, ENC_NA); /* Read the cyclic command block size field in bytes from the instance data header */ *cyc_size = (tvb_get_guint8(tvb, offset + 4) * 4); - proto_tree_add_uint_format_value(header_tree, hf_var_devce_cyclic_data_block_size, - tvb, offset + 4, 1, (*cyc_size)/4, "%d words", (*cyc_size)/4); + proto_tree_add_item(header_tree, hf_var_devce_cyclic_data_block_size, tvb, offset + 4, 1, ENC_NA); /* Read the cyclic write block size field in bytes from the instance data header */ *cyc_blk_size = (tvb_get_guint8(tvb, offset + 5) * 4); - proto_tree_add_uint_format_value(header_tree, hf_var_devce_cyclic_rw_block_size, - tvb, offset + 5, 1, (*cyc_blk_size)/4, "%d words", (*cyc_blk_size)/4); + proto_tree_add_item(header_tree, hf_var_devce_cyclic_rw_block_size, tvb, offset + 5, 1, ENC_NA); /* Read the event block size in bytes from the instance data header */ *evnt_size = (tvb_get_guint8(tvb, offset + 6) * 4); - proto_tree_add_uint_format_value(header_tree, hf_var_devce_event_block_size, - tvb, offset + 6, 1, (*evnt_size)/4, "%d words", (*evnt_size)/4); + proto_tree_add_item(header_tree, hf_var_devce_event_block_size, tvb, offset + 6, 1, ENC_NA); /* Read the service block size in bytes from the instance data header */ *servc_size = (tvb_get_guint8(tvb, offset + 7) * 4); - proto_tree_add_uint_format_value(header_tree, hf_var_devce_service_block_size, - tvb, offset + 7, 1, (*servc_size)/4, "%d words", (*servc_size)/4); + proto_tree_add_item(header_tree, hf_var_devce_service_block_size, tvb, offset + 7, 1, ENC_NA); } /* @@ -2675,32 +2666,32 @@ proto_register_cipmotion(void) }, { &hf_var_devce_instance_block_size, { "Instance Block Size", "cipm.var_devce.header.instance_block_size", - FT_UINT8, BASE_DEC, NULL, 0, + FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &units_word_words, 0, "Variable Device Header: Instance Block Size", HFILL} }, { &hf_var_devce_cyclic_block_size, { "Cyclic Block Size", "cipm.var_devce.header.cyclic_block_size", - FT_UINT8, BASE_DEC, NULL, 0, + FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &units_word_words, 0, "Variable Device Header: Cyclic Block Size", HFILL} }, { &hf_var_devce_cyclic_data_block_size, { "Cyclic Data Block Size", "cipm.var_devce.header.cyclic_data_block_size", - FT_UINT8, BASE_DEC, NULL, 0, + FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &units_word_words, 0, "Variable Device Header: Cyclic Data Block Size", HFILL} }, { &hf_var_devce_cyclic_rw_block_size, { "Cyclic Read/Write Block Size", "cipm.var_devce.header.cyclic_rw_block_size", - FT_UINT8, BASE_DEC, NULL, 0, + FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &units_word_words, 0, "Variable Device Header: Cyclic Read/Write Block Size", HFILL} }, { &hf_var_devce_event_block_size, { "Event Block Size", "cipm.var_devce.header.event_block_size", - FT_UINT8, BASE_DEC, NULL, 0, + FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &units_word_words, 0, "Variable Device Header: Event Block Size", HFILL} }, { &hf_var_devce_service_block_size, { "Service Block Size", "cipm.var_devce.header.service_block_size", - FT_UINT8, BASE_DEC, NULL, 0, + FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &units_word_words, 0, "Variable Device Header: Service Block Size", HFILL} }, |