aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-hazelcast.c
diff options
context:
space:
mode:
authorChris Maynard <Christopher.Maynard@GTECH.COM>2012-09-18 18:20:02 +0000
committerChris Maynard <Christopher.Maynard@GTECH.COM>2012-09-18 18:20:02 +0000
commit183cbe9af124b405aed43403ebc84cb8e89ee6f9 (patch)
treeaa24fde77f66dc2f90d68cf1522d6d42ff407a11 /epan/dissectors/packet-hazelcast.c
parentf870e83fb367bcd3967d4509f0832d830ab279b3 (diff)
Fix up proto_reg_handoff_hazelcast(), setting "initialized" to TRUE once initialized and also avoiding duplicate "tcp.port" registration.
svn path=/trunk/; revision=44977
Diffstat (limited to 'epan/dissectors/packet-hazelcast.c')
-rw-r--r--epan/dissectors/packet-hazelcast.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/epan/dissectors/packet-hazelcast.c b/epan/dissectors/packet-hazelcast.c
index 89f388603f..a4cfa977ae 100644
--- a/epan/dissectors/packet-hazelcast.c
+++ b/epan/dissectors/packet-hazelcast.c
@@ -75,8 +75,8 @@ static int hf_hazelcast_flags = -1;
#define HAZELCAST_LOCKCOUNT_FLAG (1 << 0)
#define HAZELCAST_TIMEOUT_FLAG (1 << 1)
-#define HAZELCAST_TTL_FLAG (1 << 2)
-#define HAZELCAST_TXN_FLAG (1 << 3)
+#define HAZELCAST_TTL_FLAG (1 << 2)
+#define HAZELCAST_TXN_FLAG (1 << 3)
#define HAZELCAST_LONGVALUE_FLAG (1 << 4)
#define HAZELCAST_VERSION_FLAG (1 << 5)
#define HAZELCAST_CLIENT_FLAG (1 << 6)
@@ -242,7 +242,7 @@ static value_string_ext responseTypes_ext = VALUE_STRING_EXT_INIT(responseTypes)
/*
- * Code to actually dissect the packets
+ * Code to actually dissect the packets
*
* this really just works in TCP reassembly and calls the real dissector
*
@@ -580,7 +580,7 @@ void proto_register_hazelcast(void) {
prefs_register_uint_preference(hazelcast_module, "tcp.port",
"Hazelcast TCP Port",
" Hazelcast TCP port if other than the default",
- 10,
+ 10,
&gPORT_PREF);
hazelcast_tap = register_tap("hzlcst");
@@ -588,26 +588,21 @@ void proto_register_hazelcast(void) {
}
-void proto_reg_handoff_hazelcast(void) {
-
+void
+proto_reg_handoff_hazelcast(void) {
static gboolean initialized = FALSE;
static dissector_handle_t hazelcast_handle;
static int currentPort;
- if ( !initialized) {
-
+ if (!initialized) {
hazelcast_handle = create_dissector_handle(dissect_hazelcast, proto_hazelcast);
- dissector_add_uint("tcp.port", currentPort, hazelcast_handle);
-
+ initialized = TRUE;
} else {
-
dissector_delete_uint("tcp.port", currentPort, hazelcast_handle);
-
}
currentPort = gPORT_PREF;
dissector_add_uint("tcp.port", currentPort, hazelcast_handle);
-
}
/*