aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/profinet
diff options
context:
space:
mode:
authorBirol Capa <birol.capa@siemens.com>2015-06-16 22:01:02 +0300
committerAnders Broman <a.broman58@gmail.com>2015-06-17 06:29:40 +0000
commit271d8e84c89537bd5d5ac16d32924dec8d093b49 (patch)
treeefed057e79d360e9734e0b1c334a944c0f0b16fe /plugins/profinet
parent053f792d307a61ec86746ee871396e1798c88372 (diff)
Profinet: I&M5 Data is added.
This optional attribute allows identifying separately orderable OEM parts used to built the device. It consists of the following attributes: Number Of Entries, IM Annotation, Vendor ID, IM Order ID, Serial Number, Hardware Revision, Software Revision Change-Id: I793f6ecd798f93e7f40e8e1a42e42a7070a4a1c1 Reviewed-on: https://code.wireshark.org/review/8955 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'plugins/profinet')
-rw-r--r--plugins/profinet/packet-dcerpc-pn-io.c110
1 files changed, 109 insertions, 1 deletions
diff --git a/plugins/profinet/packet-dcerpc-pn-io.c b/plugins/profinet/packet-dcerpc-pn-io.c
index db36c0ae40..c4579c9709 100644
--- a/plugins/profinet/packet-dcerpc-pn-io.c
+++ b/plugins/profinet/packet-dcerpc-pn-io.c
@@ -508,6 +508,9 @@ static int hf_pn_io_im_profile_specific_type = -1;
static int hf_pn_io_im_version_major = -1;
static int hf_pn_io_im_version_minor = -1;
static int hf_pn_io_im_supported = -1;
+static int hf_pn_io_im_numberofentries = -1;
+static int hf_pn_io_im_annotation = -1;
+static int hf_pn_io_im_order_id = -1;
static int hf_pn_io_number_of_ars = -1;
@@ -735,6 +738,7 @@ static const value_string pn_io_block_type[] = {
{ 0x0030, "I&M0FilterDataSubmodul"},
{ 0x0031, "I&M0FilterDataModul"},
{ 0x0032, "I&M0FilterDataDevice"},
+ { 0x0033, "I&M5Data"},
{ 0x8001, "Alarm Ack High"},
{ 0x8002, "Alarm Ack Low"},
{ 0x0101, "ARBlockReq"},
@@ -3458,6 +3462,26 @@ dissect_IandM4_block(tvbuff_t *tvb, int offset,
return offset;
}
+static int
+dissect_IandM5_block(tvbuff_t *tvb, int offset,
+ packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint8 *drep _U_, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
+{
+ guint16 u16NumberofEntries;
+
+ if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
+ expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
+ "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
+ return offset;
+ }
+
+ offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep, hf_pn_io_im_numberofentries, &u16NumberofEntries);
+
+ while(u16NumberofEntries > 0) {
+ offset = dissect_a_block(tvb, offset, pinfo, tree, drep);
+ u16NumberofEntries--;
+ }
+ return offset;
+}
static int
dissect_IandM0FilterData_block(tvbuff_t *tvb, int offset,
@@ -3538,6 +3562,70 @@ dissect_IandM0FilterData_block(tvbuff_t *tvb, int offset,
}
+static int
+dissect_IandM5Data_block(tvbuff_t *tvb, int offset,
+ packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint8 *drep)
+{
+ char *pIMAnnotation;
+ char *pIMOrderID;
+ guint8 u8VendorIDHigh;
+ guint8 u8VendorIDLow;
+ char *pIMSerialNumber;
+ guint16 u16IMHardwareRevision;
+ guint8 u8SWRevisionPrefix;
+ guint8 u8IMSWRevisionFunctionalEnhancement;
+ guint8 u8IMSWRevisionBugFix;
+ guint8 u8IMSWRevisionInternalChange;
+
+ /* c8[64] IM Annotation */
+ pIMAnnotation = (char *)wmem_alloc(wmem_packet_scope(), 64+1);
+ tvb_memcpy(tvb, (guint8 *) pIMAnnotation, offset, 64);
+ pIMAnnotation[64] = '\0';
+ proto_tree_add_string(tree, hf_pn_io_im_annotation, tvb, offset, 64, pIMAnnotation);
+ offset += 64;
+
+ /* c8[64] IM Order ID */
+ pIMOrderID = (char *)wmem_alloc(wmem_packet_scope(), 64+1);
+ tvb_memcpy(tvb, (guint8 *) pIMOrderID, offset, 64);
+ pIMOrderID[64] = '\0';
+ proto_tree_add_string(tree, hf_pn_io_im_order_id, tvb, offset, 64, pIMOrderID);
+ offset += 64;
+
+ /* x8 VendorIDHigh */
+ offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
+ hf_pn_io_vendor_id_high, &u8VendorIDHigh);
+ /* x8 VendorIDLow */
+ offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
+ hf_pn_io_vendor_id_low, &u8VendorIDLow);
+
+ /* c8[16] IM Serial Number */
+ pIMSerialNumber = (char *)wmem_alloc(wmem_packet_scope(), 16+1);
+ tvb_memcpy(tvb, (guint8 *) pIMSerialNumber, offset, 16);
+ pIMSerialNumber[16] = '\0';
+ proto_tree_add_string(tree, hf_pn_io_im_serial_number, tvb, offset, 16, pIMSerialNumber);
+ offset += 16;
+
+ /* x16 IM_Hardware_Revision */
+ offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
+ hf_pn_io_im_hardware_revision, &u16IMHardwareRevision);
+ /* c8 SWRevisionPrefix */
+ offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
+ hf_pn_io_im_revision_prefix, &u8SWRevisionPrefix);
+ /* x8 IM_SWRevision_Functional_Enhancement */
+ offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
+ hf_pn_io_im_sw_revision_functional_enhancement, &u8IMSWRevisionFunctionalEnhancement);
+ /* x8 IM_SWRevision_Bug_Fix */
+ offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
+ hf_pn_io_im_revision_bugfix, &u8IMSWRevisionBugFix);
+
+ /* x8 IM_SWRevision_Internal_Change */
+ offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep,
+ hf_pn_io_im_sw_revision_internal_change, &u8IMSWRevisionInternalChange);
+
+ return offset;
+}
+
+
/* dissect the IdentificationData block */
static int
dissect_IdentificationData_block(tvbuff_t *tvb, int offset,
@@ -8312,6 +8400,9 @@ dissect_block(tvbuff_t *tvb, int offset,
case(0x0024):
dissect_IandM4_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
break;
+ case(0x0025):
+ dissect_IandM5_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh,u8BlockVersionLow);
+ break;
case(0x0030):
dissect_IandM0FilterData_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
break;
@@ -8321,6 +8412,9 @@ dissect_block(tvbuff_t *tvb, int offset,
case(0x0032):
dissect_IandM0FilterData_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
break;
+ case(0x0033):
+ dissect_IandM5Data_block(tvb, offset, pinfo, sub_tree, sub_item, drep);
+ break;
case(0x0101):
dissect_ARBlockReq_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow,
ar);
@@ -11598,7 +11692,21 @@ proto_register_pn_io (void)
FT_UINT16, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
-
+ { &hf_pn_io_im_numberofentries,
+ { "NumberOfEntries", "pn_io.im_numberofentries",
+ FT_UINT16, BASE_HEX, NULL, 0x0,
+ NULL, HFILL }
+ },
+ { &hf_pn_io_im_annotation,
+ { "IM Annotation", "pn_io.im_annotation",
+ FT_STRING, BASE_NONE, NULL, 0x0,
+ NULL, HFILL }
+ },
+ { &hf_pn_io_im_order_id,
+ { "IM Order ID", "pn_io.im_order_id",
+ FT_STRING, BASE_NONE, NULL, 0x0,
+ NULL, HFILL }
+ },
{ &hf_pn_io_number_of_ars,
{ "NumberOfARs", "pn_io.number_of_ars",
FT_UINT16, BASE_DEC, NULL, 0x0,