From 539418c91732b71985117a01e1db42436baa83cc Mon Sep 17 00:00:00 2001 From: Birol Capa Date: Thu, 4 Jun 2015 07:35:35 +0300 Subject: Profinet: Add Fiber Optic Diagnosis Info. This make reading fiber optic diagnosis data possible. Change-Id: I90b49443ffa1b69912d37cbf7a751328eec9d590 Reviewed-on: https://code.wireshark.org/review/8750 Reviewed-by: Graham Bloice Petri-Dish: Graham Bloice Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann --- plugins/profinet/packet-dcerpc-pn-io.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'plugins/profinet') diff --git a/plugins/profinet/packet-dcerpc-pn-io.c b/plugins/profinet/packet-dcerpc-pn-io.c index 44fef1b21b..665982b048 100644 --- a/plugins/profinet/packet-dcerpc-pn-io.c +++ b/plugins/profinet/packet-dcerpc-pn-io.c @@ -814,6 +814,7 @@ static const value_string pn_io_block_type[] = { { 0x0225, "Adjust DCPBoundary"}, { 0x0226, "Adjust PreambleLength"}, { 0x0227, "Adjust FastForwardingBoundary"}, + { 0x0228, "Reading real fiber optic diagnosis data"}, { 0x022A, "PDIRSubframeData"}, { 0x022B, "SubframeBlock"}, { 0x0230, "PDNCDataCheck"}, @@ -5304,6 +5305,30 @@ dissect_FiberOpticManufacturerSpecific_block(tvbuff_t *tvb, int offset, } +/* dissect the FiberOpticDiagnosisInfo block */ +static int +dissect_FiberOpticDiagnosisInfo_block(tvbuff_t *tvb, int offset, + packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow) +{ + guint32 u32FiberOpticPowerBudget; + + + 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_pn_padding(tvb, offset, pinfo, tree, 2); + + /* decode the u32FiberOpticPowerBudget better */ + offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep, + hf_pn_io_maintenance_required_power_budget, &u32FiberOpticPowerBudget); + + return offset; +} + + /* dissect the PDPortFODataAdjust block */ static int dissect_PDPortFODataAdjust_block(tvbuff_t *tvb, int offset, @@ -8413,6 +8438,9 @@ dissect_block(tvbuff_t *tvb, int offset, case(0x0226): dissect_AdjustPreambleLength_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow); break; + case(0x0228): + dissect_FiberOpticDiagnosisInfo_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow); + break; case(0x022A): dissect_PDIRSubframeData_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow); break; -- cgit v1.2.3