opcua: display string representation of AttributeId and DeadbandType

Change-Id: I41f100ddab544054f8fab89f3f5da61866db7a2d
Reviewed-on: https://code.wireshark.org/review/11309
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>
This commit is contained in:
Hannes Mezger 2015-10-27 14:36:10 +01:00 committed by Michael Mann
parent b86e2a3609
commit e1ed17f927
5 changed files with 43 additions and 9 deletions

View File

@ -1049,7 +1049,7 @@ void parseQueryDataDescription(proto_tree *tree, tvbuff_t *tvb, packet_info *pin
proto_item *ti;
proto_tree *subtree = proto_tree_add_subtree_format(tree, tvb, *pOffset, -1, ett_opcua_QueryDataDescription, &ti, "%s: QueryDataDescription", szFieldName);
parseRelativePath(subtree, tvb, pinfo, pOffset, "RelativePath");
parseUInt32(subtree, tvb, pinfo, pOffset, hf_opcua_AttributeId);
parseAttributeId(subtree, tvb, pinfo, pOffset);
parseString(subtree, tvb, pinfo, pOffset, hf_opcua_IndexRange);
proto_item_set_end(ti, tvb, *pOffset);
}
@ -1122,7 +1122,7 @@ void parseAttributeOperand(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo,
parseNodeId(subtree, tvb, pinfo, pOffset, "NodeId");
parseString(subtree, tvb, pinfo, pOffset, hf_opcua_Alias);
parseRelativePath(subtree, tvb, pinfo, pOffset, "BrowsePath");
parseUInt32(subtree, tvb, pinfo, pOffset, hf_opcua_AttributeId);
parseAttributeId(subtree, tvb, pinfo, pOffset);
parseString(subtree, tvb, pinfo, pOffset, hf_opcua_IndexRange);
proto_item_set_end(ti, tvb, *pOffset);
}
@ -1133,7 +1133,7 @@ void parseSimpleAttributeOperand(proto_tree *tree, tvbuff_t *tvb, packet_info *p
parseNodeId(subtree, tvb, pinfo, pOffset, "TypeDefinitionId");
/* Array length field ignored: NoOfBrowsePath */
parseArrayComplex(subtree, tvb, pinfo, pOffset, "BrowsePath", "QualifiedName", parseQualifiedName, ett_opcua_array_QualifiedName);
parseUInt32(subtree, tvb, pinfo, pOffset, hf_opcua_AttributeId);
parseAttributeId(subtree, tvb, pinfo, pOffset);
parseString(subtree, tvb, pinfo, pOffset, hf_opcua_IndexRange);
proto_item_set_end(ti, tvb, *pOffset);
}
@ -1174,7 +1174,7 @@ void parseReadValueId(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint
proto_item *ti;
proto_tree *subtree = proto_tree_add_subtree_format(tree, tvb, *pOffset, -1, ett_opcua_ReadValueId, &ti, "%s: ReadValueId", szFieldName);
parseNodeId(subtree, tvb, pinfo, pOffset, "NodeId");
parseUInt32(subtree, tvb, pinfo, pOffset, hf_opcua_AttributeId);
parseAttributeId(subtree, tvb, pinfo, pOffset);
parseString(subtree, tvb, pinfo, pOffset, hf_opcua_IndexRange);
parseQualifiedName(subtree, tvb, pinfo, pOffset, "DataEncoding");
proto_item_set_end(ti, tvb, *pOffset);
@ -1280,7 +1280,7 @@ void parseWriteValue(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint *
proto_item *ti;
proto_tree *subtree = proto_tree_add_subtree_format(tree, tvb, *pOffset, -1, ett_opcua_WriteValue, &ti, "%s: WriteValue", szFieldName);
parseNodeId(subtree, tvb, pinfo, pOffset, "NodeId");
parseUInt32(subtree, tvb, pinfo, pOffset, hf_opcua_AttributeId);
parseAttributeId(subtree, tvb, pinfo, pOffset);
parseString(subtree, tvb, pinfo, pOffset, hf_opcua_IndexRange);
parseDataValue(subtree, tvb, pinfo, pOffset, "Value");
proto_item_set_end(ti, tvb, *pOffset);
@ -1390,7 +1390,7 @@ void parseDataChangeFilter(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo,
proto_item *ti;
proto_tree *subtree = proto_tree_add_subtree_format(tree, tvb, *pOffset, -1, ett_opcua_DataChangeFilter, &ti, "%s: DataChangeFilter", szFieldName);
parseDataChangeTrigger(subtree, tvb, pinfo, pOffset);
parseUInt32(subtree, tvb, pinfo, pOffset, hf_opcua_DeadbandType);
parseDeadbandType(subtree, tvb, pinfo, pOffset);
parseDouble(subtree, tvb, pinfo, pOffset, hf_opcua_DeadbandValue);
proto_item_set_end(ti, tvb, *pOffset);
}

View File

@ -522,6 +522,38 @@ void parseExceptionDeviationFormat(proto_tree *tree, tvbuff_t *tvb, packet_info
{
proto_tree_add_item(tree, hf_opcua_ExceptionDeviationFormat, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN); *pOffset+=4;
}
/** AttributeId enum table */
static const value_string g_AttributeIdTable[] = {
{1, "NodeId"},
{2, "NodeClass"},
{3, "BrowseName"},
{4, "DisplayName"},
{5, "Description"},
{6, "WriteMask"},
{7, "UserWriteMask"},
{8, "IsAbstract"},
{9, "Symmetric"},
{10, "InverseName"},
{11, "ContainsNoLoops"},
{12, "EventNotifier"},
{13, "Value"},
{14, "DataType"},
{15, "ValueRank"},
{16, "ArrayDimensions"},
{17, "AccessLevel"},
{18, "UserAccessLevel"},
{19, "MinimumSamplingInterval"},
{20, "Historizing"},
{21, "Executable"},
{22, "UserExecutable"},
{0, NULL}
};
static int hf_opcua_AttributeId = -1;
void parseAttributeId(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, gint *pOffset)
{
proto_tree_add_item(tree, hf_opcua_AttributeId, tvb, *pOffset, 4, ENC_LITTLE_ENDIAN); *pOffset += 4;
}
/** Setup enum subtree array */
static gint *ett[] =
@ -646,6 +678,9 @@ void registerEnumTypes(int proto)
{ &hf_opcua_ExceptionDeviationFormat,
{ "ExceptionDeviationFormat", "opcua.ExceptionDeviationFormat", FT_UINT32, BASE_HEX, VALS(g_ExceptionDeviationFormatTable), 0x0, NULL, HFILL }
},
{ &hf_opcua_AttributeId,
{ "AttributeId", "opcua.AttributeId", FT_UINT32, BASE_HEX, VALS(g_AttributeIdTable), 0x0, NULL, HFILL }
},
};
proto_register_field_array(proto, hf, array_length(hf));

View File

@ -51,6 +51,7 @@ extern gint ett_opcua_array_ServerState;
extern gint ett_opcua_array_ModelChangeStructureVerbMask;
extern gint ett_opcua_array_AxisScaleEnumeration;
extern gint ett_opcua_array_ExceptionDeviationFormat;
extern gint ett_opcua_array_AttributeId;
void parseNodeIdType(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint *pOffset);
void parseNamingRuleType(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint *pOffset);
@ -80,4 +81,5 @@ void parseServerState(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint
void parseModelChangeStructureVerbMask(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint *pOffset);
void parseAxisScaleEnumeration(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint *pOffset);
void parseExceptionDeviationFormat(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint *pOffset);
void parseAttributeId(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint *pOffset);
void registerEnumTypes(int proto);

View File

@ -33,7 +33,6 @@ int hf_opcua_Alias = -1;
int hf_opcua_AnnotationTime = -1;
int hf_opcua_ApplicationUri = -1;
int hf_opcua_ArrayDimensions = -1;
int hf_opcua_AttributeId = -1;
int hf_opcua_AuditEntryId = -1;
int hf_opcua_AuthenticationMechanism = -1;
int hf_opcua_AvailableSequenceNumbers = -1;
@ -339,7 +338,6 @@ void registerFieldTypes(int proto)
{ &hf_opcua_AnnotationTime, { "AnnotationTime", "opcua.AnnotationTime", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, NULL, HFILL } },
{ &hf_opcua_ApplicationUri, { "ApplicationUri", "opcua.ApplicationUri", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
{ &hf_opcua_ArrayDimensions, { "ArrayDimensions", "opcua.ArrayDimensions", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
{ &hf_opcua_AttributeId, { "AttributeId", "opcua.AttributeId", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
{ &hf_opcua_AuditEntryId, { "AuditEntryId", "opcua.AuditEntryId", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
{ &hf_opcua_AuthenticationMechanism, { "AuthenticationMechanism", "opcua.AuthenticationMechanism", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
{ &hf_opcua_AvailableSequenceNumbers, { "AvailableSequenceNumbers", "opcua.AvailableSequenceNumbers", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },

View File

@ -31,7 +31,6 @@ extern int hf_opcua_Alias;
extern int hf_opcua_AnnotationTime;
extern int hf_opcua_ApplicationUri;
extern int hf_opcua_ArrayDimensions;
extern int hf_opcua_AttributeId;
extern int hf_opcua_AuditEntryId;
extern int hf_opcua_AuthenticationMechanism;
extern int hf_opcua_AvailableSequenceNumbers;