summaryrefslogtreecommitdiff
path: root/plugins/opcua/opcua.c
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss@ulticom.com>2010-12-04 02:54:59 +0000
committerJeff Morriss <jeff.morriss@ulticom.com>2010-12-04 02:54:59 +0000
commit64a099a65208dd02197e2d16a68eaa37f0eb606c (patch)
tree39381e6392b6375e860bf8a7f83c71b3e1ab386a /plugins/opcua/opcua.c
parent4f6ea6ef475c4a27a8233c7ed93ea42f29db534c (diff)
downloadwireshark-64a099a65208dd02197e2d16a68eaa37f0eb606c.tar.gz
From Gerhard Gappmeier via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5429 :
Until now the info column only shows the OPC UA transport protocol type (Hello, Ack, Secure Conversion message). After connections establishment has finished this column shows only Secure Conversion message, because every service is sent over the secure channel. This patch adds the useful support of displaying the service type in the info column. This makes it easier to find specific service calls in huge capture files. svn path=/trunk/; revision=35119
Diffstat (limited to 'plugins/opcua/opcua.c')
-rw-r--r--plugins/opcua/opcua.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/plugins/opcua/opcua.c b/plugins/opcua/opcua.c
index 36baaf37f3..2de50733a2 100644
--- a/plugins/opcua/opcua.c
+++ b/plugins/opcua/opcua.c
@@ -38,13 +38,16 @@
#include "opcua_simpletypes.h"
#include "opcua_hfindeces.h"
+extern const value_string g_requesttypes[];
+extern const int g_NumServices;
+
/* forward reference */
static void dissect_opcua(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
static void dissect_opcua_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
void proto_reg_handoff_opcua(void);
/* declare parse function pointer */
-typedef void (*FctParse)(proto_tree *tree, tvbuff_t *tvb, gint *pOffset);
+typedef int (*FctParse)(proto_tree *tree, tvbuff_t *tvb, gint *pOffset);
static int proto_opcua = -1;
static dissector_handle_t opcua_handle;
@@ -208,6 +211,7 @@ static void dissect_opcua_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree
if (tree && pfctParse)
{
gint offset = 0;
+ int iServiceId = -1;
/* we are being asked for details */
proto_item *ti = NULL;
@@ -217,7 +221,22 @@ static void dissect_opcua_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree
transport_tree = proto_item_add_subtree(ti, ett_opcua_transport);
/* call the transport message dissector */
- (*pfctParse)(transport_tree, tvb, &offset);
+ iServiceId = (*pfctParse)(transport_tree, tvb, &offset);
+
+ /* display the service type in addition to the message type */
+ if (iServiceId != -1)
+ {
+ int index = 0;
+ while (index < g_NumServices)
+ {
+ if (g_requesttypes[index].value == (guint32)iServiceId)
+ {
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s: %s", g_szMessageTypes[msgtype], g_requesttypes[index].strptr);
+ break;
+ }
+ index++;
+ }
+ }
}
}