MSWSP: fix dissect_mswsp_smb()
[wireshark-wip.git] / epan / dissectors / packet-gluster.h
blob9d922ccd5c9360d6f0f1e9403a8a81853378105b
1 /* packet-gluster.h
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 * $Id$
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) */
84 /* GD_MGMT_PROGRAM */
85 enum gf_mgmt_procnum {
86 GD_MGMT_NULL = 0,
87 GD_MGMT_PROBE_QUERY,
88 GD_MGMT_FRIEND_ADD,
89 GD_MGMT_CLUSTER_LOCK,
90 GD_MGMT_CLUSTER_UNLOCK,
91 GD_MGMT_STAGE_OP,
92 GD_MGMT_COMMIT_OP,
93 GD_MGMT_FRIEND_REMOVE,
94 GD_MGMT_FRIEND_UPDATE,
95 GD_MGMT_CLI_PROBE,
96 GD_MGMT_CLI_DEPROBE,
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,
114 GD_MGMT_CLI_FSM_LOG,
115 GD_MGMT_CLI_GSYNC_SET,
116 GD_MGMT_CLI_PROFILE_VOLUME,
117 GD_MGMT_BRICK_OP,
118 GD_MGMT_CLI_LOG_LEVEL,
119 GD_MGMT_CLI_STATUS_VOLUME,
120 GD_MGMT_MAXVALUE
123 /* GLUSTER_CLI_PROGRAM */
124 enum gluster_cli_procnum {
125 GLUSTER_CLI_NULL = 0,
126 GLUSTER_CLI_PROBE,
127 GLUSTER_CLI_DEPROBE,
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,
144 GLUSTER_CLI_GETSPEC,
145 GLUSTER_CLI_PMAP_PORTBYBRICK,
146 GLUSTER_CLI_SYNC_VOLUME,
147 GLUSTER_CLI_RESET_VOLUME,
148 GLUSTER_CLI_FSM_LOG,
149 GLUSTER_CLI_GSYNC_SET,
150 GLUSTER_CLI_PROFILE_VOLUME,
151 GLUSTER_CLI_QUOTA,
152 GLUSTER_CLI_TOP_VOLUME,
153 GLUSTER_CLI_GETWD,
154 GLUSTER_CLI_LOG_LEVEL,
155 GLUSTER_CLI_STATUS_VOLUME,
156 GLUSTER_CLI_MOUNT,
157 GLUSTER_CLI_UMOUNT,
158 GLUSTER_CLI_HEAL_VOLUME,
159 GLUSTER_CLI_STATEDUMP_VOLUME,
160 GLUSTER_CLI_MAXVALUE
163 /* GLUSTER_CLI_PROGRAM 2 */
164 enum gluster_cli_2_procnum {
165 GLUSTER_CLI_2_NULL = 0, /* 0 */
166 GLUSTER_CLI_2_PROBE,
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,
189 GLUSTER_CLI_2_QUOTA,
190 GLUSTER_CLI_2_TOP_VOLUME,
191 GLUSTER_CLI_2_GETWD,
192 GLUSTER_CLI_2_STATUS_VOLUME,
193 GLUSTER_CLI_2_STATUS_ALL,
194 GLUSTER_CLI_2_MOUNT,
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 {
206 GF_DUMP_NULL = 0,
207 GF_DUMP_DUMP,
208 GF_DUMP_MAXVALUE
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 {
238 GF_BRICK_NULL = 0,
239 GF_BRICK_TERMINATE,
240 GF_BRICK_XLATOR_INFO,
241 GF_BRICK_XLATOR_HEAL,
242 GF_BRICK_MAXVALUE
245 /* GLUSTER_HNDSK_PROGRAM for nersion 1 and 2*/
246 enum gluster_prog_hndsk_procs {
247 GF_HNDSK_NULL = 0,
248 GF_HNDSK_SETVOLUME,
249 GF_HNDSK_GETSPEC,
250 GF_HNDSK_PING,
251 GF_HNDSK_SET_LK_VER,
252 GF_HNDSK_EVENT_NOTIFY,
253 GF_HNDSK_MAXVALUE
256 /* GLUSTER_PMAP_PROGRAM */
257 enum gf_pmap_procnum {
258 GF_PMAP_NULL = 0,
259 GF_PMAP_PORTBYBRICK,
260 GF_PMAP_BRICKBYPORT,
261 GF_PMAP_SIGNUP,
262 GF_PMAP_SIGNIN,
263 GF_PMAP_SIGNOUT,
264 GF_PMAP_MAXVALUE
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,
273 GLUSTERD_BRICK_OP,
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,
284 GLUSTERD_2_BRICK_OP,
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 {
294 GF_CBK_NULL = 0,
295 GF_CBK_FETCHSPEC,
296 GF_CBK_INO_FLUSH,
297 GF_CBK_MAXVALUE
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,
304 GLUSTERD_FRIEND_ADD,
305 GLUSTERD_FRIEND_REMOVE,
306 GLUSTERD_FRIEND_UPDATE,
307 GLUSTERD_FRIEND_MAXVALUE
310 enum gf_fop_procnum {
311 GFS3_OP_NULL = 0,
312 GFS3_OP_STAT,
313 GFS3_OP_READLINK,
314 GFS3_OP_MKNOD,
315 GFS3_OP_MKDIR,
316 GFS3_OP_UNLINK,
317 GFS3_OP_RMDIR,
318 GFS3_OP_SYMLINK,
319 GFS3_OP_RENAME,
320 GFS3_OP_LINK,
321 GFS3_OP_TRUNCATE,
322 GFS3_OP_OPEN,
323 GFS3_OP_READ,
324 GFS3_OP_WRITE,
325 GFS3_OP_STATFS,
326 GFS3_OP_FLUSH,
327 GFS3_OP_FSYNC,
328 GFS3_OP_SETXATTR,
329 GFS3_OP_GETXATTR,
330 GFS3_OP_REMOVEXATTR,
331 GFS3_OP_OPENDIR,
332 GFS3_OP_FSYNCDIR,
333 GFS3_OP_ACCESS,
334 GFS3_OP_CREATE,
335 GFS3_OP_FTRUNCATE,
336 GFS3_OP_FSTAT,
337 GFS3_OP_LK,
338 GFS3_OP_LOOKUP,
339 GFS3_OP_READDIR,
340 GFS3_OP_INODELK,
341 GFS3_OP_FINODELK,
342 GFS3_OP_ENTRYLK,
343 GFS3_OP_FENTRYLK,
344 GFS3_OP_XATTROP,
345 GFS3_OP_FXATTROP,
346 GFS3_OP_FGETXATTR,
347 GFS3_OP_FSETXATTR,
348 GFS3_OP_RCHECKSUM,
349 GFS3_OP_SETATTR,
350 GFS3_OP_FSETATTR,
351 GFS3_OP_READDIRP,
352 GFS3_OP_RELEASE,
353 GFS3_OP_RELEASEDIR,
354 GFS3_OP_FREMOVEXATTR,
355 GFS3_OP_FALLOCATE,
356 GFS3_OP_DISCARD,
357 GFS3_OP_MAXVALUE
360 /* dir-entry types from libglusterfs/src/compat.h */
361 enum gluster_entry_types {
362 GLUSTER_DT_UNKNOWN = 0,
363 GLUSTER_DT_FIFO = 1,
364 GLUSTER_DT_CHR = 2,
365 GLUSTER_DT_DIR = 4,
366 GLUSTER_DT_BLK = 6,
367 GLUSTER_DT_REG = 8,
368 GLUSTER_DT_LNK = 10,
369 GLUSTER_DT_SOCK = 12,
370 GLUSTER_DT_WHT = 14
374 /* LOCKING operators come from libglusterfs/src/glusterfs.h */
376 /* based on original enum glusterfs_lk_cmds_t */
377 enum gluster_lk_cmds {
378 GF_LK_GETLK = 0,
379 GF_LK_SETLK,
380 GF_LK_SETLKW,
381 GF_LK_RESLK_LCK,
382 GF_LK_RESLK_LCKW,
383 GF_LK_RESLK_UNLCK,
384 GF_LK_GETLK_FD
387 /* based on original enum glusterfs_lk_types_t */
388 enum gluster_lk_types {
389 GF_LK_F_RDLCK = 0,
390 GF_LK_F_WRLCK,
391 GF_LK_F_UNLCK,
392 GF_LK_EOL
395 enum gluster_lk_whence {
396 GF_LK_SEEK_SET = 0,
397 GF_LK_SEEK_CUR,
398 GF_LK_SEEK_END
401 /* based on enum glusterd_op_ from xlators/mgmt/glusterd/src/glusterd.h */
402 enum glusterd_ops {
403 GD_OP_NONE = 0,
404 GD_OP_CREATE_VOLUME,
405 GD_OP_START_BRICK,
406 GD_OP_STOP_BRICK,
407 GD_OP_DELETE_VOLUME,
408 GD_OP_START_VOLUME,
409 GD_OP_STOP_VOLUME,
410 GD_OP_DEFRAG_VOLUME,
411 GD_OP_ADD_BRICK,
412 GD_OP_REMOVE_BRICK,
413 GD_OP_REPLACE_BRICK,
414 GD_OP_SET_VOLUME,
415 GD_OP_RESET_VOLUME,
416 GD_OP_SYNC_VOLUME,
417 GD_OP_LOG_ROTATE,
418 GD_OP_GSYNC_SET,
419 GD_OP_PROFILE_VOLUME,
420 GD_OP_QUOTA,
421 GD_OP_STATUS_VOLUME,
422 GD_OP_REBALANCE,
423 GD_OP_HEAL_VOLUME,
424 GD_OP_STATEDUMP_VOLUME,
425 GD_OP_LIST_VOLUME,
426 GD_OP_CLEARLOCKS_VOLUME,
427 GD_OP_DEFRAG_BRICK_VOLUME,
428 GD_OP_MAX
431 extern int
432 gluster_rpc_dissect_dict(proto_tree *tree, tvbuff_t *tvb, int hfindex,
433 int offset);
435 extern int
436 gluster_dissect_common_reply(tvbuff_t *tvb, int offset,
437 packet_info *pinfo, proto_tree *tree, void* data _U_);
438 extern int
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__ */