nexmon – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 /* packet-dcerpc-pn-io.c
2 * Routines for PROFINET IO dissection.
3 *
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 */
22  
23 /*
24 * The PN-IO protocol is a field bus protocol related to decentralized
25 * periphery and is developed by the PROFIBUS Nutzerorganisation e.V. (PNO),
26 * see: www.profibus.com
27 *
28 *
29 * PN-IO is based on the common DCE-RPC and the "lightweight" PN-RT
30 * (ethernet type 0x8892) protocols.
31 *
32 * The context manager (CM) part is handling context information
33 * (like establishing, ...) and is using DCE-RPC as its underlying
34 * protocol.
35 *
36 * The actual cyclic data transfer and acyclic notification uses the
37 * "lightweight" PN-RT protocol.
38 *
39 * There are some other related PROFINET protocols (e.g. PN-DCP, which is
40 * handling addressing topics).
41 *
42 * Please note: the PROFINET CBA protocol is independent of the PN-IO protocol!
43 */
44  
45 /*
46 * Cyclic PNIO RTC1 Data Dissection:
47 *
48 * To dissect cyclic PNIO RTC1 frames, this plug-in has to collect important module
49 * information out of "Ident OK", "Connect Request" and "Write Response"
50 * frames first. This information will be used within "packet-pn-rtc-one.c" to
51 * dissect PNIO and PROFIsafe RTC1 frames.
52 *
53 * The data of Stationname-, -type and -id will be gained out of
54 * packet-pn-dcp.c. The header packet-pn.h will save those data.
55 *
56 * Overview for cyclic PNIO RTC1 data dissection functions:
57 * -> dissect_IOCRBlockReq_block (Save amount of IODataObjects, IOCS)
58 * -> dissect_DataDescription (Save important values for cyclic data)
59 * -> dissect_ExpectedSubmoduleBlockReq_block (Get GSD information)
60 * -> dissect_ModuleDiffBlock_block (Module has different ID)
61 * -> dissect_ProfiSafeParameterRequest (Save PROFIsafe parameters)
62 * -> dissect_RecordDataWrite (Call ProfiSafeParameterRequest)
63 * -> pnio_rtc1_cleanup (Reset routine of saved RTC1 information)
64 */
65  
66  
67 #include "config.h"
68  
69 #include <string.h>
70 #include <glib.h>
71  
72 #include <epan/packet.h>
73 #include <epan/to_str.h>
74 #include <epan/wmem/wmem.h>
75 #include <epan/dissectors/packet-dcerpc.h>
76 #include <epan/expert.h>
77 #include <epan/dissector_filters.h>
78 #include <epan/proto_data.h>
79  
80 #include <wsutil/file_util.h>
81 #include <epan/prefs.h>
82  
83 #include "packet-pn.h"
84  
85 #include <stdio.h>
86 #include <stdlib.h>
87  
88 void proto_register_pn_io(void);
89 void proto_reg_handoff_pn_io(void);
90  
91  
92 #define MAX_NAMELENGTH 200 /* max. length of the given paths */
93 #define MAX_LINE_LENGTH 1024 /* used for fgets() */
94 #define F_MESSAGE_TRAILER_4BYTE 4 /* PROFIsafe: Defines the Amount of Bytes for CRC and Status-/Controlbyte */
95 #define PN_INPUT_CR 1 /* PROFINET Input Connect Request value */
96 #define PN_INPUT_DATADESCRITPION 1 /* PROFINET Input Data Description value */
97  
98  
99 static int proto_pn_io = -1;
100 static int proto_pn_io_controller = -1;
101 static int proto_pn_io_supervisor = -1;
102 static int proto_pn_io_parameterserver = -1;
103  
104 static int hf_pn_io_opnum = -1;
105 static int hf_pn_io_reserved16 = -1;
106  
107 static int hf_pn_io_array = -1;
108 static int hf_pn_io_status = -1;
109 static int hf_pn_io_args_max = -1;
110 static int hf_pn_io_args_len = -1;
111 static int hf_pn_io_array_max_count = -1;
112 static int hf_pn_io_array_offset = -1;
113 static int hf_pn_io_array_act_count = -1;
114  
115 static int hf_pn_io_ar_type = -1;
116 static int hf_pn_io_artype_req = -1;
117 static int hf_pn_io_cminitiator_macadd = -1;
118 static int hf_pn_io_cminitiator_objectuuid = -1;
119 static int hf_pn_io_parameter_server_objectuuid = -1;
120 static int hf_pn_io_ar_data = -1;
121 static int hf_pn_io_ar_properties = -1;
122 static int hf_pn_io_ar_properties_state = -1;
123 static int hf_pn_io_ar_properties_supervisor_takeover_allowed = -1;
124 static int hf_pn_io_ar_properties_parametrization_server = -1;
125 /* removed within 2.3
126 static int hf_pn_io_ar_properties_data_rate = -1;
127 */
128 static int hf_pn_io_ar_properties_reserved_1 = -1;
129 static int hf_pn_io_ar_properties_device_access = -1;
130 static int hf_pn_io_ar_properties_companion_ar = -1;
131 static int hf_pn_io_ar_properties_achnowledge_companion_ar = -1;
132 static int hf_pn_io_ar_properties_reserved = -1;
133 static int hf_pn_io_ar_properties_combined_object_container_with_legacy_startupmode = -1;
134 static int hf_pn_io_ar_properties_combined_object_container_with_advanced_startupmode = -1;
135 static int hf_pn_io_ar_properties_pull_module_alarm_allowed = -1;
136  
137 static int hf_pn_RedundancyInfo = -1;
138 static int hf_pn_RedundancyInfo_reserved = -1;
139 static int hf_pn_io_number_of_ARDATAInfo = -1;
140  
141 static int hf_pn_io_cminitiator_activitytimeoutfactor = -1;
142 static int hf_pn_io_cminitiator_udprtport = -1;
143 static int hf_pn_io_station_name_length = -1;
144 static int hf_pn_io_cminitiator_station_name = -1;
145 /* static int hf_pn_io_responder_station_name = -1; */
146 static int hf_pn_io_arproperties_StartupMode = -1;
147  
148 static int hf_pn_io_parameter_server_station_name = -1;
149  
150 static int hf_pn_io_cmresponder_macadd = -1;
151 static int hf_pn_io_cmresponder_udprtport = -1;
152  
153 static int hf_pn_io_number_of_iocrs = -1;
154 static int hf_pn_io_iocr_tree = -1;
155 static int hf_pn_io_iocr_type = -1;
156 static int hf_pn_io_iocr_reference = -1;
157 static int hf_pn_io_iocr_SubframeOffset = -1;
158 static int hf_pn_io_iocr_SubframeData =-1;
159 /* static int hf_pn_io_iocr_txports_port = -1; */
160 /* static int hf_pn_io_iocr_txports_redundantport = -1; */
161 static int hf_pn_io_sr_properties_Reserved_1 = -1;
162 static int hf_pn_io_sr_properties_Reserved_2 = -1;
163 static int hf_pn_io_RedundancyDataHoldFactor = -1;
164 static int hf_pn_io_sr_properties = -1;
165 static int hf_pn_io_sr_properties_InputValidOnBackupAR = -1;
166 static int hf_pn_io_sr_properties_ActivateRedundancyAlarm = -1;
167  
168 static int hf_pn_io_arvendor_strucidentifier_if0_low = -1;
169 static int hf_pn_io_arvendor_strucidentifier_if0_high = -1;
170 static int hf_pn_io_arvendor_strucidentifier_if0_is8000= -1;
171 static int hf_pn_io_arvendor_strucidentifier_not0 = -1;
172  
173 static int hf_pn_io_lt = -1;
174 static int hf_pn_io_iocr_properties = -1;
175 static int hf_pn_io_iocr_properties_rtclass = -1;
176 static int hf_pn_io_iocr_properties_reserved_1 = -1;
177 static int hf_pn_io_iocr_properties_media_redundancy = -1;
178 static int hf_pn_io_iocr_properties_reserved_2 = -1;
179 static int hf_pn_io_iocr_properties_reserved_3 = -1;
180 static int hf_pn_io_iocr_properties_fast_forwarding_mac_adr = -1;
181 static int hf_pn_io_iocr_properties_distributed_subframe_watchdog = -1;
182 static int hf_pn_io_iocr_properties_full_subframe_structure = -1;
183  
184  
185 static int hf_pn_io_data_length = -1;
186 static int hf_pn_io_ir_frame_data = -1;
187 static int hf_pn_io_frame_id = -1;
188 static int hf_pn_io_send_clock_factor = -1;
189 static int hf_pn_io_reduction_ratio = -1;
190 static int hf_pn_io_phase = -1;
191 static int hf_pn_io_sequence = -1;
192 static int hf_pn_io_frame_send_offset = -1;
193 static int hf_pn_io_frame_data_properties = -1;
194 static int hf_pn_io_frame_data_properties_forwarding_Mode = -1;
195 static int hf_pn_io_frame_data_properties_FastForwardingMulticastMACAdd = -1;
196 static int hf_pn_io_frame_data_properties_FragmentMode = -1;
197 static int hf_pn_io_frame_data_properties_reserved_1 = -1;
198 static int hf_pn_io_frame_data_properties_reserved_2 = -1;
199 static int hf_pn_io_watchdog_factor = -1;
200 static int hf_pn_io_data_hold_factor = -1;
201 static int hf_pn_io_iocr_tag_header = -1;
202 static int hf_pn_io_iocr_multicast_mac_add = -1;
203 static int hf_pn_io_number_of_apis = -1;
204 static int hf_pn_io_number_of_io_data_objects = -1;
205 static int hf_pn_io_io_data_object_frame_offset = -1;
206 static int hf_pn_io_number_of_iocs = -1;
207 static int hf_pn_io_iocs_frame_offset = -1;
208  
209 static int hf_pn_io_SFIOCRProperties = -1;
210 static int hf_pn_io_DistributedWatchDogFactor = -1;
211 static int hf_pn_io_RestartFactorForDistributedWD = -1;
212 static int hf_pn_io_SFIOCRProperties_DFPmode = -1;
213 static int hf_pn_io_SFIOCRProperties_reserved_1 = -1;
214 static int hf_pn_io_SFIOCRProperties_reserved_2 = -1;
215 static int hf_pn_io_SFIOCRProperties_DFPType =-1;
216 static int hf_pn_io_SFIOCRProperties_DFPRedundantPathLayout = -1;
217 static int hf_pn_io_SFIOCRProperties_SFCRC16 = -1;
218  
219 static int hf_pn_io_subframe_data = -1;
220 static int hf_pn_io_subframe_data_reserved1 = -1;
221 static int hf_pn_io_subframe_data_reserved2 = -1;
222  
223 static int hf_pn_io_subframe_data_position = -1;
224 static int hf_pn_io_subframe_reserved1 = -1;
225 static int hf_pn_io_subframe_data_length = -1;
226 static int hf_pn_io_subframe_reserved2 = -1;
227  
228 static int hf_pn_io_alarmcr_type = -1;
229 static int hf_pn_io_alarmcr_properties = -1;
230 static int hf_pn_io_alarmcr_properties_priority = -1;
231 static int hf_pn_io_alarmcr_properties_transport = -1;
232 static int hf_pn_io_alarmcr_properties_reserved = -1;
233  
234 static int hf_pn_io_rta_timeoutfactor = -1;
235 static int hf_pn_io_rta_retries = -1;
236 static int hf_pn_io_localalarmref = -1;
237 static int hf_pn_io_remotealarmref = -1;
238 static int hf_pn_io_maxalarmdatalength = -1;
239 static int hf_pn_io_alarmcr_tagheaderhigh = -1;
240 static int hf_pn_io_alarmcr_tagheaderlow = -1;
241  
242 static int hf_pn_io_IRData_uuid = -1;
243 static int hf_pn_io_ar_uuid = -1;
244 static int hf_pn_io_target_ar_uuid = -1;
245 static int hf_pn_io_api_tree = -1;
246 static int hf_pn_io_module_tree = -1;
247 static int hf_pn_io_submodule_tree = -1;
248 static int hf_pn_io_io_data_object = -1;
249 /* General module information */
250 static int hf_pn_io_io_cs = -1;
251  
252 static int hf_pn_io_substitutionmode = -1;
253  
254 static int hf_pn_io_api = -1;
255 static int hf_pn_io_slot_nr = -1;
256 static int hf_pn_io_subslot_nr = -1;
257 static int hf_pn_io_index = -1;
258 static int hf_pn_io_seq_number = -1;
259 static int hf_pn_io_record_data_length = -1;
260 static int hf_pn_io_add_val1 = -1;
261 static int hf_pn_io_add_val2 = -1;
262  
263 static int hf_pn_io_block = -1;
264 static int hf_pn_io_block_header = -1;
265 static int hf_pn_io_block_type = -1;
266 static int hf_pn_io_block_length = -1;
267 static int hf_pn_io_block_version_high = -1;
268 static int hf_pn_io_block_version_low = -1;
269  
270 static int hf_pn_io_sessionkey = -1;
271 static int hf_pn_io_control_command = -1;
272 static int hf_pn_io_control_command_prmend = -1;
273 static int hf_pn_io_control_command_applready = -1;
274 static int hf_pn_io_control_command_release = -1;
275 static int hf_pn_io_control_command_done = -1;
276 static int hf_pn_io_control_command_ready_for_companion = -1;
277 static int hf_pn_io_control_command_ready_for_rt_class3 = -1;
278 static int hf_pn_io_control_command_prmbegin = -1;
279 static int hf_pn_io_control_command_reserved_7_15 = -1;
280 static int hf_pn_io_control_block_properties = -1;
281 static int hf_pn_io_control_block_properties_applready = -1;
282 static int hf_pn_io_control_block_properties_applready0 = -1;
283  
284 /* static int hf_pn_io_AlarmSequenceNumber = -1; */
285 static int hf_pn_io_control_command_reserved = -1;
286 static int hf_pn_io_SubmoduleListEntries = -1;
287 static int hf_pn_io_error_code = -1;
288 static int hf_pn_io_error_decode = -1;
289 static int hf_pn_io_error_code1 = -1;
290 static int hf_pn_io_error_code1_pniorw = -1;
291 static int hf_pn_io_error_code1_pnio = -1;
292 static int hf_pn_io_error_code2 = -1;
293 static int hf_pn_io_error_code2_pniorw = -1;
294 static int hf_pn_io_error_code2_pnio_1 = -1;
295 static int hf_pn_io_error_code2_pnio_2 = -1;
296 static int hf_pn_io_error_code2_pnio_3 = -1;
297 static int hf_pn_io_error_code2_pnio_4 = -1;
298 static int hf_pn_io_error_code2_pnio_5 = -1;
299 static int hf_pn_io_error_code2_pnio_6 = -1;
300 static int hf_pn_io_error_code2_pnio_7 = -1;
301 static int hf_pn_io_error_code2_pnio_8 = -1;
302 static int hf_pn_io_error_code2_pnio_20 = -1;
303 static int hf_pn_io_error_code2_pnio_21 = -1;
304 static int hf_pn_io_error_code2_pnio_22 = -1;
305 static int hf_pn_io_error_code2_pnio_23 = -1;
306 static int hf_pn_io_error_code2_pnio_40 = -1;
307 static int hf_pn_io_error_code2_pnio_61 = -1;
308 static int hf_pn_io_error_code2_pnio_62 = -1;
309 static int hf_pn_io_error_code2_pnio_63 = -1;
310 static int hf_pn_io_error_code2_pnio_64 = -1;
311 static int hf_pn_io_error_code2_pnio_65 = -1;
312 static int hf_pn_io_error_code2_pnio_66 = -1;
313 static int hf_pn_io_error_code2_pnio_70 = -1;
314 static int hf_pn_io_error_code2_pnio_71 = -1;
315 static int hf_pn_io_error_code2_pnio_72 = -1;
316 static int hf_pn_io_error_code2_pnio_73 = -1;
317 static int hf_pn_io_error_code2_pnio_74 = -1;
318 static int hf_pn_io_error_code2_pnio_75 = -1;
319 static int hf_pn_io_error_code2_pnio_76 = -1;
320 static int hf_pn_io_error_code2_pnio_77 = -1;
321 static int hf_pn_io_error_code2_pnio_253 = -1;
322 static int hf_pn_io_error_code2_pnio_255 = -1;
323  
324 static int hf_pn_io_alarm_type = -1;
325 static int hf_pn_io_alarm_specifier = -1;
326 static int hf_pn_io_alarm_specifier_sequence = -1;
327 static int hf_pn_io_alarm_specifier_channel = -1;
328 static int hf_pn_io_alarm_specifier_manufacturer = -1;
329 static int hf_pn_io_alarm_specifier_submodule = -1;
330 static int hf_pn_io_alarm_specifier_ardiagnosis = -1;
331  
332 static int hf_pn_io_alarm_dst_endpoint = -1;
333 static int hf_pn_io_alarm_src_endpoint = -1;
334 static int hf_pn_io_pdu_type = -1;
335 static int hf_pn_io_pdu_type_type = -1;
336 static int hf_pn_io_pdu_type_version = -1;
337 static int hf_pn_io_add_flags = -1;
338 static int hf_pn_io_window_size = -1;
339 static int hf_pn_io_tack = -1;
340 static int hf_pn_io_send_seq_num = -1;
341 static int hf_pn_io_ack_seq_num = -1;
342 static int hf_pn_io_var_part_len = -1;
343  
344 static int hf_pn_io_number_of_modules = -1;
345 static int hf_pn_io_module_ident_number = -1;
346 static int hf_pn_io_module_properties = -1;
347 static int hf_pn_io_module_state = -1;
348 static int hf_pn_io_number_of_submodules = -1;
349 static int hf_pn_io_submodule_ident_number = -1;
350 static int hf_pn_io_submodule_properties = -1;
351 static int hf_pn_io_submodule_properties_type = -1;
352 static int hf_pn_io_submodule_properties_shared_input = -1;
353 static int hf_pn_io_submodule_properties_reduce_input_submodule_data_length = -1;
354 static int hf_pn_io_submodule_properties_reduce_output_submodule_data_length = -1;
355 static int hf_pn_io_submodule_properties_discard_ioxs = -1;
356 static int hf_pn_io_submodule_properties_reserved = -1;
357  
358 static int hf_pn_io_submodule_state = -1;
359 static int hf_pn_io_submodule_state_format_indicator = -1;
360 static int hf_pn_io_submodule_state_add_info = -1;
361 static int hf_pn_io_submodule_state_qualified_info = -1;
362 static int hf_pn_io_submodule_state_maintenance_required = -1;
363 static int hf_pn_io_submodule_state_maintenance_demanded = -1;
364 static int hf_pn_io_submodule_state_diag_info = -1;
365 static int hf_pn_io_submodule_state_ar_info = -1;
366 static int hf_pn_io_submodule_state_ident_info = -1;
367 static int hf_pn_io_submodule_state_detail = -1;
368  
369 static int hf_pn_io_data_description_tree = -1;
370 static int hf_pn_io_data_description = -1;
371 static int hf_pn_io_submodule_data_length = -1;
372 static int hf_pn_io_length_iocs = -1;
373 static int hf_pn_io_length_iops = -1;
374  
375 static int hf_pn_io_iocs = -1;
376 static int hf_pn_io_iops = -1;
377 static int hf_pn_io_ioxs_extension = -1;
378 static int hf_pn_io_ioxs_res14 = -1;
379 static int hf_pn_io_ioxs_instance = -1;
380 static int hf_pn_io_ioxs_datastate = -1;
381  
382 static int hf_pn_io_address_resolution_properties = -1;
383 static int hf_pn_io_mci_timeout_factor = -1;
384 static int hf_pn_io_provider_station_name = -1;
385  
386 static int hf_pn_io_user_structure_identifier = -1;
387 static int hf_pn_io_user_structure_identifier_manf = -1;
388  
389 static int hf_pn_io_channel_number = -1;
390 static int hf_pn_io_channel_properties = -1;
391 static int hf_pn_io_channel_properties_type = -1;
392 static int hf_pn_io_channel_properties_accumulative = -1;
393 static int hf_pn_io_channel_properties_maintenance = -1;
394  
395  
396 static int hf_pn_io_NumberOfSubframeBlocks = -1;
397 static int hf_pn_io_channel_properties_specifier = -1;
398 static int hf_pn_io_channel_properties_direction = -1;
399  
400 static int hf_pn_io_channel_error_type = -1;
401 static int hf_pn_io_ext_channel_error_type0 = -1;
402 static int hf_pn_io_ext_channel_error_type0x8000 = -1;
403 static int hf_pn_io_ext_channel_error_type0x8001 = -1;
404 static int hf_pn_io_ext_channel_error_type0x8002 = -1;
405 static int hf_pn_io_ext_channel_error_type0x8003 = -1;
406 static int hf_pn_io_ext_channel_error_type0x8004 = -1;
407 static int hf_pn_io_ext_channel_error_type0x8005 = -1;
408 static int hf_pn_io_ext_channel_error_type0x8007 = -1;
409 static int hf_pn_io_ext_channel_error_type0x8008 = -1;
410 static int hf_pn_io_ext_channel_error_type0x800A = -1;
411 static int hf_pn_io_ext_channel_error_type0x800B = -1;
412 static int hf_pn_io_ext_channel_error_type0x800C = -1;
413  
414 static int hf_pn_io_ext_channel_error_type = -1;
415  
416 static int hf_pn_io_ext_channel_add_value = -1;
417  
418 static int hf_pn_io_ptcp_subdomain_id = -1;
419 static int hf_pn_io_ir_data_id = -1;
420 static int hf_pn_io_max_bridge_delay = -1;
421 static int hf_pn_io_number_of_ports = -1;
422 static int hf_pn_io_max_port_tx_delay = -1;
423 static int hf_pn_io_max_port_rx_delay = -1;
424  
425 static int hf_pn_io_max_line_rx_delay = -1;
426 static int hf_pn_io_yellowtime = -1;
427 static int hf_pn_io_reserved_interval_begin = -1;
428 static int hf_pn_io_reserved_interval_end = -1;
429 static int hf_pn_io_pllwindow = -1;
430 static int hf_pn_io_sync_send_factor = -1;
431 static int hf_pn_io_sync_properties = -1;
432 static int hf_pn_io_sync_frame_address = -1;
433 static int hf_pn_io_ptcp_timeout_factor = -1;
434 static int hf_pn_io_ptcp_takeover_timeout_factor = -1;
435 static int hf_pn_io_ptcp_master_startup_time = -1;
436 static int hf_pn_io_ptcp_master_priority_1 = -1;
437 static int hf_pn_io_ptcp_master_priority_2 = -1;
438 static int hf_pn_io_ptcp_length_subdomain_name = -1;
439 static int hf_pn_io_ptcp_subdomain_name = -1;
440  
441 static int hf_pn_io_MultipleInterfaceMode_NameOfDevice = -1;
442 static int hf_pn_io_MultipleInterfaceMode_reserved_1 = -1;
443 static int hf_pn_io_MultipleInterfaceMode_reserved_2 = -1;
444 /* added Portstatistics */
445 static int hf_pn_io_pdportstatistic_ifInOctets = -1;
446 static int hf_pn_io_pdportstatistic_ifOutOctets = -1;
447 static int hf_pn_io_pdportstatistic_ifInDiscards = -1;
448 static int hf_pn_io_pdportstatistic_ifOutDiscards = -1;
449 static int hf_pn_io_pdportstatistic_ifInErrors = -1;
450 static int hf_pn_io_pdportstatistic_ifOutErrors = -1;
451 /* end of port statistics */
452  
453 static int hf_pn_io_domain_boundary = -1;
454 static int hf_pn_io_domain_boundary_ingress = -1;
455 static int hf_pn_io_domain_boundary_egress = -1;
456 static int hf_pn_io_multicast_boundary = -1;
457 static int hf_pn_io_adjust_properties = -1;
458 static int hf_pn_io_PreambleLength = -1;
459 static int hf_pn_io_mau_type = -1;
460 static int hf_pn_io_mau_type_mode = -1;
461 static int hf_pn_io_port_state = -1;
462 static int hf_pn_io_line_delay = -1;
463 static int hf_pn_io_number_of_peers = -1;
464 static int hf_pn_io_length_peer_port_id = -1;
465 static int hf_pn_io_peer_port_id = -1;
466 static int hf_pn_io_length_peer_chassis_id = -1;
467 static int hf_pn_io_peer_chassis_id = -1;
468 static int hf_pn_io_length_own_port_id = -1;
469 static int hf_pn_io_own_port_id = -1;
470 static int hf_pn_io_peer_macadd = -1;
471 static int hf_pn_io_media_type = -1;
472 static int hf_pn_io_macadd = -1;
473 static int hf_pn_io_length_own_chassis_id = -1;
474 static int hf_pn_io_own_chassis_id = -1;
475  
476 static int hf_pn_io_ethertype = -1;
477 static int hf_pn_io_rx_port = -1;
478 static int hf_pn_io_frame_details = -1;
479 static int hf_pn_io_frame_details_sync_frame = -1;
480 static int hf_pn_io_frame_details_meaning_frame_send_offset = -1;
481 static int hf_pn_io_frame_details_reserved = -1;
482 static int hf_pn_io_nr_of_tx_port_groups = -1;
483 static int hf_pn_io_TxPortGroupProperties = -1;
484 static int hf_pn_io_TxPortGroupProperties_bit0 = -1;
485 static int hf_pn_io_TxPortGroupProperties_bit1 = -1;
486 static int hf_pn_io_TxPortGroupProperties_bit2 = -1;
487 static int hf_pn_io_TxPortGroupProperties_bit3 = -1;
488 static int hf_pn_io_TxPortGroupProperties_bit4 = -1;
489 static int hf_pn_io_TxPortGroupProperties_bit5 = -1;
490 static int hf_pn_io_TxPortGroupProperties_bit6 = -1;
491 static int hf_pn_io_TxPortGroupProperties_bit7 = -1;
492  
493 static int hf_pn_io_start_of_red_frame_id = -1;
494 static int hf_pn_io_end_of_red_frame_id = -1;
495 static int hf_pn_io_ir_begin_end_port = -1;
496 static int hf_pn_io_number_of_assignments = -1;
497 static int hf_pn_io_number_of_phases = -1;
498 static int hf_pn_io_red_orange_period_begin_tx = -1;
499 static int hf_pn_io_orange_period_begin_tx = -1;
500 static int hf_pn_io_green_period_begin_tx = -1;
501 static int hf_pn_io_red_orange_period_begin_rx = -1;
502 static int hf_pn_io_orange_period_begin_rx = -1;
503 static int hf_pn_io_green_period_begin_rx = -1;
504 /* static int hf_pn_io_tx_phase_assignment = -1; */
505 static int hf_pn_ir_tx_phase_assignment = -1;
506 static int hf_pn_ir_rx_phase_assignment = -1;
507 static int hf_pn_io_tx_phase_assignment_begin_value = -1;
508 static int hf_pn_io_tx_phase_assignment_orange_begin = -1;
509 static int hf_pn_io_tx_phase_assignment_end_reserved = -1;
510 static int hf_pn_io_tx_phase_assignment_reserved = -1;
511 /* static int hf_pn_io_rx_phase_assignment = -1; */
512  
513 static int hf_pn_io_slot = -1;
514 static int hf_pn_io_subslot = -1;
515 static int hf_pn_io_number_of_slots = -1;
516 static int hf_pn_io_number_of_subslots = -1;
517  
518 /* static int hf_pn_io_maintenance_required_drop_budget = -1; */
519 /* static int hf_pn_io_maintenance_demanded_drop_budget = -1; */
520 /* static int hf_pn_io_error_drop_budget = -1; */
521  
522 static int hf_pn_io_maintenance_required_power_budget = -1;
523 static int hf_pn_io_maintenance_demanded_power_budget = -1;
524 static int hf_pn_io_error_power_budget = -1;
525  
526 static int hf_pn_io_fiber_optic_type = -1;
527 static int hf_pn_io_fiber_optic_cable_type = -1;
528  
529 static int hf_pn_io_controller_appl_cycle_factor = -1;
530 static int hf_pn_io_time_data_cycle = -1;
531 static int hf_pn_io_time_io_input = -1;
532 static int hf_pn_io_time_io_output = -1;
533 static int hf_pn_io_time_io_input_valid = -1;
534 static int hf_pn_io_time_io_output_valid = -1;
535  
536 static int hf_pn_io_maintenance_status = -1;
537 static int hf_pn_io_maintenance_status_required = -1;
538 static int hf_pn_io_maintenance_status_demanded = -1;
539  
540 static int hf_pn_io_vendor_id_high = -1;
541 static int hf_pn_io_vendor_id_low = -1;
542 static int hf_pn_io_vendor_block_type = -1;
543 static int hf_pn_io_order_id = -1;
544 static int hf_pn_io_im_serial_number = -1;
545 static int hf_pn_io_im_hardware_revision = -1;
546 static int hf_pn_io_im_revision_prefix = -1;
547 static int hf_pn_io_im_sw_revision_functional_enhancement = -1;
548 static int hf_pn_io_im_revision_bugfix = -1;
549 static int hf_pn_io_im_sw_revision_internal_change = -1;
550 static int hf_pn_io_im_revision_counter = -1;
551 static int hf_pn_io_im_profile_id = -1;
552 static int hf_pn_io_im_profile_specific_type = -1;
553 static int hf_pn_io_im_version_major = -1;
554 static int hf_pn_io_im_version_minor = -1;
555 static int hf_pn_io_im_supported = -1;
556 static int hf_pn_io_im_numberofentries = -1;
557 static int hf_pn_io_im_annotation = -1;
558 static int hf_pn_io_im_order_id = -1;
559  
560 static int hf_pn_io_number_of_ars = -1;
561  
562 static int hf_pn_io_cycle_counter = -1;
563 static int hf_pn_io_data_status = -1;
564 static int hf_pn_io_data_status_res67 = -1;
565 static int hf_pn_io_data_status_ok = -1;
566 static int hf_pn_io_data_status_operate = -1;
567 static int hf_pn_io_data_status_res3 = -1;
568 static int hf_pn_io_data_status_valid = -1;
569 static int hf_pn_io_data_status_res1 = -1;
570 static int hf_pn_io_data_status_primary = -1;
571 static int hf_pn_io_transfer_status = -1;
572  
573 static int hf_pn_io_actual_local_time_stamp = -1;
574 static int hf_pn_io_number_of_log_entries = -1;
575 static int hf_pn_io_local_time_stamp = -1;
576 static int hf_pn_io_entry_detail = -1;
577  
578 static int hf_pn_io_ip_address = -1;
579 static int hf_pn_io_subnetmask = -1;
580 static int hf_pn_io_standard_gateway = -1;
581  
582 static int hf_pn_io_mrp_domain_uuid = -1;
583 static int hf_pn_io_mrp_role = -1;
584 static int hf_pn_io_mrp_length_domain_name = -1;
585 static int hf_pn_io_mrp_domain_name = -1;
586 static int hf_pn_io_mrp_instances = -1;
587 static int hf_pn_io_mrp_instance = -1;
588  
589 static int hf_pn_io_mrp_prio = -1;
590 static int hf_pn_io_mrp_topchgt = -1;
591 static int hf_pn_io_mrp_topnrmax = -1;
592 static int hf_pn_io_mrp_tstshortt = -1;
593 static int hf_pn_io_mrp_tstdefaultt = -1;
594 static int hf_pn_io_mrp_tstnrmax = -1;
595 static int hf_pn_io_mrp_check = -1;
596 static int hf_pn_io_mrp_check_mrm = -1;
597 static int hf_pn_io_mrp_check_mrpdomain = -1;
598 static int hf_pn_io_mrp_check_reserved_1 = -1;
599 static int hf_pn_io_mrp_check_reserved_2 = -1;
600  
601 static int hf_pn_io_mrp_rtmode = -1;
602 static int hf_pn_io_mrp_rtmode_rtclass12 = -1;
603 static int hf_pn_io_mrp_rtmode_rtclass3 = -1;
604 static int hf_pn_io_mrp_rtmode_reserved1 = -1;
605 static int hf_pn_io_mrp_rtmode_reserved2 = -1;
606  
607 static int hf_pn_io_mrp_lnkdownt = -1;
608 static int hf_pn_io_mrp_lnkupt = -1;
609 static int hf_pn_io_mrp_lnknrmax = -1;
610 static int hf_pn_io_mrp_version = -1;
611  
612 static int hf_pn_io_substitute_active_flag = -1;
613 static int hf_pn_io_length_data = -1;
614  
615 static int hf_pn_io_mrp_ring_state = -1;
616 static int hf_pn_io_mrp_rt_state = -1;
617  
618 static int hf_pn_io_im_tag_function = -1;
619 static int hf_pn_io_im_tag_location = -1;
620 static int hf_pn_io_im_date = -1;
621 static int hf_pn_io_im_descriptor = -1;
622  
623 static int hf_pn_io_fs_hello_mode = -1;
624 static int hf_pn_io_fs_hello_interval = -1;
625 static int hf_pn_io_fs_hello_retry = -1;
626 static int hf_pn_io_fs_hello_delay = -1;
627  
628 static int hf_pn_io_fs_parameter_mode = -1;
629 static int hf_pn_io_fs_parameter_uuid = -1;
630  
631  
632 static int hf_pn_io_check_sync_mode = -1;
633 static int hf_pn_io_check_sync_mode_reserved = -1;
634 static int hf_pn_io_check_sync_mode_sync_master = -1;
635 static int hf_pn_io_check_sync_mode_cable_delay = -1;
636  
637 /* PROFIsafe fParameters */
638 static int hf_pn_io_ps_f_prm_flag1 = -1;
639 static int hf_pn_io_ps_f_prm_flag1_chck_seq = -1;
640 static int hf_pn_io_ps_f_prm_flag1_chck_ipar = -1;
641 static int hf_pn_io_ps_f_prm_flag1_sil = -1;
642 static int hf_pn_io_ps_f_prm_flag1_crc_len = -1;
643 static int hf_pn_io_ps_f_prm_flag1_crc_seed = -1;
644 static int hf_pn_io_ps_f_prm_flag1_reserved = -1;
645 static int hf_pn_io_ps_f_prm_flag2 = -1;
646 static int hf_pn_io_ps_f_wd_time = -1;
647 static int hf_pn_io_ps_f_ipar_crc = -1;
648 static int hf_pn_io_ps_f_par_crc = -1;
649 static int hf_pn_io_ps_f_src_adr = -1;
650 static int hf_pn_io_ps_f_dest_adr = -1;
651 static int hf_pn_io_ps_f_prm_flag2_reserved = -1;
652 static int hf_pn_io_ps_f_prm_flag2_f_block_id = -1;
653 static int hf_pn_io_ps_f_prm_flag2_f_par_version = -1;
654  
655 static int hf_pn_io_profidrive_request_reference = -1;
656 static int hf_pn_io_profidrive_request_id = -1;
657 static int hf_pn_io_profidrive_do_id = -1;
658 static int hf_pn_io_profidrive_no_of_parameters = -1;
659 static int hf_pn_io_profidrive_response_id = -1;
660 static int hf_pn_io_profidrive_param_attribute = -1;
661 static int hf_pn_io_profidrive_param_no_of_elems = -1;
662 static int hf_pn_io_profidrive_param_number = -1;
663 static int hf_pn_io_profidrive_param_subindex = -1;
664 static int hf_pn_io_profidrive_param_format = -1;
665 static int hf_pn_io_profidrive_param_no_of_values = -1;
666 static int hf_pn_io_profidrive_param_value_byte = -1;
667 static int hf_pn_io_profidrive_param_value_word = -1;
668 static int hf_pn_io_profidrive_param_value_dword = -1;
669 static int hf_pn_io_profidrive_param_value_float = -1;
670 static int hf_pn_io_profidrive_param_value_string = -1;
671  
672 /* static int hf_pn_io_packedframe_SFCRC = -1; */
673 static gint ett_pn_io = -1;
674 static gint ett_pn_io_block = -1;
675 static gint ett_pn_io_block_header = -1;
676 static gint ett_pn_io_status = -1;
677 static gint ett_pn_io_rtc = -1;
678 static gint ett_pn_io_rta = -1;
679 static gint ett_pn_io_pdu_type = -1;
680 static gint ett_pn_io_add_flags = -1;
681 static gint ett_pn_io_control_command = -1;
682 static gint ett_pn_io_ioxs = -1;
683 static gint ett_pn_io_api = -1;
684 static gint ett_pn_io_data_description = -1;
685 static gint ett_pn_io_module = -1;
686 static gint ett_pn_io_submodule = -1;
687 static gint ett_pn_io_io_data_object = -1;
688 static gint ett_pn_io_io_cs = -1;
689 static gint ett_pn_io_ar_properties = -1;
690 static gint ett_pn_io_iocr_properties = -1;
691 static gint ett_pn_io_submodule_properties = -1;
692 static gint ett_pn_io_alarmcr_properties = -1;
693 static gint ett_pn_io_submodule_state = -1;
694 static gint ett_pn_io_channel_properties = -1;
695 static gint ett_pn_io_slot = -1;
696 static gint ett_pn_io_subslot = -1;
697 static gint ett_pn_io_maintenance_status = -1;
698 static gint ett_pn_io_data_status = -1;
699 static gint ett_pn_io_iocr = -1;
700 static gint ett_pn_io_mrp_rtmode = -1;
701 static gint ett_pn_io_control_block_properties = -1;
702 static gint ett_pn_io_check_sync_mode = -1;
703 static gint ett_pn_io_ir_frame_data = -1;
704 static gint ett_pn_FrameDataProperties = -1;
705 static gint ett_pn_io_ar_info = -1;
706 static gint ett_pn_io_ar_data = -1;
707 static gint ett_pn_io_ir_begin_end_port = -1;
708 static gint ett_pn_io_ir_tx_phase = -1;
709 static gint ett_pn_io_ir_rx_phase = -1;
710 static gint ett_pn_io_subframe_data =-1;
711 static gint ett_pn_io_SFIOCRProperties = -1;
712 static gint ett_pn_io_frame_defails = -1;
713 static gint ett_pn_io_profisafe_f_parameter = -1;
714 static gint ett_pn_io_profisafe_f_parameter_prm_flag1 = -1;
715 static gint ett_pn_io_profisafe_f_parameter_prm_flag2 = -1;
716 static gint ett_pn_io_profidrive_parameter_request = -1;
717 static gint ett_pn_io_profidrive_parameter_response = -1;
718 static gint ett_pn_io_profidrive_parameter_address = -1;
719 static gint ett_pn_io_profidrive_parameter_value = -1;
720  
721 static gint ett_pn_io_GroupProperties = -1;
722  
723 #define PD_SUB_FRAME_BLOCK_FIOCR_PROPERTIES_LENGTH 4
724 #define PD_SUB_FRAME_BLOCK_FRAME_ID_LENGTH 2
725 #define PD_SUB_FRAME_BLOCK_SUB_FRAME_DATA_LENGTH 4
726  
727 static expert_field ei_pn_io_block_version = EI_INIT;
728 static expert_field ei_pn_io_block_length = EI_INIT;
729 static expert_field ei_pn_io_unsupported = EI_INIT;
730 static expert_field ei_pn_io_error_code1 = EI_INIT;
731 static expert_field ei_pn_io_localalarmref = EI_INIT;
732 static expert_field ei_pn_io_mrp_instances = EI_INIT;
733 static expert_field ei_pn_io_error_code2 = EI_INIT;
734 static expert_field ei_pn_io_ar_info_not_found = EI_INIT;
735 static expert_field ei_pn_io_iocr_type = EI_INIT;
736 static expert_field ei_pn_io_frame_id = EI_INIT;
737 static expert_field ei_pn_io_nr_of_tx_port_groups = EI_INIT;
738  
739 static e_guid_t uuid_pn_io_device = { 0xDEA00001, 0x6C97, 0x11D1, { 0x82, 0x71, 0x00, 0xA0, 0x24, 0x42, 0xDF, 0x7D } };
740 static guint16 ver_pn_io_device = 1;
741  
742 static e_guid_t uuid_pn_io_controller = { 0xDEA00002, 0x6C97, 0x11D1, { 0x82, 0x71, 0x00, 0xA0, 0x24, 0x42, 0xDF, 0x7D } };
743 static guint16 ver_pn_io_controller = 1;
744  
745 static e_guid_t uuid_pn_io_supervisor = { 0xDEA00003, 0x6C97, 0x11D1, { 0x82, 0x71, 0x00, 0xA0, 0x24, 0x42, 0xDF, 0x7D } };
746 static guint16 ver_pn_io_supervisor = 1;
747  
748 static e_guid_t uuid_pn_io_parameterserver = { 0xDEA00004, 0x6C97, 0x11D1, { 0x82, 0x71, 0x00, 0xA0, 0x24, 0x42, 0xDF, 0x7D } };
749 static guint16 ver_pn_io_parameterserver = 1;
750  
751  
752 /* PNIO Preference Variables */
753 gboolean pnio_ps_selection = TRUE;
754 static const char *pnio_ps_networkpath = "";
755  
756  
757 /* Allow heuristic dissection */
758 static heur_dissector_list_t heur_pn_subdissector_list;
759  
760 static const value_string pn_io_block_type[] = {
761 { 0x0000, "Reserved" },
762 { 0x0001, "Alarm Notification High"},
763 { 0x0002, "Alarm Notification Low"},
764 { 0x0008, "IODWriteReqHeader"},
765 { 0x8008, "IODWriteResHeader"},
766 { 0x0009, "IODReadReqHeader"},
767 { 0x8009, "IODReadResHeader"},
768 { 0x0010, "DiagnosisData"},
769 { 0x0011, "Reserved"},
770 { 0x0012, "ExpectedIdentificationData"},
771 { 0x0013, "RealIdentificationData"},
772 { 0x0014, "SubstituteValue"},
773 { 0x0015, "RecordInputDataObjectElement"},
774 { 0x0016, "RecordOutputDataObjectElement"},
775 { 0x0017, "reserved"},
776 { 0x0018, "ARData"},
777 { 0x0019, "LogData"},
778 { 0x001A, "APIData"},
779 { 0x001b, "SRLData"},
780 { 0x0020, "I&M0"},
781 { 0x0021, "I&M1"},
782 { 0x0022, "I&M2"},
783 { 0x0023, "I&M3"},
784 { 0x0024, "I&M4"},
785 { 0x0025, "I&M5"},
786 { 0x0026, "I&M6"},
787 { 0x0027, "I&M7"},
788 { 0x0028, "I&M8"},
789 { 0x0029, "I&M9"},
790 { 0x002A, "I&M10"},
791 { 0x002B, "I&M11"},
792 { 0x002C, "I&M12"},
793 { 0x002D, "I&M13"},
794 { 0x002E, "I&M14"},
795 { 0x002F, "I&M15"},
796 { 0x0030, "I&M0FilterDataSubmodul"},
797 { 0x0031, "I&M0FilterDataModul"},
798 { 0x0032, "I&M0FilterDataDevice"},
799 { 0x0033, "I&M5Data"},
800 { 0x8001, "Alarm Ack High"},
801 { 0x8002, "Alarm Ack Low"},
802 { 0x0101, "ARBlockReq"},
803 { 0x8101, "ARBlockRes"},
804 { 0x0102, "IOCRBlockReq"},
805 { 0x8102, "IOCRBlockRes"},
806 { 0x0103, "AlarmCRBlockReq"},
807 { 0x8103, "AlarmCRBlockRes"},
808 { 0x0104, "ExpectedSubmoduleBlockReq"},
809 { 0x8104, "ModuleDiffBlock"},
810 { 0x0105, "PrmServerBlockReq"},
811 { 0x8105, "PrmServerBlockRes"},
812 { 0x0106, "MCRBlockReq"},
813 { 0x8106, "ARServerBlock"},
814 { 0x0107, "SubFrameBlock"},
815 { 0x0108, "ARVendorBlockReq"},
816 { 0x8108, "ARVendorBlockRes"},
817 { 0x0109, "IRInfoBlock"},
818 { 0x010A, "SRInfoBlock"},
819 { 0x010B, "ARFSUBlock"},
820 { 0x0110, "IODControlReq Prm End.req"},
821 { 0x8110, "IODControlRes Prm End.rsp"},
822 { 0x0111, "IODControlReq Prm End.req"},
823 { 0x8111, "IODControlRes Prm End.rsp"},
824 { 0x0112, "IOXBlockReq Application Ready.req"},
825 { 0x8112, "IOXBlockRes Application Ready.rsp"},
826 { 0x0113, "IOXBlockReq Application Ready.req"},
827 { 0x8113, "IOXBlockRes Application Ready.rsp"},
828 { 0x0114, "IODReleaseReq"},
829 { 0x8114, "IODReleaseRes"},
830 { 0x0115, "ARRPCServerBlockReq"},
831 { 0x8115, "ARRPCServerBlockRes"},
832 { 0x0116, "IOXControlReq Ready for Companion.req"},
833 { 0x8116, "IOXControlRes Ready for Companion.rsp"},
834 { 0x0117, "IOXControlReq Ready for RT_CLASS_3.req"},
835 { 0x8117, "IOXControlRes Ready for RT_CLASS_3.rsp"},
836 { 0x0118, "ControlBlockPrmBegin"},
837 { 0x0119, "SubmoduleListBlock"},
838 { 0x8118, "ControlBlockPrmBeginRes"},
839  
840 { 0x0200, "PDPortDataCheck"},
841 { 0x0201, "PDevData"},
842 { 0x0202, "PDPortDataAdjust"},
843 { 0x0203, "PDSyncData"},
844 { 0x0204, "IsochronousModeData"},
845 { 0x0205, "PDIRData"},
846 { 0x0206, "PDIRGlobalData"},
847 { 0x0207, "PDIRFrameData"},
848 { 0x0208, "PDIRBeginEndData"},
849 { 0x0209, "AdjustDomainBoundary"},
850 { 0x020A, "CheckPeers"},
851 { 0x020B, "CheckLineDelay"},
852 { 0x020C, "Checking MAUType"},
853 { 0x020E, "Adjusting MAUType"},
854 { 0x020F, "PDPortDataReal"},
855 { 0x0210, "AdjustMulticastBoundary"},
856 { 0x0211, "PDInterfaceMrpDataAdjust"},
857 { 0x0212, "PDInterfaceMrpDataReal"},
858 { 0x0213, "PDInterfaceMrpDataCheck"},
859 { 0x0214, "PDPortMrpDataAdjust"},
860 { 0x0215, "PDPortMrpDataReal"},
861 { 0x0216, "Media redundancy manager parameters"},
862 { 0x0217, "Media redundancy client parameters"},
863 { 0x0218, "Media redundancy RT mode for manager"},
864 { 0x0219, "Media redundancy ring state data"},
865 { 0x021A, "Media redundancy RT ring state data"},
866 { 0x021B, "Adjust LinkState"},
867 { 0x021C, "Checking LinkState"},
868 { 0x021D, "Media redundancy RT mode for clients"},
869 { 0x021E, "CheckSyncDifference"},
870 { 0x021F, "CheckMAUTypeDifference"},
871 { 0x0220, "PDPortFODataReal"},
872 { 0x0221, "Reading real fiber optic manufacturerspecific data"},
873 { 0x0222, "PDPortFODataAdjust"},
874 { 0x0223, "PDPortFODataCheck"},
875 { 0x0224, "Adjust PeerToPeerBoundary"},
876 { 0x0225, "Adjust DCPBoundary"},
877 { 0x0226, "Adjust PreambleLength"},
878 { 0x0227, "Adjust FastForwardingBoundary"},
879 { 0x0228, "Reading real fiber optic diagnosis data"},
880 { 0x022A, "PDIRSubframeData"},
881 { 0x022B, "SubframeBlock"},
882 { 0x0230, "PDNCDataCheck"},
883 { 0x0231, "MrpInstanceDataAdjust"},
884 { 0x0232, "MrpInstanceDataReal"},
885 { 0x0233, "MrpInstanceDataCheck"},
886 { 0x0240, "PDInterfaceDataReal"},
887 { 0x0250, "PDInterfaceAdjust"},
888 { 0x0251, "PDPortStatistic"},
889 { 0x0400, "MultipleBlockHeader"},
890 { 0x0401, "COContainerContent"},
891 { 0x0500, "RecordDataReadQuery"},
892 { 0x0600, "FSHello"},
893 { 0x0601, "FSParameterBlock"},
894 { 0x0608, "PDInterfaceFSUDataAdjust"},
895 { 0x0609, "ARFSUDataAdjust"},
896 { 0x0700, "AutoConfiguration"},
897 { 0x0701, "AutoConfiguration Communication"},
898 { 0x0702, "AutoConfiguration Configuration"},
899 { 0xB050, "Ext-PLL Control / RTC+RTA SyncID 0 (EDD)" },
900 { 0xB051, "Ext-PLL Control / RTA SyncID 1 (GSY)" },
901  
902 { 0xB060, "EDD Trace Unit (EDD)" },
903 { 0xB061, "EDD Trace Unit (EDD)" },
904  
905 { 0xB070, "OHA Info (OHA)" },
906  
907 { 0x0F00, "MaintenanceItem"},
908 { 0x0F01, "Upload selected Records within Upload&RetrievalItem"},
909 { 0x0F02, "iParameterItem"},
910 { 0x0F03, "Retrieve selected Records within Upload&RetrievalItem"},
911 { 0x0F04, "Retrieve all Records within Upload&RetrievalItem"},
912 { 0, NULL }
913 };
914  
915 static const value_string pn_io_alarm_type[] = {
916 { 0x0000, "Reserved" },
917 { 0x0001, "Diagnosis" },
918 { 0x0002, "Process" },
919 { 0x0003, "Pull" },
920 { 0x0004, "Plug" },
921 { 0x0005, "Status" },
922 { 0x0006, "Update" },
923 { 0x0007, "Redundancy" },
924 { 0x0008, "Controlled by supervisor" },
925 { 0x0009, "Released" },
926 { 0x000A, "Plug wrong submodule" },
927 { 0x000B, "Return of submodule" },
928 { 0x000C, "Diagnosis disappears" },
929 { 0x000D, "Multicast communication mismatch notification" },
930 { 0x000E, "Port data change notification" },
931 { 0x000F, "Sync data changed notification" },
932 { 0x0010, "Isochronous mode problem notification" },
933 { 0x0011, "Network component problem notification" },
934 { 0x0012, "Time data changed notification" },
935 { 0x0013, "Dynamic Frame Packing problem notification" },
936 /*0x0014 - 0x001D reserved */
937 { 0x001E, "Upload and retrieval notification" },
938 { 0x001F, "Pull module" },
939 /*0x0020 - 0x007F manufacturer specific */
940 /*0x0080 - 0x00FF reserved for profiles */
941 /*0x0100 - 0xFFFF reserved */
942 { 0, NULL }
943 };
944  
945 static const value_string pn_io_pdu_type[] = {
946 { 0x01, "Data-RTA-PDU" },
947 { 0x02, "NACK-RTA-PDU" },
948 { 0x03, "ACK-RTA-PDU" },
949 { 0x04, "ERR-RTA-PDU" },
950 { 0, NULL }
951 };
952  
953 static const value_string hf_pn_io_frame_data_properties_forwardingMode[] = {
954 { 0x00, "absolute mode" },
955 { 0x01, "relative mode"},
956 { 0, NULL }
957 };
958 static const value_string hf_pn_io_frame_data_properties_FFMulticastMACAdd[] = {
959 { 0x00, "Use interface MAC destination unicast address" },
960 { 0x01, "Use RT_CLASS_3 destination multicast address"},
961 { 0x02, "Use FastForwardingMulticastMACAdd"},
962 { 0x03, "reserved"},
963 { 0, NULL }};
964  
965 static const value_string hf_pn_io_frame_data_properties_FragMode[] = {
966 { 0x00, "No fragmentation" },
967 { 0x01, "Fragmentation enabled maximum size for static fragmentation 128 bytes"},
968 { 0x02, "Fragmentation enabled maximum size for static fragmentation 256 bytes"},
969 { 0x03, "reserved"},
970 { 0, NULL }};
971  
972 static const value_string pn_io_SFIOCRProperties_DFPType_vals[] = {
973 { 0x00, "DFP_INBOUND" },
974 { 0x01, "DFP_OUTBOUND" },
975 { 0, NULL }
976 };
977  
978 static const value_string pn_io_DFPRedundantPathLayout_decode[] = {
979 { 0x00, "The Frame for the redundant path contains the ordering shown by SubframeData" },
980 { 0x01, "The Frame for the redundant path contains the inverse ordering shown by SubframeData" },
981 { 0, NULL }
982 };
983  
984 static const value_string pn_io_SFCRC16_Decode[] = {
985 { 0x00, "SFCRC16 and SFCycleCounter shall be created or set to zero by the sender and not checked by the receiver" },
986 { 0x01, "SFCRC16 and SFCycleCounter shall be created by the sender and checked by the receiver." },
987 { 0, NULL }
988 };
989  
990 static const value_string pn_io_txgroup_state[] = {
991 { 0x00, "Transmission off" },
992 { 0x01, "Transmission on " },
993 { 0, NULL }
994 };
995  
996 static const value_string pn_io_error_code[] = {
997 { 0x00, "OK" },
998 { 0x81, "PNIO" },
999 { 0xCF, "RTA error" },
1000 { 0xDA, "AlarmAck" },
1001 { 0xDB, "IODConnectRes" },
1002 { 0xDC, "IODReleaseRes" },
1003 { 0xDD, "IODControlRes" },
1004 { 0xDE, "IODReadRes" },
1005 { 0xDF, "IODWriteRes" },
1006 { 0, NULL }
1007 };
1008  
1009 static const value_string pn_io_error_decode[] = {
1010 { 0x00, "OK" },
1011 { 0x80, "PNIORW" },
1012 { 0x81, "PNIO" },
1013 { 0, NULL }
1014 };
1015  
1016 /* dummy for unknown decode */
1017 static const value_string pn_io_error_code1[] = {
1018 { 0x00, "OK" },
1019 { 0, NULL }
1020 };
1021  
1022 /* dummy for unknown decode/code1 combination */
1023 static const value_string pn_io_error_code2[] = {
1024 { 0x00, "OK" },
1025 { 0, NULL }
1026 };
1027  
1028 static const value_string pn_io_error_code1_pniorw[] = {
1029 /* high nibble 0-9 not specified -> legacy codes */
1030 { 0xa0, "application: read error" },
1031 { 0xa1, "application: write error" },
1032 { 0xa2, "application: module failure" },
1033 { 0xa3, "application: not specified" },
1034 { 0xa4, "application: not specified" },
1035 { 0xa5, "application: not specified" },
1036 { 0xa6, "application: not specified" },
1037 { 0xa7, "application: busy" },
1038 { 0xa8, "application: version conflict" },
1039 { 0xa9, "application: feature not supported" },
1040 { 0xaa, "application: User specific 1" },
1041 { 0xab, "application: User specific 2" },
1042 { 0xac, "application: User specific 3" },
1043 { 0xad, "application: User specific 4" },
1044 { 0xae, "application: User specific 5" },
1045 { 0xaf, "application: User specific 6" },
1046 { 0xb0, "access: invalid index" },
1047 { 0xb1, "access: write length error" },
1048 { 0xb2, "access: invalid slot/subslot" },
1049 { 0xb3, "access: type conflict" },
1050 { 0xb4, "access: invalid area" },
1051 { 0xb5, "access: state conflict" },
1052 { 0xb6, "access: access denied" },
1053 { 0xb7, "access: invalid range" },
1054 { 0xb8, "access: invalid parameter" },
1055 { 0xb9, "access: invalid type" },
1056 { 0xba, "access: backup" },
1057 { 0xbb, "access: User specific 7" },
1058 { 0xbc, "access: User specific 8" },
1059 { 0xbd, "access: User specific 9" },
1060 { 0xbe, "access: User specific 10" },
1061 { 0xbf, "access: User specific 11" },
1062 { 0xc0, "resource: read constrain conflict" },
1063 { 0xc1, "resource: write constrain conflict" },
1064 { 0xc2, "resource: resource busy" },
1065 { 0xc3, "resource: resource unavailable" },
1066 { 0xc4, "resource: not specified" },
1067 { 0xc5, "resource: not specified" },
1068 { 0xc6, "resource: not specified" },
1069 { 0xc7, "resource: not specified" },
1070 { 0xc8, "resource: User specific 12" },
1071 { 0xc9, "resource: User specific 13" },
1072 { 0xca, "resource: User specific 14" },
1073 { 0xcb, "resource: User specific 15" },
1074 { 0xcc, "resource: User specific 16" },
1075 { 0xcd, "resource: User specific 17" },
1076 { 0xce, "resource: User specific 18" },
1077 { 0xcf, "resource: User specific 19" },
1078 /* high nibble d-f user specific */
1079 { 0, NULL }
1080 };
1081  
1082 static const value_string pn_io_error_code2_pniorw[] = {
1083 /* all values are user specified */
1084 { 0, NULL }
1085 };
1086  
1087 static const value_string pn_io_error_code1_pnio[] = {
1088 { 0x00 /* 0*/, "Reserved" },
1089 { 0x01 /* 1*/, "Connect: Faulty ARBlockReq" },
1090 { 0x02 /* 2*/, "Connect: Faulty IOCRBlockReq" },
1091 { 0x03 /* 3*/, "Connect: Faulty ExpectedSubmoduleBlockReq" },
1092 { 0x04 /* 4*/, "Connect: Faulty AlarmCRBlockReq" },
1093 { 0x05 /* 5*/, "Connect: Faulty PrmServerBlockReq" },
1094 { 0x06 /* 6*/, "Connect: Faulty MCRBlockReq" },
1095 { 0x07 /* 7*/, "Connect: Faulty ARRPCBlockReq" },
1096 { 0x08 /* 8*/, "Read/Write Record: Faulty Record" },
1097 { 0x09 /* 9*/, "Connect: Faulty SubFrameBlock" },
1098 { 0x0A /* 10*/, "Connect: Faulty IRTFrameBlock" },
1099  
1100 { 0x14 /* 20*/, "IODControl: Faulty ControlBlockConnect" },
1101 { 0x15 /* 21*/, "IODControl: Faulty ControlBlockPlug" },
1102 { 0x16 /* 22*/, "IOXControl: Faulty ControlBlock after a connect est." },
1103 { 0x17 /* 23*/, "IOXControl: Faulty ControlBlock a plug alarm" },
1104  
1105 { 0x28 /* 40*/, "Release: Faulty ReleaseBlock" },
1106  
1107 { 0x32 /* 50*/, "Response: Faulty ARBlockRes" },
1108 { 0x33 /* 51*/, "Response: Faulty IOCRBlockRes" },
1109 { 0x34 /* 52*/, "Response: Faulty AlarmCRBlockRes" },
1110 { 0x35 /* 53*/, "Response: Faulty ModuleDifflock" },
1111 { 0x36 /* 54*/, "Response: Faulty ARRPCBlockRes" },
1112  
1113 { 0x3c /* 60*/, "AlarmAck Error Codes" },
1114 { 0x3d /* 61*/, "CMDEV" },
1115 { 0x3e /* 62*/, "CMCTL" },
1116 { 0x3f /* 63*/, "NRPM" },
1117 { 0x40 /* 64*/, "RMPM" },
1118 { 0x41 /* 65*/, "ALPMI" },
1119 { 0x42 /* 66*/, "ALPMR" },
1120 { 0x43 /* 67*/, "LMPM" },
1121 { 0x44 /* 68*/, "MMAC" },
1122 { 0x45 /* 69*/, "RPC" },
1123 { 0x46 /* 70*/, "APMR" },
1124 { 0x47 /* 71*/, "APMS" },
1125 { 0x48 /* 72*/, "CPM" },
1126 { 0x49 /* 73*/, "PPM" },
1127 { 0x4a /* 74*/, "DCPUCS" },
1128 { 0x4b /* 75*/, "DCPUCR" },
1129 { 0x4c /* 76*/, "DCPMCS" },
1130 { 0x4d /* 77*/, "DCPMCR" },
1131 { 0x4e /* 78*/, "FSPM" },
1132 { 0xfd /*253*/, "RTA_ERR_CLS_PROTOCOL" },
1133 { 0xff /*255*/, "User specific" },
1134 { 0, NULL }
1135 };
1136  
1137 static const value_string pn_io_error_code2_pnio_1[] = {
1138 /* CheckingRules for ARBlockReq */
1139 { 0, "Error in Parameter BlockType" },
1140 { 1, "Error in Parameter BlockLength" },
1141 { 2, "Error in Parameter BlockVersionHigh" },
1142 { 3, "Error in Parameter BlockVersionLow" },
1143 { 4, "Error in Parameter ARType" },
1144 { 5, "Error in Parameter ARUUID" },
1145 { 7, "Error in Parameter CMInitiatorMACAddress" },
1146 { 8, "Error in Parameter CMInitiatorObjectUUID" },
1147 { 9, "Error in Parameter ARProperties" },
1148 { 10, "Error in Parameter CMInitiatorActivityTimeoutFactor" },
1149 { 11, "Error in Parameter InitiatorUDPRTPort" },
1150 { 12, "Error in Parameter StationNameLength" },
1151 { 13, "Error in Parameter CMInitiatorStationName" },
1152 { 0, NULL }
1153 };
1154  
1155 static const value_string pn_io_error_code2_pnio_2[] = {
1156 /* CheckingRules for IOCRBlockReq */
1157 { 0, "Error in Parameter BlockType" },
1158 { 1, "Error in Parameter BlockLength" },
1159 { 2, "Error in Parameter BlockVersionHigh" },
1160 { 3, "Error in Parameter BlockVersionLow" },
1161 { 4, "Error in Parameter IOCRType" },
1162 { 5, "Error in Parameter IOCRReference" },
1163 { 6, "Error in Parameter LT" },
1164 { 7, "Error in Parameter IOCRProperties" },
1165 { 8, "Error in Parameter DataLength" },
1166 { 9, "Error in Parameter FrameID" },
1167 { 10, "Error in Parameter SendClockFactor" },
1168 { 11, "Error in Parameter ReductionRatio" },
1169 { 12, "Error in Parameter Phase" },
1170 { 14, "Error in Parameter FrameSendOffset" },
1171 { 15, "Error in Parameter WatchdogFactor" },
1172 { 16, "Error in Parameter DataHoldFactor" },
1173 { 17, "Error in Parameter IOCRTagHeader" },
1174 { 18, "Error in Parameter IOCRMulticastMacAddress" },
1175 { 19, "Error in Parameter NumberOfAPI" },
1176 { 20, "Error in Parameter API" },
1177 { 21, "Error in Parameter NumberOfIODataObjects" },
1178 { 22, "Error in Parameter SlotNumber" },
1179 { 23, "Error in Parameter SubslotNumber" },
1180 { 24, "Error in Parameter IODataObjectFrameOffset" },
1181 { 25, "Error in Parameter NumberOfIOCS" },
1182 { 26, "Error in Parameter SlotNumber" },
1183 { 27, "Error in Parameter SubslotNumber" },
1184 { 28, "Error in Parameter IOCSFrameOffset" },
1185 { 0, NULL }
1186 };
1187  
1188 static const value_string pn_io_error_code2_pnio_3[] = {
1189 /* CheckingRules for ExpectedSubmoduleBlockReq */
1190 { 0, "Error in Parameter BlockType" },
1191 { 1, "Error in Parameter BlockLength" },
1192 { 2, "Error in Parameter BlockVersionHigh" },
1193 { 3, "Error in Parameter BlockVersionLow" },
1194 { 4, "Error in Parameter NumberOfAPI" },
1195 { 5, "Error in Parameter API" },
1196 { 6, "Error in Parameter SlotNumber" },
1197 { 7, "Error in Parameter ModuleIdentNumber" },
1198 { 8, "Error in Parameter ModuleProperties" },
1199 { 9, "Error in Parameter NumberOfSubmodules" },
1200 { 10, "Error in Parameter SubslotNumber" },
1201 { 12, "Error in Parameter SubmoduleProperties" },
1202 { 13, "Error in Parameter DataDescription" },
1203 { 14, "Error in Parameter SubmoduleDataLength" },
1204 { 15, "Error in Parameter LengthIOPS" },
1205 { 16, "Error in Parameter LengthIOCS" },
1206 { 0, NULL }
1207 };
1208  
1209  
1210 static const value_string pn_io_error_code2_pnio_4[] = {
1211 /* CheckingRules for AlarmCRBlockReq */
1212 { 0, "Error in Parameter BlockType" },
1213 { 1, "Error in Parameter BlockLength" },
1214 { 2, "Error in Parameter BlockVersionHigh" },
1215 { 3, "Error in Parameter BlockVersionLow" },
1216 { 4, "Error in Parameter AlarmCRType" },
1217 { 5, "Error in Parameter LT" },
1218 { 6, "Error in Parameter AlarmCRProperties" },
1219 { 7, "Error in Parameter RTATimeoutFactor" },
1220 { 8, "Error in Parameter RTARetries" },
1221 { 10, "Error in Parameter MaxAlarmDataLength" },
1222 { 11, "Error in Parameter AlarmCRTagHeaderHigh" },
1223 { 12, "Error in Parameter AlarmCRTagHeaderLow" },
1224 { 0, NULL }
1225 };
1226  
1227 static const value_string pn_io_error_code2_pnio_5[] = {
1228 /* CheckingRules for PrmServerBlockReq */
1229 { 0, "Error in Parameter BlockType" },
1230 { 1, "Error in Parameter BlockLength" },
1231 { 2, "Error in Parameter BlockVersionHigh" },
1232 { 3, "Error in Parameter BlockVersionLow" },
1233 { 6, "Error in Parameter CMInitiatorActivityTimeoutFactor" },
1234 { 7, "Error in Parameter StationNameLength" },
1235 { 8, "Error in Parameter ParameterServerStationName" },
1236 { 0, NULL }
1237 };
1238  
1239 static const value_string pn_io_error_code2_pnio_6[] = {
1240 /* CheckingRules for MCRBlockReq */
1241 { 0, "Error in Parameter BlockType" },
1242 { 1, "Error in Parameter BlockLength" },
1243 { 2, "Error in Parameter BlockVersionHigh" },
1244 { 3, "Error in Parameter BlockVersionLow" },
1245 { 4, "Error in Parameter IOCRReference" },
1246 { 5, "Error in Parameter AddressResolutionProperties" },
1247 { 6, "Error in Parameter MCITimeoutFactor" },
1248 { 7, "Error in Parameter StationNameLength" },
1249 { 8, "Error in Parameter ProviderStationName" },
1250 { 0, NULL }
1251 };
1252  
1253 static const value_string pn_io_error_code2_pnio_7[] = {
1254 /* CheckingRules for MCRBlockReq */
1255 { 0, "Error in Parameter BlockType" },
1256 { 1, "Error in Parameter BlockLength" },
1257 { 2, "Error in Parameter BlockVersionHigh" },
1258 { 3, "Error in Parameter BlockVersionLow" },
1259 { 4, "Error in Parameter InitiatorRPCServerPort" },
1260 { 0, NULL }
1261 };
1262  
1263 static const value_string pn_io_error_code2_pnio_8[] = {
1264 /* CheckingRules for Read/Write ParameterReqHeader */
1265 { 0, "Error in Parameter BlockType" },
1266 { 1, "Error in Parameter BlockLength" },
1267 { 2, "Error in Parameter BlockVersionHigh" },
1268 { 3, "Error in Parameter BlockVersionLow" },
1269 { 5, "Error in Parameter ARUUID" },
1270 { 6, "Error in Parameter API" },
1271 { 7, "Error in Parameter SlotNumber" },
1272 { 8, "Error in Parameter SubslotNumber" },
1273 { 9, "Error in Parameter Padding" },
1274 { 10, "Error in Parameter Index" },
1275 { 11, "Error in Parameter RecordDataLength" },
1276 { 12, "Error in Parameter TargetARUUID" },
1277 { 0, NULL }
1278 };
1279  
1280 static const value_string pn_io_error_code2_pnio_20[] = {
1281 /* CheckingRules for ControlBlockConnect */
1282 { 0, "Error in Parameter BlockType" },
1283 { 1, "Error in Parameter BlockLength" },
1284 { 2, "Error in Parameter BlockVersionHigh" },
1285 { 3, "Error in Parameter BlockVersionLow" },
1286 { 4, "Error in Parameter Padding" },
1287 { 6, "Error in Parameter SessionKey" },
1288 { 7, "Error in Parameter Padding" },
1289 { 8, "Error in Parameter ControlCommand" },
1290 { 9, "Error in Parameter ControlBlockProperties" },
1291 { 0, NULL }
1292 };
1293  
1294 static const value_string pn_io_error_code2_pnio_21[] = {
1295 /* CheckingRules for ControlBlockPlug */
1296 { 0, "Error in Parameter BlockType" },
1297 { 1, "Error in Parameter BlockLength" },
1298 { 2, "Error in Parameter BlockVersionHigh" },
1299 { 3, "Error in Parameter BlockVersionLow" },
1300 { 4, "Error in Parameter Padding" },
1301 { 6, "Error in Parameter SessionKey" },
1302 { 7, "Error in Parameter AlarmSequenceNumber" },
1303 { 8, "Error in Parameter ControlCommand" },
1304 { 9, "Error in Parameter ControlBlockProperties" },
1305 { 0, NULL }
1306 };
1307  
1308 static const value_string pn_io_error_code2_pnio_22[] = {
1309 /* CheckingRule for ControlBlockConnect */
1310 { 0, "Error in Parameter BlockType" },
1311 { 1, "Error in Parameter BlockLength" },
1312 { 2, "Error in Parameter BlockVersionHigh" },
1313 { 3, "Error in Parameter BlockVersionLow" },
1314 { 4, "Error in Parameter Padding" },
1315 { 6, "Error in Parameter SessionKey" },
1316 { 7, "Error in Parameter Padding" },
1317 { 8, "Error in Parameter ControlCommand" },
1318 { 9, "Error in Parameter ControlBlockProperties" },
1319 { 0, NULL }
1320 };
1321  
1322 static const value_string pn_io_error_code2_pnio_23[] = {
1323 /* CheckingRules for ControlBlockPlug */
1324 { 0, "Error in Parameter BlockType" },
1325 { 1, "Error in Parameter BlockLength" },
1326 { 2, "Error in Parameter BlockVersionHigh" },
1327 { 3, "Error in Parameter BlockVersionLow" },
1328 { 4, "Error in Parameter Padding" },
1329 { 6, "Error in Parameter SessionKey" },
1330 { 7, "Error in Parameter AlarmSequenceNumber" },
1331 { 8, "Error in Parameter ControlCommand" },
1332 { 9, "Error in Parameter ControlBlockProperties" },
1333 { 0, NULL }
1334 };
1335  
1336 static const value_string pn_io_error_code2_pnio_40[] = {
1337 /* CheckingRules for ReleaseBlock */
1338 { 0, "Error in Parameter BlockType" },
1339 { 1, "Error in Parameter BlockLength" },
1340 { 2, "Error in Parameter BlockVersionHigh" },
1341 { 3, "Error in Parameter BlockVersionLow" },
1342 { 4, "Error in Parameter Padding" },
1343 { 6, "Error in Parameter SessionKey" },
1344 { 7, "Error in Parameter Padding" },
1345 { 8, "Error in Parameter ControlCommand" },
1346 { 9, "Error in Parameter ControlBlockProperties" },
1347 { 0, NULL }
1348 };
1349  
1350 static const value_string pn_io_error_code2_pnio_61[] = {
1351 /* CMDEV */
1352 { 0, "State Conflict" },
1353 { 1, "Resources" },
1354 { 0, NULL }
1355 };
1356  
1357 static const value_string pn_io_error_code2_pnio_62[] = {
1358 /* CMCTL */
1359 { 0, "State Conflict" },
1360 { 1, "Timeout" },
1361 { 2, "No data send" },
1362 { 0, NULL }
1363 };
1364  
1365 static const value_string pn_io_error_code2_pnio_63[] = {
1366 /* NRPM */
1367 { 0, "No DCP active" },
1368 { 1, "DNS Unknown_RealStationName" },
1369 { 2, "DCP No_RealStationName" },
1370 { 3, "DCP Multiple_RealStationName" },
1371 { 4, "DCP No_StationName" },
1372 { 5, "No_IP_Addr" },
1373 { 6, "DCP_Set_Error" },
1374 { 0, NULL }
1375 };
1376  
1377 static const value_string pn_io_error_code2_pnio_64[] = {
1378 /* RMPM */
1379 { 0, "ArgsLength invalid" },
1380 { 1, "Unknown Blocks" },
1381 { 2, "IOCR Missing" },
1382 { 3, "Wrong AlarmCRBlock count" },
1383 { 4, "Out of AR Resources" },
1384 { 5, "AR UUID unknown" },
1385 { 6, "State conflict" },
1386 { 7, "Out of Provider, Consumer or Alarm Resources" },
1387 { 8, "Out of Memory" },
1388 { 0, NULL }
1389 };
1390  
1391 static const value_string pn_io_error_code2_pnio_65[] = {
1392 /* ALPMI */
1393 { 0, "Invalid State" },
1394 { 1, "Wrong ACK-PDU" },
1395 { 0, NULL }
1396 };
1397  
1398 static const value_string pn_io_error_code2_pnio_66[] = {
1399 /* ALPMR */
1400 { 0, "Invalid State" },
1401 { 1, "Wrong Notification PDU" },
1402 { 0, NULL }
1403 };
1404  
1405 static const value_string pn_io_error_code2_pnio_70[] = {
1406 /* APMR */
1407 { 0, "Invalid State" },
1408 { 1, "LMPM signaled error" },
1409 { 0, NULL }
1410 };
1411  
1412 static const value_string pn_io_error_code2_pnio_71[] = {
1413 /* APMS */
1414 { 0, "Invalid State" },
1415 { 1, "LMPM signaled error" },
1416 { 2, "Timeout" },
1417 { 0, NULL }
1418 };
1419  
1420 static const value_string pn_io_error_code2_pnio_72[] = {
1421 /* CPM */
1422 { 1, "Invalid State" },
1423 { 0, NULL }
1424 };
1425  
1426 static const value_string pn_io_error_code2_pnio_73[] = {
1427 /* PPM */
1428 { 1, "Invalid State" },
1429 { 0, NULL }
1430 };
1431  
1432 static const value_string pn_io_error_code2_pnio_74[] = {
1433 /* DCPUCS */
1434 { 0, "Invalid State" },
1435 { 1, "LMPM signaled an error" },
1436 { 2, "Timeout" },
1437 { 0, NULL }
1438 };
1439  
1440 static const value_string pn_io_error_code2_pnio_75[] = {
1441 /* DCPUCR */
1442 { 0, "Invalid State" },
1443 { 1, "LMPM signaled an error" },
1444 { 0, NULL }
1445 };
1446  
1447 static const value_string pn_io_error_code2_pnio_76[] = {
1448 /* DCPMCS */
1449 { 0, "Invalid State" },
1450 { 1, "LMPM signaled an error" },
1451 { 0, NULL }
1452 };
1453  
1454 static const value_string pn_io_error_code2_pnio_77[] = {
1455 /* DCPMCR */
1456 { 0, "Invalid State" },
1457 { 1, "LMPM signaled an error" },
1458 { 0, NULL }
1459 };
1460  
1461 static const value_string pn_io_error_code2_pnio_253[] = {
1462 { 0, "reserved" },
1463 { 1, "Error within the coordination of sequence numbers (RTA_ERR_CODE_SEQ) error" },
1464 { 2, "Instance closed (RTA_ERR_ABORT)" },
1465 { 3, "AR out of memory (RTA_ERR_ABORT)" },
1466 { 4, "AR add provider or consumer failed (RTA_ERR_ABORT)" },
1467 { 5, "AR consumer DHT/WDT expired (RTA_ERR_ABORT)" },
1468 { 6, "AR cmi timeout (RTA_ERR_ABORT)" },
1469 { 7, "AR alarm-open failed (RTA_ERR_ABORT)" },
1470 { 8, "AR alarm-send.cnf(-) (RTA_ERR_ABORT)" },
1471 { 9, "AR alarm-ack-send.cnf(-) (RTA_ERR_ABORT)" },
1472 { 10, "AR alarm data too long (RTA_ERR_ABORT)" },
1473 { 11, "AR alarm.ind(err) (RTA_ERR_ABORT)" },
1474 { 12, "AR rpc-client call.cnf(-) (RTA_ERR_ABORT)" },
1475 { 13, "AR abort.req (RTA_ERR_ABORT)" },
1476 { 14, "AR re-run aborts existing (RTA_ERR_ABORT)" },
1477 { 15, "AR release.ind received (RTA_ERR_ABORT)" },
1478 { 16, "AR device deactivated (RTA_ERR_ABORT)" },
1479 { 17, "AR removed (RTA_ERR_ABORT)" },
1480 { 18, "AR protocol violation (RTA_ERR_ABORT)" },
1481 { 19, "AR name resolution error (RTA_ERR_ABORT)" },
1482 { 20, "AR RPC-Bind error (RTA_ERR_ABORT)" },
1483 { 21, "AR RPC-Connect error (RTA_ERR_ABORT)" },
1484 { 22, "AR RPC-Read error (RTA_ERR_ABORT)" },
1485 { 23, "AR RPC-Write error (RTA_ERR_ABORT)" },
1486 { 24, "AR RPC-Control error (RTA_ERR_ABORT)" },
1487 { 25, "AR forbidden pull or plug after check.rsp and before in-data.ind (RTA_ERR_ABORT)" },
1488 { 26, "AR AP removed (RTA_ERR_ABORT)" },
1489 { 27, "AR link down (RTA_ERR_ABORT)" },
1490 { 28, "AR could not register multicast-mac address (RTA_ERR_ABORT)" },
1491 { 29, "not synchronized (cannot start companion-ar) (RTA_ERR_ABORT)" },
1492 { 30, "wrong topology (cannot start companion-ar) (RTA_ERR_ABORT)" },
1493 { 31, "dcp, station-name changed (RTA_ERR_ABORT)" },
1494 { 32, "dcp, reset to factory-settings (RTA_ERR_ABORT)" },
1495 { 33, "cannot start companion-AR because a 0x8ipp submodule in the first AR... (RTA_ERR_ABORT)" },
1496 { 34, "no irdata record yet (RTA_ERR_ABORT)" },
1497 { 35, "PDEV (RTA_ERROR_ABORT)" },
1498 { 36, "PDEV, no port offers required speed/duplexity (RTA_ERROR_ABORT)" },
1499 { 37, "IP-Suite [of the IOC] changed by means of DCP_Set(IPParameter) or local engineering (RTA_ERROR_ABORT)" },
1500 { 0, NULL }
1501 };
1502  
1503 static const value_string pn_io_error_code2_pnio_255[] = {
1504 /* User specific */
1505 { 255, "User abort" },
1506 { 0, NULL }
1507 };
1508  
1509 static const value_string pn_io_ioxs[] = {
1510 { 0x00 /* 0*/, "detected by subslot" },
1511 { 0x01 /* 1*/, "detected by slot" },
1512 { 0x02 /* 2*/, "detected by IO device" },
1513 { 0x03 /* 3*/, "detected by IO controller" },
1514 { 0, NULL }
1515 };
1516  
1517  
1518 static const value_string pn_io_ar_type[] = {
1519 { 0x0000, "reserved" },
1520 { 0x0001, "IO Controller AR"},
1521 { 0x0002, "reserved" },
1522 { 0x0003, "IOCARCIR" },
1523 { 0x0004, "reserved" },
1524 { 0x0005, "reserved" },
1525 { 0x0006, "IO Supervisor AR / DeviceAccess AR" },
1526 /*0x0007 - 0x000F reserved */
1527 { 0x0010, "IO Controller AR (RT_CLASS_3)" },
1528 /*0x0011 - 0x001F reserved */
1529 { 0x0020, "IO Controller AR (sysred/CiR)" },
1530 /*0x0007 - 0xFFFF reserved */
1531 { 0, NULL }
1532 };
1533  
1534 static const value_string pn_io_iocr_type[] = {
1535 { 0x0000, "reserved" },
1536 { 0x0001, "Input CR" },
1537 { 0x0002, "Output CR" },
1538 { 0x0003, "Multicast Provider CR" },
1539 { 0x0004, "Multicast Consumer CR" },
1540 /*0x0005 - 0xFFFF reserved */
1541 { 0, NULL }
1542 };
1543  
1544  
1545 static const value_string pn_io_data_description[] = {
1546 { 0x0000, "reserved" },
1547 { 0x0001, "Input" },
1548 { 0x0002, "Output" },
1549 { 0x0003, "reserved" },
1550 /*0x0004 - 0xFFFF reserved */
1551 { 0, NULL }
1552 };
1553  
1554  
1555 static const value_string pn_io_module_state[] = {
1556 { 0x0000, "no module" },
1557 { 0x0001, "wrong module" },
1558 { 0x0002, "proper module" },
1559 { 0x0003, "substitute" },
1560 /*0x0004 - 0xFFFF reserved */
1561 { 0, NULL }
1562 };
1563  
1564 static const value_string pn_io_arproperties_state[] = {
1565 { 0x00000000, "Reserved" },
1566 { 0x00000001, "Active" },
1567 { 0x00000002, "reserved" },
1568 { 0x00000003, "reserved" },
1569 { 0x00000004, "reserved" },
1570 { 0x00000005, "reserved" },
1571 { 0x00000006, "reserved" },
1572 { 0x00000007, "reserved" },
1573 { 0, NULL }
1574 };
1575  
1576 static const value_string pn_io_arproperties_supervisor_takeover_allowed[] = {
1577 { 0x00000000, "not allowed" },
1578 { 0x00000001, "allowed" },
1579 { 0, NULL }
1580 };
1581  
1582 static const value_string pn_io_arproperties_parametrization_server[] = {
1583 { 0x00000000, "External PrmServer" },
1584 { 0x00000001, "CM Initiator" },
1585 { 0, NULL }
1586 };
1587 /* BIT 8 */
1588 static const value_string pn_io_arproperties_DeviceAccess[] = {
1589 { 0x00000000, "Only the submodules from the ExpectedSubmoduleBlock are accessible" },
1590 { 0x00000001, "Submodule access is controlled by IO device application" },
1591 { 0, NULL }
1592 };
1593  
1594 /* Bit 9 - 10 */
1595 static const value_string pn_io_arproperties_companion_ar[] = {
1596 { 0x00000000, "Single AR" },
1597 { 0x00000001, "First AR of a companion pair and a companion AR shall follow" },
1598 { 0x00000002, "Companion AR" },
1599 { 0x00000003, "Reserved" },
1600 { 0, NULL }
1601 };
1602 /* REMOVED with 2.3
1603 static const value_string pn_io_arproperties_data_rate[] = {
1604 { 0x00000000, "at least 100 MB/s or more" },
1605 { 0x00000001, "100 MB/s" },
1606 { 0x00000002, "1 GB/s" },
1607 { 0x00000003, "10 GB/s" },
1608 { 0, NULL }
1609 };
1610 */
1611  
1612 /* BIT 11 */
1613 static const value_string pn_io_arproperties_acknowldege_companion_ar[] = {
1614 { 0x00000000, "No companion AR or no acknowledge for the companion AR required" },
1615 { 0x00000001, "Companion AR with acknowledge" },
1616 { 0, NULL }
1617 };
1618  
1619 /* bit 29 for legacy startup mode*/
1620 static const value_string pn_io_arproperties_combined_object_container_with_legacy_startupmode[] = {
1621 { 0x00000000, "CombinedObjectContainer not used" },
1622 { 0x00000001, "Reserved" },
1623 { 0, NULL }
1624 };
1625  
1626 /* bit 29 for advanced statup mode*/
1627 static const value_string pn_io_arproperties_combined_object_container_with_advanced_startupmode[] = {
1628 { 0x00000000, "CombinedObjectContainer not used" },
1629 { 0x00000001, "Usage of CombinedObjectContainer required" },
1630 { 0, NULL }
1631 };
1632  
1633 /* bit 30 */
1634 static const value_string pn_io_arpropertiesStartupMode[] = {
1635 { 0x00000000, "Legacy" },
1636 { 0x00000001, "Advanced" },
1637 { 0, NULL }
1638 };
1639  
1640 /* bit 31 */
1641 static const value_string pn_io_arproperties_pull_module_alarm_allowed[] = {
1642 { 0x00000000, "AlarmType(=Pull) shall signal pulling of submodule and module" },
1643 { 0x00000001, "AlarmType(=Pull) shall signal pulling of submodule" },
1644 { 0, NULL }
1645 };
1646  
1647 static const value_string pn_io_RedundancyInfo[] = {
1648 { 0x00000000, "Reserved" },
1649 { 0x00000001, "The delivering node is the left or below one" },
1650 { 0x00000002, "The delivering node is the right or above one" },
1651 { 0x00000003, "Reserved" },
1652 { 0, NULL }
1653 };
1654  
1655 static const value_string pn_io_iocr_properties_rtclass[] = {
1656 { 0x00000000, "reserved" },
1657 { 0x00000001, "RT_CLASS_1" },
1658 { 0x00000002, "RT_CLASS_2" },
1659 { 0x00000003, "RT_CLASS_3" },
1660 { 0x00000004, "RT_CLASS_UDP" },
1661 /*0x00000005 - 0x00000007 reserved */
1662 { 0, NULL }
1663 };
1664  
1665 static const value_string pn_io_MultipleInterfaceMode_NameOfDevice[] = {
1666 { 0x00000000, "PortID of LLDP contains name of port (Default)" },
1667 { 0x00000001, "PortID of LLDP contains name of port and NameOfStation" },
1668 { 0, NULL }
1669 };
1670  
1671 static const value_string pn_io_sr_properties_BackupAR[] = {
1672 { 0x00000000, "The device may deliver valid input data" },
1673 { 0x00000001, "The device shall deliver valid input data" },
1674 { 0, NULL }
1675 };
1676  
1677 static const value_string pn_io_sr_properties_ActivateRedundancyAlarm[] = {
1678 { 0x00000000, "The device shall not send Redundancy alarm" },
1679 { 0x00000001, "The device shall send Redundancy alarm" },
1680 { 0, NULL }
1681 };
1682  
1683 static const value_string pn_io_iocr_properties_media_redundancy[] = {
1684 { 0x00000000, "No media redundant frame transfer" },
1685 { 0x00000001, "Media redundant frame transfer" },
1686 { 0, NULL }
1687 };
1688  
1689  
1690 static const value_string pn_io_submodule_properties_type[] = {
1691 { 0x0000, "no input and no output data" },
1692 { 0x0001, "input data" },
1693 { 0x0002, "output data" },
1694 { 0x0003, "input and output data" },
1695 { 0, NULL }
1696 };
1697  
1698 static const value_string pn_io_submodule_properties_shared_input[] = {
1699 { 0x0000, "IO controller" },
1700 { 0x0001, "IO controller shared" },
1701 { 0, NULL }
1702 };
1703  
1704 static const value_string pn_io_submodule_properties_reduce_input_submodule_data_length[] = {
1705 { 0x0000, "Expected" },
1706 { 0x0001, "Zero" },
1707 { 0, NULL }
1708 };
1709  
1710 static const value_string pn_io_submodule_properties_reduce_output_submodule_data_length[] = {
1711 { 0x0000, "Expected" },
1712 { 0x0001, "Zero" },
1713 { 0, NULL }
1714 };
1715  
1716 static const value_string pn_io_submodule_properties_discard_ioxs[] = {
1717 { 0x0000, "Expected" },
1718 { 0x0001, "Zero" },
1719 { 0, NULL }
1720 };
1721  
1722 static const value_string pn_io_alarmcr_properties_priority[] = {
1723 { 0x0000, "user priority (default)" },
1724 { 0x0001, "use only low priority" },
1725 { 0, NULL }
1726 };
1727  
1728 static const value_string pn_io_alarmcr_properties_transport[] = {
1729 { 0x0000, "RTA_CLASS_1" },
1730 { 0x0001, "RTA_CLASS_UDP" },
1731 { 0, NULL }
1732 };
1733  
1734  
1735 static const value_string pn_io_submodule_state_format_indicator[] = {
1736 { 0x0000, "Coding uses Detail" },
1737 { 0x0001, "Coding uses .IdentInfo, ..." },
1738 { 0, NULL }
1739 };
1740  
1741 static const value_string pn_io_submodule_state_add_info[] = {
1742 { 0x0000, "None" },
1743 { 0x0001, "Takeover not allowed" },
1744 /*0x0002 - 0x0007 reserved */
1745 { 0, NULL }
1746 };
1747  
1748 static const value_string pn_io_submodule_state_qualified_info[] = {
1749 { 0x0000, "No QualifiedInfo available" },
1750 { 0x0001, "QualifiedInfo available" },
1751 { 0, NULL }
1752 };
1753  
1754 static const value_string pn_io_submodule_state_maintenance_required[] = {
1755 { 0x0000, "No MaintenanceRequired available" },
1756 { 0x0001, "MaintenanceRequired available" },
1757 { 0, NULL }
1758 };
1759  
1760 static const value_string pn_io_submodule_state_maintenance_demanded[] = {
1761 { 0x0000, "No MaintenanceDemanded available" },
1762 { 0x0001, "MaintenanceDemanded available" },
1763 { 0, NULL }
1764 };
1765  
1766 static const value_string pn_io_submodule_state_diag_info[] = {
1767 { 0x0000, "No DiagnosisData available" },
1768 { 0x0001, "DiagnosisData available" },
1769 { 0, NULL }
1770 };
1771  
1772 static const value_string pn_io_submodule_state_ar_info[] = {
1773 { 0x0000, "Own" },
1774 { 0x0001, "ApplicationReadyPending (ARP)" },
1775 { 0x0002, "Superordinated Locked (SO)" },
1776 { 0x0003, "Locked By IO Controller (IOC)" },
1777 { 0x0004, "Locked By IO Supervisor (IOS)" },
1778 /*0x0005 - 0x000F reserved */
1779 { 0, NULL }
1780 };
1781  
1782 static const value_string pn_io_submodule_state_ident_info[] = {
1783 { 0x0000, "OK" },
1784 { 0x0001, "Substitute (SU)" },
1785 { 0x0002, "Wrong (WR)" },
1786 { 0x0003, "NoSubmodule (NO)" },
1787 /*0x0004 - 0x000F reserved */
1788 { 0, NULL }
1789 };
1790  
1791 static const value_string pn_io_submodule_state_detail[] = {
1792 { 0x0000, "no submodule" },
1793 { 0x0001, "wrong submodule" },
1794 { 0x0002, "locked by IO controller" },
1795 { 0x0003, "reserved" },
1796 { 0x0004, "application ready pending" },
1797 { 0x0005, "reserved" },
1798 { 0x0006, "reserved" },
1799 { 0x0007, "Substitute" },
1800 /*0x0008 - 0x7FFF reserved */
1801 { 0, NULL }
1802 };
1803  
1804 static const value_string pn_io_substitutionmode[] = {
1805 { 0x0000, "ZERO" },
1806 { 0x0001, "Last value" },
1807 { 0x0002, "Replacement value" },
1808 /*0x0003 - 0xFFFF reserved */
1809 { 0, NULL }
1810 };
1811  
1812 static const value_string pn_io_index[] = {
1813 /*0x0008 - 0x7FFF user specific */
1814  
1815 /* PROFISafe */
1816 { 0x0100, "PROFISafe" },
1817  
1818 /* subslot specific */
1819 { 0x8000, "ExpectedIdentificationData for one subslot" },
1820 { 0x8001, "RealIdentificationData for one subslot" },
1821 /*0x8002 - 0x8009 reserved */
1822 { 0x800A, "Diagnosis in channel coding for one subslot" },
1823 { 0x800B, "Diagnosis in all codings for one subslot" },
1824 { 0x800C, "Diagnosis, Maintenance, Qualified and Status for one subslot" },
1825 /*0x800D - 0x800F reserved */
1826 { 0x8010, "Maintenance required in channel coding for one subslot" },
1827 { 0x8011, "Maintenance demanded in channel coding for one subslot" },
1828 { 0x8012, "Maintenance required in all codings for one subslot" },
1829 { 0x8013, "Maintenance demanded in all codings for one subslot" },
1830 /*0x8014 - 0x801D reserved */
1831 { 0x801E, "SubstituteValues for one subslot" },
1832 /*0x801F - 0x8027 reserved */
1833 { 0x8028, "RecordInputDataObjectElement for one subslot" },
1834 { 0x8029, "RecordOutputDataObjectElement for one subslot" },
1835 { 0x802A, "PDPortDataReal for one subslot" },
1836 { 0x802B, "PDPortDataCheck for one subslot" },
1837 { 0x802C, "PDIRData for one subslot" },
1838 { 0x802D, "Expected PDSyncData for one subslot with SyncID value 0" },
1839 /*0x802E reserved */
1840 { 0x802F, "PDPortDataAdjust for one subslot" },
1841 { 0x8030, "IsochronousModeData for one subslot" },
1842 { 0x8031, "Expected PDSyncData for one subslot with SyncID value 1" },
1843 { 0x8032, "Expected PDSyncData for one subslot with SyncID value 2" },
1844 { 0x8033, "Expected PDSyncData for one subslot with SyncID value 3" },
1845 { 0x8034, "Expected PDSyncData for one subslot with SyncID value 4" },
1846 { 0x8035, "Expected PDSyncData for one subslot with SyncID value 5" },
1847 { 0x8036, "Expected PDSyncData for one subslot with SyncID value 6" },
1848 { 0x8037, "Expected PDSyncData for one subslot with SyncID value 7" },
1849 { 0x8038, "Expected PDSyncData for one subslot with SyncID value 8" },
1850 { 0x8039, "Expected PDSyncData for one subslot with SyncID value 9" },
1851 { 0x803A, "Expected PDSyncData for one subslot with SyncID value 10" },
1852 { 0x803B, "Expected PDSyncData for one subslot with SyncID value 11" },
1853 { 0x803C, "Expected PDSyncData for one subslot with SyncID value 12" },
1854 { 0x803D, "Expected PDSyncData for one subslot with SyncID value 13" },
1855 { 0x803E, "Expected PDSyncData for one subslot with SyncID value 14" },
1856 { 0x803F, "Expected PDSyncData for one subslot with SyncID value 15" },
1857 { 0x8040, "Expected PDSyncData for one subslot with SyncID value 16" },
1858 { 0x8041, "Expected PDSyncData for one subslot with SyncID value 17" },
1859 { 0x8042, "Expected PDSyncData for one subslot with SyncID value 18" },
1860 { 0x8043, "Expected PDSyncData for one subslot with SyncID value 19" },
1861 { 0x8044, "Expected PDSyncData for one subslot with SyncID value 20" },
1862 { 0x8045, "Expected PDSyncData for one subslot with SyncID value 21" },
1863 { 0x8046, "Expected PDSyncData for one subslot with SyncID value 22" },
1864 { 0x8047, "Expected PDSyncData for one subslot with SyncID value 23" },
1865 { 0x8048, "Expected PDSyncData for one subslot with SyncID value 24" },
1866 { 0x8049, "Expected PDSyncData for one subslot with SyncID value 25" },
1867 { 0x804A, "Expected PDSyncData for one subslot with SyncID value 26" },
1868 { 0x804B, "Expected PDSyncData for one subslot with SyncID value 27" },
1869 { 0x804C, "Expected PDSyncData for one subslot with SyncID value 28" },
1870 { 0x804D, "Expected PDSyncData for one subslot with SyncID value 29" },
1871 { 0x804E, "Expected PDSyncData for one subslot with SyncID value 30" },
1872 { 0x804F, "Expected PDSyncData for one subslot with SyncID value 31" },
1873 { 0x8050, "PDInterfaceMrpDataReal for one subslot" },
1874 { 0x8051, "PDInterfaceMrpDataCheck for one subslot" },
1875 { 0x8052, "PDInterfaceMrpDataAdjust for one subslot" },
1876 { 0x8053, "PDPortMrpDataAdjust for one subslot" },
1877 { 0x8054, "PDPortMrpDataReal for one subslot" },
1878 /*0x8055 - 0x805F reserved */
1879 { 0x8060, "PDPortFODataReal for one subslot" },
1880 { 0x8061, "PDPortFODataCheck for one subslot" },
1881 { 0x8062, "PDPortFODataAdjust for one subslot" },
1882 /*0x8063 - 0x806F reserved */
1883 { 0x8070, "PDNCDataCheck for one subslot" },
1884 { 0x8071, "PDInterfaceAdjust for one subslot" },
1885 { 0x8072, "PDPortStatistic for one subslot" },
1886 /*0x8071 - 0x807F reserved */
1887 { 0x8080, "PDInterfaceDataReal" },
1888 /*0x8081 - 0x808F reserved */
1889 { 0x8090, "Expected PDInterfaceFSUDataAdjust" },
1890 /*0x8091 - 0xAFEF reserved except 0x80B0*/
1891 { 0x80B0, "CombinedObjectContainer" },
1892 { 0xAFF0, "I&M0" },
1893 { 0xAFF1, "I&M1" },
1894 { 0xAFF2, "I&M2" },
1895 { 0xAFF3, "I&M3" },
1896 { 0xAFF4, "I&M4" },
1897 { 0xAFF5, "I&M5" },
1898 { 0xAFF6, "I&M6" },
1899 { 0xAFF7, "I&M7" },
1900 { 0xAFF8, "I&M8" },
1901 { 0xAFF9, "I&M9" },
1902 { 0xAFFA, "I&M10" },
1903 { 0xAFFB, "I&M11" },
1904 { 0xAFFC, "I&M12" },
1905 { 0xAFFD, "I&M13" },
1906 { 0xAFFE, "I&M14" },
1907 { 0xAFFF, "I&M15" },
1908 /*0xB000 - 0xB02D reserved for profiles */
1909 { 0xB000, "Sync-Log / RTA SyncID 0 (GSY)" },
1910 { 0xB001, "Sync-Log / RTA SyncID 1 (GSY)" },
1911 { 0xB002, "reserved for profiles" },
1912 { 0xB003, "reserved for profiles" },
1913 { 0xB004, "reserved for profiles" },
1914 { 0xB005, "reserved for profiles" },
1915 { 0xB006, "reserved for profiles" },
1916 { 0xB007, "reserved for profiles" },
1917 { 0xB008, "reserved for profiles" },
1918 { 0xB009, "reserved for profiles" },
1919 { 0xB00A, "reserved for profiles" },
1920 { 0xB00B, "reserved for profiles" },
1921 { 0xB00C, "reserved for profiles" },
1922 { 0xB00D, "reserved for profiles" },
1923 { 0xB00E, "reserved for profiles" },
1924 { 0xB00F, "reserved for profiles" },
1925 { 0xB010, "reserved for profiles" },
1926 { 0xB011, "reserved for profiles" },
1927 { 0xB012, "reserved for profiles" },
1928 { 0xB013, "reserved for profiles" },
1929 { 0xB014, "reserved for profiles" },
1930 { 0xB015, "reserved for profiles" },
1931 { 0xB016, "reserved for profiles" },
1932 { 0xB017, "reserved for profiles" },
1933 { 0xB018, "reserved for profiles" },
1934 { 0xB019, "reserved for profiles" },
1935 { 0xB01A, "reserved for profiles" },
1936 { 0xB01B, "reserved for profiles" },
1937 { 0xB01C, "reserved for profiles" },
1938 { 0xB01D, "reserved for profiles" },
1939 { 0xB01E, "reserved for profiles" },
1940 { 0xB01F, "reserved for profiles" },
1941 { 0xB020, "reserved for profiles" },
1942 { 0xB001, "reserved for profiles" },
1943 { 0xB022, "reserved for profiles" },
1944 { 0xB023, "reserved for profiles" },
1945 { 0xB024, "reserved for profiles" },
1946 { 0xB025, "reserved for profiles" },
1947 { 0xB026, "reserved for profiles" },
1948 { 0xB027, "reserved for profiles" },
1949 { 0xB028, "reserved for profiles" },
1950 { 0xB029, "reserved for profiles" },
1951 { 0xB02A, "reserved for profiles" },
1952 { 0xB02B, "reserved for profiles" },
1953 { 0xB02C, "reserved for profiles" },
1954 { 0xB02D, "reserved for profiles" },
1955 /* PROFIDrive */
1956 { 0xB02E, "PROFIDrive Parameter Access - Local"},
1957 { 0xB02F, "PROFIDrive Parameter Access - Global"},
1958  
1959 /*0xB030 - 0xBFFF reserved for profiles */
1960 { 0xB050, "Ext-PLL Control / RTC+RTA SyncID 0 (EDD)" },
1961 { 0xB051, "Ext-PLL Control / RTA SyncID 1 (GSY)" },
1962  
1963 { 0xB060, "EDD Trace Unit (EDD" },
1964 { 0xB061, "EDD Trace Unit (EDD" },
1965  
1966 { 0xB070, "OHA Info (OHA)" },
1967  
1968  
1969 /* slot specific */
1970 { 0xC000, "ExpectedIdentificationData for one slot" },
1971 { 0xC001, "RealIdentificationData for one slot" },
1972 /*0xC002 - 0xC009 reserved */
1973 { 0xC00A, "Diagnosis in channel coding for one slot" },
1974 { 0xC00B, "Diagnosis in all codings for one slot" },
1975 { 0xC00C, "Diagnosis, Maintenance, Qualified and Status for one slot" },
1976 /*0xC00D - 0xC00F reserved */
1977 { 0xC010, "Maintenance required in channel coding for one slot" },
1978 { 0xC011, "Maintenance demanded in channel coding for one slot" },
1979 { 0xC012, "Maintenance required in all codings for one slot" },
1980 { 0xC013, "Maintenance demanded in all codings for one slot" },
1981 /*0xC014 - 0xCFFF reserved */
1982 /*0xD000 - 0xDFFF reserved for profiles */
1983  
1984 /* AR specific */
1985 { 0xE000, "ExpectedIdentificationData for one AR" },
1986 { 0xE001, "RealIdentificationData for one AR" },
1987 { 0xE002, "ModuleDiffBlock for one AR" },
1988 /*0xE003 - 0xE009 reserved */
1989 { 0xE00A, "Diagnosis in channel coding for one AR" },
1990 { 0xE00B, "Diagnosis in all codings for one AR" },
1991 { 0xE00C, "Diagnosis, Maintenance, Qualified and Status for one AR" },
1992 /*0xE00D - 0xE00F reserved */
1993 { 0xE010, "Maintenance required in channel coding for one AR" },
1994 { 0xE011, "Maintenance demanded in channel coding for one AR" },
1995 { 0xE012, "Maintenance required in all codings for one AR" },
1996 { 0xE013, "Maintenance demanded in all codings for one AR" },
1997 /*0xE014 - 0xE02F reserved */
1998 { 0xE030, "IsochronousModeData for one AR" },
1999 /*0xE031 - 0xE03F reserved */
2000 { 0xE040, "MultipleWrite" },
2001 /*0xE041 - 0xE04F reserved */
2002 { 0xE050, "ARFSUDataAdjust data for one AR" },
2003 /*0xE051 - 0xE05F reserved */
2004 /*0xEC00 - 0xEFFF reserved */
2005  
2006 /* API specific */
2007 { 0xF000, "RealIdentificationData for one API" },
2008 /*0xF001 - 0xF009 reserved */
2009 { 0xF00A, "Diagnosis in channel coding for one API" },
2010 { 0xF00B, "Diagnosis in all codings for one API" },
2011 { 0xF00C, "Diagnosis, Maintenance, Qualified and Status for one API" },
2012 /*0xF00D - 0xF00F reserved */
2013 { 0xF010, "Maintenance required in channel coding for one API" },
2014 { 0xF011, "Maintenance demanded in channel coding for one API" },
2015 { 0xF012, "Maintenance required in all codings for one API" },
2016 { 0xF013, "Maintenance demanded in all codings for one API" },
2017 /*0xF014 - 0xF01F reserved */
2018 { 0xF020, "ARData for one API" },
2019 /*0xF021 - 0xF3FF reserved */
2020 /*0xF400 - 0xF7FF reserved */
2021  
2022 /* device specific */
2023 /*0xF800 - 0xF80B reserved */
2024 { 0xF80C, "Diagnosis, Maintenance, Qualified and Status for one device" },
2025 /*0xF80D - 0xF81F reserved */
2026 { 0xF820, "ARData" },
2027 { 0xF821, "APIData" },
2028 /*0xF822 - 0xF82F reserved */
2029 { 0xF830, "LogData" },
2030 { 0xF831, "PDevData" },
2031 /*0xF832 - 0xF83F reserved */
2032 { 0xF840, "I&M0FilterData" },
2033 { 0xF841, "PDRealData" },
2034 { 0xF842, "PDExpectedData" },
2035 /*0xF843 - 0xF84F reserved */
2036 { 0xF850, "AutoConfigurarion" },
2037 /*0xF851 - 0xFBFF reserved */
2038 /*0xFC00 - 0xFFFF reserved for profiles */
2039 { 0, NULL }
2040 };
2041  
2042 static const value_string pn_io_user_structure_identifier[] = {
2043 /*0x0000 - 0x7FFF manufacturer specific */
2044 { 0x8000, "ChannelDiagnosis" },
2045 { 0x8001, "Multiple" },
2046 { 0x8002, "ExtChannelDiagnosis" },
2047 { 0x8003, "QualifiedChannelDiagnosis" },
2048 /*0x8004 - 0x80FF reserved */
2049 { 0x8100, "Maintenance" },
2050 /*0x8101 - 0x8FFF reserved */
2051 /*0x9000 - 0x9FFF reserved for profiles */
2052 /*0xA000 - 0xFFFF reserved */
2053 { 0, NULL }
2054 };
2055  
2056 static const value_string pn_io_channel_error_type[] = {
2057 { 0x0000, "reserved" },
2058 { 0x0001, "short circuit" },
2059 { 0x0002, "Undervoltage" },
2060 { 0x0003, "Overvoltage" },
2061 { 0x0004, "Overload" },
2062 { 0x0005, "Overtemperature" },
2063 { 0x0006, "line break" },
2064 { 0x0007, "upper limit value exceeded" },
2065 { 0x0008, "lower limit value exceeded" },
2066 { 0x0009, "Error" },
2067 /*0x000A - 0x000F reserved */
2068 { 0x0010, "parametrization fault" },
2069 { 0x0011, "power supply fault" },
2070 { 0x0012, "fuse blown / open" },
2071 { 0x0013, "Manufacturer specific" },
2072 { 0x0014, "ground fault" },
2073 { 0x0015, "reference point lost" },
2074 { 0x0016, "process event lost / sampling error" },
2075 { 0x0017, "threshold warning" },
2076 { 0x0018, "output disabled" },
2077 { 0x0019, "safety event" },
2078 { 0x001A, "external fault" },
2079 /*0x001B - 0x001F manufacturer specific */
2080 /*0x0020 - 0x00FF reserved for common profiles */
2081 /*0x0100 - 0x7FFF manufacturer specific */
2082 { 0x8000, "Data transmission impossible" },
2083 { 0x8001, "Remote mismatch" },
2084 { 0x8002, "Media redundancy mismatch" },
2085 { 0x8003, "Sync mismatch" },
2086 { 0x8004, "IsochronousMode mismatch" },
2087 { 0x8005, "Multicast CR mismatch" },
2088 { 0x8006, "reserved" },
2089 { 0x8007, "Fiber optic mismatch" },
2090 { 0x8008, "Network component function mismatch" },
2091 { 0x8009, "Time mismatch" },
2092 /* added values for IEC version 2.3: */
2093 { 0x800A, "Dynamic frame packing function mismatch" },
2094 { 0x800B, "Media redundancy with planned duplication mismatch"},
2095 { 0x800C, "System redundancy mismatch"},
2096 /* ends */
2097 /*0x800D - 0x8FFF reserved */
2098 /*0x9000 - 0x9FFF reserved for profile */
2099 /*0xA000 - 0xFFFF reserved */
2100 { 0, NULL }
2101 };
2102 /* ExtChannelErrorType for ChannelErrorType 0 - 0x7FFF */
2103  
2104 static const value_string pn_io_ext_channel_error_type0[] = {
2105 /* 0x0000 Reserved */
2106 /* 0x0001 - 0x7FFF Manufacturer specific */
2107 { 0x8000, "Accumulative Info"},
2108 /* 0x8001 - 0x8FFF Reserved */
2109 /* 0x9000 - 0x9FFF Reserved for profiles */
2110 /* 0xA000 - 0xFFFF Reserved */
2111 { 0, NULL }
2112 };
2113  
2114  
2115 /* ExtChannelErrorType for ChannelErrorType "Data transmission impossible" */
2116 static const value_string pn_io_ext_channel_error_type0x8000[] = {
2117 /* 0x0000 Reserved */
2118 /* 0x0001 - 0x7FFF Manufacturer specific */
2119 { 0x8000, "Link State mismatch - Link down"},
2120 { 0x8001, "MAUType mismatch"},
2121 { 0x8002, "Line Delay mismatch"},
2122 /* 0x8003 - 0x8FFF Reserved */
2123 /* 0x9000 - 0x9FFF Reserved for profiles */
2124 /* 0xA000 - 0xFFFF Reserved */
2125 { 0, NULL }
2126 };
2127  
2128 /* ExtChannelErrorType for ChannelErrorType "Remote mismatch" */
2129 static const value_string pn_io_ext_channel_error_type0x8001[] = {
2130 /* 0x0000 Reserved */
2131 /* 0x0001 - 0x7FFF Manufacturer specific */
2132 { 0x8000, "Peer Chassis ID mismatch"},
2133 { 0x8001, "Peer Port ID mismatch"},
2134 { 0x8002, "Peer RT_CLASS_3 mismatch a"},
2135 { 0x8003, "Peer MAUType mismatch"},
2136 { 0x8004, "Peer MRP domain mismatch"},
2137 { 0x8005, "No peer detected"},
2138 { 0x8006, "Reserved"},
2139 { 0x8007, "Peer Line Delay mismatch"},
2140 { 0x8008, "Peer PTCP mismatch b"},
2141 { 0x8009, "Peer Preamble Length mismatch"},
2142 { 0x800A, "Peer Fragmentation mismatch"},
2143 /* 0x800B - 0x8FFF Reserved */
2144 /* 0x9000 - 0x9FFF Reserved for profiles */
2145 /* 0xA000 - 0xFFFF Reserved */
2146 { 0, NULL }
2147 };
2148  
2149 /* ExtChannelErrorType for ChannelErrorType "Media redundancy mismatch" 0x8002 */
2150 static const value_string pn_io_ext_channel_error_type0x8002[] = {
2151 /* 0x0000 Reserved */
2152 /* 0x0001 - 0x7FFF Manufacturer specific */
2153 { 0x8000, "Manager role fail MRP-instance 1"},
2154 { 0x8001, "MRP-instance 1 ring open"},
2155 { 0x8002, "Reserved"},
2156 { 0x8003, "Multiple manager MRP-instance 1"},
2157 { 0x8010, "Manager role fail MRP-instance 2"},
2158 { 0x8011, "MRP-instance 2 ring open"},
2159 { 0x8012, "Reserved"},
2160 { 0x8013, "Multiple manager MRP-instance 2"},
2161 { 0x8020, "Manager role fail MRP-instance 3"},
2162 { 0x8021, "MRP-instance 3 ring open"},
2163 { 0x8023, "Multiple manager MRP-instance 3"},
2164 { 0x8030, "Manager role fail MRP-instance 4"},
2165 { 0x8031, "MRP-instance 4 ring open"},
2166 { 0x8033, "Multiple manager MRP-instance 4"},
2167 { 0x8040, "Manager role fail MRP-instance 5"},
2168 { 0x8041, "MRP-instance 5 ring open"},
2169 { 0x8043, "Multiple manager MRP-instance 5"},
2170 { 0x8050, "Manager role fail MRP-instance 6"},
2171 { 0x8051, "MRP-instance 6 ring open"},
2172 { 0x8053, "Multiple manager MRP-instance 6"},
2173 { 0x8060, "Manager role fail MRP-instance 7"},
2174 { 0x8061, "MRP-instance 7 ring open"},
2175 { 0x8063, "Multiple manager MRP-instance 7"},
2176 { 0x8070, "Manager role fail MRP-instance 8"},
2177 { 0x8071, "MRP-instance 8 ring open"},
2178 { 0x8073, "Multiple manager MRP-instance 8"},
2179 { 0x8080, "Manager role fail MRP-instance 9"},
2180 { 0x8081, "MRP-instance 9 ring open"},
2181 { 0x8083, "Multiple manager MRP-instance 9"},
2182 { 0x8090, "Manager role fail MRP-instance 10"},
2183 { 0x8091, "MRP-instance 10 ring open"},
2184 { 0x8093, "Multiple manager MRP-instance 10"},
2185 { 0x80A0, "Manager role fail MRP-instance 11"},
2186 { 0x80A1, "MRP-instance 11 ring open"},
2187 { 0x80A3, "Multiple manager MRP-instance 11"},
2188 { 0x80B0, "Manager role fail MRP-instance 12"},
2189 { 0x80B1, "MRP-instance 12 ring open"},
2190 { 0x80B3, "Multiple manager MRP-instance 12"},
2191 { 0x80C0, "Manager role fail MRP-instance 13"},
2192 { 0x80C1, "MRP-instance 13 ring open"},
2193 { 0x80C3, "Multiple manager MRP-instance 13"},
2194 { 0x80D0, "Manager role fail MRP-instance 14"},
2195 { 0x80D1, "MRP-instance 14 ring open"},
2196 { 0x80D3, "Multiple manager MRP-instance 14"},
2197 { 0x80E0, "Manager role fail MRP-instance 15"},
2198 { 0x80E1, "MRP-instance 15 ring open"},
2199 { 0x80E3, "Multiple manager MRP-instance 15"},
2200 { 0x80F0, "Manager role fail MRP-instance 16"},
2201 { 0x80F1, "MRP-instance 16 ring open"},
2202 { 0x80F3, "Multiple manager MRP-instance 16"},
2203 /* 0x8004 - 0x8FFF Reserved */
2204 /* 0x9000 - 0x9FFF Reserved for profiles */
2205 /* 0xA000 - 0xFFFF Reserved */
2206 { 0, NULL }
2207 };
2208  
2209 /* ExtChannelErrorType for ChannelErrorType "Sync mismatch" and for ChannelErrorType "Time mismatch" 0x8003 and 0x8009*/
2210 static const value_string pn_io_ext_channel_error_type0x8003[] = {
2211 /* 0x0000 Reserved */
2212 /* 0x0001 - 0x7FFF Manufacturer specific */
2213 { 0x8000, "No sync message received"},
2214 { 0x8001, "- 0x8002 Reserved"},
2215 { 0x8003, "Jitter out of boundary"},
2216 /* 0x8004 - 0x8FFF Reserved */
2217 /* 0x9000 - 0x9FFF Reserved for profiles */
2218 /* 0xA000 - 0xFFFF Reserved */
2219 { 0, NULL }
2220 };
2221  
2222 /*ExtChannelErrorType for ChannelErrorType "Isochronous mode mismatch" 0x8004 */
2223 static const value_string pn_io_ext_channel_error_type0x8004[] = {
2224 /* 0x0000 Reserved */
2225 /* 0x0001 - 0x7FFF Manufacturer specific */
2226 { 0x8000, "Output Time Failure - Output update missing or out of order"},
2227 { 0x8001, "Input Time Failure"},
2228 { 0x8002, "Master Life Sign Failure - Error in MLS update detected"},
2229 /* 0x8003 - 0x8FFF Reserved */
2230 /* 0x9000 - 0x9FFF Reserved for profiles */
2231 /* 0xA000 - 0xFFFF Reserved */
2232 { 0, NULL }
2233 };
2234  
2235 /* ExtChannelErrorType for ChannelErrorType "Multicast CR mismatch" 0x8005 */
2236 static const value_string pn_io_ext_channel_error_type0x8005[] = {
2237 /* 0x0000 Reserved */
2238 /* 0x0001 - 0x7FFF Manufacturer specific */
2239 { 0x8000, "Multicast Consumer CR timed out"},
2240 { 0x8001, "Address resolution failed"},
2241 /* 0x8002 - 0x8FFF Reserved */
2242 /* 0x9000 - 0x9FFF Reserved for profiles */
2243 /* 0xA000 - 0xFFFF Reserved */
2244 { 0, NULL }
2245 };
2246  
2247 /* ExtChannelErrorType for ChannelErrorType "Fiber optic mismatch" 0x8007*/
2248 static const value_string pn_io_ext_channel_error_type0x8007[] = {
2249 /* 0x0000 Reserved */
2250 /* 0x0001 - 0x7FFF Manufacturer specific */
2251 { 0x8000, "Power Budget"},
2252 /* 0x8001 - 0x8FFF Reserved */
2253 /* 0x9000 - 0x9FFF Reserved for profiles */
2254 /* 0xA000 - 0xFFFF Reserved */
2255 { 0, NULL }
2256 };
2257  
2258 /* ExtChannelErrorType for ChannelErrorType "Network component function mismatch" 0x8008 */
2259 static const value_string pn_io_ext_channel_error_type0x8008[] = {
2260 /* 0x0000 Reserved */
2261 /* 0x0001 - 0x7FFF Manufacturer specific */
2262 { 0x8000, "Frame dropped - no resource"},
2263 /* 0x8001 - 0x8FFF Reserved */
2264 /* 0x9000 - 0x9FFF Reserved for profiles */
2265 /* 0xA000 - 0xFFFF Reserved */
2266 { 0, NULL }
2267 };
2268  
2269 /* ExtChannelErrorType for ChannelErrorType "Dynamic Frame Packing function mismatch" 0x800A */
2270 static const value_string pn_io_ext_channel_error_type0x800A[] = {
2271 /* 0x0000 Reserved */
2272 /* 0x0001 - 0x7FFF Manufacturer specific */
2273 /* 0x8000 - 0x80FF Reserved */
2274 { 0x8100, "Frame late error for FrameID (0x0100)"},
2275 /* 0x8101 + 0x8FFE See Equation (56) */
2276 { 0x8FFF, "Frame late error for FrameID (0x0FFF)"},
2277 /* 0x8001 - 0x8FFF Reserved */
2278 /* 0x9000 - 0x9FFF Reserved for profiles */
2279 /* 0xA000 - 0xFFFF Reserved */
2280 { 0, NULL }
2281 };
2282  
2283 /* ExtChannelErrorType for ChannelErrorType "Media redundancy with planned duplication mismatch" 0x800B */
2284 static const value_string pn_io_ext_channel_error_type0x800B[] = {
2285 /* 0x0000 Reserved */
2286 /* 0x0001 - 0x7FFF Manufacturer specific */
2287 /* 0x8000 - 0x86FF Reserved */
2288 { 0x8700, "MRPD duplication void for FrameID (0x0700)"},
2289 /* 0x8701 + 0x8FFE See Equation (57) */
2290 { 0x8FFF, "MRPD duplication void for FrameID (0x0FFF)"},
2291 /* 0x9000 - 0x9FFF Reserved for profiles */
2292 /* 0xA000 - 0xFFFF Reserved */
2293 { 0, NULL }
2294 };
2295  
2296 /* ExtChannelErrorType for ChannelErrorType "System redundancy mismatch" 0x800C */
2297 static const value_string pn_io_ext_channel_error_type0x800C[] = {
2298 /* 0x0000 Reserved */
2299 /* 0x0001 - 0x7FFF Manufacturer specific */
2300 { 0x8000, "System redundancy event"},
2301 /* 0x8001 - 0x8FFF Reserved */
2302 /* 0x9000 - 0x9FFF Reserved for profiles */
2303 /* 0xA000 - 0xFFFF Reserved */
2304 { 0, NULL }
2305 };
2306  
2307 static const value_string pn_io_channel_properties_type[] = {
2308 { 0x0000, "submodule or unspecified" },
2309 { 0x0001, "1 Bit" },
2310 { 0x0002, "2 Bit" },
2311 { 0x0003, "4 Bit" },
2312 { 0x0004, "8 Bit" },
2313 { 0x0005, "16 Bit" },
2314 { 0x0006, "32 Bit" },
2315 { 0x0007, "64 Bit" },
2316 /*0x0008 - 0x00FF reserved */
2317 { 0, NULL }
2318 };
2319  
2320 static const value_string pn_io_channel_properties_accumulative_vals[] = {
2321 { 0x0000, "Channel" },
2322 { 0x0001, "ChannelGroup" },
2323 { 0, NULL }
2324 };
2325  
2326 /* We are reading this as a two bit value, but the spec specifies each bit
2327 * separately. Beware endianness when reading spec
2328 */
2329 static const value_string pn_io_channel_properties_maintenance[] = {
2330 { 0x0000, "Failure" },
2331 { 0x0001, "Maintenance required" },
2332 { 0x0002, "Maintenance demanded" },
2333 { 0x0003, "see QualifiedChannelQualifier" },
2334 { 0, NULL }
2335 };
2336  
2337 static const value_string pn_io_channel_properties_specifier[] = {
2338 { 0x0000, "All subsequent disappears" },
2339 { 0x0001, "Appears" },
2340 { 0x0002, "Disappears" },
2341 { 0x0003, "Disappears but others remain" },
2342 { 0, NULL }
2343 };
2344  
2345 static const value_string pn_io_channel_properties_direction[] = {
2346 { 0x0000, "Manufacturer-specific" },
2347 { 0x0001, "Input" },
2348 { 0x0002, "Output" },
2349 { 0x0003, "Input/Output" },
2350 /*0x0004 - 0x0007 reserved */
2351 { 0, NULL }
2352 };
2353  
2354 static const value_string pn_io_alarmcr_type[] = {
2355 { 0x0000, "reserved" },
2356 { 0x0001, "Alarm CR" },
2357 /*0x0002 - 0xFFFF reserved */
2358 { 0, NULL }
2359 };
2360  
2361 static const value_string pn_io_mau_type[] = {
2362 /*0x0000 - 0x0004 reserved */
2363 { 0x0005, "10BASET" },
2364 /*0x0006 - 0x0009 reserved */
2365 { 0x000A, "10BASETXHD" },
2366 { 0x000B, "10BASETXFD" },
2367 { 0x000C, "10BASEFLHD" },
2368 { 0x000D, "10BASEFLFD" },
2369 { 0x000F, "100BASETXHD" },
2370 { 0x0010, "100BASETXFD" },
2371 { 0x0011, "100BASEFXHD" },
2372 { 0x0012, "100BASEFXFD" },
2373 /*0x0013 - 0x0014 reserved */
2374 { 0x0015, "1000BASEXHD" },
2375 { 0x0016, "1000BASEXFD" },
2376 { 0x0017, "1000BASELXHD" },
2377 { 0x0018, "1000BASELXFD" },
2378 { 0x0019, "1000BASESXHD" },
2379 { 0x001A, "1000BASESXFD" },
2380 /*0x001B - 0x001C reserved */
2381 { 0x001D, "1000BASETHD" },
2382 { 0x001E, "1000BASETFD" },
2383 { 0x001F, "10GigBASEFX" },
2384 /*0x0020 - 0x002D reserved */
2385 { 0x002E, "100BASELX10" },
2386 /*0x002F - 0x0035 reserved */
2387 { 0x0036, "100BASEPXFD" },
2388 /*0x0037 - 0xFFFF reserved */
2389 { 0, NULL }
2390 };
2391  
2392  
2393 static const value_string pn_io_preamble_length[] = {
2394 { 0x0000, "Seven octets Preamble shall be used" },
2395 { 0x0001, "One octet Preamble shall be used" },
2396 /*0x0002 - 0xFFFF reserved */
2397 { 0, NULL }
2398 };
2399  
2400 static const value_string pn_io_mau_type_mode[] = {
2401 { 0x0000, "OFF" },
2402 { 0x0001, "ON" },
2403 /*0x0002 - 0xFFFF reserved */
2404 { 0, NULL }
2405 };
2406  
2407  
2408 static const value_string pn_io_port_state[] = {
2409 { 0x0000, "reserved" },
2410 { 0x0001, "up" },
2411 { 0x0002, "down" },
2412 { 0x0003, "testing" },
2413 { 0x0004, "unknown" },
2414 /*0x0005 - 0xFFFF reserved */
2415 { 0, NULL }
2416 };
2417  
2418  
2419 static const value_string pn_io_media_type[] = {
2420 { 0x0000, "Unknown" },
2421 { 0x0001, "Copper cable" },
2422 { 0x0002, "Fiber optic cable" },
2423 { 0x0003, "Radio communication" },
2424 /*0x0004 - 0xFFFF reserved */
2425 { 0, NULL }
2426 };
2427  
2428  
2429 static const value_string pn_io_fiber_optic_type[] = {
2430 { 0x0000, "No fiber type adjusted" },
2431 { 0x0001, "9 um single mode fiber" },
2432 { 0x0002, "50 um multi mode fiber" },
2433 { 0x0003, "62,5 um multi mode fiber" },
2434 { 0x0004, "SI-POF, NA=0.5" },
2435 { 0x0005, "SI-PCF, NA=0.36" },
2436 { 0x0006, "LowNA-POF, NA=0.3" },
2437 { 0x0007, "GI-POF" },
2438 /*0x0008 - 0xFFFF reserved */
2439 { 0, NULL }
2440 };
2441  
2442  
2443 static const value_string pn_io_fiber_optic_cable_type[] = {
2444 { 0x0000, "No cable specified" },
2445 { 0x0001, "Inside/outside cable, fixed installation" },
2446 { 0x0002, "Inside/outside cable, flexible installation" },
2447 { 0x0003, "Outdoor cable, fixed installation" },
2448 /*0x0004 - 0xFFFF reserved */
2449 { 0, NULL }
2450 };
2451  
2452 static const value_string pn_io_im_revision_prefix_vals[] = {
2453 { 'V', "V - Officially released version" },
2454 { 'R', "R - Revision" },
2455 { 'P', "P - Prototype" },
2456 { 'U', "U - Under Test (Field Test)" },
2457 { 'T', "T - Test Device" },
2458 /*all others reserved */
2459 { 0, NULL }
2460 };
2461  
2462  
2463 static const value_string pn_io_mrp_role_vals[] = {
2464 { 0x0000, "Media Redundancy disabled" },
2465 { 0x0001, "Media Redundancy Client" },
2466 { 0x0002, "Media Redundancy Manager" },
2467 /*all others reserved */
2468 { 0, NULL }
2469 };
2470  
2471 static const value_string pn_io_mrp_instance_no[] = {
2472 { 0x0000, "MRP_Instance 1" },
2473 { 0x0001, "MRP_Instance 2" },
2474 { 0x0002, "MRP_Instance 3" },
2475 { 0x0003, "MRP_Instance 4" },
2476 { 0x0004, "MRP_Instance 5" },
2477 { 0x0005, "MRP_Instance 6" },
2478 { 0x0006, "MRP_Instance 7" },
2479 { 0x0007, "MRP_Instance 8" },
2480 { 0x0008, "MRP_Instance 9" },
2481 { 0x0009, "MRP_Instance 10" },
2482 { 0x000A, "MRP_Instance 11" },
2483 { 0x000B, "MRP_Instance 12" },
2484 { 0x000C, "MRP_Instance 13" },
2485 { 0x000D, "MRP_Instance 14" },
2486 { 0x000E, "MRP_Instance 15" },
2487 { 0x000F, "MRP_Instance 16" },
2488 /*all others reserved */
2489 { 0, NULL }
2490 };
2491  
2492 static const value_string pn_io_mrp_mrm_on[] = {
2493 { 0x0000, "Disable MediaRedundancyManager diagnosis" },
2494 { 0x0001, "Enable MediaRedundancyManager diagnosis"},
2495 { 0, NULL }
2496 };
2497 static const value_string pn_io_mrp_checkUUID[] = {
2498 { 0x0000, "Disable the check of the MRP_DomainUUID" },
2499 { 0x0001, "Enable the check of the MRP_DomainUUID"},
2500 { 0, NULL }
2501 };
2502  
2503 static const value_string pn_io_mrp_prio_vals[] = {
2504 { 0x0000, "Highest priority redundancy manager" },
2505 /* 0x1000 - 0x7000 High priorities */
2506 { 0x8000, "Default priority for redundancy manager" },
2507 /* 0x9000 - 0xE000 Low priorities */
2508 { 0xF000, "Lowest priority redundancy manager" },
2509 /*all others reserved */
2510 { 0, NULL }
2511 };
2512  
2513 static const value_string pn_io_mrp_rtmode_rtclass12_vals[] = {
2514 { 0x0000, "RT_CLASS_1 and RT_CLASS_2 redundancy mode deactivated" },
2515 { 0x0001, "RT_CLASS_1 and RT_CLASS_2 redundancy mode activated" },
2516 { 0, NULL }
2517 };
2518  
2519 static const value_string pn_io_mrp_rtmode_rtclass3_vals[] = {
2520 { 0x0000, "RT_CLASS_3 redundancy mode deactivated" },
2521 { 0x0001, "RT_CLASS_3 redundancy mode activated" },
2522 { 0, NULL }
2523 };
2524  
2525 static const value_string pn_io_mrp_ring_state_vals[] = {
2526 { 0x0000, "Ring open" },
2527 { 0x0001, "Ring closed" },
2528 { 0, NULL }
2529 };
2530  
2531 static const value_string pn_io_mrp_rt_state_vals[] = {
2532 { 0x0000, "RT media redundancy lost" },
2533 { 0x0001, "RT media redundancy available" },
2534 { 0, NULL }
2535 };
2536  
2537 static const value_string pn_io_control_properties_vals[] = {
2538 { 0x0000, "Reserved" },
2539 { 0, NULL }
2540 };
2541  
2542 static const value_string pn_io_control_properties_prmbegin_vals[] = {
2543 { 0x0000, "No PrmBegin" },
2544 { 0x0001, "The IO controller starts the transmisson of the stored start-up parameter" },
2545 { 0, NULL }
2546 };
2547 static const value_string pn_io_control_properties_application_ready_vals[] = {
2548 { 0x0000, "Wait for explicit ControlCommand.ReadyForCompanion" },
2549 { 0x0001, "Implicit ControlCommand.ReadyForCompanion" },
2550 { 0, NULL }
2551 };
2552  
2553 static const value_string pn_io_fs_hello_mode_vals[] = {
2554 { 0x0000, "OFF" },
2555 { 0x0001, "Send req on LinkUp" },
2556 { 0x0002, "Send req on LinkUp after HelloDelay" },
2557 { 0, NULL }
2558 };
2559  
2560 static const value_string pn_io_fs_parameter_mode_vals[] = {
2561 { 0x0000, "OFF" },
2562 { 0x0001, "ON" },
2563 { 0x0002, "Reserved" },
2564 { 0x0003, "Reserved" },
2565 { 0, NULL }
2566 };
2567  
2568 static const value_string pn_io_frame_details_sync_master_vals[] = {
2569 { 0x0000, "No Sync Frame" },
2570 { 0x0001, "Primary sync frame" },
2571 { 0x0002, "Secondary sync frame" },
2572 { 0x0003, "Reserved" },
2573 { 0, NULL }
2574 };
2575 static const value_string pn_io_frame_details_meaning_frame_send_offset_vals[] = {
2576 { 0x0000, "Field FrameSendOffset specifies the point of time for receiving or transmitting a frame " },
2577 { 0x0001, "Field FrameSendOffset specifies the beginning of the RT_CLASS_3 interval within a phase" },
2578 { 0x0002, "Field FrameSendOffset specifies the ending of the RT_CLASS_3 interval within a phase" },
2579 { 0x0003, "Reserved" },
2580 { 0, NULL }
2581 };
2582  
2583 static const value_string pn_io_f_check_seqnr[] = {
2584 { 0x00, "consecutive number not included in crc" },
2585 { 0x01, "consecutive number included in crc" },
2586 { 0, NULL }
2587 };
2588  
2589 static const value_string pn_io_f_check_ipar[] = {
2590 { 0x00, "no check" },
2591 { 0x01, "check" },
2592 { 0, NULL }
2593 };
2594  
2595 static const value_string pn_io_f_sil[] = {
2596 { 0x00, "SIL1" },
2597 { 0x01, "SIL2" },
2598 { 0x02, "SIL3" },
2599 { 0x03, "NoSIL" },
2600 { 0, NULL }
2601 };
2602  
2603 static const value_string pn_io_f_crc_len[] = {
2604 { 0x00, "3 octet CRC" },
2605 { 0x01, "2 octet CRC" },
2606 { 0x02, "4 octet CRC" },
2607 { 0x03, "reserved" },
2608 { 0, NULL }
2609 };
2610  
2611 static const value_string pn_io_f_crc_seed[] = {
2612 { 0x00, "CRC-FP as seed value and counter" },
2613 { 0x01, "'1' as seed value and CRC-FP+/MNR" },
2614 { 0, NULL }
2615 };
2616  
2617 /* F_Block_ID dissection due to ver2.6 specifikation of PI */
2618 static const value_string pn_io_f_block_id[] = {
2619 { 0x00, "No F_WD_Time_2, no F_iPar_CRC" },
2620 { 0x01, "No F_WD_Time_2, F_iPar_CRC" },
2621 { 0x02, "F_WD_Time_2, no F_iPar_CRC" },
2622 { 0x03, "F_WD_Time_2, F_iPar_CRC" },
2623 /* 0x04..0x07 reserved */
2624 /* { 0x00, "Parameter set for F-Host/F-Device relationship" }, */
2625 /* { 0x01, "Additional F_Address parameter block" }, */
2626 /* 0x02..0x07 reserved */
2627 { 0, NULL }
2628 };
2629  
2630 static const value_string pn_io_f_par_version[] = {
2631 { 0x00, "Valid for V1-mode" },
2632 { 0x01, "Valid for V2-mode" },
2633 /* 0x02..0x03 reserved */
2634 { 0, NULL }
2635 };
2636  
2637 static const value_string pn_io_profidrive_request_id_vals[] = {
2638 { 0x00, "Reserved" },
2639 { 0x01, "Read request" },
2640 { 0x02, "Change request" },
2641 { 0, NULL }
2642 };
2643  
2644 static const value_string pn_io_profidrive_response_id_vals[] = {
2645 { 0x00, "Reserved" },
2646 { 0x01, "Positive read response" },
2647 { 0x02, "Positive change response" },
2648 { 0x81, "Negative read response" },
2649 { 0x82, "Negative change response" },
2650 { 0, NULL }
2651 };
2652  
2653 static const value_string pn_io_profidrive_attribute_vals[] = {
2654 { 0x00, "Reserved" },
2655 { 0x10, "Value" },
2656 { 0x20, "Description" },
2657 { 0x30, "Text" },
2658 { 0, NULL }
2659 };
2660  
2661 static const value_string pn_io_profidrive_format_vals[] = {
2662 {0x01, "Boolean" },
2663 {0x02, "Integer8" },
2664 {0x03, "Integer16" },
2665 {0x04, "Integer32" },
2666 {0x05, "Unsigned8" },
2667 {0x06, "Unsigned16" },
2668 {0x07, "Unsigned32" },
2669 {0x08, "Float32" },
2670 {0x09, "VisibleString" },
2671 {0x0A, "OctetString" },
2672 {0x0C, "TimeOfDay" },
2673 {0x0D, "TimeDifference" },
2674 {0x32, "Date" },
2675 {0x34, "TimeOfDay" },
2676 {0x35, "TimeDifference" },
2677 {0x36, "TimeDifference" },
2678 { 0, NULL }
2679 };
2680  
2681  
2682 static int
2683 dissect_profidrive_value(tvbuff_t *tvb, gint offset, packet_info *pinfo,
2684 proto_tree *tree, guint8 *drep, guint8 format_val)
2685 {
2686 guint32 value32;
2687 guint16 value16;
2688 guint8 value8;
2689  
2690 switch(format_val)
2691 {
2692 case 1:
2693 case 2:
2694 case 5:
2695 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
2696 hf_pn_io_profidrive_param_value_byte, &value8);
2697 break;
2698 case 3:
2699 case 6:
2700 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
2701 hf_pn_io_profidrive_param_value_word, &value16);
2702 break;
2703 case 4:
2704 case 7:
2705 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
2706 hf_pn_io_profidrive_param_value_dword, &value32);
2707 break;
2708 case 8:
2709 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
2710 hf_pn_io_profidrive_param_value_float, &value32);
2711 break;
2712 case 9:
2713 case 0x0A:
2714 {
2715 gint sLen;
2716 sLen = (gint)tvb_strnlen( tvb, offset, -1);
2717 proto_tree_add_item(tree, hf_pn_io_profidrive_param_value_string, tvb, offset, sLen, ENC_ASCII|ENC_NA);
2718 offset = (offset + sLen);
2719 break;
2720 }
2721 default:
2722 offset = offset + 1;
2723 expert_add_info_format(pinfo, tree, &ei_pn_io_unsupported, "Not supported or invalid format %u!", format_val);
2724 break;
2725 }
2726 return(offset);
2727 }
2728  
2729 static GList *pnio_ars;
2730  
2731 typedef struct pnio_ar_s {
2732 /* generic */
2733 e_guid_t aruuid;
2734 guint16 inputframeid;
2735 guint16 outputframeid;
2736  
2737 /* controller only */
2738 /*const char controllername[33];*/
2739 const guint8 controllermac[6];
2740 guint16 controlleralarmref;
2741  
2742 /* device only */
2743 const guint8 devicemac[6];
2744 guint16 devicealarmref;
2745 guint16 arType;
2746 } pnio_ar_t;
2747  
2748  
2749  
2750 static void
2751 pnio_ar_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, pnio_ar_t *ar)
2752 {
2753 p_add_proto_data(wmem_file_scope(), pinfo, proto_pn_io, 0, ar );
2754 p_add_proto_data(pinfo->pool, pinfo, proto_pn_io, 0, GUINT_TO_POINTER(10));
2755  
2756 if (tree) {
2757 proto_item *item;
2758 proto_item *sub_item;
2759 proto_tree *sub_tree;
2760 address controllermac_addr, devicemac_addr;
2761  
2762 set_address(&controllermac_addr, AT_ETHER, 6, ar->controllermac);
2763 set_address(&devicemac_addr, AT_ETHER, 6, ar->devicemac);
2764  
2765 sub_tree = proto_tree_add_subtree_format(tree, tvb, 0, 0, ett_pn_io_ar_info, &sub_item,
2766 "ARUUID:%s ContrMAC:%s ContrAlRef:0x%x DevMAC:%s DevAlRef:0x%x InCR:0x%x OutCR=0x%x",
2767 guid_to_str(wmem_packet_scope(), (const e_guid_t*) &ar->aruuid),
2768 address_to_str(wmem_packet_scope(), &controllermac_addr), ar->controlleralarmref,
2769 address_to_str(wmem_packet_scope(), &devicemac_addr), ar->devicealarmref,
2770 ar->inputframeid, ar->outputframeid);
2771 PROTO_ITEM_SET_GENERATED(sub_item);
2772  
2773 item = proto_tree_add_guid(sub_tree, hf_pn_io_ar_uuid, tvb, 0, 0, (e_guid_t *) &ar->aruuid);
2774 PROTO_ITEM_SET_GENERATED(item);
2775  
2776 item = proto_tree_add_ether(sub_tree, hf_pn_io_cminitiator_macadd, tvb, 0, 0, ar->controllermac);
2777 PROTO_ITEM_SET_GENERATED(item);
2778 item = proto_tree_add_uint(sub_tree, hf_pn_io_localalarmref, tvb, 0, 0, ar->controlleralarmref);
2779 PROTO_ITEM_SET_GENERATED(item);
2780  
2781 item = proto_tree_add_ether(sub_tree, hf_pn_io_cmresponder_macadd, tvb, 0, 0, ar->devicemac);
2782 PROTO_ITEM_SET_GENERATED(item);
2783 item = proto_tree_add_uint(sub_tree, hf_pn_io_localalarmref, tvb, 0, 0, ar->devicealarmref);
2784 PROTO_ITEM_SET_GENERATED(item);
2785  
2786 item = proto_tree_add_uint(sub_tree, hf_pn_io_frame_id, tvb, 0, 0, ar->inputframeid);
2787 PROTO_ITEM_SET_GENERATED(item);
2788 item = proto_tree_add_uint(sub_tree, hf_pn_io_frame_id, tvb, 0, 0, ar->outputframeid);
2789 PROTO_ITEM_SET_GENERATED(item);
2790 }
2791 }
2792  
2793  
2794  
2795  
2796 static int dissect_block(tvbuff_t *tvb, int offset,
2797 packet_info *pinfo, proto_tree *tree, guint8 *drep, guint16 *u16Index, guint32 *u32RecDataLen, pnio_ar_t **ar);
2798  
2799 static int dissect_a_block(tvbuff_t *tvb, int offset,
2800 packet_info *pinfo, proto_tree *tree, guint8 *drep);
2801  
2802 static int dissect_blocks(tvbuff_t *tvb, int offset,
2803 packet_info *pinfo, proto_tree *tree, guint8 *drep);
2804  
2805 static int dissect_PNIO_IOxS(tvbuff_t *tvb, int offset,
2806 packet_info *pinfo, proto_tree *tree, guint8 *drep, int hfindex);
2807  
2808  
2809  
2810  
2811  
2812 static pnio_ar_t *
2813 pnio_ar_find_by_aruuid(packet_info *pinfo _U_, e_guid_t *aruuid)
2814 {
2815 GList *ars;
2816 pnio_ar_t *ar;
2817  
2818  
2819 /* find pdev */
2820 for(ars = pnio_ars; ars != NULL; ars = g_list_next(ars)) {
2821 ar = (pnio_ar_t *)ars->data;
2822  
2823 if (memcmp(&ar->aruuid, aruuid, sizeof(e_guid_t)) == 0) {
2824 return ar;
2825 }
2826 }
2827  
2828 return NULL;
2829 }
2830  
2831  
2832 static pnio_ar_t *
2833 pnio_ar_new(e_guid_t *aruuid)
2834 {
2835 pnio_ar_t *ar;
2836  
2837  
2838 ar = (pnio_ar_t *)wmem_alloc0(wmem_file_scope(), sizeof(pnio_ar_t));
2839  
2840 memcpy(&ar->aruuid, aruuid, sizeof(e_guid_t));
2841  
2842 ar->controlleralarmref = 0xffff;
2843 ar->devicealarmref = 0xffff;
2844  
2845 pnio_ars = g_list_append(pnio_ars, ar);
2846  
2847 return ar;
2848 }
2849  
2850  
2851  
2852 /* dissect the four status (error) fields */
2853 static int
2854 dissect_PNIO_status(tvbuff_t *tvb, int offset,
2855 packet_info *pinfo, proto_tree *tree, guint8 *drep)
2856 {
2857 guint8 u8ErrorCode;
2858 guint8 u8ErrorDecode;
2859 guint8 u8ErrorCode1;
2860 guint8 u8ErrorCode2;
2861  
2862 proto_item *sub_item;
2863 proto_tree *sub_tree;
2864 guint32 u32SubStart;
2865 int bytemask = (drep[0] & DREP_LITTLE_ENDIAN) ? 3 : 0;
2866  
2867 const value_string *error_code1_vals;
2868 const value_string *error_code2_vals = pn_io_error_code2; /* defaults */
2869  
2870  
2871  
2872 /* status */
2873 sub_item = proto_tree_add_item(tree, hf_pn_io_status, tvb, offset, 0, ENC_NA);
2874 sub_tree = proto_item_add_subtree(sub_item, ett_pn_io_status);
2875 u32SubStart = offset;
2876  
2877 /* the PNIOStatus field is existing in both the RPC and the application data,
2878 * depending on the current PDU.
2879 * As the byte representation of these layers are different, this has to be handled
2880 * in a somewhat different way than elsewhere. */
2881  
2882 dissect_dcerpc_uint8(tvb, offset+(0^bytemask), pinfo, sub_tree, drep,
2883 hf_pn_io_error_code, &u8ErrorCode);
2884 dissect_dcerpc_uint8(tvb, offset+(1^bytemask), pinfo, sub_tree, drep,
2885 hf_pn_io_error_decode, &u8ErrorDecode);
2886  
2887 switch (u8ErrorDecode) {
2888 case(0x80): /* PNIORW */
2889 dissect_dcerpc_uint8(tvb, offset+(2^bytemask), pinfo, sub_tree, drep,
2890 hf_pn_io_error_code1_pniorw, &u8ErrorCode1);
2891 error_code1_vals = pn_io_error_code1_pniorw;
2892  
2893 /* u8ErrorCode2 for PNIORW is always user specific */
2894 dissect_dcerpc_uint8(tvb, offset+(3^bytemask), pinfo, sub_tree, drep,
2895 hf_pn_io_error_code2_pniorw, &u8ErrorCode2);
2896  
2897 error_code2_vals = pn_io_error_code2_pniorw;
2898  
2899 break;
2900 case(0x81): /* PNIO */
2901 dissect_dcerpc_uint8(tvb, offset+(2^bytemask), pinfo, sub_tree, drep,
2902 hf_pn_io_error_code1_pnio, &u8ErrorCode1);
2903 error_code1_vals = pn_io_error_code1_pnio;
2904  
2905 switch (u8ErrorCode1) {
2906 case(1):
2907 dissect_dcerpc_uint8(tvb, offset+(3^bytemask), pinfo, sub_tree, drep,
2908 hf_pn_io_error_code2_pnio_1, &u8ErrorCode2);
2909 error_code2_vals = pn_io_error_code2_pnio_1;
2910 break;
2911 case(2):
2912 dissect_dcerpc_uint8(tvb, offset+(3^bytemask), pinfo, sub_tree, drep,
2913 hf_pn_io_error_code2_pnio_2, &u8ErrorCode2);
2914 error_code2_vals = pn_io_error_code2_pnio_2;
2915 break;
2916 case(3):
2917 dissect_dcerpc_uint8(tvb, offset+(3^bytemask), pinfo, sub_tree, drep,
2918 hf_pn_io_error_code2_pnio_3, &u8ErrorCode2);
2919 error_code2_vals = pn_io_error_code2_pnio_3;
2920 break;
2921 case(4):
2922 dissect_dcerpc_uint8(tvb, offset+(3^bytemask), pinfo, sub_tree, drep,
2923 hf_pn_io_error_code2_pnio_4, &u8ErrorCode2);
2924 error_code2_vals = pn_io_error_code2_pnio_4;
2925 break;
2926 case(5):
2927 dissect_dcerpc_uint8(tvb, offset+(3^bytemask), pinfo, sub_tree, drep,
2928 hf_pn_io_error_code2_pnio_5, &u8ErrorCode2);
2929 error_code2_vals = pn_io_error_code2_pnio_5;
2930 break;
2931 case(6):
2932 dissect_dcerpc_uint8(tvb, offset+(3^bytemask), pinfo, sub_tree, drep,
2933 hf_pn_io_error_code2_pnio_6, &u8ErrorCode2);
2934 error_code2_vals = pn_io_error_code2_pnio_6;
2935 break;
2936 case(7):
2937 dissect_dcerpc_uint8(tvb, offset+(3^bytemask), pinfo, sub_tree, drep,
2938 hf_pn_io_error_code2_pnio_7, &u8ErrorCode2);
2939 error_code2_vals = pn_io_error_code2_pnio_7;
2940 break;
2941 case(8):
2942 dissect_dcerpc_uint8(tvb, offset+(3^bytemask), pinfo, sub_tree, drep,
2943 hf_pn_io_error_code2_pnio_8, &u8ErrorCode2);
2944 error_code2_vals = pn_io_error_code2_pnio_8;
2945 break;
2946 case(20):
2947 dissect_dcerpc_uint8(tvb, offset+(3^bytemask), pinfo, sub_tree, drep,
2948 hf_pn_io_error_code2_pnio_20, &u8ErrorCode2);
2949 error_code2_vals = pn_io_error_code2_pnio_20;
2950 break;
2951 case(21):
2952 dissect_dcerpc_uint8(tvb, offset+(3^bytemask), pinfo, sub_tree, drep,
2953 hf_pn_io_error_code2_pnio_21, &u8ErrorCode2);
2954 error_code2_vals = pn_io_error_code2_pnio_21;
2955 break;
2956 case(22):
2957 dissect_dcerpc_uint8(tvb, offset+(3^bytemask), pinfo, sub_tree, drep,
2958 hf_pn_io_error_code2_pnio_22, &u8ErrorCode2);
2959 error_code2_vals = pn_io_error_code2_pnio_22;
2960 break;
2961 case(23):
2962 dissect_dcerpc_uint8(tvb, offset+(3^bytemask), pinfo, sub_tree, drep,
2963 hf_pn_io_error_code2_pnio_23, &u8ErrorCode2);
2964 error_code2_vals = pn_io_error_code2_pnio_23;
2965 break;
2966 case(40):
2967 dissect_dcerpc_uint8(tvb, offset+(3^bytemask), pinfo, sub_tree, drep,
2968 hf_pn_io_error_code2_pnio_40, &u8ErrorCode2);
2969 error_code2_vals = pn_io_error_code2_pnio_40;
2970 break;
2971 case(61):
2972 dissect_dcerpc_uint8(tvb, offset+(3^bytemask), pinfo, sub_tree, drep,
2973 hf_pn_io_error_code2_pnio_61, &u8ErrorCode2);
2974 error_code2_vals = pn_io_error_code2_pnio_61;
2975 break;
2976 case(62):
2977 dissect_dcerpc_uint8(tvb, offset+(3^bytemask), pinfo, sub_tree, drep,
2978 hf_pn_io_error_code2_pnio_62, &u8ErrorCode2);
2979 error_code2_vals = pn_io_error_code2_pnio_62;
2980 break;
2981 case(63):
2982 dissect_dcerpc_uint8(tvb, offset+(3^bytemask), pinfo, sub_tree, drep,
2983 hf_pn_io_error_code2_pnio_63, &u8ErrorCode2);
2984 error_code2_vals = pn_io_error_code2_pnio_63;
2985 break;
2986 case(64):
2987 dissect_dcerpc_uint8(tvb, offset+(3^bytemask), pinfo, sub_tree, drep,
2988 hf_pn_io_error_code2_pnio_64, &u8ErrorCode2);
2989 error_code2_vals = pn_io_error_code2_pnio_64;
2990 break;
2991 case(65):
2992 dissect_dcerpc_uint8(tvb, offset+(3^bytemask), pinfo, sub_tree, drep,
2993 hf_pn_io_error_code2_pnio_65, &u8ErrorCode2);
2994 error_code2_vals = pn_io_error_code2_pnio_65;
2995 break;
2996 case(66):
2997 dissect_dcerpc_uint8(tvb, offset+(3^bytemask), pinfo, sub_tree, drep,
2998 hf_pn_io_error_code2_pnio_66, &u8ErrorCode2);
2999 error_code2_vals = pn_io_error_code2_pnio_66;
3000 break;
3001 case(70):
3002 dissect_dcerpc_uint8(tvb, offset+(3^bytemask), pinfo, sub_tree, drep,
3003 hf_pn_io_error_code2_pnio_70, &u8ErrorCode2);
3004 error_code2_vals = pn_io_error_code2_pnio_70;
3005 break;
3006 case(71):
3007 dissect_dcerpc_uint8(tvb, offset+(3^bytemask), pinfo, sub_tree, drep,
3008 hf_pn_io_error_code2_pnio_71, &u8ErrorCode2);
3009 error_code2_vals = pn_io_error_code2_pnio_71;
3010 break;
3011 case(72):
3012 dissect_dcerpc_uint8(tvb, offset+(3^bytemask), pinfo, sub_tree, drep,
3013 hf_pn_io_error_code2_pnio_72, &u8ErrorCode2);
3014 error_code2_vals = pn_io_error_code2_pnio_72;
3015 break;
3016 case(73):
3017 dissect_dcerpc_uint8(tvb, offset+(3^bytemask), pinfo, sub_tree, drep,
3018 hf_pn_io_error_code2_pnio_73, &u8ErrorCode2);
3019 error_code2_vals = pn_io_error_code2_pnio_73;
3020 break;
3021 case(74):
3022 dissect_dcerpc_uint8(tvb, offset+(3^bytemask), pinfo, sub_tree, drep,
3023 hf_pn_io_error_code2_pnio_74, &u8ErrorCode2);
3024 error_code2_vals = pn_io_error_code2_pnio_74;
3025 break;
3026 case(75):
3027 dissect_dcerpc_uint8(tvb, offset+(3^bytemask), pinfo, sub_tree, drep,
3028 hf_pn_io_error_code2_pnio_75, &u8ErrorCode2);
3029 error_code2_vals = pn_io_error_code2_pnio_75;
3030 break;
3031 case(76):
3032 dissect_dcerpc_uint8(tvb, offset+(3^bytemask), pinfo, sub_tree, drep,
3033 hf_pn_io_error_code2_pnio_76, &u8ErrorCode2);
3034 error_code2_vals = pn_io_error_code2_pnio_76;
3035 break;
3036 case(77):
3037 dissect_dcerpc_uint8(tvb, offset+(3^bytemask), pinfo, sub_tree, drep,
3038 hf_pn_io_error_code2_pnio_77, &u8ErrorCode2);
3039 error_code2_vals = pn_io_error_code2_pnio_77;
3040 break;
3041 case(253):
3042 dissect_dcerpc_uint8(tvb, offset+(3^bytemask), pinfo, sub_tree, drep,
3043 hf_pn_io_error_code2_pnio_253, &u8ErrorCode2);
3044 error_code2_vals = pn_io_error_code2_pnio_253;
3045 break;
3046 case(255):
3047 dissect_dcerpc_uint8(tvb, offset+(3^bytemask), pinfo, sub_tree, drep,
3048 hf_pn_io_error_code2_pnio_255, &u8ErrorCode2);
3049 error_code2_vals = pn_io_error_code2_pnio_255;
3050 break;
3051 default:
3052 /* don't know this u8ErrorCode1 for PNIO, use defaults */
3053 dissect_dcerpc_uint8(tvb, offset+(3^bytemask), pinfo, sub_tree, drep,
3054 hf_pn_io_error_code2, &u8ErrorCode2);
3055 expert_add_info_format(pinfo, sub_item, &ei_pn_io_error_code1, "Unknown ErrorCode1 0x%x (for ErrorDecode==PNIO)", u8ErrorCode1);
3056 break;
3057 }
3058 break;
3059 default:
3060 dissect_dcerpc_uint8(tvb, offset+(2^bytemask), pinfo, sub_tree, drep,
3061 hf_pn_io_error_code1, &u8ErrorCode1);
3062 if (u8ErrorDecode!=0) {
3063 expert_add_info_format(pinfo, sub_item, &ei_pn_io_error_code1, "Unknown ErrorDecode 0x%x", u8ErrorDecode);
3064 }
3065 error_code1_vals = pn_io_error_code1;
3066  
3067 /* don't know this u8ErrorDecode, use defaults */
3068 dissect_dcerpc_uint8(tvb, offset+(3^bytemask), pinfo, sub_tree, drep,
3069 hf_pn_io_error_code2, &u8ErrorCode2);
3070 if (u8ErrorDecode != 0) {
3071 expert_add_info_format(pinfo, sub_item, &ei_pn_io_error_code2, "Unknown ErrorDecode 0x%x", u8ErrorDecode);
3072 }
3073 }
3074  
3075 offset += 4;
3076  
3077 if ((u8ErrorCode == 0) && (u8ErrorDecode == 0) && (u8ErrorCode1 == 0) && (u8ErrorCode2 == 0)) {
3078 proto_item_append_text(sub_item, ": OK");
3079 col_append_str(pinfo->cinfo, COL_INFO, ", OK");
3080 } else {
3081 proto_item_append_text(sub_item, ": Error: \"%s\", \"%s\", \"%s\", \"%s\"",
3082 val_to_str(u8ErrorCode, pn_io_error_code, "(0x%x)"),
3083 val_to_str(u8ErrorDecode, pn_io_error_decode, "(0x%x)"),
3084 val_to_str(u8ErrorCode1, error_code1_vals, "(0x%x)"),
3085 val_to_str(u8ErrorCode2, error_code2_vals, "(0x%x)"));
3086 col_append_fstr(pinfo->cinfo, COL_INFO, ", Error: \"%s\", \"%s\", \"%s\", \"%s\"",
3087 val_to_str(u8ErrorCode, pn_io_error_code, "(0x%x)"),
3088 val_to_str(u8ErrorDecode, pn_io_error_decode, "(0x%x)"),
3089 val_to_str(u8ErrorCode1, error_code1_vals, "(0x%x)"),
3090 val_to_str(u8ErrorCode2, error_code2_vals, "(0x%x)"));
3091 }
3092 proto_item_set_len(sub_item, offset - u32SubStart);
3093  
3094 return offset;
3095 }
3096  
3097  
3098 /* dissect the alarm specifier */
3099 static int
3100 dissect_Alarm_specifier(tvbuff_t *tvb, int offset,
3101 packet_info *pinfo, proto_tree *tree, guint8 *drep)
3102 {
3103 guint16 u16AlarmSpecifierSequence;
3104 guint16 u16AlarmSpecifierChannel;
3105 guint16 u16AlarmSpecifierManufacturer;
3106 guint16 u16AlarmSpecifierSubmodule;
3107 guint16 u16AlarmSpecifierAR;
3108 proto_item *sub_item;
3109 proto_tree *sub_tree;
3110  
3111 /* alarm specifier */
3112 sub_item = proto_tree_add_item(tree, hf_pn_io_alarm_specifier, tvb, offset, 2, ENC_NA);
3113 sub_tree = proto_item_add_subtree(sub_item, ett_pn_io_pdu_type);
3114  
3115 dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
3116 hf_pn_io_alarm_specifier_sequence, &u16AlarmSpecifierSequence);
3117 u16AlarmSpecifierSequence &= 0x07FF;
3118 dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
3119 hf_pn_io_alarm_specifier_channel, &u16AlarmSpecifierChannel);
3120 u16AlarmSpecifierChannel = (u16AlarmSpecifierChannel &0x0800) >> 11;
3121 dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
3122 hf_pn_io_alarm_specifier_manufacturer, &u16AlarmSpecifierManufacturer);
3123 u16AlarmSpecifierManufacturer = (u16AlarmSpecifierManufacturer &0x1000) >> 12;
3124 dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
3125 hf_pn_io_alarm_specifier_submodule, &u16AlarmSpecifierSubmodule);
3126 u16AlarmSpecifierSubmodule = (u16AlarmSpecifierSubmodule & 0x2000) >> 13;
3127 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
3128 hf_pn_io_alarm_specifier_ardiagnosis, &u16AlarmSpecifierAR);
3129 u16AlarmSpecifierAR = (u16AlarmSpecifierAR & 0x8000) >> 15;
3130  
3131  
3132 proto_item_append_text(sub_item, ", Sequence: %u, Channel: %u, Manuf: %u, Submodule: %u AR: %u",
3133 u16AlarmSpecifierSequence, u16AlarmSpecifierChannel,
3134 u16AlarmSpecifierManufacturer, u16AlarmSpecifierSubmodule, u16AlarmSpecifierAR);
3135  
3136 return offset;
3137 }
3138  
3139  
3140 /* dissect the alarm header */
3141 static int
3142 dissect_Alarm_header(tvbuff_t *tvb, int offset,
3143 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep)
3144 {
3145 guint16 u16AlarmType;
3146 guint32 u32Api;
3147 guint16 u16SlotNr;
3148 guint16 u16SubslotNr;
3149  
3150 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
3151 hf_pn_io_alarm_type, &u16AlarmType);
3152 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
3153 hf_pn_io_api, &u32Api);
3154 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
3155 hf_pn_io_slot_nr, &u16SlotNr);
3156 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
3157 hf_pn_io_subslot_nr, &u16SubslotNr);
3158  
3159 proto_item_append_text(item, ", %s, API:%u, Slot:0x%x/0x%x",
3160 val_to_str(u16AlarmType, pn_io_alarm_type, "(0x%x)"),
3161 u32Api, u16SlotNr, u16SubslotNr);
3162  
3163 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s, Slot: 0x%x/0x%x",
3164 val_to_str(u16AlarmType, pn_io_alarm_type, "(0x%x)"),
3165 u16SlotNr, u16SubslotNr);
3166  
3167 return offset;
3168 }
3169  
3170  
3171 static int
3172 dissect_ChannelProperties(tvbuff_t *tvb, int offset,
3173 packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint8 *drep)
3174 {
3175 proto_item *sub_item;
3176 proto_tree *sub_tree;
3177 guint16 u16ChannelProperties;
3178  
3179  
3180 sub_item = proto_tree_add_item(tree, hf_pn_io_channel_properties, tvb, offset, 2, ENC_BIG_ENDIAN);
3181 sub_tree = proto_item_add_subtree(sub_item, ett_pn_io_channel_properties);
3182 dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
3183 hf_pn_io_channel_properties_direction, &u16ChannelProperties);
3184 dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
3185 hf_pn_io_channel_properties_specifier, &u16ChannelProperties);
3186 dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
3187 hf_pn_io_channel_properties_maintenance, &u16ChannelProperties);
3188 dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
3189 hf_pn_io_channel_properties_accumulative, &u16ChannelProperties);
3190 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
3191 hf_pn_io_channel_properties_type, &u16ChannelProperties);
3192  
3193 return offset;
3194 }
3195  
3196  
3197 static int
3198 dissect_AlarmUserStructure(tvbuff_t *tvb, int offset,
3199 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep,
3200 guint16 *body_length, guint16 u16UserStructureIdentifier)
3201 {
3202 guint16 u16ChannelNumber;
3203 guint16 u16ChannelErrorType;
3204 guint16 u16ExtChannelErrorType;
3205 guint32 u32ExtChannelAddValue;
3206 guint16 u16Index = 0;
3207 guint32 u32RecDataLen;
3208 pnio_ar_t *ar = NULL;
3209  
3210  
3211 switch (u16UserStructureIdentifier) {
3212 case(0x8000): /* ChannelDiagnosisData */
3213 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
3214 hf_pn_io_channel_number, &u16ChannelNumber);
3215 offset = dissect_ChannelProperties(tvb, offset, pinfo, tree, item, drep);
3216 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
3217 hf_pn_io_channel_error_type, &u16ChannelErrorType);
3218 *body_length -= 6;
3219 break;
3220 case(0x8002): /* ExtChannelDiagnosisData */
3221 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
3222 hf_pn_io_channel_number, &u16ChannelNumber);
3223  
3224 offset = dissect_ChannelProperties(tvb, offset, pinfo, tree, item, drep);
3225  
3226 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
3227 hf_pn_io_channel_error_type, &u16ChannelErrorType);
3228  
3229 if (u16ChannelErrorType < 0x7fff)
3230 {
3231 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
3232 hf_pn_io_ext_channel_error_type0, &u16ExtChannelErrorType);
3233 }
3234 else if (u16ChannelErrorType == 0x8000)
3235 {
3236 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
3237 hf_pn_io_ext_channel_error_type0x8000, &u16ExtChannelErrorType);
3238 }
3239 else if (u16ChannelErrorType == 0x8001)
3240 {
3241 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
3242 hf_pn_io_ext_channel_error_type0x8001, &u16ExtChannelErrorType);
3243 }
3244 else if (u16ChannelErrorType == 0x8002)
3245 {
3246 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
3247 hf_pn_io_ext_channel_error_type0x8002, &u16ExtChannelErrorType);
3248 }
3249 else if ((u16ChannelErrorType == 0x8003)||(u16ChannelErrorType == 0x8009))
3250 {
3251 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
3252 hf_pn_io_ext_channel_error_type0x8003, &u16ExtChannelErrorType);
3253 }
3254 else if (u16ChannelErrorType == 0x8004)
3255 {
3256 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
3257 hf_pn_io_ext_channel_error_type0x8004, &u16ExtChannelErrorType);
3258 }
3259 else if (u16ChannelErrorType == 0x8005)
3260 {
3261 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
3262 hf_pn_io_ext_channel_error_type0x8005, &u16ExtChannelErrorType);
3263 }
3264 else if (u16ChannelErrorType == 0x8007)
3265 {
3266 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
3267 hf_pn_io_ext_channel_error_type0x8007, &u16ExtChannelErrorType);
3268 }
3269 else if (u16ChannelErrorType == 0x8008)
3270 {
3271 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
3272 hf_pn_io_ext_channel_error_type0x8008, &u16ExtChannelErrorType);
3273 }
3274 else if (u16ChannelErrorType == 0x800A)
3275 {
3276 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
3277 hf_pn_io_ext_channel_error_type0x800A, &u16ExtChannelErrorType);
3278 }
3279 else if (u16ChannelErrorType == 0x800B)
3280 {
3281 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
3282 hf_pn_io_ext_channel_error_type0x800B, &u16ExtChannelErrorType);
3283 }
3284 else if (u16ChannelErrorType == 0x800C)
3285 {
3286 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
3287 hf_pn_io_ext_channel_error_type0x800C, &u16ExtChannelErrorType);
3288 }
3289 else
3290 {
3291 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
3292 hf_pn_io_ext_channel_error_type, &u16ExtChannelErrorType);
3293 }
3294 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
3295 hf_pn_io_ext_channel_add_value, &u32ExtChannelAddValue);
3296 *body_length -= 12;
3297 break;
3298 case(0x8100): /* MaintenanceItem */
3299 offset = dissect_block(tvb, offset, pinfo, tree, drep, &u16Index, &u32RecDataLen, &ar);
3300 *body_length -= 12;
3301 break;
3302 /* XXX - dissect remaining user structures of [AlarmItem] */
3303 case(0x8001): /* DiagnosisData */
3304 case(0x8003): /* QualifiedChannelDiagnosisData */
3305 default:
3306 if (u16UserStructureIdentifier >= 0x8000) {
3307 offset = dissect_pn_undecoded(tvb, offset, pinfo, tree, *body_length);
3308 } else {
3309 offset = dissect_pn_user_data(tvb, offset, pinfo, tree, *body_length, "UserData");
3310 }
3311  
3312 *body_length = 0;
3313 }
3314  
3315 return offset;
3316 }
3317  
3318  
3319  
3320 /* dissect the alarm notification block */
3321 static int
3322 dissect_AlarmNotification_block(tvbuff_t *tvb, int offset,
3323 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow,
3324 guint16 body_length)
3325 {
3326 guint32 u32ModuleIdentNumber;
3327 guint32 u32SubmoduleIdentNumber;
3328 guint16 u16UserStructureIdentifier;
3329  
3330  
3331 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
3332 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
3333 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
3334 return offset;
3335 }
3336  
3337 offset = dissect_Alarm_header(tvb, offset, pinfo, tree, item, drep);
3338  
3339 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
3340 hf_pn_io_module_ident_number, &u32ModuleIdentNumber);
3341 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
3342 hf_pn_io_submodule_ident_number, &u32SubmoduleIdentNumber);
3343  
3344 offset = dissect_Alarm_specifier(tvb, offset, pinfo, tree, drep);
3345  
3346 proto_item_append_text(item, ", Ident:0x%x, SubIdent:0x%x",
3347 u32ModuleIdentNumber, u32SubmoduleIdentNumber);
3348  
3349 body_length -= 20;
3350  
3351 /* the rest of the block contains optional: [MaintenanceItem] and/or [AlarmItem] */
3352 while (body_length) {
3353 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
3354 hf_pn_io_user_structure_identifier, &u16UserStructureIdentifier);
3355 proto_item_append_text(item, ", USI:0x%x", u16UserStructureIdentifier);
3356 body_length -= 2;
3357  
3358 offset = dissect_AlarmUserStructure(tvb, offset, pinfo, tree, item, drep, &body_length, u16UserStructureIdentifier);
3359 }
3360  
3361 return offset;
3362 }
3363  
3364  
3365 static int
3366 dissect_IandM0_block(tvbuff_t *tvb, int offset,
3367 packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
3368 {
3369 guint8 u8VendorIDHigh;
3370 guint8 u8VendorIDLow;
3371 char *pOrderID;
3372 char *pIMSerialNumber;
3373 guint16 u16IMHardwareRevision;
3374 guint8 u8SWRevisionPrefix;
3375 guint8 u8IMSWRevisionFunctionalEnhancement;
3376 guint8 u8IMSWRevisionBugFix;
3377 guint8 u8IMSWRevisionInternalChange;
3378 guint16 u16IMRevisionCounter;
3379 guint16 u16IMProfileID;
3380 guint16 u16IMProfileSpecificType;
3381 guint8 u8IMVersionMajor;
3382 guint8 u8IMVersionMinor;
3383 guint16 u16IMSupported;
3384  
3385  
3386 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
3387 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
3388 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
3389 return offset;
3390 }
3391  
3392 /* x8 VendorIDHigh */
3393 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
3394 hf_pn_io_vendor_id_high, &u8VendorIDHigh);
3395 /* x8 VendorIDLow */
3396 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
3397 hf_pn_io_vendor_id_low, &u8VendorIDLow);
3398 /* c8[20] OrderID */
3399 pOrderID = (char *)wmem_alloc(wmem_packet_scope(), 20+1);
3400 tvb_memcpy(tvb, (guint8 *) pOrderID, offset, 20);
3401 pOrderID[20] = '\0';
3402 proto_tree_add_string (tree, hf_pn_io_order_id, tvb, offset, 20, pOrderID);
3403 offset += 20;
3404  
3405 /* c8[16] IM_Serial_Number */
3406 pIMSerialNumber = (char *)wmem_alloc(wmem_packet_scope(), 16+1);
3407 tvb_memcpy(tvb, (guint8 *) pIMSerialNumber, offset, 16);
3408 pIMSerialNumber[16] = '\0';
3409 proto_tree_add_string (tree, hf_pn_io_im_serial_number, tvb, offset, 16, pIMSerialNumber);
3410 offset += 16;
3411  
3412 /* x16 IM_Hardware_Revision */
3413 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
3414 hf_pn_io_im_hardware_revision, &u16IMHardwareRevision);
3415 /* c8 SWRevisionPrefix */
3416 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
3417 hf_pn_io_im_revision_prefix, &u8SWRevisionPrefix);
3418 /* x8 IM_SWRevision_Functional_Enhancement */
3419 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
3420 hf_pn_io_im_sw_revision_functional_enhancement, &u8IMSWRevisionFunctionalEnhancement);
3421 /* x8 IM_SWRevision_Bug_Fix */
3422 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
3423 hf_pn_io_im_revision_bugfix, &u8IMSWRevisionBugFix);
3424 /* x8 IM_SWRevision_Internal_Change */
3425 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
3426 hf_pn_io_im_sw_revision_internal_change, &u8IMSWRevisionInternalChange);
3427 /* x16 IM_Revision_Counter */
3428 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
3429 hf_pn_io_im_revision_counter, &u16IMRevisionCounter);
3430 /* x16 IM_Profile_ID */
3431 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
3432 hf_pn_io_im_profile_id, &u16IMProfileID);
3433 /* x16 IM_Profile_Specific_Type */
3434 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
3435 hf_pn_io_im_profile_specific_type, &u16IMProfileSpecificType);
3436 /* x8 IM_Version_Major (values) */
3437 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
3438 hf_pn_io_im_version_major, &u8IMVersionMajor);
3439 /* x8 IM_Version_Minor (values) */
3440 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
3441 hf_pn_io_im_version_minor, &u8IMVersionMinor);
3442 /* x16 IM_Supported (bitfield) */
3443 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
3444 hf_pn_io_im_supported, &u16IMSupported);
3445  
3446 return offset;
3447 }
3448  
3449  
3450 static int
3451 dissect_IandM1_block(tvbuff_t *tvb, int offset,
3452 packet_info *pinfo _U_, proto_tree *tree, proto_item *item, guint8 *drep _U_, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
3453 {
3454 char *pTagFunction;
3455 char *pTagLocation;
3456  
3457 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
3458 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
3459 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
3460 return offset;
3461 }
3462  
3463 /* IM_Tag_Function [32] */
3464 pTagFunction = (char *)wmem_alloc(wmem_packet_scope(), 32+1);
3465 tvb_memcpy(tvb, (guint8 *) pTagFunction, offset, 32);
3466 pTagFunction[32] = '\0';
3467 proto_tree_add_string (tree, hf_pn_io_im_tag_function, tvb, offset, 32, pTagFunction);
3468 offset += 32;
3469  
3470 /* IM_Tag_Location [22] */
3471 pTagLocation = (char *)wmem_alloc(wmem_packet_scope(), 22+1);
3472 tvb_memcpy(tvb, (guint8 *) pTagLocation, offset, 22);
3473 pTagLocation[22] = '\0';
3474 proto_tree_add_string (tree, hf_pn_io_im_tag_location, tvb, offset, 22, pTagLocation);
3475 offset += 22;
3476  
3477 proto_item_append_text(item, ": TagFunction:\"%s\", TagLocation:\"%s\"", pTagFunction, pTagLocation);
3478  
3479 return offset;
3480 }
3481  
3482  
3483 static int
3484 dissect_IandM2_block(tvbuff_t *tvb, int offset,
3485 packet_info *pinfo _U_, proto_tree *tree, proto_item *item, guint8 *drep _U_, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
3486 {
3487 char *pDate;
3488  
3489 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
3490 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
3491 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
3492 return offset;
3493 }
3494  
3495 /* IM_Date [16] */
3496 pDate = (char *)wmem_alloc(wmem_packet_scope(), 16+1);
3497 tvb_memcpy(tvb, (guint8 *) pDate, offset, 16);
3498 pDate[16] = '\0';
3499 proto_tree_add_string (tree, hf_pn_io_im_date, tvb, offset, 16, pDate);
3500 offset += 16;
3501  
3502 proto_item_append_text(item, ": Date:\"%s\"", pDate);
3503  
3504 return offset;
3505 }
3506  
3507  
3508 static int
3509 dissect_IandM3_block(tvbuff_t *tvb, int offset,
3510 packet_info *pinfo _U_, proto_tree *tree, proto_item *item, guint8 *drep _U_, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
3511 {
3512 char *pDescriptor;
3513  
3514 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
3515 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
3516 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
3517 return offset;
3518 }
3519  
3520 /* IM_Descriptor [54] */
3521 pDescriptor = (char *)wmem_alloc(wmem_packet_scope(), 54+1);
3522 tvb_memcpy(tvb, (guint8 *) pDescriptor, offset, 54);
3523 pDescriptor[54] = '\0';
3524 proto_tree_add_string (tree, hf_pn_io_im_descriptor, tvb, offset, 54, pDescriptor);
3525 offset += 54;
3526  
3527 proto_item_append_text(item, ": Descriptor:\"%s\"", pDescriptor);
3528  
3529 return offset;
3530 }
3531  
3532  
3533 static int
3534 dissect_IandM4_block(tvbuff_t *tvb, int offset,
3535 packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint8 *drep _U_, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
3536 {
3537  
3538 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
3539 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
3540 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
3541 return offset;
3542 }
3543  
3544 dissect_pn_user_data(tvb, offset, pinfo, tree, 54, "IM Signature");
3545  
3546 return offset;
3547 }
3548  
3549 static int
3550 dissect_IandM5_block(tvbuff_t *tvb, int offset,
3551 packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint8 *drep _U_, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
3552 {
3553 guint16 u16NumberofEntries;
3554  
3555 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
3556 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
3557 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
3558 return offset;
3559 }
3560  
3561 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep, hf_pn_io_im_numberofentries, &u16NumberofEntries);
3562  
3563 while(u16NumberofEntries > 0) {
3564 offset = dissect_a_block(tvb, offset, pinfo, tree, drep);
3565 u16NumberofEntries--;
3566 }
3567 return offset;
3568 }
3569  
3570 static int
3571 dissect_IandM0FilterData_block(tvbuff_t *tvb, int offset,
3572 packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
3573 {
3574 guint16 u16NumberOfAPIs;
3575 guint32 u32Api;
3576 guint16 u16NumberOfModules;
3577 guint16 u16SlotNr;
3578 guint32 u32ModuleIdentNumber;
3579 guint16 u16NumberOfSubmodules;
3580 guint16 u16SubslotNr;
3581 guint32 u32SubmoduleIdentNumber;
3582 proto_item *subslot_item;
3583 proto_tree *subslot_tree;
3584 proto_item *module_item;
3585 proto_tree *module_tree;
3586 guint32 u32ModuleStart;
3587  
3588  
3589 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
3590 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
3591 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
3592 return offset;
3593 }
3594  
3595 /* NumberOfAPIs */
3596 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
3597 hf_pn_io_number_of_apis, &u16NumberOfAPIs);
3598  
3599 while (u16NumberOfAPIs--) {
3600 /* API */
3601 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
3602 hf_pn_io_api, &u32Api);
3603 /* NumberOfModules */
3604 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
3605 hf_pn_io_number_of_modules, &u16NumberOfModules);
3606  
3607 while (u16NumberOfModules--) {
3608 module_item = proto_tree_add_item(tree, hf_pn_io_subslot, tvb, offset, 6, ENC_NA);
3609 module_tree = proto_item_add_subtree(module_item, ett_pn_io_module);
3610  
3611 u32ModuleStart = offset;
3612  
3613 /* SlotNumber */
3614 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, module_tree, drep,
3615 hf_pn_io_slot_nr, &u16SlotNr);
3616 /* ModuleIdentNumber */
3617 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, module_tree, drep,
3618 hf_pn_io_module_ident_number, &u32ModuleIdentNumber);
3619 /* NumberOfSubmodules */
3620 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, module_tree, drep,
3621 hf_pn_io_number_of_submodules, &u16NumberOfSubmodules);
3622  
3623 proto_item_append_text(module_item, ": Slot:%u, Ident:0x%x Submodules:%u",
3624 u16SlotNr, u32ModuleIdentNumber, u16NumberOfSubmodules);
3625  
3626 while (u16NumberOfSubmodules--) {
3627 subslot_item = proto_tree_add_item(module_tree, hf_pn_io_subslot, tvb, offset, 6, ENC_NA);
3628 subslot_tree = proto_item_add_subtree(subslot_item, ett_pn_io_subslot);
3629  
3630 /* SubslotNumber */
3631 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, subslot_tree, drep,
3632 hf_pn_io_subslot_nr, &u16SubslotNr);
3633 /* SubmoduleIdentNumber */
3634 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, subslot_tree, drep,
3635 hf_pn_io_submodule_ident_number, &u32SubmoduleIdentNumber);
3636  
3637 proto_item_append_text(subslot_item, ": Number:0x%x, Ident:0x%x",
3638 u16SubslotNr, u32SubmoduleIdentNumber);
3639 }
3640  
3641 proto_item_set_len(module_item, offset-u32ModuleStart);
3642 }
3643 }
3644  
3645 return offset;
3646 }
3647  
3648  
3649 static int
3650 dissect_IandM5Data_block(tvbuff_t *tvb, int offset,
3651 packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint8 *drep)
3652 {
3653 char *pIMAnnotation;
3654 char *pIMOrderID;
3655 guint8 u8VendorIDHigh;
3656 guint8 u8VendorIDLow;
3657 char *pIMSerialNumber;
3658 guint16 u16IMHardwareRevision;
3659 guint8 u8SWRevisionPrefix;
3660 guint8 u8IMSWRevisionFunctionalEnhancement;
3661 guint8 u8IMSWRevisionBugFix;
3662 guint8 u8IMSWRevisionInternalChange;
3663  
3664 /* c8[64] IM Annotation */
3665 pIMAnnotation = (char *)wmem_alloc(wmem_packet_scope(), 64+1);
3666 tvb_memcpy(tvb, (guint8 *) pIMAnnotation, offset, 64);
3667 pIMAnnotation[64] = '\0';
3668 proto_tree_add_string(tree, hf_pn_io_im_annotation, tvb, offset, 64, pIMAnnotation);
3669 offset += 64;
3670  
3671 /* c8[64] IM Order ID */
3672 pIMOrderID = (char *)wmem_alloc(wmem_packet_scope(), 64+1);
3673 tvb_memcpy(tvb, (guint8 *) pIMOrderID, offset, 64);
3674 pIMOrderID[64] = '\0';
3675 proto_tree_add_string(tree, hf_pn_io_im_order_id, tvb, offset, 64, pIMOrderID);
3676 offset += 64;
3677  
3678 /* x8 VendorIDHigh */
3679 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
3680 hf_pn_io_vendor_id_high, &u8VendorIDHigh);
3681 /* x8 VendorIDLow */
3682 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
3683 hf_pn_io_vendor_id_low, &u8VendorIDLow);
3684  
3685 /* c8[16] IM Serial Number */
3686 pIMSerialNumber = (char *)wmem_alloc(wmem_packet_scope(), 16+1);
3687 tvb_memcpy(tvb, (guint8 *) pIMSerialNumber, offset, 16);
3688 pIMSerialNumber[16] = '\0';
3689 proto_tree_add_string(tree, hf_pn_io_im_serial_number, tvb, offset, 16, pIMSerialNumber);
3690 offset += 16;
3691  
3692 /* x16 IM_Hardware_Revision */
3693 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
3694 hf_pn_io_im_hardware_revision, &u16IMHardwareRevision);
3695 /* c8 SWRevisionPrefix */
3696 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
3697 hf_pn_io_im_revision_prefix, &u8SWRevisionPrefix);
3698 /* x8 IM_SWRevision_Functional_Enhancement */
3699 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
3700 hf_pn_io_im_sw_revision_functional_enhancement, &u8IMSWRevisionFunctionalEnhancement);
3701 /* x8 IM_SWRevision_Bug_Fix */
3702 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
3703 hf_pn_io_im_revision_bugfix, &u8IMSWRevisionBugFix);
3704  
3705 /* x8 IM_SWRevision_Internal_Change */
3706 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
3707 hf_pn_io_im_sw_revision_internal_change, &u8IMSWRevisionInternalChange);
3708  
3709 return offset;
3710 }
3711  
3712  
3713 /* dissect the IdentificationData block */
3714 static int
3715 dissect_IdentificationData_block(tvbuff_t *tvb, int offset,
3716 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
3717 {
3718 guint16 u16NumberOfAPIs = 1;
3719 guint32 u32Api;
3720 guint16 u16NumberOfSlots;
3721 guint16 u16SlotNr;
3722 guint32 u32ModuleIdentNumber;
3723 guint16 u16NumberOfSubslots;
3724 guint32 u32SubmoduleIdentNumber;
3725 guint16 u16SubslotNr;
3726 proto_item *slot_item;
3727 proto_tree *slot_tree;
3728 guint32 u32SlotStart;
3729 proto_item *subslot_item;
3730 proto_tree *subslot_tree;
3731  
3732  
3733 if (u8BlockVersionHigh != 1 || (u8BlockVersionLow != 0 && u8BlockVersionLow != 1)) {
3734 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
3735 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
3736 return offset;
3737 }
3738  
3739 if (u8BlockVersionLow == 1) {
3740 /* NumberOfAPIs */
3741 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
3742 hf_pn_io_number_of_apis, &u16NumberOfAPIs);
3743 }
3744  
3745 proto_item_append_text(item, ": APIs:%u", u16NumberOfAPIs);
3746  
3747 while (u16NumberOfAPIs--) {
3748 if (u8BlockVersionLow == 1) {
3749 /* API */
3750 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
3751 hf_pn_io_api, &u32Api);
3752 }
3753  
3754 /* NumberOfSlots */
3755 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
3756 hf_pn_io_number_of_slots, &u16NumberOfSlots);
3757  
3758 proto_item_append_text(item, ", Slots:%u", u16NumberOfSlots);
3759  
3760 while (u16NumberOfSlots--) {
3761 slot_item = proto_tree_add_item(tree, hf_pn_io_slot, tvb, offset, 0, ENC_NA);
3762 slot_tree = proto_item_add_subtree(slot_item, ett_pn_io_slot);
3763 u32SlotStart = offset;
3764  
3765 /* SlotNumber */
3766 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, slot_tree, drep,
3767 hf_pn_io_slot_nr, &u16SlotNr);
3768 /* ModuleIdentNumber */
3769 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, slot_tree, drep,
3770 hf_pn_io_module_ident_number, &u32ModuleIdentNumber);
3771 /* NumberOfSubslots */
3772 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, slot_tree, drep,
3773 hf_pn_io_number_of_subslots, &u16NumberOfSubslots);
3774  
3775 proto_item_append_text(slot_item, ": SlotNr:%u Ident:0x%x Subslots:%u",
3776 u16SlotNr, u32ModuleIdentNumber, u16NumberOfSubslots);
3777  
3778 while (u16NumberOfSubslots--) {
3779 subslot_item = proto_tree_add_item(slot_tree, hf_pn_io_subslot, tvb, offset, 6, ENC_NA);
3780 subslot_tree = proto_item_add_subtree(subslot_item, ett_pn_io_subslot);
3781  
3782 /* SubslotNumber */
3783 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, subslot_tree, drep,
3784 hf_pn_io_subslot_nr, &u16SubslotNr);
3785 /* SubmoduleIdentNumber */
3786 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, subslot_tree, drep,
3787 hf_pn_io_submodule_ident_number, &u32SubmoduleIdentNumber);
3788  
3789 proto_item_append_text(subslot_item, ": Number:0x%x, Ident:0x%x",
3790 u16SubslotNr, u32SubmoduleIdentNumber);
3791 }
3792  
3793 proto_item_set_len(slot_item, offset-u32SlotStart);
3794 }
3795 }
3796  
3797 return offset;
3798 }
3799  
3800  
3801 /* dissect the substitute value block */
3802 static int
3803 dissect_SubstituteValue_block(tvbuff_t *tvb, int offset,
3804 packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow,
3805 guint16 u16BodyLength)
3806 {
3807 guint16 u16SubstitutionMode;
3808  
3809 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
3810 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
3811 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
3812 return offset;
3813 }
3814  
3815 /* SubstitutionMode */
3816 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
3817 hf_pn_io_substitutionmode, &u16SubstitutionMode);
3818  
3819  
3820 /* SubstituteDataItem */
3821 /* IOCS */
3822 offset = dissect_PNIO_IOxS(tvb, offset, pinfo, tree, drep, hf_pn_io_iocs);
3823 u16BodyLength -= 3;
3824 /* SubstituteDataObjectElement */
3825 dissect_pn_user_data_bytes(tvb, offset, pinfo, tree, u16BodyLength, SUBST_DATA);
3826  
3827 return offset;
3828 }
3829  
3830  
3831 /* dissect the RecordInputDataObjectElement block */
3832 static int
3833 dissect_RecordInputDataObjectElement_block(tvbuff_t *tvb, int offset,
3834 packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
3835 {
3836 guint8 u8LengthIOCS;
3837 guint8 u8LengthIOPS;
3838 guint16 u16LengthData;
3839  
3840  
3841 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
3842 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
3843 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
3844 return offset;
3845 }
3846  
3847 /* LengthIOCS */
3848 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
3849 hf_pn_io_length_iocs, &u8LengthIOCS);
3850 /* IOCS */
3851 offset = dissect_PNIO_IOxS(tvb, offset, pinfo, tree, drep, hf_pn_io_iocs);
3852 /* LengthIOPS */
3853 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
3854 hf_pn_io_length_iops, &u8LengthIOPS);
3855 /* IOPS */
3856 offset = dissect_PNIO_IOxS(tvb, offset, pinfo, tree, drep, hf_pn_io_iops);
3857 /* LengthData */
3858 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
3859 hf_pn_io_length_data, &u16LengthData);
3860 /* Data */
3861 offset = dissect_pn_user_data(tvb, offset, pinfo, tree, u16LengthData, "Data");
3862  
3863 return offset;
3864 }
3865  
3866  
3867 /* dissect the RecordOutputDataObjectElement block */
3868 static int
3869 dissect_RecordOutputDataObjectElement_block(tvbuff_t *tvb, int offset,
3870 packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
3871 {
3872 guint16 u16SubstituteActiveFlag;
3873 guint8 u8LengthIOCS;
3874 guint8 u8LengthIOPS;
3875 guint16 u16LengthData;
3876 guint16 u16Index = 0;
3877 guint32 u32RecDataLen;
3878 pnio_ar_t *ar = NULL;
3879  
3880  
3881 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
3882 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
3883 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
3884 return offset;
3885 }
3886  
3887 /* SubstituteActiveFlag */
3888 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
3889 hf_pn_io_substitute_active_flag, &u16SubstituteActiveFlag);
3890  
3891 /* LengthIOCS */
3892 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
3893 hf_pn_io_length_iocs, &u8LengthIOCS);
3894 /* LengthIOPS */
3895 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
3896 hf_pn_io_length_iops, &u8LengthIOPS);
3897 /* LengthData */
3898 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
3899 hf_pn_io_length_data, &u16LengthData);
3900 /* DataItem (IOCS, Data, IOPS) */
3901 offset = dissect_PNIO_IOxS(tvb, offset, pinfo, tree, drep, hf_pn_io_iocs);
3902  
3903 offset = dissect_pn_user_data(tvb, offset, pinfo, tree, u16LengthData, "Data");
3904  
3905 offset = dissect_PNIO_IOxS(tvb, offset, pinfo, tree, drep, hf_pn_io_iops);
3906  
3907 /* SubstituteValue */
3908 offset = dissect_block(tvb, offset, pinfo, tree, drep, &u16Index, &u32RecDataLen, &ar);
3909  
3910 return offset;
3911 }
3912  
3913  
3914 /* dissect the alarm acknowledge block */
3915 static int
3916 dissect_Alarm_ack_block(tvbuff_t *tvb, int offset,
3917 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
3918 {
3919 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
3920 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
3921 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
3922 return offset;
3923 }
3924  
3925 col_append_str(pinfo->cinfo, COL_INFO, ", Alarm Ack");
3926  
3927 offset = dissect_Alarm_header(tvb, offset, pinfo, tree, item, drep);
3928  
3929 offset = dissect_Alarm_specifier(tvb, offset, pinfo, tree, drep);
3930  
3931 offset = dissect_PNIO_status(tvb, offset, pinfo, tree, drep);
3932  
3933 return offset;
3934 }
3935  
3936  
3937 /* dissect the maintenance block */
3938 static int
3939 dissect_Maintenance_block(tvbuff_t *tvb, int offset,
3940 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
3941 {
3942 proto_item *sub_item;
3943 proto_tree *sub_tree;
3944 guint32 u32MaintenanceStatus;
3945  
3946  
3947 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
3948 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
3949 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
3950 return offset;
3951 }
3952  
3953 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
3954  
3955 sub_item = proto_tree_add_item(tree, hf_pn_io_maintenance_status, tvb, offset, 4, ENC_BIG_ENDIAN);
3956 sub_tree = proto_item_add_subtree(sub_item, ett_pn_io_maintenance_status);
3957  
3958 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
3959 hf_pn_io_maintenance_status_demanded, &u32MaintenanceStatus);
3960 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
3961 hf_pn_io_maintenance_status_required, &u32MaintenanceStatus);
3962  
3963 if (u32MaintenanceStatus & 0x0002) {
3964 proto_item_append_text(item, ", Demanded");
3965 proto_item_append_text(sub_item, ", Demanded");
3966 }
3967  
3968 if (u32MaintenanceStatus & 0x0001) {
3969 proto_item_append_text(item, ", Required");
3970 proto_item_append_text(sub_item, ", Required");
3971 }
3972  
3973 return offset;
3974 }
3975  
3976  
3977 /* dissect the read/write header */
3978 static int
3979 dissect_ReadWrite_header(tvbuff_t *tvb, int offset,
3980 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint16 *u16Index, e_guid_t *aruuid)
3981 {
3982 guint32 u32Api;
3983 guint16 u16SlotNr;
3984 guint16 u16SubslotNr;
3985 guint16 u16SeqNr;
3986  
3987 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
3988 hf_pn_io_seq_number, &u16SeqNr);
3989  
3990 offset = dissect_dcerpc_uuid_t(tvb, offset, pinfo, tree, drep,
3991 hf_pn_io_ar_uuid, aruuid);
3992  
3993 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
3994 hf_pn_io_api, &u32Api);
3995 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
3996 hf_pn_io_slot_nr, &u16SlotNr);
3997 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
3998 hf_pn_io_subslot_nr, &u16SubslotNr);
3999 /* padding doesn't match offset required for align4 */
4000 offset = dissect_pn_padding(tvb, offset, pinfo, tree, 2);
4001 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
4002 hf_pn_io_index, u16Index);
4003  
4004 proto_item_append_text(item, ": Seq:%u, Api:0x%x, Slot:0x%x/0x%x",
4005 u16SeqNr, u32Api, u16SlotNr, u16SubslotNr);
4006  
4007 col_append_fstr(pinfo->cinfo, COL_INFO, ", Api:0x%x, Slot:0x%x/0x%x, Index:%s",
4008 u32Api, u16SlotNr, u16SubslotNr,
4009 val_to_str(*u16Index, pn_io_index, "(0x%x)"));
4010  
4011 return offset;
4012 }
4013  
4014  
4015 /* dissect the write request block */
4016 static int
4017 dissect_IODWriteReqHeader_block(tvbuff_t *tvb, int offset,
4018 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow,
4019 guint16 *u16Index, guint32 *u32RecDataLen, pnio_ar_t ** ar)
4020 {
4021 e_guid_t aruuid;
4022 e_guid_t null_uuid;
4023  
4024 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
4025 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
4026 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
4027 return offset;
4028 }
4029  
4030 offset = dissect_ReadWrite_header(tvb, offset, pinfo, tree, item, drep, u16Index, &aruuid);
4031  
4032 *ar = pnio_ar_find_by_aruuid(pinfo, &aruuid);
4033 if (*ar == NULL) {
4034 expert_add_info_format(pinfo, item, &ei_pn_io_ar_info_not_found, "IODWriteReq: AR information not found!");
4035 }
4036  
4037 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
4038 hf_pn_io_record_data_length, u32RecDataLen);
4039  
4040 memset(&null_uuid, 0, sizeof(e_guid_t));
4041 if (memcmp(&aruuid, &null_uuid, sizeof (e_guid_t)) == 0) {
4042 offset = dissect_dcerpc_uuid_t(tvb, offset, pinfo, tree, drep,
4043 hf_pn_io_target_ar_uuid, &aruuid);
4044 }
4045  
4046 offset = dissect_pn_padding(tvb, offset, pinfo, tree, 24);
4047  
4048 proto_item_append_text(item, ", Len:%u", *u32RecDataLen);
4049  
4050 if (*u32RecDataLen != 0)
4051 col_append_fstr(pinfo->cinfo, COL_INFO, ", %u bytes",
4052 *u32RecDataLen);
4053  
4054 return offset;
4055 }
4056  
4057  
4058 /* dissect the read request block */
4059 static int
4060 dissect_IODReadReqHeader_block(tvbuff_t *tvb, int offset,
4061 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow,
4062 guint16 *u16Index, guint32 *u32RecDataLen, pnio_ar_t **ar)
4063 {
4064 e_guid_t aruuid;
4065 e_guid_t null_uuid;
4066  
4067 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
4068 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
4069 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
4070 return offset;
4071 }
4072  
4073 offset = dissect_ReadWrite_header(tvb, offset, pinfo, tree, item, drep, u16Index, &aruuid);
4074  
4075 *ar = pnio_ar_find_by_aruuid(pinfo, &aruuid);
4076 if (*ar == NULL) {
4077 expert_add_info_format(pinfo, item, &ei_pn_io_ar_info_not_found, "IODReadReq: AR information not found!");
4078 }
4079  
4080 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
4081 hf_pn_io_record_data_length, u32RecDataLen);
4082  
4083 memset(&null_uuid, 0, sizeof(e_guid_t));
4084 if (memcmp(&aruuid, &null_uuid, sizeof (e_guid_t)) == 0) {
4085 offset = dissect_dcerpc_uuid_t(tvb, offset, pinfo, tree, drep,
4086 hf_pn_io_target_ar_uuid, &aruuid);
4087 offset = dissect_pn_padding(tvb, offset, pinfo, tree, 8);
4088 } else {
4089 offset = dissect_pn_padding(tvb, offset, pinfo, tree, 24);
4090 }
4091  
4092 proto_item_append_text(item, ", Len:%u", *u32RecDataLen);
4093  
4094 if (*u32RecDataLen != 0)
4095 col_append_fstr(pinfo->cinfo, COL_INFO, ", %u bytes",
4096 *u32RecDataLen);
4097  
4098 return offset;
4099 }
4100  
4101  
4102 /* dissect the write response block */
4103 static int
4104 dissect_IODWriteResHeader_block(tvbuff_t *tvb, int offset,
4105 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow,
4106 guint16 *u16Index, guint32 *u32RecDataLen, pnio_ar_t **ar)
4107 {
4108 e_guid_t aruuid;
4109 guint16 u16AddVal1;
4110 guint16 u16AddVal2;
4111 guint32 u32Status;
4112  
4113  
4114 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
4115 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
4116 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
4117 return offset;
4118 }
4119  
4120 offset = dissect_ReadWrite_header(tvb, offset, pinfo, tree, item, drep, u16Index, &aruuid);
4121  
4122 *ar = pnio_ar_find_by_aruuid(pinfo, &aruuid);
4123 if (*ar == NULL) {
4124 expert_add_info_format(pinfo, item, &ei_pn_io_ar_info_not_found, "IODWriteRes: AR information not found!");
4125 }
4126  
4127 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
4128 hf_pn_io_record_data_length, u32RecDataLen);
4129  
4130 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
4131 hf_pn_io_add_val1, &u16AddVal1);
4132  
4133 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
4134 hf_pn_io_add_val2, &u16AddVal2);
4135  
4136 u32Status = ((drep[0] & DREP_LITTLE_ENDIAN)
4137 ? tvb_get_letohl (tvb, offset)
4138 : tvb_get_ntohl (tvb, offset));
4139  
4140 offset = dissect_PNIO_status(tvb, offset, pinfo, tree, drep);
4141  
4142 offset = dissect_pn_padding(tvb, offset, pinfo, tree, 16);
4143  
4144 proto_item_append_text(item, ", Len:%u, Index:0x%x, Status:0x%x, Val1:%u, Val2:%u",
4145 *u32RecDataLen, *u16Index, u32Status, u16AddVal1, u16AddVal2);
4146  
4147 if (*u32RecDataLen != 0)
4148 col_append_fstr(pinfo->cinfo, COL_INFO, ", %u bytes",
4149 *u32RecDataLen);
4150  
4151 return offset;
4152 }
4153  
4154  
4155 /* dissect the read response block */
4156 static int
4157 dissect_IODReadResHeader_block(tvbuff_t *tvb, int offset,
4158 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow,
4159 guint16 *u16Index, guint32 *u32RecDataLen, pnio_ar_t **ar)
4160 {
4161 e_guid_t aruuid;
4162 guint16 u16AddVal1;
4163 guint16 u16AddVal2;
4164  
4165  
4166 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
4167 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
4168 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
4169 return offset;
4170 }
4171  
4172 offset = dissect_ReadWrite_header(tvb, offset, pinfo, tree, item, drep, u16Index, &aruuid);
4173  
4174 *ar = pnio_ar_find_by_aruuid(pinfo, &aruuid);
4175 if (*ar == NULL) {
4176 expert_add_info_format(pinfo, item, &ei_pn_io_ar_info_not_found, "IODReadRes: AR information not found!");
4177 }
4178  
4179 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
4180 hf_pn_io_record_data_length, u32RecDataLen);
4181  
4182 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
4183 hf_pn_io_add_val1, &u16AddVal1);
4184  
4185 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
4186 hf_pn_io_add_val2, &u16AddVal2);
4187  
4188 offset = dissect_pn_padding(tvb, offset, pinfo, tree, 20);
4189  
4190 proto_item_append_text(item, ", Len:%u, AddVal1:%u, AddVal2:%u",
4191 *u32RecDataLen, u16AddVal1, u16AddVal2);
4192  
4193 if (*u32RecDataLen != 0)
4194 col_append_fstr(pinfo->cinfo, COL_INFO, ", %u bytes",
4195 *u32RecDataLen);
4196  
4197 return offset;
4198 }
4199  
4200  
4201 /* dissect the control/connect block */
4202 static int
4203 dissect_ControlConnect_block(tvbuff_t *tvb, int offset,
4204 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow,
4205 pnio_ar_t **ar)
4206 {
4207 e_guid_t ar_uuid;
4208 guint16 u16SessionKey;
4209 proto_item *sub_item;
4210 proto_tree *sub_tree;
4211 guint16 u16Command;
4212 guint16 u16Properties;
4213  
4214  
4215 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
4216 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
4217 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
4218 return offset;
4219 }
4220  
4221 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
4222 hf_pn_io_reserved16, NULL);
4223  
4224 offset = dissect_dcerpc_uuid_t(tvb, offset, pinfo, tree, drep,
4225 hf_pn_io_ar_uuid, &ar_uuid);
4226  
4227 *ar = pnio_ar_find_by_aruuid(pinfo, &ar_uuid);
4228 if (*ar == NULL) {
4229 expert_add_info_format(pinfo, item, &ei_pn_io_ar_info_not_found, "ControlConnect: AR information not found!");
4230 }
4231  
4232 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
4233 hf_pn_io_sessionkey, &u16SessionKey);
4234  
4235 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
4236 hf_pn_io_reserved16, NULL);
4237  
4238 sub_item = proto_tree_add_item(tree, hf_pn_io_control_command, tvb, offset, 2, ENC_BIG_ENDIAN);
4239 sub_tree = proto_item_add_subtree(sub_item, ett_pn_io_control_command);
4240  
4241 dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
4242 hf_pn_io_control_command_prmend, &u16Command);
4243 dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
4244 hf_pn_io_control_command_applready, &u16Command);
4245 dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
4246 hf_pn_io_control_command_release, &u16Command);
4247 dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
4248 hf_pn_io_control_command_done, &u16Command);
4249 dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
4250 hf_pn_io_control_command_ready_for_companion, &u16Command);
4251 dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
4252 hf_pn_io_control_command_ready_for_rt_class3, &u16Command);
4253 /* Prm.Begin */
4254 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
4255 hf_pn_io_control_command_prmbegin, &u16Command);
4256  
4257 if (u16Command & 0x0002) {
4258 /* ApplicationReady: special decode */
4259 sub_item = proto_tree_add_item(tree, hf_pn_io_control_block_properties_applready, tvb, offset, 2, ENC_BIG_ENDIAN);
4260 sub_tree = proto_item_add_subtree(sub_item, ett_pn_io_control_block_properties);
4261 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
4262 hf_pn_io_control_block_properties_applready0, &u16Properties);
4263 } else {
4264 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
4265 hf_pn_io_control_block_properties, &u16Properties);
4266 }
4267  
4268 proto_item_append_text(item, ": Session:%u, Command:", u16SessionKey);
4269  
4270 if (u16Command & 0x0001) {
4271 proto_item_append_text(sub_item, ", ParameterEnd");
4272 proto_item_append_text(item, " ParameterEnd");
4273 col_append_str(pinfo->cinfo, COL_INFO, ", Command: ParameterEnd");
4274 }
4275 if (u16Command & 0x0002) {
4276 proto_item_append_text(sub_item, ", ApplicationReady");
4277 proto_item_append_text(item, " ApplicationReady");
4278 col_append_str(pinfo->cinfo, COL_INFO, ", Command: ApplicationReady");
4279 }
4280 if (u16Command & 0x0004) {
4281 proto_item_append_text(sub_item, ", Release");
4282 proto_item_append_text(item, " Release");
4283 col_append_str(pinfo->cinfo, COL_INFO, ", Command: Release");
4284 }
4285 if (u16Command & 0x0008) {
4286 proto_item_append_text(sub_item, ", Done");
4287 proto_item_append_text(item, ", Done");
4288 col_append_str(pinfo->cinfo, COL_INFO, ", Command: Done");
4289 }
4290  
4291 proto_item_append_text(item, ", Properties:0x%x", u16Properties);
4292  
4293 return offset;
4294 }
4295  
4296 /* dissect the ControlBlockPrmBegin block */
4297 static int
4298 dissect_ControlBlockPrmBegin(tvbuff_t *tvb, int offset,
4299 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow, guint32 u32RecDataLen,
4300 pnio_ar_t **ar)
4301 {
4302 e_guid_t ar_uuid;
4303 guint16 u16SessionKey;
4304 guint16 u16Command;
4305 proto_item *sub_item;
4306 proto_tree *sub_tree;
4307  
4308 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
4309 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
4310 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
4311 return offset;
4312 }
4313 if (u32RecDataLen != 28-2) /* must be 28 see specification (version already dissected) */
4314 {
4315 expert_add_info_format(pinfo, item, &ei_pn_io_block_length, "Block length of %u is invalid!", u32RecDataLen);
4316 return offset;
4317 }
4318 offset = dissect_pn_padding(tvb, offset, pinfo, tree, 2);
4319  
4320 /* ARUUID */
4321 offset = dissect_dcerpc_uuid_t(tvb, offset, pinfo, tree, drep, hf_pn_io_ar_uuid, &ar_uuid);
4322  
4323 *ar = pnio_ar_find_by_aruuid(pinfo, &ar_uuid);
4324 if (*ar == NULL) {
4325 expert_add_info_format(pinfo, item, &ei_pn_io_ar_info_not_found, "ControlBlockPrmBegin: AR information not found! (partial capture?)");
4326 }
4327 /* SessionKey */
4328 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep, hf_pn_io_sessionkey, &u16SessionKey);
4329  
4330 offset = dissect_pn_padding(tvb, offset, pinfo, tree, 2);
4331  
4332 /* ControlCommand */
4333 sub_item = proto_tree_add_item(tree, hf_pn_io_control_command, tvb, offset, 2, ENC_BIG_ENDIAN);
4334 sub_tree = proto_item_add_subtree(sub_item, ett_pn_io_control_command);
4335  
4336 dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
4337 hf_pn_io_control_command_prmend, &u16Command);
4338 dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
4339 hf_pn_io_control_command_applready, &u16Command);
4340 dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
4341 hf_pn_io_control_command_release, &u16Command);
4342 dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
4343 hf_pn_io_control_command_done, &u16Command);
4344 dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
4345 hf_pn_io_control_command_ready_for_companion, &u16Command);
4346 dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
4347 hf_pn_io_control_command_ready_for_rt_class3, &u16Command);
4348 /* Prm.Begin */
4349 dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
4350 hf_pn_io_control_command_prmbegin, &u16Command);
4351  
4352 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
4353 hf_pn_io_control_command_reserved_7_15, &u16Command);
4354  
4355 /* ControlBlockProperties.reserved */
4356 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep, hf_pn_io_control_command_reserved, NULL);
4357 return offset;
4358 }
4359  
4360 /* dissect the SubmoduleListBlock block */
4361 static int
4362 dissect_SubmoduleListBlock(tvbuff_t *tvb, int offset,
4363 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow, guint32 u32RecDataLen _U_,
4364 pnio_ar_t **ar _U_)
4365 {
4366 guint16 u16Entries;
4367 guint32 u32API;
4368 guint16 u16SlotNumber;
4369 guint16 u16SubSlotNumber;
4370  
4371 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
4372 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
4373 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
4374 return offset;
4375 }
4376  
4377 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep, hf_pn_io_SubmoduleListEntries, &u16Entries);
4378  
4379 while (u16Entries --)
4380 {
4381 /*API */
4382 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep, hf_pn_io_api, &u32API);
4383 /*SlotNumber */
4384 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep, hf_pn_io_slot_nr, &u16SlotNumber);
4385 /* SubSlotNumber */
4386 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep, hf_pn_io_subslot_nr, &u16SubSlotNumber);
4387 }
4388 return offset;
4389 }
4390  
4391  
4392 /* dissect the PDevData block */
4393 static int
4394 dissect_PDevData_block(tvbuff_t *tvb, int offset,
4395 packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
4396 {
4397  
4398 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
4399 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
4400 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
4401 return offset;
4402 }
4403  
4404 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
4405  
4406 offset = dissect_blocks(tvb, offset, pinfo, tree, drep);
4407  
4408 return offset;
4409 }
4410  
4411 /* dissect the AdjustPreambleLength block */
4412 static int
4413 dissect_AdjustPreambleLength_block(tvbuff_t *tvb, int offset,
4414 packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
4415 {
4416 guint16 u16AdjustProperties;
4417 guint16 u16PreambleLength;
4418  
4419 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
4420 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
4421 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
4422 return offset;
4423 }
4424  
4425 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
4426  
4427 /* PreambleLength */
4428 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
4429 hf_pn_io_PreambleLength, &u16PreambleLength);
4430  
4431  
4432 /* AdjustProperties */
4433 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
4434 hf_pn_io_adjust_properties, &u16AdjustProperties);
4435  
4436 return offset;
4437 }
4438  
4439 /* dissect the PDPortDataAdjust block */
4440 static int
4441 dissect_PDPortData_Adjust_block(tvbuff_t *tvb, int offset,
4442 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow,
4443 guint16 u16BodyLength)
4444 {
4445 guint16 u16SlotNr;
4446 guint16 u16SubslotNr;
4447 tvbuff_t *new_tvb;
4448  
4449  
4450 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
4451 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
4452 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
4453 return offset;
4454 }
4455  
4456 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
4457  
4458 /* SlotNumber */
4459 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
4460 hf_pn_io_slot_nr, &u16SlotNr);
4461 /* Subslotnumber */
4462 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
4463 hf_pn_io_subslot_nr, &u16SubslotNr);
4464  
4465 proto_item_append_text(item, ": Slot:0x%x/0x%x", u16SlotNr, u16SubslotNr);
4466  
4467 u16BodyLength -= 6;
4468  
4469 new_tvb = tvb_new_subset_length(tvb, offset, u16BodyLength);
4470 dissect_blocks(new_tvb, 0, pinfo, tree, drep);
4471 offset += u16BodyLength;
4472  
4473 /* XXX - do we have to free the new_tvb somehow? */
4474  
4475 return offset;
4476 }
4477  
4478  
4479 /* dissect the PDPortDataCheck blocks */
4480 static int
4481 dissect_PDPortData_Check_block(tvbuff_t *tvb, int offset,
4482 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow,
4483 guint16 u16BodyLength)
4484 {
4485 guint16 u16SlotNr;
4486 guint16 u16SubslotNr;
4487 tvbuff_t *new_tvb;
4488  
4489  
4490 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
4491 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
4492 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
4493 return offset;
4494 }
4495  
4496 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
4497  
4498 /* SlotNumber */
4499 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
4500 hf_pn_io_slot_nr, &u16SlotNr);
4501 /* Subslotnumber */
4502 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
4503 hf_pn_io_subslot_nr, &u16SubslotNr);
4504  
4505 proto_item_append_text(item, ": Slot:0x%x/0x%x", u16SlotNr, u16SubslotNr);
4506  
4507 u16BodyLength -= 6;
4508  
4509 new_tvb = tvb_new_subset_length(tvb, offset, u16BodyLength);
4510 dissect_blocks(new_tvb, 0, pinfo, tree, drep);
4511 offset += u16BodyLength;
4512  
4513 /* XXX - do we have to free the new_tvb somehow? */
4514  
4515 return offset;
4516 }
4517  
4518  
4519 /* dissect the PDPortDataReal blocks */
4520 static int
4521 dissect_PDPortDataReal_block(tvbuff_t *tvb, int offset,
4522 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
4523 {
4524 guint16 u16SlotNr;
4525 guint16 u16SubslotNr;
4526 guint8 u8LengthOwnPortID;
4527 char *pOwnPortID;
4528 guint8 u8NumberOfPeers;
4529 guint8 u8I;
4530 guint8 u8LengthPeerPortID;
4531 char *pPeerPortID;
4532 guint8 u8LengthPeerChassisID;
4533 char *pPeerChassisID;
4534 guint32 u32LineDelay;
4535 guint8 mac[6];
4536 guint16 u16MAUType;
4537 guint32 u32DomainBoundary;
4538 guint32 u32MulticastBoundary;
4539 guint16 u16PortState;
4540 guint32 u32MediaType;
4541  
4542  
4543 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
4544 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
4545 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
4546 return offset;
4547 }
4548  
4549 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
4550  
4551 /* SlotNumber */
4552 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
4553 hf_pn_io_slot_nr, &u16SlotNr);
4554 /* Subslotnumber */
4555 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
4556 hf_pn_io_subslot_nr, &u16SubslotNr);
4557  
4558 /* LengthOwnPortID */
4559 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
4560 hf_pn_io_length_own_port_id, &u8LengthOwnPortID);
4561 /* OwnPortID */
4562 pOwnPortID = (char *)wmem_alloc(wmem_packet_scope(), u8LengthOwnPortID+1);
4563 tvb_memcpy(tvb, (guint8 *) pOwnPortID, offset, u8LengthOwnPortID);
4564 pOwnPortID[u8LengthOwnPortID] = '\0';
4565 proto_tree_add_string (tree, hf_pn_io_own_port_id, tvb, offset, u8LengthOwnPortID, pOwnPortID);
4566 offset += u8LengthOwnPortID;
4567  
4568 /* NumberOfPeers */
4569 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
4570 hf_pn_io_number_of_peers, &u8NumberOfPeers);
4571 /* Padding */
4572 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
4573  
4574 u8I = u8NumberOfPeers;
4575 while (u8I--) {
4576 /* LengthPeerPortID */
4577 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
4578 hf_pn_io_length_peer_port_id, &u8LengthPeerPortID);
4579 /* PeerPortID */
4580 pPeerPortID = (char *)wmem_alloc(wmem_packet_scope(), u8LengthPeerPortID+1);
4581 tvb_memcpy(tvb, (guint8 *) pPeerPortID, offset, u8LengthPeerPortID);
4582 pPeerPortID[u8LengthPeerPortID] = '\0';
4583 proto_tree_add_string (tree, hf_pn_io_peer_port_id, tvb, offset, u8LengthPeerPortID, pPeerPortID);
4584 offset += u8LengthPeerPortID;
4585  
4586 /* LengthPeerChassisID */
4587 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
4588 hf_pn_io_length_peer_chassis_id, &u8LengthPeerChassisID);
4589 /* PeerChassisID */
4590 pPeerChassisID = (char *)wmem_alloc(wmem_packet_scope(), u8LengthPeerChassisID+1);
4591 tvb_memcpy(tvb, (guint8 *) pPeerChassisID, offset, u8LengthPeerChassisID);
4592 pPeerChassisID[u8LengthPeerChassisID] = '\0';
4593 proto_tree_add_string (tree, hf_pn_io_peer_chassis_id, tvb, offset, u8LengthPeerChassisID, pPeerChassisID);
4594 offset += u8LengthPeerChassisID;
4595  
4596 /* Padding */
4597 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
4598  
4599 /* LineDelay */
4600 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
4601 hf_pn_io_line_delay, &u32LineDelay);
4602  
4603 /* PeerMACAddress */
4604 offset = dissect_pn_mac(tvb, offset, pinfo, tree,
4605 hf_pn_io_peer_macadd, mac);
4606 /* Padding */
4607 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
4608 }
4609  
4610 /* MAUType */
4611 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
4612 hf_pn_io_mau_type, &u16MAUType);
4613 /* Padding */
4614 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
4615  
4616 /* DomainBoundary */
4617 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
4618 hf_pn_io_domain_boundary, &u32DomainBoundary);
4619 /* MulticastBoundary */
4620 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
4621 hf_pn_io_multicast_boundary, &u32MulticastBoundary);
4622 /* PortState */
4623 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
4624 hf_pn_io_port_state, &u16PortState);
4625 /* Padding */
4626 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
4627  
4628 /* MediaType */
4629 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
4630 hf_pn_io_media_type, &u32MediaType);
4631  
4632 proto_item_append_text(item, ": Slot:0x%x/0x%x, OwnPortID:%s, Peers:%u PortState:%s MediaType:%s",
4633 u16SlotNr, u16SubslotNr, pOwnPortID, u8NumberOfPeers,
4634 val_to_str(u16PortState, pn_io_port_state, "0x%x"),
4635 val_to_str(u32MediaType, pn_io_media_type, "0x%x"));
4636  
4637 return offset;
4638 }
4639  
4640  
4641 static int
4642 dissect_PDInterfaceMrpDataAdjust_block(tvbuff_t *tvb, int offset,
4643 packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow, guint16 u16BodyLength)
4644 {
4645 e_guid_t uuid;
4646 guint16 u16Role;
4647 guint8 u8LengthDomainName;
4648 guint8 u8NumberOfMrpInstances;
4649 char *pDomainName;
4650 int iStartOffset = offset;
4651  
4652  
4653 if (u8BlockVersionHigh != 1 || u8BlockVersionLow > 1) { /* added low version == 1 */
4654 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
4655 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
4656 return offset;
4657 }
4658  
4659 if (u8BlockVersionLow == 0) /*dissect LowVersion == 0 */
4660 {
4661 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
4662  
4663 /* MRP_DomainUUID */
4664 offset = dissect_dcerpc_uuid_t(tvb, offset, pinfo, tree, drep,
4665 hf_pn_io_mrp_domain_uuid, &uuid);
4666 /* MRP_Role */
4667 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
4668 hf_pn_io_mrp_role, &u16Role);
4669 /* Padding */
4670 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
4671  
4672 /* MRP_LengthDomainName */
4673 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
4674 hf_pn_io_mrp_length_domain_name, &u8LengthDomainName);
4675 /* MRP_DomainName */
4676 pDomainName = (char *)wmem_alloc(wmem_packet_scope(), u8LengthDomainName+1);
4677 tvb_memcpy(tvb, (guint8 *) pDomainName, offset, u8LengthDomainName);
4678 pDomainName[u8LengthDomainName] = '\0';
4679 proto_tree_add_string (tree, hf_pn_io_mrp_domain_name, tvb, offset, u8LengthDomainName, pDomainName);
4680 offset += u8LengthDomainName;
4681  
4682 /* Padding */
4683 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
4684 if ((offset - iStartOffset) < u16BodyLength)
4685 {
4686 offset = dissect_blocks(tvb, offset, pinfo, tree, drep);
4687 }
4688 }
4689 else if (u8BlockVersionLow == 1) /*dissect LowVersion == 1 */
4690 {
4691 /* Padding one byte */
4692 offset = dissect_pn_padding(tvb, offset, pinfo, tree, 1);
4693 /* Number of Mrp Instances */
4694 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
4695 hf_pn_io_mrp_instances, &u8NumberOfMrpInstances);
4696 if (u8NumberOfMrpInstances > 0xf) {
4697 expert_add_info_format(pinfo, item, &ei_pn_io_mrp_instances, "Number of MrpInstances greater 0x0f is (0x%x)", u8NumberOfMrpInstances);
4698 return offset;
4699 }
4700 while(u8NumberOfMrpInstances > 0)
4701 {
4702 offset = dissect_a_block(tvb, offset, pinfo, tree, drep);
4703 u8NumberOfMrpInstances--;
4704 }
4705 }
4706 return offset;
4707 }
4708  
4709  
4710 static int
4711 dissect_PDInterfaceMrpDataReal_block(tvbuff_t *tvb, int offset,
4712 packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow, guint16 u16BodyLength)
4713 {
4714 e_guid_t uuid;
4715 guint16 u16Role;
4716 guint16 u16Version;
4717 guint8 u8LengthDomainName;
4718 guint8 u8NumberOfMrpInstances;
4719 char *pDomainName;
4720 int endoffset = offset + u16BodyLength;
4721  
4722 /* added blockversion 1 */
4723 if (u8BlockVersionHigh != 1 || u8BlockVersionLow > 2) {
4724 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
4725 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
4726 return offset;
4727 }
4728  
4729 if (u8BlockVersionLow < 2) /* dissect low versions 0 and 1 */
4730 {
4731 /* Padding */
4732 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
4733  
4734 /* MRP_DomainUUID */
4735 offset = dissect_dcerpc_uuid_t(tvb, offset, pinfo, tree, drep,
4736 hf_pn_io_mrp_domain_uuid, &uuid);
4737 /* MRP_Role */
4738 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
4739 hf_pn_io_mrp_role, &u16Role);
4740  
4741 if (u8BlockVersionLow == 1) {
4742 /* MRP_Version */
4743 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
4744 hf_pn_io_mrp_version, &u16Version);
4745 }
4746 /* MRP_LengthDomainName */
4747 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
4748 hf_pn_io_mrp_length_domain_name, &u8LengthDomainName);
4749 /* MRP_DomainName */
4750 pDomainName = (char *)wmem_alloc(wmem_packet_scope(), u8LengthDomainName+1);
4751 tvb_memcpy(tvb, (guint8 *) pDomainName, offset, u8LengthDomainName);
4752 pDomainName[u8LengthDomainName] = '\0';
4753 proto_tree_add_string (tree, hf_pn_io_mrp_domain_name, tvb, offset, u8LengthDomainName, pDomainName);
4754 offset += u8LengthDomainName;
4755  
4756 if (u8BlockVersionLow == 0) {
4757 /* MRP_Version */
4758 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
4759 hf_pn_io_mrp_version, &u16Version);
4760 }
4761 /* Padding */
4762 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
4763  
4764 while(endoffset > offset)
4765 {
4766 offset = dissect_a_block(tvb, offset, pinfo, tree, drep);
4767 }
4768 }
4769 else if (u8BlockVersionLow == 2)
4770 {
4771 /* Padding one byte */
4772 offset = dissect_pn_padding(tvb, offset, pinfo, tree, 1);
4773 /* Number of Mrp Instances */
4774 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
4775 hf_pn_io_mrp_instances, &u8NumberOfMrpInstances);
4776 if (u8NumberOfMrpInstances > 0xf) {
4777 expert_add_info_format(pinfo, item, &ei_pn_io_mrp_instances, "Number of MrpInstances greater 0x0f is (0x%x)", u8NumberOfMrpInstances);
4778 return offset;
4779 }
4780 while(u8NumberOfMrpInstances > 0)
4781 {
4782 offset = dissect_a_block(tvb, offset, pinfo, tree, drep);
4783 u8NumberOfMrpInstances--;
4784 }
4785 }
4786 return offset;
4787 }
4788  
4789  
4790 static int
4791 dissect_PDInterfaceMrpDataCheck_block(tvbuff_t *tvb, int offset,
4792 packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
4793 {
4794 e_guid_t uuid;
4795 guint32 u32Check;
4796 guint8 u8NumberOfMrpInstances;
4797  
4798 /* BlockVersionLow == 1 added */
4799 if (u8BlockVersionHigh != 1 || u8BlockVersionLow > 1) {
4800 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
4801 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
4802 return offset;
4803 }
4804 if (u8BlockVersionLow == 0)
4805 {
4806 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
4807  
4808 /* MRP_DomainUUID */
4809 offset = dissect_dcerpc_uuid_t(tvb, offset, pinfo, tree, drep,
4810 hf_pn_io_mrp_domain_uuid, &uuid);
4811  
4812 /* MRP_Check */
4813 dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
4814 hf_pn_io_mrp_check, &u32Check);
4815 dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
4816 hf_pn_io_mrp_check_mrm, &u32Check);
4817 dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
4818 hf_pn_io_mrp_check_mrpdomain, &u32Check);
4819 dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
4820 hf_pn_io_mrp_check_reserved_1, &u32Check);
4821 dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
4822 hf_pn_io_mrp_check_reserved_2, &u32Check);
4823 offset +=4; /* MRP_Check (32 bit) done */
4824 }
4825 else if (u8BlockVersionLow == 1)
4826 {
4827 /* Padding one byte */
4828 offset = dissect_pn_padding(tvb, offset, pinfo, tree, 1);
4829 /* Number of Mrp Instances */
4830 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
4831 hf_pn_io_mrp_instances, &u8NumberOfMrpInstances);
4832 if (u8NumberOfMrpInstances > 0xf) {
4833 expert_add_info_format(pinfo, item, &ei_pn_io_mrp_instances, "Number of MrpInstances greater 0x0f is (0x%x)", u8NumberOfMrpInstances);
4834 return offset;
4835 }
4836 while(u8NumberOfMrpInstances > 0)
4837 {
4838 offset = dissect_a_block(tvb, offset, pinfo, tree, drep);
4839 u8NumberOfMrpInstances--;
4840 }
4841 }
4842  
4843 return offset;
4844 }
4845  
4846  
4847 static int
4848 dissect_PDPortMrpData_block(tvbuff_t *tvb, int offset,
4849 packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
4850 {
4851 e_guid_t uuid;
4852 guint8 u8MrpInstance;
4853  
4854 /* added BlockVersionLow == 1 */
4855 if (u8BlockVersionHigh != 1 || u8BlockVersionLow > 1) {
4856 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
4857 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
4858 return offset;
4859 }
4860 if (u8BlockVersionLow == 0) {
4861 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
4862 }
4863 else /*if (u8BlockVersionLow == 1) */
4864 {
4865 /* Padding one byte */
4866 offset = dissect_pn_padding(tvb, offset, pinfo, tree, 1);
4867 /* Mrp Instance */
4868 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
4869 hf_pn_io_mrp_instance, &u8MrpInstance);
4870 }
4871 /* MRP_DomainUUID */
4872 offset = dissect_dcerpc_uuid_t(tvb, offset, pinfo, tree, drep,
4873 hf_pn_io_mrp_domain_uuid, &uuid);
4874 return offset;
4875 }
4876  
4877  
4878 static int
4879 dissect_MrpManagerParams_block(tvbuff_t *tvb, int offset,
4880 packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
4881 {
4882 guint16 u16Prio;
4883 guint16 u16TOPchgT;
4884 guint16 u16TOPNRmax;
4885 guint16 u16TSTshortT;
4886 guint16 u16TSTdefaultT;
4887 guint16 u16TSTNRmax;
4888  
4889  
4890 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
4891 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
4892 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
4893 return offset;
4894 }
4895  
4896 /* MRP_Prio */
4897 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
4898 hf_pn_io_mrp_prio, &u16Prio);
4899 /* MRP_TOPchgT */
4900 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
4901 hf_pn_io_mrp_topchgt, &u16TOPchgT);
4902 /* MRP_TOPNRmax */
4903 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
4904 hf_pn_io_mrp_topnrmax, &u16TOPNRmax);
4905 /* MRP_TSTshortT */
4906 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
4907 hf_pn_io_mrp_tstshortt, &u16TSTshortT);
4908 /* MRP_TSTdefaultT */
4909 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
4910 hf_pn_io_mrp_tstdefaultt, &u16TSTdefaultT);
4911 /* MSP_TSTNRmax */
4912 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
4913 hf_pn_io_mrp_tstnrmax, &u16TSTNRmax);
4914 /* Padding */
4915 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
4916  
4917 return offset;
4918 }
4919  
4920  
4921 static int
4922 dissect_MrpRTMode(tvbuff_t *tvb, int offset,
4923 packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint8 *drep)
4924 {
4925 proto_item *sub_item;
4926 proto_tree *sub_tree;
4927 guint32 u32RTMode;
4928  
4929  
4930 /* MRP_RTMode */
4931 sub_item = proto_tree_add_item(tree, hf_pn_io_mrp_rtmode, tvb, offset, 4, ENC_BIG_ENDIAN);
4932 sub_tree = proto_item_add_subtree(sub_item, ett_pn_io_mrp_rtmode);
4933  
4934 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
4935 hf_pn_io_mrp_rtmode_reserved2, &u32RTMode);
4936 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
4937 hf_pn_io_mrp_rtmode_reserved1, &u32RTMode);
4938 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
4939 hf_pn_io_mrp_rtmode_rtclass3, &u32RTMode);
4940 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
4941 hf_pn_io_mrp_rtmode_rtclass12, &u32RTMode);
4942  
4943 return offset;
4944 }
4945  
4946  
4947 static int
4948 dissect_MrpRTModeManagerData_block(tvbuff_t *tvb, int offset,
4949 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
4950 {
4951 guint16 u16TSTNRmax;
4952 guint16 u16TSTdefaultT;
4953  
4954  
4955 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
4956 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
4957 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
4958 return offset;
4959 }
4960  
4961 /* MSP_TSTNRmax */
4962 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
4963 hf_pn_io_mrp_tstnrmax, &u16TSTNRmax);
4964 /* MRP_TSTdefaultT */
4965 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
4966 hf_pn_io_mrp_tstdefaultt, &u16TSTdefaultT);
4967 /* Padding */
4968 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
4969  
4970 /* MRP_RTMode */
4971 offset = dissect_MrpRTMode(tvb, offset, pinfo, tree, item, drep);
4972  
4973 return offset;
4974 }
4975  
4976  
4977 static int
4978 dissect_MrpRingStateData_block(tvbuff_t *tvb, int offset,
4979 packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
4980 {
4981 guint16 u16RingState;
4982  
4983  
4984 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
4985 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
4986 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
4987 return offset;
4988 }
4989  
4990 /* MRP_RingState */
4991 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
4992 hf_pn_io_mrp_ring_state, &u16RingState);
4993  
4994 return offset;
4995 }
4996  
4997  
4998 static int
4999 dissect_MrpRTStateData_block(tvbuff_t *tvb, int offset,
5000 packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
5001 {
5002 guint16 u16RTState;
5003  
5004  
5005 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
5006 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
5007 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
5008 return offset;
5009 }
5010  
5011 /* MRP_RTState */
5012 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
5013 hf_pn_io_mrp_rt_state, &u16RTState);
5014  
5015 return offset;
5016 }
5017  
5018  
5019 static int
5020 dissect_MrpClientParams_block(tvbuff_t *tvb, int offset,
5021 packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
5022 {
5023 guint16 u16MRP_LNKdownT;
5024 guint16 u16MRP_LNKupT;
5025 guint16 u16MRP_LNKNRmax;
5026  
5027  
5028 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
5029 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
5030 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
5031 return offset;
5032 }
5033  
5034 /* MRP_LNKdownT */
5035 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
5036 hf_pn_io_mrp_lnkdownt, &u16MRP_LNKdownT);
5037 /* MRP_LNKupT */
5038 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
5039 hf_pn_io_mrp_lnkupt, &u16MRP_LNKupT);
5040 /* MRP_LNKNRmax u16 */
5041 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
5042 hf_pn_io_mrp_lnknrmax, &u16MRP_LNKNRmax);
5043  
5044 return offset;
5045 }
5046  
5047  
5048 static int
5049 dissect_MrpRTModeClientData_block(tvbuff_t *tvb, int offset,
5050 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
5051 {
5052 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
5053  
5054 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
5055 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
5056 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
5057 return offset;
5058 }
5059  
5060 /* MRP_RTMode */
5061 offset = dissect_MrpRTMode(tvb, offset, pinfo, tree, item, drep);
5062  
5063 return offset;
5064 }
5065  
5066  
5067 static int
5068 dissect_CheckSyncDifference_block(tvbuff_t *tvb, int offset,
5069 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
5070 {
5071 proto_item *sub_item;
5072 proto_tree *sub_tree;
5073 guint16 u16CheckSyncMode;
5074  
5075  
5076 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
5077 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
5078 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
5079 return offset;
5080 }
5081  
5082 sub_item = proto_tree_add_item(tree, hf_pn_io_check_sync_mode, tvb, offset, 2, ENC_BIG_ENDIAN);
5083 sub_tree = proto_item_add_subtree(sub_item, ett_pn_io_check_sync_mode);
5084  
5085 dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
5086 hf_pn_io_check_sync_mode_reserved, &u16CheckSyncMode);
5087 dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
5088 hf_pn_io_check_sync_mode_sync_master, &u16CheckSyncMode);
5089 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
5090 hf_pn_io_check_sync_mode_cable_delay, &u16CheckSyncMode);
5091  
5092  
5093 proto_item_append_text(sub_item, "CheckSyncMode: SyncMaster:%d, CableDelay:%d",
5094 (u16CheckSyncMode >> 1) & 1, u16CheckSyncMode & 1);
5095  
5096 proto_item_append_text(item, " : SyncMaster:%d, CableDelay:%d",
5097 (u16CheckSyncMode >> 1) & 1, u16CheckSyncMode & 1);
5098  
5099 return offset;
5100 }
5101  
5102  
5103 static int
5104 dissect_CheckMAUTypeDifference_block(tvbuff_t *tvb, int offset,
5105 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
5106 {
5107 guint16 u16MAUTypeMode;
5108  
5109 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
5110 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
5111 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
5112 return offset;
5113 }
5114  
5115 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
5116 hf_pn_io_mau_type_mode, &u16MAUTypeMode);
5117  
5118 proto_item_append_text(item, ": MAUTypeMode:%s",
5119 val_to_str(u16MAUTypeMode, pn_io_mau_type_mode, "0x%x"));
5120  
5121 return offset;
5122 }
5123  
5124  
5125 /* dissect the AdjustDomainBoundary blocks */
5126 static int
5127 dissect_AdjustDomainBoundary_block(tvbuff_t *tvb, int offset,
5128 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
5129 {
5130 guint32 u32DomainBoundary;
5131 guint32 u32DomainBoundaryIngress;
5132 guint32 u32DomainBoundaryEgress;
5133 guint16 u16AdjustProperties;
5134  
5135  
5136 if (u8BlockVersionHigh != 1 || (u8BlockVersionLow != 0 && u8BlockVersionLow != 1)) {
5137 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
5138 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
5139 return offset;
5140 }
5141  
5142 /* Padding */
5143 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
5144  
5145 switch (u8BlockVersionLow) {
5146 case(0):
5147 /* DomainBoundary */
5148 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
5149 hf_pn_io_domain_boundary, &u32DomainBoundary);
5150 /* AdjustProperties */
5151 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
5152 hf_pn_io_adjust_properties, &u16AdjustProperties);
5153 /* Padding */
5154 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
5155  
5156 proto_item_append_text(item, ": Boundary:0x%x, Properties:0x%x",
5157 u32DomainBoundary, u16AdjustProperties);
5158  
5159 break;
5160 case(1):
5161 /* DomainBoundaryIngress */
5162 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
5163 hf_pn_io_domain_boundary_ingress, &u32DomainBoundaryIngress);
5164 /* DomainBoundaryEgress */
5165 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
5166 hf_pn_io_domain_boundary_egress, &u32DomainBoundaryEgress);
5167 /* AdjustProperties */
5168 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
5169 hf_pn_io_adjust_properties, &u16AdjustProperties);
5170 /* Padding */
5171 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
5172  
5173 proto_item_append_text(item, ": BoundaryIngress:0x%x, BoundaryEgress:0x%x, Properties:0x%x",
5174 u32DomainBoundaryIngress, u32DomainBoundaryEgress, u16AdjustProperties);
5175  
5176 break;
5177 default:
5178 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
5179 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
5180 return offset;
5181 }
5182  
5183 return offset;
5184 }
5185  
5186  
5187 /* dissect the AdjustMulticastBoundary blocks */
5188 static int
5189 dissect_AdjustMulticastBoundary_block(tvbuff_t *tvb, int offset,
5190 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
5191 {
5192 guint32 u32MulticastBoundary;
5193 guint16 u16AdjustProperties;
5194  
5195  
5196 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
5197 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
5198 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
5199 return offset;
5200 }
5201  
5202 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
5203  
5204 /* Boundary */
5205 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
5206 hf_pn_io_multicast_boundary, &u32MulticastBoundary);
5207 /* AdjustProperties */
5208 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
5209 hf_pn_io_adjust_properties, &u16AdjustProperties);
5210  
5211 proto_item_append_text(item, ": Boundary:0x%x, Properties:0x%x",
5212 u32MulticastBoundary, u16AdjustProperties);
5213  
5214 return offset;
5215 }
5216  
5217  
5218 /* dissect the AdjustMAUType block */
5219 static int
5220 dissect_AdjustMAUType_block(tvbuff_t *tvb, int offset,
5221 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
5222 {
5223 guint16 u16MAUType;
5224 guint16 u16AdjustProperties;
5225  
5226  
5227 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
5228 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
5229 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
5230 return offset;
5231 }
5232  
5233 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
5234  
5235 /* MAUType */
5236 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
5237 hf_pn_io_mau_type, &u16MAUType);
5238 /* AdjustProperties */
5239 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
5240 hf_pn_io_adjust_properties, &u16AdjustProperties);
5241  
5242 proto_item_append_text(item, ": MAUType:%s, Properties:0x%x",
5243 val_to_str(u16MAUType, pn_io_mau_type, "0x%x"),
5244 u16AdjustProperties);
5245  
5246 return offset;
5247 }
5248  
5249  
5250 /* dissect the CheckMAUType block */
5251 static int
5252 dissect_CheckMAUType_block(tvbuff_t *tvb, int offset,
5253 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
5254 {
5255 guint16 u16MAUType;
5256  
5257  
5258 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
5259 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
5260 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
5261 return offset;
5262 }
5263  
5264 /* MAUType */
5265 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
5266 hf_pn_io_mau_type, &u16MAUType);
5267  
5268 proto_item_append_text(item, ": MAUType:%s",
5269 val_to_str(u16MAUType, pn_io_mau_type, "0x%x"));
5270  
5271 return offset;
5272 }
5273  
5274  
5275 /* dissect the CheckLineDelay block */
5276 static int
5277 dissect_CheckLineDelay_block(tvbuff_t *tvb, int offset,
5278 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
5279 {
5280 guint32 u32LineDelay;
5281  
5282  
5283 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
5284 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
5285 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
5286 return offset;
5287 }
5288  
5289 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
5290  
5291 /* LineDelay */
5292 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
5293 hf_pn_io_line_delay, &u32LineDelay);
5294  
5295 proto_item_append_text(item, ": LineDelay:%uns", u32LineDelay);
5296  
5297 return offset;
5298 }
5299  
5300  
5301 /* dissect the CheckPeers block */
5302 static int
5303 dissect_CheckPeers_block(tvbuff_t *tvb, int offset,
5304 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
5305 {
5306 guint8 u8NumberOfPeers;
5307 guint8 u8I;
5308 guint8 u8LengthPeerPortID;
5309 char *pPeerPortID;
5310 guint8 u8LengthPeerChassisID;
5311 char *pPeerChassisID;
5312  
5313  
5314 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
5315 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
5316 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
5317 return offset;
5318 }
5319  
5320 /* NumberOfPeers */
5321 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
5322 hf_pn_io_number_of_peers, &u8NumberOfPeers);
5323  
5324 u8I = u8NumberOfPeers;
5325 while (u8I--) {
5326 /* LengthPeerPortID */
5327 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
5328 hf_pn_io_length_peer_port_id, &u8LengthPeerPortID);
5329 /* PeerPortID */
5330 pPeerPortID = (char *)wmem_alloc(wmem_packet_scope(), u8LengthPeerPortID+1);
5331 tvb_memcpy(tvb, (guint8 *) pPeerPortID, offset, u8LengthPeerPortID);
5332 pPeerPortID[u8LengthPeerPortID] = '\0';
5333 proto_tree_add_string (tree, hf_pn_io_peer_port_id, tvb, offset, u8LengthPeerPortID, pPeerPortID);
5334 offset += u8LengthPeerPortID;
5335  
5336 /* LengthPeerChassisID */
5337 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
5338 hf_pn_io_length_peer_chassis_id, &u8LengthPeerChassisID);
5339 /* PeerChassisID */
5340 pPeerChassisID = (char *)wmem_alloc(wmem_packet_scope(), u8LengthPeerChassisID+1);
5341 tvb_memcpy(tvb, (guint8 *) pPeerChassisID, offset, u8LengthPeerChassisID);
5342 pPeerChassisID[u8LengthPeerChassisID] = '\0';
5343 proto_tree_add_string (tree, hf_pn_io_peer_chassis_id, tvb, offset, u8LengthPeerChassisID, pPeerChassisID);
5344 offset += u8LengthPeerChassisID;
5345 }
5346  
5347 proto_item_append_text(item, ": NumberOfPeers:%u", u8NumberOfPeers);
5348  
5349 return offset;
5350 }
5351  
5352  
5353 /* dissect the AdjustPortState block */
5354 static int
5355 dissect_AdjustPortState_block(tvbuff_t *tvb, int offset,
5356 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
5357 {
5358 guint16 u16PortState;
5359 guint16 u16AdjustProperties;
5360  
5361  
5362 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
5363 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
5364 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
5365 return offset;
5366 }
5367  
5368 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
5369  
5370 /* PortState */
5371 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
5372 hf_pn_io_port_state, &u16PortState);
5373 /* AdjustProperties */
5374 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
5375 hf_pn_io_adjust_properties, &u16AdjustProperties);
5376  
5377 proto_item_append_text(item, ": PortState:%s, Properties:0x%x",
5378 val_to_str(u16PortState, pn_io_port_state, "0x%x"),
5379 u16AdjustProperties);
5380  
5381 return offset;
5382 }
5383  
5384  
5385 /* dissect the CheckPortState block */
5386 static int
5387 dissect_CheckPortState_block(tvbuff_t *tvb, int offset,
5388 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
5389 {
5390 guint16 u16PortState;
5391  
5392  
5393 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
5394 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
5395 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
5396 return offset;
5397 }
5398  
5399 /* PortState */
5400 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
5401 hf_pn_io_port_state, &u16PortState);
5402  
5403 proto_item_append_text(item, ": %s",
5404 val_to_str(u16PortState, pn_io_port_state, "0x%x"));
5405 return offset;
5406 }
5407  
5408  
5409 /* dissect the PDPortFODataReal block */
5410 static int
5411 dissect_PDPortFODataReal_block(tvbuff_t *tvb, int offset,
5412 packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow,
5413 guint16 u16BodyLength)
5414 {
5415 guint32 u32FiberOpticType;
5416 guint32 u32FiberOpticCableType;
5417 guint16 u16Index = 0;
5418 guint32 u32RecDataLen;
5419 pnio_ar_t *ar = NULL;
5420  
5421  
5422 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
5423 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
5424 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
5425 return offset;
5426 }
5427  
5428 /* Padding */
5429 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
5430  
5431 /* FiberOpticType */
5432 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
5433 hf_pn_io_fiber_optic_type, &u32FiberOpticType);
5434  
5435 /* FiberOpticCableType */
5436 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
5437 hf_pn_io_fiber_optic_cable_type, &u32FiberOpticCableType);
5438  
5439 /* optional: FiberOpticManufacturerSpecific */
5440 if (u16BodyLength != 10) {
5441 dissect_block(tvb, offset, pinfo, tree, drep, &u16Index, &u32RecDataLen, &ar);
5442 }
5443  
5444 return offset;
5445 }
5446  
5447  
5448 /* dissect the FiberOpticManufacturerSpecific block */
5449 static int
5450 dissect_FiberOpticManufacturerSpecific_block(tvbuff_t *tvb, int offset,
5451 packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow,
5452 guint16 u16BodyLength)
5453 {
5454 guint8 u8VendorIDHigh;
5455 guint8 u8VendorIDLow;
5456 guint16 u16VendorBlockType;
5457  
5458  
5459 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
5460 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
5461 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
5462 return offset;
5463 }
5464  
5465 /* x8 VendorIDHigh */
5466 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
5467 hf_pn_io_vendor_id_high, &u8VendorIDHigh);
5468 /* x8 VendorIDLow */
5469 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
5470 hf_pn_io_vendor_id_low, &u8VendorIDLow);
5471  
5472 /* VendorBlockType */
5473 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
5474 hf_pn_io_vendor_block_type, &u16VendorBlockType);
5475 /* Data */
5476 offset = dissect_pn_user_data(tvb, offset, pinfo, tree, u16BodyLength-4, "Data");
5477  
5478 return offset;
5479 }
5480  
5481  
5482 /* dissect the FiberOpticDiagnosisInfo block */
5483 static int
5484 dissect_FiberOpticDiagnosisInfo_block(tvbuff_t *tvb, int offset,
5485 packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
5486 {
5487 guint32 u32FiberOpticPowerBudget;
5488  
5489  
5490 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
5491 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
5492 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
5493 return offset;
5494 }
5495  
5496 offset = dissect_pn_padding(tvb, offset, pinfo, tree, 2);
5497  
5498 /* decode the u32FiberOpticPowerBudget better */
5499 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
5500 hf_pn_io_maintenance_required_power_budget, &u32FiberOpticPowerBudget);
5501  
5502 return offset;
5503 }
5504  
5505  
5506 /* dissect the PDPortFODataAdjust block */
5507 static int
5508 dissect_PDPortFODataAdjust_block(tvbuff_t *tvb, int offset,
5509 packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
5510 {
5511 guint32 u32FiberOpticType;
5512 guint32 u32FiberOpticCableType;
5513  
5514  
5515 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
5516 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
5517 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
5518 return offset;
5519 }
5520  
5521 /* Padding */
5522 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
5523  
5524 /* FiberOpticType */
5525 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
5526 hf_pn_io_fiber_optic_type, &u32FiberOpticType);
5527  
5528 /* FiberOpticCableType */
5529 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
5530 hf_pn_io_fiber_optic_cable_type, &u32FiberOpticCableType);
5531  
5532 /*
5533 proto_item_append_text(item, ": %s",
5534 val_to_str(u16PortState, pn_io_port_state, "0x%x"));*/
5535  
5536 return offset;
5537 }
5538  
5539  
5540 /* dissect the PDPortFODataCheck block */
5541 static int
5542 dissect_PDPortFODataCheck_block(tvbuff_t *tvb, int offset,
5543 packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
5544 {
5545 guint32 u32FiberOpticPowerBudget;
5546  
5547  
5548 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
5549 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
5550 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
5551 return offset;
5552 }
5553  
5554 /* Padding */
5555 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
5556  
5557 /* MaintenanceRequiredPowerBudget */
5558 /* XXX - decode the u32FiberOpticPowerBudget better */
5559 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
5560 hf_pn_io_maintenance_required_power_budget, &u32FiberOpticPowerBudget);
5561  
5562 /* MaintenanceDemandedPowerBudget */
5563 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
5564 hf_pn_io_maintenance_demanded_power_budget, &u32FiberOpticPowerBudget);
5565  
5566 /* ErrorPowerBudget */
5567 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
5568 hf_pn_io_error_power_budget, &u32FiberOpticPowerBudget);
5569  
5570 /*
5571 proto_item_append_text(item, ": %s",
5572 val_to_str(u16PortState, pn_io_port_state, "0x%x"));*/
5573  
5574 return offset;
5575 }
5576  
5577 static int
5578 dissect_MrpInstanceDataAdjust_block(tvbuff_t *tvb, int offset,
5579 packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow, guint16 u16BodyLength)
5580 {
5581 guint8 u8MrpInstance;
5582 e_guid_t uuid;
5583 guint16 u16Role;
5584 guint8 u8LengthDomainName;
5585 char* pDomainName;
5586 int endoffset = offset + u16BodyLength;
5587  
5588 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
5589 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
5590 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
5591 return offset;
5592 }
5593 /* Padding one byte */
5594 offset = dissect_pn_padding(tvb, offset, pinfo, tree, 1);
5595 /* Mrp Instance */
5596 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
5597 hf_pn_io_mrp_instance, &u8MrpInstance);
5598 /* MRP_DomainUUID */
5599 offset = dissect_dcerpc_uuid_t(tvb, offset, pinfo, tree, drep,
5600 hf_pn_io_mrp_domain_uuid, &uuid);
5601 /* MRP_Role */
5602 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
5603 hf_pn_io_mrp_role, &u16Role);
5604 /* Padding */
5605 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
5606 /* MRP_LengthDomainName */
5607 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
5608 hf_pn_io_mrp_length_domain_name, &u8LengthDomainName);
5609 /* MRP_DomainName */
5610 pDomainName = (char *)wmem_alloc(wmem_packet_scope(), u8LengthDomainName+1);
5611 tvb_memcpy(tvb, (guint8 *) pDomainName, offset, u8LengthDomainName);
5612 pDomainName[u8LengthDomainName] = '\0';
5613 proto_tree_add_string (tree, hf_pn_io_mrp_domain_name, tvb, offset, u8LengthDomainName, pDomainName);
5614 offset += u8LengthDomainName;
5615 /* Padding */
5616 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
5617 while(endoffset > offset)
5618 {
5619 offset = dissect_a_block(tvb, offset, pinfo, tree, drep);
5620 }
5621  
5622 return offset;
5623 }
5624  
5625 static int
5626 dissect_MrpInstanceDataReal_block(tvbuff_t *tvb, int offset,
5627 packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow, guint16 u16BodyLength)
5628 {
5629 guint8 u8MrpInstance;
5630 e_guid_t uuid;
5631 guint16 u16Role;
5632 guint16 u16Version;
5633 guint8 u8LengthDomainName;
5634 char* pDomainName;
5635 int endoffset = offset + u16BodyLength;
5636  
5637 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
5638 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
5639 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
5640 return offset;
5641 }
5642 /* Padding one byte */
5643 offset = dissect_pn_padding(tvb, offset, pinfo, tree, 1);
5644 /* Mrp Instance */
5645 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
5646 hf_pn_io_mrp_instance, &u8MrpInstance);
5647 /* MRP_DomainUUID */
5648 offset = dissect_dcerpc_uuid_t(tvb, offset, pinfo, tree, drep,
5649 hf_pn_io_mrp_domain_uuid, &uuid);
5650 /* MRP_Role */
5651 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
5652 hf_pn_io_mrp_role, &u16Role);
5653 /* MRP_Version */
5654 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
5655 hf_pn_io_mrp_version, &u16Version);
5656 /* MRP_LengthDomainName */
5657 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
5658 hf_pn_io_mrp_length_domain_name, &u8LengthDomainName);
5659 /* MRP_DomainName */
5660 pDomainName = (char *)wmem_alloc(wmem_packet_scope(), u8LengthDomainName+1);
5661 tvb_memcpy(tvb, (guint8 *) pDomainName, offset, u8LengthDomainName);
5662 pDomainName[u8LengthDomainName] = '\0';
5663 proto_tree_add_string (tree, hf_pn_io_mrp_domain_name, tvb, offset, u8LengthDomainName, pDomainName);
5664 offset += u8LengthDomainName;
5665 /* Padding */
5666 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
5667  
5668 while(endoffset > offset)
5669 {
5670 offset = dissect_a_block(tvb, offset, pinfo, tree, drep);
5671 }
5672 return offset;
5673 }
5674  
5675 static int
5676 dissect_MrpInstanceDataCheck_block(tvbuff_t *tvb, int offset,
5677 packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow, guint16 u16BodyLength _U_)
5678 {
5679 guint8 u8MrpInstance;
5680 guint32 u32Check;
5681 e_guid_t uuid;
5682  
5683 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
5684 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
5685 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
5686 return offset;
5687 }
5688 /* Padding one byte */
5689 offset = dissect_pn_padding(tvb, offset, pinfo, tree, 1);
5690 /* Mrp Instance */
5691 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
5692 hf_pn_io_mrp_instance, &u8MrpInstance);
5693 /* MRP_DomainUUID */
5694 offset = dissect_dcerpc_uuid_t(tvb, offset, pinfo, tree, drep,
5695 hf_pn_io_mrp_domain_uuid, &uuid);
5696  
5697 /* MRP_Check */
5698 dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
5699 hf_pn_io_mrp_check, &u32Check);
5700 dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
5701 hf_pn_io_mrp_check_mrm, &u32Check);
5702 dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
5703 hf_pn_io_mrp_check_mrpdomain, &u32Check);
5704 dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
5705 hf_pn_io_mrp_check_reserved_1, &u32Check);
5706 dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
5707 hf_pn_io_mrp_check_reserved_2, &u32Check);
5708 offset +=4; /* MRP_Check (32 bit) done */
5709  
5710 return offset;
5711 }
5712  
5713 /* PDInterfaceAdjust */
5714 static int
5715 dissect_PDInterfaceAdjust_block(tvbuff_t *tvb, int offset,
5716 packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
5717 {
5718 guint32 u32SMultipleInterfaceMode;
5719  
5720 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
5721 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
5722 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
5723 return offset;
5724 }
5725 /* Padding */
5726 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
5727 /* MultipleInterfaceMode */
5728 dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
5729 hf_pn_io_MultipleInterfaceMode_NameOfDevice, &u32SMultipleInterfaceMode);
5730 dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
5731 hf_pn_io_MultipleInterfaceMode_reserved_1, &u32SMultipleInterfaceMode);
5732 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
5733 hf_pn_io_MultipleInterfaceMode_reserved_2, &u32SMultipleInterfaceMode);
5734 return offset;
5735 }
5736  
5737 /* PDPortStatistic for one subslot */
5738 static int
5739 dissect_PDPortStatistic_block(tvbuff_t *tvb, int offset,
5740 packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
5741 {
5742 guint32 u32StatValue;
5743  
5744 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
5745 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
5746 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
5747 return offset;
5748 }
5749 /* Padding */
5750 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
5751  
5752 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
5753 hf_pn_io_pdportstatistic_ifInOctets, &u32StatValue);
5754 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
5755 hf_pn_io_pdportstatistic_ifOutOctets, &u32StatValue);
5756  
5757 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
5758 hf_pn_io_pdportstatistic_ifInDiscards, &u32StatValue);
5759 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
5760 hf_pn_io_pdportstatistic_ifOutDiscards, &u32StatValue);
5761  
5762 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
5763 hf_pn_io_pdportstatistic_ifInErrors, &u32StatValue);
5764 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
5765 hf_pn_io_pdportstatistic_ifOutErrors, &u32StatValue);
5766  
5767 return offset;
5768 }
5769  
5770  
5771 /* dissect the PDInterfaceDataReal block */
5772 static int
5773 dissect_PDInterfaceDataReal_block(tvbuff_t *tvb, int offset,
5774 packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
5775 {
5776 guint8 u8LengthOwnChassisID;
5777 char *pOwnChassisID;
5778 guint8 mac[6];
5779 guint32 ip;
5780  
5781  
5782 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
5783 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
5784 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
5785 return offset;
5786 }
5787  
5788 /* LengthOwnChassisID */
5789 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
5790 hf_pn_io_length_own_chassis_id, &u8LengthOwnChassisID);
5791 /* OwnChassisID */
5792 pOwnChassisID = (char *)wmem_alloc(wmem_packet_scope(), u8LengthOwnChassisID+1);
5793 tvb_memcpy(tvb, (guint8 *) pOwnChassisID, offset, u8LengthOwnChassisID);
5794 pOwnChassisID[u8LengthOwnChassisID] = '\0';
5795 proto_tree_add_string (tree, hf_pn_io_own_chassis_id, tvb, offset, u8LengthOwnChassisID, pOwnChassisID);
5796 offset += u8LengthOwnChassisID;
5797  
5798 /* Padding */
5799 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
5800  
5801 /* MACAddressValue */
5802 offset = dissect_pn_mac(tvb, offset, pinfo, tree, hf_pn_io_macadd, mac);
5803  
5804 /* Padding */
5805 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
5806  
5807 /* IPAddress */
5808 offset = dissect_pn_ipv4(tvb, offset, pinfo, tree, hf_pn_io_ip_address, &ip);
5809 /*proto_item_append_text(block_item, ", IP: %s", ip_to_str((guint8*)&ip));*/
5810  
5811 /* Subnetmask */
5812 offset = dissect_pn_ipv4(tvb, offset, pinfo, tree, hf_pn_io_subnetmask, &ip);
5813 /*proto_item_append_text(block_item, ", Subnet: %s", ip_to_str((guint8*)&ip));*/
5814  
5815 /* StandardGateway */
5816 offset = dissect_pn_ipv4(tvb, offset, pinfo, tree, hf_pn_io_standard_gateway, &ip);
5817 /*proto_item_append_text(block_item, ", Router: %s", ip_to_str((guint8*)&ip));*/
5818  
5819  
5820 return offset;
5821 }
5822  
5823  
5824 /* dissect the PDSyncData block */
5825 static int
5826 dissect_PDSyncData_block(tvbuff_t *tvb, int offset,
5827 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
5828 {
5829 guint16 u16SlotNr;
5830 guint16 u16SubslotNr;
5831 e_guid_t uuid;
5832 guint32 u32ReservedIntervalBegin;
5833 guint32 u32ReservedIntervalEnd;
5834 guint32 u32PLLWindow;
5835 guint32 u32SyncSendFactor;
5836 guint16 u16SendClockFactor;
5837 guint16 u16SyncProperties;
5838 guint16 u16SyncFrameAddress;
5839 guint16 u16PTCPTimeoutFactor;
5840 guint16 u16PTCPTakeoverTimeoutFactor;
5841 guint16 u16PTCPMasterStartupTime;
5842 guint8 u8MasterPriority1;
5843 guint8 u8MasterPriority2;
5844 guint8 u8LengthSubdomainName;
5845 char *pSubdomainName;
5846  
5847  
5848 if (u8BlockVersionHigh != 1) {
5849 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
5850 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
5851 return offset;
5852 }
5853  
5854 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
5855  
5856 switch (u8BlockVersionLow) {
5857 case(0):
5858 /* SlotNumber */
5859 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
5860 hf_pn_io_slot_nr, &u16SlotNr);
5861 /* Subslotnumber */
5862 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
5863 hf_pn_io_subslot_nr, &u16SubslotNr);
5864 /* PTCPSubdomainID */
5865 offset = dissect_dcerpc_uuid_t(tvb, offset, pinfo, tree, drep,
5866 hf_pn_io_ptcp_subdomain_id, &uuid);
5867 /* IRDataID */
5868 offset = dissect_dcerpc_uuid_t(tvb, offset, pinfo, tree, drep,
5869 hf_pn_io_ir_data_id, &uuid);
5870 /* ReservedIntervalBegin */
5871 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
5872 hf_pn_io_reserved_interval_begin, &u32ReservedIntervalBegin);
5873 /* ReservedIntervalEnd */
5874 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
5875 hf_pn_io_reserved_interval_end, &u32ReservedIntervalEnd);
5876 /* PLLWindow enum */
5877 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
5878 hf_pn_io_pllwindow, &u32PLLWindow);
5879 /* SyncSendFactor 32 enum */
5880 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
5881 hf_pn_io_sync_send_factor, &u32SyncSendFactor);
5882 /* SendClockFactor 16 */
5883 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
5884 hf_pn_io_send_clock_factor, &u16SendClockFactor);
5885 /* SyncProperties 16 bitfield */
5886 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
5887 hf_pn_io_sync_properties, &u16SyncProperties);
5888 /* SyncFrameAddress 16 bitfield */
5889 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
5890 hf_pn_io_sync_frame_address, &u16SyncFrameAddress);
5891 /* PTCPTimeoutFactor 16 enum */
5892 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
5893 hf_pn_io_ptcp_timeout_factor, &u16PTCPTimeoutFactor);
5894  
5895 proto_item_append_text(item, ": Slot:0x%x/0x%x, Interval:%u-%u, PLLWin:%u, Send:%u, Clock:%u",
5896 u16SlotNr, u16SubslotNr, u32ReservedIntervalBegin, u32ReservedIntervalEnd,
5897 u32PLLWindow, u32SyncSendFactor, u16SendClockFactor);
5898 break;
5899 case(2):
5900 /* PTCPSubdomainID */
5901 offset = dissect_dcerpc_uuid_t(tvb, offset, pinfo, tree, drep,
5902 hf_pn_io_ptcp_subdomain_id, &uuid);
5903 /* ReservedIntervalBegin */
5904 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
5905 hf_pn_io_reserved_interval_begin, &u32ReservedIntervalBegin);
5906 /* ReservedIntervalEnd */
5907 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
5908 hf_pn_io_reserved_interval_end, &u32ReservedIntervalEnd);
5909 /* PLLWindow enum */
5910 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
5911 hf_pn_io_pllwindow, &u32PLLWindow);
5912 /* SyncSendFactor 32 enum */
5913 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
5914 hf_pn_io_sync_send_factor, &u32SyncSendFactor);
5915 /* SendClockFactor 16 */
5916 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
5917 hf_pn_io_send_clock_factor, &u16SendClockFactor);
5918 /* PTCPTimeoutFactor 16 enum */
5919 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
5920 hf_pn_io_ptcp_timeout_factor, &u16PTCPTimeoutFactor);
5921 /* PTCPTakeoverTimeoutFactor 16 */
5922 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
5923 hf_pn_io_ptcp_takeover_timeout_factor, &u16PTCPTakeoverTimeoutFactor);
5924 /* PTCPMasterStartupTime 16 */
5925 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
5926 hf_pn_io_ptcp_master_startup_time, &u16PTCPMasterStartupTime);
5927 /* SyncProperties 16 bitfield */
5928 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
5929 hf_pn_io_sync_properties, &u16SyncProperties);
5930 /* PTCP_MasterPriority1 */
5931 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
5932 hf_pn_io_ptcp_master_priority_1, &u8MasterPriority1);
5933 /* PTCP_MasterPriority2 */
5934 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
5935 hf_pn_io_ptcp_master_priority_2, &u8MasterPriority2);
5936 /* PTCPLengthSubdomainName */
5937 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
5938 hf_pn_io_ptcp_length_subdomain_name, &u8LengthSubdomainName);
5939 /* PTCPSubdomainName */
5940 pSubdomainName = (char *)wmem_alloc(wmem_packet_scope(), u8LengthSubdomainName+1);
5941 tvb_memcpy(tvb, (guint8 *) pSubdomainName, offset, u8LengthSubdomainName);
5942 pSubdomainName[u8LengthSubdomainName] = '\0';
5943 proto_tree_add_string (tree, hf_pn_io_ptcp_subdomain_name, tvb, offset, u8LengthSubdomainName, pSubdomainName);
5944 offset += u8LengthSubdomainName;
5945  
5946 /* Padding */
5947 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
5948  
5949 proto_item_append_text(item, ": Interval:%u-%u, PLLWin:%u, Send:%u, Clock:%u",
5950 u32ReservedIntervalBegin, u32ReservedIntervalEnd,
5951 u32PLLWindow, u32SyncSendFactor, u16SendClockFactor);
5952 break;
5953 default:
5954 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
5955 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
5956 }
5957  
5958 return offset;
5959 }
5960  
5961  
5962 /* dissect the PDIRData block */
5963 static int
5964 dissect_PDIRData_block(tvbuff_t *tvb, int offset,
5965 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
5966 {
5967 guint16 u16SlotNr;
5968 guint16 u16SubslotNr;
5969 guint16 u16Index = 0;
5970 guint32 u32RecDataLen;
5971 pnio_ar_t *ar = NULL;
5972  
5973 /* versions decoded are High: 1 and LOW 0..2 */
5974 if (u8BlockVersionHigh != 1 || (u8BlockVersionLow > 2 ) ) {
5975 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
5976 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
5977 return offset;
5978 }
5979  
5980 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
5981  
5982 /* SlotNumber */
5983 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
5984 hf_pn_io_slot_nr, &u16SlotNr);
5985 /* Subslotnumber */
5986 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
5987 hf_pn_io_subslot_nr, &u16SubslotNr);
5988  
5989 proto_item_append_text(item, ": Slot:0x%x/0x%x",
5990 u16SlotNr, u16SubslotNr);
5991  
5992 /* PDIRGlobalData */
5993 offset = dissect_block(tvb, offset, pinfo, tree, drep, &u16Index, &u32RecDataLen, &ar);
5994 if (u8BlockVersionLow == 0) {
5995 /* PDIRFrameData */
5996 offset = dissect_block(tvb, offset, pinfo, tree, drep, &u16Index, &u32RecDataLen, &ar);
5997 } else if (u8BlockVersionLow == 1) {
5998 /* [PDIRFrameData] */
5999 offset = dissect_block(tvb, offset, pinfo, tree, drep, &u16Index, &u32RecDataLen, &ar);
6000 /* PDIRBeginEndData */
6001 offset = dissect_block(tvb, offset, pinfo, tree, drep, &u16Index, &u32RecDataLen, &ar);
6002 }else if (u8BlockVersionLow == 2) {
6003 /* [PDIRFrameData] */
6004 offset = dissect_block(tvb, offset, pinfo, tree, drep, &u16Index, &u32RecDataLen, &ar);
6005 /* PDIRBeginEndData */
6006 offset = dissect_block(tvb, offset, pinfo, tree, drep, &u16Index, &u32RecDataLen, &ar);
6007 }
6008 return offset;
6009 }
6010  
6011  
6012 /* dissect the PDIRGlobalData block */
6013 static int
6014 dissect_PDIRGlobalData_block(tvbuff_t *tvb, int offset,
6015 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
6016 {
6017 e_guid_t uuid;
6018 guint32 u32MaxBridgeDelay;
6019 guint32 u32NumberOfPorts;
6020 guint32 u32MaxPortTxDelay;
6021 guint32 u32MaxPortRxDelay;
6022 guint32 u32MaxLineRxDelay;
6023 guint32 u32YellowTime;
6024 guint32 u32Tmp;
6025  
6026 /* added blockversion 2 */
6027 if (u8BlockVersionHigh != 1 || (u8BlockVersionLow > 2)) {
6028 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
6029 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
6030 return offset;
6031 }
6032  
6033 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
6034  
6035 /* IRDataID */
6036 offset = dissect_dcerpc_uuid_t(tvb, offset, pinfo, tree, drep,
6037 hf_pn_io_ir_data_id, &uuid);
6038  
6039 if (u8BlockVersionLow <= 2) {
6040 /* MaxBridgeDelay */
6041 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
6042 hf_pn_io_max_bridge_delay, &u32MaxBridgeDelay);
6043 /* NumberOfPorts */
6044 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
6045 hf_pn_io_number_of_ports, &u32NumberOfPorts);
6046 u32Tmp = u32NumberOfPorts;
6047  
6048 while (u32Tmp--) {
6049 /* MaxPortTxDelay */
6050 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
6051 hf_pn_io_max_port_tx_delay, &u32MaxPortTxDelay);
6052 /* MaxPortRxDelay */
6053 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
6054 hf_pn_io_max_port_rx_delay, &u32MaxPortRxDelay);
6055 if (u8BlockVersionLow >= 2) {
6056 /* MaxLineRxDelay */
6057 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
6058 hf_pn_io_max_line_rx_delay, &u32MaxLineRxDelay);
6059 /* YellowTime */
6060 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
6061 hf_pn_io_yellowtime, &u32YellowTime);
6062 }
6063 }
6064 proto_item_append_text(item, ": MaxBridgeDelay:%u, NumberOfPorts:%u",
6065 u32MaxBridgeDelay, u32NumberOfPorts);
6066  
6067 }
6068 return offset;
6069 }
6070  
6071  
6072 /* dissect the PDIRFrameData block */
6073 static int
6074 dissect_PDIRFrameData_block(tvbuff_t *tvb, int offset,
6075 packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow,
6076 guint16 u16BodyLength)
6077 {
6078 guint32 u32FrameSendOffset;
6079 guint32 u32FrameDataProperties;
6080 guint16 u16DataLength;
6081 guint16 u16ReductionRatio;
6082 guint16 u16Phase;
6083 guint16 u16FrameID;
6084 guint16 u16Ethertype;
6085 guint8 u8RXPort;
6086 guint8 u8FrameDetails;
6087 guint8 u8NumberOfTxPortGroups;
6088 guint8 u8TxPortGroupArray;
6089 guint16 u16TxPortGroupArraySize;
6090 guint16 u16EndOffset;
6091 guint16 n = 0;
6092 proto_item *sub_item;
6093 proto_tree *sub_tree;
6094  
6095 /* added low version 1 */
6096 if (u8BlockVersionHigh != 1 || u8BlockVersionLow > 1) {
6097 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
6098 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
6099 return offset;
6100 }
6101  
6102 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
6103  
6104 u16EndOffset = offset + u16BodyLength -2;
6105 if (u8BlockVersionLow > 0) {
6106 /* for low version 1 FrameDataProperties is added */
6107 sub_item = proto_tree_add_item(tree, hf_pn_io_frame_data_properties, tvb, offset, 4, ENC_BIG_ENDIAN);
6108 sub_tree = proto_item_add_subtree(sub_item, ett_pn_FrameDataProperties);
6109 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
6110 hf_pn_io_frame_data_properties_forwarding_Mode, &u32FrameDataProperties);
6111 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
6112 hf_pn_io_frame_data_properties_FastForwardingMulticastMACAdd, &u32FrameDataProperties);
6113 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
6114 hf_pn_io_frame_data_properties_FragmentMode, &u32FrameDataProperties);
6115 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
6116 hf_pn_io_frame_data_properties_reserved_1, &u32FrameDataProperties);
6117 offset =
6118 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
6119 hf_pn_io_frame_data_properties_reserved_2, &u32FrameDataProperties);
6120 }
6121 /* dissect all IR frame data */
6122 while (offset < u16EndOffset)
6123 {
6124 proto_item *ir_frame_data_sub_item;
6125 proto_tree *ir_frame_data_tree;
6126  
6127 n++;
6128  
6129 /* new subtree for each IR frame */
6130 ir_frame_data_sub_item = proto_tree_add_item(tree, hf_pn_io_ir_frame_data, tvb, offset, 17, ENC_NA);
6131 ir_frame_data_tree = proto_item_add_subtree(ir_frame_data_sub_item, ett_pn_io_ir_frame_data);
6132  
6133 /* FrameSendOffset */
6134 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, ir_frame_data_tree, drep,
6135 hf_pn_io_frame_send_offset, &u32FrameSendOffset);
6136 /* DataLength */
6137 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, ir_frame_data_tree, drep,
6138 hf_pn_io_data_length, &u16DataLength);
6139 /* ReductionRatio */
6140 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, ir_frame_data_tree, drep,
6141 hf_pn_io_reduction_ratio, &u16ReductionRatio);
6142 /* Phase */
6143 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, ir_frame_data_tree, drep,
6144 hf_pn_io_phase, &u16Phase);
6145 /* FrameID */
6146 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, ir_frame_data_tree, drep,
6147 hf_pn_io_frame_id, &u16FrameID);
6148  
6149 /* Ethertype */
6150 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, ir_frame_data_tree, drep,
6151 hf_pn_io_ethertype, &u16Ethertype);
6152 /* RxPort */
6153 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, ir_frame_data_tree, drep,
6154 hf_pn_io_rx_port, &u8RXPort);
6155 /* FrameDetails */
6156 sub_item = proto_tree_add_item(ir_frame_data_tree, hf_pn_io_frame_details, tvb, offset, 1, ENC_BIG_ENDIAN);
6157 sub_tree = proto_item_add_subtree(sub_item, ett_pn_io_frame_defails);
6158 dissect_dcerpc_uint8(tvb, offset, pinfo, sub_tree, drep,
6159 hf_pn_io_frame_details_sync_frame, &u8FrameDetails);
6160 dissect_dcerpc_uint8(tvb, offset, pinfo, sub_tree, drep,
6161 hf_pn_io_frame_details_meaning_frame_send_offset, &u8FrameDetails);
6162 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, sub_tree, drep,
6163 hf_pn_io_frame_details_reserved, &u8FrameDetails);
6164 /* TxPortGroup */
6165 u8NumberOfTxPortGroups = tvb_get_guint8(tvb, offset);
6166 sub_item = proto_tree_add_uint(ir_frame_data_tree, hf_pn_io_nr_of_tx_port_groups,
6167 tvb, offset, 1, u8NumberOfTxPortGroups);
6168 offset++;
6169 if ((u8NumberOfTxPortGroups > 21) || ((u8NumberOfTxPortGroups & 0x1) !=1)) {
6170 expert_add_info(pinfo, sub_item, &ei_pn_io_nr_of_tx_port_groups);
6171 }
6172  
6173 /* TxPortArray */
6174 u16TxPortGroupArraySize = (u8NumberOfTxPortGroups + 7 / 8);
6175 sub_item = proto_tree_add_item(ir_frame_data_tree, hf_pn_io_TxPortGroupProperties,
6176 tvb, offset, u16TxPortGroupArraySize, ENC_BIG_ENDIAN);
6177 sub_tree = proto_item_add_subtree(sub_item, ett_pn_io_GroupProperties);
6178 while (u16TxPortGroupArraySize > 0)
6179 {
6180 dissect_dcerpc_uint8(tvb, offset, pinfo, sub_tree, drep, hf_pn_io_TxPortGroupProperties_bit0, &u8TxPortGroupArray);
6181 dissect_dcerpc_uint8(tvb, offset, pinfo, sub_tree, drep, hf_pn_io_TxPortGroupProperties_bit1, &u8TxPortGroupArray);
6182 dissect_dcerpc_uint8(tvb, offset, pinfo, sub_tree, drep, hf_pn_io_TxPortGroupProperties_bit2, &u8TxPortGroupArray);
6183 dissect_dcerpc_uint8(tvb, offset, pinfo, sub_tree, drep, hf_pn_io_TxPortGroupProperties_bit3, &u8TxPortGroupArray);
6184 dissect_dcerpc_uint8(tvb, offset, pinfo, sub_tree, drep, hf_pn_io_TxPortGroupProperties_bit4, &u8TxPortGroupArray);
6185 dissect_dcerpc_uint8(tvb, offset, pinfo, sub_tree, drep, hf_pn_io_TxPortGroupProperties_bit5, &u8TxPortGroupArray);
6186 dissect_dcerpc_uint8(tvb, offset, pinfo, sub_tree, drep, hf_pn_io_TxPortGroupProperties_bit6, &u8TxPortGroupArray);
6187 dissect_dcerpc_uint8(tvb, offset, pinfo, sub_tree, drep, hf_pn_io_TxPortGroupProperties_bit7, &u8TxPortGroupArray);
6188  
6189 offset+=1;
6190 u16TxPortGroupArraySize --;
6191 }
6192  
6193 /* align to next dataset */
6194 offset = dissect_pn_align4(tvb, offset, pinfo, ir_frame_data_tree);
6195  
6196 proto_item_append_text(ir_frame_data_tree, ": Offset:%u, Len:%u, Ratio:%u, Phase:%u, FrameID:0x%04x",
6197 u32FrameSendOffset, u16DataLength, u16ReductionRatio, u16Phase, u16FrameID);
6198  
6199 }
6200  
6201 proto_item_append_text(item, ": Frames:%u", n);
6202  
6203 return offset;
6204 }
6205  
6206  
6207 static int
6208 dissect_PDIRBeginEndData_block(tvbuff_t *tvb, int offset,
6209 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow,
6210 guint16 u16BodyLength)
6211 {
6212 guint16 u16StartOfRedFrameID;
6213 guint16 u16EndOfRedFrameID;
6214 guint32 u32NumberOfPorts;
6215 guint32 u32NumberOfAssignments;
6216 guint32 u32NumberOfPhases;
6217 guint32 u32RedOrangePeriodBegin;
6218 guint32 u32OrangePeriodBegin;
6219 guint32 u32GreenPeriodBegin;
6220 guint16 u16TXPhaseAssignment;
6221 guint16 u16RXPhaseAssignment;
6222 guint32 u32SubStart;
6223 guint32 u32Tmp;
6224 guint32 u32Tmp2;
6225 guint32 u32TxRedOrangePeriodBegin[0x11] = {0};
6226 guint32 u32TxOrangePeriodBegin [0x11] = {0};
6227 guint32 u32TxGreenPeriodBegin [0x11] = {0};
6228 guint32 u32RxRedOrangePeriodBegin[0x11] = {0};
6229 guint32 u32RxOrangePeriodBegin [0x11] = {0};
6230 guint32 u32RxGreenPeriodBegin [0x11] = {0};
6231 guint32 u32PortIndex;
6232  
6233 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
6234 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
6235 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
6236 return offset;
6237 }
6238  
6239 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
6240  
6241 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
6242 hf_pn_io_start_of_red_frame_id, &u16StartOfRedFrameID);
6243 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
6244 hf_pn_io_end_of_red_frame_id, &u16EndOfRedFrameID);
6245  
6246 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
6247 hf_pn_io_number_of_ports, &u32NumberOfPorts);
6248 u32Tmp2 = u32NumberOfPorts;
6249 while (u32Tmp2--) {
6250 proto_item *ir_begin_end_port_sub_item;
6251 proto_tree *ir_begin_end_port_tree;
6252  
6253 /* new subtree for each Port */
6254 ir_begin_end_port_sub_item = proto_tree_add_item(tree, hf_pn_io_ir_begin_end_port, tvb, offset, 0, ENC_NA);
6255 ir_begin_end_port_tree = proto_item_add_subtree(ir_begin_end_port_sub_item, ett_pn_io_ir_begin_end_port);
6256 u32SubStart = offset;
6257  
6258 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, ir_begin_end_port_tree, drep,
6259 hf_pn_io_number_of_assignments, &u32NumberOfAssignments);
6260 u32Tmp = u32NumberOfAssignments;
6261 u32PortIndex = 0;
6262 if (u32Tmp <= 0x10)
6263 {
6264 while (u32Tmp--) {
6265 /* TXBeginEndAssignment */
6266 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, ir_begin_end_port_tree, drep,
6267 hf_pn_io_red_orange_period_begin_tx, &u32RedOrangePeriodBegin);
6268 u32TxRedOrangePeriodBegin[u32PortIndex] = u32RedOrangePeriodBegin;
6269  
6270 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, ir_begin_end_port_tree, drep,
6271 hf_pn_io_orange_period_begin_tx, &u32OrangePeriodBegin);
6272 u32TxOrangePeriodBegin[u32PortIndex]= u32OrangePeriodBegin;
6273  
6274 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, ir_begin_end_port_tree, drep,
6275 hf_pn_io_green_period_begin_tx, &u32GreenPeriodBegin);
6276 u32TxGreenPeriodBegin[u32PortIndex] = u32GreenPeriodBegin;
6277  
6278 /* RXBeginEndAssignment */
6279 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, ir_begin_end_port_tree, drep,
6280 hf_pn_io_red_orange_period_begin_rx, &u32RedOrangePeriodBegin);
6281 u32RxRedOrangePeriodBegin[u32PortIndex] = u32RedOrangePeriodBegin;
6282  
6283 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, ir_begin_end_port_tree, drep,
6284 hf_pn_io_orange_period_begin_rx, &u32OrangePeriodBegin);
6285 u32RxOrangePeriodBegin[u32PortIndex]= u32OrangePeriodBegin;
6286  
6287 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, ir_begin_end_port_tree, drep,
6288 hf_pn_io_green_period_begin_rx, &u32GreenPeriodBegin);
6289 u32RxGreenPeriodBegin[u32PortIndex] = u32GreenPeriodBegin;
6290  
6291 u32PortIndex++;
6292 }
6293 }
6294  
6295 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, ir_begin_end_port_tree, drep,
6296 hf_pn_io_number_of_phases, &u32NumberOfPhases);
6297 u32Tmp = u32NumberOfPhases;
6298 if (u32Tmp <= 0x10)
6299 {
6300 while (u32Tmp--) {
6301 proto_item *ir_begin_tx_phase_sub_item;
6302 proto_tree *ir_begin_tx_phase_tree;
6303  
6304 /* new subtree for TXPhaseAssignment */
6305 ir_begin_tx_phase_sub_item = proto_tree_add_item(ir_begin_end_port_tree,
6306 hf_pn_ir_tx_phase_assignment, tvb, offset, 0, ENC_NA);
6307 ir_begin_tx_phase_tree = proto_item_add_subtree(ir_begin_tx_phase_sub_item, ett_pn_io_ir_tx_phase);
6308 /* bit 0..3 */
6309 dissect_dcerpc_uint16(tvb, offset, pinfo, ir_begin_tx_phase_tree, drep,
6310 hf_pn_io_tx_phase_assignment_begin_value, &u16TXPhaseAssignment);
6311 /* bit 4..7 */
6312 dissect_dcerpc_uint16(tvb, offset, pinfo, ir_begin_tx_phase_tree, drep,
6313 hf_pn_io_tx_phase_assignment_orange_begin, &u16TXPhaseAssignment);
6314 /* bit 8..11 */
6315 dissect_dcerpc_uint16(tvb, offset, pinfo, ir_begin_tx_phase_tree, drep,
6316 hf_pn_io_tx_phase_assignment_end_reserved, &u16TXPhaseAssignment);
6317 /* bit 12..15 */
6318 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, ir_begin_tx_phase_tree, drep,
6319 hf_pn_io_tx_phase_assignment_reserved, &u16TXPhaseAssignment);
6320  
6321 proto_item_append_text(ir_begin_tx_phase_sub_item,
6322 ": 0x%x, RedOrangePeriodBegin: %d, OrangePeriodBegin: %d, GreenPeriodBegin: %d",
6323 u16TXPhaseAssignment,
6324 u32TxRedOrangePeriodBegin[u16TXPhaseAssignment & 0x0F],
6325 u32TxOrangePeriodBegin[(u16TXPhaseAssignment & 0x0F0) >> 4],
6326 u32TxGreenPeriodBegin[(u16TXPhaseAssignment & 0x0F00)>> 8]);
6327  
6328 /* new subtree for RXPhaseAssignment */
6329 ir_begin_tx_phase_sub_item = proto_tree_add_item(ir_begin_end_port_tree,
6330 hf_pn_ir_rx_phase_assignment, tvb, offset, 0, ENC_NA);
6331 ir_begin_tx_phase_tree = proto_item_add_subtree(ir_begin_tx_phase_sub_item, ett_pn_io_ir_rx_phase);
6332 /* bit 0..3 */
6333 dissect_dcerpc_uint16(tvb, offset, pinfo, ir_begin_tx_phase_tree, drep,
6334 hf_pn_io_tx_phase_assignment_begin_value, &u16RXPhaseAssignment);
6335 /* bit 4..7 */
6336 dissect_dcerpc_uint16(tvb, offset, pinfo, ir_begin_tx_phase_tree, drep,
6337 hf_pn_io_tx_phase_assignment_orange_begin, &u16RXPhaseAssignment);
6338 /* bit 8..11 */
6339 dissect_dcerpc_uint16(tvb, offset, pinfo, ir_begin_tx_phase_tree, drep,
6340 hf_pn_io_tx_phase_assignment_end_reserved, &u16RXPhaseAssignment);
6341 /* bit 12..15 */
6342 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, ir_begin_tx_phase_tree, drep,
6343 hf_pn_io_tx_phase_assignment_reserved, &u16RXPhaseAssignment);
6344  
6345 proto_item_append_text(ir_begin_tx_phase_sub_item,
6346 ": 0x%x, RedOrangePeriodBegin: %d, OrangePeriodBegin: %d, GreenPeriodBegin: %d",
6347 u16RXPhaseAssignment,
6348 u32RxRedOrangePeriodBegin[u16RXPhaseAssignment & 0x0F],
6349 u32RxOrangePeriodBegin[(u16RXPhaseAssignment & 0x0F0) >> 4],
6350 u32RxGreenPeriodBegin[(u16RXPhaseAssignment & 0x0F00)>> 8]);
6351 }
6352 }
6353 proto_item_append_text(ir_begin_end_port_sub_item, ": Assignments:%u, Phases:%u",
6354 u32NumberOfAssignments, u32NumberOfPhases);
6355  
6356 proto_item_set_len(ir_begin_end_port_sub_item, offset - u32SubStart);
6357 }
6358  
6359 proto_item_append_text(item, ": StartOfRedFrameID: 0x%x, EndOfRedFrameID: 0x%x, Ports: %u",
6360 u16StartOfRedFrameID, u16EndOfRedFrameID, u32NumberOfPorts);
6361  
6362 return offset+u16BodyLength;
6363 }
6364  
6365  
6366 /* dissect the DiagnosisData block */
6367 static int
6368 dissect_DiagnosisData_block(tvbuff_t *tvb, int offset,
6369 packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint8 *drep _U_, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow,
6370 guint16 body_length)
6371 {
6372 guint32 u32Api;
6373 guint16 u16SlotNr;
6374 guint16 u16SubslotNr;
6375 guint16 u16ChannelNumber;
6376 guint16 u16UserStructureIdentifier;
6377 proto_item *sub_item;
6378  
6379  
6380 if (u8BlockVersionHigh != 1 || (u8BlockVersionLow != 0 && u8BlockVersionLow != 1)) {
6381 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
6382 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
6383 return offset;
6384 }
6385  
6386 if (u8BlockVersionLow == 1) {
6387 /* API */
6388 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
6389 hf_pn_io_api, &u32Api);
6390 body_length-=4;
6391 }
6392  
6393 /* SlotNumber */
6394 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
6395 hf_pn_io_slot_nr, &u16SlotNr);
6396 /* Subslotnumber */
6397 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
6398 hf_pn_io_subslot_nr, &u16SubslotNr);
6399 /* ChannelNumber got new ranges: 0..0x7FFF the source is a channel as specified by the manufacturer */
6400 /* fetch u16ChannelNumber */
6401 u16ChannelNumber = ((drep[0] & DREP_LITTLE_ENDIAN)
6402 ? tvb_get_letohs(tvb, offset)
6403 : tvb_get_ntohs(tvb, offset));
6404 if (tree) {
6405 sub_item = proto_tree_add_item(tree,hf_pn_io_channel_number, tvb, offset, 2, DREP_ENC_INTEGER(drep));
6406 if (u16ChannelNumber < 0x8000){ /* 0..0x7FFF the source is a channel as specified by the manufacturer */
6407 proto_item_append_text(sub_item, " channel number of the diagnosis source");
6408 }
6409 else
6410 if (u16ChannelNumber == 0x8000) /* 0x8000 the whole submodule is the source, */
6411 proto_item_append_text(sub_item, " (whole) Submodule");
6412 else
6413 proto_item_append_text(sub_item, " reserved");
6414 }
6415 offset = offset +2; /* Advance behind ChannelNumber */
6416 /* ChannelProperties */
6417 offset = dissect_ChannelProperties(tvb, offset, pinfo, tree, item, drep);
6418 body_length-=8;
6419 /* UserStructureIdentifier */
6420 u16UserStructureIdentifier = ((drep[0] & DREP_LITTLE_ENDIAN)
6421 ? tvb_get_letohs(tvb, offset)
6422 : tvb_get_ntohs(tvb, offset));
6423 if (u16UserStructureIdentifier > 0x7FFF){
6424 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
6425 hf_pn_io_user_structure_identifier, &u16UserStructureIdentifier);
6426 }
6427 else
6428 { /* range 0x0 to 0x7fff is manufacturer specific */
6429 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
6430 hf_pn_io_user_structure_identifier_manf, &u16UserStructureIdentifier);
6431 }
6432 proto_item_append_text(item, ", USI:0x%x", u16UserStructureIdentifier);
6433 body_length-=2;
6434  
6435 /* the rest of the block contains optional: [MaintenanceItem] and/or [AlarmItem] */
6436 while (body_length) {
6437 offset = dissect_AlarmUserStructure(tvb, offset, pinfo, tree, item, drep,
6438 &body_length, u16UserStructureIdentifier);
6439 }
6440 return offset;
6441 }
6442  
6443  
6444 static int
6445 dissect_ARProperties(tvbuff_t *tvb, int offset,
6446 packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint8 *drep _U_)
6447 {
6448 proto_item *sub_item;
6449 proto_tree *sub_tree;
6450 guint32 u32ARProperties;
6451 guint8 startupMode;
6452  
6453 sub_item = proto_tree_add_item(tree, hf_pn_io_ar_properties, tvb, offset, 4, ENC_BIG_ENDIAN);
6454 sub_tree = proto_item_add_subtree(sub_item, ett_pn_io_ar_properties);
6455 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
6456 hf_pn_io_ar_properties_pull_module_alarm_allowed, &u32ARProperties);
6457 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
6458 hf_pn_io_arproperties_StartupMode, &u32ARProperties);
6459 startupMode = (guint8)((u32ARProperties >> 30) & 0x01);
6460 /* Advanced startup mode */
6461 if (startupMode)
6462 {
6463 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
6464 hf_pn_io_ar_properties_combined_object_container_with_advanced_startupmode, &u32ARProperties);
6465 }
6466 /* Legacy startup mode */
6467 else
6468 {
6469 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
6470 hf_pn_io_ar_properties_combined_object_container_with_legacy_startupmode, &u32ARProperties);
6471 }
6472 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
6473 hf_pn_io_ar_properties_reserved, &u32ARProperties);
6474 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
6475 hf_pn_io_ar_properties_achnowledge_companion_ar, &u32ARProperties);
6476 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
6477 hf_pn_io_ar_properties_companion_ar, &u32ARProperties);
6478 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
6479 hf_pn_io_ar_properties_device_access, &u32ARProperties);
6480 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
6481 hf_pn_io_ar_properties_reserved_1, &u32ARProperties);
6482 /* removed within 2.3
6483 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
6484 hf_pn_io_ar_properties_data_rate, &u32ARProperties);
6485 */
6486 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
6487 hf_pn_io_ar_properties_parametrization_server, &u32ARProperties);
6488 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
6489 hf_pn_io_ar_properties_supervisor_takeover_allowed, &u32ARProperties);
6490 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
6491 hf_pn_io_ar_properties_state, &u32ARProperties);
6492  
6493 return offset;
6494 }
6495  
6496  
6497 /* dissect the IOCRProperties */
6498 static int
6499 dissect_IOCRProperties(tvbuff_t *tvb, int offset,
6500 packet_info *pinfo, proto_tree *tree, guint8 *drep)
6501 {
6502 proto_item *sub_item;
6503 proto_tree *sub_tree;
6504 guint32 u32IOCRProperties;
6505  
6506 sub_item = proto_tree_add_item(tree, hf_pn_io_iocr_properties, tvb, offset, 4, ENC_BIG_ENDIAN);
6507 sub_tree = proto_item_add_subtree(sub_item, ett_pn_io_iocr_properties);
6508 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
6509 hf_pn_io_iocr_properties_full_subframe_structure, &u32IOCRProperties);
6510 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
6511 hf_pn_io_iocr_properties_distributed_subframe_watchdog, &u32IOCRProperties);
6512 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
6513 hf_pn_io_iocr_properties_fast_forwarding_mac_adr, &u32IOCRProperties);
6514 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
6515 hf_pn_io_iocr_properties_reserved_3, &u32IOCRProperties);
6516 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
6517 hf_pn_io_iocr_properties_reserved_2, &u32IOCRProperties);
6518 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
6519 hf_pn_io_iocr_properties_media_redundancy, &u32IOCRProperties);
6520 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
6521 hf_pn_io_iocr_properties_reserved_1, &u32IOCRProperties);
6522 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
6523 hf_pn_io_iocr_properties_rtclass, &u32IOCRProperties);
6524  
6525 return offset;
6526 }
6527  
6528  
6529 /* dissect the ARData block */
6530 static int
6531 dissect_ARData_block(tvbuff_t *tvb, int offset,
6532 packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint8 *drep _U_, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow, guint16 u16BlockLength)
6533 {
6534 guint16 u16NumberOfARs;
6535 guint16 u16NumberofEntries;
6536 e_guid_t aruuid;
6537 e_guid_t uuid;
6538 guint16 u16ARType;
6539 char *pStationName;
6540 guint16 u16NameLength;
6541 guint16 u16NumberOfIOCRs;
6542 guint16 u16IOCRType;
6543 guint16 u16FrameID;
6544 guint16 u16CycleCounter;
6545 guint8 u8DataStatus;
6546 guint8 u8TransferStatus;
6547 proto_item *ds_item;
6548 proto_tree *ds_tree;
6549 guint16 u16UDPRTPort;
6550 guint16 u16AlarmCRType;
6551 guint16 u16LocalAlarmReference;
6552 guint16 u16RemoteAlarmReference;
6553 guint16 u16NumberOfAPIs;
6554 guint32 u32Api;
6555 proto_item *iocr_item;
6556 proto_tree *iocr_tree;
6557 proto_item *ar_item;
6558 proto_tree *ar_tree;
6559 guint32 u32IOCRStart;
6560 gint32 i32EndOffset;
6561 guint32 u32ARDataStart;
6562  
6563 /* added BlockversionLow == 1 */
6564 if (u8BlockVersionHigh != 1 || u8BlockVersionLow > 1) {
6565 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
6566 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
6567 return offset;
6568 }
6569 i32EndOffset = offset + u16BlockLength;
6570 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
6571 hf_pn_io_number_of_ars, &u16NumberOfARs);
6572 /* BlockversionLow: 0 */
6573 if (u8BlockVersionLow == 0) {
6574 while (u16NumberOfARs--) {
6575 ar_item = proto_tree_add_item(tree, hf_pn_io_ar_data, tvb, offset, 0, ENC_NA);
6576 ar_tree = proto_item_add_subtree(ar_item, ett_pn_io_ar_data);
6577 u32ARDataStart = offset;
6578 offset = dissect_dcerpc_uuid_t(tvb, offset, pinfo, ar_tree, drep,
6579 hf_pn_io_ar_uuid, &aruuid);
6580 proto_item_append_text(ar_item, "ARUUID:%s", guid_to_str(wmem_packet_scope(), (const e_guid_t*) &aruuid));
6581 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, ar_tree, drep,
6582 hf_pn_io_ar_type, &u16ARType);
6583 offset = dissect_ARProperties(tvb, offset, pinfo, ar_tree, item, drep);
6584 offset = dissect_dcerpc_uuid_t(tvb, offset, pinfo, ar_tree, drep,
6585 hf_pn_io_cminitiator_objectuuid, &uuid);
6586 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, ar_tree, drep,
6587 hf_pn_io_station_name_length, &u16NameLength);
6588 pStationName = (char *)wmem_alloc(wmem_packet_scope(), u16NameLength+1);
6589 tvb_memcpy(tvb, (guint8 *) pStationName, offset, u16NameLength);
6590 pStationName[u16NameLength] = '\0';
6591 proto_tree_add_string (ar_tree, hf_pn_io_cminitiator_station_name, tvb, offset, u16NameLength, pStationName);
6592 offset += u16NameLength;
6593  
6594 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, ar_tree, drep,
6595 hf_pn_io_number_of_iocrs, &u16NumberOfIOCRs);
6596  
6597 while (u16NumberOfIOCRs--) {
6598 iocr_item = proto_tree_add_item(ar_tree, hf_pn_io_iocr_tree, tvb, offset, 0, ENC_NA);
6599 iocr_tree = proto_item_add_subtree(iocr_item, ett_pn_io_iocr);
6600 u32IOCRStart = offset;
6601  
6602 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, iocr_tree, drep,
6603 hf_pn_io_iocr_type, &u16IOCRType);
6604 offset = dissect_IOCRProperties(tvb, offset, pinfo, iocr_tree, drep);
6605 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, iocr_tree, drep,
6606 hf_pn_io_frame_id, &u16FrameID);
6607  
6608 proto_item_append_text(iocr_item, ": FrameID:0x%x", u16FrameID);
6609  
6610 /* add cycle counter */
6611 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, iocr_tree, drep,
6612 hf_pn_io_cycle_counter, &u16CycleCounter);
6613  
6614 u8DataStatus = tvb_get_guint8(tvb, offset);
6615 u8TransferStatus = tvb_get_guint8(tvb, offset+1);
6616  
6617 /* add data status subtree */
6618 ds_item = proto_tree_add_uint_format(iocr_tree, hf_pn_io_data_status,
6619 tvb, offset, 1, u8DataStatus,
6620 "DataStatus: 0x%02x (Frame: %s and %s, Provider: %s and %s)",
6621 u8DataStatus,
6622 (u8DataStatus & 0x04) ? "Valid" : "Invalid",
6623 (u8DataStatus & 0x01) ? "Primary" : "Backup",
6624 (u8DataStatus & 0x20) ? "Ok" : "Problem",
6625 (u8DataStatus & 0x10) ? "Run" : "Stop");
6626 ds_tree = proto_item_add_subtree(ds_item, ett_pn_io_data_status);
6627 proto_tree_add_uint(ds_tree, hf_pn_io_data_status_res67, tvb, offset, 1, u8DataStatus);
6628 proto_tree_add_uint(ds_tree, hf_pn_io_data_status_ok, tvb, offset, 1, u8DataStatus);
6629 proto_tree_add_uint(ds_tree, hf_pn_io_data_status_operate, tvb, offset, 1, u8DataStatus);
6630 proto_tree_add_uint(ds_tree, hf_pn_io_data_status_res3, tvb, offset, 1, u8DataStatus);
6631 proto_tree_add_uint(ds_tree, hf_pn_io_data_status_valid, tvb, offset, 1, u8DataStatus);
6632 proto_tree_add_uint(ds_tree, hf_pn_io_data_status_res1, tvb, offset, 1, u8DataStatus);
6633 proto_tree_add_uint(ds_tree, hf_pn_io_data_status_primary, tvb, offset, 1, u8DataStatus);
6634  
6635 offset++;
6636  
6637 /* add transfer status */
6638 if (u8TransferStatus) {
6639 proto_tree_add_uint_format(iocr_tree, hf_pn_io_transfer_status, tvb,
6640 offset, 1, u8TransferStatus,
6641 "TransferStatus: 0x%02x (ignore this frame)", u8TransferStatus);
6642 } else {
6643 proto_tree_add_uint_format(iocr_tree, hf_pn_io_transfer_status, tvb,
6644 offset, 1, u8TransferStatus,
6645 "TransferStatus: 0x%02x (OK)", u8TransferStatus);
6646 }
6647  
6648 offset++;
6649  
6650 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, iocr_tree, drep,
6651 hf_pn_io_cminitiator_udprtport, &u16UDPRTPort);
6652 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, iocr_tree, drep,
6653 hf_pn_io_cmresponder_udprtport, &u16UDPRTPort);
6654  
6655 proto_item_set_len(iocr_item, offset - u32IOCRStart);
6656 }
6657  
6658 /* AlarmCRType */
6659 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, ar_tree, drep,
6660 hf_pn_io_alarmcr_type, &u16AlarmCRType);
6661 /* LocalAlarmReference */
6662 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, ar_tree, drep,
6663 hf_pn_io_localalarmref, &u16LocalAlarmReference);
6664 /* RemoteAlarmReference */
6665 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, ar_tree, drep,
6666 hf_pn_io_remotealarmref, &u16RemoteAlarmReference);
6667 /* ParameterServerObjectUUID */
6668 offset = dissect_dcerpc_uuid_t(tvb, offset, pinfo, ar_tree, drep,
6669 hf_pn_io_parameter_server_objectuuid, &uuid);
6670 /* StationNameLength */
6671 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, ar_tree, drep,
6672 hf_pn_io_station_name_length, &u16NameLength);
6673 /* ParameterServerStationName */
6674 pStationName = (char *)wmem_alloc(wmem_packet_scope(), u16NameLength+1);
6675 tvb_memcpy(tvb, (guint8 *) pStationName, offset, u16NameLength);
6676 pStationName[u16NameLength] = '\0';
6677 proto_tree_add_string (ar_tree, hf_pn_io_parameter_server_station_name, tvb, offset, u16NameLength, pStationName);
6678 offset += u16NameLength;
6679 /* NumberOfAPIs */
6680 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, ar_tree, drep,
6681 hf_pn_io_number_of_apis, &u16NumberOfAPIs);
6682 /* API */
6683 if (u16NumberOfAPIs > 0) {
6684 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, ar_tree, drep,
6685 hf_pn_io_api, &u32Api);
6686 }
6687 proto_item_set_len(ar_item, offset - u32ARDataStart);
6688 }
6689 }
6690 else
6691 { /* BlockversionLow == 1 */
6692 while (u16NumberOfARs--) {
6693 ar_item = proto_tree_add_item(tree, hf_pn_io_ar_data, tvb, offset, 0, ENC_NA);
6694 ar_tree = proto_item_add_subtree(ar_item, ett_pn_io_ar_data);
6695 u32ARDataStart = offset;
6696 /*ARUUID */
6697 offset = dissect_dcerpc_uuid_t(tvb, offset, pinfo, ar_tree, drep, hf_pn_io_ar_uuid, &aruuid);
6698 proto_item_append_text(ar_item, "ARUUID:%s", guid_to_str(wmem_packet_scope(), (const e_guid_t*) &aruuid));
6699 /* CMInitiatorObjectUUID */
6700 offset = dissect_dcerpc_uuid_t(tvb, offset, pinfo, ar_tree, drep, hf_pn_io_cminitiator_objectuuid, &uuid);
6701 /* ParameterServerObjectUUID */
6702 offset = dissect_dcerpc_uuid_t(tvb, offset, pinfo, ar_tree, drep, hf_pn_io_parameter_server_objectuuid, &uuid);
6703 /* ARProperties*/
6704 offset = dissect_ARProperties(tvb, offset, pinfo, ar_tree, item, drep);
6705 /* ARType*/
6706 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, ar_tree, drep, hf_pn_io_ar_type, &u16ARType);
6707 /* AlarmCRType */
6708 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, ar_tree, drep, hf_pn_io_alarmcr_type, &u16AlarmCRType);
6709 /* LocalAlarmReference */
6710 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, ar_tree, drep, hf_pn_io_localalarmref, &u16LocalAlarmReference);
6711 /* RemoteAlarmReference */
6712 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, ar_tree, drep, hf_pn_io_remotealarmref, &u16RemoteAlarmReference);
6713 /* InitiatorUDPRTPort*/
6714 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, ar_tree, drep, hf_pn_io_cminitiator_udprtport, &u16UDPRTPort);
6715 /* ResponderUDPRTPort*/
6716 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, ar_tree, drep, hf_pn_io_cmresponder_udprtport, &u16UDPRTPort);
6717 /* CMInitiatorStationName*/
6718 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, ar_tree, drep, hf_pn_io_station_name_length, &u16NameLength);
6719 pStationName = (char *)wmem_alloc(wmem_packet_scope(), u16NameLength+1);
6720 tvb_memcpy(tvb, (guint8 *) pStationName, offset, u16NameLength);
6721 pStationName[u16NameLength] = '\0';
6722 proto_tree_add_string (ar_tree, hf_pn_io_cminitiator_station_name, tvb, offset, u16NameLength, pStationName);
6723 offset += u16NameLength;
6724 /** align padding! **/
6725 offset = dissect_pn_align4(tvb, offset, pinfo, ar_tree);
6726  
6727 /* StationNameLength */
6728 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, ar_tree, drep, hf_pn_io_station_name_length, &u16NameLength);
6729 if (u16NameLength != 0) {
6730 /* ParameterServerStationName */
6731 pStationName = (char *)wmem_alloc(wmem_packet_scope(), u16NameLength+1);
6732 tvb_memcpy(tvb, (guint8 *) pStationName, offset, u16NameLength);
6733 pStationName[u16NameLength] = '\0';
6734 proto_tree_add_string (ar_tree, hf_pn_io_parameter_server_station_name, tvb, offset, u16NameLength, pStationName);
6735 offset += u16NameLength;
6736 }
6737 else
6738 { /* display no name present */
6739 proto_tree_add_string (ar_tree, hf_pn_io_parameter_server_station_name, tvb, offset, u16NameLength, " <no ParameterServerStationName present>");
6740 }
6741 /** align padding! **/
6742 offset = dissect_pn_align4(tvb, offset, pinfo, ar_tree);
6743  
6744 /* NumberOfIOCRs*/
6745 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, ar_tree, drep, hf_pn_io_number_of_iocrs, &u16NumberOfIOCRs);
6746 /* align to next 32 bit */
6747 offset = dissect_pn_padding(tvb, offset, pinfo, ar_tree, 2);
6748  
6749 while (u16NumberOfIOCRs--) {
6750 iocr_item = proto_tree_add_item(ar_tree, hf_pn_io_iocr_tree, tvb, offset, 0, ENC_NA);
6751 iocr_tree = proto_item_add_subtree(iocr_item, ett_pn_io_iocr);
6752 u32IOCRStart = offset;
6753  
6754 /* IOCRProperties*/
6755 offset = dissect_IOCRProperties(tvb, offset, pinfo, iocr_tree, drep);
6756 /* IOCRType*/
6757 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, iocr_tree, drep, hf_pn_io_iocr_type, &u16IOCRType);
6758 /* FrameID*/
6759 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, iocr_tree, drep, hf_pn_io_frame_id, &u16FrameID);
6760 proto_item_append_text(iocr_item, ": FrameID:0x%x", u16FrameID);
6761  
6762 /* add cycle counter */
6763 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, iocr_tree, drep,
6764 hf_pn_io_cycle_counter, &u16CycleCounter);
6765  
6766 u8DataStatus = tvb_get_guint8(tvb, offset);
6767 u8TransferStatus = tvb_get_guint8(tvb, offset+1);
6768  
6769 /* add data status subtree */
6770 ds_item = proto_tree_add_uint_format(iocr_tree, hf_pn_io_data_status,
6771 tvb, offset, 1, u8DataStatus,
6772 "DataStatus: 0x%02x (Frame: %s and %s, Provider: %s and %s)",
6773 u8DataStatus,
6774 (u8DataStatus & 0x04) ? "Valid" : "Invalid",
6775 (u8DataStatus & 0x01) ? "Primary" : "Backup",
6776 (u8DataStatus & 0x20) ? "Ok" : "Problem",
6777 (u8DataStatus & 0x10) ? "Run" : "Stop");
6778 ds_tree = proto_item_add_subtree(ds_item, ett_pn_io_data_status);
6779 proto_tree_add_uint(ds_tree, hf_pn_io_data_status_res67, tvb, offset, 1, u8DataStatus);
6780 proto_tree_add_uint(ds_tree, hf_pn_io_data_status_ok, tvb, offset, 1, u8DataStatus);
6781 proto_tree_add_uint(ds_tree, hf_pn_io_data_status_operate, tvb, offset, 1, u8DataStatus);
6782 proto_tree_add_uint(ds_tree, hf_pn_io_data_status_res3, tvb, offset, 1, u8DataStatus);
6783 proto_tree_add_uint(ds_tree, hf_pn_io_data_status_valid, tvb, offset, 1, u8DataStatus);
6784 proto_tree_add_uint(ds_tree, hf_pn_io_data_status_res1, tvb, offset, 1, u8DataStatus);
6785 proto_tree_add_uint(ds_tree, hf_pn_io_data_status_primary, tvb, offset, 1, u8DataStatus);
6786  
6787 offset++;
6788  
6789 /* add transfer status */
6790 if (u8TransferStatus) {
6791 proto_tree_add_uint_format(iocr_tree, hf_pn_io_transfer_status, tvb,
6792 offset, 1, u8TransferStatus,
6793 "TransferStatus: 0x%02x (ignore this frame)", u8TransferStatus);
6794 } else {
6795 proto_tree_add_uint_format(iocr_tree, hf_pn_io_transfer_status, tvb,
6796 offset, 1, u8TransferStatus,
6797 "TransferStatus: 0x%02x (OK)", u8TransferStatus);
6798 }
6799 offset++;
6800 proto_item_set_len(iocr_item, offset - u32IOCRStart);
6801 }
6802 /* NumberOfAPIs */
6803 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, ar_tree, drep, hf_pn_io_number_of_apis, &u16NumberOfAPIs);
6804 /* align to next 32 bit */
6805 offset = dissect_pn_padding(tvb, offset, pinfo, ar_tree, 2);
6806 /* API */
6807 if (u16NumberOfAPIs > 0) {
6808 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, ar_tree, drep, hf_pn_io_api, &u32Api);
6809 }
6810 /* get the number of subblocks an dissect them */
6811 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, ar_tree, drep, hf_pn_io_number_of_ARDATAInfo, &u16NumberofEntries);
6812  
6813 offset = dissect_pn_padding(tvb, offset, pinfo, ar_tree, 2);
6814  
6815 while ((offset < i32EndOffset) && (u16NumberofEntries > 0)) {
6816 offset = dissect_a_block(tvb, offset, pinfo, ar_tree, drep);
6817 u16NumberofEntries--;
6818 }
6819 proto_item_set_len(ar_item, offset - u32ARDataStart);
6820 }
6821 }
6822 return offset;
6823 }
6824  
6825  
6826 /* dissect the APIData block */
6827 static int
6828 dissect_APIData_block(tvbuff_t *tvb, int offset,
6829 packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint8 *drep _U_, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
6830 {
6831 guint16 u16NumberOfAPIs;
6832 guint32 u32Api;
6833  
6834  
6835 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
6836 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
6837 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
6838 return offset;
6839 }
6840  
6841 /* NumberOfAPIs */
6842 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
6843 hf_pn_io_number_of_apis, &u16NumberOfAPIs);
6844  
6845 while (u16NumberOfAPIs--) {
6846 /* API */
6847 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
6848 hf_pn_io_api, &u32Api);
6849 }
6850  
6851 return offset;
6852 }
6853  
6854 /* dissect the SLRData block */
6855 static int
6856 dissect_SRLData_block(tvbuff_t *tvb, int offset,
6857 packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint8 *drep _U_, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
6858 {
6859 guint16 RedundancyInfo;
6860  
6861 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
6862 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
6863 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
6864 return offset;
6865 }
6866 /* bit 0 ..1 EndPoint1 and EndPoint2*/
6867 dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep, hf_pn_RedundancyInfo, &RedundancyInfo);
6868 /* bit 2 .. 15 reserved */
6869 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep, hf_pn_RedundancyInfo_reserved, &RedundancyInfo);
6870 offset = dissect_pn_padding(tvb, offset, pinfo, tree, 2);
6871 return offset;
6872 }
6873  
6874 /* dissect the LogData block */
6875 static int
6876 dissect_LogData_block(tvbuff_t *tvb, int offset,
6877 packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
6878 {
6879 guint64 u64ActualLocaltimeStamp;
6880 guint16 u16NumberOfLogEntries;
6881 guint64 u64LocaltimeStamp;
6882 e_guid_t aruuid;
6883 guint32 u32EntryDetail;
6884 dcerpc_info di; /* fake dcerpc_info struct */
6885 dcerpc_call_value call_data;
6886  
6887 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
6888 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
6889 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
6890 return offset;
6891 }
6892  
6893 di.conformant_run = 0;
6894 /* we need di->call_data->flags.NDR64 == 0 */
6895 call_data.flags = 0;
6896 di.call_data = &call_data;
6897 di.dcerpc_procedure_name = "";
6898  
6899 /* ActualLocalTimeStamp */
6900 offset = dissect_dcerpc_uint64(tvb, offset, pinfo, tree, &di, drep,
6901 hf_pn_io_actual_local_time_stamp, &u64ActualLocaltimeStamp);
6902 /* NumberOfLogEntries */
6903 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
6904 hf_pn_io_number_of_log_entries, &u16NumberOfLogEntries);
6905  
6906 while (u16NumberOfLogEntries--) {
6907 /* LocalTimeStamp */
6908 offset = dissect_dcerpc_uint64(tvb, offset, pinfo, tree, &di, drep,
6909 hf_pn_io_local_time_stamp, &u64LocaltimeStamp);
6910 /* ARUUID */
6911 offset = dissect_dcerpc_uuid_t(tvb, offset, pinfo, tree, drep,
6912 hf_pn_io_ar_uuid, &aruuid);
6913 /* PNIOStatus */
6914 offset = dissect_PNIO_status(tvb, offset, pinfo, tree, drep);
6915 /* EntryDetail */
6916 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
6917 hf_pn_io_entry_detail, &u32EntryDetail);
6918 }
6919  
6920 return offset;
6921 }
6922  
6923  
6924 /* dissect the FS Hello block */
6925 static int
6926 dissect_FSHello_block(tvbuff_t *tvb, int offset,
6927 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
6928 {
6929 guint32 u32FSHelloMode;
6930 guint32 u32FSHelloInterval;
6931 guint32 u32FSHelloRetry;
6932 guint32 u32FSHelloDelay;
6933  
6934  
6935 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
6936 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
6937 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
6938 return offset;
6939 }
6940  
6941 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
6942  
6943 /* FSHelloMode */
6944 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
6945 hf_pn_io_fs_hello_mode, &u32FSHelloMode);
6946 /* FSHelloInterval */
6947 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
6948 hf_pn_io_fs_hello_interval, &u32FSHelloInterval);
6949 /* FSHelloRetry */
6950 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
6951 hf_pn_io_fs_hello_retry, &u32FSHelloRetry);
6952 /* FSHelloDelay */
6953 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
6954 hf_pn_io_fs_hello_delay, &u32FSHelloDelay);
6955  
6956 proto_item_append_text(item, ": Mode:%s, Interval:%ums, Retry:%u, Delay:%ums",
6957 val_to_str(u32FSHelloMode, pn_io_fs_hello_mode_vals, "0x%x"),
6958 u32FSHelloInterval, u32FSHelloRetry, u32FSHelloDelay);
6959  
6960 return offset;
6961 }
6962  
6963  
6964 /* dissect the FS Parameter block */
6965 static int
6966 dissect_FSParameter_block(tvbuff_t *tvb, int offset,
6967 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
6968 {
6969 guint32 u32FSParameterMode;
6970 e_guid_t FSParameterUUID;
6971  
6972  
6973 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
6974 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
6975 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
6976 return offset;
6977 }
6978  
6979 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
6980  
6981 /* FSParameterMode */
6982 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
6983 hf_pn_io_fs_parameter_mode, &u32FSParameterMode);
6984 /* FSParameterUUID */
6985 offset = dissect_dcerpc_uuid_t(tvb, offset, pinfo, tree, drep,
6986 hf_pn_io_fs_parameter_uuid, &FSParameterUUID);
6987  
6988 proto_item_append_text(item, ": Mode:%s",
6989 val_to_str(u32FSParameterMode, pn_io_fs_parameter_mode_vals, "0x%x"));
6990  
6991 return offset;
6992 }
6993  
6994  
6995  
6996  
6997 /* dissect the FSUDataAdjust block */
6998 static int
6999 dissect_PDInterfaceFSUDataAdjust_block(tvbuff_t *tvb, int offset,
7000 packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow,
7001 guint16 u16BodyLength)
7002 {
7003 tvbuff_t *new_tvb;
7004  
7005  
7006 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
7007 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
7008 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
7009 return offset;
7010 }
7011  
7012 /* Padding */
7013 offset = dissect_pn_padding(tvb, offset, pinfo, tree, 2);
7014  
7015 u16BodyLength -= 2;
7016  
7017 /* sub blocks */
7018 new_tvb = tvb_new_subset_length(tvb, offset, u16BodyLength);
7019 dissect_blocks(new_tvb, 0, pinfo, tree, drep);
7020 offset += u16BodyLength;
7021  
7022 return offset;
7023 }
7024  
7025  
7026 /* dissect the ARFSUDataAdjust block */
7027 static int
7028 dissect_ARFSUDataAdjust_block(tvbuff_t *tvb, int offset,
7029 packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow,
7030 guint16 u16BodyLength)
7031 {
7032 tvbuff_t *new_tvb;
7033  
7034  
7035 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
7036 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
7037 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
7038 return offset;
7039 }
7040  
7041 /* Padding */
7042 offset = dissect_pn_padding(tvb, offset, pinfo, tree, 2);
7043  
7044 u16BodyLength -= 2;
7045  
7046 /* sub blocks */
7047 new_tvb = tvb_new_subset_length(tvb, offset, u16BodyLength);
7048 dissect_blocks(new_tvb, 0, pinfo, tree, drep);
7049 offset += u16BodyLength;
7050  
7051 return offset;
7052 }
7053  
7054 static const char *
7055 decode_ARType_spezial(guint16 ARType, guint16 ARAccess)
7056 {
7057 if (ARType == 0x0001)
7058 return ("IO Controller AR");
7059 else if (ARType == 0x0003)
7060 return("IO Controller AR");
7061 else if (ARType == 0x0010)
7062 return("IO Controller AR (RT_CLASS_3)");
7063 else if (ARType == 0x0020)
7064 return("IO Controller AR (sysred/CiR)");
7065 else if (ARType == 0x0006)
7066 {
7067 if (ARAccess) /*TRUE */
7068 return("DeviceAccess AR");
7069 else
7070 return("IO Supervisor AR");
7071 }
7072 else
7073 return("reserved");
7074 }
7075  
7076 /* dissect the ARBlockReq */
7077 static int
7078 dissect_ARBlockReq_block(tvbuff_t *tvb, int offset,
7079 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow,
7080 pnio_ar_t ** ar)
7081 {
7082 guint16 u16ARType;
7083 guint32 u32ARProperties;
7084 e_guid_t aruuid;
7085 e_guid_t uuid;
7086 guint16 u16SessionKey;
7087 guint8 mac[6];
7088 guint16 u16TimeoutFactor;
7089 guint16 u16UDPRTPort;
7090 guint16 u16NameLength;
7091 char *pStationName;
7092 pnio_ar_t *par;
7093  
7094  
7095 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
7096 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
7097 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
7098 return offset;
7099 }
7100  
7101 u32ARProperties = ((drep[0] & DREP_LITTLE_ENDIAN)
7102 ? tvb_get_letohl (tvb, offset + 2 + 16 +2 + 6 +12)
7103 : tvb_get_ntohl (tvb, offset + 2 + 16 +2 + 6 +12));
7104  
7105 u16ARType = ((drep[0] & DREP_LITTLE_ENDIAN)
7106 ? tvb_get_letohs (tvb, offset)
7107 : tvb_get_ntohs (tvb, offset));
7108  
7109 if (tree) {
7110 proto_tree_add_string_format(tree, hf_pn_io_artype_req, tvb, offset, 2,
7111 "ARType", "ARType: (0x%04x) %s ",
7112 u16ARType, decode_ARType_spezial(u16ARType, u32ARProperties));
7113 }
7114 offset = offset + 2;
7115 offset = dissect_dcerpc_uuid_t(tvb, offset, pinfo, tree, drep,
7116 hf_pn_io_ar_uuid, &aruuid);
7117 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7118 hf_pn_io_sessionkey, &u16SessionKey);
7119 offset = dissect_pn_mac(tvb, offset, pinfo, tree,
7120 hf_pn_io_cminitiator_macadd, mac);
7121 offset = dissect_dcerpc_uuid_t(tvb, offset, pinfo, tree, drep,
7122 hf_pn_io_cminitiator_objectuuid, &uuid);
7123  
7124  
7125 offset = dissect_ARProperties(tvb, offset, pinfo, tree, item, drep);
7126  
7127 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7128 hf_pn_io_cminitiator_activitytimeoutfactor, &u16TimeoutFactor); /* XXX - special values */
7129 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7130 hf_pn_io_cminitiator_udprtport, &u16UDPRTPort);
7131 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7132 hf_pn_io_station_name_length, &u16NameLength);
7133  
7134 pStationName = (char *)wmem_alloc(wmem_packet_scope(), u16NameLength+1);
7135 tvb_memcpy(tvb, (guint8 *) pStationName, offset, u16NameLength);
7136 pStationName[u16NameLength] = '\0';
7137 proto_tree_add_string (tree, hf_pn_io_cminitiator_station_name, tvb, offset, u16NameLength, pStationName);
7138 offset += u16NameLength;
7139  
7140 proto_item_append_text(item, ": %s, Session:%u, MAC:%02x:%02x:%02x:%02x:%02x:%02x, Port:0x%x, Station:%s",
7141 decode_ARType_spezial(u16ARType, u32ARProperties),
7142 u16SessionKey,
7143 mac[0], mac[1], mac[2], mac[3], mac[4], mac[5],
7144 u16UDPRTPort,
7145 pStationName);
7146  
7147 par = pnio_ar_find_by_aruuid(pinfo, &aruuid);
7148 if (par == NULL) {
7149 par = pnio_ar_new(&aruuid);
7150 memcpy( (void *) (&par->controllermac), mac, sizeof(par->controllermac));
7151 par->arType = u16ARType; /* store AR-type for filter generation */
7152 /*strncpy( (char *) (&par->controllername), pStationName, sizeof(par->controllername));*/
7153 } else {
7154 /*expert_add_info_format(pinfo, item, PI_UNDECODED, PI_WARN, "ARBlockReq: AR already existing!");*/
7155 }
7156 *ar = par;
7157  
7158 return offset;
7159 }
7160  
7161  
7162 /* dissect the ARBlockRes */
7163 static int
7164 dissect_ARBlockRes_block(tvbuff_t *tvb, int offset,
7165 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow,
7166 pnio_ar_t **ar)
7167 {
7168 guint16 u16ARType;
7169 e_guid_t uuid;
7170 guint16 u16SessionKey;
7171 guint8 mac[6];
7172 guint16 u16UDPRTPort;
7173 pnio_ar_t *par;
7174  
7175  
7176 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
7177 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
7178 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
7179 return offset;
7180 }
7181  
7182 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7183 hf_pn_io_ar_type, &u16ARType);
7184 offset = dissect_dcerpc_uuid_t(tvb, offset, pinfo, tree, drep,
7185 hf_pn_io_ar_uuid, &uuid);
7186 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7187 hf_pn_io_sessionkey, &u16SessionKey);
7188 offset = dissect_pn_mac(tvb, offset, pinfo, tree,
7189 hf_pn_io_cmresponder_macadd, mac);
7190 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7191 hf_pn_io_cmresponder_udprtport, &u16UDPRTPort);
7192  
7193 proto_item_append_text(item, ": %s, Session:%u, MAC:%02x:%02x:%02x:%02x:%02x:%02x, Port:0x%x",
7194 val_to_str(u16ARType, pn_io_ar_type, "0x%x"),
7195 u16SessionKey,
7196 mac[0], mac[1], mac[2], mac[3], mac[4], mac[5],
7197 u16UDPRTPort);
7198  
7199 par = pnio_ar_find_by_aruuid(pinfo, &uuid);
7200 if (par == NULL) {
7201 expert_add_info_format(pinfo, item, &ei_pn_io_ar_info_not_found, "ARBlockRes: AR information not found!");
7202 } else {
7203 memcpy( (void *) (&par->devicemac), mac, sizeof(par->controllermac));
7204 }
7205 *ar = par;
7206  
7207 return offset;
7208 }
7209  
7210  
7211 /* dissect the IOCRBlockReq */
7212 static int
7213 dissect_IOCRBlockReq_block(tvbuff_t *tvb, int offset,
7214 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow,
7215 pnio_ar_t *ar)
7216 {
7217 guint16 u16IOCRType;
7218 guint16 u16IOCRReference;
7219 guint16 u16LT;
7220 guint16 u16DataLength;
7221 guint16 u16FrameID;
7222 guint16 u16SendClockFactor;
7223 guint16 u16ReductionRatio;
7224 guint16 u16Phase;
7225 guint16 u16Sequence;
7226 guint32 u32FrameSendOffset;
7227 guint16 u16WatchdogFactor;
7228 guint16 u16DataHoldFactor;
7229 guint16 u16IOCRTagHeader;
7230 guint8 mac[6];
7231 guint16 u16NumberOfAPIs;
7232 guint32 u32Api;
7233 guint16 u16NumberOfIODataObjects;
7234 guint16 u16SlotNr;
7235 guint16 u16SubslotNr;
7236 guint16 u16IODataObjectFrameOffset;
7237 guint16 u16NumberOfIOCS;
7238 guint16 u16IOCSFrameOffset;
7239 proto_item *api_item;
7240 proto_tree *api_tree;
7241 guint32 u32ApiStart;
7242 guint16 u16Tmp;
7243 proto_item *sub_item;
7244 proto_tree *sub_tree;
7245 guint32 u32SubStart;
7246  
7247 conversation_t *conversation;
7248 stationInfo *station_info = NULL;
7249 iocsObject *iocs_object;
7250 iocsObject *cmp_iocs_object;
7251 ioDataObject *io_data_object;
7252 ioDataObject *cmp_io_data_object;
7253 wmem_list_frame_t *frame;
7254 wmem_list_t *iocs_list;
7255  
7256 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
7257 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
7258 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
7259 return offset;
7260 }
7261  
7262 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7263 hf_pn_io_iocr_type, &u16IOCRType);
7264 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7265 hf_pn_io_iocr_reference, &u16IOCRReference);
7266 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7267 hf_pn_io_lt, &u16LT);
7268  
7269 offset = dissect_IOCRProperties(tvb, offset, pinfo, tree, drep);
7270  
7271 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7272 hf_pn_io_data_length, &u16DataLength);
7273 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7274 hf_pn_io_frame_id, &u16FrameID);
7275 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7276 hf_pn_io_send_clock_factor, &u16SendClockFactor);
7277 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7278 hf_pn_io_reduction_ratio, &u16ReductionRatio);
7279 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7280 hf_pn_io_phase, &u16Phase);
7281 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7282 hf_pn_io_sequence, &u16Sequence);
7283 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
7284 hf_pn_io_frame_send_offset, &u32FrameSendOffset);
7285 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7286 hf_pn_io_watchdog_factor, &u16WatchdogFactor);
7287 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7288 hf_pn_io_data_hold_factor, &u16DataHoldFactor);
7289 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7290 hf_pn_io_iocr_tag_header, &u16IOCRTagHeader);
7291 offset = dissect_pn_mac(tvb, offset, pinfo, tree,
7292 hf_pn_io_iocr_multicast_mac_add, mac);
7293  
7294 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7295 hf_pn_io_number_of_apis, &u16NumberOfAPIs);
7296  
7297 proto_item_append_text(item, ": %s, Ref:0x%x, Len:%u, FrameID:0x%x, Clock:%u, Ratio:%u, Phase:%u APIs:%u",
7298 val_to_str(u16IOCRType, pn_io_iocr_type, "0x%x"),
7299 u16IOCRReference, u16DataLength, u16FrameID,
7300 u16SendClockFactor, u16ReductionRatio, u16Phase, u16NumberOfAPIs);
7301  
7302 while (u16NumberOfAPIs--) {
7303 api_item = proto_tree_add_item(tree, hf_pn_io_api_tree, tvb, offset, 0, ENC_NA);
7304 api_tree = proto_item_add_subtree(api_item, ett_pn_io_api);
7305 u32ApiStart = offset;
7306  
7307 /* API */
7308 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, api_tree, drep,
7309 hf_pn_io_api, &u32Api);
7310 /* NumberOfIODataObjects */
7311 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, api_tree, drep,
7312 hf_pn_io_number_of_io_data_objects, &u16NumberOfIODataObjects);
7313  
7314 /* Set global Variant for Number of IO Data Objects */
7315 /* Notice: Handle Input & Output seperate!!! */
7316 if (!pinfo->fd->flags.visited) {
7317 /* Get current conversation endpoints using MAC addresses */
7318 conversation = find_conversation(pinfo->num, &pinfo->dl_src, &pinfo->dl_dst, PT_NONE, 0, 0, 0);
7319 if (conversation == NULL) {
7320 /* Create new conversation, if no "Ident OK" frame as been dissected yet!
7321 * Need to switch dl_src & dl_dst, as Connect Request is sent by controller and not by device.
7322 * All conversations are based on Device MAC as addr1 */
7323 conversation = conversation_new(pinfo->num, &pinfo->dl_dst, &pinfo->dl_src, PT_NONE, 0, 0, 0);
7324 }
7325  
7326 station_info = (stationInfo*)conversation_get_proto_data(conversation, proto_pn_dcp);
7327 if (station_info == NULL) {
7328 station_info = wmem_new0(wmem_file_scope(), stationInfo);
7329 init_pnio_rtc1_station(station_info);
7330 conversation_add_proto_data(conversation, proto_pn_dcp, station_info);
7331 }
7332 else {
7333 station_info->ioDataObjectNr = u16NumberOfIODataObjects;
7334 }
7335 }
7336  
7337 u16Tmp = u16NumberOfIODataObjects;
7338 while (u16Tmp--) {
7339 sub_item = proto_tree_add_item(api_tree, hf_pn_io_io_data_object, tvb, offset, 0, ENC_NA);
7340 sub_tree = proto_item_add_subtree(sub_item, ett_pn_io_io_data_object);
7341 u32SubStart = offset;
7342  
7343 /* SlotNumber */
7344 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
7345 hf_pn_io_slot_nr, &u16SlotNr);
7346 /* Subslotnumber */
7347 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
7348 hf_pn_io_subslot_nr, &u16SubslotNr);
7349 /* IODataObjectFrameOffset */
7350 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
7351 hf_pn_io_io_data_object_frame_offset, &u16IODataObjectFrameOffset);
7352  
7353 proto_item_append_text(sub_item, ": Slot: 0x%x, Subslot: 0x%x FrameOffset: %u",
7354 u16SlotNr, u16SubslotNr, u16IODataObjectFrameOffset);
7355  
7356 proto_item_set_len(sub_item, offset - u32SubStart);
7357  
7358 if (!pinfo->fd->flags.visited && station_info != NULL) {
7359 io_data_object = wmem_new0(wmem_file_scope(), ioDataObject);
7360 io_data_object->slotNr = u16SlotNr;
7361 io_data_object->subSlotNr = u16SubslotNr;
7362 io_data_object->frameOffset = u16IODataObjectFrameOffset;
7363 /* initial - Will be added later with Write Request */
7364 io_data_object->f_dest_adr = 0;
7365 io_data_object->f_par_crc1 = 0;
7366 io_data_object->f_src_adr = 0;
7367 io_data_object->f_crc_seed = FALSE;
7368 io_data_object->f_crc_len = 0;
7369 /* Reset as a PNIO Connect Request of a known module appears */
7370 io_data_object->last_sb_cb = 0;
7371 io_data_object->lastToggleBit = 0;
7372  
7373 if (u16IOCRType == PN_INPUT_CR) {
7374 iocs_list = station_info->ioobject_data_in;
7375 }
7376 else {
7377 iocs_list = station_info->ioobject_data_out;
7378 }
7379  
7380 for (frame = wmem_list_head(iocs_list); frame != NULL; frame = wmem_list_frame_next(frame)) {
7381 cmp_io_data_object = (ioDataObject*)wmem_list_frame_data(frame);
7382 if (cmp_io_data_object->slotNr == u16SlotNr && cmp_io_data_object->subSlotNr == u16SubslotNr) {
7383 /* Found identical existing object */
7384 break;
7385 }
7386 }
7387  
7388 if (frame == NULL) {
7389 /* new io_object data incoming */
7390 wmem_list_append(iocs_list, io_data_object);
7391 }
7392 }
7393 }
7394  
7395 /* NumberOfIOCS */
7396 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, api_tree, drep,
7397 hf_pn_io_number_of_iocs, &u16NumberOfIOCS);
7398  
7399 /* Set global Vairant for NumberOfIOCS */
7400 if (!pinfo->fd->flags.visited) {
7401 if (station_info != NULL) {
7402 station_info->iocsNr = u16NumberOfIOCS;
7403 }
7404 }
7405  
7406 u16Tmp = u16NumberOfIOCS;
7407 while (u16Tmp--) {
7408 sub_item = proto_tree_add_item(api_tree, hf_pn_io_io_cs, tvb, offset, 0, ENC_NA);
7409 sub_tree = proto_item_add_subtree(sub_item, ett_pn_io_io_cs);
7410 u32SubStart = offset;
7411  
7412 /* SlotNumber */
7413 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
7414 hf_pn_io_slot_nr, &u16SlotNr);
7415 /* Subslotnumber */
7416 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
7417 hf_pn_io_subslot_nr, &u16SubslotNr);
7418 /* IOCSFrameOffset */
7419 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
7420 hf_pn_io_iocs_frame_offset, &u16IOCSFrameOffset);
7421  
7422 proto_item_append_text(sub_item, ": Slot: 0x%x, Subslot: 0x%x FrameOffset: %u",
7423 u16SlotNr, u16SubslotNr, u16IOCSFrameOffset);
7424  
7425 proto_item_set_len(sub_item, offset - u32SubStart);
7426  
7427 if (!pinfo->fd->flags.visited) {
7428 if (station_info != NULL) {
7429 if (u16IOCRType == PN_INPUT_CR) {
7430 iocs_list = station_info->iocs_data_in;
7431 }
7432 else {
7433 iocs_list = station_info->iocs_data_out;
7434 }
7435  
7436 for (frame = wmem_list_head(iocs_list); frame != NULL; frame = wmem_list_frame_next(frame)) {
7437 cmp_iocs_object = (iocsObject*)wmem_list_frame_data(frame);
7438 if (cmp_iocs_object->slotNr == u16SlotNr && cmp_iocs_object->subSlotNr == u16SubslotNr) {
7439 /* Found identical existing object */
7440 break;
7441 }
7442 }
7443  
7444 if (frame == NULL) {
7445 /* new iocs_object data incoming */
7446 iocs_object = wmem_new(wmem_file_scope(), iocsObject);
7447 iocs_object->slotNr = u16SlotNr;
7448 iocs_object->subSlotNr = u16SubslotNr;
7449 iocs_object->frameOffset = u16IOCSFrameOffset;
7450 wmem_list_append(iocs_list, iocs_object);
7451 }
7452 }
7453 }
7454 }
7455  
7456 proto_item_append_text(api_item, ": 0x%x, NumberOfIODataObjects: %u NumberOfIOCS: %u",
7457 u32Api, u16NumberOfIODataObjects, u16NumberOfIOCS);
7458  
7459 proto_item_set_len(api_item, offset - u32ApiStart);
7460 }
7461  
7462 if (ar != NULL) {
7463 switch (u16IOCRType) {
7464 case(1): /* Input CR */
7465 if (ar->inputframeid != 0 && ar->inputframeid != u16FrameID) {
7466 expert_add_info_format(pinfo, item, &ei_pn_io_frame_id, "IOCRBlockReq: input frameID changed from %u to %u!", ar->inputframeid, u16FrameID);
7467 }
7468 ar->inputframeid = u16FrameID;
7469 break;
7470 case(2): /* Output CR */
7471 #if 0
7472 /* will usually contain 0xffff here because the correct framid will be given in the connect.Cnf */
7473 if (ar->outputframeid != 0 && ar->outputframeid != u16FrameID) {
7474 expert_add_info_format(pinfo, item, &ei_pn_io_frame_id, "IOCRBlockReq: output frameID changed from %u to %u!", ar->outputframeid, u16FrameID);
7475 }
7476 ar->outputframeid = u16FrameID;
7477 #endif
7478 break;
7479 default:
7480 expert_add_info_format(pinfo, item, &ei_pn_io_iocr_type, "IOCRBlockReq: IOCRType %u undecoded!", u16IOCRType);
7481 }
7482 } else {
7483 expert_add_info_format(pinfo, item, &ei_pn_io_ar_info_not_found, "IOCRBlockReq: no corresponding AR found!");
7484 }
7485  
7486 return offset;
7487 }
7488  
7489  
7490 /* dissect the AlarmCRBlockReq */
7491 static int
7492 dissect_AlarmCRBlockReq_block(tvbuff_t *tvb, int offset,
7493 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow,
7494 pnio_ar_t *ar)
7495 {
7496 guint16 u16AlarmCRType;
7497 guint16 u16LT;
7498 guint32 u32AlarmCRProperties;
7499 guint16 u16RTATimeoutFactor;
7500 guint16 u16RTARetries;
7501 guint16 u16LocalAlarmReference;
7502 guint16 u16MaxAlarmDataLength;
7503 guint16 u16AlarmCRTagHeaderHigh;
7504 guint16 u16AlarmCRTagHeaderLow;
7505 proto_item *sub_item;
7506 proto_tree *sub_tree;
7507  
7508  
7509 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
7510 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
7511 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
7512 return offset;
7513 }
7514  
7515 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7516 hf_pn_io_alarmcr_type, &u16AlarmCRType);
7517 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7518 hf_pn_io_lt, &u16LT);
7519  
7520 sub_item = proto_tree_add_item(tree, hf_pn_io_alarmcr_properties, tvb, offset, 4, ENC_BIG_ENDIAN);
7521 sub_tree = proto_item_add_subtree(sub_item, ett_pn_io_alarmcr_properties);
7522 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
7523 hf_pn_io_alarmcr_properties_reserved, &u32AlarmCRProperties);
7524 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
7525 hf_pn_io_alarmcr_properties_transport, &u32AlarmCRProperties);
7526 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
7527 hf_pn_io_alarmcr_properties_priority, &u32AlarmCRProperties);
7528  
7529 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7530 hf_pn_io_rta_timeoutfactor, &u16RTATimeoutFactor);
7531 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7532 hf_pn_io_rta_retries, &u16RTARetries);
7533 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7534 hf_pn_io_localalarmref, &u16LocalAlarmReference);
7535 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7536 hf_pn_io_maxalarmdatalength, &u16MaxAlarmDataLength);
7537 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7538 hf_pn_io_alarmcr_tagheaderhigh, &u16AlarmCRTagHeaderHigh);
7539 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7540 hf_pn_io_alarmcr_tagheaderlow, &u16AlarmCRTagHeaderLow);
7541  
7542 proto_item_append_text(item, ": %s, LT:0x%x, TFactor:%u, Retries:%u, Ref:0x%x, Len:%u Tag:0x%x/0x%x",
7543 val_to_str(u16AlarmCRType, pn_io_alarmcr_type, "0x%x"),
7544 u16LT, u16RTATimeoutFactor, u16RTARetries, u16LocalAlarmReference, u16MaxAlarmDataLength,
7545 u16AlarmCRTagHeaderHigh, u16AlarmCRTagHeaderLow);
7546  
7547 if (ar != NULL) {
7548 if (ar->controlleralarmref != 0xffff && ar->controlleralarmref != u16LocalAlarmReference) {
7549 expert_add_info_format(pinfo, item, &ei_pn_io_localalarmref, "AlarmCRBlockReq: local alarm ref changed from %u to %u!", ar->controlleralarmref, u16LocalAlarmReference);
7550 }
7551 ar->controlleralarmref = u16LocalAlarmReference;
7552 } else {
7553 expert_add_info_format(pinfo, item, &ei_pn_io_ar_info_not_found, "AlarmCRBlockReq: no corresponding AR found!");
7554 }
7555  
7556 return offset;
7557 }
7558  
7559  
7560 /* dissect the AlarmCRBlockRes */
7561 static int
7562 dissect_AlarmCRBlockRes_block(tvbuff_t *tvb, int offset,
7563 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow,
7564 pnio_ar_t *ar)
7565 {
7566 guint16 u16AlarmCRType;
7567 guint16 u16LocalAlarmReference;
7568 guint16 u16MaxAlarmDataLength;
7569  
7570  
7571 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
7572 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
7573 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
7574 return offset;
7575 }
7576  
7577 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7578 hf_pn_io_alarmcr_type, &u16AlarmCRType);
7579 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7580 hf_pn_io_localalarmref, &u16LocalAlarmReference);
7581 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7582 hf_pn_io_maxalarmdatalength, &u16MaxAlarmDataLength);
7583  
7584 proto_item_append_text(item, ": %s, Ref:0x%04x, MaxDataLen:%u",
7585 val_to_str(u16AlarmCRType, pn_io_alarmcr_type, "0x%x"),
7586 u16LocalAlarmReference, u16MaxAlarmDataLength);
7587  
7588 if (ar != NULL) {
7589 if (ar->devicealarmref != 0xffff && ar->devicealarmref != u16LocalAlarmReference) {
7590 expert_add_info_format(pinfo, item, &ei_pn_io_localalarmref, "AlarmCRBlockRes: local alarm ref changed from %u to %u!", ar->devicealarmref, u16LocalAlarmReference);
7591 }
7592 ar->devicealarmref = u16LocalAlarmReference;
7593 } else {
7594 expert_add_info_format(pinfo, item, &ei_pn_io_ar_info_not_found, "AlarmCRBlockRes: no corresponding AR found!");
7595 }
7596  
7597 return offset;
7598 }
7599  
7600 /* dissect the ARServerBlock */
7601 static int
7602 dissect_ARServerBlock(tvbuff_t *tvb, int offset,
7603 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
7604 {
7605 char *pStationName;
7606 guint16 u16NameLength, u16padding;
7607  
7608 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
7609 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
7610 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
7611 return offset;
7612 }
7613  
7614 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7615 hf_pn_io_station_name_length, &u16NameLength);
7616  
7617 pStationName = (char *)wmem_alloc(wmem_packet_scope(), u16NameLength+1);
7618 tvb_memcpy(tvb, (guint8 *) pStationName, offset, u16NameLength);
7619 pStationName[u16NameLength] = '\0';
7620 proto_tree_add_string (tree, hf_pn_io_cminitiator_station_name, tvb, offset, u16NameLength, pStationName);
7621 offset += u16NameLength;
7622 /* Padding to next 4 byte allignment in this block */
7623 u16padding = (u16NameLength-2) & 0x3;
7624 if (u16padding >0)
7625 offset = dissect_pn_padding(tvb, offset, pinfo, tree, u16padding);
7626 return offset;
7627 }
7628  
7629  
7630  
7631 /* dissect the IOCRBlockRes */
7632 static int
7633 dissect_IOCRBlockRes_block(tvbuff_t *tvb, int offset,
7634 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow,
7635 pnio_ar_t *ar)
7636 {
7637 guint16 u16IOCRType;
7638 guint16 u16IOCRReference;
7639 guint16 u16FrameID;
7640  
7641  
7642 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
7643 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
7644 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
7645 return offset;
7646 }
7647  
7648 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7649 hf_pn_io_iocr_type, &u16IOCRType);
7650 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7651 hf_pn_io_iocr_reference, &u16IOCRReference);
7652 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7653 hf_pn_io_frame_id, &u16FrameID);
7654  
7655 proto_item_append_text(item, ": %s, Ref:0x%04x, FrameID:0x%04x",
7656 val_to_str(u16IOCRType, pn_io_iocr_type, "0x%x"),
7657 u16IOCRReference, u16FrameID);
7658  
7659 if (ar != NULL) {
7660 switch (u16IOCRType) {
7661 case(1): /* Input CR */
7662 if (ar->inputframeid != 0 && ar->inputframeid != u16FrameID) {
7663 expert_add_info_format(pinfo, item, &ei_pn_io_frame_id, "IOCRBlockRes: input frameID changed from %u to %u!", ar->inputframeid, u16FrameID);
7664 }
7665 ar->inputframeid = u16FrameID;
7666 break;
7667 case(2): /* Output CR */
7668 if (ar->outputframeid != 0 && ar->outputframeid != u16FrameID) {
7669 expert_add_info_format(pinfo, item, &ei_pn_io_frame_id, "IOCRBlockRes: output frameID changed from %u to %u!", ar->outputframeid, u16FrameID);
7670 }
7671 ar->outputframeid = u16FrameID;
7672 break;
7673 default:
7674 expert_add_info_format(pinfo, item, &ei_pn_io_iocr_type, "IOCRBlockRes: IOCRType %u undecoded!", u16IOCRType);
7675 }
7676 } else {
7677 expert_add_info_format(pinfo, item, &ei_pn_io_ar_info_not_found, "IOCRBlockRes: no corresponding AR found!");
7678 }
7679  
7680 return offset;
7681 }
7682  
7683  
7684  
7685 /* dissect the MCRBlockReq */
7686 static int
7687 dissect_MCRBlockReq_block(tvbuff_t *tvb, int offset,
7688 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
7689 {
7690 guint16 u16IOCRReference;
7691 guint32 u32AddressResolutionProperties;
7692 guint16 u16MCITimeoutFactor;
7693 guint16 u16NameLength;
7694 char *pStationName;
7695  
7696  
7697 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
7698 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
7699 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
7700 return offset;
7701 }
7702  
7703 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7704 hf_pn_io_iocr_reference, &u16IOCRReference);
7705 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
7706 hf_pn_io_address_resolution_properties, &u32AddressResolutionProperties);
7707 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7708 hf_pn_io_mci_timeout_factor, &u16MCITimeoutFactor);
7709  
7710 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7711 hf_pn_io_station_name_length, &u16NameLength);
7712  
7713 pStationName = (char *)wmem_alloc(wmem_packet_scope(), u16NameLength+1);
7714 tvb_memcpy(tvb, (guint8 *) pStationName, offset, u16NameLength);
7715 pStationName[u16NameLength] = '\0';
7716 proto_tree_add_string (tree, hf_pn_io_provider_station_name, tvb, offset, u16NameLength, pStationName);
7717 offset += u16NameLength;
7718  
7719 proto_item_append_text(item, ", CRRef:%u, Properties:0x%x, TFactor:%u, Station:%s",
7720 u16IOCRReference, u32AddressResolutionProperties, u16MCITimeoutFactor, pStationName);
7721  
7722 return offset;
7723 }
7724  
7725  
7726  
7727 /* dissect the SubFrameBlock */
7728 static int
7729 dissect_SubFrameBlock_block(tvbuff_t *tvb, int offset,
7730 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow,
7731 guint16 u16BodyLength)
7732 {
7733 guint16 u16IOCRReference;
7734 guint8 mac[6];
7735 guint32 u32SubFrameData;
7736 guint16 u16Tmp;
7737 proto_item *sub_item;
7738 proto_tree *sub_tree;
7739  
7740  
7741 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
7742 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
7743 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
7744 return offset;
7745 }
7746 offset = dissect_pn_padding(tvb, offset, pinfo, tree, 2);
7747  
7748 /* IOCRReference */
7749 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7750 hf_pn_io_iocr_reference, &u16IOCRReference);
7751  
7752 /* CMInitiatorMACAdd */
7753 offset = dissect_pn_mac(tvb, offset, pinfo, tree,
7754 hf_pn_io_cminitiator_macadd, mac);
7755  
7756 /* SubFrameData n*32 */
7757 u16BodyLength -= 10;
7758 u16Tmp = u16BodyLength;
7759 do {
7760 sub_item = proto_tree_add_item(tree, hf_pn_io_subframe_data, tvb, offset, 4, ENC_BIG_ENDIAN);
7761 sub_tree = proto_item_add_subtree(sub_item, ett_pn_io_subframe_data);
7762 /* 31-16 reserved_2 */
7763 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
7764 hf_pn_io_subframe_data_reserved2, &u32SubFrameData);
7765 /* 15- 8 DataLength */
7766 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
7767 hf_pn_io_subframe_data_length, &u32SubFrameData);
7768 /* 7 reserved_1 */
7769 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
7770 hf_pn_io_subframe_data_reserved1, &u32SubFrameData);
7771 /* 6-0 Position */
7772 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
7773 hf_pn_io_subframe_data_position, &u32SubFrameData);
7774  
7775 proto_item_append_text(sub_item, ", Length:%u, Pos:%u",
7776 (u32SubFrameData & 0x0000FF00) >> 8, u32SubFrameData & 0x0000007F);
7777 } while (u16Tmp -= 4);
7778  
7779 proto_item_append_text(item, ", CRRef:%u, %u*Data",
7780 u16IOCRReference, u16BodyLength/4);
7781  
7782 return offset;
7783 }
7784  
7785 /* dissect the (PD)SubFrameBlock 0x022B */
7786 static int
7787 dissect_PDSubFrameBlock_block(tvbuff_t *tvb, int offset,
7788 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow,
7789 guint16 u16BodyLength)
7790 {
7791 guint32 u32SFIOCRProperties;
7792 guint32 u32SubFrameData;
7793 guint16 u16FrameID;
7794 proto_item *sub_item;
7795 proto_tree *sub_tree;
7796 guint16 u16RemainingLength;
7797  
7798 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
7799 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
7800 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
7801 return offset;
7802 }
7803 /* FrameID */
7804 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep, hf_pn_io_frame_id, &u16FrameID);
7805 /* SFIOCRProperties */
7806 sub_item = proto_tree_add_item(tree, hf_pn_io_SFIOCRProperties, tvb, offset, PD_SUB_FRAME_BLOCK_FIOCR_PROPERTIES_LENGTH, ENC_BIG_ENDIAN);
7807 sub_tree = proto_item_add_subtree(sub_item, ett_pn_io_SFIOCRProperties);
7808  
7809 /* dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep, hf_pn_io_SFIOCRProperties, &u32SFIOCRProperties); */
7810 /* Bit 31: SFIOCRProperties.SFCRC16 */
7811 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep, hf_pn_io_SFIOCRProperties_SFCRC16, &u32SFIOCRProperties);
7812  
7813 /* Bit 30: SFIOCRProperties.DFPRedundantPathLayout */
7814 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep, hf_pn_io_SFIOCRProperties_DFPRedundantPathLayout, &u32SFIOCRProperties);
7815 /* Bit 29: SFIOCRProperties.DFPRedundantPathLayout */
7816 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep, hf_pn_io_SFIOCRProperties_DFPType, &u32SFIOCRProperties);
7817 /* Bit 28 - 29: SFIOCRProperties.reserved_2 */
7818 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep, hf_pn_io_SFIOCRProperties_reserved_2, &u32SFIOCRProperties);
7819 /* Bit 24 - 27: SFIOCRProperties.reserved_1 */
7820 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep, hf_pn_io_SFIOCRProperties_reserved_1, &u32SFIOCRProperties);
7821 /* Bit 16 - 23: SFIOCRProperties.DFPmode */
7822 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep, hf_pn_io_SFIOCRProperties_DFPmode, &u32SFIOCRProperties);
7823 /* Bit 8 - 15: SFIOCRProperties.RestartFactorForDistributedWD */
7824 /* 0x00 Mandatory No restart delay necessary
7825 0x01 - 0x09 Optional Less than 1 s restart delay
7826 0x0A - 0x50 Mandatory 1 s to 8 s restart delay
7827 0x51 - 0xFF Optional More than 8 s restart delay */
7828 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep, hf_pn_io_RestartFactorForDistributedWD, &u32SFIOCRProperties);
7829 /* bit 0..7 SFIOCRProperties.DistributedWatchDogFactor */
7830 offset = /* it is the last one, so advance! */
7831 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep, hf_pn_io_DistributedWatchDogFactor, &u32SFIOCRProperties);
7832  
7833 /* SubframeData */
7834 u16RemainingLength = u16BodyLength - PD_SUB_FRAME_BLOCK_FIOCR_PROPERTIES_LENGTH - PD_SUB_FRAME_BLOCK_FRAME_ID_LENGTH;
7835 while (u16RemainingLength >= PD_SUB_FRAME_BLOCK_SUB_FRAME_DATA_LENGTH)
7836 {
7837 guint8 Position,
7838 DataLength;
7839 sub_item = proto_tree_add_item(tree, hf_pn_io_subframe_data, tvb, offset, 4, ENC_BIG_ENDIAN);
7840 sub_tree = proto_item_add_subtree(sub_item, ett_pn_io_subframe_data);
7841  
7842 /* Bit 0 - 6: SubframeData.Position */
7843 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep, hf_pn_io_subframe_data_position, &u32SubFrameData);
7844 /* Bit 7: SubframeData.reserved_1 */
7845 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep, hf_pn_io_subframe_reserved1, &u32SubFrameData);
7846 /* Bit 8 - 15: SubframeData.dataLength */
7847 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep, hf_pn_io_subframe_data_length, &u32SubFrameData);
7848 /* Bit 16 - 31: SubframeData.reserved_2 */
7849 offset =
7850 dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep, hf_pn_io_subframe_reserved2, &u32SubFrameData);
7851 Position = (guint8) (u32SubFrameData & 0x7F); /* the lower 6 bits */
7852 DataLength =(guint8) ((u32SubFrameData >>8) & 0x0ff); /* bit 8 to 15 */
7853 proto_item_append_text(sub_item, ", Length:%u (0x%x), Pos:%u",
7854 DataLength,DataLength, Position);
7855 u16RemainingLength = u16RemainingLength - 4;
7856 }
7857 return offset;
7858 }
7859  
7860  
7861 /* dissect the IRInfoBlock */
7862 static int
7863 dissect_IRInfoBlock_block(tvbuff_t *tvb, int offset,
7864 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow,
7865 guint16 u16BodyLength _U_)
7866 {
7867 guint16 u16NumberOfIOCR;
7868 guint16 u16SubframeOffset;
7869 guint32 u32SubframeData;
7870 guint16 u16IOCRReference;
7871 e_guid_t IRDataUUID;
7872  
7873  
7874 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
7875 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
7876 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
7877 return offset;
7878 }
7879 offset = dissect_pn_padding(tvb, offset, pinfo, tree, 2);
7880  
7881 offset = dissect_dcerpc_uuid_t(tvb, offset, pinfo, tree, drep,
7882 hf_pn_io_IRData_uuid, &IRDataUUID);
7883  
7884 offset = dissect_pn_padding(tvb, offset, pinfo, tree, 2);
7885  
7886 /* Numbers of IOCRs */
7887 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
7888 hf_pn_io_number_of_iocrs, &u16NumberOfIOCR);
7889  
7890 while (u16NumberOfIOCR--)
7891 { /* IOCRReference */
7892 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep, hf_pn_io_iocr_reference, &u16IOCRReference);
7893  
7894 /* SubframeOffset 16 */
7895 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep, hf_pn_io_iocr_SubframeOffset, &u16SubframeOffset);
7896  
7897 /* SubframeData 32 */
7898 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep, hf_pn_io_iocr_SubframeData, &u32SubframeData);
7899 }
7900 return offset;
7901 }
7902  
7903 /* dissect the SRInfoBlock */
7904 static int
7905 dissect_SRInfoBlock_block(tvbuff_t *tvb, int offset,
7906 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow,
7907 guint16 u16BodyLength _U_)
7908 {
7909 guint16 u16RedundancyDataHoldFactor;
7910 guint32 u32sr_properties;
7911  
7912 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
7913 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
7914 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
7915 return offset;
7916 }
7917 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep, hf_pn_io_RedundancyDataHoldFactor, &u16RedundancyDataHoldFactor);
7918  
7919 dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep, hf_pn_io_sr_properties, &u32sr_properties);
7920 dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep, hf_pn_io_sr_properties_InputValidOnBackupAR, &u32sr_properties);
7921 dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep, hf_pn_io_sr_properties_ActivateRedundancyAlarm, &u32sr_properties);
7922 dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep, hf_pn_io_sr_properties_Reserved_1, &u32sr_properties);
7923 offset =
7924 dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep, hf_pn_io_sr_properties_Reserved_2, &u32sr_properties);
7925 return offset;
7926 }
7927  
7928 /* dissect the PDIRSubframeData block 0x022a */
7929 static int
7930 dissect_PDIRSubframeData_block(tvbuff_t *tvb, int offset,
7931 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
7932 {
7933 guint16 u16NumberOfSubframeBlocks;
7934  
7935 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
7936 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
7937 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
7938 return offset;
7939 }
7940 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep, hf_pn_io_NumberOfSubframeBlocks, &u16NumberOfSubframeBlocks);
7941  
7942 while (u16NumberOfSubframeBlocks --)
7943 { /* dissect the Subframe Block */
7944 offset = dissect_a_block(tvb, offset, pinfo, /*sub_*/tree, drep);
7945 }
7946  
7947 return offset;
7948 }
7949  
7950 static int
7951 dissect_ARVendorBlockReq_block(tvbuff_t *tvb, int offset,
7952 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow,
7953 guint16 u16BodyLength _U_)
7954 {
7955 guint16 APStructureIdentifier;
7956 guint32 gu32API;
7957 guint32 guDataBytes;
7958  
7959 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
7960 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
7961 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
7962 return offset;
7963 }
7964 APStructureIdentifier = ((drep[0] & DREP_LITTLE_ENDIAN)
7965 ? tvb_get_letohs(tvb, offset)
7966 : tvb_get_ntohs(tvb, offset));
7967  
7968 gu32API = ((drep[0] & DREP_LITTLE_ENDIAN)
7969 ? tvb_get_letohl(tvb, offset + 2)
7970 : tvb_get_ntohl (tvb, offset + 2));
7971  
7972 if (tree)
7973 {
7974 if (gu32API == 0)
7975 {
7976 if (APStructureIdentifier <0x8000)
7977 {
7978 proto_tree_add_item(tree, hf_pn_io_arvendor_strucidentifier_if0_low, tvb, offset, 2, DREP_ENC_INTEGER(drep));
7979 }
7980 else
7981 {
7982 if (APStructureIdentifier > 0x8000)
7983 {
7984 proto_tree_add_item(tree, hf_pn_io_arvendor_strucidentifier_if0_high, tvb, offset, 2, DREP_ENC_INTEGER(drep));
7985 }
7986 else /* APStructureIdentifier == 0x8000 */
7987 {
7988 proto_tree_add_item(tree, hf_pn_io_arvendor_strucidentifier_if0_is8000, tvb, offset, 2, DREP_ENC_INTEGER(drep));
7989 }
7990 }
7991 }
7992 else
7993 {
7994 proto_tree_add_item(tree, hf_pn_io_arvendor_strucidentifier_not0, tvb, offset, 2, DREP_ENC_INTEGER(drep));
7995 }
7996 /* API */
7997 proto_tree_add_item(tree, hf_pn_io_api, tvb, offset + 2, 4, DREP_ENC_INTEGER(drep));
7998 }
7999 offset += 6;
8000 if (u16BodyLength < 6 )
8001 return offset; /* there are no user bytes! */
8002 guDataBytes = u16BodyLength - 6;
8003  
8004 dissect_pn_user_data(tvb, offset, pinfo, tree, guDataBytes, "Data ");
8005 return offset;
8006 }
8007  
8008 /* dissect the DataDescription */
8009 static int
8010 dissect_DataDescription(tvbuff_t *tvb, int offset,
8011 packet_info *pinfo, proto_tree *tree, guint8 *drep, ioDataObject *tmp_io_data_object)
8012 {
8013 guint16 u16DataDescription;
8014 guint16 u16SubmoduleDataLength;
8015 guint8 u8LengthIOCS;
8016 guint8 u8LengthIOPS;
8017 proto_item *sub_item;
8018 proto_tree *sub_tree;
8019 guint32 u32SubStart;
8020  
8021 conversation_t *conversation;
8022 stationInfo *station_info = NULL;
8023 ioDataObject *io_data_object;
8024 wmem_list_frame_t *frame;
8025 wmem_list_t *ioobject_list;
8026  
8027 sub_item = proto_tree_add_item(tree, hf_pn_io_data_description_tree, tvb, offset, 0, ENC_NA);
8028 sub_tree = proto_item_add_subtree(sub_item, ett_pn_io_data_description);
8029 u32SubStart = offset;
8030  
8031 /* DataDescription */
8032 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
8033 hf_pn_io_data_description, &u16DataDescription);
8034 /* SubmoduleDataLength */
8035 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
8036 hf_pn_io_submodule_data_length, &u16SubmoduleDataLength);
8037 /* LengthIOCS */
8038 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, sub_tree, drep,
8039 hf_pn_io_length_iocs, &u8LengthIOCS);
8040 /* LengthIOPS */
8041 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, sub_tree, drep,
8042 hf_pn_io_length_iops, &u8LengthIOPS);
8043  
8044 proto_item_append_text(sub_item, ": %s, SubmoduleDataLength: %u, LengthIOCS: %u, u8LengthIOPS: %u",
8045 val_to_str(u16DataDescription, pn_io_data_description, "(0x%x)"),
8046 u16SubmoduleDataLength, u8LengthIOCS, u8LengthIOPS);
8047 proto_item_set_len(sub_item, offset - u32SubStart);
8048  
8049 /* Save new data for IO Data Objects */
8050 if (!pinfo->fd->flags.visited) {
8051 /* Get current conversation endpoints using MAC addresses */
8052 conversation = find_conversation(pinfo->num, &pinfo->dl_src, &pinfo->dl_dst, PT_NONE, 0, 0, 0);
8053 if (conversation == NULL) {
8054 conversation = conversation_new(pinfo->num, &pinfo->dl_src, &pinfo->dl_dst, PT_NONE, 0, 0, 0);
8055 }
8056  
8057 station_info = (stationInfo*)conversation_get_proto_data(conversation, proto_pn_dcp);
8058  
8059 if (station_info != NULL) {
8060 if (u16DataDescription == PN_INPUT_DATADESCRITPION) {
8061 /* INPUT HANDLING */
8062 ioobject_list = station_info->ioobject_data_in;
8063 }
8064 else {
8065 /* OUTPUT HANDLING */
8066 ioobject_list = station_info->ioobject_data_out;
8067 }
8068  
8069 for (frame = wmem_list_head(ioobject_list); frame != NULL; frame = wmem_list_frame_next(frame)) {
8070 io_data_object = (ioDataObject*)wmem_list_frame_data(frame);
8071 if (io_data_object->slotNr == tmp_io_data_object->slotNr && io_data_object->subSlotNr == tmp_io_data_object->subSlotNr) {
8072 /* Write additional data from dissect_ExpectedSubmoduleBlockReq_block() to corresponding io_data_object */
8073 io_data_object->moduleIdentNr = tmp_io_data_object->moduleIdentNr;
8074 io_data_object->subModuleIdentNr = tmp_io_data_object->subModuleIdentNr;
8075 io_data_object->length = u16SubmoduleDataLength;
8076  
8077 io_data_object->moduleNameStr = wmem_strdup(wmem_file_scope(), tmp_io_data_object->moduleNameStr);
8078 io_data_object->profisafeSupported = tmp_io_data_object->profisafeSupported;
8079 io_data_object->discardIOXS = tmp_io_data_object->discardIOXS;
8080 io_data_object->amountInGSDML = tmp_io_data_object->amountInGSDML;
8081 io_data_object->fParameterIndexNr = tmp_io_data_object->fParameterIndexNr;
8082  
8083 break;
8084 }
8085 }
8086 }
8087 }
8088  
8089 return offset;
8090 }
8091  
8092  
8093 /* dissect the ExpectedSubmoduleBlockReq */
8094 static int
8095 dissect_ExpectedSubmoduleBlockReq_block(tvbuff_t *tvb, int offset,
8096 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
8097 {
8098 guint16 u16NumberOfAPIs;
8099 guint32 u32Api;
8100 guint16 u16SlotNr;
8101 guint32 u32ModuleIdentNumber;
8102 guint16 u16ModuleProperties;
8103 guint16 u16NumberOfSubmodules;
8104 guint16 u16SubslotNr;
8105 guint32 u32SubmoduleIdentNumber;
8106 guint16 u16SubmoduleProperties;
8107 proto_item *api_item;
8108 proto_tree *api_tree;
8109 guint32 u32ApiStart;
8110 proto_item *sub_item;
8111 proto_tree *sub_tree;
8112 proto_item *submodule_item;
8113 proto_tree *submodule_tree;
8114 guint32 u32SubStart;
8115  
8116 /* Variable for the search of gsd file */
8117 const char vendorIdStr[] = "VendorID=\"";
8118 const char deviceIdStr[] = "DeviceID=\"";
8119 const char moduleStr[] = "ModuleIdentNumber=\"";
8120 const char subModuleStr[] = "SubmoduleIdentNumber=\"";
8121 const char profisafeStr[] = "PROFIsafeSupported=\"true\"";
8122 const char fParameterStr[] = "<F_ParameterRecordDataItem";
8123 const char fParameterIndexStr[] = "Index=";
8124 const char moduleNameInfo[] = "<Name";
8125 const char moduleValueInfo[] = "Value=\"";
8126  
8127 guint16 searchVendorID = 0;
8128 guint16 searchDeviceID = 0;
8129 gboolean vendorMatch;
8130 gboolean deviceMatch;
8131 conversation_t *conversation;
8132 stationInfo *station_info = NULL;
8133 ioDataObject *io_data_object = NULL; /* Used to transfer data to fct. "dissect_DataDescription()" */
8134  
8135 /* Variable for the search of GSD-file */
8136 guint32 read_vendor_id;
8137 guint32 read_device_id;
8138 guint32 read_module_id;
8139 guint32 read_submodule_id;
8140 gboolean gsdmlFoundFlag;
8141 gchar tmp_moduletext[MAX_NAMELENGTH];
8142 gchar *convertStr; /* GSD-file search */
8143 gchar *pch; /* helppointer, to save temp. the found Networkpath of GSD-file */
8144 gchar *puffer; /* used for fgets() during GSD-file search */
8145 gchar *temp; /* used for fgets() during GSD-file search */
8146 gchar *diropen = NULL; /* saves the final networkpath to open for GSD-files */
8147 GDir *dir;
8148 FILE *fp = NULL; /* filepointer */
8149 const gchar *filename; /* saves the found GSD-file name */
8150  
8151 /* Helppointer initial */
8152 convertStr = (gchar*)wmem_alloc(wmem_packet_scope(), MAX_NAMELENGTH);
8153 convertStr[0] = '\0';
8154 pch = (gchar*)wmem_alloc(wmem_packet_scope(), MAX_LINE_LENGTH);
8155 pch[0] = '\0';
8156 puffer = (gchar*)wmem_alloc(wmem_packet_scope(), MAX_LINE_LENGTH);
8157 puffer[0] = '\0';
8158 temp = (gchar*)wmem_alloc(wmem_packet_scope(), MAX_LINE_LENGTH);
8159 temp[0] = '\0';
8160  
8161 /* Initial */
8162 io_data_object = wmem_new0(wmem_file_scope(), ioDataObject);
8163 io_data_object->profisafeSupported = FALSE;
8164 io_data_object->moduleNameStr = wmem_strdup(wmem_file_scope(), "Unknown");
8165 vendorMatch = FALSE;
8166 deviceMatch = FALSE;
8167 gsdmlFoundFlag = FALSE;
8168  
8169  
8170 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
8171 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
8172 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
8173 return offset;
8174 }
8175  
8176 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
8177 hf_pn_io_number_of_apis, &u16NumberOfAPIs);
8178  
8179 proto_item_append_text(item, ": APIs:%u", u16NumberOfAPIs);
8180  
8181  
8182 /* Get current conversation endpoints using MAC addresses */
8183 conversation = find_conversation(pinfo->num, &pinfo->dl_src, &pinfo->dl_dst, PT_NONE, 0, 0, 0);
8184 if (conversation == NULL) {
8185 conversation = conversation_new(pinfo->num, &pinfo->dl_src, &pinfo->dl_dst, PT_NONE, 0, 0, 0);
8186 }
8187  
8188 station_info = (stationInfo*)conversation_get_proto_data(conversation, proto_pn_dcp);
8189 if (station_info != NULL) {
8190 station_info->gsdFound = FALSE;
8191 station_info->gsdPathLength = FALSE;
8192  
8193 /* Set searchVendorID and searchDeviceID for GSDfile search */
8194 searchVendorID = station_info->u16Vendor_id;
8195 searchDeviceID = station_info->u16Device_id;
8196  
8197 /* Use the given GSD-file networkpath of the PNIO-Preference */
8198 if(pnio_ps_networkpath[0] != '\0') { /* check the length of the given networkpath (array overflow protection) */
8199 station_info->gsdPathLength = TRUE;
8200  
8201 if ((dir = g_dir_open(pnio_ps_networkpath, 0, NULL)) != NULL) {
8202 /* Find all GSD-files within directory */
8203 while ((filename = g_dir_read_name(dir)) != NULL) {
8204  
8205 /* ---- complete the path to open a GSD-file ---- */
8206 diropen = wmem_strdup_printf(wmem_packet_scope(), "%s" G_DIR_SEPARATOR_S "%s", pnio_ps_networkpath, filename);
8207  
8208 /* ---- Open the found GSD-file ---- */
8209 fp = ws_fopen(diropen, "r");
8210  
8211 if(fp != NULL) {
8212 /* ---- Get VendorID & DeviceID ---- */
8213 while(fgets(puffer, MAX_LINE_LENGTH, fp) != NULL) {
8214 /* ----- VendorID ------ */
8215 if((strstr(puffer, vendorIdStr)) != NULL) {
8216 memset (convertStr, 0, sizeof(*convertStr));
8217 pch = strstr(puffer, vendorIdStr);
8218 if (sscanf(pch, "VendorID=\"%[^\"]", convertStr) == 1) {
8219 read_vendor_id = (guint32) strtoul (convertStr, NULL, 0);
8220  
8221 if(read_vendor_id == searchVendorID) {
8222 vendorMatch = TRUE; /* found correct VendorID */
8223 }
8224 }
8225 }
8226  
8227 /* ----- DeviceID ------ */
8228 if((strstr(puffer, deviceIdStr)) != NULL) {
8229 memset(convertStr, 0, sizeof(*convertStr));
8230 pch = strstr(puffer, deviceIdStr);
8231 if (sscanf(pch, "DeviceID=\"%[^\"]", convertStr) == 1) {
8232 read_device_id = (guint32)strtoul(convertStr, NULL, 0);
8233  
8234 if(read_device_id == searchDeviceID) {
8235 deviceMatch = TRUE; /* found correct DeviceID */
8236 }
8237 }
8238 }
8239 }
8240  
8241 fclose(fp);
8242 fp = NULL;
8243  
8244 if(vendorMatch && deviceMatch) {
8245 break; /* Found correct GSD-file! -> Break the searchloop */
8246 }
8247 else {
8248 /* Couldn't find the correct GSD-file to the corresponding device */
8249 vendorMatch = FALSE;
8250 deviceMatch = FALSE;
8251 gsdmlFoundFlag = FALSE;
8252 diropen = ""; /* reset array for next search */
8253 }
8254 }
8255 }
8256  
8257 g_dir_close(dir);
8258 }
8259  
8260 /* ---- Found the correct GSD-file -> set Flag and save the completed path ---- */
8261 if(vendorMatch && deviceMatch) {
8262 gsdmlFoundFlag = TRUE;
8263 station_info->gsdFound = TRUE;
8264 station_info->gsdLocation = wmem_strdup(wmem_file_scope(), diropen);
8265 }
8266 else {
8267 /* Copy searchpath to array for a detailed output message in cyclic data dissection */
8268 station_info->gsdLocation = wmem_strdup_printf(wmem_file_scope(), "%s" G_DIR_SEPARATOR_S "*.xml", pnio_ps_networkpath);
8269 }
8270 }
8271 else {
8272 /* will be used later on in cyclic RTC1 data dissection for detailed output message */
8273 station_info->gsdPathLength = FALSE;
8274 }
8275 }
8276  
8277 while (u16NumberOfAPIs--) {
8278 api_item = proto_tree_add_item(tree, hf_pn_io_api_tree, tvb, offset, 0, ENC_NA);
8279 api_tree = proto_item_add_subtree(api_item, ett_pn_io_api);
8280 u32ApiStart = offset;
8281  
8282 /* API */
8283 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, api_tree, drep,
8284 hf_pn_io_api, &u32Api);
8285 /* SlotNumber */
8286 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, api_tree, drep,
8287 hf_pn_io_slot_nr, &u16SlotNr);
8288 /* ModuleIdentNumber */
8289 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, api_tree, drep,
8290 hf_pn_io_module_ident_number, &u32ModuleIdentNumber);
8291 /* ModuleProperties */
8292 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, api_tree, drep,
8293 hf_pn_io_module_properties, &u16ModuleProperties);
8294 /* NumberOfSubmodules */
8295 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, api_tree, drep,
8296 hf_pn_io_number_of_submodules, &u16NumberOfSubmodules);
8297  
8298 proto_item_append_text(api_item, ": %u, Slot:0x%x, IdentNumber:0x%x Properties:0x%x Submodules:%u",
8299 u32Api, u16SlotNr, u32ModuleIdentNumber, u16ModuleProperties, u16NumberOfSubmodules);
8300  
8301 proto_item_append_text(item, ", Submodules:%u", u16NumberOfSubmodules);
8302  
8303 while (u16NumberOfSubmodules--) {
8304 sub_item = proto_tree_add_item(api_tree, hf_pn_io_submodule_tree, tvb, offset, 0, ENC_NA);
8305 sub_tree = proto_item_add_subtree(sub_item, ett_pn_io_submodule);
8306 u32SubStart = offset;
8307  
8308 /* Subslotnumber */
8309 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
8310 hf_pn_io_subslot_nr, &u16SubslotNr);
8311 /* SubmoduleIdentNumber */
8312 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
8313 hf_pn_io_submodule_ident_number, &u32SubmoduleIdentNumber);
8314 /* SubmoduleProperties */
8315 submodule_item = proto_tree_add_item(sub_tree, hf_pn_io_submodule_properties, tvb, offset, 2, ENC_BIG_ENDIAN);
8316 submodule_tree = proto_item_add_subtree(submodule_item, ett_pn_io_submodule_properties);
8317 dissect_dcerpc_uint16(tvb, offset, pinfo, submodule_tree, drep,
8318 hf_pn_io_submodule_properties_reserved, &u16SubmoduleProperties);
8319 dissect_dcerpc_uint16(tvb, offset, pinfo, submodule_tree, drep,
8320 hf_pn_io_submodule_properties_discard_ioxs, &u16SubmoduleProperties);
8321 dissect_dcerpc_uint16(tvb, offset, pinfo, submodule_tree, drep,
8322 hf_pn_io_submodule_properties_reduce_output_submodule_data_length, &u16SubmoduleProperties);
8323 dissect_dcerpc_uint16(tvb, offset, pinfo, submodule_tree, drep,
8324 hf_pn_io_submodule_properties_reduce_input_submodule_data_length, &u16SubmoduleProperties);
8325 dissect_dcerpc_uint16(tvb, offset, pinfo, submodule_tree, drep,
8326 hf_pn_io_submodule_properties_shared_input, &u16SubmoduleProperties);
8327 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, submodule_tree, drep,
8328 hf_pn_io_submodule_properties_type, &u16SubmoduleProperties);
8329  
8330 io_data_object->slotNr = u16SlotNr;
8331 io_data_object->subSlotNr = u16SubslotNr;
8332 io_data_object->moduleIdentNr = u32ModuleIdentNumber;
8333 io_data_object->subModuleIdentNr = u32SubmoduleIdentNumber;
8334 io_data_object->discardIOXS = u16SubmoduleProperties & 0x0020;
8335  
8336 /* Search the moduleID and subModuleID, find if PROFIsafe and also search for F-Par. Indexnumber
8337 * ---------------------------------------------------------------------------------------------
8338 * Speical case: Module has several ModuleIdentNr. in one GSD-file
8339 * Also with the given parameters of wireshark, some modules were completely equal. For this
8340 * special case a compromise for this problem has been made, to set the module name will
8341 * be more generally displayed.
8342 * Also this searchloop will find the F-Parameter Indexnumber, so that Wireshark is able to
8343 * dissect those F-Parameters correctly, as this index can change between the vendors.
8344 */
8345  
8346 io_data_object->amountInGSDML = 0;
8347 io_data_object->fParameterIndexNr = 0;
8348 io_data_object->profisafeSupported = FALSE;
8349  
8350 if (diropen != NULL) {
8351 fp = ws_fopen(diropen, "r");
8352 }
8353 if(gsdmlFoundFlag && fp != NULL) {
8354 fseek(fp, 0, SEEK_SET);
8355  
8356 /* Find Indexnumber for fParameter */
8357 while(fgets(temp, MAX_LINE_LENGTH, fp) != NULL) {
8358 if((strstr(temp, fParameterStr)) != NULL) {
8359 memset (convertStr, 0, sizeof(*convertStr));
8360  
8361 pch = strstr(temp, fParameterIndexStr);
8362 if (sscanf(pch, "Index=\"%[^\"]", convertStr) == 1) {
8363 io_data_object->fParameterIndexNr = (guint32)strtoul(convertStr, NULL, 0);
8364 }
8365 break; /* found Indexnumber -> break search loop */
8366 }
8367 }
8368  
8369 memset (temp, 0, sizeof(*temp));
8370 fseek(fp, 0, SEEK_SET); /* Set filepointer to the beginning */
8371  
8372 while(fgets(temp, MAX_LINE_LENGTH, fp) != NULL) {
8373 if((strstr(temp, moduleStr)) != NULL) { /* find the String "ModuleIdentNumber=" */
8374 memset (convertStr, 0, sizeof(*convertStr));
8375 pch = strstr(temp, moduleStr); /* search for "ModuleIdentNumber=\"" within GSD-file */
8376 if (sscanf(pch, "ModuleIdentNumber=\"%[^\"]", convertStr) == 1) { /* Change format of Value string-->numeric string */
8377 read_module_id = (guint32)strtoul(convertStr, NULL, 0); /* Change numeric string --> unsigned long; read_module_id contains the Value of the ModuleIdentNumber */
8378  
8379 /* If the found ModuleID matches with the wanted ModuleID, search for the Submodule and break */
8380 if (read_module_id == io_data_object->moduleIdentNr) {
8381 ++io_data_object->amountInGSDML; /* Save the amount of same (!) Module- & SubmoduleIdentNr in one GSD-file */
8382  
8383 while(fgets(temp, MAX_LINE_LENGTH, fp) != NULL) {
8384 if((strstr(temp, moduleNameInfo)) != NULL) { /* find the String "<Name" for the TextID */
8385 long filePosRecord;
8386  
8387 if (sscanf(temp, "%*s TextId=\"%[^\"]", tmp_moduletext) != 1) /* saves the correct TextId for the next searchloop */
8388 break;
8389  
8390 filePosRecord = ftell(fp); /* save the current position of the filepointer (Offset) */
8391 /* ftell() may return -1 for error, don't move fp in this case */
8392 if (filePosRecord >= 0) {
8393 while (fgets(temp, MAX_LINE_LENGTH, fp) != NULL && io_data_object->amountInGSDML == 1) {
8394 /* Find a String with the saved TextID and with a fitting value for it in the same line. This value is the name of the Module! */
8395 if(((strstr(temp, tmp_moduletext)) != NULL) && ((strstr(temp, moduleValueInfo)) != NULL)) {
8396 pch = strstr(temp, moduleValueInfo);
8397 if (sscanf(pch, "Value=\"%[^\"]", io_data_object->moduleNameStr) == 1)
8398 break; /* Found the name of the module */
8399 }
8400 }
8401  
8402 fseek(fp, filePosRecord, SEEK_SET); /* set filepointer to the correct TextID */
8403 }
8404 }
8405  
8406 /* Search for Submoduleidentnumber in GSD-file */
8407 if((strstr(temp, subModuleStr)) != NULL) {
8408 memset (convertStr, 0, sizeof(*convertStr));
8409 pch = strstr(temp, subModuleStr);
8410 if (sscanf(pch, "SubmoduleIdentNumber=\"%[^\"]", convertStr) == 1) {
8411 read_submodule_id = (guint32) strtoul (convertStr, NULL, 0); /* read_submodule_id contains the Value of the SubModuleIdentNumber */
8412  
8413 /* Find "PROFIsafeSupported" flag of the module in GSD-file */
8414 if(read_submodule_id == io_data_object->subModuleIdentNr) {
8415 if((strstr(temp, profisafeStr)) != NULL) {
8416 io_data_object->profisafeSupported = TRUE; /* flag is in the same line as SubmoduleIdentNr */
8417 break;
8418 }
8419 else { /* flag is not in the same line as Submoduleidentnumber -> search for it */
8420 while(fgets(temp, MAX_LINE_LENGTH, fp) != NULL) {
8421 if((strstr(temp, profisafeStr)) != NULL) {
8422 io_data_object->profisafeSupported = TRUE;
8423 break; /* Found the PROFIsafeSupported flag of the module */
8424 }
8425  
8426 else if((strstr(temp, ">")) != NULL) {
8427 break;
8428 }
8429 }
8430 }
8431 }
8432 break; /* Found the PROFIsafe Module */
8433 }
8434 }
8435 }
8436 }
8437 }
8438 }
8439 }
8440  
8441 fclose(fp);
8442 fp = NULL;
8443 }
8444  
8445 switch (u16SubmoduleProperties & 0x03) {
8446 case(0x00): /* no input and no output data (one Input DataDescription Block follows) */
8447 offset = dissect_DataDescription(tvb, offset, pinfo, sub_tree, drep, io_data_object);
8448 break;
8449 case(0x01): /* input data (one Input DataDescription Block follows) */
8450 offset = dissect_DataDescription(tvb, offset, pinfo, sub_tree, drep, io_data_object);
8451 break;
8452 case(0x02): /* output data (one Output DataDescription Block follows) */
8453 offset = dissect_DataDescription(tvb, offset, pinfo, sub_tree, drep, io_data_object);
8454 break;
8455 case(0x03): /* input and output data (one Input and one Output DataDescription Block follows) */
8456 offset = dissect_DataDescription(tvb, offset, pinfo, sub_tree, drep, io_data_object);
8457 offset = dissect_DataDescription(tvb, offset, pinfo, sub_tree, drep, io_data_object);
8458 break;
8459 }
8460  
8461 proto_item_append_text(sub_item, ": Subslot:0x%x, Ident:0x%x Properties:0x%x",
8462 u16SubslotNr, u32SubmoduleIdentNumber, u16SubmoduleProperties);
8463 proto_item_set_len(sub_item, offset - u32SubStart);
8464 }
8465  
8466 proto_item_set_len(api_item, offset - u32ApiStart);
8467 }
8468  
8469 return offset;
8470 }
8471  
8472  
8473 /* dissect the ModuleDiffBlock */
8474 static int
8475 dissect_ModuleDiffBlock_block(tvbuff_t *tvb, int offset,
8476 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
8477 {
8478 guint16 u16NumberOfAPIs;
8479 guint32 u32Api;
8480 guint16 u16NumberOfModules;
8481 guint16 u16SlotNr;
8482 guint32 u32ModuleIdentNumber;
8483 guint16 u16ModuleState;
8484 guint16 u16NumberOfSubmodules;
8485 guint16 u16SubslotNr;
8486 guint32 u32SubmoduleIdentNumber;
8487 guint16 u16SubmoduleState;
8488 proto_item *api_item;
8489 proto_tree *api_tree;
8490 guint32 u32ApiStart;
8491 proto_item *module_item;
8492 proto_tree *module_tree;
8493 guint32 u32ModuleStart;
8494 proto_item *sub_item;
8495 proto_tree *sub_tree;
8496 proto_item *submodule_item;
8497 proto_tree *submodule_tree;
8498 guint32 u32SubStart;
8499  
8500 conversation_t *conversation;
8501 stationInfo *station_info;
8502 wmem_list_frame_t *frame;
8503 moduleDiffInfo *module_diff_info;
8504 moduleDiffInfo *cmp_module_diff_info;
8505  
8506 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
8507 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
8508 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
8509 return offset;
8510 }
8511  
8512 /* NumberOfAPIs */
8513 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
8514 hf_pn_io_number_of_apis, &u16NumberOfAPIs);
8515  
8516 proto_item_append_text(item, ": APIs:%u", u16NumberOfAPIs);
8517  
8518 while (u16NumberOfAPIs--) {
8519 api_item = proto_tree_add_item(tree, hf_pn_io_api_tree, tvb, offset, 0, ENC_NA);
8520 api_tree = proto_item_add_subtree(api_item, ett_pn_io_api);
8521 u32ApiStart = offset;
8522  
8523 /* API */
8524 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, api_tree, drep,
8525 hf_pn_io_api, &u32Api);
8526 /* NumberOfModules */
8527 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, api_tree, drep,
8528 hf_pn_io_number_of_modules, &u16NumberOfModules);
8529  
8530 proto_item_append_text(api_item, ": %u, Modules: %u",
8531 u32Api, u16NumberOfModules);
8532  
8533 proto_item_append_text(item, ", Modules:%u", u16NumberOfModules);
8534  
8535 while (u16NumberOfModules--) {
8536 module_item = proto_tree_add_item(api_tree, hf_pn_io_module_tree, tvb, offset, 0, ENC_NA);
8537 module_tree = proto_item_add_subtree(module_item, ett_pn_io_module);
8538 u32ModuleStart = offset;
8539  
8540 /* SlotNumber */
8541 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, module_tree, drep,
8542 hf_pn_io_slot_nr, &u16SlotNr);
8543 /* ModuleIdentNumber */
8544 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, module_tree, drep,
8545 hf_pn_io_module_ident_number, &u32ModuleIdentNumber);
8546 /* ModuleState */
8547 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, module_tree, drep,
8548 hf_pn_io_module_state, &u16ModuleState);
8549 /* NumberOfSubmodules */
8550 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, module_tree, drep,
8551 hf_pn_io_number_of_submodules, &u16NumberOfSubmodules);
8552  
8553 proto_item_append_text(module_item, ": Slot 0x%x, Ident: 0x%x State: %s Submodules: %u",
8554 u16SlotNr, u32ModuleIdentNumber,
8555 val_to_str(u16ModuleState, pn_io_module_state, "(0x%x)"),
8556 u16NumberOfSubmodules);
8557  
8558  
8559 if (!pinfo->fd->flags.visited) {
8560 /* Get current conversation endpoints using MAC addresses */
8561 conversation = find_conversation(pinfo->num, &pinfo->dl_src, &pinfo->dl_dst, PT_NONE, 0, 0, 0);
8562 if (conversation == NULL) {
8563 conversation = conversation_new(pinfo->num, &pinfo->dl_src, &pinfo->dl_dst, PT_NONE, 0, 0, 0);
8564 }
8565  
8566 station_info = (stationInfo*)conversation_get_proto_data(conversation, proto_pn_dcp);
8567 if (station_info != NULL) {
8568 for (frame = wmem_list_head(station_info->diff_module); frame != NULL; frame = wmem_list_frame_next(frame)) {
8569 cmp_module_diff_info = (moduleDiffInfo*)wmem_list_frame_data(frame);
8570 if (cmp_module_diff_info->slotNr == u16SlotNr) {
8571 /* Found identical existing object */
8572 break;
8573 }
8574 }
8575  
8576 if (frame == NULL) {
8577 /* new diffModuleInfo data incoming */
8578 module_diff_info = wmem_new(wmem_file_scope(), moduleDiffInfo);
8579 module_diff_info->slotNr = u16SlotNr;
8580 module_diff_info->modulID = u32ModuleIdentNumber;
8581 wmem_list_append(station_info->diff_module, module_diff_info);
8582 }
8583 }
8584 }
8585  
8586 proto_item_append_text(item, ", Submodules:%u", u16NumberOfSubmodules);
8587  
8588 while (u16NumberOfSubmodules--) {
8589 sub_item = proto_tree_add_item(module_tree, hf_pn_io_submodule_tree, tvb, offset, 0, ENC_NA);
8590 sub_tree = proto_item_add_subtree(sub_item, ett_pn_io_submodule);
8591 u32SubStart = offset;
8592  
8593 /* Subslotnumber */
8594 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
8595 hf_pn_io_subslot_nr, &u16SubslotNr);
8596 /* SubmoduleIdentNumber */
8597 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
8598 hf_pn_io_submodule_ident_number, &u32SubmoduleIdentNumber);
8599 /* SubmoduleState */
8600 submodule_item = proto_tree_add_item(sub_tree, hf_pn_io_submodule_state, tvb, offset, 2, ENC_BIG_ENDIAN);
8601 submodule_tree = proto_item_add_subtree(submodule_item, ett_pn_io_submodule_state);
8602 dissect_dcerpc_uint16(tvb, offset, pinfo, submodule_tree, drep,
8603 hf_pn_io_submodule_state_format_indicator, &u16SubmoduleState);
8604 if (u16SubmoduleState & 0x8000) {
8605 dissect_dcerpc_uint16(tvb, offset, pinfo, submodule_tree, drep,
8606 hf_pn_io_submodule_state_ident_info, &u16SubmoduleState);
8607 dissect_dcerpc_uint16(tvb, offset, pinfo, submodule_tree, drep,
8608 hf_pn_io_submodule_state_ar_info, &u16SubmoduleState);
8609 dissect_dcerpc_uint16(tvb, offset, pinfo, submodule_tree, drep,
8610 hf_pn_io_submodule_state_diag_info, &u16SubmoduleState);
8611 dissect_dcerpc_uint16(tvb, offset, pinfo, submodule_tree, drep,
8612 hf_pn_io_submodule_state_maintenance_demanded, &u16SubmoduleState);
8613 dissect_dcerpc_uint16(tvb, offset, pinfo, submodule_tree, drep,
8614 hf_pn_io_submodule_state_maintenance_required, &u16SubmoduleState);
8615 dissect_dcerpc_uint16(tvb, offset, pinfo, submodule_tree, drep,
8616 hf_pn_io_submodule_state_qualified_info, &u16SubmoduleState);
8617 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, submodule_tree, drep,
8618 hf_pn_io_submodule_state_add_info, &u16SubmoduleState);
8619 } else {
8620 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, submodule_tree, drep,
8621 hf_pn_io_submodule_state_detail, &u16SubmoduleState);
8622 }
8623  
8624 proto_item_append_text(sub_item, ": Subslot 0x%x, IdentNumber: 0x%x, State: 0x%x",
8625 u16SubslotNr, u32SubmoduleIdentNumber, u16SubmoduleState);
8626  
8627 proto_item_set_len(sub_item, offset - u32SubStart);
8628 } /* NumberOfSubmodules */
8629  
8630 proto_item_set_len(module_item, offset - u32ModuleStart);
8631 }
8632  
8633 proto_item_set_len(api_item, offset - u32ApiStart);
8634 }
8635  
8636 return offset;
8637 }
8638  
8639  
8640 /* dissect the IsochronousModeData block */
8641 static int
8642 dissect_IsochronousModeData_block(tvbuff_t *tvb, int offset,
8643 packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
8644 {
8645 guint16 u16SlotNr;
8646 guint16 u16SubslotNr;
8647 guint16 u16ControllerApplicationCycleFactor;
8648 guint16 u16TimeDataCycle;
8649 guint32 u32TimeIOInput;
8650 guint32 u32TimeIOOutput;
8651 guint32 u32TimeIOInputValid;
8652 guint32 u32TimeIOOutputValid;
8653  
8654  
8655 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
8656 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
8657 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
8658 return offset;
8659 }
8660  
8661 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
8662  
8663 /* SlotNumber */
8664 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
8665 hf_pn_io_slot_nr, &u16SlotNr);
8666 /* Subslotnumber */
8667 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
8668 hf_pn_io_subslot_nr, &u16SubslotNr);
8669  
8670 /* ControllerApplicationCycleFactor */
8671 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
8672 hf_pn_io_controller_appl_cycle_factor, &u16ControllerApplicationCycleFactor);
8673 /* TimeDataCycle */
8674 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
8675 hf_pn_io_time_data_cycle, &u16TimeDataCycle);
8676 /* TimeIOInput (ns) */
8677 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
8678 hf_pn_io_time_io_input, &u32TimeIOInput);
8679 /* TimeIOOutput (ns) */
8680 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
8681 hf_pn_io_time_io_output, &u32TimeIOOutput);
8682 /* TimeIOInputValid (ns) */
8683 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
8684 hf_pn_io_time_io_input_valid, &u32TimeIOInputValid);
8685 /* TimeIOOutputValid (ns) */
8686 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
8687 hf_pn_io_time_io_output_valid, &u32TimeIOOutputValid);
8688  
8689  
8690 return offset+1;
8691 }
8692  
8693  
8694 /* dissect the MultipleBlockHeader block */
8695 static int
8696 dissect_MultipleBlockHeader_block(tvbuff_t *tvb, int offset,
8697 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow,
8698 guint16 u16BodyLength)
8699 {
8700 guint32 u32Api;
8701 guint16 u16SlotNr;
8702 guint16 u16SubslotNr;
8703 tvbuff_t *new_tvb;
8704  
8705  
8706 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
8707 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
8708 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
8709 return offset;
8710 }
8711  
8712 offset = dissect_pn_align4(tvb, offset, pinfo, tree);
8713  
8714 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
8715 hf_pn_io_api, &u32Api);
8716 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
8717 hf_pn_io_slot_nr, &u16SlotNr);
8718 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
8719 hf_pn_io_subslot_nr, &u16SubslotNr);
8720  
8721 proto_item_append_text(item, ": Api:0x%x Slot:%u Subslot:0x%x",
8722 u32Api, u16SlotNr, u16SubslotNr);
8723  
8724 new_tvb = tvb_new_subset_length(tvb, offset, u16BodyLength-10);
8725 offset = dissect_blocks(new_tvb, 0, pinfo, tree, drep);
8726  
8727 /*offset += u16BodyLength;*/
8728  
8729 return offset;
8730 }
8731  
8732 /* dissect Combined Object Container Content block */
8733 static int
8734 dissect_COContainerContent_block(tvbuff_t *tvb, int offset,
8735 packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow,
8736 guint16 u16Index, guint32 *u32RecDataLen, pnio_ar_t **ar)
8737 {
8738 guint32 u32Api;
8739 guint16 u16SlotNr;
8740 guint16 u16SubslotNr;
8741  
8742 if(u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
8743 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
8744 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
8745 return offset;
8746 }
8747  
8748 offset = dissect_pn_padding(tvb, offset, pinfo, tree, 2);
8749  
8750 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep,
8751 hf_pn_io_api, &u32Api);
8752  
8753 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
8754 hf_pn_io_slot_nr, &u16SlotNr);
8755  
8756 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
8757 hf_pn_io_subslot_nr, &u16SubslotNr);
8758  
8759 offset = dissect_pn_padding(tvb, offset, pinfo, tree, 2);
8760  
8761 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
8762 hf_pn_io_index, &u16Index);
8763  
8764 proto_item_append_text(item, ": Api:0x%x Slot:%u Subslot:0x%x Index:0x%x",
8765 u32Api, u16SlotNr, u16SubslotNr, u16Index);
8766  
8767 if(u16Index != 0x80B0) {
8768 offset = dissect_block(tvb, offset, pinfo, tree, drep, &u16Index, u32RecDataLen, ar);
8769 }
8770  
8771 return offset;
8772 }
8773  
8774  
8775 static const gchar *
8776 indexReservedForProfiles(guint16 u16Index)
8777 {
8778 /* "reserved for profiles" */
8779 if (u16Index >= 0xb000 && u16Index <= 0xbfff) {
8780 return "Reserved for Profiles (subslot specific)";
8781 }
8782 if (u16Index >= 0xd000 && u16Index <= 0xdfff) {
8783 return "Reserved for Profiles (slot specific)";
8784 }
8785 if (u16Index >= 0xec00 && u16Index <= 0xefff) {
8786 return "Reserved for Profiles (AR specific)";
8787 }
8788 if (u16Index >= 0xf400 && u16Index <= 0xf7ff) {
8789 return "Reserved for Profiles (API specific)";
8790 }
8791 if (u16Index >= 0xfc00 /* up to 0xffff */) {
8792 return "Reserved for Profiles (device specific)";
8793 }
8794  
8795 return NULL;
8796 }
8797  
8798  
8799 /* dissect the RecordDataReadQuery block */
8800 static int
8801 dissect_RecordDataReadQuery_block(tvbuff_t *tvb, int offset,
8802 packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint8 *drep _U_, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow,
8803 guint16 u16Index, guint16 u16BodyLength)
8804 {
8805 const gchar *userProfile;
8806  
8807  
8808 if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
8809 expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
8810 "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
8811 return offset;
8812 }
8813  
8814 /* user specified format? */
8815 if (u16Index < 0x8000) {
8816 offset = dissect_pn_user_data(tvb, offset, pinfo, tree, u16BodyLength, "User Specified Data");
8817 return offset;
8818 }
8819  
8820 /* "reserved for profiles"? */
8821 userProfile = indexReservedForProfiles(u16Index);
8822 if (userProfile != NULL) {
8823 offset = dissect_pn_user_data(tvb, offset, pinfo, tree, u16BodyLength, userProfile);
8824 return offset;
8825 }
8826  
8827 return dissect_pn_undecoded(tvb, offset, pinfo, tree, u16BodyLength);
8828 }
8829  
8830  
8831 /* dissect one PN-IO block (depending on the block type) */
8832 static int
8833 dissect_block(tvbuff_t *tvb, int offset,
8834 packet_info *pinfo, proto_tree *tree, guint8 *drep, guint16 *u16Index, guint32 *u32RecDataLen, pnio_ar_t **ar)
8835 {
8836 guint16 u16BlockType;
8837 guint16 u16BlockLength;
8838 guint8 u8BlockVersionHigh;
8839 guint8 u8BlockVersionLow;
8840 proto_item *sub_item;
8841 proto_tree *sub_tree;
8842 guint32 u32SubStart;
8843 guint16 u16BodyLength;
8844 proto_item *header_item;
8845 proto_tree *header_tree;
8846 gint remainingBytes;
8847  
8848 /* from here, we only have big endian (network byte ordering)!!! */
8849 drep[0] &= ~DREP_LITTLE_ENDIAN;
8850  
8851 sub_item = proto_tree_add_item(tree, hf_pn_io_block, tvb, offset, 0, ENC_NA);
8852 sub_tree = proto_item_add_subtree(sub_item, ett_pn_io_block);
8853 u32SubStart = offset;
8854  
8855 header_item = proto_tree_add_item(sub_tree, hf_pn_io_block_header, tvb, offset, 6, ENC_NA);
8856 header_tree = proto_item_add_subtree(header_item, ett_pn_io_block_header);
8857  
8858 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, header_tree, drep,
8859 hf_pn_io_block_type, &u16BlockType);
8860 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, header_tree, drep,
8861 hf_pn_io_block_length, &u16BlockLength);
8862 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, header_tree, drep,
8863 hf_pn_io_block_version_high, &u8BlockVersionHigh);
8864 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, header_tree, drep,
8865 hf_pn_io_block_version_low, &u8BlockVersionLow);
8866  
8867 proto_item_append_text(header_item, ": Type=%s, Length=%u(+4), Version=%u.%u",
8868 val_to_str(u16BlockType, pn_io_block_type, "Unknown (0x%04x)"),
8869 u16BlockLength, u8BlockVersionHigh, u8BlockVersionLow);
8870  
8871 proto_item_set_text(sub_item, "%s",
8872 val_to_str(u16BlockType, pn_io_block_type, "Unknown (0x%04x)"));
8873  
8874 col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",
8875 val_to_str(u16BlockType, pn_io_block_type, "Unknown"));
8876  
8877 /* block length is without type and length fields, but with version field */
8878 /* as it's already dissected, remove it */
8879 u16BodyLength = u16BlockLength - 2;
8880 remainingBytes = tvb_reported_length_remaining(tvb, offset);
8881 if (remainingBytes < 0)
8882 remainingBytes = 0;
8883 if (remainingBytes +2 < u16BodyLength)
8884 {
8885 proto_item_append_text(sub_item, " Block_Length: %d greater than remaining Bytes, trying with Blocklen = remaining (%d)", u16BodyLength, remainingBytes);
8886 u16BodyLength = remainingBytes;
8887 }
8888 switch (u16BlockType) {
8889 case(0x0001):
8890 case(0x0002):
8891 dissect_AlarmNotification_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow,
8892 u16BodyLength);
8893 break;
8894 case(0x0008):
8895 dissect_IODWriteReqHeader_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow,
8896 u16Index, u32RecDataLen, ar);
8897 break;
8898 case(0x0009):
8899 dissect_IODReadReqHeader_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow,
8900 u16Index, u32RecDataLen, ar);
8901 break;
8902 case(0x0010):
8903 dissect_DiagnosisData_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow,
8904 u16BodyLength);
8905 break;
8906 case(0x0012): /* ExpectedIdentificationData */
8907 case(0x0013): /* RealIdentificationData */
8908 dissect_IdentificationData_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
8909 break;
8910 case(0x0014):
8911 dissect_SubstituteValue_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow,
8912 u16BodyLength);
8913 break;
8914 case(0x0015):
8915 dissect_RecordInputDataObjectElement_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
8916 break;
8917 case(0x0016):
8918 dissect_RecordOutputDataObjectElement_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
8919 break;
8920 /* 0x0017 reserved */
8921 case(0x0018):
8922 dissect_ARData_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow, u16BodyLength);
8923 break;
8924 case(0x0019):
8925 dissect_LogData_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
8926 break;
8927 case(0x001A):
8928 dissect_APIData_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
8929 break;
8930 case(0x001B):
8931 dissect_SRLData_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
8932 break;
8933 case(0x0020):
8934 dissect_IandM0_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
8935 break;
8936 case(0x0021):
8937 dissect_IandM1_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
8938 break;
8939 case(0x0022):
8940 dissect_IandM2_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
8941 break;
8942 case(0x0023):
8943 dissect_IandM3_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
8944 break;
8945 case(0x0024):
8946 dissect_IandM4_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
8947 break;
8948 case(0x0025):
8949 dissect_IandM5_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh,u8BlockVersionLow);
8950 break;
8951 case(0x0030):
8952 dissect_IandM0FilterData_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
8953 break;
8954 case(0x0031):
8955 dissect_IandM0FilterData_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
8956 break;
8957 case(0x0032):
8958 dissect_IandM0FilterData_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
8959 break;
8960 case(0x0033):
8961 dissect_IandM5Data_block(tvb, offset, pinfo, sub_tree, sub_item, drep);
8962 break;
8963 case(0x0101):
8964 dissect_ARBlockReq_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow,
8965 ar);
8966 break;
8967 case(0x0102):
8968 dissect_IOCRBlockReq_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow,
8969 *ar);
8970 break;
8971 case(0x0103):
8972 dissect_AlarmCRBlockReq_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow,
8973 *ar);
8974 break;
8975 case(0x0104):
8976 dissect_ExpectedSubmoduleBlockReq_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
8977 break;
8978 case(0x0106):
8979 dissect_MCRBlockReq_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
8980 break;
8981 case(0x0107):
8982 dissect_SubFrameBlock_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow, u16BodyLength);
8983 break;
8984 case(0x0108):
8985 case(0x8108):
8986 dissect_ARVendorBlockReq_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow, u16BodyLength);
8987 break;
8988 case(0x0109):
8989 dissect_IRInfoBlock_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow, u16BodyLength);
8990 break;
8991 case(0x010A):
8992 dissect_SRInfoBlock_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow, u16BodyLength);
8993 break;
8994  
8995  
8996 case(0x0110):
8997 case(0x0111):
8998 case(0x0112):
8999 case(0x0113):
9000 case(0x0114):
9001 case(0x0116):
9002 case(0x0117):
9003 dissect_ControlConnect_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow, ar);
9004 break;
9005  
9006 case(0x0118):
9007 dissect_ControlBlockPrmBegin(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow, u16BodyLength, ar);
9008 break;
9009  
9010 case(0x0119):
9011 dissect_SubmoduleListBlock(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow, u16BodyLength, ar);
9012 break;
9013  
9014 case(0x0200): /* PDPortDataCheck */
9015 dissect_PDPortData_Check_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow,
9016 u16BodyLength);
9017 break;
9018 case(0x0201):
9019 dissect_PDevData_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
9020 break;
9021 case(0x0202): /*dissect_PDPortData_Adjust_block */
9022 dissect_PDPortData_Adjust_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow,
9023 u16BodyLength);
9024 break;
9025 case(0x0203):
9026 dissect_PDSyncData_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
9027 break;
9028 case(0x0204):
9029 dissect_IsochronousModeData_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
9030 break;
9031 case(0x0205):
9032 dissect_PDIRData_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
9033 break;
9034 case(0x0206):
9035 dissect_PDIRGlobalData_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
9036 break;
9037 case(0x0207):
9038 dissect_PDIRFrameData_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow,
9039 u16BodyLength);
9040 break;
9041 case(0x0208):
9042 dissect_PDIRBeginEndData_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow,
9043 u16BodyLength);
9044 break;
9045 case(0x0209):
9046 dissect_AdjustDomainBoundary_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
9047 break;
9048 case(0x020A):
9049 dissect_CheckPeers_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
9050 break;
9051 case(0x020B):
9052 dissect_CheckLineDelay_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
9053 break;
9054 case(0x020C):
9055 dissect_CheckMAUType_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
9056 break;
9057 case(0x020E):
9058 dissect_AdjustMAUType_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
9059 break;
9060 case(0x020F):
9061 dissect_PDPortDataReal_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
9062 break;
9063 case(0x0210):
9064 dissect_AdjustMulticastBoundary_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
9065 break;
9066 case(0x0211):
9067 dissect_PDInterfaceMrpDataAdjust_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow, u16BodyLength);
9068 break;
9069 case(0x0212):
9070 dissect_PDInterfaceMrpDataReal_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow, u16BodyLength);
9071 break;
9072 case(0x0213):
9073 dissect_PDInterfaceMrpDataCheck_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
9074 break;
9075 case(0x0214):
9076 case(0x0215):
9077 dissect_PDPortMrpData_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
9078 break;
9079 case(0x0216):
9080 dissect_MrpManagerParams_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
9081 break;
9082 case(0x0217):
9083 dissect_MrpClientParams_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
9084 break;
9085 case(0x0218):
9086 dissect_MrpRTModeManagerData_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
9087 break;
9088 case(0x0219):
9089 dissect_MrpRingStateData_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
9090 break;
9091 case(0x021A):
9092 dissect_MrpRTStateData_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
9093 break;
9094 case(0x021B):
9095 dissect_AdjustPortState_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
9096 break;
9097 case(0x021C):
9098 dissect_CheckPortState_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
9099 break;
9100 case(0x021D):
9101 dissect_MrpRTModeClientData_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
9102 break;
9103 case(0x021E):
9104 dissect_CheckSyncDifference_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
9105 break;
9106 case(0x021F):
9107 dissect_CheckMAUTypeDifference_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
9108 break;
9109 case(0x0220):
9110 dissect_PDPortFODataReal_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow, u16BodyLength);
9111 break;
9112 case(0x0221):
9113 dissect_FiberOpticManufacturerSpecific_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow, u16BodyLength);
9114 break;
9115 case(0x0222):
9116 dissect_PDPortFODataAdjust_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
9117 break;
9118 case(0x0223):
9119 dissect_PDPortFODataCheck_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
9120 break;
9121 case(0x0226):
9122 dissect_AdjustPreambleLength_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
9123 break;
9124 case(0x0228):
9125 dissect_FiberOpticDiagnosisInfo_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
9126 break;
9127 case(0x022A):
9128 dissect_PDIRSubframeData_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
9129 break;
9130 case(0x022B):
9131 dissect_PDSubFrameBlock_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow, u16BodyLength);
9132 break;
9133  
9134 case(0x0230):
9135 dissect_PDPortFODataCheck_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
9136 break;
9137 case(0x0231):
9138 dissect_MrpInstanceDataAdjust_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow, u16BodyLength);
9139 break;
9140 case(0x0232):
9141 dissect_MrpInstanceDataReal_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow, u16BodyLength);
9142 break;
9143 case(0x0233):
9144 dissect_MrpInstanceDataCheck_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow, u16BodyLength);
9145 break;
9146  
9147 case(0x0240):
9148 dissect_PDInterfaceDataReal_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
9149 break;
9150 case(0x0250):
9151 dissect_PDInterfaceAdjust_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
9152 break;
9153 case(0x0251):
9154 dissect_PDPortStatistic_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
9155 break;
9156 case(0x0400):
9157 dissect_MultipleBlockHeader_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow, u16BodyLength);
9158 break;
9159 case(0x0401):
9160 dissect_COContainerContent_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow, *u16Index, u32RecDataLen, ar);
9161 break;
9162 case(0x0500):
9163 dissect_RecordDataReadQuery_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow, *u16Index, u16BodyLength);
9164 break;
9165 case(0x0600):
9166 dissect_FSHello_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
9167 break;
9168 case(0x0601):
9169 dissect_FSParameter_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
9170 break;
9171 case(0x0608):
9172 dissect_PDInterfaceFSUDataAdjust_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow, u16BodyLength);
9173 break;
9174 case(0x010B):
9175 case(0x0609):
9176 dissect_ARFSUDataAdjust_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow, u16BodyLength);
9177 break;
9178 case(0x0f00):
9179 dissect_Maintenance_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
9180 break;
9181 case(0x8001):
9182 case(0x8002):
9183 dissect_Alarm_ack_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
9184 break;
9185 case(0x8008):
9186 dissect_IODWriteResHeader_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow,
9187 u16Index, u32RecDataLen, ar);
9188 break;
9189 case(0x8009):
9190 dissect_IODReadResHeader_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow,
9191 u16Index, u32RecDataLen, ar);
9192 break;
9193 case(0x8101):
9194 dissect_ARBlockRes_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow, ar);
9195 break;
9196 case(0x8102):
9197 dissect_IOCRBlockRes_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow, *ar);
9198 break;
9199 case(0x8103):
9200 dissect_AlarmCRBlockRes_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow, *ar);
9201 break;
9202 case(0x8104):
9203 dissect_ModuleDiffBlock_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
9204 break;
9205 case(0x8106):
9206 dissect_ARServerBlock(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
9207 break;
9208 case(0x8110):
9209 case(0x8111):
9210 case(0x8112):
9211 case(0x8113):
9212 case(0x8114):
9213 case(0x8116):
9214 case(0x8117):
9215 case(0x8118):
9216 dissect_ControlConnect_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow, ar);
9217 break;
9218 default:
9219 dissect_pn_undecoded(tvb, offset, pinfo, sub_tree, u16BodyLength);
9220 }
9221 offset += u16BodyLength;
9222  
9223 proto_item_set_len(sub_item, offset - u32SubStart);
9224  
9225 return offset;
9226 }
9227  
9228  
9229 /* dissect any PN-IO block */
9230 static int
9231 dissect_a_block(tvbuff_t *tvb, int offset,
9232 packet_info *pinfo, proto_tree *tree, guint8 *drep)
9233 {
9234 guint16 u16Index = 0;
9235 guint32 u32RecDataLen;
9236 pnio_ar_t *ar = NULL;
9237  
9238 offset = dissect_block(tvb, offset, pinfo, tree, drep, &u16Index, &u32RecDataLen, &ar);
9239  
9240 if (ar != NULL) {
9241 pnio_ar_info(tvb, pinfo, tree, ar);
9242 }
9243  
9244 return offset;
9245 }
9246  
9247 /* dissect any number of PN-IO blocks */
9248 static int
9249 dissect_blocks(tvbuff_t *tvb, int offset,
9250 packet_info *pinfo, proto_tree *tree, guint8 *drep)
9251 {
9252 guint16 u16Index = 0;
9253 guint32 u32RecDataLen;
9254 pnio_ar_t *ar = NULL;
9255  
9256  
9257 while (tvb_captured_length(tvb) > (guint) offset) {
9258 offset = dissect_block(tvb, offset, pinfo, tree, drep, &u16Index, &u32RecDataLen, &ar);
9259 u16Index++;
9260 }
9261  
9262 if (ar != NULL) {
9263 pnio_ar_info(tvb, pinfo, tree, ar);
9264 }
9265  
9266 return offset;
9267 }
9268  
9269  
9270 /* dissect a PN-IO (DCE-RPC) request header */
9271 static int
9272 dissect_IPNIO_rqst_header(tvbuff_t *tvb, int offset,
9273 packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep)
9274 {
9275 guint32 u32ArgsMax;
9276 guint32 u32ArgsLen;
9277 guint32 u32MaxCount;
9278 guint32 u32Offset;
9279 guint32 u32ArraySize;
9280  
9281 proto_item *sub_item;
9282 proto_tree *sub_tree;
9283 guint32 u32SubStart;
9284  
9285  
9286 col_set_str(pinfo->cinfo, COL_PROTOCOL, "PNIO-CM");
9287  
9288 /* args_max */
9289 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep,
9290 hf_pn_io_args_max, &u32ArgsMax);
9291 /* args_len */
9292 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep,
9293 hf_pn_io_args_len, &u32ArgsLen);
9294  
9295 sub_item = proto_tree_add_item(tree, hf_pn_io_array, tvb, offset, 0, ENC_NA);
9296 sub_tree = proto_item_add_subtree(sub_item, ett_pn_io);
9297 u32SubStart = offset;
9298  
9299 /* RPC array header */
9300 offset = dissect_ndr_uint32(tvb, offset, pinfo, sub_tree, di, drep,
9301 hf_pn_io_array_max_count, &u32MaxCount);
9302 offset = dissect_ndr_uint32(tvb, offset, pinfo, sub_tree, di, drep,
9303 hf_pn_io_array_offset, &u32Offset);
9304 offset = dissect_ndr_uint32(tvb, offset, pinfo, sub_tree, di, drep,
9305 hf_pn_io_array_act_count, &u32ArraySize);
9306  
9307 proto_item_append_text(sub_item, ": Max: %u, Offset: %u, Size: %u",
9308 u32MaxCount, u32Offset, u32ArraySize);
9309 proto_item_set_len(sub_item, offset - u32SubStart);
9310  
9311 return offset;
9312 }
9313  
9314  
9315 /* dissect a PN-IO (DCE-RPC) response header */
9316 static int
9317 dissect_IPNIO_resp_header(tvbuff_t *tvb, int offset,
9318 packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep)
9319 {
9320 guint32 u32ArgsLen;
9321 guint32 u32MaxCount;
9322 guint32 u32Offset;
9323 guint32 u32ArraySize;
9324  
9325 proto_item *sub_item;
9326 proto_tree *sub_tree;
9327 guint32 u32SubStart;
9328  
9329  
9330 col_set_str(pinfo->cinfo, COL_PROTOCOL, "PNIO-CM");
9331  
9332 offset = dissect_PNIO_status(tvb, offset, pinfo, tree, drep);
9333  
9334 /* args_len */
9335 offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep,
9336 hf_pn_io_args_len, &u32ArgsLen);
9337  
9338 sub_item = proto_tree_add_item(tree, hf_pn_io_array, tvb, offset, 0, ENC_NA);
9339 sub_tree = proto_item_add_subtree(sub_item, ett_pn_io);
9340 u32SubStart = offset;
9341  
9342 /* RPC array header */
9343 offset = dissect_ndr_uint32(tvb, offset, pinfo, sub_tree, di, drep,
9344 hf_pn_io_array_max_count, &u32MaxCount);
9345 offset = dissect_ndr_uint32(tvb, offset, pinfo, sub_tree, di, drep,
9346 hf_pn_io_array_offset, &u32Offset);
9347 offset = dissect_ndr_uint32(tvb, offset, pinfo, sub_tree, di, drep,
9348 hf_pn_io_array_act_count, &u32ArraySize);
9349  
9350 proto_item_append_text(sub_item, ": Max: %u, Offset: %u, Size: %u",
9351 u32MaxCount, u32Offset, u32ArraySize);
9352 proto_item_set_len(sub_item, offset - u32SubStart);
9353  
9354 return offset;
9355 }
9356  
9357  
9358 /* dissect a PN-IO request */
9359 static int
9360 dissect_IPNIO_rqst(tvbuff_t *tvb, int offset,
9361 packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep)
9362 {
9363  
9364 offset = dissect_IPNIO_rqst_header(tvb, offset, pinfo, tree, di, drep);
9365  
9366 offset = dissect_blocks(tvb, offset, pinfo, tree, drep);
9367  
9368 return offset;
9369 }
9370  
9371  
9372 /* dissect a PN-IO response */
9373 static int
9374 dissect_IPNIO_resp(tvbuff_t *tvb, int offset,
9375 packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep)
9376 {
9377  
9378 offset = dissect_IPNIO_resp_header(tvb, offset, pinfo, tree, di, drep);
9379  
9380 offset = dissect_blocks(tvb, offset, pinfo, tree, drep);
9381  
9382 return offset;
9383 }
9384  
9385 /* dissect a PROFIDrive parameter request */
9386 static int
9387 dissect_ProfiDriveParameterRequest(tvbuff_t *tvb, int offset,
9388 packet_info *pinfo, proto_tree *tree, guint8 *drep)
9389 {
9390 guint8 request_reference;
9391 guint8 request_id;
9392 guint8 do_id;
9393 guint8 no_of_parameters;
9394 guint8 addr_idx;
9395 proto_item *profidrive_item;
9396 proto_tree *profidrive_tree;
9397  
9398 profidrive_item = proto_tree_add_item(tree, hf_pn_io_block, tvb, offset, 0, ENC_NA);
9399 profidrive_tree = proto_item_add_subtree(profidrive_item, ett_pn_io_profidrive_parameter_request);
9400 proto_item_set_text(profidrive_item, "PROFIDrive Parameter Request: ");
9401  
9402 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, profidrive_tree, drep,
9403 hf_pn_io_profidrive_request_reference, &request_reference);
9404 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, profidrive_tree, drep,
9405 hf_pn_io_profidrive_request_id, &request_id);
9406 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, profidrive_tree, drep,
9407 hf_pn_io_profidrive_do_id, &do_id);
9408 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, profidrive_tree, drep,
9409 hf_pn_io_profidrive_no_of_parameters, &no_of_parameters);
9410  
9411 proto_item_append_text(profidrive_item, "ReqRef:0x%02x, ReqId:%s, DO:%u, NoOfParameters:%u",
9412 request_reference, val_to_str(request_id, pn_io_profidrive_request_id_vals, "Unknown"),
9413 do_id, no_of_parameters);
9414  
9415 col_add_fstr(pinfo->cinfo, COL_INFO, "PROFIDrive Write Request, ReqRef:0x%02x, %s DO:%u",
9416 request_reference,
9417 request_id==0x01 ? "Read" :
9418 request_id==0x02 ? "Change" :
9419 "",
9420 do_id);
9421  
9422 /* Parameter address list */
9423 for(addr_idx=0; addr_idx<no_of_parameters; addr_idx++) {
9424 guint8 attribute;
9425 guint8 no_of_elems;
9426 guint16 parameter;
9427 guint16 idx;
9428 proto_item *sub_item;
9429 proto_tree *sub_tree;
9430  
9431 sub_item = proto_tree_add_item(profidrive_tree, hf_pn_io_block, tvb, offset, 0, ENC_NA);
9432 sub_tree = proto_item_add_subtree(sub_item, ett_pn_io_profidrive_parameter_address);
9433 proto_item_set_text(sub_item, "Parameter Address %u: ", addr_idx+1);
9434  
9435 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, sub_tree, drep,
9436 hf_pn_io_profidrive_param_attribute, &attribute);
9437 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, sub_tree, drep,
9438 hf_pn_io_profidrive_param_no_of_elems, &no_of_elems);
9439 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
9440 hf_pn_io_profidrive_param_number, &parameter);
9441 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, sub_tree, drep,
9442 hf_pn_io_profidrive_param_subindex, &idx);
9443  
9444 proto_item_append_text(sub_item, "Attr:%s, Elems:%u, Parameter:%u, Index:%u",
9445 val_to_str(attribute, pn_io_profidrive_attribute_vals, "Unknown"), no_of_elems,
9446 parameter, idx);
9447  
9448 if (no_of_elems>1) {
9449 col_append_fstr(pinfo->cinfo, COL_INFO, ", P%d[%d..%d]", parameter, idx, idx+no_of_elems-1);
9450 }
9451 else {
9452 col_append_fstr(pinfo->cinfo, COL_INFO, ", P%d[%d]", parameter, idx);
9453 }
9454 }
9455  
9456 /* in case of change request parameter value list */
9457 if (request_id == 0x02) {
9458 for(addr_idx=0; addr_idx<no_of_parameters; addr_idx++) {
9459 guint8 format;
9460 guint8 no_of_vals;
9461 proto_item *sub_item;
9462 proto_tree *sub_tree;
9463  
9464 sub_item = proto_tree_add_item(profidrive_tree, hf_pn_io_block, tvb, offset, 0, ENC_NA);
9465 sub_tree = proto_item_add_subtree(sub_item, ett_pn_io_profidrive_parameter_value);
9466 proto_item_set_text(sub_item, "Parameter Value %u: ", addr_idx+1);
9467  
9468 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, sub_tree, drep,
9469 hf_pn_io_profidrive_param_format, &format);
9470 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, sub_tree, drep,
9471 hf_pn_io_profidrive_param_no_of_values, &no_of_vals);
9472  
9473 proto_item_append_text(sub_item, "Format:%s, NoOfVals:%u",
9474 val_to_str(format, pn_io_profidrive_format_vals, "Unknown"), no_of_vals);
9475  
9476 while (no_of_vals--)
9477 {
9478 offset = dissect_profidrive_value(tvb, offset, pinfo, sub_tree, drep, format);
9479 }
9480 }
9481 }
9482  
9483 return offset;
9484 }
9485  
9486 static int
9487 dissect_ProfiDriveParameterResponse(tvbuff_t *tvb, int offset,
9488 packet_info *pinfo, proto_tree *tree, guint8 *drep)
9489 {
9490 guint8 request_reference;
9491 guint8 response_id;
9492 guint8 do_id;
9493 guint8 no_of_parameters;
9494 proto_item *profidrive_item;
9495 proto_tree *profidrive_tree;
9496  
9497 profidrive_item = proto_tree_add_item(tree, hf_pn_io_block, tvb, offset, 0, ENC_NA);
9498 profidrive_tree = proto_item_add_subtree(profidrive_item, ett_pn_io_profidrive_parameter_response);
9499 proto_item_set_text(profidrive_item, "PROFIDrive Parameter Response: ");
9500  
9501 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, profidrive_tree, drep,
9502 hf_pn_io_profidrive_request_reference, &request_reference);
9503 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, profidrive_tree, drep,
9504 hf_pn_io_profidrive_response_id, &response_id);
9505 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, profidrive_tree, drep,
9506 hf_pn_io_profidrive_do_id, &do_id);
9507 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, profidrive_tree, drep,
9508 hf_pn_io_profidrive_no_of_parameters, &no_of_parameters);
9509  
9510 proto_item_append_text(profidrive_item, "ReqRef:0x%02x, RspId:%s, DO:%u, NoOfParameters:%u",
9511 request_reference, val_to_str(response_id, pn_io_profidrive_response_id_vals, "Unknown"),
9512 do_id, no_of_parameters);
9513  
9514 col_add_fstr(pinfo->cinfo, COL_INFO, "PROFIDrive Read Response, ReqRef:0x%02x, RspId:%s",
9515 request_reference,
9516 val_to_str(response_id, pn_io_profidrive_response_id_vals, "Unknown response"));
9517 return offset;
9518 }
9519  
9520 static int
9521 dissect_RecordDataRead(tvbuff_t *tvb, int offset,
9522 packet_info *pinfo, proto_tree *tree, guint8 *drep, guint16 u16Index, guint32 u32RecDataLen)
9523 {
9524 const gchar *userProfile;
9525 pnio_ar_t *ar = NULL;
9526  
9527  
9528 /* user specified format? */
9529 if (u16Index < 0x8000) {
9530 offset = dissect_pn_user_data(tvb, offset, pinfo, tree, u32RecDataLen, "User Specified Data");
9531 return offset;
9532 }
9533  
9534 /* profidrive parameter access response */
9535 if (u16Index == 0xb02e || u16Index == 0xb02f) {
9536 return dissect_ProfiDriveParameterResponse(tvb, offset, pinfo, tree, drep);
9537 }
9538  
9539 /* "reserved for profiles"? */
9540 userProfile = indexReservedForProfiles(u16Index);
9541 if (userProfile != NULL) {
9542 offset = dissect_pn_user_data(tvb, offset, pinfo, tree, u32RecDataLen, userProfile);
9543 return offset;
9544 }
9545  
9546 /* see: pn_io_index */
9547 /* single block only */
9548 switch (u16Index) {
9549 case(0x8010): /* Maintenance required in channel coding for one subslot */
9550 case(0x8011): /* Maintenance demanded in channel coding for one subslot */
9551 case(0x8012): /* Maintenance required in all codings for one subslot */
9552 case(0x8013): /* Maintenance demanded in all codings for one subslot */
9553 case(0x801e): /* SubstituteValues for one subslot */
9554 case(0x8028): /* RecordInputDataObjectElement for one subslot */
9555 case(0x8029): /* RecordOutputDataObjectElement for one subslot */
9556 case(0x8050): /* PDInterfaceMrpDataReal for one subslot */
9557 case(0x8051): /* PDInterfaceMrpDataCheck for one subslot */
9558 case(0x8052): /* PDInterfaceMrpDataAdjust for one subslot */
9559 case(0x8053): /* PDPortMrpDataAdjust for one subslot */
9560 case(0x8054): /* PDPortMrpDataReal for one subslot */
9561 case(0x8060): /* PDPortFODataReal for one subslot */
9562 case(0x8061): /* PDPortFODataCheck for one subslot */
9563 case(0x8062): /* PDPortFODataAdjust for one subslot */
9564 case(0x8070): /* PDNCDataCheck for one subslot */
9565 case(0x8071): /* PDPortStatistic for one subslot */
9566 case(0x8080): /* PDInterfaceDataReal */
9567 case(0x8090): /* PDInterfaceFSUDataAdjust */
9568  
9569 case(0xaff0): /* I&M0 */
9570 case(0xaff1): /* I&M1 */
9571 case(0xaff2): /* I&M2 */
9572 case(0xaff3): /* I&M3 */
9573 case(0xaff4): /* I&M4 */
9574 case(0xaff5): /* I&M5 */
9575 case(0xaff6): /* I&M6 */
9576 case(0xaff7): /* I&M7 */
9577 case(0xaff8): /* I&M8 */
9578 case(0xaff9): /* I&M9 */
9579 case(0xaffa): /* I&M10 */
9580 case(0xaffb): /* I&M11 */
9581 case(0xaffc): /* I&M12 */
9582 case(0xaffd): /* I&M13 */
9583 case(0xaffe): /* I&M14 */
9584 case(0xafff): /* I&M15 */
9585  
9586 case(0xc010): /* Maintenance required in channel coding for one slot */
9587 case(0xc011): /* Maintenance demanded in channel coding for one slot */
9588 case(0xc012): /* Maintenance required in all codings for one slot */
9589 case(0xc013): /* Maintenance demanded in all codings for one slot */
9590  
9591 case(0xe002): /* ModuleDiffBlock for one AR */
9592 case(0xe010): /* Maintenance required in channel coding for one AR */
9593 case(0xe011): /* Maintenance demanded in channel coding for one AR */
9594 case(0xe012): /* Maintenance required in all codings for one AR */
9595 case(0xe013): /* Maintenance demanded in all codings for one AR */
9596  
9597 case(0xf010): /* Maintenance required in channel coding for one API */
9598 case(0xf011): /* Maintenance demanded in channel coding for one API */
9599 case(0xf012): /* Maintenance required in all codings for one API */
9600 case(0xf013): /* Maintenance demanded in all codings for one API */
9601 case(0xf020): /* ARData for one API */
9602  
9603 case(0xf820): /* ARData */
9604 case(0xf821): /* APIData */
9605 case(0xf830): /* LogData */
9606 case(0xf831): /* PDevData */
9607 offset = dissect_block(tvb, offset, pinfo, tree, drep, &u16Index, &u32RecDataLen, &ar);
9608 break;
9609  
9610 case(0xf840): /* I&M0FilterData */
9611 {
9612 int end_offset = offset + u32RecDataLen;
9613 offset = dissect_block(tvb, offset, pinfo, tree, drep, &u16Index, &u32RecDataLen, &ar);
9614 if (end_offset > offset)
9615 offset = dissect_block(tvb, offset, pinfo, tree, drep, &u16Index, &u32RecDataLen, &ar);
9616 if (end_offset > offset)
9617 offset = dissect_block(tvb, offset, pinfo, tree, drep, &u16Index, &u32RecDataLen, &ar);
9618 }
9619 break;
9620  
9621 case(0xB050):
9622 case(0xB051):
9623 case(0xB060):
9624 case(0xB061):
9625  
9626 offset = dissect_block(tvb, offset, pinfo, tree, drep, &u16Index, &u32RecDataLen, &ar);
9627 break;
9628  
9629  
9630 /*** multiple blocks possible ***/
9631 case(0x8000): /* ExpectedIdentificationData for one subslot */
9632 case(0x8001): /* RealIdentificationData for one subslot */
9633 case(0x800a): /* Diagnosis in channel decoding for one subslot */
9634 case(0x800b): /* Diagnosis in all codings for one subslot */
9635 case(0x800c): /* Diagnosis, Maintenance, Qualified and Status for one subslot */
9636  
9637 case(0x802a): /* PDPortDataReal */
9638 case(0x802b): /* PDPortDataCheck */
9639 case(0x802d): /* Expected PDSyncData for one subslot with SyncID value 0 for PTCPoverRTA */
9640 case(0x802e): /* Expected PDSyncData for one subslot with SyncID value 0 for PTCPoverRTC */
9641 case(0x802f): /* PDPortDataAdjust */
9642 case(0x8030): /* IsochronousModeData for one subslot */
9643 case(0x8031): /* Expected PDSyncData for one subslot with SyncID value 1 */
9644 case(0x8032):
9645 case(0x8033):
9646 case(0x8034):
9647 case(0x8035):
9648 case(0x8036):
9649 case(0x8037):
9650 case(0x8038):
9651 case(0x8039):
9652 case(0x803a):
9653 case(0x803b):
9654 case(0x803c):
9655 case(0x803d):
9656 case(0x803e):
9657 case(0x803f):
9658 case(0x8040): /* Expected PDSyncData for one subslot with SyncID value 2 ... 30 */
9659 case(0x8041):
9660 case(0x8042):
9661 case(0x8043):
9662 case(0x8044):
9663 case(0x8045):
9664 case(0x8046):
9665 case(0x8047):
9666 case(0x8048):
9667 case(0x8049):
9668 case(0x804a):
9669 case(0x804b):
9670 case(0x804c):
9671 case(0x804d):
9672 case(0x804e):
9673 case(0x804f): /* Expected PDSyncData for one subslot with SyncID value 31 */
9674 case(0x8072): /* PDPortStatistic for one subslot */
9675 case(0xc000): /* ExpectedIdentificationData for one slot */
9676 case(0xc001): /* RealIdentificationData for one slot */
9677 case(0xc00a): /* Diagnosis in channel coding for one slot */
9678 case(0xc00b): /* Diagnosis in all codings for one slot */
9679 case(0xc00c): /* Diagnosis, Maintenance, Qualified and Status for one slot */
9680  
9681 case(0xe000): /* ExpectedIdentificationData for one AR */
9682 case(0xe001): /* RealIdentificationData for one AR */
9683 case(0xe00a): /* Diagnosis in channel decoding for one AR */
9684 case(0xe00b): /* Diagnosis in all codings for one AR */
9685 case(0xe00c): /* Diagnosis, Maintenance, Qualified and Status for one AR */
9686 case(0xe030): /* IsochronousModeData for one AR */
9687  
9688 case(0xf000): /* RealIdentificationData for one API */
9689 case(0xf00a): /* Diagnosis in channel decoding for one API */
9690 case(0xf00b): /* Diagnosis in all codings for one API */
9691 case(0xf00c): /* Diagnosis, Maintenance, Qualified and Status for one API */
9692  
9693 case(0xf80c): /* Diagnosis, Maintenance, Qualified and Status for one device */
9694 case(0xf841): /* PDRealData */
9695 case(0xf842): /* PDExpectedData */
9696 offset = dissect_blocks(tvb, offset, pinfo, tree, drep);
9697 break;
9698 default:
9699 offset = dissect_pn_undecoded(tvb, offset, pinfo, tree, u32RecDataLen);
9700 }
9701  
9702 return offset;
9703 }
9704  
9705  
9706 /* dissect a PN-IO read response */
9707 static int
9708 dissect_IPNIO_Read_resp(tvbuff_t *tvb, int offset,
9709 packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep)
9710 {
9711 guint16 u16Index = 0;
9712 guint32 u32RecDataLen = 0;
9713 pnio_ar_t *ar = NULL;
9714  
9715 offset = dissect_IPNIO_resp_header(tvb, offset, pinfo, tree, di, drep);
9716  
9717 /* IODReadHeader */
9718 offset = dissect_block(tvb, offset, pinfo, tree, drep, &u16Index, &u32RecDataLen, &ar);
9719  
9720 /* RecordDataRead */
9721 if (u32RecDataLen != 0) {
9722 offset = dissect_RecordDataRead(tvb, offset, pinfo, tree, drep, u16Index, u32RecDataLen);
9723 }
9724  
9725 if (ar != NULL) {
9726 pnio_ar_info(tvb, pinfo, tree, ar);
9727 }
9728  
9729 return offset;
9730 }
9731  
9732 /* F-Parameter record data object */
9733 static int
9734 dissect_ProfiSafeParameterRequest(tvbuff_t *tvb, int offset,
9735 packet_info *pinfo, proto_tree *tree, guint8 *drep, guint16 u16Index, wmem_list_frame_t *frame)
9736 {
9737 proto_item *f_item;
9738 proto_tree *f_tree;
9739 proto_item *flags1_item;
9740 proto_tree *flags1_tree;
9741 proto_item *flags2_item;
9742 proto_tree *flags2_tree;
9743 guint16 src_addr;
9744 guint16 dst_addr;
9745 guint16 wd_time;
9746 guint16 par_crc;
9747 guint32 ipar_crc;
9748 guint8 prm_flag1;
9749 guint8 prm_flag1_chck_seq;
9750 guint8 prm_flag1_chck_ipar;
9751 guint8 prm_flag1_sil;
9752 guint8 prm_flag1_crc_len;
9753 guint8 prm_flag1_crc_seed;
9754 guint8 prm_flag1_reserved;
9755 guint8 prm_flag2;
9756 guint8 prm_flag2_reserved;
9757 guint8 prm_flag2_f_block_id;
9758 guint8 prm_flag2_f_par_version;
9759  
9760 conversation_t *conversation;
9761 stationInfo *station_info;
9762 ioDataObject *io_data_object;
9763 wmem_list_frame_t *frame_out;
9764  
9765 f_item = proto_tree_add_item(tree, hf_pn_io_block, tvb, offset, 0, ENC_NA);
9766 f_tree = proto_item_add_subtree(f_item, ett_pn_io_profisafe_f_parameter);
9767 proto_item_set_text(f_item, "F-Parameter: ");
9768  
9769 flags1_item = proto_tree_add_item(f_tree, hf_pn_io_ps_f_prm_flag1, tvb, offset, 1, ENC_BIG_ENDIAN);
9770 flags1_tree = proto_item_add_subtree(flags1_item, ett_pn_io_profisafe_f_parameter_prm_flag1);
9771  
9772 /* dissection of F_Prm_Flag1 */
9773 dissect_dcerpc_uint8(tvb, offset, pinfo, flags1_tree, drep,
9774 hf_pn_io_ps_f_prm_flag1_chck_seq, &prm_flag1_chck_seq);
9775 dissect_dcerpc_uint8(tvb, offset, pinfo, flags1_tree, drep,
9776 hf_pn_io_ps_f_prm_flag1_chck_ipar, &prm_flag1_chck_ipar);
9777 dissect_dcerpc_uint8(tvb, offset, pinfo, flags1_tree, drep,
9778 hf_pn_io_ps_f_prm_flag1_sil, &prm_flag1_sil);
9779 dissect_dcerpc_uint8(tvb, offset, pinfo, flags1_tree, drep,
9780 hf_pn_io_ps_f_prm_flag1_crc_len, &prm_flag1_crc_len);
9781 dissect_dcerpc_uint8(tvb, offset, pinfo, flags1_tree, drep,
9782 hf_pn_io_ps_f_prm_flag1_crc_seed, &prm_flag1_crc_seed);
9783 dissect_dcerpc_uint8(tvb, offset, pinfo, flags1_tree, drep,
9784 hf_pn_io_ps_f_prm_flag1_reserved, &prm_flag1_reserved);
9785 prm_flag1 = prm_flag1_chck_seq|prm_flag1_chck_ipar|prm_flag1_sil|prm_flag1_crc_len|prm_flag1_crc_seed|prm_flag1_reserved;
9786 offset++;
9787  
9788 flags2_item = proto_tree_add_item(f_tree, hf_pn_io_ps_f_prm_flag2, tvb, offset, 1, ENC_BIG_ENDIAN);
9789 flags2_tree = proto_item_add_subtree(flags2_item, ett_pn_io_profisafe_f_parameter_prm_flag2);
9790  
9791 /* dissection of F_Prm_Flag2 */
9792 dissect_dcerpc_uint8(tvb, offset, pinfo, flags2_tree, drep,
9793 hf_pn_io_ps_f_prm_flag2_reserved, &prm_flag2_reserved);
9794 dissect_dcerpc_uint8(tvb, offset, pinfo, flags2_tree, drep,
9795 hf_pn_io_ps_f_prm_flag2_f_block_id, &prm_flag2_f_block_id);
9796 dissect_dcerpc_uint8(tvb, offset, pinfo, flags2_tree, drep,
9797 hf_pn_io_ps_f_prm_flag2_f_par_version, &prm_flag2_f_par_version);
9798 prm_flag2 = prm_flag2_reserved|prm_flag2_f_block_id|prm_flag2_f_par_version;
9799 offset++;
9800  
9801 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, f_item, drep,
9802 hf_pn_io_ps_f_src_adr, &src_addr);
9803 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, f_item, drep,
9804 hf_pn_io_ps_f_dest_adr, &dst_addr);
9805 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, f_item, drep,
9806 hf_pn_io_ps_f_wd_time, &wd_time);
9807  
9808 /* Dissection for F_iPar_CRC: see F_Prm_Flag2 -> F_Block_ID */
9809 if( (prm_flag2_f_block_id & 0x08) && !(prm_flag2_f_block_id & 0x20) ) {
9810 offset = dissect_dcerpc_uint32(tvb, offset, pinfo, f_item, drep,
9811 hf_pn_io_ps_f_ipar_crc, &ipar_crc);
9812 }
9813  
9814 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, f_item, drep,
9815 hf_pn_io_ps_f_par_crc, &par_crc);
9816  
9817  
9818 /* Differniate between ipar_crc and no_ipar_crc */
9819 if( (prm_flag2_f_block_id & 0x08) && !(prm_flag2_f_block_id & 0x20) ) { /* include ipar_crc display */
9820 col_append_fstr(pinfo->cinfo, COL_INFO,
9821 ", F-Parameter record, prm_flag1:0x%02x, prm_flag2:0x%02x, src:0x%04x,"
9822 " dst:0x%04x, wd_time:%d, ipar_crc:0x%04x, crc:0x%04x",
9823 prm_flag1, prm_flag2, src_addr, dst_addr, wd_time, ipar_crc, par_crc);
9824  
9825 proto_item_append_text(f_item, "prm_flag1:0x%02x, prm_flag2:0x%02x, src:0x%04x, dst:0x%04x, wd_time:%d, ipar_crc:0x%04x, par_crc:0x%04x",
9826 prm_flag1, prm_flag2, src_addr, dst_addr, wd_time, ipar_crc, par_crc);
9827 }
9828 else { /* exclude ipar_crc display */
9829 col_append_fstr(pinfo->cinfo, COL_INFO,
9830 ", F-Parameter record, prm_flag1:0x%02x, prm_flag2:0x%02x, src:0x%04x,"
9831 " dst:0x%04x, wd_time:%d, crc:0x%04x",
9832 prm_flag1, prm_flag2, src_addr, dst_addr, wd_time, par_crc);
9833  
9834 proto_item_append_text(f_item, "prm_flag1:0x%02x, prm_flag2:0x%02x, src:0x%04x, dst:0x%04x, wd_time:%d, par_crc:0x%04x",
9835 prm_flag1, prm_flag2, src_addr, dst_addr, wd_time, par_crc);
9836 }
9837  
9838 if (!pinfo->fd->flags.visited) {
9839 /* Get current conversation endpoints using MAC addresses */
9840 conversation = find_conversation(pinfo->num, &pinfo->dl_src, &pinfo->dl_dst, PT_NONE, 0, 0, 0);
9841 if (conversation == NULL) {
9842 conversation = conversation_new(pinfo->num, &pinfo->dl_src, &pinfo->dl_dst, PT_NONE, 0, 0, 0);
9843 }
9844  
9845 station_info = (stationInfo*)conversation_get_proto_data(conversation, proto_pn_dcp);
9846 if (station_info != NULL) {
9847 if (frame != NULL) {
9848 io_data_object = (ioDataObject*)wmem_list_frame_data(frame);
9849  
9850 io_data_object->f_par_crc1 = par_crc;
9851 io_data_object->f_src_adr = src_addr;
9852 io_data_object->f_dest_adr = dst_addr;
9853 io_data_object->f_crc_seed = prm_flag1 & 0x40;
9854 if (!(prm_flag1 & 0x10)) {
9855 if (prm_flag1 & 0x20) {
9856 io_data_object->f_crc_len = 4;
9857 } else {
9858 io_data_object->f_crc_len = 3;
9859 }
9860 }
9861 }
9862  
9863 /* Find same module within output data to saved data */
9864 for (frame_out = wmem_list_head(station_info->ioobject_data_out); frame_out != NULL; frame_out = wmem_list_frame_next(frame_out)) {
9865 io_data_object = (ioDataObject*)wmem_list_frame_data(frame_out);
9866 if (u16Index == io_data_object->fParameterIndexNr && /* Check F-Parameter Indexnumber */
9867 io_data_object->profisafeSupported && /* Arrayelement has to be PS-Module */
9868 io_data_object->f_par_crc1 == 0) { /* Find following object with no f_par_crc1 */
9869  
9870 io_data_object->f_par_crc1 = par_crc;
9871 io_data_object->f_src_adr = src_addr;
9872 io_data_object->f_dest_adr = dst_addr;
9873 io_data_object->f_crc_seed = prm_flag1 & 0x40;
9874 if (!(prm_flag1 & 0x10)) {
9875 if (prm_flag1 & 0x20) {
9876 io_data_object->f_crc_len = 4;
9877 } else {
9878 io_data_object->f_crc_len = 3;
9879 }
9880 }
9881  
9882 break;
9883 }
9884 }
9885 }
9886 }
9887  
9888 return offset;
9889 }
9890  
9891 static int
9892 dissect_RecordDataWrite(tvbuff_t *tvb, int offset,
9893 packet_info *pinfo, proto_tree *tree, guint8 *drep, guint16 u16Index, guint32 u32RecDataLen)
9894 {
9895 conversation_t *conversation;
9896 stationInfo *station_info;
9897 wmem_list_frame_t *frame;
9898 ioDataObject *io_data_object;
9899  
9900 const gchar *userProfile;
9901 pnio_ar_t *ar = NULL;
9902  
9903 /* PROFISafe */
9904 /* Get current conversation endpoints using MAC addresses */
9905 conversation = find_conversation(pinfo->num, &pinfo->dl_src, &pinfo->dl_dst, PT_NONE, 0, 0, 0);
9906 if (conversation == NULL) {
9907 conversation = conversation_new(pinfo->num, &pinfo->dl_src, &pinfo->dl_dst, PT_NONE, 0, 0, 0);
9908 }
9909  
9910 station_info = (stationInfo*)conversation_get_proto_data(conversation, proto_pn_dcp);
9911 if (station_info != NULL) {
9912 if (!pinfo->fd->flags.visited) {
9913 /* Search within the entire existing list for current input object data */
9914 for (frame = wmem_list_head(station_info->ioobject_data_in); frame != NULL; frame = wmem_list_frame_next(frame)) {
9915 io_data_object = (ioDataObject*)wmem_list_frame_data(frame);
9916 if (u16Index == io_data_object->fParameterIndexNr && /* Check F-Parameter Indexnumber */
9917 io_data_object->profisafeSupported && /* Arrayelement has to be PS-Module */
9918 io_data_object->f_par_crc1 == 0) { /* Find following object with no f_par_crc1 */
9919  
9920 return dissect_ProfiSafeParameterRequest(tvb, offset, pinfo, tree, drep, u16Index, frame);
9921 }
9922 }
9923 }
9924 else {
9925 /* User clicked another time the frame to see the data -> PROFIsafe data has already been saved
9926 * Check whether the device contains an PROFIsafe supported submodule.
9927 */
9928  
9929 for (frame = wmem_list_head(station_info->ioobject_data_in); frame != NULL; frame = wmem_list_frame_next(frame)) {
9930 io_data_object = (ioDataObject*)wmem_list_frame_data(frame);
9931 if (u16Index == io_data_object->fParameterIndexNr && /* Check F-Parameter Indexnumber */
9932 io_data_object->profisafeSupported) { /* Arrayelement has to be PS-Module */
9933  
9934 return dissect_ProfiSafeParameterRequest(tvb, offset, pinfo, tree, drep, u16Index, frame);
9935 }
9936 }
9937  
9938 for (frame = wmem_list_head(station_info->ioobject_data_out); frame != NULL; frame = wmem_list_frame_next(frame)) {
9939 io_data_object = (ioDataObject*)wmem_list_frame_data(frame);
9940 if (u16Index == io_data_object->fParameterIndexNr && /* Check F-Parameter Indexnumber */
9941 io_data_object->profisafeSupported) { /* Arrayelement has to be PS-Module */
9942  
9943 return dissect_ProfiSafeParameterRequest(tvb, offset, pinfo, tree, drep, u16Index, frame);
9944 }
9945 }
9946 }
9947 }
9948  
9949 /* user specified format? */
9950 if (u16Index < 0x8000) {
9951 return dissect_pn_user_data(tvb, offset, pinfo, tree, u32RecDataLen, "User Specified Data");
9952 }
9953  
9954 /* profidrive parameter request */
9955 if (u16Index == 0xb02e || u16Index == 0xb02f) {
9956 return dissect_ProfiDriveParameterRequest(tvb, offset, pinfo, tree, drep);
9957 }
9958  
9959 /* "reserved for profiles"? */
9960 userProfile = indexReservedForProfiles(u16Index);
9961 if (userProfile != NULL) {
9962 offset = dissect_pn_user_data(tvb, offset, pinfo, tree, u32RecDataLen, userProfile);
9963 return offset;
9964 }
9965  
9966 /* see: pn_io_index */
9967 switch (u16Index) {
9968 case(0x8020): /* PDIRSubframeData */
9969 case(0x801e): /* SubstituteValues for one subslot */
9970 case(0x802b): /* PDPortDataCheck for one subslot */
9971 case(0x802c): /* PDirData for one subslot */
9972 case(0x802d): /* Expected PDSyncData for one subslot with SyncID value 0 for PTCPoverRTA */
9973 case(0x802e): /* Expected PDSyncData for one subslot with SyncID value 0 for PTCPoverRTC */
9974 case(0x802f): /* PDPortDataAdjust for one subslot */
9975 case(0x8030): /* IsochronousModeData for one subslot */
9976 case(0x8051): /* PDInterfaceMrpDataCheck for one subslot */
9977 case(0x8052): /* PDInterfaceMrpDataAdjust for one subslot */
9978 case(0x8053): /* PDPortMrpDataAdjust for one subslot */
9979 case(0x8061): /* PDPortFODataCheck for one subslot */
9980 case(0x8062): /* PDPortFODataAdjust for one subslot */
9981 case(0x8070): /* PDNCDataCheck for one subslot */
9982 case(0x8071): /* PDInterfaceAdjust */
9983 case(0x8090): /* PDInterfaceFSUDataAdjust */
9984 case(0x80B0): /* CombinedObjectContainer*/
9985 case(0xe030): /* IsochronousModeData for one AR */
9986 case(0xe050): /* FastStartUp data for one AR */
9987 offset = dissect_block(tvb, offset, pinfo, tree, drep, &u16Index, &u32RecDataLen, &ar);
9988 break;
9989 default:
9990 offset = dissect_pn_undecoded(tvb, offset, pinfo, tree, u32RecDataLen);
9991 }
9992  
9993 return offset;
9994 }
9995  
9996  
9997 static int
9998 dissect_IODWriteReq(tvbuff_t *tvb, int offset,
9999 packet_info *pinfo, proto_tree *tree, guint8 *drep, pnio_ar_t **ar)
10000 {
10001 guint16 u16Index = 0;
10002 guint32 u32RecDataLen = 0;
10003  
10004  
10005 /* IODWriteHeader */
10006 offset = dissect_block(tvb, offset, pinfo, tree, drep, &u16Index, &u32RecDataLen, ar);
10007  
10008 /* IODWriteMultipleReq? */
10009 if (u16Index == 0xe040) {
10010 while (tvb_captured_length_remaining(tvb, offset) > 0) {
10011 offset = dissect_IODWriteReq(tvb, offset, pinfo, tree, drep, ar);
10012 }
10013 } else {
10014 tvbuff_t *new_tvb = tvb_new_subset_length(tvb, offset, u32RecDataLen);
10015 /* RecordDataWrite */
10016 offset += dissect_RecordDataWrite(new_tvb, 0, pinfo, tree, drep, u16Index, u32RecDataLen);
10017  
10018 /* Padding */
10019 switch (offset % 4) {
10020 case(3):
10021 offset += 1;
10022 break;
10023 case(2):
10024 offset += 2;
10025 break;
10026 case(1):
10027 offset += 3;
10028 break;
10029 }
10030 }
10031  
10032 return offset;
10033 }
10034  
10035 /* dissect a PN-IO write request */
10036 static int
10037 dissect_IPNIO_Write_rqst(tvbuff_t *tvb, int offset,
10038 packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep)
10039 {
10040 pnio_ar_t *ar = NULL;
10041  
10042 offset = dissect_IPNIO_rqst_header(tvb, offset, pinfo, tree, di, drep);
10043  
10044 offset = dissect_IODWriteReq(tvb, offset, pinfo, tree, drep, &ar);
10045  
10046 if (ar != NULL) {
10047 pnio_ar_info(tvb, pinfo, tree, ar);
10048 }
10049  
10050 return offset;
10051 }
10052  
10053  
10054  
10055 static int
10056 dissect_IODWriteRes(tvbuff_t *tvb, int offset,
10057 packet_info *pinfo, proto_tree *tree, guint8 *drep)
10058 {
10059 guint16 u16Index = 0;
10060 guint32 u32RecDataLen;
10061 pnio_ar_t *ar = NULL;
10062  
10063  
10064 /* IODWriteResHeader */
10065 offset = dissect_block(tvb, offset, pinfo, tree, drep, &u16Index, &u32RecDataLen, &ar);
10066  
10067 /* IODWriteMultipleRes? */
10068 if (u16Index == 0xe040) {
10069 while (tvb_captured_length_remaining(tvb, offset) > 0) {
10070 offset = dissect_block(tvb, offset, pinfo, tree, drep, &u16Index, &u32RecDataLen, &ar);
10071 }
10072 }
10073  
10074 if (ar != NULL) {
10075 pnio_ar_info(tvb, pinfo, tree, ar);
10076 }
10077  
10078 return offset;
10079 }
10080  
10081  
10082 /* dissect a PN-IO write response */
10083 static int
10084 dissect_IPNIO_Write_resp(tvbuff_t *tvb, int offset,
10085 packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep)
10086 {
10087  
10088 offset = dissect_IPNIO_resp_header(tvb, offset, pinfo, tree, di, drep);
10089  
10090 offset = dissect_IODWriteRes(tvb, offset, pinfo, tree, drep);
10091  
10092 return offset;
10093 }
10094  
10095  
10096 /* dissect the IOxS (IOCS, IOPS) field */
10097 static int
10098 dissect_PNIO_IOxS(tvbuff_t *tvb, int offset,
10099 packet_info *pinfo _U_, proto_tree *tree, guint8 *drep _U_, int hfindex)
10100 {
10101  
10102 if (tree) {
10103 guint8 u8IOxS;
10104 proto_item *ioxs_item;
10105 proto_tree *ioxs_tree;
10106  
10107 u8IOxS = tvb_get_guint8(tvb, offset);
10108  
10109 /* add ioxs subtree */
10110 ioxs_item = proto_tree_add_uint(tree, hfindex, tvb, offset, 1, u8IOxS);
10111 proto_item_append_text(ioxs_item,
10112 " (%s%s)",
10113 (u8IOxS & 0x01) ? "another IOxS follows " : "",
10114 (u8IOxS & 0x80) ? "good" : "bad");
10115 ioxs_tree = proto_item_add_subtree(ioxs_item, ett_pn_io_ioxs);
10116  
10117 proto_tree_add_uint(ioxs_tree, hf_pn_io_ioxs_datastate, tvb, offset, 1, u8IOxS);
10118 proto_tree_add_uint(ioxs_tree, hf_pn_io_ioxs_instance, tvb, offset, 1, u8IOxS);
10119 proto_tree_add_uint(ioxs_tree, hf_pn_io_ioxs_res14, tvb, offset, 1, u8IOxS);
10120 proto_tree_add_uint(ioxs_tree, hf_pn_io_ioxs_extension, tvb, offset, 1, u8IOxS);
10121 }
10122  
10123 return offset + 1;
10124 }
10125  
10126  
10127 /* dissect a PN-IO Cyclic Service Data Unit (on top of PN-RT protocol) */
10128 static int
10129 dissect_PNIO_C_SDU(tvbuff_t *tvb, int offset,
10130 packet_info *pinfo, proto_tree *tree, guint8 *drep _U_)
10131 {
10132 proto_tree *data_tree = NULL;
10133 /* gint iTotalLen = 0; */
10134 /* gint iSubFrameLen = 0; */
10135  
10136 col_set_str(pinfo->cinfo, COL_PROTOCOL, "PNIO");
10137  
10138 if (tree) {
10139 proto_item *data_item;
10140 data_item = proto_tree_add_protocol_format(tree, proto_pn_io, tvb, offset, tvb_captured_length(tvb),
10141 "PROFINET IO Cyclic Service Data Unit: %u bytes", tvb_captured_length(tvb));
10142 data_tree = proto_item_add_subtree(data_item, ett_pn_io_rtc);
10143 }
10144  
10145 /*dissect_dcerpc_uint16(tvb, offset, pinfo, data_tree, drep, hf_pn_io_packedframe_SFCRC, &u16SFCRC);*/
10146 if (dissect_CSF_SDU_heur(tvb, pinfo, data_tree, NULL))
10147 return(tvb_captured_length(tvb));
10148  
10149 /* XXX - dissect the remaining data */
10150 /* this will be one or more DataItems followed by an optional GAP and RTCPadding */
10151 /* as we don't have the required context information to dissect the specific DataItems, */
10152 /* this will be tricky :-( */
10153 /* actual: there may be an IOxS but most case there isn't so better display a data-stream */
10154 /* offset = dissect_PNIO_IOxS(tvb, offset, pinfo, data_tree, drep, hf_pn_io_ioxs); */
10155 offset = dissect_pn_user_data(tvb, offset, pinfo, tree, tvb_captured_length_remaining(tvb, offset),
10156 "User Data (including GAP and RTCPadding)");
10157  
10158 return offset;
10159 }
10160  
10161  
10162 /* dissect a PN-IO RTA PDU (on top of PN-RT protocol) */
10163 static int
10164 dissect_PNIO_RTA(tvbuff_t *tvb, int offset,
10165 packet_info *pinfo, proto_tree *tree, guint8 *drep)
10166 {
10167 guint16 u16AlarmDstEndpoint;
10168 guint16 u16AlarmSrcEndpoint;
10169 guint8 u8PDUType;
10170 guint8 u8PDUVersion;
10171 guint8 u8WindowSize;
10172 guint8 u8Tack;
10173 guint16 u16SendSeqNum;
10174 guint16 u16AckSeqNum;
10175 guint16 u16VarPartLen;
10176 int start_offset = offset;
10177 guint16 u16Index = 0;
10178 guint32 u32RecDataLen;
10179 pnio_ar_t *ar = NULL;
10180  
10181  
10182 proto_item *rta_item;
10183 proto_tree *rta_tree;
10184  
10185 proto_item *sub_item;
10186 proto_tree *sub_tree;
10187  
10188  
10189 col_set_str(pinfo->cinfo, COL_PROTOCOL, "PNIO-AL");
10190  
10191 rta_item = proto_tree_add_protocol_format(tree, proto_pn_io, tvb, offset, tvb_captured_length(tvb),
10192 "PROFINET IO Alarm");
10193 rta_tree = proto_item_add_subtree(rta_item, ett_pn_io_rta);
10194  
10195 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, rta_tree, drep,
10196 hf_pn_io_alarm_dst_endpoint, &u16AlarmDstEndpoint);
10197 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, rta_tree, drep,
10198 hf_pn_io_alarm_src_endpoint, &u16AlarmSrcEndpoint);
10199  
10200 col_append_fstr(pinfo->cinfo, COL_INFO, ", Src: 0x%x, Dst: 0x%x",
10201 u16AlarmSrcEndpoint, u16AlarmDstEndpoint);
10202  
10203 /* PDU type */
10204 sub_item = proto_tree_add_item(rta_tree, hf_pn_io_pdu_type, tvb, offset, 1, ENC_NA);
10205 sub_tree = proto_item_add_subtree(sub_item, ett_pn_io_pdu_type);
10206 dissect_dcerpc_uint8(tvb, offset, pinfo, sub_tree, drep,
10207 hf_pn_io_pdu_type_type, &u8PDUType);
10208 u8PDUType &= 0x0F;
10209 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, sub_tree, drep,
10210 hf_pn_io_pdu_type_version, &u8PDUVersion);
10211 u8PDUVersion >>= 4;
10212 proto_item_append_text(sub_item, ", Type: %s, Version: %u",
10213 val_to_str(u8PDUType, pn_io_pdu_type, "Unknown"),
10214 u8PDUVersion);
10215  
10216 /* additional flags */
10217 sub_item = proto_tree_add_item(rta_tree, hf_pn_io_add_flags, tvb, offset, 1, ENC_NA);
10218 sub_tree = proto_item_add_subtree(sub_item, ett_pn_io_add_flags);
10219 dissect_dcerpc_uint8(tvb, offset, pinfo, sub_tree, drep,
10220 hf_pn_io_window_size, &u8WindowSize);
10221 u8WindowSize &= 0x0F;
10222 offset = dissect_dcerpc_uint8(tvb, offset, pinfo, sub_tree, drep,
10223 hf_pn_io_tack, &u8Tack);
10224 u8Tack >>= 4;
10225 proto_item_append_text(sub_item, ", Window Size: %u, Tack: %u",
10226 u8WindowSize, u8Tack);
10227  
10228 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, rta_tree, drep,
10229 hf_pn_io_send_seq_num, &u16SendSeqNum);
10230 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, rta_tree, drep,
10231 hf_pn_io_ack_seq_num, &u16AckSeqNum);
10232 offset = dissect_dcerpc_uint16(tvb, offset, pinfo, rta_tree, drep,
10233 hf_pn_io_var_part_len, &u16VarPartLen);
10234  
10235 switch ( u8PDUType & 0x0F) {
10236 case(1): /* Data-RTA */
10237 col_append_str(pinfo->cinfo, COL_INFO, ", Data-RTA");
10238 offset = dissect_block(tvb, offset, pinfo, rta_tree, drep, &u16Index, &u32RecDataLen, &ar);
10239 break;
10240 case(2): /* NACK-RTA */
10241 col_append_str(pinfo->cinfo, COL_INFO, ", NACK-RTA");
10242 /* no additional data */
10243 break;
10244 case(3): /* ACK-RTA */
10245 col_append_str(pinfo->cinfo, COL_INFO, ", ACK-RTA");
10246 /* no additional data */
10247 break;
10248 case(4): /* ERR-RTA */
10249 col_append_str(pinfo->cinfo, COL_INFO, ", ERR-RTA");
10250 offset = dissect_PNIO_status(tvb, offset, pinfo, rta_tree, drep);
10251 break;
10252 default:
10253 offset = dissect_pn_undecoded(tvb, offset, pinfo, tree, tvb_captured_length(tvb));
10254 }
10255  
10256 proto_item_set_len(rta_item, offset - start_offset);
10257  
10258 return offset;
10259 }
10260  
10261  
10262 /* possibly dissect a PN-IO related PN-RT packet */
10263 static gboolean
10264 dissect_PNIO_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
10265 void *data)
10266 {
10267 guint8 drep_data = 0;
10268 guint8 *drep = &drep_data;
10269 guint8 u8CBAVersion;
10270 /* the sub tvb will NOT contain the frame_id here! */
10271 guint16 u16FrameID = GPOINTER_TO_UINT(data);
10272 heur_dtbl_entry_t *hdtbl_entry;
10273  
10274 /*
10275 * In case the packet is a protocol encoded in the basic PNIO transport stream,
10276 * give that protocol a chance to make a heuristic dissection, before we continue
10277 * to dissect it as a normal PNIO packet.
10278 */
10279 if (dissector_try_heuristic(heur_pn_subdissector_list, tvb, pinfo, tree, &hdtbl_entry, NULL))
10280 return TRUE;
10281  
10282 u8CBAVersion = tvb_get_guint8 (tvb, 0);
10283  
10284 /* is this a (none DFP) PNIO class 3 data packet? */
10285 /* frame id must be in valid range (cyclic Real-Time, class=3) */
10286 if ((u16FrameID >= 0x0100 && u16FrameID <= 0x06FF) || /* RTC3 non redundant */
10287 (u16FrameID >= 0x700 && u16FrameID <= 0x0fff)) { /* RTC3 redundant */
10288 dissect_PNIO_C_SDU(tvb, 0, pinfo, tree, drep);
10289 return TRUE;
10290 }
10291  
10292 /* The following range is reserved for following developments */
10293 /* frame id must be in valid range (Reserved) and
10294 * first byte (CBA version field) has to be != 0x11 */
10295 if (u16FrameID >= 0x1000 && u16FrameID <= 0x7fff && u8CBAVersion != 0x11) {
10296 dissect_PNIO_C_SDU(tvb, 0, pinfo, tree, drep);
10297 return TRUE;
10298 }
10299  
10300 /* is this a PNIO class 1 data packet? */
10301 /* frame id must be in valid range (cyclic Real-Time, class=1) and
10302 * first byte (CBA version field) has to be != 0x11 */
10303 if (u16FrameID >= 0x8000 && u16FrameID < 0xbfff && u8CBAVersion != 0x11) {
10304 dissect_PNIO_C_SDU_RTC1(tvb, 0, pinfo, tree, drep);
10305 return TRUE;
10306 }
10307  
10308 /* is this a PNIO class 1 (legacy) data packet? */
10309 /* frame id must be in valid range (cyclic Real-Time, class=1, legacy) and
10310 * first byte (CBA version field) has to be != 0x11 */
10311 if (u16FrameID >= 0xc000 && u16FrameID < 0xfbff && u8CBAVersion != 0x11) {
10312 dissect_PNIO_C_SDU_RTC1(tvb, 0, pinfo, tree, drep);
10313 return TRUE;
10314 }
10315  
10316 /* is this a PNIO high priority alarm packet? */
10317 if (u16FrameID == 0xfc01) {
10318 col_set_str(pinfo->cinfo, COL_INFO, "Alarm High");
10319  
10320 dissect_PNIO_RTA(tvb, 0, pinfo, tree, drep);
10321 return TRUE;
10322 }
10323  
10324 /* is this a PNIO low priority alarm packet? */
10325 if (u16FrameID == 0xfe01) {
10326 col_set_str(pinfo->cinfo, COL_INFO, "Alarm Low");
10327  
10328 dissect_PNIO_RTA(tvb, 0, pinfo, tree, drep);
10329 return TRUE;
10330 }
10331  
10332 /* this PN-RT packet doesn't seem to be PNIO specific */
10333 return FALSE;
10334 }
10335  
10336  
10337  
10338 static gboolean
10339 pn_io_ar_conv_valid(packet_info *pinfo)
10340 {
10341 void* profinet_type = p_get_proto_data(pinfo->pool, pinfo, proto_pn_io, 0);
10342  
10343 return ((profinet_type != NULL) && (GPOINTER_TO_UINT(profinet_type) == 10));
10344 }
10345  
10346 static gchar *
10347 pn_io_ar_conv_filter(packet_info *pinfo)
10348 {
10349 pnio_ar_t *ar = (pnio_ar_t *)p_get_proto_data(wmem_file_scope(), pinfo, proto_pn_io, 0);
10350 void* profinet_type = p_get_proto_data(pinfo->pool, pinfo, proto_pn_io, 0);
10351 char *buf;
10352 address controllermac_addr, devicemac_addr;
10353  
10354 if ((profinet_type == NULL) || (GPOINTER_TO_UINT(profinet_type) != 10) || (ar == NULL)) {
10355 return NULL;
10356 }
10357  
10358 set_address(&controllermac_addr, AT_ETHER, 6, ar->controllermac);
10359 set_address(&devicemac_addr, AT_ETHER, 6, ar->devicemac);
10360  
10361 buf = g_strdup_printf(
10362 "pn_io.ar_uuid == %s || " /* ARUUID */
10363 "(pn_io.alarm_src_endpoint == 0x%x && eth.src == %s) || " /* Alarm CR (contr -> dev) */
10364 "(pn_io.alarm_src_endpoint == 0x%x && eth.src == %s)", /* Alarm CR (dev -> contr) */
10365 guid_to_str(pinfo->pool, (const e_guid_t*) &ar->aruuid),
10366 ar->controlleralarmref, address_to_str(pinfo->pool, &controllermac_addr),
10367 ar->devicealarmref, address_to_str(pinfo->pool, &devicemac_addr));
10368 return buf;
10369 }
10370  
10371 static gchar *
10372 pn_io_ar_conv_data_filter(packet_info *pinfo)
10373 {
10374 pnio_ar_t *ar = (pnio_ar_t *)p_get_proto_data(wmem_file_scope(), pinfo, proto_pn_io, 0);
10375 void* profinet_type = p_get_proto_data(pinfo->pool, pinfo, proto_pn_io, 0);
10376 char *buf, *controllermac_str, *devicemac_str, *guid_str;
10377 address controllermac_addr, devicemac_addr;
10378  
10379 if ((profinet_type == NULL) || (GPOINTER_TO_UINT(profinet_type) != 10) || (ar == NULL)) {
10380 return NULL;
10381 }
10382  
10383 set_address(&controllermac_addr, AT_ETHER, 6, ar->controllermac);
10384 set_address(&devicemac_addr, AT_ETHER, 6, ar->devicemac);
10385  
10386 controllermac_str = address_to_str(pinfo->pool, &controllermac_addr);
10387 devicemac_str = address_to_str(pinfo->pool, &devicemac_addr);
10388 guid_str = guid_to_str(pinfo->pool, (const e_guid_t*) &ar->aruuid);
10389 if (ar->arType == 0x0010) /* IOCARSingle using RT_CLASS_3 */
10390 {
10391 buf = g_strdup_printf(
10392 "pn_io.ar_uuid == %s || " /* ARUUID */
10393 "(pn_rt.frame_id == 0x%x) || (pn_rt.frame_id == 0x%x) || "
10394 "(pn_io.alarm_src_endpoint == 0x%x && eth.src == %s) || " /* Alarm CR (contr -> dev) */
10395 "(pn_io.alarm_src_endpoint == 0x%x && eth.src == %s)", /* Alarm CR (dev -> contr) */
10396 guid_str,
10397 ar->inputframeid, ar->outputframeid,
10398 ar->controlleralarmref, controllermac_str,
10399 ar->devicealarmref, devicemac_str);
10400 }
10401 else
10402 {
10403 buf = g_strdup_printf(
10404 "pn_io.ar_uuid == %s || " /* ARUUID */
10405 "(pn_rt.frame_id == 0x%x && eth.src == %s && eth.dst == %s) || " /* Input CR && dev MAC -> contr MAC */
10406 "(pn_rt.frame_id == 0x%x && eth.src == %s && eth.dst == %s) || " /* Output CR && contr MAC -> dev MAC */
10407 "(pn_io.alarm_src_endpoint == 0x%x && eth.src == %s) || " /* Alarm CR (contr -> dev) */
10408 "(pn_io.alarm_src_endpoint == 0x%x && eth.src == %s)", /* Alarm CR (dev -> contr) */
10409 guid_str,
10410 ar->inputframeid, devicemac_str, controllermac_str,
10411 ar->outputframeid, controllermac_str, devicemac_str,
10412 ar->controlleralarmref, controllermac_str,
10413 ar->devicealarmref, devicemac_str);
10414 }
10415 return buf;
10416 }
10417  
10418  
10419  
10420 /* the PNIO dcerpc interface table */
10421 static dcerpc_sub_dissector pn_io_dissectors[] = {
10422 { 0, "Connect", dissect_IPNIO_rqst, dissect_IPNIO_resp },
10423 { 1, "Release", dissect_IPNIO_rqst, dissect_IPNIO_resp },
10424 { 2, "Read", dissect_IPNIO_rqst, dissect_IPNIO_Read_resp },
10425 { 3, "Write", dissect_IPNIO_Write_rqst, dissect_IPNIO_Write_resp },
10426 { 4, "Control", dissect_IPNIO_rqst, dissect_IPNIO_resp },
10427 { 5, "Read Implicit", dissect_IPNIO_rqst, dissect_IPNIO_Read_resp },
10428 { 0, NULL, NULL, NULL }
10429 };
10430  
10431  
10432 static void
10433 pnio_cleanup(void) {
10434 g_list_free(pnio_ars);
10435 pnio_ars = NULL;
10436 }
10437  
10438  
10439 void
10440 proto_register_pn_io (void)
10441 {
10442 static hf_register_info hf[] = {
10443 { &hf_pn_io_opnum,
10444 { "Operation", "pn_io.opnum",
10445 FT_UINT16, BASE_DEC, NULL, 0x0,
10446 NULL, HFILL }
10447 },
10448 { &hf_pn_io_reserved16,
10449 { "Reserved", "pn_io.reserved16",
10450 FT_UINT16, BASE_HEX, NULL, 0x0,
10451 NULL, HFILL }
10452 },
10453 { &hf_pn_io_array,
10454 { "Array", "pn_io.array",
10455 FT_NONE, BASE_NONE, NULL, 0x0,
10456 NULL, HFILL }
10457 },
10458 { &hf_pn_io_status,
10459 { "Status", "pn_io.status",
10460 FT_NONE, BASE_NONE, NULL, 0x0,
10461 NULL, HFILL }
10462 },
10463 { &hf_pn_io_args_max,
10464 { "ArgsMaximum", "pn_io.args_max",
10465 FT_UINT32, BASE_DEC, NULL, 0x0,
10466 NULL, HFILL }
10467 },
10468 { &hf_pn_io_args_len,
10469 { "ArgsLength", "pn_io.args_len",
10470 FT_UINT32, BASE_DEC_HEX, NULL, 0x0,
10471 NULL, HFILL }
10472 },
10473 { &hf_pn_io_array_max_count,
10474 { "MaximumCount", "pn_io.array_max_count",
10475 FT_UINT32, BASE_DEC, NULL, 0x0,
10476 NULL, HFILL }
10477 },
10478 { &hf_pn_io_array_offset,
10479 { "Offset", "pn_io.array_offset",
10480 FT_UINT32, BASE_DEC_HEX, NULL, 0x0,
10481 NULL, HFILL }
10482 },
10483 { &hf_pn_io_array_act_count,
10484 { "ActualCount", "pn_io.array_act_count",
10485 FT_UINT32, BASE_DEC, NULL, 0x0,
10486 NULL, HFILL }
10487 },
10488  
10489 { &hf_pn_io_ar_data,
10490 { "ARDATA for AR:", "pn_io.ar_data",
10491 FT_NONE, BASE_NONE, 0x0, 0x0,
10492 NULL, HFILL }
10493 },
10494 { &hf_pn_io_ar_type,
10495 { "ARType", "pn_io.ar_type",
10496 FT_UINT16, BASE_HEX, VALS(pn_io_ar_type), 0x0,
10497 NULL, HFILL }
10498 },
10499 { &hf_pn_io_cminitiator_macadd,
10500 { "CMInitiatorMacAdd", "pn_io.cminitiator_mac_add",
10501 FT_ETHER, BASE_NONE, 0x0, 0x0,
10502 NULL, HFILL }
10503 },
10504 { &hf_pn_io_cminitiator_objectuuid,
10505 { "CMInitiatorObjectUUID", "pn_io.cminitiator_uuid",
10506 FT_GUID, BASE_NONE, 0x0, 0x0,
10507 NULL, HFILL }
10508 },
10509 { &hf_pn_io_parameter_server_objectuuid,
10510 { "ParameterServerObjectUUID", "pn_io.parameter_server_objectuuid",
10511 FT_GUID, BASE_NONE, 0x0, 0x0,
10512 NULL, HFILL }
10513 },
10514 { &hf_pn_io_ar_properties,
10515 { "ARProperties", "pn_io.ar_properties",
10516 FT_UINT32, BASE_HEX, NULL, 0x0,
10517 NULL, HFILL }
10518 },
10519 { &hf_pn_io_ar_properties_state,
10520 { "State", "pn_io.ar_properties.state",
10521 FT_UINT32, BASE_HEX, VALS(pn_io_arproperties_state), 0x00000007,
10522 NULL, HFILL }
10523 },
10524 { &hf_pn_io_ar_properties_supervisor_takeover_allowed,
10525 { "SupervisorTakeoverAllowed", "pn_io.ar_properties.supervisor_takeover_allowed",
10526 FT_UINT32, BASE_HEX, VALS(pn_io_arproperties_supervisor_takeover_allowed), 0x00000008,
10527 NULL, HFILL }
10528 },
10529 { &hf_pn_io_ar_properties_parametrization_server,
10530 { "ParametrizationServer", "pn_io.ar_properties.parametrization_server",
10531 FT_UINT32, BASE_HEX, VALS(pn_io_arproperties_parametrization_server), 0x00000010,
10532 NULL, HFILL }
10533 },
10534 { &hf_pn_io_artype_req,
10535 { "ARType", "pn_io.artype_req",
10536 FT_STRING, BASE_NONE, NULL, 0x0,
10537 NULL, HFILL }},
10538 { &hf_pn_io_ar_properties_companion_ar,
10539 { "CompanionAR", "pn_io.ar_properties.companion_ar",
10540 FT_UINT32, BASE_HEX, VALS(pn_io_arproperties_companion_ar), 0x00000600,
10541 NULL, HFILL }
10542 },
10543 { &hf_pn_io_ar_properties_achnowledge_companion_ar,
10544 { "AcknowledgeCompanionAR", "pn_io.ar_properties.acknowledge_companion_ar",
10545 FT_UINT32, BASE_HEX, VALS(pn_io_arproperties_acknowldege_companion_ar), 0x00000800,
10546 NULL, HFILL }
10547 },
10548 { &hf_pn_io_ar_properties_reserved,
10549 { "Reserved", "pn_io.ar_properties.reserved",
10550 FT_UINT32, BASE_HEX, NULL, 0x1FFFF000,
10551 NULL, HFILL }
10552 },
10553 { &hf_pn_io_ar_properties_combined_object_container_with_legacy_startupmode,
10554 { "CombinedObjectContainer", "pn_io.ar_properties.combined_object_container",
10555 FT_UINT32, BASE_HEX, VALS(pn_io_arproperties_combined_object_container_with_legacy_startupmode), 0x20000000,
10556 NULL, HFILL }
10557 },
10558 { &hf_pn_io_ar_properties_combined_object_container_with_advanced_startupmode,
10559 { "CombinedObjectContainer", "pn_io.ar_properties.combined_object_container",
10560 FT_UINT32, BASE_HEX, VALS(pn_io_arproperties_combined_object_container_with_advanced_startupmode), 0x20000000,
10561 NULL, HFILL }
10562 },
10563 { &hf_pn_io_arproperties_StartupMode,
10564 { "StartupMode", "pn_io.ar_properties.StartupMode",
10565 FT_UINT32, BASE_HEX, VALS(pn_io_arpropertiesStartupMode), 0x40000000,
10566 NULL, HFILL }
10567 },
10568 { &hf_pn_io_ar_properties_pull_module_alarm_allowed,
10569 { "PullModuleAlarmAllowed", "pn_io.ar_properties.pull_module_alarm_allowed",
10570 FT_UINT32, BASE_HEX, VALS(pn_io_arproperties_pull_module_alarm_allowed), 0x80000000,
10571 NULL, HFILL }
10572 },
10573 { &hf_pn_RedundancyInfo,
10574 { "RedundancyInfo.EndPoint", "pn_io.srl_data.redundancyInfo",
10575 FT_UINT16, BASE_HEX, VALS(pn_io_RedundancyInfo), 0x0000003,
10576 NULL, HFILL }
10577 },
10578 { &hf_pn_RedundancyInfo_reserved,
10579 { "RedundancyInfo.reserved", "pn_io.srl_data.redundancyInfoReserved",
10580 FT_UINT16, BASE_HEX, NULL, 0xFFFFFFFC,
10581 NULL, HFILL }
10582 },
10583 { &hf_pn_io_number_of_ARDATAInfo,
10584 { "ARDataInfo.NumberOfEntries", "pn_io.number_of_ARDATAInfo",
10585 FT_UINT16, BASE_DEC, NULL, 0x0,
10586 NULL, HFILL }
10587 },
10588  
10589 { &hf_pn_io_cminitiator_activitytimeoutfactor,
10590 { "CMInitiatorActivityTimeoutFactor", "pn_io.cminitiator_activitytimeoutfactor",
10591 FT_UINT16, BASE_DEC, NULL, 0x0,
10592 NULL, HFILL }
10593 }, /* XXX - special values */
10594 { &hf_pn_io_cminitiator_udprtport,
10595 { "CMInitiatorUDPRTPort", "pn_io.cminitiator_udprtport",
10596 FT_UINT16, BASE_HEX, NULL, 0x0,
10597 NULL, HFILL }
10598 }, /* XXX - special values */
10599 { &hf_pn_io_station_name_length,
10600 { "StationNameLength", "pn_io.station_name_length",
10601 FT_UINT16, BASE_DEC_HEX, NULL, 0x0,
10602 NULL, HFILL }
10603 },
10604 { &hf_pn_io_cminitiator_station_name,
10605 { "CMInitiatorStationName", "pn_io.cminitiator_station_name",
10606 FT_STRING, BASE_NONE, NULL, 0x0,
10607 NULL, HFILL }
10608 },
10609 { &hf_pn_io_parameter_server_station_name,
10610 { "ParameterServerStationName", "pn_io.parameter_server_station_name",
10611 FT_STRING, BASE_NONE, NULL, 0x0,
10612 NULL, HFILL }
10613 },
10614 { &hf_pn_io_cmresponder_macadd,
10615 { "CMResponderMacAdd", "pn_io.cmresponder_macadd",
10616 FT_ETHER, BASE_NONE, 0x0, 0x0,
10617 NULL, HFILL }
10618 },
10619 { &hf_pn_io_cmresponder_udprtport,
10620 { "CMResponderUDPRTPort", "pn_io.cmresponder_udprtport",
10621 FT_UINT16, BASE_HEX, NULL, 0x0,
10622 NULL, HFILL }
10623 }, /* XXX - special values */
10624 { &hf_pn_io_number_of_iocrs,
10625 { "NumberOfIOCRs", "pn_io.number_of_iocrs",
10626 FT_UINT16, BASE_DEC, NULL, 0x0,
10627 NULL, HFILL }
10628 },
10629 { &hf_pn_io_iocr_tree,
10630 { "IOCR", "pn_io.iocr_tree",
10631 FT_NONE, BASE_NONE, NULL, 0x0,
10632 NULL, HFILL }
10633 },
10634 { &hf_pn_io_iocr_type,
10635 { "IOCRType", "pn_io.iocr_type",
10636 FT_UINT16, BASE_HEX, VALS(pn_io_iocr_type), 0x0,
10637 NULL, HFILL }
10638 },
10639 { &hf_pn_io_iocr_reference,
10640 { "IOCRReference", "pn_io.iocr_reference",
10641 FT_UINT16, BASE_HEX, NULL, 0x0,
10642 NULL, HFILL }
10643 },
10644 { &hf_pn_io_iocr_SubframeOffset,
10645 { "-> SubframeOffset", "pn_io.subframe_offset",
10646 FT_UINT8, BASE_DEC_HEX, NULL, 0x0,
10647 NULL, HFILL }
10648 },
10649 { &hf_pn_io_iocr_SubframeData,
10650 { "SubframeData", "pn_io.subframe_data",
10651 FT_UINT32, BASE_HEX, NULL, 0x0,
10652 NULL, HFILL }
10653 },
10654 { &hf_pn_io_RedundancyDataHoldFactor,
10655 { "RedundancyDataHoldFactor", "pn_io.RedundancyDataHoldFactor",
10656 FT_UINT16, BASE_HEX, NULL, 0x0,
10657 NULL, HFILL }
10658 },
10659 { &hf_pn_io_sr_properties,
10660 { "SRProperties", "pn_io.sr_properties",
10661 FT_UINT32, BASE_HEX, NULL, 0x0,
10662 NULL, HFILL }
10663 },
10664 { &hf_pn_io_sr_properties_InputValidOnBackupAR,
10665 { "InputValidOnBackupAR", "pn_io.sr_properties.InputValidOnBackupAR",
10666 FT_UINT32, BASE_HEX, VALS(pn_io_sr_properties_BackupAR), 0x01,
10667 NULL, HFILL }
10668 },
10669 { &hf_pn_io_sr_properties_ActivateRedundancyAlarm,
10670 { "ActivateRedundancyAlarm", "pn_io.sr_properties.ActivateRedundancyAlarm",
10671 FT_UINT32, BASE_HEX, VALS(pn_io_sr_properties_ActivateRedundancyAlarm), 0x02,
10672 NULL, HFILL }
10673 },
10674 { &hf_pn_io_sr_properties_Reserved_1,
10675 { "Reserved_1", "pn_io.sr_properties.Reserved_1",
10676 FT_UINT32, BASE_HEX, NULL, 0x0FFFC,
10677 NULL, HFILL }
10678 },
10679 { &hf_pn_io_sr_properties_Reserved_2,
10680 { "Reserved_2", "pn_io.sr_properties.Reserved_2",
10681 FT_UINT32, BASE_HEX, NULL, 0x0FFFF0000,
10682 NULL, HFILL }
10683 },
10684 { &hf_pn_io_arvendor_strucidentifier_if0_low,
10685 { "APStructureIdentifier: Vendor specific", "pn_io.structidentifier_api_0_low",
10686 FT_UINT16, BASE_HEX, NULL, 0x0,
10687 NULL, HFILL }
10688 },
10689 { &hf_pn_io_arvendor_strucidentifier_if0_high,
10690 { "APStructureIdentifier: Administrative number for common profiles", "pn_io.structidentifier_api_0_high",
10691 FT_UINT16, BASE_HEX, NULL, 0x0,
10692 NULL, HFILL }
10693 },
10694 { &hf_pn_io_arvendor_strucidentifier_if0_is8000,
10695 { "APStructureIdentifier: Extended identification rules", "pn_io.tructidentifier_api_0_is8000",
10696 FT_UINT16, BASE_HEX, NULL, 0x0,
10697 NULL, HFILL }
10698 },
10699 { &hf_pn_io_arvendor_strucidentifier_not0,
10700 { "APStructureIdentifier: Administrative number for application profiles", "pn_io.tructidentifier_api_not_0",
10701 FT_UINT16, BASE_HEX, NULL, 0x0,
10702 NULL, HFILL }
10703 },
10704 { &hf_pn_io_lt,
10705 { "LT", "pn_io.lt",
10706 FT_UINT16, BASE_HEX, NULL, 0x0,
10707 NULL, HFILL }
10708 },
10709 { &hf_pn_io_iocr_properties,
10710 { "IOCRProperties", "pn_io.iocr_properties",
10711 FT_UINT32, BASE_HEX, NULL, 0x0,
10712 NULL, HFILL }
10713 },
10714 { &hf_pn_io_iocr_properties_rtclass,
10715 { "RTClass", "pn_io.iocr_properties.rtclass",
10716 FT_UINT32, BASE_HEX, VALS(pn_io_iocr_properties_rtclass), 0x0000000F,
10717 NULL, HFILL }
10718 },
10719 { &hf_pn_io_iocr_properties_reserved_1,
10720 { "Reserved1", "pn_io.iocr_properties.reserved1",
10721 FT_UINT32, BASE_HEX, NULL, 0x00000FF0,
10722 NULL, HFILL }
10723 },
10724 { &hf_pn_io_iocr_properties_media_redundancy,
10725 { "MediaRedundancy", "pn_io.iocr_properties.media_redundancy",
10726 FT_UINT32, BASE_HEX, VALS(pn_io_iocr_properties_media_redundancy), 0x00000800,
10727 NULL, HFILL }
10728 },
10729 { &hf_pn_io_iocr_properties_reserved_2,
10730 { "Reserved2", "pn_io.iocr_properties.reserved2",
10731 FT_UINT32, BASE_HEX, NULL, 0x00FFF000,
10732 NULL, HFILL }
10733 },
10734 { &hf_pn_io_iocr_properties_reserved_3,
10735 { "Reserved3", "pn_io.iocr_properties.reserved3",
10736 FT_UINT32, BASE_HEX, NULL, 0xF000000,
10737 NULL, HFILL }
10738 },
10739 { &hf_pn_io_iocr_properties_fast_forwarding_mac_adr,
10740 { "FastForwardingMACAdr", "pn_io.iocr_properties.fast_forwarding_mac_adr",
10741 FT_UINT32, BASE_HEX, NULL, 0x20000000,
10742 NULL, HFILL }
10743 },
10744 { &hf_pn_io_iocr_properties_distributed_subframe_watchdog,
10745 { "DistributedSubFrameWatchDog", "pn_io.iocr_properties.distributed_subframe_watchdog",
10746 FT_UINT32, BASE_HEX, NULL, 0x40000000,
10747 NULL, HFILL }
10748 },
10749 { &hf_pn_io_iocr_properties_full_subframe_structure,
10750 { "FullSubFrameStructure", "pn_io.iocr_properties.full_subframe_structure",
10751 FT_UINT32, BASE_HEX, NULL, 0x80000000,
10752 NULL, HFILL }
10753 },
10754 { &hf_pn_io_SFIOCRProperties,
10755 { "SFIOCRProperties", "pn_io.SFIOCRProperties",
10756 FT_UINT32, BASE_HEX, NULL, 0x0,
10757 NULL, HFILL }
10758 },
10759 { &hf_pn_io_DistributedWatchDogFactor,
10760 { "SFIOCRProperties.DistributedWatchDogFactor", "pn_io.SFIOCRProperties.DistributedWatchDogFactor",
10761 FT_UINT32, BASE_HEX, NULL, 0x0FF,
10762 NULL, HFILL }
10763 },
10764 { &hf_pn_io_RestartFactorForDistributedWD,
10765 { "SFIOCRProperties.RestartFactorForDistributedWD", "pn_io.SFIOCRProperties.RestartFactorForDistributedWD",
10766 FT_UINT32, BASE_HEX, NULL, 0xff00,
10767 NULL, HFILL }
10768 },
10769 { &hf_pn_io_SFIOCRProperties_DFPmode,
10770 { "SFIOCRProperties.DFPmode", "pn_io.SFIOCRProperties.DFPmode",
10771 FT_UINT32, BASE_HEX, NULL, 0xFF0000,
10772 NULL, HFILL }
10773 },
10774 { &hf_pn_io_SFIOCRProperties_reserved_1,
10775 { "SFIOCRProperties.reserved_1", "pn_io.SFIOCRProperties.reserved_1",
10776 FT_UINT32, BASE_HEX, NULL, 0x0F000000,
10777 NULL, HFILL }
10778 },
10779 { &hf_pn_io_SFIOCRProperties_reserved_2,
10780 { "SFIOCRProperties.reserved_2", "pn_io.SFIOCRProperties.reserved_2",
10781 FT_UINT32, BASE_HEX, NULL, 0x010000000,
10782 NULL, HFILL }
10783 },
10784 { &hf_pn_io_SFIOCRProperties_DFPType,
10785 { "SFIOCRProperties.DFPType", "pn_io.SFIOCRProperties.DFPType",
10786 FT_UINT32, BASE_HEX, VALS(pn_io_SFIOCRProperties_DFPType_vals), 0x020000000,
10787 NULL, HFILL }
10788 },
10789 { &hf_pn_io_SFIOCRProperties_DFPRedundantPathLayout,
10790 { "SFIOCRProperties.DFPRedundantPathLayout", "pn_io.SFIOCRProperties.DFPRedundantPathLayout",
10791 FT_UINT32, BASE_HEX, VALS(pn_io_DFPRedundantPathLayout_decode), 0x040000000,
10792 NULL, HFILL }
10793 },
10794 { &hf_pn_io_SFIOCRProperties_SFCRC16,
10795 { "SFIOCRProperties.SFCRC16", "pn_io.SFIOCRProperties.SFCRC16",
10796 FT_UINT32, BASE_HEX, VALS(pn_io_SFCRC16_Decode), 0x080000000,
10797 NULL, HFILL }
10798 },
10799 { &hf_pn_io_data_length,
10800 { "DataLength", "pn_io.data_length",
10801 FT_UINT16, BASE_DEC_HEX, NULL, 0x0,
10802 NULL, HFILL }
10803 },
10804 { &hf_pn_io_ir_frame_data,
10805 { "Frame data", "pn_io.ir_frame_data",
10806 FT_NONE, BASE_NONE, NULL, 0x0,
10807 NULL, HFILL }
10808 },
10809 { &hf_pn_io_frame_id,
10810 { "FrameID", "pn_io.frame_id",
10811 FT_UINT16, BASE_HEX, NULL, 0x0,
10812 NULL, HFILL }
10813 },
10814 { &hf_pn_io_send_clock_factor,
10815 { "SendClockFactor", "pn_io.send_clock_factor",
10816 FT_UINT16, BASE_DEC, NULL, 0x0,
10817 NULL, HFILL }
10818 }, /* XXX - special values */
10819 { &hf_pn_io_reduction_ratio,
10820 { "ReductionRatio", "pn_io.reduction_ratio",
10821 FT_UINT16, BASE_DEC, NULL, 0x0,
10822 NULL, HFILL }
10823 }, /* XXX - special values */
10824 { &hf_pn_io_phase,
10825 { "Phase", "pn_io.phase",
10826 FT_UINT16, BASE_DEC_HEX, NULL, 0x0,
10827 NULL, HFILL }
10828 },
10829 { &hf_pn_io_sequence,
10830 { "Sequence", "pn_io.sequence",
10831 FT_UINT16, BASE_DEC, NULL, 0x0,
10832 NULL, HFILL }
10833 },
10834 { &hf_pn_io_frame_send_offset,
10835 { "FrameSendOffset", "pn_io.frame_send_offset",
10836 FT_UINT32, BASE_DEC_HEX, NULL, 0x0,
10837 NULL, HFILL }
10838 },
10839 { &hf_pn_io_frame_data_properties,
10840 { "FrameDataProperties", "pn_io.frame_data_properties",
10841 FT_UINT32, BASE_HEX, NULL, 0x0,
10842 NULL, HFILL }
10843 },
10844 { &hf_pn_io_frame_data_properties_forwarding_Mode,
10845 { "ForwardingMode", "pn_io.frame_data_properties_forwardingMode",
10846 FT_UINT32, BASE_HEX, VALS(hf_pn_io_frame_data_properties_forwardingMode), 0x01,
10847 NULL, HFILL }
10848 },
10849 { &hf_pn_io_frame_data_properties_FastForwardingMulticastMACAdd,
10850 { "FastForwardingMulticastMACAdd", "pn_io.frame_data_properties_MulticastMACAdd",
10851 FT_UINT32, BASE_HEX, VALS(hf_pn_io_frame_data_properties_FFMulticastMACAdd), 0x06,
10852 NULL, HFILL }
10853 },
10854 { &hf_pn_io_frame_data_properties_FragmentMode,
10855 { "FragmentationMode", "pn_io.frame_data_properties_FragMode",
10856 FT_UINT32, BASE_HEX, VALS(hf_pn_io_frame_data_properties_FragMode), 0x18,
10857 NULL, HFILL }
10858 },
10859 { &hf_pn_io_frame_data_properties_reserved_1,
10860 { "Reserved_1", "pn_io.frame_data.reserved_1",
10861 FT_UINT32, BASE_HEX, NULL, 0x0000FFE0,
10862 NULL, HFILL }
10863 },
10864 { &hf_pn_io_frame_data_properties_reserved_2,
10865 { "Reserved_2", "pn_io.frame_data.reserved_2",
10866 FT_UINT32, BASE_HEX, NULL, 0xFFFF0000,
10867 NULL, HFILL }
10868 },
10869 { &hf_pn_io_watchdog_factor,
10870 { "WatchdogFactor", "pn_io.watchdog_factor",
10871 FT_UINT16, BASE_DEC, NULL, 0x0,
10872 NULL, HFILL }
10873 },
10874 { &hf_pn_io_data_hold_factor,
10875 { "DataHoldFactor", "pn_io.data_hold_factor",
10876 FT_UINT16, BASE_DEC, NULL, 0x0,
10877 NULL, HFILL }
10878 },
10879 { &hf_pn_io_iocr_tag_header,
10880 { "IOCRTagHeader", "pn_io.iocr_tag_header",
10881 FT_UINT16, BASE_HEX, NULL, 0x0,
10882 NULL, HFILL }
10883 },
10884 { &hf_pn_io_iocr_multicast_mac_add,
10885 { "IOCRMulticastMACAdd", "pn_io.iocr_multicast_mac_add",
10886 FT_ETHER, BASE_NONE, NULL, 0x0,
10887 NULL, HFILL }
10888 },
10889 { &hf_pn_io_number_of_apis,
10890 { "NumberOfAPIs", "pn_io.number_of_apis",
10891 FT_UINT16, BASE_DEC, NULL, 0x0,
10892 NULL, HFILL }
10893 },
10894 { &hf_pn_io_number_of_io_data_objects,
10895 { "NumberOfIODataObjects", "pn_io.number_of_io_data_objects",
10896 FT_UINT16, BASE_DEC, NULL, 0x0,
10897 NULL, HFILL }
10898 },
10899 { &hf_pn_io_number_of_iocs,
10900 { "NumberOfIOCS", "pn_io.number_of_iocs",
10901 FT_UINT16, BASE_DEC, NULL, 0x0,
10902 NULL, HFILL }
10903 },
10904 { &hf_pn_io_iocs_frame_offset,
10905 { "IOCSFrameOffset", "pn_io.iocs_frame_offset",
10906 FT_UINT16, BASE_DEC_HEX, NULL, 0x0,
10907 NULL, HFILL }
10908 },
10909 { &hf_pn_io_alarmcr_type,
10910 { "AlarmCRType", "pn_io.alarmcr_type",
10911 FT_UINT16, BASE_HEX, VALS(pn_io_alarmcr_type), 0x0,
10912 NULL, HFILL }
10913 },
10914 { &hf_pn_io_alarmcr_properties,
10915 { "AlarmCRProperties", "pn_io.alarmcr_properties",
10916 FT_UINT32, BASE_HEX, NULL, 0x0,
10917 NULL, HFILL }
10918 },
10919 { &hf_pn_io_alarmcr_properties_priority,
10920 { "priority", "pn_io.alarmcr_properties.priority",
10921 FT_UINT32, BASE_HEX, VALS(pn_io_alarmcr_properties_priority), 0x00000001,
10922 NULL, HFILL }
10923 },
10924 { &hf_pn_io_alarmcr_properties_transport,
10925 { "Transport", "pn_io.alarmcr_properties.transport",
10926 FT_UINT32, BASE_HEX, VALS(pn_io_alarmcr_properties_transport), 0x00000002,
10927 NULL, HFILL }
10928 },
10929 { &hf_pn_io_alarmcr_properties_reserved,
10930 { "Reserved", "pn_io.alarmcr_properties.reserved",
10931 FT_UINT32, BASE_HEX, NULL, 0xFFFFFFFC,
10932 NULL, HFILL }
10933 },
10934 { &hf_pn_io_rta_timeoutfactor,
10935 { "RTATimeoutFactor", "pn_io.rta_timeoutfactor",
10936 FT_UINT16, BASE_DEC, NULL, 0x0,
10937 NULL, HFILL }
10938 }, /* XXX - special values */
10939 { &hf_pn_io_rta_retries,
10940 { "RTARetries", "pn_io.rta_retries",
10941 FT_UINT16, BASE_DEC, NULL, 0x0,
10942 NULL, HFILL }
10943 }, /* XXX - only values 3 - 15 allowed */
10944 { &hf_pn_io_localalarmref,
10945 { "LocalAlarmReference", "pn_io.localalarmref",
10946 FT_UINT16, BASE_HEX, NULL, 0x0,
10947 NULL, HFILL }
10948 }, /* XXX - special values */
10949 { &hf_pn_io_remotealarmref,
10950 { "RemoteAlarmReference", "pn_io.remotealarmref",
10951 FT_UINT16, BASE_HEX, NULL, 0x0,
10952 NULL, HFILL }
10953 }, /* XXX - special values */
10954 { &hf_pn_io_maxalarmdatalength,
10955 { "MaxAlarmDataLength", "pn_io.maxalarmdatalength",
10956 FT_UINT16, BASE_DEC_HEX, NULL, 0x0,
10957 NULL, HFILL }
10958 }, /* XXX - only values 200 - 1432 allowed */
10959 { &hf_pn_io_alarmcr_tagheaderhigh,
10960 { "AlarmCRTagHeaderHigh", "pn_io.alarmcr_tagheaderhigh",
10961 FT_UINT16, BASE_HEX, NULL, 0x0,
10962 NULL, HFILL }
10963 }, /* XXX - 16 bitfield! */
10964 { &hf_pn_io_alarmcr_tagheaderlow,
10965 { "AlarmCRTagHeaderLow", "pn_io.alarmcr_tagheaderlow",
10966 FT_UINT16, BASE_HEX, NULL, 0x0,
10967 NULL, HFILL }
10968 }, /* XXX - 16 bitfield!*/
10969 { &hf_pn_io_api_tree,
10970 { "API", "pn_io.api_tree",
10971 FT_NONE, BASE_NONE, NULL, 0x0,
10972 NULL, HFILL }
10973 },
10974 { &hf_pn_io_module_tree,
10975 { "Module", "pn_io.module_tree",
10976 FT_NONE, BASE_NONE, NULL, 0x0,
10977 NULL, HFILL }
10978 },
10979 { &hf_pn_io_submodule_tree,
10980 { "Submodule", "pn_io.submodule_tree",
10981 FT_NONE, BASE_NONE, NULL, 0x0,
10982 NULL, HFILL }
10983 },
10984 { &hf_pn_io_io_data_object,
10985 { "IODataObject", "pn_io.io_data_object",
10986 FT_NONE, BASE_NONE, NULL, 0x0,
10987 NULL, HFILL }
10988 },
10989 { &hf_pn_io_io_data_object_frame_offset,
10990 { "IODataObjectFrameOffset", "pn_io.io_data_object.frame_offset",
10991 FT_UINT16, BASE_DEC_HEX, NULL, 0x0,
10992 NULL, HFILL }
10993 },
10994 { &hf_pn_io_io_cs,
10995 { "IOCS", "pn_io.io_cs",
10996 FT_NONE, BASE_NONE, NULL, 0x0,
10997 NULL, HFILL }
10998 },
10999 { &hf_pn_io_substitutionmode,
11000 { "Substitutionmode", "pn_io.substitutionmode",
11001 FT_UINT16, BASE_HEX, VALS(pn_io_substitutionmode), 0x0,
11002 NULL, HFILL }
11003 },
11004 { &hf_pn_io_IRData_uuid,
11005 { "IRDataUUID", "pn_io.IRData_uuid",
11006 FT_GUID, BASE_NONE, NULL, 0x0,
11007 NULL, HFILL }
11008 },
11009 { &hf_pn_io_ar_uuid,
11010 { "ARUUID", "pn_io.ar_uuid",
11011 FT_GUID, BASE_NONE, NULL, 0x0,
11012 NULL, HFILL }
11013 },
11014 { &hf_pn_io_target_ar_uuid,
11015 { "TargetARUUID", "pn_io.target_ar_uuid",
11016 FT_GUID, BASE_NONE, NULL, 0x0,
11017 NULL, HFILL }
11018 },
11019 { &hf_pn_io_api,
11020 { "API", "pn_io.api",
11021 FT_UINT32, BASE_HEX, NULL, 0x0,
11022 NULL, HFILL }
11023 },
11024 { &hf_pn_io_slot_nr,
11025 { "SlotNumber", "pn_io.slot_nr",
11026 FT_UINT16, BASE_HEX, NULL, 0x0,
11027 NULL, HFILL }
11028 },
11029 { &hf_pn_io_subslot_nr,
11030 { "SubslotNumber", "pn_io.subslot_nr",
11031 FT_UINT16, BASE_HEX, NULL, 0x0,
11032 NULL, HFILL }
11033 },
11034 { &hf_pn_io_index,
11035 { "Index", "pn_io.index",
11036 FT_UINT16, BASE_HEX, VALS(pn_io_index), 0x0,
11037 NULL, HFILL }
11038 },
11039 { &hf_pn_io_seq_number,
11040 { "SeqNumber", "pn_io.seq_number",
11041 FT_UINT16, BASE_DEC, NULL, 0x0,
11042 NULL, HFILL }
11043 },
11044 { &hf_pn_io_record_data_length,
11045 { "RecordDataLength", "pn_io.record_data_length",
11046 FT_UINT32, BASE_DEC_HEX, NULL, 0x0,
11047 NULL, HFILL }
11048 },
11049 { &hf_pn_io_add_val1,
11050 { "AdditionalValue1", "pn_io.add_val1",
11051 FT_UINT16, BASE_DEC, NULL, 0x0,
11052 NULL, HFILL }
11053 },
11054 { &hf_pn_io_add_val2,
11055 { "AdditionalValue2", "pn_io.add_val2",
11056 FT_UINT16, BASE_DEC, NULL, 0x0,
11057 NULL, HFILL }
11058 },
11059 { &hf_pn_io_block_header,
11060 { "BlockHeader", "pn_io.block_header",
11061 FT_NONE, BASE_NONE, NULL, 0x0,
11062 NULL, HFILL }
11063 },
11064 { &hf_pn_io_block_type,
11065 { "BlockType", "pn_io.block_type",
11066 FT_UINT16, BASE_HEX, VALS(pn_io_block_type), 0x0,
11067 NULL, HFILL }
11068 },
11069 { &hf_pn_io_block_length,
11070 { "BlockLength", "pn_io.block_length",
11071 FT_UINT16, BASE_DEC_HEX, NULL, 0x0,
11072 NULL, HFILL }
11073 },
11074 { &hf_pn_io_block_version_high,
11075 { "BlockVersionHigh", "pn_io.block_version_high",
11076 FT_UINT8, BASE_DEC, NULL, 0x0,
11077 NULL, HFILL }
11078 },
11079 { &hf_pn_io_block_version_low,
11080 { "BlockVersionLow", "pn_io.block_version_low",
11081 FT_UINT8, BASE_DEC, NULL, 0x0,
11082 NULL, HFILL }
11083 },
11084 { &hf_pn_io_sessionkey,
11085 { "SessionKey", "pn_io.session_key",
11086 FT_UINT16, BASE_DEC, NULL, 0x0,
11087 NULL, HFILL }
11088 },
11089 { &hf_pn_io_control_command,
11090 { "ControlCommand", "pn_io.control_command",
11091 FT_UINT16, BASE_HEX, NULL, 0x0,
11092 NULL, HFILL }
11093 },
11094 { &hf_pn_io_control_command_reserved,
11095 { "ControlBlockProperties.reserved", "pn_io.control_properties_reserved",
11096 FT_UINT16, BASE_HEX, NULL, 0x0,
11097 NULL, HFILL }
11098 },
11099 { &hf_pn_io_control_command_prmend,
11100 { "PrmEnd", "pn_io.control_command.prmend",
11101 FT_UINT16, BASE_DEC, NULL, 0x0001,
11102 NULL, HFILL }
11103 },
11104 { &hf_pn_io_control_command_applready,
11105 { "ApplicationReady", "pn_io.control_command.applready",
11106 FT_UINT16, BASE_DEC, NULL, 0x0002,
11107 NULL, HFILL }
11108 },
11109 { &hf_pn_io_control_command_release,
11110 { "Release", "pn_io.control_command.release",
11111 FT_UINT16, BASE_DEC, NULL, 0x0004,
11112 NULL, HFILL }
11113 },
11114 { &hf_pn_io_control_command_done,
11115 { "Done", "pn_io.control_command.done",
11116 FT_UINT16, BASE_DEC, NULL, 0x0008,
11117 NULL, HFILL }
11118 },
11119 { &hf_pn_io_control_command_ready_for_companion,
11120 { "ReadyForCompanion", "pn_io.control_command.ready_for_companion",
11121 FT_UINT16, BASE_DEC, NULL, 0x0010,
11122 NULL, HFILL }
11123 },
11124 { &hf_pn_io_control_command_ready_for_rt_class3,
11125 { "ReadyForRT Class 3", "pn_io.control_command.ready_for_rt_class3",
11126 FT_UINT16, BASE_DEC, NULL, 0x0020,
11127 NULL, HFILL }
11128 },
11129 { &hf_pn_io_control_command_prmbegin,
11130 { "PrmBegin", "pn_io.control_command.prmbegin",
11131 FT_UINT16, BASE_DEC, VALS(pn_io_control_properties_prmbegin_vals), 0x0040,
11132 NULL, HFILL }
11133 },
11134 { &hf_pn_io_control_command_reserved_7_15,
11135 { "ControlBlockProperties.reserved", "pn_io.control_properties_reserved_7_15",
11136 FT_UINT16, BASE_HEX, NULL, 0x0FF80,
11137 NULL, HFILL }
11138 },
11139 { &hf_pn_io_control_block_properties,
11140 { "ControlBlockProperties", "pn_io.control_block_properties",
11141 FT_UINT16, BASE_HEX, VALS(pn_io_control_properties_vals), 0x0,
11142 NULL, HFILL }
11143 },
11144 { &hf_pn_io_control_block_properties_applready,
11145 { "ControlBlockProperties", "pn_io.control_block_properties.appl_ready",
11146 FT_UINT16, BASE_HEX, NULL, 0x0,
11147 NULL, HFILL }
11148 },
11149 { &hf_pn_io_control_block_properties_applready0,
11150 { "ApplicationReady", "pn_io.control_block_properties.appl_ready0",
11151 FT_UINT16, BASE_HEX, VALS(pn_io_control_properties_application_ready_vals), 0x0001,
11152 NULL, HFILL }
11153 },
11154 { &hf_pn_io_SubmoduleListEntries,
11155 { "NumberOfEntries", "pn_io.SubmoduleListEntries",
11156 FT_UINT16, BASE_DEC, NULL, 0x0,
11157 NULL, HFILL }
11158 },
11159 { &hf_pn_io_error_code,
11160 { "ErrorCode", "pn_io.error_code",
11161 FT_UINT8, BASE_HEX, VALS(pn_io_error_code), 0x0,
11162 NULL, HFILL }
11163 },
11164 { &hf_pn_io_error_decode,
11165 { "ErrorDecode", "pn_io.error_decode",
11166 FT_UINT8, BASE_HEX, VALS(pn_io_error_decode), 0x0,
11167 NULL, HFILL }
11168 },
11169 { &hf_pn_io_error_code1,
11170 { "ErrorCode1", "pn_io.error_code1",
11171 FT_UINT8, BASE_DEC, VALS(pn_io_error_code1), 0x0,
11172 NULL, HFILL }
11173 },
11174 { &hf_pn_io_error_code2,
11175 { "ErrorCode2", "pn_io.error_code2",
11176 FT_UINT8, BASE_DEC, VALS(pn_io_error_code2), 0x0,
11177 NULL, HFILL }
11178 },
11179 { &hf_pn_io_error_code1_pniorw,
11180 { "ErrorCode1", "pn_io.error_code1",
11181 FT_UINT8, BASE_DEC, VALS(pn_io_error_code1_pniorw), 0x0,
11182 NULL, HFILL }
11183 },
11184 { &hf_pn_io_error_code2_pniorw,
11185 { "ErrorCode2 for PNIORW is user specified!", "pn_io.error_code2",
11186 FT_UINT8, BASE_DEC, NULL, 0x0,
11187 NULL, HFILL }
11188 },
11189 { &hf_pn_io_error_code1_pnio,
11190 { "ErrorCode1", "pn_io.error_code1",
11191 FT_UINT8, BASE_DEC, VALS(pn_io_error_code1_pnio), 0x0,
11192 NULL, HFILL }
11193 },
11194 { &hf_pn_io_error_code2_pnio_1,
11195 { "ErrorCode2", "pn_io.error_code2",
11196 FT_UINT8, BASE_DEC, VALS(pn_io_error_code2_pnio_1), 0x0,
11197 NULL, HFILL }
11198 },
11199 { &hf_pn_io_error_code2_pnio_2,
11200 { "ErrorCode2", "pn_io.error_code2",
11201 FT_UINT8, BASE_DEC, VALS(pn_io_error_code2_pnio_2), 0x0,
11202 NULL, HFILL }
11203 },
11204 { &hf_pn_io_error_code2_pnio_3,
11205 { "ErrorCode2", "pn_io.error_code2",
11206 FT_UINT8, BASE_DEC, VALS(pn_io_error_code2_pnio_3), 0x0,
11207 NULL, HFILL }
11208 },
11209 { &hf_pn_io_error_code2_pnio_4,
11210 { "ErrorCode2", "pn_io.error_code2",
11211 FT_UINT8, BASE_DEC, VALS(pn_io_error_code2_pnio_4), 0x0,
11212 NULL, HFILL }
11213 },
11214 { &hf_pn_io_error_code2_pnio_5,
11215 { "ErrorCode2", "pn_io.error_code2",
11216 FT_UINT8, BASE_DEC, VALS(pn_io_error_code2_pnio_5), 0x0,
11217 NULL, HFILL }
11218 },
11219 { &hf_pn_io_error_code2_pnio_6,
11220 { "ErrorCode2", "pn_io.error_code2",
11221 FT_UINT8, BASE_DEC, VALS(pn_io_error_code2_pnio_6), 0x0,
11222 NULL, HFILL }
11223 },
11224 { &hf_pn_io_error_code2_pnio_7,
11225 { "ErrorCode2", "pn_io.error_code2",
11226 FT_UINT8, BASE_DEC, VALS(pn_io_error_code2_pnio_7), 0x0,
11227 NULL, HFILL }
11228 },
11229 { &hf_pn_io_error_code2_pnio_8,
11230 { "ErrorCode2", "pn_io.error_code2",
11231 FT_UINT8, BASE_DEC, VALS(pn_io_error_code2_pnio_8), 0x0,
11232 NULL, HFILL }
11233 },
11234 { &hf_pn_io_error_code2_pnio_20,
11235 { "ErrorCode2", "pn_io.error_code2",
11236 FT_UINT8, BASE_DEC, VALS(pn_io_error_code2_pnio_20), 0x0,
11237 NULL, HFILL }
11238 },
11239 { &hf_pn_io_error_code2_pnio_21,
11240 { "ErrorCode2", "pn_io.error_code2",
11241 FT_UINT8, BASE_DEC, VALS(pn_io_error_code2_pnio_21), 0x0,
11242 NULL, HFILL }
11243 },
11244 { &hf_pn_io_error_code2_pnio_22,
11245 { "ErrorCode2", "pn_io.error_code2",
11246 FT_UINT8, BASE_DEC, VALS(pn_io_error_code2_pnio_22), 0x0,
11247 NULL, HFILL }
11248 },
11249 { &hf_pn_io_error_code2_pnio_23,
11250 { "ErrorCode2", "pn_io.error_code2",
11251 FT_UINT8, BASE_DEC, VALS(pn_io_error_code2_pnio_23), 0x0,
11252 NULL, HFILL }
11253 },
11254 { &hf_pn_io_error_code2_pnio_40,
11255 { "ErrorCode2", "pn_io.error_code2",
11256 FT_UINT8, BASE_DEC, VALS(pn_io_error_code2_pnio_40), 0x0,
11257 NULL, HFILL }
11258 },
11259 { &hf_pn_io_error_code2_pnio_61,
11260 { "ErrorCode2", "pn_io.error_code2",
11261 FT_UINT8, BASE_DEC, VALS(pn_io_error_code2_pnio_61), 0x0,
11262 NULL, HFILL }
11263 },
11264 { &hf_pn_io_error_code2_pnio_62,
11265 { "ErrorCode2", "pn_io.error_code2",
11266 FT_UINT8, BASE_DEC, VALS(pn_io_error_code2_pnio_62), 0x0,
11267 NULL, HFILL }
11268 },
11269 { &hf_pn_io_error_code2_pnio_63,
11270 { "ErrorCode2", "pn_io.error_code2",
11271 FT_UINT8, BASE_DEC, VALS(pn_io_error_code2_pnio_63), 0x0,
11272 NULL, HFILL }
11273 },
11274 { &hf_pn_io_error_code2_pnio_64,
11275 { "ErrorCode2", "pn_io.error_code2",
11276 FT_UINT8, BASE_DEC, VALS(pn_io_error_code2_pnio_64), 0x0,
11277 NULL, HFILL }
11278 },
11279 { &hf_pn_io_error_code2_pnio_65,
11280 { "ErrorCode2", "pn_io.error_code2",
11281 FT_UINT8, BASE_DEC, VALS(pn_io_error_code2_pnio_65), 0x0,
11282 NULL, HFILL }
11283 },
11284 { &hf_pn_io_error_code2_pnio_66,
11285 { "ErrorCode2", "pn_io.error_code2",
11286 FT_UINT8, BASE_DEC, VALS(pn_io_error_code2_pnio_66), 0x0,
11287 NULL, HFILL }
11288 },
11289 { &hf_pn_io_error_code2_pnio_70,
11290 { "ErrorCode2", "pn_io.error_code2",
11291 FT_UINT8, BASE_DEC, VALS(pn_io_error_code2_pnio_70), 0x0,
11292 NULL, HFILL }
11293 },
11294 { &hf_pn_io_error_code2_pnio_71,
11295 { "ErrorCode2", "pn_io.error_code2",
11296 FT_UINT8, BASE_DEC, VALS(pn_io_error_code2_pnio_71), 0x0,
11297 NULL, HFILL }
11298 },
11299 { &hf_pn_io_error_code2_pnio_72,
11300 { "ErrorCode2", "pn_io.error_code2",
11301 FT_UINT8, BASE_DEC, VALS(pn_io_error_code2_pnio_72), 0x0,
11302 NULL, HFILL }
11303 },
11304 { &hf_pn_io_error_code2_pnio_73,
11305 { "ErrorCode2", "pn_io.error_code2",
11306 FT_UINT8, BASE_DEC, VALS(pn_io_error_code2_pnio_73), 0x0,
11307 NULL, HFILL }
11308 },
11309 { &hf_pn_io_error_code2_pnio_74,
11310 { "ErrorCode2", "pn_io.error_code2",
11311 FT_UINT8, BASE_DEC, VALS(pn_io_error_code2_pnio_74), 0x0,
11312 NULL, HFILL }
11313 },
11314 { &hf_pn_io_error_code2_pnio_75,
11315 { "ErrorCode2", "pn_io.error_code2",
11316 FT_UINT8, BASE_DEC, VALS(pn_io_error_code2_pnio_75), 0x0,
11317 NULL, HFILL }
11318 },
11319 { &hf_pn_io_error_code2_pnio_76,
11320 { "ErrorCode2", "pn_io.error_code2",
11321 FT_UINT8, BASE_DEC, VALS(pn_io_error_code2_pnio_76), 0x0,
11322 NULL, HFILL }
11323 },
11324 { &hf_pn_io_error_code2_pnio_77,
11325 { "ErrorCode2", "pn_io.error_code2",
11326 FT_UINT8, BASE_DEC, VALS(pn_io_error_code2_pnio_77), 0x0,
11327 NULL, HFILL }
11328 },
11329 { &hf_pn_io_error_code2_pnio_253,
11330 { "ErrorCode2", "pn_io.error_code2",
11331 FT_UINT8, BASE_DEC, VALS(pn_io_error_code2_pnio_253), 0x0,
11332 NULL, HFILL }
11333 },
11334 { &hf_pn_io_error_code2_pnio_255,
11335 { "ErrorCode2", "pn_io.error_code2",
11336 FT_UINT8, BASE_DEC, VALS(pn_io_error_code2_pnio_255), 0x0,
11337 NULL, HFILL }
11338 },
11339 { &hf_pn_io_block,
11340 { "Block", "pn_io.block",
11341 FT_NONE, BASE_NONE, NULL, 0x0,
11342 NULL, HFILL }
11343 },
11344 { &hf_pn_io_alarm_type,
11345 { "AlarmType", "pn_io.alarm_type",
11346 FT_UINT16, BASE_HEX, VALS(pn_io_alarm_type), 0x0,
11347 NULL, HFILL }
11348 },
11349 { &hf_pn_io_alarm_specifier,
11350 { "AlarmSpecifier", "pn_io.alarm_specifier",
11351 FT_NONE, BASE_NONE, NULL, 0x0,
11352 NULL, HFILL }
11353 },
11354 { &hf_pn_io_alarm_specifier_sequence,
11355 { "SequenceNumber", "pn_io.alarm_specifier.sequence",
11356 FT_UINT16, BASE_HEX, NULL, 0x07FF,
11357 NULL, HFILL }
11358 },
11359 { &hf_pn_io_alarm_specifier_channel,
11360 { "ChannelDiagnosis", "pn_io.alarm_specifier.channel",
11361 FT_UINT16, BASE_HEX, NULL, 0x0800,
11362 NULL, HFILL }
11363 },
11364 { &hf_pn_io_alarm_specifier_manufacturer,
11365 { "ManufacturerSpecificDiagnosis", "pn_io.alarm_specifier.manufacturer",
11366 FT_UINT16, BASE_HEX, NULL, 0x1000,
11367 NULL, HFILL }
11368 },
11369 { &hf_pn_io_alarm_specifier_submodule,
11370 { "SubmoduleDiagnosisState", "pn_io.alarm_specifier.submodule",
11371 FT_UINT16, BASE_HEX, NULL, 0x2000,
11372 NULL, HFILL }
11373 },
11374 { &hf_pn_io_alarm_specifier_ardiagnosis,
11375 { "ARDiagnosisState", "pn_io.alarm_specifier.ardiagnosis",
11376 FT_UINT16, BASE_HEX, NULL, 0x8000,
11377 NULL, HFILL }
11378 },
11379 { &hf_pn_io_alarm_dst_endpoint,
11380 { "AlarmDstEndpoint", "pn_io.alarm_dst_endpoint",
11381 FT_UINT16, BASE_HEX, NULL, 0x0,
11382 NULL, HFILL }
11383 },
11384 { &hf_pn_io_alarm_src_endpoint,
11385 { "AlarmSrcEndpoint", "pn_io.alarm_src_endpoint",
11386 FT_UINT16, BASE_HEX, NULL, 0x0,
11387 NULL, HFILL }
11388 },
11389 { &hf_pn_io_pdu_type,
11390 { "PDUType", "pn_io.pdu_type",
11391 FT_NONE, BASE_NONE, NULL, 0x0,
11392 NULL, HFILL }
11393 },
11394 { &hf_pn_io_pdu_type_type,
11395 { "Type", "pn_io.pdu_type.type",
11396 FT_UINT8, BASE_HEX, VALS(pn_io_pdu_type), 0x0F,
11397 NULL, HFILL }
11398 },
11399 { &hf_pn_io_pdu_type_version,
11400 { "Version", "pn_io.pdu_type.version",
11401 FT_UINT8, BASE_HEX, NULL, 0xF0,
11402 NULL, HFILL }
11403 },
11404 { &hf_pn_io_add_flags,
11405 { "AddFlags", "pn_io.add_flags",
11406 FT_NONE, BASE_NONE, NULL, 0x0,
11407 NULL, HFILL }
11408 },
11409 { &hf_pn_io_window_size,
11410 { "WindowSize", "pn_io.window_size",
11411 FT_UINT8, BASE_DEC, NULL, 0x0F,
11412 NULL, HFILL }
11413 },
11414 { &hf_pn_io_tack,
11415 { "TACK", "pn_io.tack",
11416 FT_UINT8, BASE_HEX, NULL, 0xF0,
11417 NULL, HFILL }
11418 },
11419 { &hf_pn_io_send_seq_num,
11420 { "SendSeqNum", "pn_io.send_seq_num",
11421 FT_UINT16, BASE_HEX, NULL, 0x0,
11422 NULL, HFILL }
11423 },
11424 { &hf_pn_io_ack_seq_num,
11425 { "AckSeqNum", "pn_io.ack_seq_num",
11426 FT_UINT16, BASE_HEX, NULL, 0x0,
11427 NULL, HFILL }
11428 },
11429 { &hf_pn_io_var_part_len,
11430 { "VarPartLen", "pn_io.var_part_len",
11431 FT_UINT16, BASE_HEX, NULL, 0x0,
11432 NULL, HFILL }
11433 },
11434 { &hf_pn_io_module_ident_number,
11435 { "ModuleIdentNumber", "pn_io.module_ident_number",
11436 FT_UINT32, BASE_HEX, NULL, 0x0,
11437 NULL, HFILL }
11438 },
11439 { &hf_pn_io_submodule_ident_number,
11440 { "SubmoduleIdentNumber", "pn_io.submodule_ident_number",
11441 FT_UINT32, BASE_HEX, NULL, 0x0,
11442 NULL, HFILL }
11443 },
11444  
11445 { &hf_pn_io_number_of_modules,
11446 { "NumberOfModules", "pn_io.number_of_modules",
11447 FT_UINT16, BASE_HEX, NULL, 0x0,
11448 NULL, HFILL }
11449 },
11450 { &hf_pn_io_module_properties,
11451 { "ModuleProperties", "pn_io.module_properties",
11452 FT_UINT16, BASE_HEX, NULL, 0x0,
11453 NULL, HFILL }
11454 },
11455 { &hf_pn_io_module_state,
11456 { "ModuleState", "pn_io.module_state",
11457 FT_UINT16, BASE_HEX, VALS(pn_io_module_state), 0x0,
11458 NULL, HFILL }
11459 },
11460 { &hf_pn_io_number_of_submodules,
11461 { "NumberOfSubmodules", "pn_io.number_of_submodules",
11462 FT_UINT16, BASE_DEC, NULL, 0x0,
11463 NULL, HFILL }
11464 },
11465  
11466 { &hf_pn_io_submodule_properties,
11467 { "SubmoduleProperties", "pn_io.submodule_properties",
11468 FT_UINT16, BASE_HEX, NULL, 0x0,
11469 NULL, HFILL }
11470 },
11471 { &hf_pn_io_submodule_properties_type,
11472 { "Type", "pn_io.submodule_properties.type",
11473 FT_UINT16, BASE_HEX, VALS(pn_io_submodule_properties_type), 0x0003,
11474 NULL, HFILL }
11475 },
11476 { &hf_pn_io_submodule_properties_shared_input,
11477 { "SharedInput", "pn_io.submodule_properties.shared_input",
11478 FT_UINT16, BASE_HEX, VALS(pn_io_submodule_properties_shared_input), 0x0004,
11479 NULL, HFILL }
11480 },
11481 { &hf_pn_io_submodule_properties_reduce_input_submodule_data_length,
11482 { "ReduceInputSubmoduleDataLength", "pn_io.submodule_properties.reduce_input_submodule_data_length",
11483 FT_UINT16, BASE_HEX, VALS(pn_io_submodule_properties_reduce_input_submodule_data_length), 0x0008,
11484 NULL, HFILL }
11485 },
11486 { &hf_pn_io_submodule_properties_reduce_output_submodule_data_length,
11487 { "ReduceOutputSubmoduleDataLength", "pn_io.submodule_properties.reduce_output_submodule_data_length",
11488 FT_UINT16, BASE_HEX, VALS(pn_io_submodule_properties_reduce_output_submodule_data_length), 0x0010,
11489 NULL, HFILL }
11490 },
11491 { &hf_pn_io_submodule_properties_discard_ioxs,
11492 { "DiscardIOXS", "pn_io.submodule_properties.discard_ioxs",
11493 FT_UINT16, BASE_HEX, VALS(pn_io_submodule_properties_discard_ioxs), 0x0020,
11494 NULL, HFILL }
11495 },
11496 { &hf_pn_io_submodule_properties_reserved,
11497 { "Reserved", "pn_io.submodule_properties.reserved",
11498 FT_UINT16, BASE_HEX, NULL, 0xFFC0,
11499 NULL, HFILL }
11500 },
11501 { &hf_pn_io_submodule_state,
11502 { "SubmoduleState", "pn_io.submodule_state",
11503 FT_UINT16, BASE_HEX, NULL, 0x0,
11504 NULL, HFILL }
11505 },
11506 { &hf_pn_io_submodule_state_format_indicator,
11507 { "FormatIndicator", "pn_io.submodule_state.format_indicator",
11508 FT_UINT16, BASE_HEX, VALS(pn_io_submodule_state_format_indicator), 0x8000,
11509 NULL, HFILL }
11510 },
11511 { &hf_pn_io_submodule_state_add_info,
11512 { "AddInfo", "pn_io.submodule_state.add_info",
11513 FT_UINT16, BASE_HEX, VALS(pn_io_submodule_state_add_info), 0x0007,
11514 NULL, HFILL }
11515 },
11516 { &hf_pn_io_submodule_state_qualified_info,
11517 { "QualifiedInfo", "pn_io.submodule_state.qualified_info",
11518 FT_UINT16, BASE_HEX, VALS(pn_io_submodule_state_qualified_info), 0x0008,
11519 NULL, HFILL }
11520 },
11521 { &hf_pn_io_submodule_state_maintenance_required,
11522 { "MaintenanceRequired", "pn_io.submodule_state.maintenance_required",
11523 FT_UINT16, BASE_HEX, VALS(pn_io_submodule_state_maintenance_required), 0x0010,
11524 NULL, HFILL }
11525 },
11526 { &hf_pn_io_submodule_state_maintenance_demanded,
11527 { "MaintenanceDemanded", "pn_io.submodule_state.maintenance_demanded",
11528 FT_UINT16, BASE_HEX, VALS(pn_io_submodule_state_maintenance_demanded), 0x0020,
11529 NULL, HFILL }
11530 },
11531 { &hf_pn_io_submodule_state_diag_info,
11532 { "DiagInfo", "pn_io.submodule_state.diag_info",
11533 FT_UINT16, BASE_HEX, VALS(pn_io_submodule_state_diag_info), 0x0040,
11534 NULL, HFILL }
11535 },
11536 { &hf_pn_io_submodule_state_ar_info,
11537 { "ARInfo", "pn_io.submodule_state.ar_info",
11538 FT_UINT16, BASE_HEX, VALS(pn_io_submodule_state_ar_info), 0x0780,
11539 NULL, HFILL }
11540 },
11541 { &hf_pn_io_submodule_state_ident_info,
11542 { "IdentInfo", "pn_io.submodule_state.ident_info",
11543 FT_UINT16, BASE_HEX, VALS(pn_io_submodule_state_ident_info), 0x7800,
11544 NULL, HFILL }
11545 },
11546 { &hf_pn_io_submodule_state_detail,
11547 { "Detail", "pn_io.submodule_state.detail",
11548 FT_UINT16, BASE_HEX, VALS(pn_io_submodule_state_detail), 0x7FFF,
11549 NULL, HFILL }
11550 },
11551 { &hf_pn_io_data_description_tree,
11552 { "DataDescription", "pn_io.data_description_tree",
11553 FT_NONE, BASE_NONE, NULL, 0x0,
11554 NULL, HFILL }
11555 },
11556 { &hf_pn_io_data_description,
11557 { "DataDescription", "pn_io.data_description",
11558 FT_UINT16, BASE_HEX, VALS(pn_io_data_description), 0x0,
11559 NULL, HFILL }
11560 },
11561 { &hf_pn_io_submodule_data_length,
11562 { "SubmoduleDataLength", "pn_io.submodule_data_length",
11563 FT_UINT16, BASE_DEC, NULL, 0x0,
11564 NULL, HFILL }
11565 },
11566 { &hf_pn_io_length_iocs,
11567 { "LengthIOCS", "pn_io.length_iocs",
11568 FT_UINT16, BASE_DEC, NULL, 0x0,
11569 NULL, HFILL }
11570 },
11571 { &hf_pn_io_length_iops,
11572 { "LengthIOPS", "pn_io.length_iops",
11573 FT_UINT16, BASE_DEC, NULL, 0x0,
11574 NULL, HFILL }
11575 },
11576  
11577 { &hf_pn_io_iocs,
11578 { "IOCS", "pn_io.ioxs",
11579 FT_UINT8, BASE_HEX, NULL, 0x0,
11580 NULL, HFILL }
11581 },
11582 { &hf_pn_io_iops,
11583 { "IOPS", "pn_io.ioxs",
11584 FT_UINT8, BASE_HEX, NULL, 0x0,
11585 NULL, HFILL }
11586 },
11587 { &hf_pn_io_ioxs_extension,
11588 { "Extension (1:another IOxS follows/0:no IOxS follows)", "pn_io.ioxs.extension",
11589 FT_UINT8, BASE_HEX, NULL, 0x01,
11590 NULL, HFILL }
11591 },
11592 { &hf_pn_io_ioxs_res14,
11593 { "Reserved (should be zero)", "pn_io.ioxs.res14",
11594 FT_UINT8, BASE_HEX, NULL, 0x1E,
11595 NULL, HFILL }
11596 },
11597 { &hf_pn_io_ioxs_instance,
11598 { "Instance (only valid, if DataState is bad)",
11599 "pn_io.ioxs.instance", FT_UINT8, BASE_HEX, VALS(pn_io_ioxs),
11600 0x60, NULL, HFILL }
11601 },
11602 { &hf_pn_io_ioxs_datastate,
11603 { "DataState (1:good/0:bad)", "pn_io.ioxs.datastate",
11604 FT_UINT8, BASE_HEX, NULL, 0x80,
11605 NULL, HFILL }
11606 },
11607 { &hf_pn_io_address_resolution_properties,
11608 { "AddressResolutionProperties", "pn_io.address_resolution_properties",
11609 FT_UINT32, BASE_HEX, NULL, 0x0,
11610 NULL, HFILL }
11611 },
11612 { &hf_pn_io_mci_timeout_factor,
11613 { "MCITimeoutFactor", "pn_io.mci_timeout_factor",
11614 FT_UINT16, BASE_DEC, NULL, 0x0,
11615 NULL, HFILL }
11616 },
11617 { &hf_pn_io_provider_station_name,
11618 { "ProviderStationName", "pn_io.provider_station_name",
11619 FT_STRING, BASE_NONE, NULL, 0x0,
11620 NULL, HFILL }
11621 },
11622 { &hf_pn_io_user_structure_identifier,
11623 { "UserStructureIdentifier", "pn_io.user_structure_identifier",
11624 FT_UINT16, BASE_HEX, VALS(pn_io_user_structure_identifier), 0x0,
11625 NULL, HFILL }
11626 },
11627 { &hf_pn_io_user_structure_identifier_manf,
11628 { "UserStructureIdentifier manufacturer specific", "pn_io.user_structure_identifier_manf",
11629 FT_UINT16, BASE_HEX, NULL, 0x0,
11630 NULL, HFILL }
11631 },
11632 { &hf_pn_io_ar_properties_reserved_1,
11633 { "Reserved_1", "pn_io.ar_properties.reserved_1",
11634 FT_UINT32, BASE_HEX, NULL, 0x000000E0,
11635 NULL, HFILL }},
11636 { &hf_pn_io_ar_properties_device_access,
11637 { "DeviceAccess", "pn_io.ar_properties.device_access",
11638 FT_UINT32, BASE_HEX, VALS(pn_io_arproperties_DeviceAccess), 0x00000100,
11639 NULL, HFILL }},
11640 { &hf_pn_io_subframe_data,
11641 { "SubFrameData", "pn_io.subframe_data",
11642 FT_UINT32, BASE_HEX, NULL, 0x0,
11643 NULL, HFILL }
11644 },
11645 { &hf_pn_io_subframe_reserved2,
11646 { "Reserved1", "pn_io.subframe_data.reserved2",
11647 FT_UINT32, BASE_HEX, NULL, 0xFFFF0000,
11648 NULL, HFILL }
11649 },
11650 { &hf_pn_io_subframe_data_length,
11651 { "DataLength", "pn_io.subframe_data.data_length",
11652 FT_UINT32, BASE_HEX, NULL, 0x0000FF00,
11653 NULL, HFILL }
11654 },
11655 { &hf_pn_io_subframe_reserved1,
11656 { "Reserved1", "pn_io.subframe_data.reserved1",
11657 FT_UINT32, BASE_HEX, NULL, 0x00000080,
11658 NULL, HFILL }
11659 },
11660 { &hf_pn_io_subframe_data_position,
11661 { "DataPosition", "pn_io.subframe_data.position",
11662 FT_UINT32, BASE_HEX, NULL, 0x0000007F,
11663 NULL, HFILL }
11664 },
11665 { &hf_pn_io_subframe_data_reserved1,
11666 { "Reserved1", "pn_io.subframe_data.reserved_1",
11667 FT_UINT32, BASE_HEX, NULL, 0x00000080,
11668 NULL, HFILL }
11669 },
11670 { &hf_pn_io_subframe_data_reserved2,
11671 { "Reserved1", "pn_io.subframe_data.reserved_2",
11672 FT_UINT32, BASE_HEX, NULL, 0xFFFF0000,
11673 NULL, HFILL }
11674 },
11675 { &hf_pn_io_channel_number,
11676 { "ChannelNumber", "pn_io.channel_number",
11677 FT_UINT16, BASE_HEX, NULL, 0x0,
11678 NULL, HFILL }
11679 },
11680  
11681 { &hf_pn_io_channel_properties,
11682 { "ChannelProperties", "pn_io.channel_properties",
11683 FT_UINT16, BASE_HEX, NULL, 0x0,
11684 NULL, HFILL }
11685 },
11686 { &hf_pn_io_channel_properties_type,
11687 { "Type", "pn_io.channel_properties.type",
11688 FT_UINT16, BASE_HEX, VALS(pn_io_channel_properties_type), 0x00FF,
11689 NULL, HFILL }
11690 },
11691 { &hf_pn_io_channel_properties_accumulative,
11692 { "Accumulative", "pn_io.channel_properties.accumulative",
11693 FT_UINT16, BASE_HEX, VALS(pn_io_channel_properties_accumulative_vals), 0x0100,
11694 NULL, HFILL }
11695 },
11696 { &hf_pn_io_NumberOfSubframeBlocks,
11697 { "NumberOfSubframeBlocks", "pn_io.NumberOfSubframeBlocks",
11698 FT_UINT16, BASE_DEC, NULL, 0x0,
11699 NULL, HFILL }
11700 },
11701 { &hf_pn_io_channel_properties_maintenance,
11702 { "Maintenance (Severity)", "pn_io.channel_properties.maintenance",
11703 FT_UINT16, BASE_HEX, VALS(pn_io_channel_properties_maintenance), 0x0600,
11704 NULL, HFILL }
11705 },
11706 { &hf_pn_io_channel_properties_specifier,
11707 { "Specifier", "pn_io.channel_properties.specifier",
11708 FT_UINT16, BASE_HEX, VALS(pn_io_channel_properties_specifier), 0x1800,
11709 NULL, HFILL }
11710 },
11711 { &hf_pn_io_channel_properties_direction,
11712 { "Direction", "pn_io.channel_properties.direction",
11713 FT_UINT16, BASE_HEX, VALS(pn_io_channel_properties_direction), 0xE000,
11714 NULL, HFILL }
11715 },
11716  
11717 { &hf_pn_io_channel_error_type,
11718 { "ChannelErrorType", "pn_io.channel_error_type",
11719 FT_UINT16, BASE_HEX, VALS(pn_io_channel_error_type), 0x0,
11720 NULL, HFILL }
11721 },
11722 { &hf_pn_io_ext_channel_error_type0,
11723 { "ExtChannelErrorType", "pn_io.ext_channel_error_type0",
11724 FT_UINT16, BASE_HEX, VALS(pn_io_ext_channel_error_type0), 0x0,
11725 NULL, HFILL }
11726 },
11727 { &hf_pn_io_ext_channel_error_type0x8000,
11728 { "ExtChannelErrorType", "pn_io.ext_channel_error_type0800",
11729 FT_UINT16, BASE_HEX, VALS(pn_io_ext_channel_error_type0x8000), 0x0,
11730 NULL, HFILL }
11731 },
11732 { &hf_pn_io_ext_channel_error_type0x8001,
11733 { "ExtChannelErrorType", "pn_io.ext_channel_error_type8001",
11734 FT_UINT16, BASE_HEX, VALS(pn_io_ext_channel_error_type0x8001), 0x0,
11735 NULL, HFILL }
11736 },
11737 { &hf_pn_io_ext_channel_error_type0x8002,
11738 { "ExtChannelErrorType", "pn_io.ext_channel_error_type8002",
11739 FT_UINT16, BASE_HEX, VALS(pn_io_ext_channel_error_type0x8002), 0x0,
11740 NULL, HFILL }
11741 },
11742 { &hf_pn_io_ext_channel_error_type0x8003,
11743 { "ExtChannelErrorType", "pn_io.ext_channel_error_type8003",
11744 FT_UINT16, BASE_HEX, VALS(pn_io_ext_channel_error_type0x8003), 0x0,
11745 NULL, HFILL }
11746 },
11747 { &hf_pn_io_ext_channel_error_type0x8004,
11748 { "ExtChannelErrorType", "pn_io.ext_channel_error_type8004",
11749 FT_UINT16, BASE_HEX, VALS(pn_io_ext_channel_error_type0x8004), 0x0,
11750 NULL, HFILL }
11751 },
11752 { &hf_pn_io_ext_channel_error_type0x8005,
11753 { "ExtChannelErrorType", "pn_io.ext_channel_error_type8005",
11754 FT_UINT16, BASE_HEX, VALS(pn_io_ext_channel_error_type0x8005), 0x0,
11755 NULL, HFILL }
11756 },
11757 { &hf_pn_io_ext_channel_error_type0x8007,
11758 { "ExtChannelErrorType", "pn_io.ext_channel_error_type8007",
11759 FT_UINT16, BASE_HEX, VALS(pn_io_ext_channel_error_type0x8007), 0x0,
11760 NULL, HFILL }
11761 },
11762 { &hf_pn_io_ext_channel_error_type0x8008,
11763 { "ExtChannelErrorType", "pn_io.ext_channel_error_type8008",
11764 FT_UINT16, BASE_HEX, VALS(pn_io_ext_channel_error_type0x8008), 0x0,
11765 NULL, HFILL }
11766 },
11767 { &hf_pn_io_ext_channel_error_type0x800A,
11768 { "ExtChannelErrorType", "pn_io.ext_channel_error_type800A",
11769 FT_UINT16, BASE_HEX, VALS(pn_io_ext_channel_error_type0x800A), 0x0,
11770 NULL, HFILL }
11771 },
11772 { &hf_pn_io_ext_channel_error_type0x800B,
11773 { "ExtChannelErrorType", "pn_io.ext_channel_error_type800B",
11774 FT_UINT16, BASE_HEX, VALS(pn_io_ext_channel_error_type0x800B), 0x0,
11775 NULL, HFILL }
11776 },
11777 { &hf_pn_io_ext_channel_error_type0x800C,
11778 { "ExtChannelErrorType", "pn_io.ext_channel_error_type800C",
11779 FT_UINT16, BASE_HEX, VALS(pn_io_ext_channel_error_type0x800C), 0x0,
11780 NULL, HFILL }
11781 },
11782 { &hf_pn_io_ext_channel_error_type,
11783 { "ExtChannelErrorType", "pn_io.ext_channel_error_type",
11784 FT_UINT16, BASE_HEX, NULL, 0x0,
11785 NULL, HFILL }
11786 },
11787 { &hf_pn_io_ext_channel_add_value,
11788 { "ExtChannelAddValue", "pn_io.ext_channel_add_value",
11789 FT_UINT32, BASE_HEX, NULL, 0x0,
11790 NULL, HFILL }
11791 },
11792 { &hf_pn_io_ptcp_subdomain_id,
11793 { "PTCPSubdomainID", "pn_io.ptcp_subdomain_id",
11794 FT_GUID, BASE_NONE, NULL, 0x0,
11795 NULL, HFILL }
11796 },
11797 { &hf_pn_io_ir_data_id,
11798 { "IRDataID", "pn_io.ir_data_id",
11799 FT_GUID, BASE_NONE, NULL, 0x0,
11800 NULL, HFILL }
11801 },
11802 { &hf_pn_io_max_bridge_delay,
11803 { "MaxBridgeDelay", "pn_io.max_bridge_delay",
11804 FT_UINT32, BASE_DEC, NULL, 0x0,
11805 NULL, HFILL }
11806 },
11807 { &hf_pn_io_number_of_ports,
11808 { "NumberOfPorts", "pn_io.number_of_ports",
11809 FT_UINT32, BASE_DEC, NULL, 0x0,
11810 NULL, HFILL }
11811 },
11812 { &hf_pn_io_max_port_tx_delay,
11813 { "MaxPortTxDelay", "pn_io.max_port_tx_delay",
11814 FT_UINT32, BASE_DEC, NULL, 0x0,
11815 NULL, HFILL }
11816 },
11817 { &hf_pn_io_max_port_rx_delay,
11818 { "MaxPortRxDelay", "pn_io.max_port_rx_delay",
11819 FT_UINT32, BASE_DEC, NULL, 0x0,
11820 NULL, HFILL }
11821 },
11822 { &hf_pn_io_max_line_rx_delay,
11823 { "MaxLineRxDelay", "pn_io.max_line_rx_delay",
11824 FT_UINT32, BASE_DEC, NULL, 0x0,
11825 NULL, HFILL }
11826 },
11827 { &hf_pn_io_yellowtime,
11828 { "YellowTime", "pn_io.yellowtime",
11829 FT_UINT32, BASE_DEC, NULL, 0x0,
11830 NULL, HFILL }
11831 },
11832 { &hf_pn_io_reserved_interval_begin,
11833 { "ReservedIntervalBegin", "pn_io.reserved_interval_begin",
11834 FT_UINT32, BASE_DEC, NULL, 0x0,
11835 NULL, HFILL }
11836 },
11837 { &hf_pn_io_reserved_interval_end,
11838 { "ReservedIntervalEnd", "pn_io.reserved_interval_end",
11839 FT_UINT32, BASE_DEC, NULL, 0x0,
11840 NULL, HFILL }
11841 },
11842 { &hf_pn_io_pllwindow,
11843 { "PLLWindow", "pn_io.pllwindow",
11844 FT_UINT32, BASE_DEC, NULL, 0x0,
11845 NULL, HFILL }
11846 },
11847 { &hf_pn_io_sync_send_factor,
11848 { "SyncSendFactor", "pn_io.sync_send_factor",
11849 FT_UINT32, BASE_DEC, NULL, 0x0,
11850 NULL, HFILL }
11851 },
11852 { &hf_pn_io_sync_properties,
11853 { "SyncProperties", "pn_io.sync_properties",
11854 FT_UINT16, BASE_HEX, NULL, 0x0,
11855 NULL, HFILL }
11856 },
11857 { &hf_pn_io_sync_frame_address,
11858 { "SyncFrameAddress", "pn_io.sync_frame_address",
11859 FT_UINT16, BASE_HEX, NULL, 0x0,
11860 NULL, HFILL }
11861 },
11862 { &hf_pn_io_ptcp_timeout_factor,
11863 { "PTCPTimeoutFactor", "pn_io.ptcp_timeout_factor",
11864 FT_UINT16, BASE_DEC, NULL, 0x0,
11865 NULL, HFILL }
11866 },
11867 { &hf_pn_io_ptcp_takeover_timeout_factor,
11868 { "PTCPTakeoverTimeoutFactor", "pn_io.ptcp_takeover_timeout_factor",
11869 FT_UINT16, BASE_DEC, NULL, 0x0,
11870 NULL, HFILL }
11871 },
11872 { &hf_pn_io_ptcp_master_startup_time,
11873 { "PTCPMasterStartupTime", "pn_io.ptcp_master_startup_time",
11874 FT_UINT16, BASE_DEC, NULL, 0x0,
11875 NULL, HFILL }
11876 },
11877 { &hf_pn_io_ptcp_master_priority_1,
11878 { "PTCP_MasterPriority1", "pn_io.ptcp_master_priority_1",
11879 FT_UINT8, BASE_DEC, NULL, 0x0,
11880 NULL, HFILL }
11881 },
11882 { &hf_pn_io_ptcp_master_priority_2,
11883 { "PTCP_MasterPriority2", "pn_io.ptcp_master_priority_2",
11884 FT_UINT8, BASE_DEC, NULL, 0x0,
11885 NULL, HFILL }
11886 },
11887 { &hf_pn_io_ptcp_length_subdomain_name,
11888 { "PTCPLengthSubdomainName", "pn_io.ptcp_length_subdomain_name",
11889 FT_UINT8, BASE_DEC_HEX, NULL, 0x0,
11890 NULL, HFILL }
11891 },
11892 { &hf_pn_io_ptcp_subdomain_name,
11893 { "PTCPSubdomainName", "pn_io.ptcp_subdomain_name",
11894 FT_STRING, BASE_NONE, NULL, 0x0,
11895 NULL, HFILL }
11896 },
11897 { &hf_pn_io_MultipleInterfaceMode_NameOfDevice,
11898 { "MultipleInterfaceMode.NameOfDevice", "pn_io.MultipleInterfaceMode_NameOfDevice", FT_UINT32, BASE_HEX, VALS(pn_io_MultipleInterfaceMode_NameOfDevice), 0x01, NULL, HFILL }},
11899 { &hf_pn_io_MultipleInterfaceMode_reserved_1,
11900 { "MultipleInterfaceMode.Reserved_1", "pn_io.MultipleInterfaceMode_reserved_1", FT_UINT32, BASE_HEX, NULL, 0xFFFE, NULL, HFILL }},
11901 { &hf_pn_io_MultipleInterfaceMode_reserved_2,
11902 { "MultipleInterfaceMode.Reserved_2", "pn_io.MultipleInterfaceMode_reserved_2", FT_UINT32, BASE_HEX, NULL, 0xFFFF0000, NULL, HFILL }},
11903 { &hf_pn_io_pdportstatistic_ifInOctets,
11904 { "ifInOctets", "pn_io.ifInOctets",
11905 FT_UINT32, BASE_HEX, NULL, 0x0,
11906 NULL, HFILL }
11907 },
11908 { &hf_pn_io_pdportstatistic_ifOutOctets,
11909 { "ifOutOctets", "pn_io.ifOutOctets",
11910 FT_UINT32, BASE_HEX, NULL, 0x0,
11911 NULL, HFILL }
11912 },
11913 { &hf_pn_io_pdportstatistic_ifInDiscards,
11914 { "ifInDiscards", "pn_io.ifInDiscards",
11915 FT_UINT32, BASE_HEX, NULL, 0x0,
11916 NULL, HFILL }
11917 },
11918 { &hf_pn_io_pdportstatistic_ifOutDiscards,
11919 { "ifOutDiscards", "pn_io.ifOutDiscards",
11920 FT_UINT32, BASE_HEX, NULL, 0x0,
11921 NULL, HFILL }
11922 },
11923 { &hf_pn_io_pdportstatistic_ifInErrors,
11924 { "ifInErrors", "pn_io.ifInErrors",
11925 FT_UINT32, BASE_HEX, NULL, 0x0,
11926 NULL, HFILL }
11927 },
11928 { &hf_pn_io_pdportstatistic_ifOutErrors,
11929 { "ifOutErrors", "pn_io.ifOutErrors",
11930 FT_UINT32, BASE_HEX, NULL, 0x0,
11931 NULL, HFILL }
11932 },
11933  
11934 { &hf_pn_io_domain_boundary,
11935 { "DomainBoundary", "pn_io.domain_boundary",
11936 FT_UINT32, BASE_HEX, NULL, 0x0,
11937 NULL, HFILL }
11938 },
11939 { &hf_pn_io_domain_boundary_ingress,
11940 { "DomainBoundaryIngress", "pn_io.domain_boundary.ingress",
11941 FT_UINT32, BASE_HEX, NULL, 0x0,
11942 NULL, HFILL }
11943 },
11944 { &hf_pn_io_domain_boundary_egress,
11945 { "DomainBoundaryEgress", "pn_io.domain_boundary.egress",
11946 FT_UINT32, BASE_HEX, NULL, 0x0,
11947 NULL, HFILL }
11948 },
11949 { &hf_pn_io_multicast_boundary,
11950 { "MulticastBoundary", "pn_io.multicast_boundary",
11951 FT_UINT32, BASE_HEX, NULL, 0x0,
11952 NULL, HFILL }
11953 },
11954 { &hf_pn_io_adjust_properties,
11955 { "AdjustProperties", "pn_io.adjust_properties",
11956 FT_UINT16, BASE_HEX, NULL, 0x0,
11957 NULL, HFILL }
11958 },
11959 { &hf_pn_io_PreambleLength,
11960 { "Preamble Length", "pn_io.preamble_length",
11961 FT_UINT16, BASE_DEC_HEX, VALS(pn_io_preamble_length), 0x0,
11962 NULL, HFILL }
11963 },
11964 { &hf_pn_io_mau_type,
11965 { "MAUType", "pn_io.mau_type",
11966 FT_UINT16, BASE_HEX, VALS(pn_io_mau_type), 0x0,
11967 NULL, HFILL }
11968 },
11969 { &hf_pn_io_mau_type_mode,
11970 { "MAUTypeMode", "pn_io.mau_type_mode",
11971 FT_UINT16, BASE_HEX, VALS(pn_io_mau_type_mode), 0x0,
11972 NULL, HFILL }
11973 },
11974 { &hf_pn_io_port_state,
11975 { "PortState", "pn_io.port_state",
11976 FT_UINT16, BASE_HEX, VALS(pn_io_port_state), 0x0,
11977 NULL, HFILL }
11978 },
11979 { &hf_pn_io_line_delay,
11980 { "LineDelay", "pn_io.line_delay",
11981 FT_UINT32, BASE_DEC, NULL, 0x0,
11982 "LineDelay in nanoseconds", HFILL }
11983 },
11984 { &hf_pn_io_number_of_peers,
11985 { "NumberOfPeers", "pn_io.number_of_peers",
11986 FT_UINT8, BASE_DEC, NULL, 0x0,
11987 NULL, HFILL }
11988 },
11989 { &hf_pn_io_length_peer_port_id,
11990 { "LengthPeerPortID", "pn_io.length_peer_port_id",
11991 FT_UINT8, BASE_DEC_HEX, NULL, 0x0,
11992 NULL, HFILL }
11993 },
11994 { &hf_pn_io_peer_port_id,
11995 { "PeerPortID", "pn_io.peer_port_id",
11996 FT_STRING, BASE_NONE, NULL, 0x0,
11997 NULL, HFILL }
11998 },
11999 { &hf_pn_io_length_peer_chassis_id,
12000 { "LengthPeerChassisID", "pn_io.length_peer_chassis_id",
12001 FT_UINT8, BASE_DEC_HEX, NULL, 0x0,
12002 NULL, HFILL }
12003 },
12004 { &hf_pn_io_peer_chassis_id,
12005 { "PeerChassisID", "pn_io.peer_chassis_id",
12006 FT_STRING, BASE_NONE, NULL, 0x0,
12007 NULL, HFILL }
12008 },
12009 { &hf_pn_io_length_own_chassis_id,
12010 { "LengthOwnChassisID", "pn_io.length_own_chassis_id",
12011 FT_UINT8, BASE_DEC, NULL, 0x0,
12012 NULL, HFILL }
12013 },
12014 { &hf_pn_io_own_chassis_id,
12015 { "OwnChassisID", "pn_io.own_chassis_id",
12016 FT_STRING, BASE_NONE, NULL, 0x0,
12017 NULL, HFILL }
12018 },
12019 { &hf_pn_io_length_own_port_id,
12020 { "LengthOwnPortID", "pn_io.length_own_port_id",
12021 FT_UINT8, BASE_DEC_HEX, NULL, 0x0,
12022 NULL, HFILL }
12023 },
12024 { &hf_pn_io_own_port_id,
12025 { "OwnPortID", "pn_io.own_port_id",
12026 FT_STRING, BASE_NONE, NULL, 0x0,
12027 NULL, HFILL }
12028 },
12029 { &hf_pn_io_peer_macadd,
12030 { "PeerMACAddress", "pn_io.peer_macadd",
12031 FT_ETHER, BASE_NONE, NULL, 0x0,
12032 NULL, HFILL }
12033 },
12034 { &hf_pn_io_macadd,
12035 { "MACAddress", "pn_io.macadd",
12036 FT_ETHER, BASE_NONE, NULL, 0x0,
12037 NULL, HFILL }
12038 },
12039 { &hf_pn_io_media_type,
12040 { "MediaType", "pn_io.media_type",
12041 FT_UINT32, BASE_HEX, VALS(pn_io_media_type), 0x0,
12042 NULL, HFILL }
12043 },
12044  
12045 { &hf_pn_io_ethertype,
12046 { "Ethertype", "pn_io.ethertype",
12047 FT_UINT16, BASE_HEX, NULL, 0x0,
12048 NULL, HFILL }
12049 },
12050 { &hf_pn_io_rx_port,
12051 { "RXPort", "pn_io.rx_port",
12052 FT_UINT8, BASE_DEC, NULL, 0x0,
12053 NULL, HFILL }
12054 },
12055 { &hf_pn_io_frame_details,
12056 { "FrameDetails", "pn_io.frame_details",
12057 FT_UINT8, BASE_HEX, NULL, 0x0,
12058 NULL, HFILL }
12059 },
12060 { &hf_pn_io_frame_details_sync_frame,
12061 { "SyncFrame", "pn_io.frame_details.sync_frame",
12062 FT_UINT8, BASE_HEX, VALS(pn_io_frame_details_sync_master_vals), 0x03,
12063 NULL, HFILL }
12064 },
12065 { &hf_pn_io_frame_details_meaning_frame_send_offset,
12066 { "Meaning", "pn_io.frame_details.meaning_frame_send_offset",
12067 FT_UINT8, BASE_HEX, VALS(pn_io_frame_details_meaning_frame_send_offset_vals), 0x0C,
12068 NULL, HFILL }
12069 },
12070 { &hf_pn_io_frame_details_reserved,
12071 { "Reserved", "pn_io.frame_details.reserved",
12072 FT_UINT8, BASE_HEX, NULL, 0xF0,
12073 NULL, HFILL }
12074 },
12075 { &hf_pn_io_nr_of_tx_port_groups,
12076 { "NumberOfTxPortGroups", "pn_io.nr_of_tx_port_groups",
12077 FT_UINT8, BASE_DEC, NULL, 0x0,
12078 NULL, HFILL }
12079 },
12080 { &hf_pn_io_TxPortGroupProperties,
12081 { "TxPortGroupProperties", "pn_io.tx_port_properties",
12082 FT_UINT8, BASE_HEX, NULL, 0x0,
12083 NULL, HFILL }
12084 },
12085 { &hf_pn_io_TxPortGroupProperties_bit0,
12086 { "TxPortLocal", "pn_io.tx_port_properties_bit_0",
12087 FT_UINT8, BASE_HEX, VALS(pn_io_txgroup_state), 0x01,
12088 NULL, HFILL }
12089 },
12090 { &hf_pn_io_TxPortGroupProperties_bit1,
12091 { "TxPort_1", "pn_io.tx_port_properties_bit_1",
12092 FT_UINT8, BASE_HEX, VALS(pn_io_txgroup_state), 0x02,
12093 NULL, HFILL }
12094 },
12095 { &hf_pn_io_TxPortGroupProperties_bit2,
12096 { "TxPort_2", "pn_io.tx_port_properties_bit_2",
12097 FT_UINT8, BASE_HEX, VALS(pn_io_txgroup_state), 0x04,
12098 NULL, HFILL }
12099 },
12100 { &hf_pn_io_TxPortGroupProperties_bit3,
12101 { "TxPort_3", "pn_io.tx_port_properties_bit_3",
12102 FT_UINT8, BASE_HEX, VALS(pn_io_txgroup_state), 0x08,
12103 NULL, HFILL }
12104 },
12105 { &hf_pn_io_TxPortGroupProperties_bit4,
12106 { "TxPort_4", "pn_io.tx_port_properties_bit_4",
12107 FT_UINT8, BASE_HEX, VALS(pn_io_txgroup_state), 0x10,
12108 NULL, HFILL }
12109 },
12110 { &hf_pn_io_TxPortGroupProperties_bit5,
12111 { "TxPort_5", "pn_io.tx_port_properties_bit_5",
12112 FT_UINT8, BASE_HEX, VALS(pn_io_txgroup_state), 0x20,
12113 NULL, HFILL }
12114 },
12115 { &hf_pn_io_TxPortGroupProperties_bit6,
12116 { "TxPort_6", "pn_io.tx_port_properties_bit_6",
12117 FT_UINT8, BASE_HEX, VALS(pn_io_txgroup_state), 0x40,
12118 NULL, HFILL }
12119 },
12120 { &hf_pn_io_TxPortGroupProperties_bit7,
12121 { "TxPort_7", "pn_io.tx_port_properties_bit_7",
12122 FT_UINT8, BASE_HEX, VALS(pn_io_txgroup_state), 0x80,
12123 NULL, HFILL }
12124 },
12125  
12126 { &hf_pn_io_start_of_red_frame_id,
12127 { "StartOfRedFrameID", "pn_io.start_of_red_frame_id",
12128 FT_UINT16, BASE_HEX, NULL, 0x0,
12129 NULL, HFILL }
12130 },
12131 { &hf_pn_io_end_of_red_frame_id,
12132 { "EndOfRedFrameID", "pn_io.end_of_red_frame_id",
12133 FT_UINT16, BASE_HEX, NULL, 0x0,
12134 NULL, HFILL }
12135 },
12136 { &hf_pn_io_ir_begin_end_port,
12137 { "Port", "pn_io.ir_begin_end_port",
12138 FT_NONE, BASE_NONE, NULL, 0x0,
12139 NULL, HFILL }
12140 },
12141 { &hf_pn_io_number_of_assignments,
12142 { "NumberOfAssignments", "pn_io.number_of_assignments",
12143 FT_UINT32, BASE_DEC, NULL, 0x0,
12144 NULL, HFILL }
12145 },
12146 { &hf_pn_io_number_of_phases,
12147 { "NumberOfPhases", "pn_io.number_of_phases",
12148 FT_UINT32, BASE_DEC, NULL, 0x0,
12149 NULL, HFILL }
12150 },
12151 { &hf_pn_io_red_orange_period_begin_tx,
12152 { "RedOrangePeriodBegin [TX]", "pn_io.red_orange_period_begin_tx",
12153 FT_UINT32, BASE_DEC, NULL, 0x0,
12154 NULL, HFILL }
12155 },
12156 { &hf_pn_io_orange_period_begin_tx,
12157 { "OrangePeriodBegin [TX]", "pn_io.orange_period_begin_tx",
12158 FT_UINT32, BASE_DEC, NULL, 0x0,
12159 NULL, HFILL }
12160 },
12161 { &hf_pn_io_green_period_begin_tx,
12162 { "GreenPeriodBegin [TX]", "pn_io.green_period_begin_tx",
12163 FT_UINT32, BASE_DEC, NULL, 0x0,
12164 NULL, HFILL }
12165 },
12166 { &hf_pn_io_red_orange_period_begin_rx,
12167 { "RedOrangePeriodBegin [RX]", "pn_io.red_orange_period_begin_rx",
12168 FT_UINT32, BASE_DEC, NULL, 0x0,
12169 NULL, HFILL }
12170 },
12171 { &hf_pn_io_orange_period_begin_rx,
12172 { "OrangePeriodBegin [RX]", "pn_io.orange_period_begin_rx",
12173 FT_UINT32, BASE_DEC, NULL, 0x0,
12174 NULL, HFILL }
12175 },
12176 { &hf_pn_io_green_period_begin_rx,
12177 { "GreenPeriodBegin [RX]", "pn_io.green_period_begin_rx",
12178 FT_UINT32, BASE_DEC, NULL, 0x0,
12179 NULL, HFILL }
12180 },
12181 { &hf_pn_ir_tx_phase_assignment,
12182 { "TXPhaseAssignment", "pn_io.tx_phase_assignment_sub",
12183 FT_NONE, BASE_NONE, NULL, 0x0,
12184 NULL, HFILL }
12185 },
12186 { &hf_pn_io_tx_phase_assignment_begin_value,
12187 { "AssignedValueForReservedBegin", "pn_io.tx_phase_assignment_begin_value",
12188 FT_UINT16, BASE_DEC, NULL, 0x0F,
12189 NULL, HFILL }
12190 },
12191 { &hf_pn_io_tx_phase_assignment_orange_begin,
12192 { "AssignedValueForOrangeBegin", "pn_io.tx_phase_assignment_orange_begin",
12193 FT_UINT16, BASE_DEC, NULL, 0x0F0,
12194 NULL, HFILL }
12195 },
12196 { &hf_pn_io_tx_phase_assignment_end_reserved,
12197 { "AssignedValueForReservedEnd", "pn_io.tx_phase_assignment_end_reserved",
12198 FT_UINT16, BASE_DEC, NULL, 0x0F00,
12199 NULL, HFILL }
12200 },
12201 { &hf_pn_io_tx_phase_assignment_reserved,
12202 { "Reserved should be 0", "pn_io.tx_phase_assignment_reserved",
12203 FT_UINT16, BASE_DEC, NULL, 0x0F000,
12204 NULL, HFILL }
12205 },
12206 { &hf_pn_ir_rx_phase_assignment,
12207 { "RXPhaseAssignment", "pn_io.rx_phase_assignment_sub",
12208 FT_NONE, BASE_NONE, NULL, 0x0,
12209 NULL, HFILL }
12210 },
12211 { &hf_pn_io_slot,
12212 { "Slot", "pn_io.slot",
12213 FT_NONE, BASE_NONE, NULL, 0x0,
12214 NULL, HFILL }
12215 },
12216 { &hf_pn_io_subslot,
12217 { "Subslot", "pn_io.subslot",
12218 FT_NONE, BASE_NONE, NULL, 0x0,
12219 NULL, HFILL }
12220 },
12221 { &hf_pn_io_number_of_slots,
12222 { "NumberOfSlots", "pn_io.number_of_slots",
12223 FT_UINT16, BASE_DEC, NULL, 0x0,
12224 NULL, HFILL }
12225 },
12226 { &hf_pn_io_number_of_subslots,
12227 { "NumberOfSubslots", "pn_io.number_of_subslots",
12228 FT_UINT16, BASE_DEC, NULL, 0x0,
12229 NULL, HFILL }
12230 },
12231 { &hf_pn_io_maintenance_required_power_budget,
12232 { "MaintenanceRequiredPowerBudget", "pn_io.maintenance_required_power_budget",
12233 FT_UINT32, BASE_HEX, NULL, 0x0,
12234 NULL, HFILL }
12235 },
12236 { &hf_pn_io_maintenance_demanded_power_budget,
12237 { "MaintenanceDemandedPowerBudget", "pn_io.maintenance_demanded_power_budget",
12238 FT_UINT32, BASE_HEX, NULL, 0x0,
12239 NULL, HFILL }
12240 },
12241 { &hf_pn_io_error_power_budget,
12242 { "ErrorPowerBudget", "pn_io.error_power_budget",
12243 FT_UINT32, BASE_HEX, NULL, 0x0,
12244 NULL, HFILL }
12245 },
12246 { &hf_pn_io_fiber_optic_type,
12247 { "FiberOpticType", "pn_io.fiber_optic_type",
12248 FT_UINT32, BASE_HEX, VALS(pn_io_fiber_optic_type), 0x0,
12249 NULL, HFILL }
12250 },
12251 { &hf_pn_io_fiber_optic_cable_type,
12252 { "FiberOpticCableType", "pn_io.fiber_optic_cable_type",
12253 FT_UINT32, BASE_HEX, VALS(pn_io_fiber_optic_cable_type), 0x0,
12254 NULL, HFILL }
12255 },
12256 { &hf_pn_io_controller_appl_cycle_factor,
12257 { "ControllerApplicationCycleFactor", "pn_io.controller_appl_cycle_factor",
12258 FT_UINT16, BASE_DEC, NULL, 0x0,
12259 NULL, HFILL }
12260 },
12261 { &hf_pn_io_time_data_cycle,
12262 { "TimeDataCycle", "pn_io.time_data_cycle",
12263 FT_UINT16, BASE_DEC, NULL, 0x0,
12264 NULL, HFILL }
12265 },
12266 { &hf_pn_io_time_io_input,
12267 { "TimeIOInput", "pn_io.time_io_input",
12268 FT_UINT32, BASE_DEC, NULL, 0x0,
12269 NULL, HFILL }
12270 },
12271 { &hf_pn_io_time_io_output,
12272 { "TimeIOOutput", "pn_io.time_io_output",
12273 FT_UINT32, BASE_DEC, NULL, 0x0,
12274 NULL, HFILL }
12275 },
12276 { &hf_pn_io_time_io_input_valid,
12277 { "TimeIOInputValid", "pn_io.time_io_input_valid",
12278 FT_UINT32, BASE_DEC, NULL, 0x0,
12279 NULL, HFILL }
12280 },
12281 { &hf_pn_io_time_io_output_valid,
12282 { "TimeIOOutputValid", "pn_io.time_io_output_valid",
12283 FT_UINT32, BASE_DEC, NULL, 0x0,
12284 NULL, HFILL }
12285 },
12286 { &hf_pn_io_maintenance_status,
12287 { "MaintenanceStatus", "pn_io.maintenance_status",
12288 FT_UINT32, BASE_HEX, NULL, 0x0,
12289 NULL, HFILL }
12290 },
12291 { &hf_pn_io_maintenance_status_required,
12292 { "Required", "pn_io.maintenance_status_required",
12293 FT_UINT32, BASE_HEX, NULL, 0x0001,
12294 NULL, HFILL }
12295 },
12296 { &hf_pn_io_maintenance_status_demanded,
12297 { "Demanded", "pn_io.maintenance_status_demanded",
12298 FT_UINT32, BASE_HEX, NULL, 0x0002,
12299 NULL, HFILL }
12300 },
12301 { &hf_pn_io_vendor_id_high,
12302 { "VendorIDHigh", "pn_io.vendor_id_high",
12303 FT_UINT8, BASE_HEX, NULL, 0x0,
12304 NULL, HFILL }
12305 },
12306 { &hf_pn_io_vendor_id_low,
12307 { "VendorIDLow", "pn_io.vendor_id_low",
12308 FT_UINT8, BASE_HEX, NULL, 0x0,
12309 NULL, HFILL }
12310 },
12311 { &hf_pn_io_vendor_block_type,
12312 { "VendorBlockType", "pn_io.vendor_block_type",
12313 FT_UINT16, BASE_HEX, NULL, 0x0,
12314 NULL, HFILL }
12315 },
12316 { &hf_pn_io_order_id,
12317 { "OrderID", "pn_io.order_id",
12318 FT_STRING, BASE_NONE, NULL, 0x0,
12319 NULL, HFILL }
12320 },
12321 { &hf_pn_io_im_serial_number,
12322 { "IMSerialNumber", "pn_io.im_serial_number",
12323 FT_STRING, BASE_NONE, NULL, 0x0,
12324 NULL, HFILL }
12325 },
12326 { &hf_pn_io_im_hardware_revision,
12327 { "IMHardwareRevision", "pn_io.im_hardware_revision",
12328 FT_UINT16, BASE_HEX, NULL, 0x0,
12329 NULL, HFILL }
12330 },
12331 /* XXX - better use a simple char here -> vals */
12332 { &hf_pn_io_im_revision_prefix,
12333 { "IMRevisionPrefix", "pn_io.im_revision_prefix",
12334 FT_UINT8, BASE_HEX, VALS(pn_io_im_revision_prefix_vals), 0x0,
12335 NULL, HFILL }
12336 },
12337 { &hf_pn_io_im_sw_revision_functional_enhancement,
12338 { "IMSWRevisionFunctionalEnhancement", "pn_io.im_sw_revision_functional_enhancement",
12339 FT_UINT8, BASE_HEX, NULL, 0x0,
12340 NULL, HFILL }
12341 },
12342 { &hf_pn_io_im_revision_bugfix,
12343 { "IM_SWRevisionBugFix", "pn_io.im_revision_bugfix",
12344 FT_UINT8, BASE_HEX, NULL, 0x0,
12345 NULL, HFILL }
12346 },
12347 { &hf_pn_io_im_sw_revision_internal_change,
12348 { "IMSWRevisionInternalChange", "pn_io.im_sw_revision_internal_change",
12349 FT_UINT8, BASE_HEX, NULL, 0x0,
12350 NULL, HFILL }
12351 },
12352 { &hf_pn_io_im_revision_counter,
12353 { "IMRevisionCounter", "pn_io.im_revision_counter",
12354 FT_UINT16, BASE_HEX, NULL, 0x0,
12355 NULL, HFILL }
12356 },
12357 { &hf_pn_io_im_profile_id,
12358 { "IMProfileID", "pn_io.im_profile_id",
12359 FT_UINT16, BASE_HEX, NULL, 0x0,
12360 NULL, HFILL }
12361 },
12362 { &hf_pn_io_im_profile_specific_type,
12363 { "IMProfileSpecificType", "pn_io.im_profile_specific_type",
12364 FT_UINT16, BASE_HEX, NULL, 0x0,
12365 NULL, HFILL }
12366 },
12367 { &hf_pn_io_im_version_major,
12368 { "IMVersionMajor", "pn_io.im_version_major",
12369 FT_UINT8, BASE_HEX, NULL, 0x0,
12370 NULL, HFILL }
12371 },
12372 { &hf_pn_io_im_version_minor,
12373 { "IMVersionMinor", "pn_io.im_version_minor",
12374 FT_UINT8, BASE_HEX, NULL, 0x0,
12375 NULL, HFILL }
12376 },
12377 { &hf_pn_io_im_supported,
12378 { "IM_Supported", "pn_io.im_supported",
12379 FT_UINT16, BASE_HEX, NULL, 0x0,
12380 NULL, HFILL }
12381 },
12382 { &hf_pn_io_im_numberofentries,
12383 { "NumberOfEntries", "pn_io.im_numberofentries",
12384 FT_UINT16, BASE_HEX, NULL, 0x0,
12385 NULL, HFILL }
12386 },
12387 { &hf_pn_io_im_annotation,
12388 { "IM Annotation", "pn_io.im_annotation",
12389 FT_STRING, BASE_NONE, NULL, 0x0,
12390 NULL, HFILL }
12391 },
12392 { &hf_pn_io_im_order_id,
12393 { "IM Order ID", "pn_io.im_order_id",
12394 FT_STRING, BASE_NONE, NULL, 0x0,
12395 NULL, HFILL }
12396 },
12397 { &hf_pn_io_number_of_ars,
12398 { "NumberOfARs", "pn_io.number_of_ars",
12399 FT_UINT16, BASE_DEC, NULL, 0x0,
12400 NULL, HFILL }
12401 },
12402 { &hf_pn_io_cycle_counter,
12403 { "CycleCounter", "pn_io.cycle_counter",
12404 FT_UINT16, BASE_DEC, NULL, 0x0,
12405 NULL, HFILL }
12406 },
12407 { &hf_pn_io_data_status,
12408 { "DataStatus", "pn_io.ds",
12409 FT_UINT8, BASE_HEX, 0, 0x0,
12410 NULL, HFILL }
12411 },
12412 { &hf_pn_io_data_status_res67,
12413 { "Reserved (should be zero)", "pn_io.ds_res67",
12414 FT_UINT8, BASE_HEX, 0, 0xc0,
12415 NULL, HFILL }
12416 },
12417 { &hf_pn_io_data_status_ok,
12418 { "StationProblemIndicator (1:Ok/0:Problem)", "pn_io.ds_ok",
12419 FT_UINT8, BASE_HEX, 0, 0x20,
12420 NULL, HFILL }
12421 },
12422 { &hf_pn_io_data_status_operate,
12423 { "ProviderState (1:Run/0:Stop)", "pn_io.ds_operate",
12424 FT_UINT8, BASE_HEX, 0, 0x10,
12425 NULL, HFILL }
12426 },
12427 { &hf_pn_io_data_status_res3,
12428 { "Reserved (should be zero)", "pn_io.ds_res3",
12429 FT_UINT8, BASE_HEX, 0, 0x08,
12430 NULL, HFILL }
12431 },
12432 { &hf_pn_io_data_status_valid,
12433 { "DataValid (1:Valid/0:Invalid)", "pn_io.ds_valid",
12434 FT_UINT8, BASE_HEX, 0, 0x04,
12435 NULL, HFILL }
12436 },
12437 { &hf_pn_io_data_status_res1,
12438 { "primary AR of a given AR-set is present (0:One/ 1:None)", "pn_io.ds_res1",
12439 FT_UINT8, BASE_HEX, 0, 0x02,
12440 NULL, HFILL }
12441 },
12442 { &hf_pn_io_data_status_primary,
12443 { "State (1:Primary/0:Backup)", "pn_io.ds_primary",
12444 FT_UINT8, BASE_HEX, 0, 0x01,
12445 NULL, HFILL }
12446 },
12447 { &hf_pn_io_transfer_status,
12448 { "TransferStatus", "pn_io.transfer_status",
12449 FT_UINT8, BASE_DEC, NULL, 0x0,
12450 NULL, HFILL }
12451 },
12452 { &hf_pn_io_actual_local_time_stamp,
12453 { "ActualLocalTimeStamp", "pn_io.actual_local_time_stamp",
12454 FT_UINT64, BASE_DEC, NULL, 0x0,
12455 NULL, HFILL }
12456 },
12457 { &hf_pn_io_local_time_stamp,
12458 { "LocalTimeStamp", "pn_io.local_time_stamp",
12459 FT_UINT64, BASE_DEC, NULL, 0x0,
12460 NULL, HFILL }
12461 },
12462 { &hf_pn_io_number_of_log_entries,
12463 { "NumberOfLogEntries", "pn_io.number_of_log_entries",
12464 FT_UINT16, BASE_DEC, NULL, 0x0,
12465 NULL, HFILL }
12466 },
12467 { &hf_pn_io_entry_detail,
12468 { "EntryDetail", "pn_io.entry_detail",
12469 FT_UINT32, BASE_DEC, NULL, 0x0,
12470 NULL, HFILL }
12471 },
12472 { &hf_pn_io_ip_address,
12473 { "IPAddress", "pn_io.ip_address",
12474 FT_IPv4, BASE_NONE, NULL, 0x0,
12475 NULL, HFILL }
12476 },
12477 { &hf_pn_io_subnetmask,
12478 { "Subnetmask", "pn_io.subnetmask",
12479 FT_IPv4, BASE_NONE, NULL, 0x0,
12480 NULL, HFILL }
12481 },
12482 { &hf_pn_io_standard_gateway,
12483 { "StandardGateway", "pn_io.standard_gateway",
12484 FT_IPv4, BASE_NONE, NULL, 0x0,
12485 NULL, HFILL }
12486 },
12487  
12488 { &hf_pn_io_mrp_domain_uuid,
12489 { "MRP_DomainUUID", "pn_io.mrp_domain_uuid",
12490 FT_GUID, BASE_NONE, NULL, 0x0,
12491 NULL, HFILL }
12492 },
12493 { &hf_pn_io_mrp_role,
12494 { "MRP_Role", "pn_io.mrp_role",
12495 FT_UINT16, BASE_HEX, VALS(pn_io_mrp_role_vals), 0x0,
12496 NULL, HFILL }
12497 },
12498 { &hf_pn_io_mrp_length_domain_name,
12499 { "MRP_LengthDomainName", "pn_io.mrp_length_domain_name",
12500 FT_UINT16, BASE_DEC_HEX, NULL, 0x0,
12501 NULL, HFILL }
12502 },
12503 { &hf_pn_io_mrp_domain_name,
12504 { "MRP_DomainName", "pn_io.mrp_domain_name",
12505 FT_STRING, BASE_NONE, NULL, 0x0,
12506 NULL, HFILL }
12507 },
12508 { &hf_pn_io_mrp_instances,
12509 { "NumberOfMrpInstances", "pn_io.mrp_Number_MrpInstances",
12510 FT_UINT8, BASE_DEC, NULL, 0x0,
12511 NULL, HFILL }
12512 },
12513 { &hf_pn_io_mrp_instance,
12514 { "Mrp_Instance", "pn_io.mrp_MrpInstance",
12515 FT_UINT8, BASE_DEC, VALS(pn_io_mrp_instance_no), 0x0,
12516 NULL, HFILL }
12517 },
12518  
12519 { &hf_pn_io_mrp_prio,
12520 { "MRP_Prio", "pn_io.mrp_prio",
12521 FT_UINT16, BASE_HEX, VALS(pn_io_mrp_prio_vals), 0x0,
12522 NULL, HFILL }
12523 },
12524 { &hf_pn_io_mrp_topchgt,
12525 { "MRP_TOPchgT", "pn_io.mrp_topchgt",
12526 FT_UINT16, BASE_DEC, NULL, 0x0,
12527 "time base 10ms", HFILL }
12528 },
12529 { &hf_pn_io_mrp_topnrmax,
12530 { "MRP_TOPNRmax", "pn_io.mrp_topnrmax",
12531 FT_UINT16, BASE_DEC, NULL, 0x0,
12532 "number of iterations", HFILL }
12533 },
12534 { &hf_pn_io_mrp_tstshortt,
12535 { "MRP_TSTshortT", "pn_io.mrp_tstshortt",
12536 FT_UINT16, BASE_DEC, NULL, 0x0,
12537 "time base 1 ms", HFILL }
12538 },
12539 { &hf_pn_io_mrp_tstdefaultt,
12540 { "MRP_TSTdefaultT", "pn_io.mrp_tstdefaultt",
12541 FT_UINT16, BASE_DEC, NULL, 0x0,
12542 "time base 1ms", HFILL }
12543 },
12544 { &hf_pn_io_mrp_tstnrmax,
12545 { "MRP_TSTNRmax", "pn_io.mrp_tstnrmax",
12546 FT_UINT16, BASE_DEC, NULL, 0x0,
12547 "number of outstanding test indications causes ring failure", HFILL }
12548 },
12549 { &hf_pn_io_mrp_check,
12550 { "MRP_Check", "pn_io.mrp_check",
12551 FT_UINT32, BASE_HEX, NULL, 0x0,
12552 NULL, HFILL }
12553 },
12554 { &hf_pn_io_mrp_check_mrm,
12555 { "MRP_Check.MediaRedundancyManager", "pn_io.mrp_check.mrm",
12556 FT_UINT32, BASE_HEX, VALS(pn_io_mrp_mrm_on), 0x01,
12557 NULL, HFILL }
12558 },
12559 { &hf_pn_io_mrp_check_mrpdomain,
12560 { "MRP_Check.MRP_DomainUUID", "pn_io.mrp_check.domainUUID",
12561 FT_UINT32, BASE_HEX, VALS(pn_io_mrp_checkUUID), 0x02,
12562 NULL, HFILL }
12563 },
12564 { &hf_pn_io_mrp_check_reserved_1,
12565 { "MRP_Check.reserved_1", "pn_io.mrp_check_reserved_1",
12566 FT_UINT32, BASE_HEX, NULL, 0x0FFFFFC,
12567 NULL, HFILL }
12568 },
12569 { &hf_pn_io_mrp_check_reserved_2,
12570 { "MRP_Check.reserved_2", "pn_io.mrp_check_reserved_2",
12571 FT_UINT32, BASE_HEX, NULL, 0x0FF000000,
12572 NULL, HFILL }
12573 },
12574 { &hf_pn_io_mrp_rtmode,
12575 { "MRP_RTMode", "pn_io.mrp_rtmode",
12576 FT_UINT32, BASE_HEX, NULL, 0x0,
12577 NULL, HFILL }
12578 },
12579 { &hf_pn_io_mrp_rtmode_rtclass12,
12580 { "RTClass1_2", "pn_io.mrp_rtmode.class1_2",
12581 FT_UINT32, BASE_HEX, VALS(pn_io_mrp_rtmode_rtclass12_vals), 0x00000001,
12582 NULL, HFILL }
12583 },
12584 { &hf_pn_io_mrp_rtmode_rtclass3,
12585 { "RTClass1_3", "pn_io.mrp_rtmode.class3",
12586 FT_UINT32, BASE_HEX, VALS(pn_io_mrp_rtmode_rtclass3_vals), 0x00000002,
12587 NULL, HFILL }
12588 },
12589 { &hf_pn_io_mrp_rtmode_reserved1,
12590 { "Reserved_1", "pn_io.mrp_rtmode.reserved_1",
12591 FT_UINT32, BASE_HEX, NULL, 0x00fffffc,
12592 NULL, HFILL }
12593 },
12594 { &hf_pn_io_mrp_rtmode_reserved2,
12595 { "Reserved_2", "pn_io.mrp_rtmode.reserved_2",
12596 FT_UINT32, BASE_HEX, NULL, 0xff000000,
12597 NULL, HFILL }
12598 },
12599 { &hf_pn_io_mrp_lnkdownt,
12600 { "MRP_LNKdownT", "pn_io.mrp_lnkdownt",
12601 FT_UINT16, BASE_HEX, NULL, 0x0,
12602 "Link down Interval in ms", HFILL }
12603 },
12604 { &hf_pn_io_mrp_lnkupt,
12605 { "MRP_LNKupT", "pn_io.mrp_lnkupt",
12606 FT_UINT16, BASE_HEX, NULL, 0x0,
12607 "Link up Interval in ms", HFILL }
12608 },
12609 { &hf_pn_io_mrp_lnknrmax,
12610 { "MRP_LNKNRmax", "pn_io.mrp_lnknrmax",
12611 FT_UINT16, BASE_HEX, NULL, 0x0,
12612 NULL, HFILL }
12613 },
12614 { &hf_pn_io_mrp_version,
12615 { "MRP_Version", "pn_io.mrp_version",
12616 FT_UINT16, BASE_DEC, NULL, 0x0,
12617 NULL, HFILL }
12618 },
12619 { &hf_pn_io_substitute_active_flag,
12620 { "SubstituteActiveFlag", "pn_io.substitute_active_flag",
12621 FT_UINT16, BASE_HEX, NULL, 0x0,
12622 NULL, HFILL }
12623 },
12624 { &hf_pn_io_length_data,
12625 { "LengthData", "pn_io.length_data",
12626 FT_UINT16, BASE_DEC_HEX, NULL, 0x0,
12627 NULL, HFILL }
12628 },
12629 { &hf_pn_io_mrp_ring_state,
12630 { "MRP_RingState", "pn_io.mrp_ring_state",
12631 FT_UINT16, BASE_HEX, VALS(pn_io_mrp_ring_state_vals), 0x0,
12632 NULL, HFILL }
12633 },
12634 { &hf_pn_io_mrp_rt_state,
12635 { "MRP_RTState", "pn_io.mrp_rt_state",
12636 FT_UINT16, BASE_HEX, VALS(pn_io_mrp_rt_state_vals), 0x0,
12637 NULL, HFILL }
12638 },
12639 { &hf_pn_io_im_tag_function,
12640 { "IM_Tag_Function", "pn_io.im_tag_function",
12641 FT_STRING, BASE_NONE, NULL, 0x0,
12642 NULL, HFILL }
12643 },
12644 { &hf_pn_io_im_tag_location,
12645 { "IM_Tag_Location", "pn_io.im_tag_location",
12646 FT_STRING, BASE_NONE, NULL, 0x0,
12647 NULL, HFILL }
12648 },
12649 { &hf_pn_io_im_date,
12650 { "IM_Date", "pn_io.im_date",
12651 FT_STRING, BASE_NONE, NULL, 0x0,
12652 NULL, HFILL }
12653 },
12654 { &hf_pn_io_im_descriptor,
12655 { "IM_Descriptor", "pn_io.im_descriptor",
12656 FT_STRING, BASE_NONE, NULL, 0x0,
12657 NULL, HFILL }
12658 },
12659 { &hf_pn_io_fs_hello_mode,
12660 { "FSHelloMode", "pn_io.fs_hello_mode",
12661 FT_UINT32, BASE_HEX, VALS(pn_io_fs_hello_mode_vals), 0x0,
12662 NULL, HFILL }
12663 },
12664 { &hf_pn_io_fs_hello_interval,
12665 { "FSHelloInterval", "pn_io.fs_hello_interval",
12666 FT_UINT32, BASE_DEC, NULL, 0x0,
12667 "ms before conveying a second DCP_Hello.req", HFILL }
12668 },
12669 { &hf_pn_io_fs_hello_retry,
12670 { "FSHelloRetry", "pn_io.fs_hello_retry",
12671 FT_UINT32, BASE_DEC, NULL, 0x0,
12672 NULL, HFILL }
12673 },
12674 { &hf_pn_io_fs_hello_delay,
12675 { "FSHelloDelay", "pn_io.fs_hello_delay",
12676 FT_UINT32, BASE_DEC, NULL, 0x0,
12677 NULL, HFILL }
12678 },
12679 { &hf_pn_io_fs_parameter_mode,
12680 { "FSParameterMode", "pn_io.fs_parameter_mode",
12681 FT_UINT32, BASE_HEX, VALS(pn_io_fs_parameter_mode_vals), 0x0,
12682 NULL, HFILL }
12683 },
12684 { &hf_pn_io_fs_parameter_uuid,
12685 { "FSParameterUUID", "pn_io.fs_parameter_uuid",
12686 FT_GUID, BASE_NONE, NULL, 0x0,
12687 NULL, HFILL }
12688 },
12689 { &hf_pn_io_check_sync_mode,
12690 { "CheckSyncMode", "pn_io.check_sync_mode",
12691 FT_UINT16, BASE_HEX, NULL, 0x0,
12692 NULL, HFILL }
12693 },
12694 { &hf_pn_io_check_sync_mode_reserved,
12695 { "Reserved", "pn_io.check_sync_mode.reserved",
12696 FT_UINT16, BASE_HEX, NULL, 0xFFFC,
12697 NULL, HFILL }
12698 },
12699 { &hf_pn_io_check_sync_mode_sync_master,
12700 { "SyncMaster", "pn_io.check_sync_mode.sync_master",
12701 FT_UINT16, BASE_HEX, NULL, 0x0002,
12702 NULL, HFILL }
12703 },
12704 { &hf_pn_io_check_sync_mode_cable_delay,
12705 { "CableDelay", "pn_io.check_sync_mode.cable_delay",
12706 FT_UINT16, BASE_HEX, NULL, 0x0001,
12707 NULL, HFILL }
12708 },
12709 /* PROFIsafe F-Parameter */
12710 { &hf_pn_io_ps_f_prm_flag1,
12711 { "F_Prm_Flag1", "pn_io.ps.f_prm_flag1",
12712 FT_UINT8, BASE_HEX, NULL, 0x0,
12713 NULL, HFILL }
12714 },
12715 { &hf_pn_io_ps_f_prm_flag1_chck_seq,
12716 { "F_Check_SeqNr", "pn_io.ps.f_prm_flag1.f_check_seqnr",
12717 FT_UINT8, BASE_HEX, VALS(pn_io_f_check_seqnr), 0x01,
12718 NULL, HFILL }
12719 },
12720 { &hf_pn_io_ps_f_prm_flag1_chck_ipar,
12721 { "F_Check_iPar", "pn_io.ps.f_prm_flag1.f_check_ipar",
12722 FT_UINT8, BASE_HEX, VALS(pn_io_f_check_ipar), 0x02,
12723 NULL, HFILL }
12724 },
12725 { &hf_pn_io_ps_f_prm_flag1_sil,
12726 { "F_SIL", "pn_io.ps.f_prm_flag1.f_sil",
12727 FT_UINT8, BASE_HEX, VALS(pn_io_f_sil), 0xc,
12728 NULL, HFILL }
12729 },
12730 { &hf_pn_io_ps_f_prm_flag1_crc_len,
12731 { "F_CRC_Length", "pn_io.ps.f_prm_flag1.f_crc_len",
12732 FT_UINT8, BASE_HEX, VALS(pn_io_f_crc_len), 0x30,
12733 NULL, HFILL }
12734 },
12735 { &hf_pn_io_ps_f_prm_flag1_crc_seed,
12736 { "F_CRC_Seed", "pn_io.ps.f_prm_flag1.f_crc_seed",
12737 FT_UINT8, BASE_HEX, VALS(pn_io_f_crc_seed), 0x40,
12738 NULL, HFILL }
12739 },
12740 { &hf_pn_io_ps_f_prm_flag1_reserved,
12741 { "Reserved", "pn_io.ps.f_prm_flag1.reserved",
12742 FT_UINT8, BASE_HEX, NULL, 0x80,
12743 NULL, HFILL }
12744 },
12745 { &hf_pn_io_ps_f_prm_flag2,
12746 { "F_Prm_Flag2", "pn_io.ps.f_prm_flag2",
12747 FT_UINT8, BASE_HEX, NULL, 0x0,
12748 NULL, HFILL }
12749 },
12750 { &hf_pn_io_ps_f_prm_flag2_reserved,
12751 { "Reserved", "pn_io.ps.f_prm_flag2.reserved",
12752 FT_UINT8, BASE_HEX, NULL, 0x07,
12753 NULL, HFILL }
12754 },
12755 { &hf_pn_io_ps_f_prm_flag2_f_block_id,
12756 { "F_Block_ID", "pn_io.ps.f_prm_flag2.f_block_id",
12757 FT_UINT8, BASE_HEX, VALS(pn_io_f_block_id), 0x38,
12758 NULL, HFILL }
12759 },
12760 { &hf_pn_io_ps_f_prm_flag2_f_par_version,
12761 { "F_Par_Version", "pn_io.ps.f_prm_flag2.f_par_version",
12762 FT_UINT8, BASE_HEX, VALS(pn_io_f_par_version), 0xC0,
12763 NULL, HFILL }
12764 },
12765 { &hf_pn_io_ps_f_wd_time,
12766 { "F_WD_Time", "pn_io.ps.f_wd_time",
12767 FT_UINT16, BASE_DEC, NULL, 0x0,
12768 NULL, HFILL }
12769 },
12770 { &hf_pn_io_ps_f_ipar_crc,
12771 { "F_iPar_CRC", "pn_io.ps.f_ipar_crc",
12772 FT_UINT32, BASE_DEC, NULL, 0x0,
12773 NULL, HFILL }
12774 },
12775 { &hf_pn_io_ps_f_par_crc,
12776 { "F_Par_CRC", "pn_io.ps.f_par_crc",
12777 FT_UINT16, BASE_DEC, NULL, 0x0,
12778 NULL, HFILL }
12779 },
12780 { &hf_pn_io_ps_f_dest_adr,
12781 { "F_Dest_Add", "pn_io.ps.f_dest_add",
12782 FT_UINT16, BASE_DEC, NULL, 0x0,
12783 NULL, HFILL }
12784 },
12785 { &hf_pn_io_ps_f_src_adr,
12786 { "F_Source_Add", "pn_io.ps.f_source_add",
12787 FT_UINT16, BASE_DEC, NULL, 0x0,
12788 NULL, HFILL }
12789 },
12790 /* profidrive parameter access */
12791 { &hf_pn_io_profidrive_request_reference,
12792 { "RequestReference", "pn_io.profidrive.parameter.request_reference",
12793 FT_UINT8, BASE_HEX, NULL, 0x0,
12794 NULL, HFILL }
12795 },
12796 { &hf_pn_io_profidrive_request_id,
12797 { "RequestID", "pn_io.profidrive.parameter.request_id",
12798 FT_UINT8, BASE_HEX, VALS(pn_io_profidrive_request_id_vals), 0x0,
12799 NULL, HFILL }
12800 },
12801 { &hf_pn_io_profidrive_do_id,
12802 { "DO", "pn_io.profidrive.parameter.do",
12803 FT_UINT8, BASE_DEC, NULL, 0x0,
12804 NULL, HFILL }
12805 },
12806 { &hf_pn_io_profidrive_no_of_parameters,
12807 { "NoOfParameters", "pn_io.profidrive.parameter.no_of_parameters",
12808 FT_UINT8, BASE_DEC, NULL, 0x0,
12809 NULL, HFILL }
12810 },
12811 { &hf_pn_io_profidrive_param_attribute,
12812 { "Attribute", "pn_io.profidrive.parameter.attribute",
12813 FT_UINT8, BASE_HEX, VALS(pn_io_profidrive_attribute_vals), 0x0,
12814 NULL, HFILL }
12815 },
12816 { &hf_pn_io_profidrive_param_no_of_elems,
12817 { "NoOfElements", "pn_io.profidrive.parameter.no_of_elems",
12818 FT_UINT8, BASE_DEC, NULL, 0x0,
12819 NULL, HFILL }
12820 },
12821 { &hf_pn_io_profidrive_param_number,
12822 { "Parameter", "pn_io.profidrive.parameter.number",
12823 FT_UINT16, BASE_DEC, NULL, 0x0,
12824 NULL, HFILL }
12825 },
12826 { &hf_pn_io_profidrive_param_subindex,
12827 { "Index", "pn_io.profidrive.parameter.index",
12828 FT_UINT16, BASE_DEC, NULL, 0x0,
12829 NULL, HFILL }
12830 },
12831 { &hf_pn_io_profidrive_response_id,
12832 { "ResponseID", "pn_io.profidrive.parameter.response_id",
12833 FT_UINT8, BASE_HEX, VALS(pn_io_profidrive_response_id_vals), 0x0,
12834 NULL, HFILL }
12835 },
12836 { &hf_pn_io_profidrive_param_format,
12837 { "Format", "pn_io.profidrive.parameter.format",
12838 FT_UINT8, BASE_HEX, VALS(pn_io_profidrive_format_vals), 0x0,
12839 NULL, HFILL }
12840 },
12841 { &hf_pn_io_profidrive_param_no_of_values,
12842 { "NoOfValues", "pn_io.profidrive.parameter.no_of_values",
12843 FT_UINT8, BASE_DEC, NULL, 0x0,
12844 NULL, HFILL }
12845 },
12846 { &hf_pn_io_profidrive_param_value_byte,
12847 { "Value", "pn_io.profidrive.parameter.value_b",
12848 FT_UINT8, BASE_HEX, NULL, 0x0,
12849 NULL, HFILL }
12850 },
12851 { &hf_pn_io_profidrive_param_value_word,
12852 { "Value", "pn_io.profidrive.parameter.value_w",
12853 FT_UINT16, BASE_HEX, NULL, 0x0,
12854 NULL, HFILL }
12855 },
12856 { &hf_pn_io_profidrive_param_value_dword,
12857 { "Value", "pn_io.profidrive.parameter.value_dw",
12858 FT_UINT32, BASE_HEX, NULL, 0x0,
12859 NULL, HFILL }
12860 },
12861 { &hf_pn_io_profidrive_param_value_float,
12862 { "Value", "pn_io.profidrive.parameter.value_float",
12863 FT_FLOAT, BASE_NONE, NULL, 0x0,
12864 NULL, HFILL }
12865 },
12866 { &hf_pn_io_profidrive_param_value_string,
12867 { "Value", "pn_io.profidrive.parameter.value_str",
12868 FT_STRING, BASE_NONE, NULL, 0x0,
12869 NULL, HFILL }
12870 },
12871 };
12872  
12873 static gint *ett[] = {
12874 &ett_pn_io,
12875 &ett_pn_io_block,
12876 &ett_pn_io_block_header,
12877 &ett_pn_io_status,
12878 &ett_pn_io_rtc,
12879 &ett_pn_io_rta,
12880 &ett_pn_io_pdu_type,
12881 &ett_pn_io_add_flags,
12882 &ett_pn_io_control_command,
12883 &ett_pn_io_ioxs,
12884 &ett_pn_io_api,
12885 &ett_pn_io_data_description,
12886 &ett_pn_io_module,
12887 &ett_pn_io_submodule,
12888 &ett_pn_io_io_data_object,
12889 &ett_pn_io_io_cs,
12890 &ett_pn_io_ar_properties,
12891 &ett_pn_io_iocr_properties,
12892 &ett_pn_io_submodule_properties,
12893 &ett_pn_io_alarmcr_properties,
12894 &ett_pn_io_submodule_state,
12895 &ett_pn_io_channel_properties,
12896 &ett_pn_io_slot,
12897 &ett_pn_io_subslot,
12898 &ett_pn_io_maintenance_status,
12899 &ett_pn_io_data_status,
12900 &ett_pn_io_iocr,
12901 &ett_pn_io_mrp_rtmode,
12902 &ett_pn_io_control_block_properties,
12903 &ett_pn_io_check_sync_mode,
12904 &ett_pn_io_ir_frame_data,
12905 &ett_pn_FrameDataProperties,
12906 &ett_pn_io_ar_info,
12907 &ett_pn_io_ar_data,
12908 &ett_pn_io_ir_begin_end_port,
12909 &ett_pn_io_ir_tx_phase,
12910 &ett_pn_io_ir_rx_phase,
12911 &ett_pn_io_subframe_data,
12912 &ett_pn_io_SFIOCRProperties,
12913 &ett_pn_io_frame_defails,
12914 &ett_pn_io_profisafe_f_parameter,
12915 &ett_pn_io_profisafe_f_parameter_prm_flag1,
12916 &ett_pn_io_profisafe_f_parameter_prm_flag2,
12917 &ett_pn_io_profidrive_parameter_request,
12918 &ett_pn_io_profidrive_parameter_response,
12919 &ett_pn_io_profidrive_parameter_address,
12920 &ett_pn_io_profidrive_parameter_value,
12921 &ett_pn_io_GroupProperties
12922 };
12923  
12924 static ei_register_info ei[] = {
12925 { &ei_pn_io_block_version, { "pn_io.block_version.not_implemented", PI_UNDECODED, PI_WARN, "Block version not implemented yet!", EXPFILL }},
12926 { &ei_pn_io_error_code1, { "pn_io.error_code1.expert", PI_UNDECODED, PI_WARN, "Unknown ErrorCode1", EXPFILL }},
12927 { &ei_pn_io_error_code2, { "pn_io.error_code2.expert", PI_UNDECODED, PI_WARN, "Unknown ErrorDecode", EXPFILL }},
12928 { &ei_pn_io_ar_info_not_found, { "pn_io.ar_info_not_found", PI_UNDECODED, PI_NOTE, "IODWriteReq: AR information not found!", EXPFILL }},
12929 { &ei_pn_io_block_length, { "pn_io.block_length.invalid", PI_UNDECODED, PI_WARN, "Block length invalid!", EXPFILL }},
12930 { &ei_pn_io_unsupported, { "pn_io.profidrive.parameter.format.invalid", PI_UNDECODED, PI_WARN, "Unknown Fomatvalue", EXPFILL }},
12931 { &ei_pn_io_mrp_instances, { "pn_io.mrp_Number_MrpInstances.invalid", PI_UNDECODED, PI_WARN, "Number of MrpInstances invalid", EXPFILL }},
12932 { &ei_pn_io_frame_id, { "pn_io.frame_id.changed", PI_UNDECODED, PI_WARN, "FrameID changed", EXPFILL }},
12933 { &ei_pn_io_iocr_type, { "pn_io.iocr_type.unknown", PI_UNDECODED, PI_WARN, "IOCRType undecoded!", EXPFILL }},
12934 { &ei_pn_io_localalarmref, { "pn_io.localalarmref.changed", PI_UNDECODED, PI_WARN, "AlarmCRBlockReq: local alarm ref changed", EXPFILL }},
12935 { &ei_pn_io_nr_of_tx_port_groups, { "pn_io.nr_of_tx_port_groups.not_allowed", PI_PROTOCOL, PI_WARN, "Not allowed value of NumberOfTxPortGroups", EXPFILL }},
12936 };
12937  
12938 module_t *pnio_module;
12939 expert_module_t* expert_pn_io;
12940  
12941 proto_pn_io = proto_register_protocol ("PROFINET IO", "PNIO", "pn_io");
12942  
12943 /* Register by name */
12944 register_dissector("pnio", dissect_PNIO_heur, proto_pn_io);
12945  
12946 /* Created to remove Decode As confusion */
12947 proto_pn_io_controller = proto_register_protocol ("PROFINET IO (Controller)", "PNIO (Controller)", "pn_io_controller");
12948 proto_pn_io_supervisor = proto_register_protocol ("PROFINET IO (Supervisor)", "PNIO (Supervisor)", "pn_io_supervisor");
12949 proto_pn_io_parameterserver = proto_register_protocol ("PROFINET IO (Parameter Server)", "PNIO (Parameter Server)", "pn_io_parameterserver");
12950  
12951 proto_register_field_array (proto_pn_io, hf, array_length (hf));
12952 proto_register_subtree_array (ett, array_length (ett));
12953 expert_pn_io = expert_register_protocol(proto_pn_io);
12954 expert_register_field_array(expert_pn_io, ei, array_length(ei));
12955  
12956 /* Register preferences */
12957 pnio_module = prefs_register_protocol(proto_pn_io, NULL);
12958 prefs_register_bool_preference(pnio_module, "pnio_ps_selection",
12959 "Enable detailed PROFIsafe dissection",
12960 "Whether the PNIO dissector is allowed to use detailed PROFIsafe dissection of cyclic data frames",
12961 &pnio_ps_selection);
12962 prefs_register_directory_preference(pnio_module, "pnio_ps_networkpath",
12963 "Configuration GSD-File Networkpath", /* Title */
12964 "Select your Networkpath to your GSD-Files.", /* Descreption */
12965 &pnio_ps_networkpath); /* Variable to save the GSD-File networkpath */
12966  
12967 /* subdissector code */
12968 register_dissector("pn_io", dissect_PNIO_heur, proto_pn_io);
12969 heur_pn_subdissector_list = register_heur_dissector_list("pn_io", proto_pn_io);
12970  
12971 /* Initialise RTC1 dissection */
12972 init_pn_io_rtc1(proto_pn_io);
12973  
12974 /* Cleanup functions of PNIO protocol */
12975 register_cleanup_routine(pnio_cleanup);
12976  
12977 register_conversation_filter("pn_io", "PN-IO AR", pn_io_ar_conv_valid, pn_io_ar_conv_filter);
12978 register_conversation_filter("pn_io", "PN-IO AR (with data)", pn_io_ar_conv_valid, pn_io_ar_conv_data_filter);
12979 }
12980  
12981  
12982 void
12983 proto_reg_handoff_pn_io (void)
12984 {
12985 /* Register the protocols as dcerpc */
12986 dcerpc_init_uuid (proto_pn_io, ett_pn_io, &uuid_pn_io_device, ver_pn_io_device, pn_io_dissectors, hf_pn_io_opnum);
12987 dcerpc_init_uuid (proto_pn_io_controller, ett_pn_io, &uuid_pn_io_controller, ver_pn_io_controller, pn_io_dissectors, hf_pn_io_opnum);
12988 dcerpc_init_uuid (proto_pn_io_supervisor, ett_pn_io, &uuid_pn_io_supervisor, ver_pn_io_supervisor, pn_io_dissectors, hf_pn_io_opnum);
12989 dcerpc_init_uuid (proto_pn_io_parameterserver, ett_pn_io, &uuid_pn_io_parameterserver, ver_pn_io_parameterserver, pn_io_dissectors, hf_pn_io_opnum);
12990  
12991 heur_dissector_add("pn_rt", dissect_PNIO_heur, "PROFINET IO", "pn_io_pn_rt", proto_pn_io, HEURISTIC_ENABLE);
12992 }
12993  
12994 /*
12995 * Editor modelines
12996 *
12997 * Local Variables:
12998 * c-basic-offset: 4
12999 * tab-width: 8
13000 * indent-tabs-mode: nil
13001 * End:
13002 *
13003 * ex: set shiftwidth=4 tabstop=8 expandtab:
13004 * :indentSize=4:tabSize=8:noTabs=true:
13005 */