Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-hazelcast.c
blob78877d03b6e70c452962a5c233d700627323743c
1 /*
2 * packet-hazelcast.c
3 * dissector for hazelcast wire protocol
4 * Paul Erkkila <paul.erkkila@level3.com>
6 * Website: http://www.hazelcast.com/
8 * reversed from this code:
9 * http://code.google.com/p/hazelcast/source/browse/branches/1.9.4/hazelcast/src/main/java/com/hazelcast/nio/Packet.java
11 * Wireshark - Network traffic analyzer
12 * By Gerald Combs <gerald@wireshark.org>
13 * Copyright 1998 Gerald Combs
15 * SPDX-License-Identifier: GPL-2.0-or-later
20 #include "config.h"
22 #include <epan/packet.h>
23 #include <epan/prefs.h>
24 #include <epan/tap.h>
25 #include "packet-tcp.h"
27 void proto_register_hazelcast(void);
28 void proto_reg_handoff_hazelcast(void);
30 static dissector_handle_t hazelcast_handle;
32 static int proto_hazelcast;
33 static int hazelcast_tap;
35 static int hf_hazelcast_headerLength;
36 static int hf_hazelcast_headerKeyLength;
37 static int hf_hazelcast_headerValueLength;
38 static int hf_hazelcast_headerVersion;
40 static int hf_hazelcast_operation;
41 static int hf_hazelcast_blockID;
42 static int hf_hazelcast_threadID;
43 static int hf_hazelcast_timeout;
44 static int hf_hazelcast_ttl;
45 static int hf_hazelcast_txnID;
46 static int hf_hazelcast_longValue;
47 static int hf_hazelcast_version;
48 static int hf_hazelcast_lockCount;
49 static int hf_hazelcast_lockAddrIP;
50 static int hf_hazelcast_lockAddrPort;
51 static int hf_hazelcast_callID;
52 static int hf_hazelcast_responseType;
53 static int hf_hazelcast_nameLength;
54 static int hf_hazelcast_name;
55 static int hf_hazelcast_indexCount;
56 static int hf_hazelcast_keyPartitionHash;
57 static int hf_hazelcast_valuePartitionHash;
58 static int hf_hazelcast_keys;
59 static int hf_hazelcast_values;
61 /* flags */
62 static int hf_hazelcast_flags;
64 #define HAZELCAST_LOCKCOUNT_FLAG (1 << 0)
65 #define HAZELCAST_TIMEOUT_FLAG (1 << 1)
66 #define HAZELCAST_TTL_FLAG (1 << 2)
67 #define HAZELCAST_TXN_FLAG (1 << 3)
68 #define HAZELCAST_LONGVALUE_FLAG (1 << 4)
69 #define HAZELCAST_VERSION_FLAG (1 << 5)
70 #define HAZELCAST_CLIENT_FLAG (1 << 6)
71 #define HAZELCAST_LOCKADDRNULL_FLAG (1 << 7)
73 static int hf_hazelcast_flags_lockCount;
74 static int hf_hazelcast_flags_timeout;
75 static int hf_hazelcast_flags_ttl;
76 static int hf_hazelcast_flags_txn;
77 static int hf_hazelcast_flags_longValue;
78 static int hf_hazelcast_flags_version;
79 static int hf_hazelcast_flags_client;
80 static int hf_hazelcast_flags_lockAddrNull;
83 static int ett_hazelcast;
84 static int ett_hazelcast_flags;
86 /* prefs */
87 static bool hazelcast_desegment = true;
88 #define HAZELCAST_PORT 5701 /* Not IANA registered */
90 static const value_string operationTypes[] = {
91 {0, "NONE"},
92 {1, "RESPONSE"},
93 {2, "LOG"},
94 {3, "HEARTBEAT"},
95 {4, "JOIN_CHECK"},
96 {5, "REMOTELY_PROCESS"},
97 {6, "REMOTELY_PROCESS_AND_RESPOND"},
98 {7, "REMOTELY_CALLABLE_BOOLEAN"},
99 {8, "REMOTELY_CALLABLE_OBJECT"},
100 {9, "EVENT"},
101 {10, "EXECUTE"},
102 {11, "CANCEL_EXECUTION"},
103 {12, "ADD_LISTENER"},
104 {13, "ADD_LISTENER_NO_RESPONSE"},
105 {14, "REMOVE_LISTENER"},
106 {15, "BLOCKING_ADD_KEY"},
107 {16, "BLOCKING_REMOVE_KEY"},
108 {17, "BLOCKING_OFFER_KEY"},
109 {18, "BLOCKING_GENERATE_KEY"},
110 {19, "BLOCKING_ITERATE"},
111 {20, "BLOCKING_SIZE"},
112 {21, "BLOCKING_TAKE_KEY"},
113 {22, "BLOCKING_CANCEL_TAKE_KEY"},
114 {23, "BLOCKING_SET"},
115 {24, "BLOCKING_PEEK_KEY"},
116 {25, "BLOCKING_GET_KEY_BY_INDEX"},
117 {26, "BLOCKING_GET_INDEX_BY_KEY"},
118 {27, "BLOCKING_QUEUE_POLL"},
119 {28, "BLOCKING_QUEUE_OFFER"},
120 {29, "BLOCKING_QUEUE_SIZE"},
121 {30, "BLOCKING_QUEUE_PEEK"},
122 {31, "BLOCKING_QUEUE_REMOVE"},
123 {32, "TOPIC_PUBLISH"},
124 {33, "ATOMIC_NUMBER_ADD_AND_GET"},
125 {34, "ATOMIC_NUMBER_GET_AND_ADD"},
126 {35, "ATOMIC_NUMBER_GET_AND_SET"},
127 {36, "ATOMIC_NUMBER_COMPARE_AND_SET"},
128 {37, "CONCURRENT_MAP_PUT"},
129 {38, "CONCURRENT_MAP_PUT_ALL"},
130 {39, "CONCURRENT_MAP_PUT_TRANSIENT"},
131 {40, "CONCURRENT_MAP_SET"},
132 {41, "CONCURRENT_MAP_MERGE"},
133 {42, "CONCURRENT_MAP_ASYNC_MERGE"},
134 {43, "CONCURRENT_MAP_WAN_MERGE"},
135 {44, "CONCURRENT_MAP_TRY_PUT"},
136 {45, "CONCURRENT_MAP_PUT_AND_UNLOCK"},
137 {46, "CONCURRENT_MAP_GET"},
138 {47, "CONCURRENT_MAP_GET_ALL"},
139 {48, "CONCURRENT_MAP_REMOVE"},
140 {49, "CONCURRENT_MAP_TRY_REMOVE"},
141 {50, "CONCURRENT_MAP_REMOVE_ITEM"},
142 {51, "CONCURRENT_MAP_GET_MAP_ENTRY"},
143 {52, "CONCURRENT_MAP_GET_DATA_RECORD_ENTRY"},
144 {53, "CONCURRENT_MAP_BLOCK_INFO"},
145 {54, "CONCURRENT_MAP_BLOCK_MIGRATION_CHECK"},
146 {55, "CONCURRENT_MAP_SIZE"},
147 {56, "CONCURRENT_MAP_CONTAINS_KEY"},
148 {57, "CONCURRENT_MAP_CONTAINS_ENTRY"},
149 {58, "CONCURRENT_MAP_ITERATE_ENTRIES"},
150 {59, "CONCURRENT_MAP_ITERATE_KEYS"},
151 {60, "CONCURRENT_MAP_ITERATE_KEYS_ALL"},
152 {61, "CONCURRENT_MAP_ITERATE_VALUES"},
153 {62, "CONCURRENT_MAP_LOCK"},
154 {63, "CONCURRENT_MAP_LOCK_MAP"},
155 {64, "CONCURRENT_MAP_UNLOCK"},
156 {65, "CONCURRENT_MAP_FORCE_UNLOCK"},
157 {66, "CONCURRENT_MAP_UNLOCK_MAP"},
158 {67, "CONCURRENT_MAP_BLOCKS"},
159 {68, "CONCURRENT_MAP_CONTAINS_VALUE"},
160 {69, "CONCURRENT_MAP_PUT_IF_ABSENT"},
161 {70, "CONCURRENT_MAP_REMOVE_IF_SAME"},
162 {71, "CONCURRENT_MAP_REPLACE_IF_NOT_NULL"},
163 {72, "CONCURRENT_MAP_REPLACE_IF_SAME"},
164 {73, "CONCURRENT_MAP_TRY_LOCK_AND_GET"},
165 {74, "CONCURRENT_MAP_ADD_TO_LIST"},
166 {75, "CONCURRENT_MAP_ADD_TO_SET"},
167 {76, "CONCURRENT_MAP_MIGRATE_RECORD"},
168 {77, "CONCURRENT_MAP_PUT_MULTI"},
169 {78, "CONCURRENT_MAP_REMOVE_MULTI"},
170 {79, "CONCURRENT_MAP_VALUE_COUNT"},
171 {80, "CONCURRENT_MAP_BACKUP_PUT"},
172 {81, "CONCURRENT_MAP_BACKUP_REMOVE"},
173 {82, "CONCURRENT_MAP_BACKUP_REMOVE_MULTI"},
174 {83, "CONCURRENT_MAP_BACKUP_LOCK"},
175 {84, "CONCURRENT_MAP_BACKUP_ADD"},
176 {85, "CONCURRENT_MAP_INVALIDATE"},
177 {86, "CONCURRENT_MAP_EVICT"},
178 {87, "CONCURRENT_MAP_FLUSH"},
179 {88, "TRANSACTION_BEGIN"},
180 {89, "TRANSACTION_COMMIT"},
181 {90, "TRANSACTION_ROLLBACK"},
182 {91, "DESTROY"},
183 {92, "GET_ID"},
184 {93, "NEW_ID"},
185 {94, "ADD_INDEX"},
186 {95, "GET_INSTANCES"},
187 {96, "GET_MEMBERS"},
188 {97, "GET_CLUSTER_TIME"},
189 {98, "CLIENT_AUTHENTICATE"},
190 {99, "CLIENT_ADD_INSTANCE_LISTENER"},
191 {100, "CLIENT_GET_PARTITIONS"},
192 {101, "BLOCKING_QUEUE_REMAINING_CAPACITY"},
193 {102, "BLOCKING_QUEUE_ENTRIES"},
194 {103, "COUNT_DOWN_LATCH_AWAIT"},
195 {104, "COUNT_DOWN_LATCH_COUNT_DOWN"},
196 {105, "COUNT_DOWN_LATCH_DESTROY"},
197 {106, "COUNT_DOWN_LATCH_GET_COUNT"},
198 {107, "COUNT_DOWN_LATCH_GET_OWNER"},
199 {108, "COUNT_DOWN_LATCH_SET_COUNT"},
200 {109, "SEMAPHORE_ATTACH_DETACH_PERMITS"},
201 {110, "SEMAPHORE_CANCEL_ACQUIRE"},
202 {111, "SEMAPHORE_DESTROY"},
203 {112, "SEMAPHORE_DRAIN_PERMITS"},
204 {113, "SEMAPHORE_GET_ATTACHED_PERMITS"},
205 {114, "SEMAPHORE_GET_AVAILABLE_PERMITS"},
206 {115, "SEMAPHORE_REDUCE_PERMITS"},
207 {116, "SEMAPHORE_RELEASE"},
208 {117, "SEMAPHORE_TRY_ACQUIRE"},
209 {118, "LOCK_LOCK"},
210 {119, "LOCK_UNLOCK"},
211 {120, "LOCK_FORCE_UNLOCK"},
212 {0 , NULL}
214 static value_string_ext operationTypes_ext = VALUE_STRING_EXT_INIT(operationTypes);
216 static const value_string responseTypes[] = {
217 {2, "RESPONSE_NONE"},
218 {3, "RESPONSE_SUCCESS"},
219 {4, "RESPONSE_FAILURE"},
220 {5, "RESPONSE_REDO"},
221 {0, NULL}
223 static value_string_ext responseTypes_ext = VALUE_STRING_EXT_INIT(responseTypes);
228 /* Get the length of a single HAZELCAST message */
229 static unsigned get_hazelcast_message_len(packet_info *pinfo _U_, tvbuff_t *tvb,
230 int offset, void *data _U_)
233 unsigned messageLength;
234 unsigned headerKeyLength;
235 unsigned headerValueLength;
237 messageLength = tvb_get_ntohl(tvb, offset);
239 headerKeyLength = tvb_get_ntohl(tvb, offset+4);
241 headerValueLength = tvb_get_ntohl(tvb, offset+8);
244 * * That length doesn't include the length of the header itself add that in.
246 return messageLength + headerKeyLength + headerValueLength + 13;
250 static int dissect_hazelcast_message(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_) {
252 uint8_t version;
254 uint8_t flags;
255 uint8_t operation;
257 uint8_t lockCountFlag;
258 uint8_t timeoutFlag;
259 uint8_t ttlFlag;
260 uint8_t txnFlag;
261 uint8_t longValueFlag;
262 uint8_t versionFlag;
263 uint8_t lockAddrNullFlag;
265 uint32_t nameLength;
266 uint32_t keyLength;
267 uint32_t valueLength;
268 int offset = 0;
270 proto_tree *hcast_tree = NULL;
271 proto_tree *flag_tree = NULL;
273 proto_item *tf = NULL;
275 /* Make entries in Protocol column and Info column on summary display */
276 col_set_str(pinfo->cinfo, COL_PROTOCOL, "HAZELCAST");
277 col_set_str(pinfo->cinfo, COL_INFO, "Hazelcast distributed object goodness");
279 if (tree) {
281 proto_item *ti;
282 ti = proto_tree_add_item(tree, proto_hazelcast, tvb, 0, -1, ENC_NA);
284 hcast_tree = proto_item_add_subtree(ti, ett_hazelcast);
286 if (tvb_captured_length_remaining(tvb, 0) < 13) {
287 col_set_str(pinfo->cinfo, COL_INFO, "Hazelcast too short");
288 return 0;
291 version = tvb_get_uint8(tvb, 12);
292 if ( version != 6 ) {
293 col_set_str(pinfo->cinfo, COL_INFO, "Hazelcast unsupported version");
294 return 12;
297 proto_tree_add_item(hcast_tree, hf_hazelcast_headerLength, tvb, offset, 4, ENC_BIG_ENDIAN);
298 offset += 4;
299 proto_tree_add_item(hcast_tree, hf_hazelcast_headerKeyLength, tvb, offset, 4, ENC_BIG_ENDIAN);
300 keyLength = tvb_get_ntohl(tvb, offset);
301 offset += 4;
302 proto_tree_add_item(hcast_tree, hf_hazelcast_headerValueLength, tvb, offset, 4, ENC_BIG_ENDIAN);
303 valueLength = tvb_get_ntohl(tvb, offset);
304 offset += 4;
305 proto_tree_add_item(hcast_tree, hf_hazelcast_headerVersion, tvb, offset, 1, ENC_BIG_ENDIAN);
306 offset += 1;
309 proto_tree_add_item(hcast_tree, hf_hazelcast_operation, tvb, offset, 1, ENC_BIG_ENDIAN);
310 operation = tvb_get_uint8(tvb, offset);
311 col_add_str(pinfo->cinfo, COL_INFO, val_to_str(operation, operationTypes, "Unknown (0x%02x)"));
312 offset += 1;
314 proto_tree_add_item(hcast_tree, hf_hazelcast_blockID, tvb, offset, 4, ENC_BIG_ENDIAN);
315 offset += 4;
316 proto_tree_add_item(hcast_tree, hf_hazelcast_threadID, tvb, offset, 4, ENC_BIG_ENDIAN);
317 offset += 4;
319 flags = tvb_get_uint8(tvb, offset);
321 tf = proto_tree_add_item(hcast_tree, hf_hazelcast_flags, tvb, offset, 1, ENC_BIG_ENDIAN);
323 flag_tree = proto_item_add_subtree(tf, ett_hazelcast_flags);
325 proto_tree_add_item(flag_tree, hf_hazelcast_flags_lockCount, tvb, offset, 1, ENC_BIG_ENDIAN);
326 proto_tree_add_item(flag_tree, hf_hazelcast_flags_timeout, tvb, offset, 1, ENC_BIG_ENDIAN);
327 proto_tree_add_item(flag_tree, hf_hazelcast_flags_ttl, tvb, offset, 1, ENC_BIG_ENDIAN);
328 proto_tree_add_item(flag_tree, hf_hazelcast_flags_txn, tvb, offset, 1, ENC_BIG_ENDIAN);
329 proto_tree_add_item(flag_tree, hf_hazelcast_flags_longValue, tvb, offset, 1, ENC_BIG_ENDIAN);
330 proto_tree_add_item(flag_tree, hf_hazelcast_flags_version, tvb, offset, 1, ENC_BIG_ENDIAN);
331 proto_tree_add_item(flag_tree, hf_hazelcast_flags_client, tvb, offset, 1, ENC_BIG_ENDIAN);
332 proto_tree_add_item(flag_tree, hf_hazelcast_flags_lockAddrNull, tvb, offset, 1, ENC_BIG_ENDIAN);
335 lockCountFlag = flags & HAZELCAST_LOCKCOUNT_FLAG;
336 timeoutFlag = flags & HAZELCAST_TIMEOUT_FLAG;
337 ttlFlag = flags & HAZELCAST_TTL_FLAG;
338 txnFlag = flags & HAZELCAST_TXN_FLAG;
339 longValueFlag = flags & HAZELCAST_LONGVALUE_FLAG;
340 versionFlag = flags & HAZELCAST_VERSION_FLAG;
341 lockAddrNullFlag = flags & HAZELCAST_LOCKADDRNULL_FLAG;
343 offset += 1;
346 if ( lockCountFlag ) {
347 proto_tree_add_item(hcast_tree, hf_hazelcast_lockCount, tvb, offset, 4, ENC_BIG_ENDIAN);
348 offset += 4;
351 if ( timeoutFlag ) {
352 proto_tree_add_item(hcast_tree, hf_hazelcast_timeout, tvb, offset, 8, ENC_BIG_ENDIAN);
353 offset += 8;
356 if ( ttlFlag ) {
357 proto_tree_add_item(hcast_tree, hf_hazelcast_ttl, tvb, offset, 8, ENC_BIG_ENDIAN);
358 offset += 8;
361 if ( txnFlag ) {
362 proto_tree_add_item(hcast_tree, hf_hazelcast_txnID, tvb, offset, 8, ENC_BIG_ENDIAN);
363 offset += 8;
366 if ( longValueFlag ) {
367 proto_tree_add_item(hcast_tree, hf_hazelcast_longValue, tvb, offset, 8, ENC_BIG_ENDIAN);
368 offset += 8;
371 if ( versionFlag ) {
372 proto_tree_add_item(hcast_tree, hf_hazelcast_version, tvb, offset, 8, ENC_BIG_ENDIAN);
373 offset += 8;
376 if ( lockAddrNullFlag == 0 ) {
377 proto_tree_add_item(hcast_tree, hf_hazelcast_lockAddrIP, tvb, offset, 4, ENC_BIG_ENDIAN);
378 offset += 4;
379 proto_tree_add_item(hcast_tree, hf_hazelcast_lockAddrPort, tvb, offset, 4, ENC_BIG_ENDIAN);
380 offset += 4;
383 proto_tree_add_item(hcast_tree, hf_hazelcast_callID, tvb, offset, 8, ENC_BIG_ENDIAN);
384 offset += 8;
386 proto_tree_add_item(hcast_tree, hf_hazelcast_responseType, tvb, offset, 1, ENC_BIG_ENDIAN);
387 offset += 1;
389 proto_tree_add_item(hcast_tree, hf_hazelcast_nameLength, tvb, offset, 4, ENC_BIG_ENDIAN);
390 nameLength = tvb_get_ntohl(tvb, offset);
391 offset += 4;
393 if ( nameLength > 0 ) {
394 proto_tree_add_item(hcast_tree, hf_hazelcast_name, tvb, offset, nameLength, ENC_ASCII);
395 offset += nameLength;
398 proto_tree_add_item(hcast_tree, hf_hazelcast_indexCount, tvb, offset, 1, ENC_BIG_ENDIAN);
399 offset += 1;
401 proto_tree_add_item(hcast_tree, hf_hazelcast_keyPartitionHash, tvb, offset, 4, ENC_BIG_ENDIAN);
402 offset += 4;
404 proto_tree_add_item(hcast_tree, hf_hazelcast_valuePartitionHash, tvb, offset, 4, ENC_BIG_ENDIAN);
405 offset += 4;
407 if ( keyLength > 0 ) {
408 proto_tree_add_item(hcast_tree, hf_hazelcast_keys, tvb, offset, keyLength, ENC_NA);
409 offset += keyLength;
412 if ( valueLength > 0 ) {
413 proto_tree_add_item(hcast_tree, hf_hazelcast_values, tvb, offset, valueLength, ENC_NA);
414 /*offset += valueLength;*/
417 return tvb_captured_length(tvb);
421 * Code to actually dissect the packets
423 * this really just works in TCP reassembly and calls the real dissector
426 static int dissect_hazelcast(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) {
428 tcp_dissect_pdus(tvb, pinfo, tree, hazelcast_desegment, 13, get_hazelcast_message_len, dissect_hazelcast_message, data);
429 return tvb_captured_length(tvb);
432 void proto_register_hazelcast(void) {
434 static hf_register_info hf[] = {
436 { &hf_hazelcast_headerLength,
437 { "Hazelcast hdr length", "hazelcast.hdr.length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }
439 { &hf_hazelcast_headerKeyLength,
440 { "Hazelcast hdr key length", "hazelcast.hdr.keylength", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }
442 { &hf_hazelcast_headerValueLength,
443 { "Hazelcast hdr value length", "hazelcast.hdr.valuelength", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }
445 { &hf_hazelcast_headerVersion,
446 { "Hazelcast hdr version", "hazelcast.hdr.version", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
448 { &hf_hazelcast_operation,
449 { "Hazelcast operation", "hazelcast.operation", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &operationTypes_ext, 0x0, NULL, HFILL }
451 { &hf_hazelcast_blockID,
452 { "Hazelcast blockID", "hazelcast.blockID", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }
454 { &hf_hazelcast_threadID,
455 { "Hazelcast threadID", "hazelcast.threadID", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }
457 { &hf_hazelcast_flags,
458 { "hazelcast flags", "hazelcast.flags", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }
460 { &hf_hazelcast_flags_lockCount,
461 { "hazelcast lockCount flag", "hazelcast.flags.lockCount", FT_BOOLEAN, 8, NULL, HAZELCAST_LOCKCOUNT_FLAG, NULL, HFILL }
463 { &hf_hazelcast_flags_timeout,
464 { "hazelcast timeout flag", "hazelcast.flags.timeout", FT_BOOLEAN, 8, NULL, HAZELCAST_TIMEOUT_FLAG, NULL, HFILL }
466 { &hf_hazelcast_flags_ttl,
467 { "hazelcast ttl flag", "hazelcast.flags.ttl", FT_BOOLEAN, 8, NULL, HAZELCAST_TTL_FLAG, NULL, HFILL }
469 { &hf_hazelcast_flags_txn,
470 { "hazelcast txn flag", "hazelcast.flags.txn", FT_BOOLEAN, 8, NULL, HAZELCAST_TXN_FLAG, NULL, HFILL }
472 { &hf_hazelcast_flags_longValue,
473 { "hazelcast longValue flag", "hazelcast.flags.longValue", FT_BOOLEAN, 8, NULL, HAZELCAST_LONGVALUE_FLAG, NULL, HFILL }
475 { &hf_hazelcast_flags_version,
476 { "hazelcast version flag", "hazelcast.flags.version", FT_BOOLEAN, 8, NULL, HAZELCAST_VERSION_FLAG, NULL, HFILL }
478 { &hf_hazelcast_flags_client,
479 { "hazelcast client flag", "hazelcast.flags.client", FT_BOOLEAN, 8, NULL, HAZELCAST_CLIENT_FLAG, NULL, HFILL }
481 { &hf_hazelcast_flags_lockAddrNull,
482 { "hazelcast lockAddrNull flag", "hazelcast.flags.lockAddrNull", FT_BOOLEAN, 8, NULL, HAZELCAST_LOCKADDRNULL_FLAG, NULL, HFILL }
484 { &hf_hazelcast_timeout,
485 { "hazelcast timeout", "hazelcast.timeout", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }
487 { &hf_hazelcast_ttl,
488 { "hazelcast ttl", "hazelcast.ttl", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }
490 { &hf_hazelcast_longValue,
491 { "hazelcast longValue", "hazelcast.longValue", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }
493 { &hf_hazelcast_txnID,
494 { "hazelcast txnID", "hazelcast.txnID", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }
496 { &hf_hazelcast_version,
497 { "hazelcast version", "hazelcast.version", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }
499 { &hf_hazelcast_lockCount,
500 { "hazelcast lockCount", "hazelcast.lockCount", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }
502 { &hf_hazelcast_lockAddrIP,
503 { "hazelcast lock address IP", "hazelcast.lockaddr.ip", FT_IPv4, BASE_NONE, NULL, 0x0, "lockAddrIP", HFILL }
505 { &hf_hazelcast_lockAddrPort,
506 { "hazelcast lock address Port", "hazelcast.lockaddr.port", FT_UINT32, BASE_DEC, NULL, 0x0, "lockAddrPort", HFILL }
508 { &hf_hazelcast_callID,
509 { "hazelcast callID", "hazelcast.callID", FT_INT64, BASE_DEC, NULL, 0x0, NULL, HFILL }
511 { &hf_hazelcast_responseType,
512 { "hazelcast response type", "hazelcast.responseType", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &responseTypes_ext, 0x0, NULL, HFILL }
514 { &hf_hazelcast_nameLength,
515 { "hazelcast name length", "hazelcast.nameLength", FT_UINT32, BASE_DEC, NULL, 0x0, "nameLength", HFILL }
517 { &hf_hazelcast_name,
518 { "hazelcast name", "hazelcast.name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }
520 { &hf_hazelcast_indexCount,
521 { "hazelcast indexCount", "hazelcast.indexCount", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
523 { &hf_hazelcast_keyPartitionHash,
524 { "hazelcast keyPartitionHash", "hazelcast.keyPartitionHash", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }
526 { &hf_hazelcast_valuePartitionHash,
527 { "hazelcast valuePartitionHash", "hazelcast.valuePartitionHash", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }
529 { &hf_hazelcast_keys,
530 { "hazelcast keys", "hazelcast.keys", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }
532 { &hf_hazelcast_values,
533 { "hazelcast values", "hazelcast.values", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }
538 /* Setup protocol subtree array */
539 static int *ett[] = {
540 &ett_hazelcast,
541 &ett_hazelcast_flags
544 module_t *hazelcast_module;
547 proto_hazelcast = proto_register_protocol (
548 "Hazelcast Wire Protocol", /* name */
549 "HAZELCAST", /* short name */
550 "hzlcst" /* abbrev */
553 proto_register_field_array(proto_hazelcast, hf, array_length(hf));
554 proto_register_subtree_array(ett, array_length(ett));
556 hazelcast_module = prefs_register_protocol(proto_hazelcast, NULL);
558 prefs_register_bool_preference(hazelcast_module, "desegment",
559 "Reassemble hazelcast messages spanning multiple TCP segments",
560 "Whether the hazel dissector should reassemble messages spanning multiple TCP segments."
561 " To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
562 &hazelcast_desegment);
564 hazelcast_tap = register_tap("hzlcst");
566 hazelcast_handle = register_dissector("hzlcst", dissect_hazelcast, proto_hazelcast);
570 void
571 proto_reg_handoff_hazelcast(void) {
572 dissector_add_uint_with_preference("tcp.port", HAZELCAST_PORT, hazelcast_handle);
576 * Editor modelines - https://www.wireshark.org/tools/modelines.html
578 * Local variables:
579 * c-basic-offset: 4
580 * tab-width: 8
581 * indent-tabs-mode: nil
582 * End:
584 * vi: set shiftwidth=4 tabstop=8 expandtab:
585 * :indentSize=4:tabSize=8:noTabs=true: