aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/opcua
diff options
context:
space:
mode:
authorUlf Lamping <ulf.lamping@web.de>2007-05-16 08:13:11 +0000
committerUlf Lamping <ulf.lamping@web.de>2007-05-16 08:13:11 +0000
commit872f29e29355ee7bd25648e507d89a6e08d46f0d (patch)
tree599ce83a9c1d8f5b4b9128ed71b1bf291aa6346e /plugins/opcua
parent2c0a60004644841332c6d844e44dd40cb64b4e46 (diff)
from Gerhard Gappmeier (ULFL: only slightly changed the unused prevention):
I updated the files for the build process to fit the current wireshark version. I don't know much about it so a just copied the missing parts from another module. I'm not sure of it's right, so please have a look at it. Modifications: * added plugin.rc.in * added moduleinfo.nmake * updated Makefile.am/nmake/common * removed unused variable from opcua_application_layer.c * fixed unused parameter warning in opcua.c I tested it on Windows with VC6 and on Gentoo linux with gcc 3.4.6. svn path=/trunk/; revision=21802
Diffstat (limited to 'plugins/opcua')
-rw-r--r--plugins/opcua/Makefile.am10
-rw-r--r--plugins/opcua/Makefile.common23
-rw-r--r--plugins/opcua/Makefile.nmake34
-rw-r--r--plugins/opcua/moduleinfo.nmake28
-rw-r--r--plugins/opcua/opcua.c3
-rw-r--r--plugins/opcua/opcua_application_layer.c5
-rw-r--r--plugins/opcua/opcua_complextypeparser.c17
-rw-r--r--plugins/opcua/opcua_security_layer.c2
-rw-r--r--plugins/opcua/plugin.rc.in34
9 files changed, 123 insertions, 33 deletions
diff --git a/plugins/opcua/Makefile.am b/plugins/opcua/Makefile.am
index bd10e17b83..fafb8bf8e2 100644
--- a/plugins/opcua/Makefile.am
+++ b/plugins/opcua/Makefile.am
@@ -27,6 +27,10 @@ INCLUDES = -I$(top_srcdir) -I$(includedir)
include Makefile.common
+if HAVE_WARNINGS_AS_ERRORS
+AM_CFLAGS = -Werror
+endif
+
plugindir = @plugindir@
plugin_LTLIBRARIES = opcua.la
@@ -34,6 +38,7 @@ opcua_la_SOURCES = \
plugin.c \
moduleinfo.h \
$(DISSECTOR_SRC) \
+ $(DISSECTOR_SUPPORT_SRC) \
$(DISSECTOR_INCLUDES)
opcua_la_LDFLAGS = -module -avoid-version
opcua_la_LIBADD = @PLUGIN_LIBS@
@@ -116,4 +121,7 @@ MAINTAINERCLEANFILES = \
EXTRA_DIST = \
Makefile.common \
- Makefile.nmake
+ Makefile.nmake \
+ moduleinfo.nmake \
+ plugin.rc.in \
+ README
diff --git a/plugins/opcua/Makefile.common b/plugins/opcua/Makefile.common
index 689f4807a2..6a5b0d9ecc 100644
--- a/plugins/opcua/Makefile.common
+++ b/plugins/opcua/Makefile.common
@@ -29,16 +29,7 @@ PLUGIN_NAME = opcua
# the dissector sources (without any helpers)
DISSECTOR_SRC = \
- opcua.c \
- opcua_transport_layer.c \
- opcua_security_layer.c \
- opcua_application_layer.c \
- opcua_serviceparser.c \
- opcua_complextypeparser.c \
- opcua_enumparser.c \
- opcua_simpletypes.c \
- opcua_servicetable.c \
- opcua_hfindeces.c
+ opcua.c
# corresponding headers
DISSECTOR_INCLUDES = \
@@ -51,3 +42,15 @@ DISSECTOR_INCLUDES = \
opcua_application_layer.h \
opcua_security_layer.h \
opcua_transport_layer.h
+
+# other sources
+DISSECTOR_SUPPORT_SRC = \
+ opcua_transport_layer.c \
+ opcua_security_layer.c \
+ opcua_application_layer.c \
+ opcua_serviceparser.c \
+ opcua_complextypeparser.c \
+ opcua_enumparser.c \
+ opcua_simpletypes.c \
+ opcua_servicetable.c \
+ opcua_hfindeces.c
diff --git a/plugins/opcua/Makefile.nmake b/plugins/opcua/Makefile.nmake
index daf998f2dc..c265b1cbc5 100644
--- a/plugins/opcua/Makefile.nmake
+++ b/plugins/opcua/Makefile.nmake
@@ -5,12 +5,11 @@
#
include ..\..\config.nmake
-
-############### no need to modify below this line #########
+include moduleinfo.nmake
include Makefile.common
-CFLAGS=/DHAVE_CONFIG_H /I../.. /I../../wiretap $(GLIB_CFLAGS) \
+CFLAGS=/WX /DHAVE_CONFIG_H /I../.. /I../../wiretap $(GLIB_CFLAGS) \
/I$(PCAP_DIR)\include -D_U_="" $(LOCAL_CFLAGS)
LDFLAGS = /NOLOGO /INCREMENTAL:no /MACHINE:I386 $(LOCAL_LDFLAGS)
@@ -21,12 +20,27 @@ CFLAGS=/DHAVE_WIN32_LIBWIRESHARK_LIB /D_NEED_VAR_IMPORT_ $(CFLAGS)
DISSECTOR_OBJECTS = $(DISSECTOR_SRC:.c=.obj)
-OBJECTS=$(DISSECTOR_OBJECTS) plugin.obj
+DISSECTOR_SUPPORT_OBJECTS = $(DISSECTOR_SUPPORT_SRC:.c=.obj)
+
+OBJECTS = $(DISSECTOR_OBJECTS) $(DISSECTOR_SUPPORT_OBJECTS) plugin.obj
+
+RESOURCE=$(PLUGIN_NAME).res
+
+all: $(PLUGIN_NAME).dll
-opcua.dll opcua.exp opcua.lib : $(OBJECTS) $(LINK_PLUGIN_WITH)
- link -dll /out:opcua.dll $(LDFLAGS) $(OBJECTS) $(LINK_PLUGIN_WITH) \
- $(GLIB_LIBS)
+$(PLUGIN_NAME).rc : moduleinfo.nmake
+ sed -e s/@PLUGIN_NAME@/$(PLUGIN_NAME)/ \
+ -e s/@RC_MODULE_VERSION@/$(RC_MODULE_VERSION)/ \
+ -e s/@RC_VERSION@/$(RC_VERSION)/ \
+ -e s/@MODULE_VERSION@/$(MODULE_VERSION)/ \
+ -e s/@PACKAGE@/$(PACKAGE)/ \
+ -e s/@VERSION@/$(VERSION)/ \
+ -e s/@MSVC_VARIANT@/$(MSVC_VARIANT)/ \
+ < plugin.rc.in > $@
+$(PLUGIN_NAME).dll $(PLUGIN_NAME).exp $(PLUGIN_NAME).lib : $(OBJECTS) $(LINK_PLUGIN_WITH) $(RESOURCE)
+ link -dll /out:$(PLUGIN_NAME).dll $(LDFLAGS) $(OBJECTS) $(LINK_PLUGIN_WITH) \
+ $(GLIB_LIBS) $(RESOURCE)
#
# Build plugin.c, which contains the plugin version[] string, a
# function plugin_register() that calls the register routines for all
@@ -60,7 +74,7 @@ opcua.dll opcua.exp opcua.lib : $(OBJECTS) $(LINK_PLUGIN_WITH)
# a plugin.c file for a plugin.
# All subsequent arguments are the files to scan.
#
-plugin.c: $(DISSECTOR_SRC)
+plugin.c: $(DISSECTOR_SRC) ../../tools/make-dissector-reg.py ../../tools/make-dissector-reg
!IFDEF PYTHON
@echo Making plugin.c (using python)
@$(PYTHON) "../../tools/make-dissector-reg.py" . plugin $(DISSECTOR_SRC)
@@ -72,7 +86,9 @@ plugin.c: $(DISSECTOR_SRC)
!ENDIF
clean:
- rm -f $(OBJECTS) opcua.dll opcua.exp opcua.lib *.pdb
+ rm -f $(OBJECTS) $(RESOURCE) plugin.c *.pdb \
+ $(PLUGIN_NAME).dll $(PLUGIN_NAME).dll.manifest $(PLUGIN_NAME).lib \
+ $(PLUGIN_NAME).exp $(PLUGIN_NAME).rc
distclean: clean
diff --git a/plugins/opcua/moduleinfo.nmake b/plugins/opcua/moduleinfo.nmake
new file mode 100644
index 0000000000..c4b165ff9d
--- /dev/null
+++ b/plugins/opcua/moduleinfo.nmake
@@ -0,0 +1,28 @@
+#
+# $Id$
+#
+
+# The name
+PACKAGE=opcua
+
+# The version
+MODULE_VERSION_MAJOR=0
+MODULE_VERSION_MINOR=0
+MODULE_VERSION_MICRO=1
+MODULE_VERSION_EXTRA=0
+
+#
+# The RC_VERSION should be comma-separated, not dot-separated,
+# as per Graham Bloice's message in
+#
+# http://www.ethereal.com/lists/ethereal-dev/200303/msg00283.html
+#
+# "The RC_VERSION variable in config.nmake should be comma separated.
+# This allows the resources to be built correctly and the version
+# number to be correctly displayed in the explorer properties dialog
+# for the executables, and XP's tooltip, rather than 0.0.0.0."
+#
+
+MODULE_VERSION=$(MODULE_VERSION_MAJOR).$(MODULE_VERSION_MINOR).$(MODULE_VERSION_MICRO).$(MODULE_VERSION_EXTRA)
+RC_MODULE_VERSION=$(MODULE_VERSION_MAJOR),$(MODULE_VERSION_MINOR),$(MODULE_VERSION_MICRO),$(MODULE_VERSION_EXTRA)
+
diff --git a/plugins/opcua/opcua.c b/plugins/opcua/opcua.c
index 6f21594bd1..920a29862a 100644
--- a/plugins/opcua/opcua.c
+++ b/plugins/opcua/opcua.c
@@ -148,7 +148,7 @@ void proto_reg_handoff_opcua(void)
* This function reads the length information from
* the transport header.
*/
-static guint get_opcua_message_len(packet_info *pinfo, tvbuff_t *tvb, int offset)
+static guint get_opcua_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
{
gint32 plen;
@@ -254,3 +254,4 @@ static void dissect_opcua_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree
+
diff --git a/plugins/opcua/opcua_application_layer.c b/plugins/opcua/opcua_application_layer.c
index 0626cfb517..4f68cccded 100644
--- a/plugins/opcua/opcua_application_layer.c
+++ b/plugins/opcua/opcua_application_layer.c
@@ -75,7 +75,7 @@ void registerApplicationLayerTypes(int proto)
int parseServiceNodeId(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, char *szFieldName)
{
gint iOffset = *pOffset;
- guint8 EncodingMask, NSId = 0;
+ guint8 EncodingMask;
guint32 Numeric = 0;
szFieldName = 0; /* avoid warning */
@@ -92,7 +92,6 @@ int parseServiceNodeId(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, char *szF
iOffset+=1;
break;
case 0x01: /* four byte node id */
- NSId = tvb_get_guint8(tvb, iOffset);
proto_tree_add_item(tree, hf_opcua_app_nsid, tvb, iOffset, 1, TRUE);
iOffset+=1;
Numeric = tvb_get_letohs(tvb, iOffset);
@@ -100,7 +99,6 @@ int parseServiceNodeId(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, char *szF
iOffset+=2;
break;
case 0x02: /* numeric, that does not fit into four bytes */
- NSId = tvb_get_letohl(tvb, iOffset);
proto_tree_add_item(tree, hf_opcua_app_nsid, tvb, iOffset, 4, TRUE);
iOffset+=4;
Numeric = tvb_get_letohl(tvb, iOffset);
@@ -120,3 +118,4 @@ int parseServiceNodeId(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, char *szF
return Numeric;
}
+
diff --git a/plugins/opcua/opcua_complextypeparser.c b/plugins/opcua/opcua_complextypeparser.c
index cffedb312b..b1ee709af7 100644
--- a/plugins/opcua/opcua_complextypeparser.c
+++ b/plugins/opcua/opcua_complextypeparser.c
@@ -294,11 +294,11 @@ void parseEndpointConfiguration(proto_tree *tree, tvbuff_t *tvb, gint *pOffset,
}
gint ett_opcua_UserIdentityToken = -1;
-void parseUserIdentityToken(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, char *szFieldName)
+void parseUserIdentityToken(proto_tree *tree, tvbuff_t *tvb, gint *pOffset _U_, char *szFieldName)
{
proto_item *ti = proto_tree_add_text(tree, tvb, 0, -1, "%s : UserIdentityToken", szFieldName);
proto_tree *subtree = proto_item_add_subtree(ti, ett_opcua_UserIdentityToken);
-
+ subtree = 0;
}
gint ett_opcua_UserNameIdentityToken = -1;
@@ -1155,11 +1155,11 @@ void parseContentFilter(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, char *sz
}
gint ett_opcua_FilterOperand = -1;
-void parseFilterOperand(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, char *szFieldName)
+void parseFilterOperand(proto_tree *tree, tvbuff_t *tvb, gint *pOffset _U_, char *szFieldName)
{
proto_item *ti = proto_tree_add_text(tree, tvb, 0, -1, "%s : FilterOperand", szFieldName);
proto_tree *subtree = proto_item_add_subtree(ti, ett_opcua_FilterOperand);
-
+ subtree = 0;
}
gint ett_opcua_ElementOperand = -1;
@@ -1269,11 +1269,11 @@ void parseHistoryReadResult(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, char
}
gint ett_opcua_MonitoringFilter = -1;
-void parseMonitoringFilter(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, char *szFieldName)
+void parseMonitoringFilter(proto_tree *tree, tvbuff_t *tvb, gint *pOffset _U_, char *szFieldName)
{
proto_item *ti = proto_tree_add_text(tree, tvb, 0, -1, "%s : MonitoringFilter", szFieldName);
proto_tree *subtree = proto_item_add_subtree(ti, ett_opcua_MonitoringFilter);
-
+ subtree = 0;
}
gint ett_opcua_EventFilter = -1;
@@ -1485,11 +1485,11 @@ void parseDataChangeFilter(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, char
}
gint ett_opcua_MonitoringFilterResult = -1;
-void parseMonitoringFilterResult(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, char *szFieldName)
+void parseMonitoringFilterResult(proto_tree *tree, tvbuff_t *tvb, gint *pOffset _U_, char *szFieldName)
{
proto_item *ti = proto_tree_add_text(tree, tvb, 0, -1, "%s : MonitoringFilterResult", szFieldName);
proto_tree *subtree = proto_item_add_subtree(ti, ett_opcua_MonitoringFilterResult);
-
+ subtree = 0;
}
gint ett_opcua_EventFilterResult = -1;
@@ -1747,3 +1747,4 @@ void registerComplexTypes()
proto_register_subtree_array(ett, array_length(ett));
}
+
diff --git a/plugins/opcua/opcua_security_layer.c b/plugins/opcua/opcua_security_layer.c
index 61d97e5c40..fc19dc57f6 100644
--- a/plugins/opcua/opcua_security_layer.c
+++ b/plugins/opcua/opcua_security_layer.c
@@ -38,7 +38,6 @@ static const value_string g_SecSigTable[] = {
{ 3, "Message" },
{ 0, NULL }
};
-static int hf_opcua_SecuritySigEnum = -1;
static int hf_opcua_security_sig = -1;
static int hf_opcua_security_policy = -1;
@@ -97,3 +96,4 @@ void parseSecurityLayer(proto_tree *tree, tvbuff_t *tvb, gint *pOffset)
}
}
+
diff --git a/plugins/opcua/plugin.rc.in b/plugins/opcua/plugin.rc.in
new file mode 100644
index 0000000000..7e181a45d6
--- /dev/null
+++ b/plugins/opcua/plugin.rc.in
@@ -0,0 +1,34 @@
+#include "winver.h"
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION @RC_MODULE_VERSION@
+ PRODUCTVERSION @RC_VERSION@,0
+ FILEFLAGSMASK 0x0L
+#ifdef _DEBUG
+ FILEFLAGS VS_FF_PRERELEASE+VS_FF_DEBUG
+#else
+ FILEFLAGS VS_FF_PRERELEASE
+#endif
+ FILEOS VOS_NT_WINDOWS32
+ FILETYPE VFT_DLL
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "CompanyName", "The Wireshark developer community, http://www.wireshark.org/\0"
+ VALUE "FileDescription", "OPC Unified Architecture Dissector\0"
+ VALUE "FileVersion", "@MODULE_VERSION@\0"
+ VALUE "InternalName", "@PACKAGE@ @MODULE_VERSION@\0"
+ VALUE "LegalCopyright", "Copyright © 1998 Gerald Combs <gerald@wireshark.org>, Gilbert Ramirez <gram@alumni.rice.edu> and others\0"
+ VALUE "OriginalFilename", "@PLUGIN_NAME@.dll\0"
+ VALUE "ProductName", "Wireshark\0"
+ VALUE "ProductVersion", "@VERSION@\0"
+ VALUE "Comments", "Build with @MSVC_VARIANT@\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END