1 /* packet-gluster_glusterd.c
2 * Routines for Gluster Daemon Management dissection
3 * Copyright 2012, Niels de Vos <ndevos@redhat.com>
4 * With contributions from:
5 * Shreedhara LG <shreedharlg@gmail.com>
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * SPDX-License-Identifier: GPL-2.0-or-later
14 * References to source files point in general to the glusterfs sources.
15 * There is currently no RFC or other document where the protocol is
16 * completely described. The glusterfs sources can be found at:
17 * - https://github.com/gluster/glusterfs
19 * The coding-style is roughly the same as the one use in the Linux kernel,
20 * see http://www.kernel.org/doc/Documentation/CodingStyle.
25 #include <epan/packet.h>
27 #include "packet-rpc.h"
28 #include "packet-gluster.h"
30 void proto_register_gluster_gd_mgmt(void);
31 void proto_reg_handoff_gluster_gd_mgmt(void);
33 /* Initialize the protocol and registered fields */
34 static int proto_glusterd
;
35 static int proto_gd_mgmt
;
36 static int proto_gd_brick
;
37 static int proto_gd_friend
;
39 /* programs and procedures */
40 static int hf_gd_mgmt_proc
;
41 static int hf_gd_mgmt_2_proc
;
42 static int hf_gd_mgmt_3_proc
;
43 static int hf_gd_mgmt_brick_2_proc
;
44 static int hf_glusterd_friend_proc
;
46 /* fields used by multiple programs/procedures */
47 static int hf_glusterd_dict
;
48 static int hf_glusterd_op
;
49 static int hf_glusterd_op_ret
;
50 static int hf_glusterd_op_errstr
;
51 static int hf_glusterd_uuid
;
52 static int hf_glusterd_tnx_id
;
53 static int hf_glusterd_hostname
;
54 static int hf_glusterd_port
;
55 static int hf_glusterd_vols
;
56 static int hf_glusterd_buf
;
57 static int hf_glusterd_name
;
59 /* Initialize the subtree pointers */
60 static int ett_gd_mgmt
;
61 static int ett_gd_brick
;
62 static int ett_gd_friend
;
64 /* the UUID is the same as a GlusterFS GFID, except it's encoded per byte */
66 gluster_gd_mgmt_dissect_uuid(tvbuff_t
*tvb
, proto_tree
*tree
, int hfindex
,
71 int start_offset
= offset
;
73 uuid
.data1
= (tvb_get_ntohl(tvb
, offset
) & 0xff) << 24 |
74 (tvb_get_ntohl(tvb
, offset
+4) & 0xff) << 16 |
75 (tvb_get_ntohl(tvb
, offset
+8) & 0xff) << 8 |
76 (tvb_get_ntohl(tvb
, offset
+12) & 0xff);
78 uuid
.data2
= (tvb_get_ntohl(tvb
, offset
) & 0xff) << 8 |
79 (tvb_get_ntohl(tvb
, offset
+4) & 0xff);
81 uuid
.data3
= (tvb_get_ntohl(tvb
, offset
) & 0xff) << 8 |
82 (tvb_get_ntohl(tvb
, offset
+4) & 0xff);
84 uuid
.data4
[0] = tvb_get_ntohl(tvb
, offset
);
86 uuid
.data4
[1] = tvb_get_ntohl(tvb
, offset
);
88 uuid
.data4
[2] = tvb_get_ntohl(tvb
, offset
);
90 uuid
.data4
[3] = tvb_get_ntohl(tvb
, offset
);
92 uuid
.data4
[4] = tvb_get_ntohl(tvb
, offset
);
94 uuid
.data4
[5] = tvb_get_ntohl(tvb
, offset
);
96 uuid
.data4
[6] = tvb_get_ntohl(tvb
, offset
);
98 uuid
.data4
[7] = tvb_get_ntohl(tvb
, offset
);
100 proto_tree_add_guid(tree
, hfindex
, tvb
, start_offset
, 4*16, &uuid
);
108 gluster_gd_mgmt_probe_reply(tvbuff_t
*tvb
, packet_info
*pinfo
,
109 proto_tree
*tree
, void* data
)
113 offset
= gluster_gd_mgmt_dissect_uuid(tvb
, tree
, hf_glusterd_uuid
,
115 offset
= dissect_rpc_string(tvb
, tree
, hf_glusterd_hostname
, offset
,
117 offset
= dissect_rpc_uint32(tvb
, tree
, hf_glusterd_port
, offset
);
118 offset
= gluster_dissect_common_reply(tvb
, offset
, pinfo
, tree
, data
);
124 gluster_gd_mgmt_probe_call(tvbuff_t
*tvb
, packet_info
*pinfo _U_
,
125 proto_tree
*tree
, void* data _U_
)
128 offset
= gluster_gd_mgmt_dissect_uuid(tvb
, tree
, hf_glusterd_uuid
,
130 offset
= dissect_rpc_string(tvb
, tree
, hf_glusterd_hostname
, offset
,
132 offset
= dissect_rpc_uint32(tvb
, tree
, hf_glusterd_port
, offset
);
138 gluster_gd_mgmt_friend_add_reply(tvbuff_t
*tvb
,
139 packet_info
*pinfo
, proto_tree
*tree
, void* data
)
143 offset
= gluster_gd_mgmt_dissect_uuid(tvb
, tree
, hf_glusterd_uuid
,
145 offset
= dissect_rpc_string(tvb
, tree
, hf_glusterd_hostname
, offset
,
147 offset
= gluster_dissect_common_reply(tvb
, offset
, pinfo
, tree
, data
);
148 offset
= dissect_rpc_uint32(tvb
, tree
, hf_glusterd_port
, offset
);
154 gluster_gd_mgmt_friend_add_call(tvbuff_t
*tvb
,
155 packet_info
*pinfo _U_
, proto_tree
*tree
, void* data _U_
)
159 offset
= gluster_gd_mgmt_dissect_uuid(tvb
, tree
, hf_glusterd_uuid
,
161 offset
= dissect_rpc_string(tvb
, tree
, hf_glusterd_hostname
, offset
,
163 offset
= dissect_rpc_uint32(tvb
, tree
, hf_glusterd_port
, offset
);
164 offset
= gluster_rpc_dissect_dict(tree
, tvb
, hf_glusterd_vols
, offset
);
169 /* gluster_gd_mgmt_cluster_lock_reply is used for LOCK and UNLOCK */
171 gluster_gd_mgmt_cluster_lock_reply(tvbuff_t
*tvb
,
172 packet_info
*pinfo
, proto_tree
*tree
, void* data
)
176 offset
= gluster_gd_mgmt_dissect_uuid(tvb
, tree
, hf_glusterd_uuid
,
178 offset
= gluster_dissect_common_reply(tvb
, offset
, pinfo
, tree
, data
);
183 /* gluster_gd_mgmt_cluster_lock_call is used for LOCK and UNLOCK */
185 gluster_gd_mgmt_cluster_lock_call(tvbuff_t
*tvb
,
186 packet_info
*pinfo _U_
, proto_tree
*tree
, void* data _U_
)
188 return gluster_gd_mgmt_dissect_uuid(tvb
, tree
, hf_glusterd_uuid
, 0);
192 gluster_gd_mgmt_stage_op_reply(tvbuff_t
*tvb
, packet_info
*pinfo
,
193 proto_tree
*tree
, void* data
)
196 offset
= gluster_gd_mgmt_dissect_uuid(tvb
, tree
, hf_glusterd_uuid
,
198 offset
= gluster_dissect_common_reply(tvb
, offset
, pinfo
, tree
, data
);
199 offset
= dissect_rpc_string(tvb
, tree
, hf_glusterd_op_errstr
, offset
,
201 offset
= gluster_rpc_dissect_dict(tree
, tvb
, hf_glusterd_dict
, offset
);
206 gluster_gd_mgmt_stage_op_call(tvbuff_t
*tvb
,
207 packet_info
*pinfo _U_
, proto_tree
*tree
, void* data _U_
)
210 offset
= gluster_gd_mgmt_dissect_uuid(tvb
, tree
, hf_glusterd_uuid
,
212 offset
= dissect_rpc_uint32(tvb
, tree
, hf_glusterd_op
, offset
);
213 offset
= gluster_rpc_dissect_dict(tree
, tvb
, hf_glusterd_dict
, offset
);
219 gluster_gd_mgmt_commit_op_reply(tvbuff_t
*tvb
, packet_info
*pinfo
,
220 proto_tree
*tree
, void* data
)
223 offset
= gluster_gd_mgmt_dissect_uuid(tvb
, tree
, hf_glusterd_uuid
,
225 offset
= gluster_dissect_common_reply(tvb
, offset
, pinfo
, tree
, data
);
226 offset
= gluster_rpc_dissect_dict(tree
, tvb
, hf_glusterd_buf
, offset
);
227 offset
= dissect_rpc_string(tvb
, tree
, hf_glusterd_op_errstr
, offset
,
233 gluster_gd_mgmt_commit_op_call(tvbuff_t
*tvb
,
234 packet_info
*pinfo _U_
, proto_tree
*tree
, void* data _U_
)
237 offset
= gluster_gd_mgmt_dissect_uuid(tvb
, tree
, hf_glusterd_uuid
,
239 offset
= dissect_rpc_uint32(tvb
, tree
, hf_glusterd_op
, offset
);
240 offset
= gluster_rpc_dissect_dict(tree
, tvb
, hf_glusterd_buf
,
247 gluster_gd_mgmt_friend_update_reply(tvbuff_t
*tvb
,
248 packet_info
*pinfo
, proto_tree
*tree
, void* data
)
251 offset
= gluster_gd_mgmt_dissect_uuid(tvb
, tree
, hf_glusterd_uuid
,
253 offset
= dissect_rpc_uint32(tvb
, tree
, hf_glusterd_op
, offset
);
254 offset
= gluster_dissect_common_reply(tvb
, offset
, pinfo
, tree
, data
);
260 gluster_gd_mgmt_friend_update_call(tvbuff_t
*tvb
,
261 packet_info
*pinfo _U_
, proto_tree
*tree
, void* data _U_
)
264 offset
= gluster_gd_mgmt_dissect_uuid(tvb
, tree
, hf_glusterd_uuid
,
266 offset
= gluster_rpc_dissect_dict(tree
, tvb
, hf_glusterd_vols
,
268 offset
= dissect_rpc_uint32(tvb
, tree
, hf_glusterd_port
, offset
);
273 /* Below procedure is used for version 2 */
275 glusterd_mgmt_2_cluster_lock_reply(tvbuff_t
*tvb
,
276 packet_info
*pinfo
, proto_tree
*tree
, void* data
)
279 offset
= gluster_gd_mgmt_dissect_uuid(tvb
, tree
, hf_glusterd_uuid
,
281 offset
= gluster_dissect_common_reply(tvb
, offset
, pinfo
, tree
, data
);
286 /* glusterd__mgmt_2_cluster_lock_call is used for LOCK and UNLOCK */
288 glusterd_mgmt_2_cluster_lock_call(tvbuff_t
*tvb
,
289 packet_info
*pinfo _U_
, proto_tree
*tree
, void* data _U_
)
291 return gluster_gd_mgmt_dissect_uuid(tvb
, tree
, hf_glusterd_uuid
, 0);
295 glusterd_mgmt_2_stage_op_reply(tvbuff_t
*tvb
, packet_info
*pinfo
,
296 proto_tree
*tree
, void* data
)
299 offset
= gluster_gd_mgmt_dissect_uuid(tvb
, tree
, hf_glusterd_uuid
,
301 offset
= dissect_rpc_uint32(tvb
, tree
, hf_glusterd_op
, offset
);
302 offset
= gluster_dissect_common_reply(tvb
, offset
, pinfo
, tree
, data
);
303 offset
= dissect_rpc_string(tvb
, tree
, hf_glusterd_op_errstr
, offset
,
305 offset
= gluster_rpc_dissect_dict(tree
, tvb
, hf_glusterd_dict
, offset
);
311 glusterd_mgmt_2_stage_op_call(tvbuff_t
*tvb
,
312 packet_info
*pinfo _U_
, proto_tree
*tree
, void* data _U_
)
315 offset
= gluster_gd_mgmt_dissect_uuid(tvb
, tree
, hf_glusterd_uuid
,
317 offset
= dissect_rpc_uint32(tvb
, tree
, hf_glusterd_op
, offset
);
318 offset
= gluster_rpc_dissect_dict(tree
, tvb
, hf_glusterd_dict
, offset
);
324 glusterd_mgmt_2_commit_op_reply(tvbuff_t
*tvb
, packet_info
*pinfo
,
325 proto_tree
*tree
, void* data
)
328 offset
= gluster_gd_mgmt_dissect_uuid(tvb
, tree
, hf_glusterd_uuid
,
330 offset
= dissect_rpc_uint32(tvb
, tree
, hf_glusterd_op
, offset
);
331 offset
= gluster_dissect_common_reply(tvb
, offset
, pinfo
, tree
, data
);
332 offset
= gluster_rpc_dissect_dict(tree
, tvb
, hf_glusterd_buf
, offset
);
333 offset
= dissect_rpc_string(tvb
, tree
, hf_glusterd_op_errstr
, offset
,
340 glusterd_mgmt_2_commit_op_call(tvbuff_t
*tvb
,
341 packet_info
*pinfo _U_
, proto_tree
*tree
, void* data _U_
)
344 offset
= gluster_gd_mgmt_dissect_uuid(tvb
, tree
, hf_glusterd_uuid
,
346 offset
= dissect_rpc_uint32(tvb
, tree
, hf_glusterd_op
, offset
);
347 offset
= gluster_rpc_dissect_dict(tree
, tvb
, hf_glusterd_buf
, offset
);
352 /* glusterd_mgmt_3_lock_call is used for LOCK and UNLOCK */
354 glusterd_mgmt_3_lock_call(tvbuff_t
*tvb
, packet_info
*pinfo _U_
,
355 proto_tree
*tree
, void* data _U_
)
358 offset
= gluster_gd_mgmt_dissect_uuid(tvb
, tree
, hf_glusterd_uuid
,
360 offset
= gluster_gd_mgmt_dissect_uuid(tvb
, tree
, hf_glusterd_tnx_id
,
362 offset
= dissect_rpc_uint32(tvb
, tree
, hf_glusterd_op
, offset
);
363 offset
= gluster_rpc_dissect_dict(tree
, tvb
, hf_glusterd_dict
, offset
);
369 glusterd_mgmt_3_lock_reply(tvbuff_t
*tvb
, packet_info
*pinfo
,
370 proto_tree
*tree
, void* data
)
373 offset
= gluster_gd_mgmt_dissect_uuid(tvb
, tree
, hf_glusterd_uuid
,
375 offset
= gluster_gd_mgmt_dissect_uuid(tvb
, tree
, hf_glusterd_tnx_id
,
377 offset
= gluster_rpc_dissect_dict(tree
, tvb
, hf_glusterd_dict
, offset
);
378 offset
= gluster_dissect_common_reply(tvb
, offset
, pinfo
, tree
, data
);
383 glusterd_mgmt_3_pre_val_call(tvbuff_t
*tvb
,
384 packet_info
*pinfo _U_
, proto_tree
*tree
, void* data _U_
)
387 offset
= gluster_gd_mgmt_dissect_uuid(tvb
, tree
, hf_glusterd_uuid
,
389 offset
= dissect_rpc_uint32(tvb
, tree
, hf_glusterd_op
, offset
);
390 offset
= gluster_rpc_dissect_dict(tree
, tvb
, hf_glusterd_dict
, offset
);
396 glusterd_mgmt_3_pre_val_reply(tvbuff_t
*tvb
, packet_info
*pinfo
,
397 proto_tree
*tree
, void* data
)
400 offset
= gluster_gd_mgmt_dissect_uuid(tvb
, tree
, hf_glusterd_uuid
,
402 offset
= dissect_rpc_uint32(tvb
, tree
, hf_glusterd_op
, offset
);
403 offset
= gluster_dissect_common_reply(tvb
, offset
, pinfo
, tree
, data
);
404 offset
= dissect_rpc_string(tvb
, tree
, hf_glusterd_op_errstr
, offset
,
406 offset
= gluster_rpc_dissect_dict(tree
, tvb
, hf_glusterd_dict
, offset
);
411 glusterd_mgmt_3_commit_reply(tvbuff_t
*tvb
, packet_info
*pinfo
,
412 proto_tree
*tree
, void* data
)
415 offset
= gluster_gd_mgmt_dissect_uuid(tvb
, tree
, hf_glusterd_uuid
,
417 offset
= dissect_rpc_uint32(tvb
, tree
, hf_glusterd_op
, offset
);
418 offset
= gluster_dissect_common_reply(tvb
, offset
, pinfo
, tree
, data
);
419 offset
= gluster_rpc_dissect_dict(tree
, tvb
, hf_glusterd_dict
, offset
);
420 offset
= dissect_rpc_string(tvb
, tree
, hf_glusterd_op_errstr
, offset
,
426 glusterd_mgmt_3_post_val_call(tvbuff_t
*tvb
,
427 packet_info
*pinfo _U_
, proto_tree
*tree
, void* data _U_
)
430 offset
= gluster_gd_mgmt_dissect_uuid(tvb
, tree
, hf_glusterd_uuid
,
432 offset
= dissect_rpc_uint32(tvb
, tree
, hf_glusterd_op
, offset
);
433 offset
= dissect_rpc_uint32(tvb
, tree
, hf_glusterd_op_ret
, offset
);
434 offset
= gluster_rpc_dissect_dict(tree
, tvb
, hf_glusterd_dict
, offset
);
440 /* Brick management common function */
443 glusterd_brick_2_common_reply(tvbuff_t
*tvb
, packet_info
*pinfo
,
444 proto_tree
*tree
, void* data
)
447 offset
= gluster_dissect_common_reply(tvb
, offset
, pinfo
, tree
, data
);
448 offset
= dissect_rpc_string(tvb
, tree
, hf_glusterd_op_errstr
, offset
,
450 offset
= gluster_rpc_dissect_dict(tree
, tvb
, hf_glusterd_dict
, offset
);
456 glusterd_brick_2_common_call(tvbuff_t
*tvb
,
457 packet_info
*pinfo _U_
, proto_tree
*tree
, void* data _U_
)
460 offset
= dissect_rpc_string(tvb
, tree
, hf_glusterd_name
, offset
,
462 offset
= dissect_rpc_uint32(tvb
, tree
, hf_glusterd_op
, offset
);
463 offset
= gluster_rpc_dissect_dict(tree
, tvb
, hf_glusterd_dict
, offset
);
470 * - xlators/mgmt/glusterd/src/glusterd-handler.c: "GlusterD svc mgmt"
471 * - xlators/mgmt/glusterd/src/glusterd-rpc-ops.c: "glusterd clnt mgmt"
473 static const vsff gd_mgmt_proc
[] = {
475 GD_MGMT_NULL
, "NULL",
476 dissect_rpc_void
, dissect_rpc_void
479 GD_MGMT_PROBE_QUERY
, "PROBE_QUERY",
480 gluster_gd_mgmt_probe_call
, gluster_gd_mgmt_probe_reply
483 GD_MGMT_FRIEND_ADD
, "FRIEND_ADD",
484 gluster_gd_mgmt_friend_add_call
,
485 gluster_gd_mgmt_friend_add_reply
488 GD_MGMT_CLUSTER_LOCK
, "CLUSTER_LOCK",
489 gluster_gd_mgmt_cluster_lock_call
,
490 gluster_gd_mgmt_cluster_lock_reply
493 GD_MGMT_CLUSTER_UNLOCK
, "CLUSTER_UNLOCK",
494 /* UNLOCK seems to be the same a LOCK, re-use the function */
495 gluster_gd_mgmt_cluster_lock_call
,
496 gluster_gd_mgmt_cluster_lock_reply
499 GD_MGMT_STAGE_OP
, "STAGE_OP",
500 gluster_gd_mgmt_stage_op_call
, gluster_gd_mgmt_stage_op_reply
503 GD_MGMT_COMMIT_OP
, "COMMIT_OP",
504 gluster_gd_mgmt_commit_op_call
, gluster_gd_mgmt_commit_op_reply
506 { GD_MGMT_FRIEND_REMOVE
, "FRIEND_REMOVE", dissect_rpc_unknown
, dissect_rpc_unknown
},
508 GD_MGMT_FRIEND_UPDATE
, "FRIEND_UPDATE",
509 gluster_gd_mgmt_friend_update_call
,
510 gluster_gd_mgmt_friend_update_reply
512 { GD_MGMT_CLI_PROBE
, "CLI_PROBE", dissect_rpc_unknown
, dissect_rpc_unknown
},
513 { GD_MGMT_CLI_DEPROBE
, "CLI_DEPROBE", dissect_rpc_unknown
, dissect_rpc_unknown
},
514 { GD_MGMT_CLI_LIST_FRIENDS
, "CLI_LIST_FRIENDS", dissect_rpc_unknown
, dissect_rpc_unknown
},
515 { GD_MGMT_CLI_CREATE_VOLUME
, "CLI_CREATE_VOLUME", dissect_rpc_unknown
, dissect_rpc_unknown
},
516 { GD_MGMT_CLI_GET_VOLUME
, "CLI_GET_VOLUME", dissect_rpc_unknown
, dissect_rpc_unknown
},
517 { GD_MGMT_CLI_DELETE_VOLUME
, "CLI_DELETE_VOLUME", dissect_rpc_unknown
, dissect_rpc_unknown
},
518 { GD_MGMT_CLI_START_VOLUME
, "CLI_START_VOLUME", dissect_rpc_unknown
, dissect_rpc_unknown
},
519 { GD_MGMT_CLI_STOP_VOLUME
, "CLI_STOP_VOLUME", dissect_rpc_unknown
, dissect_rpc_unknown
},
520 { GD_MGMT_CLI_RENAME_VOLUME
, "CLI_RENAME_VOLUME", dissect_rpc_unknown
, dissect_rpc_unknown
},
521 { GD_MGMT_CLI_DEFRAG_VOLUME
, "CLI_DEFRAG_VOLUME", dissect_rpc_unknown
, dissect_rpc_unknown
},
522 { GD_MGMT_CLI_SET_VOLUME
, "CLI_DEFRAG_VOLUME", dissect_rpc_unknown
, dissect_rpc_unknown
},
523 { GD_MGMT_CLI_ADD_BRICK
, "CLI_ADD_BRICK", dissect_rpc_unknown
, dissect_rpc_unknown
},
524 { GD_MGMT_CLI_REMOVE_BRICK
, "CLI_REMOVE_BRICK", dissect_rpc_unknown
, dissect_rpc_unknown
},
525 { GD_MGMT_CLI_REPLACE_BRICK
, "CLI_REPLACE_BRICK", dissect_rpc_unknown
, dissect_rpc_unknown
},
526 { GD_MGMT_CLI_LOG_FILENAME
, "CLI_LOG_FILENAME", dissect_rpc_unknown
, dissect_rpc_unknown
},
527 { GD_MGMT_CLI_LOG_LOCATE
, "CLI_LOG_LOCATE", dissect_rpc_unknown
, dissect_rpc_unknown
},
528 { GD_MGMT_CLI_LOG_ROTATE
, "CLI_LOG_ROTATE", dissect_rpc_unknown
, dissect_rpc_unknown
},
529 { GD_MGMT_CLI_SYNC_VOLUME
, "CLI_SYNC_VOLUME", dissect_rpc_unknown
, dissect_rpc_unknown
},
530 { GD_MGMT_CLI_RESET_VOLUME
, "CLI_RESET_VOLUME", dissect_rpc_unknown
, dissect_rpc_unknown
},
531 { GD_MGMT_CLI_FSM_LOG
, "CLI_FSM_LOG", dissect_rpc_unknown
, dissect_rpc_unknown
},
532 { GD_MGMT_CLI_GSYNC_SET
, "CLI_GSYNC_SET", dissect_rpc_unknown
, dissect_rpc_unknown
},
533 { GD_MGMT_CLI_PROFILE_VOLUME
, "CLI_PROFILE_VOLUME", dissect_rpc_unknown
, dissect_rpc_unknown
},
534 { GD_MGMT_BRICK_OP
, "BRICK_OP", dissect_rpc_unknown
, dissect_rpc_unknown
},
535 { GD_MGMT_CLI_LOG_LEVEL
, "CLI_LOG_LEVEL", dissect_rpc_unknown
, dissect_rpc_unknown
},
536 { GD_MGMT_CLI_STATUS_VOLUME
, "CLI_STATUS_VOLUME", dissect_rpc_unknown
, dissect_rpc_unknown
},
537 { 0, NULL
, NULL
, NULL
}
540 static const vsff gd_mgmt_2_proc
[] = {
542 GLUSTERD_MGMT_2_NULL
, "NULL",
543 dissect_rpc_void
, dissect_rpc_void
546 GLUSTERD_MGMT_2_CLUSTER_LOCK
, "CLUSTER_LOCK",
547 glusterd_mgmt_2_cluster_lock_call
,
548 glusterd_mgmt_2_cluster_lock_reply
551 GLUSTERD_MGMT_2_CLUSTER_UNLOCK
, "CLUSTER_UNLOCK",
552 /* UNLOCK seems to be the same a LOCK, re-use the function */
553 glusterd_mgmt_2_cluster_lock_call
,
554 glusterd_mgmt_2_cluster_lock_reply
557 GLUSTERD_MGMT_2_STAGE_OP
, "STAGE_OP",
558 glusterd_mgmt_2_stage_op_call
, glusterd_mgmt_2_stage_op_reply
561 GLUSTERD_MGMT_2_COMMIT_OP
, "COMMIT_OP",
562 glusterd_mgmt_2_commit_op_call
, glusterd_mgmt_2_commit_op_reply
564 { 0, NULL
, NULL
, NULL
}
567 static const vsff gd_mgmt_3_proc
[] = {
569 GLUSTERD_MGMT_3_NULL
, "NULL",
570 dissect_rpc_void
, dissect_rpc_void
573 GLUSTERD_MGMT_3_LOCK
, "LOCK",
574 glusterd_mgmt_3_lock_call
,
575 glusterd_mgmt_3_lock_reply
578 GLUSTERD_MGMT_3_PRE_VALIDATE
, "PRE_VALIDATE",
579 glusterd_mgmt_3_pre_val_call
,
580 glusterd_mgmt_3_pre_val_reply
583 GLUSTERD_MGMT_3_BRICK_OP
, "BRICK_OP",
584 glusterd_mgmt_3_pre_val_call
,
585 glusterd_mgmt_3_pre_val_reply
588 GLUSTERD_MGMT_3_COMMIT
, "COMMIT",
589 glusterd_mgmt_3_pre_val_call
,
590 glusterd_mgmt_3_commit_reply
593 GLUSTERD_MGMT_3_POST_VALIDATE
, "POST_VALIDATE",
594 glusterd_mgmt_3_post_val_call
,
595 glusterd_mgmt_3_pre_val_reply
598 GLUSTERD_MGMT_3_UNLOCK
, "UNLOCK",
599 /* UNLOCK seems to be the same a LOCK, re-use the function */
600 glusterd_mgmt_3_lock_call
,
601 glusterd_mgmt_3_lock_reply
603 { 0, NULL
, NULL
, NULL
}
606 static const rpc_prog_vers_info glusterd_mgmt_vers_info
[] = {
607 { 1, gd_mgmt_proc
, &hf_gd_mgmt_proc
},
608 { 2, gd_mgmt_2_proc
, &hf_gd_mgmt_2_proc
},
609 { 3, gd_mgmt_3_proc
, &hf_gd_mgmt_3_proc
}
612 static const vsff gd_mgmt_brick_2_proc
[] = {
614 GLUSTERD_2_BRICK_NULL
, "NULL",
615 dissect_rpc_void
, dissect_rpc_void
618 GLUSTERD_2_BRICK_TERMINATE
, "TERMINATE",
619 glusterd_brick_2_common_call
, glusterd_brick_2_common_reply
622 GLUSTERD_2_BRICK_XLATOR_INFO
, "XLATOR_INFO",
623 glusterd_brick_2_common_call
, glusterd_brick_2_common_reply
626 GLUSTERD_2_BRICK_XLATOR_OP
, "XLATOR_OP" ,
627 glusterd_brick_2_common_call
, glusterd_brick_2_common_reply
630 GLUSTERD_2_BRICK_STATUS
, "STATUS",
631 glusterd_brick_2_common_call
, glusterd_brick_2_common_reply
634 GLUSTERD_2_BRICK_OP
, "OP",
635 glusterd_brick_2_common_call
, glusterd_brick_2_common_reply
638 GLUSTERD_2_BRICK_XLATOR_DEFRAG
, "XLATOR_DEFRAG",
639 glusterd_brick_2_common_call
, glusterd_brick_2_common_reply
642 GLUSTERD_2_NODE_PROFILE
, "NODE_PROFILE",
643 glusterd_brick_2_common_call
, glusterd_brick_2_common_reply
646 GLUSTERD_2_NODE_STATUS
, "NODE_STATUS",
647 glusterd_brick_2_common_call
, glusterd_brick_2_common_reply
649 { 0, NULL
, NULL
, NULL
}
652 static const rpc_prog_vers_info gd_mgmt_brick_vers_info
[] = {
653 { 2, gd_mgmt_brick_2_proc
, &hf_gd_mgmt_brick_2_proc
},
656 static const vsff glusterd_friend_proc
[] = {
657 { GLUSTERD_FRIEND_NULL
, "NULL" , dissect_rpc_void
, dissect_rpc_void
},
658 { GLUSTERD_PROBE_QUERY
, "PROBE_QUERY" , dissect_rpc_unknown
, dissect_rpc_unknown
},
659 { GLUSTERD_FRIEND_ADD
, "ADD" , dissect_rpc_unknown
, dissect_rpc_unknown
},
660 { GLUSTERD_FRIEND_REMOVE
, "REMOVE", dissect_rpc_unknown
, dissect_rpc_unknown
},
661 { GLUSTERD_FRIEND_UPDATE
, "UPDATE" , dissect_rpc_unknown
, dissect_rpc_unknown
},
662 { 0, NULL
, NULL
, NULL
}
665 static const rpc_prog_vers_info glusterd_friend_vers_info
[] = {
666 { 2, glusterd_friend_proc
, &hf_glusterd_friend_proc
},
669 static const value_string gd_mgmt_proc_vals
[] = {
670 { GD_MGMT_NULL
, "NULL" },
671 { GD_MGMT_PROBE_QUERY
, "PROBE_QUERY" },
672 { GD_MGMT_FRIEND_ADD
, "FRIEND_ADD" },
673 { GD_MGMT_CLUSTER_LOCK
, "CLUSTER_LOCK" },
674 { GD_MGMT_CLUSTER_UNLOCK
, "CLUSTER_UNLOCK" },
675 { GD_MGMT_STAGE_OP
, "STAGE_OP" },
676 { GD_MGMT_COMMIT_OP
, "COMMIT_OP" },
677 { GD_MGMT_FRIEND_REMOVE
, "FRIEND_REMOVE" },
678 { GD_MGMT_FRIEND_UPDATE
, "FRIEND_UPDATE" },
679 { GD_MGMT_CLI_PROBE
, "CLI_PROBE" },
680 { GD_MGMT_CLI_DEPROBE
, "CLI_DEPROBE" },
681 { GD_MGMT_CLI_LIST_FRIENDS
, "CLI_LIST_FRIENDS" },
682 { GD_MGMT_CLI_CREATE_VOLUME
, "CLI_CREATE_VOLUME" },
683 { GD_MGMT_CLI_GET_VOLUME
, "CLI_GET_VOLUME" },
684 { GD_MGMT_CLI_DELETE_VOLUME
, "CLI_DELETE_VOLUME" },
685 { GD_MGMT_CLI_START_VOLUME
, "CLI_START_VOLUME" },
686 { GD_MGMT_CLI_STOP_VOLUME
, "CLI_STOP_VOLUME" },
687 { GD_MGMT_CLI_RENAME_VOLUME
, "CLI_RENAME_VOLUME" },
688 { GD_MGMT_CLI_DEFRAG_VOLUME
, "CLI_DEFRAG_VOLUME" },
689 { GD_MGMT_CLI_SET_VOLUME
, "CLI_DEFRAG_VOLUME" },
690 { GD_MGMT_CLI_ADD_BRICK
, "CLI_ADD_BRICK" },
691 { GD_MGMT_CLI_REMOVE_BRICK
, "CLI_REMOVE_BRICK" },
692 { GD_MGMT_CLI_REPLACE_BRICK
, "CLI_REPLACE_BRICK" },
693 { GD_MGMT_CLI_LOG_FILENAME
, "CLI_LOG_FILENAME" },
694 { GD_MGMT_CLI_LOG_LOCATE
, "CLI_LOG_LOCATE" },
695 { GD_MGMT_CLI_LOG_ROTATE
, "CLI_LOG_ROTATE" },
696 { GD_MGMT_CLI_SYNC_VOLUME
, "CLI_SYNC_VOLUME" },
697 { GD_MGMT_CLI_RESET_VOLUME
, "CLI_RESET_VOLUME" },
698 { GD_MGMT_CLI_FSM_LOG
, "CLI_FSM_LOG" },
699 { GD_MGMT_CLI_GSYNC_SET
, "CLI_GSYNC_SET" },
700 { GD_MGMT_CLI_PROFILE_VOLUME
, "CLI_PROFILE_VOLUME" },
701 { GD_MGMT_BRICK_OP
, "BRICK_OP" },
702 { GD_MGMT_CLI_LOG_LEVEL
, "CLI_LOG_LEVEL" },
703 { GD_MGMT_CLI_STATUS_VOLUME
, "CLI_STATUS_VOLUME" },
706 static value_string_ext gd_mgmt_proc_vals_ext
= VALUE_STRING_EXT_INIT(gd_mgmt_proc_vals
);
708 static const value_string gd_mgmt_2_proc_vals
[] = {
709 { GLUSTERD_MGMT_2_NULL
, "NULL" },
710 { GLUSTERD_MGMT_2_CLUSTER_LOCK
, "CLUSTER_LOCK" },
711 { GLUSTERD_MGMT_2_CLUSTER_UNLOCK
, "CLUSTER_UNLOCK" },
712 { GLUSTERD_MGMT_2_STAGE_OP
, "STAGE_OP"},
713 { GLUSTERD_MGMT_2_COMMIT_OP
, "COMMIT_OP"},
716 static value_string_ext gd_mgmt_2_proc_vals_ext
= VALUE_STRING_EXT_INIT(gd_mgmt_2_proc_vals
);
718 static const value_string gd_mgmt_3_proc_vals
[] = {
719 { GLUSTERD_MGMT_3_NULL
, "NULL" },
720 { GLUSTERD_MGMT_3_LOCK
, "LOCK" },
721 { GLUSTERD_MGMT_3_UNLOCK
, "UNLOCK" },
724 static value_string_ext gd_mgmt_3_proc_vals_ext
= VALUE_STRING_EXT_INIT(gd_mgmt_3_proc_vals
);
726 static const value_string gd_mgmt_brick_2_proc_vals
[] = {
727 { GLUSTERD_2_BRICK_NULL
, "NULL" }, /* 0 */
728 { GLUSTERD_2_BRICK_TERMINATE
, "TERMINATE" },
729 { GLUSTERD_2_BRICK_XLATOR_INFO
, "XLATOR_INFO" },
730 { GLUSTERD_2_BRICK_XLATOR_OP
, "XLATOR_OP" },
731 { GLUSTERD_2_BRICK_STATUS
, "STATUS" },
732 { GLUSTERD_2_BRICK_OP
, "OP" },
733 { GLUSTERD_2_BRICK_XLATOR_DEFRAG
, "XLATOR_DEFRAG" },
734 { GLUSTERD_2_NODE_PROFILE
, "NODE_PROFILE" },
735 { GLUSTERD_2_NODE_STATUS
, "NODE_PROFILE" },
738 static value_string_ext gd_mgmt_brick_2_proc_vals_ext
= VALUE_STRING_EXT_INIT(gd_mgmt_brick_2_proc_vals
);
740 static const value_string glusterd_op_vals
[] = {
741 { GD_OP_NONE
, "NONE" },
742 { GD_OP_CREATE_VOLUME
, "CREATE_VOLUME" },
743 { GD_OP_START_BRICK
, "START_BRICK" },
744 { GD_OP_STOP_BRICK
, "STOP_BRICK" },
745 { GD_OP_DELETE_VOLUME
, "DELETE_VOLUME" },
746 { GD_OP_START_VOLUME
, "START_VOLUME" },
747 { GD_OP_STOP_VOLUME
, "STOP_VOLUME" },
748 { GD_OP_DEFRAG_VOLUME
, "DEFRAG_VOLUME" },
749 { GD_OP_ADD_BRICK
, "ADD_BRICK" },
750 { GD_OP_REMOVE_BRICK
, "REMOVE_BRICK" },
751 { GD_OP_REPLACE_BRICK
, "REPLACE_BRICK" },
752 { GD_OP_SET_VOLUME
, "SET_VOLUME" },
753 { GD_OP_RESET_VOLUME
, "RESET_VOLUME" },
754 { GD_OP_SYNC_VOLUME
, "SYNC_VOLUME" },
755 { GD_OP_LOG_ROTATE
, "LOG_ROTATE" },
756 { GD_OP_GSYNC_SET
, "GSYNC_SET" },
757 { GD_OP_PROFILE_VOLUME
, "PROFILE_VOLUME" },
758 { GD_OP_QUOTA
, "QUOTA" },
759 { GD_OP_STATUS_VOLUME
, "STATUS_VOLUME" },
760 { GD_OP_REBALANCE
, "REBALANCE" },
761 { GD_OP_HEAL_VOLUME
, "HEAL_VOLUME" },
762 { GD_OP_STATEDUMP_VOLUME
, "STATEDUMP_VOLUME" },
763 { GD_OP_LIST_VOLUME
, "LIST_VOLUME" },
764 { GD_OP_CLEARLOCKS_VOLUME
, "CLEARLOCKS_VOLUME" },
765 { GD_OP_DEFRAG_BRICK_VOLUME
, "DEFRAG_BRICK_VOLUME" },
766 { GD_OP_COPY_FILE
, "Copy File" },
767 { GD_OP_SYS_EXEC
, "Execute system commands" },
768 { GD_OP_GSYNC_CREATE
, "Geo-replication Create" },
769 { GD_OP_SNAP
, "Snapshot" },
772 static value_string_ext glusterd_op_vals_ext
= VALUE_STRING_EXT_INIT(glusterd_op_vals
);
774 static const value_string glusterd_friend_proc_vals
[] = {
775 { GLUSTERD_FRIEND_NULL
, "NULL" },
776 { GLUSTERD_PROBE_QUERY
, "PROBE_QUERY" },
777 { GLUSTERD_FRIEND_ADD
, "ADD" },
778 { GLUSTERD_FRIEND_REMOVE
, "REMOVE" },
779 { GLUSTERD_FRIEND_UPDATE
, "UPDATE" },
782 static value_string_ext glusterd_friend_proc_vals_ext
= VALUE_STRING_EXT_INIT(glusterd_friend_proc_vals
);
785 proto_register_gluster_gd_mgmt(void)
787 /* Setup list of header fields See Section 1.6.1 for details */
788 static hf_register_info hf
[] = {
791 { "Gluster Daemon Management", "glusterd.mgmt.proc",
792 FT_UINT32
, BASE_DEC
| BASE_EXT_STRING
, &gd_mgmt_proc_vals_ext
,
795 { &hf_gd_mgmt_2_proc
,
796 { "Gluster Daemon Management", "glusterd.mgmt.proc",
797 FT_UINT32
, BASE_DEC
| BASE_EXT_STRING
, &gd_mgmt_2_proc_vals_ext
,
800 { &hf_gd_mgmt_3_proc
,
801 { "Gluster Daemon Management", "glusterd.mgmt.proc",
802 FT_UINT32
, BASE_DEC
| BASE_EXT_STRING
, &gd_mgmt_3_proc_vals_ext
,
805 { &hf_gd_mgmt_brick_2_proc
,
806 { "Gluster Daemon Brick Operations",
807 "glusterd.brick.proc", FT_UINT32
, BASE_DEC
| BASE_EXT_STRING
,
808 &gd_mgmt_brick_2_proc_vals_ext
, 0, NULL
,
811 { &hf_glusterd_friend_proc
,
812 { "Gluster Daemon Friend Operations",
813 "glusterd.friend.proc", FT_UINT32
, BASE_DEC
| BASE_EXT_STRING
,
814 &glusterd_friend_proc_vals_ext
, 0, NULL
,
818 { "Dict", "glusterd.dict", FT_STRING
, BASE_NONE
,
819 NULL
, 0, NULL
, HFILL
}
822 { "Operation", "glusterd.op", FT_UINT32
, BASE_DEC
| BASE_EXT_STRING
,
823 &glusterd_op_vals_ext
, 0, NULL
, HFILL
}
825 { &hf_glusterd_op_ret
,
826 { "Return of previous operation", "glusterd.op_ret",
827 FT_UINT32
, BASE_DEC
, NULL
, 0, NULL
, HFILL
}
829 { &hf_glusterd_op_errstr
,
830 { "Error", "glusterd.op_errstr", FT_STRING
,
831 BASE_NONE
, NULL
, 0, NULL
, HFILL
}
834 { "UUID", "glusterd.uuid", FT_GUID
,
835 BASE_NONE
, NULL
, 0, NULL
, HFILL
}
837 { &hf_glusterd_tnx_id
,
838 { "Transaction ID", "glusterd.tnx_id", FT_GUID
,
839 BASE_NONE
, NULL
, 0, NULL
, HFILL
}
841 { &hf_glusterd_hostname
,
842 { "Hostname", "glusterd.hostname", FT_STRING
,
843 BASE_NONE
, NULL
, 0, NULL
, HFILL
}
846 { "Port", "glusterd.port", FT_INT32
, BASE_DEC
,
847 NULL
, 0, NULL
, HFILL
}
850 { "Volumes", "glusterd.vols", FT_STRING
, BASE_NONE
,
851 NULL
, 0, NULL
, HFILL
}
854 { "Buffer", "glusterd.buffer", FT_STRING
, BASE_NONE
,
855 NULL
, 0, NULL
, HFILL
}
858 { "Name", "glusterd.name", FT_STRING
, BASE_NONE
,
859 NULL
, 0, NULL
, HFILL
}
863 /* Setup protocol subtree array */
864 static int *ett
[] = {
870 /* Register the protocol name and description */
871 proto_glusterd
= proto_register_protocol("Gluster Daemon", "GlusterD", "glusterd");
872 proto_register_subtree_array(ett
, array_length(ett
));
873 proto_register_field_array(proto_glusterd
, hf
, array_length(hf
));
875 proto_gd_mgmt
= proto_register_protocol_in_name_only("Gluster Daemon Management",
876 "GlusterD Management", "glusterd.mgmt", proto_glusterd
, FT_PROTOCOL
);
877 proto_gd_brick
= proto_register_protocol_in_name_only(
878 "Gluster Daemon Brick Operations",
879 "GlusterD Brick", "glusterd.brick", proto_glusterd
, FT_PROTOCOL
);
880 proto_gd_friend
= proto_register_protocol_in_name_only(
881 "Gluster Daemon Friend Operations",
882 "GlusterD Friend", "glusterd.friend", proto_glusterd
, FT_PROTOCOL
);
886 proto_reg_handoff_gluster_gd_mgmt(void)
888 rpc_init_prog(proto_gd_mgmt
, GD_MGMT_PROGRAM
, ett_gd_mgmt
,
889 G_N_ELEMENTS(glusterd_mgmt_vers_info
), glusterd_mgmt_vers_info
);
891 rpc_init_prog(proto_gd_brick
, GD_BRICK_PROGRAM
, ett_gd_brick
,
892 G_N_ELEMENTS(gd_mgmt_brick_vers_info
), gd_mgmt_brick_vers_info
);
894 rpc_init_prog(proto_gd_friend
, GD_FRIEND_PROGRAM
, ett_gd_friend
,
895 G_N_ELEMENTS(glusterd_friend_vers_info
), glusterd_friend_vers_info
);
899 * Editor modelines - https://www.wireshark.org/tools/modelines.html
904 * indent-tabs-mode: t
907 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
908 * :indentSize=8:tabSize=8:noTabs=false: