### Bug Summary

File: | builds/wireshark/wireshark/plugins/epan/ethercat/packet-ecatmb.c
Warning: | line 346, column 51 Value stored to 'offset' is never read

### Annotated Source Code

Press '?' to see keyboard shortcuts

Show analyzer invocation
clang -cc1 -cc1 -triple x86_64-pc-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name packet-ecatmb.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -fno-delete-null-pointer-checks -mframe-pointer=all -relaxed-aliasing -fmath-errno -ffp-contract=on -fno-rounding-math -ffloat16-excess-precision=fast -fbfloat16-excess-precision=fast -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/builds/wireshark/wireshark/build -fcoverage-compilation-dir=/builds/wireshark/wireshark/build -resource-dir /usr/lib/llvm-21/lib/clang/21 -isystem /usr/include/glib-2.0 -isystem /usr/lib/x86_64-linux-gnu/glib-2.0/include -D G_DISABLE_DEPRECATED -D G_DISABLE_SINGLE_INCLUDES -D PLUGIN_VERSION="0.1.0" -D WS_DEBUG -D WS_DEBUG_UTF_8 -D ethercat_EXPORTS -I /builds/wireshark/wireshark/build -I /builds/wireshark/wireshark -I /builds/wireshark/wireshark/include -I /builds/wireshark/wireshark/plugins/epan/ethercat -D _GLIBCXX_ASSERTIONS -internal-isystem /usr/lib/llvm-21/lib/clang/21/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/14/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fmacro-prefix-map=/builds/wireshark/wireshark/= -fmacro-prefix-map=/builds/wireshark/wireshark/build/= -fmacro-prefix-map=../= -Wno-format-nonliteral -std=gnu11 -ferror-limit 19 -fvisibility=hidden -fwrapv -fwrapv-pointer -fstrict-flex-arrays=3 -stack-protector 2 -fstack-clash-protection -fcf-protection=full -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fexceptions -fcolor-diagnostics -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /builds/wireshark/wireshark/sbout/2026-03-28-100342-3641-1 -x c /builds/wireshark/wireshark/plugins/epan/ethercat/packet-ecatmb.c

Keyboard shortcuts:

- Use 'j/k' keys for keyboard navigation
- Use 'Shift+S' to show/hide relevant lines
- Use '?' to toggle this window

Close
Show only relevant lines Show control flow arrows

1 | /* packet-ecatmb.c
2 | * Routines for EtherCAT packet disassembly
3 | *
4 | * Copyright (c) 2007 by Beckhoff Automation GmbH
5 | *
6 | * Wireshark - Network traffic analyzer
7 | * By Gerald Combs <gerald@wireshark.org>
8 | * Copyright 1998 Gerald Combs
9 | *
10 | * SPDX-License-Identifier: GPL-2.0-or-later
11 | */
12 |
13 | /* Include files */
14 |
15 | #include "config.h"
16 |
17 | #include <epan/packet.h>
18 | #include <epan/expert.h>
19 | #include <epan/tfs.h>
20 | #include <wsutil/array.h>
21 |
22 | #include "packet-ecatmb.h"
23 |
24 | #define BIT2BYTE(x)((x+7)/8) ((x+7)/8)
25 |
26 | void proto_register_ecat_mailbox(void);
27 | void proto_reg_handoff_ecat_mailbox(void);
28 |
29 | static dissector_handle_t eth_handle;
30 | static dissector_handle_t ams_handle;
31 | static dissector_handle_t ecat_mailbox_handle;
32 |
33 | /* Define the EtherCAT mailbox proto */
34 | int proto_ecat_mailbox;
35 |
36 | static int ett_ecat_mailbox;
37 | static int ett_ecat_mailbox_eoe;
38 | static int ett_ecat_mailbox_eoe_init;
39 | static int ett_ecat_mailbox_eoe_macfilter;
40 | static int ett_ecat_mailbox_eoe_macfilter_filter;
41 | static int ett_ecat_mailbox_eoe_macfilter_filtermask;
42 | static int ett_ecat_mailbox_coe;
43 | static int ett_ecat_mailbox_sdo;
44 | static int ett_ecat_mailbox_coe_sdoccs;
45 | static int ett_ecat_mailbox_coe_sdoscs;
46 | static int ett_ecat_mailbox_foe;
47 | static int ett_ecat_mailbox_foe_efw;
48 | static int ett_ecat_mailbox_soeflag;
49 | static int ett_ecat_mailbox_soe;
50 | static int ett_ecat_mailbox_fraghead;
51 | static int ett_ecat_mailbox_header;
52 | static int ett_ecat_mailbox_voe;
53 |
54 | static int hf_ecat_mailboxlength;
55 | static int hf_ecat_mailboxaddress;
56 | static int hf_ecat_mailboxpriority;
57 | static int hf_ecat_mailboxtype;
58 | static int hf_ecat_mailboxcounter;
59 | static int hf_ecat_mailbox_eoe;
60 | static int hf_ecat_mailbox_eoe_fraghead;
61 | static int hf_ecat_mailbox_eoe_type;
62 | static int hf_ecat_mailbox_eoe_fragno;
63 | static int hf_ecat_mailbox_eoe_offset;
64 | static int hf_ecat_mailbox_eoe_frame;
65 | static int hf_ecat_mailbox_eoe_last;
66 | static int hf_ecat_mailbox_eoe_timestampreq;
67 | static int hf_ecat_mailbox_eoe_timestampapp;
68 | static int hf_ecat_mailbox_eoe_fragment;
69 | static int hf_ecat_mailbox_eoe_init;
70 | static int hf_ecat_mailbox_eoe_init_contains_macaddr;
71 | static int hf_ecat_mailbox_eoe_init_contains_ipaddr;
72 | static int hf_ecat_mailbox_eoe_init_contains_subnetmask;
73 | static int hf_ecat_mailbox_eoe_init_contains_defaultgateway;
74 | static int hf_ecat_mailbox_eoe_init_contains_dnsserver;
75 | static int hf_ecat_mailbox_eoe_init_contains_dnsname;
76 | static int hf_ecat_mailbox_eoe_init_append_timestamp;
77 | static int hf_ecat_mailbox_eoe_init_macaddr;
78 | static int hf_ecat_mailbox_eoe_init_ipaddr;
79 | static int hf_ecat_mailbox_eoe_init_subnetmask;
80 | static int hf_ecat_mailbox_eoe_init_defaultgateway;
81 | static int hf_ecat_mailbox_eoe_init_dnsserver;
82 | static int hf_ecat_mailbox_eoe_init_dnsname;
83 | static int hf_ecat_mailbox_eoe_macfilter;
84 | static int hf_ecat_mailbox_eoe_macfilter_macfiltercount;
85 | static int hf_ecat_mailbox_eoe_macfilter_maskcount;
86 | static int hf_ecat_mailbox_eoe_macfilter_nobroadcasts;
87 | static int hf_ecat_mailbox_eoe_macfilter_filter;
88 | static int hf_ecat_mailbox_eoe_macfilter_filters[16];
89 | static int hf_ecat_mailbox_eoe_macfilter_filtermask;
90 | static int hf_ecat_mailbox_eoe_macfilter_filtermasks[4];
91 | static int hf_ecat_mailbox_eoe_timestamp;
92 | static int hf_ecat_mailbox_coe;
93 | static int hf_ecat_mailbox_coe_number;
94 | static int hf_ecat_mailbox_coe_type;
95 | static int hf_ecat_mailbox_coe_sdoreq;
96 | static int hf_ecat_mailbox_coe_sdoccsid;
97 | static int hf_ecat_mailbox_coe_sdoccsid_sizeind;
98 | static int hf_ecat_mailbox_coe_sdoccsid_expedited;
99 | static int hf_ecat_mailbox_coe_sdoccsid_size0;
100 | static int hf_ecat_mailbox_coe_sdoccsid_size1;
101 | static int hf_ecat_mailbox_coe_sdoccsid_complete;
102 | static int hf_ecat_mailbox_coe_sdoccsds;
103 | static int hf_ecat_mailbox_coe_sdoccsds_lastseg;
104 | static int hf_ecat_mailbox_coe_sdoccsds_size;
105 | static int hf_ecat_mailbox_coe_sdoccsds_toggle;
106 | static int hf_ecat_mailbox_coe_sdoccsus;
107 | static int hf_ecat_mailbox_coe_sdoccsus_toggle;
108 | static int hf_ecat_mailbox_coe_sdoccsiu;
109 | /* static int hf_ecat_mailbox_coe_sdoccsiu_complete; */
110 | static int hf_ecat_mailbox_coe_sdoidx;
111 | static int hf_ecat_mailbox_coe_sdoabortcode;
112 | static int hf_ecat_mailbox_coe_sdosub;
113 | static int hf_ecat_mailbox_coe_sdodata;
114 | static int hf_ecat_mailbox_coe_sdodata1;
115 | static int hf_ecat_mailbox_coe_sdodata2;
116 | static int hf_ecat_mailbox_coe_sdoldata;
117 | static int hf_ecat_mailbox_coe_sdolength;
118 | /* static int hf_ecat_mailbox_coe_sdoerror; */
119 | static int hf_ecat_mailbox_coe_sdores;
120 | static int hf_ecat_mailbox_coe_sdoscsds;
121 | static int hf_ecat_mailbox_coe_sdoscsds_toggle;
122 | static int hf_ecat_mailbox_coe_sdoscsiu;
123 | static int hf_ecat_mailbox_coe_sdoscsiu_sizeind;
124 | static int hf_ecat_mailbox_coe_sdoscsiu_expedited;
125 | static int hf_ecat_mailbox_coe_sdoscsiu_size0;
126 | static int hf_ecat_mailbox_coe_sdoscsiu_size1;
127 | static int hf_ecat_mailbox_coe_sdoscsiu_complete;
128 | static int hf_ecat_mailbox_coe_sdoscsus;
129 | static int hf_ecat_mailbox_coe_sdoscsus_lastseg;
130 | static int hf_ecat_mailbox_coe_sdoscsus_bytes;
131 | static int hf_ecat_mailbox_coe_sdoscsus_toggle;
132 | static int hf_ecat_mailbox_coe_sdoinfoopcode;
133 | static int hf_ecat_mailbox_coe_sdoinfofrag;
134 | static int hf_ecat_mailbox_coe_sdoinfolisttype;
135 | static int hf_ecat_mailbox_coe_sdoinfolist;
136 | static int hf_ecat_mailbox_coe_sdoinfoindex;
137 | static int hf_ecat_mailbox_coe_sdoinfosubindex;
138 | static int hf_ecat_mailbox_coe_sdoinfovalueinfo;
139 | static int hf_ecat_mailbox_coe_sdoinfoerrorcode;
140 | static int hf_ecat_mailbox_coe_sdoinfodatatype;
141 | static int hf_ecat_mailbox_coe_sdoinfomaxsub;
142 | static int hf_ecat_mailbox_coe_sdoinfoobjcode;
143 | static int hf_ecat_mailbox_coe_sdoinfoname;
144 | static int hf_ecat_mailbox_coe_sdoinfobitlen;
145 | static int hf_ecat_mailbox_coe_sdoinfoobjaccess;
146 | static int hf_ecat_mailbox_coe_sdoinfounittype;
147 | static int hf_ecat_mailbox_coe_sdoinfodefaultvalue;
148 | static int hf_ecat_mailbox_coe_sdoinfominvalue;
149 | static int hf_ecat_mailbox_coe_sdoinfomaxvalue;
150 | static int hf_ecat_mailboxdata;
151 | static int hf_ecat_mailbox_foe;
152 | static int hf_ecat_mailbox_foe_opmode;
153 | static int hf_ecat_mailbox_foe_filelength;
154 | static int hf_ecat_mailbox_foe_filename;
155 | static int hf_ecat_mailbox_foe_packetno;
156 | static int hf_ecat_mailbox_foe_errcode;
157 | static int hf_ecat_mailbox_foe_errtext;
158 | static int hf_ecat_mailbox_foe_busydone;
159 | static int hf_ecat_mailbox_foe_busyentire;
160 | static int hf_ecat_mailbox_foe_data;
161 | static int hf_ecat_mailbox_foe_efw;
162 | static int hf_ecat_mailbox_foe_efw_cmd;
163 | static int hf_ecat_mailbox_foe_efw_size;
164 | static int hf_ecat_mailbox_foe_efw_addresslw;
165 | static int hf_ecat_mailbox_foe_efw_addresshw;
166 | static int hf_ecat_mailbox_foe_efw_data;
167 | static int hf_ecat_mailbox_soe;
168 | static int hf_ecat_mailbox_soe_header;
169 |
170 | static int hf_ecat_mailbox_soe_header_opcode;
171 | static int hf_ecat_mailbox_soe_header_incomplete;
172 | static int hf_ecat_mailbox_soe_header_error;
173 | static int hf_ecat_mailbox_soe_header_driveno;
174 | static int hf_ecat_mailbox_soe_header_datastate;
175 | static int hf_ecat_mailbox_soe_header_name;
176 | static int hf_ecat_mailbox_soe_header_attribute;
177 | static int hf_ecat_mailbox_soe_header_unit;
178 | static int hf_ecat_mailbox_soe_header_min;
179 | static int hf_ecat_mailbox_soe_header_max;
180 | static int hf_ecat_mailbox_soe_header_value;
181 | static int hf_ecat_mailbox_soe_header_reserved;
182 | static int hf_ecat_mailbox_soe_idn;
183 | static int hf_ecat_mailbox_soe_data;
184 | static int hf_ecat_mailbox_soe_frag;
185 | static int hf_ecat_mailbox_soe_error;
186 |
187 | static int hf_ecat_mailbox_voe;
188 | static int hf_ecat_mailbox_voe_vendor_id;
189 | static int hf_ecat_mailbox_voe_vendor_type;
190 | static int hf_ecat_mailbox_voe_data;
191 |
192 | static expert_field ei_ecat_mailbox_error;
193 | static expert_field ei_ecat_mailbox_coe_error;
194 | static expert_field ei_ecat_mailbox_eoe_error;
195 | static expert_field ei_ecat_mailbox_soe_error;
196 | static expert_field ei_ecat_mailbox_foe_error;
197 | static expert_field ei_ecat_mailbox_voe_error;
198 |
199 |
200 | static const value_string EcMBoxType[] =
201 | {
202 | { 0, "Invalid", },
203 | { 1, "AoE (Vendor specific; Beckhoff ADS over EtherCAT)", },
204 | { 2, "EoE (Ethernet over EtherCAT)", },
205 | { 3, "CoE (CANopen over EtherCAT)", },
206 | { 4, "FoE (File access over EtherCAT)", },
207 | { 5, "SoE (Servo profile over EtherCAT)", },
208 | { 15, "VoE (Vendor specific over EtherCAT)"},
209 | { 0x80+1, "AoE - Err", },
210 | { 0x80+2, "EoE - Err", },
211 | { 0x80+3, "CoE - Err", },
212 | { 0x80+4, "FoE - Err", },
213 | { 0x80+5, "SoE - Err", },
214 | { 0, NULL((void*)0) }
215 | };
216 |
217 | static const value_string FoEOpMode[] =
218 | {
219 | { 1, "RRQ", },
220 | { 2, "WRQ", },
221 | { 3, "DATA", },
222 | { 4, "ACK", },
223 | { 5, "ERROR", },
224 | { 6, "BUSY", },
225 | { 0, NULL((void*)0) }
226 | };
227 |
228 | static const value_string FoEEfwCmd[] =
229 | {
230 | { 1, "Memory Transfer", },
231 | { 2, "Write Code", },
232 | { 3, "Check device id", },
233 | { 4, "Checksum", },
234 | { 5, "Write code checksum", },
235 | { 6, "Set device id", },
236 | { 8, "Set code id", },
237 | { 9, "NOP", },
238 | { 10, "Checksum checksum", },
239 | { 11, "boot checksum", },
240 | { 0, NULL((void*)0) }
241 | };
242 |
243 | static const value_string SoeOpcode[] =
244 | {
245 | { 0, "unused" },
246 | { 1, "readReq" },
247 | { 2, "readRes"},
248 | { 3, "writeReq"},
249 | { 4, "writeRes" },
250 | { 5, "notification" },
251 | { 6, "emergency"},
252 | { 0, NULL((void*)0) }
253 | };
254 |
255 | static const value_string EoEType[] =
256 | {
257 | { EOE_TYPE_FRAME_FRAG0, "Fragment" },
258 | { EOE_TYPE_TIMESTAMP_RES1, "TimeStamp" },
259 | { EOE_TYPE_INIT_REQ2, "Init Req"},
260 | { EOE_TYPE_INIT_RES3, "Init Res"},
261 | { EOE_TYPE_MACFILTER_REQ4, "MAC Req" },
262 | { EOE_TYPE_MACFILTER_RES5, "MAC Res" },
263 | { 0, NULL((void*)0) }
264 | };
265 |
266 | static const value_string CANopenType[] =
267 | {
268 | { ETHERCAT_COE_TYPE_EMERGENCY1, "EMERGENCY" },
269 | { ETHERCAT_COE_TYPE_SDOREQ2, "SDO Req" },
270 | { ETHERCAT_COE_TYPE_SDORES3, "SDO Res"},
271 | { ETHERCAT_COE_TYPE_TXPDO4, "TxPDO"},
272 | { ETHERCAT_COE_TYPE_RXPDO5, "RxPDO" },
273 | { ETHERCAT_COE_TYPE_TXPDO_RTR6, "TxPDO_RTR" },
274 | { ETHERCAT_COE_TYPE_RXPDO_RTR7, "RxPDO_RTR" },
275 | { ETHERCAT_COE_TYPE_SDOINFO8, "SDO Information" },
276 | { 0, NULL((void*)0) }
277 | };
278 |
279 | static const value_string CANopenSdoInfo[] =
280 | {
281 | { ECAT_COE_INFO_OPCODE_LIST_Q1, "List Req" },
282 | { ECAT_COE_INFO_OPCODE_LIST_S2, "List Res" },
283 | { ECAT_COE_INFO_OPCODE_OBJ_Q3, "Obj Req"},
284 | { ECAT_COE_INFO_OPCODE_OBJ_S4, "Obj Res"},
285 | { ECAT_COE_INFO_OPCODE_ENTRY_Q5, "Entry Req" },
286 | { ECAT_COE_INFO_OPCODE_ENTRY_S6, "Entry Res" },
287 | { ECAT_COE_INFO_OPCODE_ERROR_S7, "Error Res" },
288 | { 0, NULL((void*)0) }
289 | };
290 |
291 | static const true_false_string tfs_complete =
292 | {
293 | "Complete", "Legacy"
294 | };
295 |
296 | void init_mbx_header(PETHERCAT_MBOX_HEADER pMbox, tvbuff_t *tvb, int offset)
297 | {
298 | pMbox->Length = tvb_get_letohs(tvb, offset); offset+=2;
299 | pMbox->Address = tvb_get_letohs(tvb, offset); offset+=2;
300 | pMbox->aControlUnion.Control = tvb_get_letohs(tvb, offset);
301 | }
302 |
303 | static void init_eoe_header(PETHERCAT_EOE_HEADER pEoE, tvbuff_t *tvb, int offset)
304 | {
305 | pEoE->anEoeHeaderInfoUnion.Info = tvb_get_letohs(tvb, offset); offset+=2;
306 | pEoE->anEoeHeaderDataUnion.Result = tvb_get_letohs(tvb, offset);
307 | }
308 |
309 | static void init_foe_header(PETHERCAT_FOE_HEADER pFoE, tvbuff_t *tvb, int offset)
310 | {
311 | pFoE->OpMode = tvb_get_uint8(tvb, offset++);
312 | pFoE->Reserved1 = tvb_get_uint8(tvb, offset++);
313 | pFoE->aFoeHeaderDataUnion.FileLength = tvb_get_letohl(tvb, offset);
314 | }
315 |
316 | static void init_soe_header(PETHERCAT_SOE_HEADER pSoE, tvbuff_t *tvb, int offset)
317 | {
318 | pSoE->anSoeHeaderControlUnion.v2.Control = tvb_get_uint8(tvb, offset++);
319 | pSoE->anSoeHeaderControlUnion.v2.Element = tvb_get_uint8(tvb, offset++);
320 | pSoE->anSoeHeaderDataUnion.FragmentsLeft = tvb_get_letohs(tvb, offset);
321 | }
322 |
323 | static void init_coe_header(PETHERCAT_COE_HEADER pCoE, tvbuff_t *tvb, int offset)
324 | {
325 | pCoE->header = tvb_get_letohs(tvb, offset);
326 | }
327 |
328 | static void init_sdo_header(PETHERCAT_SDO_HEADER pSdo, tvbuff_t *tvb, int offset)
329 | {
330 | pSdo->anSdoHeaderUnion.CS = tvb_get_uint8(tvb, offset++);
331 | pSdo->Index = tvb_get_letohs(tvb, offset);offset+=2;
332 | pSdo->SubIndex = tvb_get_uint8(tvb, offset++);
333 | pSdo->Data = tvb_get_letohl(tvb, offset);
334 | }
335 |
336 | static void init_sdo_info_header(PETHERCAT_SDO_INFO_HEADER pInfo, tvbuff_t *tvb, int offset)
337 | {
338 | pInfo->anSdoControlUnion.Control = tvb_get_uint8(tvb, offset++);
339 | pInfo->Reserved = tvb_get_uint8(tvb, offset);
340 | pInfo->FragmentsLeft = 2;
341 | }
342 |
343 | static void init_voe_header(PETHERCAT_VOE_HEADER pVoE, tvbuff_t *tvb, int offset)
344 | {
345 | pVoE->VendorID = tvb_get_letohl(tvb, offset);offset+=4;
346 | pVoE->VendorType = tvb_get_letohs(tvb, offset);offset+=2;
| Value stored to 'offset' is never read
347 | }
348 |
349 | static void CANopenSdoReqFormatter(PETHERCAT_SDO_HEADER pSdo, char *szText, int nMax)
350 | {
351 | switch ( pSdo->anSdoHeaderUnion.Idq.Ccs )
352 | {
353 | case SDO_CCS_INITIATE_DOWNLOAD1:
354 | snprintf ( szText, nMax, "SDO Req : 'Initiate Download' (%d) Idx=0x%x Sub=%d", pSdo->anSdoHeaderUnion.Idq.Ccs, pSdo->Index, pSdo->SubIndex);
355 | break;
356 | case SDO_CCS_INITIATE_UPLOAD2:
357 | snprintf ( szText, nMax, "SDO Req : 'Initiate Upload' (%d) Idx=0x%x Sub=%d", pSdo->anSdoHeaderUnion.Idq.Ccs, pSdo->Index, pSdo->SubIndex);
358 | break;
359 | case SDO_CCS_DOWNLOAD_SEGMENT0:
360 | snprintf ( szText, nMax, "SDO Req : 'Download Segment' (%d)", pSdo->anSdoHeaderUnion.Idq.Ccs);
361 | break;
362 | case SDO_CCS_UPLOAD_SEGMENT3:
363 | snprintf ( szText, nMax, "SDO Req : 'Upload Segment' (%d)", pSdo->anSdoHeaderUnion.Idq.Ccs);
364 | break;
365 | case SDO_CCS_ABORT_TRANSFER4:
366 | snprintf ( szText, nMax, "SDO Req : 'Abort Transfer' (%d)", pSdo->anSdoHeaderUnion.Idq.Ccs);
367 | break;
368 | default:
369 | snprintf ( szText, nMax, "SDO Req : Ccs %d", pSdo->anSdoHeaderUnion.Idq.Ccs);
370 | }
371 | }
372 |
373 | static void FoeFormatter(tvbuff_t *tvb, wmem_allocator_t *scope, int offset, char *szText, int nMax, unsigned foe_length)
374 | {
375 | ETHERCAT_FOE_HEADER foe;
376 | char *tmp = NULL((void*)0);
377 |
378 | init_foe_header(&foe, tvb, offset);
379 |
380 | switch ( foe.OpMode )
381 | {
382 | case ECAT_FOE_OPMODE_RRQ1:
383 | case ECAT_FOE_OPMODE_WRQ2:
384 | case ECAT_FOE_OPMODE_ERR5:
385 | if ( foe_length > ETHERCAT_FOE_HEADER_LEN6 ) {
386 | tmp = (char*)tvb_get_string_enc(scope, tvb, offset+ETHERCAT_FOE_HEADER_LEN6, MIN(foe_length-ETHERCAT_FOE_HEADER_LEN, 49)(((foe_length-6) < (49)) ? (foe_length-6) : (49)), ENC_ASCII0x00000000);
387 | }
388 | break;
389 | }
390 |
391 | switch ( foe.OpMode )
392 | {
393 | case ECAT_FOE_OPMODE_RRQ1:
394 | snprintf ( szText, nMax, "FoE RRQ (%d) : '%s'", foe.aFoeHeaderDataUnion.FileLength, tmp ? tmp : "");
395 | break;
396 | case ECAT_FOE_OPMODE_WRQ2:
397 | snprintf ( szText, nMax, "FoE WRQ (%d) : '%s'", foe.aFoeHeaderDataUnion.FileLength, tmp ? tmp : "");
398 | break;
399 | case ECAT_FOE_OPMODE_DATA3:
400 | snprintf ( szText, nMax, "FoE DATA (%d) : %d Bytes", foe.aFoeHeaderDataUnion.v.PacketNo, foe_length-ETHERCAT_FOE_HEADER_LEN6);
401 | break;
402 | case ECAT_FOE_OPMODE_ACK4:
403 | snprintf ( szText, nMax, "FoE ACK (%d)", foe.aFoeHeaderDataUnion.v.PacketNo);
404 | break;
405 | case ECAT_FOE_OPMODE_ERR5:
406 | snprintf ( szText, nMax, "FoE ERR (%d) : '%s'", foe.aFoeHeaderDataUnion.ErrorCode, tmp ? tmp : "");
407 | break;
408 | case ECAT_FOE_OPMODE_BUSY6:
409 | if ( foe.aFoeHeaderDataUnion.v2.Entire > 0 )
410 | snprintf ( szText, nMax, "FoE BUSY (%d%%)", ((uint32_t)foe.aFoeHeaderDataUnion.v2.Done*100)/foe.aFoeHeaderDataUnion.v2.Entire);
411 | else
412 | snprintf ( szText, nMax, "FoE BUSY (%d/%d)", foe.aFoeHeaderDataUnion.v2.Done, foe.aFoeHeaderDataUnion.v2.Entire);
413 | break;
414 | default:
415 | snprintf ( szText, nMax, "FoE Unknown");
416 | }
417 | }
418 |
419 | static void SoEIdToString( char* txt, uint16_t id, int nMax)
420 | {
421 | if ( id & 0x8000 )
422 | snprintf(txt, nMax, "P-%d-%04d", (id>>12) & 0x0007, id & 0x0FFF );
423 | else
424 | snprintf(txt, nMax, "S-%d-%04d", id>>12, id & 0x0FFF );
425 | }
426 |
427 | static void SoeFormatter(tvbuff_t *tvb, int offset, char *szText, int nMax, unsigned soe_length)
428 | {
429 | ETHERCAT_SOE_HEADER soe;
430 | char tmp[50];
431 | char elm[50];
432 | memset(tmp, 0, sizeof(tmp));
433 |
434 | init_soe_header(&soe, tvb, offset);
435 | offset+=ETHERCAT_SOE_HEADER_LEN((int) sizeof(ETHERCAT_SOE_HEADER));
436 |
437 | if ( !soe.anSoeHeaderControlUnion.v.Error )
438 | {
439 | if ( !soe.anSoeHeaderControlUnion.v.InComplete )
440 | {
441 | SoEIdToString(tmp, soe.anSoeHeaderDataUnion.IDN, sizeof(tmp)-1);
442 | elm[0] = '\0';
443 | if ( soe.anSoeHeaderControlUnion.v.DataState )
444 | (void) g_strlcat(elm, "D", 50);
445 | if ( soe.anSoeHeaderControlUnion.v.Name )
446 | (void) g_strlcat(elm, "N", 50);
447 | if ( soe.anSoeHeaderControlUnion.v.Attribute )
448 | (void) g_strlcat(elm, "A", 50);
449 | if ( soe.anSoeHeaderControlUnion.v.Unit )
450 | (void) g_strlcat(elm, "U", 50);
451 | if ( soe.anSoeHeaderControlUnion.v.Min )
452 | (void) g_strlcat(elm, "I", 50);
453 | if ( soe.anSoeHeaderControlUnion.v.Max )
454 | (void) g_strlcat(elm, "X", 50);
455 | if ( soe.anSoeHeaderControlUnion.v.Value )
456 | (void) g_strlcat(elm, "V", 50);
457 | switch ( soe.anSoeHeaderControlUnion.v.OpCode )
458 | {
459 | case ECAT_SOE_OPCODE_RRQ1:
460 | snprintf ( szText, nMax, "SoE: RRQ (%s, '%s')", tmp, elm);
461 | break;
462 | case ECAT_SOE_OPCODE_RRS2:
463 | snprintf ( szText, nMax, "SoE: RRS (%s, '%s') : %u Bytes", tmp, elm, (unsigned)(soe_length-ETHERCAT_SOE_HEADER_LEN((int) sizeof(ETHERCAT_SOE_HEADER))));
464 | break;
465 | case ECAT_SOE_OPCODE_WRS4:
466 | snprintf ( szText, nMax, "SoE: WRS (%s, '%s')", tmp, elm);
467 | break;
468 | case ECAT_SOE_OPCODE_WRQ3:
469 | snprintf ( szText, nMax, "SoE: WRQ (%s, '%s') : %u Bytes", tmp, elm, (unsigned)(soe_length-ETHERCAT_SOE_HEADER_LEN((int) sizeof(ETHERCAT_SOE_HEADER))));
470 | break;
471 | case ECAT_SOE_OPCODE_NFC5:
472 | snprintf ( szText, nMax, "SoE: NFC (%s, '%s') : %u Bytes", tmp, elm, (unsigned)(soe_length-ETHERCAT_SOE_HEADER_LEN((int) sizeof(ETHERCAT_SOE_HEADER))));
473 | break;
474 | case 6:
475 | snprintf ( szText, nMax, "SoE: EMGCY");
476 | break;
477 | default:
478 | snprintf ( szText, nMax, "SoE:");
479 | }
480 | }
481 | else
482 | snprintf ( szText, nMax, "SoE: FragmentsLeft %d", soe.anSoeHeaderDataUnion.FragmentsLeft);
483 | }
484 | else
485 | snprintf ( szText, nMax, "SoE: Error %04x", tvb_get_letohs(tvb, offset));
486 | }
487 |
488 | static void VoeFormatter(tvbuff_t *tvb, int offset, char *szText, int nMax, unsigned voe_length)
489 | {
490 | ETHERCAT_VOE_HEADER voe;
491 | init_voe_header(&voe, tvb, offset);
492 |
493 | snprintf ( szText, nMax, "VoE(ID=0x%x, Type=0x%x) : %d Bytes", voe.VendorID, voe.VendorType, (unsigned)(voe_length-ETHERCAT_VOE_HEADER_LEN6));
494 | }
495 |
496 | /* ethercat mailbox */
497 | static void dissect_ecat_coe(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
498 | {
499 | proto_tree *ecat_coe_tree = NULL((void*)0), *ecat_sdo_tree, *ecat_coe_sdoccs_tree, *ecat_coe_sdoscs_tree;
500 |
501 | proto_item *anItem = NULL((void*)0), *aparent = NULL((void*)0);
502 | char szText[200];
503 | int nMax = sizeof(szText)-1;
504 |
505 | unsigned coe_length = tvb_reported_length(tvb)-offset;
506 | uint16_t len;
507 |
508 | if( tree )
509 | {
510 | anItem = proto_tree_add_bytes_format(tree, hf_ecat_mailbox_coe, tvb, offset, coe_length, NULL((void*)0), "CoE");
511 | aparent = proto_item_get_parent(anItem);
512 | proto_item_append_text(aparent,":CoE ");
513 | }
514 |
515 | col_append_str(pinfo->cinfo, COL_INFO, "CoE ");
516 |
517 | if( coe_length >= ETHERCAT_COE_HEADER_LEN((int) sizeof(ETHERCAT_COE_HEADER)) )
518 | {
519 | ETHERCAT_COE_HEADER coe;
520 | init_coe_header(&coe, tvb, offset);
521 | if( tree )
522 | {
523 | ecat_coe_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_coe);
524 |
525 | proto_tree_add_uint(ecat_coe_tree, hf_ecat_mailbox_coe_number, tvb, offset, ETHERCAT_COE_HEADER_LEN((int) sizeof(ETHERCAT_COE_HEADER)), coe.v.Number);
526 | proto_tree_add_uint(ecat_coe_tree, hf_ecat_mailbox_coe_type, tvb, offset, ETHERCAT_COE_HEADER_LEN((int) sizeof(ETHERCAT_COE_HEADER)), coe.v.Type);
527 | }
528 |
529 | offset += ETHERCAT_COE_HEADER_LEN((int) sizeof(ETHERCAT_COE_HEADER));
530 |
531 | switch (coe.v.Type)
532 | {
533 | case ETHERCAT_COE_TYPE_SDOREQ2:
534 | {
535 | ETHERCAT_SDO_HEADER sdo;
536 |
537 | if( coe_length < ETHERCAT_COE_HEADER_LEN((int) sizeof(ETHERCAT_COE_HEADER)) + ETHERCAT_SDO_HEADER_LEN8 )
538 | {
539 | col_append_str(pinfo->cinfo, COL_INFO, "Sdo Req - invalid length");
540 | expert_add_info_format(pinfo, ecat_coe_tree, &ei_ecat_mailbox_coe_error, "Sdo Req - invalid length");
541 | break;
542 | }
543 |
544 | init_sdo_header(&sdo, tvb, offset);
545 |
546 | CANopenSdoReqFormatter(&sdo, szText, nMax);
547 | col_append_str(pinfo->cinfo, COL_INFO, szText);
548 |
549 | if( tree )
550 | {
551 | proto_item_append_text(aparent, "%s", szText);
552 |
553 | anItem = proto_tree_add_uint(ecat_coe_tree, hf_ecat_mailbox_coe_sdoreq, tvb, offset, 1, sdo.anSdoHeaderUnion.Idq.Ccs);
554 | proto_item_set_text(anItem, "%s", szText);
555 | ecat_sdo_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_sdo);
556 |
557 | switch ( sdo.anSdoHeaderUnion.Idq.Ccs )
558 | {
559 | case SDO_CCS_INITIATE_DOWNLOAD1:
560 | anItem = proto_tree_add_item(ecat_sdo_tree, hf_ecat_mailbox_coe_sdoccsid, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000);
561 | ecat_coe_sdoccs_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_coe_sdoccs);
562 | proto_tree_add_item(ecat_coe_sdoccs_tree, hf_ecat_mailbox_coe_sdoccsid_sizeind, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000);
563 | proto_tree_add_item(ecat_coe_sdoccs_tree, hf_ecat_mailbox_coe_sdoccsid_expedited, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000);
564 | proto_tree_add_item(ecat_coe_sdoccs_tree, hf_ecat_mailbox_coe_sdoccsid_size0, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000);
565 | proto_tree_add_item(ecat_coe_sdoccs_tree, hf_ecat_mailbox_coe_sdoccsid_size1, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000);
566 | proto_tree_add_item(ecat_coe_sdoccs_tree, hf_ecat_mailbox_coe_sdoccsid_complete, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000);
567 |
568 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoidx, tvb, offset+1, 2, ENC_LITTLE_ENDIAN0x80000000);
569 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdosub, tvb, offset+3, 1, ENC_LITTLE_ENDIAN0x80000000);
570 | if ( sdo.anSdoHeaderUnion.Idq.SizeInd && !sdo.anSdoHeaderUnion.Idq.Expedited )
571 | {
572 | len = coe_length - ETHERCAT_COE_HEADER_LEN((int) sizeof(ETHERCAT_COE_HEADER)) - ETHERCAT_SDO_HEADER_LEN8;
573 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdolength, tvb, offset+4, 4, ENC_LITTLE_ENDIAN0x80000000);
574 | offset+=ETHERCAT_SDO_HEADER_LEN8;
575 | if ( len > 0 )
576 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoldata, tvb, offset, len, ENC_NA0x00000000);
577 | }
578 | else
579 | {
580 | if ( sdo.anSdoHeaderUnion.Idq.Size == 3 )
581 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdodata1, tvb, offset+4, 1, ENC_LITTLE_ENDIAN0x80000000);
582 | else if ( sdo.anSdoHeaderUnion.Idq.Size == 2 )
583 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdodata2, tvb, offset+4, 2, ENC_LITTLE_ENDIAN0x80000000);
584 | else
585 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdodata, tvb, offset+4, 4, ENC_LITTLE_ENDIAN0x80000000);
586 | }
587 | break;
588 | case SDO_CCS_INITIATE_UPLOAD2:
589 | anItem = proto_tree_add_item(ecat_sdo_tree, hf_ecat_mailbox_coe_sdoccsiu, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000);
590 | ecat_coe_sdoccs_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_coe_sdoccs);
591 | proto_tree_add_item(ecat_coe_sdoccs_tree, hf_ecat_mailbox_coe_sdoccsid_complete, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000);
592 |
593 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoidx, tvb, offset+1, 2, ENC_LITTLE_ENDIAN0x80000000);
594 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdosub, tvb, offset+3, 1, ENC_LITTLE_ENDIAN0x80000000);
595 |
596 | break;
597 | case SDO_CCS_DOWNLOAD_SEGMENT0:
598 | anItem = proto_tree_add_item(ecat_sdo_tree, hf_ecat_mailbox_coe_sdoccsds, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000);
599 | ecat_coe_sdoccs_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_coe_sdoccs);
600 | proto_tree_add_item(ecat_coe_sdoccs_tree, hf_ecat_mailbox_coe_sdoccsds_lastseg, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000);
601 | proto_tree_add_item(ecat_coe_sdoccs_tree, hf_ecat_mailbox_coe_sdoccsds_size, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000);
602 | proto_tree_add_item(ecat_coe_sdoccs_tree, hf_ecat_mailbox_coe_sdoccsds_toggle, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000);
603 | offset+=1;
604 |
605 | if ( coe_length-offset > 0 )
606 | {
607 | anItem = proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoldata, tvb, offset, coe_length-offset, ENC_NA0x00000000);
608 | proto_item_append_text(anItem, "(len = %d)", coe_length-offset);
609 | }
610 | break;
611 | case SDO_CCS_UPLOAD_SEGMENT3:
612 | anItem = proto_tree_add_item(ecat_sdo_tree, hf_ecat_mailbox_coe_sdoccsus, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000);
613 | ecat_coe_sdoccs_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_coe_sdoccs);
614 | proto_tree_add_item(ecat_coe_sdoccs_tree, hf_ecat_mailbox_coe_sdoccsus_toggle, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000);
615 | break;
616 | case SDO_CCS_ABORT_TRANSFER4:
617 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoabortcode, tvb, offset+4, 4, ENC_LITTLE_ENDIAN0x80000000);
618 | break;
619 | }
620 | }
621 | }
622 | break;
623 |
624 | case ETHERCAT_COE_TYPE_SDORES3:
625 | {
626 | ETHERCAT_SDO_HEADER sdo;
627 | if( coe_length < ETHERCAT_COE_HEADER_LEN((int) sizeof(ETHERCAT_COE_HEADER)) + ETHERCAT_SDO_HEADER_LEN8 )
628 | {
629 | col_append_str(pinfo->cinfo, COL_INFO, "Sdo Res - invalid length");
630 | expert_add_info_format(pinfo, ecat_coe_tree, &ei_ecat_mailbox_coe_error, "Sdo Res - invalid length");
631 | break;
632 | }
633 |
634 | init_sdo_header(&sdo, tvb, offset);
635 |
636 | col_append_fstr(pinfo->cinfo, COL_INFO, "SDO Res: Scs %d", sdo.anSdoHeaderUnion.Ids.Scs);
637 | if( tree )
638 | {
639 | proto_tree_add_uint_format_value(ecat_coe_tree, hf_ecat_mailbox_coe_sdores, tvb, offset, 1, sdo.anSdoHeaderUnion.Ids.Scs,
640 | "Scs %d", sdo.anSdoHeaderUnion.Ids.Scs);
641 | ecat_sdo_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_sdo);
642 |
643 | switch ( sdo.anSdoHeaderUnion.Ids.Scs )
644 | {
645 | case SDO_SCS_INITIATE_DOWNLOAD3:
646 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoidx, tvb, offset+1, 2, ENC_LITTLE_ENDIAN0x80000000);
647 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdosub, tvb, offset+3, 1, ENC_LITTLE_ENDIAN0x80000000);
648 | break;
649 | case SDO_SCS_INITIATE_UPLOAD2:
650 | anItem = proto_tree_add_item(ecat_sdo_tree, hf_ecat_mailbox_coe_sdoscsiu, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000);
651 | ecat_coe_sdoscs_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_coe_sdoscs);
652 | proto_tree_add_item(ecat_coe_sdoscs_tree, hf_ecat_mailbox_coe_sdoscsiu_sizeind, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000);
653 | proto_tree_add_item(ecat_coe_sdoscs_tree, hf_ecat_mailbox_coe_sdoscsiu_expedited, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000);
654 | proto_tree_add_item(ecat_coe_sdoscs_tree, hf_ecat_mailbox_coe_sdoscsiu_size0, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000);
655 | proto_tree_add_item(ecat_coe_sdoscs_tree, hf_ecat_mailbox_coe_sdoscsiu_size1, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000);
656 | proto_tree_add_item(ecat_coe_sdoscs_tree, hf_ecat_mailbox_coe_sdoscsiu_complete, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000);
657 |
658 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoidx, tvb, offset+1, 2, ENC_LITTLE_ENDIAN0x80000000);
659 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdosub, tvb, offset+3, 1, ENC_LITTLE_ENDIAN0x80000000);
660 | if ( sdo.anSdoHeaderUnion.Ius.SizeInd && !sdo.anSdoHeaderUnion.Ius.Expedited )
661 | {
662 | len = coe_length - ETHERCAT_COE_HEADER_LEN((int) sizeof(ETHERCAT_COE_HEADER)) - ETHERCAT_SDO_HEADER_LEN8;
663 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdolength, tvb, offset+4, 4, ENC_LITTLE_ENDIAN0x80000000);
664 | offset+=ETHERCAT_SDO_HEADER_LEN8;
665 | if ( len > 0 )
666 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoldata, tvb, offset, len, ENC_NA0x00000000);
667 | }
668 | else if ( sdo.anSdoHeaderUnion.Ius.SizeInd && sdo.anSdoHeaderUnion.Ius.Expedited && sdo.anSdoHeaderUnion.Ius.Size == 3 )
669 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdodata1, tvb, offset+4, 1, ENC_LITTLE_ENDIAN0x80000000);
670 | else if ( sdo.anSdoHeaderUnion.Ius.SizeInd && sdo.anSdoHeaderUnion.Ius.Expedited && sdo.anSdoHeaderUnion.Ius.Size == 2 )
671 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdodata2, tvb, offset+4, 2, ENC_LITTLE_ENDIAN0x80000000);
672 | else
673 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdodata, tvb, offset+4, 4, ENC_LITTLE_ENDIAN0x80000000);
674 | break;
675 | case SDO_SCS_DOWNLOAD_SEGMENT1:
676 | anItem = proto_tree_add_item(ecat_sdo_tree, hf_ecat_mailbox_coe_sdoscsds, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000);
677 | ecat_coe_sdoscs_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_coe_sdoscs);
678 | proto_tree_add_item(ecat_coe_sdoscs_tree, hf_ecat_mailbox_coe_sdoscsds_toggle, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000);
679 | break;
680 | case SDO_SCS_UPLOAD_SEGMENT0:
681 | anItem = proto_tree_add_item(ecat_sdo_tree, hf_ecat_mailbox_coe_sdoscsus, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000);
682 | ecat_coe_sdoscs_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_coe_sdoscs);
683 | proto_tree_add_item(ecat_coe_sdoscs_tree, hf_ecat_mailbox_coe_sdoscsus_lastseg, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000);
684 | proto_tree_add_item(ecat_coe_sdoscs_tree, hf_ecat_mailbox_coe_sdoscsus_bytes, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000);
685 | proto_tree_add_item(ecat_coe_sdoscs_tree, hf_ecat_mailbox_coe_sdoscsus_toggle, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000);
686 | offset+=1;
687 |
688 | if ( coe_length-offset> 0 )
689 | {
690 | anItem = proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoldata, tvb, offset, coe_length-offset, ENC_NA0x00000000);
691 | proto_item_append_text(anItem, "(len = %d)", coe_length-offset);
692 | }
693 | break;
694 | }
695 | }
696 | }
697 | break;
698 |
699 | case ETHERCAT_COE_TYPE_SDOINFO8:
700 | {
701 | ETHERCAT_SDO_INFO_HEADER info;
702 |
703 | if( coe_length < ETHERCAT_COE_HEADER_LEN((int) sizeof(ETHERCAT_COE_HEADER)) + ETHERCAT_SDO_INFO_LISTREQ_LEN6 )
704 | {
705 | col_append_str(pinfo->cinfo, COL_INFO, "Sdo Info - invalid length");
706 | expert_add_info_format(pinfo, ecat_coe_tree, &ei_ecat_mailbox_coe_error, "Sdo Info - invalid length");
707 | break;
708 | }
709 |
710 | memset(&info, 0x0, sizeof(info));
711 | init_sdo_info_header(&info, tvb, offset);
712 |
713 | col_append_str(pinfo->cinfo, COL_INFO, val_to_str(pinfo->pool, info.anSdoControlUnion.v.OpCode & 0x7F, CANopenSdoInfo, "%d (Unknown)"));
714 | if ( info.anSdoControlUnion.v.InComplete )
715 | col_append_str(pinfo->cinfo, COL_INFO, " - More Follows");
716 |
717 | if( tree )
718 | {
719 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfoopcode, tvb, offset++, 1, ENC_LITTLE_ENDIAN0x80000000);
720 | offset++; /*Reserved*/
721 |
722 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfofrag, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
723 | offset+=2;
724 |
725 | switch ( info.anSdoControlUnion.v.OpCode )
726 | {
727 | case ECAT_COE_INFO_OPCODE_LIST_Q1:
728 | {
729 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfolisttype, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
730 | }
731 | break;
732 | case ECAT_COE_INFO_OPCODE_LIST_S2:
733 | {
734 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfolisttype, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
735 | offset+=2;
736 |
737 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfolist, tvb, offset, coe_length-offset, ENC_NA0x00000000);
738 | }
739 | break;
740 | case ECAT_COE_INFO_OPCODE_OBJ_Q3:
741 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfoindex, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
742 | break;
743 | case ECAT_COE_INFO_OPCODE_OBJ_S4:
744 | {
745 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfoindex, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
746 | offset+=2;
747 |
748 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfodatatype, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
749 | offset+=2;
750 |
751 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfomaxsub, tvb, offset++, 1, ENC_LITTLE_ENDIAN0x80000000);
752 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfoobjcode, tvb, offset++, 1, ENC_LITTLE_ENDIAN0x80000000);
753 |
754 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfoname, tvb, offset, coe_length-offset, ENC_ASCII0x00000000);
755 | }
756 | break;
757 | case ECAT_COE_INFO_OPCODE_ENTRY_Q5:
758 | {
759 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfoindex, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
760 | offset+=2;
761 |
762 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfosubindex, tvb, offset++, 1, ENC_LITTLE_ENDIAN0x80000000);
763 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfovalueinfo, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000);
764 | }
765 | break;
766 | case ECAT_COE_INFO_OPCODE_ENTRY_S6:
767 | {
768 | uint16_t objlen;
769 |
770 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfoindex, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
771 | offset+=2;
772 |
773 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfosubindex, tvb, offset++, 1, ENC_LITTLE_ENDIAN0x80000000);
774 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfovalueinfo, tvb, offset++, 1, ENC_LITTLE_ENDIAN0x80000000);
775 |
776 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfodatatype, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
777 | offset+=2;
778 |
779 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfobitlen, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
780 | offset+=2;
781 |
782 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfoobjaccess, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
783 | offset+=2;
784 |
785 | if ( (info.anSdoInfoUnion.Entry.ValueInfo & 0x08) != 0 )
786 | {
787 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfounittype, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
788 | offset+=2;
789 | }
790 | if ( (info.anSdoInfoUnion.Entry.ValueInfo & 0x10) != 0 )
791 | {
792 | objlen = BIT2BYTE(info.anSdoInfoUnion.Entry.Res.BitLen)((info.anSdoInfoUnion.Entry.Res.BitLen+7)/8);
793 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfodefaultvalue, tvb, offset, objlen, ENC_NA0x00000000);
794 | offset+=objlen;
795 | }
796 | if ( (info.anSdoInfoUnion.Entry.ValueInfo & 0x20) != 0 )
797 | {
798 | objlen = BIT2BYTE(info.anSdoInfoUnion.Entry.Res.BitLen)((info.anSdoInfoUnion.Entry.Res.BitLen+7)/8);
799 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfominvalue, tvb, offset, objlen, ENC_NA0x00000000);
800 | offset+=objlen;
801 | }
802 | if ( (info.anSdoInfoUnion.Entry.ValueInfo & 0x40) != 0 )
803 | {
804 | objlen = BIT2BYTE(info.anSdoInfoUnion.Entry.Res.BitLen)((info.anSdoInfoUnion.Entry.Res.BitLen+7)/8);
805 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfomaxvalue, tvb, offset, objlen, ENC_NA0x00000000);
806 | offset+=objlen;
807 | }
808 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfoname, tvb, offset, coe_length-offset, ENC_ASCII0x00000000);
809 | }
810 | break;
811 | case ECAT_COE_INFO_OPCODE_ERROR_S7:
812 | {
813 | proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfoerrorcode, tvb, offset, 4, ENC_LITTLE_ENDIAN0x80000000);
814 | }
815 | break;
816 | }
817 | }
818 | }
819 | break;
820 | }
821 | }
822 | else
823 | {
824 | col_append_str(pinfo->cinfo, COL_INFO, "- invalid length");
825 | expert_add_info(pinfo, tree, &ei_ecat_mailbox_coe_error);
826 | }
827 | }
828 |
829 | static void dissect_ecat_soe(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
830 | {
831 | proto_tree *ecat_soeflag_tree, *ecat_soe_tree;
832 |
833 | proto_item *anItem = NULL((void*)0) ,*aparent = NULL((void*)0);
834 | char szText[200];
835 | int nMax = sizeof(szText)-1;
836 |
837 | unsigned soe_length = tvb_reported_length(tvb)-offset;
838 |
839 | if( tree )
840 | {
841 | anItem = proto_tree_add_item(tree, hf_ecat_mailbox_soe, tvb, offset, soe_length, ENC_NA0x00000000);
842 |
843 | aparent = proto_item_get_parent(anItem);
844 | proto_item_append_text(aparent,":SoE ");
845 | }
846 |
847 | if( soe_length >= ETHERCAT_SOE_HEADER_LEN((int) sizeof(ETHERCAT_SOE_HEADER)) )
848 | {
849 | SoeFormatter(tvb, offset, szText, nMax, soe_length);
850 | col_append_str(pinfo->cinfo, COL_INFO, szText);
851 |
852 | if( tree )
853 | {
854 | ETHERCAT_SOE_HEADER soe;
855 | init_soe_header(&soe, tvb, offset);
856 |
857 | proto_item_append_text(aparent, "%s", szText);
858 | proto_item_set_text(anItem, "%s", szText);
859 |
860 | ecat_soe_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_soe);
861 | anItem = proto_tree_add_item(ecat_soe_tree, hf_ecat_mailbox_soe_header, tvb, offset , 2, ENC_LITTLE_ENDIAN0x80000000);
862 |
863 | ecat_soeflag_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_soeflag);
864 | proto_tree_add_item(ecat_soeflag_tree, hf_ecat_mailbox_soe_header_opcode, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
865 | proto_tree_add_item(ecat_soeflag_tree, hf_ecat_mailbox_soe_header_incomplete, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
866 | proto_tree_add_item(ecat_soeflag_tree, hf_ecat_mailbox_soe_header_error, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
867 | proto_tree_add_item(ecat_soeflag_tree, hf_ecat_mailbox_soe_header_driveno, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
868 | proto_tree_add_item(ecat_soeflag_tree, hf_ecat_mailbox_soe_header_datastate, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
869 | proto_tree_add_item(ecat_soeflag_tree, hf_ecat_mailbox_soe_header_name, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
870 | proto_tree_add_item(ecat_soeflag_tree, hf_ecat_mailbox_soe_header_attribute, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
871 | proto_tree_add_item(ecat_soeflag_tree, hf_ecat_mailbox_soe_header_unit, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
872 | proto_tree_add_item(ecat_soeflag_tree, hf_ecat_mailbox_soe_header_min, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
873 | proto_tree_add_item(ecat_soeflag_tree, hf_ecat_mailbox_soe_header_max, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
874 | proto_tree_add_item(ecat_soeflag_tree, hf_ecat_mailbox_soe_header_value, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
875 | proto_tree_add_item(ecat_soeflag_tree, hf_ecat_mailbox_soe_header_reserved, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
876 | offset+=2;
877 |
878 | if ( !soe.anSoeHeaderControlUnion.v.Error )
879 | {
880 | if ( !soe.anSoeHeaderControlUnion.v.InComplete )
881 | {
882 | switch (soe.anSoeHeaderControlUnion.v.OpCode)
883 | {
884 | case ECAT_SOE_OPCODE_RRQ1:
885 | case ECAT_SOE_OPCODE_WRS4:
886 | proto_tree_add_item(ecat_soe_tree, hf_ecat_mailbox_soe_idn, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
887 | break;
888 | case ECAT_SOE_OPCODE_RRS2:
889 | case ECAT_SOE_OPCODE_WRQ3:
890 | case ECAT_SOE_OPCODE_NFC5:
891 | proto_tree_add_item(ecat_soe_tree, hf_ecat_mailbox_soe_idn, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
892 | offset+=2;
893 | proto_tree_add_item(tree, hf_ecat_mailbox_soe_data, tvb, offset, soe_length-offset, ENC_NA0x00000000);
894 | break;
895 | }
896 | }
897 | else
898 | {
899 | proto_tree_add_item(ecat_soe_tree, hf_ecat_mailbox_soe_frag, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
900 | offset+=2;
901 |
902 | proto_tree_add_item(tree, hf_ecat_mailbox_soe_data, tvb, offset, soe_length-offset, ENC_NA0x00000000);
903 | }
904 | }
905 | else
906 | {
907 | proto_tree_add_item(ecat_soe_tree, hf_ecat_mailbox_soe_idn, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
908 | proto_tree_add_item(tree, hf_ecat_mailbox_soe_error, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
909 | }
910 | }
911 | }
912 | else
913 | {
914 | col_append_str(pinfo->cinfo, COL_INFO, "SoE - invalid length");
915 | expert_add_info(pinfo, tree, &ei_ecat_mailbox_soe_error);
916 | }
917 | }
918 |
919 | static void dissect_ecat_eoe(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
920 | {
921 | proto_tree *ecat_eoe_tree = 0, *ecat_fraghead_tree, *ecat_eoe_init_tree, *ecat_eoe_macfilter_tree,
922 | *ecat_eoe_macfilter_filter_tree;
923 | tvbuff_t *next_tvb;
924 | proto_item *anItem = NULL((void*)0), *aparent = NULL((void*)0);
925 | int nCnt;
926 |
927 | unsigned eoe_length = tvb_reported_length(tvb)-offset;
928 |
929 | if( tree )
930 | {
931 | anItem = proto_tree_add_bytes_format(tree, hf_ecat_mailbox_eoe, tvb, offset, eoe_length, NULL((void*)0), "EoE Fragment");
932 |
933 | aparent = proto_item_get_parent(anItem);
934 | proto_item_append_text(aparent,":EoE ");
935 | }
936 |
937 | if( eoe_length >= ETHERCAT_EOE_HEADER_LEN((int) sizeof(ETHERCAT_EOE_HEADER)) )
938 | {
939 | ETHERCAT_EOE_HEADER eoe;
940 | init_eoe_header(&eoe, tvb, offset);
941 | if ( eoe.anEoeHeaderInfoUnion.v.Type == EOE_TYPE_FRAME_FRAG0 )
942 | col_append_fstr(pinfo->cinfo, COL_INFO, "EoE-Frag %d", eoe.anEoeHeaderDataUnion.v.Fragment);
943 | else
944 | col_append_str(pinfo->cinfo, COL_INFO, "EoE");
945 |
946 | { /* Do the following even 'if (tree == NULL)' since a call_dissector() is done */
947 | ecat_eoe_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_eoe);
948 |
949 | anItem = proto_tree_add_item(ecat_eoe_tree, hf_ecat_mailbox_eoe_fraghead, tvb, offset, 4, ENC_NA0x00000000);
950 | ecat_fraghead_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_fraghead);
951 |
952 | proto_tree_add_uint(ecat_fraghead_tree, hf_ecat_mailbox_eoe_type, tvb, offset, 4, eoe.anEoeHeaderInfoUnion.v.Type);
953 |
954 | switch ( eoe.anEoeHeaderInfoUnion.v.Type )
955 | {
956 | case EOE_TYPE_FRAME_FRAG0:
957 | proto_tree_add_uint(ecat_fraghead_tree, hf_ecat_mailbox_eoe_fragno, tvb, offset, 4, eoe.anEoeHeaderDataUnion.v.Fragment);
958 |
959 | if (eoe.anEoeHeaderDataUnion.v.Fragment == 0)
960 | {
961 | proto_tree_add_uint_format(ecat_fraghead_tree, hf_ecat_mailbox_eoe_offset, tvb, offset, 4, 32*eoe.anEoeHeaderDataUnion.v.OffsetBuffer,
962 | "BufferSize: %d", 32*eoe.anEoeHeaderDataUnion.v.OffsetBuffer);
963 | }
964 | else
965 | {
966 | proto_tree_add_uint(ecat_fraghead_tree, hf_ecat_mailbox_eoe_offset, tvb, offset, 4, 32*eoe.anEoeHeaderDataUnion.v.OffsetBuffer);
967 | }
968 |
969 | proto_tree_add_uint(ecat_fraghead_tree, hf_ecat_mailbox_eoe_frame, tvb, offset, 4, eoe.anEoeHeaderDataUnion.v.FrameNo);
970 |
971 | proto_tree_add_uint(ecat_fraghead_tree, hf_ecat_mailbox_eoe_last, tvb, offset, 4, eoe.anEoeHeaderInfoUnion.v.LastFragment);
972 |
973 | if ( eoe.anEoeHeaderInfoUnion.v.TimeStampRequested )
974 | {
975 | proto_tree_add_uint(ecat_fraghead_tree, hf_ecat_mailbox_eoe_timestampreq, tvb, offset, 4, eoe.anEoeHeaderInfoUnion.v.TimeStampRequested);
976 | }
977 |
978 | if ( eoe.anEoeHeaderInfoUnion.v.TimeStampAppended )
979 | {
980 | proto_tree_add_uint(ecat_fraghead_tree, hf_ecat_mailbox_eoe_timestampapp, tvb, offset, 4, eoe.anEoeHeaderInfoUnion.v.TimeStampAppended);
981 | }
982 |
983 | offset+=ETHERCAT_EOE_HEADER_LEN((int) sizeof(ETHERCAT_EOE_HEADER));
984 | proto_tree_add_item(ecat_eoe_tree, hf_ecat_mailbox_eoe_fragment, tvb, offset, eoe_length-offset, ENC_NA0x00000000);
985 |
986 | if ( eoe.anEoeHeaderDataUnion.v.Fragment == 0 )
987 | {
988 | next_tvb = tvb_new_subset_length(tvb, offset, eoe_length-offset);
989 | call_dissector( eth_handle, next_tvb, pinfo, ecat_eoe_tree);
990 | }
991 |
992 | if ( eoe.anEoeHeaderInfoUnion.v.TimeStampAppended )
993 | {
994 | proto_tree_add_item(ecat_eoe_tree, hf_ecat_mailbox_eoe_timestamp, tvb, eoe_length-ETHERCAT_EOE_TIMESTAMP_LEN((int) sizeof(ETHERCAT_EOE_TIMESTAMP)), ETHERCAT_EOE_TIMESTAMP_LEN((int) sizeof(ETHERCAT_EOE_TIMESTAMP)), ENC_LITTLE_ENDIAN0x80000000);
995 | }
996 | break;
997 |
998 | case EOE_TYPE_TIMESTAMP_RES1:
999 | proto_tree_add_item(ecat_eoe_tree, hf_ecat_mailbox_eoe_timestamp, tvb, offset+ETHERCAT_EOE_HEADER_LEN((int) sizeof(ETHERCAT_EOE_HEADER)), ETHERCAT_EOE_TIMESTAMP_LEN((int) sizeof(ETHERCAT_EOE_TIMESTAMP)), ENC_LITTLE_ENDIAN0x80000000);
1000 | break;
1001 |
1002 | case EOE_TYPE_INIT_REQ2:
1003 | offset+=ETHERCAT_EOE_HEADER_LEN((int) sizeof(ETHERCAT_EOE_HEADER));
1004 | anItem = proto_tree_add_item(ecat_fraghead_tree, hf_ecat_mailbox_eoe_init, tvb, offset, MIN(eoe_length-offset,ETHERCAT_EOE_INIT_LEN)(((eoe_length-offset) < (58)) ? (eoe_length-offset) : (58) ), ENC_NA0x00000000);
1005 | if( eoe_length-offset >= ETHERCAT_EOE_INIT_LEN58 )
1006 | {
1007 | ecat_eoe_init_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_eoe_init);
1008 |
1009 | proto_tree_add_item(ecat_eoe_init_tree, hf_ecat_mailbox_eoe_init_contains_macaddr, tvb, offset, 4, ENC_LITTLE_ENDIAN0x80000000);
1010 | proto_tree_add_item(ecat_eoe_init_tree, hf_ecat_mailbox_eoe_init_contains_ipaddr, tvb, offset, 4, ENC_LITTLE_ENDIAN0x80000000);
1011 | proto_tree_add_item(ecat_eoe_init_tree, hf_ecat_mailbox_eoe_init_contains_subnetmask, tvb, offset, 4, ENC_LITTLE_ENDIAN0x80000000);
1012 | proto_tree_add_item(ecat_eoe_init_tree, hf_ecat_mailbox_eoe_init_contains_defaultgateway, tvb, offset, 4, ENC_LITTLE_ENDIAN0x80000000);
1013 | proto_tree_add_item(ecat_eoe_init_tree, hf_ecat_mailbox_eoe_init_contains_dnsserver, tvb, offset, 4, ENC_LITTLE_ENDIAN0x80000000);
1014 | proto_tree_add_item(ecat_eoe_init_tree, hf_ecat_mailbox_eoe_init_contains_dnsname, tvb, offset, 4, ENC_LITTLE_ENDIAN0x80000000);
1015 | proto_tree_add_item(ecat_eoe_init_tree, hf_ecat_mailbox_eoe_init_append_timestamp, tvb, offset, 4, ENC_LITTLE_ENDIAN0x80000000);
1016 | offset+=4;
1017 |
1018 | proto_tree_add_item(ecat_eoe_init_tree, hf_ecat_mailbox_eoe_init_macaddr, tvb, offset, ETHERNET_ADDRESS_LEN((int) sizeof(ETHERNET_ADDRESS)), ENC_NA0x00000000);
1019 | offset+=ETHERNET_ADDRESS_LEN((int) sizeof(ETHERNET_ADDRESS));
1020 |
1021 | proto_tree_add_item(ecat_eoe_init_tree, hf_ecat_mailbox_eoe_init_ipaddr, tvb, offset, 4, ENC_LITTLE_ENDIAN0x80000000);
1022 | offset+=4;
1023 |
1024 | proto_tree_add_item(ecat_eoe_init_tree, hf_ecat_mailbox_eoe_init_subnetmask, tvb, offset, 4, ENC_LITTLE_ENDIAN0x80000000);
1025 | offset+=4;
1026 |
1027 | proto_tree_add_item(ecat_eoe_init_tree, hf_ecat_mailbox_eoe_init_defaultgateway, tvb, offset, 4, ENC_LITTLE_ENDIAN0x80000000);
1028 | offset+=4;
1029 |
1030 | proto_tree_add_item(ecat_eoe_init_tree, hf_ecat_mailbox_eoe_init_dnsserver, tvb, offset, 4, ENC_LITTLE_ENDIAN0x80000000);
1031 | offset+=4;
1032 |
1033 | proto_tree_add_item(ecat_eoe_init_tree, hf_ecat_mailbox_eoe_init_dnsname, tvb, offset, 32, ENC_ASCII0x00000000);
1034 | }
1035 | else
1036 | {
1037 | proto_item_append_text(anItem, " - Invalid length!");
1038 | expert_add_info(pinfo, anItem, &ei_ecat_mailbox_eoe_error);
1039 | }
1040 | break;
1041 |
1042 | case EOE_TYPE_MACFILTER_REQ4:
1043 | {
1044 | EoeMacFilterOptionsUnion options;
1045 | offset+=ETHERCAT_EOE_HEADER_LEN((int) sizeof(ETHERCAT_EOE_HEADER));
1046 | anItem = proto_tree_add_item(ecat_fraghead_tree, hf_ecat_mailbox_eoe_macfilter, tvb, offset, MIN(eoe_length-offset, ETHERCAT_EOE_MACFILTER_LEN)(((eoe_length-offset) < (((int) sizeof(ETHERCAT_EOE_MACFILTER )))) ? (eoe_length-offset) : (((int) sizeof(ETHERCAT_EOE_MACFILTER )))), ENC_NA0x00000000);
1047 | if( eoe_length-offset >= ETHERCAT_EOE_MACFILTER_LEN((int) sizeof(ETHERCAT_EOE_MACFILTER)) )
1048 | {
1049 | proto_tree *ecat_eoe_macfilter_filtermask_tree;
1050 |
1051 | ecat_eoe_macfilter_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_eoe_macfilter);
1052 |
1053 | /* XXX: Is the field containing EoeMacFilterOptionsUnion 4 bytes or 2 bytes ? */
1054 | /* sizeof EoeMacFilterOptionsUnion = 2 bytes but the code below */
1055 | /* originally used a field width of 4 bytes. */
1056 | /* Given the size of the union, the code below was changed to */
1057 | /* use a field width of 2 bytes. */
1058 | /* The hf[] entries were also changed to match the union struct */
1059 | proto_tree_add_item(ecat_eoe_macfilter_tree, hf_ecat_mailbox_eoe_macfilter_macfiltercount, tvb, offset, /*4*/ 2, ENC_LITTLE_ENDIAN0x80000000);
1060 | proto_tree_add_item(ecat_eoe_macfilter_tree, hf_ecat_mailbox_eoe_macfilter_maskcount, tvb, offset, /*4*/ 2, ENC_LITTLE_ENDIAN0x80000000);
1061 | proto_tree_add_item(ecat_eoe_macfilter_tree, hf_ecat_mailbox_eoe_macfilter_nobroadcasts, tvb, offset, /*4*/ 2, ENC_LITTLE_ENDIAN0x80000000);
1062 | options.Options = tvb_get_letohs(tvb, offset);
1063 | offset+=/*4*/ 2;
1064 |
1065 | anItem = proto_tree_add_item(ecat_eoe_macfilter_tree, hf_ecat_mailbox_eoe_macfilter_filter, tvb, offset, 16*ETHERNET_ADDRESS_LEN((int) sizeof(ETHERNET_ADDRESS)), ENC_NA0x00000000);
1066 | ecat_eoe_macfilter_filter_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_eoe_macfilter_filter);
1067 | for( nCnt=0; nCnt<options.v.MacFilterCount; nCnt++)
1068 | proto_tree_add_item(ecat_eoe_macfilter_filter_tree, hf_ecat_mailbox_eoe_macfilter_filters[nCnt], tvb, offset+nCnt*ETHERNET_ADDRESS_LEN((int) sizeof(ETHERNET_ADDRESS)), ETHERNET_ADDRESS_LEN((int) sizeof(ETHERNET_ADDRESS)), ENC_NA0x00000000);
1069 | offset+=16*ETHERNET_ADDRESS_LEN((int) sizeof(ETHERNET_ADDRESS));
1070 |
1071 | anItem = proto_tree_add_item(ecat_eoe_macfilter_tree, hf_ecat_mailbox_eoe_macfilter_filtermask, tvb, offset, 4*4, ENC_NA0x00000000);
1072 | ecat_eoe_macfilter_filtermask_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_eoe_macfilter_filtermask);
1073 | for( nCnt=0; nCnt<options.v.MacFilterMaskCount; nCnt++)
1074 | proto_tree_add_item(ecat_eoe_macfilter_filtermask_tree, hf_ecat_mailbox_eoe_macfilter_filtermasks[nCnt], tvb, offset+nCnt*4, 4, ENC_NA0x00000000);
1075 | }
1076 | else
1077 | {
1078 | proto_item_append_text(anItem, " - Invalid length!");
1079 | expert_add_info(pinfo, anItem, &ei_ecat_mailbox_eoe_error);
1080 | }
1081 | }
1082 | break;
1083 |
1084 | case EOE_TYPE_INIT_RES3:
1085 | case EOE_TYPE_MACFILTER_RES5:
1086 | break;
1087 | }
1088 | }
1089 |
1090 | col_prepend_fstr(pinfo->cinfo, COL_INFO, "EoE(");
1091 |
1092 | col_prepend_fstr(pinfo->cinfo, COL_PROTOCOL, "EoE-");
1093 | }
1094 | else
1095 | {
1096 | expert_add_info(pinfo, tree, &ei_ecat_mailbox_eoe_error);
1097 | col_append_str(pinfo->cinfo, COL_INFO, "EoE - invalid length!");
1098 | }
1099 | }
1100 |
1101 | static void dissect_ecat_foe(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
1102 | {
1103 | proto_tree *ecat_foe_tree,*ecat_foe_efw_tree;
1104 |
1105 | proto_item *anItem= NULL((void*)0),*aparent = NULL((void*)0);
1106 | char szText[200];
1107 | int nMax = sizeof(szText)-1;
1108 |
1109 | unsigned foe_length = tvb_reported_length(tvb)-offset;
1110 |
1111 | if( tree )
1112 | {
1113 | anItem = proto_tree_add_bytes_format(tree, hf_ecat_mailbox_foe, tvb, offset, foe_length, NULL((void*)0), "Foe");
1114 |
1115 | aparent = proto_item_get_parent(anItem);
1116 | proto_item_append_text(aparent,": FoE");
1117 | }
1118 |
1119 | if( foe_length >= ETHERCAT_FOE_HEADER_LEN6 )
1120 | {
1121 | FoeFormatter(tvb, pinfo->pool, offset, szText, nMax, foe_length);
1122 | col_append_str(pinfo->cinfo, COL_INFO, szText);
1123 |
1124 | if( tree )
1125 | {
1126 | ETHERCAT_FOE_HEADER foe;
1127 | init_foe_header(&foe, tvb, offset);
1128 |
1129 | ecat_foe_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_foe);
1130 | proto_tree_add_item(ecat_foe_tree, hf_ecat_mailbox_foe_opmode, tvb, offset++, 1, ENC_LITTLE_ENDIAN0x80000000);
1131 | offset++; /*Reserved1;*/
1132 |
1133 | switch (foe.OpMode)
1134 | {
1135 | case ECAT_FOE_OPMODE_RRQ1:
1136 | case ECAT_FOE_OPMODE_WRQ2:
1137 | proto_tree_add_item(ecat_foe_tree, hf_ecat_mailbox_foe_filelength, tvb, offset, 4, ENC_LITTLE_ENDIAN0x80000000);
1138 | offset+=4;
1139 |
1140 | proto_tree_add_item(ecat_foe_tree, hf_ecat_mailbox_foe_filename, tvb, offset, foe_length-offset, ENC_ASCII0x00000000);
1141 | break;
1142 |
1143 | case ECAT_FOE_OPMODE_DATA3:
1144 | {
1145 | proto_tree_add_item(ecat_foe_tree, hf_ecat_mailbox_foe_packetno, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
1146 | offset+=4; /*+2 for Reserved2*/
1147 |
1148 | if( foe_length-offset >= sizeof(TEFWUPDATE_HEADER) )
1149 | {
1150 | anItem = proto_tree_add_item(ecat_foe_tree, hf_ecat_mailbox_foe_efw, tvb, offset, foe_length-offset, ENC_NA0x00000000);
1151 | ecat_foe_efw_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_foe_efw);
1152 | proto_tree_add_item(ecat_foe_efw_tree, hf_ecat_mailbox_foe_efw_cmd, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
1153 | offset+=2;
1154 |
1155 | proto_tree_add_item(ecat_foe_efw_tree, hf_ecat_mailbox_foe_efw_size, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
1156 | offset+=2;
1157 |
1158 | proto_tree_add_item(ecat_foe_efw_tree, hf_ecat_mailbox_foe_efw_addresslw, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
1159 | offset+=2;
1160 |
1161 | proto_tree_add_item(ecat_foe_efw_tree, hf_ecat_mailbox_foe_efw_addresshw, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
1162 | offset+=2;
1163 |
1164 | proto_tree_add_item(ecat_foe_efw_tree, hf_ecat_mailbox_foe_efw_data, tvb, offset, foe_length-offset, ENC_NA0x00000000);
1165 | }
1166 | else
1167 | {
1168 | proto_tree_add_item(ecat_foe_tree, hf_ecat_mailbox_foe_data, tvb, offset, foe_length-offset, ENC_NA0x00000000);
1169 | }
1170 | }
1171 | break;
1172 |
1173 | case ECAT_FOE_OPMODE_ACK4:
1174 | proto_tree_add_item(ecat_foe_tree, hf_ecat_mailbox_foe_packetno, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
1175 | break;
1176 |
1177 | case ECAT_FOE_OPMODE_ERR5:
1178 | proto_tree_add_item(ecat_foe_tree, hf_ecat_mailbox_foe_errcode, tvb, offset, 4, ENC_LITTLE_ENDIAN0x80000000);
1179 | offset+=4;
1180 |
1181 | proto_tree_add_item(ecat_foe_tree, hf_ecat_mailbox_foe_errtext, tvb, offset, foe_length-offset, ENC_ASCII0x00000000);
1182 | break;
1183 |
1184 | case ECAT_FOE_OPMODE_BUSY6:
1185 | proto_tree_add_item(ecat_foe_tree, hf_ecat_mailbox_foe_busydone, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
1186 | offset+=2;
1187 |
1188 | proto_tree_add_item(ecat_foe_tree, hf_ecat_mailbox_foe_busyentire, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
1189 | break;
1190 | }
1191 | }
1192 | }
1193 | else
1194 | {
1195 | col_append_str(pinfo->cinfo, COL_INFO, "FoE - invalid length");
1196 | expert_add_info(pinfo, tree, &ei_ecat_mailbox_foe_error);
1197 | }
1198 | }
1199 |
1200 | static void dissect_ecat_voe(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
1201 | {
1202 | proto_tree *ecat_voe_tree;
1203 | proto_item *anItem = NULL((void*)0) ,*aparent = NULL((void*)0);
1204 | char szText[100];
1205 | int nMax = sizeof(szText)-1;
1206 |
1207 | unsigned voe_length = tvb_reported_length(tvb)-offset;
1208 |
1209 | if( tree )
1210 | {
1211 | anItem = proto_tree_add_bytes_format(tree, hf_ecat_mailbox_voe, tvb, offset, voe_length, NULL((void*)0), "Voe");
1212 |
1213 | aparent = proto_item_get_parent(anItem);
1214 | proto_item_append_text(aparent,": VoE");
1215 | }
1216 |
1217 | if( voe_length >= ETHERCAT_VOE_HEADER_LEN6 )
1218 | {
1219 | VoeFormatter(tvb, offset, szText, nMax, voe_length);
1220 | col_append_str(pinfo->cinfo, COL_INFO, szText);
1221 | if( tree )
1222 | {
1223 | ecat_voe_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox_voe);
1224 | proto_tree_add_item(ecat_voe_tree, hf_ecat_mailbox_voe_vendor_id, tvb, offset, 4, ENC_LITTLE_ENDIAN0x80000000);
1225 | offset+=4;
1226 | proto_tree_add_item(ecat_voe_tree, hf_ecat_mailbox_voe_vendor_type, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
1227 | offset+=2;
1228 | proto_tree_add_item(ecat_voe_tree, hf_ecat_mailbox_voe_data, tvb, offset, voe_length-offset, ENC_NA0x00000000);
1229 | }
1230 | }
1231 | else
1232 | {
1233 | col_append_str(pinfo->cinfo, COL_INFO, "VoE - invalid length");
1234 | expert_add_info(pinfo, tree, &ei_ecat_mailbox_voe_error);
1235 | }
1236 | }
1237 |
1238 | static int dissect_ecat_mailbox(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U___attribute__((unused)))
1239 | {
1240 | proto_tree *ecat_mailbox_tree = NULL((void*)0);
1241 | proto_tree *ecat_mailbox_header_tree = NULL((void*)0);
1242 | tvbuff_t *next_tvb;
1243 | proto_item *anItem;
1244 | int offset = 0;
1245 |
1246 | int mailbox_length = tvb_reported_length(tvb);
1247 |
1248 | if( mailbox_length >= ETHERCAT_MBOX_HEADER_LEN((int) sizeof(ETHERCAT_MBOX_HEADER)) )
1249 | {
1250 | ETHERCAT_MBOX_HEADER hdr;
1251 |
1252 | init_mbx_header(&hdr, tvb, offset);
1253 |
1254 | col_append_str(pinfo->cinfo, COL_INFO, " Mbx(");
1255 |
1256 | /* Create the mailbox sub tree */
1257 | anItem = proto_tree_add_item(tree, proto_ecat_mailbox, tvb, 0, ETHERCAT_MBOX_HEADER_LEN((int) sizeof(ETHERCAT_MBOX_HEADER))+hdr.Length, ENC_NA0x00000000);
1258 | ecat_mailbox_tree = proto_item_add_subtree(anItem, ett_ecat_mailbox);
1259 |
1260 | /* Create a mailbox header subtree */
1261 | ecat_mailbox_header_tree = proto_tree_add_subtree(ecat_mailbox_tree, tvb, offset, ETHERCAT_MBOX_HEADER_LEN((int) sizeof(ETHERCAT_MBOX_HEADER)), ett_ecat_mailbox_header, NULL((void*)0), "Header");
1262 |
1263 | /* Add length information to the mailbox header */
1264 | proto_tree_add_item(ecat_mailbox_header_tree, hf_ecat_mailboxlength, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
1265 | offset+=2;
1266 |
1267 | /* Add address information to the mailbox header */
1268 | proto_tree_add_item(ecat_mailbox_header_tree, hf_ecat_mailboxaddress, tvb, offset, 2, ENC_LITTLE_ENDIAN0x80000000);
1269 | offset+=2;
1270 |
1271 | /* Add priority information to the mailbox header */
1272 | proto_tree_add_item(ecat_mailbox_header_tree, hf_ecat_mailboxpriority, tvb, offset, 1, ENC_LITTLE_ENDIAN0x80000000);
1273 | offset+=1;
1274 |
1275 | /* Add type information to the mailbox header */
1276 | proto_tree_add_uint(ecat_mailbox_header_tree, hf_ecat_mailboxtype, tvb, offset, 1, hdr.aControlUnion.v.Type);
1277 |
1278 | /* Add counter information to the mailbox header */
1279 | proto_tree_add_uint(ecat_mailbox_header_tree, hf_ecat_mailboxcounter, tvb, offset, 1, hdr.aControlUnion.v.Counter);
1280 | offset++;
1281 |
1282 | if( mailbox_length >= ETHERCAT_MBOX_HEADER_LEN((int) sizeof(ETHERCAT_MBOX_HEADER)) + hdr.Length )
1283 | {
1284 | next_tvb = tvb_new_subset_length (tvb, offset, hdr.Length);
1285 | switch ( hdr.aControlUnion.v.Type )
1286 | {
1287 | case ETHERCAT_MBOX_TYPE_ADS1:
1288 | call_dissector(ams_handle, next_tvb, pinfo, ecat_mailbox_tree);
1289 | break;
1290 |
1291 | case ETHERCAT_MBOX_TYPE_EOE2:
1292 | dissect_ecat_eoe(next_tvb, 0, pinfo, ecat_mailbox_tree);
1293 | break;
1294 |
1295 | case ETHERCAT_MBOX_TYPE_COE3:
1296 | dissect_ecat_coe(next_tvb, 0, pinfo, ecat_mailbox_tree);
1297 | break;
1298 |
1299 | case ETHERCAT_MBOX_TYPE_FOE4:
1300 | dissect_ecat_foe(next_tvb, 0, pinfo, ecat_mailbox_tree);
1301 | break;
1302 |
1303 | case ETHERCAT_MBOX_TYPE_SOE5:
1304 | dissect_ecat_soe(next_tvb, 0, pinfo, ecat_mailbox_tree);
1305 | break;
1306 |
1307 | case ETHERCAT_MBOX_TYPE_VOE15:
1308 | dissect_ecat_voe(next_tvb, 0, pinfo, ecat_mailbox_tree);
1309 | break;
1310 |
1311 | default:
1312 | proto_tree_add_item(ecat_mailbox_tree, hf_ecat_mailboxdata, tvb, offset, hdr.Length, ENC_NA0x00000000);
1313 | }
1314 | }
1315 | else
1316 | {
1317 | anItem =proto_tree_add_item(ecat_mailbox_tree, hf_ecat_mailboxdata, tvb, offset, mailbox_length-ETHERCAT_MBOX_HEADER_LEN((int) sizeof(ETHERCAT_MBOX_HEADER)), ENC_NA0x00000000);
1318 | expert_add_info_format(pinfo, anItem, &ei_ecat_mailbox_error,"Incorrect Mailbox data length(Expected:%d Actual:%d)", hdr.Length, mailbox_length-ETHERCAT_MBOX_HEADER_LEN((int) sizeof(ETHERCAT_MBOX_HEADER)));
1319 | }
1320 | col_append_str(pinfo->cinfo, COL_INFO, ")");
1321 | }
1322 | return tvb_captured_length(tvb);
1323 | }
1324 |
1325 | void proto_register_ecat_mailbox(void)
1326 | {
1327 | static const true_false_string flags_set_truth =
1328 | {
1329 | "Set",
1330 | "Not set"
1331 | };
1332 |
1333 | static hf_register_info hf[] =
1334 | {
1335 | { &hf_ecat_mailboxlength,
1336 | { "Length", "ecat_mailbox.length",
1337 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0,
1338 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1339 | },
1340 | { &hf_ecat_mailboxaddress,
1341 | { "Address", "ecat_mailbox.address",
1342 | FT_UINT16, BASE_HEX, NULL((void*)0), 0x0,
1343 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1344 | },
1345 | { &hf_ecat_mailboxpriority,
1346 | { "Priority", "ecat_mailbox.priority",
1347 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x03,
1348 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1349 | },
1350 | { &hf_ecat_mailboxtype,
1351 | { "Type", "ecat_mailbox.type",
1352 | FT_UINT8, BASE_DEC, VALS(EcMBoxType)((0 ? (const struct _value_string*)0 : ((EcMBoxType)))), 0x0,
1353 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1354 | },
1355 | { &hf_ecat_mailboxcounter,
1356 | { "Counter", "ecat_mailbox.counter",
1357 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x0,
1358 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1359 | },
1360 | { &hf_ecat_mailbox_eoe,
1361 | { "EoE Fragment", "ecat_mailbox.eoe",
1362 | FT_BYTES, BASE_NONE, NULL((void*)0), 0x0,
1363 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1364 | },
1365 | { &hf_ecat_mailbox_eoe_fraghead,
1366 | { "Header", "ecat_mailbox.eoe.fraghead",
1367 | FT_BYTES, BASE_NONE, NULL((void*)0), 0x0,
1368 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1369 | },
1370 | { &hf_ecat_mailbox_eoe_type,
1371 | { "Type", "ecat_mailbox.eoe.type",
1372 | FT_UINT32, BASE_DEC, VALS(EoEType)((0 ? (const struct _value_string*)0 : ((EoEType)))), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1373 | },
1374 | { &hf_ecat_mailbox_eoe_fragno,
1375 | { "FragNo", "ecat_mailbox.eoe.fragno",
1376 | FT_UINT32, BASE_DEC, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1377 | },
1378 | { &hf_ecat_mailbox_eoe_offset,
1379 | { "Offset", "ecat_mailbox.eoe.offset",
1380 | FT_UINT32, BASE_DEC, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0)}
1381 | },
1382 | { &hf_ecat_mailbox_eoe_frame,
1383 | { "FrameNo", "ecat_mailbox.eoe.frame",
1384 | FT_UINT32, BASE_DEC, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1385 | },
1386 | { &hf_ecat_mailbox_eoe_last,
1387 | { "Last Fragment", "ecat_mailbox.eoe.last",
1388 | FT_UINT32, BASE_DEC, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1389 | },
1390 | { &hf_ecat_mailbox_eoe_timestampapp,
1391 | { "Time Stamp Appended", "ecat_mailbox.eoe.timestampapp",
1392 | FT_UINT32, BASE_DEC, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1393 | },
1394 | { &hf_ecat_mailbox_eoe_timestampreq,
1395 | { "Time Stamp Requested", "ecat_mailbox.eoe.timestampreq",
1396 | FT_UINT32, BASE_DEC, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1397 | },
1398 | { &hf_ecat_mailbox_eoe_fragment,
1399 | { "EoE Frag Data", "ecat_mailbox.eoe.fragment",
1400 | FT_BYTES, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1401 | },
1402 | { &hf_ecat_mailbox_eoe_init,
1403 | { "Init", "ecat_mailbox.eoe.init",
1404 | FT_NONE, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1405 | },
1406 | { &hf_ecat_mailbox_eoe_init_contains_macaddr,
1407 | { "MacAddr", "ecat_mailbox.eoe.init.contains_macaddr",
1408 | FT_BOOLEAN, 32, TFS(&flags_set_truth)((0 ? (const struct true_false_string*)0 : ((&flags_set_truth )))), 0x00000001, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1409 | },
1410 | { &hf_ecat_mailbox_eoe_init_contains_ipaddr,
1411 | { "IpAddr", "ecat_mailbox.eoe.init.contains_ipaddr",
1412 | FT_BOOLEAN, 32, TFS(&flags_set_truth)((0 ? (const struct true_false_string*)0 : ((&flags_set_truth )))), 0x00000002, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1413 | },
1414 | { &hf_ecat_mailbox_eoe_init_contains_subnetmask,
1415 | { "SubnetMask", "ecat_mailbox.eoe.init.contains_subnetmask",
1416 | FT_BOOLEAN, 32, TFS(&flags_set_truth)((0 ? (const struct true_false_string*)0 : ((&flags_set_truth )))), 0x00000004, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1417 | },
1418 | { &hf_ecat_mailbox_eoe_init_contains_defaultgateway,
1419 | { "DefaultGateway", "ecat_mailbox.eoe.init.contains_defaultgateway",
1420 | FT_BOOLEAN, 32, TFS(&flags_set_truth)((0 ? (const struct true_false_string*)0 : ((&flags_set_truth )))), 0x00000008, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1421 | },
1422 | { &hf_ecat_mailbox_eoe_init_contains_dnsserver,
1423 | { "DnsServer", "ecat_mailbox.eoe.init.contains_dnsserver",
1424 | FT_BOOLEAN, 32, TFS(&flags_set_truth)((0 ? (const struct true_false_string*)0 : ((&flags_set_truth )))), 0x00000010, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1425 | },
1426 | { &hf_ecat_mailbox_eoe_init_contains_dnsname,
1427 | { "DnsName", "ecat_mailbox.eoe.init.contains_dnsname",
1428 | FT_BOOLEAN, 32, TFS(&flags_set_truth)((0 ? (const struct true_false_string*)0 : ((&flags_set_truth )))), 0x00000020, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1429 | },
1430 | { &hf_ecat_mailbox_eoe_init_append_timestamp,
1431 | { "AppendTimeStamp", "ecat_mailbox.eoe.init.append_timestamp",
1432 | FT_BOOLEAN, 32, TFS(&flags_set_truth)((0 ? (const struct true_false_string*)0 : ((&flags_set_truth )))), 0x00010000, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1433 | },
1434 | { &hf_ecat_mailbox_eoe_init_macaddr,
1435 | { "Mac Addr", "ecat_mailbox.eoe.init.macaddr",
1436 | FT_ETHER, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1437 | },
1438 | { &hf_ecat_mailbox_eoe_init_ipaddr,
1439 | { "Ip Addr", "ecat_mailbox.eoe.init.ipaddr",
1440 | FT_IPv4, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1441 | },
1442 | { &hf_ecat_mailbox_eoe_init_subnetmask,
1443 | { "Subnet Mask", "ecat_mailbox.eoe.init.subnetmask",
1444 | FT_IPv4, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1445 | },
1446 | { &hf_ecat_mailbox_eoe_init_defaultgateway,
1447 | { "Default Gateway", "ecat_mailbox.eoe.init.defaultgateway",
1448 | FT_IPv4, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1449 | },
1450 | { &hf_ecat_mailbox_eoe_init_dnsserver,
1451 | { "Dns Server", "ecat_mailbox.eoe.init.dnsserver",
1452 | FT_IPv4, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1453 | },
1454 | { &hf_ecat_mailbox_eoe_init_dnsname,
1455 | { "Dns Name", "ecat_mailbox.eoe.init.dnsname",
1456 | FT_STRING, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1457 | },
1458 | { &hf_ecat_mailbox_eoe_macfilter,
1459 | { "Mac Filter", "ecat_mailbox.eoe.macfilter",
1460 | FT_BYTES, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1461 | },
1462 |
1463 | /* XXX: The following 3 fields may not be specified correctly */
1464 | /* See related comment above */
1465 | { &hf_ecat_mailbox_eoe_macfilter_macfiltercount,
1466 | { "Mac Filter Count", "ecat_mailbox.eoe.macfilter.macfiltercount",
1467 | FT_UINT16, BASE_DEC, NULL((void*)0), 0xF000, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1468 | },
1469 | { &hf_ecat_mailbox_eoe_macfilter_maskcount,
1470 | { "Mac Filter Mask Count", "ecat_mailbox.eoe.macfilter.maskcount",
1471 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0C00, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1472 | },
1473 | { &hf_ecat_mailbox_eoe_macfilter_nobroadcasts,
1474 | { "No Broadcasts", "ecat_mailbox.eoe.macfilter.nobroadcasts",
1475 | FT_BOOLEAN, 16, TFS(&flags_set_truth)((0 ? (const struct true_false_string*)0 : ((&flags_set_truth )))), 0x0100, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1476 | },
1477 | /* ... */
1478 |
1479 | { &hf_ecat_mailbox_eoe_macfilter_filter,
1480 | { "Filter", "ecat_mailbox.eoe.macfilter.filter",
1481 | FT_BYTES, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1482 | },
1483 | { &hf_ecat_mailbox_eoe_macfilter_filters[0],
1484 | { "Filter 0", "ecat_mailbox.eoe.macfilter.filter0",
1485 | FT_ETHER, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1486 | },
1487 | { &hf_ecat_mailbox_eoe_macfilter_filters[1],
1488 | { "Filter 1", "ecat_mailbox.eoe.macfilter.filter1",
1489 | FT_ETHER, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1490 | },
1491 | { &hf_ecat_mailbox_eoe_macfilter_filters[2],
1492 | { "Filter 2", "ecat_mailbox.eoe.macfilter.filter2",
1493 | FT_ETHER, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1494 | },
1495 | { &hf_ecat_mailbox_eoe_macfilter_filters[3],
1496 | { "Filter 3", "ecat_mailbox.eoe.macfilter.filter3",
1497 | FT_ETHER, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1498 | },
1499 | { &hf_ecat_mailbox_eoe_macfilter_filters[4],
1500 | { "Filter 4", "ecat_mailbox.eoe.macfilter.filter4",
1501 | FT_ETHER, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1502 | },
1503 | { &hf_ecat_mailbox_eoe_macfilter_filters[5],
1504 | { "Filter 5", "ecat_mailbox.eoe.macfilter.filter5",
1505 | FT_ETHER, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1506 | },
1507 | { &hf_ecat_mailbox_eoe_macfilter_filters[6],
1508 | { "Filter 6", "ecat_mailbox.eoe.macfilter.filter6",
1509 | FT_ETHER, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1510 | },
1511 | { &hf_ecat_mailbox_eoe_macfilter_filters[7],
1512 | { "Filter 7", "ecat_mailbox.eoe.macfilter.filter7",
1513 | FT_ETHER, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1514 | },
1515 | { &hf_ecat_mailbox_eoe_macfilter_filters[8],
1516 | { "Filter 8", "ecat_mailbox.eoe.macfilter.filter8",
1517 | FT_ETHER, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1518 | },
1519 | { &hf_ecat_mailbox_eoe_macfilter_filters[9],
1520 | { "Filter 9", "ecat_mailbox.eoe.macfilter.filter9",
1521 | FT_ETHER, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1522 | },
1523 | { &hf_ecat_mailbox_eoe_macfilter_filters[10],
1524 | { "Filter 10", "ecat_mailbox.eoe.macfilter.filter10",
1525 | FT_ETHER, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1526 | },
1527 | { &hf_ecat_mailbox_eoe_macfilter_filters[11],
1528 | { "Filter 11", "ecat_mailbox.eoe.macfilter.filter11",
1529 | FT_ETHER, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1530 | },
1531 | { &hf_ecat_mailbox_eoe_macfilter_filters[12],
1532 | { "Filter 12", "ecat_mailbox.eoe.macfilter.filter12",
1533 | FT_ETHER, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1534 | },
1535 | { &hf_ecat_mailbox_eoe_macfilter_filters[13],
1536 | { "Filter 13", "ecat_mailbox.eoe.macfilter.filter13",
1537 | FT_ETHER, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1538 | },
1539 | { &hf_ecat_mailbox_eoe_macfilter_filters[14],
1540 | { "Filter 14", "ecat_mailbox.eoe.macfilter.filter14",
1541 | FT_ETHER, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1542 | },
1543 | { &hf_ecat_mailbox_eoe_macfilter_filters[15],
1544 | { "Filter 15", "ecat_mailbox.eoe.macfilter.filter15",
1545 | FT_ETHER, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1546 | },
1547 | { &hf_ecat_mailbox_eoe_macfilter_filtermask,
1548 | { "Filter Mask", "ecat_mailbox.eoe.macfilter.filtermask",
1549 | FT_BYTES, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1550 | },
1551 | { &hf_ecat_mailbox_eoe_macfilter_filtermasks[0],
1552 | { "Mask 0", "ecat_mailbox.eoe.macfilter.filtermask0",
1553 | FT_ETHER, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1554 | },
1555 | { &hf_ecat_mailbox_eoe_macfilter_filtermasks[1],
1556 | { "Mask 1", "ecat_mailbox.eoe.macfilter.filtermask1",
1557 | FT_ETHER, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1558 | },
1559 | { &hf_ecat_mailbox_eoe_macfilter_filtermasks[2],
1560 | { "Mask 2", "ecat_mailbox.eoe.macfilter.filtermask2",
1561 | FT_ETHER, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1562 | },
1563 | { &hf_ecat_mailbox_eoe_macfilter_filtermasks[3],
1564 | { "Mask 3", "ecat_mailbox.eoe.macfilter.filtermask3",
1565 | FT_ETHER, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1566 | },
1567 | { &hf_ecat_mailbox_eoe_timestamp,
1568 | { "Time Stamp", "ecat_mailbox.eoe.timestamp",
1569 | FT_UINT32, BASE_DEC, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1570 | },
1571 | { &hf_ecat_mailbox_coe,
1572 | { "CoE", "ecat_mailbox.coe",
1573 | FT_BYTES, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1574 | },
1575 | { &hf_ecat_mailbox_coe_number,
1576 | { "Number", "ecat_mailbox.coe.number",
1577 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1578 | },
1579 | { &hf_ecat_mailbox_coe_type,
1580 | { "Type", "ecat_mailbox.coe.type",
1581 | FT_UINT16, BASE_DEC, VALS(CANopenType)((0 ? (const struct _value_string*)0 : ((CANopenType)))), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1582 | },
1583 | { &hf_ecat_mailbox_coe_sdoreq,
1584 | { "SDO Req", "ecat_mailbox.coe.sdoreq",
1585 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1586 | },
1587 | { &hf_ecat_mailbox_coe_sdoccsid,
1588 | { "Initiate Download", "ecat_mailbox.coe.sdoccsid",
1589 | FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1590 | },
1591 | { &hf_ecat_mailbox_coe_sdoccsid_sizeind,
1592 | { "Size Ind.", "ecat_mailbox.coe.sdoccsid.sizeind",
1593 | FT_BOOLEAN, 8, TFS(&flags_set_truth)((0 ? (const struct true_false_string*)0 : ((&flags_set_truth )))), 0x01,
1594 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1595 | },
1596 | { &hf_ecat_mailbox_coe_sdoccsid_expedited,
1597 | { "Expedited", "ecat_mailbox.coe.sdoccsid.expedited",
1598 | FT_BOOLEAN, 8, TFS(&flags_set_truth)((0 ? (const struct true_false_string*)0 : ((&flags_set_truth )))), 0x02,
1599 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1600 | },
1601 | { &hf_ecat_mailbox_coe_sdoccsid_size0,
1602 | { "Bytes", "ecat_mailbox.coe.sdoccsid.size0",
1603 | FT_BOOLEAN, 8, TFS(&flags_set_truth)((0 ? (const struct true_false_string*)0 : ((&flags_set_truth )))), 0x04,
1604 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1605 | },
1606 | { &hf_ecat_mailbox_coe_sdoccsid_size1,
1607 | { "Bytes", "ecat_mailbox.coe.sdoccsid.size1",
1608 | FT_BOOLEAN, 8, TFS(&flags_set_truth)((0 ? (const struct true_false_string*)0 : ((&flags_set_truth )))), 0x08,
1609 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1610 | },
1611 | { &hf_ecat_mailbox_coe_sdoccsid_complete,
1612 | { "Access", "ecat_mailbox.coe.sdoccsid.complete",
1613 | FT_BOOLEAN, 8, TFS(&tfs_complete)((0 ? (const struct true_false_string*)0 : ((&tfs_complete )))), 0x10,
1614 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1615 | },
1616 | { &hf_ecat_mailbox_coe_sdoccsds,
1617 | { "Download Segment", "ecat_mailbox.coe.sdoccsds",
1618 | FT_UINT8, BASE_HEX, NULL((void*)0), 0x0,
1619 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1620 | },
1621 | { &hf_ecat_mailbox_coe_sdoccsds_lastseg,
1622 | { "Last Segment", "ecat_mailbox.coe.sdoccsds.lastseg",
1623 | FT_BOOLEAN, 8, TFS(&flags_set_truth)((0 ? (const struct true_false_string*)0 : ((&flags_set_truth )))), 0x01,
1624 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1625 | },
1626 | { &hf_ecat_mailbox_coe_sdoccsds_size,
1627 | { "Size", "ecat_mailbox.coe.sdoccsds.size",
1628 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x0E,
1629 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1630 | },
1631 | { &hf_ecat_mailbox_coe_sdoccsds_toggle,
1632 | { "Toggle Bit", "ecat_mailbox.coe.sdoccsds.toggle",
1633 | FT_BOOLEAN, 8, TFS(&flags_set_truth)((0 ? (const struct true_false_string*)0 : ((&flags_set_truth )))), 0x10,
1634 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1635 | },
1636 | { &hf_ecat_mailbox_coe_sdoccsiu,
1637 | { "Init Upload", "ecat_mailbox.coe.sdoccsiu",
1638 | FT_UINT8, BASE_HEX, NULL((void*)0), 0x0,
1639 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1640 | },
1641 | #if 0
1642 | { &hf_ecat_mailbox_coe_sdoccsiu_complete,
1643 | { "Toggle Bit", "ecat_mailbox.coe.sdoccsiu.complete",
1644 | FT_BOOLEAN, 8, TFS(&flags_set_truth)((0 ? (const struct true_false_string*)0 : ((&flags_set_truth )))), 0x10,
1645 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1646 | },
1647 | #endif
1648 | { &hf_ecat_mailbox_coe_sdoccsus,
1649 | { "Upload Segment", "ecat_mailbox.coe.sdoccsus",
1650 | FT_UINT8, BASE_HEX, NULL((void*)0), 0x0,
1651 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1652 | },
1653 | { &hf_ecat_mailbox_coe_sdoccsus_toggle,
1654 | { "Toggle Bit", "ecat_mailbox.coe.sdoccsus_toggle",
1655 | FT_BOOLEAN, 8, TFS(&flags_set_truth)((0 ? (const struct true_false_string*)0 : ((&flags_set_truth )))), 0x10,
1656 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1657 | },
1658 | { &hf_ecat_mailbox_coe_sdoidx,
1659 | { "Index", "ecat_mailbox.coe.sdoidx",
1660 | FT_UINT16, BASE_HEX, NULL((void*)0), 0x0,
1661 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1662 | },
1663 | { &hf_ecat_mailbox_coe_sdoabortcode,
1664 | { "Abort code", "ecat_mailbox.coe.abortcode",
1665 | FT_UINT32, BASE_HEX, NULL((void*)0), 0x0,
1666 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1667 | },
1668 | { &hf_ecat_mailbox_coe_sdosub,
1669 | { "SubIndex", "ecat_mailbox.coe.sdosub",
1670 | FT_UINT8, BASE_HEX, NULL((void*)0), 0x0,
1671 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1672 | },
1673 | { &hf_ecat_mailbox_coe_sdodata,
1674 | { "Data", "ecat_mailbox.coe.sdodata",
1675 | FT_UINT32, BASE_HEX, NULL((void*)0), 0x0,
1676 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1677 | },
1678 | { &hf_ecat_mailbox_coe_sdodata1,
1679 | { "Data", "ecat_mailbox.coe.sdodata",
1680 | FT_UINT8, BASE_HEX, NULL((void*)0), 0x0,
1681 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1682 | },
1683 | { &hf_ecat_mailbox_coe_sdodata2,
1684 | { "Data", "ecat_mailbox.coe.sdodata",
1685 | FT_UINT16, BASE_HEX, NULL((void*)0), 0x0,
1686 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1687 | },
1688 | { &hf_ecat_mailbox_coe_sdoldata,
1689 | { "Data", "ecat_mailbox.coe.dsoldata",
1690 | FT_BYTES, BASE_NONE, NULL((void*)0), 0x0,
1691 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1692 | },
1693 | { &hf_ecat_mailbox_coe_sdolength,
1694 | { "Length", "ecat_mailbox.coe.sdolength",
1695 | FT_UINT32, BASE_HEX, NULL((void*)0), 0x0,
1696 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1697 | },
1698 | #if 0
1699 | { &hf_ecat_mailbox_coe_sdoerror,
1700 | { "SDO Error", "ecat_mailbox.coe.sdoerror",
1701 | FT_UINT32, BASE_HEX, NULL((void*)0), 0x0,
1702 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1703 | },
1704 | #endif
1705 | { &hf_ecat_mailbox_coe_sdores,
1706 | { "SDO Res", "ecat_mailbox.coe.sdores",
1707 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x0,
1708 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1709 | },
1710 | { &hf_ecat_mailbox_coe_sdoscsiu,
1711 | { "Initiate Upload Response", "ecat_mailbox.coe.sdoscsiu",
1712 | FT_UINT8, BASE_HEX, NULL((void*)0), 0x0,
1713 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1714 | },
1715 | { &hf_ecat_mailbox_coe_sdoscsiu_sizeind,
1716 | { "Size Ind.", "ecat_mailbox.coe.sdoscsiu_sizeind",
1717 | FT_BOOLEAN, 8, TFS(&flags_set_truth)((0 ? (const struct true_false_string*)0 : ((&flags_set_truth )))), 0x01,
1718 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1719 | },
1720 | { &hf_ecat_mailbox_coe_sdoscsiu_expedited,
1721 | { "Expedited", "ecat_mailbox.coe.sdoscsiu_expedited",
1722 | FT_BOOLEAN, 8, TFS(&flags_set_truth)((0 ? (const struct true_false_string*)0 : ((&flags_set_truth )))), 0x02,
1723 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1724 | },
1725 | { &hf_ecat_mailbox_coe_sdoscsiu_size0,
1726 | { "Bytes", "ecat_mailbox.coe.sdoscsiu_size0",
1727 | FT_BOOLEAN, 8, TFS(&flags_set_truth)((0 ? (const struct true_false_string*)0 : ((&flags_set_truth )))), 0x04,
1728 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1729 | },
1730 | { &hf_ecat_mailbox_coe_sdoscsiu_size1,
1731 | { "Bytes", "ecat_mailbox.coe.sdoscsiu_size1",
1732 | FT_BOOLEAN, 8, TFS(&flags_set_truth)((0 ? (const struct true_false_string*)0 : ((&flags_set_truth )))), 0x08,
1733 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1734 | },
1735 | { &hf_ecat_mailbox_coe_sdoscsiu_complete,
1736 | { "Access", "ecat_mailbox.coe.sdoscsiu_complete",
1737 | FT_BOOLEAN, 8, TFS(&tfs_complete)((0 ? (const struct true_false_string*)0 : ((&tfs_complete )))), 0x10,
1738 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1739 | },
1740 | { &hf_ecat_mailbox_coe_sdoscsds,
1741 | { "Download Segment Response", "ecat_mailbox.coe.sdoscsds",
1742 | FT_UINT8, BASE_HEX, NULL((void*)0), 0x0,
1743 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1744 | },
1745 | { &hf_ecat_mailbox_coe_sdoscsds_toggle,
1746 | { "Toggle Bit", "ecat_mailbox.coe.sdoscsds_toggle",
1747 | FT_BOOLEAN, 8, TFS(&flags_set_truth)((0 ? (const struct true_false_string*)0 : ((&flags_set_truth )))), 0x10,
1748 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1749 | },
1750 | { &hf_ecat_mailbox_coe_sdoscsus,
1751 | { "Upload Segment", "ecat_mailbox.coe.sdoscsus",
1752 | FT_UINT8, BASE_HEX, NULL((void*)0), 0x0,
1753 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1754 | },
1755 | { &hf_ecat_mailbox_coe_sdoscsus_lastseg,
1756 | { "Last Segment", "ecat_mailbox.coe.sdoscsus_lastseg",
1757 | FT_BOOLEAN, 8, TFS(&flags_set_truth)((0 ? (const struct true_false_string*)0 : ((&flags_set_truth )))), 0x01,
1758 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1759 | },
1760 | { &hf_ecat_mailbox_coe_sdoscsus_bytes,
1761 | { "Bytes", "ecat_mailbox.coe.sdoscsus_bytes",
1762 | FT_UINT8, BASE_DEC, NULL((void*)0), 0x0E,
1763 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1764 | },
1765 | { &hf_ecat_mailbox_coe_sdoscsus_toggle,
1766 | { "Toggle Bit", "ecat_mailbox.coe.sdoscsus_toggle",
1767 | FT_BOOLEAN, 8, TFS(&flags_set_truth)((0 ? (const struct true_false_string*)0 : ((&flags_set_truth )))), 0x10,
1768 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1769 | },
1770 | { &hf_ecat_mailbox_coe_sdoinfoopcode,
1771 | { "Info OpCode", "ecat_mailbox.coe.sdoinfoopcode",
1772 | FT_UINT8, BASE_DEC, VALS(CANopenSdoInfo)((0 ? (const struct _value_string*)0 : ((CANopenSdoInfo)))), 0x0,
1773 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) },
1774 | },
1775 | { &hf_ecat_mailbox_coe_sdoinfofrag,
1776 | { "Info Frag Left", "ecat_mailbox.coe.sdoinfofrag",
1777 | FT_UINT16, BASE_HEX, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) },
1778 | },
1779 | { &hf_ecat_mailbox_coe_sdoinfolisttype,
1780 | { "Info List Type", "ecat_mailbox.coe.sdoinfolisttype",
1781 | FT_UINT16, BASE_HEX, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) },
1782 | },
1783 | { &hf_ecat_mailbox_coe_sdoinfolist,
1784 | { "Info List", "ecat_mailbox.coe.sdoinfolist",
1785 | FT_NONE, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) },
1786 | },
1787 | { &hf_ecat_mailbox_coe_sdoinfoindex,
1788 | { "Info Obj Index", "ecat_mailbox.coe.sdoinfoindex",
1789 | FT_UINT16, BASE_HEX, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) },
1790 | },
1791 | { &hf_ecat_mailbox_coe_sdoinfosubindex,
1792 | { "Info Obj SubIdx", "ecat_mailbox.coe.sdoinfosubindex",
1793 | FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) },
1794 | },
1795 | { &hf_ecat_mailbox_coe_sdoinfovalueinfo,
1796 | { "Info Obj ValueInfo", "ecat_mailbox.coe.sdoinfovalueinfo",
1797 | FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) },
1798 | },
1799 | { &hf_ecat_mailbox_coe_sdoinfoerrorcode,
1800 | { "Info Error Code", "ecat_mailbox.coe.sdoinfoerrorcode",
1801 | FT_UINT32, BASE_HEX, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) },
1802 | },
1803 | { &hf_ecat_mailbox_coe_sdoinfodatatype,
1804 | { "Info Data Type", "ecat_mailbox.coe.sdoinfodatatype",
1805 | FT_UINT16, BASE_HEX, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) },
1806 | },
1807 | { &hf_ecat_mailbox_coe_sdoinfomaxsub,
1808 | { "Info Max SubIdx", "ecat_mailbox.coe.sdoinfomaxsub",
1809 | FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) },
1810 | },
1811 | { &hf_ecat_mailbox_coe_sdoinfoobjcode,
1812 | { "Info Obj Code", "ecat_mailbox.coe.sdoinfoobjcode",
1813 | FT_UINT8, BASE_HEX, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) },
1814 | },
1815 | { &hf_ecat_mailbox_coe_sdoinfoname,
1816 | { "Info Name", "ecat_mailbox.coe.sdoinfoname",
1817 | FT_STRING, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) },
1818 | },
1819 | { &hf_ecat_mailbox_coe_sdoinfobitlen,
1820 | { "Info Bit Len", "ecat_mailbox.coe.sdoinfobitlen",
1821 | FT_UINT16, BASE_HEX, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) },
1822 | },
1823 | { &hf_ecat_mailbox_coe_sdoinfoobjaccess,
1824 | { "Info Obj Access", "ecat_mailbox.coe.sdoinfoobjaccess",
1825 | FT_UINT16, BASE_HEX, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) },
1826 | },
1827 | { &hf_ecat_mailbox_coe_sdoinfounittype,
1828 | { "Info Data Type", "ecat_mailbox.coe.sdoinfounittype",
1829 | FT_UINT16, BASE_HEX, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) },
1830 | },
1831 | { &hf_ecat_mailbox_coe_sdoinfodefaultvalue,
1832 | { "Info Default Val", "ecat_mailbox.coe.sdoinfodefaultvalue",
1833 | FT_NONE, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) },
1834 | },
1835 | { &hf_ecat_mailbox_coe_sdoinfominvalue,
1836 | { "Info Min Val", "ecat_mailbox.coe.sdoinfominvalue",
1837 | FT_NONE, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) },
1838 | },
1839 | { &hf_ecat_mailbox_coe_sdoinfomaxvalue,
1840 | { "Info Max Val", "ecat_mailbox.coe.sdoinfomaxvalue",
1841 | FT_NONE, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) },
1842 | },
1843 | { &hf_ecat_mailboxdata,
1844 | { "MB Data", "ecat_mailbox.data",
1845 | FT_NONE, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1846 | },
1847 | { &hf_ecat_mailbox_foe,
1848 | { "Foe", "ecat_mailbox.foe",
1849 | FT_BYTES, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1850 | },
1851 | { &hf_ecat_mailbox_foe_opmode,
1852 | { "Foe OpMode", "ecat_mailbox.foe_opmode",
1853 | FT_UINT8, BASE_HEX, VALS(FoEOpMode)((0 ? (const struct _value_string*)0 : ((FoEOpMode)))), 0x0, "Op modes", HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1854 | },
1855 | { &hf_ecat_mailbox_foe_filelength,
1856 | { "Foe FileLength", "ecat_mailbox.foe_filelength",
1857 | FT_UINT32, BASE_DEC, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1858 | },
1859 | { &hf_ecat_mailbox_foe_filename,
1860 | { "Foe FileName", "ecat_mailbox.foe_filename",
1861 | FT_STRING, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1862 | },
1863 | { &hf_ecat_mailbox_foe_packetno,
1864 | { "Foe PacketNo", "ecat_mailbox.foe_packetno",
1865 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1866 | },
1867 | { &hf_ecat_mailbox_foe_errcode,
1868 | { "Foe ErrorCode", "ecat_mailbox.foe_errcode",
1869 | FT_UINT32, BASE_DEC, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1870 | },
1871 | { &hf_ecat_mailbox_foe_errtext,
1872 | { "Foe ErrorString", "ecat_mailbox.foe_errtext",
1873 | FT_STRING, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1874 | },
1875 | { &hf_ecat_mailbox_foe_busydone,
1876 | { "Foe BusyDone", "ecat_mailbox.foe_busydone",
1877 | FT_UINT16, BASE_HEX, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1878 | },
1879 | { &hf_ecat_mailbox_foe_busyentire,
1880 | { "Foe BusyEntire", "ecat_mailbox.foe_busyentire",
1881 | FT_UINT16, BASE_HEX, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1882 | },
1883 | { &hf_ecat_mailbox_foe_data,
1884 | { "Foe Data", "ecat_mailbox.foe_busydata",
1885 | FT_BYTES, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1886 | },
1887 | { &hf_ecat_mailbox_foe_efw,
1888 | { "Firmware", "ecat_mailbox.foe.efw",
1889 | FT_BYTES, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1890 | },
1891 | { &hf_ecat_mailbox_foe_efw_cmd,
1892 | { "Cmd", "ecat_mailbox.foe.efw.cmd",
1893 | FT_UINT16, BASE_HEX, VALS(FoEEfwCmd)((0 ? (const struct _value_string*)0 : ((FoEEfwCmd)))), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1894 | },
1895 | { &hf_ecat_mailbox_foe_efw_size,
1896 | { "Size", "ecat_mailbox.foe.efw.size",
1897 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1898 | },
1899 | { &hf_ecat_mailbox_foe_efw_addresslw,
1900 | { "AddressLW", "ecat_mailbox.foe.efw.addresslw",
1901 | FT_UINT16, BASE_HEX, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1902 | },
1903 | { &hf_ecat_mailbox_foe_efw_addresshw,
1904 | { "AddressHW", "ecat_mailbox.foe.efw.addresshw",
1905 | FT_UINT16, BASE_HEX, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1906 | },
1907 | { &hf_ecat_mailbox_foe_efw_data,
1908 | { "Data", "ecat_mailbox.foe.efw.data",
1909 | FT_BYTES, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1910 | },
1911 | { &hf_ecat_mailbox_soe,
1912 | { "Soe", "ecat_mailbox.soe",
1913 | FT_BYTES, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1914 | },
1915 | { &hf_ecat_mailbox_soe_header,
1916 | { "Soe Header", "ecat_mailbox.soe_header",
1917 | FT_UINT16, BASE_HEX, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1918 | },
1919 | { &hf_ecat_mailbox_soe_header_opcode,
1920 | { "SoE OpCode", "ecat_mailbox.soe_opcode",
1921 | FT_UINT16, BASE_DEC, VALS(SoeOpcode)((0 ? (const struct _value_string*)0 : ((SoeOpcode)))), 0x0007, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1922 | },
1923 | { &hf_ecat_mailbox_soe_header_incomplete,
1924 | { "More Follows...", "ecat_mailbox.soe_header_incomplete",
1925 | FT_BOOLEAN, 16, TFS(&flags_set_truth)((0 ? (const struct true_false_string*)0 : ((&flags_set_truth )))), 0x0008, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1926 | },
1927 | { &hf_ecat_mailbox_soe_header_error,
1928 | { "Error", "ecat_mailbox.soe_header_error",
1929 | FT_BOOLEAN, 16, TFS(&flags_set_truth)((0 ? (const struct true_false_string*)0 : ((&flags_set_truth )))), 0x0010,
1930 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1931 | },
1932 | { &hf_ecat_mailbox_soe_header_driveno,
1933 | { "Drive No", "ecat_mailbox.soe_header_driveno",
1934 | FT_UINT16, BASE_DEC, NULL((void*)0), 0x00e0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1935 | },
1936 | { &hf_ecat_mailbox_soe_header_datastate,
1937 | { "Datastate", "ecat_mailbox.soe_header_datastate",
1938 | FT_BOOLEAN, 16, TFS(&flags_set_truth)((0 ? (const struct true_false_string*)0 : ((&flags_set_truth )))), 0x0100,
1939 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1940 | },
1941 | { &hf_ecat_mailbox_soe_header_name,
1942 | { "Name", "ecat_mailbox.soe_header_name",
1943 | FT_BOOLEAN, 16, TFS(&flags_set_truth)((0 ? (const struct true_false_string*)0 : ((&flags_set_truth )))), 0x0200,
1944 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1945 | },
1946 | { &hf_ecat_mailbox_soe_header_attribute,
1947 | { "Attribute", "ecat_mailbox.soe_header_attribute",
1948 | FT_BOOLEAN, 16, TFS(&flags_set_truth)((0 ? (const struct true_false_string*)0 : ((&flags_set_truth )))), 0x0400,
1949 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1950 | },
1951 | { &hf_ecat_mailbox_soe_header_unit,
1952 | { "Unit", "ecat_mailbox.soe_header_unit",
1953 | FT_BOOLEAN, 16, TFS(&flags_set_truth)((0 ? (const struct true_false_string*)0 : ((&flags_set_truth )))), 0x0800,
1954 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1955 | },
1956 | { &hf_ecat_mailbox_soe_header_min,
1957 | { "Min", "ecat_mailbox.soe_header_min",
1958 | FT_BOOLEAN, 16, TFS(&flags_set_truth)((0 ? (const struct true_false_string*)0 : ((&flags_set_truth )))), 0x1000,
1959 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1960 | },
1961 | { &hf_ecat_mailbox_soe_header_max,
1962 | { "Max", "ecat_mailbox.soe_header_max",
1963 | FT_BOOLEAN, 16, TFS(&flags_set_truth)((0 ? (const struct true_false_string*)0 : ((&flags_set_truth )))), 0x2000,
1964 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1965 | },
1966 | { &hf_ecat_mailbox_soe_header_value,
1967 | { "Value", "ecat_mailbox.soe_header_value",
1968 | FT_BOOLEAN, 16, TFS(&flags_set_truth)((0 ? (const struct true_false_string*)0 : ((&flags_set_truth )))), 0x4000,
1969 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1970 | },
1971 | { &hf_ecat_mailbox_soe_header_reserved,
1972 | { "Reserved", "ecat_mailbox.soe_header_reserved",
1973 | FT_BOOLEAN, 16, TFS(&flags_set_truth)((0 ? (const struct true_false_string*)0 : ((&flags_set_truth )))), 0x8000,
1974 | NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1975 | },
1976 | { &hf_ecat_mailbox_soe_idn,
1977 | { "SoE IDN", "ecat_mailbox.soe_idn",
1978 | FT_UINT16, BASE_HEX, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1979 | },
1980 | { &hf_ecat_mailbox_soe_data,
1981 | { "SoE Data", "ecat_mailbox.soe_data",
1982 | FT_BYTES, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1983 | },
1984 | { &hf_ecat_mailbox_soe_frag,
1985 | { "SoE FragLeft", "ecat_mailbox.soe_frag",
1986 | FT_UINT16, BASE_HEX, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1987 | },
1988 | { &hf_ecat_mailbox_soe_error,
1989 | { "SoE Error", "ecat_mailbox.soe_error",
1990 | FT_UINT16, BASE_HEX, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1991 | },
1992 | { &hf_ecat_mailbox_voe,
1993 | { "Voe", "ecat_mailbox.voe",
1994 | FT_BYTES, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1995 | },
1996 | { &hf_ecat_mailbox_voe_vendor_id,
1997 | { "Voe VendorID", "ecat_mailbox.voe_vendor_id",
1998 | FT_UINT32, BASE_HEX, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
1999 | },
2000 | { &hf_ecat_mailbox_voe_vendor_type,
2001 | { "Voe Vendor Type", "ecat_mailbox.voe_vendor_type",
2002 | FT_UINT16, BASE_HEX, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
2003 | },
2004 | { &hf_ecat_mailbox_voe_data,
2005 | { "Voe Data", "ecat_mailbox.voe_data",
2006 | FT_BYTES, BASE_NONE, NULL((void*)0), 0x0, NULL((void*)0), HFILL-1, 0, HF_REF_TYPE_NONE, -1, ((void*)0) }
2007 | },
2008 | };
2009 |
2010 | static int *ett[] =
2011 | {
2012 | &ett_ecat_mailbox,
2013 | &ett_ecat_mailbox_eoe,
2014 | &ett_ecat_mailbox_eoe_init,
2015 | &ett_ecat_mailbox_eoe_macfilter,
2016 | &ett_ecat_mailbox_eoe_macfilter_filter,
2017 | &ett_ecat_mailbox_eoe_macfilter_filtermask,
2018 | &ett_ecat_mailbox_coe,
2019 | &ett_ecat_mailbox_sdo,
2020 | &ett_ecat_mailbox_coe_sdoccs,
2021 | &ett_ecat_mailbox_coe_sdoscs,
2022 | &ett_ecat_mailbox_foe,
2023 | &ett_ecat_mailbox_foe_efw,
2024 | &ett_ecat_mailbox_soeflag,
2025 | &ett_ecat_mailbox_soe,
2026 | &ett_ecat_mailbox_fraghead,
2027 | &ett_ecat_mailbox_header,
2028 | &ett_ecat_mailbox_voe
2029 | };
2030 |
2031 | static ei_register_info ei[] =
2032 | {
2033 | { &ei_ecat_mailbox_error, { "ecat_mailbox.invalid", PI_MALFORMED0x07000000, PI_ERROR0x00800000, "Malformed mailbox data", EXPFILL0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE , BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0)}} } },
2034 | { &ei_ecat_mailbox_coe_error, { "ecat_mailbox.coe.invalid", PI_MALFORMED0x07000000, PI_ERROR0x00800000, "Malformed CoE data", EXPFILL0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE , BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0)}} } },
2035 | { &ei_ecat_mailbox_foe_error, { "ecat_mailbox.foe.invalid", PI_MALFORMED0x07000000, PI_ERROR0x00800000, "Malformed FoE data", EXPFILL0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE , BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0)}} } },
2036 | { &ei_ecat_mailbox_soe_error, { "ecat_mailbox.soe.invalid", PI_MALFORMED0x07000000, PI_ERROR0x00800000, "Malformed SoE data", EXPFILL0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE , BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0)}} } },
2037 | { &ei_ecat_mailbox_eoe_error, { "ecat_mailbox.eoe.invalid", PI_MALFORMED0x07000000, PI_ERROR0x00800000, "Malformed EoE data", EXPFILL0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE , BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0)}} } },
2038 | { &ei_ecat_mailbox_voe_error, { "ecat_mailbox.voe.invalid", PI_MALFORMED0x07000000, PI_ERROR0x00800000, "Malformed VoE data", EXPFILL0, ((void*)0), 0, ((void*)0), {0, {((void*)0), ((void*)0), FT_NONE , BASE_NONE, ((void*)0), 0, ((void*)0), -1, 0, HF_REF_TYPE_NONE , -1, ((void*)0)}} } }
2039 | };
2040 |
2041 | expert_module_t *expert_module;
2042 |
2043 | proto_ecat_mailbox = proto_register_protocol("EtherCAT Mailbox Protocol",
2044 | "ECAT_MAILBOX", "ecat_mailbox");
2045 |
2046 | expert_module = expert_register_protocol(proto_ecat_mailbox);
2047 | expert_register_field_array(expert_module, ei, array_length(ei)(sizeof (ei) / sizeof (ei)[0]));
2048 |
2049 | proto_register_field_array(proto_ecat_mailbox, hf,array_length(hf)(sizeof (hf) / sizeof (hf)[0]));
2050 | proto_register_subtree_array(ett, array_length(ett)(sizeof (ett) / sizeof (ett)[0]));
2051 |
2052 | ecat_mailbox_handle = register_dissector("ecat_mailbox", dissect_ecat_mailbox, proto_ecat_mailbox);
2053 | }
2054 |
2055 | void proto_reg_handoff_ecat_mailbox(void)
2056 | {
2057 | /* Register this dissector as a sub dissector to E88A4 based on ether type. */
2058 | dissector_add_uint("ecatf.type", 5, ecat_mailbox_handle);
2059 |
2060 | eth_handle = find_dissector_add_dependency("eth_withoutfcs", proto_ecat_mailbox);
2061 | ams_handle = find_dissector_add_dependency("ams", proto_ecat_mailbox);
2062 | }
2063 |
2064 | /*
2065 | * Editor modelines - https://www.wireshark.org/tools/modelines.html
2066 | *
2067 | * Local Variables:
2068 | * c-basic-offset: 3
2069 | * tab-width: 8
2070 | * indent-tabs-mode: nil
2071 | * End:
2072 | *
2073 | * ex: set shiftwidth=3 tabstop=8 expandtab:
2074 | * :indentSize=3:tabSize=8:noTabs=true:
2075 | */