diff options
author | Richard Kuemmel <kuemmel.ric@googlemail.com> | 2019-05-28 08:13:55 +0200 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2019-06-09 13:54:43 +0000 |
commit | fc758f97c26c60158cab63a513ee8d4f1790eb5f (patch) | |
tree | 3f22199c0a3e80dd3809554b64fc4ac878c0850d /plugins/epan | |
parent | 8c3d23f2f7c7f866210b430f3777c8a3add8b67f (diff) |
ethercat: add new hf item for sdo abort code.
Add new hf item for sdo abort code and display abort code instead of index.
Added check of APWR and FPRW to decide if an EtherCAT command is a mailbox
command.
Change-Id: I42877c26cb70c7567dc2d1b703e84aad8a3f7ac8
Reviewed-on: https://code.wireshark.org/review/33405
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'plugins/epan')
-rw-r--r-- | plugins/epan/ethercat/packet-ecatmb.c | 9 | ||||
-rw-r--r-- | plugins/epan/ethercat/packet-ethercat-datagram.c | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/plugins/epan/ethercat/packet-ecatmb.c b/plugins/epan/ethercat/packet-ecatmb.c index be8baccb01..0434d0cbb3 100644 --- a/plugins/epan/ethercat/packet-ecatmb.c +++ b/plugins/epan/ethercat/packet-ecatmb.c @@ -108,6 +108,7 @@ static int hf_ecat_mailbox_coe_sdoccsus_toggle = -1; static int hf_ecat_mailbox_coe_sdoccsiu = -1; /* static int hf_ecat_mailbox_coe_sdoccsiu_complete = -1; */ static int hf_ecat_mailbox_coe_sdoidx = -1; +static int hf_ecat_mailbox_coe_sdoabortcode = -1; static int hf_ecat_mailbox_coe_sdosub = -1; static int hf_ecat_mailbox_coe_sdodata = -1; static int hf_ecat_mailbox_coe_sdodata1 = -1; @@ -592,7 +593,7 @@ static void dissect_ecat_coe(tvbuff_t *tvb, gint offset, packet_info *pinfo, pro proto_tree_add_item(ecat_coe_sdoccs_tree, hf_ecat_mailbox_coe_sdoccsus_toggle, tvb, offset, 1, ENC_LITTLE_ENDIAN); break; case SDO_CCS_ABORT_TRANSFER: - proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoidx, tvb, offset+4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoabortcode, tvb, offset+4, 4, ENC_LITTLE_ENDIAN); break; } } @@ -1591,12 +1592,16 @@ void proto_register_ecat_mailbox(void) FT_BOOLEAN, 8, TFS(&flags_set_truth), 0x00000010, NULL, HFILL } }, - { &hf_ecat_mailbox_coe_sdoidx, { "Index", "ecat_mailbox.coe.sdoidx", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, + { &hf_ecat_mailbox_coe_sdoabortcode, + { "Abort code", "ecat_mailbox.coe.abortcode", + FT_UINT32, BASE_HEX, NULL, 0x0, + NULL, HFILL } + }, { &hf_ecat_mailbox_coe_sdosub, { "SubIndex", "ecat_mailbox.coe.sdosub", FT_UINT8, BASE_HEX, NULL, 0x0, diff --git a/plugins/epan/ethercat/packet-ethercat-datagram.c b/plugins/epan/ethercat/packet-ethercat-datagram.c index 2dfcabf2d4..d0cbed2652 100644 --- a/plugins/epan/ethercat/packet-ethercat-datagram.c +++ b/plugins/epan/ethercat/packet-ethercat-datagram.c @@ -1632,7 +1632,7 @@ static int dissect_ecat_datagram(tvbuff_t *tvb, packet_info *pinfo, proto_tree * guint dataLength = len; if ( len >= ETHERCAT_MBOX_HEADER_LEN && - ((ecHdr.cmd==EC_CMD_TYPE_FPWR || ecHdr.cmd == EC_CMD_TYPE_APWR) || ((ecHdr.cmd==EC_CMD_TYPE_FPRD || ecHdr.cmd==EC_CMD_TYPE_APRD) && cnt==1) ) && + ((ecHdr.cmd==EC_CMD_TYPE_FPWR || ecHdr.cmd == EC_CMD_TYPE_APWR || ecHdr.cmd == EC_CMD_TYPE_APRW || ecHdr.cmd == EC_CMD_TYPE_FPRW) || ((ecHdr.cmd==EC_CMD_TYPE_FPRD || ecHdr.cmd==EC_CMD_TYPE_APRD) && cnt==1) ) && ecHdr.anAddrUnion.a.ado>=0x1000 ) { |