-
Notifications
You must be signed in to change notification settings - Fork 0
/
packet-epl.c
6039 lines (5283 loc) · 215 KB
/
packet-epl.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* packet-epl.c
* Routines for "Ethernet POWERLINK 2.0" dissection
* (Ethernet POWERLINK V2.0 Communication Profile Specification Draft Standard Version 1.2.0)
*
* Copyright (c) 2006: Zurich University of Applied Sciences Winterthur (ZHW)
* Institute of Embedded Systems (InES)
* http://ines.zhwin.ch
*
* - Dominic Bechaz <bdo[AT]zhwin.ch>
* - Damir Bursic <bum[AT]zhwin.ch>
* - David Buechi <bhd[AT]zhwin.ch>
*
* Copyright (c) 2007: SYS TEC electronic GmbH
* http://www.systec-electronic.com
* - Daniel Krueger <daniel.krueger[AT]systec-electronic.com>
*
* Copyright (c) 2013: B&R Industrieelektronik GmbH
* http://www.br-automation.com
*
* - Christoph Schlosser <christoph.schlosser[AT]br-automation.com>
* - Lukas Emersberger <lukas.emersberger[AT]br-automation.com>
* - Josef Baumgartner <josef.baumgartner[AT]br-automation.com>
* - Roland Knall <roland.knall[AT]br-automation.com>
* - Extended to be similair in handling as to B&R plugin
* - Multiple SOD Read/Write dissection
* - Include AInv message type
* - Straighten text formatting
* - Remove unneccessary if(tree) checks
*
* Copyright (c) 2017: Karlsruhe Institute of Technology (KIT)
* Institute for Anthropomatics and Robotics (IAR)
* Intelligent Process Control and Robotics (IPR)
* http://rob.ipr.kit.edu/
*
* - Ahmad Fatoum <ahmad[AT]a3f.at>
* - Converted into plugin for easier development
* - ObjectMappings now used for dissecting PDOs
* - XDD/EDS files can be read for name/type information
*
* A dissector for:
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "packet-epl.h"
#ifdef HAVE_LIBXML2
#include "xdd.h"
#define IF_LIBXML(x) x
#else /* !HAVE_LIBXML2 */
#define IF_LIBXML(x)
#endif /* !HAVE_LIBXML2 */
#include "eds.h"
#include "wmem_iarray.h"
#include <epan/conversation.h>
#include <epan/packet.h>
#include <epan/etypes.h>
#include <epan/prefs.h>
#include <epan/expert.h>
#include <epan/reassemble.h>
#include <epan/proto_data.h>
#include <epan/uat.h>
#include <wsutil/file_util.h>
#include <wsutil/report_err.h>
#include <glib.h>
#include <string.h>
#include <errno.h>
void proto_register_epl(void);
void proto_reg_handoff_epl(void);
#ifndef UDP_PORT_EPL
#define UDP_PORT_EPL 3819
#endif
/* Allow heuristic dissection and ASND manufacturer dissection */
static heur_dissector_list_t heur_epl_subdissector_list;
static heur_dissector_list_t heur_epl_data_subdissector_list;
static dissector_table_t epl_asnd_dissector_table;
#if 0
/* Container for tapping relevant data */
typedef struct _epl_info_t {
unsigned char epl_mtyp;
} epl_info_t;
#endif
/*EPL Addressing*/
#define EPL_DYNAMIC_NODEID 0
#define EPL_MN_NODEID 240
#define EPL_DIAGNOSTIC_DEVICE_NODEID 253
#define EPL_TO_LEGACY_ETHERNET_ROUTER_NODEID 254
#define EPL_BROADCAST_NODEID 255
#define EPL_IS_CN_NODEID(nodeid) (EPL_DYNAMIC_NODEID < (nodeid) && (nodeid) < EPL_MN_NODEID)
static const value_string addr_str_vals[] = {
{EPL_DYNAMIC_NODEID, " (Dynamically assigned)" },
{EPL_MN_NODEID, " (Managing Node)" },
{EPL_DIAGNOSTIC_DEVICE_NODEID, " (Diagnostic Device)" },
{EPL_TO_LEGACY_ETHERNET_ROUTER_NODEID, " (POWERLINK to legacy Ethernet Router)" },
{EPL_BROADCAST_NODEID, " (broadcast)" },
{0,NULL}
};
static const value_string addr_str_abbr_vals[] _U_ = {
{EPL_DYNAMIC_NODEID, " (dyn.)" },
{EPL_MN_NODEID, " (MN)" },
{EPL_DIAGNOSTIC_DEVICE_NODEID, " (diag.)" },
{EPL_TO_LEGACY_ETHERNET_ROUTER_NODEID, " (router)" },
{EPL_BROADCAST_NODEID, " (bc)" },
{0,NULL}
};
/*
static const gchar* addr_str_abbr_cn = " (CN)";
static const gchar* addr_str_abbr_res = " (res.)";
*/
/* Offsets of fields within an EPL packet. */
#define EPL_MTYP_OFFSET 0 /* same offset for all message types*/
#define EPL_DEST_OFFSET 1 /* same offset for all message types*/
#define EPL_SRC_OFFSET 2 /* same offset for all message types*/
#define EPL_SOA_SVID_OFFSET 6
#define EPL_SOA_SVTG_OFFSET 7
#define EPL_SOA_EPLV_OFFSET 8
/* SyncRequest */
#define EPL_SOA_SYNC_OFFSET 10
#define EPL_SOA_PRFE_OFFSET 14
#define EPL_SOA_PRSE_OFFSET 18
#define EPL_SOA_MNDF_OFFSET 22
#define EPL_SOA_MNDS_OFFSET 26
#define EPL_SOA_PRTO_OFFSET 30
#define EPL_SOA_DEST_OFFSET 34
#define EPL_ASND_SVID_OFFSET 3
#define EPL_ASND_DATA_OFFSET 4
/* NMT Command DNA size */
#define EPL_SIZEOF_NMTCOMMAND_DNA 27
/* EPL message types */
#define EPL_SOC 0x01
#define EPL_PREQ 0x03
#define EPL_PRES 0x04
#define EPL_SOA 0x05
#define EPL_ASND 0x06
#define EPL_AMNI 0x07
#define EPL_AINV 0x0D
static const value_string mtyp_vals[] = {
{EPL_SOC, "Start of Cycle (SoC)" },
{EPL_PREQ, "PollRequest (PReq)" },
{EPL_PRES, "PollResponse (PRes)" },
{EPL_SOA, "Start of Asynchronous (SoA)" },
{EPL_ASND, "Asynchronous Send (ASnd)" },
{EPL_AINV, "Asynchronous Invite (AInv)" },
{EPL_AMNI, "ActiveManagingNodeIndication (AMNI)" },
{0,NULL}
};
#define EPL_SOC_MC_MASK 0x80
#define EPL_SOC_PS_MASK 0x40
#define EPL_PDO_RD_MASK 0x01
#define EPL_PDO_RS_MASK 0x07
#define EPL_PDO_PR_MASK 0x38
/* RequestedServiceID s for EPL message type "SoA" */
#define EPL_SOA_NOSERVICE 0
#define EPL_SOA_IDENTREQUEST 1
#define EPL_SOA_STATUSREQUEST 2
#define EPL_SOA_NMTREQUESTINVITE 3
#define EPL_SOA_SYNCREQUEST 6
#define EPL_SOA_UNSPECIFIEDINVITE 255
#define EPL_SOA_SYNC_PRES_FIRST 0x01
#define EPL_SOA_SYNC_PRES_SECOND 0x02
#define EPL_SOA_SYNC_MND_FIRST 0x04
#define EPL_SOA_SYNC_MND_SECOND 0x08
#define EPL_SOA_SYNC_PRES_TIMEOUT 0x10
#define EPL_SOA_SYNC_MAC_VALID 0x20
#define EPL_SOA_SYNC_PRES_RESET 0x40
#define EPL_SOA_SYNC_PRES_SET 0x80
static const range_string soa_svid_vals[] = {
{EPL_SOA_NOSERVICE, EPL_SOA_NOSERVICE, "NoService"},
{EPL_SOA_IDENTREQUEST, EPL_SOA_IDENTREQUEST, "IdentRequest"},
{EPL_SOA_STATUSREQUEST, EPL_SOA_STATUSREQUEST, "StatusRequest"},
{EPL_SOA_NMTREQUESTINVITE, EPL_SOA_NMTREQUESTINVITE, "NMTRequestInvite"},
{0x04, 0x05, "Reserved"},
{EPL_SOA_SYNCREQUEST, EPL_SOA_SYNCREQUEST, "SyncRequest"},
{0x07, 0x9F, "Reserved"},
{0xA0, 0xFE, "Manufacturer Specific"},
{EPL_SOA_UNSPECIFIEDINVITE, EPL_SOA_UNSPECIFIEDINVITE, "UnspecifiedInvite"},
{0, 0, NULL}
};
/* ServiceID values for EPL message type "ASnd" */
#define EPL_ASND_IDENTRESPONSE 1
#define EPL_ASND_STATUSRESPONSE 2
#define EPL_ASND_NMTREQUEST 3
#define EPL_ASND_NMTCOMMAND 4
#define EPL_ASND_SDO 5
#define EPL_ASND_SYNCRESPONSE 6
#define EPL_ASND_SYNCRESPONSE_FST_VALID 0x01
#define EPL_ASND_SYNCRESPONSE_SEC_VALID 0x02
#define EPL_ASND_SYNCRESPONSE_MODE 0x80
static const range_string soa_svid_id_vals[] = {
{EPL_SOA_NOSERVICE, EPL_SOA_NOSERVICE, "NO_SERVICE"},
{EPL_SOA_IDENTREQUEST, EPL_SOA_IDENTREQUEST, "IDENT_REQUEST"},
{EPL_SOA_STATUSREQUEST, EPL_SOA_STATUSREQUEST, "STATUS_REQUEST"},
{EPL_SOA_NMTREQUESTINVITE, EPL_SOA_NMTREQUESTINVITE, "NMT_REQUEST_INV"},
{0x04, 0x05, "RESERVED"},
{EPL_SOA_SYNCREQUEST, EPL_SOA_SYNCREQUEST, "SYNC_REQUEST"},
{0x07, 0x9F, "RESERVED"},
{0xA0, 0xFE, "MANUFACTURER SPECIFIC"},
{EPL_SOA_UNSPECIFIEDINVITE, EPL_SOA_UNSPECIFIEDINVITE, "UNSPEC_INVITE"},
{0, 0, NULL}
};
static const range_string asnd_svid_vals[] = {
{0, 0, "Reserved"},
{EPL_ASND_IDENTRESPONSE, EPL_ASND_IDENTRESPONSE, "IdentResponse"},
{EPL_ASND_STATUSRESPONSE, EPL_ASND_STATUSRESPONSE, "StatusResponse"},
{EPL_ASND_NMTREQUEST, EPL_ASND_NMTREQUEST, "NMTRequest"},
{EPL_ASND_NMTCOMMAND, EPL_ASND_NMTCOMMAND, "NMTCommand"},
{EPL_ASND_SDO, EPL_ASND_SDO, "SDO"},
{EPL_ASND_SYNCRESPONSE, EPL_ASND_SYNCRESPONSE, "SyncResponse"},
{0x07, 0x9F, "Reserved"},
{0xA0, 0xFE, "Manufacturer Specific"},
{0xFF, 0xFF, "Reserved"},
{0, 0, NULL}
};
static const range_string asnd_svid_id_vals[] = {
{0, 0, "RESERVED"},
{EPL_ASND_IDENTRESPONSE, EPL_ASND_IDENTRESPONSE, "IDENT_RESPONSE"},
{EPL_ASND_STATUSRESPONSE, EPL_ASND_STATUSRESPONSE, "STATUS_RESPONSE"},
{EPL_ASND_NMTREQUEST, EPL_ASND_NMTREQUEST, "NMT_REQUEST"},
{EPL_ASND_NMTCOMMAND, EPL_ASND_NMTCOMMAND, "NMT_COMMAND"},
{EPL_ASND_SDO, EPL_ASND_SDO, "SDO"},
{EPL_ASND_SYNCRESPONSE, EPL_ASND_SYNCRESPONSE, "SYNC_RESPONSE"},
{0x07, 0x9F, "RESERVED"},
{0xA0, 0xFE, "MANUFACTURER SPECIFIC"},
{0xFF, 0xFF, "RESERVED"},
{0, 0, NULL}
};
/* NMTCommand values for EPL message type "ASnd" */
#define EPL_ASND_NMTCOMMAND_NMTSTARTNODE 0x21
#define EPL_ASND_NMTCOMMAND_NMTSTOPNODE 0x22
#define EPL_ASND_NMTCOMMAND_NMTENTERPREOPERATIONAL2 0x23
#define EPL_ASND_NMTCOMMAND_NMTENABLEREADYTOOPERATE 0x24
#define EPL_ASND_NMTCOMMAND_NMTRESETNODE 0x28
#define EPL_ASND_NMTCOMMAND_NMTRESETCOMMUNICATION 0x29
#define EPL_ASND_NMTCOMMAND_NMTRESETCONFIGURATION 0x2A
#define EPL_ASND_NMTCOMMAND_NMTSWRESET 0x2B
#define EPL_ASND_NMTCOMMAND_NMTDNA 0x2D
#define EPL_ASND_NMTCOMMAND_NMTSTARTNODEEX 0x41
#define EPL_ASND_NMTCOMMAND_NMTSTOPNODEEX 0x42
#define EPL_ASND_NMTCOMMAND_NMTENTERPREOPERATIONAL2EX 0x43
#define EPL_ASND_NMTCOMMAND_NMTENABLEREADYTOOPERATEEX 0x44
#define EPL_ASND_NMTCOMMAND_NMTRESETNODEEX 0x48
#define EPL_ASND_NMTCOMMAND_NMTRESETCOMMUNICATIONEX 0x49
#define EPL_ASND_NMTCOMMAND_NMTRESETCONFIGURATIONEX 0x4A
#define EPL_ASND_NMTCOMMAND_NMTSWRESETEX 0x4B
#define EPL_ASND_NMTCOMMAND_NMTNETHOSTNAMESET 0x62
#define EPL_ASND_NMTCOMMAND_NMTFLUSHARPENTRY 0x63
#define EPL_ASND_NMTCOMMAND_NMTPUBLISHCONFIGUREDNODES 0x80
#define EPL_ASND_NMTCOMMAND_NMTPUBLISHACTIVENODES 0x90
#define EPL_ASND_NMTCOMMAND_NMTPUBLISHPREOPERATIONAL1 0x91
#define EPL_ASND_NMTCOMMAND_NMTPUBLISHPREOPERATIONAL2 0x92
#define EPL_ASND_NMTCOMMAND_NMTPUBLISHREADYTOOPERATE 0x93
#define EPL_ASND_NMTCOMMAND_NMTPUBLISHOPERATIONAL 0x94
#define EPL_ASND_NMTCOMMAND_NMTPUBLISHSTOPPED 0x95
#define EPL_ASND_NMTCOMMAND_NMTPUBLISHEMERGENCYNEW 0xA0
#define EPL_ASND_NMTCOMMAND_NMTPUBLISHTIME 0XB0
#define EPL_ASND_NMTCOMMAND_NMTINVALIDSERVICE 0xFF
static const value_string asnd_cid_vals[] = {
/* "special" values to cover all possibilities of CommandID in NMTRequests */
{EPL_ASND_IDENTRESPONSE, "IdentResponse" },
{EPL_ASND_STATUSRESPONSE, "StatusResponse" },
/* ... */
{EPL_ASND_NMTCOMMAND_NMTSTARTNODE, "NMTStartNode" },
{EPL_ASND_NMTCOMMAND_NMTSTOPNODE, "NMTStopNode" },
{EPL_ASND_NMTCOMMAND_NMTENTERPREOPERATIONAL2, "NMTEnterPreOperational2" },
{EPL_ASND_NMTCOMMAND_NMTENABLEREADYTOOPERATE, "NMTEnableReadyToOperate" },
{EPL_ASND_NMTCOMMAND_NMTRESETNODE, "NMTResetNode" },
{EPL_ASND_NMTCOMMAND_NMTRESETCOMMUNICATION, "NMTResetCommunication" },
{EPL_ASND_NMTCOMMAND_NMTRESETCONFIGURATION, "NMTResetConfiguration" },
{EPL_ASND_NMTCOMMAND_NMTSWRESET, "NMTSwReset" },
{EPL_ASND_NMTCOMMAND_NMTDNA, "NMTDNA" },
{EPL_ASND_NMTCOMMAND_NMTSTARTNODEEX, "NMTStartNodeEx" },
{EPL_ASND_NMTCOMMAND_NMTSTOPNODEEX, "NMTStopNodeEx" },
{EPL_ASND_NMTCOMMAND_NMTENTERPREOPERATIONAL2EX, "NMTEnterPreOperational2Ex" },
{EPL_ASND_NMTCOMMAND_NMTENABLEREADYTOOPERATEEX, "NMTEnableReadyToOperateEx" },
{EPL_ASND_NMTCOMMAND_NMTRESETNODEEX, "NMTResetNodeEx" },
{EPL_ASND_NMTCOMMAND_NMTRESETCOMMUNICATIONEX, "NMTCommunicationEx" },
{EPL_ASND_NMTCOMMAND_NMTRESETCONFIGURATIONEX, "NMTResetConfigurationEx" },
{EPL_ASND_NMTCOMMAND_NMTSWRESETEX, "NMTSwResetEx" },
{EPL_ASND_NMTCOMMAND_NMTNETHOSTNAMESET, "NMTNetHostNameSet" },
{EPL_ASND_NMTCOMMAND_NMTFLUSHARPENTRY, "NMTFlushArpEntry" },
{EPL_ASND_NMTCOMMAND_NMTPUBLISHCONFIGUREDNODES, "NMTPublishConfiguredNodes" },
{EPL_ASND_NMTCOMMAND_NMTPUBLISHACTIVENODES, "NMTPublishActiveNodes" },
{EPL_ASND_NMTCOMMAND_NMTPUBLISHPREOPERATIONAL1, "NMTPublishPreOperational1" },
{EPL_ASND_NMTCOMMAND_NMTPUBLISHPREOPERATIONAL2, "NMTPublishPreOperational2" },
{EPL_ASND_NMTCOMMAND_NMTPUBLISHREADYTOOPERATE, "NMTPublishReadyToOperate" },
{EPL_ASND_NMTCOMMAND_NMTPUBLISHOPERATIONAL, "NMTPublishOperational" },
{EPL_ASND_NMTCOMMAND_NMTPUBLISHSTOPPED, "NMTPublishStopped" },
{EPL_ASND_NMTCOMMAND_NMTPUBLISHEMERGENCYNEW, "NMTPublishEmergencyNew" },
{EPL_ASND_NMTCOMMAND_NMTPUBLISHTIME, "NMTPublishTime" },
{EPL_ASND_NMTCOMMAND_NMTINVALIDSERVICE, "NMTInvalidService" },
{0,NULL}
};
static value_string_ext asnd_cid_vals_ext = VALUE_STRING_EXT_INIT(asnd_cid_vals);
/* Maximal Sequence */
#define EPL_MAX_SEQUENCE 0x40
#define EPL_MAX_ADDRESSES 0xF1
/* SCON and RCON values*/
#define EPL_NO_CONNECTION 0x00
#define EPL_INITIALIZATION 0x01
#define EPL_VALID 0x02
#define EPL_ACKREQ 0x03
#define EPL_RETRANSMISSION 0x03
/* MAX Frame offset */
#define EPL_MAX_FRAME_OFFSET 0x64
/* error codes */
#define E_NO_ERROR 0x0000
#define E_NMT_NO_IDENT_RES 0xF001
#define E_NMT_NO_STATUS_RES 0xF002
#define E_DLL_BAD_PHYS_MODE 0x8161
#define E_DLL_COLLISION 0x8162
#define E_DLL_COLLISION_TH 0x8163
#define E_DLL_CRC_TH 0x8164
#define E_DLL_LOSS_OF_LINK 0x8165
#define E_DLL_MAC_BUFFER 0x8166
#define E_DLL_ADDRESS_CONFLICT 0x8201
#define E_DLL_MULTIPLE_MN 0x8202
#define E_PDO_SHORT_RX 0x8210
#define E_PDO_MAP_VERS 0x8211
#define E_NMT_ASND_MTU_DIF 0x8212
#define E_NMT_ASND_MTU_LIM 0x8213
#define E_NMT_ASND_TX_LIM 0x8214
#define E_NMT_CYCLE_LEN 0x8231
#define E_DLL_CYCLE_EXCEED 0x8232
#define E_DLL_CYCLE_EXCEED_TH 0x8233
#define E_NMT_IDLE_LIM 0x8234
#define E_DLL_JITTER_TH 0x8235
#define E_DLL_LATE_PRES_TH 0x8236
#define E_NMT_PREQ_CN 0x8237
#define E_NMT_PREQ_LIM 0x8238
#define E_NMT_PRES_CN 0x8239
#define E_NMT_PRES_RX_LIM 0x823A
#define E_NMT_PRES_TX_LIM 0x823B
#define E_DLL_INVALID_FORMAT 0x8241
#define E_DLL_LOSS_PREQ_TH 0x8242
#define E_DLL_LOSS_PRES_TH 0x8243
#define E_DLL_LOSS_SOA_TH 0x8244
#define E_DLL_LOSS_SOC_TH 0x8245
#define E_NMT_BA1 0x8410
#define E_NMT_BA1_NO_MN_SUPPORT 0x8411
#define E_NMT_BPO1 0x8420
#define E_NMT_BPO1_GET_IDENT 0x8421
#define E_NMT_BPO1_DEVICE_TYPE 0x8422
#define E_NMT_BPO1_VENDOR_ID 0x8423
#define E_NMT_BPO1_PRODUCT_CODE 0x8424
#define E_NMT_BPO1_REVISION_NO 0x8425
#define E_NMT_BPO1_SERIAL_NO 0x8426
#define E_NMT_BPO1_CF_VERIFY 0x8428
#define E_NMT_BPO2 0x8430
#define E_NMT_BRO 0x8440
#define E_NMT_WRONG_STATE 0x8480
static const value_string errorcode_vals[] = {
{ E_NO_ERROR, "E_NO_ERROR" },
{ E_DLL_BAD_PHYS_MODE, "E_DLL_BAD_PHYS_MODE" },
{ E_DLL_COLLISION, "E_DLL_COLLISION" },
{ E_DLL_COLLISION_TH, "E_DLL_COLLISION_TH" },
{ E_DLL_CRC_TH, "E_DLL_CRC_TH" },
{ E_DLL_LOSS_OF_LINK, "E_DLL_LOSS_OF_LINK" },
{ E_DLL_MAC_BUFFER, "E_DLL_MAC_BUFFER" },
{ E_DLL_ADDRESS_CONFLICT, "E_DLL_ADDRESS_CONFLICT" },
{ E_DLL_MULTIPLE_MN, "E_DLL_MULTIPLE_MN" },
{ E_PDO_SHORT_RX, "E_PDO_SHORT_RX" },
{ E_PDO_MAP_VERS, "E_PDO_MAP_VERS" },
{ E_NMT_ASND_MTU_DIF, "E_NMT_ASND_MTU_DIF" },
{ E_NMT_ASND_MTU_LIM, "E_NMT_ASND_MTU_LIM" },
{ E_NMT_ASND_TX_LIM, "E_NMT_ASND_TX_LIM" },
{ E_NMT_CYCLE_LEN, "E_NMT_CYCLE_LEN" },
{ E_DLL_CYCLE_EXCEED, "E_DLL_CYCLE_EXCEED" },
{ E_DLL_CYCLE_EXCEED_TH, "E_DLL_CYCLE_EXCEED_TH" },
{ E_NMT_IDLE_LIM, "E_NMT_IDLE_LIM" },
{ E_DLL_JITTER_TH, "E_DLL_JITTER_TH" },
{ E_DLL_LATE_PRES_TH, "E_DLL_LATE_PRES_TH" },
{ E_NMT_PREQ_CN, "E_NMT_PREQ_CN" },
{ E_NMT_PREQ_LIM, "E_NMT_PREQ_LIM" },
{ E_NMT_PRES_CN, "E_NMT_PRES_CN" },
{ E_NMT_PRES_RX_LIM, "E_NMT_PRES_RX_LIM" },
{ E_NMT_PRES_TX_LIM, "E_NMT_PRES_TX_LIM" },
{ E_DLL_INVALID_FORMAT, "E_DLL_INVALID_FORMAT" },
{ E_DLL_LOSS_PREQ_TH, "E_DLL_LOSS_PREQ_TH" },
{ E_DLL_LOSS_PRES_TH, "E_DLL_LOSS_PRES_TH" },
{ E_DLL_LOSS_SOA_TH, "E_DLL_LOSS_SOA_TH" },
{ E_DLL_LOSS_SOC_TH, "E_DLL_LOSS_SOC_TH" },
{ E_NMT_BA1, "E_NMT_BA1" },
{ E_NMT_BA1_NO_MN_SUPPORT, "E_NMT_BA1_NO_MN_SUPPORT" },
{ E_NMT_BPO1, "E_NMT_BPO1" },
{ E_NMT_BPO1_GET_IDENT, "E_NMT_BPO1_GET_IDENT" },
{ E_NMT_BPO1_DEVICE_TYPE, "E_NMT_BPO1_DEVICE_TYPE" },
{ E_NMT_BPO1_VENDOR_ID, "E_NMT_BPO1_VENDOR_ID" },
{ E_NMT_BPO1_PRODUCT_CODE, "E_NMT_BPO1_PRODUCT_CODE" },
{ E_NMT_BPO1_REVISION_NO, "E_NMT_BPO1_REVISION_NO" },
{ E_NMT_BPO1_SERIAL_NO, "E_NMT_BPO1_SERIAL_NO" },
{ E_NMT_BPO1_CF_VERIFY, "E_NMT_BPO1_CF_VERIFY" },
{ E_NMT_BPO2, "E_NMT_BPO2" },
{ E_NMT_BRO, "E_NMT_BRO" },
{ E_NMT_WRONG_STATE, "E_NMT_WRONG_STATE" },
{ E_NMT_NO_IDENT_RES, "E_NMT_NO_IDENT_RES" },
{ E_NMT_NO_STATUS_RES, "E_NMT_NO_STATUS_RES" },
{0,NULL}
};
static value_string_ext errorcode_vals_ext = VALUE_STRING_EXT_INIT(errorcode_vals);
/* duplication table key */
typedef struct {
guint8 src;
guint8 dest;
guint8 seq_send;
guint8 seq_recv;
} duplication_key;
/* duplication table value */
typedef struct {
guint32 frame;
} duplication_data;
static guint32 ct = 0;
static guint32 count = 0;
typedef struct _epl_sdo_reassembly
{
guint32 frame[EPL_MAX_SEQUENCE][EPL_MAX_SEQUENCE];
} epl_sdo_reassembly;
static struct _epl_segmentation{
guint8 src;
guint8 dest;
guint8 recv;
guint8 send;
} epl_segmentation;
static epl_sdo_reassembly epl_asnd_sdo_reassembly_write;
static epl_sdo_reassembly epl_asnd_sdo_reassembly_read;
static gboolean first_read = TRUE;
static gboolean first_write = TRUE;
/* Priority values for EPL message type "ASnd", "", "", field PR */
#define EPL_PR_GENERICREQUEST 0x03
#define EPL_PR_NMTREQUEST 0x07
static const value_string epl_pr_vals[] = {
{0, "lowest"},
{1, "lower"},
{2, "below generic"},
{EPL_PR_GENERICREQUEST, "GenericRequest"},
{4, "above generic"},
{5, "higher"},
{6, "below NMTRequest"},
{EPL_PR_NMTREQUEST, "NMTRequest"},
{0,NULL}
};
/* NMT State values (for CN)*/
#define EPL_NMT_GS_OFF 0x00
#define EPL_NMT_GS_INITIALIZING 0x19
#define EPL_NMT_GS_RESET_APPLICATION 0x29
#define EPL_NMT_GS_RESET_COMMUNICATION 0x39
#define EPL_NMT_CS_NOT_ACTIVE 0x1C
#define EPL_NMT_CS_PRE_OPERATIONAL_1 0x1D
#define EPL_NMT_CS_PRE_OPERATIONAL_2 0x5D
#define EPL_NMT_CS_READY_TO_OPERATE 0x6D
#define EPL_NMT_CS_OPERATIONAL 0xFD
#define EPL_NMT_CS_STOPPED 0x4D
#define EPL_NMT_CS_BASIC_ETHERNET 0x1E
static const value_string epl_nmt_cs_vals[] = {
{EPL_NMT_GS_OFF, "NMT_GS_OFF" },
{EPL_NMT_GS_INITIALIZING, "NMT_GS_INITIALIZING" },
{EPL_NMT_GS_RESET_APPLICATION, "NMT_GS_RESET_APPLICATION" },
{EPL_NMT_GS_RESET_COMMUNICATION, "NMT_GS_RESET_COMMUNICATION"},
{EPL_NMT_CS_NOT_ACTIVE, "NMT_CS_NOT_ACTIVE" },
{EPL_NMT_CS_PRE_OPERATIONAL_1, "NMT_CS_PRE_OPERATIONAL_1" },
{EPL_NMT_CS_PRE_OPERATIONAL_2, "NMT_CS_PRE_OPERATIONAL_2" },
{EPL_NMT_CS_READY_TO_OPERATE, "NMT_CS_READY_TO_OPERATE" },
{EPL_NMT_CS_OPERATIONAL, "NMT_CS_OPERATIONAL" },
{EPL_NMT_CS_STOPPED, "NMT_CS_STOPPED" },
{EPL_NMT_CS_BASIC_ETHERNET, "NMT_CS_BASIC_ETHERNET" },
{0,NULL}
};
/* NMT State values (for MN)*/
#define EPL_NMT_GS_OFF 0x00
#define EPL_NMT_GS_INITIALIZING 0x19
#define EPL_NMT_GS_RESET_APPLICATION 0x29
#define EPL_NMT_GS_RESET_COMMUNICATION 0x39
#define EPL_NMT_MS_NOT_ACTIVE 0x1C
#define EPL_NMT_MS_PRE_OPERATIONAL_1 0x1D
#define EPL_NMT_MS_PRE_OPERATIONAL_2 0x5D
#define EPL_NMT_MS_READY_TO_OPERATE 0x6D
#define EPL_NMT_MS_OPERATIONAL 0xFD
#define EPL_NMT_MS_BASIC_ETHERNET 0x1E
static const value_string epl_nmt_ms_vals[] = {
{EPL_NMT_GS_OFF, "NMT_GS_OFF" },
{EPL_NMT_GS_INITIALIZING, "NMT_GS_INITIALIZING" },
{EPL_NMT_GS_RESET_APPLICATION, "NMT_GS_RESET_APPLICATION" },
{EPL_NMT_GS_RESET_COMMUNICATION, "NMT_GS_RESET_COMMUNICATION"},
{EPL_NMT_MS_NOT_ACTIVE, "NMT_MS_NOT_ACTIVE" },
{EPL_NMT_MS_PRE_OPERATIONAL_1, "NMT_MS_PRE_OPERATIONAL_1" },
{EPL_NMT_MS_PRE_OPERATIONAL_2, "NMT_MS_PRE_OPERATIONAL_2" },
{EPL_NMT_MS_READY_TO_OPERATE, "NMT_MS_READY_TO_OPERATE" },
{EPL_NMT_MS_OPERATIONAL, "NMT_MS_OPERATIONAL" },
{EPL_NMT_MS_BASIC_ETHERNET, "NMT_MS_BASIC_ETHERNET" },
{0,NULL}
};
/* EPL Device Profiles according to CANopen */
#define EPL_PROFILE_NO 0
#define EPL_PROFILE_GENERIC_IO 401
#define EPL_PROFILE_DRIVE 402
#define EPL_PROFILE_HMI 403
#define EPL_PROFILE_MEASURING 404
#define EPL_PROFILE_PLC 405
#define EPL_PROFILE_ENCODER 406
static const value_string epl_device_profiles[] = {
{EPL_PROFILE_NO, "No Standard Device"},
{EPL_PROFILE_GENERIC_IO, "Generic I/O module"},
{EPL_PROFILE_DRIVE, "Drive and motion control"},
{EPL_PROFILE_HMI, "Human Machine Interface"},
{EPL_PROFILE_MEASURING, "Measuring device"},
{EPL_PROFILE_PLC, "IEC 61131-3 PLC"},
{EPL_PROFILE_ENCODER, "Encoder"},
{0,NULL}
};
/* SDO SequenceLayer */
#define EPL_ASND_SDO_SEQ_RECEIVE_SEQUENCE_NUMBER_OFFSET 4
#define EPL_ASND_SDO_SEQ_RECEIVE_CON_OFFSET 4
#define EPL_ASND_SDO_SEQ_SEND_SEQUENCE_NUMBER_OFFSET 5
#define EPL_ASND_SDO_SEQ_SEND_CON_OFFSET 5
#define EPL_ASND_SDO_SEQ_RECEIVE_CON_NO_CONNECTION 0x00
#define EPL_ASND_SDO_SEQ_RECEIVE_CON_INITIALIZATION 0x01
#define EPL_ASND_SDO_SEQ_RECEIVE_CON_CONNECTION_VALID 0x02
#define EPL_ASND_SDO_SEQ_RECEIVE_CON_ERROR_RESPONSE 0x03
#define EPL_ASND_SDO_SEQ_CON_MASK 0x03
#define EPL_ASND_SDO_SEQ_MASK 0x02
static const value_string epl_sdo_receive_con_vals[] = {
{EPL_ASND_SDO_SEQ_RECEIVE_CON_NO_CONNECTION, "No connection" },
{EPL_ASND_SDO_SEQ_RECEIVE_CON_INITIALIZATION, "Initialization" },
{EPL_ASND_SDO_SEQ_RECEIVE_CON_CONNECTION_VALID, "Connection valid" },
{EPL_ASND_SDO_SEQ_RECEIVE_CON_ERROR_RESPONSE, "Error Response (retransmission request)"},
{0,NULL}
};
#define EPL_ASND_SDO_SEQ_SEND_CON_NO_CONNECTION 0x00
#define EPL_ASND_SDO_SEQ_SEND_CON_INITIALIZATION 0x01
#define EPL_ASND_SDO_SEQ_SEND_CON_CONNECTION_VALID 0x02
#define EPL_ASND_SDO_SEQ_SEND_CON_ERROR_VALID_ACK_REQ 0x03
static const value_string epl_sdo_init_abbr_vals[] = {
{EPL_ASND_SDO_SEQ_RECEIVE_CON_NO_CONNECTION, "n" },
{EPL_ASND_SDO_SEQ_RECEIVE_CON_INITIALIZATION, "i" },
{EPL_ASND_SDO_SEQ_RECEIVE_CON_CONNECTION_VALID, "c" },
{EPL_ASND_SDO_SEQ_RECEIVE_CON_ERROR_RESPONSE, "e" },
{0,NULL}
};
static const value_string epl_sdo_send_con_vals[] = {
{EPL_ASND_SDO_SEQ_SEND_CON_NO_CONNECTION, "No connection" },
{EPL_ASND_SDO_SEQ_SEND_CON_INITIALIZATION, "Initialization" },
{EPL_ASND_SDO_SEQ_SEND_CON_CONNECTION_VALID, "Connection valid" },
{EPL_ASND_SDO_SEQ_SEND_CON_ERROR_VALID_ACK_REQ, "Connection valid with acknowledge request" },
{0,NULL}
};
#define EPL_SDO_INIT_REQUEST ((EPL_NO_CONNECTION << 8) | EPL_INITIALIZATION)
#define EPL_SDO_INIT_ACK ((EPL_INITIALIZATION << 8) | EPL_INITIALIZATION)
#define EPL_SDO_INIT_RESPONSE ((EPL_INITIALIZATION << 8) | EPL_VALID)
#define EPL_SDO_VALID ((EPL_VALID << 8) | EPL_VALID)
#define EPL_SDO_RETRANSMISSION ((EPL_RETRANSMISSION << 8) | EPL_VALID)
#define EPL_SDO_ACKREQ ((EPL_VALID << 8) | EPL_ACKREQ)
#define EPL_SDO_CLOSE ((EPL_NO_CONNECTION << 8) | EPL_NO_CONNECTION)
static const value_string epl_sdo_init_con_vals[] = {
{EPL_SDO_INIT_REQUEST, "InitReq" },
{EPL_SDO_INIT_ACK, "InitAck" },
{EPL_SDO_INIT_RESPONSE, "InitResp" },
{EPL_SDO_VALID, "Valid" },
{EPL_SDO_RETRANSMISSION, "Retrans" },
{EPL_SDO_ACKREQ, "AckReq" },
{EPL_SDO_CLOSE, "Close" },
{0,NULL}
};
/* SDO Command Layer Protocol */
#define EPL_ASND_SDO_CMD_ABORT_FILTER 0x40
#define EPL_ASND_SDO_CMD_SEGMENTATION_FILTER 0x30
#define EPL_ASND_SDO_CMD_RESPONSE_FILTER 0x80
#define EPL_ASND_SDO_CMD_RESPONSE_RESPONSE 0
#define EPL_ASND_SDO_CMD_RESPONSE_REQUEST 1
#define EPL_ASND_SDO_CMD_ABORT_TRANSFER_OK 0
#define EPL_ASND_SDO_CMD_ABORT_ABORT_TRANSFER 1
#define EPL_ASND_SDO_CMD_SEGMENTATION_EPEDITED_TRANSFER 0
#define EPL_ASND_SDO_CMD_SEGMENTATION_INITIATE_TRANSFER 1
#define EPL_ASND_SDO_CMD_SEGMENTATION_SEGMENT 2
#define EPL_ASND_SDO_CMD_SEGMENTATION_TRANSFER_COMPLETE 3
#define EPL_ASND_SDO_COMMAND_NOT_IN_LIST 0x00
#define EPL_ASND_SDO_COMMAND_WRITE_BY_INDEX 0x01
#define EPL_ASND_SDO_COMMAND_READ_BY_INDEX 0x02
#define EPL_ASND_SDO_COMMAND_WRITE_ALL_BY_INDEX 0x03
#define EPL_ASND_SDO_COMMAND_READ_ALL_BY_INDEX 0x04
#define EPL_ASND_SDO_COMMAND_WRITE_BY_NAME 0x05
#define EPL_ASND_SDO_COMMAND_READ_BY_NAME 0x06
#define EPL_ASND_SDO_COMMAND_FILE_WRITE 0x20
#define EPL_ASND_SDO_COMMAND_FILE_READ 0x21
#define EPL_ASND_SDO_COMMAND_WRITE_MULTIPLE_PARAMETER_BY_INDEX 0x31
#define EPL_ASND_SDO_COMMAND_READ_MULTIPLE_PARAMETER_BY_INDEX 0x32
#define EPL_ASND_SDO_COMMAND_MAXIMUM_SEGMENT_SIZE 0x70
#define EPL_ASND_SDO_COMMAND_LINK_NAME_TO_INDEX 0x71
/* OD indexes */
#define EPL_SOD_CYLE_LEN 0x1006
#define EPL_SOD_PDO_RX_COMM 0x1400
#define EPL_SOD_PDO_RX_MAPP 0x1600
#define EPL_SOD_PDO_TX_COMM 0x1800
#define EPL_SOD_PDO_TX_MAPP 0x1A00
#define EPL_SDO_SERVER_CONT 0x1200
#define EPL_SDO_CLIENT_CONT 0x1280
#define EPL_SOD_ERR_HISTORY 0x1003
#define EPL_SOD_STORE_PARAM 0x1010
#define EPL_SOD_RESTORE_PARAM 0x1011
#define EPL_SOD_HEARTBEAT_TMN 0x1016
#define EPL_SOD_IDENTITY_OBJECT 0x1018
#define EPL_SOD_VERIFY_CONF 0x1020
#define EPL_SOD_INT_GRP 0x1030
#define EPL_SOD_RLATENCY_DIFF 0x1050
#define EPL_SOD_TELEG_Count 0x1101
#define EPL_SOD_ERR_STAT 0x1102
#define EPL_SOD_STORE_DCF_LST 0x1F20
#define EPL_SOD_STORE_CFM_FMT 0x1F21
#define EPL_SOD_STORE_CON_LST 0x1F22
#define EPL_SOD_STORE_DEV_FILE 0x1F23
#define EPL_SOD_STORE_DEV_FMT 0x1F24
#define EPL_SOD_CONF_REQ 0x1F25
#define EPL_SOD_CONF_DATE 0x1F26
#define EPL_SOD_CONF_TIME 0x1F27
#define EPL_SOD_CONF_ID 0x1F28
#define EPL_SOD_DL_PROG_DATA 0x1F50
#define EPL_SOD_DL_PROG_CTRL 0x1F51
#define EPL_SOD_LOC_SW 0x1F52
#define EPL_SOD_MN_SW_DATE 0x1F53
#define EPL_SOD_MN_SW_TIME 0x1F54
#define EPL_SOD_PROC_IMG 0x1F70
#define EPL_SOD_NMT_NODE 0x1F81
#define EPL_SOD_DEVICE_TYPE_LST 0x1F84
#define EPL_SOD_VENDORID_LST 0x1F85
#define EPL_SOD_PRODUCTEC_LST 0x1F86
#define EPL_SOD_REVISION_NO_LST 0x1F87
#define EPL_SOD_SERIAL_NO_LST 0x1F88
#define EPL_SOD_BOOT_TIME 0x1F89
#define EPL_SOD_CYCLE_TIME 0x1F8A
#define EPL_SOD_PREQ_PAYLOAD 0x1F8B
#define EPL_SOD_PRES_PAYLOAD 0x1F8D
#define EPL_SOD_NODE_STATE 0x1F8E
#define EPL_SOD_NODE_EXP_STATE 0x1F8F
#define EPL_SOD_CNRES_TMOUT 0x1F92
#define EPL_SOD_MULT_CYCL 0x1F9B
#define EPL_SOD_ISO_SLOT_ASSIGN 0x1F9C
#define EPL_SOD_NAT_TABLE 0x1D00
#define EPL_SOD_IP_ADD_TABLE 0x1E40
#define EPL_SOD_ROUTING_TABLE 0x1E90
#define EPL_SOD_ACL_IN_TABLE 0x1ED0
#define EPL_SOD_ACL_OUT_TABLE 0x1EE0
#define EPL_SOD_CYLE_LEN 0x1006
#define EPL_NMT_DEVICE_TYPE 0x1000
#define EPL_ERR_ERROR_REGISTER 0x1001
#define EPL_MANUFACT_DEV_NAME 0x1008
#define EPL_MANUFACT_HW_VERS 0x1009
#define EPL_MANUFACT_SW_VERS 0x100A
#define EPL_STORE_DEV_FILE 0x1021
#define EPL_STORE_DEV_FORMAT 0x1022
#define EPL_INT_GROUP 0x1300
#define EPL_INT_INDEX 0x1301
#define EPL_INT_DESC 0x1302
#define EPL_VERSION 0x1F83
#define EPL_CN_ETH_TIMEOUT 0x1F99
#define EPL_HOST_NAME 0x1F9A
#define EPL_CN_LINK_CUM 0x1C10
#define EPL_CN_JITTER 0x1C13
#define EPL_LOSS_OF_FRAME 0x1C14
static const range_string sod_cmd_str[] = {
{EPL_SOD_PDO_RX_COMM, 0x14FF, "0x1400"},
{EPL_SOD_PDO_RX_MAPP, 0x16FF, "0x1600"},
{EPL_SOD_PDO_TX_COMM, 0x18FF, "0x1800"},
{EPL_SOD_PDO_TX_MAPP, 0x1AFF, "0x1A00"},
{EPL_SDO_SERVER_CONT, 0x1279, "0x1200"},
{EPL_SDO_CLIENT_CONT, 0x12FF, "0x1280"},
{EPL_SOD_NAT_TABLE, 0x1DFF, "0x1D00"},
{EPL_SOD_IP_ADD_TABLE, 0x1E49, "0x1E40"},
{EPL_SOD_ROUTING_TABLE, 0x1ECF, "0x1E90"},
{EPL_SOD_ACL_IN_TABLE, 0x1EDF, "0x1ED0"},
{EPL_SOD_ACL_OUT_TABLE, 0x1EEF, "0x1EE0"},
{0,0,NULL}
};
static const value_string sod_cmd_str_val[] = {
{EPL_SOD_PDO_RX_COMM, "0x1400"},
{EPL_SOD_PDO_RX_MAPP, "0x1600"},
{EPL_SOD_PDO_TX_COMM, "0x1800"},
{EPL_SOD_PDO_TX_MAPP, "0x1A00"},
{EPL_SDO_SERVER_CONT, "0x1200"},
{EPL_SDO_CLIENT_CONT, "0x1280"},
{EPL_SOD_NAT_TABLE, "0x1D00"},
{EPL_SOD_IP_ADD_TABLE, "0x1E40"},
{EPL_SOD_ROUTING_TABLE, "0x1E90"},
{EPL_SOD_ACL_IN_TABLE, "0x1ED0"},
{EPL_SOD_ACL_OUT_TABLE, "0x1EE0"},
{0,NULL}
};
static const value_string sod_cmd_sub_str_val[] = {
{EPL_SOD_ERR_HISTORY, "0x1003"},
{EPL_SOD_HEARTBEAT_TMN, "0x1016"},
{EPL_SOD_STORE_DCF_LST, "0x1F20"},
{EPL_SOD_STORE_CFM_FMT, "0x1F21"},
{EPL_SOD_STORE_CON_LST, "0x1F22"},
{EPL_SOD_STORE_DEV_FILE, "0x1F23"},
{EPL_SOD_STORE_DEV_FMT, "0x1F24"},
{EPL_SOD_CONF_REQ, "0x1F25"},
{EPL_SOD_CONF_DATE, "0x1F26"},
{EPL_SOD_CONF_TIME, "0x1F27"},
{EPL_SOD_CONF_ID, "0x1F28"},
{EPL_SOD_DL_PROG_DATA, "0x1F50"},
{EPL_SOD_DL_PROG_CTRL, "0x1F51"},
{EPL_SOD_MN_SW_DATE, "0x1F53"},
{EPL_SOD_MN_SW_TIME, "0x1F54"},
{EPL_SOD_NMT_NODE, "0x1F81"},
{EPL_SOD_DEVICE_TYPE_LST,"0x1F84"},
{EPL_SOD_VENDORID_LST, "0x1F85"},
{EPL_SOD_PRODUCTEC_LST, "0x1F86"},
{EPL_SOD_REVISION_NO_LST,"0x1F87"},
{EPL_SOD_SERIAL_NO_LST, "0x1F88"},
{EPL_SOD_PREQ_PAYLOAD, "0x1F8B"},
{EPL_SOD_PRES_PAYLOAD, "0x1F8D"},
{EPL_SOD_NODE_STATE, "0x1F8E"},
{EPL_SOD_NODE_EXP_STATE, "0x1F8F"},
{EPL_SOD_CNRES_TMOUT, "0x1F92"},
{EPL_SOD_MULT_CYCL, "0x1F9B"},
{EPL_SOD_ISO_SLOT_ASSIGN,"0x1F9C"},
{0,NULL}
};
static value_string_ext sod_cmd_sub_str = VALUE_STRING_EXT_INIT(sod_cmd_sub_str_val);
static const value_string sod_cmd_str_no_sub[] = {
{EPL_NMT_DEVICE_TYPE, "0x1000"},
{EPL_ERR_ERROR_REGISTER, "0x1001"},
{EPL_SOD_CYLE_LEN, "0x1006"},
{EPL_MANUFACT_DEV_NAME, "0x1008"},
{EPL_MANUFACT_HW_VERS, "0x1009"},
{EPL_MANUFACT_SW_VERS, "0x100A"},
{EPL_STORE_DEV_FILE, "0x1021"},
{EPL_STORE_DEV_FORMAT, "0x1022"},
{EPL_INT_GROUP, "0x1300"},
{EPL_INT_INDEX, "0x1301"},
{EPL_INT_DESC, "0x1302"},
{EPL_CN_LINK_CUM, "0x1C10"},
{EPL_CN_JITTER, "0x1C13"},
{EPL_LOSS_OF_FRAME, "0x1C14"},
{EPL_VERSION, "0x1F83"},
{EPL_CN_ETH_TIMEOUT, "0x1F99"},
{EPL_HOST_NAME, "0x1F9A"},
{0,NULL}
};
static value_string_ext sod_cmd_no_sub = VALUE_STRING_EXT_INIT(sod_cmd_str_no_sub);
static const value_string sod_idx_names[] = {
/* SDO directory names */
{0x10000000, "NMT_DeviceType_U32"},
{0x10010000, "ERR_ErrorRegister_U8"},
{0x10030000, "ERR_History_ADOM"},
{0x10030001, "ErrorEntry_DOM"},
{0x10060000, "NMT_CycleLen_U32"},
{0x10080000, "NMT_ManufactDevName_VS"},
{0x10090000, "NMT_ManufactHwVers_VS"},
{0x100A0000, "NMT_ManufactSwVers_VS"},
{0x10100000, "NMT_StoreParam_REC"},
{0x10100001, "AllParam_U32"},
{0x10100002, "CommunicationParam_U32"},
{0x10100003, "ApplicationParam_U32"},
{0x10100004, "ManufacturerParam_XXh_U32"},
{0x10110000, "NMT_RestoreDefParam_REC"},
{0x10110001, "AllParam_U32"},
{0x10110002, "CommunicationParam_U32"},
{0x10110003, "ApplicationParam_U32"},
{0x10110004, "ManufacturerParam_XXh_U32"},
{0x10160000, "NMT_ConsumerHeartbeatTime_AU32"},
{0x10160001, "HeartbeatDescription"},
{0x10180000, "NMT_IdentityObject_REC" },
{0x10180001, "VendorId_U32" },
{0x10180002, "ProductCode_U32" },
{0x10180003, "RevisionNo_U32" },
{0x10180004, "SerialNo_U32" },
{0x10200000, "CFM_VerifyConfiguration_REC"},
{0x10200001, "ConfDate_U32"},
{0x10200002, "ConfTime_U32"},
{0x10200003, "ConfId_U32"},
{0x10200004, "VerifyConfInvalid_BOOL"},
{0x10210000, "CFM_StoreDevDescrFile_DOM"},
{0x10220000, "CFM_StoreDevDescrFormat_U16"},
{0x10300000, "NMT_InterfaceGroup_XX_REC"},
{0x10300001, "InterfaceIndex_U16"},
{0x10300002, "InterfaceDescription_VSTR"},
{0x10300003, "InterfaceType_U8"},
{0x10300004, "InterfaceMtu_U16"},
{0x10300005, "InterfacePhysAddress_OSTR"},
{0x10300006, "InterfaceName_VSTR"},
{0x10300007, "InterfaceOperStatus_U8"},
{0x10300008, "InterfaceAdminState_U8"},
{0x10300009, "Valid_BOOL"},
{0x10500000, "NMT_RelativeLatencyDiff_AU32"},
{0x10500000, "RelativeLatencyDiff"},
{0x11010000, "DIA_NMTTelegrCount_REC"},
{0x11010001, "IsochrCyc_U32"},
{0x11010002, "IsochrRx_U32"},
{0x11010003, "IsochrTx_U32"},
{0x11010004, "AsyncRx_U32"},
{0x11010005, "AsyncTx_U32"},
{0x11010006, "SdoRx_U32"},
{0x11010007, "SdoTx_U32"},
{0x11010008, "Status_U32"},
{0x11020000, "DIA_ERRStatistics_REC"},
{0x11020001, "HistoryEntryWrite_U32"},
{0x11020002, "EmergencyQueueWrite_U32"},
{0x11020003, "EmergencyQueueOverflow_U32"},
{0x11020004, "StatusEntryChanged_U32"},
{0x11020005, "StaticErrorBitFieldChanged_U32"},
{0x11020006, "ExceptionResetEdgePos_U32"},
{0x11020007, "ExceptionNewEdge_U32"},
{0x12000000, "SDO_ServerContainerParam"},
{0x12000001, "ClientNodeID_U8"},
{0x12000002, "ServerNodeID_U8"},
{0x12000003, "ContainerLen_U8"},
{0x12000004, "HistorySize_U8"},
{0x12800000, "SDO_ClientContainerParam"},
{0x12800001, "ClientNodeID_U8"},
{0x12800002, "ServerNodeID_U8"},
{0x12800003, "ContainerLen_U8"},
{0x12800004, "HistorySize_U8"},
{0x12800005, "Reserved"},
{0x13000000, "SDO_SequLayerTimeout_U32"},
{0x13010000, "SDO_CmdLayerTimeout_U32"},
{0x13020000, "SDO_SequLayerNoAck_U32"},
{0x14000000, "PDO_RxCommParam"},
{0x14000001, "NodeID_U8"},
{0x14000002, "MappingVersion_U8"},
{0x16000000, "PDO_RxMappParam"},
{0x16000001, "ObjectMapping"},
{0x18000000, "PDO_TxCommParam"},
{0x18000001, "NodeID_U8"},
{0x18000002, "MappingVersion"},
{0x1A000000, "PDO_TxMappParam"},
{0x1A000001, "ObjectMapping"},
{0x1C0A0000, "DLL_CNCollision_REC"},
{0x1C0A0001, "CumulativeCnt_U32"},
{0x1C0A0002, "ThresholdCnt_U32"},
{0x1C0A0003, "Threshold_U32"},
{0x1C0B0000, "DLL_CNLossSoC_REC"},
{0x1C0B0001, "CumulativeCnt_U32"},
{0x1C0B0002, "ThresholdCnt_U32"},
{0x1C0B0003, "Threshold_U32"},
{0x1C0C0000, "DLL_CNLossSoA_REC"},
{0x1C0C0001, "CumulativeCnt_U32"},
{0x1C0C0002, "ThresholdCnt_U32"},
{0x1C0C0003, "Threshold_U32"},
{0x1C0D0000, "DLL_CNLossPReq_REC"},
{0x1C0D0001, "CumulativeCnt_U32"},
{0x1C0D0002, "ThresholdCnt_U32"},
{0x1C0D0003, "Threshold_U32"},
{0x1C0E0000, "DLL_CNSoCJitter_REC"},
{0x1C0E0001, "CumulativeCnt_U32"},
{0x1C0E0002, "ThresholdCnt_U32"},
{0x1C0E0003, "Threshold_U32"},
{0x1C0F0000, "DLL_CNCRCError_REC"},
{0x1C0F0001, "CumulativeCnt_U32"},
{0x1C0F0002, "ThresholdCnt_U32"},
{0x1C0F0003, "Threshold_U32"},
{0x1C100000, "DLL_CNLossOfLinkCum_U32"},
{0x1C130000, "DLL_CNSoCJitterRange_U32"},
{0x1C140000, "DLL_LossOfFrameTolerance_U32"},
{0x1D000000, "RT1_NatTable"},
{0x1D000001, "EplIpAddr_IPAD"},
{0x1D000002, "ExtIpAddr_IPAD"},
{0x1D000003, "Mask_IPAD"},
{0x1D000004, "Type_U8"},
{0x1E400000, "NWL_IpAddrTable"},
{0x1E400001, "IfIndex_U16"},
{0x1E400002, "Addr_IPAD"},
{0x1E400003, "NetMask_IPAD"},
{0x1E400004, "ReasmMaxSize_U16"},
{0x1E400005, "DefaultGateway_IPAD"},
{0x1E4A0000, "NWL_IpGroup_REC"},
{0x1E4A0001, "Forwarding_BOOL"},
{0x1E4A0002, "DefaultTTL_U16"},
{0x1E4A0003, "ForwardDatagrams_U32"},
{0x1E800000, "RT1_EplRouter_REC"},
{0x1E800001, "EnableNat_BOOL"},
{0x1E800002, "EnablePacketFiltering_BOOL"},
{0x1E810000, "RT1_SecurityGroup_REC"},
{0x1E810001, "FwdTablePolicy_U8"},
{0x1E810002, "InTablePolicy_U8"},
{0x1E810003, "OutTablePolicy_U8"},
{0x1E900000, "RT1_IpRoutingTable"},
{0x1E900001, "IpForwardDest_IPAD"},
{0x1E900002, "IpForwardMask_IPAD"},
{0x1E900003, "IpForwardNextHop_IPAD"},
{0x1E900004, "IpForwardType_U8"},
{0x1E900005, "IpForwardAge_U32"},
{0x1E900006, "IpForwardItfIndex_U16"},
{0x1E900007, "IpForwardMetric1_S32"},
{0x1ED00000, "RT1_AclInTable"},
{0x1ED00001, "SrcIp_IPAD"},
{0x1ED00002, "SrcMask_IPAD"},
{0x1ED00003, "DstIp_IPAD"},
{0x1ED00004, "DstMask_IPAD"},