Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-glusterfs.c
blobcd6da9723b6f3753f60042e8a26fcd3d43a3ebb4
1 /* packet-glusterfs.c
2 * Routines for GlusterFS dissection
3 * Copyright 2012, Niels de Vos <ndevos@redhat.com>
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
12 * References to source files point in general to the glusterfs sources.
13 * There is currently no RFC or other document where the protocol is
14 * completely described. The glusterfs sources can be found at:
15 * - https://github.com/gluster/glusterfs
17 * The coding-style is roughly the same as the one use in the Linux kernel,
18 * see http://www.kernel.org/doc/Documentation/CodingStyle.
21 #include "config.h"
23 #include <epan/packet.h>
24 #include <epan/to_str.h>
25 #include <epan/tfs.h>
26 #include "packet-rpc.h"
27 #include "packet-gluster.h"
29 void proto_register_glusterfs(void);
30 void proto_reg_handoff_glusterfs(void);
32 /* Initialize the protocol and registered fields */
33 static int proto_glusterfs;
35 /* programs and procedures */
36 static int hf_glusterfs_proc;
38 /* fields used by multiple programs/procedures */
39 static int hf_gluster_op_ret;
40 static int hf_gluster_op_errno;
42 /* GlusterFS specific */
43 static int hf_glusterfs_gfid;
44 static int hf_glusterfs_pargfid;
45 static int hf_glusterfs_oldgfid;
46 static int hf_glusterfs_newgfid;
47 static int hf_glusterfs_path;
48 static int hf_glusterfs_bname;
49 static int hf_glusterfs_dict;
50 static int hf_glusterfs_fd;
51 static int hf_glusterfs_offset;
52 static int hf_glusterfs_size;
53 static int hf_glusterfs_size64;
54 static int hf_glusterfs_volume;
55 static int hf_glusterfs_cmd;
56 static int hf_glusterfs_type;
57 static int hf_glusterfs_entries;
58 static int hf_glusterfs_xflags;
59 static int hf_glusterfs_linkname;
60 static int hf_glusterfs_umask;
61 static int hf_glusterfs_mask;
62 static int hf_glusterfs_name;
63 static int hf_glusterfs_namelen;
64 static int hf_glusterfs_whence;
66 /* flags passed on to OPEN, CREATE etc.*/
67 static int hf_glusterfs_flags;
68 static int hf_glusterfs_flags_rdonly;
69 static int hf_glusterfs_flags_wronly;
70 static int hf_glusterfs_flags_rdwr;
71 static int hf_glusterfs_flags_accmode;
72 static int hf_glusterfs_flags_append;
73 static int hf_glusterfs_flags_async;
74 static int hf_glusterfs_flags_cloexec;
75 static int hf_glusterfs_flags_creat;
76 static int hf_glusterfs_flags_direct;
77 static int hf_glusterfs_flags_directory;
78 static int hf_glusterfs_flags_excl;
79 static int hf_glusterfs_flags_largefile;
80 static int hf_glusterfs_flags_noatime;
81 static int hf_glusterfs_flags_noctty;
82 static int hf_glusterfs_flags_nofollow;
83 static int hf_glusterfs_flags_nonblock;
84 static int hf_glusterfs_flags_ndelay;
85 static int hf_glusterfs_flags_sync;
86 static int hf_glusterfs_flags_trunc;
87 static int hf_glusterfs_flags_reserved;
89 /* access modes */
90 static int hf_glusterfs_mode;
91 static int hf_glusterfs_mode_suid;
92 static int hf_glusterfs_mode_sgid;
93 static int hf_glusterfs_mode_svtx;
94 static int hf_glusterfs_mode_rusr;
95 static int hf_glusterfs_mode_wusr;
96 static int hf_glusterfs_mode_xusr;
97 static int hf_glusterfs_mode_rgrp;
98 static int hf_glusterfs_mode_wgrp;
99 static int hf_glusterfs_mode_xgrp;
100 static int hf_glusterfs_mode_roth;
101 static int hf_glusterfs_mode_woth;
102 static int hf_glusterfs_mode_xoth;
103 static int hf_glusterfs_mode_reserved;
105 /* dir-entry */
106 static int hf_glusterfs_entry_ino;
107 static int hf_glusterfs_entry_off;
108 static int hf_glusterfs_entry_len;
109 static int hf_glusterfs_entry_type;
110 static int hf_glusterfs_entry_path;
112 /* gf_iatt */
113 static int hf_glusterfs_iatt;
114 static int hf_glusterfs_preparent_iatt;
115 static int hf_glusterfs_postparent_iatt;
116 static int hf_glusterfs_preop_iatt;
117 static int hf_glusterfs_postop_iatt;
118 static int hf_glusterfs_ia_ino;
119 static int hf_glusterfs_ia_dev;
120 static int hf_glusterfs_ia_mode;
121 static int hf_glusterfs_ia_nlink;
122 static int hf_glusterfs_ia_uid;
123 static int hf_glusterfs_ia_gid;
124 static int hf_glusterfs_ia_rdev;
125 static int hf_glusterfs_ia_size;
126 static int hf_glusterfs_ia_blksize;
127 static int hf_glusterfs_ia_blocks;
128 static int hf_glusterfs_ia_atime;
129 static int hf_glusterfs_ia_mtime;
130 static int hf_glusterfs_ia_ctime;
132 static int hf_glusterfs_iattx;
133 static int hf_glusterfs_preparent_iattx;
134 static int hf_glusterfs_postparent_iattx;
135 static int hf_glusterfs_preop_iattx;
136 static int hf_glusterfs_postop_iattx;
137 static int hf_glusterfs_iax_flags;
138 static int hf_glusterfs_iax_attributes;
139 static int hf_glusterfs_iax_attributes_mask;
140 static int hf_glusterfs_iax_atime;
141 static int hf_glusterfs_iax_mtime;
142 static int hf_glusterfs_iax_ctime;
143 static int hf_glusterfs_iax_btime;
144 static int hf_glusterfs_iax_atime_nsec;
145 static int hf_glusterfs_iax_mtime_nsec;
146 static int hf_glusterfs_iax_ctime_nsec;
147 static int hf_glusterfs_iax_btime_nsec;
150 /* gf_flock */
151 static int hf_glusterfs_flock_type;
152 static int hf_glusterfs_flock_whence;
153 static int hf_glusterfs_flock_start;
154 static int hf_glusterfs_flock_len;
155 static int hf_glusterfs_flock_pid;
156 static int hf_glusterfs_flock_owner;
158 /* statfs */
159 static int hf_glusterfs_bsize;
160 static int hf_glusterfs_frsize;
161 static int hf_glusterfs_blocks;
162 static int hf_glusterfs_bfree;
163 static int hf_glusterfs_bavail;
164 static int hf_glusterfs_files;
165 static int hf_glusterfs_ffree;
166 static int hf_glusterfs_favail;
167 static int hf_glusterfs_id;
168 static int hf_glusterfs_mnt_flags;
169 static int hf_glusterfs_mnt_flag_rdonly;
170 static int hf_glusterfs_mnt_flag_nosuid;
171 static int hf_glusterfs_mnt_flag_nodev;
172 static int hf_glusterfs_mnt_flag_noexec;
173 static int hf_glusterfs_mnt_flag_synchronous;
174 static int hf_glusterfs_mnt_flag_mandlock;
175 static int hf_glusterfs_mnt_flag_write;
176 static int hf_glusterfs_mnt_flag_append;
177 static int hf_glusterfs_mnt_flag_immutable;
178 static int hf_glusterfs_mnt_flag_noatime;
179 static int hf_glusterfs_mnt_flag_nodiratime;
180 static int hf_glusterfs_mnt_flag_relatime;
181 static int hf_glusterfs_namemax;
183 static int hf_glusterfs_setattr_valid;
184 /* flags for setattr.valid */
185 static int hf_glusterfs_setattr_set_mode;
186 static int hf_glusterfs_setattr_set_uid;
187 static int hf_glusterfs_setattr_set_gid;
188 static int hf_glusterfs_setattr_set_size;
189 static int hf_glusterfs_setattr_set_atime;
190 static int hf_glusterfs_setattr_set_mtime;
191 static int hf_glusterfs_setattr_set_reserved;
193 /* Rename */
194 static int hf_glusterfs_oldbname;
195 static int hf_glusterfs_newbname;
197 /* for FSYNC/FSYNCDIR */
198 static int hf_glusterfs_fsync_flags;
199 static int hf_glusterfs_fsync_flag_datasync;
200 static int hf_glusterfs_fsync_flag_unknown;
202 /* for entrylk */
203 static int hf_glusterfs_entrylk_namelen;
205 static int hf_gluster_dict_xdr_size;
206 static int hf_gluster_dict_size;
207 static int hf_gluster_num_dict_items;
208 static int hf_gluster_rpc_roundup_bytes;
209 static int hf_gluster_trusted_afr_key;
210 static int hf_gluster_dict_value;
213 /* Initialize the subtree pointers */
214 static int ett_glusterfs;
215 static int ett_glusterfs_flags;
216 static int ett_glusterfs_mnt_flags;
217 static int ett_glusterfs_mode;
218 static int ett_glusterfs_setattr_valid;
219 static int ett_glusterfs_parent_iatt;
220 static int ett_glusterfs_iatt;
221 static int ett_glusterfs_entry;
222 static int ett_glusterfs_flock;
223 static int ett_glusterfs_fsync_flags;
224 static int ett_gluster_dict;
225 static int ett_gluster_dict_items;
227 static int
228 glusterfs_rpc_dissect_gfid(proto_tree *tree, tvbuff_t *tvb, int hfindex, int offset)
230 proto_tree_add_item(tree, hfindex, tvb, offset, 16, ENC_NA);
231 offset += 16;
233 return offset;
236 static int
237 glusterfs_rpc_dissect_mode(proto_tree *tree, tvbuff_t *tvb, int hfindex,
238 int offset)
240 static int * const mode_bits[] = {
241 &hf_glusterfs_mode_suid,
242 &hf_glusterfs_mode_sgid,
243 &hf_glusterfs_mode_svtx,
244 &hf_glusterfs_mode_rusr,
245 &hf_glusterfs_mode_wusr,
246 &hf_glusterfs_mode_xusr,
247 &hf_glusterfs_mode_rgrp,
248 &hf_glusterfs_mode_wgrp,
249 &hf_glusterfs_mode_xgrp,
250 &hf_glusterfs_mode_roth,
251 &hf_glusterfs_mode_woth,
252 &hf_glusterfs_mode_xoth,
253 &hf_glusterfs_mode_reserved,
254 NULL
257 proto_tree_add_bitmask(tree, tvb, offset, hfindex,
258 ett_glusterfs_mode, mode_bits, ENC_BIG_ENDIAN);
260 offset += 4;
261 return offset;
265 * from rpc/xdr/src/glusterfs3-xdr.c:xdr_gf_iatt()
268 glusterfs_rpc_dissect_gf_iatt(proto_tree *tree, tvbuff_t *tvb, int hfindex,
269 int offset)
271 proto_item *iatt_item;
272 proto_tree *iatt_tree;
273 int start_offset = offset;
275 iatt_item = proto_tree_add_item(tree, hfindex, tvb, offset, -1,
276 ENC_NA);
277 iatt_tree = proto_item_add_subtree(iatt_item, ett_glusterfs_iatt);
279 offset = glusterfs_rpc_dissect_gfid(iatt_tree, tvb, hf_glusterfs_gfid,
280 offset);
281 offset = dissect_rpc_uint64(tvb, iatt_tree, hf_glusterfs_ia_ino,
282 offset);
283 offset = dissect_rpc_uint64(tvb, iatt_tree, hf_glusterfs_ia_dev,
284 offset);
285 offset = glusterfs_rpc_dissect_mode(iatt_tree, tvb,
286 hf_glusterfs_ia_mode, offset);
287 offset = dissect_rpc_uint32(tvb, iatt_tree, hf_glusterfs_ia_nlink,
288 offset);
289 offset = dissect_rpc_uint32(tvb, iatt_tree, hf_glusterfs_ia_uid,
290 offset);
291 offset = dissect_rpc_uint32(tvb, iatt_tree, hf_glusterfs_ia_gid,
292 offset);
293 offset = dissect_rpc_uint64(tvb, iatt_tree, hf_glusterfs_ia_rdev,
294 offset);
295 offset = dissect_rpc_uint64(tvb, iatt_tree, hf_glusterfs_ia_size,
296 offset);
297 offset = dissect_rpc_uint32(tvb, iatt_tree, hf_glusterfs_ia_blksize,
298 offset);
299 offset = dissect_rpc_uint64(tvb, iatt_tree, hf_glusterfs_ia_blocks,
300 offset);
302 proto_tree_add_item(iatt_tree, hf_glusterfs_ia_atime, tvb,
303 offset, 8, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN);
304 offset += 8;
306 proto_tree_add_item(iatt_tree, hf_glusterfs_ia_mtime, tvb,
307 offset, 8, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN);
308 offset += 8;
310 proto_tree_add_item(iatt_tree, hf_glusterfs_ia_ctime, tvb,
311 offset, 8, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN);
312 offset += 8;
314 proto_item_set_len (iatt_item, offset - start_offset);
316 return offset;
319 static int
320 glusterfs_rpc_dissect_gf_flock(proto_tree *tree, tvbuff_t *tvb, int offset)
322 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_flock_type, offset);
323 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_flock_whence, offset);
324 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_flock_start, offset);
325 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_flock_len, offset);
326 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_flock_pid, offset);
328 proto_tree_add_item(tree, hf_glusterfs_flock_owner, tvb, offset, 8, ENC_NA);
329 offset += 8;
331 return offset;
334 static int
335 glusterfs_rpc_dissect_gf_2_flock(proto_tree *tree, tvbuff_t *tvb, int offset)
337 proto_item *flock_item;
338 proto_tree *flock_tree;
339 int len;
340 int start_offset = offset;
342 flock_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_glusterfs_flock, &flock_item, "Flock");
344 offset = dissect_rpc_uint32(tvb, flock_tree, hf_glusterfs_flock_type,
345 offset);
346 offset = dissect_rpc_uint32(tvb, flock_tree, hf_glusterfs_flock_whence,
347 offset);
348 offset = dissect_rpc_uint64(tvb, flock_tree, hf_glusterfs_flock_start,
349 offset);
350 offset = dissect_rpc_uint64(tvb, flock_tree, hf_glusterfs_flock_len,
351 offset);
352 offset = dissect_rpc_uint32(tvb, flock_tree, hf_glusterfs_flock_pid,
353 offset);
355 len = tvb_get_ntohl(tvb, offset);
356 offset += 4;
358 proto_tree_add_item(flock_tree, hf_glusterfs_flock_owner, tvb, offset, len, ENC_NA);
359 offset += len;
361 proto_item_set_len (flock_item, offset - start_offset);
363 return offset;
366 static const true_false_string glusterfs_notset_set = {
367 "Not set",
368 "Set"
371 static const value_string glusterfs_accmode_vals[] = {
372 { 0, "Not set"},
373 { 1, "Not set"},
374 { 2, "Not set"},
375 { 3, "Set"},
376 { 0, NULL}
379 static int
380 glusterfs_rpc_dissect_flags(proto_tree *tree, tvbuff_t *tvb, int offset)
382 bool rdonly;
383 uint32_t accmode;
384 proto_item *flag_tree;
385 header_field_info *rdonly_hf, *accmode_hf;
387 static int * const flag_bits[] = {
388 &hf_glusterfs_flags_wronly,
389 &hf_glusterfs_flags_rdwr,
390 &hf_glusterfs_flags_creat,
391 &hf_glusterfs_flags_excl,
392 &hf_glusterfs_flags_noctty,
393 &hf_glusterfs_flags_trunc,
394 &hf_glusterfs_flags_append,
395 &hf_glusterfs_flags_nonblock,
396 &hf_glusterfs_flags_ndelay,
397 &hf_glusterfs_flags_sync,
398 &hf_glusterfs_flags_async,
399 &hf_glusterfs_flags_direct,
400 &hf_glusterfs_flags_largefile,
401 &hf_glusterfs_flags_directory,
402 &hf_glusterfs_flags_nofollow,
403 &hf_glusterfs_flags_noatime,
404 &hf_glusterfs_flags_cloexec,
405 &hf_glusterfs_flags_reserved,
406 NULL
409 flag_tree = proto_tree_add_bitmask(tree, tvb, offset, hf_glusterfs_flags, ett_glusterfs_flags, flag_bits, ENC_BIG_ENDIAN);
411 /* rdonly is true only when no flags are set */
412 rdonly = (tvb_get_ntohl(tvb, offset) == 0);
413 proto_tree_add_item(flag_tree, hf_glusterfs_flags_rdonly, tvb, offset, 4, ENC_BIG_ENDIAN);
414 if (rdonly) {
415 rdonly_hf = proto_registrar_get_nth(hf_glusterfs_flags_rdonly);
416 proto_item_append_text(flag_tree, ", %s", rdonly_hf->name);
419 /* hf_glusterfs_flags_accmode is true if bits 0 and 1 are set */
420 accmode_hf = proto_registrar_get_nth(hf_glusterfs_flags_accmode);
421 accmode = tvb_get_ntohl(tvb, offset);
422 proto_tree_add_uint_format_value(flag_tree, hf_glusterfs_flags_accmode, tvb, offset, 4, accmode,
423 "%s", val_to_str_const((accmode & (uint32_t)(accmode_hf->bitmask)), glusterfs_accmode_vals, "Unknown"));
424 if ((accmode & accmode_hf->bitmask) == accmode_hf->bitmask)
425 proto_item_append_text(flag_tree, ", %s", proto_registrar_get_nth(hf_glusterfs_flags_accmode)->name);
427 offset += 4;
428 return offset;
431 static int
432 glusterfs_rpc_dissect_statfs(proto_tree *tree, tvbuff_t *tvb, int offset)
434 static int * const flag_bits[] = {
435 &hf_glusterfs_mnt_flag_rdonly,
436 &hf_glusterfs_mnt_flag_nosuid,
437 &hf_glusterfs_mnt_flag_nodev,
438 &hf_glusterfs_mnt_flag_noexec,
439 &hf_glusterfs_mnt_flag_synchronous,
440 &hf_glusterfs_mnt_flag_mandlock,
441 &hf_glusterfs_mnt_flag_write,
442 &hf_glusterfs_mnt_flag_append,
443 &hf_glusterfs_mnt_flag_immutable,
444 &hf_glusterfs_mnt_flag_noatime,
445 &hf_glusterfs_mnt_flag_nodiratime,
446 &hf_glusterfs_mnt_flag_relatime,
447 NULL
450 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_bsize, offset);
451 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_frsize, offset);
452 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_blocks, offset);
453 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_bfree, offset);
454 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_bavail, offset);
455 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_files, offset);
456 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_ffree, offset);
457 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_favail, offset);
458 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_id, offset);
460 proto_tree_add_bitmask(tree, tvb, offset,
461 hf_glusterfs_mnt_flags, ett_glusterfs_mnt_flags,
462 flag_bits, ENC_BIG_ENDIAN);
463 offset += 8;
465 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_namemax, offset);
467 return offset;
470 /* function for dissecting and adding a gluster dict_t to the tree */
472 gluster_rpc_dissect_dict(proto_tree *tree, tvbuff_t *tvb, int hfindex, int offset)
474 char *key, *value;
475 const char *name;
476 int roundup, value_len, key_len;
477 uint32_t i, items, len;
478 int start_offset, start_offset2;
480 proto_item *subtree_item, *ti;
481 proto_tree *subtree;
483 proto_item *dict_item = NULL;
485 /* create a subtree for all the items in the dict */
486 if (hfindex >= 0) {
487 header_field_info *hfinfo = proto_registrar_get_nth(hfindex);
488 name = hfinfo->name;
489 } else
490 name = "<NAMELESS DICT STRUCTURE>";
492 start_offset = offset;
493 subtree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_gluster_dict, &subtree_item, name);
495 len = tvb_get_ntohl(tvb, offset);
496 roundup = rpc_roundup(len) - len;
497 ti = proto_tree_add_item_ret_uint(subtree, hf_gluster_dict_size, tvb, offset, 4, ENC_BIG_ENDIAN, &len);
498 proto_item_append_text(ti, " (%d bytes inc. RPC-roundup)", rpc_roundup(len));
499 proto_item_set_generated(ti);
500 offset += 4;
502 if (len == 0)
503 items = 0;
504 else
505 items = tvb_get_ntohl(tvb, offset);
507 proto_item_append_text(subtree_item, ", contains %d item%s", items, items == 1 ? "" : "s");
509 if (len == 0)
510 return offset;
512 proto_tree_add_uint(subtree, hf_gluster_num_dict_items, tvb, offset, 4, items);
513 offset += 4;
515 for (i = 0; i < items; i++) {
516 /* key_len is the length of the key without the terminating '\0' */
517 /* key_len = tvb_get_ntohl(tvb, offset) + 1; // will be read later */
518 offset += 4;
519 value_len = tvb_get_ntohl(tvb, offset);
520 offset += 4;
522 /* read the key, '\0' terminated */
523 key = tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset, &key_len, ENC_ASCII);
524 start_offset2 = offset;
525 offset += key_len;
527 /* read the value, possibly '\0' terminated */
529 /* keys named "gfid-req" contain a GFID in hex */
530 if (value_len == 16 && (
531 !strncmp("gfid-req", key, 8) ||
532 !strncmp("transaction_id", key, 14) ||
533 !strncmp("originator_uuid", key, 15))) {
534 char *gfid_s;
535 e_guid_t gfid;
537 tvb_get_ntohguid(tvb, offset, &gfid);
539 gfid_s = guid_to_str(wmem_packet_scope(), &gfid);
540 dict_item = proto_tree_add_guid_format(subtree, hf_glusterfs_gfid,
541 tvb, offset, 16, &gfid,
542 "%s: %s", key, gfid_s);
543 /* this is a changelog in binary format */
544 } else if (value_len == 12 && !strncmp("trusted.afr.", key, 12)) {
545 dict_item = proto_tree_add_bytes_format(subtree, hf_gluster_trusted_afr_key, tvb, offset, 12,
546 NULL, "%s: 0x%.8x%.8x%.8x", key,
547 tvb_get_letohl(tvb, offset + 0),
548 tvb_get_letohl(tvb, offset + 4),
549 tvb_get_letohl(tvb, offset + 8));
550 } else {
551 value = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, value_len, ENC_ASCII);
552 dict_item = proto_tree_add_string_format(subtree, hf_gluster_dict_value, tvb, offset, value_len, value, "%s: %s",
553 key, value);
556 offset += value_len;
557 proto_item_set_len (dict_item, offset - start_offset2);
560 if (roundup) {
561 ti = proto_tree_add_item(subtree, hf_gluster_rpc_roundup_bytes, tvb, offset, -1, ENC_NA);
562 proto_item_set_generated(ti);
563 offset += roundup;
566 proto_item_set_len (subtree_item, offset - start_offset);
568 return offset;
572 * from rpc/xdr/src/glusterfs3-xdr.c:xdr_gf_iatt()
574 static int
575 glusterfs_rpc_dissect_gfx_iatt(proto_tree *tree, tvbuff_t *tvb, int hfindex,
576 int offset)
578 proto_item *iatt_item;
579 proto_tree *iatt_tree;
580 int start_offset = offset;
582 iatt_item = proto_tree_add_item(tree, hfindex, tvb, offset, -1,
583 ENC_NA);
584 iatt_tree = proto_item_add_subtree(iatt_item, ett_glusterfs_iatt);
586 offset = glusterfs_rpc_dissect_gfid(iatt_tree, tvb, hf_glusterfs_gfid,
587 offset);
588 offset = dissect_rpc_uint64(tvb, iatt_tree, hf_glusterfs_iax_flags,
589 offset);
590 offset = dissect_rpc_uint64(tvb, iatt_tree, hf_glusterfs_ia_ino,
591 offset);
592 offset = dissect_rpc_uint64(tvb, iatt_tree, hf_glusterfs_ia_dev,
593 offset);
594 offset = dissect_rpc_uint64(tvb, iatt_tree, hf_glusterfs_ia_rdev,
595 offset);
596 offset = dissect_rpc_uint64(tvb, iatt_tree, hf_glusterfs_ia_size,
597 offset);
598 offset = dissect_rpc_uint64(tvb, iatt_tree, hf_glusterfs_ia_blocks,
599 offset);
600 offset = dissect_rpc_uint64(tvb, iatt_tree, hf_glusterfs_iax_attributes,
601 offset);
602 offset = dissect_rpc_uint64(tvb, iatt_tree, hf_glusterfs_iax_attributes_mask,
603 offset);
604 offset = dissect_rpc_uint64(tvb, iatt_tree, hf_glusterfs_iax_atime,
605 offset);
606 offset = dissect_rpc_uint64(tvb, iatt_tree, hf_glusterfs_iax_mtime,
607 offset);
608 offset = dissect_rpc_uint64(tvb, iatt_tree, hf_glusterfs_iax_ctime,
609 offset);
610 offset = dissect_rpc_uint64(tvb, iatt_tree, hf_glusterfs_iax_btime,
611 offset);
612 offset = dissect_rpc_uint32(tvb, iatt_tree, hf_glusterfs_iax_atime_nsec,
613 offset);
614 offset = dissect_rpc_uint32(tvb, iatt_tree, hf_glusterfs_iax_mtime_nsec,
615 offset);
616 offset = dissect_rpc_uint32(tvb, iatt_tree, hf_glusterfs_iax_ctime_nsec,
617 offset);
618 offset = dissect_rpc_uint32(tvb, iatt_tree, hf_glusterfs_iax_btime_nsec,
619 offset);
620 offset = dissect_rpc_uint32(tvb, iatt_tree, hf_glusterfs_ia_nlink,
621 offset);
622 offset = dissect_rpc_uint32(tvb, iatt_tree, hf_glusterfs_ia_uid,
623 offset);
624 offset = dissect_rpc_uint32(tvb, iatt_tree, hf_glusterfs_ia_gid,
625 offset);
626 offset = dissect_rpc_uint32(tvb, iatt_tree, hf_glusterfs_ia_blksize,
627 offset);
628 offset = glusterfs_rpc_dissect_mode(iatt_tree, tvb,
629 hf_glusterfs_ia_mode, offset);
631 proto_item_set_len (iatt_item, offset - start_offset);
633 return offset;
636 /* function for dissecting and adding a gluster4_0 dict_t to the tree */
637 static int
638 gluster_rpc4_0_dissect_dict(proto_tree *tree, tvbuff_t *tvb, int hfindex, int offset)
640 char *key, *value;
641 const char *name;
642 uint32_t i, items, len, val_type, val_len, key_len;
643 int start_offset, start_offset2;
644 char *gfid_s;
645 e_guid_t gfid;
647 proto_item *subtree_item;
648 proto_tree *subtree;
650 proto_item *dict_item = NULL;
652 /* create a subtree for all the items in the dict */
653 if (hfindex >= 0) {
654 header_field_info *hfinfo = proto_registrar_get_nth(hfindex);
655 name = hfinfo->name;
656 } else
657 name = "<NAMELESS DICT STRUCTURE>";
659 start_offset = offset;
660 subtree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_gluster_dict, &subtree_item, name);
662 len = tvb_get_ntohl(tvb, offset);
663 offset = dissect_rpc_uint32 (tvb, subtree, hf_gluster_dict_xdr_size, offset);
665 offset += 4;
667 if (len == 0)
668 items = 0;
669 else
670 items = tvb_get_ntohl(tvb, offset);
671 offset = dissect_rpc_uint32 (tvb, subtree, hf_gluster_num_dict_items, offset);
673 if (len == 0)
674 return offset;
676 for (i = 0; i < items; i++) {
677 val_len = 0;
678 key_len = tvb_get_ntohl(tvb, offset);
679 key_len = rpc_roundup(key_len);
680 offset += 4;
682 /* read the key, '\0' terminated */
683 key = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, key_len, ENC_ASCII);
684 start_offset2 = offset;
685 offset += key_len;
687 val_type = tvb_get_ntohl(tvb, offset);
688 offset += 4;
690 if (val_type == 2) {
691 val_len = 8;
692 dict_item = proto_tree_add_string_format(subtree, hf_gluster_dict_value, tvb, offset, val_len,
693 NULL, "%s: %"PRId64, key,
694 tvb_get_int64(tvb, offset, ENC_BIG_ENDIAN));
695 } else if (val_type == 3) {
696 val_len = 8;
697 dict_item = proto_tree_add_string_format(subtree, hf_gluster_dict_value, tvb, offset, val_len,
698 NULL, "%s: %"PRIu64, key,
699 tvb_get_uint64(tvb, offset, ENC_BIG_ENDIAN));
700 } else if (val_type == 4) {
701 val_len = 8;
702 dict_item = proto_tree_add_string_format(subtree, hf_gluster_dict_value, tvb, offset, val_len,
703 NULL, "%s: %f", key,
704 tvb_get_ieee_double(tvb, offset, ENC_BIG_ENDIAN));
705 } else if (val_type == 5) {
706 val_len = tvb_get_ntohl(tvb, offset);
707 val_len = rpc_roundup(val_len);
708 offset += 4;
709 value = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, val_len, ENC_ASCII);
710 dict_item = proto_tree_add_string_format(subtree, hf_gluster_dict_value, tvb, offset, val_len, value, "%s: %s",
711 key, value);
712 } else if (val_type == 8) {
713 offset = glusterfs_rpc_dissect_gfx_iatt(tree, tvb,
714 hf_glusterfs_preparent_iatt, offset);
715 } else if (val_type == 7) {
716 val_len = 16;
717 tvb_get_ntohguid(tvb, offset, &gfid);
718 gfid_s = guid_to_str(wmem_packet_scope(), &gfid);
719 dict_item = proto_tree_add_guid_format(subtree, hf_glusterfs_gfid,
720 tvb, offset, val_len, &gfid,
721 "%s: %s", key, gfid_s);
722 } else if (val_type == 6) {
723 val_len = tvb_get_ntohl(tvb, offset);
724 offset += 4;
726 /* read the value, possibly '\0' terminated */
728 /* keys named "gfid-req" contain a GFID in hex */
729 if (val_len == 16 && (
730 !strncmp("gfid-req", key, 8) ||
731 !strncmp("transaction_id", key, 14) ||
732 !strncmp("originator_uuid", key, 15))) {
733 tvb_get_ntohguid(tvb, offset, &gfid);
735 gfid_s = guid_to_str(wmem_packet_scope(), &gfid);
736 dict_item = proto_tree_add_guid_format(subtree, hf_glusterfs_gfid,
737 tvb, offset, 16, &gfid,
738 "%s: %s", key, gfid_s);
739 /* this is a changelog in binary format */
740 } else if (val_len == 12 && !strncmp("trusted.afr.", key, 12)) {
741 dict_item = proto_tree_add_bytes_format(subtree, hf_gluster_trusted_afr_key, tvb, offset, 12,
742 NULL, "%s: 0x%.8x%.8x%.8x", key,
743 tvb_get_letohl(tvb, offset + 0),
744 tvb_get_letohl(tvb, offset + 4),
745 tvb_get_letohl(tvb, offset + 8));
746 } else {
747 value = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, val_len, ENC_ASCII);
748 dict_item = proto_tree_add_string_format(subtree, hf_gluster_dict_value, tvb, offset, val_len, value, "%s: %s",
749 key, value);
753 offset += val_len;
754 proto_item_set_len (dict_item, offset - start_offset2);
757 proto_item_set_len (subtree_item, offset - start_offset);
759 return offset;
763 GlusterFS protocol error codes, from the GlusterFS source.
765 The GlusterFS server maps system errno values to these codes,
766 which is a Good Thing, because not only are some errno values
767 different on different platforms, some errno values on some
768 Linux platforms differ from the equivalent values on most
769 Linux platforms, meaning that if a server sends one of its
770 errno values to a client with a different operating system -
771 or if a Linux server sends one of its errno values to a Linux
772 client with different errno values - the errno might not be
773 interpreted correctly.
775 Copyright notice from the GlusterFS code's compat-errno.h,
776 from which these codes, CF_ERROR_CODE_ names, and error
777 message strings are taken:
779 Copyright (c) 2008-2012 Red Hat, Inc. <http://www.redhat.com>
780 This file is part of GlusterFS.
782 This file is licensed to you under your choice of the GNU Lesser
783 General Public License, version 3 or any later version (LGPLv3 or
784 later), or the GNU General Public License, version 2 (GPLv2), in all
785 cases as published by the Free Software Foundation.
788 static const value_string glusterfs_error_codes[] = {
789 {0, "Success"}, /* GF_ERROR_CODE_SUCCESS */
790 {1, "Operation not permitted"}, /* GF_ERROR_CODE_PERM */
791 {2, "No such file or directory"}, /* GF_ERROR_CODE_NOENT */
792 {3, "No such process"}, /* GF_ERROR_CODE_SRCH */
793 {4, "Interrupted system call"}, /* GF_ERROR_CODE_INTR */
794 {5, "I/O error"}, /* GF_ERROR_CODE_IO */
795 {6, "No such device or address"}, /* GF_ERROR_CODE_NXIO */
796 {7, "Argument list too long"}, /* GF_ERROR_CODE_2BIG */
797 {8, "Exec format error"}, /* GF_ERROR_CODE_NOEXEC */
798 {9, "Bad file number"}, /* GF_ERROR_CODE_BADF */
799 {10, "No child processes"}, /* GF_ERROR_CODE_CHILD */
800 {11, "Try again"}, /* GF_ERROR_CODE_AGAIN */
801 {12, "Out of memory"}, /* GF_ERROR_CODE_NOMEM */
802 {13, "Permission denied"}, /* GF_ERROR_CODE_ACCES */
803 {14, "Bad address"}, /* GF_ERROR_CODE_FAULT */
804 {15, "Block device required"}, /* GF_ERROR_CODE_NOTBLK */
805 {16, "Device or resource busy"}, /* GF_ERROR_CODE_BUSY */
806 {17, "File exists"}, /* GF_ERROR_CODE_EXIST */
807 {18, "Cross-device link"}, /* GF_ERROR_CODE_XDEV */
808 {19, "No such device"}, /* GF_ERROR_CODE_NODEV */
809 {20, "Not a directory"}, /* GF_ERROR_CODE_NOTDIR */
810 {21, "Is a directory"}, /* GF_ERROR_CODE_ISDIR */
811 {22, "Invalid argument"}, /* GF_ERROR_CODE_INVAL */
812 {23, "File table overflow"}, /* GF_ERROR_CODE_NFILE */
813 {24, "Too many open files"}, /* GF_ERROR_CODE_MFILE */
814 {25, "Not a typewriter"}, /* GF_ERROR_CODE_NOTTY */
815 {26, "Text file busy"}, /* GF_ERROR_CODE_TXTBSY */
816 {27, "File too large"}, /* GF_ERROR_CODE_FBIG */
817 {28, "No space left on device"}, /* GF_ERROR_CODE_NOSPC */
818 {29, "Illegal seek"}, /* GF_ERROR_CODE_SPIPE */
819 {30, "Read-only file system"}, /* GF_ERROR_CODE_ROFS */
820 {31, "Too many links"}, /* GF_ERROR_CODE_MLINK */
821 {32, "Broken pipe"}, /* GF_ERROR_CODE_PIPE */
822 {33, "Math argument out of domain of func"}, /* GF_ERROR_CODE_DOM */
823 {34, "Math result not representable"}, /* GF_ERROR_CODE_RANGE */
824 {35, "Resource deadlock would occur"}, /* GF_ERROR_CODE_DEADLK */
825 {36, "File name too long"}, /* GF_ERROR_CODE_NAMETOOLONG */
826 {37, "No record locks available"}, /* GF_ERROR_CODE_NOLCK */
827 {38, "Function not implemented"}, /* GF_ERROR_CODE_NOSYS */
828 {39, "Directory not empty"}, /* GF_ERROR_CODE_NOTEMPTY */
829 {40, "Too many symbolic links encountered"}, /* GF_ERROR_CODE_LOOP */
831 {42, "No message of desired type"}, /* GF_ERROR_CODE_NOMSG */
832 {43, "Identifier removed"}, /* GF_ERROR_CODE_IDRM */
833 {44, "Channel number out of range"}, /* GF_ERROR_CODE_CHRNG */
834 {45, "Level 2 not synchronized"}, /* GF_ERROR_CODE_L2NSYNC */
835 {46, "Level 3 halted"}, /* GF_ERROR_CODE_L3HLT */
836 {47, "Level 3 reset"}, /* GF_ERROR_CODE_L3RST */
837 {48, "Link number out of range"}, /* GF_ERROR_CODE_LNRNG */
838 {49, "Protocol driver not attached"}, /* GF_ERROR_CODE_UNATCH */
839 {50, "No CSI structure available"}, /* GF_ERROR_CODE_NOCSI */
840 {51, "Level 2 halted"}, /* GF_ERROR_CODE_L2HLT */
841 {52, "Invalid exchange"}, /* GF_ERROR_CODE_BADE */
842 {53, "Invalid request descriptor"}, /* GF_ERROR_CODE_BADR */
843 {54, "Exchange full"}, /* GF_ERROR_CODE_XFULL */
844 {55, "No anode"}, /* GF_ERROR_CODE_NOANO */
845 {56, "Invalid request code"}, /* GF_ERROR_CODE_BADRQC */
846 {57, "Invalid slot"}, /* GF_ERROR_CODE_BADSLT */
847 {59, "Bad font file format"}, /* GF_ERROR_CODE_BFONT */
848 {60, "Device not a stream"}, /* GF_ERROR_CODE_NOSTR */
849 {61, "No data available"}, /* GF_ERROR_CODE_NODATA */
850 {62, "Timer expired"}, /* GF_ERROR_CODE_TIME */
851 {63, "Out of streams resources"}, /* GF_ERROR_CODE_NOSR */
852 {64, "Machine is not on the network"}, /* GF_ERROR_CODE_NONET */
853 {65, "Package not installed"}, /* GF_ERROR_CODE_NOPKG */
854 {66, "Object is remote"}, /* GF_ERROR_CODE_REMOTE */
855 {67, "Link has been severed"}, /* GF_ERROR_CODE_NOLINK */
856 {68, "Advertise error"}, /* GF_ERROR_CODE_ADV */
857 {69, "Srmount error"}, /* GF_ERROR_CODE_SRMNT */
858 {70, "Communication error on send"}, /* GF_ERROR_CODE_COMM */
859 {71, "Protocol error"}, /* GF_ERROR_CODE_PROTO */
860 {72, "Multihop attempted"}, /* GF_ERROR_CODE_MULTIHOP */
861 {73, "RFS specific error"}, /* GF_ERROR_CODE_DOTDOT */
862 {74, "Not a data message"}, /* GF_ERROR_CODE_BADMSG */
863 {75, "Value too large for defined data type"}, /* GF_ERROR_CODE_OVERFLOW */
864 {76, "Name not unique on network"}, /* GF_ERROR_CODE_NOTUNIQ */
865 {77, "File descriptor in bad state"}, /* GF_ERROR_CODE_BADFD */
866 {78, "Remote address changed"}, /* GF_ERROR_CODE_REMCHG */
867 {79, "Can not access a needed shared library"}, /* GF_ERROR_CODE_LIBACC */
868 {80, "Accessing a corrupted shared library"}, /* GF_ERROR_CODE_LIBBAD */
869 {81, ".lib section in a.out corrupted"}, /* GF_ERROR_CODE_LIBSCN */
870 {82, "Attempting to link in too many shared libraries"}, /* GF_ERROR_CODE_LIBMAX */
871 {83, "Cannot exec a shared library directly"}, /* GF_ERROR_CODE_LIBEXEC */
872 {84, "Illegal byte sequence"}, /* GF_ERROR_CODE_ILSEQ */
873 {85, "Interrupted system call should be restarted"}, /* GF_ERROR_CODE_RESTART */
874 {86, "Streams pipe error"}, /* GF_ERROR_CODE_STRPIPE */
875 {87, "Too many users"}, /* GF_ERROR_CODE_USERS */
876 {88, "Socket operation on non-socket"}, /* GF_ERROR_CODE_NOTSOCK */
877 {89, "Destination address required"}, /* GF_ERROR_CODE_DESTADDRREQ */
878 {90, "Message too long"}, /* GF_ERROR_CODE_MSGSIZE */
879 {91, "Protocol wrong type for socket"}, /* GF_ERROR_CODE_PROTOTYPE */
880 {92, "Protocol not available"}, /* GF_ERROR_CODE_NOPROTOOPT */
881 {93, "Protocol not supported"}, /* GF_ERROR_CODE_PROTONOSUPPORT */
882 {94, "Socket type not supported"}, /* GF_ERROR_CODE_SOCKTNOSUPPORT */
883 {95, "Operation not supported on transport endpoint"}, /* GF_ERROR_CODE_OPNOTSUPP */
884 {96, "Protocol family not supported"}, /* GF_ERROR_CODE_PFNOSUPPORT */
885 {97, "Address family not supported by protocol"}, /* GF_ERROR_CODE_AFNOSUPPORT */
886 {98, "Address already in use"}, /* GF_ERROR_CODE_ADDRINUSE */
887 {99, "Cannot assign requested address"}, /* GF_ERROR_CODE_ADDRNOTAVAIL */
888 {100, "Network is down"}, /* GF_ERROR_CODE_NETDOWN */
889 {101, "Network is unreachable"}, /* GF_ERROR_CODE_NETUNREACH */
890 {102, "Network dropped connection because of reset"}, /* GF_ERROR_CODE_NETRESET */
891 {103, "Software caused connection abort"}, /* GF_ERROR_CODE_CONNABORTED */
892 {104, "Connection reset by peer"}, /* GF_ERROR_CODE_CONNRESET */
893 {105, "No buffer space available"}, /* GF_ERROR_CODE_NOBUFS */
894 {106, "Transport endpoint is already connected"}, /* GF_ERROR_CODE_ISCONN */
895 {107, "Transport endpoint is not connected"}, /* GF_ERROR_CODE_NOTCONN */
896 {108, "Cannot send after transport endpoint shutdown"}, /* GF_ERROR_CODE_SHUTDOWN */
897 {109, "Too many references: cannot splice"}, /* GF_ERROR_CODE_TOOMANYREFS */
898 {110, "Connection timed out"}, /* GF_ERROR_CODE_TIMEDOUT */
899 {111, "Connection refused"}, /* GF_ERROR_CODE_CONNREFUSED */
900 {112, "Host is down"}, /* GF_ERROR_CODE_HOSTDOWN */
901 {113, "No route to host"}, /* GF_ERROR_CODE_HOSTUNREACH */
902 {114, "Operation already in progress"}, /* GF_ERROR_CODE_ALREADY */
903 {115, "Operation now in progress"}, /* GF_ERROR_CODE_INPROGRESS */
904 {116, "Stale NFS file handle"}, /* GF_ERROR_CODE_STALE */
905 {117, "Structure needs cleaning"}, /* GF_ERROR_CODE_UCLEAN */
906 {118, "Not a XENIX named type file"}, /* GF_ERROR_CODE_NOTNAM */
907 {119, "No XENIX semaphores available"}, /* GF_ERROR_CODE_NAVAIL */
908 {120, "Is a named type file"}, /* GF_ERROR_CODE_ISNAM */
909 {121, "Remote I/O error"}, /* GF_ERROR_CODE_REMOTEIO */
910 {122, "Quota exceeded"}, /* GF_ERROR_CODE_DQUOT */
911 {123, "No medium found"}, /* GF_ERROR_CODE_NOMEDIUM */
912 {124, "Wrong medium type"}, /* GF_ERROR_CODE_MEDIUMTYPE */
913 {125, "Operation Canceled"}, /* GF_ERROR_CODE_CANCELED */
914 {126, "Required key not available"}, /* GF_ERROR_CODE_NOKEY */
915 {127, "Key has expired"}, /* GF_ERROR_CODE_KEYEXPIRED */
916 {128, "Key has been revoked"}, /* GF_ERROR_CODE_KEYREVOKED */
917 {129, "Key was rejected by service"}, /* GF_ERROR_CODE_KEYREJECTED */
919 /* for robust mutexes */
920 {130, "Owner died"}, /* GF_ERROR_CODE_OWNERDEAD */
921 {131, "State not recoverable"}, /* GF_ERROR_CODE_NOTRECOVERABLE */
924 * "Should never be seen by user programs"
925 * These are internal system call returns (Linux?) used to
926 * indicate various internal conditions such as "restart
927 * this system call" indications.
929 {512, "Restart system call"}, /* GF_ERROR_CODE_RESTARTSYS */
930 {513, "Restart system call (no intr)"}, /* GF_ERROR_CODE_RESTARTNOINTR */
931 {514, "Restart if no signal handler"}, /* GF_ERROR_CODE_RESTARTNOHAND */
932 {515, "No ioctl command"}, /* GF_ERROR_CODE_NOIOCTLCMD */
933 {516, "Restart system call by calling sys_restart_syscall"}, /* GF_ERROR_CODE_RESTART_RESTARTBLOCK */
935 /* Defined for the NFSv3 protocol */
936 {521, "Illegal NFS file handle"}, /* GF_ERROR_CODE_BADHANDLE */
937 {522, "Update synchronization mismatch"}, /* GF_ERROR_CODE_NOTSYNC */
938 {523, "Cookie is stale"}, /* GF_ERROR_CODE_BADCOOKIE */
939 {524, "Operation is not supported"}, /* GF_ERROR_CODE_NOTSUPP */
940 {525, "Buffer or request is too small"}, /* GF_ERROR_CODE_TOOSMALL */
941 {526, "An untranslatable error occurred"}, /* GF_ERROR_CODE_SERVERFAULT */
942 {527, "Type not supported by server"}, /* GF_ERROR_CODE_BADTYPE */
943 {528, "Request initiated, but will not complete before timeout"}, /* GF_ERROR_CODE_JUKEBOX */
944 {529, "iocb queued, will get completion event"}, /* GF_ERROR_CODE_IOCBQUEUED */
945 {530, "iocb queued, will trigger a retry"}, /* GF_ERROR_CODE_IOCBRETRY */
947 /* Darwin */
948 {701, "No such policy registered"}, /* GF_ERROR_CODE_NOPOLICY */
949 {702, "Malformed Mach-O file"}, /* GF_ERROR_CODE_BADMACHO */
950 {703, "Device power is off"}, /* GF_ERROR_CODE_PWROFF */
951 {704, "Device error" /* e.g., paper out */}, /* GF_ERROR_CODE_DEVERR */
952 {705, "Bad CPU type in executable"}, /* GF_ERROR_CODE_BADARCH */
953 {706, "Bad executable"}, /* GF_ERROR_CODE_BADEXEC */
954 {707, "Shared library version mismatch"}, /* GF_ERROR_CODE_SHLIBVERS */
956 /* Solaris */
957 {801, "Facility is not active"}, /* GF_ERROR_CODE_NOTACTIVE */
958 {802, "Locked lock was unmapped"}, /* GF_ERROR_CODE_LOCKUNMAPPED */
960 /* BSD system */
961 {901, "Too many processes"}, /* GF_ERROR_CODE_PROCLIM */
962 {902, "RPC struct is bad"}, /* GF_ERROR_CODE_BADRPC */
963 {903, "RPC version wrong"}, /* GF_ERROR_CODE_RPCMISMATCH */
964 {904, "RPC prog. not avail"}, /* GF_ERROR_CODE_PROGUNAVAIL */
965 {905, "Program version wrong"}, /* GF_ERROR_CODE_PROGMISMATCH */
966 {905, "Bad procedure for program"}, /* GF_ERROR_CODE_PROCUNAVAIL */
967 {906, "Inappropriate file type or format"}, /* GF_ERROR_CODE_FTYPE */
968 {907, "Authentication error"}, /* GF_ERROR_CODE_AUTH */
969 {908, "Need authenticator"}, /* GF_ERROR_CODE_NEEDAUTH */
970 {909, "Programming error"}, /* GF_ERROR_CODE_DOOFUS */
971 {1024, "Unknown"}, /* GF_ERROR_CODE_UNKNOWN */
973 {0, NULL}
975 static value_string_ext glusterfs_error_codes_ext = VALUE_STRING_EXT_INIT(glusterfs_error_codes);
978 gluster_dissect_common_reply(tvbuff_t *tvb, int offset,
979 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
981 proto_item *errno_item;
982 unsigned op_errno;
984 offset = dissect_rpc_uint32(tvb, tree, hf_gluster_op_ret, offset);
986 op_errno = tvb_get_ntohl(tvb, offset);
987 errno_item = proto_tree_add_int(tree, hf_gluster_op_errno, tvb,
988 offset, 4, op_errno);
989 proto_item_append_text(errno_item, " (%s)", val_to_str_ext_const(op_errno, &glusterfs_error_codes_ext, "Unknown"));
990 offset += 4;
992 return offset;
995 static int
996 gluster_local_dissect_common_reply(tvbuff_t *tvb,
997 packet_info *pinfo, proto_tree *tree, void* data)
999 return gluster_dissect_common_reply(tvb, 0, pinfo, tree, data);
1002 static int
1003 _glusterfs_gfs3_common_readdir_reply(tvbuff_t *tvb, proto_tree *tree, int offset)
1005 proto_item *errno_item;
1006 unsigned op_errno;
1008 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_entries, offset);
1010 op_errno = tvb_get_ntohl(tvb, offset);
1011 errno_item = proto_tree_add_int(tree, hf_gluster_op_errno, tvb,
1012 offset, 4, op_errno);
1013 if (op_errno == 0)
1014 proto_item_append_text(errno_item, " (More replies follow)");
1015 else if (op_errno == 2 /* GF_ERROR_CODE_NOENT */)
1016 proto_item_append_text(errno_item, " (Last reply)");
1017 offset += 4;
1019 return offset;
1022 static int
1023 glusterfs_gfs3_op_unlink_reply(tvbuff_t *tvb,
1024 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1026 int offset = 0;
1028 offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb,
1029 hf_glusterfs_preparent_iatt, offset);
1030 offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb,
1031 hf_glusterfs_postparent_iatt, offset);
1033 return offset;
1036 static int
1037 glusterfs_gfs3_op_unlink_call(tvbuff_t *tvb,
1038 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1040 int offset = 0;
1042 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_pargfid, offset);
1043 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_path, offset, NULL);
1044 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_bname, offset, NULL);
1045 return offset;
1048 static int
1049 glusterfs_gfs3_op_statfs_reply(tvbuff_t *tvb, packet_info *pinfo,
1050 proto_tree *tree, void* data)
1052 int offset = 0;
1054 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
1055 offset = glusterfs_rpc_dissect_statfs(tree, tvb, offset);
1056 return offset;
1059 static int
1060 glusterfs_gfs3_op_statfs_call(tvbuff_t *tvb,
1061 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1063 int offset = 0;
1065 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1066 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_path, offset, NULL);
1068 return offset;
1071 static int
1072 glusterfs_gfs3_op_flush_call(tvbuff_t *tvb,
1073 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1075 int offset = 0;
1077 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1078 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
1079 return offset;
1082 static int
1083 glusterfs_gfs3_op_setxattr_call(tvbuff_t *tvb,
1084 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1086 int offset = 0;
1088 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1089 offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
1090 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1091 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_path, offset, NULL);
1093 return offset;
1096 static int
1097 glusterfs_gfs3_op_opendir_reply(tvbuff_t *tvb, packet_info *pinfo,
1098 proto_tree *tree, void* data)
1100 int offset = 0;
1102 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
1103 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
1104 return offset;
1107 static int
1108 glusterfs_gfs3_op_opendir_call(tvbuff_t *tvb,
1109 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1111 int offset = 0;
1113 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1114 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_path, offset, NULL);
1116 return offset;
1119 /* rpc/xdr/src/glusterfs3-xdr.c:xdr_gfs3_create_rsp */
1120 static int
1121 glusterfs_gfs3_op_create_reply(tvbuff_t *tvb, packet_info *pinfo,
1122 proto_tree *tree, void* data)
1124 int offset = 0;
1126 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
1127 offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb, hf_glusterfs_iatt,
1128 offset);
1129 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
1130 offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb,
1131 hf_glusterfs_preparent_iatt, offset);
1132 offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb,
1133 hf_glusterfs_postparent_iatt, offset);
1135 return offset;
1138 /* rpc/xdr/src/glusterfs3-xdr.c:xdr_gfs3_create_req */
1139 static int
1140 glusterfs_gfs3_op_create_call(tvbuff_t *tvb,
1141 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1143 int offset = 0;
1144 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_pargfid, offset);
1145 offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
1146 offset = glusterfs_rpc_dissect_mode(tree, tvb, hf_glusterfs_mode, offset);
1147 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_path, offset, NULL);
1148 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_bname, offset, NULL);
1149 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1151 return offset;
1154 static int
1155 glusterfs_gfs3_op_lookup_reply(tvbuff_t *tvb, packet_info *pinfo,
1156 proto_tree *tree, void* data)
1158 int offset = 0;
1159 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
1160 offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb, hf_glusterfs_iatt,
1161 offset);
1162 offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb,
1163 hf_glusterfs_postparent_iatt, offset);
1164 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1166 return offset;
1169 static int
1170 glusterfs_gfs3_op_lookup_call(tvbuff_t *tvb,
1171 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1173 int offset = 0;
1174 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1175 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_pargfid, offset);
1176 offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
1177 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_path, offset, NULL);
1178 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_bname, offset, NULL);
1179 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1181 return offset;
1184 static int
1185 glusterfs_gfs3_op_inodelk_call(tvbuff_t *tvb,
1186 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1188 proto_item *flock_item;
1189 proto_tree *flock_tree;
1190 int start_offset;
1191 int offset = 0;
1193 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1194 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_cmd, offset);
1195 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_type, offset);
1197 start_offset = offset;
1198 flock_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_glusterfs_flock, &flock_item, "Flock");
1199 offset = glusterfs_rpc_dissect_gf_flock(flock_tree, tvb, offset);
1200 proto_item_set_len (flock_item, offset - start_offset);
1202 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_path, offset, NULL);
1203 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_volume, offset, NULL);
1204 return offset;
1207 static int
1208 _glusterfs_gfs_op_readdir_entry(tvbuff_t *tvb, int offset, proto_tree *tree,
1209 bool iatt, bool proto_4_0, bool dict)
1211 proto_item *entry_item;
1212 proto_tree *entry_tree;
1213 const char* path = NULL;
1214 int start_offset = offset;
1216 entry_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_glusterfs_entry, &entry_item, "Entry");
1218 offset = dissect_rpc_uint64(tvb, entry_tree, hf_glusterfs_entry_ino, offset);
1219 offset = dissect_rpc_uint64(tvb, entry_tree, hf_glusterfs_entry_off, offset);
1220 offset = dissect_rpc_uint32(tvb, entry_tree, hf_glusterfs_entry_len, offset);
1221 offset = dissect_rpc_uint32(tvb, entry_tree, hf_glusterfs_entry_type, offset);
1222 offset = dissect_rpc_string(tvb, entry_tree, hf_glusterfs_entry_path, offset, &path);
1224 proto_item_append_text(entry_item, " Path: %s", path);
1226 if (iatt) {
1227 if (proto_4_0)
1228 offset = glusterfs_rpc_dissect_gfx_iatt(entry_tree, tvb,
1229 hf_glusterfs_iattx, offset);
1230 else
1231 offset = glusterfs_rpc_dissect_gf_iatt(entry_tree, tvb,
1232 hf_glusterfs_iatt, offset);
1234 if (dict) {
1235 if (proto_4_0)
1236 offset = gluster_rpc4_0_dissect_dict(entry_tree, tvb, hf_glusterfs_dict, offset);
1237 else
1238 offset = gluster_rpc_dissect_dict(entry_tree, tvb, hf_glusterfs_dict, offset);
1241 proto_item_set_len (entry_item, offset - start_offset);
1243 return offset;
1246 static int
1247 glusterfs_gfs3_op_readdirp_entry(tvbuff_t *tvb, int offset,
1248 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1250 return _glusterfs_gfs_op_readdir_entry(tvb, offset, tree, true, false, false);
1253 static int
1254 glusterfs_gfs3_3_op_readdir_entry(tvbuff_t *tvb, int offset,
1255 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1257 return _glusterfs_gfs_op_readdir_entry(tvb, offset, tree, false, false, false);
1260 static int
1261 glusterfs_gfs3_3_op_readdirp_entry(tvbuff_t *tvb, int offset,
1262 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1264 return _glusterfs_gfs_op_readdir_entry(tvb, offset, tree, true, false, true);
1267 static int
1268 glusterfs_gfs4_0_op_readdir_entry(tvbuff_t *tvb, int offset,
1269 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1271 return _glusterfs_gfs_op_readdir_entry(tvb, offset, tree, false, true, false);
1274 static int
1275 glusterfs_gfs4_0_op_readdirp_entry(tvbuff_t *tvb, int offset,
1276 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1278 return _glusterfs_gfs_op_readdir_entry(tvb, offset, tree, true, true, true);
1281 /* details in xlators/storage/posix/src/posix.c:posix_fill_readdir() */
1282 static int
1283 glusterfs_gfs3_op_readdirp_reply(tvbuff_t *tvb, packet_info *pinfo,
1284 proto_tree *tree, void* data _U_)
1286 int offset = 0;
1287 offset = _glusterfs_gfs3_common_readdir_reply(tvb, tree, offset);
1288 offset = dissect_rpc_list(tvb, pinfo, tree, offset,
1289 glusterfs_gfs3_op_readdirp_entry, NULL);
1291 return offset;
1294 static int
1295 glusterfs_gfs3_op_readdirp_call(tvbuff_t *tvb,
1296 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1298 int offset = 0;
1299 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1300 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
1301 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
1302 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_size, offset);
1304 return offset;
1307 static int
1308 glusterfs_gfs3_op_setattr_reply(tvbuff_t *tvb, packet_info *pinfo,
1309 proto_tree *tree, void* data)
1311 int offset = 0;
1313 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
1314 offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb,
1315 hf_glusterfs_preop_iatt, offset);
1316 offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb,
1317 hf_glusterfs_postop_iatt, offset);
1319 return offset;
1322 static int
1323 glusterfs_rpc_dissect_setattr(proto_tree *tree, tvbuff_t *tvb, int offset)
1325 static int * const flag_bits[] = {
1326 &hf_glusterfs_setattr_set_mode,
1327 &hf_glusterfs_setattr_set_uid,
1328 &hf_glusterfs_setattr_set_gid,
1329 &hf_glusterfs_setattr_set_size,
1330 &hf_glusterfs_setattr_set_atime,
1331 &hf_glusterfs_setattr_set_mtime,
1332 &hf_glusterfs_setattr_set_reserved,
1333 NULL
1336 proto_tree_add_bitmask(tree, tvb, offset, hf_glusterfs_setattr_valid,
1337 ett_glusterfs_setattr_valid, flag_bits, ENC_NA);
1338 offset += 4;
1340 return offset;
1343 static int
1344 glusterfs_gfs3_op_setattr_call(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1346 int offset = 0;
1348 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid,
1349 offset);
1350 offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb, hf_glusterfs_iatt,
1351 offset);
1352 offset = glusterfs_rpc_dissect_setattr(tree, tvb, offset);
1353 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_path, offset, NULL);
1355 return offset;
1358 /*GlusterFS 3_3 fops */
1360 static int
1361 glusterfs_gfs3_3_op_stat_call(tvbuff_t *tvb,
1362 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1364 int offset = 0;
1366 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1367 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1368 return offset;
1372 static int
1373 glusterfs_gfs3_3_op_stat_reply(tvbuff_t *tvb, packet_info *pinfo,
1374 proto_tree *tree, void* data)
1376 int offset = 0;
1378 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
1379 offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb, hf_glusterfs_iatt,
1380 offset);
1381 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict,
1382 offset);
1384 return offset;
1387 /* glusterfs_gfs3_3_op_mknod_reply() is also used as a ..mkdir_reply() */
1388 static int
1389 glusterfs_gfs3_3_op_mknod_reply(tvbuff_t *tvb, packet_info *pinfo,
1390 proto_tree *tree, void* data)
1392 int offset = 0;
1394 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
1395 offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb, hf_glusterfs_iatt,
1396 offset);
1397 offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb,
1398 hf_glusterfs_preparent_iatt, offset);
1399 offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb,
1400 hf_glusterfs_postparent_iatt, offset);
1401 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict,
1402 offset);
1404 return offset;
1407 static int
1408 glusterfs_gfs3_3_op_mknod_call(tvbuff_t *tvb,
1409 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1411 int offset = 0;
1413 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_pargfid, offset);
1414 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
1415 offset = glusterfs_rpc_dissect_mode(tree, tvb, hf_glusterfs_mode, offset);
1416 offset = glusterfs_rpc_dissect_mode(tree, tvb, hf_glusterfs_umask, offset);
1417 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_bname, offset, NULL);
1418 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1420 return offset;
1423 static int
1424 glusterfs_gfs3_3_op_mkdir_call(tvbuff_t *tvb,
1425 packet_info *pinfo, proto_tree *tree, void* data _U_)
1427 int offset = 0;
1428 const char *name = NULL;
1430 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_pargfid, offset);
1431 offset = glusterfs_rpc_dissect_mode(tree, tvb, hf_glusterfs_mode, offset);
1432 offset = glusterfs_rpc_dissect_mode(tree, tvb, hf_glusterfs_umask, offset);
1433 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_bname, offset, &name);
1434 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1435 col_append_fstr(pinfo->cinfo, COL_INFO, ", Filename: %s", name);
1437 return offset;
1440 static int
1441 glusterfs_gfs3_3_op_readlink_reply(tvbuff_t *tvb,
1442 packet_info *pinfo, proto_tree *tree, void* data)
1444 int offset = 0;
1445 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
1446 offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb, hf_glusterfs_iatt,
1447 offset);
1448 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_path, offset,
1449 NULL);
1450 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict,
1451 offset);
1452 return offset;
1455 static int
1456 glusterfs_gfs3_3_op_readlink_call(tvbuff_t *tvb,
1457 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1459 int offset = 0;
1460 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1461 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_size, offset);
1462 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1464 return offset;
1467 /* glusterfs_gfs3_3_op_unlink_reply() is also used for ...rmdir_reply() */
1468 static int
1469 glusterfs_gfs3_3_op_unlink_reply(tvbuff_t *tvb, packet_info *pinfo,
1470 proto_tree *tree, void* data)
1472 int offset = 0;
1474 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
1475 offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb,
1476 hf_glusterfs_preparent_iatt, offset);
1477 offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb,
1478 hf_glusterfs_postparent_iatt, offset);
1479 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1481 return offset;
1484 static int
1485 glusterfs_gfs3_3_op_unlink_call(tvbuff_t *tvb,
1486 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1488 unsigned xflags;
1489 int offset = 0;
1491 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_pargfid, offset);
1492 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_bname, offset, NULL);
1493 xflags = tvb_get_ntohl(tvb, offset);
1494 proto_tree_add_uint_format(tree, hf_glusterfs_xflags, tvb, offset, 4, xflags, "Flags: 0%02o", xflags);
1495 offset += 4;
1496 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1498 return offset;
1501 static int
1502 glusterfs_gfs3_3_op_rmdir_call(tvbuff_t *tvb,
1503 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1505 unsigned xflags;
1506 int offset = 0;
1508 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_pargfid, offset);
1509 xflags = tvb_get_ntohl(tvb, offset);
1510 proto_tree_add_uint_format(tree, hf_glusterfs_xflags, tvb, offset, 4, xflags, "Flags: 0%02o", xflags);
1511 offset += 4;
1512 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_bname, offset, NULL);
1513 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1515 return offset;
1518 static int
1519 glusterfs_gfs3_3_op_symlink_call(tvbuff_t *tvb,
1520 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1522 int offset = 0;
1524 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_pargfid, offset);
1525 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_bname, offset, NULL);
1526 offset = glusterfs_rpc_dissect_mode(tree, tvb, hf_glusterfs_umask, offset);
1528 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_linkname, offset, NULL);
1529 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1531 return offset;
1534 static int
1535 glusterfs_gfs3_3_op_rename_call(tvbuff_t *tvb,
1536 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1538 int offset = 0;
1540 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_oldgfid, offset);
1541 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_newgfid, offset);
1542 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_oldbname, offset, NULL);
1543 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_newbname, offset, NULL);
1544 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1546 return offset;
1549 static int
1550 glusterfs_gfs3_3_op_rename_reply(tvbuff_t *tvb, packet_info *pinfo,
1551 proto_tree *tree, void* data)
1553 proto_tree *old_tree, *new_tree;
1554 proto_item *old_item, *new_item;
1555 int start_offset;
1556 int offset = 0;
1558 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
1559 offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb, hf_glusterfs_iatt,
1560 offset);
1562 start_offset = offset;
1563 old_tree = proto_tree_add_subtree(tree, tvb, offset, -1,
1564 ett_glusterfs_parent_iatt, &old_item, "Old parent");
1565 offset = glusterfs_rpc_dissect_gf_iatt(old_tree, tvb,
1566 hf_glusterfs_preparent_iatt, offset);
1567 offset = glusterfs_rpc_dissect_gf_iatt(old_tree, tvb,
1568 hf_glusterfs_postparent_iatt, offset);
1569 proto_item_set_len (old_item, offset - start_offset);
1571 start_offset = offset;
1572 new_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_glusterfs_parent_iatt, &new_item, "New parent");
1573 offset = glusterfs_rpc_dissect_gf_iatt(new_tree, tvb,
1574 hf_glusterfs_preparent_iatt, offset);
1575 offset = glusterfs_rpc_dissect_gf_iatt(new_tree, tvb,
1576 hf_glusterfs_postparent_iatt, offset);
1577 proto_item_set_len (new_item, offset - start_offset);
1579 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1581 return offset;
1584 static int
1585 glusterfs_gfs3_3_op_link_call(tvbuff_t *tvb,
1586 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1588 int offset = 0;
1590 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_oldgfid, offset);
1591 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_newgfid, offset);
1592 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_newbname, offset, NULL);
1593 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1595 return offset;
1598 static int
1599 glusterfs_gfs3_3_op_truncate_call(tvbuff_t *tvb,
1600 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1602 int offset = 0;
1604 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1605 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
1606 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1608 return offset;
1611 static int
1612 glusterfs_gfs3_3_op_open_reply(tvbuff_t *tvb, packet_info *pinfo,
1613 proto_tree *tree, void* data)
1615 int offset = 0;
1617 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
1618 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
1619 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1620 return offset;
1623 static int
1624 glusterfs_gfs3_3_op_open_call(tvbuff_t *tvb,
1625 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1627 int offset = 0;
1628 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1629 offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
1630 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1632 return offset;
1635 static int
1636 glusterfs_gfs3_3_op_read_reply(tvbuff_t *tvb, packet_info *pinfo,
1637 proto_tree *tree, void* data)
1639 int offset = 0;
1641 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
1642 offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb, hf_glusterfs_iatt,
1643 offset);
1644 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_size, offset);
1645 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict,
1646 offset);
1648 return offset;
1651 static int
1652 glusterfs_gfs3_3_op_read_call(tvbuff_t *tvb,
1653 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1655 int offset = 0;
1657 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1658 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
1659 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
1660 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_size, offset);
1661 offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
1662 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1664 return offset;
1667 static int
1668 glusterfs_gfs3_3_op_write_call(tvbuff_t *tvb,
1669 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1671 int offset = 0;
1673 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1674 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
1675 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
1676 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_size, offset);
1677 offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
1678 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1680 return offset;
1683 static int
1684 glusterfs_gfs3_3_op_statfs_reply(tvbuff_t *tvb, packet_info *pinfo,
1685 proto_tree *tree, void* data)
1687 int offset = 0;
1689 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
1690 offset = glusterfs_rpc_dissect_statfs(tree, tvb, offset);
1691 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1693 return offset;
1696 static int
1697 glusterfs_gfs3_3_op_statfs_call(tvbuff_t *tvb,
1698 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1700 int offset = 0;
1702 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1703 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1705 return offset;
1708 static int
1709 glusterfs_gfs3_3_op_flush_call(tvbuff_t *tvb,
1710 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1712 int offset = 0;
1714 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1715 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
1716 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1718 return offset;
1721 static int
1722 glusterfs_gfs3_3_op_setxattr_call(tvbuff_t *tvb,
1723 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1725 int offset = 0;
1727 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1728 offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
1729 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1730 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1732 return offset;
1735 static int
1736 glusterfs_gfs3_3_op_getxattr_call(tvbuff_t *tvb,
1737 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1739 int offset = 0;
1741 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1742 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_namelen, offset);
1743 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_name, offset, NULL);
1744 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1746 return offset;
1750 static int
1751 glusterfs_gfs3_3_op_getxattr_reply(tvbuff_t *tvb,
1752 packet_info *pinfo, proto_tree *tree, void* data)
1754 int offset = 0;
1756 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
1757 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1758 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1760 return offset;
1763 static int
1764 glusterfs_gfs3_3_op_removexattr_call(tvbuff_t *tvb,
1765 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1767 int offset = 0;
1769 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1770 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_name, offset, NULL);
1771 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1773 return offset;
1776 static int
1777 glusterfs_gfs3_3_op_fsync_call(tvbuff_t *tvb,
1778 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1780 static int * const flag_bits[] = {
1781 &hf_glusterfs_fsync_flag_datasync,
1782 &hf_glusterfs_fsync_flag_unknown,
1783 NULL
1785 int offset = 0;
1787 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1788 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
1790 proto_tree_add_bitmask(tree, tvb, offset,
1791 hf_glusterfs_fsync_flags,
1792 ett_glusterfs_fsync_flags, flag_bits, ENC_NA);
1793 offset += 4;
1795 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1797 return offset;
1800 static int
1801 glusterfs_gfs3_3_op_opendir_reply(tvbuff_t *tvb,
1802 packet_info *pinfo, proto_tree *tree, void* data)
1804 int offset = 0;
1806 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
1807 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
1808 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1810 return offset;
1813 static int
1814 glusterfs_gfs3_3_op_opendir_call(tvbuff_t *tvb,
1815 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1817 int offset = 0;
1818 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1819 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1821 return offset;
1824 static int
1825 glusterfs_gfs3_3_op_create_reply(tvbuff_t *tvb, packet_info *pinfo,
1826 proto_tree *tree, void* data)
1828 int offset = 0;
1830 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
1831 offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb, hf_glusterfs_iatt,
1832 offset);
1833 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
1834 offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb,
1835 hf_glusterfs_preparent_iatt, offset);
1836 offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb,
1837 hf_glusterfs_postparent_iatt, offset);
1838 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1840 return offset;
1844 static int
1845 glusterfs_gfs3_3_op_create_call(tvbuff_t *tvb,
1846 packet_info *pinfo, proto_tree *tree, void* data _U_)
1848 const char *name = NULL;
1849 int offset = 0;
1851 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_pargfid, offset);
1852 offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
1853 offset = glusterfs_rpc_dissect_mode(tree, tvb, hf_glusterfs_mode, offset);
1854 offset = glusterfs_rpc_dissect_mode(tree, tvb, hf_glusterfs_umask, offset);
1855 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_bname, offset, &name);
1856 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1857 col_append_fstr(pinfo->cinfo, COL_INFO, ", Filename: %s", name);
1859 return offset;
1862 static int
1863 glusterfs_gfs3_3_op_ftruncate_call(tvbuff_t *tvb,
1864 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1866 int offset = 0;
1868 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1869 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
1870 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
1871 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1873 return offset;
1876 static int
1877 glusterfs_gfs3_3_op_fstat_call(tvbuff_t *tvb,
1878 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1880 int offset = 0;
1882 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1883 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
1884 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1886 return offset;
1889 static int
1890 glusterfs_gfs3_3_op_fstat_reply(tvbuff_t *tvb, packet_info *pinfo,
1891 proto_tree *tree, void* data)
1893 int offset = 0;
1895 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
1896 offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb, hf_glusterfs_iatt,
1897 offset);
1898 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict,
1899 offset);
1901 return offset;
1904 static int
1905 glusterfs_gfs3_3_op_lk_call(tvbuff_t *tvb,
1906 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1908 int offset = 0;
1910 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1911 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
1912 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_cmd, offset);
1913 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_type, offset);
1914 offset = glusterfs_rpc_dissect_gf_2_flock(tree, tvb, offset);
1915 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1917 return offset;
1920 static int
1921 glusterfs_gfs3_3_op_lk_reply(tvbuff_t *tvb,
1922 packet_info *pinfo, proto_tree *tree, void* data)
1924 int offset = 0;
1926 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
1927 offset = glusterfs_rpc_dissect_gf_2_flock(tree, tvb, offset);
1928 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1930 return offset;
1933 static int
1934 glusterfs_gfs3_3_op_access_call(tvbuff_t *tvb,
1935 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1937 int offset = 0;
1939 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1940 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_mask, offset);
1941 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1942 return offset;
1945 static int
1946 glusterfs_gfs3_3_op_lookup_call(tvbuff_t *tvb,
1947 packet_info *pinfo, proto_tree *tree, void* data _U_)
1949 const char *name = NULL;
1950 int length;
1951 int offset = 0;
1953 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1954 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_pargfid, offset);
1955 offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
1956 length = tvb_get_letohl(tvb, offset);
1957 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_bname, offset, &name);
1958 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1959 if(length == 0)
1960 col_append_str(pinfo->cinfo, COL_INFO, ", Filename: (nameless, by GFID)");
1961 else
1962 col_append_fstr(pinfo->cinfo, COL_INFO, ", Filename: %s", name);
1964 return offset;
1967 static int
1968 glusterfs_gfs3_3_op_readdir_reply(tvbuff_t *tvb,
1969 packet_info *pinfo, proto_tree *tree, void* data _U_)
1971 int offset = 0;
1973 offset = _glusterfs_gfs3_common_readdir_reply(tvb, tree, offset);
1974 offset = dissect_rpc_list(tvb, pinfo, tree, offset,
1975 glusterfs_gfs3_3_op_readdir_entry, NULL);
1976 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1978 return offset;
1981 static int
1982 glusterfs_gfs3_3_op_readdir_call(tvbuff_t *tvb,
1983 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1985 int offset = 0;
1987 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1988 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
1989 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
1990 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_size, offset);
1991 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1993 return offset;
1996 static int
1997 glusterfs_gfs3_3_op_inodelk_call(tvbuff_t *tvb,
1998 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2000 int offset = 0;
2002 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2003 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_cmd, offset);
2004 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_type, offset);
2005 offset = glusterfs_rpc_dissect_gf_2_flock(tree, tvb, offset);
2006 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_volume, offset, NULL);
2007 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2009 return offset;
2012 static int
2013 glusterfs_gfs3_3_op_finodelk_call(tvbuff_t *tvb,
2014 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2016 int offset = 0;
2018 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2019 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2021 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_cmd, offset);
2022 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_type, offset);
2023 offset = glusterfs_rpc_dissect_gf_2_flock(tree, tvb, offset);
2025 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_volume, offset, NULL);
2026 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2028 return offset;
2031 static int
2032 glusterfs_gfs3_3_op_entrylk_call(tvbuff_t *tvb,
2033 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2035 int offset = 0;
2037 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2038 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_cmd, offset);
2039 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_type, offset);
2040 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_entrylk_namelen, offset);
2041 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_name, offset, NULL);
2042 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_volume, offset, NULL);
2043 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2045 return offset;
2048 static int
2049 glusterfs_gfs3_3_op_fentrylk_call(tvbuff_t *tvb,
2050 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2052 int offset = 0;
2054 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2055 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2056 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_cmd, offset);
2057 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_type, offset);
2058 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_entrylk_namelen, offset);
2059 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_name, offset, NULL);
2060 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_volume, offset, NULL);
2061 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2063 return offset;
2066 static int
2067 glusterfs_gfs3_3_op_xattrop_reply(tvbuff_t *tvb,
2068 packet_info *pinfo, proto_tree *tree, void* data)
2070 int offset = 0;
2072 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
2073 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2074 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2076 return offset;
2079 static int
2080 glusterfs_gfs3_3_op_xattrop_call(tvbuff_t *tvb,
2081 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2083 int offset = 0;
2085 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2086 offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
2087 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2088 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2090 return offset;
2093 static int
2094 glusterfs_gfs3_3_op_fxattrop_call(tvbuff_t *tvb,
2095 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2097 int offset = 0;
2099 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2100 offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
2101 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2102 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2103 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2105 return offset;
2108 static int
2109 glusterfs_gfs3_3_op_fgetxattr_call(tvbuff_t *tvb,
2110 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2112 int offset = 0;
2114 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2115 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2116 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_namelen, offset);
2117 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_name, offset, NULL);
2118 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2120 return offset;
2123 static int
2124 gluter_gfs3_3_op_fsetxattr_call(tvbuff_t *tvb,
2125 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2127 int offset = 0;
2129 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2130 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2131 offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
2132 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2133 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2135 return offset;
2138 static int
2139 glusterfs_gfs3_3_op_setattr_reply(tvbuff_t *tvb, packet_info *pinfo,
2140 proto_tree *tree, void* data)
2142 int offset = 0;
2144 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
2145 offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb,
2146 hf_glusterfs_preop_iatt, offset);
2147 offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb,
2148 hf_glusterfs_postop_iatt, offset);
2149 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2151 return offset;
2154 static int
2155 glusterfs_gfs3_3_op_setattr_call(tvbuff_t *tvb,
2156 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2158 int offset = 0;
2160 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid,
2161 offset);
2162 offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb, hf_glusterfs_iatt,
2163 offset);
2164 offset = glusterfs_rpc_dissect_setattr(tree, tvb, offset);
2165 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2167 return offset;
2170 static int
2171 glusterfs_gfs3_3_op_readdirp_reply(tvbuff_t *tvb,
2172 packet_info *pinfo, proto_tree *tree, void* data _U_)
2174 int offset = 0;
2176 offset = _glusterfs_gfs3_common_readdir_reply(tvb, tree, offset);
2177 offset = dissect_rpc_list(tvb, pinfo, tree, offset,
2178 glusterfs_gfs3_3_op_readdirp_entry, NULL);
2179 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2181 return offset;
2184 /* READDIRP and DISCARD both use this */
2185 static int
2186 glusterfs_gfs3_3_op_readdirp_call(tvbuff_t *tvb,
2187 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2189 int offset = 0;
2191 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2192 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2193 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
2194 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_size, offset);
2195 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2197 return offset;
2200 static int
2201 glusterfs_gfs3_3_op_release_call(tvbuff_t *tvb,
2202 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2204 int offset = 0;
2206 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2207 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2208 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2210 return offset;
2213 static int
2214 glusterfs_gfs3_3_op_releasedir_call(tvbuff_t *tvb,
2215 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2217 int offset = 0;
2219 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2220 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2221 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2223 return offset;
2226 static int
2227 glusterfs_gfs3_3_op_fremovexattr_call(tvbuff_t *tvb,
2228 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2230 int offset = 0;
2232 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2233 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2234 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_name, offset, NULL);
2235 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2237 return offset;
2240 static int
2241 glusterfs_gfs3_3_op_fallocate_call(tvbuff_t *tvb,
2242 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2244 int offset = 0;
2246 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2247 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2248 offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
2249 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
2250 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_size, offset);
2251 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2253 return offset;
2256 static int
2257 glusterfs_gfs3_3_op_zerofill_call(tvbuff_t *tvb,
2258 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2260 int offset = 0;
2262 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2263 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2264 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
2265 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_size64, offset);
2267 return offset;
2270 static int
2271 glusterfs_gfs3_3_op_seek_reply(tvbuff_t *tvb, packet_info *pinfo,
2272 proto_tree *tree, void* data)
2274 int offset = 0;
2276 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
2277 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
2278 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2280 return offset;
2283 static int
2284 glusterfs_gfs3_3_op_seek_call(tvbuff_t *tvb, packet_info *pinfo _U_,
2285 proto_tree *tree, void* data _U_)
2287 int offset = 0;
2289 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2290 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2291 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
2292 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_whence, offset);
2293 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2295 return offset;
2298 /* This function is for common replay. RELEASE , RELEASEDIR and some other function use this method */
2301 glusterfs_gfs3_3_op_common_reply(tvbuff_t *tvb, packet_info *pinfo,
2302 proto_tree *tree, void* data)
2304 int offset = 0;
2306 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
2307 offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2309 return offset;
2313 /*GlusterFS 4_0 fops */
2315 static int
2316 glusterfs_gfs4_0_op_stat_call(tvbuff_t *tvb,
2317 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2319 int offset = 0;
2321 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2322 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2323 return offset;
2327 static int
2328 glusterfs_gfs4_0_op_common_iatt_reply(tvbuff_t *tvb, packet_info *pinfo,
2329 proto_tree *tree, void* data)
2331 int offset = 0;
2333 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
2334 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2335 offset = glusterfs_rpc_dissect_gfx_iatt(tree, tvb, hf_glusterfs_iattx,
2336 offset);
2337 return offset;
2340 /* glusterfs_gfs4_0_op_mknod_reply() is also used as a ..mkdir_reply() */
2341 static int
2342 glusterfs_gfs4_0_op_common_3iatt_reply(tvbuff_t *tvb, packet_info *pinfo,
2343 proto_tree *tree, void* data)
2345 int offset = 0;
2347 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
2348 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict,
2349 offset);
2350 offset = glusterfs_rpc_dissect_gfx_iatt(tree, tvb, hf_glusterfs_iattx,
2351 offset);
2352 offset = glusterfs_rpc_dissect_gfx_iatt(tree, tvb,
2353 hf_glusterfs_preparent_iattx, offset);
2354 offset = glusterfs_rpc_dissect_gfx_iatt(tree, tvb,
2355 hf_glusterfs_postparent_iattx, offset);
2357 return offset;
2360 static int
2361 glusterfs_gfs4_0_op_mknod_call(tvbuff_t *tvb,
2362 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2364 int offset = 0;
2366 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_pargfid, offset);
2367 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
2368 offset = glusterfs_rpc_dissect_mode(tree, tvb, hf_glusterfs_mode, offset);
2369 offset = glusterfs_rpc_dissect_mode(tree, tvb, hf_glusterfs_umask, offset);
2370 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_bname, offset, NULL);
2371 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2373 return offset;
2376 static int
2377 glusterfs_gfs4_0_op_mkdir_call(tvbuff_t *tvb,
2378 packet_info *pinfo, proto_tree *tree, void* data _U_)
2380 int offset = 0;
2381 const char *name = NULL;
2383 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_pargfid, offset);
2384 offset = glusterfs_rpc_dissect_mode(tree, tvb, hf_glusterfs_mode, offset);
2385 offset = glusterfs_rpc_dissect_mode(tree, tvb, hf_glusterfs_umask, offset);
2386 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_bname, offset, &name);
2387 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2388 col_append_fstr(pinfo->cinfo, COL_INFO, ", Filename: %s", name);
2390 return offset;
2393 static int
2394 glusterfs_gfs4_0_op_readlink_reply(tvbuff_t *tvb,
2395 packet_info *pinfo, proto_tree *tree, void* data)
2397 int offset = 0;
2398 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
2399 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict,
2400 offset);
2401 offset = glusterfs_rpc_dissect_gfx_iatt(tree, tvb, hf_glusterfs_iattx,
2402 offset);
2403 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_path, offset,
2404 NULL);
2405 return offset;
2408 static int
2409 glusterfs_gfs4_0_op_readlink_call(tvbuff_t *tvb,
2410 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2412 int offset = 0;
2413 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2414 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_size, offset);
2415 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2417 return offset;
2420 /* glusterfs_gfs4_0_op_unlink_reply() is also used for ...rmdir_reply() */
2421 static int
2422 glusterfs_gfs4_0_op_common_2parent_iatt_reply(tvbuff_t *tvb, packet_info *pinfo,
2423 proto_tree *tree, void* data)
2425 int offset = 0;
2427 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
2428 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2429 offset = glusterfs_rpc_dissect_gfx_iatt(tree, tvb,
2430 hf_glusterfs_preparent_iattx, offset);
2431 offset = glusterfs_rpc_dissect_gfx_iatt(tree, tvb,
2432 hf_glusterfs_postparent_iattx, offset);
2434 return offset;
2437 static int
2438 glusterfs_gfs4_0_op_unlink_call(tvbuff_t *tvb,
2439 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2441 unsigned xflags;
2442 int offset = 0;
2444 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_pargfid, offset);
2445 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_bname, offset, NULL);
2446 xflags = tvb_get_ntohl(tvb, offset);
2447 proto_tree_add_uint_format(tree, hf_glusterfs_xflags, tvb, offset, 4, xflags, "Flags: 0%02o", xflags);
2448 offset += 4;
2449 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2451 return offset;
2454 static int
2455 glusterfs_gfs4_0_op_rmdir_call(tvbuff_t *tvb,
2456 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2458 unsigned xflags;
2459 int offset = 0;
2461 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_pargfid, offset);
2462 xflags = tvb_get_ntohl(tvb, offset);
2463 proto_tree_add_uint_format(tree, hf_glusterfs_xflags, tvb, offset, 4, xflags, "Flags: 0%02o", xflags);
2464 offset += 4;
2465 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_bname, offset, NULL);
2466 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2468 return offset;
2471 static int
2472 glusterfs_gfs4_0_op_symlink_call(tvbuff_t *tvb,
2473 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2475 int offset = 0;
2477 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_pargfid, offset);
2478 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_bname, offset, NULL);
2479 offset = glusterfs_rpc_dissect_mode(tree, tvb, hf_glusterfs_umask, offset);
2481 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_linkname, offset, NULL);
2482 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2484 return offset;
2487 static int
2488 glusterfs_gfs4_0_op_rename_call(tvbuff_t *tvb,
2489 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2491 int offset = 0;
2493 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_oldgfid, offset);
2494 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_newgfid, offset);
2495 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_oldbname, offset, NULL);
2496 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_newbname, offset, NULL);
2497 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2499 return offset;
2502 static int
2503 glusterfs_gfs4_0_op_rename_reply(tvbuff_t *tvb, packet_info *pinfo,
2504 proto_tree *tree, void* data)
2506 proto_tree *old_tree, *new_tree;
2507 proto_item *old_item, *new_item;
2508 int start_offset;
2509 int offset = 0;
2511 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
2512 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2513 offset = glusterfs_rpc_dissect_gfx_iatt(tree, tvb, hf_glusterfs_iattx,
2514 offset);
2516 start_offset = offset;
2517 old_tree = proto_tree_add_subtree(tree, tvb, offset, -1,
2518 ett_glusterfs_parent_iatt, &old_item, "Old parent");
2519 offset = glusterfs_rpc_dissect_gfx_iatt(old_tree, tvb,
2520 hf_glusterfs_preparent_iattx, offset);
2521 offset = glusterfs_rpc_dissect_gfx_iatt(old_tree, tvb,
2522 hf_glusterfs_postparent_iattx, offset);
2523 proto_item_set_len (old_item, offset - start_offset);
2525 start_offset = offset;
2526 new_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_glusterfs_parent_iatt, &new_item, "New parent");
2527 offset = glusterfs_rpc_dissect_gfx_iatt(new_tree, tvb,
2528 hf_glusterfs_preparent_iattx, offset);
2529 offset = glusterfs_rpc_dissect_gfx_iatt(new_tree, tvb,
2530 hf_glusterfs_postparent_iattx, offset);
2531 proto_item_set_len (new_item, offset - start_offset);
2533 return offset;
2536 static int
2537 glusterfs_gfs4_0_op_link_call(tvbuff_t *tvb,
2538 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2540 int offset = 0;
2542 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_oldgfid, offset);
2543 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_newgfid, offset);
2544 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_newbname, offset, NULL);
2545 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2547 return offset;
2550 static int
2551 glusterfs_gfs4_0_op_truncate_call(tvbuff_t *tvb,
2552 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2554 int offset = 0;
2556 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2557 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
2558 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2560 return offset;
2563 static int
2564 glusterfs_gfs4_0_op_open_reply(tvbuff_t *tvb, packet_info *pinfo,
2565 proto_tree *tree, void* data)
2567 int offset = 0;
2569 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
2570 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2571 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2572 return offset;
2575 static int
2576 glusterfs_gfs4_0_op_open_call(tvbuff_t *tvb,
2577 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2579 int offset = 0;
2580 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2581 offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
2582 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2584 return offset;
2587 static int
2588 glusterfs_gfs4_0_op_read_reply(tvbuff_t *tvb, packet_info *pinfo,
2589 proto_tree *tree, void* data)
2591 int offset = 0;
2593 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
2594 offset = glusterfs_rpc_dissect_gfx_iatt(tree, tvb, hf_glusterfs_iattx,
2595 offset);
2596 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_size, offset);
2597 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict,
2598 offset);
2600 return offset;
2603 static int
2604 glusterfs_gfs4_0_op_read_call(tvbuff_t *tvb,
2605 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2607 int offset = 0;
2609 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2610 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2611 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
2612 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_size, offset);
2613 offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
2614 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2616 return offset;
2619 static int
2620 glusterfs_gfs4_0_op_write_call(tvbuff_t *tvb,
2621 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2623 int offset = 0;
2625 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2626 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2627 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
2628 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_size, offset);
2629 offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
2630 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2632 return offset;
2635 static int
2636 glusterfs_gfs4_0_op_statfs_reply(tvbuff_t *tvb, packet_info *pinfo,
2637 proto_tree *tree, void* data)
2639 int offset = 0;
2641 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
2642 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2643 offset = glusterfs_rpc_dissect_statfs(tree, tvb, offset);
2645 return offset;
2648 static int
2649 glusterfs_gfs4_0_op_statfs_call(tvbuff_t *tvb,
2650 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2652 int offset = 0;
2654 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2655 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2657 return offset;
2660 static int
2661 glusterfs_gfs4_0_op_flush_call(tvbuff_t *tvb,
2662 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2664 int offset = 0;
2666 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2667 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2668 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2670 return offset;
2673 static int
2674 glusterfs_gfs4_0_op_setxattr_call(tvbuff_t *tvb,
2675 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2677 int offset = 0;
2679 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2680 offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
2681 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2682 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2684 return offset;
2687 static int
2688 glusterfs_gfs4_0_op_getxattr_call(tvbuff_t *tvb,
2689 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2691 int offset = 0;
2693 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2694 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_namelen, offset);
2695 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_name, offset, NULL);
2696 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2698 return offset;
2702 static int
2703 glusterfs_gfs4_0_op_common_dict_reply(tvbuff_t *tvb,
2704 packet_info *pinfo, proto_tree *tree, void* data)
2706 int offset = 0;
2708 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
2709 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2710 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2711 offset = glusterfs_rpc_dissect_gfx_iatt(tree, tvb,
2712 hf_glusterfs_preop_iattx, offset);
2713 offset = glusterfs_rpc_dissect_gfx_iatt(tree, tvb,
2714 hf_glusterfs_postop_iattx, offset);
2716 return offset;
2719 static int
2720 glusterfs_gfs4_0_op_removexattr_call(tvbuff_t *tvb,
2721 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2723 int offset = 0;
2725 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2726 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_name, offset, NULL);
2727 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2729 return offset;
2732 static int
2733 glusterfs_gfs4_0_op_fsync_call(tvbuff_t *tvb,
2734 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2736 static int * const flag_bits[] = {
2737 &hf_glusterfs_fsync_flag_datasync,
2738 &hf_glusterfs_fsync_flag_unknown,
2739 NULL
2741 int offset = 0;
2743 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2744 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2746 proto_tree_add_bitmask(tree, tvb, offset,
2747 hf_glusterfs_fsync_flags,
2748 ett_glusterfs_fsync_flags, flag_bits, ENC_NA);
2749 offset += 4;
2751 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2753 return offset;
2756 static int
2757 glusterfs_gfs4_0_op_opendir_call(tvbuff_t *tvb,
2758 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2760 int offset = 0;
2761 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2762 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2764 return offset;
2767 static int
2768 glusterfs_gfs4_0_op_create_reply(tvbuff_t *tvb, packet_info *pinfo,
2769 proto_tree *tree, void* data)
2771 int offset = 0;
2773 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
2774 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2775 offset = glusterfs_rpc_dissect_gfx_iatt(tree, tvb, hf_glusterfs_iattx,
2776 offset);
2777 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2778 offset = glusterfs_rpc_dissect_gfx_iatt(tree, tvb,
2779 hf_glusterfs_preparent_iattx, offset);
2780 offset = glusterfs_rpc_dissect_gfx_iatt(tree, tvb,
2781 hf_glusterfs_postparent_iattx, offset);
2783 return offset;
2787 static int
2788 glusterfs_gfs4_0_op_create_call(tvbuff_t *tvb,
2789 packet_info *pinfo, proto_tree *tree, void* data _U_)
2791 const char *name = NULL;
2792 int offset = 0;
2794 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_pargfid, offset);
2795 offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
2796 offset = glusterfs_rpc_dissect_mode(tree, tvb, hf_glusterfs_mode, offset);
2797 offset = glusterfs_rpc_dissect_mode(tree, tvb, hf_glusterfs_umask, offset);
2798 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_bname, offset, &name);
2799 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2800 col_append_fstr(pinfo->cinfo, COL_INFO, ", Filename: %s", name);
2802 return offset;
2805 static int
2806 glusterfs_gfs4_0_op_ftruncate_call(tvbuff_t *tvb,
2807 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2809 int offset = 0;
2811 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2812 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2813 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
2814 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2816 return offset;
2819 static int
2820 glusterfs_gfs4_0_op_fstat_call(tvbuff_t *tvb,
2821 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2823 int offset = 0;
2825 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2826 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2827 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2829 return offset;
2832 static int
2833 glusterfs_gfs4_0_op_lk_call(tvbuff_t *tvb,
2834 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2836 int offset = 0;
2838 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2839 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2840 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_cmd, offset);
2841 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_type, offset);
2842 offset = glusterfs_rpc_dissect_gf_2_flock(tree, tvb, offset);
2843 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2845 return offset;
2848 static int
2849 glusterfs_gfs4_0_op_lk_reply(tvbuff_t *tvb,
2850 packet_info *pinfo, proto_tree *tree, void* data)
2852 int offset = 0;
2854 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
2855 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2856 offset = glusterfs_rpc_dissect_gf_2_flock(tree, tvb, offset);
2858 return offset;
2861 static int
2862 glusterfs_gfs4_0_op_access_call(tvbuff_t *tvb,
2863 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2865 int offset = 0;
2867 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2868 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_mask, offset);
2869 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2870 return offset;
2873 static int
2874 glusterfs_gfs4_0_op_lookup_call(tvbuff_t *tvb,
2875 packet_info *pinfo, proto_tree *tree, void* data _U_)
2877 const char *name = NULL;
2878 int length;
2879 int offset = 0;
2881 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2882 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_pargfid, offset);
2883 offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
2884 length = tvb_get_letohl(tvb, offset);
2885 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_bname, offset, &name);
2886 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2887 if(length == 0)
2888 col_append_str(pinfo->cinfo, COL_INFO, ", Filename: (nameless, by GFID)");
2889 else
2890 col_append_fstr(pinfo->cinfo, COL_INFO, ", Filename: %s", name);
2892 return offset;
2895 static int
2896 glusterfs_gfs4_0_op_readdir_reply(tvbuff_t *tvb,
2897 packet_info *pinfo, proto_tree *tree, void* data _U_)
2899 int offset = 0;
2901 offset = _glusterfs_gfs3_common_readdir_reply(tvb, tree, offset);
2902 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2903 offset = dissect_rpc_list(tvb, pinfo, tree, offset,
2904 glusterfs_gfs4_0_op_readdir_entry, NULL);
2906 return offset;
2909 static int
2910 glusterfs_gfs4_0_op_readdir_call(tvbuff_t *tvb,
2911 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2913 int offset = 0;
2915 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2916 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2917 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
2918 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_size, offset);
2919 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2921 return offset;
2924 static int
2925 glusterfs_gfs4_0_op_inodelk_call(tvbuff_t *tvb,
2926 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2928 int offset = 0;
2930 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2931 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_cmd, offset);
2932 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_type, offset);
2933 offset = glusterfs_rpc_dissect_gf_2_flock(tree, tvb, offset);
2934 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_volume, offset, NULL);
2935 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2937 return offset;
2940 static int
2941 glusterfs_gfs4_0_op_finodelk_call(tvbuff_t *tvb,
2942 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2944 int offset = 0;
2946 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2947 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2949 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_cmd, offset);
2950 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_type, offset);
2951 offset = glusterfs_rpc_dissect_gf_2_flock(tree, tvb, offset);
2953 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_volume, offset, NULL);
2954 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2956 return offset;
2959 static int
2960 glusterfs_gfs4_0_op_entrylk_call(tvbuff_t *tvb,
2961 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2963 int offset = 0;
2965 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2966 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_cmd, offset);
2967 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_type, offset);
2968 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_entrylk_namelen, offset);
2969 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_name, offset, NULL);
2970 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_volume, offset, NULL);
2971 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2973 return offset;
2976 static int
2977 glusterfs_gfs4_0_op_fentrylk_call(tvbuff_t *tvb,
2978 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2980 int offset = 0;
2982 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2983 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2984 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_cmd, offset);
2985 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_type, offset);
2986 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_entrylk_namelen, offset);
2987 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_name, offset, NULL);
2988 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_volume, offset, NULL);
2989 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2991 return offset;
2994 static int
2995 glusterfs_gfs4_0_op_xattrop_call(tvbuff_t *tvb,
2996 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2998 int offset = 0;
3000 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
3001 offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
3002 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
3003 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
3005 return offset;
3008 static int
3009 glusterfs_gfs4_0_op_fxattrop_call(tvbuff_t *tvb,
3010 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
3012 int offset = 0;
3014 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
3015 offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
3016 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
3017 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
3018 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
3020 return offset;
3023 static int
3024 glusterfs_gfs4_0_op_fgetxattr_call(tvbuff_t *tvb,
3025 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
3027 int offset = 0;
3029 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
3030 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
3031 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_namelen, offset);
3032 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_name, offset, NULL);
3033 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
3035 return offset;
3038 static int
3039 gluter_gfs4_0_op_fsetxattr_call(tvbuff_t *tvb,
3040 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
3042 int offset = 0;
3044 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
3045 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
3046 offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
3047 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
3048 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
3050 return offset;
3053 static int
3054 glusterfs_gfs4_0_op_common_2iatt_reply(tvbuff_t *tvb, packet_info *pinfo,
3055 proto_tree *tree, void* data)
3057 int offset = 0;
3059 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
3060 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
3061 offset = glusterfs_rpc_dissect_gfx_iatt(tree, tvb,
3062 hf_glusterfs_preop_iattx, offset);
3063 offset = glusterfs_rpc_dissect_gfx_iatt(tree, tvb,
3064 hf_glusterfs_postop_iattx, offset);
3066 return offset;
3069 static int
3070 glusterfs_gfs4_0_op_setattr_call(tvbuff_t *tvb,
3071 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
3073 int offset = 0;
3075 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid,
3076 offset);
3077 offset = glusterfs_rpc_dissect_gfx_iatt(tree, tvb, hf_glusterfs_iattx,
3078 offset);
3079 offset = glusterfs_rpc_dissect_setattr(tree, tvb, offset);
3080 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
3082 return offset;
3085 static int
3086 glusterfs_gfs4_0_op_fsetattr_call(tvbuff_t *tvb,
3087 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
3089 int offset = 0;
3091 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid,
3092 offset);
3093 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
3094 offset = glusterfs_rpc_dissect_gfx_iatt(tree, tvb, hf_glusterfs_iattx,
3095 offset);
3096 offset = glusterfs_rpc_dissect_setattr(tree, tvb, offset);
3097 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
3099 return offset;
3102 static int
3103 glusterfs_gfs4_0_op_readdirp_reply(tvbuff_t *tvb,
3104 packet_info *pinfo, proto_tree *tree, void* data _U_)
3106 int offset = 0;
3108 offset = _glusterfs_gfs3_common_readdir_reply(tvb, tree, offset);
3109 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
3110 offset = dissect_rpc_list(tvb, pinfo, tree, offset,
3111 glusterfs_gfs4_0_op_readdirp_entry, NULL);
3113 return offset;
3116 /* READDIRP and DISCARD both use this */
3117 static int
3118 glusterfs_gfs4_0_op_readdirp_call(tvbuff_t *tvb,
3119 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
3121 int offset = 0;
3123 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
3124 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
3125 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
3126 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_size, offset);
3127 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
3129 return offset;
3132 static int
3133 glusterfs_gfs4_0_op_release_call(tvbuff_t *tvb,
3134 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
3136 int offset = 0;
3138 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
3139 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
3140 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
3142 return offset;
3145 static int
3146 glusterfs_gfs4_0_op_releasedir_call(tvbuff_t *tvb,
3147 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
3149 int offset = 0;
3151 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
3152 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
3153 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
3155 return offset;
3158 static int
3159 glusterfs_gfs4_0_op_fremovexattr_call(tvbuff_t *tvb,
3160 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
3162 int offset = 0;
3164 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
3165 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
3166 offset = dissect_rpc_string(tvb, tree, hf_glusterfs_name, offset, NULL);
3167 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
3169 return offset;
3172 static int
3173 glusterfs_gfs4_0_op_fallocate_call(tvbuff_t *tvb,
3174 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
3176 int offset = 0;
3178 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
3179 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
3180 offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
3181 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
3182 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_size, offset);
3183 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
3185 return offset;
3188 static int
3189 glusterfs_gfs4_0_op_zerofill_call(tvbuff_t *tvb,
3190 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
3192 int offset = 0;
3194 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
3195 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
3196 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
3197 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_size64, offset);
3199 return offset;
3202 static int
3203 glusterfs_gfs4_0_op_seek_reply(tvbuff_t *tvb, packet_info *pinfo,
3204 proto_tree *tree, void* data)
3206 int offset = 0;
3208 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
3209 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
3210 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
3212 return offset;
3215 static int
3216 glusterfs_gfs4_0_op_seek_call(tvbuff_t *tvb, packet_info *pinfo _U_,
3217 proto_tree *tree, void* data _U_)
3219 int offset = 0;
3221 offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
3222 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
3223 offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
3224 offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_whence, offset);
3225 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
3227 return offset;
3230 /* This function is for common replay. RELEASE , RELEASEDIR and some other function use this method */
3232 static int
3233 glusterfs_gfs4_0_op_common_reply(tvbuff_t *tvb, packet_info *pinfo,
3234 proto_tree *tree, void* data)
3236 int offset = 0;
3238 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
3239 offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
3241 return offset;
3246 * GLUSTER3_1_FOP_PROGRAM
3247 * - xlators/protocol/client/src/client3_1-fops.c
3248 * - xlators/protocol/server/src/server3_1-fops.c
3250 static const vsff glusterfs3_1_fop_proc[] = {
3252 GFS3_OP_NULL, "NULL",
3253 dissect_rpc_void, dissect_rpc_void
3255 { GFS3_OP_STAT, "STAT", dissect_rpc_unknown, dissect_rpc_unknown },
3256 { GFS3_OP_READLINK, "READLINK", dissect_rpc_unknown, dissect_rpc_unknown },
3257 { GFS3_OP_MKNOD, "MKNOD", dissect_rpc_unknown, dissect_rpc_unknown },
3258 { GFS3_OP_MKDIR, "MKDIR", dissect_rpc_unknown, dissect_rpc_unknown },
3260 GFS3_OP_UNLINK, "UNLINK",
3261 glusterfs_gfs3_op_unlink_call, glusterfs_gfs3_op_unlink_reply
3263 { GFS3_OP_RMDIR, "RMDIR", dissect_rpc_unknown, dissect_rpc_unknown },
3264 { GFS3_OP_SYMLINK, "SYMLINK", dissect_rpc_unknown, dissect_rpc_unknown },
3265 { GFS3_OP_RENAME, "RENAME", dissect_rpc_unknown, dissect_rpc_unknown },
3266 { GFS3_OP_LINK, "LINK", dissect_rpc_unknown, dissect_rpc_unknown },
3267 { GFS3_OP_TRUNCATE, "TRUNCATE", dissect_rpc_unknown, dissect_rpc_unknown },
3268 { GFS3_OP_OPEN, "OPEN", dissect_rpc_unknown, dissect_rpc_unknown },
3269 { GFS3_OP_READ, "READ", dissect_rpc_unknown, dissect_rpc_unknown },
3270 { GFS3_OP_WRITE, "WRITE", dissect_rpc_unknown, dissect_rpc_unknown },
3272 GFS3_OP_STATFS, "STATFS",
3273 glusterfs_gfs3_op_statfs_call, glusterfs_gfs3_op_statfs_reply
3276 GFS3_OP_FLUSH, "FLUSH",
3277 glusterfs_gfs3_op_flush_call, gluster_local_dissect_common_reply
3279 { GFS3_OP_FSYNC, "FSYNC", dissect_rpc_unknown, dissect_rpc_unknown },
3281 GFS3_OP_SETXATTR, "SETXATTR",
3282 glusterfs_gfs3_op_setxattr_call, gluster_local_dissect_common_reply
3284 { GFS3_OP_GETXATTR, "GETXATTR", dissect_rpc_unknown, dissect_rpc_unknown },
3285 { GFS3_OP_REMOVEXATTR, "REMOVEXATTR", dissect_rpc_unknown, dissect_rpc_unknown },
3287 GFS3_OP_OPENDIR, "OPENDIR",
3288 glusterfs_gfs3_op_opendir_call, glusterfs_gfs3_op_opendir_reply
3290 { GFS3_OP_FSYNCDIR, "FSYNCDIR", dissect_rpc_unknown, dissect_rpc_unknown },
3291 { GFS3_OP_ACCESS, "ACCESS", dissect_rpc_unknown, dissect_rpc_unknown },
3293 GFS3_OP_CREATE, "CREATE",
3294 glusterfs_gfs3_op_create_call, glusterfs_gfs3_op_create_reply
3296 { GFS3_OP_FTRUNCATE, "FTRUNCATE", dissect_rpc_unknown, dissect_rpc_unknown },
3297 { GFS3_OP_FSTAT, "FSTAT", dissect_rpc_unknown, dissect_rpc_unknown },
3298 { GFS3_OP_LK, "LK", dissect_rpc_unknown, dissect_rpc_unknown },
3300 GFS3_OP_LOOKUP, "LOOKUP",
3301 glusterfs_gfs3_op_lookup_call, glusterfs_gfs3_op_lookup_reply
3303 { GFS3_OP_READDIR, "READDIR", dissect_rpc_unknown, dissect_rpc_unknown },
3305 GFS3_OP_INODELK, "INODELK",
3306 glusterfs_gfs3_op_inodelk_call, gluster_local_dissect_common_reply
3308 { GFS3_OP_FINODELK, "FINODELK", dissect_rpc_unknown, dissect_rpc_unknown },
3309 { GFS3_OP_ENTRYLK, "ENTRYLK", dissect_rpc_unknown, dissect_rpc_unknown },
3310 { GFS3_OP_FENTRYLK, "FENTRYLK", dissect_rpc_unknown, dissect_rpc_unknown },
3311 { GFS3_OP_XATTROP, "XATTROP", dissect_rpc_unknown, dissect_rpc_unknown },
3312 { GFS3_OP_FXATTROP, "FXATTROP", dissect_rpc_unknown, dissect_rpc_unknown },
3313 { GFS3_OP_FGETXATTR, "FGETXATTR", dissect_rpc_unknown, dissect_rpc_unknown },
3314 { GFS3_OP_FSETXATTR, "FSETXATTR", dissect_rpc_unknown, dissect_rpc_unknown },
3315 { GFS3_OP_RCHECKSUM, "RCHECKSUM", dissect_rpc_unknown, dissect_rpc_unknown },
3317 GFS3_OP_SETATTR, "SETATTR",
3318 glusterfs_gfs3_op_setattr_call, glusterfs_gfs3_op_setattr_reply
3321 GFS3_OP_FSETATTR, "FSETATTR",
3322 /* SETATTR and SETFATTS calls and reply are encoded the same */
3323 glusterfs_gfs3_op_setattr_call, glusterfs_gfs3_op_setattr_reply
3326 GFS3_OP_READDIRP, "READDIRP",
3327 glusterfs_gfs3_op_readdirp_call, glusterfs_gfs3_op_readdirp_reply
3329 { GFS3_OP_RELEASE, "RELEASE", dissect_rpc_unknown, dissect_rpc_unknown },
3330 { GFS3_OP_RELEASEDIR, "RELEASEDIR", dissect_rpc_unknown, dissect_rpc_unknown },
3331 { 0, NULL, NULL, NULL }
3336 * GLUSTER3_1_FOP_PROGRAM for 3_3
3337 * - xlators/protocol/client/src/client3_1-fops.c
3338 * - xlators/protocol/server/src/server3_1-fops.c
3340 static const vsff glusterfs3_3_fop_proc[] = {
3342 GFS3_OP_NULL, "NULL",
3343 dissect_rpc_void, dissect_rpc_void
3346 GFS3_OP_STAT, "STAT",
3347 glusterfs_gfs3_3_op_stat_call, glusterfs_gfs3_3_op_stat_reply
3350 GFS3_OP_READLINK, "READLINK",
3351 glusterfs_gfs3_3_op_readlink_call, glusterfs_gfs3_3_op_readlink_reply
3354 GFS3_OP_MKNOD, "MKNOD",
3355 glusterfs_gfs3_3_op_mknod_call, glusterfs_gfs3_3_op_mknod_reply
3358 GFS3_OP_MKDIR, "MKDIR",
3359 glusterfs_gfs3_3_op_mkdir_call, glusterfs_gfs3_3_op_mknod_reply
3362 GFS3_OP_UNLINK, "UNLINK",
3363 glusterfs_gfs3_3_op_unlink_call, glusterfs_gfs3_3_op_unlink_reply
3366 GFS3_OP_RMDIR, "RMDIR",
3367 glusterfs_gfs3_3_op_rmdir_call, glusterfs_gfs3_3_op_unlink_reply
3370 GFS3_OP_SYMLINK, "SYMLINK",
3371 glusterfs_gfs3_3_op_symlink_call, glusterfs_gfs3_3_op_mknod_reply
3374 GFS3_OP_RENAME, "RENAME",
3375 glusterfs_gfs3_3_op_rename_call, glusterfs_gfs3_3_op_rename_reply
3378 GFS3_OP_LINK, "LINK",
3379 glusterfs_gfs3_3_op_link_call, glusterfs_gfs3_3_op_mknod_reply
3382 GFS3_OP_TRUNCATE, "TRUNCATE",
3383 glusterfs_gfs3_3_op_truncate_call, glusterfs_gfs3_3_op_unlink_reply
3386 GFS3_OP_OPEN, "OPEN",
3387 glusterfs_gfs3_3_op_open_call, glusterfs_gfs3_3_op_open_reply
3390 GFS3_OP_READ, "READ",
3391 glusterfs_gfs3_3_op_read_call, glusterfs_gfs3_3_op_read_reply
3394 GFS3_OP_WRITE, "WRITE",
3395 glusterfs_gfs3_3_op_write_call, glusterfs_gfs3_3_op_setattr_reply
3398 GFS3_OP_STATFS, "STATFS",
3399 glusterfs_gfs3_3_op_statfs_call, glusterfs_gfs3_3_op_statfs_reply
3402 GFS3_OP_FLUSH, "FLUSH",
3403 glusterfs_gfs3_3_op_flush_call, glusterfs_gfs3_3_op_common_reply
3406 GFS3_OP_FSYNC, "FSYNC",
3407 glusterfs_gfs3_3_op_fsync_call, glusterfs_gfs3_3_op_setattr_reply
3410 GFS3_OP_SETXATTR, "SETXATTR",
3411 glusterfs_gfs3_3_op_setxattr_call, glusterfs_gfs3_3_op_common_reply
3414 GFS3_OP_GETXATTR, "GETXATTR",
3415 glusterfs_gfs3_3_op_getxattr_call, glusterfs_gfs3_3_op_getxattr_reply
3418 GFS3_OP_REMOVEXATTR, "REMOVEXATTR",
3419 glusterfs_gfs3_3_op_removexattr_call, glusterfs_gfs3_3_op_common_reply
3422 GFS3_OP_OPENDIR, "OPENDIR",
3423 glusterfs_gfs3_3_op_opendir_call, glusterfs_gfs3_3_op_opendir_reply
3426 GFS3_OP_FSYNCDIR, "FSYNCDIR",
3427 glusterfs_gfs3_3_op_fsync_call, glusterfs_gfs3_3_op_common_reply
3430 GFS3_OP_ACCESS, "ACCESS",
3431 glusterfs_gfs3_3_op_access_call, glusterfs_gfs3_3_op_common_reply
3434 GFS3_OP_CREATE, "CREATE",
3435 glusterfs_gfs3_3_op_create_call, glusterfs_gfs3_3_op_create_reply
3438 GFS3_OP_FTRUNCATE, "FTRUNCATE",
3439 glusterfs_gfs3_3_op_ftruncate_call, glusterfs_gfs3_3_op_unlink_reply
3442 GFS3_OP_FSTAT, "FSTAT",
3443 glusterfs_gfs3_3_op_fstat_call, glusterfs_gfs3_3_op_fstat_reply
3446 GFS3_OP_LK, "LK",
3447 glusterfs_gfs3_3_op_lk_call, glusterfs_gfs3_3_op_lk_reply
3450 GFS3_OP_LOOKUP, "LOOKUP",
3451 glusterfs_gfs3_3_op_lookup_call, glusterfs_gfs3_3_op_setattr_reply
3454 GFS3_OP_READDIR, "READDIR",
3455 glusterfs_gfs3_3_op_readdir_call, glusterfs_gfs3_3_op_readdir_reply
3458 GFS3_OP_INODELK, "INODELK",
3459 glusterfs_gfs3_3_op_inodelk_call, glusterfs_gfs3_3_op_common_reply
3462 GFS3_OP_FINODELK, "FINODELK",
3463 glusterfs_gfs3_3_op_finodelk_call, glusterfs_gfs3_3_op_common_reply
3466 GFS3_OP_ENTRYLK, "ENTRYLK",
3467 glusterfs_gfs3_3_op_entrylk_call, glusterfs_gfs3_3_op_common_reply
3470 GFS3_OP_FENTRYLK, "FENTRYLK",
3471 glusterfs_gfs3_3_op_fentrylk_call, glusterfs_gfs3_3_op_common_reply
3474 GFS3_OP_XATTROP, "XATTROP",
3475 glusterfs_gfs3_3_op_xattrop_call, glusterfs_gfs3_3_op_xattrop_reply
3477 /*xattrop and fxattrop replay both are same */
3479 GFS3_OP_FXATTROP, "FXATTROP",
3480 glusterfs_gfs3_3_op_fxattrop_call, glusterfs_gfs3_3_op_xattrop_reply
3483 GFS3_OP_FGETXATTR, "FGETXATTR",
3484 glusterfs_gfs3_3_op_fgetxattr_call, glusterfs_gfs3_3_op_xattrop_reply
3487 GFS3_OP_FSETXATTR, "FSETXATTR",
3488 gluter_gfs3_3_op_fsetxattr_call, glusterfs_gfs3_3_op_common_reply
3490 { GFS3_OP_RCHECKSUM, "RCHECKSUM", dissect_rpc_unknown, dissect_rpc_unknown },
3492 GFS3_OP_SETATTR, "SETATTR",
3493 glusterfs_gfs3_3_op_setattr_call, glusterfs_gfs3_3_op_setattr_reply
3496 GFS3_OP_FSETATTR, "FSETATTR",
3497 /* SETATTR and SETFATTS calls and reply are encoded the same */
3498 glusterfs_gfs3_3_op_setattr_call, glusterfs_gfs3_3_op_setattr_reply
3501 GFS3_OP_READDIRP, "READDIRP",
3502 glusterfs_gfs3_3_op_readdirp_call, glusterfs_gfs3_3_op_readdirp_reply
3505 GFS3_OP_RELEASE, "RELEASE",
3506 glusterfs_gfs3_3_op_release_call, glusterfs_gfs3_3_op_common_reply
3509 GFS3_OP_RELEASEDIR, "RELEASEDIR",
3510 glusterfs_gfs3_3_op_releasedir_call, glusterfs_gfs3_3_op_common_reply
3513 GFS3_OP_FREMOVEXATTR, "FREMOVEXATTR",
3514 glusterfs_gfs3_3_op_fremovexattr_call, glusterfs_gfs3_3_op_common_reply
3517 GFS3_OP_FALLOCATE, "FALLOCATE",
3518 glusterfs_gfs3_3_op_fallocate_call, glusterfs_gfs3_3_op_setattr_reply
3521 GFS3_OP_DISCARD, "DISCARD",
3522 glusterfs_gfs3_3_op_readdirp_call, glusterfs_gfs3_3_op_setattr_reply
3525 GFS3_OP_ZEROFILL, "ZEROFILL",
3526 glusterfs_gfs3_3_op_zerofill_call, glusterfs_gfs3_3_op_setattr_reply
3529 GFS3_OP_SEEK, "SEEK",
3530 glusterfs_gfs3_3_op_seek_call, glusterfs_gfs3_3_op_seek_reply
3532 { 0, NULL, NULL, NULL }
3537 * GLUSTER4_0_FOP_PROGRAM for 4_0
3538 * - xlators/protocol/client/src/client-rpc-fops_v2.c
3539 * - xlators/protocol/server/src/server-rpc-fops_v2.c
3541 static const vsff glusterfs4_0_fop_proc[] = {
3543 GFS3_OP_NULL, "NULL",
3544 dissect_rpc_void, dissect_rpc_void
3547 GFS3_OP_STAT, "STAT",
3548 glusterfs_gfs4_0_op_stat_call, glusterfs_gfs4_0_op_common_iatt_reply
3551 GFS3_OP_READLINK, "READLINK",
3552 glusterfs_gfs4_0_op_readlink_call, glusterfs_gfs4_0_op_readlink_reply
3555 GFS3_OP_MKNOD, "MKNOD",
3556 glusterfs_gfs4_0_op_mknod_call, glusterfs_gfs4_0_op_common_3iatt_reply
3559 GFS3_OP_MKDIR, "MKDIR",
3560 glusterfs_gfs4_0_op_mkdir_call, glusterfs_gfs4_0_op_common_3iatt_reply
3563 GFS3_OP_UNLINK, "UNLINK",
3564 glusterfs_gfs4_0_op_unlink_call, glusterfs_gfs4_0_op_common_2parent_iatt_reply
3567 GFS3_OP_RMDIR, "RMDIR",
3568 glusterfs_gfs4_0_op_rmdir_call, glusterfs_gfs4_0_op_common_2parent_iatt_reply
3571 GFS3_OP_SYMLINK, "SYMLINK",
3572 glusterfs_gfs4_0_op_symlink_call, glusterfs_gfs4_0_op_common_3iatt_reply
3575 GFS3_OP_RENAME, "RENAME",
3576 glusterfs_gfs4_0_op_rename_call, glusterfs_gfs4_0_op_rename_reply
3579 GFS3_OP_LINK, "LINK",
3580 glusterfs_gfs4_0_op_link_call, glusterfs_gfs4_0_op_common_3iatt_reply
3583 GFS3_OP_TRUNCATE, "TRUNCATE",
3584 glusterfs_gfs4_0_op_truncate_call, glusterfs_gfs4_0_op_common_2iatt_reply
3587 GFS3_OP_OPEN, "OPEN",
3588 glusterfs_gfs4_0_op_open_call, glusterfs_gfs4_0_op_open_reply
3591 GFS3_OP_READ, "READ",
3592 glusterfs_gfs4_0_op_read_call, glusterfs_gfs4_0_op_read_reply
3595 GFS3_OP_WRITE, "WRITE",
3596 glusterfs_gfs4_0_op_write_call, glusterfs_gfs4_0_op_common_2iatt_reply
3599 GFS3_OP_STATFS, "STATFS",
3600 glusterfs_gfs4_0_op_statfs_call, glusterfs_gfs4_0_op_statfs_reply
3603 GFS3_OP_FLUSH, "FLUSH",
3604 glusterfs_gfs4_0_op_flush_call, glusterfs_gfs4_0_op_common_reply
3607 GFS3_OP_FSYNC, "FSYNC",
3608 glusterfs_gfs4_0_op_fsync_call, glusterfs_gfs4_0_op_common_2iatt_reply
3611 GFS3_OP_SETXATTR, "SETXATTR",
3612 glusterfs_gfs4_0_op_setxattr_call, glusterfs_gfs4_0_op_common_reply
3615 GFS3_OP_GETXATTR, "GETXATTR",
3616 glusterfs_gfs4_0_op_getxattr_call, glusterfs_gfs4_0_op_common_dict_reply
3619 GFS3_OP_REMOVEXATTR, "REMOVEXATTR",
3620 glusterfs_gfs4_0_op_removexattr_call, glusterfs_gfs4_0_op_common_reply
3623 GFS3_OP_OPENDIR, "OPENDIR",
3624 glusterfs_gfs4_0_op_opendir_call, glusterfs_gfs4_0_op_open_reply
3627 GFS3_OP_FSYNCDIR, "FSYNCDIR",
3628 glusterfs_gfs4_0_op_fsync_call, glusterfs_gfs4_0_op_common_reply
3631 GFS3_OP_ACCESS, "ACCESS",
3632 glusterfs_gfs4_0_op_access_call, glusterfs_gfs4_0_op_common_reply
3635 GFS3_OP_CREATE, "CREATE",
3636 glusterfs_gfs4_0_op_create_call, glusterfs_gfs4_0_op_create_reply
3639 GFS3_OP_FTRUNCATE, "FTRUNCATE",
3640 glusterfs_gfs4_0_op_ftruncate_call, glusterfs_gfs4_0_op_common_2iatt_reply
3643 GFS3_OP_FSTAT, "FSTAT",
3644 glusterfs_gfs4_0_op_fstat_call, glusterfs_gfs4_0_op_common_iatt_reply
3647 GFS3_OP_LK, "LK",
3648 glusterfs_gfs4_0_op_lk_call, glusterfs_gfs4_0_op_lk_reply
3651 GFS3_OP_LOOKUP, "LOOKUP",
3652 glusterfs_gfs4_0_op_lookup_call, glusterfs_gfs4_0_op_common_2iatt_reply
3655 GFS3_OP_READDIR, "READDIR",
3656 glusterfs_gfs4_0_op_readdir_call, glusterfs_gfs4_0_op_readdir_reply
3659 GFS3_OP_INODELK, "INODELK",
3660 glusterfs_gfs4_0_op_inodelk_call, glusterfs_gfs4_0_op_common_reply
3663 GFS3_OP_FINODELK, "FINODELK",
3664 glusterfs_gfs4_0_op_finodelk_call, glusterfs_gfs4_0_op_common_reply
3667 GFS3_OP_ENTRYLK, "ENTRYLK",
3668 glusterfs_gfs4_0_op_entrylk_call, glusterfs_gfs4_0_op_common_reply
3671 GFS3_OP_FENTRYLK, "FENTRYLK",
3672 glusterfs_gfs4_0_op_fentrylk_call, glusterfs_gfs4_0_op_common_reply
3675 GFS3_OP_XATTROP, "XATTROP",
3676 glusterfs_gfs4_0_op_xattrop_call, glusterfs_gfs4_0_op_common_dict_reply
3678 /*xattrop and fxattrop replay both are same */
3680 GFS3_OP_FXATTROP, "FXATTROP",
3681 glusterfs_gfs4_0_op_fxattrop_call, glusterfs_gfs4_0_op_common_dict_reply
3684 GFS3_OP_FGETXATTR, "FGETXATTR",
3685 glusterfs_gfs4_0_op_fgetxattr_call, glusterfs_gfs4_0_op_common_dict_reply
3688 GFS3_OP_FSETXATTR, "FSETXATTR",
3689 gluter_gfs4_0_op_fsetxattr_call, glusterfs_gfs4_0_op_common_reply
3691 { GFS3_OP_RCHECKSUM, "RCHECKSUM", dissect_rpc_unknown, dissect_rpc_unknown },
3693 GFS3_OP_SETATTR, "SETATTR",
3694 glusterfs_gfs4_0_op_setattr_call, glusterfs_gfs4_0_op_common_2iatt_reply
3697 GFS3_OP_FSETATTR, "FSETATTR",
3698 /* SETATTR and SETFATTS calls and reply are encoded the same */
3699 glusterfs_gfs4_0_op_fsetattr_call, glusterfs_gfs4_0_op_common_2iatt_reply
3702 GFS3_OP_READDIRP, "READDIRP",
3703 glusterfs_gfs4_0_op_readdirp_call, glusterfs_gfs4_0_op_readdirp_reply
3706 GFS3_OP_RELEASE, "RELEASE",
3707 glusterfs_gfs4_0_op_release_call, glusterfs_gfs4_0_op_common_reply
3710 GFS3_OP_RELEASEDIR, "RELEASEDIR",
3711 glusterfs_gfs4_0_op_releasedir_call, glusterfs_gfs4_0_op_common_reply
3714 GFS3_OP_FREMOVEXATTR, "FREMOVEXATTR",
3715 glusterfs_gfs4_0_op_fremovexattr_call, glusterfs_gfs4_0_op_common_reply
3718 GFS3_OP_FALLOCATE, "FALLOCATE",
3719 glusterfs_gfs4_0_op_fallocate_call, glusterfs_gfs4_0_op_common_2iatt_reply
3722 GFS3_OP_DISCARD, "DISCARD",
3723 glusterfs_gfs4_0_op_readdirp_call, glusterfs_gfs4_0_op_common_2iatt_reply
3726 GFS3_OP_ZEROFILL, "ZEROFILL",
3727 glusterfs_gfs4_0_op_zerofill_call, glusterfs_gfs4_0_op_common_2iatt_reply
3730 GFS3_OP_SEEK, "SEEK",
3731 glusterfs_gfs4_0_op_seek_call, glusterfs_gfs4_0_op_seek_reply
3733 { 0, NULL, NULL, NULL }
3737 static const rpc_prog_vers_info glusterfs_vers_info[] = {
3738 { 310, glusterfs3_1_fop_proc, &hf_glusterfs_proc },
3739 { 330, glusterfs3_3_fop_proc, &hf_glusterfs_proc },
3740 { 400, glusterfs4_0_fop_proc, &hf_glusterfs_proc },
3744 static const value_string glusterfs3_1_fop_proc_vals[] = {
3745 { GFS3_OP_NULL, "NULL" },
3746 { GFS3_OP_STAT, "STAT" },
3747 { GFS3_OP_READLINK, "READLINK" },
3748 { GFS3_OP_MKNOD, "MKNOD" },
3749 { GFS3_OP_MKDIR, "MKDIR" },
3750 { GFS3_OP_UNLINK, "UNLINK" },
3751 { GFS3_OP_RMDIR, "RMDIR" },
3752 { GFS3_OP_SYMLINK, "SYMLINK" },
3753 { GFS3_OP_RENAME, "RENAME" },
3754 { GFS3_OP_LINK, "LINK" },
3755 { GFS3_OP_TRUNCATE, "TRUNCATE" },
3756 { GFS3_OP_OPEN, "OPEN" },
3757 { GFS3_OP_READ, "READ" },
3758 { GFS3_OP_WRITE, "WRITE" },
3759 { GFS3_OP_STATFS, "STATFS" },
3760 { GFS3_OP_FLUSH, "FLUSH" },
3761 { GFS3_OP_FSYNC, "FSYNC" },
3762 { GFS3_OP_SETXATTR, "SETXATTR" },
3763 { GFS3_OP_GETXATTR, "GETXATTR" },
3764 { GFS3_OP_REMOVEXATTR, "REMOVEXATTR" },
3765 { GFS3_OP_OPENDIR, "OPENDIR" },
3766 { GFS3_OP_FSYNCDIR, "FSYNCDIR" },
3767 { GFS3_OP_ACCESS, "ACCESS" },
3768 { GFS3_OP_CREATE, "CREATE" },
3769 { GFS3_OP_FTRUNCATE, "FTRUNCATE" },
3770 { GFS3_OP_FSTAT, "FSTAT" },
3771 { GFS3_OP_LK, "LK" },
3772 { GFS3_OP_LOOKUP, "LOOKUP" },
3773 { GFS3_OP_READDIR, "READDIR" },
3774 { GFS3_OP_INODELK, "INODELK" },
3775 { GFS3_OP_FINODELK, "FINODELK" },
3776 { GFS3_OP_ENTRYLK, "ENTRYLK" },
3777 { GFS3_OP_FENTRYLK, "FENTRYLK" },
3778 { GFS3_OP_XATTROP, "XATTROP" },
3779 { GFS3_OP_FXATTROP, "FXATTROP" },
3780 { GFS3_OP_FGETXATTR, "FGETXATTR" },
3781 { GFS3_OP_FSETXATTR, "FSETXATTR" },
3782 { GFS3_OP_RCHECKSUM, "RCHECKSUM" },
3783 { GFS3_OP_SETATTR, "SETATTR" },
3784 { GFS3_OP_FSETATTR, "FSETATTR" },
3785 { GFS3_OP_READDIRP, "READDIRP" },
3786 { GFS3_OP_FORGET, "FORGET" },
3787 { GFS3_OP_RELEASE, "RELEASE" },
3788 { GFS3_OP_RELEASEDIR, "RELEASEDIR" },
3789 { GFS3_OP_FREMOVEXATTR, "FREMOVEXATTR" },
3790 { GFS3_OP_FALLOCATE, "FALLOCATE" },
3791 { GFS3_OP_DISCARD, "DISCARD" },
3792 { GFS3_OP_ZEROFILL, "ZEROFILL" },
3793 { GFS3_OP_IPC, "IPC" },
3794 { GFS3_OP_SEEK, "SEEK" },
3795 { 0, NULL }
3797 static value_string_ext glusterfs3_1_fop_proc_vals_ext = VALUE_STRING_EXT_INIT(glusterfs3_1_fop_proc_vals);
3799 /* dir-entry types */
3800 static const value_string glusterfs_entry_type_names[] = {
3801 { GLUSTER_DT_UNKNOWN, "DT_UNKNOWN" },
3802 { GLUSTER_DT_FIFO, "DT_FIFO" },
3803 { GLUSTER_DT_CHR, "DT_CHR" },
3804 { GLUSTER_DT_DIR, "DT_DIR" },
3805 { GLUSTER_DT_BLK, "DT_BLK" },
3806 { GLUSTER_DT_REG, "DT_REG" },
3807 { GLUSTER_DT_LNK, "DT_LNK" },
3808 { GLUSTER_DT_SOCK, "DT_SOCK" },
3809 { GLUSTER_DT_WHT, "DT_WHT" },
3810 { 0, NULL }
3812 static value_string_ext glusterfs_entry_type_names_ext = VALUE_STRING_EXT_INIT(glusterfs_entry_type_names);
3814 /* Normal locking commands */
3815 static const value_string glusterfs_lk_cmd_names[] = {
3816 { GF_LK_GETLK, "GF_LK_GETLK" },
3817 { GF_LK_SETLK, "GF_LK_SETLK" },
3818 { GF_LK_SETLKW, "GF_LK_SETLKW" },
3819 { GF_LK_RESLK_LCK, "GF_LK_RESLK_LCK" },
3820 { GF_LK_RESLK_LCKW, "GF_LK_RESLK_LCKW" },
3821 { GF_LK_RESLK_UNLCK, "GF_LK_RESLK_UNLCK" },
3822 { GF_LK_GETLK_FD, "GF_LK_GETLK_FD" },
3823 { 0, NULL }
3825 static value_string_ext glusterfs_lk_cmd_names_ext = VALUE_STRING_EXT_INIT(glusterfs_lk_cmd_names);
3827 /* Different lock types */
3828 static const value_string glusterfs_lk_type_names[] = {
3829 { GF_LK_F_RDLCK, "GF_LK_F_RDLCK" },
3830 { GF_LK_F_WRLCK, "GF_LK_F_WRLCK" },
3831 { GF_LK_F_UNLCK, "GF_LK_F_UNLCK" },
3832 { GF_LK_EOL, "GF_LK_EOL" },
3833 { 0, NULL }
3836 static const value_string glusterfs_lk_whence[] = {
3837 { GF_LK_SEEK_SET, "SEEK_SET" },
3838 { GF_LK_SEEK_CUR, "SEEK_CUR" },
3839 { GF_LK_SEEK_END, "SEEK_END" },
3840 { 0, NULL }
3843 static const value_string glusterfs_seek_whence[] = {
3844 { GF_SEEK_DATA, "SEEK_DATA" },
3845 { GF_SEEK_HOLE, "SEEK_HOLE" },
3846 { 0, NULL }
3849 void
3850 proto_register_glusterfs(void)
3852 /* Setup list of header fields See Section 1.6.1 for details */
3853 static hf_register_info hf[] = {
3854 /* programs */
3855 { &hf_glusterfs_proc,
3856 { "GlusterFS", "glusterfs.proc", FT_UINT32, BASE_DEC | BASE_EXT_STRING,
3857 &glusterfs3_1_fop_proc_vals_ext, 0, NULL, HFILL }
3859 /* fields used by multiple programs/procedures and other
3860 * Gluster dissectors with gluster_dissect_common_reply() */
3861 { &hf_gluster_op_ret,
3862 { "Return value", "gluster.op_ret", FT_INT32, BASE_DEC,
3863 NULL, 0, NULL, HFILL }
3865 { &hf_gluster_op_errno,
3866 { "Errno", "gluster.op_errno", FT_INT32, BASE_DEC,
3867 NULL, 0, NULL, HFILL }
3869 /* GlusterFS specific */
3870 { &hf_glusterfs_gfid,
3871 { "GFID", "glusterfs.gfid", FT_GUID,
3872 BASE_NONE, NULL, 0, NULL, HFILL }
3874 { &hf_glusterfs_pargfid,
3875 { "Parent GFID", "glusterfs.pargfid", FT_GUID,
3876 BASE_NONE, NULL, 0,
3877 "GFID of the parent directory", HFILL }
3879 { &hf_glusterfs_oldgfid,
3880 { "Old GFID", "glusterfs.oldgfid", FT_GUID,
3881 BASE_NONE, NULL, 0, NULL, HFILL }
3883 { &hf_glusterfs_newgfid,
3884 { "New GFID", "glusterfs.newgfid", FT_GUID,
3885 BASE_NONE, NULL, 0, NULL, HFILL }
3887 { &hf_glusterfs_path,
3888 { "Path", "glusterfs.path", FT_STRING, BASE_NONE,
3889 NULL, 0, NULL, HFILL }
3891 { &hf_glusterfs_bname,
3892 { "Basename", "glusterfs.bname", FT_STRING, BASE_NONE,
3893 NULL, 0, NULL, HFILL }
3895 { &hf_glusterfs_dict,
3896 { "Dict", "glusterfs.dict", FT_STRING, BASE_NONE,
3897 NULL, 0, NULL, HFILL }
3899 { &hf_glusterfs_fd,
3900 { "File Descriptor", "glusterfs.fd", FT_UINT64, BASE_DEC,
3901 NULL, 0, NULL, HFILL }
3903 { &hf_glusterfs_offset,
3904 { "Offset", "glusterfs.offset", FT_UINT64, BASE_DEC,
3905 NULL, 0, NULL, HFILL }
3907 { &hf_glusterfs_size,
3908 { "Size", "glusterfs.size", FT_UINT32, BASE_DEC,
3909 NULL, 0, NULL, HFILL }
3911 { &hf_glusterfs_size64,
3912 { "Size", "glusterfs.size64", FT_UINT64, BASE_DEC,
3913 NULL, 0, NULL, HFILL }
3915 { &hf_glusterfs_type,
3916 { "Type", "glusterfs.type", FT_INT32, BASE_DEC,
3917 VALS(glusterfs_lk_type_names), 0, NULL, HFILL }
3919 { &hf_glusterfs_cmd,
3920 { "Command", "glusterfs.cmd", FT_INT32, BASE_DEC | BASE_EXT_STRING,
3921 &glusterfs_lk_cmd_names_ext, 0, NULL, HFILL }
3923 { &hf_glusterfs_volume,
3924 { "Volume", "glusterfs.volume", FT_STRING, BASE_NONE,
3925 NULL, 0, NULL, HFILL }
3927 { &hf_glusterfs_namelen,
3928 { "Name Length", "glusterfs.namelen", FT_UINT32, BASE_DEC,
3929 NULL, 0, NULL, HFILL }
3931 { &hf_glusterfs_linkname,
3932 { "Linkname", "glusterfs.linkname", FT_STRING, BASE_NONE,
3933 NULL, 0, NULL, HFILL }
3935 { &hf_glusterfs_umask,
3936 { "Umask", "glusterfs.umask", FT_UINT32, BASE_OCT,
3937 NULL, 0, NULL, HFILL }
3939 { &hf_glusterfs_mask,
3940 { "Mask", "glusterfs.mask", FT_UINT32, BASE_OCT,
3941 NULL, 0, NULL, HFILL }
3944 { &hf_glusterfs_entries, /* READDIRP returned <x> entries */
3945 { "Entries returned", "glusterfs.entries", FT_INT32, BASE_DEC,
3946 NULL, 0, NULL, HFILL }
3948 { &hf_glusterfs_whence,
3949 { "Whence", "glusterfs.whence", FT_UINT32, BASE_DEC,
3950 VALS(glusterfs_seek_whence), 0, NULL, HFILL }
3952 /* Flags passed on to OPEN, CREATE etc, based on */
3953 { &hf_glusterfs_flags,
3954 { "Flags", "glusterfs.flags", FT_UINT32, BASE_OCT,
3955 NULL, 0, NULL, HFILL }
3957 { &hf_glusterfs_flags_rdonly,
3958 { "O_RDONLY", "glusterfs.flags.rdonly", FT_BOOLEAN, 32,
3959 TFS(&glusterfs_notset_set), 0xffffffff, NULL, HFILL }
3961 { &hf_glusterfs_flags_wronly,
3962 { "O_WRONLY", "glusterfs.flags.wronly", FT_BOOLEAN, 32,
3963 TFS(&tfs_set_notset), 00000001, NULL, HFILL }
3965 { &hf_glusterfs_flags_rdwr,
3966 { "O_RDWR", "glusterfs.flags.rdwr", FT_BOOLEAN, 32,
3967 TFS(&tfs_set_notset), 00000002, NULL, HFILL }
3969 { &hf_glusterfs_flags_accmode,
3970 { "O_ACCMODE", "glusterfs.flags.accmode", FT_UINT32, BASE_DEC,
3971 VALS(glusterfs_accmode_vals), 00000003, NULL, HFILL }
3973 { &hf_glusterfs_flags_append,
3974 { "O_APPEND", "glusterfs.flags.append", FT_BOOLEAN, 32,
3975 TFS(&tfs_set_notset), 00002000, NULL, HFILL }
3977 { &hf_glusterfs_flags_async,
3978 { "O_ASYNC", "glusterfs.flags.async", FT_BOOLEAN, 32,
3979 TFS(&tfs_set_notset), 00020000, NULL, HFILL }
3981 { &hf_glusterfs_flags_cloexec,
3982 { "O_CLOEXEC", "glusterfs.flags.cloexec", FT_BOOLEAN, 32,
3983 TFS(&tfs_set_notset), 02000000, NULL, HFILL }
3985 { &hf_glusterfs_flags_creat,
3986 { "O_CREAT", "glusterfs.flags.creat", FT_BOOLEAN, 32,
3987 TFS(&tfs_set_notset), 00000100, NULL, HFILL }
3989 { &hf_glusterfs_flags_direct,
3990 { "O_DIRECT", "glusterfs.flags.direct", FT_BOOLEAN, 32,
3991 TFS(&tfs_set_notset), 00040000, NULL, HFILL }
3993 { &hf_glusterfs_flags_directory,
3994 { "O_DIRECTORY", "glusterfs.flags.directory", FT_BOOLEAN, 32,
3995 TFS(&tfs_set_notset), 00200000, NULL, HFILL }
3997 { &hf_glusterfs_flags_excl,
3998 { "O_EXCL", "glusterfs.flags.excl", FT_BOOLEAN, 32,
3999 TFS(&tfs_set_notset), 00000200, NULL, HFILL }
4001 { &hf_glusterfs_flags_largefile,
4002 { "O_LARGEFILE", "glusterfs.flags.largefile", FT_BOOLEAN, 32,
4003 TFS(&tfs_set_notset), 00100000, NULL, HFILL }
4005 { &hf_glusterfs_flags_noatime,
4006 { "O_NOATIME", "glusterfs.flags.noatime", FT_BOOLEAN, 32,
4007 TFS(&tfs_set_notset), 01000000, NULL, HFILL }
4009 { &hf_glusterfs_flags_noctty,
4010 { "O_NOCTTY", "glusterfs.flags.noctty", FT_BOOLEAN, 32,
4011 TFS(&tfs_set_notset), 00000400, NULL, HFILL }
4013 { &hf_glusterfs_flags_nofollow,
4014 { "O_NOFOLLOW", "glusterfs.flags.nofollow", FT_BOOLEAN, 32,
4015 TFS(&tfs_set_notset), 00400000, NULL, HFILL }
4017 /* TODO: These 2 have the same mask. Which one is correct? */
4018 { &hf_glusterfs_flags_nonblock,
4019 { "O_NONBLOCK", "glusterfs.flags.nonblock", FT_BOOLEAN, 32,
4020 TFS(&tfs_set_notset), 00004000, NULL, HFILL }
4022 { &hf_glusterfs_flags_ndelay,
4023 { "O_NDELAY", "glusterfs.flags.ndelay", FT_BOOLEAN, 32,
4024 TFS(&tfs_set_notset), 00004000, NULL, HFILL }
4026 /* TODO: These 2 have the same mask. Which one is correct? */
4027 { &hf_glusterfs_flags_sync,
4028 { "O_SYNC", "glusterfs.flags.sync", FT_BOOLEAN, 32,
4029 TFS(&tfs_set_notset), 00010000, NULL, HFILL }
4031 { &hf_glusterfs_flags_trunc,
4032 { "O_TRUNC", "glusterfs.flags.trunc", FT_BOOLEAN, 32,
4033 TFS(&tfs_set_notset), 00001000, NULL, HFILL }
4035 { &hf_glusterfs_flags_reserved,
4036 { "Unused", "glusterfs.flags.reserved", FT_BOOLEAN, 32,
4037 TFS(&tfs_set_notset), 037774000074, NULL, HFILL }
4039 /* access modes */
4040 { &hf_glusterfs_mode,
4041 { "Mode", "glusterfs.mode", FT_UINT32, BASE_OCT,
4042 NULL, 0, "Access Permissions", HFILL }
4044 { &hf_glusterfs_mode_suid,
4045 { "S_ISUID", "glusterfs.mode.s_isuid", FT_BOOLEAN, 32,
4046 TFS(&tfs_set_notset), (04000), "set-user-ID", HFILL }
4048 { &hf_glusterfs_mode_sgid,
4049 { "S_ISGID", "glusterfs.mode.s_isgid", FT_BOOLEAN, 32,
4050 TFS(&tfs_set_notset), (02000), "set-group-ID", HFILL }
4052 { &hf_glusterfs_mode_svtx,
4053 { "S_ISVTX", "glusterfs.mode.s_isvtx", FT_BOOLEAN, 32,
4054 TFS(&tfs_set_notset), (01000), "sticky bit", HFILL }
4056 { &hf_glusterfs_mode_rusr,
4057 { "S_IRUSR", "glusterfs.mode.s_irusr", FT_BOOLEAN, 32,
4058 TFS(&tfs_set_notset), (00400), "read by owner", HFILL }
4060 { &hf_glusterfs_mode_wusr,
4061 { "S_IWUSR", "glusterfs.mode.s_iwusr", FT_BOOLEAN, 32,
4062 TFS(&tfs_set_notset), (00200), "write by owner", HFILL }
4064 { &hf_glusterfs_mode_xusr,
4065 { "S_IXUSR", "glusterfs.mode.s_ixusr", FT_BOOLEAN, 32,
4066 TFS(&tfs_set_notset), (00100), "execute/search by owner", HFILL }
4068 { &hf_glusterfs_mode_rgrp,
4069 { "S_IRGRP", "glusterfs.mode.s_irgrp", FT_BOOLEAN, 32,
4070 TFS(&tfs_set_notset), (00040), "read by group", HFILL }
4072 { &hf_glusterfs_mode_wgrp,
4073 { "S_IWGRP", "glusterfs.mode.s_iwgrp", FT_BOOLEAN, 32,
4074 TFS(&tfs_set_notset), (00020), "write by group", HFILL }
4076 { &hf_glusterfs_mode_xgrp,
4077 { "S_IXGRP", "glusterfs.mode.s_ixgrp", FT_BOOLEAN, 32,
4078 TFS(&tfs_set_notset), (00010), "execute/search by group", HFILL }
4080 { &hf_glusterfs_mode_roth,
4081 { "S_IROTH", "glusterfs.mode.s_iroth", FT_BOOLEAN, 32,
4082 TFS(&tfs_set_notset), (00004), "read by others", HFILL }
4084 { &hf_glusterfs_mode_woth,
4085 { "S_IWOTH", "glusterfs.mode.s_iwoth", FT_BOOLEAN, 32,
4086 TFS(&tfs_set_notset), (00002), "write by others", HFILL }
4088 { &hf_glusterfs_mode_xoth,
4089 { "S_IXOTH", "glusterfs.mode.s_ixoth", FT_BOOLEAN, 32,
4090 TFS(&tfs_set_notset), (00001), "execute/search by others", HFILL }
4092 { &hf_glusterfs_mode_reserved,
4093 { "Reserved", "glusterfs.mode.reserved", FT_BOOLEAN, 32,
4094 TFS(&tfs_set_notset), (~07777), "execute/search by others", HFILL }
4096 /* the dir-entry structure */
4097 { &hf_glusterfs_entry_ino,
4098 { "Inode", "glusterfs.entry.ino", FT_UINT64, BASE_DEC,
4099 NULL, 0, NULL, HFILL }
4101 { &hf_glusterfs_entry_off, /* like telldir() */
4102 { "Offset", "glusterfs.entry.d_off", FT_UINT64, BASE_DEC,
4103 NULL, 0, NULL, HFILL }
4105 { &hf_glusterfs_entry_len, /* length of the path string */
4106 { "Path length", "glusterfs.entry.len", FT_UINT32, BASE_DEC,
4107 NULL, 0, NULL, HFILL }
4109 { &hf_glusterfs_entry_type,
4110 { "Type", "glusterfs.entry.d_type", FT_UINT32, BASE_DEC | BASE_EXT_STRING,
4111 &glusterfs_entry_type_names_ext, 0, NULL, HFILL }
4113 { &hf_glusterfs_entry_path,
4114 { "Path", "glusterfs.entry.path", FT_STRING, BASE_NONE,
4115 NULL, 0, NULL, HFILL }
4117 /* the IATT structure */
4118 { &hf_glusterfs_iatt,
4119 { "IATT", "glusterfs.iatt", FT_NONE, BASE_NONE, NULL,
4120 0, NULL, HFILL }
4122 { &hf_glusterfs_preparent_iatt,
4123 { "Pre-operation parent IATT", "glusterfs.preparent_iatt", FT_NONE, BASE_NONE, NULL,
4124 0, NULL, HFILL }
4126 { &hf_glusterfs_postparent_iatt,
4127 { "Post-operation parent IATT", "glusterfs.postparent_iatt", FT_NONE, BASE_NONE, NULL,
4128 0, NULL, HFILL }
4130 { &hf_glusterfs_preop_iatt,
4131 { "Pre-operation IATT", "glusterfs.preop_iatt", FT_NONE, BASE_NONE, NULL,
4132 0, NULL, HFILL }
4134 { &hf_glusterfs_postop_iatt,
4135 { "Post-operation IATT", "glusterfs.postop_iatt", FT_NONE, BASE_NONE, NULL,
4136 0, NULL, HFILL }
4138 { &hf_glusterfs_ia_ino,
4139 { "Inode", "glusterfs.ia_ino", FT_UINT64, BASE_DEC,
4140 NULL, 0, NULL, HFILL }
4142 { &hf_glusterfs_ia_dev,
4143 { "Device", "glusterfs.ia_dev", FT_UINT64, BASE_HEX,
4144 NULL, 0, NULL, HFILL }
4146 { &hf_glusterfs_ia_mode,
4147 { "Mode", "glusterfs.ia_mode", FT_UINT32, BASE_OCT,
4148 NULL, 0, NULL, HFILL }
4150 { &hf_glusterfs_ia_nlink,
4151 { "Number of hard links", "glusterfs.ia_nlink",
4152 FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL }
4154 { &hf_glusterfs_ia_uid,
4155 { "UID", "glusterfs.ia_uid", FT_INT32, BASE_DEC,
4156 NULL, 0, NULL, HFILL }
4158 { &hf_glusterfs_ia_gid,
4159 { "GID", "glusterfs.ia_gid", FT_INT32, BASE_DEC,
4160 NULL, 0, NULL, HFILL }
4162 { &hf_glusterfs_ia_rdev,
4163 { "Root device", "glusterfs.ia_rdev", FT_UINT64,
4164 BASE_HEX, NULL, 0, NULL, HFILL }
4166 { &hf_glusterfs_ia_size,
4167 { "Size", "glusterfs.ia_size", FT_UINT64, BASE_DEC,
4168 NULL, 0, NULL, HFILL }
4170 { &hf_glusterfs_ia_blksize,
4171 { "Block size", "glusterfs.ia_blksize", FT_INT32,
4172 BASE_DEC, NULL, 0, NULL, HFILL }
4174 { &hf_glusterfs_ia_blocks,
4175 { "Blocks", "glusterfs.ia_blocks", FT_UINT64,
4176 BASE_DEC, NULL, 0, NULL, HFILL }
4178 { &hf_glusterfs_ia_atime,
4179 { "Time of last access", "glusterfs.ia_atime",
4180 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
4181 NULL, HFILL }
4183 { &hf_glusterfs_ia_mtime,
4184 { "Time of last modification", "glusterfs.ia_mtime",
4185 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
4186 NULL, HFILL }
4188 { &hf_glusterfs_ia_ctime,
4189 { "Time of last status change", "glusterfs.ia_ctime",
4190 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
4191 NULL, HFILL }
4194 /* the IATTx structure */
4195 { &hf_glusterfs_iattx,
4196 { "IATTX", "glusterfs.iattx", FT_NONE, BASE_NONE, NULL,
4197 0, NULL, HFILL }
4199 { &hf_glusterfs_preparent_iattx,
4200 { "Pre-operation parent IATTX", "glusterfs.preparent_iattx", FT_NONE, BASE_NONE, NULL,
4201 0, NULL, HFILL }
4203 { &hf_glusterfs_postparent_iattx,
4204 { "Post-operation parent IATTX", "glusterfs.postparent_iattx", FT_NONE, BASE_NONE, NULL,
4205 0, NULL, HFILL }
4207 { &hf_glusterfs_preop_iattx,
4208 { "Pre-operation IATTX", "glusterfs.preop_iattx", FT_NONE, BASE_NONE, NULL,
4209 0, NULL, HFILL }
4211 { &hf_glusterfs_postop_iattx,
4212 { "Post-operation IATTX", "glusterfs.postop_iattx", FT_NONE, BASE_NONE, NULL,
4213 0, NULL, HFILL }
4215 { &hf_glusterfs_iax_attributes,
4216 { "IATT attributes", "glusterfs.iax_attributes", FT_UINT64,
4217 BASE_HEX, NULL, 0, NULL, HFILL }
4219 { &hf_glusterfs_iax_attributes_mask,
4220 { "IATT attributes mask", "glusterfs.iax_attributes_mask", FT_UINT64,
4221 BASE_HEX, NULL, 0, NULL, HFILL }
4223 { &hf_glusterfs_iax_flags,
4224 { "IATT flags", "glusterfs.iax_flags", FT_UINT64,
4225 BASE_HEX, NULL, 0, NULL, HFILL }
4227 { &hf_glusterfs_iax_atime,
4228 { "Time of last access", "glusterfs.iax_atime",
4229 FT_UINT64, BASE_DEC, NULL, 0,
4230 NULL, HFILL }
4232 { &hf_glusterfs_iax_mtime,
4233 { "Time of last modification", "glusterfs.iax_mtime",
4234 FT_UINT64, BASE_DEC, NULL, 0,
4235 NULL, HFILL }
4237 { &hf_glusterfs_iax_ctime,
4238 { "Time of last status change", "glusterfs.iax_ctime",
4239 FT_UINT64, BASE_DEC, NULL, 0,
4240 NULL, HFILL }
4242 { &hf_glusterfs_iax_btime,
4243 { "Creation time", "glusterfs.iax_btime",
4244 FT_UINT64, BASE_DEC, NULL, 0,
4245 NULL, HFILL }
4247 { &hf_glusterfs_iax_atime_nsec,
4248 { "Time of last access(nsec)", "glusterfs.iax_atime_nsec",
4249 FT_UINT64, BASE_DEC, NULL, 0,
4250 NULL, HFILL }
4252 { &hf_glusterfs_iax_mtime_nsec,
4253 { "Time of last modification(nsec)", "glusterfs.iax_mtime_nsec",
4254 FT_UINT64, BASE_DEC, NULL, 0,
4255 NULL, HFILL }
4257 { &hf_glusterfs_iax_ctime_nsec,
4258 { "Time of last status change(nsec)", "glusterfs.iax_ctime_nsec",
4259 FT_UINT64, BASE_DEC, NULL, 0,
4260 NULL, HFILL }
4262 { &hf_glusterfs_iax_btime_nsec,
4263 { "Creation time(nsec)", "glusterfs.iax_btime_nsec",
4264 FT_UINT64, BASE_DEC, NULL, 0,
4265 NULL, HFILL }
4268 /* gf_flock */
4269 { &hf_glusterfs_flock_type,
4270 { "Type", "glusterfs.flock.type", FT_UINT32, BASE_DEC,
4271 VALS(glusterfs_lk_type_names), 0, NULL, HFILL }
4273 { &hf_glusterfs_flock_whence,
4274 { "Whence", "glusterfs.flock.whence", FT_UINT32,
4275 BASE_DEC, VALS(glusterfs_lk_whence), 0, NULL,
4276 HFILL }
4278 { &hf_glusterfs_flock_start,
4279 { "Start", "glusterfs.flock.start", FT_UINT64,
4280 BASE_DEC, NULL, 0, NULL, HFILL }
4282 { &hf_glusterfs_flock_len,
4283 { "Length", "glusterfs.flock.len", FT_UINT64, BASE_DEC,
4284 NULL, 0, NULL, HFILL }
4286 { &hf_glusterfs_flock_pid,
4287 { "PID", "glusterfs.flock.pid", FT_INT32, BASE_DEC,
4288 NULL, 0, NULL, HFILL }
4290 { &hf_glusterfs_flock_owner,
4291 { "Owner", "glusterfs.flock.owner", FT_BYTES,
4292 BASE_NONE, NULL, 0, NULL, HFILL }
4295 /* statvfs descriptions from 'man 2 statvfs' on Linix */
4296 { &hf_glusterfs_bsize,
4297 { "File system block size", "glusterfs.statfs.bsize",
4298 FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }
4300 { &hf_glusterfs_frsize,
4301 { "Fragment size", "glusterfs.statfs.frsize",
4302 FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }
4304 { &hf_glusterfs_blocks,
4305 { "Size of fs in f_frsize units",
4306 "glusterfs.statfs.blocks", FT_UINT64, BASE_DEC,
4307 NULL, 0, NULL, HFILL }
4309 { &hf_glusterfs_bfree,
4310 { "# free blocks", "glusterfs.statfs.bfree", FT_UINT64,
4311 BASE_DEC, NULL, 0, NULL, HFILL }
4313 { &hf_glusterfs_bavail,
4314 { "# free blocks for non-root",
4315 "glusterfs.statfs.bavail", FT_UINT64, BASE_DEC,
4316 NULL, 0, NULL, HFILL }
4318 { &hf_glusterfs_files,
4319 { "# inodes", "glusterfs.statfs.files", FT_UINT64,
4320 BASE_DEC, NULL, 0, NULL, HFILL }
4322 { &hf_glusterfs_ffree,
4323 { "# free inodes", "glusterfs.statfs.ffree", FT_UINT64,
4324 BASE_DEC, NULL, 0, NULL, HFILL }
4326 { &hf_glusterfs_favail,
4327 { "# free inodes for non-root",
4328 "glusterfs.statfs.favail", FT_UINT64, BASE_DEC,
4329 NULL, 0, NULL, HFILL }
4331 { &hf_glusterfs_id,
4332 { "File system ID", "glusterfs.statfs.fsid", FT_UINT64,
4333 BASE_HEX, NULL, 0, NULL, HFILL }
4335 { &hf_glusterfs_mnt_flags,
4336 { "Mount flags", "glusterfs.statfs.flags", FT_UINT64,
4337 BASE_HEX, NULL, 0, NULL, HFILL }
4339 /* ST_* flags from /usr/include/bits/statvfs.h */
4340 { &hf_glusterfs_mnt_flag_rdonly,
4341 { "ST_RDONLY", "glusterfs.statfs.flag.rdonly",
4342 FT_BOOLEAN, 64, TFS(&tfs_set_notset), 1, NULL,
4343 HFILL }
4345 { &hf_glusterfs_mnt_flag_nosuid,
4346 { "ST_NOSUID", "glusterfs.statfs.flag.nosuid",
4347 FT_BOOLEAN, 64, TFS(&tfs_set_notset), 2, NULL,
4348 HFILL }
4350 { &hf_glusterfs_mnt_flag_nodev,
4351 { "ST_NODEV", "glusterfs.statfs.flag.nodev",
4352 FT_BOOLEAN, 64, TFS(&tfs_set_notset), 4, NULL,
4353 HFILL }
4355 { &hf_glusterfs_mnt_flag_noexec,
4356 { "ST_EXEC", "glusterfs.statfs.flag.noexec",
4357 FT_BOOLEAN, 64, TFS(&tfs_set_notset), 8, NULL,
4358 HFILL }
4360 { &hf_glusterfs_mnt_flag_synchronous,
4361 { "ST_SYNCHRONOUS",
4362 "glusterfs.statfs.flag.synchronous",
4363 FT_BOOLEAN, 64, TFS(&tfs_set_notset), 16, NULL,
4364 HFILL }
4366 { &hf_glusterfs_mnt_flag_mandlock,
4367 { "ST_MANDLOCK", "glusterfs.statfs.flag.mandlock",
4368 FT_BOOLEAN, 64, TFS(&tfs_set_notset), 64, NULL,
4369 HFILL }
4371 { &hf_glusterfs_mnt_flag_write,
4372 { "ST_WRITE", "glusterfs.statfs.flag.write",
4373 FT_BOOLEAN, 64, TFS(&tfs_set_notset), 128,
4374 NULL, HFILL }
4376 { &hf_glusterfs_mnt_flag_append,
4377 { "ST_APPEND", "glusterfs.statfs.flag.append",
4378 FT_BOOLEAN, 64, TFS(&tfs_set_notset), 256,
4379 NULL, HFILL }
4381 { &hf_glusterfs_mnt_flag_immutable,
4382 { "ST_IMMUTABLE", "glusterfs.statfs.flag.immutable",
4383 FT_BOOLEAN, 64, TFS(&tfs_set_notset), 512,
4384 NULL, HFILL }
4386 { &hf_glusterfs_mnt_flag_noatime,
4387 { "ST_NOATIME", "glusterfs.statfs.flag.noatime",
4388 FT_BOOLEAN, 64, TFS(&tfs_set_notset), 1024,
4389 NULL, HFILL }
4391 { &hf_glusterfs_mnt_flag_nodiratime,
4392 { "ST_NODIRATIME", "glusterfs.statfs.flag.nodiratime",
4393 FT_BOOLEAN, 64, TFS(&tfs_set_notset), 2048,
4394 NULL, HFILL }
4396 { &hf_glusterfs_mnt_flag_relatime,
4397 { "ST_RELATIME", "glusterfs.statfs.flag.relatime",
4398 FT_BOOLEAN, 64, TFS(&tfs_set_notset), 4096,
4399 NULL, HFILL }
4401 { &hf_glusterfs_namemax,
4402 { "Maximum filename length",
4403 "glusterfs.statfs.namemax", FT_UINT64,
4404 BASE_DEC, NULL, 0, NULL, HFILL }
4406 { &hf_glusterfs_setattr_valid,
4407 { "Set attributes", "glusterfs.setattr.valid",
4408 FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }
4410 /* setattr.valid flags from libglusterfs/src/xlator.h */
4411 { &hf_glusterfs_setattr_set_mode,
4412 { "SET_ATTR_MODE", "glusterfs.setattr.set_mode",
4413 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001,
4414 NULL, HFILL }
4416 { &hf_glusterfs_setattr_set_uid,
4417 { "SET_ATTR_UID", "glusterfs.setattr.set_uid",
4418 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002,
4419 NULL, HFILL }
4421 { &hf_glusterfs_setattr_set_gid,
4422 { "SET_ATTR_GID", "glusterfs.setattr.set_gid",
4423 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000004,
4424 NULL, HFILL }
4426 { &hf_glusterfs_setattr_set_size,
4427 { "SET_ATTR_SIZE", "glusterfs.setattr.set_size",
4428 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000008,
4429 NULL, HFILL }
4431 { &hf_glusterfs_setattr_set_atime,
4432 { "SET_ATTR_ATIME", "glusterfs.setattr.set_atime",
4433 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000010,
4434 NULL, HFILL }
4436 { &hf_glusterfs_setattr_set_mtime,
4437 { "SET_ATTR_MTIME", "glusterfs.setattr.set_mtime",
4438 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000020,
4439 NULL, HFILL }
4441 { &hf_glusterfs_setattr_set_reserved,
4442 { "Reserved", "glusterfs.setattr.set_reserved",
4443 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0xffffffcf,
4444 NULL, HFILL }
4446 { &hf_glusterfs_xflags,
4447 { "XFlags", "glusterfs.xflags", FT_UINT32, BASE_OCT,
4448 NULL, 0, NULL, HFILL }
4450 { &hf_glusterfs_oldbname,
4451 { "OldBasename", "glusterfs.oldbname", FT_STRING, BASE_NONE,
4452 NULL, 0, NULL, HFILL }
4454 { &hf_glusterfs_newbname,
4455 { "NewBasename", "glusterfs.newbname", FT_STRING, BASE_NONE,
4456 NULL, 0, NULL, HFILL }
4458 { &hf_glusterfs_name,
4459 { "Name", "glusterfs.name", FT_STRING, BASE_NONE,
4460 NULL, 0, NULL, HFILL }
4462 { &hf_glusterfs_fsync_flags,
4463 { "Flags", "glusterfs.fsync.flags", FT_UINT32, BASE_HEX,
4464 NULL, 0, NULL, HFILL }
4466 { &hf_glusterfs_fsync_flag_datasync,
4467 { "DATASYNC", "glusterfs.fsync.datasync",
4468 FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x1,
4469 NULL, HFILL }
4471 { &hf_glusterfs_fsync_flag_unknown,
4472 { "Unknown", "glusterfs.fsync.unknown",
4473 FT_BOOLEAN, 32, TFS(&tfs_set_notset), ~0x1,
4474 NULL, HFILL }
4476 /* For entry an fentry lk */
4477 { &hf_glusterfs_entrylk_namelen,
4478 { "File Descriptor", "glusterfs.entrylk.namelen", FT_UINT64, BASE_DEC,
4479 NULL, 0, NULL, HFILL }
4481 { &hf_gluster_dict_xdr_size,
4482 { "XDR Size", "glusterfs.dict_xdr_size", FT_UINT32, BASE_DEC,
4483 NULL, 0, NULL, HFILL }
4485 { &hf_gluster_dict_size,
4486 { "Size", "glusterfs.dict_size", FT_UINT32, BASE_DEC,
4487 NULL, 0, NULL, HFILL }
4489 { &hf_gluster_num_dict_items,
4490 { "Items", "glusterfs.num_dict_items", FT_UINT32, BASE_DEC,
4491 NULL, 0, NULL, HFILL }
4493 { &hf_gluster_rpc_roundup_bytes,
4494 { "RPC-roundup bytes", "glusterfs.rpc_roundup_bytes", FT_BYTES, BASE_NONE,
4495 NULL, 0, NULL, HFILL }
4497 { &hf_gluster_trusted_afr_key,
4498 { "Key", "glusterfs.trusted_afr_key", FT_BYTES, BASE_NONE,
4499 NULL, 0, NULL, HFILL }
4501 { &hf_gluster_dict_value,
4502 { "Value", "glusterfs.dict_value", FT_STRING, BASE_NONE,
4503 NULL, 0, NULL, HFILL }
4507 /* Setup protocol subtree array */
4508 static int *ett[] = {
4509 &ett_glusterfs,
4510 &ett_glusterfs_flags,
4511 &ett_glusterfs_mnt_flags,
4512 &ett_glusterfs_mode,
4513 &ett_glusterfs_entry,
4514 &ett_glusterfs_setattr_valid,
4515 &ett_glusterfs_parent_iatt,
4516 &ett_glusterfs_iatt,
4517 &ett_glusterfs_flock,
4518 &ett_glusterfs_fsync_flags,
4519 &ett_gluster_dict,
4520 &ett_gluster_dict_items
4523 /* Register the protocol name and description */
4524 proto_glusterfs = proto_register_protocol("GlusterFS", "GlusterFS",
4525 "glusterfs");
4526 proto_register_subtree_array(ett, array_length(ett));
4527 proto_register_field_array(proto_glusterfs, hf, array_length(hf));
4530 void
4531 proto_reg_handoff_glusterfs(void)
4533 rpc_init_prog(proto_glusterfs, GLUSTER3_1_FOP_PROGRAM, ett_glusterfs,
4534 G_N_ELEMENTS(glusterfs_vers_info), glusterfs_vers_info);
4538 * Editor modelines - https://www.wireshark.org/tools/modelines.html
4540 * Local variables:
4541 * c-basic-offset: 8
4542 * tab-width: 8
4543 * indent-tabs-mode: t
4544 * End:
4546 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
4547 * :indentSize=8:tabSize=8:noTabs=false: