diff options
author | Bill Meier <wmeier@newsguy.com> | 2008-10-25 20:24:31 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2008-10-25 20:24:31 +0000 |
commit | 05c1929f1d51ef94a5827147aee61d2320434783 (patch) | |
tree | 3e6cc68f2dc569fe027498b7deb3d0574cd99c09 /plugins/opcua/opcua.c | |
parent | 94c73a47c9e361b6eeeecf53e9b600f9cf1b77a9 (diff) | |
download | wireshark-05c1929f1d51ef94a5827147aee61d2320434783.tar.gz |
proto_register/proto_reg_handoff; Various small cleanup and bug-fixing
remove unnecessary #include prefs.f and emem.h in a few cases...
svn path=/trunk/; revision=26554
Diffstat (limited to 'plugins/opcua/opcua.c')
-rw-r--r-- | plugins/opcua/opcua.c | 34 |
1 files changed, 9 insertions, 25 deletions
diff --git a/plugins/opcua/opcua.c b/plugins/opcua/opcua.c index 55a2b472d5..0742b5137e 100644 --- a/plugins/opcua/opcua.c +++ b/plugins/opcua/opcua.c @@ -27,9 +27,7 @@ #include <glib.h> #include <epan/packet.h> -#include <epan/emem.h> #include <epan/dissectors/packet-tcp.h> -#include <epan/prefs.h> #include "opcua_transport_layer.h" #include "opcua_security_layer.h" #include "opcua_application_layer.h" @@ -40,8 +38,6 @@ #include "opcua_hfindeces.h" /* forward reference */ -void proto_register_opcua (void); -void proto_reg_handoff_opcua (void); 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); @@ -50,8 +46,7 @@ typedef void (*FctParse)(proto_tree *tree, tvbuff_t *tvb, gint *pOffset); static int proto_opcua = -1; /** Official IANA registered port for OPC UA Binary Protocol. */ -static int global_opcua_port = 4840; -static dissector_handle_t opcua_handle; +#define OPCUA_PORT 4840 /** subtree types */ gint ett_opcua_transport = -1; @@ -100,18 +95,11 @@ static gint *ett[] = */ void proto_register_opcua(void) { - module_t *opcua_module; - - if (proto_opcua == -1) - { - proto_opcua = proto_register_protocol( - "OpcUa Binary Protocol", /* name */ - "OpcUa", /* short name */ - "opcua" /* abbrev */ - ); - } - opcua_module = prefs_register_protocol(proto_opcua, proto_reg_handoff_opcua); - + proto_opcua = proto_register_protocol( + "OpcUa Binary Protocol", /* name */ + "OpcUa", /* short name */ + "opcua" /* abbrev */ + ); registerTransportLayerTypes(proto_opcua); registerSecurityLayerTypes(proto_opcua); registerApplicationLayerTypes(proto_opcua); @@ -129,13 +117,9 @@ void proto_register_opcua(void) */ void proto_reg_handoff_opcua(void) { - static int Initialized=FALSE; - - if (!Initialized) - { - opcua_handle = create_dissector_handle(dissect_opcua, proto_opcua); - dissector_add("tcp.port", global_opcua_port, opcua_handle); - } + dissector_handle_t opcua_handle; + opcua_handle = create_dissector_handle(dissect_opcua, proto_opcua); + dissector_add("tcp.port", OPCUA_PORT, opcua_handle); } /** header length that is needed to compute |