aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
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
parent4f6ea6ef475c4a27a8233c7ed93ea42f29db534c (diff)
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')
-rw-r--r--plugins/opcua/opcua.c23
-rw-r--r--plugins/opcua/opcua_transport_layer.c18
-rw-r--r--plugins/opcua/opcua_transport_layer.h14
3 files changed, 40 insertions, 15 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++;
+ }
+ }
}
}
diff --git a/plugins/opcua/opcua_transport_layer.c b/plugins/opcua/opcua_transport_layer.c
index e35dd99369..426f6835fc 100644
--- a/plugins/opcua/opcua_transport_layer.c
+++ b/plugins/opcua/opcua_transport_layer.c
@@ -125,7 +125,7 @@ void registerTransportLayerTypes(int proto)
}
/* Transport Layer: message parsers */
-void parseHello(proto_tree *tree, tvbuff_t *tvb, gint *pOffset)
+int parseHello(proto_tree *tree, tvbuff_t *tvb, gint *pOffset)
{
proto_tree_add_item(tree, hf_opcua_transport_type, tvb, *pOffset, 3, TRUE); *pOffset+=3;
proto_tree_add_item(tree, hf_opcua_transport_chunk, tvb, *pOffset, 1, TRUE); *pOffset+=1;
@@ -136,9 +136,10 @@ void parseHello(proto_tree *tree, tvbuff_t *tvb, gint *pOffset)
proto_tree_add_item(tree, hf_opcua_transport_mms, tvb, *pOffset, 4, TRUE); *pOffset+=4;
proto_tree_add_item(tree, hf_opcua_transport_mcc, tvb, *pOffset, 4, TRUE); *pOffset+=4;
parseString(tree, tvb, pOffset, hf_opcua_transport_endpoint);
+ return -1;
}
-void parseAcknowledge(proto_tree *tree, tvbuff_t *tvb, gint *pOffset)
+int parseAcknowledge(proto_tree *tree, tvbuff_t *tvb, gint *pOffset)
{
proto_tree_add_item(tree, hf_opcua_transport_type, tvb, *pOffset, 3, TRUE); *pOffset+=3;
proto_tree_add_item(tree, hf_opcua_transport_chunk, tvb, *pOffset, 1, TRUE); *pOffset+=1;
@@ -148,18 +149,20 @@ void parseAcknowledge(proto_tree *tree, tvbuff_t *tvb, gint *pOffset)
proto_tree_add_item(tree, hf_opcua_transport_sbs, tvb, *pOffset, 4, TRUE); *pOffset+=4;
proto_tree_add_item(tree, hf_opcua_transport_mms, tvb, *pOffset, 4, TRUE); *pOffset+=4;
proto_tree_add_item(tree, hf_opcua_transport_mcc, tvb, *pOffset, 4, TRUE); *pOffset+=4;
+ return -1;
}
-void parseError(proto_tree *tree, tvbuff_t *tvb, gint *pOffset)
+int parseError(proto_tree *tree, tvbuff_t *tvb, gint *pOffset)
{
proto_tree_add_item(tree, hf_opcua_transport_type, tvb, *pOffset, 3, TRUE); *pOffset+=3;
proto_tree_add_item(tree, hf_opcua_transport_chunk, tvb, *pOffset, 1, TRUE); *pOffset+=1;
proto_tree_add_item(tree, hf_opcua_transport_size, tvb, *pOffset, 4, TRUE); *pOffset+=4;
proto_tree_add_item(tree, hf_opcua_transport_error, tvb, *pOffset, 4, TRUE); *pOffset+=4;
parseString(tree, tvb, pOffset, hf_opcua_transport_reason);
+ return -1;
}
-void parseMessage(proto_tree *tree, tvbuff_t *tvb, gint *pOffset)
+int parseMessage(proto_tree *tree, tvbuff_t *tvb, gint *pOffset)
{
proto_item *ti;
proto_tree *encobj_tree;
@@ -188,9 +191,10 @@ void parseMessage(proto_tree *tree, tvbuff_t *tvb, gint *pOffset)
ServiceId = parseServiceNodeId(nodeid_tree, tvb, pOffset, "NodeId");
dispatchService(encobj_tree, tvb, pOffset, ServiceId);
+ return ServiceId;
}
-void parseOpenSecureChannel(proto_tree *tree, tvbuff_t *tvb, gint *pOffset)
+int parseOpenSecureChannel(proto_tree *tree, tvbuff_t *tvb, gint *pOffset)
{
proto_item *ti;
proto_tree *encobj_tree;
@@ -217,13 +221,15 @@ void parseOpenSecureChannel(proto_tree *tree, tvbuff_t *tvb, gint *pOffset)
ServiceId = parseServiceNodeId(nodeid_tree, tvb, pOffset, "NodeId");
dispatchService(encobj_tree, tvb, pOffset, ServiceId);
+ return -1;
}
-void parseCloseSecureChannel(proto_tree *tree, tvbuff_t *tvb, gint *pOffset)
+int parseCloseSecureChannel(proto_tree *tree, tvbuff_t *tvb, gint *pOffset)
{
proto_tree_add_item(tree, hf_opcua_transport_type, tvb, *pOffset, 3, TRUE); *pOffset+=3;
proto_tree_add_item(tree, hf_opcua_transport_chunk, tvb, *pOffset, 1, TRUE); *pOffset+=1;
proto_tree_add_item(tree, hf_opcua_transport_size, tvb, *pOffset, 4, TRUE); *pOffset+=4;
proto_tree_add_item(tree, hf_opcua_transport_scid, tvb, *pOffset, 4, TRUE); *pOffset+=4;
+ return -1;
}
diff --git a/plugins/opcua/opcua_transport_layer.h b/plugins/opcua/opcua_transport_layer.h
index 4fc2a02817..71779fb525 100644
--- a/plugins/opcua/opcua_transport_layer.h
+++ b/plugins/opcua/opcua_transport_layer.h
@@ -22,11 +22,11 @@
******************************************************************************/
/* Transport Layer: message parsers */
-void parseHello(proto_tree *tree, tvbuff_t *tvb, gint *pOffset);
-void parseAcknowledge(proto_tree *tree, tvbuff_t *tvb, gint *pOffset);
-void parseError(proto_tree *tree, tvbuff_t *tvb, gint *pOffset);
-void parseMessage(proto_tree *tree, tvbuff_t *tvb, gint *pOffset);
-void parseOpenSecureChannel(proto_tree *tree, tvbuff_t *tvb, gint *pOffset);
-void parseCloseSecureChannel(proto_tree *tree, tvbuff_t *tvb, gint *pOffset);
-void registerTransportLayerTypes(int proto);
+int parseHello(proto_tree *tree, tvbuff_t *tvb, gint *pOffset);
+int parseAcknowledge(proto_tree *tree, tvbuff_t *tvb, gint *pOffset);
+int parseError(proto_tree *tree, tvbuff_t *tvb, gint *pOffset);
+int parseMessage(proto_tree *tree, tvbuff_t *tvb, gint *pOffset);
+int parseOpenSecureChannel(proto_tree *tree, tvbuff_t *tvb, gint *pOffset);
+int parseCloseSecureChannel(proto_tree *tree, tvbuff_t *tvb, gint *pOffset);
+int registerTransportLayerTypes(int proto);