Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-epl_v1.c
blob44d7eb03455c668d11f51873d713d54ce58eaf84
1 /* packet-epl_v1.c
2 * Routines for "ETHERNET Powerlink 1.0" dissection
3 * (ETHERNET Powerlink Powerlink WhitePaper V0006-B)
5 * Copyright (c) 2006: Zurich University of Applied Sciences Winterthur (ZHW)
6 * Institute of Embedded Systems (InES)
7 * http://ines.zhwin.ch
9 * - Dominic Bechaz <bdo@zhwin.ch>
10 * - David Buechi <bhd@zhwin.ch>
13 * A dissector for:
14 * Wireshark - Network traffic analyzer
15 * By Gerald Combs <gerald@wireshark.org>
16 * Copyright 1999 Gerald Combs
18 * SPDX-License-Identifier: GPL-2.0-or-later
21 #include "config.h"
23 #include <epan/packet.h>
24 #include <epan/etypes.h>
25 void proto_register_epl_v1(void);
26 void proto_reg_handoff_epl_v1(void);
28 static dissector_handle_t epl_v1_handle;
30 /* Offsets of fields within an EPL_V1 packet. */
31 #define EPL_V1_SERVICE_OFFSET 0 /* same offset for all message types*/
32 #define EPL_V1_DEST_OFFSET 1 /* same offset for all message types*/
33 #define EPL_V1_SRC_OFFSET 2 /* same offset for all message types*/
35 #define EPL_V1_SOC_C2_OFFSET 3
36 #define EPL_V1_SOC_PF_OFFSET 3
37 #define EPL_V1_SOC_NET_COMMAND_OFFSET 4
38 #define EPL_V1_SOC_NET_TIME_OFFSET 6
39 #define EPL_V1_SOC_POWERLINK_CYCLE_TIME_OFFSET 10
40 #define EPL_V1_SOC_NET_COMMAND_PARAMETER_OFFSET 14
42 #define EPL_V1_PREQ_C2_OFFSET 3
43 /* "Powerlink Multimanager Konzept V1.1" protocol extension*/
44 #define PMM_KONZEPT_V1_1_PREQ_YA 3
45 #define PMM_KONZEPT_V1_1_PREQ_SC 3
46 /* end "Powerlink Multimanager Konzept V1.1" protocol extension*/
47 #define EPL_V1_PREQ_RD_OFFSET 3
48 #define EPL_V1_PREQ_RD_OFFSET 3
49 #define EPL_V1_PREQ_POLL_SIZE_OUT_OFFSET 4
50 #define EPL_V1_PREQ_OUT_DATA_OFFSET 10
52 #define EPL_V1_PRES_C2_OFFSET 3
53 #define EPL_V1_PRES_EX_OFFSET 3
54 #define EPL_V1_PRES_RS_OFFSET 3
55 #define EPL_V1_PRES_WA_OFFSET 3
56 #define EPL_V1_PRES_ER_OFFSET 3
57 #define EPL_V1_PRES_RD_OFFSET 3
58 #define EPL_V1_PRES_POLL_SIZE_IN_OFFSET 4
59 #define EPL_V1_PRES_IN_DATA_OFFSET 10
61 #define EPL_V1_EOC_NET_COMMAND_OFFSET 4
62 #define EPL_V1_EOC_NET_COMMAND_PARAMETER_OFFSET 14
64 #define EPL_V1_AINV_CHANNEL_OFFSET 3
66 #define EPL_V1_ASND_CHANNEL_OFFSET 3
67 #define EPL_V1_ASND_SIZE_OFFSET 4
68 #define EPL_V1_ASND_DATA_OFFSET 6
69 #define EPL_V1_ASND_NODE_ID_OFFSET 6
70 #define EPL_V1_ASND_HARDWARE_REVISION_OFFSET 10
71 #define EPL_V1_ASND_FIRMWARE_VERSION_OFFSET 14
72 #define EPL_V1_ASND_DEVICE_VARIANT_OFFSET 18
73 #define EPL_V1_ASND_POLL_IN_SIZE_OFFSET 22
74 #define EPL_V1_ASND_POLL_OUT_SIZE_OFFSET 26
76 /* EPL_V1 message types */
77 #define EPL_V1_SOC 0x01
78 #define EPL_V1_EOC 0x02
79 #define EPL_V1_PREQ 0x03
80 #define EPL_V1_PRES 0x04
81 #define EPL_V1_AINV 0x05
82 #define EPL_V1_ASND 0x06
84 static const value_string service_vals[] = {
85 {EPL_V1_SOC, "Start of Cyclic (SoC)" },
86 {EPL_V1_EOC, "End of Cyclic (EoC)" },
87 {EPL_V1_PREQ, "Poll Request (PReq)" },
88 {EPL_V1_PRES, "Poll Response (PRes)" },
89 {EPL_V1_AINV, "Acyclic Invite (AInv)" },
90 {EPL_V1_ASND, "Acyclic Send (ASnd)" },
91 {0,NULL}
94 /* Channel values for EPL_V1 message type "AInv" */
95 #define EPL_V1_AINV_IDENT 1
96 #define EPL_V1_AINV_GENERIC 255
98 static const value_string ainv_channel_number_vals[] = {
99 {EPL_V1_AINV_IDENT, "Ident" },
100 {EPL_V1_AINV_GENERIC, "Generic Channel" },
101 {0,NULL}
104 /* Channel values for EPL_V1 message type "ASnd" */
105 #define EPL_V1_ASND_IDENT 1
106 #define EPL_V1_ASND_GENERIC 255
108 static const value_string asnd_channel_number_vals[] = {
109 {EPL_V1_ASND_IDENT, "Ident" },
110 {EPL_V1_ASND_GENERIC, "Generic Channel" },
111 {0,NULL}
114 /* Net Command values for EPL_V1 message type "SoC" */
115 #define EPL_V1_SOC_NET_COMMAND_IDLE 0
116 #define EPL_V1_SOC_NET_COMMAND_ACTIVE 1
118 static const value_string soc_net_command_vals[] = {
119 {EPL_V1_SOC_NET_COMMAND_IDLE, "Net Command Idle" },
120 {EPL_V1_SOC_NET_COMMAND_ACTIVE, "Net Command Active"},
121 {0,NULL}
124 /* Net Command values for EPL_V1 message type "EoC" */
125 #define EPL_V1_EOC_NET_COMMAND_IDLE 0
126 #define EPL_V1_EOC_NET_COMMAND_ACTIVE 1
128 static const value_string eoc_net_command_vals[] = {
129 {EPL_V1_EOC_NET_COMMAND_IDLE, "Net Command Idle" },
130 {EPL_V1_EOC_NET_COMMAND_ACTIVE, "Net Command Active"},
131 {0,NULL}
135 /* Initialize the protocol and registered fields */
136 static int proto_epl_v1;
137 static int hf_epl_v1_service;
138 static int hf_epl_v1_dest;
139 static int hf_epl_v1_src;
141 static int hf_epl_v1_soc_ms;
142 static int hf_epl_v1_soc_ps;
143 static int hf_epl_v1_soc_net_command;
144 static int hf_epl_v1_soc_net_time;
145 static int hf_epl_v1_soc_powerlink_cycle_time;
146 static int hf_epl_v1_soc_net_command_parameter;
148 static int hf_epl_v1_preq_ms;
149 static int hf_epl_v1_preq_rd;
150 static int hf_epl_v1_preq_poll_size_out;
151 static int hf_epl_v1_preq_out_data;
153 static int hf_epl_v1_pres_ms;
154 static int hf_epl_v1_pres_ex;
155 static int hf_epl_v1_pres_rs;
156 static int hf_epl_v1_pres_wa;
157 static int hf_epl_v1_pres_er;
158 static int hf_epl_v1_pres_rd;
159 static int hf_epl_v1_pres_poll_size_in;
160 static int hf_epl_v1_pres_in_data;
162 static int hf_epl_v1_eoc_net_command;
163 static int hf_epl_v1_eoc_net_command_parameter;
165 static int hf_epl_v1_ainv_channel;
167 static int hf_epl_v1_asnd_channel;
168 static int hf_epl_v1_asnd_size;
169 static int hf_epl_v1_asnd_data;
170 static int hf_epl_v1_asnd_node_id;
171 static int hf_epl_v1_asnd_hardware_revision;
172 static int hf_epl_v1_asnd_firmware_version;
173 static int hf_epl_v1_asnd_device_variant;
174 static int hf_epl_v1_asnd_poll_in_size;
175 static int hf_epl_v1_asnd_poll_out_size;
177 static int ett_epl_v1;
180 static int
181 dissect_epl_v1_soc(proto_tree *epl_v1_tree, tvbuff_t *tvb, int offset)
183 proto_tree_add_item(epl_v1_tree, hf_epl_v1_soc_ms, tvb, offset, 1, ENC_LITTLE_ENDIAN);
184 proto_tree_add_item(epl_v1_tree, hf_epl_v1_soc_ps, tvb, offset, 1, ENC_LITTLE_ENDIAN);
185 offset += 1;
187 proto_tree_add_item(epl_v1_tree, hf_epl_v1_soc_net_command, tvb, offset, 2, ENC_LITTLE_ENDIAN);
188 offset += 2;
190 proto_tree_add_item(epl_v1_tree, hf_epl_v1_soc_net_time, tvb, offset, 4, ENC_LITTLE_ENDIAN);
191 offset += 4;
193 proto_tree_add_item(epl_v1_tree, hf_epl_v1_soc_powerlink_cycle_time, tvb, offset, 4, ENC_LITTLE_ENDIAN);
194 offset += 4;
196 proto_tree_add_item(epl_v1_tree, hf_epl_v1_soc_net_command_parameter, tvb, offset, 32, ENC_NA);
197 offset += 32;
199 return offset;
203 static int
204 dissect_epl_v1_eoc(proto_tree *epl_v1_tree, tvbuff_t *tvb, int offset)
206 offset += 1;
208 proto_tree_add_item(epl_v1_tree, hf_epl_v1_eoc_net_command, tvb, offset, 2, ENC_LITTLE_ENDIAN);
209 offset += 8;
211 proto_tree_add_item(epl_v1_tree, hf_epl_v1_eoc_net_command_parameter, tvb, offset, 32, ENC_NA);
212 offset += 32;
214 return offset;
218 static int
219 dissect_epl_v1_preq(proto_tree *epl_v1_tree, tvbuff_t *tvb, int offset)
221 uint16_t len;
223 proto_tree_add_item(epl_v1_tree, hf_epl_v1_preq_ms, tvb, offset, 1, ENC_LITTLE_ENDIAN);
224 proto_tree_add_item(epl_v1_tree, hf_epl_v1_preq_rd, tvb, offset, 1, ENC_LITTLE_ENDIAN);
225 offset += 1;
227 /* get length of data */
228 proto_tree_add_item(epl_v1_tree, hf_epl_v1_preq_poll_size_out, tvb, offset, 2, ENC_LITTLE_ENDIAN);
229 len = tvb_get_letohs(tvb, offset);
230 offset += 6;
232 if(len>0){
233 proto_tree_add_item(epl_v1_tree, hf_epl_v1_preq_out_data, tvb, offset, len, ENC_NA);
234 offset += len;
237 return offset;
242 static int
243 dissect_epl_v1_pres(proto_tree *epl_v1_tree, tvbuff_t *tvb, int offset)
245 uint16_t len;
247 proto_tree_add_item(epl_v1_tree, hf_epl_v1_pres_ms, tvb, offset, 1, ENC_LITTLE_ENDIAN);
248 proto_tree_add_item(epl_v1_tree, hf_epl_v1_pres_ex, tvb, offset, 1, ENC_LITTLE_ENDIAN);
249 proto_tree_add_item(epl_v1_tree, hf_epl_v1_pres_rs, tvb, offset, 1, ENC_LITTLE_ENDIAN);
250 proto_tree_add_item(epl_v1_tree, hf_epl_v1_pres_wa, tvb, offset, 1, ENC_LITTLE_ENDIAN);
251 proto_tree_add_item(epl_v1_tree, hf_epl_v1_pres_er, tvb, offset, 1, ENC_LITTLE_ENDIAN);
252 proto_tree_add_item(epl_v1_tree, hf_epl_v1_pres_rd, tvb, offset, 1, ENC_LITTLE_ENDIAN);
253 offset += 1;
255 /* get length of data */
256 proto_tree_add_item(epl_v1_tree, hf_epl_v1_pres_poll_size_in, tvb, offset, 2, ENC_LITTLE_ENDIAN);
257 len = tvb_get_letohs(tvb, offset);
258 offset += 6;
260 if(len>0){
261 proto_tree_add_item(epl_v1_tree, hf_epl_v1_pres_in_data, tvb, offset, len, ENC_NA);
262 offset += len;
265 return offset;
270 static int
271 dissect_epl_v1_ainv(proto_tree *epl_v1_tree, tvbuff_t *tvb, int offset)
273 proto_tree_add_item(epl_v1_tree, hf_epl_v1_ainv_channel, tvb, offset, 1, ENC_LITTLE_ENDIAN);
274 offset += 1;
276 return offset;
281 static int
282 dissect_epl_v1_asnd(proto_tree *epl_v1_tree, tvbuff_t *tvb, int offset)
284 uint8_t epl_v1_asnd_channel;
285 uint16_t len;
287 /* get ASnd channel */
288 proto_tree_add_item(epl_v1_tree, hf_epl_v1_asnd_channel, tvb, offset, 1, ENC_LITTLE_ENDIAN);
289 epl_v1_asnd_channel = tvb_get_uint8(tvb, offset);
290 offset += 1;
292 /* get length of data */
293 proto_tree_add_item(epl_v1_tree, hf_epl_v1_asnd_size, tvb, offset, 2, ENC_LITTLE_ENDIAN);
294 len = tvb_get_letohs(tvb, offset);
295 offset += 2;
297 /* "Ident" or "Generic" channel? */
298 if(epl_v1_asnd_channel == EPL_V1_AINV_IDENT){ /* Ident channel*/
299 proto_tree_add_item(epl_v1_tree, hf_epl_v1_asnd_node_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
300 offset += 4;
302 proto_tree_add_item(epl_v1_tree, hf_epl_v1_asnd_hardware_revision, tvb, offset, 4, ENC_LITTLE_ENDIAN);
303 offset += 4;
305 proto_tree_add_item(epl_v1_tree, hf_epl_v1_asnd_firmware_version, tvb, offset, 4, ENC_LITTLE_ENDIAN);
306 offset += 4;
308 proto_tree_add_item(epl_v1_tree, hf_epl_v1_asnd_device_variant, tvb, offset, 4, ENC_LITTLE_ENDIAN);
309 offset += 4;
311 proto_tree_add_item(epl_v1_tree, hf_epl_v1_asnd_poll_in_size, tvb, offset, 4, ENC_LITTLE_ENDIAN);
312 offset += 4;
314 proto_tree_add_item(epl_v1_tree, hf_epl_v1_asnd_poll_out_size, tvb, offset, 4, ENC_LITTLE_ENDIAN);
315 offset += 4;
316 } else { /* "Generic" and all other channels */
317 proto_tree_add_item(epl_v1_tree, hf_epl_v1_asnd_data, tvb, offset, len, ENC_NA);
318 offset += len;
321 return offset;
326 /* Code to actually dissect the packets */
327 static int
328 dissect_epl_v1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
330 uint8_t epl_v1_service, epl_v1_dest, epl_v1_src, epl_v1_ainv_ch, epl_v1_asnd_ch;
331 int offset;
332 proto_item *ti=NULL;
333 proto_tree *epl_v1_tree=NULL;
336 if(tvb_captured_length(tvb) < 3){
337 /* Not enough data for an EPL_V1 header; don't try to interpret it */
338 return false;
341 offset = 0;
343 /* make entries in Protocol column and Info column on summary display */
344 col_set_str(pinfo->cinfo, COL_PROTOCOL, "EPL_V1");
345 col_clear(pinfo->cinfo, COL_INFO);
347 /* get service type */
348 epl_v1_service = tvb_get_uint8(tvb, EPL_V1_SERVICE_OFFSET) & 0x7F;
350 /* get destination */
351 epl_v1_dest = tvb_get_uint8(tvb, EPL_V1_DEST_OFFSET);
353 /* get source */
354 epl_v1_src = tvb_get_uint8(tvb, EPL_V1_SRC_OFFSET);
356 /* choose the right string for "Info" column */
357 switch(epl_v1_service){
358 case EPL_V1_SOC:
359 col_add_fstr(pinfo->cinfo, COL_INFO, "SoC dest = %3d src = %3d ", epl_v1_dest, epl_v1_src);
360 break;
362 case EPL_V1_EOC:
363 col_add_fstr(pinfo->cinfo, COL_INFO, "EoC dest = %3d src = %3d ", epl_v1_dest, epl_v1_src);
364 break;
366 case EPL_V1_PREQ:
367 col_add_fstr(pinfo->cinfo, COL_INFO, "PReq dest = %3d src = %3d ", epl_v1_dest, epl_v1_src);
368 break;
370 case EPL_V1_PRES:
371 col_add_fstr(pinfo->cinfo, COL_INFO, "PRes dest = %3d src = %3d ", epl_v1_dest, epl_v1_src);
372 break;
374 case EPL_V1_AINV:
375 /* get AInv channel */
376 epl_v1_ainv_ch = tvb_get_uint8(tvb, EPL_V1_AINV_CHANNEL_OFFSET);
377 col_add_fstr(pinfo->cinfo, COL_INFO, "AInv dest = %3d src = %3d channel = %s ",
378 epl_v1_dest, epl_v1_src, val_to_str(epl_v1_ainv_ch, ainv_channel_number_vals, "unknown Channel (%d)"));
379 break;
381 case EPL_V1_ASND:
382 /* get ASnd channel */
383 epl_v1_asnd_ch = tvb_get_uint8(tvb, EPL_V1_ASND_CHANNEL_OFFSET);
384 col_add_fstr(pinfo->cinfo, COL_INFO, "ASnd dest = %3d src = %3d channel = %s ",
385 epl_v1_dest, epl_v1_src, val_to_str(epl_v1_asnd_ch, asnd_channel_number_vals, "unknown Channel (%d)"));
386 break;
388 default: /* no valid EPL packet */
389 return false;
392 if(tree){
393 /* create display subtree for the protocol */
394 ti = proto_tree_add_item(tree, proto_epl_v1, tvb, 0, -1, ENC_NA);
396 epl_v1_tree = proto_item_add_subtree(ti, ett_epl_v1);
398 proto_tree_add_item(epl_v1_tree, hf_epl_v1_service, tvb, offset, 1, ENC_LITTLE_ENDIAN);
399 offset += 1;
401 proto_tree_add_item(epl_v1_tree, hf_epl_v1_dest, tvb, offset, 1, ENC_LITTLE_ENDIAN);
402 offset += 1;
404 proto_tree_add_item(epl_v1_tree, hf_epl_v1_src, tvb, offset, 1, ENC_LITTLE_ENDIAN);
405 offset += 1;
407 /* The rest of the epl_v1 dissector depends on the message type */
408 switch(epl_v1_service){
409 case EPL_V1_SOC:
410 offset = dissect_epl_v1_soc(epl_v1_tree, tvb, offset);
411 break;
413 case EPL_V1_EOC:
414 offset = dissect_epl_v1_eoc(epl_v1_tree, tvb, offset);
415 break;
417 case EPL_V1_PREQ:
418 offset = dissect_epl_v1_preq(epl_v1_tree, tvb, offset);
419 break;
421 case EPL_V1_PRES:
422 offset = dissect_epl_v1_pres(epl_v1_tree, tvb, offset);
423 break;
425 case EPL_V1_AINV:
426 offset = dissect_epl_v1_ainv(epl_v1_tree, tvb, offset);
427 break;
429 case EPL_V1_ASND:
430 offset = dissect_epl_v1_asnd(epl_v1_tree, tvb, offset);
431 break;
433 default: /* not a valid MessageType - can't dissect any further. */
434 return false;
436 return offset;
441 void
442 proto_register_epl_v1(void)
444 static hf_register_info hf[] = {
445 /* Common data fields (same for all message types) */
446 { &hf_epl_v1_service,
447 { "Service", "epl_v1.service",
448 FT_UINT8, BASE_DEC, VALS(service_vals), 0x7F,
449 NULL, HFILL }
451 { &hf_epl_v1_dest,
452 { "Destination", "epl_v1.dest",
453 FT_UINT8, BASE_DEC, NULL, 0x00,
454 NULL, HFILL }
456 { &hf_epl_v1_src,
457 { "Source", "epl_v1.src",
458 FT_UINT8, BASE_DEC, NULL, 0x00,
459 NULL, HFILL }
461 /* SoC data fields*/
462 { &hf_epl_v1_soc_ms,
463 { "MS (Multiplexed Slot)", "epl_v1.soc.ms",
464 FT_UINT8, BASE_DEC, NULL, 0x80,
465 NULL, HFILL }
467 { &hf_epl_v1_soc_ps,
468 { "PS (Prescaled Slot)", "epl_v1.soc.ps",
469 FT_UINT8, BASE_DEC, NULL, 0x40,
470 NULL, HFILL }
472 { &hf_epl_v1_soc_net_command,
473 { "Net Command", "epl_v1.soc.netcommand",
474 FT_UINT16, BASE_DEC, VALS(soc_net_command_vals), 0x0,
475 NULL, HFILL }
477 { &hf_epl_v1_soc_net_time,
478 { "Net Time", "epl_v1.soc.nettime",
479 FT_UINT32, BASE_DEC, NULL, 0x0,
480 NULL, HFILL }
482 { &hf_epl_v1_soc_powerlink_cycle_time,
483 { "Cycle Time", "epl_v1.soc.cycletime",
484 FT_UINT32, BASE_DEC, NULL, 0x0,
485 NULL, HFILL }
487 { &hf_epl_v1_soc_net_command_parameter,
488 { "Net Command Parameter", "epl_v1.soc.netcommand.parameter",
489 FT_BYTES, BASE_NONE, NULL, 0x0,
490 NULL, HFILL }
492 /* PReq data fields*/
493 { &hf_epl_v1_preq_ms,
494 { "MS (Multiplexed Slot)", "epl_v1.preq.ms",
495 FT_UINT8, BASE_DEC, NULL, 0x20,
496 NULL, HFILL }
498 { &hf_epl_v1_preq_rd,
499 { "RD (Ready)", "epl_v1.preq.rd",
500 FT_UINT8, BASE_DEC, NULL, 0x01,
501 NULL, HFILL }
503 { &hf_epl_v1_preq_poll_size_out,
504 { "Poll Size OUT", "epl_v1.preq.pollsize",
505 FT_UINT16, BASE_DEC, NULL, 0x00,
506 NULL, HFILL }
508 { &hf_epl_v1_preq_out_data,
509 { "OUT Data", "epl_v1.preq.data",
510 FT_BYTES, BASE_NONE, NULL, 0x00,
511 NULL, HFILL }
513 /* PRes data fields*/
514 { &hf_epl_v1_pres_ms,
515 { "MS (Multiplexed)", "epl_v1.pres.ms",
516 FT_UINT8, BASE_DEC, NULL, 0x20,
517 NULL, HFILL }
519 { &hf_epl_v1_pres_ex,
520 { "EX (Exception)", "epl_v1.pres.ex",
521 FT_UINT8, BASE_DEC, NULL, 0x10,
522 NULL, HFILL }
524 { &hf_epl_v1_pres_rs,
525 { "RS (Request to Send)", "epl_v1.pres.rs",
526 FT_UINT8, BASE_DEC, NULL, 0x08,
527 NULL, HFILL }
529 { &hf_epl_v1_pres_wa,
530 { "WA (Warning)", "epl_v1.pres.wa",
531 FT_UINT8, BASE_DEC, NULL, 0x04,
532 NULL, HFILL }
534 { &hf_epl_v1_pres_er,
535 { "ER (Error)", "epl_v1.pres.er",
536 FT_UINT8, BASE_DEC, NULL, 0x02,
537 NULL, HFILL }
539 { &hf_epl_v1_pres_rd,
540 { "RD (Ready)", "epl_v1.pres.rd",
541 FT_UINT8, BASE_DEC, NULL, 0x01,
542 NULL, HFILL }
544 { &hf_epl_v1_pres_poll_size_in,
545 { "Poll Size IN", "epl_v1.pres.pollsize",
546 FT_UINT16, BASE_DEC, NULL, 0x00,
547 NULL, HFILL }
549 { &hf_epl_v1_pres_in_data,
550 { "IN Data", "epl_v1.pres.data",
551 FT_BYTES, BASE_NONE, NULL, 0x00,
552 NULL, HFILL }
554 /* EoC data fields*/
555 { &hf_epl_v1_eoc_net_command,
556 { "Net Command", "epl_v1.eoc.netcommand",
557 FT_UINT16, BASE_DEC, VALS(eoc_net_command_vals), 0x00,
558 NULL, HFILL }
560 { &hf_epl_v1_eoc_net_command_parameter,
561 { "Net Command Parameter", "epl_v1.soa.netcommand.parameter",
562 FT_BYTES, BASE_NONE, NULL, 0x00,
563 NULL, HFILL }
565 /* AInv data fields*/
566 { &hf_epl_v1_ainv_channel,
567 { "Channel", "epl_v1.ainv.channel",
568 FT_UINT8, BASE_DEC, VALS(ainv_channel_number_vals), 0x00,
569 NULL, HFILL }
571 /* ASnd data fields*/
572 { &hf_epl_v1_asnd_channel,
573 { "Channel", "epl_v1.asnd.channel",
574 FT_UINT8, BASE_DEC, VALS(asnd_channel_number_vals), 0x00,
575 NULL, HFILL }
577 { &hf_epl_v1_asnd_size,
578 { "Size", "epl_v1.asnd.size",
579 FT_UINT16, BASE_DEC, NULL, 0x00,
580 NULL, HFILL }
582 { &hf_epl_v1_asnd_data,
583 { "Data", "epl_v1.asnd.data",
584 FT_BYTES, BASE_NONE, NULL, 0x00,
585 NULL, HFILL }
588 { &hf_epl_v1_asnd_node_id,
589 { "NodeID", "epl_v1.asnd.node_id",
590 FT_UINT32, BASE_DEC, NULL, 0x00,
591 NULL, HFILL }
593 { &hf_epl_v1_asnd_hardware_revision,
594 { "Hardware Revision", "epl_v1.asnd.hardware.revision",
595 FT_UINT32, BASE_DEC, NULL, 0x00,
596 NULL, HFILL }
598 { &hf_epl_v1_asnd_firmware_version,
599 { "Firmware Version", "epl_v1.asnd.firmware.version",
600 FT_UINT32, BASE_DEC, NULL, 0x00,
601 NULL, HFILL }
603 { &hf_epl_v1_asnd_device_variant,
604 { "Device Variant", "epl_v1.asnd.device.variant",
605 FT_UINT32, BASE_DEC, NULL, 0x00,
606 NULL, HFILL }
608 { &hf_epl_v1_asnd_poll_in_size,
609 { "Poll IN Size", "epl_v1.asnd.poll.in.size",
610 FT_UINT32, BASE_DEC, NULL, 0x00,
611 NULL, HFILL }
613 { &hf_epl_v1_asnd_poll_out_size,
614 { "Poll OUT Size", "epl_v1.asnd.poll.out.size",
615 FT_UINT32, BASE_DEC, NULL, 0x00,
616 NULL, HFILL }
620 /* Setup protocol subtree array */
621 static int *ett[] = {
622 &ett_epl_v1,
625 /* Register the protocol name and description */
626 proto_epl_v1 = proto_register_protocol("ETHERNET Powerlink V1.0", "EPL_V1", "epl_v1");
628 /* Required function calls to register the header fields and subtrees used */
629 proto_register_field_array(proto_epl_v1, hf, array_length(hf));
630 proto_register_subtree_array(ett, array_length(ett));
632 epl_v1_handle = register_dissector("epl_v1", dissect_epl_v1, proto_epl_v1);
637 void
638 proto_reg_handoff_epl_v1(void)
640 dissector_add_uint("ethertype", ETHERTYPE_EPL_V1, epl_v1_handle);
644 * Editor modelines - https://www.wireshark.org/tools/modelines.html
646 * Local variables:
647 * c-basic-offset: 8
648 * tab-width: 8
649 * indent-tabs-mode: t
650 * End:
652 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
653 * :indentSize=8:tabSize=8:noTabs=false: