diff options
author | Birol Capa <birol.capa@siemens.com> | 2015-06-09 13:28:19 +0300 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2015-06-15 12:33:26 +0000 |
commit | 75ddc454f17123e6c22053b6f148c21e57fd3610 (patch) | |
tree | f0e87f0061b3e3bcd1894f485a59a88490bf868d /plugins | |
parent | 1131398db35484f1f32a18bd3e76788bd9de0080 (diff) | |
download | wireshark-75ddc454f17123e6c22053b6f148c21e57fd3610.tar.gz wireshark-75ddc454f17123e6c22053b6f148c21e57fd3610.tar.bz2 wireshark-75ddc454f17123e6c22053b6f148c21e57fd3610.zip |
Profinet: Combined Object Container is added.
An IO device may define so called “combined objects”.
A particular combined object is a group of related submodules, e.g. an interface and its ports.
The Combined Object Container holds the parametrization for all submodules.
Change-Id: Ifb6c63d2c3a1d3cf2cf100a8f54cf0eafa84fe6c
Reviewed-on: https://code.wireshark.org/review/8853
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/profinet/packet-dcerpc-pn-io.c | 51 | ||||
-rw-r--r-- | plugins/profinet/packet-pn.c | 2 |
2 files changed, 50 insertions, 3 deletions
diff --git a/plugins/profinet/packet-dcerpc-pn-io.c b/plugins/profinet/packet-dcerpc-pn-io.c index 665982b048..db36c0ae40 100644 --- a/plugins/profinet/packet-dcerpc-pn-io.c +++ b/plugins/profinet/packet-dcerpc-pn-io.c @@ -825,6 +825,7 @@ static const value_string pn_io_block_type[] = { { 0x0250, "PDInterfaceAdjust"}, { 0x0251, "PDPortStatistic"}, { 0x0400, "MultipleBlockHeader"}, + { 0x0401, "COContainerContent"}, { 0x0500, "RecordDataReadQuery"}, { 0x0600, "FSHello"}, { 0x0601, "FSParameterBlock"}, @@ -1810,7 +1811,8 @@ static const value_string pn_io_index[] = { { 0x8080, "PDInterfaceDataReal" }, /*0x8081 - 0x808F reserved */ { 0x8090, "Expected PDInterfaceFSUDataAdjust" }, - /*0x8091 - 0xAFEF reserved */ + /*0x8091 - 0xAFEF reserved except 0x80B0*/ + { 0x80B0, "CombinedObjectContainer" }, { 0xAFF0, "I&M0" }, { 0xAFF1, "I&M1" }, { 0xAFF2, "I&M2" }, @@ -8094,6 +8096,48 @@ dissect_MultipleBlockHeader_block(tvbuff_t *tvb, int offset, return offset; } +/* dissect Combined Object Container Content block */ +static int +dissect_COContainerContent_block(tvbuff_t *tvb, int offset, + packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow, + guint16 u16Index, guint32 *u32RecDataLen, pnio_ar_t **ar) +{ + guint32 u32Api; + guint16 u16SlotNr; + guint16 u16SubslotNr; + + 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); + + offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep, + hf_pn_io_api, &u32Api); + + offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep, + hf_pn_io_slot_nr, &u16SlotNr); + + offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep, + hf_pn_io_subslot_nr, &u16SubslotNr); + + offset = dissect_pn_padding(tvb, offset, pinfo, tree, 2); + + offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep, + hf_pn_io_index, &u16Index); + + proto_item_append_text(item, ": Api:0x%x Slot:%u Subslot:0x%x Index:0x%x", + u32Api, u16SlotNr, u16SubslotNr, u16Index); + + if(u16Index != 0x80B0) { + offset = dissect_block(tvb, offset, pinfo, tree, drep, &u16Index, u32RecDataLen, ar); + } + + return offset; +} + static const gchar * indexReservedForProfiles(guint16 u16Index) @@ -8473,6 +8517,9 @@ dissect_block(tvbuff_t *tvb, int offset, case(0x0400): dissect_MultipleBlockHeader_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow, u16BodyLength); break; + case(0x0401): + dissect_COContainerContent_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow, *u16Index, u32RecDataLen, ar); + break; case(0x0500): dissect_RecordDataReadQuery_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow, *u16Index, u16BodyLength); break; @@ -9168,7 +9215,7 @@ dissect_RecordDataWrite(tvbuff_t *tvb, int offset, case(0x8070): /* PDNCDataCheck for one subslot */ case(0x8071): /* PDInterfaceAdjust */ case(0x8090): /* PDInterfaceFSUDataAdjust */ - + case(0x80B0): /* CombinedObjectContainer*/ case(0xe030): /* IsochronousModeData for one AR */ case(0xe050): /* FastStartUp data for one AR */ offset = dissect_block(tvb, offset, pinfo, tree, drep, &u16Index, &u32RecDataLen, &ar); diff --git a/plugins/profinet/packet-pn.c b/plugins/profinet/packet-pn.c index f5de71a37a..ba4c90d072 100644 --- a/plugins/profinet/packet-pn.c +++ b/plugins/profinet/packet-pn.c @@ -245,7 +245,7 @@ int dissect_pn_user_data(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, guint32 length, const char *text) { - if (tree) { + if (tree && length != 0) { proto_tree_add_string_format(tree, hf_pn_user_data, tvb, offset, length, "data", "%s: %d bytes", text, length); } |