2 * Header for gluster 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 * - http://git.gluster.com/?p=glusterfs.git
18 * - https://github.com/gluster/glusterfs
20 * The coding-style is roughly the same as the one use in the Linux kernel,
21 * see http://www.kernel.org/doc/Documentation/CodingStyle.
24 #ifndef __PACKET_GLUSTER_H__
25 #define __PACKET_GLUSTER_H__
27 #define GLUSTER_PORT 24007
29 /* most of this comes from rpc/rpc-lib/src/protocol-common.h
30 * Some versions are commented with a user-visible version, others are not.
31 * Some programs were introduced starting version 2.
33 * Older versions were removed from the sources.
34 * One patch that did this is at http://review.gluster.com/610
36 #define GLUSTERD1_MGMT_PROGRAM 1298433
37 /* only available in version 1 */
39 #define GLUSTERFS_PROGRAM 4867634 /* same as GD_BRICK_PROGRAM */
40 /* only available in version 1 (replaced by GD_BRICK_PROGRAM) */
42 /* rpc/rpc-lib/src/xdr-common.h */
43 #define GLUSTER_DUMP_PROGRAM 123451501
44 /* only available in version 1 */
46 #define GLUSTER_HNDSK_PROGRAM 14398633
47 /* only available in version 1 (0.0.1) */
49 #define GLUSTER_PMAP_PROGRAM 34123456
50 /* only available in version 1 */
52 #define GLUSTER_CBK_PROGRAM 52743234
53 /* only available in version 1 (0.0.1) */
55 #define GLUSTER3_1_FOP_PROGRAM 1298437
56 /* available in version 310 (3.1.0) */
58 #define GD_MGMT_PROGRAM 1238433
59 /* available in version 1, 2 and 3 */
61 #define GD_FRIEND_PROGRAM 1238437
62 /* only available in version 2 (0.0.2) */
64 #define GLUSTER_CLI_PROGRAM 1238463
65 /* available in version 1 (0.0.1) and 2 (0.0.2) */
67 #define GD_BRICK_PROGRAM 4867634
68 /* only available in version 2 (supersedes GLUSTERFS_PROGRAM) */
71 enum gf_mgmt_procnum
{
76 GD_MGMT_CLUSTER_UNLOCK
,
79 GD_MGMT_FRIEND_REMOVE
,
80 GD_MGMT_FRIEND_UPDATE
,
83 GD_MGMT_CLI_LIST_FRIENDS
,
84 GD_MGMT_CLI_CREATE_VOLUME
,
85 GD_MGMT_CLI_GET_VOLUME
,
86 GD_MGMT_CLI_DELETE_VOLUME
,
87 GD_MGMT_CLI_START_VOLUME
,
88 GD_MGMT_CLI_STOP_VOLUME
,
89 GD_MGMT_CLI_RENAME_VOLUME
,
90 GD_MGMT_CLI_DEFRAG_VOLUME
,
91 GD_MGMT_CLI_SET_VOLUME
,
92 GD_MGMT_CLI_ADD_BRICK
,
93 GD_MGMT_CLI_REMOVE_BRICK
,
94 GD_MGMT_CLI_REPLACE_BRICK
,
95 GD_MGMT_CLI_LOG_FILENAME
,
96 GD_MGMT_CLI_LOG_LOCATE
,
97 GD_MGMT_CLI_LOG_ROTATE
,
98 GD_MGMT_CLI_SYNC_VOLUME
,
99 GD_MGMT_CLI_RESET_VOLUME
,
101 GD_MGMT_CLI_GSYNC_SET
,
102 GD_MGMT_CLI_PROFILE_VOLUME
,
104 GD_MGMT_CLI_LOG_LEVEL
,
105 GD_MGMT_CLI_STATUS_VOLUME
,
109 /* GLUSTER_CLI_PROGRAM */
110 enum gluster_cli_procnum
{
111 GLUSTER_CLI_NULL
= 0,
114 GLUSTER_CLI_LIST_FRIENDS
,
115 GLUSTER_CLI_CREATE_VOLUME
,
116 GLUSTER_CLI_GET_VOLUME
,
117 GLUSTER_CLI_GET_NEXT_VOLUME
,
118 GLUSTER_CLI_DELETE_VOLUME
,
119 GLUSTER_CLI_START_VOLUME
,
120 GLUSTER_CLI_STOP_VOLUME
,
121 GLUSTER_CLI_RENAME_VOLUME
,
122 GLUSTER_CLI_DEFRAG_VOLUME
,
123 GLUSTER_CLI_SET_VOLUME
,
124 GLUSTER_CLI_ADD_BRICK
,
125 GLUSTER_CLI_REMOVE_BRICK
,
126 GLUSTER_CLI_REPLACE_BRICK
,
127 GLUSTER_CLI_LOG_FILENAME
,
128 GLUSTER_CLI_LOG_LOCATE
,
129 GLUSTER_CLI_LOG_ROTATE
,
131 GLUSTER_CLI_PMAP_PORTBYBRICK
,
132 GLUSTER_CLI_SYNC_VOLUME
,
133 GLUSTER_CLI_RESET_VOLUME
,
135 GLUSTER_CLI_GSYNC_SET
,
136 GLUSTER_CLI_PROFILE_VOLUME
,
138 GLUSTER_CLI_TOP_VOLUME
,
140 GLUSTER_CLI_LOG_LEVEL
,
141 GLUSTER_CLI_STATUS_VOLUME
,
144 GLUSTER_CLI_HEAL_VOLUME
,
145 GLUSTER_CLI_STATEDUMP_VOLUME
,
149 /* GLUSTER_CLI_PROGRAM 2 */
150 enum gluster_cli_2_procnum
{
151 GLUSTER_CLI_2_NULL
= 0, /* 0 */
153 GLUSTER_CLI_2_DEPROBE
,
154 GLUSTER_CLI_2_LIST_FRIENDS
,
155 GLUSTER_CLI_2_CREATE_VOLUME
,
156 GLUSTER_CLI_2_GET_VOLUME
,
157 GLUSTER_CLI_2_GET_NEXT_VOLUME
,
158 GLUSTER_CLI_2_DELETE_VOLUME
,
159 GLUSTER_CLI_2_START_VOLUME
,
160 GLUSTER_CLI_2_STOP_VOLUME
,
161 GLUSTER_CLI_2_RENAME_VOLUME
,
162 GLUSTER_CLI_2_DEFRAG_VOLUME
,
163 GLUSTER_CLI_2_SET_VOLUME
,
164 GLUSTER_CLI_2_ADD_BRICK
,
165 GLUSTER_CLI_2_REMOVE_BRICK
,
166 GLUSTER_CLI_2_REPLACE_BRICK
,
167 GLUSTER_CLI_2_LOG_ROTATE
,
168 GLUSTER_CLI_2_GETSPEC
,
169 GLUSTER_CLI_2_PMAP_PORTBYBRICK
,
170 GLUSTER_CLI_2_SYNC_VOLUME
,
171 GLUSTER_CLI_2_RESET_VOLUME
,
172 GLUSTER_CLI_2_FSM_LOG
,
173 GLUSTER_CLI_2_GSYNC_SET
,
174 GLUSTER_CLI_2_PROFILE_VOLUME
,
176 GLUSTER_CLI_2_TOP_VOLUME
,
178 GLUSTER_CLI_2_STATUS_VOLUME
,
179 GLUSTER_CLI_2_STATUS_ALL
,
181 GLUSTER_CLI_2_UMOUNT
,
182 GLUSTER_CLI_2_HEAL_VOLUME
,
183 GLUSTER_CLI_2_STATEDUMP_VOLUME
,
184 GLUSTER_CLI_2_LIST_VOLUME
,
185 GLUSTER_CLI_2_CLRLOCKS_VOLUME
,
186 GLUSTER_CLI_2_MAXVALUE
190 /* GLUSTER_DUMP_PROGRAM */
191 enum gluster_prog_dump_procs
{
197 /* GLUSTERD1_MGMT_PROGRAM */
198 enum glusterd_mgmt_procnum
{
199 GLUSTERD_MGMT_NULL
= 0,
200 GLUSTERD_MGMT_PROBE_QUERY
,
201 GLUSTERD_MGMT_FRIEND_ADD
,
202 GLUSTERD_MGMT_CLUSTER_LOCK
,
203 GLUSTERD_MGMT_CLUSTER_UNLOCK
,
204 GLUSTERD_MGMT_STAGE_OP
,
205 GLUSTERD_MGMT_COMMIT_OP
,
206 GLUSTERD_MGMT_FRIEND_REMOVE
,
207 GLUSTERD_MGMT_FRIEND_UPDATE
,
208 GLUSTERD_MGMT_MAXVALUE
211 /* GLUSTERD1_MGMT_PROGRAM for version 2*/
212 enum glusterd_mgmt_2_procnum
{
213 GLUSTERD_MGMT_2_NULL
= 0, /* 0 */
214 GLUSTERD_MGMT_2_CLUSTER_LOCK
,
215 GLUSTERD_MGMT_2_CLUSTER_UNLOCK
,
216 GLUSTERD_MGMT_2_STAGE_OP
,
217 GLUSTERD_MGMT_2_COMMIT_OP
,
218 GLUSTERD_MGMT_2_MAXVALUE
221 /* GLUSTERD1_MGMT_PROGRAM for version 3 */
222 enum glusterd_mgmt_3_procnum
{
223 GLUSTERD_MGMT_3_NULL
= 0,
224 GLUSTERD_MGMT_3_LOCK
,
225 GLUSTERD_MGMT_3_PRE_VALIDATE
,
226 GLUSTERD_MGMT_3_BRICK_OP
,
227 GLUSTERD_MGMT_3_COMMIT
,
228 GLUSTERD_MGMT_3_POST_VALIDATE
,
229 GLUSTERD_MGMT_3_UNLOCK
,
230 GLUSTERD_MGMT_3_MAXVALUE
233 /* GLUSTERFS_PROGRAM */
234 enum gf_brick_procnum
{
237 GF_BRICK_XLATOR_INFO
,
238 GF_BRICK_XLATOR_HEAL
,
242 /* GLUSTER_HNDSK_PROGRAM for version 1 and 2*/
243 enum gluster_prog_hndsk_procs
{
249 GF_HNDSK_EVENT_NOTIFY
,
250 GF_HNDSK_GET_VOLUME_INFO
,
254 /* GLUSTER_PMAP_PROGRAM */
255 enum gf_pmap_procnum
{
265 /* GD_BRICK_PROGRAM */
266 enum glusterd_brick_procnum
{
267 GLUSTERD_BRICK_NULL
= 0,
268 GLUSTERD_BRICK_TERMINATE
,
269 GLUSTERD_BRICK_XLATOR_INFO
,
270 GLUSTERD_BRICK_XLATOR_HEAL
,
272 GLUSTERD_BRICK_MAXVALUE
275 /* "rpc/rpc-lib/src/protocol-common.h" line 174 of 228 */
276 enum glusterd_brick_2_procnum
{
277 GLUSTERD_2_BRICK_NULL
, /* 0 */
278 GLUSTERD_2_BRICK_TERMINATE
,
279 GLUSTERD_2_BRICK_XLATOR_INFO
,
280 GLUSTERD_2_BRICK_XLATOR_OP
,
281 GLUSTERD_2_BRICK_STATUS
,
283 GLUSTERD_2_BRICK_XLATOR_DEFRAG
,
284 GLUSTERD_2_NODE_PROFILE
,
285 GLUSTERD_2_NODE_STATUS
,
286 GLUSTERD_2_BRICK_MAXVALUE
290 /* GLUSTER_CBK_PROGRAM */
291 enum gf_cbk_procnum
{
297 GF_CBK_CACHE_INVALIDATION
,
301 /* GD_FRIEND_PROGRAM defined in "rpc/rpc-lib/src/protocol-common.h" */
302 enum glusterd_friend_procnum
{
303 GLUSTERD_FRIEND_NULL
, /* 0 */
304 GLUSTERD_PROBE_QUERY
,
306 GLUSTERD_FRIEND_REMOVE
,
307 GLUSTERD_FRIEND_UPDATE
,
308 GLUSTERD_FRIEND_MAXVALUE
311 enum gf_fop_procnum
{
356 GFS3_OP_FREMOVEXATTR
,
365 /* dir-entry types from libglusterfs/src/compat.h */
366 enum gluster_entry_types
{
367 GLUSTER_DT_UNKNOWN
= 0,
374 GLUSTER_DT_SOCK
= 12,
379 /* LOCKING operators come from libglusterfs/src/glusterfs.h */
381 /* based on original enum glusterfs_lk_cmds_t */
382 enum gluster_lk_cmds
{
392 /* based on original enum glusterfs_lk_types_t */
393 enum gluster_lk_types
{
400 enum gluster_lk_whence
{
406 enum gluster_seek_whence
{
411 /* based on enum glusterd_op_ from xlators/mgmt/glusterd/src/glusterd.h */
429 GD_OP_PROFILE_VOLUME
,
434 GD_OP_STATEDUMP_VOLUME
,
436 GD_OP_CLEARLOCKS_VOLUME
,
437 GD_OP_DEFRAG_BRICK_VOLUME
,
445 /* based on enum gf_upcall_event_ from libglusterfs/src/upcall-utils.h */
446 enum gf_upcall_event
{
447 GF_UPCALL_EVENT_NULL
,
448 GF_UPCALL_CACHE_INVALIDATION
,
452 gluster_rpc_dissect_dict(proto_tree
*tree
, tvbuff_t
*tvb
, int hfindex
,
456 gluster_dissect_common_reply(tvbuff_t
*tvb
, int offset
,
457 packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
);
459 glusterfs_gfs3_3_op_common_reply(tvbuff_t
*tvb
,
460 packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
);
463 glusterfs_rpc_dissect_gf_iatt(proto_tree
*tree
, tvbuff_t
*tvb
, int hfindex
,
465 #endif /* __PACKET_GLUSTER_H__ */