aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/opcua/opcua_complextypeparser.c4
-rw-r--r--plugins/opcua/opcua_enumparser.c22
-rw-r--r--plugins/opcua/opcua_enumparser.h3
-rw-r--r--plugins/opcua/opcua_hfindeces.c4
-rw-r--r--plugins/opcua/opcua_hfindeces.h2
-rw-r--r--plugins/opcua/opcua_simpletypes.c122
-rw-r--r--plugins/opcua/opcua_simpletypes.h9
7 files changed, 133 insertions, 33 deletions
diff --git a/plugins/opcua/opcua_complextypeparser.c b/plugins/opcua/opcua_complextypeparser.c
index 7609088..2c90fa6 100644
--- a/plugins/opcua/opcua_complextypeparser.c
+++ b/plugins/opcua/opcua_complextypeparser.c
@@ -942,8 +942,8 @@ void parseBrowseDescription(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo,
parseBrowseDirection(subtree, tvb, pinfo, pOffset);
parseNodeId(subtree, tvb, pinfo, pOffset, "ReferenceTypeId");
parseBoolean(subtree, tvb, pinfo, pOffset, hf_opcua_IncludeSubtypes);
- parseUInt32(subtree, tvb, pinfo, pOffset, hf_opcua_NodeClassMask);
- parseUInt32(subtree, tvb, pinfo, pOffset, hf_opcua_ResultMask);
+ parseNodeClassMask(subtree, tvb, pinfo, pOffset);
+ parseResultMask(subtree, tvb, pinfo, pOffset);
proto_item_set_end(ti, tvb, *pOffset);
}
void parseReferenceDescription(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint *pOffset, const char *szFieldName)
diff --git a/plugins/opcua/opcua_enumparser.c b/plugins/opcua/opcua_enumparser.c
index f2467ec..2cd7054 100644
--- a/plugins/opcua/opcua_enumparser.c
+++ b/plugins/opcua/opcua_enumparser.c
@@ -289,26 +289,7 @@ void parseBrowseDirection(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U
{
proto_tree_add_item(tree, hf_opcua_BrowseDirection, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN); *pOffset+=4;
}
-/** BrowseResultMask enum table */
-static const value_string g_BrowseResultMaskTable[] = {
- { 0, "None" },
- { 1, "ReferenceTypeId" },
- { 2, "IsForward" },
- { 4, "NodeClass" },
- { 8, "BrowseName" },
- { 16, "DisplayName" },
- { 32, "TypeDefinition" },
- { 63, "All" },
- { 3, "ReferenceTypeInfo" },
- { 60, "TargetInfo" },
- { 0, NULL }
-};
-static int hf_opcua_BrowseResultMask = -1;
-void parseBrowseResultMask(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint *pOffset)
-{
- proto_tree_add_item(tree, hf_opcua_BrowseResultMask, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN); *pOffset+=4;
-}
/** ComplianceLevel enum table */
static const value_string g_ComplianceLevelTable[] = {
{ 0, "Untested" },
@@ -633,9 +614,6 @@ void registerEnumTypes(int proto)
{ &hf_opcua_BrowseDirection,
{ "BrowseDirection", "opcua.BrowseDirection", FT_UINT32, BASE_HEX, VALS(g_BrowseDirectionTable), 0x0, NULL, HFILL }
},
- { &hf_opcua_BrowseResultMask,
- { "BrowseResultMask", "opcua.BrowseResultMask", FT_UINT32, BASE_HEX, VALS(g_BrowseResultMaskTable), 0x0, NULL, HFILL }
- },
{ &hf_opcua_ComplianceLevel,
{ "ComplianceLevel", "opcua.ComplianceLevel", FT_UINT32, BASE_HEX, VALS(g_ComplianceLevelTable), 0x0, NULL, HFILL }
},
diff --git a/plugins/opcua/opcua_enumparser.h b/plugins/opcua/opcua_enumparser.h
index 56360a8..001e718 100644
--- a/plugins/opcua/opcua_enumparser.h
+++ b/plugins/opcua/opcua_enumparser.h
@@ -66,7 +66,8 @@ void parseSecurityTokenRequestType(proto_tree *tree, tvbuff_t *tvb, packet_info
void parseNodeAttributesMask(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint *pOffset);
void parseAttributeWriteMask(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint *pOffset);
void parseBrowseDirection(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint *pOffset);
-void parseBrowseResultMask(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint *pOffset);
+void parseNodeClassMask(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint *pOffset);
+void parseResultMask(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint *pOffset);
void parseComplianceLevel(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint *pOffset);
void parseFilterOperator(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint *pOffset);
void parseTimestampsToReturn(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint *pOffset);
diff --git a/plugins/opcua/opcua_hfindeces.c b/plugins/opcua/opcua_hfindeces.c
index 07d1fb0..dd84925 100644
--- a/plugins/opcua/opcua_hfindeces.c
+++ b/plugins/opcua/opcua_hfindeces.c
@@ -176,7 +176,6 @@ int hf_opcua_MoreNotifications = -1;
int hf_opcua_Name = -1;
int hf_opcua_NamespaceUri = -1;
int hf_opcua_NextSequenceNumber = -1;
-int hf_opcua_NodeClassMask = -1;
int hf_opcua_NotificationsCount = -1;
int hf_opcua_NumValuesPerNode = -1;
int hf_opcua_Offset = -1;
@@ -219,7 +218,6 @@ int hf_opcua_RequestedMaxKeepAliveCount = -1;
int hf_opcua_RequestedMaxReferencesPerNode = -1;
int hf_opcua_RequestedPublishingInterval = -1;
int hf_opcua_RequestedSessionTimeout = -1;
-int hf_opcua_ResultMask = -1;
int hf_opcua_Results = -1;
int hf_opcua_RetransmitSequenceNumber = -1;
int hf_opcua_ReturnBounds = -1;
@@ -481,7 +479,6 @@ void registerFieldTypes(int proto)
{ &hf_opcua_Name, { "Name", "opcua.Name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
{ &hf_opcua_NamespaceUri, { "NamespaceUri", "opcua.NamespaceUri", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
{ &hf_opcua_NextSequenceNumber, { "NextSequenceNumber", "opcua.NextSequenceNumber", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
- { &hf_opcua_NodeClassMask, { "NodeClassMask", "opcua.NodeClassMask", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
{ &hf_opcua_NotificationsCount, { "NotificationsCount", "opcua.NotificationsCount", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
{ &hf_opcua_NumValuesPerNode, { "NumValuesPerNode", "opcua.NumValuesPerNode", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
{ &hf_opcua_Offset, { "Offset", "opcua.Offset", FT_INT16, BASE_DEC, NULL, 0x0, NULL, HFILL } },
@@ -524,7 +521,6 @@ void registerFieldTypes(int proto)
{ &hf_opcua_RequestedMaxReferencesPerNode, { "RequestedMaxReferencesPerNode", "opcua.RequestedMaxReferencesPerNode", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
{ &hf_opcua_RequestedPublishingInterval, { "RequestedPublishingInterval", "opcua.RequestedPublishingInterval", FT_DOUBLE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
{ &hf_opcua_RequestedSessionTimeout, { "RequestedSessionTimeout", "opcua.RequestedSessionTimeout", FT_DOUBLE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
- { &hf_opcua_ResultMask, { "ResultMask", "opcua.ResultMask", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
{ &hf_opcua_Results, { "Results", "opcua.Results", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } },
{ &hf_opcua_RetransmitSequenceNumber, { "RetransmitSequenceNumber", "opcua.RetransmitSequenceNumber", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
{ &hf_opcua_ReturnBounds, { "ReturnBounds", "opcua.ReturnBounds", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL } },
diff --git a/plugins/opcua/opcua_hfindeces.h b/plugins/opcua/opcua_hfindeces.h
index 913636e..b04025b 100644
--- a/plugins/opcua/opcua_hfindeces.h
+++ b/plugins/opcua/opcua_hfindeces.h
@@ -174,7 +174,6 @@ extern int hf_opcua_MoreNotifications;
extern int hf_opcua_Name;
extern int hf_opcua_NamespaceUri;
extern int hf_opcua_NextSequenceNumber;
-extern int hf_opcua_NodeClassMask;
extern int hf_opcua_NotificationsCount;
extern int hf_opcua_NumValuesPerNode;
extern int hf_opcua_Offset;
@@ -217,7 +216,6 @@ extern int hf_opcua_RequestedMaxKeepAliveCount;
extern int hf_opcua_RequestedMaxReferencesPerNode;
extern int hf_opcua_RequestedPublishingInterval;
extern int hf_opcua_RequestedSessionTimeout;
-extern int hf_opcua_ResultMask;
extern int hf_opcua_Results;
extern int hf_opcua_RetransmitSequenceNumber;
extern int hf_opcua_ReturnBounds;
diff --git a/plugins/opcua/opcua_simpletypes.c b/plugins/opcua/opcua_simpletypes.c
index 9a603b4..005106d 100644
--- a/plugins/opcua/opcua_simpletypes.c
+++ b/plugins/opcua/opcua_simpletypes.c
@@ -63,6 +63,23 @@
#define RETURNDIAGNOSTICS_OPERATIONLEVEL_ADDITIONALINFO 0x0080
#define RETURNDIAGNOSTICS_OPERATIONLEVEL_INNERSTATUSCODE 0x0100
#define RETURNDIAGNOSTICS_OPERATIONLEVEL_INNERDIAGNOSTICS 0x0200
+#define NODECLASSMASK_ALL 0x0000
+#define NODECLASSMASK_OBJECT 0x0001
+#define NODECLASSMASK_VARIABLE 0x0002
+#define NODECLASSMASK_METHOD 0x0004
+#define NODECLASSMASK_OBJECTTYPE 0x0008
+#define NODECLASSMASK_VARIABLETYPE 0x0010
+#define NODECLASSMASK_REFERENCETYPE 0x0020
+#define NODECLASSMASK_DATATYPE 0x0040
+#define NODECLASSMASK_VIEW 0x0080
+#define RESULTMASK_REFERENCETYPE 0x0001
+#define RESULTMASK_ISFORWARD 0x0002
+#define RESULTMASK_NODECLASS 0x0004
+#define RESULTMASK_BROWSENAME 0x0008
+#define RESULTMASK_DISPLAYNAME 0x0010
+#define RESULTMASK_TYPEDEFINITION 0x0020
+#define RESULTMASK_ALL 0x003F
+
/* Chosen arbitrarily */
#define MAX_ARRAY_LEN 10000
@@ -134,6 +151,24 @@ int hf_opcua_returnDiag_mask_ol_localizedText = -1;
int hf_opcua_returnDiag_mask_ol_additionalinfo = -1;
int hf_opcua_returnDiag_mask_ol_innerstatuscode = -1;
int hf_opcua_returnDiag_mask_ol_innerdiagnostics = -1;
+int hf_opcua_nodeClassMask = -1;
+int hf_opcua_nodeClassMask_all = -1;
+int hf_opcua_nodeClassMask_object = -1;
+int hf_opcua_nodeClassMask_variable = -1;
+int hf_opcua_nodeClassMask_method = -1;
+int hf_opcua_nodeClassMask_objecttype = -1;
+int hf_opcua_nodeClassMask_variabletype = -1;
+int hf_opcua_nodeClassMask_referencetype = -1;
+int hf_opcua_nodeClassMask_datatype = -1;
+int hf_opcua_nodeClassMask_view = -1;
+int hf_opcua_resultMask = -1;
+int hf_opcua_resultMask_all = -1;
+int hf_opcua_resultMask_referencetype = -1;
+int hf_opcua_resultMask_isforward = -1;
+int hf_opcua_resultMask_nodeclass = -1;
+int hf_opcua_resultMask_browsename = -1;
+int hf_opcua_resultMask_displayname = -1;
+int hf_opcua_resultMask_typedefinition = -1;
static expert_field ei_array_length = EI_INIT;
@@ -292,6 +327,18 @@ static const value_string g_VariantTypes[] = {
#define VARIANT_ARRAYDIMENSIONS 0x40
#define VARIANT_ARRAYMASK 0x80
+/** BrowseRequest's BrowseDescription's NodeClassMaskTable enum table */
+static const value_string g_NodeClassMask[] = {
+ { NODECLASSMASK_ALL, "All" },
+ { 0, NULL }
+};
+
+/* BrowseRequest's BrowseDescription's ResultMaskTable enum table */
+static const value_string g_ResultMask[] = {
+ { RESULTMASK_ALL, "All" },
+ { 0, NULL }
+};
+
/* trees */
static gint ett_opcua_diagnosticinfo = -1;
static gint ett_opcua_diagnosticinfo_encodingmask = -1;
@@ -335,6 +382,9 @@ gint ett_opcua_array_ExtensionObject = -1;
gint ett_opcua_array_DataValue = -1;
gint ett_opcua_array_Variant = -1;
gint ett_opcua_returnDiagnostics = -1;
+gint ett_opcua_nodeClassMask = -1;
+gint ett_opcua_resultMask = -1;
+
static gint *ett[] =
{
&ett_opcua_diagnosticinfo,
@@ -378,7 +428,9 @@ static gint *ett[] =
&ett_opcua_array_ExtensionObject,
&ett_opcua_array_DataValue,
&ett_opcua_array_Variant,
- &ett_opcua_returnDiagnostics
+ &ett_opcua_returnDiagnostics,
+ &ett_opcua_nodeClassMask,
+ &ett_opcua_resultMask
};
void registerSimpleTypes(int proto)
@@ -455,7 +507,25 @@ void registerSimpleTypes(int proto)
{&hf_opcua_returnDiag_mask_ol_additionalinfo, {"OperationLevel / AdditionalInfo", "opcua.returndiag.operationlevel.additionalinfo", FT_BOOLEAN, 16, NULL, RETURNDIAGNOSTICS_OPERATIONLEVEL_ADDITIONALINFO, NULL, HFILL}},
{&hf_opcua_returnDiag_mask_ol_innerstatuscode, {"OperationLevel / Inner StatusCode", "opcua.returndiag.operationlevel.innerstatuscode", FT_BOOLEAN, 16, NULL, RETURNDIAGNOSTICS_OPERATIONLEVEL_INNERSTATUSCODE, NULL, HFILL}},
{&hf_opcua_returnDiag_mask_ol_innerdiagnostics, {"OperationLevel / Inner Diagnostics", "opcua.returndiag.operationlevel.innerdiagnostics", FT_BOOLEAN, 16, NULL, RETURNDIAGNOSTICS_OPERATIONLEVEL_INNERDIAGNOSTICS, NULL, HFILL}},
- };
+ {&hf_opcua_nodeClassMask, {"Node Class Mask", "opcua.nodeclassmask", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}},
+ {&hf_opcua_nodeClassMask_all, {"Node Class Mask", "opcua.nodeclassmask.all", FT_UINT32, BASE_HEX, VALS(g_NodeClassMask), 0x0, NULL, HFILL}},
+ {&hf_opcua_nodeClassMask_object, {"Object", "opcua.nodeclassmask.object", FT_BOOLEAN, 16, NULL, NODECLASSMASK_OBJECT, NULL, HFILL}},
+ {&hf_opcua_nodeClassMask_variable, {"Variable", "opcua.nodeclassmask.variable", FT_BOOLEAN, 16, NULL, NODECLASSMASK_VARIABLE, NULL, HFILL}},
+ {&hf_opcua_nodeClassMask_method, {"Method", "opcua.nodeclassmask.method", FT_BOOLEAN, 16, NULL, NODECLASSMASK_METHOD, NULL, HFILL}},
+ {&hf_opcua_nodeClassMask_objecttype, {"ObjectType", "opcua.nodeclassmask.objecttype", FT_BOOLEAN, 16, NULL, NODECLASSMASK_OBJECTTYPE, NULL, HFILL}},
+ {&hf_opcua_nodeClassMask_variabletype, {"VariableType", "opcua.nodeclassmask.variabletype", FT_BOOLEAN, 16, NULL, NODECLASSMASK_VARIABLETYPE, NULL, HFILL}},
+ {&hf_opcua_nodeClassMask_referencetype, {"ReferenceType", "opcua.nodeclassmask.referencetype", FT_BOOLEAN, 16, NULL, NODECLASSMASK_REFERENCETYPE, NULL, HFILL}},
+ {&hf_opcua_nodeClassMask_datatype, {"DataType", "opcua.nodeclassmask.datatype", FT_BOOLEAN, 16, NULL, NODECLASSMASK_DATATYPE, NULL, HFILL}},
+ {&hf_opcua_nodeClassMask_view, {"View", "opcua.nodeclassmask.view", FT_BOOLEAN, 16, NULL, NODECLASSMASK_VIEW, NULL, HFILL}},
+ {&hf_opcua_resultMask, {"Result Mask", "opcua.resultmask", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}},
+ {&hf_opcua_resultMask_referencetype, {"Reference Type", "opcua.resultmask.referencetype", FT_BOOLEAN, 16, NULL, RESULTMASK_REFERENCETYPE, NULL, HFILL}},
+ {&hf_opcua_resultMask_isforward, {"Is Forward", "opcua.resultmask.isforward", FT_BOOLEAN, 16, NULL, RESULTMASK_ISFORWARD, NULL, HFILL}},
+ {&hf_opcua_resultMask_nodeclass, {"Node Class", "opcua.resultmask.nodeclass", FT_BOOLEAN, 16, NULL, RESULTMASK_NODECLASS, NULL, HFILL}},
+ {&hf_opcua_resultMask_browsename, {"Browse Name", "opcua.resultmask.browsename", FT_BOOLEAN, 16, NULL, RESULTMASK_BROWSENAME, NULL, HFILL}},
+ {&hf_opcua_resultMask_displayname, {"Display Name", "opcua.resultmask.displayname", FT_BOOLEAN, 16, NULL, RESULTMASK_DISPLAYNAME, NULL, HFILL}},
+ {&hf_opcua_resultMask_typedefinition, {"Type Definiton", "opcua.resultmask.typedefinition", FT_BOOLEAN, 16, NULL, RESULTMASK_TYPEDEFINITION, NULL, HFILL}},
+ {&hf_opcua_resultMask_all, {"Result Mask", "opcua.resultmask.all", FT_UINT32, BASE_HEX, VALS(g_ResultMask), 0x0, NULL, HFILL}},
+ };
static ei_register_info ei[] = {
{ &ei_array_length, { "opcua.array.length", PI_UNDECODED, PI_ERROR, "Max array length exceeded", EXPFILL }},
@@ -1221,6 +1291,54 @@ guint32 getExtensionObjectType(tvbuff_t *tvb, gint *pOffset)
return Numeric;
}
+void parseNodeClassMask(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint *pOffset)
+{
+ static const int *nodeclass_mask[] = {
+ &hf_opcua_nodeClassMask_object,
+ &hf_opcua_nodeClassMask_variable,
+ &hf_opcua_nodeClassMask_method,
+ &hf_opcua_nodeClassMask_objecttype,
+ &hf_opcua_nodeClassMask_variabletype,
+ &hf_opcua_nodeClassMask_referencetype,
+ &hf_opcua_nodeClassMask_datatype,
+ &hf_opcua_nodeClassMask_view,
+ NULL};
+
+ guint8 NodeClassMask = tvb_get_guint8(tvb, *pOffset);
+ if(NodeClassMask == NODECLASSMASK_ALL)
+ {
+ proto_tree_add_item(tree, hf_opcua_nodeClassMask_all, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN);
+ }
+ else
+ {
+ proto_tree_add_bitmask(tree, tvb, *pOffset, hf_opcua_nodeClassMask, ett_opcua_nodeClassMask, nodeclass_mask, ENC_LITTLE_ENDIAN);
+ }
+ *pOffset+=4;
+}
+
+void parseResultMask(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint *pOffset)
+{
+ static const int *browseresult_mask[] = {
+ &hf_opcua_resultMask_referencetype,
+ &hf_opcua_resultMask_isforward,
+ &hf_opcua_resultMask_nodeclass,
+ &hf_opcua_resultMask_browsename,
+ &hf_opcua_resultMask_displayname,
+ &hf_opcua_resultMask_typedefinition,
+ NULL};
+
+ guint8 ResultMask = tvb_get_guint8(tvb, *pOffset);
+ if(ResultMask == RESULTMASK_ALL)
+ {
+ proto_tree_add_item(tree, hf_opcua_resultMask_all, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN);
+ }
+ else
+ {
+ proto_tree_add_bitmask(tree, tvb, *pOffset, hf_opcua_resultMask, ett_opcua_resultMask, browseresult_mask, ENC_LITTLE_ENDIAN);
+ }
+ *pOffset+=4;
+}
+
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
diff --git a/plugins/opcua/opcua_simpletypes.h b/plugins/opcua/opcua_simpletypes.h
index 94fc19b..ebbdbbf 100644
--- a/plugins/opcua/opcua_simpletypes.h
+++ b/plugins/opcua/opcua_simpletypes.h
@@ -31,6 +31,15 @@ extern int hf_opcua_returnDiag_mask_ol_localizedText;
extern int hf_opcua_returnDiag_mask_ol_additionalinfo;
extern int hf_opcua_returnDiag_mask_ol_innerstatuscode;
extern int hf_opcua_returnDiag_mask_ol_innerdiagnostics;
+extern int hf_opcua_nodeClassMask;
+extern int hf_opcua_nodeClassMask_object;
+extern int hf_opcua_nodeClassMask_variable;
+extern int hf_opcua_nodeClassMask_method;
+extern int hf_opcua_nodeClassMask_objecttype;
+extern int hf_opcua_nodeClassMask_variabletype;
+extern int hf_opcua_nodeClassMask_referencetype;
+extern int hf_opcua_nodeClassMask_datatype;
+extern int hf_opcua_nodeClassMask_view;
/* simple types trees */
extern gint ett_opcua_array_Boolean;