Wireshark 2.9.0-477-g68ec514b The Wireshark network protocol analyzer

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

packet-opensafety.h
1 /* packet-opensafety.h
2 *
3 * openSAFETY is a machine-safety protocol, encapsulated in modern fieldbus
4 * and industrial ethernet solutions.
5 *
6 * For more information see http://www.open-safety.org
7 *
8 * This header contains commonly used headers, which may be used by programs
9 * utilizing the tap-interface of the dissector
10 *
11 * By Roland Knall <roland.knall@br-automation.com>
12 * Copyright 2011-2015 Bernecker + Rainer Industrie-Elektronik Ges.m.b.H.
13 *
14 * Wireshark - Network traffic analyzer
15 * By Gerald Combs <gerald@wireshark.org>
16 * Copyright 1998 Gerald Combs
17 *
18 * SPDX-License-Identifier: GPL-2.0-or-later
19 */
20
21 #ifndef _OPENSAFETY_HEADER_
22 #define _OPENSAFETY_HEADER_
23
24 #include <config.h>
25
26 #include <epan/packet.h>
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif /* __cplusplus */
31
32 /* openSAFETY UDP Port */
33 #ifndef OPENSAFETY_UDP_PORT
34 #define OPENSAFETY_UDP_PORT 9877
35 #endif
36
37 /* SercosIII UDP Port */
38 #ifndef OPENSAFETY_UDP_PORT_SIII
39 #define OPENSAFETY_UDP_PORT_SIII 8755
40 #endif
41
42 #define OPENSAFETY_DEFAULT_DOMAIN 0x1
43
44 /* openSAFETY CRC types */
45 #define OPENSAFETY_CHECKSUM_CRC8 0x01
46 #define OPENSAFETY_CHECKSUM_CRC16 0x02
47 #define OPENSAFETY_CHECKSUM_CRC32 0x04
48 #define OPENSAFETY_CHECKSUM_CRC16SLIM 0x08
49 #define OPENSAFETY_CHECKSUM_INVALID 0xFF
50
51 static const value_string opensafety_frame_crc_type[] = {
52 { OPENSAFETY_CHECKSUM_CRC8, "CRC8" },
53 { OPENSAFETY_CHECKSUM_CRC16, "CRC16" },
54 { OPENSAFETY_CHECKSUM_CRC32, "CRC32" },
55 { OPENSAFETY_CHECKSUM_CRC16SLIM, "CRC16 Slim" },
56 { 0, NULL }
57 };
58
59 /* openSAFETY Message Types */
60 #define OPENSAFETY_SNMT_MESSAGE_TYPE 0xA0
61 #define OPENSAFETY_SPDO_MESSAGE_TYPE 0xC0
62 #define OPENSAFETY_SSDO_MESSAGE_TYPE 0xE0
63 #define OPENSAFETY_SLIM_SSDO_MESSAGE_TYPE 0xE8
64
65 /* We shift the values by 5, otherwise they won't get picked up by the
66 * hf_field value dissection */
67 static const value_string opensafety_msg_id_values[] = {
68 { OPENSAFETY_SNMT_MESSAGE_TYPE >> 5, "openSAFETY SNMT" },
69 { OPENSAFETY_SPDO_MESSAGE_TYPE >> 5, "openSAFETY SPDO" },
70 { OPENSAFETY_SSDO_MESSAGE_TYPE >> 5, "openSAFETY SSDO" },
71 { 0, NULL }
72 };
73
74 /* openSAFETY Message IDs */
75 #define OPENSAFETY_MSG_SPDO_DATA_ONLY 0xC0
76 #define OPENSAFETY_MSG_SPDO_DATA_WITH_TIME_REQUEST 0xC8
77 #define OPENSAFETY_MSG_SPDO_DATA_WITH_TIME_RESPONSE 0xD0
78 #define OPENSAFETY_MSG_SPDO_RESERVED 0xD8
79
80 #define OPENSAFETY_MSG_SSDO_SERVICE_REQUEST 0xE0
81 #define OPENSAFETY_MSG_SSDO_SERVICE_RESPONSE 0xE4
82 #define OPENSAFETY_MSG_SSDO_SLIM_SERVICE_REQUEST 0xE8
83 #define OPENSAFETY_MSG_SSDO_SLIM_SERVICE_RESPONSE 0xEC
84
85 #define OPENSAFETY_MSG_SNMT_REQUEST_UDID 0xA0
86 #define OPENSAFETY_MSG_SNMT_RESPONSE_UDID 0xA4
87 #define OPENSAFETY_MSG_SNMT_ASSIGN_SADR 0xA8
88 #define OPENSAFETY_MSG_SNMT_SADR_ASSIGNED 0xAC
89 #define OPENSAFETY_MSG_SNMT_SERVICE_REQUEST 0xB0
90 #define OPENSAFETY_MSG_SNMT_SERVICE_RESPONSE 0xB4
91 #define OPENSAFETY_MSG_SNMT_SN_RESET_GUARDING_SCM 0xBC
92
93 static const value_string opensafety_message_type_values[] = {
94 { OPENSAFETY_MSG_SPDO_DATA_ONLY, "SPDO Data only" },
95 { OPENSAFETY_MSG_SPDO_DATA_WITH_TIME_REQUEST, "SPDO Data with Time Request" },
96 { OPENSAFETY_MSG_SPDO_DATA_WITH_TIME_RESPONSE, "SPDO Data with Time Response" },
97 { OPENSAFETY_MSG_SPDO_RESERVED, "SPDO Reserved" },
98
99 { OPENSAFETY_MSG_SSDO_SERVICE_REQUEST, "SSDO Service Request" },
100 { OPENSAFETY_MSG_SSDO_SERVICE_RESPONSE, "SSDO Service Response" },
101 { OPENSAFETY_MSG_SSDO_SLIM_SERVICE_REQUEST, "SSDO Slim Service Request" },
102 { OPENSAFETY_MSG_SSDO_SLIM_SERVICE_RESPONSE, "SSDO Slim Service Response" },
103
104 { OPENSAFETY_MSG_SNMT_REQUEST_UDID, "SNMT Request UDID" },
105 { OPENSAFETY_MSG_SNMT_RESPONSE_UDID, "SNMT Response UDID" },
106 { OPENSAFETY_MSG_SNMT_ASSIGN_SADR, "SNMT Assign SADR" },
107 { OPENSAFETY_MSG_SNMT_SADR_ASSIGNED, "SNMT SADR Assigned" },
108 { OPENSAFETY_MSG_SNMT_SERVICE_REQUEST, "SNMT Service Request" },
109 { OPENSAFETY_MSG_SNMT_SERVICE_RESPONSE, "SNMT Service Response" },
110 { OPENSAFETY_MSG_SNMT_SN_RESET_GUARDING_SCM, "SNMT SN reset guarding SCM" },
111 {0, NULL }
112 };
113
114 /* SNTM extended Services */
115 #define OPENSAFETY_MSG_SNMT_EXT_SN_SET_TO_PRE_OP 0x00
116 #define OPENSAFETY_MSG_SNMT_EXT_SN_SET_TO_OP 0x02
117 #define OPENSAFETY_MSG_SNMT_EXT_SCM_SET_TO_STOP 0x04
118 #define OPENSAFETY_MSG_SNMT_EXT_SCM_SET_TO_OP 0x06
119 #define OPENSAFETY_MSG_SNMT_EXT_SCM_GUARD_SN 0x08
120 #define OPENSAFETY_MSG_SNMT_EXT_ASSIGN_ADDITIONAL_SADR 0x0A
121 #define OPENSAFETY_MSG_SNMT_EXT_SN_ACKNOWLEDGE 0x0C
122 #define OPENSAFETY_MSG_SNMT_EXT_SN_ASSIGN_UDID_SCM 0x0E
123 #define OPENSAFETY_MSG_SNMT_EXT_SN_STATUS_PRE_OP 0x01
124 #define OPENSAFETY_MSG_SNMT_EXT_SN_STATUS_OP 0x03
125 #define OPENSAFETY_MSG_SNMT_EXT_SN_ASSIGNED_ADDITIONAL_SADR 0x05
126 #define OPENSAFETY_MSG_SNMT_EXT_SN_FAIL 0x07
127 #define OPENSAFETY_MSG_SNMT_EXT_SN_BUSY 0x09
128 #define OPENSAFETY_MSG_SNMT_EXT_SN_ASSIGNED_UDID_SCM 0x0F
129 #define OPENSAFETY_MSG_SNMT_EXT_ASSIGN_INIT_CT 0x10
130 #define OPENSAFETY_MSG_SNMT_EXT_ASSIGNED_INIT_CT 0x11
131
132 static const value_string opensafety_message_service_type[] = {
133 { OPENSAFETY_MSG_SNMT_EXT_SN_SET_TO_PRE_OP, "SN set to pre Operational" },
134 { OPENSAFETY_MSG_SNMT_EXT_SN_SET_TO_OP, "SN set to Operational" },
135 { OPENSAFETY_MSG_SNMT_EXT_SCM_SET_TO_STOP, "SCM set to Stop" },
136 { OPENSAFETY_MSG_SNMT_EXT_SCM_SET_TO_OP, "SCM set to Operational" },
137 { OPENSAFETY_MSG_SNMT_EXT_SCM_GUARD_SN, "SCM guard SN" },
138 { OPENSAFETY_MSG_SNMT_EXT_ASSIGN_ADDITIONAL_SADR, "Assign additional SADR" },
139 { OPENSAFETY_MSG_SNMT_EXT_SN_ACKNOWLEDGE, "SN Acknowledge" },
140 { OPENSAFETY_MSG_SNMT_EXT_SN_ASSIGN_UDID_SCM, "SN assign UDID SCM" },
141 { OPENSAFETY_MSG_SNMT_EXT_SN_STATUS_PRE_OP, "SN status pre Operational" },
142 { OPENSAFETY_MSG_SNMT_EXT_SN_STATUS_OP, "SN status Operational" },
143 { OPENSAFETY_MSG_SNMT_EXT_SN_ASSIGNED_ADDITIONAL_SADR, "Assigned additional SADR" },
144 { OPENSAFETY_MSG_SNMT_EXT_SN_FAIL, "SN Fail" },
145 { OPENSAFETY_MSG_SNMT_EXT_SN_BUSY, "SN Busy" },
146 { OPENSAFETY_MSG_SNMT_EXT_SN_ASSIGNED_UDID_SCM, "SN assigned UDID SCM" },
147 { OPENSAFETY_MSG_SNMT_EXT_ASSIGN_INIT_CT, "Assign initial CT for SN" },
148 { OPENSAFETY_MSG_SNMT_EXT_ASSIGNED_INIT_CT, "Acknowledge initial CT for SN" },
149 { 0, NULL }
150 };
151
152 /* Values 6-255 are reserved for future use. They will be presented as "Reserved [%d]"
153 * during dissection
154 */
155 #define OPENSAFETY_ERROR_GROUP_APPLICATION 0x01
156 #define OPENSAFETY_ERROR_GROUP_PARAMETER 0x02
157 #define OPENSAFETY_ERROR_GROUP_VENDOR_SPECIFIC 0x03
158 #define OPENSAFETY_ERROR_GROUP_OPENSAFETY_STACK 0x04
159 #define OPENSAFETY_ERROR_GROUP_ADD_PARAMETER 0x05
160
161 static const value_string opensafety_sn_fail_error_group[] = {
162 { OPENSAFETY_ERROR_GROUP_APPLICATION, "Application" },
163 { OPENSAFETY_ERROR_GROUP_PARAMETER, "Parameter" },
164 { OPENSAFETY_ERROR_GROUP_VENDOR_SPECIFIC, "Vendor specific" },
165 { OPENSAFETY_ERROR_GROUP_OPENSAFETY_STACK, "openSAFETY Stack" },
166 { OPENSAFETY_ERROR_GROUP_ADD_PARAMETER, "Additional parameter needed" },
167 { 0, NULL }
168 };
169
170 /* SSDO Access Command */
171
172 #define OPENSAFETY_SSDO_SACMD_ACC 0x01
173 #define OPENSAFETY_SSDO_SACMD_PRLD 0x02
174 #define OPENSAFETY_SSDO_SACMD_ABRT 0x04
175 #define OPENSAFETY_SSDO_SACMD_SEG 0x08
176 #define OPENSAFETY_SSDO_SACMD_TGL 0x10
177 #define OPENSAFETY_SSDO_SACMD_INI 0x20
178 #define OPENSAFETY_SSDO_SACMD_ENSG 0x40
179 #define OPENSAFETY_SSDO_SACMD_RES 0x80
180
181 #define OPENSAFETY_SSDO_UPLOAD 0x00
182 #define OPENSAFETY_SSDO_DOWNLOAD 0x01
183
184 #define OPENSAFETY_MSG_SSDO_ABORT ( OPENSAFETY_SSDO_SACMD_ABRT )
185 #define OPENSAFETY_MSG_SSDO_UPLOAD_SEGMENT_MIDDLE ( OPENSAFETY_SSDO_SACMD_SEG | OPENSAFETY_SSDO_UPLOAD )
186 #define OPENSAFETY_MSG_SSDO_DOWNLOAD_SEGMENT_MIDDLE ( OPENSAFETY_SSDO_SACMD_SEG | OPENSAFETY_SSDO_DOWNLOAD )
187 #define OPENSAFETY_MSG_SSDO_UPLOAD_SEGMENT_MID_PRELOAD ( OPENSAFETY_MSG_SSDO_UPLOAD_SEGMENT_MIDDLE | OPENSAFETY_SSDO_SACMD_PRLD )
188 #define OPENSAFETY_MSG_SSDO_DOWNLOAD_SEGMENT_MID_PRELOAD ( OPENSAFETY_MSG_SSDO_DOWNLOAD_SEGMENT_MIDDLE | OPENSAFETY_SSDO_SACMD_PRLD )
189 #define OPENSAFETY_MSG_SSDO_UPLOAD_INITIATE_EXPEDITED ( OPENSAFETY_SSDO_SACMD_INI | OPENSAFETY_SSDO_UPLOAD )
190 #define OPENSAFETY_MSG_SSDO_DOWNLOAD_INITIATE_EXPEDITED ( OPENSAFETY_SSDO_SACMD_INI | OPENSAFETY_SSDO_DOWNLOAD )
191 #define OPENSAFETY_MSG_SSDO_UPLOAD_INITIATE_EXP_PRELOAD ( OPENSAFETY_MSG_SSDO_UPLOAD_INITIATE_EXPEDITED | OPENSAFETY_SSDO_SACMD_PRLD )
192 #define OPENSAFETY_MSG_SSDO_DOWNLOAD_INITIATE_EXP_PRELOAD ( OPENSAFETY_MSG_SSDO_DOWNLOAD_INITIATE_EXPEDITED | OPENSAFETY_SSDO_SACMD_PRLD )
193 #define OPENSAFETY_MSG_SSDO_UPLOAD_INITIATE_SEGMENTED ( OPENSAFETY_SSDO_SACMD_INI | OPENSAFETY_SSDO_SACMD_SEG | OPENSAFETY_SSDO_UPLOAD )
194 #define OPENSAFETY_MSG_SSDO_DOWNLOAD_INITIATE_SEGMENTED ( OPENSAFETY_SSDO_SACMD_INI | OPENSAFETY_SSDO_SACMD_SEG | OPENSAFETY_SSDO_DOWNLOAD )
195 #define OPENSAFETY_MSG_SSDO_UPLOAD_INITIATE_SEG_PRELOAD ( OPENSAFETY_MSG_SSDO_UPLOAD_INITIATE_SEGMENTED | OPENSAFETY_SSDO_SACMD_PRLD )
196 #define OPENSAFETY_MSG_SSDO_DOWNLOAD_INITIATE_SEG_PRELOAD ( OPENSAFETY_MSG_SSDO_DOWNLOAD_INITIATE_SEGMENTED | OPENSAFETY_SSDO_SACMD_PRLD )
197 #define OPENSAFETY_MSG_SSDO_UPLOAD_SEGMENT_END ( OPENSAFETY_SSDO_SACMD_ENSG | OPENSAFETY_SSDO_SACMD_SEG | OPENSAFETY_SSDO_UPLOAD )
198 #define OPENSAFETY_MSG_SSDO_DOWNLOAD_SEGMENT_END ( OPENSAFETY_SSDO_SACMD_ENSG | OPENSAFETY_SSDO_SACMD_SEG | OPENSAFETY_SSDO_DOWNLOAD )
199
200 static const value_string opensafety_ssdo_sacmd_values[] = {
201 { OPENSAFETY_MSG_SSDO_DOWNLOAD_SEGMENT_END, "Download End Segment" },
202 { OPENSAFETY_MSG_SSDO_UPLOAD_SEGMENT_END, "Upload End Segment" },
203 { OPENSAFETY_MSG_SSDO_DOWNLOAD_INITIATE_EXPEDITED, "Download Expedited Initiate" },
204 { OPENSAFETY_MSG_SSDO_UPLOAD_INITIATE_SEGMENTED, "Upload Initiate Segmented" },
205 { OPENSAFETY_MSG_SSDO_DOWNLOAD_INITIATE_SEGMENTED, "Download Initiate Segmented" },
206 { OPENSAFETY_MSG_SSDO_UPLOAD_INITIATE_EXPEDITED, "Upload Expedited Initiate" },
207 { OPENSAFETY_MSG_SSDO_UPLOAD_INITIATE_EXP_PRELOAD, "Upload Expedited Initiate w.Preload" },
208 { OPENSAFETY_MSG_SSDO_DOWNLOAD_INITIATE_EXP_PRELOAD, "Download Initiate Segmented w.Preload" },
209 { OPENSAFETY_MSG_SSDO_UPLOAD_INITIATE_SEG_PRELOAD, "Upload Initiate Segmented w. Preload" },
210 { OPENSAFETY_MSG_SSDO_DOWNLOAD_INITIATE_SEG_PRELOAD, "Download Expedited Initiate w.Preload" },
211 { OPENSAFETY_MSG_SSDO_DOWNLOAD_SEGMENT_MIDDLE, "Download Middle Segment" },
212 { OPENSAFETY_MSG_SSDO_UPLOAD_SEGMENT_MIDDLE, "Upload Middle Segment" },
213 { OPENSAFETY_MSG_SSDO_DOWNLOAD_SEGMENT_MID_PRELOAD, "Download Middle Segment w. Preload" },
214 { OPENSAFETY_MSG_SSDO_UPLOAD_SEGMENT_MID_PRELOAD, "Upload Middle Segment w. Preload" },
215 { OPENSAFETY_MSG_SSDO_ABORT, "Abort" },
216 { 0, NULL }
217 };
218
219 static const true_false_string opensafety_sacmd_acc = { "Download", "Upload" };
220 static const true_false_string opensafety_sacmd_abrt = { "Abort Transfer", "Successful Transfer" };
221 static const true_false_string opensafety_sacmd_seg = { "Segmented Access", "Expedited Access" };
222 static const true_false_string opensafety_sacmd_ini = { "Initiate", "No Initiate" };
223 static const true_false_string opensafety_sacmd_ensg = { "No more segments", "More segments" };
224
225 static const value_string opensafety_sod_idx_names[] = {
226 /* SSDO dictionary names, only names that are in common use are presented */
227 { 0x100C0000, "Life Guarding" },
228 { 0x100C0001, "Guard Time" },
229 { 0x100C0002, "LifeTimeFactor" },
230
231 { 0x100D0000, "Number of Retries for Reset Guarding" },
232
233 { 0x10180000, "Device Vendor Information" },
234 { 0x10180001, "VendorID" },
235 { 0x10180002, "ProductCode" },
236 { 0x10180003, "RevisionNumber" },
237 { 0x10180004, "SerialNumber" },
238 { 0x10180005, "FirmWareChecksum" },
239 { 0x10180006, "Parameter Checksum" },
240 { 0x10180007, "Parameter Timestamp" },
241
242 { 0x10190000, "Unique Device ID" },
243 { 0x101A0000, "Parameter Download" },
244 { 0x101B0000, "SCM Parameters" },
245
246 { 0x12000000, "Common Communication Parameters" },
247 { 0x12000001, "Safety Domain Number" },
248 { 0x12000002, "SADR" },
249 { 0x12000003, "Consecutive Timebase" },
250 { 0x12000004, "UDID of SCM" },
251
252 { 0x14000000, "RxSPDO Communication Parameters" },
253 { 0x14000001, "SADR" },
254 { 0x14000002, "SCT" },
255 { 0x14000003, "Number of consecutive TReq" },
256 { 0x14000004, "Time delay TReq" },
257 { 0x14000005, "Time delay Sync" },
258 { 0x14000006, "Min TSync Propagation Delay" },
259 { 0x14000007, "Max TSync Propagation Delay" },
260 { 0x14000008, "Min SPDO Propagation Delay" },
261 { 0x14000009, "Max SPDO Propagation Delay" },
262 { 0x1400000A, "Best case TRes Delay" },
263 { 0x1400000B, "Time Request Cycle" },
264 { 0x1400000C, "TxSPDO No" },
265
266 { 0x18000000, "RxSPDO Mapping Parameters" },
267
268 { 0x1C000000, "TxSPDO Communication Parameters" },
269 { 0x1C000001, "SADR for broadcast" },
270 { 0x1C000002, "Refresh Prescale" },
271 { 0x1C000003, "Number of TRes" },
272
273 { 0x20000000, "Manufacturer Parameters" },
274 { 0x20010000, "Used Channels" },
275
276 { 0x21000000, "Safe Machine Options" },
277
278 { 0x21010000, "SDG CRC Configuration" },
279 { 0x21010001, "SDG CRC #1" },
280 { 0x21010002, "SDG CRC #2" },
281 { 0x21010003, "SDG CRC #3" },
282 { 0x21010004, "SDG CRC #4" },
283 { 0x21010005, "SDG CRC #5" },
284 { 0x21010006, "SDG CRC #6" },
285 { 0x21010007, "SDG CRC #7" },
286 { 0x21010008, "SDG CRC #8" },
287 { 0x21010009, "SDG CRC #9" },
288 { 0x2101000A, "SDG CRC #10" },
289
290 { 0x21120000, "Manufacturer - Module specific" },
291 { 0x21120002, "PDOmapRx" },
292 { 0x21120003, "PDOmapTx" },
293 { 0x21120004, "CycleTime min [us]" },
294 { 0x21120005, "CycleTime max [us]" },
295 { 0x21120006, "Used Channels (same as 0x2001)" },
296 { 0x21120007, "External Machine Options" },
297 { 0x21120008, "Parameter for SafeMC" },
298
299 { 0xC0000000, "TxSPDO Mapping Parameters" },
300
301 { 0xD0000000, "SCM Module Flags" },
302 { 0xD0000001, "BCM" },
303 { 0xD0000002, "Optional" },
304 { 0xD0000003, "Startup" },
305 { 0xD0000004, "EMOs" },
306 { 0xD0000005, "ext. Startup-Flags allowed" },
307 { 0xD0000006, "Remote-Ctrl allowed" },
308 { 0xD0000007, "Scans at startup" },
309 { 0xD0000008, "Not Present" },
310 { 0xD0000009, "Use Remanent Data" },
311 { 0xD000000A, "SCM-AR specific" },
312
313 { 0xD0100000, "Remanent Data" },
314 { 0xD0100001, "DINT" },
315
316 { 0xD0110000, "Remanent Data" },
317 { 0xD0110001, "DUINT" },
318
319 { 0, NULL }
320 };
321 static value_string_ext opensafety_sod_idx_names_ext = VALUE_STRING_EXT_INIT(opensafety_sod_idx_names);
322
323 static const value_string opensafety_abort_codes[] = {
324
325 /* SSDO abort codes */
326 { 0x05030000, "Reserved" },
327
328 { 0x05040000, "SSDO protocol timed out" },
329 { 0x05040001, "Client/server Command ID not valid or unknown" },
330 { 0x05040002, "Invalid block size" },
331 { 0x05040003, "Invalid sequence number" },
332 { 0x05040004, "Reserved" },
333 { 0x05040005, "Out of memory" },
334
335 { 0x06010000, "Unsupported access to an object" },
336 { 0x06010001, "Attempt to read a write-only object" },
337 { 0x06010002, "Attempt to write a read-only object" },
338
339 { 0x06020000, "Object does not exist in the object dictionary" },
340
341 { 0x06040041, "Object cannot be mapped to the SPDO" },
342 { 0x06040042, "The number and length of the objects to be mapped would exceed SPDO length" },
343 { 0x06040043, "General parameter incompatibility" },
344 { 0x06040047, "General internal incompatibility in the device" },
345
346 { 0x06060000, "Access failed due to a hardware error" },
347
348 { 0x06070010, "Data type does not match, length of service parameter does not match" },
349 { 0x06070012, "Data type does not match, length of service parameter too high" },
350 { 0x06070013, "Data type does not match, length of service parameter too low" },
351
352 { 0x06090011, "Sub-index does not exist" },
353 { 0x06090030, "Value range o parameter exceeded (only for write access)" },
354 { 0x06090031, "Value of parameter written too high" },
355 { 0x06090032, "Value of parameter written too low" },
356 { 0x06090036, "Maximum value is less than minimum value" },
357
358 { 0x08000000, "General error" },
359 { 0x08000020, "Data cannot be transferred or stored to the application" },
360 { 0x08000021, "Data cannot be transferred or stored to the application because of local control" },
361 { 0x08000022, "Data cannot be transferred or stored to the application because of the present device state" },
362 { 0x08000023, "Data cannot be transferred or stored to the application because of the object data is not available now" },
363
364 { 0, NULL }
365 };
366 static value_string_ext opensafety_abort_codes_ext = VALUE_STRING_EXT_INIT(opensafety_abort_codes);
367
368 static const true_false_string opensafety_message_direction = { "Response", "Request" };
369 static const true_false_string opensafety_spdo_direction = { "Producer", "Consumer" };
370 static const true_false_string opensafety_addparam_request = { "Header only", "Header & Data" };
371
372 typedef struct _opensafety_packet_spdo
373 {
374 guint16 timerequest;
375
376 gboolean conn_valid;
377
378 gboolean counter_40bit;
379
380 union {
381 guint16 b16;
382 guint64 b40;
383 } counter;
384
385 struct {
386 gboolean enabled40bit;
387 gboolean requested40bit;
388 } flags;
389
390 } opensafety_packet_spdo;
391
392 typedef struct _opensafety_packet_ssdo
393 {
394 gboolean is_slim;
395
396 struct {
397 gboolean end_segment;
398 gboolean initiate;
399 gboolean toggle;
400 gboolean segmented;
401 gboolean abort_transfer;
402 gboolean preload;
403 gboolean read_access;
404 } sacmd;
405 } opensafety_packet_ssdo;
406
407 typedef struct _opensafety_packet_snmt
408 {
409 guint8 ext_msg_id;
410
411 struct {
412 gboolean exists;
413 guint8 id;
414 guint8 set;
415 gboolean full;
416 } add_param;
417
418 struct {
419 guint16 actual;
420 guint16 additional;
421 } add_saddr;
422
423 guint64 init_ct;
424
425 gchar * scm_udid;
426 gchar * sn_udid;
427
428 guint8 error_code;
429 } opensafety_packet_snmt;
430
431 typedef struct _opensafety_packet_frame
432 {
433 gboolean malformed;
434
435 guint16 subframe1;
436 guint16 subframe2;
437
438 guint length;
439
440 guint16 byte_offset;
441
442 tvbuff_t *frame_tvb;
443
444 } opensafety_packet_frame;
445
446 typedef struct _opensafety_packet_crc
447 {
448 guint8 type;
449
450 guint16 frame1;
451 guint16 frame2;
452
453 gboolean valid1;
454 gboolean valid2;
455 } opensafety_packet_crc;
456
457 typedef struct _opensafety_packet_info
458 {
459 opensafety_packet_frame frame;
460
461 guint16 saddr;
462 guint16 sdn;
463
464 guint16 sender;
465 guint16 receiver;
466
467 gboolean is_request;
468
469 guint8 msg_id;
470 guint8 msg_type;
471 guint8 msg_len;
472 guint frame_len;
473
474 guint8 scm_udid[6];
475 gboolean scm_udid_valid;
476
477 opensafety_packet_crc crc;
478
479 union {
480 opensafety_packet_snmt *snmt;
481 opensafety_packet_ssdo *ssdo;
482 opensafety_packet_spdo *spdo;
483 } payload;
484
485 } opensafety_packet_info;
486
487 #ifdef __cplusplus
488 }
489 #endif /* __cplusplus */
490
491 #endif /* _OPENSAFETY_HEADER_ */
492
493 /*
494 * Editor modelines - http://www.wireshark.org/tools/modelines.html
495 *
496 * Local variables:
497 * c-basic-offset: 4
498 * tab-width: 8
499 * indent-tabs-mode: nil
500 * End:
501 *
502 * vi: set shiftwidth=4 tabstop=8 expandtab:
503 * :indentSize=4:tabSize=8:noTabs=true:
504 */
true_false_string
Definition: tfs.h:26
_opensafety_packet_info
Definition: packet-opensafety.h:457
tvbuff
Definition: tvbuff-int.h:35
_opensafety_packet_info::msg_id
guint8 msg_id
Definition: packet-opensafety.h:469
_opensafety_packet_spdo
Definition: packet-opensafety.h:372
_opensafety_packet_ssdo
Definition: packet-opensafety.h:392
_opensafety_packet_crc
Definition: packet-opensafety.h:446
_opensafety_packet_snmt
Definition: packet-opensafety.h:407
_opensafety_packet_info::msg_type
guint8 msg_type
Definition: packet-opensafety.h:470
_opensafety_packet_frame
Definition: packet-opensafety.h:431
_value_string
Definition: value_string.h:24
_value_string_ext
Definition: value_string.h:164