2 * Header for gluster dissection
3 * Copyright 2012, Niels de Vos <ndevos@redhat.com>
4 * With contributions from:
5 * Shreedhara LG <shreedharlg@gmail.com>
9 * Wireshark - Network traffic analyzer
10 * By Gerald Combs <gerald@wireshark.org>
11 * Copyright 1998 Gerald Combs
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
28 * References to source files point in general to the glusterfs sources.
29 * There is currently no RFC or other document where the protocol is
30 * completely described. The glusterfs sources can be found at:
31 * - http://git.gluster.com/?p=glusterfs.git
32 * - https://github.com/gluster/glusterfs
34 * The coding-style is roughly the same as the one use in the Linux kernel,
35 * see http://www.kernel.org/doc/Documentation/CodingStyle.
38 #ifndef __PACKET_GLUSTER_H__
39 #define __PACKET_GLUSTER_H__
41 #define GLUSTER_PORT 24007
43 /* most of this comes from rpc/rpc-lib/src/protocol-common.h
44 * Some versions are commented with a user-visible version, others are not.
45 * Some programs were introduced starting version 2.
47 * Older versions were removed from the sources.
48 * One patch that did this is at http://review.gluster.com/610
50 #define GLUSTERD1_MGMT_PROGRAM 1298433
51 /* only available in version 1 */
53 #define GLUSTERFS_PROGRAM 4867634 /* same as GD_BRICK_PROGRAM */
54 /* only available in version 1 (replaced by GD_BRICK_PROGRAM) */
56 /* rpc/rpc-lib/src/xdr-common.h */
57 #define GLUSTER_DUMP_PROGRAM 123451501
58 /* only available in version 1 */
60 #define GLUSTER_HNDSK_PROGRAM 14398633
61 /* only available in version 1 (0.0.1) */
63 #define GLUSTER_PMAP_PROGRAM 34123456
64 /* only available in version 1 */
66 #define GLUSTER_CBK_PROGRAM 52743234
67 /* only available in version 1 (0.0.1) */
69 #define GLUSTER3_1_FOP_PROGRAM 1298437
70 /* available in version 310 (3.1.0) */
72 #define GD_MGMT_PROGRAM 1238433
73 /* available in version 1 and 2 */
75 #define GD_FRIEND_PROGRAM 1238437
76 /* only available in version 2 (0.0.2) */
78 #define GLUSTER_CLI_PROGRAM 1238463
79 /* available in version 1 (0.0.1) and 2 (0.0.2) */
81 #define GD_BRICK_PROGRAM 4867634
82 /* only available in version 2 (supersedes GLUSTERFS_PROGRAM) */
85 enum gf_mgmt_procnum
{
90 GD_MGMT_CLUSTER_UNLOCK
,
93 GD_MGMT_FRIEND_REMOVE
,
94 GD_MGMT_FRIEND_UPDATE
,
97 GD_MGMT_CLI_LIST_FRIENDS
,
98 GD_MGMT_CLI_CREATE_VOLUME
,
99 GD_MGMT_CLI_GET_VOLUME
,
100 GD_MGMT_CLI_DELETE_VOLUME
,
101 GD_MGMT_CLI_START_VOLUME
,
102 GD_MGMT_CLI_STOP_VOLUME
,
103 GD_MGMT_CLI_RENAME_VOLUME
,
104 GD_MGMT_CLI_DEFRAG_VOLUME
,
105 GD_MGMT_CLI_SET_VOLUME
,
106 GD_MGMT_CLI_ADD_BRICK
,
107 GD_MGMT_CLI_REMOVE_BRICK
,
108 GD_MGMT_CLI_REPLACE_BRICK
,
109 GD_MGMT_CLI_LOG_FILENAME
,
110 GD_MGMT_CLI_LOG_LOCATE
,
111 GD_MGMT_CLI_LOG_ROTATE
,
112 GD_MGMT_CLI_SYNC_VOLUME
,
113 GD_MGMT_CLI_RESET_VOLUME
,
115 GD_MGMT_CLI_GSYNC_SET
,
116 GD_MGMT_CLI_PROFILE_VOLUME
,
118 GD_MGMT_CLI_LOG_LEVEL
,
119 GD_MGMT_CLI_STATUS_VOLUME
,
123 /* GLUSTER_CLI_PROGRAM */
124 enum gluster_cli_procnum
{
125 GLUSTER_CLI_NULL
= 0,
128 GLUSTER_CLI_LIST_FRIENDS
,
129 GLUSTER_CLI_CREATE_VOLUME
,
130 GLUSTER_CLI_GET_VOLUME
,
131 GLUSTER_CLI_GET_NEXT_VOLUME
,
132 GLUSTER_CLI_DELETE_VOLUME
,
133 GLUSTER_CLI_START_VOLUME
,
134 GLUSTER_CLI_STOP_VOLUME
,
135 GLUSTER_CLI_RENAME_VOLUME
,
136 GLUSTER_CLI_DEFRAG_VOLUME
,
137 GLUSTER_CLI_SET_VOLUME
,
138 GLUSTER_CLI_ADD_BRICK
,
139 GLUSTER_CLI_REMOVE_BRICK
,
140 GLUSTER_CLI_REPLACE_BRICK
,
141 GLUSTER_CLI_LOG_FILENAME
,
142 GLUSTER_CLI_LOG_LOCATE
,
143 GLUSTER_CLI_LOG_ROTATE
,
145 GLUSTER_CLI_PMAP_PORTBYBRICK
,
146 GLUSTER_CLI_SYNC_VOLUME
,
147 GLUSTER_CLI_RESET_VOLUME
,
149 GLUSTER_CLI_GSYNC_SET
,
150 GLUSTER_CLI_PROFILE_VOLUME
,
152 GLUSTER_CLI_TOP_VOLUME
,
154 GLUSTER_CLI_LOG_LEVEL
,
155 GLUSTER_CLI_STATUS_VOLUME
,
158 GLUSTER_CLI_HEAL_VOLUME
,
159 GLUSTER_CLI_STATEDUMP_VOLUME
,
163 /* GLUSTER_CLI_PROGRAM 2 */
164 enum gluster_cli_2_procnum
{
165 GLUSTER_CLI_2_NULL
= 0, /* 0 */
167 GLUSTER_CLI_2_DEPROBE
,
168 GLUSTER_CLI_2_LIST_FRIENDS
,
169 GLUSTER_CLI_2_CREATE_VOLUME
,
170 GLUSTER_CLI_2_GET_VOLUME
,
171 GLUSTER_CLI_2_GET_NEXT_VOLUME
,
172 GLUSTER_CLI_2_DELETE_VOLUME
,
173 GLUSTER_CLI_2_START_VOLUME
,
174 GLUSTER_CLI_2_STOP_VOLUME
,
175 GLUSTER_CLI_2_RENAME_VOLUME
,
176 GLUSTER_CLI_2_DEFRAG_VOLUME
,
177 GLUSTER_CLI_2_SET_VOLUME
,
178 GLUSTER_CLI_2_ADD_BRICK
,
179 GLUSTER_CLI_2_REMOVE_BRICK
,
180 GLUSTER_CLI_2_REPLACE_BRICK
,
181 GLUSTER_CLI_2_LOG_ROTATE
,
182 GLUSTER_CLI_2_GETSPEC
,
183 GLUSTER_CLI_2_PMAP_PORTBYBRICK
,
184 GLUSTER_CLI_2_SYNC_VOLUME
,
185 GLUSTER_CLI_2_RESET_VOLUME
,
186 GLUSTER_CLI_2_FSM_LOG
,
187 GLUSTER_CLI_2_GSYNC_SET
,
188 GLUSTER_CLI_2_PROFILE_VOLUME
,
190 GLUSTER_CLI_2_TOP_VOLUME
,
192 GLUSTER_CLI_2_STATUS_VOLUME
,
193 GLUSTER_CLI_2_STATUS_ALL
,
195 GLUSTER_CLI_2_UMOUNT
,
196 GLUSTER_CLI_2_HEAL_VOLUME
,
197 GLUSTER_CLI_2_STATEDUMP_VOLUME
,
198 GLUSTER_CLI_2_LIST_VOLUME
,
199 GLUSTER_CLI_2_CLRLOCKS_VOLUME
,
200 GLUSTER_CLI_2_MAXVALUE
204 /* GLUSTER_DUMP_PROGRAM */
205 enum gluster_prog_dump_procs
{
211 /* GLUSTERD1_MGMT_PROGRAM */
212 enum glusterd_mgmt_procnum
{
213 GLUSTERD_MGMT_NULL
= 0,
214 GLUSTERD_MGMT_PROBE_QUERY
,
215 GLUSTERD_MGMT_FRIEND_ADD
,
216 GLUSTERD_MGMT_CLUSTER_LOCK
,
217 GLUSTERD_MGMT_CLUSTER_UNLOCK
,
218 GLUSTERD_MGMT_STAGE_OP
,
219 GLUSTERD_MGMT_COMMIT_OP
,
220 GLUSTERD_MGMT_FRIEND_REMOVE
,
221 GLUSTERD_MGMT_FRIEND_UPDATE
,
222 GLUSTERD_MGMT_MAXVALUE
225 /* GLUSTERD1_MGMT_PROGRAM for version 2*/
226 enum glusterd_mgmt_2_procnum
{
227 GLUSTERD_MGMT_2_NULL
= 0, /* 0 */
228 GLUSTERD_MGMT_2_CLUSTER_LOCK
,
229 GLUSTERD_MGMT_2_CLUSTER_UNLOCK
,
230 GLUSTERD_MGMT_2_STAGE_OP
,
231 GLUSTERD_MGMT_2_COMMIT_OP
,
232 GLUSTERD_MGMT_2_MAXVALUE
236 /* GLUSTERFS_PROGRAM */
237 enum gf_brick_procnum
{
240 GF_BRICK_XLATOR_INFO
,
241 GF_BRICK_XLATOR_HEAL
,
245 /* GLUSTER_HNDSK_PROGRAM for nersion 1 and 2*/
246 enum gluster_prog_hndsk_procs
{
252 GF_HNDSK_EVENT_NOTIFY
,
256 /* GLUSTER_PMAP_PROGRAM */
257 enum gf_pmap_procnum
{
267 /* GD_BRICK_PROGRAM */
268 enum glusterd_brick_procnum
{
269 GLUSTERD_BRICK_NULL
= 0,
270 GLUSTERD_BRICK_TERMINATE
,
271 GLUSTERD_BRICK_XLATOR_INFO
,
272 GLUSTERD_BRICK_XLATOR_HEAL
,
274 GLUSTERD_BRICK_MAXVALUE
277 /* "rpc/rpc-lib/src/protocol-common.h" line 174 of 228 */
278 enum glusterd_brick_2_procnum
{
279 GLUSTERD_2_BRICK_NULL
, /* 0 */
280 GLUSTERD_2_BRICK_TERMINATE
,
281 GLUSTERD_2_BRICK_XLATOR_INFO
,
282 GLUSTERD_2_BRICK_XLATOR_OP
,
283 GLUSTERD_2_BRICK_STATUS
,
285 GLUSTERD_2_BRICK_XLATOR_DEFRAG
,
286 GLUSTERD_2_NODE_PROFILE
,
287 GLUSTERD_2_NODE_STATUS
,
288 GLUSTERD_2_BRICK_MAXVALUE
292 /* GLUSTER_CBK_PROGRAM */
293 enum gf_cbk_procnum
{
300 /* GD_FRIEND_PROGRAM defined in "rpc/rpc-lib/src/protocol-common.h" */
301 enum glusterd_friend_procnum
{
302 GLUSTERD_FRIEND_NULL
, /* 0 */
303 GLUSTERD_PROBE_QUERY
,
305 GLUSTERD_FRIEND_REMOVE
,
306 GLUSTERD_FRIEND_UPDATE
,
307 GLUSTERD_FRIEND_MAXVALUE
310 enum gf_fop_procnum
{
354 GFS3_OP_FREMOVEXATTR
,
360 /* dir-entry types from libglusterfs/src/compat.h */
361 enum gluster_entry_types
{
362 GLUSTER_DT_UNKNOWN
= 0,
369 GLUSTER_DT_SOCK
= 12,
374 /* LOCKING operators come from libglusterfs/src/glusterfs.h */
376 /* based on original enum glusterfs_lk_cmds_t */
377 enum gluster_lk_cmds
{
387 /* based on original enum glusterfs_lk_types_t */
388 enum gluster_lk_types
{
395 enum gluster_lk_whence
{
401 /* based on enum glusterd_op_ from xlators/mgmt/glusterd/src/glusterd.h */
419 GD_OP_PROFILE_VOLUME
,
424 GD_OP_STATEDUMP_VOLUME
,
426 GD_OP_CLEARLOCKS_VOLUME
,
427 GD_OP_DEFRAG_BRICK_VOLUME
,
432 gluster_rpc_dissect_dict(proto_tree
*tree
, tvbuff_t
*tvb
, int hfindex
,
436 gluster_dissect_common_reply(tvbuff_t
*tvb
, int offset
,
437 packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
);
439 glusterfs_gfs3_3_op_common_reply(tvbuff_t
*tvb
, int offset
,
440 packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
);
442 #endif /* __PACKET_GLUSTER_H__ */