Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-omron-fins.c
blob7487e7abd2941977c421a3e25a72cec7f154b56b
1 /* packet-omron-fins.c
2 * Routines for OMRON FINS UDP dissection
3 * Copyright Sourcefire, Inc. 2008-2009, Matthew Watchinski <mwatchinski@sourcefire.com>
5 * Omron FINS/TCP Support
6 * Copyright 2019 Kevin Herron <kevinherron@gmail.com>
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1998 Gerald Combs
12 * Reference for OMRON-FINS W227_E1_02_FINS_Command_Reference_Manual
13 * Hopefully google will find it for you.
15 * Special thanks to the guys who wrote the README.developer: it's great.
17 * SPDX-License-Identifier: GPL-2.0-or-later
21 #include "config.h"
22 #include "packet-tcp.h"
24 #include <epan/packet.h>
25 #include <epan/expert.h>
26 #include <epan/tfs.h>
27 #include <wsutil/array.h>
28 void proto_register_omron_fins(void);
29 void proto_reg_handoff_omron_fins(void);
31 static dissector_handle_t omron_fins_tcp_handle;
32 static dissector_handle_t omron_fins_udp_handle;
34 #define OMRON_FINS_TCP_PORT 9600 /* Not IANA registered */
35 #define OMRON_FINS_UDP_PORT 9600 /* Not IANA registered */
36 #define OMRON_FINS_TCP_MAGIC_BYTES 0x46494e53 /* ASCII 'FINS' */
38 static int proto_omron_fins;
39 static int ett_omron;
40 static int ett_omron_tcp_header;
41 static int ett_omron_header;
42 static int ett_omron_icf_fields;
43 static int ett_omron_command_data;
44 static int ett_area_data;
45 static int ett_cpu_bus;
46 static int ett_io_data;
47 static int ett_pc_status_fields;
48 static int ett_fatal_fields;
49 static int ett_non_fatal_fields;
50 static int ett_message_fields;
51 static int ett_omron_error_log_data;
52 static int ett_omron_disk_data;
53 static int ett_omron_file_data;
54 static int ett_omron_data_type;
55 static int ett_omron_block_record;
56 static int ett_omron_status_block;
57 static int ett_omron_cyclic_fields;
58 static int ett_omron_netw_nodes_sts;
59 static int ett_omron_netw_node_sts;
60 static int ett_omron_netw_nodes_non_fatal_err_sts;
61 static int ett_omron_netw_nodes_cyclic_err_ctrs;
62 static int ett_omron_data_link_status_tree;
64 #if 0
65 static bool gPREF_HEX;
66 #endif
68 /* TCP Header fields */
69 static int hf_omron_tcp_magic;
70 static int hf_omron_tcp_length;
71 static int hf_omron_tcp_command;
72 static int hf_omron_tcp_error_code;
73 static int hf_omron_tcp_client_node_address;
74 static int hf_omron_tcp_server_node_address;
76 /* Omron-FINS Header fields */
77 static int hf_omron_icf;
79 static int hf_omron_icf_gwb; /* Gateway usage (0: don't use; 1: use) should be 1 */
80 static int hf_omron_icf_dtb; /* Data type (0: command 1: response) */
81 static int hf_omron_icf_rb0; /* Reserved should be 0 */
82 static int hf_omron_icf_rb1; /* Reserved should be 0 */
83 static int hf_omron_icf_rb2; /* Reserved should be 0 */
84 static int hf_omron_icf_rb3; /* Reserved should be 0 */
85 static int hf_omron_icf_rb4; /* Reserved should be 0 */
86 static int hf_omron_icf_rsb; /* Response setting (0: response required; 1: response not required) */
88 static int hf_omron_rsv;
89 static int hf_omron_gct;
90 static int hf_omron_dna;
91 static int hf_omron_da1;
92 static int hf_omron_da2;
93 static int hf_omron_sna;
94 static int hf_omron_sa1;
95 static int hf_omron_sa2;
96 static int hf_omron_sid;
98 static int hf_omron_command;
99 static int hf_omron_command_data;
100 static int hf_omron_command_memory_area_code;
101 static int hf_omron_response_code;
103 static int hf_omron_address;
104 static int hf_omron_address_bits;
105 static int hf_omron_num_items;
107 static int hf_omron_response_data;
108 static int hf_omron_parameter_area_code;
110 static int hf_omron_beginning_word;
111 static int hf_omron_num_words;
113 static int hf_omron_program_number;
114 static int hf_omron_protect_code;
115 static int hf_omron_begin_word;
116 static int hf_omron_last_word;
117 static int hf_omron_password;
119 static int hf_omron_clear_code;
120 static int hf_omron_mode_code;
121 static int hf_omron_monitor_label;
123 static int hf_omron_controller_model;
124 static int hf_omron_controller_version;
125 static int hf_omron_for_system_use;
127 static int hf_omron_program_area_size;
128 static int hf_omron_iom_size;
129 static int hf_omron_num_dm_words;
130 static int hf_omron_timer_counter_size;
131 static int hf_omron_expansion_dm_size;
132 static int hf_omron_num_step_transitions;
133 static int hf_omron_kind_memory_card;
134 static int hf_omron_memory_card_size;
136 static int hf_omron_cpu_bus_unit_0;
137 static int hf_omron_cpu_bus_unit_1;
138 static int hf_omron_cpu_bus_unit_2;
139 static int hf_omron_cpu_bus_unit_3;
140 static int hf_omron_cpu_bus_unit_4;
141 static int hf_omron_cpu_bus_unit_5;
142 static int hf_omron_cpu_bus_unit_6;
143 static int hf_omron_cpu_bus_unit_7;
144 static int hf_omron_cpu_bus_unit_8;
145 static int hf_omron_cpu_bus_unit_9;
146 static int hf_omron_cpu_bus_unit_10;
147 static int hf_omron_cpu_bus_unit_11;
148 static int hf_omron_cpu_bus_unit_12;
149 static int hf_omron_cpu_bus_unit_13;
150 static int hf_omron_cpu_bus_unit_14;
151 static int hf_omron_cpu_bus_unit_15;
152 static int hf_omron_cpu_bus_reserved;
154 static int hf_omron_io_data_num_sysmac_1;
155 static int hf_omron_io_data_num_sysmac_2;
157 static int hf_omron_pc_status;
158 static int hf_omron_pc_status_pdc;
159 static int hf_omron_pc_status_hi;
160 static int hf_omron_pc_status_r1;
161 static int hf_omron_pc_status_r2;
162 static int hf_omron_pc_status_rack_num;
164 static int hf_omron_unit_address;
165 static int hf_omron_num_units;
166 static int hf_omron_model_number;
168 static int hf_omron_status;
169 static int hf_omron_fatal_error_data;
170 static int hf_omron_fatal_fals_error;
171 static int hf_omron_fatal_sfc_error;
172 static int hf_omron_fatal_cycle_time_over;
173 static int hf_omron_fatal_program_error;
174 static int hf_omron_fatal_io_setting_error;
175 static int hf_omron_fatal_io_point_overflow;
176 static int hf_omron_fatal_cpu_bus_error;
177 static int hf_omron_fatal_duplication_error;
178 static int hf_omron_fatal_io_bus_error;
179 static int hf_omron_fatal_memory_error;
180 static int hf_omron_fatal_rv_1;
181 static int hf_omron_fatal_rv_2;
182 static int hf_omron_fatal_rv_3;
183 static int hf_omron_fatal_rv_4;
184 static int hf_omron_fatal_rv_5;
185 static int hf_omron_fatal_watch_dog_timer_error;
187 static int hf_omron_non_fatal_error_data;
188 static int hf_omron_non_fatal_rv1;
189 static int hf_omron_non_fatal_rv2;
190 static int hf_omron_non_fatal_power_interruption;
191 static int hf_omron_non_fatal_cpu_bus_unit_setting_error;
192 static int hf_omron_non_fatal_battery_error;
193 static int hf_omron_non_fatal_sysmac_bus_error;
194 static int hf_omron_non_fatal_sysmac_bus2_error;
195 static int hf_omron_non_fatal_cpu_bus_unit_error;
196 static int hf_omron_non_fatal_rv3;
197 static int hf_omron_non_fatal_io_verification_error;
198 static int hf_omron_non_fatal_rv4;
199 static int hf_omron_non_fatal_sfc_error;
200 static int hf_omron_non_fatal_indirect_dm_error;
201 static int hf_omron_non_fatal_jmp_error;
202 static int hf_omron_non_fatal_rv5;
203 static int hf_omron_non_fatal_fal_error;
205 static int hf_omron_message;
206 static int hf_omron_message_no_0;
207 static int hf_omron_message_no_1;
208 static int hf_omron_message_no_2;
209 static int hf_omron_message_no_3;
210 static int hf_omron_message_no_4;
211 static int hf_omron_message_no_5;
212 static int hf_omron_message_no_6;
213 static int hf_omron_message_no_7;
214 static int hf_omron_message_rv_0;
215 static int hf_omron_message_rv_1;
216 static int hf_omron_message_rv_2;
217 static int hf_omron_message_rv_3;
218 static int hf_omron_message_rv_4;
219 static int hf_omron_message_rv_5;
220 static int hf_omron_message_rv_6;
221 static int hf_omron_message_rv_7;
223 static int hf_omron_fals;
224 static int hf_omron_error_message;
226 static int hf_omron_parameter;
227 static int hf_omron_avg_cycle_time;
228 static int hf_omron_max_cycle_time;
229 static int hf_omron_min_cycle_time;
231 static int hf_omron_year;
232 static int hf_omron_month;
233 static int hf_omron_date;
234 static int hf_omron_hour;
235 static int hf_omron_minute;
236 static int hf_omron_second;
237 static int hf_omron_day;
239 static int hf_omron_read_message;
241 static int hf_omron_node_number;
242 static int hf_omron_network_address;
244 static int hf_omron_error_reset_fals_no;
246 static int hf_omron_beginning_record_no;
247 static int hf_omron_no_of_records;
248 static int hf_omron_max_no_of_stored_records;
249 static int hf_omron_no_of_stored_records;
251 static int hf_omron_disk_no;
252 static int hf_omron_beginning_file_position;
253 static int hf_omron_no_of_files;
255 static int hf_omron_volume_label;
256 static int hf_omron_date_year;
257 static int hf_omron_date_month;
258 static int hf_omron_date_day;
259 static int hf_omron_date_hour;
260 static int hf_omron_date_minute;
261 static int hf_omron_date_second;
262 static int hf_omron_total_capacity;
263 static int hf_omron_unused_capacity;
264 static int hf_omron_total_no_files;
265 static int hf_omron_no_files;
266 static int hf_omron_filename;
267 static int hf_omron_file_capacity;
269 static int hf_omron_file_position;
270 static int hf_omron_data_length;
271 static int hf_omron_file_data;
272 static int hf_omron_file_parameter_code;
274 static int hf_omron_volume_parameter_code;
275 static int hf_omron_transfer_parameter_code;
277 static int hf_omron_transfer_beginning_address;
278 static int hf_omron_number_of_bytes;
280 static int hf_omron_number_of_bits_flags;
281 static int hf_omron_set_reset_specification;
282 static int hf_omron_bit_flag;
284 static int hf_omron_data;
286 static int hf_omron_beginning_block_num;
287 static int hf_omron_num_blocks;
288 static int hf_omron_num_blocks_remaining;
289 static int hf_omron_total_num_blocks;
290 static int hf_omron_type;
291 static int hf_omron_data_type;
292 static int hf_omron_data_type_type;
293 static int hf_omron_data_type_rv;
294 static int hf_omron_data_type_protected;
295 static int hf_omron_data_type_end;
296 static int hf_omron_control_data;
298 static int hf_omron_block_num;
299 static int hf_omron_num_unit_uint16;
301 static int hf_omron_fixed;
302 static int hf_omron_intelligent_id_no;
303 static int hf_omron_first_word;
304 static int hf_omron_read_len;
305 static int hf_omron_no_of_link_nodes;
306 static int hf_omron_block_record_node_num_status;
307 static int hf_omron_block_record_node_num_num_nodes;
308 static int hf_omron_block_record_cio_area;
309 static int hf_omron_block_record_kind_of_dm;
310 static int hf_omron_block_record_dm_area_first_word;
311 static int hf_omron_block_record_no_of_total_words;
313 static int hf_omron_status_flags;
314 static int hf_omron_status_flags_slave_master;
315 static int hf_omron_status_flags_data_link;
316 static int hf_omron_master_node_number;
317 static int hf_omron_status_node_0;
318 static int hf_omron_status_node_1;
319 static int hf_omron_status_node_2;
320 static int hf_omron_status_node_3;
321 static int hf_omron_status_node_4;
322 static int hf_omron_status_node_5;
323 static int hf_omron_status_node_6;
324 static int hf_omron_status_node_7;
325 static int hf_omron_status_1_node_0;
326 static int hf_omron_status_1_node_1;
327 static int hf_omron_status_1_node_2;
328 static int hf_omron_status_1_node_3;
329 static int hf_omron_status_1_node_4;
330 static int hf_omron_status_1_node_5;
331 static int hf_omron_status_1_node_6;
332 static int hf_omron_status_1_node_7;
333 static int hf_omron_status_2_node_0;
334 static int hf_omron_status_2_node_1;
335 static int hf_omron_status_2_node_2;
336 static int hf_omron_status_2_node_3;
337 static int hf_omron_status_2_node_4;
338 static int hf_omron_status_2_node_5;
339 static int hf_omron_status_2_node_6;
340 static int hf_omron_status_2_node_7;
342 static int hf_omron_name_data;
344 static int hf_omron_num_receptions;
346 static int hf_omron_netw_node_sts_low_0;
347 static int hf_omron_netw_node_sts_low_1;
348 static int hf_omron_netw_node_sts_low_2;
349 static int hf_omron_netw_node_sts_low_3;
350 static int hf_omron_netw_node_sts_high_0;
351 static int hf_omron_netw_node_sts_high_1;
352 static int hf_omron_netw_node_sts_high_2;
353 static int hf_omron_netw_node_sts_high_3;
354 static int hf_omron_com_cycle_time;
355 static int hf_omron_polling_unit_node_num;
356 static int hf_omron_cyclic_operation;
357 static int hf_omron_cyclic_trans_status;
359 static int hf_omron_cyclic_label_1;
360 static int hf_omron_cyclic_7;
361 static int hf_omron_cyclic_6;
362 static int hf_omron_cyclic_5;
363 static int hf_omron_cyclic_4;
364 static int hf_omron_cyclic_3;
365 static int hf_omron_cyclic_2;
366 static int hf_omron_cyclic_1;
367 static int hf_omron_cyclic_label_2;
368 static int hf_omron_cyclic_15;
369 static int hf_omron_cyclic_14;
370 static int hf_omron_cyclic_13;
371 static int hf_omron_cyclic_12;
372 static int hf_omron_cyclic_11;
373 static int hf_omron_cyclic_10;
374 static int hf_omron_cyclic_9;
375 static int hf_omron_cyclic_8;
376 static int hf_omron_cyclic_label_3;
377 static int hf_omron_cyclic_23;
378 static int hf_omron_cyclic_22;
379 static int hf_omron_cyclic_21;
380 static int hf_omron_cyclic_20;
381 static int hf_omron_cyclic_19;
382 static int hf_omron_cyclic_18;
383 static int hf_omron_cyclic_17;
384 static int hf_omron_cyclic_16;
385 static int hf_omron_cyclic_label_4;
386 static int hf_omron_cyclic_31;
387 static int hf_omron_cyclic_30;
388 static int hf_omron_cyclic_29;
389 static int hf_omron_cyclic_28;
390 static int hf_omron_cyclic_27;
391 static int hf_omron_cyclic_26;
392 static int hf_omron_cyclic_25;
393 static int hf_omron_cyclic_24;
394 static int hf_omron_cyclic_label_5;
395 static int hf_omron_cyclic_39;
396 static int hf_omron_cyclic_38;
397 static int hf_omron_cyclic_37;
398 static int hf_omron_cyclic_36;
399 static int hf_omron_cyclic_35;
400 static int hf_omron_cyclic_34;
401 static int hf_omron_cyclic_33;
402 static int hf_omron_cyclic_32;
403 static int hf_omron_cyclic_label_6;
404 static int hf_omron_cyclic_47;
405 static int hf_omron_cyclic_46;
406 static int hf_omron_cyclic_45;
407 static int hf_omron_cyclic_44;
408 static int hf_omron_cyclic_43;
409 static int hf_omron_cyclic_42;
410 static int hf_omron_cyclic_41;
411 static int hf_omron_cyclic_40;
412 static int hf_omron_cyclic_label_7;
413 static int hf_omron_cyclic_55;
414 static int hf_omron_cyclic_54;
415 static int hf_omron_cyclic_53;
416 static int hf_omron_cyclic_52;
417 static int hf_omron_cyclic_51;
418 static int hf_omron_cyclic_50;
419 static int hf_omron_cyclic_49;
420 static int hf_omron_cyclic_48;
421 static int hf_omron_cyclic_label_8;
422 static int hf_omron_cyclic_62;
423 static int hf_omron_cyclic_61;
424 static int hf_omron_cyclic_60;
425 static int hf_omron_cyclic_59;
426 static int hf_omron_cyclic_58;
427 static int hf_omron_cyclic_57;
428 static int hf_omron_cyclic_56;
429 static int hf_omron_node_error_count;
431 static expert_field ei_omron_command_code;
432 static expert_field ei_omron_bad_length;
433 static expert_field ei_oomron_command_memory_area_code;
436 /* Defines */
437 #define TCP_CMD_NODE_ADDRESS_DATA_SEND_CLIENT 0x00
438 #define TCP_CMD_NODE_ADDRESS_DATA_SEND_SERVER 0x01
439 #define TCP_CMD_FRAME_SEND 0x02
440 #define TCP_CMD_FRAME_SEND_ERROR_NOTIFICATION 0x03
441 #define TCP_CMD_CONNECTION_CONFIRMATION 0x06
443 #define ICF_GW_MASK 0x80
444 #define ICF_GW_DUSE 0x00
445 #define ICF_GW_USE 0x01
447 #define ICF_DTB_MASK 0x40
448 #define ICF_DTB_CMD 0x00
449 #define ICF_DTB_RESP 0x01
451 #define ICF_RB0_MASK 0x20
452 #define ICF_RB1_MASK 0x10
453 #define ICF_RB2_MASK 0x08
454 #define ICF_RB3_MASK 0x04
455 #define ICF_RB4_MASK 0x02
457 #define ICF_RSB_MASK 0x01
458 #define ICF_RSB_DUSE 0x00
459 #define ICF_RSB_USE 0x01
461 #define INT_DNA_MIN1 0x00
462 #define INT_DNA_MAX1 0x00
463 #define INT_DNA_MIN2 0x01
464 #define INT_DNA_MAX2 0x7F
466 #define INT_DA1_MIN1 0x00
467 #define INT_DA1_MAX1 0x3E
468 #define INT_DA1_MIN2 0x3F
469 #define INT_DA1_MAX2 0x7E
470 #define INT_DA1_MIN3 0xFF
471 #define INT_DA1_MAX3 0xFF
473 #define INT_DA2_MIN1 0x00
474 #define INT_DA2_MAX1 0x00
475 #define INT_DA2_MIN2 0xFE
476 #define INT_DA2_MAX2 0xFE
477 #define INT_DA2_MIN3 0x10
478 #define INT_DA2_MAX3 0x1F
480 #define INT_SNA_MIN1 0x00
481 #define INT_SNA_MAX1 0x00
482 #define INT_SNA_MIN2 0x01
483 #define INT_SNA_MAX2 0x7F
485 #define INT_SA1_MIN1 0x00
486 #define INT_SA1_MAX1 0x3E
487 #define INT_SA1_MIN2 0x3F
488 #define INT_SA1_MAX2 0x7E
489 #define INT_SA1_MIN3 0xFF
490 #define INT_SA1_MAX3 0xFF
492 #define INT_SA2_MIN1 0x00
493 #define INT_SA2_MAX1 0x00
494 #define INT_SA2_MIN2 0xFE
495 #define INT_SA2_MAX2 0xFE
496 #define INT_SA2_MIN3 0x10
497 #define INT_SA2_MAX3 0x1F
500 /* Constants used for display */
501 static const value_string icf_gw_vals[] = {
502 { ICF_GW_DUSE, "Don't use Gateway" },
503 { ICF_GW_USE, "Use Gateway" },
504 { 0, NULL } };
506 static const value_string icf_dtb_vals[] = {
507 { ICF_DTB_CMD, "Command" },
508 { ICF_DTB_RESP, "Response" },
509 { 0, NULL } };
511 static const value_string icf_rsb_vals[] = {
512 { ICF_RSB_DUSE, "Response Required" },
513 { ICF_RSB_USE, "Response Not Required" },
514 { 0, NULL } };
516 static const range_string omron_dna_range[] = {
517 { INT_DNA_MIN1, INT_DNA_MAX1, "Local network" },
518 { INT_DNA_MIN2, INT_DNA_MAX2, "Remote network" },
519 { 0, 0, NULL } };
521 static const range_string omron_da1_range[] = {
522 { INT_DA1_MIN1, INT_DA1_MAX1, "SYSMAC NET / LINK" },
523 { INT_DA1_MIN2, INT_DA1_MAX2, "SYSMAC NET" },
524 { INT_DA1_MIN3, INT_DA1_MAX3, "Broadcast" },
525 { 0, 0, NULL } };
527 static const range_string omron_da2_range[] = {
528 { INT_DA2_MIN1, INT_DA2_MAX1, "PC (CPU)" },
529 { INT_DA2_MIN2, INT_DA2_MAX2, "SYSMAC NET or LINK Unit connected to network" },
530 { INT_DA2_MIN3, INT_DA2_MAX3, "CPU BUS Unit" },
531 { 0, 0, NULL } };
533 static const range_string omron_sna_range[] = {
534 { INT_SNA_MIN1, INT_SNA_MAX1, "Local network" },
535 { INT_SNA_MIN2, INT_SNA_MAX2, "Remote network" },
536 { 0, 0, NULL } };
538 static const range_string omron_sa1_range[] = {
539 { INT_SA1_MIN1, INT_SA1_MAX1, "SYSMAC NET / LINK" },
540 { INT_SA1_MIN2, INT_SA1_MAX2, "SYSMAC NET" },
541 { INT_SA1_MIN3, INT_SA1_MAX3, "Broadcast" },
542 { 0, 0, NULL } };
544 static const range_string omron_sa2_range[] = {
545 { INT_SA2_MIN1, INT_SA2_MAX1, "PC (CPU)" },
546 { INT_SA2_MIN2, INT_SA2_MAX2, "SYSMAC NET or LINK Unit connected to network" },
547 { INT_SA2_MIN3, INT_SA2_MAX3, "CPU BUS Unit" },
548 { 0, 0, NULL } };
550 static const range_string omron_error_reset_range[] = {
551 { 0xFFFE, 0xFFFE, "Present error cleared" },
552 { 0x0002, 0x0002, "Power interruption error" },
553 { 0x00A0, 0x00A7, "SYSMAC BUS error" },
554 { 0x00B0, 0x00B3, "SYSMAC BUS/2 error" },
555 { 0x00E7, 0x00E7, "I/O verification error" },
556 { 0x00F4, 0x00F4, "Non-fatal SFC error" },
557 { 0x00F7, 0x00F7, "Batter error" },
558 { 0x00F8, 0x00F8, "Indirect DM error" },
559 { 0x00F9, 0x00F9, "JMP error" },
560 { 0x0200, 0x0215, "CPU Bus Unit error" },
561 { 0x0400, 0x0415, "CPU Bus Unit setting error" },
562 { 0x4101, 0x42FF, "FALL (006) executed in user program" },
563 { 0xFFFF, 0xFFFF, "All errors cleared" },
564 { 0x809F, 0x809F, "Cycle time too long" },
565 { 0x80C0, 0x80C7, "I/O bus error" },
566 { 0x80E0, 0x80E0, "I/O setting error" },
567 { 0x80E1, 0x80E1, "I/O points overflow" },
568 { 0x80E9, 0x80E9, "Duplication error" },
569 { 0x80F0, 0x80F0, "Program error" },
570 { 0x80F1, 0x80F1, "Memory error" },
571 { 0x80F3, 0x80F3, "Fatal SFC error" },
572 { 0x80FF, 0x80FF, "System error" },
573 { 0x8100, 0x8115, "CPU bus error" },
574 { 0xC101, 0xC2FF, "FALS(007) executed" },
575 { 0,0, NULL }
578 static const value_string tcp_command_cv[] = {
579 { TCP_CMD_NODE_ADDRESS_DATA_SEND_CLIENT, "Node Address Data Send (Client to Server)" },
580 { TCP_CMD_NODE_ADDRESS_DATA_SEND_SERVER, "Node Address Data Send (Server to Client)" },
581 { TCP_CMD_FRAME_SEND, "Frame Send" },
582 { TCP_CMD_FRAME_SEND_ERROR_NOTIFICATION, "Frame Send Error Notification" },
583 { TCP_CMD_CONNECTION_CONFIRMATION, "Connection Confirmation" },
584 { 0, NULL }
587 static const value_string tcp_error_code_cv[] = {
588 { 0x00000000, "Normal" },
589 { 0x00000001, "The header is not 'FINS' (ASCII code)" },
590 { 0x00000002, "The data length is too long" },
591 { 0x00000003, "The command is not supported" },
592 { 0x00000020, "All connections are in use" },
593 { 0x00000021, "The specified node is already connected" },
594 { 0x00000022, "Attempt to access a protected node from an unspecified IP address" },
595 { 0x00000023, "The client FINS node address is out of range" },
596 { 0x00000024, "The same FINS node address is being used by the client and server" },
597 { 0x00000025, "All the node addresses available for allocation have been used" },
598 { 0, NULL }
601 static const value_string command_code_cv[] = {
602 { 0x0101, "Memory Area Read" },
603 { 0x0102, "Memory Area Write" },
604 { 0x0103, "Memory Area Fill" },
605 { 0x0104, "Multiple Memory Area Read" },
606 { 0x0105, "Memory Area Transfer" },
607 { 0x0201, "Parameter Area Read" },
608 { 0x0202, "Parameter Area Write" },
609 { 0x0203, "Parameter Area Clear" },
610 { 0x0220, "Data Link Table Read" },
611 { 0x0221, "Data Link Table Write" },
612 { 0x0304, "Program Area Protect" },
613 { 0x0305, "Program Area Protect Clear" },
614 { 0x0306, "Program Area Read" },
615 { 0x0307, "Program Area Write" },
616 { 0x0308, "Program Area Clear" },
617 { 0x0401, "Run" },
618 { 0x0402, "Stop" },
619 { 0x0403, "Reset" },
620 { 0x0501, "Controller Data Read" },
621 { 0x0502, "Connection Data Read" },
622 { 0x0601, "Controller Status Read" },
623 { 0x0602, "Network Status Read" },
624 { 0x0603, "Data Link Status Read" },
625 { 0x0620, "Cycle Time Read" },
626 { 0x0701, "Clock Read" },
627 { 0x0702, "Clock Write" },
628 { 0x0801, "LOOP-BACK Test" },
629 { 0x0802, "Broadcast Test Results Read" },
630 { 0x0803, "Broadcast Test Data Send" },
631 { 0x0920, "Message Read | Message Clear | FAL/FALS Read" },
632 { 0x0C01, "Access Right Acquire" },
633 { 0x0C02, "Access Right Forced Acquire" },
634 { 0x0C03, "Access Right Release" },
635 { 0x2101, "Error Clear" },
636 { 0x2102, "Error Log Read" },
637 { 0x2103, "Error Log Clear" },
638 { 0x2201, "File Name Read" },
639 { 0x2202, "Single File Read" },
640 { 0x2203, "Single File Write" },
641 { 0x2204, "Memory Card Format" },
642 { 0x2205, "File Delete" },
643 { 0x2206, "Volume Label Create/Delete" },
644 { 0x2207, "File Copy" },
645 { 0x2208, "File Name Change" },
646 { 0x2209, "File Data Check" },
647 { 0x220A, "Memory Area File Transfer" },
648 { 0x220B, "Parameter Area File Transfer" },
649 { 0x220C, "Program Area File Transfer" },
650 { 0x220F, "File Memory Index Read" },
651 { 0x2210, "File Memory Read" },
652 { 0x2211, "File Memory Write" },
653 { 0x2301, "Forced Set/Reset" },
654 { 0x2302, "Forced Set/Reset Cancel" },
655 { 0x230A, "Multiple Forced Status Read" },
656 { 0x2601, "Name Set" },
657 { 0x2602, "Name Delete" },
658 { 0x2603, "Name Read" },
659 { 0, NULL } };
661 static const value_string memory_area_code_cv[] = {
662 { 0x00, "CIO, TR, CPU Bus Link, and Auxiliary : Bit status" },
663 { 0x40, "CIO, TR, CPU Bus Link, and Auxiliary : Bit status (with forced status)" },
664 { 0x80, "CIO, TR, CPU Bus Link, and Auxiliary : Word contents" },
665 { 0xC0, "CIO, TR, CPU Bus Link, and Auxiliary : Word contents (with forced status)" },
666 { 0x01, "Timer/Counter : Completion Flag status" },
667 { 0x41, "Timer/Counter : Completion Flag status (with forced status)" },
668 { 0x81, "Timer/Counter : PV" },
669 { 0x82, "DM : Word contents" },
670 { 0x03, "Transition : Flag status" },
671 { 0x43, "Transition : Flag status (with forced status)" },
672 { 0x04, "Step : Flag status" },
673 { 0x44, "Step : Status" },
674 { 0x84, "Step : Step timer PV" },
675 { 0x05, "Forced status : Bit status" },
676 { 0x85, "Forced status : Word contents" },
677 { 0x90, "Expansion DM : Word contents, bank E0" },
678 { 0x91, "Expansion DM : Word contents, bank E1" },
679 { 0x92, "Expansion DM : Word contents, bank E2" },
680 { 0x93, "Expansion DM : Word contents, bank E3" },
681 { 0x94, "Expansion DM : Word contents, bank E4" },
682 { 0x95, "Expansion DM : Word contents, bank E5" },
683 { 0x96, "Expansion DM : Word contents, bank E6" },
684 { 0x97, "Expansion DM : Word contents, bank E7" },
685 { 0x98, "Expansion DM : Word contents, current bank" },
686 { 0x9C, "Register : Register contents / Current bank no. of expansion DM" },
687 { 0x1B, "Action : Flag status" },
688 { 0xDD, "Interrupt status : Scheduled interrupt interval" },
689 { 0x30, "CS1 mode: CIO Area : Bit status" },
690 { 0x31, "CS1 mode: Work Area : Bit status" },
691 { 0x32, "CS1 mode: Holding Bit Area : Bit status" },
692 { 0x33, "CS1 mode: Auxiliary Area : Bit status" },
693 { 0x70, "CS1 mode: CIO Area : Bit status (with forced status)" },
694 { 0x71, "CS1 mode: Work Area : Bit status (with forced status)" },
695 { 0x72, "CS1 mode: Holding Bit Area : Bit status (with forced status)" },
696 { 0xB0, "CS1 mode: CIO Area : Word contents" },
697 { 0xB1, "CS1 mode: Work Area : Word contents" },
698 { 0xB2, "CS1 mode: Holding Bit Area : Word contents" },
699 { 0xB3, "CS1 mode: Auxiliary Bit Area : Word contents" },
700 { 0xF0, "CS1 mode: CIO Area : Word contents (with forced status)" },
701 { 0xF1, "CS1 mode: Work Area : Word contents (with forced status)" },
702 { 0xF2, "CS1 mode: Holding Bit Area : Word contents (with forced status)" },
703 { 0x09, "CS1 mode: Timer/Counter : Completion Flag status" },
704 { 0x49, "CS1 mode: Timer/Counter : Completion Flag status (with forced status)" },
705 { 0x89, "CS1 mode: Timer/Counter : PV" },
706 { 0x02, "CS1 mode: DM : Bit contents" },
707 { 0x20, "CS1 mode: Expansion DM : Bit contents, bank E0" },
708 { 0x21, "CS1 mode: Expansion DM : Bit contents, bank E1" },
709 { 0x22, "CS1 mode: Expansion DM : Bit contents, bank E2" },
710 { 0x23, "CS1 mode: Expansion DM : Bit contents, bank E3" },
711 { 0x24, "CS1 mode: Expansion DM : Bit contents, bank E4" },
712 { 0x25, "CS1 mode: Expansion DM : Bit contents, bank E5" },
713 { 0x26, "CS1 mode: Expansion DM : Bit contents, bank E6" },
714 { 0x27, "CS1 mode: Expansion DM : Bit contents, bank E7" },
715 { 0x28, "CS1 mode: Expansion DM : Bit contents, bank E8" },
716 { 0x29, "CS1 mode: Expansion DM : Bit contents, bank E9" },
717 { 0x2A, "CS1 mode: Expansion DM : Bit contents, bank EA" },
718 { 0x2B, "CS1 mode: Expansion DM : Bit contents, bank EB" },
719 { 0x2C, "CS1 mode: Expansion DM : Bit contents, bank EC" },
720 { 0xA0, "CS1 mode: Expansion DM : Word contents, bank E0" },
721 { 0xA1, "CS1 mode: Expansion DM : Word contents, bank E1" },
722 { 0xA2, "CS1 mode: Expansion DM : Word contents, bank E2" },
723 { 0xA3, "CS1 mode: Expansion DM : Word contents, bank E3" },
724 { 0xA4, "CS1 mode: Expansion DM : Word contents, bank E4" },
725 { 0xA5, "CS1 mode: Expansion DM : Word contents, bank E5" },
726 { 0xA6, "CS1 mode: Expansion DM : Word contents, bank E6" },
727 { 0xA7, "CS1 mode: Expansion DM : Word contents, bank E7" },
728 { 0xA8, "CS1 mode: Expansion DM : Word contents, bank E8" },
729 { 0xA9, "CS1 mode: Expansion DM : Word contents, bank E9" },
730 { 0xAA, "CS1 mode: Expansion DM : Word contents, bank EA" },
731 { 0xAB, "CS1 mode: Expansion DM : Word contents, bank EB" },
732 { 0xAC, "CS1 mode: Expansion DM : Word contents, bank EC" },
733 { 0xBC, "CS1 mode: Register : Register contents / Current bank no. of expansion DM" },
734 { 0x06, "CS1 mode: Task flag : Bit contents" },
735 { 0x46, "CS1 mode: Task flag : Status" },
736 { 0xDC, "CS1 mode: Index register : Register contents" },
737 { 0x07, "CS1 mode: Clock pulses / Condition flags : Bit contents" },
738 { 0, NULL } };
740 static const value_string memory_area_code_prefix[] = {
741 { 0x82, "D" },
742 { 0x90, "E0_" },
743 { 0x91, "E1_" },
744 { 0x92, "E2_" },
745 { 0x93, "E3_" },
746 { 0x94, "E4_" },
747 { 0x95, "E5_" },
748 { 0x96, "E6_" },
749 { 0x97, "E7_" },
750 { 0x30, "CIO" },
751 { 0x31, "W" },
752 { 0x32, "H" },
753 { 0x33, "A" },
754 { 0x70, "CIO" },
755 { 0x71, "W" },
756 { 0x72, "H" },
757 { 0xB0, "CIO" },
758 { 0xB1, "W" },
759 { 0xB2, "H" },
760 { 0xB3, "A" },
761 { 0xF0, "CIO" },
762 { 0xF1, "W" },
763 { 0xF2, "H" },
764 { 0x02, "D" },
765 { 0x20, "E0_" },
766 { 0x21, "E1_" },
767 { 0x22, "E2_" },
768 { 0x23, "E3_" },
769 { 0x24, "E4_" },
770 { 0x25, "E5_" },
771 { 0x26, "E6_" },
772 { 0x27, "E7_" },
773 { 0x28, "E8_" },
774 { 0x29, "E9_" },
775 { 0x2A, "EA_" },
776 { 0x2B, "EB_" },
777 { 0x2C, "EC_" },
778 { 0xA0, "E0_" },
779 { 0xA1, "E1_" },
780 { 0xA2, "E2_" },
781 { 0xA3, "E3_" },
782 { 0xA4, "E4_" },
783 { 0xA5, "E5_" },
784 { 0xA6, "E6_" },
785 { 0xA7, "E7_" },
786 { 0xA8, "E8_" },
787 { 0xA9, "E9_" },
788 { 0xAA, "EA_" },
789 { 0xAB, "EB_" },
790 { 0xAC, "EC_" },
791 { 0, NULL } };
793 static const value_string response_codes[] = {
794 { 0x0000, "Normal completion" },
795 { 0x0001, "Service was interrupted" },
796 { 0x0101, "Local node not part of Network" },
797 { 0x0102, "Token time-out, node number to large" },
798 { 0x0103, "Number of transmit retries exceeded" },
799 { 0x0104, "Maximum number of frames exceeded" },
800 { 0x0105, "Node number setting error (range)" },
801 { 0x0106, "Node number duplication error" },
802 { 0x0201, "Destination node not part of Network" },
803 { 0x0202, "No node with the specified node number" },
804 { 0x0203, "Third node not part of Network : Broadcasting was specified" },
805 { 0x0204, "Busy error, destination node busy" },
806 { 0x0205, "Response time-out" },
807 { 0x0301, "Error occurred : ERC indicator is lit" },
808 { 0x0302, "CPU error occurred in the PC at the destination node" },
809 { 0x0303, "A controller error has prevented a normal response" },
810 { 0x0304, "Node number setting error" },
811 { 0x0401, "An undefined command has been used" },
812 { 0x0402, "Cannot process command because the specified unit model or version is wrong" },
813 { 0x0501, "Destination node number is not set in the routing table" },
814 { 0x0502, "Routing table isn't registered" },
815 { 0x0503, "Routing table error" },
816 { 0x0504, "Max relay nodes (2) was exceeded" },
817 { 0x1001, "The command is longer than the max permissible length" },
818 { 0x1002, "The command is shorter than the min permissible length" },
819 { 0x1003, "The designated number of data items differs from the actual number" },
820 { 0x1004, "An incorrect command format has been used" },
821 { 0x1005, "An incorrect header has been used" },
822 { 0x1101, "Memory area code invalid or DM is not available" },
823 { 0x1102, "Access size is wrong in command" },
824 { 0x1103, "First address in inaccessible area" },
825 { 0x1104, "The end of specified word range exceeds acceptable range" },
826 { 0x1106, "A non-existent program number" },
827 { 0x1109, "The size of data items in command block are wrong" },
828 { 0x110A, "The IOM break function cannot be executed" },
829 { 0x110B, "The response block is longer than the max length" },
830 { 0x110C, "An incorrect parameter code has been specified" },
831 { 0x2002, "The data is protected" },
832 { 0x2003, "Registered table does not exist" },
833 { 0x2004, "Search data does not exist" },
834 { 0x2005, "Non-existent program number" },
835 { 0x2006, "Non-existent file" },
836 { 0x2007, "Verification error" },
837 { 0x2101, "Specified area is read-only" },
838 { 0x2102, "The data is protected" },
839 { 0x2103, "Too many files open" },
840 { 0x2105, "Non-existent program number" },
841 { 0x2106, "Non-existent file" },
842 { 0x2107, "File already exists" },
843 { 0x2108, "Data cannot be changed" },
844 { 0x2201, "The mode is wrong (executing)" },
845 { 0x2202, "The mode is wrong (stopped)" },
846 { 0x2203, "The PC is in the PROGRAM mode" },
847 { 0x2204, "The PC is in the DEBUG mode" },
848 { 0x2205, "The PC is in the MONITOR mode" },
849 { 0x2206, "The PC is in the RUN mode" },
850 { 0x2207, "The specified node is not the control node" },
851 { 0x2208, "The mode is wrong and the step cannot be executed" },
852 { 0x2301, "The file device does not exist where specified" },
853 { 0x2302, "The specified memory does not exist" },
854 { 0x2303, "No clock exists" },
855 { 0x2401, "Data link table is incorrect" },
856 { 0x2502, "Parity / checksum error occurred" },
857 { 0x2503, "I/O setting error" },
858 { 0x2504, "Too many I/O points" },
859 { 0x2505, "CPU bus error" },
860 { 0x2506, "I/O duplication error" },
861 { 0x2507, "I/O bus error" },
862 { 0x2509, "SYSMAC BUS/2 error" },
863 { 0x250A, "Special I/O Unit error" },
864 { 0x250D, "Duplication in SYSMAC BUS word allocation" },
865 { 0x250F, "A memory error has occurred" },
866 { 0x2510, "Terminator not connected in SYSMAC BUS system" },
867 { 0x2601, "The specified area is not protected" },
868 { 0x2602, "An incorrect password has been specified" },
869 { 0x2604, "The specified area is protected" },
870 { 0x2605, "The service is being executed" },
871 { 0x2606, "The service is not being executed" },
872 { 0x2607, "Service cannot be execute from local node" },
873 { 0x2608, "Service cannot be executed settings are incorrect" },
874 { 0x2609, "Service cannot be executed incorrect settings in command data" },
875 { 0x260A, "The specified action has already been registered" },
876 { 0x260B, "Cannot clear error, error still exists" },
877 { 0x3001, "The access right is held by another device" },
878 { 0x4001, "Command aborted with ABORT command" },
879 { 0, NULL } };
881 static const value_string parameter_area_codes[] = {
882 { 0x8010, "PC Setup" },
883 { 0x8011, "Peripheral Device settings" },
884 { 0x8012, "I/O table" },
885 { 0x8013, "Routing tables" },
886 { 0x8002, "CPU Bus Unit settings" },
887 { 0, NULL } };
889 static const value_string mode_codes[] = {
890 { 0x00, "PROGRAM mode" },
891 { 0x01, "DEBUG mode" },
892 { 0x02, "MONITOR mode" },
893 { 0x04, "RUN mode" },
894 { 0, NULL } };
896 static const value_string status_codes[] = {
897 { 0x00, "Stop" },
898 { 0x01, "Run" },
899 { 0x80, "CPU on standby" },
900 { 0, NULL } };
902 static const value_string memory_card_codes[] = {
903 { 0x00, "No memory card" },
904 { 0x01, "SPRAM" },
905 { 0x02, "EPROM" },
906 { 0x03, "EEPROM" },
907 { 0, NULL } };
909 static const value_string parameter_codes[] = {
910 { 0x00, "Initializes the cycle time." },
911 { 0x01, "Read the cycle time" },
912 { 0, NULL } };
914 static const value_string omron_days[] = {
915 { 0x00, "Sun" },
916 { 0x01, "Mon" },
917 { 0x02, "Tues" },
918 { 0x03, "Wed" },
919 { 0x04, "Thur" },
920 { 0x05, "Fri" },
921 { 0x06, "Sat" },
922 { 0, NULL } };
924 static const value_string omron_file_parameter_codes[] = {
925 { 0x0000, "Write new file, do not overwrite" },
926 { 0x0001, "Write new file, overwrite" },
927 { 0x0002, "Append to file " },
928 { 0x0003, "Overwrite file" },
929 { 0, NULL } };
931 static const value_string omron_volume_parameter_codes[] = {
932 { 0x0000, "Create new volume label, do not overwrite" },
933 { 0x0001, "Create new volume label, overwrite" },
934 { 0x0002, "Delete existing volume label" },
935 { 0, NULL } };
937 static const value_string omron_transfer_parameter_codes[] = {
938 { 0x0000, "Data transfer from the PC memory area to the file device" },
939 { 0x0001, "Data transfer from the file device to the PC memory area" },
940 { 0x0002, "Data compared" },
941 { 0, NULL } };
943 static const value_string omron_set_reset_specifications[] = {
944 { 0x0000, "Force-reset (OFF)" },
945 { 0x0001, "Force-set (ON)" },
946 { 0x8000, "Forced status released and bit turned OFF (0)" },
947 { 0x8001, "Forced status released and bit turned ON (1)" },
948 { 0xFFFF, "Forced status released" },
949 { 0, NULL } };
951 static const value_string omron_type_codes[] = {
952 { 0x00, "RAM" },
953 { 0x01, "First half RAM; second half ROM" },
954 { 0, NULL } };
956 static const value_string omron_data_type_bits[] = {
957 { 0x00, "Empty" },
958 { 0x01, "I/O data" },
959 { 0x02, "User program" },
960 { 0x03, "Comments" },
961 { 0, NULL } };
963 static const value_string omron_cyclic_ops_codes[] = {
964 { 0x00, "Stopped" },
965 { 0x01, "Active" },
966 { 0, NULL } };
968 static const value_string omron_cyclic_trans_codes[] = {
969 { 0x00, "No transmission" },
970 { 0x01, "Transmission" },
971 { 0, NULL } };
973 static int * const omron_icf_fields[] = {
974 &hf_omron_icf_gwb,
975 &hf_omron_icf_dtb,
976 &hf_omron_icf_rb0,
977 &hf_omron_icf_rb1,
978 &hf_omron_icf_rb2,
979 &hf_omron_icf_rb3,
980 &hf_omron_icf_rb4,
981 &hf_omron_icf_rsb,
982 NULL
985 static int * const pc_status_fields[] = {
986 &hf_omron_pc_status_pdc,
987 &hf_omron_pc_status_hi,
988 &hf_omron_pc_status_r1,
989 &hf_omron_pc_status_r2,
990 &hf_omron_pc_status_rack_num,
991 NULL
994 static int * const fatal_error_fields[] = {
995 &hf_omron_fatal_fals_error,
996 &hf_omron_fatal_sfc_error,
997 &hf_omron_fatal_cycle_time_over,
998 &hf_omron_fatal_program_error,
999 &hf_omron_fatal_io_setting_error,
1000 &hf_omron_fatal_io_point_overflow,
1001 &hf_omron_fatal_cpu_bus_error,
1002 &hf_omron_fatal_duplication_error,
1003 &hf_omron_fatal_io_bus_error,
1004 &hf_omron_fatal_memory_error,
1005 &hf_omron_fatal_rv_1,
1006 &hf_omron_fatal_rv_2,
1007 &hf_omron_fatal_rv_3,
1008 &hf_omron_fatal_rv_4,
1009 &hf_omron_fatal_rv_5,
1010 &hf_omron_fatal_watch_dog_timer_error,
1011 NULL
1014 static int * const non_fatal_error_fields[] = {
1015 &hf_omron_non_fatal_rv1,
1016 &hf_omron_non_fatal_rv2,
1017 &hf_omron_non_fatal_power_interruption,
1018 &hf_omron_non_fatal_cpu_bus_unit_setting_error,
1019 &hf_omron_non_fatal_battery_error,
1020 &hf_omron_non_fatal_sysmac_bus_error,
1021 &hf_omron_non_fatal_sysmac_bus2_error,
1022 &hf_omron_non_fatal_cpu_bus_unit_error,
1023 &hf_omron_non_fatal_rv3,
1024 &hf_omron_non_fatal_io_verification_error,
1025 &hf_omron_non_fatal_rv4,
1026 &hf_omron_non_fatal_sfc_error,
1027 &hf_omron_non_fatal_indirect_dm_error,
1028 &hf_omron_non_fatal_jmp_error,
1029 &hf_omron_non_fatal_rv5,
1030 &hf_omron_non_fatal_fal_error,
1031 NULL
1034 static int * const message_fields[] = {
1035 &hf_omron_message_no_0,
1036 &hf_omron_message_no_1,
1037 &hf_omron_message_no_2,
1038 &hf_omron_message_no_3,
1039 &hf_omron_message_no_4,
1040 &hf_omron_message_no_5,
1041 &hf_omron_message_no_6,
1042 &hf_omron_message_no_7,
1043 &hf_omron_message_rv_0,
1044 &hf_omron_message_rv_1,
1045 &hf_omron_message_rv_2,
1046 &hf_omron_message_rv_3,
1047 &hf_omron_message_rv_4,
1048 &hf_omron_message_rv_5,
1049 &hf_omron_message_rv_6,
1050 &hf_omron_message_rv_7,
1051 NULL
1054 static int * const message_yes_no_fields[] = {
1055 &hf_omron_message_rv_1,
1056 &hf_omron_message_rv_2,
1057 &hf_omron_message_rv_3,
1058 &hf_omron_message_rv_4,
1059 &hf_omron_message_rv_5,
1060 &hf_omron_message_rv_6,
1061 &hf_omron_message_rv_7,
1062 NULL
1065 static int * const data_type_fields[] = {
1066 &hf_omron_data_type_type,
1067 &hf_omron_data_type_rv,
1068 &hf_omron_data_type_protected,
1069 &hf_omron_data_type_end,
1070 NULL
1073 static int * const cyclic_non_fatal_1_fields[] = {
1074 &hf_omron_cyclic_1,
1075 &hf_omron_cyclic_2,
1076 &hf_omron_cyclic_3,
1077 &hf_omron_cyclic_4,
1078 &hf_omron_cyclic_5,
1079 &hf_omron_cyclic_6,
1080 &hf_omron_cyclic_7,
1081 NULL
1084 static int * const cyclic_non_fatal_2_fields[] = {
1085 &hf_omron_cyclic_8,
1086 &hf_omron_cyclic_9,
1087 &hf_omron_cyclic_10,
1088 &hf_omron_cyclic_11,
1089 &hf_omron_cyclic_12,
1090 &hf_omron_cyclic_13,
1091 &hf_omron_cyclic_14,
1092 &hf_omron_cyclic_15,
1093 NULL
1096 static int * const cyclic_non_fatal_3_fields[] = {
1097 &hf_omron_cyclic_16,
1098 &hf_omron_cyclic_17,
1099 &hf_omron_cyclic_18,
1100 &hf_omron_cyclic_19,
1101 &hf_omron_cyclic_20,
1102 &hf_omron_cyclic_21,
1103 &hf_omron_cyclic_22,
1104 &hf_omron_cyclic_23,
1105 NULL
1108 static int * const cyclic_non_fatal_4_fields[] = {
1109 &hf_omron_cyclic_24,
1110 &hf_omron_cyclic_25,
1111 &hf_omron_cyclic_26,
1112 &hf_omron_cyclic_27,
1113 &hf_omron_cyclic_28,
1114 &hf_omron_cyclic_29,
1115 &hf_omron_cyclic_30,
1116 &hf_omron_cyclic_31,
1117 NULL
1120 static int * const cyclic_non_fatal_5_fields[] = {
1121 &hf_omron_cyclic_32,
1122 &hf_omron_cyclic_33,
1123 &hf_omron_cyclic_34,
1124 &hf_omron_cyclic_35,
1125 &hf_omron_cyclic_36,
1126 &hf_omron_cyclic_37,
1127 &hf_omron_cyclic_38,
1128 &hf_omron_cyclic_39,
1129 NULL
1132 static int * const cyclic_non_fatal_6_fields[] = {
1133 &hf_omron_cyclic_40,
1134 &hf_omron_cyclic_41,
1135 &hf_omron_cyclic_42,
1136 &hf_omron_cyclic_43,
1137 &hf_omron_cyclic_44,
1138 &hf_omron_cyclic_45,
1139 &hf_omron_cyclic_46,
1140 &hf_omron_cyclic_47,
1141 NULL
1144 static int * const cyclic_non_fatal_7_fields[] = {
1145 &hf_omron_cyclic_48,
1146 &hf_omron_cyclic_49,
1147 &hf_omron_cyclic_50,
1148 &hf_omron_cyclic_51,
1149 &hf_omron_cyclic_52,
1150 &hf_omron_cyclic_53,
1151 &hf_omron_cyclic_54,
1152 &hf_omron_cyclic_55,
1153 NULL
1156 static int * const cyclic_non_fatal_8_fields[] = {
1157 &hf_omron_cyclic_56,
1158 &hf_omron_cyclic_57,
1159 &hf_omron_cyclic_58,
1160 &hf_omron_cyclic_59,
1161 &hf_omron_cyclic_60,
1162 &hf_omron_cyclic_61,
1163 &hf_omron_cyclic_62,
1164 NULL
1167 static const true_false_string boolean_data_type_protected = {
1168 "Protected",
1169 "Not Protected"
1172 static const true_false_string boolean_data_type_end = {
1173 "Last Block",
1174 "Not Last Block"
1177 static const true_false_string boolean_node_num_status = {
1178 "Normal",
1179 "Warning"
1182 static const true_false_string boolean_status_flag_status = {
1183 "Error",
1184 "Normal"
1187 static const true_false_string boolean_status_flags_slave_master = {
1188 "Master",
1189 "Slave"
1192 static const true_false_string boolean_status_flags_data_link = {
1193 "Active",
1194 "Not Active"
1197 static const true_false_string boolean_status_block_stop_run = {
1198 "Run",
1199 "Stop"
1202 static const true_false_string boolean_status_flag_status_2 = {
1203 "Warning",
1204 "Normal"
1207 static const true_false_string boolean_member_network = {
1208 "In network",
1209 "Not in network"
1212 static const true_false_string boolean_member_polling = {
1213 "Unit does not respond to polling",
1214 "Unit responds to polling"
1217 /* CODE */
1219 static int
1220 dissect_omron_fins_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *omron_tree)
1222 proto_item *ti = NULL;
1223 proto_tree *omron_header_tree, *field_tree, *command_tree, *area_data_tree, *cpu_bus_tree;
1224 proto_tree *io_data_tree, *error_log_tree, *omron_disk_data_tree, *omron_file_data_tree;
1225 proto_tree *omron_block_record_tree, *omron_status_tree;
1226 const char *cmd_str;
1227 int cmd_str_idx = -1;
1228 int reported_length_remaining;
1229 unsigned offset = 0;
1230 uint8_t icf_flags;
1231 uint8_t omron_byte;
1232 bool is_response = false;
1233 bool is_command = false;
1234 uint16_t command_code = 0;
1236 /* Set the protocol column */
1237 col_set_str(pinfo->cinfo, COL_PROTOCOL, "OMRON");
1239 /* get the command code: we need it later */
1240 command_code = tvb_get_ntohs(tvb, offset + 10);
1242 cmd_str = try_val_to_str_idx(command_code, command_code_cv, &cmd_str_idx);
1243 if (cmd_str_idx == -1)
1244 cmd_str = wmem_strdup_printf(pinfo->pool, "Unknown (%d)", command_code);
1246 /* Setup and fill in the INFO column if it's there */
1247 icf_flags = tvb_get_uint8(tvb, offset);
1248 if (icf_flags & 0x40) {
1249 is_response = true;
1250 col_add_fstr(pinfo->cinfo, COL_INFO, "Response : %s", cmd_str);
1251 } else {
1252 is_command = true;
1253 col_add_fstr(pinfo->cinfo, COL_INFO, "Command : %s", cmd_str);
1256 /* Show address info for single memory area read */
1257 if (is_command && command_code == 0x0101 && tvb_captured_length(tvb) >= 15) {
1258 const char *mem_area_str;
1259 int mem_area_str_idx;
1260 uint8_t mem_area;
1261 uint16_t mem_address;
1263 mem_area = tvb_get_uint8(tvb, offset + 12);
1264 mem_area_str = try_val_to_str_idx(mem_area, memory_area_code_prefix, &mem_area_str_idx);
1265 if (mem_area_str_idx >= 0) {
1266 mem_address = tvb_get_ntohs(tvb, offset + 13);
1267 col_append_fstr(pinfo->cinfo, COL_INFO, " (%s%u)", mem_area_str, mem_address);
1271 if (omron_tree) { /* we are being asked for details */
1272 omron_header_tree = proto_tree_add_subtree(omron_tree, tvb, offset, 12, ett_omron_header, &ti, "FINS Header");
1274 proto_tree_add_bitmask(omron_header_tree, tvb, offset, hf_omron_icf,
1275 ett_omron_icf_fields, omron_icf_fields, ENC_BIG_ENDIAN);
1277 /* Byte 2 RSV */
1278 offset = offset + 1;
1279 proto_tree_add_item(omron_header_tree, hf_omron_rsv, tvb, offset, 1, ENC_BIG_ENDIAN);
1281 /* Byte 3 GCT */
1282 offset = offset + 1;
1283 proto_tree_add_item(omron_header_tree, hf_omron_gct, tvb, offset, 1, ENC_BIG_ENDIAN);
1285 /* Byte 4 DNA */
1286 offset = offset + 1;
1287 proto_tree_add_item(omron_header_tree, hf_omron_dna, tvb, offset, 1, ENC_BIG_ENDIAN);
1289 /* Byte 5 DA1 */
1290 offset = offset + 1;
1291 proto_tree_add_item(omron_header_tree, hf_omron_da1, tvb, offset, 1, ENC_BIG_ENDIAN);
1293 /* Byte 6 DA2 */
1294 offset = offset + 1;
1295 proto_tree_add_item(omron_header_tree, hf_omron_da2, tvb, offset, 1, ENC_BIG_ENDIAN);
1297 /* Byte 7 SNA */
1298 offset = offset + 1;
1299 proto_tree_add_item(omron_header_tree, hf_omron_sna, tvb, offset, 1, ENC_BIG_ENDIAN);
1301 /* Byte 8 SA1 */
1302 offset = offset + 1;
1303 proto_tree_add_item(omron_header_tree, hf_omron_sa1, tvb, offset, 1, ENC_BIG_ENDIAN);
1305 /* Byte 9 SA2 */
1306 offset = offset + 1;
1307 proto_tree_add_item(omron_header_tree, hf_omron_sa2, tvb, offset, 1, ENC_BIG_ENDIAN);
1309 /* Byte 10 SID */
1310 offset = offset + 1;
1311 proto_tree_add_item(omron_header_tree, hf_omron_sid, tvb, offset, 1, ENC_BIG_ENDIAN);
1313 /* Byte 11 and 12 Command Code */
1314 offset = offset + 1;
1315 ti = proto_tree_add_item(omron_header_tree, hf_omron_command, tvb, offset, 2, ENC_BIG_ENDIAN);
1317 offset = offset + 2;
1319 reported_length_remaining = tvb_reported_length_remaining(tvb, offset);
1321 if (cmd_str_idx == -1) {
1322 /* Unknown command-code */
1323 expert_add_info(pinfo, ti, &ei_omron_command_code);
1324 return tvb_captured_length(tvb);
1327 /* Handle special cases wherein the data length for a command and/or a response can be 0 */
1328 switch(command_code) {
1329 case 0x0402:
1330 case 0x0601:
1331 case 0x0602:
1332 case 0x0603:
1333 case 0x0701:
1334 case 0x0802:
1335 case 0x2103:
1336 case 0x2302:
1337 case 0x2602:
1338 case 0x2603:
1339 /* command data length > 0 is NG; response data lengths are > 0 */
1340 if (is_command) {
1341 if (reported_length_remaining != 0) {
1342 expert_add_info_format(pinfo, omron_tree, &ei_omron_bad_length, "Unexpected Length (Should be 0)");
1344 return tvb_captured_length(tvb);
1346 break;
1348 case 0x0403:
1349 /* command data length should be 0 */
1350 if (is_command) {
1351 if(reported_length_remaining != 0) {
1352 expert_add_info_format(pinfo, omron_tree, &ei_omron_bad_length, "Unexpected Length (Should be 0)");
1355 /* There's no response */
1356 if (is_response)
1358 expert_add_info_format(pinfo, ti, &ei_omron_command_code, "Unknown Response Command-Code");
1360 return tvb_captured_length(tvb);
1362 case 0x0801:
1363 /* command data length = 0 or > 0 is OK; */
1364 if (is_command) {
1365 if (reported_length_remaining == 0)
1366 return tvb_captured_length(tvb);
1368 break;
1370 case 0x0803:
1371 /* command data length = 0 or > 0 is OK; */
1372 if (is_command) {
1373 if (reported_length_remaining == 0)
1374 return tvb_captured_length(tvb);
1376 /* There's no response */
1377 if (is_response)
1379 expert_add_info_format(pinfo, ti, &ei_omron_command_code, "Unknown Response Command-Code");
1380 return tvb_captured_length(tvb);
1382 break;
1384 default:
1385 break;
1388 /* Add command data tree */
1389 /* Note: A "malformed" will be thrown if data length = 0 at this point */
1390 command_tree = proto_tree_add_subtree(omron_tree, tvb, offset, -1, ett_omron_command_data, NULL, "Command Data");
1392 /* Start parsing individual commands */
1393 switch(command_code) {
1395 case 0x0101:
1397 /* check for enough data */
1398 if(is_command)
1400 if(reported_length_remaining == 6)
1402 proto_tree_add_item(command_tree, hf_omron_command_memory_area_code,
1403 tvb, offset, 1, ENC_BIG_ENDIAN);
1405 proto_tree_add_item(command_tree, hf_omron_address, tvb, (offset+1), 2, ENC_BIG_ENDIAN);
1406 proto_tree_add_item(command_tree, hf_omron_address_bits, tvb, (offset+3), 1, ENC_BIG_ENDIAN);
1407 proto_tree_add_item(command_tree, hf_omron_num_items, tvb, (offset+4), 2, ENC_BIG_ENDIAN);
1408 offset = offset + 6;
1412 if(is_response)
1414 if(reported_length_remaining >= 2)
1416 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset,
1417 2, ENC_BIG_ENDIAN);
1419 if(reported_length_remaining > 2)
1421 proto_tree_add_item(command_tree, hf_omron_response_data, tvb,
1422 (offset+2), -1, ENC_NA);
1424 offset = offset + reported_length_remaining;
1428 break;
1430 case 0x0102:
1432 if(is_command)
1434 if(reported_length_remaining >= 6)
1436 proto_tree_add_item(command_tree, hf_omron_command_memory_area_code,
1437 tvb, offset, 1, ENC_BIG_ENDIAN);
1439 proto_tree_add_item(command_tree, hf_omron_address, tvb, (offset+1), 2, ENC_BIG_ENDIAN);
1440 proto_tree_add_item(command_tree, hf_omron_address_bits, tvb, (offset+3), 1, ENC_BIG_ENDIAN);
1441 proto_tree_add_item(command_tree, hf_omron_num_items, tvb, (offset+4), 2, ENC_BIG_ENDIAN);
1443 proto_tree_add_item(command_tree, hf_omron_command_data, tvb, (offset+6), -1, ENC_NA);
1444 offset = offset + reported_length_remaining;
1448 if(is_response)
1450 if(reported_length_remaining == 2)
1452 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset,
1453 2, ENC_BIG_ENDIAN);
1454 offset = offset + 2;
1458 break;
1460 case 0x0103:
1462 if(is_command)
1464 if(reported_length_remaining == 8)
1466 proto_tree_add_item(command_tree, hf_omron_command_memory_area_code,
1467 tvb, offset, 1, ENC_BIG_ENDIAN);
1469 proto_tree_add_item(command_tree, hf_omron_address, tvb, (offset+1), 2, ENC_BIG_ENDIAN);
1470 proto_tree_add_item(command_tree, hf_omron_address_bits, tvb, (offset+3), 1, ENC_BIG_ENDIAN);
1471 proto_tree_add_item(command_tree, hf_omron_num_items, tvb, (offset+4), 2, ENC_BIG_ENDIAN);
1473 proto_tree_add_item(command_tree, hf_omron_command_data, tvb, (offset+6), 2, ENC_NA);
1474 offset = offset + 8;
1478 if(is_response)
1480 if(reported_length_remaining == 2)
1482 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset,
1483 2, ENC_BIG_ENDIAN);
1484 offset = offset + 2;
1488 break;
1490 case 0x0104:
1492 if(is_command)
1494 while(reported_length_remaining >= 4)
1496 const char *mem_area_str;
1497 int mem_area_str_idx;
1498 uint8_t mem_area;
1499 uint16_t mem_address;
1501 proto_tree_add_item(command_tree, hf_omron_command_memory_area_code, tvb, offset, 1, ENC_BIG_ENDIAN);
1502 ti = proto_tree_add_item(command_tree, hf_omron_address, tvb, (offset+1), 2, ENC_BIG_ENDIAN);
1504 mem_area = tvb_get_uint8(tvb, offset);
1505 mem_area_str = try_val_to_str_idx(mem_area, memory_area_code_prefix, &mem_area_str_idx);
1506 if(mem_area_str_idx >= 0) {
1507 mem_address = tvb_get_ntohs(tvb, offset+1);
1508 proto_item_append_text(ti, " (%s%u)", mem_area_str, mem_address);
1511 proto_tree_add_item(command_tree, hf_omron_address_bits, tvb, (offset+3), 1, ENC_BIG_ENDIAN);
1512 offset = offset + 4;
1513 reported_length_remaining = reported_length_remaining - 4;
1517 if(is_response)
1519 if(reported_length_remaining >= 3)
1521 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
1522 offset = offset + 2;
1523 reported_length_remaining = reported_length_remaining - 2;
1525 while(reported_length_remaining >= 2)
1527 uint8_t memory_area_code;
1528 uint8_t memory_code_len;
1530 ti = proto_tree_add_item(command_tree, hf_omron_command_memory_area_code, tvb, offset, 1, ENC_BIG_ENDIAN);
1531 memory_area_code = tvb_get_uint8(tvb, offset);
1532 switch(memory_area_code) {
1533 case 0x00:
1534 case 0x01:
1535 case 0x02:
1536 case 0x03:
1537 case 0x04:
1538 case 0x05:
1539 case 0x06:
1540 case 0x07:
1541 case 0x09:
1542 case 0x1B:
1543 case 0x20:
1544 case 0x21:
1545 case 0x22:
1546 case 0x23:
1547 case 0x24:
1548 case 0x25:
1549 case 0x26:
1550 case 0x27:
1551 case 0x28:
1552 case 0x29:
1553 case 0x2A:
1554 case 0x2B:
1555 case 0x2C:
1556 case 0x30:
1557 case 0x31:
1558 case 0x32:
1559 case 0x33:
1560 case 0x40:
1561 case 0x41:
1562 case 0x43:
1563 case 0x44:
1564 case 0x46:
1565 case 0x49:
1566 case 0x70:
1567 case 0x71:
1568 case 0x72:
1569 memory_code_len = 1;
1570 break;
1571 case 0x80:
1572 case 0x81:
1573 case 0x82:
1574 case 0x84:
1575 case 0x85:
1576 case 0x89:
1577 case 0x90:
1578 case 0x91:
1579 case 0x92:
1580 case 0x93:
1581 case 0x94:
1582 case 0x95:
1583 case 0x96:
1584 case 0x97:
1585 case 0x98:
1586 case 0x9C:
1587 case 0xA0:
1588 case 0xA1:
1589 case 0xA2:
1590 case 0xA3:
1591 case 0xA4:
1592 case 0xA5:
1593 case 0xA6:
1594 case 0xA7:
1595 case 0xA8:
1596 case 0xA9:
1597 case 0xAA:
1598 case 0xAB:
1599 case 0xAC:
1600 case 0xB0:
1601 case 0xB1:
1602 case 0xB2:
1603 case 0xB3:
1604 case 0xBC:
1605 memory_code_len = 2;
1606 break;
1607 case 0xC0:
1608 case 0xDC:
1609 case 0xDD:
1610 case 0xF0:
1611 case 0xF1:
1612 case 0xF2:
1613 memory_code_len = 4;
1614 break;
1615 default:
1616 memory_code_len = 0;
1617 } /* switch */
1619 offset = offset + 1;
1620 reported_length_remaining = reported_length_remaining - 1;
1622 if(memory_code_len == 0) {
1623 expert_add_info_format(pinfo, ti, &ei_oomron_command_memory_area_code, "Unknown Memory-Area-Code (%u)", memory_area_code);
1624 return tvb_captured_length(tvb); /* Bail out .... */
1626 proto_tree_add_item(command_tree, hf_omron_response_data, tvb, offset, memory_code_len, ENC_NA);
1627 offset = offset + memory_code_len;
1628 reported_length_remaining = reported_length_remaining - memory_code_len;
1630 } /* while ( ... >= 2) */
1631 } /* if(reported_length_remaining >= 3) */
1634 break;
1636 case 0x0105:
1638 if(is_command)
1640 if(reported_length_remaining == 10)
1642 proto_tree_add_item(command_tree, hf_omron_command_memory_area_code,
1643 tvb, offset, 1, ENC_BIG_ENDIAN);
1644 proto_tree_add_item(command_tree, hf_omron_address, tvb, (offset+1), 2, ENC_BIG_ENDIAN);
1645 proto_tree_add_item(command_tree, hf_omron_address_bits, tvb, (offset+3), 1, ENC_BIG_ENDIAN);
1647 proto_tree_add_item(command_tree, hf_omron_command_memory_area_code,
1648 tvb, (offset+4), 1, ENC_BIG_ENDIAN);
1649 proto_tree_add_item(command_tree, hf_omron_address, tvb, (offset+5), 2, ENC_BIG_ENDIAN);
1650 proto_tree_add_item(command_tree, hf_omron_address_bits, tvb, (offset+7), 1, ENC_BIG_ENDIAN);
1652 proto_tree_add_item(command_tree, hf_omron_num_items, tvb, (offset+8), 2, ENC_BIG_ENDIAN);
1653 offset = offset + 10;
1657 if(is_response)
1659 if(reported_length_remaining == 2)
1661 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset,
1662 2, ENC_BIG_ENDIAN);
1663 offset = offset + 2;
1667 break;
1669 case 0x0201:
1672 if(is_command)
1674 if(reported_length_remaining == 6)
1676 proto_tree_add_item(command_tree, hf_omron_parameter_area_code, tvb, offset, 2, ENC_BIG_ENDIAN);
1677 proto_tree_add_item(command_tree, hf_omron_beginning_word, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
1678 proto_tree_add_item(command_tree, hf_omron_num_words, tvb, (offset+4), 2, ENC_BIG_ENDIAN);
1679 offset = offset + 6;
1683 if(is_response)
1685 if(reported_length_remaining >= 8)
1687 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset,
1688 2, ENC_BIG_ENDIAN);
1689 proto_tree_add_item(command_tree, hf_omron_parameter_area_code, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
1690 proto_tree_add_item(command_tree, hf_omron_beginning_word, tvb, (offset+4), 2, ENC_BIG_ENDIAN);
1691 proto_tree_add_item(command_tree, hf_omron_num_words, tvb, (offset+6), 2, ENC_BIG_ENDIAN);
1693 if(reported_length_remaining > 8)
1695 proto_tree_add_item(command_tree, hf_omron_response_data, tvb,
1696 (offset+8), -1, ENC_NA);
1698 offset = offset + reported_length_remaining;
1702 break;
1704 case 0x0202:
1705 case 0x0203:
1708 if(is_command)
1710 if(reported_length_remaining >= 6)
1712 proto_tree_add_item(command_tree, hf_omron_parameter_area_code, tvb, offset, 2, ENC_BIG_ENDIAN);
1713 proto_tree_add_item(command_tree, hf_omron_beginning_word, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
1714 proto_tree_add_item(command_tree, hf_omron_num_words, tvb, (offset+4), 2, ENC_BIG_ENDIAN);
1716 if(reported_length_remaining > 6)
1718 proto_tree_add_item(command_tree, hf_omron_command_data, tvb,
1719 (offset+6), -1, ENC_NA);
1721 offset = offset + reported_length_remaining;
1725 if(is_response)
1727 if(reported_length_remaining == 2)
1729 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset,
1730 2, ENC_BIG_ENDIAN);
1731 offset = offset + 2;
1735 break;
1737 case 0x0220:
1739 if(is_command)
1741 if(reported_length_remaining == 8)
1743 proto_tree_add_item(command_tree, hf_omron_fixed, tvb, offset, 2, ENC_BIG_ENDIAN);
1744 proto_tree_add_item(command_tree, hf_omron_intelligent_id_no, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
1745 proto_tree_add_item(command_tree, hf_omron_first_word, tvb, (offset+4), 2, ENC_BIG_ENDIAN);
1746 proto_tree_add_item(command_tree, hf_omron_read_len, tvb, (offset+6), 2, ENC_BIG_ENDIAN);
1747 offset = offset + 8;
1751 if(is_response)
1753 if(reported_length_remaining >= 3)
1755 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
1756 proto_tree_add_item(command_tree, hf_omron_no_of_link_nodes, tvb, (offset+2), 1, ENC_BIG_ENDIAN);
1758 offset = offset + 3;
1759 reported_length_remaining = reported_length_remaining - 3;
1761 /* add block record tree for each record */
1762 while(reported_length_remaining >= 8)
1764 omron_block_record_tree = proto_tree_add_subtree(command_tree, tvb, offset, 8, ett_omron_block_record, NULL, "Block Record");
1765 proto_tree_add_item(omron_block_record_tree, hf_omron_block_record_node_num_status, tvb, offset, 1, ENC_BIG_ENDIAN);
1766 proto_tree_add_item(omron_block_record_tree, hf_omron_block_record_node_num_num_nodes, tvb, offset, 1, ENC_BIG_ENDIAN);
1767 proto_tree_add_item(omron_block_record_tree, hf_omron_block_record_cio_area, tvb, (offset+1), 2, ENC_BIG_ENDIAN);
1768 proto_tree_add_item(omron_block_record_tree, hf_omron_block_record_kind_of_dm, tvb, (offset+3), 1, ENC_BIG_ENDIAN);
1769 proto_tree_add_item(omron_block_record_tree, hf_omron_block_record_dm_area_first_word, tvb, (offset+4), 2, ENC_BIG_ENDIAN);
1770 proto_tree_add_item(omron_block_record_tree, hf_omron_block_record_no_of_total_words, tvb, (offset+6), 2, ENC_BIG_ENDIAN);
1771 offset = offset + 8;
1772 reported_length_remaining = reported_length_remaining - 8;
1775 } /* if (is_response) */
1777 break;
1779 case 0x0221:
1781 if(is_command)
1783 if(reported_length_remaining >= 9)
1785 proto_tree_add_item(command_tree, hf_omron_fixed, tvb, offset, 2, ENC_BIG_ENDIAN);
1786 proto_tree_add_item(command_tree, hf_omron_intelligent_id_no, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
1787 proto_tree_add_item(command_tree, hf_omron_first_word, tvb, (offset+4), 2, ENC_BIG_ENDIAN);
1788 proto_tree_add_item(command_tree, hf_omron_read_len, tvb, (offset+6), 2, ENC_BIG_ENDIAN);
1789 proto_tree_add_item(command_tree, hf_omron_no_of_link_nodes, tvb, (offset+8), 1, ENC_BIG_ENDIAN);
1791 offset = offset + 9;
1792 reported_length_remaining = reported_length_remaining - 9;
1794 while(reported_length_remaining >= 8)
1796 omron_block_record_tree = proto_tree_add_subtree(command_tree, tvb, offset, 8, ett_omron_block_record, NULL, "Block Record");
1797 proto_tree_add_item(omron_block_record_tree, hf_omron_block_record_node_num_status, tvb, offset, 1, ENC_BIG_ENDIAN);
1798 proto_tree_add_item(omron_block_record_tree, hf_omron_block_record_node_num_num_nodes, tvb, offset, 1, ENC_BIG_ENDIAN);
1799 proto_tree_add_item(omron_block_record_tree, hf_omron_block_record_cio_area, tvb, (offset+1), 2, ENC_BIG_ENDIAN);
1800 proto_tree_add_item(omron_block_record_tree, hf_omron_block_record_kind_of_dm, tvb, (offset+3), 1, ENC_BIG_ENDIAN);
1801 proto_tree_add_item(omron_block_record_tree, hf_omron_block_record_dm_area_first_word, tvb, (offset+4), 2, ENC_BIG_ENDIAN);
1802 proto_tree_add_item(omron_block_record_tree, hf_omron_block_record_no_of_total_words, tvb, (offset+6), 2, ENC_BIG_ENDIAN);
1803 offset = offset + 8;
1804 reported_length_remaining = reported_length_remaining - 8;
1809 if(is_response)
1811 if(reported_length_remaining == 2)
1813 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
1814 offset = offset + 2;
1818 break;
1820 case 0x0304:
1821 case 0x0305:
1823 if(is_command)
1825 if(reported_length_remaining == 15)
1827 proto_tree_add_item(command_tree, hf_omron_program_number, tvb, offset, 2, ENC_BIG_ENDIAN);
1828 proto_tree_add_item(command_tree, hf_omron_protect_code, tvb, (offset+2), 1, ENC_BIG_ENDIAN);
1829 proto_tree_add_item(command_tree, hf_omron_begin_word, tvb, (offset+3),4,ENC_BIG_ENDIAN);
1830 proto_tree_add_item(command_tree, hf_omron_last_word, tvb, (offset+7),4,ENC_BIG_ENDIAN);
1831 proto_tree_add_item(command_tree, hf_omron_password, tvb, (offset+11),4,ENC_ASCII);
1832 offset = offset + 15;
1836 if(is_response)
1838 if(reported_length_remaining == 2)
1840 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
1841 offset = offset + 2;
1845 break;
1847 case 0x0306:
1849 if(is_command)
1851 if(reported_length_remaining == 8)
1853 proto_tree_add_item(command_tree, hf_omron_program_number, tvb, offset, 2, ENC_BIG_ENDIAN);
1854 proto_tree_add_item(command_tree, hf_omron_begin_word, tvb, (offset+2), 4, ENC_BIG_ENDIAN);
1855 proto_tree_add_item(command_tree, hf_omron_num_words, tvb, (offset+6), 2, ENC_BIG_ENDIAN);
1856 offset = offset + 8;
1860 if(is_response)
1862 if(reported_length_remaining >= 10)
1864 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
1865 proto_tree_add_item(command_tree, hf_omron_program_number, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
1866 proto_tree_add_item(command_tree, hf_omron_begin_word, tvb, (offset+4), 4, ENC_BIG_ENDIAN);
1867 proto_tree_add_item(command_tree, hf_omron_num_words, tvb, (offset+8), 2, ENC_BIG_ENDIAN);
1869 if(reported_length_remaining > 10)
1871 proto_tree_add_item(command_tree, hf_omron_response_data, tvb, (offset+10), -1, ENC_NA);
1873 offset = offset + reported_length_remaining;
1877 break;
1879 case 0x0307:
1881 if(is_command)
1883 if(reported_length_remaining >= 8)
1885 proto_tree_add_item(command_tree, hf_omron_program_number, tvb, offset, 2, ENC_BIG_ENDIAN);
1886 proto_tree_add_item(command_tree, hf_omron_begin_word, tvb, (offset+2), 4, ENC_BIG_ENDIAN);
1887 proto_tree_add_item(command_tree, hf_omron_num_words, tvb, (offset+6), 2, ENC_BIG_ENDIAN);
1889 if(reported_length_remaining > 8)
1891 proto_tree_add_item(command_tree, hf_omron_command_data, tvb, (offset+8), -1, ENC_NA);
1893 offset = offset + reported_length_remaining;
1896 if(is_response)
1898 if(reported_length_remaining == 10)
1900 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
1901 proto_tree_add_item(command_tree, hf_omron_program_number, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
1902 proto_tree_add_item(command_tree, hf_omron_begin_word, tvb, (offset+4), 4, ENC_BIG_ENDIAN);
1903 proto_tree_add_item(command_tree, hf_omron_num_words, tvb, (offset+8), 2, ENC_BIG_ENDIAN);
1904 offset = offset + 10;
1908 break;
1910 case 0x0308:
1912 if(is_command)
1914 if(reported_length_remaining == 3)
1916 proto_tree_add_item(command_tree, hf_omron_program_number, tvb, offset, 2, ENC_BIG_ENDIAN);
1917 proto_tree_add_item(command_tree, hf_omron_clear_code, tvb, (offset+2), 1, ENC_BIG_ENDIAN);
1918 offset = offset + 3;
1921 if(is_response)
1923 if(reported_length_remaining == 2)
1925 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
1926 offset = offset + 2;
1930 break;
1932 case 0x0401:
1934 if(is_command)
1936 if(reported_length_remaining == 3)
1938 proto_tree_add_item(command_tree, hf_omron_program_number, tvb, offset, 2, ENC_BIG_ENDIAN);
1939 proto_tree_add_item(command_tree, hf_omron_mode_code, tvb, (offset+2), 1, ENC_BIG_ENDIAN);
1940 offset = offset + 3;
1942 else if (reported_length_remaining == 2)
1944 proto_tree_add_item(command_tree, hf_omron_program_number, tvb, offset, 2, ENC_BIG_ENDIAN);
1945 proto_tree_add_item(command_tree, hf_omron_monitor_label, tvb, offset, 0, ENC_NA);
1946 offset = offset + 2;
1949 if(is_response)
1951 if(reported_length_remaining == 2)
1953 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
1954 offset = offset + 2;
1958 break;
1960 case 0x0402:
1962 /* command data length is 0 */
1964 if(is_response)
1966 if(reported_length_remaining == 2)
1968 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
1969 offset = offset + 2;
1973 break;
1975 case 0x0501:
1977 if(is_command)
1979 if(reported_length_remaining == 1)
1981 proto_tree_add_item(command_tree, hf_omron_command_data, tvb,
1982 offset, -1, ENC_NA);
1983 offset = offset + 1;
1987 if(is_response)
1989 if(reported_length_remaining == 94)
1991 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
1992 proto_tree_add_item(command_tree, hf_omron_controller_model, tvb, (offset+2), 20, ENC_ASCII);
1993 proto_tree_add_item(command_tree, hf_omron_controller_version, tvb, (offset+22), 20, ENC_ASCII);
1994 proto_tree_add_item(command_tree, hf_omron_for_system_use, tvb, (offset+42), 40, ENC_ASCII);
1995 /* add area data sub tree */
1996 area_data_tree = proto_tree_add_subtree(command_tree, tvb, (offset+82), 12, ett_area_data, NULL, "Area Data");
1997 proto_tree_add_item(area_data_tree, hf_omron_program_area_size, tvb, (offset+82), 2, ENC_BIG_ENDIAN);
1998 proto_tree_add_item(area_data_tree, hf_omron_iom_size, tvb, (offset+84), 1, ENC_BIG_ENDIAN);
1999 proto_tree_add_item(area_data_tree, hf_omron_num_dm_words, tvb, (offset+85), 2, ENC_BIG_ENDIAN);
2000 proto_tree_add_item(area_data_tree, hf_omron_timer_counter_size, tvb, (offset+87), 1, ENC_BIG_ENDIAN);
2001 proto_tree_add_item(area_data_tree, hf_omron_expansion_dm_size, tvb, (offset+88), 1, ENC_BIG_ENDIAN);
2002 proto_tree_add_item(area_data_tree, hf_omron_num_step_transitions, tvb, (offset+89), 2, ENC_BIG_ENDIAN);
2003 proto_tree_add_item(area_data_tree, hf_omron_kind_memory_card, tvb, (offset+91), 1, ENC_BIG_ENDIAN);
2004 proto_tree_add_item(area_data_tree, hf_omron_memory_card_size, tvb, (offset+92), 2, ENC_BIG_ENDIAN);
2005 offset = offset + 94;
2008 else if(reported_length_remaining == 69)
2010 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
2011 cpu_bus_tree = proto_tree_add_subtree(command_tree, tvb, (offset+2), 64, ett_cpu_bus, NULL, "CPU Bus Unit Conf");
2012 proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_unit_0, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
2013 proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_unit_1, tvb, (offset+4), 2, ENC_BIG_ENDIAN);
2014 proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_unit_2, tvb, (offset+6), 2, ENC_BIG_ENDIAN);
2015 proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_unit_3, tvb, (offset+8), 2, ENC_BIG_ENDIAN);
2016 proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_unit_4, tvb, (offset+10), 2, ENC_BIG_ENDIAN);
2017 proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_unit_5, tvb, (offset+12), 2, ENC_BIG_ENDIAN);
2018 proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_unit_6, tvb, (offset+14), 2, ENC_BIG_ENDIAN);
2019 proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_unit_7, tvb, (offset+16), 2, ENC_BIG_ENDIAN);
2020 proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_unit_8, tvb, (offset+18), 2, ENC_BIG_ENDIAN);
2021 proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_unit_9, tvb, (offset+20), 2, ENC_BIG_ENDIAN);
2022 proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_unit_10, tvb, (offset+22), 2, ENC_BIG_ENDIAN);
2023 proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_unit_11, tvb, (offset+24), 2, ENC_BIG_ENDIAN);
2024 proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_unit_12, tvb, (offset+26), 2, ENC_BIG_ENDIAN);
2025 proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_unit_13, tvb, (offset+28), 2, ENC_BIG_ENDIAN);
2026 proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_unit_14, tvb, (offset+30), 2, ENC_BIG_ENDIAN);
2027 proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_unit_15, tvb, (offset+32), 2, ENC_BIG_ENDIAN);
2028 proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_reserved, tvb, (offset+34), 32, ENC_ASCII);
2029 /* Remote IO Data tree */
2030 io_data_tree = proto_tree_add_subtree(command_tree, tvb, (offset+66), 2, ett_io_data, NULL, "Remote I/O data");
2031 proto_tree_add_item(io_data_tree, hf_omron_io_data_num_sysmac_1, tvb, (offset+66), 1, ENC_BIG_ENDIAN);
2032 proto_tree_add_item(io_data_tree, hf_omron_io_data_num_sysmac_2, tvb, (offset+67), 1, ENC_BIG_ENDIAN);
2033 /* PC status */
2034 proto_tree_add_bitmask(command_tree, tvb, (offset+68), hf_omron_pc_status,
2035 ett_pc_status_fields, pc_status_fields, ENC_BIG_ENDIAN);
2036 offset = offset + 69;
2039 else if(reported_length_remaining == 161)
2041 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
2042 proto_tree_add_item(command_tree, hf_omron_controller_model, tvb, (offset+2), 20, ENC_ASCII);
2043 proto_tree_add_item(command_tree, hf_omron_controller_version, tvb, (offset+22), 20, ENC_ASCII);
2044 proto_tree_add_item(command_tree, hf_omron_for_system_use, tvb, (offset+42), 40, ENC_ASCII);
2045 /* add area data sub tree */
2046 area_data_tree = proto_tree_add_subtree(command_tree, tvb, (offset+82), 12, ett_area_data, NULL, "Area Data");
2047 proto_tree_add_item(area_data_tree, hf_omron_program_area_size, tvb, (offset+82), 2, ENC_BIG_ENDIAN);
2048 proto_tree_add_item(area_data_tree, hf_omron_iom_size, tvb, (offset+84), 1, ENC_BIG_ENDIAN);
2049 proto_tree_add_item(area_data_tree, hf_omron_num_dm_words, tvb, (offset+85), 2, ENC_BIG_ENDIAN);
2050 proto_tree_add_item(area_data_tree, hf_omron_timer_counter_size, tvb, (offset+87), 1, ENC_BIG_ENDIAN);
2051 proto_tree_add_item(area_data_tree, hf_omron_expansion_dm_size, tvb, (offset+88), 1, ENC_BIG_ENDIAN);
2052 proto_tree_add_item(area_data_tree, hf_omron_num_step_transitions, tvb, (offset+89), 2, ENC_BIG_ENDIAN);
2053 proto_tree_add_item(area_data_tree, hf_omron_kind_memory_card, tvb, (offset+91), 1, ENC_BIG_ENDIAN);
2054 proto_tree_add_item(area_data_tree, hf_omron_memory_card_size, tvb, (offset+92), 2, ENC_BIG_ENDIAN);
2055 /* cpu bus unit configuration */
2056 cpu_bus_tree = proto_tree_add_subtree(command_tree, tvb, (offset+94), 64, ett_cpu_bus, NULL, "CPU Bus Unit Conf");
2057 proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_unit_0, tvb, (offset+94), 2, ENC_BIG_ENDIAN);
2058 proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_unit_1, tvb, (offset+96), 2, ENC_BIG_ENDIAN);
2059 proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_unit_2, tvb, (offset+98), 2, ENC_BIG_ENDIAN);
2060 proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_unit_3, tvb, (offset+100), 2, ENC_BIG_ENDIAN);
2061 proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_unit_4, tvb, (offset+102), 2, ENC_BIG_ENDIAN);
2062 proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_unit_5, tvb, (offset+104), 2, ENC_BIG_ENDIAN);
2063 proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_unit_6, tvb, (offset+106), 2, ENC_BIG_ENDIAN);
2064 proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_unit_7, tvb, (offset+108), 2, ENC_BIG_ENDIAN);
2065 proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_unit_8, tvb, (offset+110), 2, ENC_BIG_ENDIAN);
2066 proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_unit_9, tvb, (offset+112), 2, ENC_BIG_ENDIAN);
2067 proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_unit_10, tvb, (offset+114), 2, ENC_BIG_ENDIAN);
2068 proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_unit_11, tvb, (offset+116), 2, ENC_BIG_ENDIAN);
2069 proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_unit_12, tvb, (offset+118), 2, ENC_BIG_ENDIAN);
2070 proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_unit_13, tvb, (offset+120), 2, ENC_BIG_ENDIAN);
2071 proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_unit_14, tvb, (offset+122), 2, ENC_BIG_ENDIAN);
2072 proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_unit_15, tvb, (offset+124), 2, ENC_BIG_ENDIAN);
2073 proto_tree_add_item(cpu_bus_tree, hf_omron_cpu_bus_reserved, tvb, (offset+126), 32, ENC_ASCII);
2074 /* Remote IO Data tree */
2075 io_data_tree = proto_tree_add_subtree(command_tree, tvb, (offset+158), 2, ett_io_data, NULL, "Remote I/O data");
2076 proto_tree_add_item(io_data_tree, hf_omron_io_data_num_sysmac_1, tvb, (offset+158), 1, ENC_BIG_ENDIAN);
2077 proto_tree_add_item(io_data_tree, hf_omron_io_data_num_sysmac_2, tvb, (offset+159), 1, ENC_BIG_ENDIAN);
2078 /* PC status */
2079 proto_tree_add_bitmask(command_tree, tvb, (offset+160), hf_omron_pc_status,
2080 ett_pc_status_fields, pc_status_fields, ENC_BIG_ENDIAN);
2081 offset = offset + 161;
2085 break;
2087 case 0x0502:
2089 if(is_command)
2091 if(reported_length_remaining >= 1)
2093 proto_tree_add_item(command_tree, hf_omron_unit_address, tvb, offset, 1, ENC_BIG_ENDIAN);
2094 if (reported_length_remaining == 2)
2096 proto_tree_add_item(command_tree, hf_omron_num_units, tvb, (offset+1), 1, ENC_BIG_ENDIAN);
2097 offset = offset + 1;
2099 offset = offset + 1;
2103 if(is_response)
2105 if(reported_length_remaining >= 24)
2107 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
2108 proto_tree_add_item(command_tree, hf_omron_num_units, tvb, offset+2, 1, ENC_BIG_ENDIAN);
2109 offset = offset + 3;
2110 reported_length_remaining = reported_length_remaining - 3;
2112 while(reported_length_remaining >= 21)
2114 proto_tree_add_item(command_tree, hf_omron_unit_address, tvb, offset, 1, ENC_BIG_ENDIAN);
2115 proto_tree_add_item(command_tree, hf_omron_model_number, tvb, offset+1, 20, ENC_ASCII);
2116 offset = offset + 21;
2117 reported_length_remaining = reported_length_remaining - 21;
2122 break;
2124 case 0x0601:
2126 /* command data length is 0 */
2128 if(is_response)
2130 if(reported_length_remaining == 28)
2132 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
2133 proto_tree_add_item(command_tree, hf_omron_status, tvb, (offset+2), 1, ENC_BIG_ENDIAN);
2134 proto_tree_add_item(command_tree, hf_omron_mode_code, tvb, (offset+3), 1, ENC_BIG_ENDIAN);
2135 /* Add bitmask for Fatal error data */
2136 proto_tree_add_bitmask(command_tree, tvb, (offset+4), hf_omron_fatal_error_data,
2137 ett_fatal_fields, fatal_error_fields, ENC_BIG_ENDIAN);
2138 /* Add bitmask for non fatal error data */
2139 proto_tree_add_bitmask(command_tree, tvb, (offset+6), hf_omron_non_fatal_error_data,
2140 ett_non_fatal_fields, non_fatal_error_fields, ENC_BIG_ENDIAN);
2141 /* add bitmask for message yes/no data */
2142 proto_tree_add_bitmask(command_tree, tvb, (offset+8), hf_omron_message,
2143 ett_message_fields, message_fields, ENC_BIG_ENDIAN);
2144 /* Add rest of fields */
2145 proto_tree_add_item(command_tree, hf_omron_fals, tvb, (offset+10), 2, ENC_BIG_ENDIAN);
2146 proto_tree_add_item(command_tree, hf_omron_error_message, tvb, (offset+12), 16, ENC_ASCII);
2147 offset = offset + 28;
2151 break;
2153 case 0x0602:
2155 /* command data length is 0 */
2157 if(is_response)
2159 if(reported_length_remaining == 108)
2161 proto_tree *netw_nodes_sts_tree;
2162 proto_tree *netw_nodes_non_fatal_err_sts_tree;
2163 proto_tree *netw_nodes_cyclic_err_ctrs_tree;
2164 uint8_t i;
2165 uint8_t node_num;
2167 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
2168 offset = offset + 2;
2170 /* parsing 31 bytes of foo */
2171 netw_nodes_sts_tree = proto_tree_add_subtree(command_tree, tvb, offset, 31, ett_omron_netw_nodes_sts, NULL, "Network Nodes Status");
2172 node_num = 1;
2173 for(i = 0; i < 31; i++)
2175 field_tree = proto_tree_add_subtree_format(netw_nodes_sts_tree, tvb, offset, 1,
2176 ett_omron_netw_node_sts, NULL, "Node Number %d", node_num);
2177 proto_tree_add_item(field_tree, hf_omron_netw_node_sts_low_3, tvb, offset, 1, ENC_BIG_ENDIAN);
2178 proto_tree_add_item(field_tree, hf_omron_netw_node_sts_low_2, tvb, offset, 1, ENC_BIG_ENDIAN);
2179 proto_tree_add_item(field_tree, hf_omron_netw_node_sts_low_1, tvb, offset, 1, ENC_BIG_ENDIAN);
2180 proto_tree_add_item(field_tree, hf_omron_netw_node_sts_low_0, tvb, offset, 1, ENC_BIG_ENDIAN);
2181 node_num = node_num + 1;
2183 field_tree = proto_tree_add_subtree_format(netw_nodes_sts_tree, tvb, offset, 1,
2184 ett_omron_netw_node_sts, NULL, "Node Number %d", node_num);
2185 proto_tree_add_item(field_tree, hf_omron_netw_node_sts_high_3, tvb, offset, 1, ENC_BIG_ENDIAN);
2186 proto_tree_add_item(field_tree, hf_omron_netw_node_sts_high_2, tvb, offset, 1, ENC_BIG_ENDIAN);
2187 proto_tree_add_item(field_tree, hf_omron_netw_node_sts_high_1, tvb, offset, 1, ENC_BIG_ENDIAN);
2188 proto_tree_add_item(field_tree, hf_omron_netw_node_sts_high_0, tvb, offset, 1, ENC_BIG_ENDIAN);
2189 node_num = node_num + 1;
2191 offset = offset + 1;
2194 proto_tree_add_item(command_tree, hf_omron_com_cycle_time, tvb, offset, 2, ENC_BIG_ENDIAN);
2195 proto_tree_add_item(command_tree, hf_omron_polling_unit_node_num, tvb, (offset+2), 1, ENC_BIG_ENDIAN);
2196 proto_tree_add_item(command_tree, hf_omron_cyclic_operation, tvb, (offset+3), 1, ENC_BIG_ENDIAN);
2197 proto_tree_add_item(command_tree, hf_omron_cyclic_trans_status, tvb, (offset+4), 1, ENC_BIG_ENDIAN);
2198 offset =offset + 5;
2200 netw_nodes_non_fatal_err_sts_tree = proto_tree_add_subtree(command_tree, tvb, offset, 8,
2201 ett_omron_netw_nodes_non_fatal_err_sts, NULL, "Network Nodes Non-Fatal Error Status");
2203 proto_tree_add_bitmask(netw_nodes_non_fatal_err_sts_tree, tvb, (offset+0), hf_omron_cyclic_label_1,
2204 ett_omron_cyclic_fields, cyclic_non_fatal_1_fields, ENC_BIG_ENDIAN);
2205 proto_tree_add_bitmask(netw_nodes_non_fatal_err_sts_tree, tvb, (offset+1), hf_omron_cyclic_label_2,
2206 ett_omron_cyclic_fields, cyclic_non_fatal_2_fields, ENC_BIG_ENDIAN);
2207 proto_tree_add_bitmask(netw_nodes_non_fatal_err_sts_tree, tvb, (offset+2), hf_omron_cyclic_label_3,
2208 ett_omron_cyclic_fields, cyclic_non_fatal_3_fields, ENC_BIG_ENDIAN);
2209 proto_tree_add_bitmask(netw_nodes_non_fatal_err_sts_tree, tvb, (offset+3), hf_omron_cyclic_label_4,
2210 ett_omron_cyclic_fields, cyclic_non_fatal_4_fields, ENC_BIG_ENDIAN);
2211 proto_tree_add_bitmask(netw_nodes_non_fatal_err_sts_tree, tvb, (offset+4), hf_omron_cyclic_label_5,
2212 ett_omron_cyclic_fields, cyclic_non_fatal_5_fields, ENC_BIG_ENDIAN);
2213 proto_tree_add_bitmask(netw_nodes_non_fatal_err_sts_tree, tvb, (offset+5), hf_omron_cyclic_label_6,
2214 ett_omron_cyclic_fields, cyclic_non_fatal_6_fields, ENC_BIG_ENDIAN);
2215 proto_tree_add_bitmask(netw_nodes_non_fatal_err_sts_tree, tvb, (offset+6), hf_omron_cyclic_label_7,
2216 ett_omron_cyclic_fields, cyclic_non_fatal_7_fields, ENC_BIG_ENDIAN);
2217 proto_tree_add_bitmask(netw_nodes_non_fatal_err_sts_tree, tvb, (offset+7), hf_omron_cyclic_label_8,
2218 ett_omron_cyclic_fields, cyclic_non_fatal_8_fields, ENC_BIG_ENDIAN);
2220 offset = offset + 8;
2222 netw_nodes_cyclic_err_ctrs_tree = proto_tree_add_subtree(command_tree, tvb, offset, 62,
2223 ett_omron_netw_nodes_cyclic_err_ctrs, NULL, "Network Nodes Cyclic Error Counters");
2224 node_num = 1;
2225 for(i = 0; i < 62; i++)
2227 uint8_t ctr = tvb_get_uint8(tvb, offset);
2228 proto_tree_add_uint_format(netw_nodes_cyclic_err_ctrs_tree, hf_omron_node_error_count,
2229 tvb, offset, 1, ctr, "Node Number %2d: %3d", node_num, ctr);
2230 node_num = node_num + 1;
2231 offset = offset + 1;
2236 break;
2238 case 0x0603:
2240 /* command data length is 0 */
2242 if(is_response)
2244 if(reported_length_remaining == 16)
2246 proto_tree *status_flags_tree;
2248 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
2250 /* add status flag tree */
2251 ti = proto_tree_add_item(command_tree, hf_omron_status_flags, tvb, (offset+2), 1, ENC_BIG_ENDIAN);
2252 omron_status_tree = proto_item_add_subtree(ti, ett_omron_status_block);
2253 proto_tree_add_item(omron_status_tree, hf_omron_status_flags_slave_master, tvb, (offset+2), 1, ENC_BIG_ENDIAN);
2254 proto_tree_add_item(omron_status_tree, hf_omron_status_flags_data_link, tvb, (offset+2), 1, ENC_BIG_ENDIAN);
2256 /* command_tree for master node */
2257 proto_tree_add_item(command_tree, hf_omron_master_node_number, tvb, (offset+3), 1, ENC_BIG_ENDIAN);
2258 offset = offset + 4;
2260 /* Status flag blocks */
2261 status_flags_tree = proto_tree_add_subtree(command_tree, tvb, offset, 96, ett_omron_data_link_status_tree, NULL, "Status flag blocks");
2263 /* Status block 1 */
2264 ti = proto_tree_add_item(status_flags_tree, hf_omron_status_flags, tvb, (offset+0), 3, ENC_BIG_ENDIAN);
2265 omron_status_tree = proto_item_add_subtree(ti, ett_omron_status_block);
2266 proto_tree_add_item(omron_status_tree, hf_omron_status_node_0, tvb, (offset+0), 1, ENC_BIG_ENDIAN);
2267 proto_tree_add_item(omron_status_tree, hf_omron_status_node_1, tvb, (offset+0), 1, ENC_BIG_ENDIAN);
2268 proto_tree_add_item(omron_status_tree, hf_omron_status_node_2, tvb, (offset+0), 1, ENC_BIG_ENDIAN);
2269 proto_tree_add_item(omron_status_tree, hf_omron_status_node_3, tvb, (offset+0), 1, ENC_BIG_ENDIAN);
2270 proto_tree_add_item(omron_status_tree, hf_omron_status_node_4, tvb, (offset+0), 1, ENC_BIG_ENDIAN);
2271 proto_tree_add_item(omron_status_tree, hf_omron_status_node_5, tvb, (offset+0), 1, ENC_BIG_ENDIAN);
2272 proto_tree_add_item(omron_status_tree, hf_omron_status_node_6, tvb, (offset+0), 1, ENC_BIG_ENDIAN);
2273 proto_tree_add_item(omron_status_tree, hf_omron_status_node_7, tvb, (offset+0), 1, ENC_BIG_ENDIAN);
2275 ti = proto_tree_add_item(status_flags_tree, hf_omron_status_flags, tvb, (offset+0), 3, ENC_BIG_ENDIAN);
2276 omron_status_tree = proto_item_add_subtree(ti, ett_omron_status_block);
2277 proto_tree_add_item(omron_status_tree, hf_omron_status_1_node_0, tvb, (offset+1), 1, ENC_BIG_ENDIAN);
2278 proto_tree_add_item(omron_status_tree, hf_omron_status_1_node_1, tvb, (offset+1), 1, ENC_BIG_ENDIAN);
2279 proto_tree_add_item(omron_status_tree, hf_omron_status_1_node_2, tvb, (offset+1), 1, ENC_BIG_ENDIAN);
2280 proto_tree_add_item(omron_status_tree, hf_omron_status_1_node_3, tvb, (offset+1), 1, ENC_BIG_ENDIAN);
2281 proto_tree_add_item(omron_status_tree, hf_omron_status_1_node_4, tvb, (offset+1), 1, ENC_BIG_ENDIAN);
2282 proto_tree_add_item(omron_status_tree, hf_omron_status_1_node_5, tvb, (offset+1), 1, ENC_BIG_ENDIAN);
2283 proto_tree_add_item(omron_status_tree, hf_omron_status_1_node_6, tvb, (offset+1), 1, ENC_BIG_ENDIAN);
2284 proto_tree_add_item(omron_status_tree, hf_omron_status_1_node_7, tvb, (offset+1), 1, ENC_BIG_ENDIAN);
2286 ti = proto_tree_add_item(status_flags_tree, hf_omron_status_flags, tvb, (offset+0), 3, ENC_BIG_ENDIAN);
2287 omron_status_tree = proto_item_add_subtree(ti, ett_omron_status_block);
2288 proto_tree_add_item(omron_status_tree, hf_omron_status_2_node_0, tvb, (offset+2), 1, ENC_BIG_ENDIAN);
2289 proto_tree_add_item(omron_status_tree, hf_omron_status_2_node_1, tvb, (offset+2), 1, ENC_BIG_ENDIAN);
2290 proto_tree_add_item(omron_status_tree, hf_omron_status_2_node_2, tvb, (offset+2), 1, ENC_BIG_ENDIAN);
2291 proto_tree_add_item(omron_status_tree, hf_omron_status_2_node_3, tvb, (offset+2), 1, ENC_BIG_ENDIAN);
2292 proto_tree_add_item(omron_status_tree, hf_omron_status_2_node_4, tvb, (offset+2), 1, ENC_BIG_ENDIAN);
2293 proto_tree_add_item(omron_status_tree, hf_omron_status_2_node_5, tvb, (offset+2), 1, ENC_BIG_ENDIAN);
2294 proto_tree_add_item(omron_status_tree, hf_omron_status_2_node_6, tvb, (offset+2), 1, ENC_BIG_ENDIAN);
2295 proto_tree_add_item(omron_status_tree, hf_omron_status_2_node_7, tvb, (offset+2), 1, ENC_BIG_ENDIAN);
2297 /* status block 2 */
2298 ti = proto_tree_add_item(status_flags_tree, hf_omron_status_flags, tvb, (offset+3), 3, ENC_BIG_ENDIAN);
2299 omron_status_tree = proto_item_add_subtree(ti, ett_omron_status_block);
2300 proto_tree_add_item(omron_status_tree, hf_omron_status_node_0, tvb, (offset+3), 1, ENC_BIG_ENDIAN);
2301 proto_tree_add_item(omron_status_tree, hf_omron_status_node_1, tvb, (offset+3), 1, ENC_BIG_ENDIAN);
2302 proto_tree_add_item(omron_status_tree, hf_omron_status_node_2, tvb, (offset+3), 1, ENC_BIG_ENDIAN);
2303 proto_tree_add_item(omron_status_tree, hf_omron_status_node_3, tvb, (offset+3), 1, ENC_BIG_ENDIAN);
2304 proto_tree_add_item(omron_status_tree, hf_omron_status_node_4, tvb, (offset+3), 1, ENC_BIG_ENDIAN);
2305 proto_tree_add_item(omron_status_tree, hf_omron_status_node_5, tvb, (offset+3), 1, ENC_BIG_ENDIAN);
2306 proto_tree_add_item(omron_status_tree, hf_omron_status_node_6, tvb, (offset+3), 1, ENC_BIG_ENDIAN);
2307 proto_tree_add_item(omron_status_tree, hf_omron_status_node_7, tvb, (offset+3), 1, ENC_BIG_ENDIAN);
2309 ti = proto_tree_add_item(status_flags_tree, hf_omron_status_flags, tvb, (offset+3), 3, ENC_BIG_ENDIAN);
2310 omron_status_tree = proto_item_add_subtree(ti, ett_omron_status_block);
2311 proto_tree_add_item(omron_status_tree, hf_omron_status_1_node_0, tvb, (offset+4), 1, ENC_BIG_ENDIAN);
2312 proto_tree_add_item(omron_status_tree, hf_omron_status_1_node_1, tvb, (offset+4), 1, ENC_BIG_ENDIAN);
2313 proto_tree_add_item(omron_status_tree, hf_omron_status_1_node_2, tvb, (offset+4), 1, ENC_BIG_ENDIAN);
2314 proto_tree_add_item(omron_status_tree, hf_omron_status_1_node_3, tvb, (offset+4), 1, ENC_BIG_ENDIAN);
2315 proto_tree_add_item(omron_status_tree, hf_omron_status_1_node_4, tvb, (offset+4), 1, ENC_BIG_ENDIAN);
2316 proto_tree_add_item(omron_status_tree, hf_omron_status_1_node_5, tvb, (offset+4), 1, ENC_BIG_ENDIAN);
2317 proto_tree_add_item(omron_status_tree, hf_omron_status_1_node_6, tvb, (offset+4), 1, ENC_BIG_ENDIAN);
2318 proto_tree_add_item(omron_status_tree, hf_omron_status_1_node_7, tvb, (offset+4), 1, ENC_BIG_ENDIAN);
2320 ti = proto_tree_add_item(status_flags_tree, hf_omron_status_flags, tvb, (offset+3), 3, ENC_BIG_ENDIAN);
2321 omron_status_tree = proto_item_add_subtree(ti, ett_omron_status_block);
2322 proto_tree_add_item(omron_status_tree, hf_omron_status_2_node_0, tvb, (offset+5), 1, ENC_BIG_ENDIAN);
2323 proto_tree_add_item(omron_status_tree, hf_omron_status_2_node_1, tvb, (offset+5), 1, ENC_BIG_ENDIAN);
2324 proto_tree_add_item(omron_status_tree, hf_omron_status_2_node_2, tvb, (offset+5), 1, ENC_BIG_ENDIAN);
2325 proto_tree_add_item(omron_status_tree, hf_omron_status_2_node_3, tvb, (offset+5), 1, ENC_BIG_ENDIAN);
2326 proto_tree_add_item(omron_status_tree, hf_omron_status_2_node_4, tvb, (offset+5), 1, ENC_BIG_ENDIAN);
2327 proto_tree_add_item(omron_status_tree, hf_omron_status_2_node_5, tvb, (offset+5), 1, ENC_BIG_ENDIAN);
2328 proto_tree_add_item(omron_status_tree, hf_omron_status_2_node_6, tvb, (offset+5), 1, ENC_BIG_ENDIAN);
2329 proto_tree_add_item(omron_status_tree, hf_omron_status_2_node_7, tvb, (offset+5), 1, ENC_BIG_ENDIAN);
2331 /* status block 3 */
2332 ti = proto_tree_add_item(status_flags_tree, hf_omron_status_flags, tvb, (offset+6), 3, ENC_BIG_ENDIAN);
2333 omron_status_tree = proto_item_add_subtree(ti, ett_omron_status_block);
2334 proto_tree_add_item(omron_status_tree, hf_omron_status_node_0, tvb, (offset+6), 1, ENC_BIG_ENDIAN);
2335 proto_tree_add_item(omron_status_tree, hf_omron_status_node_1, tvb, (offset+6), 1, ENC_BIG_ENDIAN);
2336 proto_tree_add_item(omron_status_tree, hf_omron_status_node_2, tvb, (offset+6), 1, ENC_BIG_ENDIAN);
2337 proto_tree_add_item(omron_status_tree, hf_omron_status_node_3, tvb, (offset+6), 1, ENC_BIG_ENDIAN);
2338 proto_tree_add_item(omron_status_tree, hf_omron_status_node_4, tvb, (offset+6), 1, ENC_BIG_ENDIAN);
2339 proto_tree_add_item(omron_status_tree, hf_omron_status_node_5, tvb, (offset+6), 1, ENC_BIG_ENDIAN);
2340 proto_tree_add_item(omron_status_tree, hf_omron_status_node_6, tvb, (offset+6), 1, ENC_BIG_ENDIAN);
2341 proto_tree_add_item(omron_status_tree, hf_omron_status_node_7, tvb, (offset+6), 1, ENC_BIG_ENDIAN);
2343 ti = proto_tree_add_item(status_flags_tree, hf_omron_status_flags, tvb, (offset+6), 3, ENC_BIG_ENDIAN);
2344 omron_status_tree = proto_item_add_subtree(ti, ett_omron_status_block);
2345 proto_tree_add_item(omron_status_tree, hf_omron_status_1_node_0, tvb, (offset+7), 1, ENC_BIG_ENDIAN);
2346 proto_tree_add_item(omron_status_tree, hf_omron_status_1_node_1, tvb, (offset+7), 1, ENC_BIG_ENDIAN);
2347 proto_tree_add_item(omron_status_tree, hf_omron_status_1_node_2, tvb, (offset+7), 1, ENC_BIG_ENDIAN);
2348 proto_tree_add_item(omron_status_tree, hf_omron_status_1_node_3, tvb, (offset+7), 1, ENC_BIG_ENDIAN);
2349 proto_tree_add_item(omron_status_tree, hf_omron_status_1_node_4, tvb, (offset+7), 1, ENC_BIG_ENDIAN);
2350 proto_tree_add_item(omron_status_tree, hf_omron_status_1_node_5, tvb, (offset+7), 1, ENC_BIG_ENDIAN);
2351 proto_tree_add_item(omron_status_tree, hf_omron_status_1_node_6, tvb, (offset+7), 1, ENC_BIG_ENDIAN);
2352 proto_tree_add_item(omron_status_tree, hf_omron_status_1_node_7, tvb, (offset+7), 1, ENC_BIG_ENDIAN);
2354 ti = proto_tree_add_item(status_flags_tree, hf_omron_status_flags, tvb, (offset+6), 3, ENC_BIG_ENDIAN);
2355 omron_status_tree = proto_item_add_subtree(ti, ett_omron_status_block);
2356 proto_tree_add_item(omron_status_tree, hf_omron_status_2_node_0, tvb, (offset+8), 1, ENC_BIG_ENDIAN);
2357 proto_tree_add_item(omron_status_tree, hf_omron_status_2_node_1, tvb, (offset+8), 1, ENC_BIG_ENDIAN);
2358 proto_tree_add_item(omron_status_tree, hf_omron_status_2_node_2, tvb, (offset+8), 1, ENC_BIG_ENDIAN);
2359 proto_tree_add_item(omron_status_tree, hf_omron_status_2_node_3, tvb, (offset+8), 1, ENC_BIG_ENDIAN);
2360 proto_tree_add_item(omron_status_tree, hf_omron_status_2_node_4, tvb, (offset+8), 1, ENC_BIG_ENDIAN);
2361 proto_tree_add_item(omron_status_tree, hf_omron_status_2_node_5, tvb, (offset+8), 1, ENC_BIG_ENDIAN);
2362 proto_tree_add_item(omron_status_tree, hf_omron_status_2_node_6, tvb, (offset+8), 1, ENC_BIG_ENDIAN);
2363 proto_tree_add_item(omron_status_tree, hf_omron_status_2_node_7, tvb, (offset+8), 1, ENC_BIG_ENDIAN);
2365 /* status block 4 */
2366 ti = proto_tree_add_item(status_flags_tree, hf_omron_status_flags, tvb, (offset+9), 3, ENC_BIG_ENDIAN);
2367 omron_status_tree = proto_item_add_subtree(ti, ett_omron_status_block);
2368 proto_tree_add_item(omron_status_tree, hf_omron_status_node_0, tvb, (offset+9), 1, ENC_BIG_ENDIAN);
2369 proto_tree_add_item(omron_status_tree, hf_omron_status_node_1, tvb, (offset+9), 1, ENC_BIG_ENDIAN);
2370 proto_tree_add_item(omron_status_tree, hf_omron_status_node_2, tvb, (offset+9), 1, ENC_BIG_ENDIAN);
2371 proto_tree_add_item(omron_status_tree, hf_omron_status_node_3, tvb, (offset+9), 1, ENC_BIG_ENDIAN);
2372 proto_tree_add_item(omron_status_tree, hf_omron_status_node_4, tvb, (offset+9), 1, ENC_BIG_ENDIAN);
2373 proto_tree_add_item(omron_status_tree, hf_omron_status_node_5, tvb, (offset+9), 1, ENC_BIG_ENDIAN);
2374 proto_tree_add_item(omron_status_tree, hf_omron_status_node_6, tvb, (offset+9), 1, ENC_BIG_ENDIAN);
2375 proto_tree_add_item(omron_status_tree, hf_omron_status_node_7, tvb, (offset+9), 1, ENC_BIG_ENDIAN);
2377 ti = proto_tree_add_item(status_flags_tree, hf_omron_status_flags, tvb, (offset+9), 3, ENC_BIG_ENDIAN);
2378 omron_status_tree = proto_item_add_subtree(ti, ett_omron_status_block);
2379 proto_tree_add_item(omron_status_tree, hf_omron_status_1_node_0, tvb, (offset+10), 1, ENC_BIG_ENDIAN);
2380 proto_tree_add_item(omron_status_tree, hf_omron_status_1_node_1, tvb, (offset+10), 1, ENC_BIG_ENDIAN);
2381 proto_tree_add_item(omron_status_tree, hf_omron_status_1_node_2, tvb, (offset+10), 1, ENC_BIG_ENDIAN);
2382 proto_tree_add_item(omron_status_tree, hf_omron_status_1_node_3, tvb, (offset+10), 1, ENC_BIG_ENDIAN);
2383 proto_tree_add_item(omron_status_tree, hf_omron_status_1_node_4, tvb, (offset+10), 1, ENC_BIG_ENDIAN);
2384 proto_tree_add_item(omron_status_tree, hf_omron_status_1_node_5, tvb, (offset+10), 1, ENC_BIG_ENDIAN);
2385 proto_tree_add_item(omron_status_tree, hf_omron_status_1_node_6, tvb, (offset+10), 1, ENC_BIG_ENDIAN);
2386 proto_tree_add_item(omron_status_tree, hf_omron_status_1_node_7, tvb, (offset+10), 1, ENC_BIG_ENDIAN);
2388 ti = proto_tree_add_item(status_flags_tree, hf_omron_status_flags, tvb, (offset+9), 3, ENC_BIG_ENDIAN);
2389 omron_status_tree = proto_item_add_subtree(ti, ett_omron_status_block);
2390 proto_tree_add_item(omron_status_tree, hf_omron_status_2_node_0, tvb, (offset+11), 1, ENC_BIG_ENDIAN);
2391 proto_tree_add_item(omron_status_tree, hf_omron_status_2_node_1, tvb, (offset+11), 1, ENC_BIG_ENDIAN);
2392 proto_tree_add_item(omron_status_tree, hf_omron_status_2_node_2, tvb, (offset+11), 1, ENC_BIG_ENDIAN);
2393 proto_tree_add_item(omron_status_tree, hf_omron_status_2_node_3, tvb, (offset+11), 1, ENC_BIG_ENDIAN);
2394 proto_tree_add_item(omron_status_tree, hf_omron_status_2_node_4, tvb, (offset+11), 1, ENC_BIG_ENDIAN);
2395 proto_tree_add_item(omron_status_tree, hf_omron_status_2_node_5, tvb, (offset+11), 1, ENC_BIG_ENDIAN);
2396 proto_tree_add_item(omron_status_tree, hf_omron_status_2_node_6, tvb, (offset+11), 1, ENC_BIG_ENDIAN);
2397 proto_tree_add_item(omron_status_tree, hf_omron_status_2_node_7, tvb, (offset+11), 1, ENC_BIG_ENDIAN);
2399 offset = offset + 12;
2403 break;
2405 case 0x0620:
2407 if(is_command)
2409 if(reported_length_remaining == 1)
2411 proto_tree_add_item(command_tree, hf_omron_parameter, tvb, offset, 1, ENC_BIG_ENDIAN);
2412 offset = offset + 1;
2416 if(is_response)
2418 if(reported_length_remaining == 2)
2420 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
2421 offset = offset + 2;
2424 else if(reported_length_remaining == 14)
2426 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
2427 proto_tree_add_item(command_tree, hf_omron_avg_cycle_time, tvb, (offset+2), 4, ENC_BIG_ENDIAN);
2428 proto_tree_add_item(command_tree, hf_omron_max_cycle_time, tvb, (offset+6), 4, ENC_BIG_ENDIAN);
2429 proto_tree_add_item(command_tree, hf_omron_min_cycle_time, tvb, (offset+10), 4, ENC_BIG_ENDIAN);
2430 offset = offset + 14;
2434 break;
2436 case 0x0701:
2438 /* command data length is 0 */
2440 if(is_response)
2442 if(reported_length_remaining == 9)
2444 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
2445 proto_tree_add_item(command_tree, hf_omron_year, tvb, (offset+2), 1, ENC_BIG_ENDIAN);
2446 proto_tree_add_item(command_tree, hf_omron_month, tvb, (offset+3), 1, ENC_BIG_ENDIAN);
2447 proto_tree_add_item(command_tree, hf_omron_date, tvb, (offset+4), 1, ENC_BIG_ENDIAN);
2448 proto_tree_add_item(command_tree, hf_omron_hour, tvb, (offset+5), 1, ENC_BIG_ENDIAN);
2449 proto_tree_add_item(command_tree, hf_omron_minute, tvb, (offset+6), 1, ENC_BIG_ENDIAN);
2450 proto_tree_add_item(command_tree, hf_omron_second, tvb, (offset+7), 1, ENC_BIG_ENDIAN);
2451 proto_tree_add_item(command_tree, hf_omron_day, tvb, (offset+8), 1, ENC_BIG_ENDIAN);
2452 offset = offset + 9;
2456 break;
2458 case 0x0702:
2460 if(is_command)
2462 if(reported_length_remaining >= 5)
2464 proto_tree_add_item(command_tree, hf_omron_year, tvb, (offset), 1, ENC_BIG_ENDIAN);
2465 proto_tree_add_item(command_tree, hf_omron_month, tvb, (offset+1), 1, ENC_BIG_ENDIAN);
2466 proto_tree_add_item(command_tree, hf_omron_date, tvb, (offset+2), 1, ENC_BIG_ENDIAN);
2467 proto_tree_add_item(command_tree, hf_omron_hour, tvb, (offset+3), 1, ENC_BIG_ENDIAN);
2468 proto_tree_add_item(command_tree, hf_omron_minute, tvb, (offset+4), 1, ENC_BIG_ENDIAN);
2470 if(reported_length_remaining == 7)
2472 proto_tree_add_item(command_tree, hf_omron_second, tvb, (offset+5), 1, ENC_BIG_ENDIAN);
2473 proto_tree_add_item(command_tree, hf_omron_day, tvb, (offset+6), 1, ENC_BIG_ENDIAN);
2474 offset = offset + 2;
2476 offset = offset + 5;
2480 if(is_response)
2482 if(reported_length_remaining == 2)
2484 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
2485 offset = offset + 2;
2489 break;
2491 case 0x0801:
2493 if(is_command)
2495 /* zero-length case handled in previous switch statement */
2496 if(reported_length_remaining > 0)
2498 proto_tree_add_item(command_tree, hf_omron_data, tvb, offset, -1, ENC_NA);
2499 offset = offset + reported_length_remaining;
2503 if(is_response)
2505 if(reported_length_remaining > 2)
2507 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
2508 proto_tree_add_item(command_tree, hf_omron_data, tvb, (offset+2), -1, ENC_NA);
2509 offset = offset + reported_length_remaining;
2513 break;
2515 case 0x0802:
2517 if(is_response)
2519 if(reported_length_remaining == 4)
2521 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
2522 proto_tree_add_item(command_tree, hf_omron_num_receptions, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
2523 offset = offset + 4;
2527 break;
2529 case 0x0803:
2531 if(is_command)
2533 /* zero-length case handled in previous switch statement */
2534 if(reported_length_remaining > 0)
2536 proto_tree_add_item(command_tree, hf_omron_data, tvb, offset, -1, ENC_NA);
2537 offset = offset + reported_length_remaining;
2541 break;
2543 case 0x0920:
2545 if(is_command)
2547 if(reported_length_remaining == 2)
2549 if((tvb_get_ntohs(tvb, offset) & 0xC000) == 0x8000)
2551 /* "FAL/FALS READ" */
2552 proto_tree_add_item(command_tree, hf_omron_fals, tvb, offset, 2, ENC_BIG_ENDIAN);
2554 else
2556 /* "MESSAGE READ" / "MESSAGE CLEAR" */
2557 /* add bitmask for message yes/no data */
2558 proto_tree_add_bitmask(command_tree, tvb, offset, hf_omron_message,
2559 ett_message_fields, message_yes_no_fields, ENC_BIG_ENDIAN);
2561 offset = offset + 2;
2565 if(is_response)
2567 if(reported_length_remaining == 2)
2569 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
2570 offset = offset + 2;
2572 else if(reported_length_remaining == 20)
2574 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
2575 proto_tree_add_item(command_tree, hf_omron_fals, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
2576 proto_tree_add_item(command_tree, hf_omron_error_message, tvb, (offset+4), 16, ENC_ASCII);
2577 offset = offset + 20;
2579 else if(reported_length_remaining >= 4)
2581 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
2582 /* add bitmask for message yes/no data */
2583 proto_tree_add_bitmask(command_tree, tvb, (offset+2), hf_omron_message,
2584 ett_message_fields, message_yes_no_fields, ENC_BIG_ENDIAN);
2586 offset = offset + 4;
2587 reported_length_remaining = reported_length_remaining - 4;
2589 while (reported_length_remaining >= 32)
2591 proto_tree_add_item(command_tree, hf_omron_read_message, tvb, offset, 32, ENC_ASCII);
2592 offset = offset + 32;
2593 reported_length_remaining = reported_length_remaining - 32;
2598 break;
2600 case 0x0C01:
2602 if(is_command)
2604 if(reported_length_remaining == 2)
2606 proto_tree_add_item(command_tree, hf_omron_program_number, tvb, offset, 2, ENC_BIG_ENDIAN);
2607 offset = offset + 2;
2611 if(is_response)
2613 if(reported_length_remaining == 2)
2615 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
2616 offset = offset + 2;
2618 else if(reported_length_remaining == 5)
2620 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
2621 proto_tree_add_item(command_tree, hf_omron_unit_address, tvb, (offset+2), 1, ENC_BIG_ENDIAN);
2622 proto_tree_add_item(command_tree, hf_omron_node_number, tvb, (offset+3), 1, ENC_BIG_ENDIAN);
2623 proto_tree_add_item(command_tree, hf_omron_network_address, tvb, (offset+4), 1, ENC_BIG_ENDIAN);
2624 offset = offset + 5;
2629 break;
2631 case 0x0C02:
2633 if(is_command)
2635 if(reported_length_remaining == 2)
2637 proto_tree_add_item(command_tree, hf_omron_program_number, tvb, offset, 2, ENC_BIG_ENDIAN);
2638 offset = offset + 2;
2642 if(is_response)
2644 if(reported_length_remaining == 2)
2646 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
2647 offset = offset + 2;
2652 break;
2654 case 0x0C03:
2656 if(is_command)
2658 if(reported_length_remaining == 2)
2660 proto_tree_add_item(command_tree, hf_omron_program_number, tvb, offset, 2, ENC_BIG_ENDIAN);
2661 offset = offset + 2;
2665 if(is_response)
2667 if(reported_length_remaining == 2)
2669 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
2670 offset = offset + 2;
2675 break;
2677 case 0x2101:
2679 if(is_command)
2681 if(reported_length_remaining == 2)
2683 proto_tree_add_item(command_tree, hf_omron_error_reset_fals_no, tvb, offset, 2, ENC_BIG_ENDIAN);
2684 offset = offset + 2;
2688 if(is_response)
2690 if(reported_length_remaining == 2)
2692 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
2693 offset = offset + 2;
2698 break;
2700 case 0x2102:
2702 if(is_command)
2704 if(reported_length_remaining == 4)
2706 proto_tree_add_item(command_tree, hf_omron_beginning_record_no, tvb, offset, 2, ENC_BIG_ENDIAN);
2707 proto_tree_add_item(command_tree, hf_omron_no_of_records, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
2708 offset = offset + 4;
2712 if(is_response)
2714 if(reported_length_remaining >= 8)
2716 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
2717 proto_tree_add_item(command_tree, hf_omron_max_no_of_stored_records, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
2718 proto_tree_add_item(command_tree, hf_omron_no_of_stored_records, tvb, (offset+4), 2, ENC_BIG_ENDIAN);
2719 proto_tree_add_item(command_tree, hf_omron_no_of_records, tvb, (offset+6), 2, ENC_BIG_ENDIAN);
2720 offset = offset + 8;
2721 reported_length_remaining = reported_length_remaining - 8;
2723 while(reported_length_remaining >= 10)
2725 error_log_tree = proto_tree_add_subtree(command_tree, tvb, offset, 10, ett_omron_error_log_data, NULL, "Error log data");
2727 proto_tree_add_item(error_log_tree, hf_omron_error_reset_fals_no, tvb, offset, 2, ENC_BIG_ENDIAN);
2728 proto_tree_add_item(error_log_tree, hf_omron_error_reset_fals_no, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
2729 proto_tree_add_item(error_log_tree, hf_omron_minute, tvb, (offset+4), 1, ENC_BIG_ENDIAN);
2730 proto_tree_add_item(error_log_tree, hf_omron_second, tvb, (offset+5), 1, ENC_BIG_ENDIAN);
2731 proto_tree_add_item(error_log_tree, hf_omron_day, tvb, (offset+6), 1, ENC_BIG_ENDIAN);
2732 proto_tree_add_item(error_log_tree, hf_omron_hour, tvb, (offset+7), 1, ENC_BIG_ENDIAN);
2733 proto_tree_add_item(error_log_tree, hf_omron_year, tvb, (offset+8), 1, ENC_BIG_ENDIAN);
2734 proto_tree_add_item(error_log_tree, hf_omron_month, tvb, (offset+9), 1, ENC_BIG_ENDIAN);
2736 offset = offset + 10;
2737 reported_length_remaining = reported_length_remaining - 10;
2742 break;
2744 case 0x2103:
2746 /* command data length is 0 */
2748 if(is_response)
2750 if(reported_length_remaining == 2)
2752 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
2753 offset = offset + 2;
2757 break;
2759 case 0x2201:
2761 if(is_command)
2763 if(reported_length_remaining == 6)
2765 proto_tree_add_item(command_tree, hf_omron_disk_no, tvb, offset, 2, ENC_BIG_ENDIAN);
2766 proto_tree_add_item(command_tree, hf_omron_beginning_file_position, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
2767 proto_tree_add_item(command_tree, hf_omron_no_of_files, tvb, (offset+4), 2, ENC_BIG_ENDIAN);
2768 offset = offset + 6;
2772 if(is_response)
2774 if(reported_length_remaining >= 50)
2776 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
2778 omron_disk_data_tree = proto_tree_add_subtree(command_tree, tvb, (offset+2), 26, ett_omron_disk_data, NULL, "Disk data");
2779 proto_tree_add_item(omron_disk_data_tree, hf_omron_volume_label, tvb, (offset+2), 12, ENC_ASCII);
2781 omron_byte = tvb_get_uint8(tvb, (offset+14));
2782 proto_tree_add_uint_format_value(omron_disk_data_tree, hf_omron_date_year, tvb, (offset+14), 1, omron_byte,
2783 "%d", ((omron_byte>>1)+1980));
2785 proto_tree_add_item(omron_disk_data_tree, hf_omron_date_month, tvb, (offset+14), 4, ENC_BIG_ENDIAN);
2786 proto_tree_add_item(omron_disk_data_tree, hf_omron_date_day, tvb, (offset+14), 4, ENC_BIG_ENDIAN);
2787 proto_tree_add_item(omron_disk_data_tree, hf_omron_date_hour, tvb, (offset+14), 4, ENC_BIG_ENDIAN);
2788 proto_tree_add_item(omron_disk_data_tree, hf_omron_date_minute, tvb, (offset+14), 4, ENC_BIG_ENDIAN);
2790 omron_byte = tvb_get_uint8(tvb, (offset+17));
2791 proto_tree_add_uint_format_value(omron_disk_data_tree, hf_omron_date_second, tvb, (offset+17), 1, omron_byte,
2792 "%d", ((omron_byte&0x1F)*2));
2794 proto_tree_add_item(omron_disk_data_tree, hf_omron_total_capacity, tvb, (offset+18), 4, ENC_BIG_ENDIAN);
2795 proto_tree_add_item(omron_disk_data_tree, hf_omron_unused_capacity, tvb, (offset+22), 4, ENC_BIG_ENDIAN);
2796 proto_tree_add_item(omron_disk_data_tree, hf_omron_total_no_files, tvb, (offset+26), 2, ENC_BIG_ENDIAN);
2797 proto_tree_add_item(omron_disk_data_tree, hf_omron_no_files, tvb, (offset+28), 2, ENC_BIG_ENDIAN);
2799 offset = offset + 30;
2800 reported_length_remaining = reported_length_remaining - 30;
2802 while(reported_length_remaining >= 20)
2804 omron_file_data_tree = proto_tree_add_subtree(command_tree, tvb, offset, 20, ett_omron_file_data, NULL, "File data");
2806 proto_tree_add_item(omron_file_data_tree, hf_omron_filename, tvb, offset, 12, ENC_ASCII);
2808 omron_byte = tvb_get_uint8(tvb, (offset+12));
2809 proto_tree_add_uint_format_value(omron_file_data_tree, hf_omron_date_year, tvb, (offset+12), 1, omron_byte,
2810 "%d", ((omron_byte>>1)+1980));
2812 proto_tree_add_item(omron_file_data_tree, hf_omron_date_month, tvb, (offset+12), 4, ENC_BIG_ENDIAN);
2813 proto_tree_add_item(omron_file_data_tree, hf_omron_date_day, tvb, (offset+12), 4, ENC_BIG_ENDIAN);
2814 proto_tree_add_item(omron_file_data_tree, hf_omron_date_hour, tvb, (offset+12), 4, ENC_BIG_ENDIAN);
2815 proto_tree_add_item(omron_file_data_tree, hf_omron_date_minute, tvb, (offset+12), 4, ENC_BIG_ENDIAN);
2817 omron_byte = tvb_get_uint8(tvb, (offset+15));
2818 proto_tree_add_uint_format_value(omron_file_data_tree, hf_omron_date_second, tvb, (offset+15), 1, omron_byte,
2819 "%d", ((omron_byte&0x1F)*2));
2821 proto_tree_add_item(omron_file_data_tree, hf_omron_file_capacity, tvb, (offset+16), 4, ENC_BIG_ENDIAN);
2823 offset = offset + 20;
2824 reported_length_remaining = reported_length_remaining - 20;
2825 } /* while */
2826 } /* if(reported_length_remaining >= 50) */
2829 break;
2831 case 0x2202:
2833 if(is_command)
2835 if(reported_length_remaining == 20)
2837 proto_tree_add_item(command_tree, hf_omron_disk_no, tvb, offset, 2, ENC_BIG_ENDIAN);
2838 proto_tree_add_item(command_tree, hf_omron_filename, tvb, (offset+2), 12, ENC_ASCII);
2839 proto_tree_add_item(command_tree, hf_omron_file_position, tvb, (offset+14), 4, ENC_BIG_ENDIAN);
2840 proto_tree_add_item(command_tree, hf_omron_data_length, tvb, (offset+18), 2, ENC_BIG_ENDIAN);
2841 offset = offset + 20;
2845 if(is_response)
2847 if(reported_length_remaining >= 12)
2849 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
2850 proto_tree_add_item(command_tree, hf_omron_file_capacity, tvb, (offset+2), 4, ENC_BIG_ENDIAN);
2851 proto_tree_add_item(command_tree, hf_omron_file_position, tvb, (offset+6), 4, ENC_BIG_ENDIAN);
2852 proto_tree_add_item(command_tree, hf_omron_data_length, tvb, (offset+10), 2, ENC_BIG_ENDIAN);
2854 if(reported_length_remaining > 12)
2856 proto_tree_add_item(command_tree, hf_omron_file_data, tvb, (offset+12), -1, ENC_NA);
2858 offset = offset + reported_length_remaining;
2862 break;
2864 case 0x2203:
2866 if(is_command)
2868 if(reported_length_remaining >= 22)
2870 proto_tree_add_item(command_tree, hf_omron_disk_no, tvb, offset, 2, ENC_BIG_ENDIAN);
2871 proto_tree_add_item(command_tree, hf_omron_file_parameter_code, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
2872 proto_tree_add_item(command_tree, hf_omron_filename, tvb, (offset+4), 12, ENC_ASCII);
2873 proto_tree_add_item(command_tree, hf_omron_file_position, tvb, (offset+16), 4, ENC_BIG_ENDIAN);
2874 proto_tree_add_item(command_tree, hf_omron_data_length, tvb, (offset+20), 2, ENC_BIG_ENDIAN);
2875 if(reported_length_remaining > 22)
2877 proto_tree_add_item(command_tree, hf_omron_file_data, tvb, (offset+22), -1, ENC_NA);
2879 offset = offset + reported_length_remaining;
2883 if(is_response)
2885 if(reported_length_remaining == 2)
2887 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
2888 offset = offset + 2;
2892 break;
2894 case 0x2204:
2896 if(is_command)
2898 if(reported_length_remaining == 2)
2900 proto_tree_add_item(command_tree, hf_omron_disk_no, tvb, offset, 2, ENC_BIG_ENDIAN);
2901 offset = offset + 2;
2904 if(is_response)
2906 if(reported_length_remaining == 2)
2908 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
2909 offset = offset + 2;
2913 break;
2915 case 0x2205:
2917 if(is_command)
2919 if(reported_length_remaining >= 16)
2921 proto_tree_add_item(command_tree, hf_omron_disk_no, tvb, offset, 2, ENC_BIG_ENDIAN);
2922 proto_tree_add_item(command_tree, hf_omron_no_files, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
2923 offset = offset + 4;
2924 reported_length_remaining = reported_length_remaining - 4;
2926 while(reported_length_remaining >= 12)
2928 proto_tree_add_item(command_tree, hf_omron_filename, tvb, offset, 12, ENC_ASCII);
2929 offset = offset + 12;
2930 reported_length_remaining = reported_length_remaining - 12;
2935 if(is_response)
2937 if(reported_length_remaining == 4)
2939 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
2940 proto_tree_add_item(command_tree, hf_omron_no_files, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
2941 offset = offset + 4;
2945 break;
2947 case 0x2206:
2949 if(is_command)
2951 if(reported_length_remaining >= 4)
2953 proto_tree_add_item(command_tree, hf_omron_disk_no, tvb, offset, 2, ENC_BIG_ENDIAN);
2954 proto_tree_add_item(command_tree, hf_omron_volume_parameter_code, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
2956 if(reported_length_remaining == 16)
2958 proto_tree_add_item(command_tree, hf_omron_volume_label, tvb, (offset+4), 12, ENC_ASCII);
2959 offset = offset + 12;
2961 offset = offset + 4;
2965 if(is_response)
2967 if(reported_length_remaining == 2)
2969 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
2970 offset = offset + 2;
2974 break;
2976 case 0x2207:
2978 if(is_command)
2980 if(reported_length_remaining == 28)
2982 proto_tree_add_item(command_tree, hf_omron_disk_no, tvb, offset, 2, ENC_BIG_ENDIAN);
2983 proto_tree_add_item(command_tree, hf_omron_filename, tvb, (offset+2), 12, ENC_ASCII);
2984 proto_tree_add_item(command_tree, hf_omron_disk_no, tvb, (offset+14), 2, ENC_BIG_ENDIAN);
2985 proto_tree_add_item(command_tree, hf_omron_filename, tvb, (offset+16), 12, ENC_ASCII);
2986 offset = offset + 28;
2990 if(is_response)
2992 if(reported_length_remaining == 2)
2994 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
2995 offset = offset + 2;
2999 break;
3001 case 0x2208:
3003 if(is_command)
3005 if(reported_length_remaining == 26)
3007 proto_tree_add_item(command_tree, hf_omron_disk_no, tvb, offset, 2, ENC_BIG_ENDIAN);
3008 proto_tree_add_item(command_tree, hf_omron_filename, tvb, (offset+2), 12, ENC_ASCII);
3009 proto_tree_add_item(command_tree, hf_omron_filename, tvb, (offset+14), 12, ENC_ASCII);
3010 offset = offset + 26;
3014 if(is_response)
3016 if(reported_length_remaining == 2)
3018 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
3019 offset = offset + 2;
3023 break;
3025 case 0x2209:
3027 if(is_command)
3029 if(reported_length_remaining == 14)
3031 proto_tree_add_item(command_tree, hf_omron_disk_no, tvb, offset, 2, ENC_BIG_ENDIAN);
3032 proto_tree_add_item(command_tree, hf_omron_filename, tvb, (offset+2), 12, ENC_ASCII);
3033 offset = offset + 14;
3037 if(is_response)
3039 if(reported_length_remaining == 2)
3041 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
3042 offset = offset + 2;
3046 break;
3048 case 0x220A:
3050 if(is_command)
3052 if(reported_length_remaining == 22)
3054 proto_tree_add_item(command_tree, hf_omron_transfer_parameter_code, tvb, offset, 2, ENC_BIG_ENDIAN);
3055 proto_tree_add_item(command_tree, hf_omron_command_memory_area_code, tvb, (offset+2), 1, ENC_BIG_ENDIAN);
3056 proto_tree_add_item(command_tree, hf_omron_transfer_beginning_address, tvb, (offset+3), 3, ENC_BIG_ENDIAN);
3057 proto_tree_add_item(command_tree, hf_omron_num_items, tvb, (offset+6), 2, ENC_BIG_ENDIAN);
3058 proto_tree_add_item(command_tree, hf_omron_disk_no, tvb, (offset+8), 2, ENC_BIG_ENDIAN);
3059 proto_tree_add_item(command_tree, hf_omron_filename, tvb, (offset+10), 12, ENC_ASCII);
3060 offset = offset + 22;
3064 if(is_response)
3066 if(reported_length_remaining == 4)
3068 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
3069 proto_tree_add_item(command_tree, hf_omron_num_items, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
3070 offset = offset + 4;
3074 break;
3076 case 0x220B:
3078 if(is_command)
3080 if(reported_length_remaining == 22)
3082 proto_tree_add_item(command_tree, hf_omron_transfer_parameter_code, tvb, offset, 2, ENC_BIG_ENDIAN);
3083 proto_tree_add_item(command_tree, hf_omron_parameter_area_code, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
3084 proto_tree_add_item(command_tree, hf_omron_address, tvb, (offset+4), 2, ENC_BIG_ENDIAN);
3085 proto_tree_add_item(command_tree, hf_omron_num_words, tvb, (offset+6), 2, ENC_BIG_ENDIAN);
3086 proto_tree_add_item(command_tree, hf_omron_disk_no, tvb, (offset+8), 2, ENC_BIG_ENDIAN);
3087 proto_tree_add_item(command_tree, hf_omron_filename, tvb, (offset+10), 12, ENC_ASCII);
3088 offset = offset + 22;
3092 if(is_response)
3094 if(reported_length_remaining == 4)
3096 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
3097 proto_tree_add_item(command_tree, hf_omron_num_words, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
3098 offset = offset + 4;
3102 break;
3104 case 0x220C:
3106 if(is_command)
3108 if(reported_length_remaining == 26)
3110 proto_tree_add_item(command_tree, hf_omron_transfer_parameter_code, tvb, offset, 2, ENC_BIG_ENDIAN);
3111 proto_tree_add_item(command_tree, hf_omron_program_number, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
3112 proto_tree_add_item(command_tree, hf_omron_begin_word, tvb, (offset+4), 4, ENC_BIG_ENDIAN);
3113 proto_tree_add_item(command_tree, hf_omron_number_of_bytes, tvb, (offset+8), 4, ENC_BIG_ENDIAN);
3114 proto_tree_add_item(command_tree, hf_omron_disk_no, tvb, (offset+12), 2, ENC_BIG_ENDIAN);
3115 proto_tree_add_item(command_tree, hf_omron_filename, tvb, (offset+14), 12, ENC_ASCII);
3116 offset = offset + 26;
3120 if(is_response)
3122 if(reported_length_remaining == 6)
3124 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
3125 proto_tree_add_item(command_tree, hf_omron_number_of_bytes, tvb, (offset+2), 4, ENC_BIG_ENDIAN);
3126 offset = offset + 6;
3130 break;
3132 case 0x220F:
3134 if(is_command)
3136 if(reported_length_remaining == 3)
3138 proto_tree_add_item(command_tree, hf_omron_beginning_block_num, tvb, offset, 2, ENC_BIG_ENDIAN);
3139 proto_tree_add_item(command_tree, hf_omron_num_blocks, tvb, (offset+2), 1, ENC_BIG_ENDIAN);
3140 offset = offset + 3;
3144 if(is_response)
3146 if(reported_length_remaining >= 9)
3148 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
3149 proto_tree_add_item(command_tree, hf_omron_num_blocks_remaining, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
3150 proto_tree_add_item(command_tree, hf_omron_total_num_blocks, tvb, (offset+4), 2, ENC_BIG_ENDIAN);
3151 proto_tree_add_item(command_tree, hf_omron_type, tvb, (offset+6), 1, ENC_BIG_ENDIAN);
3152 offset = offset + 7;
3153 reported_length_remaining = reported_length_remaining - 7;
3155 while(reported_length_remaining >= 2)
3157 proto_tree_add_bitmask(command_tree, tvb, offset, hf_omron_data_type,
3158 ett_omron_data_type, data_type_fields, ENC_BIG_ENDIAN);
3159 proto_tree_add_item(command_tree, hf_omron_control_data, tvb, (offset+1), 1, ENC_BIG_ENDIAN);
3160 offset = offset + 2;
3161 reported_length_remaining = reported_length_remaining - 2;
3166 break;
3168 case 0x2210:
3170 if(is_command)
3172 if(reported_length_remaining == 2)
3174 proto_tree_add_item(command_tree, hf_omron_block_num, tvb, offset, 2, ENC_BIG_ENDIAN);
3175 offset = offset + 2;
3179 if(is_response)
3181 if(reported_length_remaining >= 4)
3183 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
3184 proto_tree_add_bitmask(command_tree, tvb, (offset+2), hf_omron_data_type,
3185 ett_omron_data_type, data_type_fields, ENC_BIG_ENDIAN);
3186 proto_tree_add_item(command_tree, hf_omron_control_data, tvb, (offset+3), 1, ENC_BIG_ENDIAN);
3187 proto_tree_add_item(command_tree, hf_omron_data, tvb, (offset+4), -1, ENC_NA);
3188 offset = offset + reported_length_remaining;
3192 break;
3194 case 0x2211:
3196 if(is_command)
3198 if(reported_length_remaining >= 4)
3200 proto_tree_add_bitmask(command_tree, tvb, offset, hf_omron_data_type,
3201 ett_omron_data_type, data_type_fields, ENC_BIG_ENDIAN);
3202 proto_tree_add_item(command_tree, hf_omron_control_data, tvb, (offset+1), 1, ENC_BIG_ENDIAN);
3203 proto_tree_add_item(command_tree, hf_omron_block_num, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
3204 proto_tree_add_item(command_tree, hf_omron_data, tvb, (offset+4), -1, ENC_NA);
3205 offset = offset + reported_length_remaining;
3209 if(is_response)
3211 if(reported_length_remaining == 2)
3213 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
3214 offset = offset + 2;
3219 break;
3221 case 0x2301:
3223 if(is_command)
3225 if(reported_length_remaining >= 8)
3227 proto_tree_add_item(command_tree, hf_omron_number_of_bits_flags, tvb, offset, 2, ENC_BIG_ENDIAN);
3228 offset = offset + 2;
3229 reported_length_remaining = reported_length_remaining - 2;
3231 while (reported_length_remaining >= 6)
3233 proto_tree_add_item(command_tree, hf_omron_set_reset_specification, tvb, offset, 2, ENC_BIG_ENDIAN);
3234 proto_tree_add_item(command_tree, hf_omron_command_memory_area_code, tvb, (offset+2), 1, ENC_BIG_ENDIAN);
3235 proto_tree_add_item(command_tree, hf_omron_bit_flag, tvb, (offset+3), 3, ENC_BIG_ENDIAN);
3237 offset = offset + 6;
3238 reported_length_remaining = reported_length_remaining - 6;
3243 if(is_response)
3245 if(reported_length_remaining == 2)
3247 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
3248 offset = offset + 2;
3252 break;
3254 case 0x2302:
3256 /* command data length is 0 */
3258 if(is_response)
3260 if(reported_length_remaining == 2)
3262 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
3263 offset = offset + 2;
3268 break;
3270 case 0x230A:
3272 if(is_command)
3274 if(reported_length_remaining == 6)
3276 proto_tree_add_item(command_tree, hf_omron_command_memory_area_code, tvb, offset, 1, ENC_BIG_ENDIAN);
3277 proto_tree_add_item(command_tree, hf_omron_transfer_beginning_address, tvb, (offset+1), 3, ENC_BIG_ENDIAN);
3278 proto_tree_add_item(command_tree, hf_omron_num_unit_uint16, tvb, (offset+4), 2, ENC_BIG_ENDIAN);
3279 offset = offset + 6;
3283 if(is_response)
3285 if(reported_length_remaining >= 8)
3287 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
3288 proto_tree_add_item(command_tree, hf_omron_command_memory_area_code, tvb, (offset+2), 1, ENC_BIG_ENDIAN);
3289 proto_tree_add_item(command_tree, hf_omron_transfer_beginning_address, tvb, (offset+3), 3, ENC_BIG_ENDIAN);
3290 proto_tree_add_item(command_tree, hf_omron_num_unit_uint16, tvb, (offset+6), 2, ENC_BIG_ENDIAN);
3291 proto_tree_add_item(command_tree, hf_omron_data, tvb, (offset+8), -1, ENC_NA);
3292 offset = offset + reported_length_remaining;
3296 break;
3298 case 0x2601:
3300 if(is_command)
3302 if((reported_length_remaining > 0) && (reported_length_remaining <= 8))
3304 proto_tree_add_item(command_tree, hf_omron_name_data, tvb, offset, -1, ENC_ASCII);
3305 offset = offset + reported_length_remaining;
3309 if(is_response)
3311 if(reported_length_remaining == 2)
3313 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
3314 offset = offset + 2;
3318 break;
3320 case 0x2602:
3322 /* command data length is 0 */
3324 if(is_response)
3326 if(reported_length_remaining == 2)
3328 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
3329 offset = offset + 2;
3333 break;
3335 case 0x2603:
3337 /* command data length is 0 */
3339 if(is_response)
3341 if((reported_length_remaining > 2) && (reported_length_remaining <= (2+8)))
3343 proto_tree_add_item(command_tree, hf_omron_response_code, tvb, offset, 2, ENC_BIG_ENDIAN);
3344 proto_tree_add_item(command_tree, hf_omron_name_data, tvb, offset, -1, ENC_ASCII);
3345 offset = offset + reported_length_remaining;
3349 break;
3351 default:
3352 { /* invalid command ?? */
3353 /* ??? dissector_bug ??*/
3355 break;
3357 } /* switch(command_code) */
3359 if ((unsigned)offset != tvb_reported_length(tvb)) {
3360 expert_add_info(pinfo, omron_tree, &ei_omron_bad_length);
3363 } /* if(tree) */
3365 return tvb_captured_length(tvb);
3368 static unsigned
3369 get_omron_fins_tcp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
3371 uint32_t length = tvb_get_ntohl(tvb, offset + 4);
3373 // length field does not include magic or length fields
3374 return 8 + length;
3377 static int
3378 dissect_omron_fins_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
3380 proto_item *ti = NULL;
3381 proto_tree *omron_tree = NULL;
3382 proto_tree *omron_tcp_header_tree = NULL;
3384 int fins_pdu_offset = 0;
3385 uint32_t tcp_command = tvb_get_ntohl(tvb, 8);
3387 switch (tcp_command) {
3388 case TCP_CMD_NODE_ADDRESS_DATA_SEND_CLIENT:
3389 fins_pdu_offset = 20;
3390 break;
3391 case TCP_CMD_NODE_ADDRESS_DATA_SEND_SERVER:
3392 fins_pdu_offset = 24;
3393 break;
3394 case TCP_CMD_FRAME_SEND:
3395 case TCP_CMD_FRAME_SEND_ERROR_NOTIFICATION:
3396 case TCP_CMD_CONNECTION_CONFIRMATION:
3397 fins_pdu_offset = 16;
3398 break;
3399 default:
3400 return 0;
3403 col_set_str(pinfo->cinfo, COL_PROTOCOL, "OMRON");
3405 col_add_fstr(pinfo->cinfo, COL_INFO, "FINS/TCP : %s",
3406 val_to_str(tcp_command, tcp_command_cv, "Unknown (%d)"));
3408 if (tree) {
3409 ti = proto_tree_add_item(tree, proto_omron_fins, tvb, 0, -1, ENC_NA);
3410 omron_tree = proto_item_add_subtree(ti, ett_omron);
3412 omron_tcp_header_tree = proto_tree_add_subtree(
3413 omron_tree, tvb, 0, fins_pdu_offset, ett_omron_tcp_header, &ti, "FINS/TCP Header");
3415 proto_tree_add_item(omron_tcp_header_tree, hf_omron_tcp_magic, tvb, 0, 4, ENC_BIG_ENDIAN);
3416 proto_tree_add_item(omron_tcp_header_tree, hf_omron_tcp_length, tvb, 4, 4, ENC_BIG_ENDIAN);
3417 proto_tree_add_item(omron_tcp_header_tree, hf_omron_tcp_command, tvb, 8, 4, ENC_BIG_ENDIAN);
3418 proto_tree_add_item(omron_tcp_header_tree, hf_omron_tcp_error_code, tvb, 12, 4, ENC_BIG_ENDIAN);
3420 if (tcp_command == TCP_CMD_NODE_ADDRESS_DATA_SEND_CLIENT) {
3421 proto_tree_add_item(omron_tcp_header_tree, hf_omron_tcp_client_node_address, tvb, 16, 4, ENC_BIG_ENDIAN);
3422 } else if (tcp_command == TCP_CMD_NODE_ADDRESS_DATA_SEND_SERVER) {
3423 proto_tree_add_item(omron_tcp_header_tree, hf_omron_tcp_client_node_address, tvb, 16, 4, ENC_BIG_ENDIAN);
3424 proto_tree_add_item(omron_tcp_header_tree, hf_omron_tcp_server_node_address, tvb, 20, 4, ENC_BIG_ENDIAN);
3428 if (tcp_command == TCP_CMD_FRAME_SEND) {
3429 tvbuff_t *slice = tvb_new_subset_remaining(tvb, fins_pdu_offset);
3431 dissect_omron_fins_common(slice, pinfo, omron_tree);
3434 return tvb_reported_length(tvb);
3437 static int
3438 dissect_omron_fins_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
3440 if (tvb_get_ntohl(tvb, 0) != OMRON_FINS_TCP_MAGIC_BYTES) {
3441 return 0;
3444 tcp_dissect_pdus(tvb, pinfo, tree, true, 8,
3445 get_omron_fins_tcp_pdu_len, dissect_omron_fins_tcp_pdu, data);
3447 return tvb_reported_length(tvb);
3450 static int
3451 dissect_omron_fins_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
3453 uint8_t omron_byte;
3454 proto_item *ti = NULL;
3455 proto_tree *omron_tree = NULL;
3457 /* Make sure we have enough actual data to do the heuristics checks */
3458 if (tvb_captured_length(tvb) < 12) {
3459 return 0;
3461 /* Check some bytes to see if it's OMRON */
3462 omron_byte = tvb_get_uint8(tvb, 1);
3463 if (omron_byte != 0x00) {
3464 return 0;
3467 if (tree) {
3468 ti = proto_tree_add_item(tree, proto_omron_fins, tvb, 0, -1, ENC_NA);
3469 omron_tree = proto_item_add_subtree(ti, ett_omron);
3472 return dissect_omron_fins_common(tvb, pinfo, omron_tree);
3475 void
3476 proto_register_omron_fins(void)
3478 #if 0
3479 module_t *omron_fins_module;
3480 #endif
3482 /* Setup list of header fields */
3484 static hf_register_info hf[] = {
3485 { &hf_omron_tcp_magic,
3486 { "Magic Bytes", "omron.tcp.magic", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
3488 { &hf_omron_tcp_length,
3489 { "Length", "omron.tcp.length", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL }},
3491 { &hf_omron_tcp_command,
3492 { "Command", "omron.tcp.command", FT_UINT32, BASE_HEX, VALS(tcp_command_cv), 0x0, NULL, HFILL }},
3494 { &hf_omron_tcp_error_code,
3495 { "Error Code", "omron.tcp.error_code", FT_UINT32, BASE_HEX, VALS(tcp_error_code_cv), 0x0, NULL, HFILL }},
3497 { &hf_omron_tcp_client_node_address,
3498 { "Client Node Address", "omron.tcp.client_node_address", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL }},
3500 { &hf_omron_tcp_server_node_address,
3501 { "Server Node Address", "omron.tcp.server_node_address", FT_UINT32, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL }},
3503 { &hf_omron_icf,
3504 { "OMRON ICF Field", "omron.icf", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
3506 { &hf_omron_icf_gwb,
3507 { "Gateway bit", "omron.icf.gwb", FT_UINT8, BASE_HEX, VALS(icf_gw_vals), ICF_GW_MASK, NULL, HFILL }},
3509 { &hf_omron_icf_dtb,
3510 { "Data Type bit", "omron.icf.dtb", FT_UINT8, BASE_HEX, VALS(icf_dtb_vals), ICF_DTB_MASK, NULL, HFILL }},
3512 { &hf_omron_icf_rb0,
3513 { "Reserved bit 0", "omron.icf.rb0", FT_UINT8, BASE_HEX, NULL, ICF_RB0_MASK, NULL, HFILL }},
3515 { &hf_omron_icf_rb1,
3516 { "Reserved bit 1", "omron.icf.rb1", FT_UINT8, BASE_HEX, NULL, ICF_RB1_MASK, NULL, HFILL }},
3518 { &hf_omron_icf_rb2,
3519 { "Reserved bit 2", "omron.icf.rb2", FT_UINT8, BASE_HEX, NULL, ICF_RB2_MASK, NULL, HFILL }},
3521 { &hf_omron_icf_rb3,
3522 { "Reserved bit 3", "omron.icf.rb3", FT_UINT8, BASE_HEX, NULL, ICF_RB3_MASK, NULL, HFILL }},
3524 { &hf_omron_icf_rb4,
3525 { "Reserved bit 4", "omron.icf.rb4", FT_UINT8, BASE_HEX, NULL, ICF_RB4_MASK, NULL, HFILL }},
3527 { &hf_omron_icf_rsb,
3528 { "Response setting bit", "omron.icf.rsb", FT_UINT8, BASE_HEX, VALS(icf_rsb_vals), ICF_RSB_MASK, NULL, HFILL }},
3530 { &hf_omron_rsv,
3531 { "Reserved", "omron.rsv", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
3533 { &hf_omron_gct,
3534 { "Gateway Count", "omron.gct", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
3536 { &hf_omron_dna,
3537 { "Destination network address", "omron.dna", FT_UINT8, BASE_RANGE_STRING|BASE_HEX, RVALS(omron_dna_range), 0x0, NULL, HFILL }},
3539 { &hf_omron_da1,
3540 { "Destination node number", "omron.da1", FT_UINT8, BASE_RANGE_STRING|BASE_HEX, RVALS(omron_da1_range), 0x0, NULL, HFILL }},
3542 { &hf_omron_da2,
3543 { "Destination unit address", "omron.da2", FT_UINT8, BASE_RANGE_STRING|BASE_HEX, RVALS(omron_da2_range), 0x0, NULL, HFILL }},
3545 { &hf_omron_sna,
3546 { "Source network address", "omron.sna", FT_UINT8, BASE_RANGE_STRING|BASE_HEX, RVALS(omron_sna_range), 0x0, NULL, HFILL }},
3548 { &hf_omron_sa1,
3549 { "Source node number", "omron.sa1", FT_UINT8, BASE_RANGE_STRING|BASE_HEX, RVALS(omron_sa1_range), 0x0, NULL, HFILL }},
3551 { &hf_omron_sa2,
3552 { "Source unit address", "omron.sa2", FT_UINT8, BASE_RANGE_STRING|BASE_HEX, RVALS(omron_sa2_range), 0x0, NULL, HFILL }},
3554 { &hf_omron_sid,
3555 { "Service ID", "omron.sid", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
3557 { &hf_omron_command,
3558 { "Command CODE", "omron.command", FT_UINT16, BASE_HEX, VALS(command_code_cv), 0x0, NULL, HFILL }},
3560 { &hf_omron_command_memory_area_code,
3561 { "Memory Area Code", "omron.memory.area.read", FT_UINT8, BASE_HEX, VALS(memory_area_code_cv), 0x0, NULL, HFILL }},
3563 { &hf_omron_response_code,
3564 { "Response code", "omron.response.code", FT_UINT16, BASE_HEX, VALS(response_codes), 0x0, NULL, HFILL }},
3566 { &hf_omron_command_data,
3567 { "Command Data", "omron.command.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
3569 { &hf_omron_address,
3570 { "Beginning address", "omron.memory.address", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
3572 { &hf_omron_address_bits,
3573 { "Beginning address bits", "omron.memory.address.bits", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
3575 { &hf_omron_num_items,
3576 { "Number of items", "omron.memory.numitems", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
3578 { &hf_omron_response_data,
3579 { "Response data", "omron.response.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
3581 { &hf_omron_parameter_area_code,
3582 { "Parameter area code", "omron.parameter_area_code", FT_UINT16, BASE_HEX, VALS(parameter_area_codes), 0x0, NULL, HFILL }},
3584 { &hf_omron_beginning_word,
3585 { "Beginning word", "omron.word", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
3587 { &hf_omron_num_words,
3588 { "No. words or Bytes", "omron.numwords", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
3590 { &hf_omron_program_number,
3591 { "Program number", "omron.program_number", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
3593 { &hf_omron_protect_code,
3594 { "Protect code", "omron.protect_code", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
3596 { &hf_omron_begin_word,
3597 { "Beginning word", "omron.word.begin", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
3599 { &hf_omron_last_word,
3600 { "Last word", "omron.word.last", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
3602 { &hf_omron_password,
3603 { "Password", "omron.password", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
3605 { &hf_omron_clear_code,
3606 { "Clear Code", "omron.clearcode", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
3608 { &hf_omron_mode_code,
3609 { "Mode Code", "omron.mode_code", FT_UINT8, BASE_HEX, VALS(mode_codes), 0x0, NULL, HFILL }},
3611 { &hf_omron_monitor_label,
3612 { "Mode Code (Default Monitor)", "omron.mode_code_default_monitor", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
3614 { &hf_omron_controller_model,
3615 { "Controller model", "omron.controller.model", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
3617 { &hf_omron_controller_version,
3618 { "Controller version", "omron.controller.version", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
3619 { &hf_omron_for_system_use,
3620 { "For system use", "omron.system.use", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
3622 { &hf_omron_program_area_size,
3623 {"Program area size", "omron.area_data.program_area_size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3625 { &hf_omron_iom_size,
3626 {"IOM size", "omron.area_data.iom_size", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3628 { &hf_omron_num_dm_words,
3629 { "No. of DM words", "omron.area_data.dm_words", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3631 { &hf_omron_timer_counter_size,
3632 { "Timer/counter size", "omron.area_data.timer_size", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3633 { &hf_omron_expansion_dm_size,
3634 { "Expansion DM size", "omron.area_data.dm_size", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3636 { &hf_omron_num_step_transitions,
3637 { "No. of steps/transitions", "omron.area_data.num_steps", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3638 { &hf_omron_kind_memory_card,
3639 { "Kind of Memory card", "omron.area_data.memory_card", FT_UINT8, BASE_DEC, VALS(memory_card_codes), 0x0, NULL, HFILL }},
3641 { &hf_omron_memory_card_size,
3642 { "Memory card size", "omron.area_data.memory_card.size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3643 { &hf_omron_cpu_bus_unit_0,
3644 { "CPU Bus Unit No. 0", "omron.cpubus_unit.no0", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3645 { &hf_omron_cpu_bus_unit_1,
3646 { "CPU Bus Unit No. 1", "omron.cpubus_unit.no1", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3647 { &hf_omron_cpu_bus_unit_2,
3648 { "CPU Bus Unit No. 2", "omron.cpubus_unit.no2", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3649 { &hf_omron_cpu_bus_unit_3,
3650 { "CPU Bus Unit No. 3", "omron.cpubus_unit.no3", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3651 { &hf_omron_cpu_bus_unit_4,
3652 { "CPU Bus Unit No. 4", "omron.cpubus_unit.no4", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3653 { &hf_omron_cpu_bus_unit_5,
3654 { "CPU Bus Unit No. 5", "omron.cpubus_unit.no5", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3655 { &hf_omron_cpu_bus_unit_6,
3656 { "CPU Bus Unit No. 6", "omron.cpubus_unit.no6", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3657 { &hf_omron_cpu_bus_unit_7,
3658 { "CPU Bus Unit No. 7", "omron.cpubus_unit.no7", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3659 { &hf_omron_cpu_bus_unit_8,
3660 { "CPU Bus Unit No. 8", "omron.cpubus_unit.no8", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3661 { &hf_omron_cpu_bus_unit_9,
3662 { "CPU Bus Unit No. 9", "omron.cpubus_unit.no9", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3663 { &hf_omron_cpu_bus_unit_10,
3664 { "CPU Bus Unit No. 10", "omron.cpubus_unit.no10", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3665 { &hf_omron_cpu_bus_unit_11,
3666 { "CPU Bus Unit No. 11", "omron.cpubus_unit.no11", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3667 { &hf_omron_cpu_bus_unit_12,
3668 { "CPU Bus Unit No. 12", "omron.cpubus_unit.no12", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3669 { &hf_omron_cpu_bus_unit_13,
3670 { "CPU Bus Unit No. 13", "omron.cpubus_unit.no13", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3671 { &hf_omron_cpu_bus_unit_14,
3672 { "CPU Bus Unit No. 14", "omron.cpubus_unit.no14", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3673 { &hf_omron_cpu_bus_unit_15,
3674 { "CPU Bus Unit No. 15", "omron.cpubus_unit.no15", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3675 { &hf_omron_cpu_bus_reserved,
3676 { "CPU Bus Unit Reserved", "omron.cpubus_unit.reserved", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
3677 { &hf_omron_io_data_num_sysmac_1,
3678 { "No. of SYSMAC BUS/2 Masters mounted", "omron.remote_io_date.sysmac_1", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3679 { &hf_omron_io_data_num_sysmac_2,
3680 { "No. of SYSMAC BUS Masters mounted", "omron.remote_io_date.sysmac_2", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3681 { &hf_omron_pc_status,
3682 { "PC status", "omron.pc_status", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
3683 { &hf_omron_pc_status_pdc,
3684 { "Peripheral Device connected", "omron.pc_status.pdc", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x80, NULL, HFILL}},
3685 { &hf_omron_pc_status_hi,
3686 { "With built-in host interface", "omron.pc_status.hi", FT_UINT8, BASE_DEC, NULL, 0x40, NULL, HFILL}},
3687 { &hf_omron_pc_status_r1,
3688 { "Reserved 1", "omron.pc_status.r1", FT_UINT8, BASE_DEC, NULL, 0x20, NULL, HFILL}},
3689 { &hf_omron_pc_status_r2,
3690 { "Reserved 2", "omron.pc_status.r2", FT_UINT8, BASE_DEC, NULL, 0x10, NULL, HFILL}},
3691 { &hf_omron_pc_status_rack_num,
3692 { "Rack Number", "omron.pcp_status.rack_num", FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL}},
3693 { &hf_omron_unit_address,
3694 { "Unit address", "omron.unit_address", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}},
3695 { &hf_omron_num_units,
3696 { "No. of Units", "omron.unit_nums", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},
3697 { &hf_omron_model_number,
3698 { "Model Number", "omron.model_number", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL}},
3699 { &hf_omron_status,
3700 { "Status", "omron.status", FT_UINT8, BASE_HEX, VALS(status_codes), 0x0, NULL, HFILL}},
3701 { &hf_omron_fatal_error_data,
3702 { "Fatal error data", "omron.fatal_error_data", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}},
3703 { &hf_omron_fatal_fals_error,
3704 {"FALS error", "omron.fatal.fals_error", FT_UINT16, BASE_DEC, NULL, 0x8000, NULL, HFILL }},
3705 { &hf_omron_fatal_sfc_error,
3706 {"Fatal SFC error", "omron.fatal.sfc_error", FT_UINT16, BASE_DEC, NULL, 0x4000, NULL, HFILL }},
3707 { &hf_omron_fatal_cycle_time_over,
3708 {"Cycle time over", "omron.fatal.cycle_time_over", FT_UINT16, BASE_DEC, NULL, 0x2000, NULL, HFILL }},
3709 { &hf_omron_fatal_program_error,
3710 {"Program error", "omron.fatal.program_error", FT_UINT16, BASE_DEC, NULL, 0x1000, NULL, HFILL }},
3711 { &hf_omron_fatal_io_setting_error,
3712 {"I/O setting error", "omron.fatal.io_setting_error", FT_UINT16, BASE_DEC, NULL, 0x0800, NULL, HFILL }},
3713 { &hf_omron_fatal_io_point_overflow,
3714 {"I/O point overflow", "omron.fatal.io_point_overflow", FT_UINT16, BASE_DEC, NULL, 0x0400, NULL, HFILL }},
3715 { &hf_omron_fatal_cpu_bus_error,
3716 {"CPU bus error", "omron.fatal.cpu_bus_error", FT_UINT16, BASE_DEC, NULL, 0x0200, NULL, HFILL }},
3717 { &hf_omron_fatal_duplication_error,
3718 {"Duplication error", "omron.fatal.duplication_error", FT_UINT16, BASE_DEC, NULL, 0x0100, NULL, HFILL }},
3719 { &hf_omron_fatal_io_bus_error,
3720 {"I/O bus error", "omron.fatal.io_bus_error", FT_UINT16, BASE_DEC, NULL, 0x0080, NULL, HFILL }},
3721 { &hf_omron_fatal_memory_error,
3722 {"Memory error", "omron.fatal.memory_error", FT_UINT16, BASE_DEC, NULL, 0x0040, NULL, HFILL }},
3723 { &hf_omron_fatal_rv_1,
3724 {"Reserved", "omron.fatal.rv_1", FT_UINT16, BASE_DEC, NULL, 0x0020, NULL, HFILL }},
3725 { &hf_omron_fatal_rv_2,
3726 {"Reserved", "omron.fatal.rv_2", FT_UINT16, BASE_DEC, NULL, 0x0010, NULL, HFILL }},
3727 { &hf_omron_fatal_rv_3,
3728 {"Reserved", "omron.fatal.rv_3", FT_UINT16, BASE_DEC, NULL, 0x0008, NULL, HFILL }},
3729 { &hf_omron_fatal_rv_4,
3730 {"Reserved", "omron.fatal.rv_4", FT_UINT16, BASE_DEC, NULL, 0x0004, NULL, HFILL }},
3731 { &hf_omron_fatal_rv_5,
3732 {"Reserved", "omron.fatal.rv_5", FT_UINT16, BASE_DEC, NULL, 0x0002, NULL, HFILL }},
3733 { &hf_omron_fatal_watch_dog_timer_error,
3734 {"Watch dog timer error", "omron.fatal.watch_dog_timer_error", FT_UINT16, BASE_DEC, NULL, 0x0001, NULL, HFILL }},
3735 { &hf_omron_non_fatal_error_data,
3736 { "Non fatal error data", "omron.fatal_error_data", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}},
3737 { &hf_omron_non_fatal_rv1,
3738 { "Reserved", "omron.non_fatal.rv1", FT_UINT16, BASE_DEC, NULL, 0x8000, NULL, HFILL }},
3739 { &hf_omron_non_fatal_rv2,
3740 { "Reserved", "omron.non_fatal.rv2", FT_UINT16, BASE_DEC, NULL, 0x4000, NULL, HFILL }},
3741 { &hf_omron_non_fatal_power_interruption,
3742 { "Momentary power interruption", "omron.non_fatal.power_interruption", FT_UINT16, BASE_DEC, NULL, 0x2000, NULL, HFILL }},
3743 { &hf_omron_non_fatal_cpu_bus_unit_setting_error,
3744 { "CPU Bus Unit setting error", "omron.non_fatal.cpu_bus_unit_setting_error", FT_UINT16, BASE_DEC, NULL, 0x1000, NULL, HFILL }},
3745 { &hf_omron_non_fatal_battery_error,
3746 { "Battery error", "omron.non_fatal.batter_error", FT_UINT16, BASE_DEC, NULL, 0x0800, NULL, HFILL }},
3747 { &hf_omron_non_fatal_sysmac_bus_error,
3748 { "SYSMAC BUS error", "omron.non_fatal.sysmac_bus_error", FT_UINT16, BASE_DEC, NULL, 0x0400, NULL, HFILL }},
3749 { &hf_omron_non_fatal_sysmac_bus2_error,
3750 { "SYSMAC BUS/2 error", "omron.non_fatal.sysmac_bus2_error", FT_UINT16, BASE_DEC, NULL, 0x0200, NULL, HFILL }},
3751 { &hf_omron_non_fatal_cpu_bus_unit_error,
3752 { "CPU Bus Unit error", "omron.non_fatal.cpu_bus_unit_error", FT_UINT16, BASE_DEC, NULL, 0x0100, NULL, HFILL }},
3753 { &hf_omron_non_fatal_rv3,
3754 { "Reserved", "omron.non_fatal.rv3", FT_UINT16, BASE_DEC, NULL, 0x0080, NULL, HFILL }},
3755 { &hf_omron_non_fatal_io_verification_error,
3756 { "I/O verification error", "omron.non_fatal.io_verification_error", FT_UINT16, BASE_DEC, NULL, 0x0040, NULL, HFILL }},
3757 { &hf_omron_non_fatal_rv4,
3758 { "Reserved", "omron.non_fatal.rv4", FT_UINT16, BASE_DEC, NULL, 0x0020, NULL, HFILL }},
3759 { &hf_omron_non_fatal_sfc_error,
3760 { "Non-fatal SFC error v", "omron.non_fatal.sfc_error", FT_UINT16, BASE_DEC, NULL, 0x0010, NULL, HFILL }},
3761 { &hf_omron_non_fatal_indirect_dm_error,
3762 { "Indirect DM error", "omron.non_fatal.indirect_dm_error", FT_UINT16, BASE_DEC, NULL, 0x0008, NULL, HFILL }},
3763 { &hf_omron_non_fatal_jmp_error,
3764 { "JMP error", "omron.non_fatal.jmp_error", FT_UINT16, BASE_DEC, NULL, 0x0004, NULL, HFILL }},
3765 { &hf_omron_non_fatal_rv5,
3766 { "Reserved", "omron.non_fatal.rv5", FT_UINT16, BASE_DEC, NULL, 0x0002, NULL, HFILL }},
3767 { &hf_omron_non_fatal_fal_error,
3768 { "FAL error", "omron.non_fatal.fal_error", FT_UINT16, BASE_DEC, NULL, 0x0001, NULL, HFILL }},
3769 { &hf_omron_message,
3770 { "Message", "omron.message", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}},
3771 { &hf_omron_message_no_0,
3772 { "Message no. 0", "omron.message.no_0", FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x8000, NULL, HFILL }},
3773 { &hf_omron_message_no_1,
3774 { "Message no. 1", "omron.message.no_1", FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x4000, NULL, HFILL }},
3775 { &hf_omron_message_no_2,
3776 { "Message no. 2", "omron.message.no_2", FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x2000, NULL, HFILL }},
3777 { &hf_omron_message_no_3,
3778 { "Message no. 3", "omron.message.no_3", FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x1000, NULL, HFILL }},
3779 { &hf_omron_message_no_4,
3780 { "Message no. 4", "omron.message.no_4", FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0800, NULL, HFILL }},
3781 { &hf_omron_message_no_5,
3782 { "Message no. 5", "omron.message.no_5", FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0400, NULL, HFILL }},
3783 { &hf_omron_message_no_6,
3784 { "Message no. 6", "omron.message.no_6", FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0200, NULL, HFILL }},
3785 { &hf_omron_message_no_7,
3786 { "Message no. 7", "omron.message.no_7", FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0100, NULL, HFILL }},
3787 { &hf_omron_message_rv_0,
3788 { "Reserved", "omron.message.rv_0", FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0080, NULL, HFILL }},
3789 { &hf_omron_message_rv_1,
3790 { "Reserved", "omron.message.rv_1", FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0040, NULL, HFILL }},
3791 { &hf_omron_message_rv_2,
3792 { "Reserved", "omron.message.rv_2", FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0020, NULL, HFILL }},
3793 { &hf_omron_message_rv_3,
3794 { "Reserved", "omron.message.rv_3", FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0010, NULL, HFILL }},
3795 { &hf_omron_message_rv_4,
3796 { "Reserved", "omron.message.rv_4", FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0008, NULL, HFILL }},
3797 { &hf_omron_message_rv_5,
3798 { "Reserved", "omron.message.rv_5", FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0004, NULL, HFILL }},
3799 { &hf_omron_message_rv_6,
3800 { "Reserved", "omron.message.rv_6", FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0002, NULL, HFILL }},
3801 { &hf_omron_message_rv_7,
3802 { "Reserved", "omron.message.rv_7", FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0001, NULL, HFILL }},
3803 { &hf_omron_fals,
3804 { "FALS / FALS no.", "omron.fals", FT_UINT16, BASE_HEX, NULL, 0x3FFF, NULL, HFILL}},
3805 { &hf_omron_error_message,
3806 { "Error message", "omron.error_message", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL}},
3807 { &hf_omron_parameter,
3808 { "Parameter", "omron.parameter", FT_UINT8, BASE_HEX, VALS(parameter_codes), 0x0, NULL, HFILL }},
3809 { &hf_omron_avg_cycle_time,
3810 { "Average cycle time", "omron.avg_cycle_time", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
3811 { &hf_omron_max_cycle_time,
3812 { "Max. cycle time", "omron.max_cycle_time", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
3813 { &hf_omron_min_cycle_time,
3814 { "Min cycle time", "omron.min_cycle_time", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
3815 { &hf_omron_year,
3816 { "Year", "omron.year", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3817 { &hf_omron_month,
3818 { "Month", "omron.month", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3819 { &hf_omron_date,
3820 { "Date", "omron.date", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3821 { &hf_omron_hour,
3822 { "Hour", "omron.hour", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3823 { &hf_omron_minute,
3824 { "Minute", "omron.minute", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3825 { &hf_omron_second,
3826 { "Second", "omron.second", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3827 { &hf_omron_day,
3828 { "Day", "omron.day", FT_UINT8, BASE_DEC, VALS(omron_days), 0x0, NULL, HFILL }},
3829 { &hf_omron_read_message,
3830 { "Message", "omron.read_message", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
3831 { &hf_omron_node_number,
3832 { "Node number", "omron.node_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3833 { &hf_omron_network_address,
3834 { "Network address", "omron.network_address", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3835 { &hf_omron_error_reset_fals_no,
3836 { "Error reset FAL no.", "omron.error_reset_fals_no", FT_UINT16, BASE_RANGE_STRING|BASE_HEX, RVALS(omron_error_reset_range), 0x0, NULL, HFILL }},
3837 { &hf_omron_beginning_record_no,
3838 { "Beginning record no.", "omron.beginning_record_no", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3839 { &hf_omron_no_of_records,
3840 { "No. of records", "omron.no_of_records", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3841 { &hf_omron_max_no_of_stored_records,
3842 { "Max. no. of stored records", "omron.max_no_of_stored_records", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3843 { &hf_omron_no_of_stored_records,
3844 { "No. of stored records", "omron.no_stored_records", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3845 { &hf_omron_disk_no,
3846 { "Disk no.", "omron.disk_no", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3847 { &hf_omron_beginning_file_position,
3848 { "Beginning file position", "omron.beginning_file_position", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
3849 { &hf_omron_no_of_files,
3850 { "No. of files", "omron.no_of_files", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3851 { &hf_omron_volume_label,
3852 { "Volume label", "omron.disk_data.volume_label", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
3853 { &hf_omron_date_year,
3854 { "Year", "omron.disk_data.year", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3855 { &hf_omron_date_month,
3856 { "Month", "omron.disk_data.month", FT_UINT32, BASE_DEC, NULL, 0x01E00000, NULL, HFILL }},
3857 { &hf_omron_date_day,
3858 { "Day", "omron.disk_data.day", FT_UINT32, BASE_DEC, NULL, 0x001F0000, NULL, HFILL }},
3859 { &hf_omron_date_hour,
3860 { "Hour", "omron.disk_data.hour", FT_UINT32, BASE_DEC, NULL, 0x0000F800, NULL, HFILL }},
3861 { &hf_omron_date_minute,
3862 { "Minute", "omron.disk_data.minute", FT_UINT32, BASE_DEC, NULL, 0x000007E0, NULL, HFILL }},
3863 { &hf_omron_date_second,
3864 { "Second", "omron.disk_data.second", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3865 { &hf_omron_total_capacity,
3866 { "Total capacity", "omron.disk_data.total_capacity", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3867 { &hf_omron_unused_capacity,
3868 { "Unused capacity", "omron.disk_data.unused_capacity", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3869 { &hf_omron_total_no_files,
3870 { "Total no. of files", "omron.disk_data.total_no_files", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3871 { &hf_omron_no_files,
3872 { "No. of files", "omron.disk_data.no_files", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3873 { &hf_omron_filename,
3874 { "Filename", "omron.file_data.filename", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
3875 { &hf_omron_file_capacity,
3876 { "File capacity", "omron.file_data.file_capacity", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3877 { &hf_omron_file_position,
3878 { "File position", "omron.file_position", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3879 { &hf_omron_data_length,
3880 { "Data length", "omron.data_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3881 { &hf_omron_file_data,
3882 { "File data", "omron.file_data", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
3883 { &hf_omron_file_parameter_code,
3884 { "Parameter code", "omron.file_parameter_code", FT_UINT16, BASE_HEX, VALS(omron_file_parameter_codes), 0x0, NULL, HFILL }},
3885 { &hf_omron_volume_parameter_code,
3886 { "Volume parameter code", "omron.volume_parameter_code", FT_UINT16, BASE_HEX, VALS(omron_volume_parameter_codes), 0x0, NULL, HFILL }},
3887 { &hf_omron_transfer_parameter_code,
3888 { "Parameter code", "omron.transfer_parameter_code", FT_UINT16, BASE_HEX, VALS(omron_transfer_parameter_codes), 0x0, NULL, HFILL }},
3889 { &hf_omron_transfer_beginning_address,
3890 { "Beginning address", "omron.transfer_beginning_address", FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL }},
3891 { &hf_omron_number_of_bytes,
3892 { "Number of bytes", "omron.number_of_bytes", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3893 { &hf_omron_number_of_bits_flags,
3894 { "No. of bits/flags", "omron.number_of_bits_flags", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3895 { &hf_omron_set_reset_specification,
3896 { "Set/Reset Specification", "omron.set_reset_specification", FT_UINT16, BASE_HEX, VALS(omron_set_reset_specifications), 0x0, NULL, HFILL }},
3897 { &hf_omron_bit_flag,
3898 { "Bit/flag", "omron.bit_flag", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3899 { &hf_omron_data,
3900 { "Data", "omron.data", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
3901 { &hf_omron_beginning_block_num,
3902 { "Beginning block number", "omron.beginning_block_num", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3903 { &hf_omron_num_blocks,
3904 { "Number of blocks", "omron.num_blocks", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3905 { &hf_omron_num_blocks_remaining,
3906 { "Number of blocks remaining", "omron.num_blocks_remaining", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3907 { &hf_omron_total_num_blocks,
3908 { "Total number of blocks", "omron.total_num_blocks", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3909 { &hf_omron_type,
3910 { "Type", "omron.type", FT_UINT8, BASE_HEX, VALS(omron_type_codes), 0x0, NULL, HFILL }},
3911 { &hf_omron_data_type,
3912 { "Data type", "omron.data_type", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
3913 { &hf_omron_data_type_type,
3914 { "Data type", "omron.data_type_type", FT_UINT8, BASE_HEX, VALS(omron_data_type_bits), 0x07, NULL, HFILL }},
3915 { &hf_omron_data_type_rv,
3916 { "Reserved", "omron.data_type_rv", FT_UINT8, BASE_HEX, NULL, 0x38, NULL, HFILL }},
3917 { &hf_omron_data_type_protected,
3918 { "Protected", "omron.data_type_protected", FT_BOOLEAN, 8, TFS(&boolean_data_type_protected), 0x40, NULL, HFILL }},
3919 { &hf_omron_data_type_end,
3920 { "Block", "omron.data_type_end", FT_BOOLEAN, 8, TFS(&boolean_data_type_end), 0x80, NULL, HFILL }},
3921 { &hf_omron_control_data,
3922 { "Control data", "omron.control_data", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
3923 { &hf_omron_block_num,
3924 { "Block number", "omron.block_num", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3925 { &hf_omron_num_unit_uint16,
3926 { "Number of units", "omron.num_unit_uint16", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3927 { &hf_omron_fixed,
3928 { "Fixed", "omron.fixed", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
3929 { &hf_omron_intelligent_id_no,
3930 { "Intelligent ID no.", "omron.intelligent_id_no", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
3931 { &hf_omron_first_word,
3932 { "First word", "omron.first_word", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
3933 { &hf_omron_read_len,
3934 { "Read length", "omron.read_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3935 { &hf_omron_no_of_link_nodes,
3936 { "No. of link nodes", "omron.no_of_link_nodes", FT_UINT8, BASE_DEC, NULL, 0x7F, NULL, HFILL }},
3937 { &hf_omron_block_record_node_num_status,
3938 { "Data link status", "omron.block_record.node_num_status", FT_BOOLEAN, 8, TFS(&boolean_node_num_status), 0x80, NULL, HFILL }},
3939 { &hf_omron_block_record_node_num_num_nodes,
3940 { "No. of link nodes", "omron.block_record.node_num_num_nodes", FT_UINT8, BASE_DEC, NULL, 0x7F, NULL, HFILL }},
3941 { &hf_omron_block_record_cio_area,
3942 { "CIO Area first word", "omron.block_record.cio_area", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
3943 { &hf_omron_block_record_kind_of_dm,
3944 { "Kind of DM", "omron.block_record.kind_of_dm", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
3945 { &hf_omron_block_record_dm_area_first_word,
3946 { "DM Area first word", "omron.block_record.dm_area_first_word", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
3947 { &hf_omron_block_record_no_of_total_words,
3948 { "No. of total words", "omron.block_record.no_of_total_words", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3949 { &hf_omron_status_flags,
3950 { "Status flags", "omron.status_flags", FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL }},
3951 { &hf_omron_status_flags_slave_master,
3952 { "Status Type", "omron.status_flags.slave_master", FT_BOOLEAN, 8, TFS(&boolean_status_flags_slave_master), 0x80, NULL, HFILL }},
3953 { &hf_omron_status_flags_data_link,
3954 { "Status Data link", "omron.status_flags.data_link", FT_BOOLEAN, 8, TFS(&boolean_status_flags_data_link), 0x01, NULL, HFILL }},
3955 { &hf_omron_master_node_number,
3956 { "Master node number", "omron.master_node_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
3957 { &hf_omron_status_node_0,
3958 { "Node 0", "omron.status.node.0", FT_BOOLEAN, 8, TFS(&boolean_status_flag_status), 0x01, NULL, HFILL }},
3959 { &hf_omron_status_node_1,
3960 { "Node 1", "omron.status.node.1", FT_BOOLEAN, 8, TFS(&boolean_status_flag_status), 0x02, NULL, HFILL }},
3961 { &hf_omron_status_node_2,
3962 { "Node 2", "omron.status.node.2", FT_BOOLEAN, 8, TFS(&boolean_status_flag_status), 0x04, NULL, HFILL }},
3963 { &hf_omron_status_node_3,
3964 { "Node 3", "omron.status.node.3", FT_BOOLEAN, 8, TFS(&boolean_status_flag_status), 0x08, NULL, HFILL }},
3965 { &hf_omron_status_node_4,
3966 { "Node 4", "omron.status.node.4", FT_BOOLEAN, 8, TFS(&boolean_status_flag_status), 0x10, NULL, HFILL }},
3967 { &hf_omron_status_node_5,
3968 { "Node 5", "omron.status.node.5", FT_BOOLEAN, 8, TFS(&boolean_status_flag_status), 0x20, NULL, HFILL }},
3969 { &hf_omron_status_node_6,
3970 { "Node 6", "omron.status.node.6", FT_BOOLEAN, 8, TFS(&boolean_status_flag_status), 0x40, NULL, HFILL }},
3971 { &hf_omron_status_node_7,
3972 { "Node 7", "omron.status.node.7", FT_BOOLEAN, 8, TFS(&boolean_status_flag_status), 0x80, NULL, HFILL }},
3973 { &hf_omron_status_1_node_0,
3974 { "Node 0", "omron.status.node.10", FT_BOOLEAN, 8, TFS(&boolean_status_block_stop_run), 0x01, NULL, HFILL }},
3975 { &hf_omron_status_1_node_1,
3976 { "Node 1", "omron.status.node.11", FT_BOOLEAN, 8, TFS(&boolean_status_block_stop_run), 0x02, NULL, HFILL }},
3977 { &hf_omron_status_1_node_2,
3978 { "Node 2", "omron.status.node.12", FT_BOOLEAN, 8, TFS(&boolean_status_block_stop_run), 0x04, NULL, HFILL }},
3979 { &hf_omron_status_1_node_3,
3980 { "Node 3", "omron.status.node.13", FT_BOOLEAN, 8, TFS(&boolean_status_block_stop_run), 0x08, NULL, HFILL }},
3981 { &hf_omron_status_1_node_4,
3982 { "Node 4", "omron.status.node.14", FT_BOOLEAN, 8, TFS(&boolean_status_block_stop_run), 0x10, NULL, HFILL }},
3983 { &hf_omron_status_1_node_5,
3984 { "Node 5", "omron.status.node.15", FT_BOOLEAN, 8, TFS(&boolean_status_block_stop_run), 0x20, NULL, HFILL }},
3985 { &hf_omron_status_1_node_6,
3986 { "Node 6", "omron.status.node.16", FT_BOOLEAN, 8, TFS(&boolean_status_block_stop_run), 0x40, NULL, HFILL }},
3987 { &hf_omron_status_1_node_7,
3988 { "Node 7", "omron.status.node.17", FT_BOOLEAN, 8, TFS(&boolean_status_block_stop_run), 0x80, NULL, HFILL }},
3989 { &hf_omron_status_2_node_0,
3990 { "Node 0", "omron.status.node.20", FT_BOOLEAN, 8, TFS(&boolean_status_flag_status_2), 0x01, NULL, HFILL }},
3991 { &hf_omron_status_2_node_1,
3992 { "Node 1", "omron.status.node.21", FT_BOOLEAN, 8, TFS(&boolean_status_flag_status_2), 0x02, NULL, HFILL }},
3993 { &hf_omron_status_2_node_2,
3994 { "Node 2", "omron.status.node.22", FT_BOOLEAN, 8, TFS(&boolean_status_flag_status_2), 0x04, NULL, HFILL }},
3995 { &hf_omron_status_2_node_3,
3996 { "Node 3", "omron.status.node.23", FT_BOOLEAN, 8, TFS(&boolean_status_flag_status_2), 0x08, NULL, HFILL }},
3997 { &hf_omron_status_2_node_4,
3998 { "Node 4", "omron.status.node.24", FT_BOOLEAN, 8, TFS(&boolean_status_flag_status_2), 0x10, NULL, HFILL }},
3999 { &hf_omron_status_2_node_5,
4000 { "Node 5", "omron.status.node.25", FT_BOOLEAN, 8, TFS(&boolean_status_flag_status_2), 0x20, NULL, HFILL }},
4001 { &hf_omron_status_2_node_6,
4002 { "Node 6", "omron.status.node.26", FT_BOOLEAN, 8, TFS(&boolean_status_flag_status_2), 0x40, NULL, HFILL }},
4003 { &hf_omron_status_2_node_7,
4004 { "Node 7", "omron.status.node.27", FT_BOOLEAN, 8, TFS(&boolean_status_flag_status_2), 0x80, NULL, HFILL }},
4005 { &hf_omron_name_data,
4006 { "Name data", "omron.name_data", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
4007 { &hf_omron_num_receptions,
4008 { "Number of receptions", "omron.num_receptions", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
4009 { &hf_omron_netw_node_sts_low_0,
4010 { "Network", "omron.node_number.low.network", FT_BOOLEAN, 8, TFS(&boolean_member_network), 0x01, NULL, HFILL }},
4011 { &hf_omron_netw_node_sts_low_1,
4012 { "Exit status", "omron.node_number.low.exit_status", FT_BOOLEAN, 8, TFS(&boolean_status_flag_status), 0x02, NULL, HFILL }},
4013 { &hf_omron_netw_node_sts_low_2,
4014 { "Reserved", "omron.node_number.low.rv", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }},
4015 { &hf_omron_netw_node_sts_low_3,
4016 { "Polling", "omron.node_number.low.polling_Status", FT_BOOLEAN, 8, TFS(&boolean_member_polling), 0x08, NULL, HFILL }},
4017 { &hf_omron_netw_node_sts_high_0,
4018 { "Network", "omron.node_number.high.network", FT_BOOLEAN, 8, TFS(&boolean_member_network), 0x10, NULL, HFILL }},
4019 { &hf_omron_netw_node_sts_high_1,
4020 { "Exit status", "omron.node_number.high.exit_status", FT_BOOLEAN, 8, TFS(&boolean_status_flag_status), 0x20, NULL, HFILL }},
4021 { &hf_omron_netw_node_sts_high_2,
4022 { "Reserved", "omron.node_number.high.rv", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }},
4023 { &hf_omron_netw_node_sts_high_3,
4024 { "Polling", "omron.node_number.high.polling_Status", FT_BOOLEAN, 8, TFS(&boolean_member_polling), 0x80, NULL, HFILL }},
4025 { &hf_omron_com_cycle_time,
4026 { "Communications cycle time (usec)", "omron.com_cycle_time", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
4027 { &hf_omron_polling_unit_node_num,
4028 { "Current polling unit node number", "omron.polling_unit_node_num", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
4029 { &hf_omron_cyclic_operation,
4030 { "Cyclic operation", "omron.cyclic_operation", FT_UINT8, BASE_HEX, VALS(omron_cyclic_ops_codes), 0x0, NULL, HFILL }},
4031 { &hf_omron_cyclic_trans_status,
4032 { "Cyclic transmission status", "omron.cyclic_trans_status", FT_UINT8, BASE_HEX, VALS(omron_cyclic_trans_codes), 0x0, NULL, HFILL }},
4033 { &hf_omron_cyclic_label_1,
4034 { "Nodes 1- 7", "omron.cyclic_error_status", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
4035 { &hf_omron_cyclic_7,
4036 { "Node 7 error status", "omron.cyclic_error.node.7", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x80, NULL, HFILL }},
4037 { &hf_omron_cyclic_6,
4038 { "Node 6 error status", "omron.cyclic_error.node.6", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x40, NULL, HFILL }},
4039 { &hf_omron_cyclic_5,
4040 { "Node 5 error status", "omron.cyclic_error.node.5", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x20, NULL, HFILL }},
4041 { &hf_omron_cyclic_4,
4042 { "Node 4 error status", "omron.cyclic_error.node.4", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x10, NULL, HFILL }},
4043 { &hf_omron_cyclic_3,
4044 { "Node 3 error status", "omron.cyclic_error.node.3", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x08, NULL, HFILL }},
4045 { &hf_omron_cyclic_2,
4046 { "Node 2 error status", "omron.cyclic_error.node.2", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x04, NULL, HFILL }},
4047 { &hf_omron_cyclic_1,
4048 { "Node 1 error status", "omron.cyclic_error.node.1", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x02, NULL, HFILL }},
4049 { &hf_omron_cyclic_label_2,
4050 { "Nodes 8-15", "omron.cyclic_error_status", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
4051 { &hf_omron_cyclic_15,
4052 { "Node 15 error status", "omron.cyclic_error.node.15", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x80, NULL, HFILL }},
4053 { &hf_omron_cyclic_14,
4054 { "Node 14 error status", "omron.cyclic_error.node.14", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x40, NULL, HFILL }},
4055 { &hf_omron_cyclic_13,
4056 { "Node 13 error status", "omron.cyclic_error.node.13", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x20, NULL, HFILL }},
4057 { &hf_omron_cyclic_12,
4058 { "Node 12 error status", "omron.cyclic_error.node.12", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x10, NULL, HFILL }},
4059 { &hf_omron_cyclic_11,
4060 { "Node 11 error status", "omron.cyclic_error.node.11", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x08, NULL, HFILL }},
4061 { &hf_omron_cyclic_10,
4062 { "Node 10 error status", "omron.cyclic_error.node.10", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x04, NULL, HFILL }},
4063 { &hf_omron_cyclic_9,
4064 { "Node 9 error status", "omron.cyclic_error.node.9", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x02, NULL, HFILL }},
4065 { &hf_omron_cyclic_8,
4066 { "Node 8 error status", "omron.cyclic_error.node.8", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x01, NULL, HFILL }},
4067 { &hf_omron_cyclic_label_3,
4068 { "Nodes 16-23", "omron.cyclic_error_status", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
4069 { &hf_omron_cyclic_23,
4070 { "Node 23 error status", "omron.cyclic_error.node.23", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x80, NULL, HFILL }},
4071 { &hf_omron_cyclic_22,
4072 { "Node 22 error status", "omron.cyclic_error.node.22", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x40, NULL, HFILL }},
4073 { &hf_omron_cyclic_21,
4074 { "Node 21 error status", "omron.cyclic_error.node.21", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x20, NULL, HFILL }},
4075 { &hf_omron_cyclic_20,
4076 { "Node 20 error status", "omron.cyclic_error.node.20", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x10, NULL, HFILL }},
4077 { &hf_omron_cyclic_19,
4078 { "Node 19 error status", "omron.cyclic_error.node.19", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x08, NULL, HFILL }},
4079 { &hf_omron_cyclic_18,
4080 { "Node 18 error status", "omron.cyclic_error.node.18", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x04, NULL, HFILL }},
4081 { &hf_omron_cyclic_17,
4082 { "Node 17 error status", "omron.cyclic_error.node.17", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x02, NULL, HFILL }},
4083 { &hf_omron_cyclic_16,
4084 { "Node 16 error status", "omron.cyclic_error.node.16", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x01, NULL, HFILL }},
4085 { &hf_omron_cyclic_label_4,
4086 { "Nodes 24-31", "omron.cyclic_error_status", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
4087 { &hf_omron_cyclic_31,
4088 { "Node 31 error status", "omron.cyclic_error.node.31", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x80, NULL, HFILL }},
4089 { &hf_omron_cyclic_30,
4090 { "Node 30 error status", "omron.cyclic_error.node.30", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x40, NULL, HFILL }},
4091 { &hf_omron_cyclic_29,
4092 { "Node 29 error status", "omron.cyclic_error.node.29", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x20, NULL, HFILL }},
4093 { &hf_omron_cyclic_28,
4094 { "Node 28 error status", "omron.cyclic_error.node.28", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x10, NULL, HFILL }},
4095 { &hf_omron_cyclic_27,
4096 { "Node 27 error status", "omron.cyclic_error.node.27", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x08, NULL, HFILL }},
4097 { &hf_omron_cyclic_26,
4098 { "Node 26 error status", "omron.cyclic_error.node.26", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x04, NULL, HFILL }},
4099 { &hf_omron_cyclic_25,
4100 { "Node 25 error status", "omron.cyclic_error.node.25", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x02, NULL, HFILL }},
4101 { &hf_omron_cyclic_24,
4102 { "Node 24 error status", "omron.cyclic_error.node.24", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x01, NULL, HFILL }},
4103 { &hf_omron_cyclic_label_5,
4104 { "Nodes 32-39", "omron.cyclic_error_status", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
4105 { &hf_omron_cyclic_39,
4106 { "Node 39 error status", "omron.cyclic_error.node.39", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x80, NULL, HFILL }},
4107 { &hf_omron_cyclic_38,
4108 { "Node 38 error status", "omron.cyclic_error.node.38", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x40, NULL, HFILL }},
4109 { &hf_omron_cyclic_37,
4110 { "Node 37 error status", "omron.cyclic_error.node.37", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x20, NULL, HFILL }},
4111 { &hf_omron_cyclic_36,
4112 { "Node 36 error status", "omron.cyclic_error.node.36", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x10, NULL, HFILL }},
4113 { &hf_omron_cyclic_35,
4114 { "Node 35 error status", "omron.cyclic_error.node.35", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x08, NULL, HFILL }},
4115 { &hf_omron_cyclic_34,
4116 { "Node 34 error status", "omron.cyclic_error.node.34", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x04, NULL, HFILL }},
4117 { &hf_omron_cyclic_33,
4118 { "Node 33 error status", "omron.cyclic_error.node.33", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x02, NULL, HFILL }},
4119 { &hf_omron_cyclic_32,
4120 { "Node 32 error status", "omron.cyclic_error.node.32", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x01, NULL, HFILL }},
4121 { &hf_omron_cyclic_label_6,
4122 { "Nodes 40-47", "omron.cyclic_error_status", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
4123 { &hf_omron_cyclic_47,
4124 { "Node 47 error status", "omron.cyclic_error.node.47", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x80, NULL, HFILL }},
4125 { &hf_omron_cyclic_46,
4126 { "Node 46 error status", "omron.cyclic_error.node.46", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x40, NULL, HFILL }},
4127 { &hf_omron_cyclic_45,
4128 { "Node 45 error status", "omron.cyclic_error.node.45", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x20, NULL, HFILL }},
4129 { &hf_omron_cyclic_44,
4130 { "Node 44 error status", "omron.cyclic_error.node.44", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x10, NULL, HFILL }},
4131 { &hf_omron_cyclic_43,
4132 { "Node 43 error status", "omron.cyclic_error.node.43", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x08, NULL, HFILL }},
4133 { &hf_omron_cyclic_42,
4134 { "Node 42 error status", "omron.cyclic_error.node.42", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x04, NULL, HFILL }},
4135 { &hf_omron_cyclic_41,
4136 { "Node 41 error status", "omron.cyclic_error.node.41", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x02, NULL, HFILL }},
4137 { &hf_omron_cyclic_40,
4138 { "Node 40 error status", "omron.cyclic_error.node.40", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x01, NULL, HFILL }},
4139 { &hf_omron_cyclic_label_7,
4140 { "Nodes 48-55", "omron.cyclic_error_status", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
4141 { &hf_omron_cyclic_55,
4142 { "Node 55 error status", "omron.cyclic_error.node.55", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x80, NULL, HFILL }},
4143 { &hf_omron_cyclic_54,
4144 { "Node 54 error status", "omron.cyclic_error.node.54", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x40, NULL, HFILL }},
4145 { &hf_omron_cyclic_53,
4146 { "Node 53 error status", "omron.cyclic_error.node.53", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x20, NULL, HFILL }},
4147 { &hf_omron_cyclic_52,
4148 { "Node 52 error status", "omron.cyclic_error.node.52", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x10, NULL, HFILL }},
4149 { &hf_omron_cyclic_51,
4150 { "Node 51 error status", "omron.cyclic_error.node.51", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x08, NULL, HFILL }},
4151 { &hf_omron_cyclic_50,
4152 { "Node 50 error status", "omron.cyclic_error.node.50", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x04, NULL, HFILL }},
4153 { &hf_omron_cyclic_49,
4154 { "Node 49 error status", "omron.cyclic_error.node.49", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x02, NULL, HFILL }},
4155 { &hf_omron_cyclic_48,
4156 { "Node 48 error status", "omron.cyclic_error.node.48", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x01, NULL, HFILL }},
4157 { &hf_omron_cyclic_label_8,
4158 { "Nodes 56-62", "omron.cyclic_error_status", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
4159 { &hf_omron_cyclic_62,
4160 { "Node 62 error status", "omron.cyclic_error.node.62", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x40, NULL, HFILL }},
4161 { &hf_omron_cyclic_61,
4162 { "Node 61 error status", "omron.cyclic_error.node.61", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x20, NULL, HFILL }},
4163 { &hf_omron_cyclic_60,
4164 { "Node 60 error status", "omron.cyclic_error.node.60", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x10, NULL, HFILL }},
4165 { &hf_omron_cyclic_59,
4166 { "Node 59 error status", "omron.cyclic_error.node.59", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x08, NULL, HFILL }},
4167 { &hf_omron_cyclic_58,
4168 { "Node 58 error status", "omron.cyclic_error.node.58", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x04, NULL, HFILL }},
4169 { &hf_omron_cyclic_57,
4170 { "Node 57 error status", "omron.cyclic_error.node.57", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x02, NULL, HFILL }},
4171 { &hf_omron_cyclic_56,
4172 { "Node 56 error status", "omron.cyclic_error.node.56", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x01, NULL, HFILL }},
4173 { &hf_omron_node_error_count,
4174 { "Node error count", "omron.node_error_count", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}
4177 /* Setup protocol subtree array */
4178 static int *ett[] = {
4179 &ett_omron,
4180 &ett_omron_tcp_header,
4181 &ett_omron_header,
4182 &ett_omron_icf_fields,
4183 &ett_omron_command_data,
4184 &ett_area_data,
4185 &ett_cpu_bus,
4186 &ett_io_data,
4187 &ett_pc_status_fields,
4188 &ett_fatal_fields,
4189 &ett_non_fatal_fields,
4190 &ett_message_fields,
4191 &ett_omron_error_log_data,
4192 &ett_omron_disk_data,
4193 &ett_omron_file_data,
4194 &ett_omron_data_type,
4195 &ett_omron_block_record,
4196 &ett_omron_status_block,
4197 &ett_omron_cyclic_fields,
4198 &ett_omron_netw_nodes_sts,
4199 &ett_omron_netw_node_sts,
4200 &ett_omron_netw_nodes_non_fatal_err_sts,
4201 &ett_omron_netw_nodes_cyclic_err_ctrs,
4202 &ett_omron_data_link_status_tree,
4205 static ei_register_info ei[] = {
4206 { &ei_omron_command_code, { "omron.command.unknown", PI_UNDECODED, PI_WARN, "Unknown Command-Code", EXPFILL }},
4207 { &ei_oomron_command_memory_area_code, { "omron.memory.area.read.unknown", PI_UNDECODED, PI_WARN, "Unknown Memory-Area-Code", EXPFILL }},
4208 { &ei_omron_bad_length, { "omron.bad_length", PI_MALFORMED, PI_WARN, "Unexpected Length", EXPFILL }},
4211 expert_module_t* expert_omron_fins;
4213 /* Register the protocol name and description */
4214 proto_omron_fins = proto_register_protocol (
4215 "OMRON FINS Protocol", /* name */
4216 "OMRON FINS", /* short name */
4217 "omron" /* abbrev */
4220 /* Required function calls to register the header fields and subtrees used */
4221 proto_register_field_array(proto_omron_fins, hf, array_length(hf));
4222 proto_register_subtree_array(ett, array_length(ett));
4223 expert_omron_fins = expert_register_protocol(proto_omron_fins);
4224 expert_register_field_array(expert_omron_fins, ei, array_length(ei));
4226 omron_fins_tcp_handle = register_dissector("omron.tcp", dissect_omron_fins_tcp, proto_omron_fins);
4227 omron_fins_udp_handle = register_dissector("omron.udp", dissect_omron_fins_udp, proto_omron_fins);
4229 #if 0
4230 /*Register preferences module (See Section 2.6 for more on preferences) */
4231 omron_fins_module = prefs_register_protocol(proto_omron_fins, NULL);
4233 /* Register a sample preference */
4234 prefs_register_bool_preference(omron_fins_module, "show_hex",
4235 "Display numbers in Hex",
4236 "Enable to display numerical values in hexadecimal.",
4237 &gPREF_HEX);
4238 #endif
4241 void
4242 proto_reg_handoff_omron_fins(void)
4244 dissector_add_uint_with_preference("tcp.port", OMRON_FINS_TCP_PORT, omron_fins_tcp_handle);
4245 dissector_add_uint_with_preference("udp.port", OMRON_FINS_UDP_PORT, omron_fins_udp_handle);
4249 * Editor modelines - https://www.wireshark.org/tools/modelines.html
4251 * Local variables:
4252 * c-basic-offset: 4
4253 * tab-width: 8
4254 * indent-tabs-mode: nil
4255 * End:
4257 * vi: set shiftwidth=4 tabstop=8 expandtab:
4258 * :indentSize=4:tabSize=8:noTabs=true: