summaryrefslogtreecommitdiffstats
path: root/plugins/epan/ethercat
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:26 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:26 +0000
commitc4e8a3222648fcf22ca207f1815ebbf7cd144eeb (patch)
tree93d5c6aa93d9987680dd1adad5685e2ad698f223 /plugins/epan/ethercat
parentAdding upstream version 4.2.6. (diff)
downloadwireshark-upstream.tar.xz
wireshark-upstream.zip
Adding upstream version 4.4.0.upstream/4.4.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'plugins/epan/ethercat')
-rw-r--r--plugins/epan/ethercat/packet-ams.c392
-rw-r--r--plugins/epan/ethercat/packet-ams.h132
-rw-r--r--plugins/epan/ethercat/packet-ecatmb.c384
-rw-r--r--plugins/epan/ethercat/packet-ecatmb.h258
-rw-r--r--plugins/epan/ethercat/packet-esl.c118
-rw-r--r--plugins/epan/ethercat/packet-ethercat-datagram.c908
-rw-r--r--plugins/epan/ethercat/packet-ethercat-datagram.h14
-rw-r--r--plugins/epan/ethercat/packet-ethercat-frame.c14
-rw-r--r--plugins/epan/ethercat/packet-ethercat-frame.h8
-rw-r--r--plugins/epan/ethercat/packet-ioraw.c16
-rw-r--r--plugins/epan/ethercat/packet-ioraw.h2
-rw-r--r--plugins/epan/ethercat/packet-nv.c106
-rw-r--r--plugins/epan/ethercat/packet-nv.h16
13 files changed, 1184 insertions, 1184 deletions
diff --git a/plugins/epan/ethercat/packet-ams.c b/plugins/epan/ethercat/packet-ams.c
index b6246eb5..21ae65c7 100644
--- a/plugins/epan/ethercat/packet-ams.c
+++ b/plugins/epan/ethercat/packet-ams.c
@@ -24,98 +24,98 @@ void proto_reg_handoff_ams(void);
#define AMS_TCP_PORT 48898 /* Not IANA registered */
/* Define the ams proto */
-int proto_ams = -1;
+int proto_ams;
static dissector_handle_t amstcp_handle;
/* Define the tree for ams */
-static int ett_ams = -1;
-static int ett_ams_stateflags = -1;
-static int ett_ams_adsreadrequest = -1;
-static int ett_ams_adsreadresponse = -1;
-static int ett_ams_adswriterequest = -1;
-static int ett_ams_adswriteresponse = -1;
-static int ett_ams_adsreadwriterequest = -1;
-static int ett_ams_adsreadwriteresponse = -1;
-static int ett_ams_adsreadstaterequest = -1;
-static int ett_ams_adsreadstateresponse = -1;
-static int ett_ams_adswritectrlrequest = -1;
-static int ett_ams_adswritectrlresponse = -1;
-static int ett_ams_adsreaddinforequest = -1;
-static int ett_ams_adsreaddinforesponse = -1;
-static int ett_ams_adsadddnrequest = -1;
-static int ett_ams_adsadddnresponse = -1;
-static int ett_ams_adsdeldnrequest = -1;
-static int ett_ams_adsdeldnresponse = -1;
-static int ett_ams_adsdnrequest = -1;
-
-static int hf_ams_sendernetid = -1;
-static int hf_ams_senderport = -1;
-static int hf_ams_targetnetid = -1;
-static int hf_ams_targetport = -1;
-static int hf_ams_cmdid = -1;
-static int hf_ams_stateflags = -1;
-static int hf_ams_stateresponse = -1;
-static int hf_ams_statenoreturn = -1;
-static int hf_ams_stateadscmd = -1;
-static int hf_ams_statesyscmd = -1;
-static int hf_ams_statehighprio = -1;
-static int hf_ams_statetimestampadded = -1;
-static int hf_ams_stateudp = -1;
-static int hf_ams_stateinitcmd = -1;
-static int hf_ams_statebroadcast = -1;
-static int hf_ams_cbdata = -1;
-static int hf_ams_errorcode = -1;
-static int hf_ams_invokeid = -1;
-static int hf_ams_data = -1;
+static int ett_ams;
+static int ett_ams_stateflags;
+static int ett_ams_adsreadrequest;
+static int ett_ams_adsreadresponse;
+static int ett_ams_adswriterequest;
+static int ett_ams_adswriteresponse;
+static int ett_ams_adsreadwriterequest;
+static int ett_ams_adsreadwriteresponse;
+static int ett_ams_adsreadstaterequest;
+static int ett_ams_adsreadstateresponse;
+static int ett_ams_adswritectrlrequest;
+static int ett_ams_adswritectrlresponse;
+static int ett_ams_adsreaddinforequest;
+static int ett_ams_adsreaddinforesponse;
+static int ett_ams_adsadddnrequest;
+static int ett_ams_adsadddnresponse;
+static int ett_ams_adsdeldnrequest;
+static int ett_ams_adsdeldnresponse;
+static int ett_ams_adsdnrequest;
+
+static int hf_ams_sendernetid;
+static int hf_ams_senderport;
+static int hf_ams_targetnetid;
+static int hf_ams_targetport;
+static int hf_ams_cmdid;
+static int hf_ams_stateflags;
+static int hf_ams_stateresponse;
+static int hf_ams_statenoreturn;
+static int hf_ams_stateadscmd;
+static int hf_ams_statesyscmd;
+static int hf_ams_statehighprio;
+static int hf_ams_statetimestampadded;
+static int hf_ams_stateudp;
+static int hf_ams_stateinitcmd;
+static int hf_ams_statebroadcast;
+static int hf_ams_cbdata;
+static int hf_ams_errorcode;
+static int hf_ams_invokeid;
+static int hf_ams_data;
/*ads Commands */
-static int hf_ams_adsindexgroup = -1;
-static int hf_ams_adsindexoffset = -1;
-static int hf_ams_adscblength = -1;
-static int hf_ams_adsreadrequest = -1;
-static int hf_ams_adsreadresponse = -1;
-static int hf_ams_adsinvokeid = -1;
-static int hf_ams_adsresult = -1;
-static int hf_ams_adsdata = -1;
-static int hf_ams_adswriterequest = -1;
-static int hf_ams_adswriteresponse = -1;
-static int hf_ams_adsreadwriterequest = -1;
-static int hf_ams_adsreadwriteresponse = -1;
-static int hf_ams_adscbreadlength = -1;
-static int hf_ams_adscbwritelength = -1;
-static int hf_ams_adsstate = -1;
-static int hf_ams_adsdevicestate = -1;
-static int hf_ams_adsnotificationhandle = -1;
-static int hf_ams_adsreadstaterequest = -1;
-static int hf_ams_adsreadstateresponse = -1;
-static int hf_ams_adswritectrlrequest = -1;
-static int hf_ams_adswritectrlresponse = -1;
-static int hf_ams_adsreaddinforequest = -1;
-static int hf_ams_adsreaddinforesponse = -1;
-static int hf_ams_adsadddnrequest = -1;
-static int hf_ams_adsadddnresponse = -1;
-static int hf_ams_adsdeldnrequest = -1;
-static int hf_ams_adsdeldnresponse = -1;
-static int hf_ams_adsdnrequest = -1;
-/* static int hf_ams_adsdnresponse = -1; */
-/* static int hf_ams_adsnoteattrib = -1; */
-/* static int hf_ams_adsnoteblocks = -1; */
-/* static int hf_ams_adsversion = -1; */
-static int hf_ams_adsdevicename = -1;
-static int hf_ams_adsversionversion = -1;
-static int hf_ams_adsversionrevision = -1;
-static int hf_ams_adsversionbuild = -1;
-static int hf_ams_adsnoteblocksstamps = -1;
-/* static int hf_ams_adsnoteblocksstamp = -1; */
-/* static int hf_ams_adstimestamp = -1; */
-/* static int hf_ams_adssamplecnt = -1; */
-/* static int hf_ams_adsnoteblockssample = -1; */
-static int hf_ams_adstransmode = -1;
-static int hf_ams_adsmaxdelay = -1;
-static int hf_ams_adscycletime = -1;
-/* static int hf_ams_adscmpmax = -1; */
-/* static int hf_ams_adscmpmin = -1; */
+static int hf_ams_adsindexgroup;
+static int hf_ams_adsindexoffset;
+static int hf_ams_adscblength;
+static int hf_ams_adsreadrequest;
+static int hf_ams_adsreadresponse;
+static int hf_ams_adsinvokeid;
+static int hf_ams_adsresult;
+static int hf_ams_adsdata;
+static int hf_ams_adswriterequest;
+static int hf_ams_adswriteresponse;
+static int hf_ams_adsreadwriterequest;
+static int hf_ams_adsreadwriteresponse;
+static int hf_ams_adscbreadlength;
+static int hf_ams_adscbwritelength;
+static int hf_ams_adsstate;
+static int hf_ams_adsdevicestate;
+static int hf_ams_adsnotificationhandle;
+static int hf_ams_adsreadstaterequest;
+static int hf_ams_adsreadstateresponse;
+static int hf_ams_adswritectrlrequest;
+static int hf_ams_adswritectrlresponse;
+static int hf_ams_adsreaddinforequest;
+static int hf_ams_adsreaddinforesponse;
+static int hf_ams_adsadddnrequest;
+static int hf_ams_adsadddnresponse;
+static int hf_ams_adsdeldnrequest;
+static int hf_ams_adsdeldnresponse;
+static int hf_ams_adsdnrequest;
+/* static int hf_ams_adsdnresponse; */
+/* static int hf_ams_adsnoteattrib; */
+/* static int hf_ams_adsnoteblocks; */
+/* static int hf_ams_adsversion; */
+static int hf_ams_adsdevicename;
+static int hf_ams_adsversionversion;
+static int hf_ams_adsversionrevision;
+static int hf_ams_adsversionbuild;
+static int hf_ams_adsnoteblocksstamps;
+/* static int hf_ams_adsnoteblocksstamp; */
+/* static int hf_ams_adstimestamp; */
+/* static int hf_ams_adssamplecnt; */
+/* static int hf_ams_adsnoteblockssample; */
+static int hf_ams_adstransmode;
+static int hf_ams_adsmaxdelay;
+static int hf_ams_adscycletime;
+/* static int hf_ams_adscmpmax; */
+/* static int hf_ams_adscmpmin; */
static dissector_handle_t ams_handle;
@@ -372,28 +372,28 @@ static const value_string AMS_CommandId_vals[] =
};
-static void NetIdFormater(tvbuff_t *tvb, guint offset, char *szText, gint nMax)
+static void NetIdFormater(tvbuff_t *tvb, unsigned offset, char *szText, int nMax)
{
- snprintf ( szText, nMax, "%d.%d.%d.%d.%d.%d", tvb_get_guint8(tvb, offset),
- tvb_get_guint8(tvb, offset+1),
- tvb_get_guint8(tvb, offset+2),
- tvb_get_guint8(tvb, offset+3),
- tvb_get_guint8(tvb, offset+4),
- tvb_get_guint8(tvb, offset+5)
+ snprintf ( szText, nMax, "%d.%d.%d.%d.%d.%d", tvb_get_uint8(tvb, offset),
+ tvb_get_uint8(tvb, offset+1),
+ tvb_get_uint8(tvb, offset+2),
+ tvb_get_uint8(tvb, offset+3),
+ tvb_get_uint8(tvb, offset+4),
+ tvb_get_uint8(tvb, offset+5)
);
}
/*ams*/
-static gint dissect_ams_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
+static int dissect_ams_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
{
proto_item *ti, *anItem;
proto_tree *ams_tree = NULL, *ams_adstree, *ams_statetree;
- guint ams_length = tvb_reported_length(tvb);
- guint16 stateflags = 0;
- guint16 cmdId = 0;
- guint32 cbdata = 0;
+ unsigned ams_length = tvb_reported_length(tvb);
+ uint16_t stateflags = 0;
+ uint16_t cmdId = 0;
+ uint32_t cbdata = 0;
char szText[200];
int nMax = sizeof(szText)-1;
@@ -414,43 +414,43 @@ static gint dissect_ams_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_tree_add_string(ams_tree, hf_ams_targetnetid, tvb, offset, AmsNetId_Len, szText);
offset += AmsNetId_Len;
- proto_tree_add_item(ams_tree, hf_ams_targetport, tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
- offset += (int)sizeof(guint16);
+ proto_tree_add_item(ams_tree, hf_ams_targetport, tvb, offset, (int)sizeof(uint16_t), ENC_LITTLE_ENDIAN);
+ offset += (int)sizeof(uint16_t);
NetIdFormater(tvb, offset, szText, nMax);
proto_tree_add_string(ams_tree, hf_ams_sendernetid, tvb, offset, AmsNetId_Len, szText);
offset += AmsNetId_Len;
- proto_tree_add_item(ams_tree, hf_ams_senderport, tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
- offset += (int)sizeof(guint16);
+ proto_tree_add_item(ams_tree, hf_ams_senderport, tvb, offset, (int)sizeof(uint16_t), ENC_LITTLE_ENDIAN);
+ offset += (int)sizeof(uint16_t);
- proto_tree_add_item(ams_tree, hf_ams_cmdid, tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_tree, hf_ams_cmdid, tvb, offset, (int)sizeof(uint16_t), ENC_LITTLE_ENDIAN);
cmdId = tvb_get_letohs(tvb, offset);
- offset+=(int)sizeof(guint16);
+ offset+=(int)sizeof(uint16_t);
- anItem = proto_tree_add_item(ams_tree, hf_ams_stateflags, tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
+ anItem = proto_tree_add_item(ams_tree, hf_ams_stateflags, tvb, offset, (int)sizeof(uint16_t), ENC_LITTLE_ENDIAN);
ams_statetree = proto_item_add_subtree(anItem, ett_ams_stateflags);
- proto_tree_add_item(ams_statetree, hf_ams_stateresponse,tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ams_statetree, hf_ams_statenoreturn,tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ams_statetree, hf_ams_stateadscmd,tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ams_statetree, hf_ams_statesyscmd,tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ams_statetree, hf_ams_statehighprio,tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ams_statetree, hf_ams_statetimestampadded,tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ams_statetree, hf_ams_stateudp,tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ams_statetree, hf_ams_stateinitcmd,tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ams_statetree, hf_ams_statebroadcast,tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_statetree, hf_ams_stateresponse,tvb, offset, (int)sizeof(uint16_t), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_statetree, hf_ams_statenoreturn,tvb, offset, (int)sizeof(uint16_t), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_statetree, hf_ams_stateadscmd,tvb, offset, (int)sizeof(uint16_t), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_statetree, hf_ams_statesyscmd,tvb, offset, (int)sizeof(uint16_t), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_statetree, hf_ams_statehighprio,tvb, offset, (int)sizeof(uint16_t), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_statetree, hf_ams_statetimestampadded,tvb, offset, (int)sizeof(uint16_t), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_statetree, hf_ams_stateudp,tvb, offset, (int)sizeof(uint16_t), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_statetree, hf_ams_stateinitcmd,tvb, offset, (int)sizeof(uint16_t), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_statetree, hf_ams_statebroadcast,tvb, offset, (int)sizeof(uint16_t), ENC_LITTLE_ENDIAN);
stateflags = tvb_get_letohs(tvb, offset);
- offset+=(int)sizeof(guint16);
+ offset+=(int)sizeof(uint16_t);
- proto_tree_add_item(ams_tree, hf_ams_cbdata, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_tree, hf_ams_cbdata, tvb, offset, (int)sizeof(uint32_t), ENC_LITTLE_ENDIAN);
cbdata = tvb_get_letohl(tvb,offset);
- offset+=(int)sizeof(guint32);
+ offset+=(int)sizeof(uint32_t);
- proto_tree_add_item(ams_tree, hf_ams_errorcode, tvb, offset, (int)sizeof(guint32),ENC_LITTLE_ENDIAN);
- offset+=(int)sizeof(guint32);
+ proto_tree_add_item(ams_tree, hf_ams_errorcode, tvb, offset, (int)sizeof(uint32_t),ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(uint32_t);
- proto_tree_add_item(ams_tree, hf_ams_invokeid, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=(int)sizeof(guint32);
+ proto_tree_add_item(ams_tree, hf_ams_invokeid, tvb, offset, (int)sizeof(uint32_t), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(uint32_t);
}
else
{
@@ -475,14 +475,14 @@ static gint dissect_ams_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if( ams_length-offset >= TAdsReadReq_Len )
{
ams_adstree = proto_item_add_subtree(anItem, ett_ams_adsreadrequest);
- proto_tree_add_item(ams_adstree, hf_ams_adsindexgroup, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=(int)sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adsindexgroup, tvb, offset, (int)sizeof(uint32_t), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(uint32_t);
- proto_tree_add_item(ams_adstree, hf_ams_adsindexoffset, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=(int)sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adsindexoffset, tvb, offset, (int)sizeof(uint32_t), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(uint32_t);
- proto_tree_add_item(ams_adstree, hf_ams_adscblength, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=(int)sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adscblength, tvb, offset, (int)sizeof(uint32_t), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(uint32_t);
}
}
}
@@ -494,17 +494,17 @@ static gint dissect_ams_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if( tree )
{
anItem = proto_tree_add_item(ams_tree, hf_ams_adswriterequest, tvb, offset, ams_length-offset, ENC_NA);
- if( ams_length-offset >= TAdsWriteReq_Len - (int)sizeof(guint16) )
+ if( ams_length-offset >= TAdsWriteReq_Len - (int)sizeof(uint16_t) )
{
ams_adstree = proto_item_add_subtree(anItem, ett_ams_adswriterequest);
proto_tree_add_item(ams_adstree, hf_ams_adsindexgroup, tvb, offset, 4, ENC_LITTLE_ENDIAN);
- offset+=(int)sizeof(guint32);
+ offset+=(int)sizeof(uint32_t);
proto_tree_add_item(ams_adstree, hf_ams_adsindexoffset, tvb, offset, 4, ENC_LITTLE_ENDIAN);
- offset+=(int)sizeof(guint32);
+ offset+=(int)sizeof(uint32_t);
proto_tree_add_item(ams_adstree, hf_ams_adscblength, tvb, offset, 4, ENC_LITTLE_ENDIAN);
- offset+=(int)sizeof(guint32);
+ offset+=(int)sizeof(uint32_t);
proto_tree_add_item(ams_adstree, hf_ams_adsdata, tvb, offset, ams_length-offset, ENC_NA);
}
@@ -518,20 +518,20 @@ static gint dissect_ams_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if( tree )
{
anItem = proto_tree_add_item(ams_tree, hf_ams_adsreadwriterequest, tvb, offset, ams_length-offset, ENC_NA);
- if( ams_length-offset >= TAdsReadWriteReq_Len - (int)sizeof(guint16))
+ if( ams_length-offset >= TAdsReadWriteReq_Len - (int)sizeof(uint16_t))
{
ams_adstree = proto_item_add_subtree(anItem, ett_ams_adsreadwriterequest);
- proto_tree_add_item(ams_adstree, hf_ams_adsindexgroup, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=(int)sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adsindexgroup, tvb, offset, (int)sizeof(uint32_t), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(uint32_t);
- proto_tree_add_item(ams_adstree, hf_ams_adsindexoffset, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=(int)sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adsindexoffset, tvb, offset, (int)sizeof(uint32_t), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(uint32_t);
- proto_tree_add_item(ams_adstree, hf_ams_adscbreadlength, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=(int)sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adscbreadlength, tvb, offset, (int)sizeof(uint32_t), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(uint32_t);
- proto_tree_add_item(ams_adstree, hf_ams_adscbwritelength, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=(int)sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adscbwritelength, tvb, offset, (int)sizeof(uint32_t), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(uint32_t);
proto_tree_add_item(ams_adstree, hf_ams_adsdata, tvb, offset, ams_length-offset, ENC_NA);
}
@@ -548,7 +548,7 @@ static gint dissect_ams_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if( ams_length-offset >= TAdsReadStateReq_Len )
{
ams_adstree = proto_item_add_subtree(anItem, ett_ams_adsreadstaterequest);
- proto_tree_add_item(ams_adstree, hf_ams_adsinvokeid, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_adstree, hf_ams_adsinvokeid, tvb, offset, (int)sizeof(uint32_t), ENC_LITTLE_ENDIAN);
}
}
}
@@ -560,17 +560,17 @@ static gint dissect_ams_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if( tree )
{
anItem = proto_tree_add_item(ams_tree, hf_ams_adswritectrlrequest, tvb, offset, ams_length-offset, ENC_NA);
- if( ams_length-offset >= TAdsWriteControlReq_Len - (int)sizeof(guint16) )
+ if( ams_length-offset >= TAdsWriteControlReq_Len - (int)sizeof(uint16_t) )
{
ams_adstree = proto_item_add_subtree(anItem, ett_ams_adswritectrlrequest);
proto_tree_add_item(ams_adstree, hf_ams_adsstate, tvb, offset, 2, ENC_LITTLE_ENDIAN);
- offset+=(int)sizeof(guint16);
+ offset+=(int)sizeof(uint16_t);
proto_tree_add_item(ams_adstree, hf_ams_adsdevicestate, tvb, offset, 2, ENC_LITTLE_ENDIAN);
- offset+=(int)sizeof(guint16);
+ offset+=(int)sizeof(uint16_t);
- proto_tree_add_item(ams_adstree, hf_ams_adscblength, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=(int)sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adscblength, tvb, offset, (int)sizeof(uint32_t), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(uint32_t);
proto_tree_add_item(ams_adstree, hf_ams_adsdata, tvb, offset, ams_length-offset, ENC_NA);
}
@@ -587,7 +587,7 @@ static gint dissect_ams_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if( ams_length-offset >= TAdsReadDeviceInfoReq_Len )
{
ams_adstree = proto_item_add_subtree(anItem, ett_ams_adsreaddinforequest);
- proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, (int)sizeof(uint32_t), ENC_LITTLE_ENDIAN);
}
}
}
@@ -602,23 +602,23 @@ static gint dissect_ams_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if( ams_length-offset >= TAdsAddDeviceNotificationReq_Len )
{
ams_adstree = proto_item_add_subtree(anItem, ett_ams_adsadddnrequest);
- proto_tree_add_item(ams_adstree, hf_ams_adsindexgroup, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=(int)sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adsindexgroup, tvb, offset, (int)sizeof(uint32_t), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(uint32_t);
- proto_tree_add_item(ams_adstree, hf_ams_adsindexoffset, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=(int)sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adsindexoffset, tvb, offset, (int)sizeof(uint32_t), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(uint32_t);
- proto_tree_add_item(ams_adstree, hf_ams_adscblength, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=(int)sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adscblength, tvb, offset, (int)sizeof(uint32_t), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(uint32_t);
- proto_tree_add_item(ams_adstree, hf_ams_adstransmode, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=(int)sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adstransmode, tvb, offset, (int)sizeof(uint32_t), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(uint32_t);
- proto_tree_add_item(ams_adstree, hf_ams_adsmaxdelay, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=(int)sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adsmaxdelay, tvb, offset, (int)sizeof(uint32_t), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(uint32_t);
- proto_tree_add_item(ams_adstree, hf_ams_adscycletime, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=(int)sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adscycletime, tvb, offset, (int)sizeof(uint32_t), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(uint32_t);
}
}
}
@@ -633,7 +633,7 @@ static gint dissect_ams_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if( ams_length-offset >= TAdsDelDeviceNotificationReq_Len )
{
ams_adstree = proto_item_add_subtree(anItem, ett_ams_adsdeldnrequest);
- proto_tree_add_item(ams_adstree, hf_ams_adsnotificationhandle, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_adstree, hf_ams_adsnotificationhandle, tvb, offset, (int)sizeof(uint32_t), ENC_LITTLE_ENDIAN);
}
}
}
@@ -644,20 +644,20 @@ static gint dissect_ams_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if( tree )
{
- /*guint32 cbLength;
- guint32 nStamps;*/
+ /*uint32_t cbLength;
+ uint32_t nStamps;*/
anItem = proto_tree_add_item(ams_tree, hf_ams_adsdnrequest, tvb, offset, ams_length-offset, ENC_NA);
if( ams_length-offset >= TAdsDeviceNotificationReq_Len )
{
ams_adstree = proto_item_add_subtree(anItem, ett_ams_adsdnrequest);
- proto_tree_add_item(ams_adstree, hf_ams_adscblength, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_adstree, hf_ams_adscblength, tvb, offset, (int)sizeof(uint32_t), ENC_LITTLE_ENDIAN);
/*cbLength = tvb_get_letohs(tvb, offset);*/
- offset+=(int)sizeof(guint32);
+ offset+=(int)sizeof(uint32_t);
- proto_tree_add_item(ams_adstree, hf_ams_adsnoteblocksstamps, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_adstree, hf_ams_adsnoteblocksstamps, tvb, offset, (int)sizeof(uint32_t), ENC_LITTLE_ENDIAN);
/*nStamps = tvb_get_letohs(tvb, offset);*/
- offset+=(int)sizeof(guint32);
+ offset+=(int)sizeof(uint32_t);
/*ToDo: dissect noteblocks*/
}
@@ -678,14 +678,14 @@ static gint dissect_ams_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if( tree )
{
anItem = proto_tree_add_item(ams_tree, hf_ams_adsreadresponse, tvb, offset, ams_length-offset, ENC_NA);
- if( ams_length-offset >= TAdsReadRes_Len - (int)sizeof(guint16) )
+ if( ams_length-offset >= TAdsReadRes_Len - (int)sizeof(uint16_t) )
{
ams_adstree = proto_item_add_subtree(anItem, ett_ams_adsreadresponse);
- proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=(int)sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, (int)sizeof(uint32_t), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(uint32_t);
- proto_tree_add_item(ams_adstree, hf_ams_adscblength, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=(int)sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adscblength, tvb, offset, (int)sizeof(uint32_t), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(uint32_t);
proto_tree_add_item(ams_adstree, hf_ams_adsdata, tvb, offset, ams_length-offset, ENC_NA);
}
@@ -702,7 +702,7 @@ static gint dissect_ams_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if( ams_length-offset >= TAdsWriteRes_Len )
{
ams_adstree = proto_item_add_subtree(anItem, ett_ams_adswriteresponse);
- proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, (int)sizeof(uint32_t), ENC_LITTLE_ENDIAN);
}
}
}
@@ -714,14 +714,14 @@ static gint dissect_ams_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if( tree )
{
anItem = proto_tree_add_item(ams_tree, hf_ams_adsreadwriteresponse, tvb, offset, ams_length-offset, ENC_NA);
- if( ams_length-offset >= TAdsReadWriteRes_Len - (int)sizeof(guint16) )
+ if( ams_length-offset >= TAdsReadWriteRes_Len - (int)sizeof(uint16_t) )
{
ams_adstree = proto_item_add_subtree(anItem, ett_ams_adsreadwriteresponse);
- proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=(int)sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, (int)sizeof(uint32_t), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(uint32_t);
- proto_tree_add_item(ams_adstree, hf_ams_adscblength, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=(int)sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adscblength, tvb, offset, (int)sizeof(uint32_t), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(uint32_t);
proto_tree_add_item(ams_adstree, hf_ams_adsdata, tvb, offset, ams_length-offset, ENC_NA);
}
@@ -738,13 +738,13 @@ static gint dissect_ams_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if( ams_length-offset >= TAdsReadStateRes_Len )
{
ams_adstree = proto_item_add_subtree(anItem, ett_ams_adsreadstateresponse);
- proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=(int)sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, (int)sizeof(uint32_t), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(uint32_t);
- proto_tree_add_item(ams_adstree, hf_ams_adsstate, tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
- offset+=(int)sizeof(guint16);
+ proto_tree_add_item(ams_adstree, hf_ams_adsstate, tvb, offset, (int)sizeof(uint16_t), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(uint16_t);
- proto_tree_add_item(ams_adstree, hf_ams_adsdevicestate, tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_adstree, hf_ams_adsdevicestate, tvb, offset, (int)sizeof(uint16_t), ENC_LITTLE_ENDIAN);
}
}
}
@@ -759,7 +759,7 @@ static gint dissect_ams_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if( ams_length-offset >= TAdsWriteControlRes_Len )
{
ams_adstree = proto_item_add_subtree(anItem, ett_ams_adswritectrlresponse);
- proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, (int)sizeof(uint32_t), ENC_LITTLE_ENDIAN);
}
}
}
@@ -774,13 +774,13 @@ static gint dissect_ams_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if( ams_length-offset >= TAdsReadDeviceInfoRes_Len )
{
ams_adstree = proto_item_add_subtree(anItem, ett_ams_adsreaddinforesponse);
- proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=(int)sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, (int)sizeof(uint32_t), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(uint32_t);
- proto_tree_add_item(ams_adstree, hf_ams_adsversionversion, tvb, offset++, (int)sizeof(guint8), ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ams_adstree, hf_ams_adsversionrevision, tvb, offset++, (int)sizeof(guint8), ENC_LITTLE_ENDIAN);
- proto_tree_add_item(ams_adstree, hf_ams_adsversionbuild, tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
- offset+=(int)sizeof(guint16);
+ proto_tree_add_item(ams_adstree, hf_ams_adsversionversion, tvb, offset++, (int)sizeof(uint8_t), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_adstree, hf_ams_adsversionrevision, tvb, offset++, (int)sizeof(uint8_t), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_adstree, hf_ams_adsversionbuild, tvb, offset, (int)sizeof(uint16_t), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(uint16_t);
proto_tree_add_item(ams_adstree, hf_ams_adsdevicename, tvb, offset, ams_length-offset, ENC_ASCII|ENC_NA);
}
@@ -797,10 +797,10 @@ static gint dissect_ams_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if( ams_length-offset >= TAdsAddDeviceNotificationRes_Len )
{
ams_adstree = proto_item_add_subtree(anItem, ett_ams_adsadddnresponse);
- proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
- offset+=(int)sizeof(guint32);
+ proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, (int)sizeof(uint32_t), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(uint32_t);
- proto_tree_add_item(ams_adstree, hf_ams_adsnotificationhandle, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_adstree, hf_ams_adsnotificationhandle, tvb, offset, (int)sizeof(uint32_t), ENC_LITTLE_ENDIAN);
}
}
}
@@ -815,7 +815,7 @@ static gint dissect_ams_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if( ams_length-offset >= TAdsDelDeviceNotificationRes_Len )
{
ams_adstree = proto_item_add_subtree(anItem, ett_ams_adsdeldnresponse);
- proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, (int)sizeof(guint32), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(ams_adstree, hf_ams_adsresult, tvb, offset, (int)sizeof(uint32_t), ENC_LITTLE_ENDIAN);
}
}
}
@@ -836,12 +836,12 @@ static gint dissect_ams_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
/*ams*/
-static gint dissect_ams(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
+static int dissect_ams(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
return dissect_ams_pdu(tvb, pinfo, tree, 0);
}
-static gint dissect_amstcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
+static int dissect_amstcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
if( TcpAdsParserHDR_Len > tvb_reported_length(tvb))
return 0;
@@ -1192,7 +1192,7 @@ void proto_register_ams(void)
#endif
};
- static gint *ett[] =
+ static int *ett[] =
{
&ett_ams,
&ett_ams_stateflags,
diff --git a/plugins/epan/ethercat/packet-ams.h b/plugins/epan/ethercat/packet-ams.h
index 199e1028..006fc548 100644
--- a/plugins/epan/ethercat/packet-ams.h
+++ b/plugins/epan/ethercat/packet-ams.h
@@ -659,29 +659,29 @@ typedef enum
typedef struct AmsNetId_
{
- guint8 b[6];
+ uint8_t b[6];
} AmsNetId;
#define AmsNetId_Len (int)sizeof(AmsNetId)
typedef struct AmsAddr_
{
AmsNetId netId;
- guint16 port;
+ uint16_t port;
} AmsAddr;
typedef union ErrCodeUnion
{
- gint32 errCode;
- gint32 hRcv;
+ int32_t errCode;
+ int32_t hRcv;
} ErrCodeUnion;
typedef union tUserUnion
{
- gint32 hUser;
+ int32_t hUser;
struct
{
- guint16 fragmentNo;
- guint16 packetNo;
+ uint16_t fragmentNo;
+ uint16_t packetNo;
} a;
} UserUnion;
@@ -689,9 +689,9 @@ typedef struct
{
AmsAddr target;
AmsAddr sender;
- guint16 cmdId;
- guint16 stateFlags;
- guint32 cbData;
+ uint16_t cmdId;
+ uint16_t stateFlags;
+ uint32_t cbData;
ErrCodeUnion anErrCodeUnion;
UserUnion aUserUnion;
@@ -780,9 +780,9 @@ typedef struct
#define ADSIGRP_SUMUP_READ 0xF080
#define ADSIGRP_SUMUP_WRITE 0xF081
-#define ADS_SUMUP_IGRP(p, i) (((guint32*)p)[(i)*3+0])
-#define ADS_SUMUP_IOFFS(p, i) (((guint32*)p)[(i)*3+1])
-#define ADS_SUMUP_LENGTH(p, i) (((guint32*)p)[(i)*3+2])
+#define ADS_SUMUP_IGRP(p, i) (((uint32_t*)p)[(i)*3+0])
+#define ADS_SUMUP_IOFFS(p, i) (((uint32_t*)p)[(i)*3+1])
+#define ADS_SUMUP_LENGTH(p, i) (((uint32_t*)p)[(i)*3+2])
#define ADSIGRP_DEVICE_DATA 0xF100
#define ADSIOFFS_DEVDATA_ADSSTATE 0x0000
@@ -968,109 +968,109 @@ typedef enum nAdsTransMode
/* ADS AMS command */
/*typedef struct
{
- guint32 hNotification;
- guint32 cbSampleSize;
- guint8 data[ANYSIZE_ARRAY];
+ uint32_t hNotification;
+ uint32_t cbSampleSize;
+ uint8_t data[ANYSIZE_ARRAY];
} AdsNotificationSample, *PAdsNotificationSample;*/
#define AdsNotificationSample_Min_Len 4
typedef struct
{
- guint32 invokeId;
+ uint32_t invokeId;
} TAdsReadDeviceInfoReq;
#define TAdsReadDeviceInfoReq_Len (int)sizeof(TAdsReadDeviceInfoReq)
/*typedef struct
{
- guint16 adsState;
- guint16 deviceState;
- guint32 cbLength;
- guint16 firstDataWord;
+ uint16_t adsState;
+ uint16_t deviceState;
+ uint32_t cbLength;
+ uint16_t firstDataWord;
} TAdsWriteControlReq, TAdsWriteControlInd;*/
#define TAdsWriteControlReq_Len 10
typedef struct
{
- guint32 invokeId;
+ uint32_t invokeId;
} TAdsReadStateReq;
#define TAdsReadStateReq_Len (int)sizeof(TAdsReadStateReq)
typedef struct
{
- guint32 indexGroup;
- guint32 indexOffset;
- guint32 cbLength;
+ uint32_t indexGroup;
+ uint32_t indexOffset;
+ uint32_t cbLength;
} TAdsReadReq;
#define TAdsReadReq_Len (int)sizeof(TAdsReadReq)
/*typedef struct
{
- guint32 indexGroup;
- guint32 indexOffset;
- guint32 cbLength;
- guint16 firstDataWord;
+ uint32_t indexGroup;
+ uint32_t indexOffset;
+ uint32_t cbLength;
+ uint16_t firstDataWord;
} TAdsWriteReq;*/
#define TAdsWriteReq_Len 14
/*
typedef struct
{
- guint32 indexGroup;
- guint32 indexOffset;
- guint32 cbReadLength;
- guint32 cbWriteLength;
- guint16 firstDataWord;
+ uint32_t indexGroup;
+ uint32_t indexOffset;
+ uint32_t cbReadLength;
+ uint32_t cbWriteLength;
+ uint16_t firstDataWord;
} TAdsReadWriteReq;*/
#define TAdsReadWriteReq_Len 18
typedef struct
{
- guint32 cbLength;
- guint32 nTransMode;
- guint32 nMaxDelay;
- guint32 nCycleTime;
- guint8 nCmpMax[sizeof(double)];
- guint8 nCmpMin[sizeof(double)];
+ uint32_t cbLength;
+ uint32_t nTransMode;
+ uint32_t nMaxDelay;
+ uint32_t nCycleTime;
+ uint8_t nCmpMax[sizeof(double)];
+ uint8_t nCmpMin[sizeof(double)];
} AdsNotificationAttrib;
typedef struct
{
- guint32 indexGroup;
- guint32 indexOffset;
+ uint32_t indexGroup;
+ uint32_t indexOffset;
AdsNotificationAttrib noteAttrib;
} TAdsAddDeviceNotificationReq;
#define TAdsAddDeviceNotificationReq_Len (int)sizeof(TAdsAddDeviceNotificationReq)
typedef struct
{
- guint32 hNotification;
+ uint32_t hNotification;
} TAdsDelDeviceNotificationReq;
#define TAdsDelDeviceNotificationReq_Len (int)sizeof(TAdsDelDeviceNotificationReq)
typedef struct
{
- guint32 cbLength;
- guint32 nStamps;
+ uint32_t cbLength;
+ uint32_t nStamps;
} TAdsDeviceNotificationReq;
#define TAdsDeviceNotificationReq_Len (int)sizeof(TAdsDeviceNotificationReq)
typedef struct
{
- guint32 result;
+ uint32_t result;
} TAdsRes;
#define TAdsRes_Len (int)sizeof(TAdsRes)
typedef struct
{
- guint8 version;
- guint8 revision;
- guint16 build;
+ uint8_t version;
+ uint8_t revision;
+ uint16_t build;
} AdsVersion, *PAdsVersion;
typedef struct
{
- guint32 result;
+ uint32_t result;
AdsVersion version;
char sName[ADS_FIXEDNAMESIZE];
} TAdsReadDeviceInfoRes;
@@ -1078,50 +1078,50 @@ typedef struct
typedef struct
{
- guint32 result;
+ uint32_t result;
} TAdsWriteControlRes;
#define TAdsWriteControlRes_Len (int)sizeof(TAdsWriteControlRes)
typedef struct
{
- guint32 result;
- guint16 adsState;
- guint16 deviceState;
+ uint32_t result;
+ uint16_t adsState;
+ uint16_t deviceState;
} TAdsReadStateRes;
#define TAdsReadStateRes_Len (int)sizeof(TAdsReadStateRes)
typedef struct
{
- guint32 result;
- guint32 cbLength;
- guint16 firstDataWord;
+ uint32_t result;
+ uint32_t cbLength;
+ uint16_t firstDataWord;
} TAdsReadRes;
#define TAdsReadRes_Len (int)sizeof(TAdsReadRes)
typedef struct
{
- guint32 result;
- guint32 cbLength;
- guint16 firstDataWord;
+ uint32_t result;
+ uint32_t cbLength;
+ uint16_t firstDataWord;
} TAdsReadWriteRes;
#define TAdsReadWriteRes_Len (int)sizeof(TAdsReadWriteRes)
typedef struct
{
- guint32 result;
+ uint32_t result;
} TAdsWriteRes;
#define TAdsWriteRes_Len (int)sizeof(TAdsWriteRes)
typedef struct
{
- guint32 result;
- guint32 handle;
+ uint32_t result;
+ uint32_t handle;
} TAdsAddDeviceNotificationRes;
#define TAdsAddDeviceNotificationRes_Len (int)sizeof(TAdsAddDeviceNotificationRes)
typedef struct
{
- guint32 result;
+ uint32_t result;
} TAdsDelDeviceNotificationRes;
#define TAdsDelDeviceNotificationRes_Len (int)sizeof(TAdsDelDeviceNotificationRes)
@@ -1129,8 +1129,8 @@ typedef struct
/* structure for decoding the header -----------------------------------------*/
/*typedef struct
{
- guint16 reserved;
- guint32 cbLength;
+ uint16_t reserved;
+ uint32_t cbLength;
} TcpAdsParserHDR;
typedef TcpAdsParserHDR;*/
#define TcpAdsParserHDR_Len 6
diff --git a/plugins/epan/ethercat/packet-ecatmb.c b/plugins/epan/ethercat/packet-ecatmb.c
index c5998540..24f6b53a 100644
--- a/plugins/epan/ethercat/packet-ecatmb.c
+++ b/plugins/epan/ethercat/packet-ecatmb.c
@@ -32,163 +32,163 @@ static dissector_handle_t ams_handle;
static dissector_handle_t ecat_mailbox_handle;
/* Define the EtherCAT mailbox proto */
-int proto_ecat_mailbox = -1;
-
-static int ett_ecat_mailbox = -1;
-static int ett_ecat_mailbox_eoe = -1;
-static int ett_ecat_mailbox_eoe_init = -1;
-static int ett_ecat_mailbox_eoe_macfilter = -1;
-static int ett_ecat_mailbox_eoe_macfilter_filter = -1;
-static int ett_ecat_mailbox_eoe_macfilter_filtermask = -1;
-static int ett_ecat_mailbox_coe = -1;
-static int ett_ecat_mailbox_sdo = -1;
-static int ett_ecat_mailbox_coe_sdoccs = -1;
-static int ett_ecat_mailbox_coe_sdoscs = -1;
-static int ett_ecat_mailbox_foe = -1;
-static int ett_ecat_mailbox_foe_efw = -1;
-static int ett_ecat_mailbox_soeflag = -1;
-static int ett_ecat_mailbox_soe = -1;
-static int ett_ecat_mailbox_fraghead = -1;
-static int ett_ecat_mailbox_header = -1;
-
-static int hf_ecat_mailboxlength = -1;
-static int hf_ecat_mailboxaddress = -1;
-static int hf_ecat_mailboxpriority = -1;
-static int hf_ecat_mailboxtype = -1;
-static int hf_ecat_mailboxcounter = -1;
-static int hf_ecat_mailbox_eoe = -1;
-static int hf_ecat_mailbox_eoe_fraghead = -1;
-static int hf_ecat_mailbox_eoe_type = -1;
-static int hf_ecat_mailbox_eoe_fragno = -1;
-static int hf_ecat_mailbox_eoe_offset = -1;
-static int hf_ecat_mailbox_eoe_frame = -1;
-static int hf_ecat_mailbox_eoe_last = -1;
-static int hf_ecat_mailbox_eoe_timestampreq = -1;
-static int hf_ecat_mailbox_eoe_timestampapp = -1;
-static int hf_ecat_mailbox_eoe_fragment = -1;
-static int hf_ecat_mailbox_eoe_init = -1;
-static int hf_ecat_mailbox_eoe_init_contains_macaddr = -1;
-static int hf_ecat_mailbox_eoe_init_contains_ipaddr = -1;
-static int hf_ecat_mailbox_eoe_init_contains_subnetmask = -1;
-static int hf_ecat_mailbox_eoe_init_contains_defaultgateway = -1;
-static int hf_ecat_mailbox_eoe_init_contains_dnsserver = -1;
-static int hf_ecat_mailbox_eoe_init_contains_dnsname = -1;
-static int hf_ecat_mailbox_eoe_init_append_timestamp = -1;
-static int hf_ecat_mailbox_eoe_init_macaddr = -1;
-static int hf_ecat_mailbox_eoe_init_ipaddr = -1;
-static int hf_ecat_mailbox_eoe_init_subnetmask = -1;
-static int hf_ecat_mailbox_eoe_init_defaultgateway = -1;
-static int hf_ecat_mailbox_eoe_init_dnsserver = -1;
-static int hf_ecat_mailbox_eoe_init_dnsname = -1;
-static int hf_ecat_mailbox_eoe_macfilter = -1;
-static int hf_ecat_mailbox_eoe_macfilter_macfiltercount = -1;
-static int hf_ecat_mailbox_eoe_macfilter_maskcount = -1;
-static int hf_ecat_mailbox_eoe_macfilter_nobroadcasts = -1;
+int proto_ecat_mailbox;
+
+static int ett_ecat_mailbox;
+static int ett_ecat_mailbox_eoe;
+static int ett_ecat_mailbox_eoe_init;
+static int ett_ecat_mailbox_eoe_macfilter;
+static int ett_ecat_mailbox_eoe_macfilter_filter;
+static int ett_ecat_mailbox_eoe_macfilter_filtermask;
+static int ett_ecat_mailbox_coe;
+static int ett_ecat_mailbox_sdo;
+static int ett_ecat_mailbox_coe_sdoccs;
+static int ett_ecat_mailbox_coe_sdoscs;
+static int ett_ecat_mailbox_foe;
+static int ett_ecat_mailbox_foe_efw;
+static int ett_ecat_mailbox_soeflag;
+static int ett_ecat_mailbox_soe;
+static int ett_ecat_mailbox_fraghead;
+static int ett_ecat_mailbox_header;
+
+static int hf_ecat_mailboxlength;
+static int hf_ecat_mailboxaddress;
+static int hf_ecat_mailboxpriority;
+static int hf_ecat_mailboxtype;
+static int hf_ecat_mailboxcounter;
+static int hf_ecat_mailbox_eoe;
+static int hf_ecat_mailbox_eoe_fraghead;
+static int hf_ecat_mailbox_eoe_type;
+static int hf_ecat_mailbox_eoe_fragno;
+static int hf_ecat_mailbox_eoe_offset;
+static int hf_ecat_mailbox_eoe_frame;
+static int hf_ecat_mailbox_eoe_last;
+static int hf_ecat_mailbox_eoe_timestampreq;
+static int hf_ecat_mailbox_eoe_timestampapp;
+static int hf_ecat_mailbox_eoe_fragment;
+static int hf_ecat_mailbox_eoe_init;
+static int hf_ecat_mailbox_eoe_init_contains_macaddr;
+static int hf_ecat_mailbox_eoe_init_contains_ipaddr;
+static int hf_ecat_mailbox_eoe_init_contains_subnetmask;
+static int hf_ecat_mailbox_eoe_init_contains_defaultgateway;
+static int hf_ecat_mailbox_eoe_init_contains_dnsserver;
+static int hf_ecat_mailbox_eoe_init_contains_dnsname;
+static int hf_ecat_mailbox_eoe_init_append_timestamp;
+static int hf_ecat_mailbox_eoe_init_macaddr;
+static int hf_ecat_mailbox_eoe_init_ipaddr;
+static int hf_ecat_mailbox_eoe_init_subnetmask;
+static int hf_ecat_mailbox_eoe_init_defaultgateway;
+static int hf_ecat_mailbox_eoe_init_dnsserver;
+static int hf_ecat_mailbox_eoe_init_dnsname;
+static int hf_ecat_mailbox_eoe_macfilter;
+static int hf_ecat_mailbox_eoe_macfilter_macfiltercount;
+static int hf_ecat_mailbox_eoe_macfilter_maskcount;
+static int hf_ecat_mailbox_eoe_macfilter_nobroadcasts;
static int hf_ecat_mailbox_eoe_macfilter_filter;
-static int hf_ecat_mailbox_eoe_macfilter_filters[16] = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1};
-static int hf_ecat_mailbox_eoe_macfilter_filtermask = -1;
-static int hf_ecat_mailbox_eoe_macfilter_filtermasks[4] = {-1,-1,-1,-1};
-static int hf_ecat_mailbox_eoe_timestamp = -1;
-static int hf_ecat_mailbox_coe = -1;
-static int hf_ecat_mailbox_coe_number = -1;
-static int hf_ecat_mailbox_coe_type = -1;
-static int hf_ecat_mailbox_coe_sdoreq = -1;
-static int hf_ecat_mailbox_coe_sdoccsid = -1;
-static int hf_ecat_mailbox_coe_sdoccsid_sizeind = -1;
-static int hf_ecat_mailbox_coe_sdoccsid_expedited = -1;
-static int hf_ecat_mailbox_coe_sdoccsid_size0= -1;
-static int hf_ecat_mailbox_coe_sdoccsid_size1= -1;
-static int hf_ecat_mailbox_coe_sdoccsid_complete = -1;
-static int hf_ecat_mailbox_coe_sdoccsds = -1;
-static int hf_ecat_mailbox_coe_sdoccsds_lastseg = -1;
-static int hf_ecat_mailbox_coe_sdoccsds_size = -1;
-static int hf_ecat_mailbox_coe_sdoccsds_toggle = -1;
-static int hf_ecat_mailbox_coe_sdoccsus = -1;
-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;
-static int hf_ecat_mailbox_coe_sdodata2 = -1;
-static int hf_ecat_mailbox_coe_sdoldata = -1;
-static int hf_ecat_mailbox_coe_sdolength = -1;
-/* static int hf_ecat_mailbox_coe_sdoerror = -1; */
-static int hf_ecat_mailbox_coe_sdores = -1;
-static int hf_ecat_mailbox_coe_sdoscsds = -1;
-static int hf_ecat_mailbox_coe_sdoscsds_toggle = -1;
-static int hf_ecat_mailbox_coe_sdoscsiu = -1;
-static int hf_ecat_mailbox_coe_sdoscsiu_sizeind = -1;
-static int hf_ecat_mailbox_coe_sdoscsiu_expedited = -1;
-static int hf_ecat_mailbox_coe_sdoscsiu_size0 = -1;
-static int hf_ecat_mailbox_coe_sdoscsiu_size1 = -1;
-static int hf_ecat_mailbox_coe_sdoscsiu_complete = -1;
-static int hf_ecat_mailbox_coe_sdoscsus = -1;
-static int hf_ecat_mailbox_coe_sdoscsus_lastseg = -1;
-static int hf_ecat_mailbox_coe_sdoscsus_bytes = -1;
-static int hf_ecat_mailbox_coe_sdoscsus_toggle = -1;
-static int hf_ecat_mailbox_coe_sdoinfoopcode = -1;
-static int hf_ecat_mailbox_coe_sdoinfofrag = -1;
-static int hf_ecat_mailbox_coe_sdoinfolisttype = -1;
-static int hf_ecat_mailbox_coe_sdoinfolist = -1;
-static int hf_ecat_mailbox_coe_sdoinfoindex = -1;
-static int hf_ecat_mailbox_coe_sdoinfosubindex = -1;
-static int hf_ecat_mailbox_coe_sdoinfovalueinfo = -1;
-static int hf_ecat_mailbox_coe_sdoinfoerrorcode = -1;
-static int hf_ecat_mailbox_coe_sdoinfodatatype = -1;
-static int hf_ecat_mailbox_coe_sdoinfomaxsub = -1;
-static int hf_ecat_mailbox_coe_sdoinfoobjcode = -1;
-static int hf_ecat_mailbox_coe_sdoinfoname = -1;
-static int hf_ecat_mailbox_coe_sdoinfobitlen = -1;
-static int hf_ecat_mailbox_coe_sdoinfoobjaccess = -1;
-static int hf_ecat_mailbox_coe_sdoinfounittype = -1;
-static int hf_ecat_mailbox_coe_sdoinfodefaultvalue = -1;
-static int hf_ecat_mailbox_coe_sdoinfominvalue = -1;
-static int hf_ecat_mailbox_coe_sdoinfomaxvalue = -1;
-static int hf_ecat_mailboxdata = -1;
-static int hf_ecat_mailbox_foe = -1;
-static int hf_ecat_mailbox_foe_opmode = -1;
-static int hf_ecat_mailbox_foe_filelength = -1;
-static int hf_ecat_mailbox_foe_filename = -1;
-static int hf_ecat_mailbox_foe_packetno = -1;
-static int hf_ecat_mailbox_foe_errcode = -1;
-static int hf_ecat_mailbox_foe_errtext = -1;
-static int hf_ecat_mailbox_foe_busydone = -1;
-static int hf_ecat_mailbox_foe_busyentire = -1;
-static int hf_ecat_mailbox_foe_data = -1;
-static int hf_ecat_mailbox_foe_efw = -1;
-static int hf_ecat_mailbox_foe_efw_cmd = -1;
-static int hf_ecat_mailbox_foe_efw_size = -1;
-static int hf_ecat_mailbox_foe_efw_addresslw = -1;
-static int hf_ecat_mailbox_foe_efw_addresshw = -1;
-static int hf_ecat_mailbox_foe_efw_data = -1;
-static int hf_ecat_mailbox_soe = -1;
-static int hf_ecat_mailbox_soe_header = -1;
-
-static int hf_ecat_mailbox_soe_header_opcode = -1;
-static int hf_ecat_mailbox_soe_header_incomplete = -1;
-static int hf_ecat_mailbox_soe_header_error = -1;
-static int hf_ecat_mailbox_soe_header_driveno = -1;
-static int hf_ecat_mailbox_soe_header_datastate = -1;
-static int hf_ecat_mailbox_soe_header_name = -1;
-static int hf_ecat_mailbox_soe_header_attribute = -1;
-static int hf_ecat_mailbox_soe_header_unit = -1;
-static int hf_ecat_mailbox_soe_header_min = -1;
-static int hf_ecat_mailbox_soe_header_max = -1;
-static int hf_ecat_mailbox_soe_header_value = -1;
-static int hf_ecat_mailbox_soe_header_reserved = -1;
-static int hf_ecat_mailbox_soe_idn = -1;
-static int hf_ecat_mailbox_soe_data = -1;
-static int hf_ecat_mailbox_soe_frag = -1;
-static int hf_ecat_mailbox_soe_error = -1;
-
-static expert_field ei_ecat_mailbox_error = EI_INIT;
-static expert_field ei_ecat_mailbox_coe_error = EI_INIT;
-static expert_field ei_ecat_mailbox_eoe_error = EI_INIT;
-static expert_field ei_ecat_mailbox_soe_error = EI_INIT;
-static expert_field ei_ecat_mailbox_foe_error = EI_INIT;
+static int hf_ecat_mailbox_eoe_macfilter_filters[16];
+static int hf_ecat_mailbox_eoe_macfilter_filtermask;
+static int hf_ecat_mailbox_eoe_macfilter_filtermasks[4];
+static int hf_ecat_mailbox_eoe_timestamp;
+static int hf_ecat_mailbox_coe;
+static int hf_ecat_mailbox_coe_number;
+static int hf_ecat_mailbox_coe_type;
+static int hf_ecat_mailbox_coe_sdoreq;
+static int hf_ecat_mailbox_coe_sdoccsid;
+static int hf_ecat_mailbox_coe_sdoccsid_sizeind;
+static int hf_ecat_mailbox_coe_sdoccsid_expedited;
+static int hf_ecat_mailbox_coe_sdoccsid_size0;
+static int hf_ecat_mailbox_coe_sdoccsid_size1;
+static int hf_ecat_mailbox_coe_sdoccsid_complete;
+static int hf_ecat_mailbox_coe_sdoccsds;
+static int hf_ecat_mailbox_coe_sdoccsds_lastseg;
+static int hf_ecat_mailbox_coe_sdoccsds_size;
+static int hf_ecat_mailbox_coe_sdoccsds_toggle;
+static int hf_ecat_mailbox_coe_sdoccsus;
+static int hf_ecat_mailbox_coe_sdoccsus_toggle;
+static int hf_ecat_mailbox_coe_sdoccsiu;
+/* static int hf_ecat_mailbox_coe_sdoccsiu_complete; */
+static int hf_ecat_mailbox_coe_sdoidx;
+static int hf_ecat_mailbox_coe_sdoabortcode;
+static int hf_ecat_mailbox_coe_sdosub;
+static int hf_ecat_mailbox_coe_sdodata;
+static int hf_ecat_mailbox_coe_sdodata1;
+static int hf_ecat_mailbox_coe_sdodata2;
+static int hf_ecat_mailbox_coe_sdoldata;
+static int hf_ecat_mailbox_coe_sdolength;
+/* static int hf_ecat_mailbox_coe_sdoerror; */
+static int hf_ecat_mailbox_coe_sdores;
+static int hf_ecat_mailbox_coe_sdoscsds;
+static int hf_ecat_mailbox_coe_sdoscsds_toggle;
+static int hf_ecat_mailbox_coe_sdoscsiu;
+static int hf_ecat_mailbox_coe_sdoscsiu_sizeind;
+static int hf_ecat_mailbox_coe_sdoscsiu_expedited;
+static int hf_ecat_mailbox_coe_sdoscsiu_size0;
+static int hf_ecat_mailbox_coe_sdoscsiu_size1;
+static int hf_ecat_mailbox_coe_sdoscsiu_complete;
+static int hf_ecat_mailbox_coe_sdoscsus;
+static int hf_ecat_mailbox_coe_sdoscsus_lastseg;
+static int hf_ecat_mailbox_coe_sdoscsus_bytes;
+static int hf_ecat_mailbox_coe_sdoscsus_toggle;
+static int hf_ecat_mailbox_coe_sdoinfoopcode;
+static int hf_ecat_mailbox_coe_sdoinfofrag;
+static int hf_ecat_mailbox_coe_sdoinfolisttype;
+static int hf_ecat_mailbox_coe_sdoinfolist;
+static int hf_ecat_mailbox_coe_sdoinfoindex;
+static int hf_ecat_mailbox_coe_sdoinfosubindex;
+static int hf_ecat_mailbox_coe_sdoinfovalueinfo;
+static int hf_ecat_mailbox_coe_sdoinfoerrorcode;
+static int hf_ecat_mailbox_coe_sdoinfodatatype;
+static int hf_ecat_mailbox_coe_sdoinfomaxsub;
+static int hf_ecat_mailbox_coe_sdoinfoobjcode;
+static int hf_ecat_mailbox_coe_sdoinfoname;
+static int hf_ecat_mailbox_coe_sdoinfobitlen;
+static int hf_ecat_mailbox_coe_sdoinfoobjaccess;
+static int hf_ecat_mailbox_coe_sdoinfounittype;
+static int hf_ecat_mailbox_coe_sdoinfodefaultvalue;
+static int hf_ecat_mailbox_coe_sdoinfominvalue;
+static int hf_ecat_mailbox_coe_sdoinfomaxvalue;
+static int hf_ecat_mailboxdata;
+static int hf_ecat_mailbox_foe;
+static int hf_ecat_mailbox_foe_opmode;
+static int hf_ecat_mailbox_foe_filelength;
+static int hf_ecat_mailbox_foe_filename;
+static int hf_ecat_mailbox_foe_packetno;
+static int hf_ecat_mailbox_foe_errcode;
+static int hf_ecat_mailbox_foe_errtext;
+static int hf_ecat_mailbox_foe_busydone;
+static int hf_ecat_mailbox_foe_busyentire;
+static int hf_ecat_mailbox_foe_data;
+static int hf_ecat_mailbox_foe_efw;
+static int hf_ecat_mailbox_foe_efw_cmd;
+static int hf_ecat_mailbox_foe_efw_size;
+static int hf_ecat_mailbox_foe_efw_addresslw;
+static int hf_ecat_mailbox_foe_efw_addresshw;
+static int hf_ecat_mailbox_foe_efw_data;
+static int hf_ecat_mailbox_soe;
+static int hf_ecat_mailbox_soe_header;
+
+static int hf_ecat_mailbox_soe_header_opcode;
+static int hf_ecat_mailbox_soe_header_incomplete;
+static int hf_ecat_mailbox_soe_header_error;
+static int hf_ecat_mailbox_soe_header_driveno;
+static int hf_ecat_mailbox_soe_header_datastate;
+static int hf_ecat_mailbox_soe_header_name;
+static int hf_ecat_mailbox_soe_header_attribute;
+static int hf_ecat_mailbox_soe_header_unit;
+static int hf_ecat_mailbox_soe_header_min;
+static int hf_ecat_mailbox_soe_header_max;
+static int hf_ecat_mailbox_soe_header_value;
+static int hf_ecat_mailbox_soe_header_reserved;
+static int hf_ecat_mailbox_soe_idn;
+static int hf_ecat_mailbox_soe_data;
+static int hf_ecat_mailbox_soe_frag;
+static int hf_ecat_mailbox_soe_error;
+
+static expert_field ei_ecat_mailbox_error;
+static expert_field ei_ecat_mailbox_coe_error;
+static expert_field ei_ecat_mailbox_eoe_error;
+static expert_field ei_ecat_mailbox_soe_error;
+static expert_field ei_ecat_mailbox_foe_error;
static const value_string EcMBoxType[] =
@@ -287,54 +287,54 @@ static const true_false_string tfs_complete =
"Complete", "Legacy"
};
-void init_mbx_header(PETHERCAT_MBOX_HEADER pMbox, tvbuff_t *tvb, gint offset)
+void init_mbx_header(PETHERCAT_MBOX_HEADER pMbox, tvbuff_t *tvb, int offset)
{
pMbox->Length = tvb_get_letohs(tvb, offset); offset+=2;
pMbox->Address = tvb_get_letohs(tvb, offset); offset+=2;
pMbox->aControlUnion.Control = tvb_get_letohs(tvb, offset);
}
-static void init_eoe_header(PETHERCAT_EOE_HEADER pEoE, tvbuff_t *tvb, gint offset)
+static void init_eoe_header(PETHERCAT_EOE_HEADER pEoE, tvbuff_t *tvb, int offset)
{
pEoE->anEoeHeaderInfoUnion.Info = tvb_get_letohs(tvb, offset); offset+=2;
pEoE->anEoeHeaderDataUnion.Result = tvb_get_letohs(tvb, offset);
}
-static void init_foe_header(PETHERCAT_FOE_HEADER pFoE, tvbuff_t *tvb, gint offset)
+static void init_foe_header(PETHERCAT_FOE_HEADER pFoE, tvbuff_t *tvb, int offset)
{
- pFoE->OpMode = tvb_get_guint8(tvb, offset++);
- pFoE->Reserved1 = tvb_get_guint8(tvb, offset++);
+ pFoE->OpMode = tvb_get_uint8(tvb, offset++);
+ pFoE->Reserved1 = tvb_get_uint8(tvb, offset++);
pFoE->aFoeHeaderDataUnion.FileLength = tvb_get_letohl(tvb, offset);
}
-static void init_soe_header(PETHERCAT_SOE_HEADER pSoE, tvbuff_t *tvb, gint offset)
+static void init_soe_header(PETHERCAT_SOE_HEADER pSoE, tvbuff_t *tvb, int offset)
{
- pSoE->anSoeHeaderControlUnion.v2.Control = tvb_get_guint8(tvb, offset++);
- pSoE->anSoeHeaderControlUnion.v2.Element = tvb_get_guint8(tvb, offset++);
+ pSoE->anSoeHeaderControlUnion.v2.Control = tvb_get_uint8(tvb, offset++);
+ pSoE->anSoeHeaderControlUnion.v2.Element = tvb_get_uint8(tvb, offset++);
pSoE->anSoeHeaderDataUnion.FragmentsLeft = tvb_get_letohs(tvb, offset);
}
-static void init_coe_header(PETHERCAT_COE_HEADER pCoE, tvbuff_t *tvb, gint offset)
+static void init_coe_header(PETHERCAT_COE_HEADER pCoE, tvbuff_t *tvb, int offset)
{
pCoE->header = tvb_get_letohs(tvb, offset);
}
-static void init_sdo_header(PETHERCAT_SDO_HEADER pSdo, tvbuff_t *tvb, gint offset)
+static void init_sdo_header(PETHERCAT_SDO_HEADER pSdo, tvbuff_t *tvb, int offset)
{
- pSdo->anSdoHeaderUnion.CS = tvb_get_guint8(tvb, offset++);
+ pSdo->anSdoHeaderUnion.CS = tvb_get_uint8(tvb, offset++);
pSdo->Index = tvb_get_letohs(tvb, offset);offset+=2;
- pSdo->SubIndex = tvb_get_guint8(tvb, offset++);
+ pSdo->SubIndex = tvb_get_uint8(tvb, offset++);
pSdo->Data = tvb_get_letohl(tvb, offset);
}
-static void init_sdo_info_header(PETHERCAT_SDO_INFO_HEADER pInfo, tvbuff_t *tvb, gint offset)
+static void init_sdo_info_header(PETHERCAT_SDO_INFO_HEADER pInfo, tvbuff_t *tvb, int offset)
{
- pInfo->anSdoControlUnion.Control = tvb_get_guint8(tvb, offset++);
- pInfo->Reserved = tvb_get_guint8(tvb, offset);
+ pInfo->anSdoControlUnion.Control = tvb_get_uint8(tvb, offset++);
+ pInfo->Reserved = tvb_get_uint8(tvb, offset);
pInfo->FragmentsLeft = 2;
}
-static void CANopenSdoReqFormatter(PETHERCAT_SDO_HEADER pSdo, char *szText, gint nMax)
+static void CANopenSdoReqFormatter(PETHERCAT_SDO_HEADER pSdo, char *szText, int nMax)
{
switch ( pSdo->anSdoHeaderUnion.Idq.Ccs )
{
@@ -358,7 +358,7 @@ static void CANopenSdoReqFormatter(PETHERCAT_SDO_HEADER pSdo, char *szText, gint
}
}
-static void FoeFormatter(tvbuff_t *tvb, wmem_allocator_t *scope, gint offset, char *szText, gint nMax, guint foe_length)
+static void FoeFormatter(tvbuff_t *tvb, wmem_allocator_t *scope, int offset, char *szText, int nMax, unsigned foe_length)
{
ETHERCAT_FOE_HEADER foe;
char *tmp = NULL;
@@ -395,7 +395,7 @@ static void FoeFormatter(tvbuff_t *tvb, wmem_allocator_t *scope, gint offset, ch
break;
case ECAT_FOE_OPMODE_BUSY:
if ( foe.aFoeHeaderDataUnion.v2.Entire > 0 )
- snprintf ( szText, nMax, "FoE BUSY (%d%%)", ((guint32)foe.aFoeHeaderDataUnion.v2.Done*100)/foe.aFoeHeaderDataUnion.v2.Entire);
+ snprintf ( szText, nMax, "FoE BUSY (%d%%)", ((uint32_t)foe.aFoeHeaderDataUnion.v2.Done*100)/foe.aFoeHeaderDataUnion.v2.Entire);
else
snprintf ( szText, nMax, "FoE BUSY (%d/%d)", foe.aFoeHeaderDataUnion.v2.Done, foe.aFoeHeaderDataUnion.v2.Entire);
break;
@@ -404,7 +404,7 @@ static void FoeFormatter(tvbuff_t *tvb, wmem_allocator_t *scope, gint offset, ch
}
}
-static void SoEIdToString( char* txt, guint16 id, int nMax)
+static void SoEIdToString( char* txt, uint16_t id, int nMax)
{
if ( id & 0x8000 )
snprintf(txt, nMax, "P-%d-%04d", (id>>12) & 0x0007, id & 0x0FFF );
@@ -412,7 +412,7 @@ static void SoEIdToString( char* txt, guint16 id, int nMax)
snprintf(txt, nMax, "S-%d-%04d", id>>12, id & 0x0FFF );
}
-static void SoeFormatter(tvbuff_t *tvb, gint offset, char *szText, gint nMax, guint soe_length)
+static void SoeFormatter(tvbuff_t *tvb, int offset, char *szText, int nMax, unsigned soe_length)
{
ETHERCAT_SOE_HEADER soe;
char tmp[50];
@@ -448,16 +448,16 @@ static void SoeFormatter(tvbuff_t *tvb, gint offset, char *szText, gint nMax, gu
snprintf ( szText, nMax, "SoE: RRQ (%s, '%s')", tmp, elm);
break;
case ECAT_SOE_OPCODE_RRS:
- snprintf ( szText, nMax, "SoE: RRS (%s, '%s') : %u Bytes", tmp, elm, (guint)(soe_length-ETHERCAT_SOE_HEADER_LEN));
+ snprintf ( szText, nMax, "SoE: RRS (%s, '%s') : %u Bytes", tmp, elm, (unsigned)(soe_length-ETHERCAT_SOE_HEADER_LEN));
break;
case ECAT_SOE_OPCODE_WRS:
snprintf ( szText, nMax, "SoE: WRS (%s, '%s')", tmp, elm);
break;
case ECAT_SOE_OPCODE_WRQ:
- snprintf ( szText, nMax, "SoE: WRQ (%s, '%s') : %u Bytes", tmp, elm, (guint)(soe_length-ETHERCAT_SOE_HEADER_LEN));
+ snprintf ( szText, nMax, "SoE: WRQ (%s, '%s') : %u Bytes", tmp, elm, (unsigned)(soe_length-ETHERCAT_SOE_HEADER_LEN));
break;
case ECAT_SOE_OPCODE_NFC:
- snprintf ( szText, nMax, "SoE: NFC (%s, '%s') : %u Bytes", tmp, elm, (guint)(soe_length-ETHERCAT_SOE_HEADER_LEN));
+ snprintf ( szText, nMax, "SoE: NFC (%s, '%s') : %u Bytes", tmp, elm, (unsigned)(soe_length-ETHERCAT_SOE_HEADER_LEN));
break;
case 6:
snprintf ( szText, nMax, "SoE: EMGCY");
@@ -474,7 +474,7 @@ static void SoeFormatter(tvbuff_t *tvb, gint offset, char *szText, gint nMax, gu
}
/* ethercat mailbox */
-static void dissect_ecat_coe(tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree)
+static void dissect_ecat_coe(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
{
proto_tree *ecat_coe_tree = NULL, *ecat_sdo_tree, *ecat_coe_sdoccs_tree, *ecat_coe_sdoscs_tree;
@@ -482,8 +482,8 @@ static void dissect_ecat_coe(tvbuff_t *tvb, gint offset, packet_info *pinfo, pro
char szText[200];
int nMax = sizeof(szText)-1;
- guint coe_length = tvb_reported_length(tvb)-offset;
- guint16 len;
+ unsigned coe_length = tvb_reported_length(tvb)-offset;
+ uint16_t len;
if( tree )
{
@@ -745,7 +745,7 @@ static void dissect_ecat_coe(tvbuff_t *tvb, gint offset, packet_info *pinfo, pro
break;
case ECAT_COE_INFO_OPCODE_ENTRY_S:
{
- guint16 objlen;
+ uint16_t objlen;
proto_tree_add_item(ecat_coe_tree, hf_ecat_mailbox_coe_sdoinfoindex, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
@@ -806,7 +806,7 @@ static void dissect_ecat_coe(tvbuff_t *tvb, gint offset, packet_info *pinfo, pro
}
}
-static void dissect_ecat_soe(tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree)
+static void dissect_ecat_soe(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
{
proto_tree *ecat_soeflag_tree, *ecat_soe_tree;
@@ -814,7 +814,7 @@ static void dissect_ecat_soe(tvbuff_t *tvb, gint offset, packet_info *pinfo, pro
char szText[200];
int nMax = sizeof(szText)-1;
- guint soe_length = tvb_reported_length(tvb)-offset;
+ unsigned soe_length = tvb_reported_length(tvb)-offset;
if( tree )
{
@@ -896,7 +896,7 @@ static void dissect_ecat_soe(tvbuff_t *tvb, gint offset, packet_info *pinfo, pro
}
}
-static void dissect_ecat_eoe(tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree)
+static void dissect_ecat_eoe(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
{
proto_tree *ecat_eoe_tree = 0, *ecat_fraghead_tree, *ecat_eoe_init_tree, *ecat_eoe_macfilter_tree,
*ecat_eoe_macfilter_filter_tree;
@@ -904,7 +904,7 @@ static void dissect_ecat_eoe(tvbuff_t *tvb, gint offset, packet_info *pinfo, pro
proto_item *anItem = NULL, *aparent = NULL;
int nCnt;
- guint eoe_length = tvb_reported_length(tvb)-offset;
+ unsigned eoe_length = tvb_reported_length(tvb)-offset;
if( tree )
{
@@ -1078,7 +1078,7 @@ static void dissect_ecat_eoe(tvbuff_t *tvb, gint offset, packet_info *pinfo, pro
}
}
-static void dissect_ecat_foe(tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree)
+static void dissect_ecat_foe(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
{
proto_tree *ecat_foe_tree,*ecat_foe_efw_tree;
@@ -1086,7 +1086,7 @@ static void dissect_ecat_foe(tvbuff_t *tvb, gint offset, packet_info *pinfo, pro
char szText[200];
int nMax = sizeof(szText)-1;
- guint foe_length = tvb_reported_length(tvb)-offset;
+ unsigned foe_length = tvb_reported_length(tvb)-offset;
if( tree )
{
@@ -1183,9 +1183,9 @@ static int dissect_ecat_mailbox(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
proto_tree *ecat_mailbox_header_tree = NULL;
tvbuff_t *next_tvb;
proto_item *anItem;
- gint offset = 0;
+ int offset = 0;
- gint mailbox_length = tvb_reported_length(tvb);
+ int mailbox_length = tvb_reported_length(tvb);
if( mailbox_length >= ETHERCAT_MBOX_HEADER_LEN )
{
@@ -1929,7 +1929,7 @@ void proto_register_ecat_mailbox(void)
}
};
- static gint *ett[] =
+ static int *ett[] =
{
&ett_ecat_mailbox,
&ett_ecat_mailbox_eoe,
diff --git a/plugins/epan/ethercat/packet-ecatmb.h b/plugins/epan/ethercat/packet-ecatmb.h
index 54dce708..6e9ad29b 100644
--- a/plugins/epan/ethercat/packet-ecatmb.h
+++ b/plugins/epan/ethercat/packet-ecatmb.h
@@ -18,7 +18,7 @@ DIAG_OFF_PEDANTIC
typedef struct TETHERNET_ADDRESS
{
- guint8 b[6];
+ uint8_t b[6];
} ETHERNET_ADDRESS, *PETHERNET_ADDRESS;
#define ETHERNET_ADDRESS_LEN ((int) sizeof(ETHERNET_ADDRESS))
@@ -31,21 +31,21 @@ typedef struct TETHERNET_ADDRESS
typedef union tMbxHeaderControlUnion
{
- guint16 Control;
+ uint16_t Control;
struct
{
- guint16 Channel : 6; /* optional communication channels (default = 0)*/
- guint16 Priority : 2; /* optional communication priority (default = 0)*/
- guint16 Type : 4; /* TETHERCAT_MBOX_TYPE_xxx*/
- guint16 Counter : 3; /* 0 = counter not used (old version)*/
- guint16 Unsupported : 1; /* unsupported protocol detected*/
+ uint16_t Channel : 6; /* optional communication channels (default = 0)*/
+ uint16_t Priority : 2; /* optional communication priority (default = 0)*/
+ uint16_t Type : 4; /* TETHERCAT_MBOX_TYPE_xxx*/
+ uint16_t Counter : 3; /* 0 = counter not used (old version)*/
+ uint16_t Unsupported : 1; /* unsupported protocol detected*/
} v;
} MbxHeaderControlUnion;
typedef struct TETHERCAT_MBOX_HEADER
{
- guint16 Length; /* following bytes*/
- guint16 Address; /* S->M: phys addr of destination; M->S: phys addr of source; 0 = master*/
+ uint16_t Length; /* following bytes*/
+ uint16_t Address; /* S->M: phys addr of destination; M->S: phys addr of source; 0 = master*/
MbxHeaderControlUnion aControlUnion;
} ETHERCAT_MBOX_HEADER, *PETHERCAT_MBOX_HEADER;
@@ -70,18 +70,18 @@ typedef struct TETHERCAT_MBOX_HEADER
/*typedef struct TETHERCAT_EOE_INIT
{
- guint32 ContainsMacAddr :1;
- guint32 ContainsIpAddr :1;
- guint32 ContainsSubnetMask :1;
- guint32 ContainsDefaultGateway :1;
- guint32 ContainsDnsServer :1;
- guint32 ContainsDnsName :1;
- guint32 Reserved :26;
+ uint32_t ContainsMacAddr :1;
+ uint32_t ContainsIpAddr :1;
+ uint32_t ContainsSubnetMask :1;
+ uint32_t ContainsDefaultGateway :1;
+ uint32_t ContainsDnsServer :1;
+ uint32_t ContainsDnsName :1;
+ uint32_t Reserved :26;
ETHERNET_ADDRESS MacAddr;
- guint32 IpAddr;
- guint32 SubnetMask;
- guint32 DefaultGateway;
- guint32 DnsServer;
+ uint32_t IpAddr;
+ uint32_t SubnetMask;
+ uint32_t DefaultGateway;
+ uint32_t DnsServer;
char DnsName[32];
} ETHERCAT_EOE_INIT, *PETHERCAT_EOE_INIT;*/
#define ETHERCAT_EOE_INIT_LEN 58 /*sizeof(ETHERCAT_EOE_INIT)*/
@@ -90,13 +90,13 @@ typedef union tEoeMacFilterOptionsUnion
{
struct
{
- guint16 MacFilterCount :4;
- guint16 MacFilterMaskCount :2;
- guint16 Reserved1 :1;
- guint16 NoBroadcasts :1;
- guint16 Reserved2 :8;
+ uint16_t MacFilterCount :4;
+ uint16_t MacFilterMaskCount :2;
+ uint16_t Reserved1 :1;
+ uint16_t NoBroadcasts :1;
+ uint16_t Reserved2 :8;
} v;
- guint16 Options;
+ uint16_t Options;
} EoeMacFilterOptionsUnion;
typedef struct TETHERCAT_EOE_MACFILTER
@@ -109,7 +109,7 @@ typedef struct TETHERCAT_EOE_MACFILTER
typedef struct TETHERCAT_EOE_TIMESTAMP
{
- guint32 TimeStamp; /* 32 bit time stamp */
+ uint32_t TimeStamp; /* 32 bit time stamp */
} ETHERCAT_EOE_TIMESTAMP;
#define ETHERCAT_EOE_TIMESTAMP_LEN ((int) sizeof(ETHERCAT_EOE_TIMESTAMP))
@@ -117,26 +117,26 @@ typedef union tEoeHeaderDataUnion
{
struct
{ /* EOE_TYPE_FRAME_FRAG and EOE_TYPE_TIMESTAMP_RES only */
- guint16 Fragment : 6; /* fragment number (EOE_TYPE_FRAME_FRAG only) */
- guint16 OffsetBuffer : 6; /* byte offset multiplied by 32 (if Fragment != 0) (EOE_TYPE_FRAME_FRAG only) */
+ uint16_t Fragment : 6; /* fragment number (EOE_TYPE_FRAME_FRAG only) */
+ uint16_t OffsetBuffer : 6; /* byte offset multiplied by 32 (if Fragment != 0) (EOE_TYPE_FRAME_FRAG only) */
/* buffer size multiplied by 32 (if Fragment == 0) (EOE_TYPE_FRAME_FRAG only) */
- guint16 FrameNo : 4; /* frame number (EOE_TYPE_FRAME_FRAG and EOE_TYPE_TIMESTAMP_RES only) */
+ uint16_t FrameNo : 4; /* frame number (EOE_TYPE_FRAME_FRAG and EOE_TYPE_TIMESTAMP_RES only) */
} v;
- guint16 Result; /* EOE_TYPE_INIT_RES and EOE_TYPE_MACFILTER_RES only */
+ uint16_t Result; /* EOE_TYPE_INIT_RES and EOE_TYPE_MACFILTER_RES only */
} EoeHeaderDataUnion;
typedef union tEoeHeaderInfoUnion
{
struct
{
- guint16 Type : 4; /* specifies following data */
- guint16 PortAssign : 4; /* 0 = unspecified, 1 = port 1 */
- guint16 LastFragment : 1; /* TRUE if last fragment (EOE_TYPE_FRAME_FRAG only) */
- guint16 TimeStampAppended : 1; /* 32 bit time stamp appended (EOE_TYPE_FRAME_FRAG with LastFragment=1 only) */
- guint16 TimeStampRequested : 1; /* time stamp response requested (EOE_TYPE_FRAME_FRAG only) */
- guint16 Reserved : 5;
+ uint16_t Type : 4; /* specifies following data */
+ uint16_t PortAssign : 4; /* 0 = unspecified, 1 = port 1 */
+ uint16_t LastFragment : 1; /* true if last fragment (EOE_TYPE_FRAME_FRAG only) */
+ uint16_t TimeStampAppended : 1; /* 32 bit time stamp appended (EOE_TYPE_FRAME_FRAG with LastFragment=1 only) */
+ uint16_t TimeStampRequested : 1; /* time stamp response requested (EOE_TYPE_FRAME_FRAG only) */
+ uint16_t Reserved : 5;
} v;
- guint16 Info;
+ uint16_t Info;
} EoeHeaderInfoUnion;
typedef struct TETHERCAT_EOE_HEADER
@@ -160,11 +160,11 @@ typedef union TETHERCAT_COE_HEADER
{
struct
{
- guint16 Number : 9; /* e.g. PDO number*/
- guint16 Reserved : 3; /* = 0*/
- guint16 Type : 4; /* CANopen type*/
+ uint16_t Number : 9; /* e.g. PDO number*/
+ uint16_t Reserved : 3; /* = 0*/
+ uint16_t Type : 4; /* CANopen type*/
} v;
- guint16 header;
+ uint16_t header;
} ETHERCAT_COE_HEADER, *PETHERCAT_COE_HEADER;
#define ETHERCAT_COE_HEADER_LEN ((int) sizeof(ETHERCAT_COE_HEADER))
@@ -173,72 +173,72 @@ typedef union tSdoHeaderUnion
{
struct
{ /* Initiate Download Request*/
- guint8 SizeInd : 1;
- guint8 Expedited : 1;
- guint8 Size : 2;
- guint8 Complete : 1;
- guint8 Ccs : 3; /* = 1*/
+ uint8_t SizeInd : 1;
+ uint8_t Expedited : 1;
+ uint8_t Size : 2;
+ uint8_t Complete : 1;
+ uint8_t Ccs : 3; /* = 1*/
} Idq;
struct
{ /* Initiate Download Response*/
- guint8 Reserved : 5;
- guint8 Scs : 3; /* = 3*/
+ uint8_t Reserved : 5;
+ uint8_t Scs : 3; /* = 3*/
} Ids;
struct
{ /* Download Segment Request*/
- guint8 LastSeg : 1;
- guint8 Size : 3;
- guint8 Toggle : 1;
- guint8 Ccs : 3; /* = 0*/
+ uint8_t LastSeg : 1;
+ uint8_t Size : 3;
+ uint8_t Toggle : 1;
+ uint8_t Ccs : 3; /* = 0*/
} Dsq;
struct
{ /* Download Segment Response*/
- guint8 Reserved : 4;
- guint8 Toggle : 1;
- guint8 Scs : 3; /* = 1*/
+ uint8_t Reserved : 4;
+ uint8_t Toggle : 1;
+ uint8_t Scs : 3; /* = 1*/
} Dss;
struct
{ /* Initiate Upload Request*/
- guint8 Reserved : 4;
- guint8 Complete : 1;
- guint8 Ccs : 3; /* = 2*/
+ uint8_t Reserved : 4;
+ uint8_t Complete : 1;
+ uint8_t Ccs : 3; /* = 2*/
} Iuq;
struct
{ /* Initiate Upload Response*/
- guint8 SizeInd : 1;
- guint8 Expedited : 1;
- guint8 Size : 2;
- guint8 Complete : 1;
- guint8 Scs : 3; /* = 2*/
+ uint8_t SizeInd : 1;
+ uint8_t Expedited : 1;
+ uint8_t Size : 2;
+ uint8_t Complete : 1;
+ uint8_t Scs : 3; /* = 2*/
} Ius;
struct
{ /* Upload Segment Request*/
- guint8 Reserved : 4;
- guint8 Toggle : 1;
- guint8 Ccs : 3; /* = 3*/
+ uint8_t Reserved : 4;
+ uint8_t Toggle : 1;
+ uint8_t Ccs : 3; /* = 3*/
} Usq;
struct
{ /* Upload Segment Response*/
- guint8 LastSeg : 1;
- guint8 Bytes : 3;
- guint8 Toggle : 1;
- guint8 Scs : 3; /* = 0*/
+ uint8_t LastSeg : 1;
+ uint8_t Bytes : 3;
+ uint8_t Toggle : 1;
+ uint8_t Scs : 3; /* = 0*/
} Uss;
struct
{ /* Abort Transfer*/
- guint8 Reserved : 5;
- guint8 Ccs : 3; /* = 4*/
+ uint8_t Reserved : 5;
+ uint8_t Ccs : 3; /* = 4*/
} Abt;
- guint8 CS;
+ uint8_t CS;
} SdoHeaderUnion;
typedef struct TETHERCAT_SDO_HEADER
{
SdoHeaderUnion anSdoHeaderUnion;
- guint16 Index;
- guint8 SubIndex;
- guint32 Data;
+ uint16_t Index;
+ uint8_t SubIndex;
+ uint32_t Data;
} ETHERCAT_SDO_HEADER, *PETHERCAT_SDO_HEADER;
#define ETHERCAT_SDO_HEADER_LEN 8 /* sizeof(ETHERCAT_SDO_HEADER)*/
@@ -284,42 +284,42 @@ typedef struct TETHERCAT_SDO_HEADER
typedef struct TETHERCAT_SDO_INFO_LIST
{
- guint16 ListType; /* == SDO_INFO_LIST_TYPE_XXX */
+ uint16_t ListType; /* == SDO_INFO_LIST_TYPE_XXX */
struct
{
- guint16 Index[1];
+ uint16_t Index[1];
} Res;
} ETHERCAT_SDO_INFO_LIST;
typedef struct TETHERCAT_SDO_INFO_OBJ
{
- guint16 Index;
+ uint16_t Index;
struct
{
- guint16 DataType; /* refer to data type index */
- guint8 MaxSubIndex; /* max subIndex */
- guint8 ObjCode; /* defined in DS 301 (Table 37)*/
+ uint16_t DataType; /* refer to data type index */
+ uint8_t MaxSubIndex; /* max subIndex */
+ uint8_t ObjCode; /* defined in DS 301 (Table 37)*/
char Name[1]; /* rest of mailbox data*/
} Res;
} ETHERCAT_SDO_INFO_OBJ;
typedef struct TETHERCAT_SDO_INFO_ENTRY
{
- guint16 Index;
- guint8 SubIdx;
- guint8 ValueInfo; /* bit0 = ObjAccess, bit1 = ObjCategory, bit2 = PdoMapping, bit3 = UnitType
+ uint16_t Index;
+ uint8_t SubIdx;
+ uint8_t ValueInfo; /* bit0 = ObjAccess, bit1 = ObjCategory, bit2 = PdoMapping, bit3 = UnitType
bit4 = DefaultValue, bit5 = MinValue, bit6 = MaxValue*/
struct
{
- guint16 DataType; /* refer to data type index */
- guint16 BitLen;
- guint16 ObjAccess; /* bit0 = read; bit1 = write; bit2 = const. bit3 = 'PRE-OP'; bit4 = 'SAFE-OP'; bit5 = 'OP'.*/
+ uint16_t DataType; /* refer to data type index */
+ uint16_t BitLen;
+ uint16_t ObjAccess; /* bit0 = read; bit1 = write; bit2 = const. bit3 = 'PRE-OP'; bit4 = 'SAFE-OP'; bit5 = 'OP'.*/
} Res;
} ETHERCAT_SDO_INFO_ENTRY;
typedef struct TETHERCAT_SDO_INFO_ERROR
{
- guint32 ErrorCode;
+ uint32_t ErrorCode;
char ErrorText[1]; /* rest of mailbox data */
} ETHERCAT_SDO_INFO_ERROR;
@@ -329,24 +329,24 @@ typedef union tSdoInfoUnion
ETHERCAT_SDO_INFO_OBJ Obj;
ETHERCAT_SDO_INFO_ENTRY Entry;
ETHERCAT_SDO_INFO_ERROR Error;
- guint8 Data[1];
+ uint8_t Data[1];
} SdoInfoUnion;
typedef union tSdoControlUnion
{
struct
{
- guint8 OpCode : 7; /* == SDO_INFO_TYPE_XXX */
- guint8 InComplete : 1;
+ uint8_t OpCode : 7; /* == SDO_INFO_TYPE_XXX */
+ uint8_t InComplete : 1;
} v;
- guint8 Control;
+ uint8_t Control;
} SdoControlUnion;
typedef struct TETHERCAT_SDO_INFO_HEADER
{
SdoControlUnion anSdoControlUnion;
- guint8 Reserved; /* == 0 */
- guint16 FragmentsLeft;
+ uint8_t Reserved; /* == 0 */
+ uint16_t FragmentsLeft;
SdoInfoUnion anSdoInfoUnion;
} ETHERCAT_SDO_INFO_HEADER, *PETHERCAT_SDO_INFO_HEADER;
@@ -373,30 +373,30 @@ typedef struct TETHERCAT_SDO_INFO_HEADER
typedef union tFoeHeaderDataUnion
{
- guint32 FileLength; /* (RRQ, WRQ) = 0 if unknown */
+ uint32_t FileLength; /* (RRQ, WRQ) = 0 if unknown */
struct
{
- guint16 PacketNo; /* (DATA, ACK)*/
- guint16 Reserved2; /* (DATA, ACK)*/
+ uint16_t PacketNo; /* (DATA, ACK)*/
+ uint16_t Reserved2; /* (DATA, ACK)*/
} v;
- guint32 ErrorCode; /* (ERR)*/
+ uint32_t ErrorCode; /* (ERR)*/
struct
{
- guint16 Done; /* (BUSY)*/
- guint16 Entire; /* (BUSY)*/
+ uint16_t Done; /* (BUSY)*/
+ uint16_t Entire; /* (BUSY)*/
} v2;
} FoeHeaderDataUnion;
typedef struct TETHERCAT_FOE_HEADER
{
- guint8 OpMode; /* = 1 (RRQ), = 2 (WRQ), = 3 (DATA), = 4 (ACK), = 5 (ERR), = 6 (BUSY) */
- guint8 Reserved1; /* = 0 */
+ uint8_t OpMode; /* = 1 (RRQ), = 2 (WRQ), = 3 (DATA), = 4 (ACK), = 5 (ERR), = 6 (BUSY) */
+ uint8_t Reserved1; /* = 0 */
FoeHeaderDataUnion aFoeHeaderDataUnion;
/* typedef union tMailBoxDataUnion
{
char Name[] (RRQ, WRQ) rest of mailbox data
- guint8 Data[] (DATA) rest of mailbox data (if OpMode = 3)
+ uint8_t Data[] (DATA) rest of mailbox data (if OpMode = 3)
char ErrorText[] (ERR) rest of mailbox data
} MailBoxDataUnion;*/
} ETHERCAT_FOE_HEADER, *PETHERCAT_FOE_HEADER;
@@ -404,10 +404,10 @@ typedef struct TETHERCAT_FOE_HEADER
typedef struct
{
- guint16 Cmd;
- guint16 Size;
- guint16 AddressLW;
- guint16 AddressHW;
+ uint16_t Cmd;
+ uint16_t Size;
+ uint16_t AddressLW;
+ uint16_t AddressHW;
} TEFWUPDATE_HEADER;
@@ -423,32 +423,32 @@ typedef union tSoeHeaderControlUnion
{
struct
{
- guint8 OpCode : 3; /* 0 = unused, 1 = readReq, 2 = readRes, 3 = writeReq, 4 = writeRes
+ uint8_t OpCode : 3; /* 0 = unused, 1 = readReq, 2 = readRes, 3 = writeReq, 4 = writeRes
5 = notification (command changed notification)*/
- guint8 InComplete : 1; /* more follows*/
- guint8 Error : 1; /* an error word follows */
- guint8 DriveNo : 3; /* drive number */
-
- guint8 DataState : 1; /* follows or requested */
- guint8 Name : 1; /* follows or requested */
- guint8 Attribute : 1; /* follows or requested */
- guint8 Unit : 1; /* follows or requested */
- guint8 Min : 1; /* follows or requested */
- guint8 Max : 1; /* follows or requested */
- guint8 Value : 1; /* follows or requested */
- guint8 Reserved : 1;
+ uint8_t InComplete : 1; /* more follows*/
+ uint8_t Error : 1; /* an error word follows */
+ uint8_t DriveNo : 3; /* drive number */
+
+ uint8_t DataState : 1; /* follows or requested */
+ uint8_t Name : 1; /* follows or requested */
+ uint8_t Attribute : 1; /* follows or requested */
+ uint8_t Unit : 1; /* follows or requested */
+ uint8_t Min : 1; /* follows or requested */
+ uint8_t Max : 1; /* follows or requested */
+ uint8_t Value : 1; /* follows or requested */
+ uint8_t Reserved : 1;
} v;
struct
{
- guint8 Control;
- guint8 Element;
+ uint8_t Control;
+ uint8_t Element;
} v2;
} SoeHeaderControlUnion;
typedef union tSoeHeaderDataUnion
{
- guint16 IDN; /* SOE IDN if (InComplete==0) */
- guint16 FragmentsLeft; /* Pending fragments if (InComplete==1) */
+ uint16_t IDN; /* SOE IDN if (InComplete==0) */
+ uint16_t FragmentsLeft; /* Pending fragments if (InComplete==1) */
} SoeHeaderDataUnion;
typedef struct TETHERCAT_SOE_HEADER
@@ -457,13 +457,13 @@ typedef struct TETHERCAT_SOE_HEADER
SoeHeaderDataUnion anSoeHeaderDataUnion;
/* typedef union tMailBoxDataUnion
{
- guint8 Data[] rest of mailbox data if (Error==0)
- guint16 ErrorCode if (Error==1)
+ uint8_t Data[] rest of mailbox data if (Error==0)
+ uint16_t ErrorCode if (Error==1)
} MailBoxDataUnion;*/
} ETHERCAT_SOE_HEADER, *PETHERCAT_SOE_HEADER;
#define ETHERCAT_SOE_HEADER_LEN ((int) sizeof(ETHERCAT_SOE_HEADER))
-extern void init_mbx_header(PETHERCAT_MBOX_HEADER pMbox, tvbuff_t *tvb, gint offset);
+extern void init_mbx_header(PETHERCAT_MBOX_HEADER pMbox, tvbuff_t *tvb, int offset);
DIAG_ON_PEDANTIC
#endif /* _PACKET_ECATMAILBOX_H_ */
diff --git a/plugins/epan/ethercat/packet-esl.c b/plugins/epan/ethercat/packet-esl.c
index 75f269b4..ae9156f1 100644
--- a/plugins/epan/ethercat/packet-esl.c
+++ b/plugins/epan/ethercat/packet-esl.c
@@ -24,29 +24,29 @@ typedef union _EslFlagsUnion
{
struct
{
- guint16 port7 : 1;
- guint16 port6 : 1;
- guint16 port5 : 1;
- guint16 port4 : 1;
- guint16 port3 : 1;
- guint16 port2 : 1;
- guint16 port1 : 1;
- guint16 port0 : 1;
- guint16 extended : 1;
- guint16 port11 : 1;
- guint16 port10 : 1;
- guint16 alignError : 1;
- guint16 crcError : 1;
- guint16 timeStampEna : 1;
- guint16 port9 : 1;
- guint16 port8 : 1;
+ uint16_t port7 : 1;
+ uint16_t port6 : 1;
+ uint16_t port5 : 1;
+ uint16_t port4 : 1;
+ uint16_t port3 : 1;
+ uint16_t port2 : 1;
+ uint16_t port1 : 1;
+ uint16_t port0 : 1;
+ uint16_t extended : 1;
+ uint16_t port11 : 1;
+ uint16_t port10 : 1;
+ uint16_t alignError : 1;
+ uint16_t crcError : 1;
+ uint16_t timeStampEna : 1;
+ uint16_t port9 : 1;
+ uint16_t port8 : 1;
}d;
struct
{
- guint8 loPorts : 1;
- guint8 flagsHiPorts : 1;
+ uint8_t loPorts : 1;
+ uint8_t flagsHiPorts : 1;
}lo_hi_flags;
- guint flags;
+ unsigned flags;
} EslFlagsUnion;
#endif
@@ -70,9 +70,9 @@ typedef union _EslFlagsUnion
#if 0
typedef struct _EslHeader
{
- guint8 eslCookie[6]; /* 01 01 05 10 00 00 */
+ uint8_t eslCookie[6]; /* 01 01 05 10 00 00 */
EslFlagsUnion flags;
- guint64 timeStamp;
+ uint64_t timeStamp;
} EslHeader, *PEslHeader;
#endif
@@ -84,14 +84,14 @@ static dissector_handle_t eth_withoutfcs_handle;
void proto_reg_handoff_esl(void);
/* Define the esl proto */
-int proto_esl = -1;
+int proto_esl;
-static int ett_esl = -1;
+static int ett_esl;
-static int hf_esl_timestamp = -1;
-static int hf_esl_port = -1;
-static int hf_esl_crcerror = -1;
-static int hf_esl_alignerror = -1;
+static int hf_esl_timestamp;
+static int hf_esl_port;
+static int hf_esl_crcerror;
+static int hf_esl_alignerror;
/* Note: using external tfs strings apparently doesn't work in a plugin */
static const true_false_string flags_yes_no = {
@@ -101,7 +101,7 @@ static const true_false_string flags_yes_no = {
#if 0
/* XXX: using bitfields is compiler dependent: See README.developer */
-static guint16 flags_to_port(guint16 flagsValue) {
+static uint16_t flags_to_port(uint16_t flagsValue) {
EslFlagsUnion flagsUnion;
flagsUnion.flags = flagsValue;
if ( flagsUnion.d.port0 )
@@ -129,7 +129,7 @@ static guint16 flags_to_port(guint16 flagsValue) {
}
#endif
-static guint16 flags_to_port(guint16 flagsValue) {
+static uint16_t flags_to_port(uint16_t flagsValue) {
if ( (flagsValue & esl_port0_bitmask) != 0 )
return 0;
else if ( (flagsValue & esl_port1_bitmask) != 0 )
@@ -164,14 +164,14 @@ dissect_esl_header(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void
proto_item *ti = NULL;
proto_tree *esl_header_tree;
- gint offset = 0;
+ int offset = 0;
- guint esl_length = tvb_reported_length(tvb);
+ unsigned esl_length = tvb_reported_length(tvb);
if ( esl_length >= SIZEOF_ESLHEADER )
{
if (tree)
{
- guint16 flags;
+ uint16_t flags;
ti = proto_tree_add_item(tree, proto_esl, tvb, 0, SIZEOF_ESLHEADER, ENC_NA);
esl_header_tree = proto_item_add_subtree(ti, ett_esl);
@@ -194,24 +194,24 @@ dissect_esl_header(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void
typedef struct _ref_time_frame_info
{
frame_data *fd;
- guint64 esl_ts;
+ uint64_t esl_ts;
nstime_t abs_ts;
- guint32 num;
+ uint32_t num;
} ref_time_frame_info;
static ref_time_frame_info ref_time_frame;
-static gboolean is_esl_header(tvbuff_t *tvb, gint offset)
+static bool is_esl_header(tvbuff_t *tvb, int offset)
{
- return tvb_get_guint8(tvb, offset) == 0x01 &&
- tvb_get_guint8(tvb, offset+1) == 0x01 &&
- tvb_get_guint8(tvb, offset+2) == 0x05 &&
- (tvb_get_guint8(tvb, offset+3) == 0x10 ||tvb_get_guint8(tvb, offset+3) == 0x11)&&
- tvb_get_guint8(tvb, offset+4) == 0x00 &&
- tvb_get_guint8(tvb, offset+5) == 0x00;
+ return tvb_get_uint8(tvb, offset) == 0x01 &&
+ tvb_get_uint8(tvb, offset+1) == 0x01 &&
+ tvb_get_uint8(tvb, offset+2) == 0x05 &&
+ (tvb_get_uint8(tvb, offset+3) == 0x10 ||tvb_get_uint8(tvb, offset+3) == 0x11)&&
+ tvb_get_uint8(tvb, offset+4) == 0x00 &&
+ tvb_get_uint8(tvb, offset+5) == 0x00;
}
-static void modify_times(tvbuff_t *tvb, gint offset, packet_info *pinfo)
+static void modify_times(tvbuff_t *tvb, int offset, packet_info *pinfo)
{
if ( ref_time_frame.fd == NULL )
{
@@ -222,8 +222,8 @@ static void modify_times(tvbuff_t *tvb, gint offset, packet_info *pinfo)
}
else if ( !pinfo->fd->visited )
{
- guint64 nsecs = tvb_get_letoh64(tvb, offset+8) - ref_time_frame.esl_ts;
- guint64 secs = nsecs/1000000000;
+ uint64_t nsecs = tvb_get_letoh64(tvb, offset+8) - ref_time_frame.esl_ts;
+ uint64_t secs = nsecs/1000000000;
nstime_t ts;
nstime_t ts_delta;
@@ -243,18 +243,18 @@ static void modify_times(tvbuff_t *tvb, gint offset, packet_info *pinfo)
}
}
-static gboolean
+static bool
dissect_esl_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- static gboolean in_heur = FALSE;
- gboolean result;
+ static bool in_heur = false;
+ bool result;
tvbuff_t *next_tvb;
- guint esl_length = tvb_captured_length(tvb);
+ unsigned esl_length = tvb_captured_length(tvb);
if ( in_heur )
- return FALSE;
+ return false;
- in_heur = TRUE;
+ in_heur = true;
/*TRY */
{
if ( ref_time_frame.fd != NULL && !pinfo->fd->visited && pinfo->num <= ref_time_frame.num )
@@ -262,7 +262,7 @@ dissect_esl_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
/* Check that there's enough data */
if ( esl_length < SIZEOF_ESLHEADER )
- return FALSE;
+ return false;
/* check for Esl frame, this has a unique destination MAC from Beckhoff range
First 6 bytes must be: 01 01 05 10 00 00 */
@@ -275,7 +275,7 @@ dissect_esl_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, tree);
}
modify_times(tvb, 0, pinfo);
- result = TRUE;
+ result = true;
}
else if ( is_esl_header(tvb, esl_length-SIZEOF_ESLHEADER) )
{
@@ -288,18 +288,18 @@ dissect_esl_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
dissect_esl_header(next_tvb, pinfo, tree, data);
modify_times(tvb, esl_length-SIZEOF_ESLHEADER, pinfo);
- result = TRUE;
+ result = true;
}
else
{
- result = FALSE;
+ result = false;
}
}
/*CATCH_ALL{
- in_heur = FALSE;
+ in_heur = false;
RETHROW;
}ENDTRY;*/
- in_heur = FALSE;
+ in_heur = false;
return result;
}
@@ -328,7 +328,7 @@ proto_register_esl(void) {
},
};
- static gint *ett[] = {
+ static int *ett[] = {
&ett_esl,
};
@@ -349,12 +349,12 @@ proto_register_esl(void) {
void
proto_reg_handoff_esl(void) {
- static gboolean initialized = FALSE;
+ static bool initialized = false;
if (!initialized) {
eth_withoutfcs_handle = find_dissector_add_dependency("eth_withoutfcs", proto_esl);
heur_dissector_add("eth", dissect_esl_heur, "EtherCAT over Ethernet", "esl_eth", proto_esl, HEURISTIC_DISABLE);
- initialized = TRUE;
+ initialized = true;
}
}
diff --git a/plugins/epan/ethercat/packet-ethercat-datagram.c b/plugins/epan/ethercat/packet-ethercat-datagram.c
index 6ba7c9e3..6e20fdfa 100644
--- a/plugins/epan/ethercat/packet-ethercat-datagram.c
+++ b/plugins/epan/ethercat/packet-ethercat-datagram.c
@@ -29,418 +29,418 @@ static dissector_handle_t ecat_handle;
static dissector_handle_t ecat_mailbox_handle;
/* Define the EtherCAT proto */
-static int proto_ecat_datagram = -1;
+static int proto_ecat_datagram;
/* Define the tree for EtherCAT */
-static int ett_ecat = -1;
-static int ett_ecat_header = -1;
-static int ett_ecat_dc = -1;
-static int ett_ecat_length = -1;
-static int ett_ecat_padding = -1;
-static int ett_ecat_datagram_subtree = -1;
-static int ett_ecat_reg_esc_features = -1;
-static int ett_ecat_reg_dlctrl1 = -1;
-static int ett_ecat_reg_dlctrl2 = -1;
-static int ett_ecat_reg_dlctrl3 = -1;
-static int ett_ecat_reg_dlctrl4 = -1;
-static int ett_ecat_reg_dlstatus1 = -1;
-static int ett_ecat_reg_dlstatus2 = -1;
-static int ett_ecat_reg_alctrl = -1;
-static int ett_ecat_reg_alstatus = -1;
-static int ett_ecat_reg_pdictrl1 = -1;
-static int ett_ecat_reg_pdictrl2 = -1;
-static int ett_ecat_reg_ecat_mask = -1;
-static int ett_ecat_reg_pdiL = -1;
-static int ett_ecat_reg_ecat = -1;
-static int ett_ecat_reg_pdi1 = -1;
-static int ett_ecat_reg_crc0 = -1;
-static int ett_ecat_reg_crc1 = -1;
-static int ett_ecat_reg_crc2 = -1;
-static int ett_ecat_reg_crc3 = -1;
-static int ett_ecat_reg_wd_status = -1;
-static int ett_ecat_reg_eeprom_assign = -1;
-static int ett_ecat_reg_ctrlstat = -1;
-static int ett_ecat_reg_mio_ctrlstat = -1;
-static int ett_ecat_mio_addr = -1;
-static int ett_ecat_mio_access = -1;
-static int ett_ecat_mio_status0 = -1;
-static int ett_ecat_mio_status1 = -1;
-static int ett_ecat_mio_status2 = -1;
-static int ett_ecat_mio_status3 = -1;
-static int ett_ecat_reg_fmmu = -1;
-static int ett_ecat_reg_syncman = -1;
-static int ett_ecat_reg_syncman_ctrlstatus = -1;
-static int ett_ecat_reg_syncman_sm_enable = -1;
-static int ett_ecat_reg_dc_cycunitctrl = -1;
-static int ett_ecat_dc_activation = -1;
-static int ett_ecat_dc_activationstat = -1;
-static int ett_ecat_dc_sync0_status = -1;
-static int ett_ecat_dc_sync1_status = -1;
-static int ett_ecat_dc_latch0_ctrl = -1;
-static int ett_ecat_dc_latch1_ctrl = -1;
-static int ett_ecat_dc_latch0_status = -1;
-static int ett_ecat_dc_latch1_status = -1;
+static int ett_ecat;
+static int ett_ecat_header;
+static int ett_ecat_dc;
+static int ett_ecat_length;
+static int ett_ecat_padding;
+static int ett_ecat_datagram_subtree;
+static int ett_ecat_reg_esc_features;
+static int ett_ecat_reg_dlctrl1;
+static int ett_ecat_reg_dlctrl2;
+static int ett_ecat_reg_dlctrl3;
+static int ett_ecat_reg_dlctrl4;
+static int ett_ecat_reg_dlstatus1;
+static int ett_ecat_reg_dlstatus2;
+static int ett_ecat_reg_alctrl;
+static int ett_ecat_reg_alstatus;
+static int ett_ecat_reg_pdictrl1;
+static int ett_ecat_reg_pdictrl2;
+static int ett_ecat_reg_ecat_mask;
+static int ett_ecat_reg_pdiL;
+static int ett_ecat_reg_ecat;
+static int ett_ecat_reg_pdi1;
+static int ett_ecat_reg_crc0;
+static int ett_ecat_reg_crc1;
+static int ett_ecat_reg_crc2;
+static int ett_ecat_reg_crc3;
+static int ett_ecat_reg_wd_status;
+static int ett_ecat_reg_eeprom_assign;
+static int ett_ecat_reg_ctrlstat;
+static int ett_ecat_reg_mio_ctrlstat;
+static int ett_ecat_mio_addr;
+static int ett_ecat_mio_access;
+static int ett_ecat_mio_status0;
+static int ett_ecat_mio_status1;
+static int ett_ecat_mio_status2;
+static int ett_ecat_mio_status3;
+static int ett_ecat_reg_fmmu;
+static int ett_ecat_reg_syncman;
+static int ett_ecat_reg_syncman_ctrlstatus;
+static int ett_ecat_reg_syncman_sm_enable;
+static int ett_ecat_reg_dc_cycunitctrl;
+static int ett_ecat_dc_activation;
+static int ett_ecat_dc_activationstat;
+static int ett_ecat_dc_sync0_status;
+static int ett_ecat_dc_sync1_status;
+static int ett_ecat_dc_latch0_ctrl;
+static int ett_ecat_dc_latch1_ctrl;
+static int ett_ecat_dc_latch0_status;
+static int ett_ecat_dc_latch1_status;
static int hf_ecat_sub;
-static int hf_ecat_sub_data[10] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
-static int hf_ecat_sub_cmd[10] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
-static int hf_ecat_sub_idx[10] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
-static int hf_ecat_sub_cnt[10] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
-static int hf_ecat_sub_ado[10] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
-static int hf_ecat_sub_adp[10] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
-static int hf_ecat_sub_lad[10] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
-
-/* static int hf_ecat_header = -1; */
-static int hf_ecat_data = -1;
-static int hf_ecat_cnt = -1;
-static int hf_ecat_cmd = -1;
-static int hf_ecat_idx = -1;
-static int hf_ecat_adp = -1;
-static int hf_ecat_ado = -1;
-static int hf_ecat_lad = -1;
-/* static int hf_ecat_len = -1; */
-static int hf_ecat_int = -1;
-
-static int hf_ecat_sub_dc_diff_da[10] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
-static int hf_ecat_sub_dc_diff_bd[10] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
-static int hf_ecat_sub_dc_diff_cb[10] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
-static int hf_ecat_sub_dc_diff_cd[10] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
-static int hf_ecat_sub_dc_diff_ba[10] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
-static int hf_ecat_sub_dc_diff_ca[10] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
-
-static int hf_ecat_dc_diff_da = -1;
-static int hf_ecat_dc_diff_bd = -1;
-static int hf_ecat_dc_diff_cb = -1;
-static int hf_ecat_dc_diff_cd = -1;
-static int hf_ecat_dc_diff_ba = -1;
-static int hf_ecat_dc_diff_ca = -1;
-
-static int hf_ecat_length_len = -1;
-static int hf_ecat_length_r = -1;
-static int hf_ecat_length_c = -1;
-static int hf_ecat_length_m = -1;
-
-static int hf_ecat_padding = -1;
-
-static int hf_ecat_reg_revision = -1;
-static int hf_ecat_reg_esc_type = -1;
-static int hf_ecat_reg_esc_build = -1;
-static int hf_ecat_reg_esc_fmmucnt = -1;
-static int hf_ecat_reg_esc_smcnt = -1;
-static int hf_ecat_reg_esc_ports = -1;
-static int hf_ecat_reg_esc_dpram = -1;
-static int hf_ecat_reg_esc_features = -1;
-static int hf_ecat_reg_esc_features_fmmurestrict = -1;
-static int hf_ecat_reg_esc_features_smaddrrestrict = -1;
-static int hf_ecat_reg_esc_features_dcsupport = -1;
-static int hf_ecat_reg_esc_features_dc64support = -1;
-static int hf_ecat_reg_esc_features_ebuslowjitter = -1;
-static int hf_ecat_reg_esc_features_ebusextlinkdetect = -1;
-static int hf_ecat_reg_esc_features_miiextlinkdetect = -1;
-static int hf_ecat_reg_esc_features_crcext = -1;
-static int hf_ecat_reg_physaddr = -1;
-static int hf_ecat_reg_physaddr2 = -1;
-static int hf_ecat_reg_dlctrl1 = -1;
-static int hf_ecat_reg_dlctrl1_killnonecat = -1;
-static int hf_ecat_reg_dlctrl1_port0extlinkdetect = -1;
-static int hf_ecat_reg_dlctrl1_port1extlinkdetect = -1;
-static int hf_ecat_reg_dlctrl1_port2extlinkdetect = -1;
-static int hf_ecat_reg_dlctrl1_port3extlinkdetect = -1;
-static int hf_ecat_reg_dlctrl2 = -1;
-static int hf_ecat_reg_dlctrl2_port0 = -1;
-static int hf_ecat_reg_dlctrl2_port1 = -1;
-static int hf_ecat_reg_dlctrl2_port2 = -1;
-static int hf_ecat_reg_dlctrl2_port3 = -1;
-static int hf_ecat_reg_dlctrl3 = -1;
-static int hf_ecat_reg_dlctrl3_fifosize = -1;
-static int hf_ecat_reg_dlctrl3_lowebusjit = -1;
-static int hf_ecat_reg_dlctrl4 = -1;
-static int hf_ecat_reg_dlctrl4_2ndaddress = -1;
-static int hf_ecat_reg_dlstatus1 = -1;
-static int hf_ecat_reg_dlstatus1_operation = -1;
-static int hf_ecat_reg_dlstatus1_pdiwatchdog = -1;
-static int hf_ecat_reg_dlstatus1_enhlinkdetect = -1;
-static int hf_ecat_reg_dlstatus1_physlink_port0 = -1;
-static int hf_ecat_reg_dlstatus1_physlink_port1 = -1;
-static int hf_ecat_reg_dlstatus1_physlink_port2 = -1;
-static int hf_ecat_reg_dlstatus1_physlink_port3 = -1;
-static int hf_ecat_reg_dlstatus2 = -1;
-static int hf_ecat_reg_dlstatus2_port0 = -1;
-static int hf_ecat_reg_dlstatus2_port1 = -1;
-static int hf_ecat_reg_dlstatus2_port2 = -1;
-static int hf_ecat_reg_dlstatus2_port3 = -1;
-static int hf_ecat_reg_regprotect = -1;
-static int hf_ecat_reg_accessprotect = -1;
-static int hf_ecat_reg_resetecat = -1;
-static int hf_ecat_reg_resetpdi = -1;
-static int hf_ecat_reg_regphysrwoffs = -1;
-static int hf_ecat_reg_alctrl = -1;
-static int hf_ecat_reg_alctrl_ctrl = -1;
-static int hf_ecat_reg_alctrl_errack = -1;
-static int hf_ecat_reg_alctrl_id = -1;
-static int hf_ecat_reg_alstatus = -1;
-static int hf_ecat_reg_alstatus_status = -1;
-static int hf_ecat_reg_alstatus_err = -1;
-static int hf_ecat_reg_alstatus_id = -1;
-static int hf_ecat_reg_pdictrl1 = -1;
-static int hf_ecat_reg_pdictrl1_pdi = -1;
-static int hf_ecat_reg_pdictrl2 = -1;
-static int hf_ecat_reg_pdictrl2_devemul = -1;
-static int hf_ecat_reg_pdictrl2_enhlnkdetect = -1;
-static int hf_ecat_reg_pdictrl2_dcsyncout = -1;
-static int hf_ecat_reg_pdictrl2_dcsyncin = -1;
-static int hf_ecat_reg_pdictrl2_enhlnkdetect0 = -1;
-static int hf_ecat_reg_pdictrl2_enhlnkdetect1 = -1;
-static int hf_ecat_reg_pdictrl2_enhlnkdetect2 = -1;
-static int hf_ecat_reg_pdictrl2_enhlnkdetect3 = -1;
-static int hf_ecat_reg_alstatuscode = -1;
-static int hf_ecat_reg_ecat_mask = -1;
-static int hf_ecat_reg_ecat_mask_latchevt = -1;
-static int hf_ecat_reg_ecat_mask_escstatevt = -1;
-static int hf_ecat_reg_ecat_mask_alstatevt = -1;
-static int hf_ecat_reg_ecat_mask_sm0irq = -1;
-static int hf_ecat_reg_ecat_mask_sm1irq = -1;
-static int hf_ecat_reg_ecat_mask_sm2irq = -1;
-static int hf_ecat_reg_ecat_mask_sm3irq = -1;
-static int hf_ecat_reg_ecat_mask_sm4irq = -1;
-static int hf_ecat_reg_ecat_mask_sm5irq = -1;
-static int hf_ecat_reg_ecat_mask_sm6irq = -1;
-static int hf_ecat_reg_ecat_mask_sm7irq = -1;
-static int hf_ecat_reg_pdiL = -1;
-static int hf_ecat_reg_pdiL_alctrl = -1;
-static int hf_ecat_reg_pdiL_latchin = -1;
-static int hf_ecat_reg_pdiL_sync0 = -1;
-static int hf_ecat_reg_pdiL_sync1 = -1;
-static int hf_ecat_reg_pdiL_smchg = -1;
-static int hf_ecat_reg_pdiL_eepromcmdpen = -1;
-static int hf_ecat_reg_pdiL_sm0 = -1;
-static int hf_ecat_reg_pdiL_sm1 = -1;
-static int hf_ecat_reg_pdiL_sm2 = -1;
-static int hf_ecat_reg_pdiL_sm3 = -1;
-static int hf_ecat_reg_pdiL_sm4 = -1;
-static int hf_ecat_reg_pdiL_sm5 = -1;
-static int hf_ecat_reg_pdiL_sm6 = -1;
-static int hf_ecat_reg_pdiL_sm7 = -1;
-static int hf_ecat_reg_pdiH = -1;
-static int hf_ecat_reg_ecat = -1;
-static int hf_ecat_reg_ecat_latchevt = -1;
-static int hf_ecat_reg_ecat_escstatevt = -1;
-static int hf_ecat_reg_ecat_alstatevt = -1;
-static int hf_ecat_reg_ecat_sm0irq = -1;
-static int hf_ecat_reg_ecat_sm1irq = -1;
-static int hf_ecat_reg_ecat_sm2irq = -1;
-static int hf_ecat_reg_ecat_sm3irq = -1;
-static int hf_ecat_reg_ecat_sm4irq = -1;
-static int hf_ecat_reg_ecat_sm5irq = -1;
-static int hf_ecat_reg_ecat_sm6irq = -1;
-static int hf_ecat_reg_ecat_sm7irq = -1;
-static int hf_ecat_reg_pdi1 = -1;
-static int hf_ecat_reg_pdi1_alctrl = -1;
-static int hf_ecat_reg_pdi1_latchin = -1;
-static int hf_ecat_reg_pdi1_sync0 = -1;
-static int hf_ecat_reg_pdi1_sync1 = -1;
-static int hf_ecat_reg_pdi1_smchg = -1;
-static int hf_ecat_reg_pdi1_eepromcmdpen = -1;
-static int hf_ecat_reg_pdi1_sm0 = -1;
-static int hf_ecat_reg_pdi1_sm1 = -1;
-static int hf_ecat_reg_pdi1_sm2 = -1;
-static int hf_ecat_reg_pdi1_sm3 = -1;
-static int hf_ecat_reg_pdi1_sm4 = -1;
-static int hf_ecat_reg_pdi1_sm5 = -1;
-static int hf_ecat_reg_pdi1_sm6 = -1;
-static int hf_ecat_reg_pdi1_sm7 = -1;
-static int hf_ecat_reg_pdi2 = -1;
-static int hf_ecat_reg_crc0 = -1;
-static int hf_ecat_reg_crc0_frame = -1;
-static int hf_ecat_reg_crc0_rx = -1;
-static int hf_ecat_reg_crc1 = -1;
-static int hf_ecat_reg_crc1_frame = -1;
-static int hf_ecat_reg_crc1_rx = -1;
-static int hf_ecat_reg_crc2 = -1;
-static int hf_ecat_reg_crc2_frame = -1;
-static int hf_ecat_reg_crc2_rx = -1;
-static int hf_ecat_reg_crc3 = -1;
-static int hf_ecat_reg_crc3_frame = -1;
-static int hf_ecat_reg_crc3_rx = -1;
-static int hf_ecat_reg_crc_fwd0 = -1;
-static int hf_ecat_reg_crc_fwd1 = -1;
-static int hf_ecat_reg_crc_fwd2 = -1;
-static int hf_ecat_reg_crc_fwd3 = -1;
-static int hf_ecat_reg_processuniterr = -1;
-static int hf_ecat_reg_pdierr = -1;
-static int hf_ecat_reg_linklost0 = -1;
-static int hf_ecat_reg_linklost1 = -1;
-static int hf_ecat_reg_linklost2 = -1;
-static int hf_ecat_reg_linklost3 = -1;
-static int hf_ecat_reg_wd_divisor = -1;
-static int hf_ecat_reg_wd_timepdi = -1;
-static int hf_ecat_reg_wd_timesm = -1;
-static int hf_ecat_reg_wd_status = -1;
-static int hf_ecat_reg_wd_status_pdwatchdog = -1;
-static int hf_ecat_reg_wd_cntsm = -1;
-static int hf_ecat_reg_wd_cntpdi = -1;
-static int hf_ecat_reg_eeprom_assign = -1;
-static int hf_ecat_reg_eeprom_assign_ctrl = -1;
-static int hf_ecat_reg_eeprom_assign_pdiaccess = -1;
-static int hf_ecat_reg_eeprom_assign_status = -1;
-static int hf_ecat_reg_ctrlstat = -1;
-static int hf_ecat_reg_ctrlstat_wraccess = -1;
-static int hf_ecat_reg_ctrlstat_eepromemul = -1;
-static int hf_ecat_reg_ctrlstat_8bacc = -1;
-static int hf_ecat_reg_ctrlstat_2bacc = -1;
-static int hf_ecat_reg_ctrlstat_rdacc = -1;
-static int hf_ecat_reg_ctrlstat_wracc = -1;
-static int hf_ecat_reg_ctrlstat_reloadacc = -1;
-static int hf_ecat_reg_ctrlstat_crcerr = -1;
-static int hf_ecat_reg_ctrlstat_lderr = -1;
-static int hf_ecat_reg_ctrlstat_cmderr = -1;
-static int hf_ecat_reg_ctrlstat_wrerr = -1;
-static int hf_ecat_reg_ctrlstat_busy = -1;
-static int hf_ecat_reg_addrl = -1;
-static int hf_ecat_reg_addrh = -1;
-static int hf_ecat_reg_data0 = -1;
-static int hf_ecat_reg_data1 = -1;
-static int hf_ecat_reg_data2 = -1;
-static int hf_ecat_reg_data3 = -1;
-static int hf_ecat_reg_mio_ctrlstat = -1;
-static int hf_ecat_reg_mio_ctrlstat_wracc1 = -1;
-static int hf_ecat_reg_mio_ctrlstat_offsphy = -1;
-static int hf_ecat_reg_mio_ctrlstat_rdacc = -1;
-static int hf_ecat_reg_mio_ctrlstat_wracc2 = -1;
-static int hf_ecat_reg_mio_ctrlstat_wrerr = -1;
-static int hf_ecat_reg_mio_ctrlstat_busy = -1;
-static int hf_ecat_reg_mio_addr = -1;
-static int hf_ecat_reg_mio_addr_phyaddr = -1;
-static int hf_ecat_reg_mio_addr_mioaddr = -1;
-static int hf_ecat_reg_mio_data = -1;
-static int hf_ecat_reg_mio_access = -1;
-static int hf_ecat_reg_mio_access_ecatacc = -1;
-static int hf_ecat_reg_mio_access_pdiacc = -1;
-static int hf_ecat_reg_mio_access_forcereset = -1;
-static int hf_ecat_reg_mio_status0 = -1;
-static int hf_ecat_reg_mio_status0_physlink = -1;
-static int hf_ecat_reg_mio_status0_link = -1;
-static int hf_ecat_reg_mio_status0_linkstatuserr = -1;
-static int hf_ecat_reg_mio_status0_readerr = -1;
-static int hf_ecat_reg_mio_status0_linkpartnererr = -1;
-static int hf_ecat_reg_mio_status0_phycfgupdated = -1;
-static int hf_ecat_reg_mio_status1 = -1;
-static int hf_ecat_reg_mio_status1_physlink = -1;
-static int hf_ecat_reg_mio_status1_link = -1;
-static int hf_ecat_reg_mio_status1_linkstatuserr = -1;
-static int hf_ecat_reg_mio_status1_readerr = -1;
-static int hf_ecat_reg_mio_status1_linkpartnererr = -1;
-static int hf_ecat_reg_mio_status1_phycfgupdated = -1;
-static int hf_ecat_reg_mio_status2 = -1;
-static int hf_ecat_reg_mio_status2_physlink = -1;
-static int hf_ecat_reg_mio_status2_link = -1;
-static int hf_ecat_reg_mio_status2_linkstatuserr = -1;
-static int hf_ecat_reg_mio_status2_readerr = -1;
-static int hf_ecat_reg_mio_status2_linkpartnererr = -1;
-static int hf_ecat_reg_mio_status2_phycfgupdated = -1;
-static int hf_ecat_reg_mio_status3 = -1;
-static int hf_ecat_reg_mio_status3_physlink = -1;
-static int hf_ecat_reg_mio_status3_link = -1;
-static int hf_ecat_reg_mio_status3_linkstatuserr = -1;
-static int hf_ecat_reg_mio_status3_readerr = -1;
-static int hf_ecat_reg_mio_status3_linkpartnererr = -1;
-static int hf_ecat_reg_mio_status3_phycfgupdated = -1;
-static int hf_ecat_reg_fmmu = -1;
-static int hf_ecat_reg_fmmu_lstart = -1;
-static int hf_ecat_reg_fmmu_llen = -1;
-static int hf_ecat_reg_fmmu_lstartbit = -1;
-static int hf_ecat_reg_fmmu_lendbit = -1;
-static int hf_ecat_reg_fmmu_pstart = -1;
-static int hf_ecat_reg_fmmu_pstartbit = -1;
-static int hf_ecat_reg_fmmu_type = -1;
-static int hf_ecat_reg_fmmu_typeread = -1;
-static int hf_ecat_reg_fmmu_typewrite = -1;
-static int hf_ecat_reg_fmmu_activate = -1;
-static int hf_ecat_reg_fmmu_activate0 = -1;
-static int hf_ecat_reg_syncman_ctrlstatus = -1;
-static int hf_ecat_reg_syncman_pmode = -1;
-static int hf_ecat_reg_syncman_access = -1;
-static int hf_ecat_reg_syncman_irq_ecat = -1;
-static int hf_ecat_reg_syncman_irq_pdi = -1;
-static int hf_ecat_reg_syncman_wdt = -1;
-static int hf_ecat_reg_syncman_irq_write = -1;
-static int hf_ecat_reg_syncman_irq_read = -1;
-static int hf_ecat_reg_syncman_1bufstate = -1;
-static int hf_ecat_reg_syncman_3bufstate = -1;
-static int hf_ecat_reg_syncman_sm_enable = -1;
-static int hf_ecat_reg_syncman_enable = -1;
-static int hf_ecat_reg_syncman_repeatreq = -1;
-static int hf_ecat_reg_syncman_latchsmchg_ecat = -1;
-static int hf_ecat_reg_syncman_latchsmchg_pdi = -1;
-static int hf_ecat_reg_syncman_deactivate = -1;
-static int hf_ecat_reg_syncman_repeatack = -1;
-static int hf_ecat_reg_syncman = -1;
-static int hf_ecat_reg_syncman_start = -1;
-static int hf_ecat_reg_syncman_len = -1;
-static int hf_ecat_reg_dc_recv0 = -1;
-static int hf_ecat_reg_dc_recv1 = -1;
-static int hf_ecat_reg_dc_recv2 = -1;
-static int hf_ecat_reg_dc_recv3 = -1;
-static int hf_ecat_reg_dc_systime = -1;
-static int hf_ecat_reg_dc_systimeL = -1;
-static int hf_ecat_reg_dc_systimeH = -1;
-static int hf_ecat_reg_dc_recvtime64 = -1;
-static int hf_ecat_reg_dc_systimeoffs = -1;
-static int hf_ecat_reg_dc_systimeoffsl = -1;
-static int hf_ecat_reg_dc_systimeoffsh = -1;
-static int hf_ecat_reg_dc_systimedelay = -1;
-static int hf_ecat_reg_dc_ctrlerr = -1;
-static int hf_ecat_reg_dc_speedstart = -1;
-static int hf_ecat_reg_dc_speeddiff = -1;
-static int hf_ecat_reg_dc_fltdepth_systimediff = -1;
-static int hf_ecat_reg_dc_fltdepth_speedcnt = -1;
-static int hf_ecat_reg_dc_cycunitctrl = -1;
-static int hf_ecat_reg_dc_cycunitctrl_access_cyclic = -1;
-static int hf_ecat_reg_dc_cycunitctrl_access_latch0 = -1;
-static int hf_ecat_reg_dc_cycunitctrl_access_latch1 = -1;
-static int hf_ecat_reg_dc_activation = -1;
-static int hf_ecat_reg_dc_activation_enablecyclic = -1;
-static int hf_ecat_reg_dc_activation_gen_sync0 = -1;
-static int hf_ecat_reg_dc_activation_gen_sync1 = -1;
-static int hf_ecat_reg_dc_activation_autoactivation = -1;
-static int hf_ecat_reg_dc_activation_stimeext = -1;
-static int hf_ecat_reg_dc_activation_stimecheck = -1;
-static int hf_ecat_reg_dc_activation_hlfrange = -1;
-static int hf_ecat_reg_dc_activation_dblrange = -1;
-static int hf_ecat_reg_dc_cycimpuls = -1;
-static int hf_ecat_reg_dc_activationstat = -1;
-static int hf_ecat_reg_dc_activationstat_sync0pend = -1;
-static int hf_ecat_reg_dc_activationstat_sync1pend = -1;
-static int hf_ecat_reg_dc_activationstat_stimeoutofrange = -1;
-static int hf_ecat_reg_dc_sync0_status = -1;
-static int hf_ecat_reg_dc_sync0_status_triggered = -1;
-static int hf_ecat_reg_dc_sync1_status = -1;
-static int hf_ecat_reg_dc_sync1_status_triggered = -1;
-static int hf_ecat_reg_dc_starttime0 = -1;
-static int hf_ecat_reg_dc_starttime1 = -1;
-static int hf_ecat_reg_dc_cyctime0 = -1;
-static int hf_ecat_reg_dc_cyctime1 = -1;
-static int hf_ecat_reg_dc_latch0_ctrl_pos = -1;
-static int hf_ecat_reg_dc_latch0_ctrl_neg = -1;
-static int hf_ecat_reg_dc_latch1_ctrl_pos = -1;
-static int hf_ecat_reg_dc_latch1_ctrl_neg = -1;
-static int hf_ecat_reg_dc_latch0_status_eventpos = -1;
-static int hf_ecat_reg_dc_latch0_status_eventneg = -1;
-static int hf_ecat_reg_dc_latch0_status_pinstate = -1;
-static int hf_ecat_reg_dc_latch1_status_eventpos = -1;
-static int hf_ecat_reg_dc_latch1_status_eventneg = -1;
-static int hf_ecat_reg_dc_latch1_status_pinstate = -1;
-static int hf_ecat_reg_dc_latch0_ctrl = -1;
-static int hf_ecat_reg_dc_latch1_ctrl = -1;
-static int hf_ecat_reg_dc_latch0_status = -1;
-static int hf_ecat_reg_dc_latch1_status = -1;
-static int hf_ecat_reg_dc_latch0_pos = -1;
-static int hf_ecat_reg_dc_latch0_neg = -1;
-static int hf_ecat_reg_dc_latch1_pos = -1;
-static int hf_ecat_reg_dc_latch1_neg = -1;
-static int hf_ecat_reg_dc_rcvsyncmanchg = -1;
-static int hf_ecat_reg_dc_pdismstart = -1;
-static int hf_ecat_reg_dc_pdismchg = -1;
+static int hf_ecat_sub_data[10];
+static int hf_ecat_sub_cmd[10];
+static int hf_ecat_sub_idx[10];
+static int hf_ecat_sub_cnt[10];
+static int hf_ecat_sub_ado[10];
+static int hf_ecat_sub_adp[10];
+static int hf_ecat_sub_lad[10];
+
+/* static int hf_ecat_header; */
+static int hf_ecat_data;
+static int hf_ecat_cnt;
+static int hf_ecat_cmd;
+static int hf_ecat_idx;
+static int hf_ecat_adp;
+static int hf_ecat_ado;
+static int hf_ecat_lad;
+/* static int hf_ecat_len; */
+static int hf_ecat_int;
+
+static int hf_ecat_sub_dc_diff_da[10];
+static int hf_ecat_sub_dc_diff_bd[10];
+static int hf_ecat_sub_dc_diff_cb[10];
+static int hf_ecat_sub_dc_diff_cd[10];
+static int hf_ecat_sub_dc_diff_ba[10];
+static int hf_ecat_sub_dc_diff_ca[10];
+
+static int hf_ecat_dc_diff_da;
+static int hf_ecat_dc_diff_bd;
+static int hf_ecat_dc_diff_cb;
+static int hf_ecat_dc_diff_cd;
+static int hf_ecat_dc_diff_ba;
+static int hf_ecat_dc_diff_ca;
+
+static int hf_ecat_length_len;
+static int hf_ecat_length_r;
+static int hf_ecat_length_c;
+static int hf_ecat_length_m;
+
+static int hf_ecat_padding;
+
+static int hf_ecat_reg_revision;
+static int hf_ecat_reg_esc_type;
+static int hf_ecat_reg_esc_build;
+static int hf_ecat_reg_esc_fmmucnt;
+static int hf_ecat_reg_esc_smcnt;
+static int hf_ecat_reg_esc_ports;
+static int hf_ecat_reg_esc_dpram;
+static int hf_ecat_reg_esc_features;
+static int hf_ecat_reg_esc_features_fmmurestrict;
+static int hf_ecat_reg_esc_features_smaddrrestrict;
+static int hf_ecat_reg_esc_features_dcsupport;
+static int hf_ecat_reg_esc_features_dc64support;
+static int hf_ecat_reg_esc_features_ebuslowjitter;
+static int hf_ecat_reg_esc_features_ebusextlinkdetect;
+static int hf_ecat_reg_esc_features_miiextlinkdetect;
+static int hf_ecat_reg_esc_features_crcext;
+static int hf_ecat_reg_physaddr;
+static int hf_ecat_reg_physaddr2;
+static int hf_ecat_reg_dlctrl1;
+static int hf_ecat_reg_dlctrl1_killnonecat;
+static int hf_ecat_reg_dlctrl1_port0extlinkdetect;
+static int hf_ecat_reg_dlctrl1_port1extlinkdetect;
+static int hf_ecat_reg_dlctrl1_port2extlinkdetect;
+static int hf_ecat_reg_dlctrl1_port3extlinkdetect;
+static int hf_ecat_reg_dlctrl2;
+static int hf_ecat_reg_dlctrl2_port0;
+static int hf_ecat_reg_dlctrl2_port1;
+static int hf_ecat_reg_dlctrl2_port2;
+static int hf_ecat_reg_dlctrl2_port3;
+static int hf_ecat_reg_dlctrl3;
+static int hf_ecat_reg_dlctrl3_fifosize;
+static int hf_ecat_reg_dlctrl3_lowebusjit;
+static int hf_ecat_reg_dlctrl4;
+static int hf_ecat_reg_dlctrl4_2ndaddress;
+static int hf_ecat_reg_dlstatus1;
+static int hf_ecat_reg_dlstatus1_operation;
+static int hf_ecat_reg_dlstatus1_pdiwatchdog;
+static int hf_ecat_reg_dlstatus1_enhlinkdetect;
+static int hf_ecat_reg_dlstatus1_physlink_port0;
+static int hf_ecat_reg_dlstatus1_physlink_port1;
+static int hf_ecat_reg_dlstatus1_physlink_port2;
+static int hf_ecat_reg_dlstatus1_physlink_port3;
+static int hf_ecat_reg_dlstatus2;
+static int hf_ecat_reg_dlstatus2_port0;
+static int hf_ecat_reg_dlstatus2_port1;
+static int hf_ecat_reg_dlstatus2_port2;
+static int hf_ecat_reg_dlstatus2_port3;
+static int hf_ecat_reg_regprotect;
+static int hf_ecat_reg_accessprotect;
+static int hf_ecat_reg_resetecat;
+static int hf_ecat_reg_resetpdi;
+static int hf_ecat_reg_regphysrwoffs;
+static int hf_ecat_reg_alctrl;
+static int hf_ecat_reg_alctrl_ctrl;
+static int hf_ecat_reg_alctrl_errack;
+static int hf_ecat_reg_alctrl_id;
+static int hf_ecat_reg_alstatus;
+static int hf_ecat_reg_alstatus_status;
+static int hf_ecat_reg_alstatus_err;
+static int hf_ecat_reg_alstatus_id;
+static int hf_ecat_reg_pdictrl1;
+static int hf_ecat_reg_pdictrl1_pdi;
+static int hf_ecat_reg_pdictrl2;
+static int hf_ecat_reg_pdictrl2_devemul;
+static int hf_ecat_reg_pdictrl2_enhlnkdetect;
+static int hf_ecat_reg_pdictrl2_dcsyncout;
+static int hf_ecat_reg_pdictrl2_dcsyncin;
+static int hf_ecat_reg_pdictrl2_enhlnkdetect0;
+static int hf_ecat_reg_pdictrl2_enhlnkdetect1;
+static int hf_ecat_reg_pdictrl2_enhlnkdetect2;
+static int hf_ecat_reg_pdictrl2_enhlnkdetect3;
+static int hf_ecat_reg_alstatuscode;
+static int hf_ecat_reg_ecat_mask;
+static int hf_ecat_reg_ecat_mask_latchevt;
+static int hf_ecat_reg_ecat_mask_escstatevt;
+static int hf_ecat_reg_ecat_mask_alstatevt;
+static int hf_ecat_reg_ecat_mask_sm0irq;
+static int hf_ecat_reg_ecat_mask_sm1irq;
+static int hf_ecat_reg_ecat_mask_sm2irq;
+static int hf_ecat_reg_ecat_mask_sm3irq;
+static int hf_ecat_reg_ecat_mask_sm4irq;
+static int hf_ecat_reg_ecat_mask_sm5irq;
+static int hf_ecat_reg_ecat_mask_sm6irq;
+static int hf_ecat_reg_ecat_mask_sm7irq;
+static int hf_ecat_reg_pdiL;
+static int hf_ecat_reg_pdiL_alctrl;
+static int hf_ecat_reg_pdiL_latchin;
+static int hf_ecat_reg_pdiL_sync0;
+static int hf_ecat_reg_pdiL_sync1;
+static int hf_ecat_reg_pdiL_smchg;
+static int hf_ecat_reg_pdiL_eepromcmdpen;
+static int hf_ecat_reg_pdiL_sm0;
+static int hf_ecat_reg_pdiL_sm1;
+static int hf_ecat_reg_pdiL_sm2;
+static int hf_ecat_reg_pdiL_sm3;
+static int hf_ecat_reg_pdiL_sm4;
+static int hf_ecat_reg_pdiL_sm5;
+static int hf_ecat_reg_pdiL_sm6;
+static int hf_ecat_reg_pdiL_sm7;
+static int hf_ecat_reg_pdiH;
+static int hf_ecat_reg_ecat;
+static int hf_ecat_reg_ecat_latchevt;
+static int hf_ecat_reg_ecat_escstatevt;
+static int hf_ecat_reg_ecat_alstatevt;
+static int hf_ecat_reg_ecat_sm0irq;
+static int hf_ecat_reg_ecat_sm1irq;
+static int hf_ecat_reg_ecat_sm2irq;
+static int hf_ecat_reg_ecat_sm3irq;
+static int hf_ecat_reg_ecat_sm4irq;
+static int hf_ecat_reg_ecat_sm5irq;
+static int hf_ecat_reg_ecat_sm6irq;
+static int hf_ecat_reg_ecat_sm7irq;
+static int hf_ecat_reg_pdi1;
+static int hf_ecat_reg_pdi1_alctrl;
+static int hf_ecat_reg_pdi1_latchin;
+static int hf_ecat_reg_pdi1_sync0;
+static int hf_ecat_reg_pdi1_sync1;
+static int hf_ecat_reg_pdi1_smchg;
+static int hf_ecat_reg_pdi1_eepromcmdpen;
+static int hf_ecat_reg_pdi1_sm0;
+static int hf_ecat_reg_pdi1_sm1;
+static int hf_ecat_reg_pdi1_sm2;
+static int hf_ecat_reg_pdi1_sm3;
+static int hf_ecat_reg_pdi1_sm4;
+static int hf_ecat_reg_pdi1_sm5;
+static int hf_ecat_reg_pdi1_sm6;
+static int hf_ecat_reg_pdi1_sm7;
+static int hf_ecat_reg_pdi2;
+static int hf_ecat_reg_crc0;
+static int hf_ecat_reg_crc0_frame;
+static int hf_ecat_reg_crc0_rx;
+static int hf_ecat_reg_crc1;
+static int hf_ecat_reg_crc1_frame;
+static int hf_ecat_reg_crc1_rx;
+static int hf_ecat_reg_crc2;
+static int hf_ecat_reg_crc2_frame;
+static int hf_ecat_reg_crc2_rx;
+static int hf_ecat_reg_crc3;
+static int hf_ecat_reg_crc3_frame;
+static int hf_ecat_reg_crc3_rx;
+static int hf_ecat_reg_crc_fwd0;
+static int hf_ecat_reg_crc_fwd1;
+static int hf_ecat_reg_crc_fwd2;
+static int hf_ecat_reg_crc_fwd3;
+static int hf_ecat_reg_processuniterr;
+static int hf_ecat_reg_pdierr;
+static int hf_ecat_reg_linklost0;
+static int hf_ecat_reg_linklost1;
+static int hf_ecat_reg_linklost2;
+static int hf_ecat_reg_linklost3;
+static int hf_ecat_reg_wd_divisor;
+static int hf_ecat_reg_wd_timepdi;
+static int hf_ecat_reg_wd_timesm;
+static int hf_ecat_reg_wd_status;
+static int hf_ecat_reg_wd_status_pdwatchdog;
+static int hf_ecat_reg_wd_cntsm;
+static int hf_ecat_reg_wd_cntpdi;
+static int hf_ecat_reg_eeprom_assign;
+static int hf_ecat_reg_eeprom_assign_ctrl;
+static int hf_ecat_reg_eeprom_assign_pdiaccess;
+static int hf_ecat_reg_eeprom_assign_status;
+static int hf_ecat_reg_ctrlstat;
+static int hf_ecat_reg_ctrlstat_wraccess;
+static int hf_ecat_reg_ctrlstat_eepromemul;
+static int hf_ecat_reg_ctrlstat_8bacc;
+static int hf_ecat_reg_ctrlstat_2bacc;
+static int hf_ecat_reg_ctrlstat_rdacc;
+static int hf_ecat_reg_ctrlstat_wracc;
+static int hf_ecat_reg_ctrlstat_reloadacc;
+static int hf_ecat_reg_ctrlstat_crcerr;
+static int hf_ecat_reg_ctrlstat_lderr;
+static int hf_ecat_reg_ctrlstat_cmderr;
+static int hf_ecat_reg_ctrlstat_wrerr;
+static int hf_ecat_reg_ctrlstat_busy;
+static int hf_ecat_reg_addrl;
+static int hf_ecat_reg_addrh;
+static int hf_ecat_reg_data0;
+static int hf_ecat_reg_data1;
+static int hf_ecat_reg_data2;
+static int hf_ecat_reg_data3;
+static int hf_ecat_reg_mio_ctrlstat;
+static int hf_ecat_reg_mio_ctrlstat_wracc1;
+static int hf_ecat_reg_mio_ctrlstat_offsphy;
+static int hf_ecat_reg_mio_ctrlstat_rdacc;
+static int hf_ecat_reg_mio_ctrlstat_wracc2;
+static int hf_ecat_reg_mio_ctrlstat_wrerr;
+static int hf_ecat_reg_mio_ctrlstat_busy;
+static int hf_ecat_reg_mio_addr;
+static int hf_ecat_reg_mio_addr_phyaddr;
+static int hf_ecat_reg_mio_addr_mioaddr;
+static int hf_ecat_reg_mio_data;
+static int hf_ecat_reg_mio_access;
+static int hf_ecat_reg_mio_access_ecatacc;
+static int hf_ecat_reg_mio_access_pdiacc;
+static int hf_ecat_reg_mio_access_forcereset;
+static int hf_ecat_reg_mio_status0;
+static int hf_ecat_reg_mio_status0_physlink;
+static int hf_ecat_reg_mio_status0_link;
+static int hf_ecat_reg_mio_status0_linkstatuserr;
+static int hf_ecat_reg_mio_status0_readerr;
+static int hf_ecat_reg_mio_status0_linkpartnererr;
+static int hf_ecat_reg_mio_status0_phycfgupdated;
+static int hf_ecat_reg_mio_status1;
+static int hf_ecat_reg_mio_status1_physlink;
+static int hf_ecat_reg_mio_status1_link;
+static int hf_ecat_reg_mio_status1_linkstatuserr;
+static int hf_ecat_reg_mio_status1_readerr;
+static int hf_ecat_reg_mio_status1_linkpartnererr;
+static int hf_ecat_reg_mio_status1_phycfgupdated;
+static int hf_ecat_reg_mio_status2;
+static int hf_ecat_reg_mio_status2_physlink;
+static int hf_ecat_reg_mio_status2_link;
+static int hf_ecat_reg_mio_status2_linkstatuserr;
+static int hf_ecat_reg_mio_status2_readerr;
+static int hf_ecat_reg_mio_status2_linkpartnererr;
+static int hf_ecat_reg_mio_status2_phycfgupdated;
+static int hf_ecat_reg_mio_status3;
+static int hf_ecat_reg_mio_status3_physlink;
+static int hf_ecat_reg_mio_status3_link;
+static int hf_ecat_reg_mio_status3_linkstatuserr;
+static int hf_ecat_reg_mio_status3_readerr;
+static int hf_ecat_reg_mio_status3_linkpartnererr;
+static int hf_ecat_reg_mio_status3_phycfgupdated;
+static int hf_ecat_reg_fmmu;
+static int hf_ecat_reg_fmmu_lstart;
+static int hf_ecat_reg_fmmu_llen;
+static int hf_ecat_reg_fmmu_lstartbit;
+static int hf_ecat_reg_fmmu_lendbit;
+static int hf_ecat_reg_fmmu_pstart;
+static int hf_ecat_reg_fmmu_pstartbit;
+static int hf_ecat_reg_fmmu_type;
+static int hf_ecat_reg_fmmu_typeread;
+static int hf_ecat_reg_fmmu_typewrite;
+static int hf_ecat_reg_fmmu_activate;
+static int hf_ecat_reg_fmmu_activate0;
+static int hf_ecat_reg_syncman_ctrlstatus;
+static int hf_ecat_reg_syncman_pmode;
+static int hf_ecat_reg_syncman_access;
+static int hf_ecat_reg_syncman_irq_ecat;
+static int hf_ecat_reg_syncman_irq_pdi;
+static int hf_ecat_reg_syncman_wdt;
+static int hf_ecat_reg_syncman_irq_write;
+static int hf_ecat_reg_syncman_irq_read;
+static int hf_ecat_reg_syncman_1bufstate;
+static int hf_ecat_reg_syncman_3bufstate;
+static int hf_ecat_reg_syncman_sm_enable;
+static int hf_ecat_reg_syncman_enable;
+static int hf_ecat_reg_syncman_repeatreq;
+static int hf_ecat_reg_syncman_latchsmchg_ecat;
+static int hf_ecat_reg_syncman_latchsmchg_pdi;
+static int hf_ecat_reg_syncman_deactivate;
+static int hf_ecat_reg_syncman_repeatack;
+static int hf_ecat_reg_syncman;
+static int hf_ecat_reg_syncman_start;
+static int hf_ecat_reg_syncman_len;
+static int hf_ecat_reg_dc_recv0;
+static int hf_ecat_reg_dc_recv1;
+static int hf_ecat_reg_dc_recv2;
+static int hf_ecat_reg_dc_recv3;
+static int hf_ecat_reg_dc_systime;
+static int hf_ecat_reg_dc_systimeL;
+static int hf_ecat_reg_dc_systimeH;
+static int hf_ecat_reg_dc_recvtime64;
+static int hf_ecat_reg_dc_systimeoffs;
+static int hf_ecat_reg_dc_systimeoffsl;
+static int hf_ecat_reg_dc_systimeoffsh;
+static int hf_ecat_reg_dc_systimedelay;
+static int hf_ecat_reg_dc_ctrlerr;
+static int hf_ecat_reg_dc_speedstart;
+static int hf_ecat_reg_dc_speeddiff;
+static int hf_ecat_reg_dc_fltdepth_systimediff;
+static int hf_ecat_reg_dc_fltdepth_speedcnt;
+static int hf_ecat_reg_dc_cycunitctrl;
+static int hf_ecat_reg_dc_cycunitctrl_access_cyclic;
+static int hf_ecat_reg_dc_cycunitctrl_access_latch0;
+static int hf_ecat_reg_dc_cycunitctrl_access_latch1;
+static int hf_ecat_reg_dc_activation;
+static int hf_ecat_reg_dc_activation_enablecyclic;
+static int hf_ecat_reg_dc_activation_gen_sync0;
+static int hf_ecat_reg_dc_activation_gen_sync1;
+static int hf_ecat_reg_dc_activation_autoactivation;
+static int hf_ecat_reg_dc_activation_stimeext;
+static int hf_ecat_reg_dc_activation_stimecheck;
+static int hf_ecat_reg_dc_activation_hlfrange;
+static int hf_ecat_reg_dc_activation_dblrange;
+static int hf_ecat_reg_dc_cycimpuls;
+static int hf_ecat_reg_dc_activationstat;
+static int hf_ecat_reg_dc_activationstat_sync0pend;
+static int hf_ecat_reg_dc_activationstat_sync1pend;
+static int hf_ecat_reg_dc_activationstat_stimeoutofrange;
+static int hf_ecat_reg_dc_sync0_status;
+static int hf_ecat_reg_dc_sync0_status_triggered;
+static int hf_ecat_reg_dc_sync1_status;
+static int hf_ecat_reg_dc_sync1_status_triggered;
+static int hf_ecat_reg_dc_starttime0;
+static int hf_ecat_reg_dc_starttime1;
+static int hf_ecat_reg_dc_cyctime0;
+static int hf_ecat_reg_dc_cyctime1;
+static int hf_ecat_reg_dc_latch0_ctrl_pos;
+static int hf_ecat_reg_dc_latch0_ctrl_neg;
+static int hf_ecat_reg_dc_latch1_ctrl_pos;
+static int hf_ecat_reg_dc_latch1_ctrl_neg;
+static int hf_ecat_reg_dc_latch0_status_eventpos;
+static int hf_ecat_reg_dc_latch0_status_eventneg;
+static int hf_ecat_reg_dc_latch0_status_pinstate;
+static int hf_ecat_reg_dc_latch1_status_eventpos;
+static int hf_ecat_reg_dc_latch1_status_eventneg;
+static int hf_ecat_reg_dc_latch1_status_pinstate;
+static int hf_ecat_reg_dc_latch0_ctrl;
+static int hf_ecat_reg_dc_latch1_ctrl;
+static int hf_ecat_reg_dc_latch0_status;
+static int hf_ecat_reg_dc_latch1_status;
+static int hf_ecat_reg_dc_latch0_pos;
+static int hf_ecat_reg_dc_latch0_neg;
+static int hf_ecat_reg_dc_latch1_pos;
+static int hf_ecat_reg_dc_latch1_neg;
+static int hf_ecat_reg_dc_rcvsyncmanchg;
+static int hf_ecat_reg_dc_pdismstart;
+static int hf_ecat_reg_dc_pdismchg;
static const value_string EcCmdShort[] =
@@ -1072,12 +1072,12 @@ typedef int register_dissect_func(packet_info *pinfo, proto_tree *tree, tvbuff_t
/* esc registers */
typedef struct
{
- guint16 reg;
- guint16 length;
- guint16 repeat;
+ uint16_t reg;
+ uint16_t length;
+ uint16_t repeat;
int* phf;
int* const *bitmask_info;
- gint* pett;
+ int* pett;
register_dissect_func *dissect;
} ecat_esc_reg_info;
@@ -1198,13 +1198,13 @@ static ecat_esc_reg_info ecat_esc_registers [] =
};
/* esc dissector */
-static int dissect_esc_register(packet_info* pinfo, proto_tree *tree, tvbuff_t *tvb, gint offset, guint32 len, EcParserHDR* hdr, guint16 cnt)
+static int dissect_esc_register(packet_info* pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, uint32_t len, EcParserHDR* hdr, uint16_t cnt)
{
- guint i;
- gint r;
- gint res = -1;
- gint regOffset;
- gint read = 0;
+ unsigned i;
+ int r;
+ int res = -1;
+ int regOffset;
+ int read = 0;
if (len > 0 )
{
@@ -1231,7 +1231,7 @@ static int dissect_esc_register(packet_info* pinfo, proto_tree *tree, tvbuff_t *
regOffset = ecat_esc_registers[i].reg;
for ( r=0; r<ecat_esc_registers[i].repeat; r++ )
{
- if ( regOffset >= hdr->anAddrUnion.a.ado && regOffset+ecat_esc_registers[i].length <= (guint16)(hdr->anAddrUnion.a.ado + len) )
+ if ( regOffset >= hdr->anAddrUnion.a.ado && regOffset+ecat_esc_registers[i].length <= (uint16_t)(hdr->anAddrUnion.a.ado + len) )
{
if ( cnt > 0 || !read )
{
@@ -1260,17 +1260,17 @@ static int dissect_esc_register(packet_info* pinfo, proto_tree *tree, tvbuff_t *
return res;
}
-static void init_EcParserHDR(EcParserHDR* pHdr, tvbuff_t *tvb, gint offset)
+static void init_EcParserHDR(EcParserHDR* pHdr, tvbuff_t *tvb, int offset)
{
- pHdr->cmd = tvb_get_guint8(tvb, offset++);
- pHdr->idx = tvb_get_guint8(tvb, offset++);
+ pHdr->cmd = tvb_get_uint8(tvb, offset++);
+ pHdr->idx = tvb_get_uint8(tvb, offset++);
pHdr->anAddrUnion.a.adp = tvb_get_letohs(tvb, offset); offset+=2;
pHdr->anAddrUnion.a.ado = tvb_get_letohs(tvb, offset); offset+=2;
pHdr->len = tvb_get_letohs(tvb, offset); offset+=2;
pHdr->intr = tvb_get_letohs(tvb, offset);
}
-static void init_dc_measure(guint32* pDC, tvbuff_t *tvb, gint offset)
+static void init_dc_measure(uint32_t* pDC, tvbuff_t *tvb, int offset)
{
int i;
for ( i=0; i<4; i++ )
@@ -1280,27 +1280,27 @@ static void init_dc_measure(guint32* pDC, tvbuff_t *tvb, gint offset)
}
}
-static guint16 get_wc(EcParserHDR* pHdr, tvbuff_t *tvb, gint offset)
+static uint16_t get_wc(EcParserHDR* pHdr, tvbuff_t *tvb, int offset)
{
return tvb_get_letohs(tvb, offset+EcParserHDR_Len+(pHdr->len&0x07ff));
}
-static guint16 get_cmd_len(EcParserHDR* pHdr)
+static uint16_t get_cmd_len(EcParserHDR* pHdr)
{
return (EcParserHDR_Len+(pHdr->len&0x07ff)+2); /*Header + data + wc*/
}
-static void EcSummaryFormater(guint32 datalength, tvbuff_t *tvb, gint offset, char *szText, gint nMax)
+static void EcSummaryFormater(uint32_t datalength, tvbuff_t *tvb, int offset, char *szText, int nMax)
{
- guint nSub=0;
- guint nLen=0;
- guint8 nCmds[4];
- guint nLens[4];
+ unsigned nSub=0;
+ unsigned nLen=0;
+ uint8_t nCmds[4];
+ unsigned nLens[4];
EcParserHDR ecFirst;
EcParserHDR ecParser;
- guint suboffset=0;
+ unsigned suboffset=0;
init_EcParserHDR(&ecFirst, tvb, offset);
@@ -1331,8 +1331,8 @@ static void EcSummaryFormater(guint32 datalength, tvbuff_t *tvb, gint offset, ch
}
if ( nSub == 1 )
{
- guint16 len = ecFirst.len&0x07ff;
- guint16 cnt = get_wc(&ecFirst, tvb, offset);
+ uint16_t len = ecFirst.len&0x07ff;
+ uint16_t cnt = get_wc(&ecFirst, tvb, offset);
snprintf ( szText, nMax, "'%s': Len: %d, Adp 0x%x, Ado 0x%x, Wc %d ",
convertEcCmdToText(ecFirst.cmd, EcCmdShort), len, ecFirst.anAddrUnion.a.adp, ecFirst.anAddrUnion.a.ado, cnt );
}
@@ -1356,10 +1356,10 @@ static void EcSummaryFormater(guint32 datalength, tvbuff_t *tvb, gint offset, ch
nSub, nLen, convertEcCmdToText(ecFirst.cmd, EcCmdShort));
}
-static void EcCmdFormatter(guint8 cmd, char *szText, gint nMax)
+static void EcCmdFormatter(uint8_t cmd, char *szText, int nMax)
{
- gint idx=0;
- const gchar *szCmd = try_val_to_str_idx((guint32)cmd, EcCmdLong, &idx);
+ int idx=0;
+ const char *szCmd = try_val_to_str_idx((uint32_t)cmd, EcCmdLong, &idx);
if ( idx != -1 )
snprintf(szText, nMax, "Cmd : %d (%s)", cmd, szCmd);
@@ -1368,10 +1368,10 @@ static void EcCmdFormatter(guint8 cmd, char *szText, gint nMax)
}
-static void EcSubFormatter(tvbuff_t *tvb, gint offset, char *szText, gint nMax)
+static void EcSubFormatter(tvbuff_t *tvb, int offset, char *szText, int nMax)
{
EcParserHDR ecParser;
- guint16 len, cnt;
+ uint16_t len, cnt;
init_EcParserHDR(&ecParser, tvb, offset);
len = ecParser.len&0x07ff;
@@ -1414,14 +1414,14 @@ static int dissect_ecat_datagram(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
tvbuff_t *next_tvb;
proto_item *ti, *aitem = NULL;
proto_tree *ecat_datagrams_tree = NULL;
- guint offset = 0;
+ unsigned offset = 0;
char szText[200];
int nMax = sizeof(szText)-1;
- guint ecLength=0;
- guint subCount = 0;
- const guint datagram_length = tvb_captured_length(tvb);
- guint datagram_padding_bytes = 0;
+ unsigned ecLength=0;
+ unsigned subCount = 0;
+ const unsigned datagram_length = tvb_captured_length(tvb);
+ unsigned datagram_padding_bytes = 0;
EcParserHDR ecHdr;
heur_dtbl_entry_t *hdtbl_entry;
@@ -1473,10 +1473,10 @@ static int dissect_ecat_datagram(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
proto_tree *ecat_datagram_tree = NULL, *ecat_header_tree = NULL, *ecat_dc_tree = NULL;
proto_item *hidden_item;
- guint32 subsize;
- guint32 suboffset;
- guint32 len;
- guint16 cnt;
+ uint32_t subsize;
+ uint32_t suboffset;
+ uint32_t len;
+ uint16_t cnt;
ETHERCAT_MBOX_HEADER mbox;
suboffset = offset;
@@ -1568,7 +1568,7 @@ static int dissect_ecat_datagram(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
if ( (ecHdr.cmd == 1 || ecHdr.cmd == 4) && ecHdr.anAddrUnion.a.ado == 0x900 && ecHdr.len >= 16 && cnt > 0 )
{
- guint32 pDC[4];
+ uint32_t pDC[4];
init_dc_measure(pDC, tvb, suboffset);
ecat_dc_tree = proto_tree_add_subtree(ecat_datagram_tree, tvb, suboffset, len, ett_ecat_dc, NULL, "Dc");
@@ -1631,8 +1631,8 @@ static int dissect_ecat_datagram(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
}
else if (dissect_esc_register(pinfo, ecat_datagram_tree, tvb, suboffset, len, &ecHdr, cnt) != 0)
{
- guint startOfData = offset + EcParserHDR_Len;
- guint dataLength = len;
+ unsigned startOfData = offset + EcParserHDR_Len;
+ unsigned 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_APRW || ecHdr.cmd == EC_CMD_TYPE_FPRW) || ((ecHdr.cmd==EC_CMD_TYPE_FPRD || ecHdr.cmd==EC_CMD_TYPE_APRD) && cnt==1) ) &&
@@ -1649,7 +1649,7 @@ static int dissect_ecat_datagram(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
case ETHERCAT_MBOX_TYPE_SOE:
if ( mbox.Length <= 1500 )
{
- guint MBoxLength = mbox.Length + ETHERCAT_MBOX_HEADER_LEN;
+ unsigned MBoxLength = mbox.Length + ETHERCAT_MBOX_HEADER_LEN;
if ( MBoxLength > len )
MBoxLength = len;
@@ -3511,7 +3511,7 @@ void proto_register_ecat(void)
FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x10, NULL, HFILL }
},
{ &hf_ecat_reg_dc_activation_stimecheck,
- {"Start time chheck", "ecat.reg.dc.activation.stimecheck",
+ {"Start time check", "ecat.reg.dc.activation.stimecheck",
FT_BOOLEAN, 8, TFS(&tfs_local_true_false), 0x20, NULL, HFILL }
},
{ &hf_ecat_reg_dc_activation_hlfrange,
@@ -3660,7 +3660,7 @@ void proto_register_ecat(void)
},
};
- static gint *ett[] =
+ static int *ett[] =
{
&ett_ecat,
&ett_ecat_header,
@@ -3718,7 +3718,7 @@ void proto_register_ecat(void)
ecat_handle = register_dissector("ecat", dissect_ecat_datagram, proto_ecat_datagram);
/* Sub dissector code */
- heur_subdissector_list = register_heur_dissector_list("ecat.data", proto_ecat_datagram);
+ heur_subdissector_list = register_heur_dissector_list_with_description("ecat.data", "EtherCAT payload", proto_ecat_datagram);
}
/* The registration hand-off routing */
diff --git a/plugins/epan/ethercat/packet-ethercat-datagram.h b/plugins/epan/ethercat/packet-ethercat-datagram.h
index b1565cfe..cd0b545a 100644
--- a/plugins/epan/ethercat/packet-ethercat-datagram.h
+++ b/plugins/epan/ethercat/packet-ethercat-datagram.h
@@ -16,19 +16,19 @@ typedef union
{
struct
{
- guint16 adp;
- guint16 ado;
+ uint16_t adp;
+ uint16_t ado;
} a;
- guint32 addr;
+ uint32_t addr;
} EcParserAddrUnion;
typedef struct _EcParser
{
- guint8 cmd;
- guint8 idx;
+ uint8_t cmd;
+ uint8_t idx;
EcParserAddrUnion anAddrUnion;
- guint16 len;
- guint16 intr;
+ uint16_t len;
+ uint16_t intr;
} EcParserHDR, *PEcParserHDR;
#define EcParserHDR_Len 10/*sizeof(EcParserHDR)*/
diff --git a/plugins/epan/ethercat/packet-ethercat-frame.c b/plugins/epan/ethercat/packet-ethercat-frame.c
index 3de05942..687ca8bd 100644
--- a/plugins/epan/ethercat/packet-ethercat-frame.c
+++ b/plugins/epan/ethercat/packet-ethercat-frame.c
@@ -23,17 +23,17 @@ void proto_register_ethercat_frame(void);
void proto_reg_handoff_ethercat_frame(void);
/* Define the Ethercat frame proto */
-static int proto_ethercat_frame = -1;
+static int proto_ethercat_frame;
static dissector_table_t ethercat_frame_dissector_table;
static dissector_handle_t ethercat_frame_handle;
/* Define the tree for the EtherCAT frame */
-static int ett_ethercat_frame = -1;
-static int hf_ethercat_frame_length = -1;
-static int hf_ethercat_frame_reserved = -1;
-static int hf_ethercat_frame_type = -1;
+static int ett_ethercat_frame;
+static int hf_ethercat_frame_length;
+static int hf_ethercat_frame_reserved;
+static int hf_ethercat_frame_type;
static const value_string EthercatFrameTypes[] =
{
@@ -58,7 +58,7 @@ static int dissect_ethercat_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree
tvbuff_t *next_tvb;
proto_item *ti;
proto_tree *ethercat_frame_tree;
- gint offset = 0;
+ int offset = 0;
EtherCATFrameParserHDR hdr;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "ECATF");
@@ -115,7 +115,7 @@ void proto_register_ethercat_frame(void)
}
};
- static gint *ett[] =
+ static int *ett[] =
{
&ett_ethercat_frame
};
diff --git a/plugins/epan/ethercat/packet-ethercat-frame.h b/plugins/epan/ethercat/packet-ethercat-frame.h
index 2bb8c19b..d47587e4 100644
--- a/plugins/epan/ethercat/packet-ethercat-frame.h
+++ b/plugins/epan/ethercat/packet-ethercat-frame.h
@@ -19,11 +19,11 @@ typedef union _EtherCATFrameParser
{
struct
{
- guint16 length : 11;
- guint16 reserved : 1;
- guint16 protocol : 4;
+ uint16_t length : 11;
+ uint16_t reserved : 1;
+ uint16_t protocol : 4;
} v;
- guint16 hdr;
+ uint16_t hdr;
} EtherCATFrameParserHDR;
DIAG_ON_PEDANTIC
typedef EtherCATFrameParserHDR *PEtherCATFrameParserHDR;
diff --git a/plugins/epan/ethercat/packet-ioraw.c b/plugins/epan/ethercat/packet-ioraw.c
index 846ae01c..a6554cfd 100644
--- a/plugins/epan/ethercat/packet-ioraw.c
+++ b/plugins/epan/ethercat/packet-ioraw.c
@@ -22,15 +22,15 @@ void proto_register_ioraw(void);
void proto_reg_handoff_ioraw(void);
/* Define the ioraw proto */
-int proto_ioraw = -1;
+int proto_ioraw;
-static int ett_ioraw = -1;
+static int ett_ioraw;
static dissector_handle_t ioraw_handle;
-/* static int hf_ioraw_summary = -1; */
-static int hf_ioraw_header = -1;
-static int hf_ioraw_data = -1;
+/* static int hf_ioraw_summary; */
+static int hf_ioraw_header;
+static int hf_ioraw_data;
/*ioraw*/
static void IoRawSummaryFormater( char *szText, int nMax)
@@ -42,11 +42,11 @@ static int dissect_ioraw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo
{
proto_item *ti;
proto_tree *ioraw_tree;
- gint offset = 0;
+ int offset = 0;
char szText[200];
int nMax = sizeof(szText)-1;
- guint ioraw_length = tvb_reported_length(tvb);
+ unsigned ioraw_length = tvb_reported_length(tvb);
col_set_str(pinfo->cinfo, COL_PROTOCOL, "IO-RAW");
@@ -88,7 +88,7 @@ void proto_register_ioraw(void)
}
};
- static gint *ett[] =
+ static int *ett[] =
{
&ett_ioraw
};
diff --git a/plugins/epan/ethercat/packet-ioraw.h b/plugins/epan/ethercat/packet-ioraw.h
index 48f942ef..f1e11c5b 100644
--- a/plugins/epan/ethercat/packet-ioraw.h
+++ b/plugins/epan/ethercat/packet-ioraw.h
@@ -14,7 +14,7 @@
/* headers are only used for size and offset calculation*/
typedef struct _IoRawParser
{
- guint32 head;
+ uint32_t head;
} IoRawParserHDR, *PIoRawParserHDR;
#define IoRawParserHDR_Len (int)sizeof(IoRawParserHDR)
diff --git a/plugins/epan/ethercat/packet-nv.c b/plugins/epan/ethercat/packet-nv.c
index b9f5c0ce..3113ffb9 100644
--- a/plugins/epan/ethercat/packet-nv.c
+++ b/plugins/epan/ethercat/packet-nv.c
@@ -22,57 +22,57 @@ void proto_register_nv(void);
void proto_reg_handoff_nv(void);
/* Define the nv proto */
-int proto_nv = -1;
+int proto_nv;
static dissector_handle_t nv_handle;
-static int ett_nv = -1;
-static int ett_nv_header = -1;
-static int ett_nv_var = -1;
-static int ett_nv_varheader = -1;
-
-/* static int hf_nv_summary = -1; */
-static int hf_nv_header = -1;
-static int hf_nv_publisher = -1;
-static int hf_nv_count = -1;
-static int hf_nv_cycleindex = -1;
-static int hf_nv_variable = -1;
-static int hf_nv_varheader = -1;
-static int hf_nv_id = -1;
-static int hf_nv_hash = -1;
-static int hf_nv_length = -1;
-static int hf_nv_quality = -1;
-static int hf_nv_data = -1;
+static int ett_nv;
+static int ett_nv_header;
+static int ett_nv_var;
+static int ett_nv_varheader;
+
+/* static int hf_nv_summary; */
+static int hf_nv_header;
+static int hf_nv_publisher;
+static int hf_nv_count;
+static int hf_nv_cycleindex;
+static int hf_nv_variable;
+static int hf_nv_varheader;
+static int hf_nv_id;
+static int hf_nv_hash;
+static int hf_nv_length;
+static int hf_nv_quality;
+static int hf_nv_data;
/*nv*/
-static void NvSummaryFormater(tvbuff_t *tvb, gint offset, char *szText, int nMax)
+static void NvSummaryFormater(tvbuff_t *tvb, int offset, char *szText, int nMax)
{
- guint32 nvOffset = offset;
+ uint32_t nvOffset = offset;
snprintf ( szText, nMax, "Network Vars from %d.%d.%d.%d.%d.%d - %d Var(s)",
- tvb_get_guint8(tvb, nvOffset),
- tvb_get_guint8(tvb, nvOffset+1),
- tvb_get_guint8(tvb, nvOffset+2),
- tvb_get_guint8(tvb, nvOffset+3),
- tvb_get_guint8(tvb, nvOffset+4),
- tvb_get_guint8(tvb, nvOffset+5),
+ tvb_get_uint8(tvb, nvOffset),
+ tvb_get_uint8(tvb, nvOffset+1),
+ tvb_get_uint8(tvb, nvOffset+2),
+ tvb_get_uint8(tvb, nvOffset+3),
+ tvb_get_uint8(tvb, nvOffset+4),
+ tvb_get_uint8(tvb, nvOffset+5),
tvb_get_letohs(tvb, nvOffset+6));
}
-static void NvPublisherFormater(tvbuff_t *tvb, gint offset, char *szText, int nMax)
+static void NvPublisherFormater(tvbuff_t *tvb, int offset, char *szText, int nMax)
{
- guint32 nvOffset = offset;
+ uint32_t nvOffset = offset;
snprintf ( szText, nMax, "Publisher %d.%d.%d.%d.%d.%d",
- tvb_get_guint8(tvb, nvOffset),
- tvb_get_guint8(tvb, nvOffset+1),
- tvb_get_guint8(tvb, nvOffset+2),
- tvb_get_guint8(tvb, nvOffset+3),
- tvb_get_guint8(tvb, nvOffset+4),
- tvb_get_guint8(tvb, nvOffset+5));
+ tvb_get_uint8(tvb, nvOffset),
+ tvb_get_uint8(tvb, nvOffset+1),
+ tvb_get_uint8(tvb, nvOffset+2),
+ tvb_get_uint8(tvb, nvOffset+3),
+ tvb_get_uint8(tvb, nvOffset+4),
+ tvb_get_uint8(tvb, nvOffset+5));
}
-static void NvVarHeaderFormater(tvbuff_t *tvb, gint offset, char *szText, int nMax)
+static void NvVarHeaderFormater(tvbuff_t *tvb, int offset, char *szText, int nMax)
{
snprintf ( szText, nMax, "Variable - Id = %d, Length = %d",
tvb_get_letohs(tvb, offset),
@@ -83,11 +83,11 @@ static int dissect_nv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
{
proto_item *ti;
proto_tree *nv_tree, *nv_header_tree, *nv_var_tree,*nv_varheader_tree;
- gint offset = 0;
+ int offset = 0;
char szText[200];
int nMax = (int)sizeof(szText)-1;
- gint i;
+ int i;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "TC-NV");
@@ -98,7 +98,7 @@ static int dissect_nv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
if (tree)
{
- guint16 nv_count;
+ uint16_t nv_count;
ti = proto_tree_add_item(tree, proto_nv, tvb, 0, -1, ENC_NA);
nv_tree = proto_item_add_subtree(ti, ett_nv);
@@ -108,21 +108,21 @@ static int dissect_nv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
nv_header_tree = proto_item_add_subtree(ti, ett_nv_header);
- ti= proto_tree_add_item(nv_header_tree, hf_nv_publisher, tvb, offset, (int)sizeof(guint8)*6, ENC_NA);
+ ti= proto_tree_add_item(nv_header_tree, hf_nv_publisher, tvb, offset, (int)sizeof(uint8_t)*6, ENC_NA);
NvPublisherFormater(tvb, offset, szText, nMax);
proto_item_set_text(ti, "%s", szText);
- offset+=((int)sizeof(guint8)*6);
+ offset+=((int)sizeof(uint8_t)*6);
- proto_tree_add_item(nv_header_tree, hf_nv_count, tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(nv_header_tree, hf_nv_count, tvb, offset, (int)sizeof(uint16_t), ENC_LITTLE_ENDIAN);
nv_count = tvb_get_letohs(tvb, offset);
- offset+=(int)sizeof(guint16);
+ offset+=(int)sizeof(uint16_t);
- proto_tree_add_item(nv_header_tree, hf_nv_cycleindex, tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(nv_header_tree, hf_nv_cycleindex, tvb, offset, (int)sizeof(uint16_t), ENC_LITTLE_ENDIAN);
offset = NvParserHDR_Len;
for ( i=0; i < nv_count; i++ )
{
- guint16 var_length = tvb_get_letohs(tvb, offset+4);
+ uint16_t var_length = tvb_get_letohs(tvb, offset+4);
ti = proto_tree_add_item(nv_tree, hf_nv_variable, tvb, offset, ETYPE_88A4_NV_DATA_HEADER_Len+var_length, ENC_NA);
NvVarHeaderFormater(tvb, offset, szText, nMax);
@@ -132,17 +132,17 @@ static int dissect_nv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
ti = proto_tree_add_item(nv_var_tree, hf_nv_varheader, tvb, offset, ETYPE_88A4_NV_DATA_HEADER_Len, ENC_NA);
nv_varheader_tree = proto_item_add_subtree(ti, ett_nv_varheader);
- proto_tree_add_item(nv_varheader_tree, hf_nv_id, tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
- offset+=(int)sizeof(guint16);
+ proto_tree_add_item(nv_varheader_tree, hf_nv_id, tvb, offset, (int)sizeof(uint16_t), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(uint16_t);
- proto_tree_add_item(nv_varheader_tree, hf_nv_hash, tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
- offset+=(int)sizeof(guint16);
+ proto_tree_add_item(nv_varheader_tree, hf_nv_hash, tvb, offset, (int)sizeof(uint16_t), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(uint16_t);
- proto_tree_add_item(nv_varheader_tree, hf_nv_length, tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
- offset+=(int)sizeof(guint16);
+ proto_tree_add_item(nv_varheader_tree, hf_nv_length, tvb, offset, (int)sizeof(uint16_t), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(uint16_t);
- proto_tree_add_item(nv_varheader_tree, hf_nv_quality, tvb, offset, (int)sizeof(guint16), ENC_LITTLE_ENDIAN);
- offset+=(int)sizeof(guint16);
+ proto_tree_add_item(nv_varheader_tree, hf_nv_quality, tvb, offset, (int)sizeof(uint16_t), ENC_LITTLE_ENDIAN);
+ offset+=(int)sizeof(uint16_t);
proto_tree_add_item(nv_var_tree, hf_nv_data, tvb, offset, var_length, ENC_NA);
offset+=var_length;
@@ -207,7 +207,7 @@ void proto_register_nv(void)
},
};
- static gint *ett[] =
+ static int *ett[] =
{
&ett_nv,
&ett_nv_header,
diff --git a/plugins/epan/ethercat/packet-nv.h b/plugins/epan/ethercat/packet-nv.h
index 14eaee03..0ca7ea8e 100644
--- a/plugins/epan/ethercat/packet-nv.h
+++ b/plugins/epan/ethercat/packet-nv.h
@@ -15,19 +15,19 @@
/* Ensure the same data layout for all platforms*/
typedef struct _ETYPE_88A4_NV_DATA_HEADER
{
- guint16 Id;
- guint16 Hash;
- guint16 Length;
- guint16 Quality;
+ uint16_t Id;
+ uint16_t Hash;
+ uint16_t Length;
+ uint16_t Quality;
} ETYPE_88A4_NV_DATA_HEADER;
#define ETYPE_88A4_NV_DATA_HEADER_Len (int)sizeof(ETYPE_88A4_NV_DATA_HEADER)
typedef struct _NvParserHDR
{
- guint8 Publisher[6];
- guint16 CountNV;
- guint16 CycleIndex;
- guint16 Reserved;
+ uint8_t Publisher[6];
+ uint16_t CountNV;
+ uint16_t CycleIndex;
+ uint16_t Reserved;
} NvParserHDR;
#define NvParserHDR_Len (int)sizeof(NvParserHDR)