Profinet: ARProperties that contains Combined Object Container Bit
authorBirol Capa <birol.capa@siemens.com>
Tue, 24 Nov 2015 14:13:15 +0000 (16:13 +0200)
committerAnders Broman <a.broman58@gmail.com>
Wed, 25 Nov 2015 05:40:40 +0000 (05:40 +0000)
New ARProperties has a bit that contains if usage of Combined Object Container is required or not.

Change-Id: Ia4420cdf161d79933fcc0d8ffb411c02bfe26f3b
Reviewed-on: https://code.wireshark.org/review/12098
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
plugins/profinet/packet-dcerpc-pn-io.c

index bf795e40033aba7bd5e69912d80527e977339588..6a50757457fe30cf21010ef144d6c1ba7fbd5220 100644 (file)
@@ -92,6 +92,8 @@ static int hf_pn_io_ar_properties_device_access = -1;
 static int hf_pn_io_ar_properties_companion_ar = -1;
 static int hf_pn_io_ar_properties_achnowledge_companion_ar = -1;
 static int hf_pn_io_ar_properties_reserved = -1;
+static int hf_pn_io_ar_properties_combined_object_container_with_legacy_startupmode = -1;
+static int hf_pn_io_ar_properties_combined_object_container_with_advanced_startupmode = -1;
 static int hf_pn_io_ar_properties_pull_module_alarm_allowed = -1;
 
 static int hf_pn_RedundancyInfo = -1;
@@ -1562,6 +1564,20 @@ static const value_string pn_io_arproperties_acknowldege_companion_ar[] = {
     { 0, NULL }
 };
 
+/* bit 29 for legacy startup mode*/
+static const value_string pn_io_arproperties_combined_object_container_with_legacy_startupmode[] = {
+    { 0x00000000, "CombinedObjectContainer not used" },
+    { 0x00000001, "Reserved" },
+    { 0, NULL }
+};
+
+/* bit 29 for advanced statup mode*/
+static const value_string pn_io_arproperties_combined_object_container_with_advanced_startupmode[] = {
+    { 0x00000000, "CombinedObjectContainer not used" },
+    { 0x00000001, "Usage of CombinedObjectContainer required" },
+    { 0, NULL }
+};
+
 /* bit 30 */
 static const value_string pn_io_arpropertiesStartupMode[] = {
     { 0x00000000, "Legacy" },
@@ -6367,7 +6383,7 @@ dissect_ARProperties(tvbuff_t *tvb, int offset,
     proto_item *sub_item;
     proto_tree *sub_tree;
     guint32     u32ARProperties;
-
+    guint8      startupMode;
 
     sub_item = proto_tree_add_item(tree, hf_pn_io_ar_properties, tvb, offset, 4, ENC_BIG_ENDIAN);
     sub_tree = proto_item_add_subtree(sub_item, ett_pn_io_ar_properties);
@@ -6375,6 +6391,19 @@ dissect_ARProperties(tvbuff_t *tvb, int offset,
                         hf_pn_io_ar_properties_pull_module_alarm_allowed, &u32ARProperties);
     dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
                         hf_pn_io_arproperties_StartupMode, &u32ARProperties);
+    startupMode = (guint8)((u32ARProperties >> 30) & 0x01);
+    /* Advanced startup mode */
+    if (startupMode)
+    {
+        dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
+            hf_pn_io_ar_properties_combined_object_container_with_advanced_startupmode, &u32ARProperties);
+    }
+    /* Legacy startup mode */
+    else
+    {
+        dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
+            hf_pn_io_ar_properties_combined_object_container_with_legacy_startupmode, &u32ARProperties);
+    }
     dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
                         hf_pn_io_ar_properties_reserved, &u32ARProperties);
     dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep,
@@ -9876,16 +9905,26 @@ proto_register_pn_io (void)
         FT_UINT32, BASE_HEX, VALS(pn_io_arproperties_acknowldege_companion_ar), 0x00000800,
         NULL, HFILL }
     },
+    { &hf_pn_io_ar_properties_reserved,
+      { "Reserved", "pn_io.ar_properties.reserved",
+        FT_UINT32, BASE_HEX, NULL, 0x1FFFF000,
+        NULL, HFILL }
+    },
+    { &hf_pn_io_ar_properties_combined_object_container_with_legacy_startupmode,
+      { "CombinedObjectContainer", "pn_io.ar_properties.combined_object_container",
+        FT_UINT32, BASE_HEX, VALS(pn_io_arproperties_combined_object_container_with_legacy_startupmode), 0x20000000,
+        NULL, HFILL }
+    },
+    { &hf_pn_io_ar_properties_combined_object_container_with_advanced_startupmode,
+    { "CombinedObjectContainer", "pn_io.ar_properties.combined_object_container",
+       FT_UINT32, BASE_HEX, VALS(pn_io_arproperties_combined_object_container_with_advanced_startupmode), 0x20000000,
+       NULL, HFILL }
+    },
     { &hf_pn_io_arproperties_StartupMode,
       { "StartupMode", "pn_io.ar_properties.StartupMode",
         FT_UINT32, BASE_HEX, VALS(pn_io_arpropertiesStartupMode), 0x40000000,
         NULL, HFILL }
     },
-    { &hf_pn_io_ar_properties_reserved,
-      { "Reserved", "pn_io.ar_properties.reserved",
-        FT_UINT32, BASE_HEX, NULL, 0x3FFFF000,
-        NULL, HFILL }
-    },
     { &hf_pn_io_ar_properties_pull_module_alarm_allowed,
       { "PullModuleAlarmAllowed", "pn_io.ar_properties.pull_module_alarm_allowed",
         FT_UINT32, BASE_HEX, VALS(pn_io_arproperties_pull_module_alarm_allowed), 0x80000000,