aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorHannes Mezger <hannes.mezger@ascolab.com>2015-07-02 11:48:12 +0200
committerMichael Mann <mmann78@netscape.net>2015-07-08 18:33:39 +0000
commite0deadcbc79dcee74eef693ba47485fccfc15446 (patch)
treed4e34d1974536db23b830e0491da30097a065882 /plugins
parent4eca2689357fad460908c2b7a74cbdb8cb5d0f4e (diff)
opcua dissector: fix display of service type in packet column
The loop was iterating using g_NumServices, which is the number of entries in g_arParserTable and not the number of entries in g_requesttypes. Instead now we use val_to_str which can in addition display the ServiceId instead if not found in the table. Change-Id: If15ee5c460e07c4687464805935b92c913392011 Reviewed-on: https://code.wireshark.org/review/9459 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')
-rw-r--r--plugins/opcua/opcua.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/plugins/opcua/opcua.c b/plugins/opcua/opcua.c
index 9f1bd07f44..3a00f0ad89 100644
--- a/plugins/opcua/opcua.c
+++ b/plugins/opcua/opcua.c
@@ -332,22 +332,15 @@ static int dissect_opcua_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
/* display the service type in addition to the message type */
if (iServiceId != -1)
{
- int indx = 0;
- while (indx < g_NumServices)
+ const gchar *szServiceName = val_to_str((guint32)iServiceId, g_requesttypes, "ServiceId %d");
+
+ if (bIsLastFragment == FALSE)
{
- if (g_requesttypes[indx].value == (guint32)iServiceId)
- {
- if (bIsLastFragment == FALSE)
- {
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s: %s", g_szMessageTypes[msgtype], g_requesttypes[indx].strptr);
- }
- else
- {
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s: %s (Message Reassembled)", g_szMessageTypes[msgtype], g_requesttypes[indx].strptr);
- }
- break;
- }
- indx++;
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s: %s", g_szMessageTypes[msgtype], szServiceName);
+ }
+ else
+ {
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s: %s (Message Reassembled)", g_szMessageTypes[msgtype], szServiceName);
}
}
}