aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-omron-fins.c
diff options
context:
space:
mode:
authorBill Meier <wmeier@newsguy.com>2011-10-15 18:46:26 +0000
committerBill Meier <wmeier@newsguy.com>2011-10-15 18:46:26 +0000
commit126aa8539380e6b0b465b48d30f349b76afdc489 (patch)
tree16b43738b14751d74a8ca8e4de803ba0b6c87196 /epan/dissectors/packet-omron-fins.c
parent4c9bb81ad7b0f609fa236c808a1ab9ef6cab5a79 (diff)
Convert proto_tree_add_item() 'encoding' arg for field types FT_STRING, FT_STRINGZ, FT_UINT_STRING as follows:
1. If there's no character encoding (ENC_ASCII, ...) specified then use ENC_ASCII. 2. For all but FT_UINT_STRING, always use ENC_NA (replacing any existing True/1/FALSE/0 /ENC_BIG_ENDIAN/ENC_LITTLE_ENDIAN). svn path=/trunk/; revision=39426
Diffstat (limited to 'epan/dissectors/packet-omron-fins.c')
-rw-r--r--epan/dissectors/packet-omron-fins.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/epan/dissectors/packet-omron-fins.c b/epan/dissectors/packet-omron-fins.c
index 0a5e667079..f853d207c9 100644
--- a/epan/dissectors/packet-omron-fins.c
+++ b/epan/dissectors/packet-omron-fins.c
@@ -1693,7 +1693,7 @@ dissect_omron_fins(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(command_tree, hf_omron_protect_code, tvb, (offset+2), 1, ENC_BIG_ENDIAN);
proto_tree_add_item(command_tree, hf_omron_begin_word, tvb, (offset+3),4,ENC_BIG_ENDIAN);
proto_tree_add_item(command_tree, hf_omron_last_word, tvb, (offset+7),4,ENC_BIG_ENDIAN);
- proto_tree_add_item(command_tree, hf_omron_password, tvb, (offset+11),4,FALSE);
+ proto_tree_add_item(command_tree, hf_omron_password, tvb, (offset+11),4,ENC_ASCII|ENC_NA);
offset = offset + 15;
}
}
@@ -1854,9 +1854,9 @@ dissect_omron_fins(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if(reported_length_remaining == 94)
{
proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(command_tree, hf_omron_controller_model, tvb, (offset+2), 20, FALSE);
- proto_tree_add_item(command_tree, hf_omron_controller_version, tvb, (offset+22), 20, FALSE);
- proto_tree_add_item(command_tree, hf_omron_for_system_use, tvb, (offset+42), 40, FALSE);
+ proto_tree_add_item(command_tree, hf_omron_controller_model, tvb, (offset+2), 20, ENC_ASCII|ENC_NA);
+ proto_tree_add_item(command_tree, hf_omron_controller_version, tvb, (offset+22), 20, ENC_ASCII|ENC_NA);
+ proto_tree_add_item(command_tree, hf_omron_for_system_use, tvb, (offset+42), 40, ENC_ASCII|ENC_NA);
/* add area data sub tree */
ti = proto_tree_add_text(command_tree, tvb, (offset+82), 12, "Area Data");
area_data_tree = proto_item_add_subtree(ti, ett_area_data);
@@ -1892,7 +1892,7 @@ dissect_omron_fins(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_unit_13, tvb, (offset+28), 2, ENC_BIG_ENDIAN);
proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_unit_14, tvb, (offset+30), 2, ENC_BIG_ENDIAN);
proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_unit_15, tvb, (offset+32), 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_reserved, tvb, (offset+34), 32, FALSE);
+ proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_reserved, tvb, (offset+34), 32, ENC_ASCII|ENC_NA);
/* Remote IO Data tree */
ti = proto_tree_add_text(command_tree, tvb, (offset+66), 2, "Remote I/O data");
io_data_tree = proto_item_add_subtree(ti, ett_io_data);
@@ -1907,9 +1907,9 @@ dissect_omron_fins(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
else if(reported_length_remaining == 161)
{
proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(command_tree, hf_omron_controller_model, tvb, (offset+2), 20, FALSE);
- proto_tree_add_item(command_tree, hf_omron_controller_version, tvb, (offset+22), 20, FALSE);
- proto_tree_add_item(command_tree, hf_omron_for_system_use, tvb, (offset+42), 40, FALSE);
+ proto_tree_add_item(command_tree, hf_omron_controller_model, tvb, (offset+2), 20, ENC_ASCII|ENC_NA);
+ proto_tree_add_item(command_tree, hf_omron_controller_version, tvb, (offset+22), 20, ENC_ASCII|ENC_NA);
+ proto_tree_add_item(command_tree, hf_omron_for_system_use, tvb, (offset+42), 40, ENC_ASCII|ENC_NA);
/* add area data sub tree */
ti = proto_tree_add_text(command_tree, tvb, (offset+82), 12, "Area Data");
area_data_tree = proto_item_add_subtree(ti, ett_area_data);
@@ -1940,7 +1940,7 @@ dissect_omron_fins(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_unit_13, tvb, (offset+120), 2, ENC_BIG_ENDIAN);
proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_unit_14, tvb, (offset+122), 2, ENC_BIG_ENDIAN);
proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_unit_15, tvb, (offset+124), 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_reserved, tvb, (offset+126), 32, FALSE);
+ proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_reserved, tvb, (offset+126), 32, ENC_ASCII|ENC_NA);
/* Remote IO Data tree */
ti = proto_tree_add_text(command_tree, tvb, (offset+158), 2, "Remote I/O data");
io_data_tree = proto_item_add_subtree(ti, ett_io_data);
@@ -1983,7 +1983,7 @@ dissect_omron_fins(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
while(reported_length_remaining >= 21)
{
proto_tree_add_item(command_tree, hf_omron_unit_address, tvb, offset, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(command_tree, hf_omron_model_number, tvb, offset+1, 20, FALSE);
+ proto_tree_add_item(command_tree, hf_omron_model_number, tvb, offset+1, 20, ENC_ASCII|ENC_NA);
offset = offset + 21;
reported_length_remaining = reported_length_remaining - 21;
}
@@ -2014,7 +2014,7 @@ dissect_omron_fins(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ett_message_fields, message_fields, FALSE);
/* Add rest of fields */
proto_tree_add_item(command_tree, hf_omron_fals, tvb, (offset+10), 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(command_tree, hf_omron_error_message, tvb, (offset+12), 16, FALSE);
+ proto_tree_add_item(command_tree, hf_omron_error_message, tvb, (offset+12), 16, ENC_ASCII|ENC_NA);
offset = offset + 28;
}
}
@@ -2452,7 +2452,7 @@ dissect_omron_fins(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(command_tree, hf_omron_fals, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(command_tree, hf_omron_error_message, tvb, (offset+4), 16, FALSE);
+ proto_tree_add_item(command_tree, hf_omron_error_message, tvb, (offset+4), 16, ENC_ASCII|ENC_NA);
offset = offset + 20;
}
else if(reported_length_remaining >= 4)
@@ -2467,7 +2467,7 @@ dissect_omron_fins(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
while (reported_length_remaining >= 32)
{
- proto_tree_add_item(command_tree, hf_omron_read_message, tvb, offset, 32, FALSE);
+ proto_tree_add_item(command_tree, hf_omron_read_message, tvb, offset, 32, ENC_ASCII|ENC_NA);
offset = offset + 32;
reported_length_remaining = reported_length_remaining - 32;
}
@@ -2657,7 +2657,7 @@ dissect_omron_fins(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ti = proto_tree_add_text(command_tree, tvb, (offset+2), 26, "Disk data");
omron_disk_data_tree = proto_item_add_subtree(ti, ett_omron_disk_data);
- proto_tree_add_item(omron_disk_data_tree, hf_omron_volume_label, tvb, (offset+2), 12, FALSE);
+ 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,
@@ -2685,7 +2685,7 @@ dissect_omron_fins(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ti = proto_tree_add_text(command_tree, tvb, offset, 20, "File data");
omron_file_data_tree = proto_item_add_subtree(ti, ett_omron_file_data);
- proto_tree_add_item(omron_file_data_tree, hf_omron_filename, tvb, offset, 12, FALSE);
+ 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,
@@ -2717,7 +2717,7 @@ dissect_omron_fins(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if(reported_length_remaining == 20)
{
proto_tree_add_item(command_tree, hf_omron_disk_no, tvb, offset, 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(command_tree, hf_omron_filename, tvb, (offset+2), 12, FALSE);
+ proto_tree_add_item(command_tree, hf_omron_filename, tvb, (offset+2), 12, ENC_ASCII|ENC_NA);
proto_tree_add_item(command_tree, hf_omron_file_position, tvb, (offset+14), 4, ENC_BIG_ENDIAN);
proto_tree_add_item(command_tree, hf_omron_data_length, tvb, (offset+18), 2, ENC_BIG_ENDIAN);
offset = offset + 20;
@@ -2751,7 +2751,7 @@ dissect_omron_fins(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_tree_add_item(command_tree, hf_omron_disk_no, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(command_tree, hf_omron_file_parameter_code, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(command_tree, hf_omron_filename, tvb, (offset+4), 12, FALSE);
+ proto_tree_add_item(command_tree, hf_omron_filename, tvb, (offset+4), 12, ENC_ASCII|ENC_NA);
proto_tree_add_item(command_tree, hf_omron_file_position, tvb, (offset+16), 4, ENC_BIG_ENDIAN);
proto_tree_add_item(command_tree, hf_omron_data_length, tvb, (offset+20), 2, ENC_BIG_ENDIAN);
if(reported_length_remaining > 22)
@@ -2807,7 +2807,7 @@ dissect_omron_fins(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
while(reported_length_remaining >= 12)
{
- proto_tree_add_item(command_tree, hf_omron_filename, tvb, offset, 12, FALSE);
+ proto_tree_add_item(command_tree, hf_omron_filename, tvb, offset, 12, ENC_ASCII|ENC_NA);
offset = offset + 12;
reported_length_remaining = reported_length_remaining - 12;
}
@@ -2837,7 +2837,7 @@ dissect_omron_fins(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if(reported_length_remaining == 16)
{
- proto_tree_add_item(command_tree, hf_omron_volume_label, tvb, (offset+4), 12, FALSE);
+ proto_tree_add_item(command_tree, hf_omron_volume_label, tvb, (offset+4), 12, ENC_ASCII|ENC_NA);
offset = offset + 12;
}
offset = offset + 4;
@@ -2862,9 +2862,9 @@ dissect_omron_fins(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if(reported_length_remaining == 28)
{
proto_tree_add_item(command_tree, hf_omron_disk_no, tvb, offset, 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(command_tree, hf_omron_filename, tvb, (offset+2), 12, FALSE);
+ proto_tree_add_item(command_tree, hf_omron_filename, tvb, (offset+2), 12, ENC_ASCII|ENC_NA);
proto_tree_add_item(command_tree, hf_omron_disk_no, tvb, (offset+14), 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(command_tree, hf_omron_filename, tvb, (offset+16), 12, FALSE);
+ proto_tree_add_item(command_tree, hf_omron_filename, tvb, (offset+16), 12, ENC_ASCII|ENC_NA);
offset = offset + 28;
}
}
@@ -2887,8 +2887,8 @@ dissect_omron_fins(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if(reported_length_remaining == 26)
{
proto_tree_add_item(command_tree, hf_omron_disk_no, tvb, offset, 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(command_tree, hf_omron_filename, tvb, (offset+2), 12, FALSE);
- proto_tree_add_item(command_tree, hf_omron_filename, tvb, (offset+14), 12, FALSE);
+ proto_tree_add_item(command_tree, hf_omron_filename, tvb, (offset+2), 12, ENC_ASCII|ENC_NA);
+ proto_tree_add_item(command_tree, hf_omron_filename, tvb, (offset+14), 12, ENC_ASCII|ENC_NA);
offset = offset + 26;
}
}
@@ -2911,7 +2911,7 @@ dissect_omron_fins(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if(reported_length_remaining == 14)
{
proto_tree_add_item(command_tree, hf_omron_disk_no, tvb, offset, 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(command_tree, hf_omron_filename, tvb, (offset+2), 12, FALSE);
+ proto_tree_add_item(command_tree, hf_omron_filename, tvb, (offset+2), 12, ENC_ASCII|ENC_NA);
offset = offset + 14;
}
}
@@ -2938,7 +2938,7 @@ dissect_omron_fins(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(command_tree, hf_omron_transfer_beginning_address, tvb, (offset+3), 3, ENC_BIG_ENDIAN);
proto_tree_add_item(command_tree, hf_omron_num_items, tvb, (offset+6), 2, ENC_BIG_ENDIAN);
proto_tree_add_item(command_tree, hf_omron_disk_no, tvb, (offset+8), 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(command_tree, hf_omron_filename, tvb, (offset+10), 12, FALSE);
+ proto_tree_add_item(command_tree, hf_omron_filename, tvb, (offset+10), 12, ENC_ASCII|ENC_NA);
offset = offset + 22;
}
}
@@ -2966,7 +2966,7 @@ dissect_omron_fins(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(command_tree, hf_omron_address, tvb, (offset+4), 2, ENC_BIG_ENDIAN);
proto_tree_add_item(command_tree, hf_omron_num_words, tvb, (offset+6), 2, ENC_BIG_ENDIAN);
proto_tree_add_item(command_tree, hf_omron_disk_no, tvb, (offset+8), 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(command_tree, hf_omron_filename, tvb, (offset+10), 12, FALSE);
+ proto_tree_add_item(command_tree, hf_omron_filename, tvb, (offset+10), 12, ENC_ASCII|ENC_NA);
offset = offset + 22;
}
}
@@ -2994,7 +2994,7 @@ dissect_omron_fins(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(command_tree, hf_omron_begin_word, tvb, (offset+4), 4, ENC_BIG_ENDIAN);
proto_tree_add_item(command_tree, hf_omron_number_of_bytes, tvb, (offset+8), 4, ENC_BIG_ENDIAN);
proto_tree_add_item(command_tree, hf_omron_disk_no, tvb, (offset+12), 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(command_tree, hf_omron_filename, tvb, (offset+14), 12, FALSE);
+ proto_tree_add_item(command_tree, hf_omron_filename, tvb, (offset+14), 12, ENC_ASCII|ENC_NA);
offset = offset + 26;
}
}
@@ -3183,7 +3183,7 @@ dissect_omron_fins(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
if((reported_length_remaining > 0) && (reported_length_remaining <= 8))
{
- proto_tree_add_item(command_tree, hf_omron_name_data, tvb, offset, -1, FALSE);
+ proto_tree_add_item(command_tree, hf_omron_name_data, tvb, offset, -1, ENC_ASCII|ENC_NA);
offset = offset + reported_length_remaining;
}
}
@@ -3223,7 +3223,7 @@ dissect_omron_fins(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if((reported_length_remaining > 2) && (reported_length_remaining <= (2+8)))
{
proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(command_tree, hf_omron_name_data, tvb, offset, -1, FALSE);
+ proto_tree_add_item(command_tree, hf_omron_name_data, tvb, offset, -1, ENC_ASCII|ENC_NA);
offset = offset + reported_length_remaining;
}
}