aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorBill Meier <wmeier@newsguy.com>2007-06-06 21:04:22 +0000
committerBill Meier <wmeier@newsguy.com>2007-06-06 21:04:22 +0000
commit6e5dc8ea479cf60e229eaf7b0ec279731a1a79ac (patch)
treeab4550e9d3b98ee3add1017752ccb025f4fc9b75 /epan
parent475916db3c9a110549f18e27b80e395aec3042fe (diff)
Fwom David Buechi: Powerlink dissector enhancement:
The attached patch adds a small enhancement for the ETHERNET Powerlink dissector (some well-known CANopen device profiles are decoded in human readable plaintext in the IdentResponse frame). svn path=/trunk/; revision=22061
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-epl.c17
-rw-r--r--epan/dissectors/packet-epl.h24
2 files changed, 37 insertions, 4 deletions
diff --git a/epan/dissectors/packet-epl.c b/epan/dissectors/packet-epl.c
index d718fdac8c..f90b7496a9 100644
--- a/epan/dissectors/packet-epl.c
+++ b/epan/dissectors/packet-epl.c
@@ -119,6 +119,7 @@ static gint hf_epl_asnd_identresponse_pis = -1;
static gint hf_epl_asnd_identresponse_pos = -1;
static gint hf_epl_asnd_identresponse_rst = -1;
static gint hf_epl_asnd_identresponse_dt = -1;
+static gint hf_epl_asnd_identresponse_profile = -1;
static gint hf_epl_asnd_identresponse_vid = -1;
static gint hf_epl_asnd_identresponse_productcode = -1;
static gint hf_epl_asnd_identresponse_rno = -1;
@@ -784,6 +785,7 @@ gint
dissect_epl_asnd_ires(proto_tree *epl_tree, tvbuff_t *tvb, packet_info *pinfo, guint8 epl_src, gint offset)
{
guint8 eplversion;
+ guint16 profile,additional;
guint32 epl_asnd_identresponse_ipa, epl_asnd_identresponse_snm, epl_asnd_identresponse_gtw;
guint32 epl_asnd_ires_feat, device_type;
proto_item *ti_feat;
@@ -848,7 +850,13 @@ dissect_epl_asnd_ires(proto_tree *epl_tree, tvbuff_t *tvb, packet_info *pinfo, g
proto_tree_add_item(epl_tree, hf_epl_asnd_identresponse_rst, tvb, offset, 4, TRUE);
offset += 6;
- proto_tree_add_uint(epl_tree, hf_epl_asnd_identresponse_dt, tvb, offset, 4, device_type);
+ profile = tvb_get_letohs(tvb, offset);
+ additional = tvb_get_letohs(tvb, offset+2);
+ proto_tree_add_string_format(epl_tree, hf_epl_asnd_identresponse_dt, tvb, offset,
+ 4, "", "Device Type: Profil %d (%s), Additional Information: 0x%4.4X",
+ profile, val_to_str(profile, epl_device_profiles, "Unkown Profile"), additional);
+
+ proto_tree_add_item(epl_tree, hf_epl_asnd_identresponse_profile, tvb, offset, 2, TRUE);
offset += 4;
proto_tree_add_item(epl_tree, hf_epl_asnd_identresponse_vid, tvb, offset, 4, TRUE);
@@ -899,7 +907,7 @@ dissect_epl_asnd_ires(proto_tree *epl_tree, tvbuff_t *tvb, packet_info *pinfo, g
if (check_col(pinfo->cinfo, COL_INFO))
{
- col_append_fstr(pinfo->cinfo, COL_INFO, "DevType = 0x%08X", device_type);
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str(profile, epl_device_profiles, "Device Profile %d"));
}
return offset;
@@ -1392,7 +1400,8 @@ static hf_register_info hf[] = {
{ &hf_epl_asnd_identresponse_pis, { "PollInSize", "epl.asnd.ires.pollinsize", FT_UINT16, BASE_DEC, NULL, 0x00, "", HFILL }},
{ &hf_epl_asnd_identresponse_pos, { "PollOutSize", "epl.asnd.ires.polloutsizes", FT_UINT16, BASE_DEC, NULL, 0x00, "", HFILL }},
{ &hf_epl_asnd_identresponse_rst, { "ResponseTime", "epl.asnd.ires.resptime", FT_UINT32, BASE_DEC, NULL, 0x00, "", HFILL }},
-{ &hf_epl_asnd_identresponse_dt, { "DeviceType", "epl.asnd.ires.devicetype", FT_UINT32, BASE_DEC_HEX, NULL, 0x00, "", HFILL }},
+{ &hf_epl_asnd_identresponse_dt, { "DeviceType", "epl.asnd.ires.devicetype", FT_STRING, BASE_DEC, NULL, 0x00, "", HFILL }},
+{ &hf_epl_asnd_identresponse_profile, { "Profile", "epl.asnd.ires.profile", FT_UINT16, BASE_DEC, NULL, 0x00, "", HFILL }},
{ &hf_epl_asnd_identresponse_vid, { "VendorId", "epl.asnd.ires.vendorid", FT_UINT32, BASE_DEC_HEX, NULL, 0x00, "", HFILL }},
{ &hf_epl_asnd_identresponse_productcode,{ "ProductCode", "epl.asnd.ires.productcode", FT_UINT32, BASE_DEC_HEX, NULL, 0x00, "", HFILL }},
{ &hf_epl_asnd_identresponse_rno, { "RevisionNumber", "epl.asnd.ires.revisionno", FT_UINT32, BASE_DEC_HEX, NULL, 0x00, "", HFILL }},
@@ -1503,7 +1512,7 @@ static hf_register_info hf[] = {
prefs_register_bool_preference(epl_module, "show_soc_flags", "Show flags of SoC frame in Info column",
"If you are capturing in networks with multiplexed or slow nodes, this can be useful", &show_soc_flags);
-
+
/* tap-registration */
/* epl_tap = register_tap("epl");*/
}
diff --git a/epan/dissectors/packet-epl.h b/epan/dissectors/packet-epl.h
index dd48ce2fb9..f9e7dce5a0 100644
--- a/epan/dissectors/packet-epl.h
+++ b/epan/dissectors/packet-epl.h
@@ -304,6 +304,30 @@ static const value_string epl_nmt_ms_vals[] = {
{0,NULL}
};
+
+
+// EPL Device Profiles according to CANopen
+#define EPL_PROFILE_NO 0
+#define EPL_PROFILE_GENERIC_IO 401
+#define EPL_PROFILE_DRIVE 402
+#define EPL_PROFILE_HMI 403
+#define EPL_PROFILE_MEASURING 404
+#define EPL_PROFILE_PLC 405
+#define EPL_PROFILE_ENCODER 406
+
+
+static const value_string epl_device_profiles[] = {
+ {EPL_PROFILE_NO, "No Standard Device"},
+ {EPL_PROFILE_GENERIC_IO, "Generic I/O module"},
+ {EPL_PROFILE_DRIVE, "Drive and motion control"},
+ {EPL_PROFILE_HMI, "Human Machine Interface"},
+ {EPL_PROFILE_MEASURING, "Measuring device"},
+ {EPL_PROFILE_PLC, "IEC 61131-3 PLC"},
+ {EPL_PROFILE_ENCODER, "Encoder"},
+ {0,NULL}
+};
+
+
/* SDO SequenceLayer */
#define EPL_ASND_SDO_SEQ_RECEIVE_SEQUENCE_NUMBER_OFFSET 4
#define EPL_ASND_SDO_SEQ_RECEIVE_CON_OFFSET 4