aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/profinet
diff options
context:
space:
mode:
authorBirol Capa <birol.capa@siemens.com>2015-06-08 09:19:52 +0300
committerMichael Mann <mmann78@netscape.net>2015-06-08 13:01:24 +0000
commit09e3505701559298c2b43b9f2439a80d0c39323f (patch)
treeab4719e9fa017f9c3e4e2f4c21e65c02af12c0d4 /plugins/profinet
parent951ddf736e976b162920387eba0f77b9732829cf (diff)
Profinet: OEM Device ID is added
The Device ID of the OEM part may additionally be offered using OEM Device ID Change-Id: Ic51cc4c05a41a8d18f265fb1abab739d1e82e28a Reviewed-on: https://code.wireshark.org/review/8832 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: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'plugins/profinet')
-rw-r--r--plugins/profinet/packet-pn-dcp.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/plugins/profinet/packet-pn-dcp.c b/plugins/profinet/packet-pn-dcp.c
index e96c77d547..570d72018c 100644
--- a/plugins/profinet/packet-pn-dcp.c
+++ b/plugins/profinet/packet-pn-dcp.c
@@ -72,6 +72,8 @@ static int hf_pn_dcp_suboption_device_role = -1;
static int hf_pn_dcp_suboption_device_aliasname = -1;
static int hf_pn_dcp_suboption_device_instance_high = -1;
static int hf_pn_dcp_suboption_device_instance_low = -1;
+static int hf_pn_dcp_suboption_device_oem_ven_id = -1;
+static int hf_pn_dcp_suboption_device_oem_dev_id = -1;
static int hf_pn_dcp_suboption_dhcp = -1;
static int hf_pn_dcp_suboption_dhcp_device_id = -1;
@@ -237,6 +239,7 @@ static const value_string pn_dcp_suboption_ip_block_info[] = {
#define PNDCP_SUBOPTION_DEVICE_DEV_OPTIONS 0x05
#define PNDCP_SUBOPTION_DEVICE_ALIAS_NAME 0x06
#define PNDCP_SUBOPTION_DEVICE_DEV_INSTANCE 0x07
+#define PNDCP_SUBOPTION_DEVICE_OEM_DEV_ID 0x08
static const value_string pn_dcp_suboption_device[] = {
{ 0x00, "Reserved" },
@@ -247,7 +250,8 @@ static const value_string pn_dcp_suboption_device[] = {
{ PNDCP_SUBOPTION_DEVICE_DEV_OPTIONS, "Device Options" },
{ PNDCP_SUBOPTION_DEVICE_ALIAS_NAME, "Alias Name" },
{ PNDCP_SUBOPTION_DEVICE_DEV_INSTANCE, "Device Instance" },
- /*0x08 - 0xff reserved */
+ { PNDCP_SUBOPTION_DEVICE_OEM_DEV_ID, "OEM Device ID"},
+ /*0x09 - 0xff reserved */
{ 0, NULL }
};
@@ -477,6 +481,8 @@ dissect_PNDCP_Suboption_Device(tvbuff_t *tvb, int offset, packet_info *pinfo,
gboolean have_block_qualifier = FALSE;
guint8 device_instance_high;
guint8 device_instance_low;
+ guint16 oem_vendor_id;
+ guint16 oem_device_id;
/* SuboptionDevice... */
@@ -624,6 +630,21 @@ dissect_PNDCP_Suboption_Device(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_item_append_text(block_item, ", InstanceHigh: %d, Instance Low: %d",
device_instance_high, device_instance_low);
break;
+ case PNDCP_SUBOPTION_DEVICE_OEM_DEV_ID:
+ offset = dissect_pn_uint16(tvb, offset, pinfo, tree, hf_pn_dcp_suboption_device_oem_ven_id, &oem_vendor_id);
+ offset = dissect_pn_uint16(tvb, offset, pinfo, tree, hf_pn_dcp_suboption_device_oem_dev_id, &oem_device_id);
+ pn_append_info(pinfo, dcp_item, ", OEM-Dev-ID");
+ proto_item_append_text(block_item, "Device/OEM Device ID");
+ if(have_block_qualifier) {
+ proto_item_append_text(block_item, ", BlockQualifier: %s",
+ val_to_str(block_qualifier, pn_dcp_block_qualifier, "Unknown"));
+ }
+ if(have_block_info) {
+ proto_item_append_text(block_item, ", BlockInfo: %s",
+ val_to_str(block_info, pn_dcp_block_info, "Unknown"));
+ }
+ proto_item_append_text(block_item, ", OEMVendorID: 0x%04x / OEMDeviceID: 0x%04x", oem_vendor_id, oem_device_id);
+ break;
default:
offset = dissect_pn_undecoded(tvb, offset, pinfo, tree, block_length);
}
@@ -1195,6 +1216,16 @@ proto_register_pn_dcp (void)
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }},
+ { &hf_pn_dcp_suboption_device_oem_ven_id,
+ { "OEMVendorID", "pn_dcp.suboption_device_oem_ven_id",
+ FT_UINT16, BASE_HEX, NULL, 0x0,
+ NULL, HFILL }},
+
+ { &hf_pn_dcp_suboption_device_oem_dev_id,
+ { "OEMDeviceID", "pn_dcp.suboption_device_oem_dev_id",
+ FT_UINT16, BASE_HEX, NULL, 0x0,
+ NULL, HFILL }},
+
{ &hf_pn_dcp_suboption_dhcp,
{ "Suboption", "pn_dcp.suboption_dhcp",
FT_UINT8, BASE_DEC, VALS(pn_dcp_suboption_dhcp), 0x0,