diff options
author | Hannes Mezger <hannes.mezger@ascolab.com> | 2014-06-10 12:27:34 +0200 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2014-06-11 12:59:08 +0000 |
commit | baa58887886c6bbe24f2894e40a4c0e1bccd5314 (patch) | |
tree | 2ff324bc0d6882018989158ad219c08706274df1 /plugins | |
parent | fabee432def958af4a102eca6bfe935ec80836f6 (diff) |
Move ServiceFault from ComplexType- to ServiceParser
ServiceFaults are always sent as a service response and never as value, this moves the parsing code to the correct location.
Change-Id: Ida9cb561aa40fcbfc3c0429aed732d108b295138
Reviewed-on: https://code.wireshark.org/review/2124
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/opcua/opcua_complextypeparser.c | 9 | ||||
-rw-r--r-- | plugins/opcua/opcua_complextypeparser.h | 1 | ||||
-rw-r--r-- | plugins/opcua/opcua_extensionobjectids.h | 1 | ||||
-rw-r--r-- | plugins/opcua/opcua_extensionobjecttable.c | 1 | ||||
-rw-r--r-- | plugins/opcua/opcua_serviceids.h | 1 | ||||
-rw-r--r-- | plugins/opcua/opcua_serviceparser.c | 10 | ||||
-rw-r--r-- | plugins/opcua/opcua_serviceparser.h | 1 | ||||
-rw-r--r-- | plugins/opcua/opcua_servicetable.c | 2 |
8 files changed, 14 insertions, 12 deletions
diff --git a/plugins/opcua/opcua_complextypeparser.c b/plugins/opcua/opcua_complextypeparser.c index b1a944ccd4..9c4b04c775 100644 --- a/plugins/opcua/opcua_complextypeparser.c +++ b/plugins/opcua/opcua_complextypeparser.c @@ -314,14 +314,6 @@ void parseResponseHeader(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, const c parseExtensionObject(subtree, tvb, pOffset, "AdditionalHeader"); proto_item_set_end(ti, tvb, *pOffset); } -gint ett_opcua_ServiceFault = -1; -void parseServiceFault(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, const char *szFieldName) -{ - proto_item *ti = proto_tree_add_text(tree, tvb, *pOffset, -1, "%s : ServiceFault", szFieldName); - proto_tree *subtree = proto_item_add_subtree(ti, ett_opcua_ServiceFault); - parseResponseHeader(subtree, tvb, pOffset, "ResponseHeader"); - proto_item_set_end(ti, tvb, *pOffset); -} gint ett_opcua_UserTokenPolicy = -1; void parseUserTokenPolicy(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, const char *szFieldName) { @@ -1803,7 +1795,6 @@ static gint *ett[] = &ett_opcua_ApplicationDescription, &ett_opcua_RequestHeader, &ett_opcua_ResponseHeader, - &ett_opcua_ServiceFault, &ett_opcua_UserTokenPolicy, &ett_opcua_EndpointDescription, &ett_opcua_RegisteredServer, diff --git a/plugins/opcua/opcua_complextypeparser.h b/plugins/opcua/opcua_complextypeparser.h index 100499d701..dd154a68a1 100644 --- a/plugins/opcua/opcua_complextypeparser.h +++ b/plugins/opcua/opcua_complextypeparser.h @@ -42,7 +42,6 @@ void parseTimeZoneDataType(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, const void parseApplicationDescription(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, const char *szFieldName); void parseRequestHeader(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, const char *szFieldName); void parseResponseHeader(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, const char *szFieldName); -void parseServiceFault(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, const char *szFieldName); void parseUserTokenPolicy(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, const char *szFieldName); void parseEndpointDescription(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, const char *szFieldName); void parseRegisteredServer(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, const char *szFieldName); diff --git a/plugins/opcua/opcua_extensionobjectids.h b/plugins/opcua/opcua_extensionobjectids.h index 974f10e17e..d186fcac6f 100644 --- a/plugins/opcua/opcua_extensionobjectids.h +++ b/plugins/opcua/opcua_extensionobjectids.h @@ -34,7 +34,6 @@ #define OpcUaId_ApplicationDescription_Encoding_DefaultBinary 310 #define OpcUaId_RequestHeader_Encoding_DefaultBinary 391 #define OpcUaId_ResponseHeader_Encoding_DefaultBinary 394 -#define OpcUaId_ServiceFault_Encoding_DefaultBinary 397 #define OpcUaId_FindServersRequest_Encoding_DefaultBinary 422 #define OpcUaId_FindServersResponse_Encoding_DefaultBinary 425 #define OpcUaId_UserTokenPolicy_Encoding_DefaultBinary 306 diff --git a/plugins/opcua/opcua_extensionobjecttable.c b/plugins/opcua/opcua_extensionobjecttable.c index ddc38fbd9d..0d170696ca 100644 --- a/plugins/opcua/opcua_extensionobjecttable.c +++ b/plugins/opcua/opcua_extensionobjecttable.c @@ -49,7 +49,6 @@ ExtensionObjectParserEntry g_arExtensionObjectParserTable[] = { { OpcUaId_ApplicationDescription_Encoding_DefaultBinary, parseApplicationDescription, "ApplicationDescription" }, { OpcUaId_RequestHeader_Encoding_DefaultBinary, parseRequestHeader, "RequestHeader" }, { OpcUaId_ResponseHeader_Encoding_DefaultBinary, parseResponseHeader, "ResponseHeader" }, - { OpcUaId_ServiceFault_Encoding_DefaultBinary, parseServiceFault, "ServiceFault" }, { OpcUaId_UserTokenPolicy_Encoding_DefaultBinary, parseUserTokenPolicy, "UserTokenPolicy" }, { OpcUaId_EndpointDescription_Encoding_DefaultBinary, parseEndpointDescription, "EndpointDescription" }, { OpcUaId_RegisteredServer_Encoding_DefaultBinary, parseRegisteredServer, "RegisteredServer" }, diff --git a/plugins/opcua/opcua_serviceids.h b/plugins/opcua/opcua_serviceids.h index 92bbcacad8..27d03f2e40 100644 --- a/plugins/opcua/opcua_serviceids.h +++ b/plugins/opcua/opcua_serviceids.h @@ -20,6 +20,7 @@ ** ******************************************************************************/ +#define OpcUaId_ServiceFault_Encoding_DefaultBinary 397 #define OpcUaId_TestStackRequest_Encoding_DefaultBinary 410 #define OpcUaId_TestStackResponse_Encoding_DefaultBinary 413 #define OpcUaId_TestStackExRequest_Encoding_DefaultBinary 416 diff --git a/plugins/opcua/opcua_serviceparser.c b/plugins/opcua/opcua_serviceparser.c index 16f20b0555..08c3880fe5 100644 --- a/plugins/opcua/opcua_serviceparser.c +++ b/plugins/opcua/opcua_serviceparser.c @@ -29,6 +29,15 @@ #include "opcua_hfindeces.h" #include "opcua_serviceparser.h" +gint ett_opcua_ServiceFault = -1; +void parseServiceFault(proto_tree *tree, tvbuff_t *tvb, gint *pOffset) +{ + proto_item *ti = proto_tree_add_text(tree, tvb, *pOffset, -1, "ServiceFault"); + proto_tree *subtree = proto_item_add_subtree(ti, ett_opcua_ServiceFault); + + parseResponseHeader(subtree, tvb, pOffset, "ResponseHeader"); + proto_item_set_end(ti, tvb, *pOffset); +} gint ett_opcua_FindServersRequest = -1; void parseFindServersRequest(proto_tree *tree, tvbuff_t *tvb, gint *pOffset) { @@ -1003,6 +1012,7 @@ void parseTestStackExResponse(proto_tree *tree, tvbuff_t *tvb, gint *pOffset) /** Setup protocol subtree array */ static gint *ett[] = { + &ett_opcua_ServiceFault, &ett_opcua_FindServersRequest, &ett_opcua_FindServersResponse, &ett_opcua_GetEndpointsRequest, diff --git a/plugins/opcua/opcua_serviceparser.h b/plugins/opcua/opcua_serviceparser.h index a8bb7dbead..6025cf7d73 100644 --- a/plugins/opcua/opcua_serviceparser.h +++ b/plugins/opcua/opcua_serviceparser.h @@ -23,6 +23,7 @@ #include <glib.h> #include <epan/packet.h> +void parseServiceFault(proto_tree *tree, tvbuff_t *tvb, gint *pOffset); void parseFindServersRequest(proto_tree *tree, tvbuff_t *tvb, gint *pOffset); void parseFindServersResponse(proto_tree *tree, tvbuff_t *tvb, gint *pOffset); void parseGetEndpointsRequest(proto_tree *tree, tvbuff_t *tvb, gint *pOffset); diff --git a/plugins/opcua/opcua_servicetable.c b/plugins/opcua/opcua_servicetable.c index c26ff23c0d..1f1150747c 100644 --- a/plugins/opcua/opcua_servicetable.c +++ b/plugins/opcua/opcua_servicetable.c @@ -29,6 +29,7 @@ #include "opcua_servicetable.h" ParserEntry g_arParserTable[] = { + { OpcUaId_ServiceFault_Encoding_DefaultBinary, parseServiceFault }, { OpcUaId_FindServersRequest_Encoding_DefaultBinary, parseFindServersRequest }, { OpcUaId_FindServersResponse_Encoding_DefaultBinary, parseFindServersResponse }, { OpcUaId_GetEndpointsRequest_Encoding_DefaultBinary, parseGetEndpointsRequest }, @@ -112,6 +113,7 @@ const int g_NumServices = sizeof(g_arParserTable) / sizeof(ParserEntry); /** Service type table */ const value_string g_requesttypes[] = { + { OpcUaId_ServiceFault_Encoding_DefaultBinary, "ServiceFault" }, { OpcUaId_FindServersRequest_Encoding_DefaultBinary, "FindServersRequest" }, { OpcUaId_FindServersResponse_Encoding_DefaultBinary, "FindServersResponse" }, { OpcUaId_GetEndpointsRequest_Encoding_DefaultBinary, "GetEndpointsRequest" }, |