Coverage Report

Created: 2025-02-15 06:25

/src/wireshark/epan/dissectors/packet-glusterfs.c
Line
Count
Source (jump to first uncovered line)
1
/* packet-glusterfs.c
2
 * Routines for GlusterFS dissection
3
 * Copyright 2012, Niels de Vos <ndevos@redhat.com>
4
 *
5
 * Wireshark - Network traffic analyzer
6
 * By Gerald Combs <gerald@wireshark.org>
7
 * Copyright 1998 Gerald Combs
8
 *
9
 * SPDX-License-Identifier: GPL-2.0-or-later
10
 *
11
 *
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
16
 *
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.
19
 */
20
21
#include "config.h"
22
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"
28
29
void proto_register_glusterfs(void);
30
void proto_reg_handoff_glusterfs(void);
31
32
/* Initialize the protocol and registered fields */
33
static int proto_glusterfs;
34
35
/* programs and procedures */
36
static int hf_glusterfs_proc;
37
38
/* fields used by multiple programs/procedures */
39
static int hf_gluster_op_ret;
40
static int hf_gluster_op_errno;
41
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;
65
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;
88
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;
104
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;
111
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;
131
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;
148
149
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;
157
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;
182
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;
192
193
/* Rename */
194
static int hf_glusterfs_oldbname;
195
static int hf_glusterfs_newbname;
196
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;
201
202
/* for entrylk */
203
static int hf_glusterfs_entrylk_namelen;
204
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;
211
212
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;
226
227
static int
228
glusterfs_rpc_dissect_gfid(proto_tree *tree, tvbuff_t *tvb, int hfindex, int offset)
229
0
{
230
0
  proto_tree_add_item(tree, hfindex, tvb, offset, 16, ENC_NA);
231
0
  offset += 16;
232
233
0
  return offset;
234
0
}
235
236
static int
237
glusterfs_rpc_dissect_mode(proto_tree *tree, tvbuff_t *tvb, int hfindex,
238
                int offset)
239
0
{
240
0
  static int * const mode_bits[] = {
241
0
    &hf_glusterfs_mode_suid,
242
0
    &hf_glusterfs_mode_sgid,
243
0
    &hf_glusterfs_mode_svtx,
244
0
    &hf_glusterfs_mode_rusr,
245
0
    &hf_glusterfs_mode_wusr,
246
0
    &hf_glusterfs_mode_xusr,
247
0
    &hf_glusterfs_mode_rgrp,
248
0
    &hf_glusterfs_mode_wgrp,
249
0
    &hf_glusterfs_mode_xgrp,
250
0
    &hf_glusterfs_mode_roth,
251
0
    &hf_glusterfs_mode_woth,
252
0
    &hf_glusterfs_mode_xoth,
253
0
    &hf_glusterfs_mode_reserved,
254
0
    NULL
255
0
  };
256
257
0
  proto_tree_add_bitmask(tree, tvb, offset, hfindex,
258
0
      ett_glusterfs_mode, mode_bits, ENC_BIG_ENDIAN);
259
260
0
  offset += 4;
261
0
  return offset;
262
0
}
263
264
/*
265
 * from rpc/xdr/src/glusterfs3-xdr.c:xdr_gf_iatt()
266
 */
267
int
268
glusterfs_rpc_dissect_gf_iatt(proto_tree *tree, tvbuff_t *tvb, int hfindex,
269
                int offset)
270
0
{
271
0
  proto_item *iatt_item;
272
0
  proto_tree *iatt_tree;
273
0
  int start_offset = offset;
274
275
0
  iatt_item = proto_tree_add_item(tree, hfindex, tvb, offset, -1,
276
0
                ENC_NA);
277
0
  iatt_tree = proto_item_add_subtree(iatt_item, ett_glusterfs_iatt);
278
279
0
  offset = glusterfs_rpc_dissect_gfid(iatt_tree, tvb, hf_glusterfs_gfid,
280
0
                offset);
281
0
  offset = dissect_rpc_uint64(tvb, iatt_tree, hf_glusterfs_ia_ino,
282
0
                offset);
283
0
  offset = dissect_rpc_uint64(tvb, iatt_tree, hf_glusterfs_ia_dev,
284
0
                offset);
285
0
  offset = glusterfs_rpc_dissect_mode(iatt_tree, tvb,
286
0
            hf_glusterfs_ia_mode, offset);
287
0
  offset = dissect_rpc_uint32(tvb, iatt_tree, hf_glusterfs_ia_nlink,
288
0
                offset);
289
0
  offset = dissect_rpc_uint32(tvb, iatt_tree, hf_glusterfs_ia_uid,
290
0
                offset);
291
0
  offset = dissect_rpc_uint32(tvb, iatt_tree, hf_glusterfs_ia_gid,
292
0
                offset);
293
0
  offset = dissect_rpc_uint64(tvb, iatt_tree, hf_glusterfs_ia_rdev,
294
0
                offset);
295
0
  offset = dissect_rpc_uint64(tvb, iatt_tree, hf_glusterfs_ia_size,
296
0
                offset);
297
0
  offset = dissect_rpc_uint32(tvb, iatt_tree, hf_glusterfs_ia_blksize,
298
0
                offset);
299
0
  offset = dissect_rpc_uint64(tvb, iatt_tree, hf_glusterfs_ia_blocks,
300
0
                offset);
301
302
0
  proto_tree_add_item(iatt_tree, hf_glusterfs_ia_atime, tvb,
303
0
      offset, 8, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN);
304
0
  offset += 8;
305
306
0
  proto_tree_add_item(iatt_tree, hf_glusterfs_ia_mtime, tvb,
307
0
      offset, 8, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN);
308
0
  offset += 8;
309
310
0
  proto_tree_add_item(iatt_tree, hf_glusterfs_ia_ctime, tvb,
311
0
      offset, 8, ENC_TIME_SECS_NSECS|ENC_BIG_ENDIAN);
312
0
  offset += 8;
313
314
0
  proto_item_set_len (iatt_item, offset - start_offset);
315
316
0
  return offset;
317
0
}
318
319
static int
320
glusterfs_rpc_dissect_gf_flock(proto_tree *tree, tvbuff_t *tvb, int offset)
321
0
{
322
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_flock_type, offset);
323
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_flock_whence, offset);
324
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_flock_start, offset);
325
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_flock_len, offset);
326
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_flock_pid, offset);
327
328
0
  proto_tree_add_item(tree, hf_glusterfs_flock_owner, tvb, offset, 8, ENC_NA);
329
0
  offset += 8;
330
331
0
  return offset;
332
0
}
333
334
static int
335
glusterfs_rpc_dissect_gf_2_flock(proto_tree *tree, tvbuff_t *tvb, int offset)
336
0
{
337
0
  proto_item *flock_item;
338
0
  proto_tree *flock_tree;
339
0
  int len;
340
0
  int start_offset = offset;
341
342
0
  flock_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_glusterfs_flock, &flock_item, "Flock");
343
344
0
  offset = dissect_rpc_uint32(tvb, flock_tree, hf_glusterfs_flock_type,
345
0
                offset);
346
0
  offset = dissect_rpc_uint32(tvb, flock_tree, hf_glusterfs_flock_whence,
347
0
                offset);
348
0
  offset = dissect_rpc_uint64(tvb, flock_tree, hf_glusterfs_flock_start,
349
0
                offset);
350
0
  offset = dissect_rpc_uint64(tvb, flock_tree, hf_glusterfs_flock_len,
351
0
                offset);
352
0
  offset = dissect_rpc_uint32(tvb, flock_tree, hf_glusterfs_flock_pid,
353
0
                offset);
354
355
0
  len = tvb_get_ntohl(tvb, offset);
356
0
  offset += 4;
357
358
0
  proto_tree_add_item(flock_tree, hf_glusterfs_flock_owner, tvb, offset, len, ENC_NA);
359
0
  offset += len;
360
361
0
  proto_item_set_len (flock_item, offset - start_offset);
362
363
0
  return offset;
364
0
}
365
366
static const true_false_string glusterfs_notset_set = {
367
  "Not set",
368
  "Set"
369
};
370
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}
377
};
378
379
static int
380
glusterfs_rpc_dissect_flags(proto_tree *tree, tvbuff_t *tvb, int offset)
381
0
{
382
0
  bool rdonly;
383
0
  uint32_t accmode;
384
0
  proto_item *flag_tree;
385
0
  header_field_info *rdonly_hf, *accmode_hf;
386
387
0
  static int * const flag_bits[] = {
388
0
    &hf_glusterfs_flags_wronly,
389
0
    &hf_glusterfs_flags_rdwr,
390
0
    &hf_glusterfs_flags_creat,
391
0
    &hf_glusterfs_flags_excl,
392
0
    &hf_glusterfs_flags_noctty,
393
0
    &hf_glusterfs_flags_trunc,
394
0
    &hf_glusterfs_flags_append,
395
0
    &hf_glusterfs_flags_nonblock,
396
0
    &hf_glusterfs_flags_ndelay,
397
0
    &hf_glusterfs_flags_sync,
398
0
    &hf_glusterfs_flags_async,
399
0
    &hf_glusterfs_flags_direct,
400
0
    &hf_glusterfs_flags_largefile,
401
0
    &hf_glusterfs_flags_directory,
402
0
    &hf_glusterfs_flags_nofollow,
403
0
    &hf_glusterfs_flags_noatime,
404
0
    &hf_glusterfs_flags_cloexec,
405
0
    &hf_glusterfs_flags_reserved,
406
0
    NULL
407
0
  };
408
409
0
  flag_tree = proto_tree_add_bitmask(tree, tvb, offset, hf_glusterfs_flags, ett_glusterfs_flags, flag_bits, ENC_BIG_ENDIAN);
410
411
  /* rdonly is true only when no flags are set */
412
0
  rdonly = (tvb_get_ntohl(tvb, offset) == 0);
413
0
  proto_tree_add_item(flag_tree, hf_glusterfs_flags_rdonly, tvb, offset, 4, ENC_BIG_ENDIAN);
414
0
  if (rdonly) {
415
0
    rdonly_hf = proto_registrar_get_nth(hf_glusterfs_flags_rdonly);
416
0
    proto_item_append_text(flag_tree, ", %s", rdonly_hf->name);
417
0
  }
418
419
  /* hf_glusterfs_flags_accmode is true if bits 0 and 1 are set */
420
0
  accmode_hf = proto_registrar_get_nth(hf_glusterfs_flags_accmode);
421
0
  accmode = tvb_get_ntohl(tvb, offset);
422
0
  proto_tree_add_uint_format_value(flag_tree, hf_glusterfs_flags_accmode, tvb, offset, 4, accmode,
423
0
      "%s", val_to_str_const((accmode & (uint32_t)(accmode_hf->bitmask)), glusterfs_accmode_vals, "Unknown"));
424
0
  if ((accmode & accmode_hf->bitmask) == accmode_hf->bitmask)
425
0
    proto_item_append_text(flag_tree, ", %s", proto_registrar_get_nth(hf_glusterfs_flags_accmode)->name);
426
427
0
  offset += 4;
428
0
  return offset;
429
0
}
430
431
static int
432
glusterfs_rpc_dissect_statfs(proto_tree *tree, tvbuff_t *tvb, int offset)
433
0
{
434
0
  static int * const flag_bits[] = {
435
0
    &hf_glusterfs_mnt_flag_rdonly,
436
0
    &hf_glusterfs_mnt_flag_nosuid,
437
0
    &hf_glusterfs_mnt_flag_nodev,
438
0
    &hf_glusterfs_mnt_flag_noexec,
439
0
    &hf_glusterfs_mnt_flag_synchronous,
440
0
    &hf_glusterfs_mnt_flag_mandlock,
441
0
    &hf_glusterfs_mnt_flag_write,
442
0
    &hf_glusterfs_mnt_flag_append,
443
0
    &hf_glusterfs_mnt_flag_immutable,
444
0
    &hf_glusterfs_mnt_flag_noatime,
445
0
    &hf_glusterfs_mnt_flag_nodiratime,
446
0
    &hf_glusterfs_mnt_flag_relatime,
447
0
    NULL
448
0
  };
449
450
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_bsize, offset);
451
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_frsize, offset);
452
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_blocks, offset);
453
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_bfree, offset);
454
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_bavail, offset);
455
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_files, offset);
456
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_ffree, offset);
457
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_favail, offset);
458
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_id, offset);
459
460
0
  proto_tree_add_bitmask(tree, tvb, offset,
461
0
      hf_glusterfs_mnt_flags, ett_glusterfs_mnt_flags,
462
0
      flag_bits, ENC_BIG_ENDIAN);
463
0
  offset += 8;
464
465
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_namemax, offset);
466
467
0
  return offset;
468
0
}
469
470
/* function for dissecting and adding a gluster dict_t to the tree */
471
int
472
gluster_rpc_dissect_dict(proto_tree *tree, tvbuff_t *tvb, int hfindex, int offset)
473
0
{
474
0
  char *key, *value;
475
0
  const char *name;
476
0
  int roundup, value_len, key_len;
477
0
  uint32_t i, items, len;
478
0
  int start_offset, start_offset2;
479
480
0
  proto_item *subtree_item, *ti;
481
0
  proto_tree *subtree;
482
483
0
  proto_item *dict_item = NULL;
484
485
  /* create a subtree for all the items in the dict */
486
0
  if (hfindex >= 0) {
487
0
    header_field_info *hfinfo = proto_registrar_get_nth(hfindex);
488
0
    name = hfinfo->name;
489
0
  } else
490
0
    name = "<NAMELESS DICT STRUCTURE>";
491
492
0
  start_offset = offset;
493
0
  subtree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_gluster_dict, &subtree_item, name);
494
495
0
  len = tvb_get_ntohl(tvb, offset);
496
0
  roundup = rpc_roundup(len) - len;
497
0
  ti = proto_tree_add_item_ret_uint(subtree, hf_gluster_dict_size, tvb, offset, 4, ENC_BIG_ENDIAN, &len);
498
0
  proto_item_append_text(ti, " (%d bytes inc. RPC-roundup)", rpc_roundup(len));
499
0
  proto_item_set_generated(ti);
500
0
  offset += 4;
501
502
0
  if (len == 0)
503
0
    items = 0;
504
0
  else
505
0
    items = tvb_get_ntohl(tvb, offset);
506
507
0
  proto_item_append_text(subtree_item, ", contains %d item%s", items, items == 1 ? "" : "s");
508
509
0
  if (len == 0)
510
0
    return offset;
511
512
0
  proto_tree_add_uint(subtree, hf_gluster_num_dict_items, tvb, offset, 4, items);
513
0
  offset += 4;
514
515
0
  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
0
    offset += 4;
519
0
    value_len = tvb_get_ntohl(tvb, offset);
520
0
    offset += 4;
521
522
    /* read the key, '\0' terminated */
523
0
    key = tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset, &key_len, ENC_ASCII);
524
0
    start_offset2 = offset;
525
0
    offset += key_len;
526
527
    /* read the value, possibly '\0' terminated */
528
529
    /* keys named "gfid-req" contain a GFID in hex */
530
0
    if (value_len == 16 && (
531
0
          !strncmp("gfid-req", key, 8) ||
532
0
          !strncmp("transaction_id", key, 14) ||
533
0
          !strncmp("originator_uuid", key, 15))) {
534
0
      char *gfid_s;
535
0
      e_guid_t gfid;
536
537
0
      tvb_get_ntohguid(tvb, offset, &gfid);
538
539
0
      gfid_s = guid_to_str(wmem_packet_scope(), &gfid);
540
0
      dict_item = proto_tree_add_guid_format(subtree, hf_glusterfs_gfid,
541
0
          tvb, offset, 16, &gfid,
542
0
          "%s: %s", key, gfid_s);
543
      /* this is a changelog in binary format */
544
0
    } else if (value_len == 12 && !strncmp("trusted.afr.", key, 12)) {
545
0
      dict_item = proto_tree_add_bytes_format(subtree, hf_gluster_trusted_afr_key, tvb, offset, 12,
546
0
          NULL, "%s: 0x%.8x%.8x%.8x", key,
547
0
          tvb_get_letohl(tvb, offset + 0),
548
0
          tvb_get_letohl(tvb, offset + 4),
549
0
          tvb_get_letohl(tvb, offset + 8));
550
0
    } else {
551
0
      value = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, value_len, ENC_ASCII);
552
0
      dict_item = proto_tree_add_string_format(subtree, hf_gluster_dict_value, tvb, offset, value_len, value, "%s: %s",
553
0
          key, value);
554
0
    }
555
556
0
    offset += value_len;
557
0
    proto_item_set_len (dict_item, offset - start_offset2);
558
0
  }
559
560
0
  if (roundup) {
561
0
    ti = proto_tree_add_item(subtree, hf_gluster_rpc_roundup_bytes, tvb, offset, -1, ENC_NA);
562
0
    proto_item_set_generated(ti);
563
0
    offset += roundup;
564
0
  }
565
566
0
  proto_item_set_len (subtree_item, offset - start_offset);
567
568
0
  return offset;
569
0
}
570
571
/*
572
 * from rpc/xdr/src/glusterfs3-xdr.c:xdr_gf_iatt()
573
 */
574
static int
575
glusterfs_rpc_dissect_gfx_iatt(proto_tree *tree, tvbuff_t *tvb, int hfindex,
576
                int offset)
577
0
{
578
0
  proto_item *iatt_item;
579
0
  proto_tree *iatt_tree;
580
0
  int start_offset = offset;
581
582
0
  iatt_item = proto_tree_add_item(tree, hfindex, tvb, offset, -1,
583
0
                ENC_NA);
584
0
  iatt_tree = proto_item_add_subtree(iatt_item, ett_glusterfs_iatt);
585
586
0
  offset = glusterfs_rpc_dissect_gfid(iatt_tree, tvb, hf_glusterfs_gfid,
587
0
                offset);
588
0
  offset = dissect_rpc_uint64(tvb, iatt_tree, hf_glusterfs_iax_flags,
589
0
                offset);
590
0
  offset = dissect_rpc_uint64(tvb, iatt_tree, hf_glusterfs_ia_ino,
591
0
                offset);
592
0
  offset = dissect_rpc_uint64(tvb, iatt_tree, hf_glusterfs_ia_dev,
593
0
                offset);
594
0
  offset = dissect_rpc_uint64(tvb, iatt_tree, hf_glusterfs_ia_rdev,
595
0
                offset);
596
0
  offset = dissect_rpc_uint64(tvb, iatt_tree, hf_glusterfs_ia_size,
597
0
                offset);
598
0
  offset = dissect_rpc_uint64(tvb, iatt_tree, hf_glusterfs_ia_blocks,
599
0
                offset);
600
0
  offset = dissect_rpc_uint64(tvb, iatt_tree, hf_glusterfs_iax_attributes,
601
0
                offset);
602
0
  offset = dissect_rpc_uint64(tvb, iatt_tree, hf_glusterfs_iax_attributes_mask,
603
0
                offset);
604
0
  offset = dissect_rpc_uint64(tvb, iatt_tree, hf_glusterfs_iax_atime,
605
0
                offset);
606
0
  offset = dissect_rpc_uint64(tvb, iatt_tree, hf_glusterfs_iax_mtime,
607
0
                offset);
608
0
  offset = dissect_rpc_uint64(tvb, iatt_tree, hf_glusterfs_iax_ctime,
609
0
                offset);
610
0
  offset = dissect_rpc_uint64(tvb, iatt_tree, hf_glusterfs_iax_btime,
611
0
                offset);
612
0
  offset = dissect_rpc_uint32(tvb, iatt_tree, hf_glusterfs_iax_atime_nsec,
613
0
                offset);
614
0
  offset = dissect_rpc_uint32(tvb, iatt_tree, hf_glusterfs_iax_mtime_nsec,
615
0
                offset);
616
0
  offset = dissect_rpc_uint32(tvb, iatt_tree, hf_glusterfs_iax_ctime_nsec,
617
0
                offset);
618
0
  offset = dissect_rpc_uint32(tvb, iatt_tree, hf_glusterfs_iax_btime_nsec,
619
0
                offset);
620
0
  offset = dissect_rpc_uint32(tvb, iatt_tree, hf_glusterfs_ia_nlink,
621
0
                offset);
622
0
  offset = dissect_rpc_uint32(tvb, iatt_tree, hf_glusterfs_ia_uid,
623
0
                offset);
624
0
  offset = dissect_rpc_uint32(tvb, iatt_tree, hf_glusterfs_ia_gid,
625
0
                offset);
626
0
  offset = dissect_rpc_uint32(tvb, iatt_tree, hf_glusterfs_ia_blksize,
627
0
                offset);
628
0
  offset = glusterfs_rpc_dissect_mode(iatt_tree, tvb,
629
0
            hf_glusterfs_ia_mode, offset);
630
631
0
  proto_item_set_len (iatt_item, offset - start_offset);
632
633
0
  return offset;
634
0
}
635
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)
639
0
{
640
0
  char *key, *value;
641
0
  const char *name;
642
0
  uint32_t i, items, len, val_type, val_len, key_len;
643
0
  int start_offset, start_offset2;
644
0
  char *gfid_s;
645
0
  e_guid_t gfid;
646
647
0
  proto_item *subtree_item;
648
0
  proto_tree *subtree;
649
650
0
  proto_item *dict_item = NULL;
651
652
  /* create a subtree for all the items in the dict */
653
0
  if (hfindex >= 0) {
654
0
    header_field_info *hfinfo = proto_registrar_get_nth(hfindex);
655
0
    name = hfinfo->name;
656
0
  } else
657
0
    name = "<NAMELESS DICT STRUCTURE>";
658
659
0
  start_offset = offset;
660
0
  subtree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_gluster_dict, &subtree_item, name);
661
662
0
  len = tvb_get_ntohl(tvb, offset);
663
0
  offset = dissect_rpc_uint32 (tvb, subtree, hf_gluster_dict_xdr_size, offset);
664
665
0
  offset += 4;
666
667
0
  if (len == 0)
668
0
    items = 0;
669
0
  else
670
0
    items = tvb_get_ntohl(tvb, offset);
671
0
  offset = dissect_rpc_uint32 (tvb, subtree, hf_gluster_num_dict_items, offset);
672
673
0
  if (len == 0)
674
0
    return offset;
675
676
0
  for (i = 0; i < items; i++) {
677
0
    val_len = 0;
678
0
    key_len = tvb_get_ntohl(tvb, offset);
679
0
    key_len = rpc_roundup(key_len);
680
0
    offset += 4;
681
682
    /* read the key, '\0' terminated */
683
0
    key = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, key_len, ENC_ASCII);
684
0
    start_offset2 = offset;
685
0
    offset += key_len;
686
687
0
    val_type = tvb_get_ntohl(tvb, offset);
688
0
    offset += 4;
689
690
0
    if (val_type == 2) {
691
0
      val_len = 8;
692
0
      dict_item = proto_tree_add_string_format(subtree, hf_gluster_dict_value, tvb, offset, val_len,
693
0
                NULL, "%s: %"PRId64, key,
694
0
                tvb_get_int64(tvb, offset, ENC_BIG_ENDIAN));
695
0
    } else if (val_type == 3) {
696
0
      val_len = 8;
697
0
      dict_item = proto_tree_add_string_format(subtree, hf_gluster_dict_value, tvb, offset, val_len,
698
0
                NULL, "%s: %"PRIu64, key,
699
0
                tvb_get_uint64(tvb, offset, ENC_BIG_ENDIAN));
700
0
    } else if (val_type == 4) {
701
0
      val_len = 8;
702
0
      dict_item = proto_tree_add_string_format(subtree, hf_gluster_dict_value, tvb, offset, val_len,
703
0
                NULL, "%s: %f", key,
704
0
                tvb_get_ieee_double(tvb, offset, ENC_BIG_ENDIAN));
705
0
    } else if (val_type == 5) {
706
0
      val_len = tvb_get_ntohl(tvb, offset);
707
0
      val_len = rpc_roundup(val_len);
708
0
      offset += 4;
709
0
      value = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, val_len, ENC_ASCII);
710
0
      dict_item = proto_tree_add_string_format(subtree, hf_gluster_dict_value, tvb, offset, val_len, value, "%s: %s",
711
0
                key, value);
712
0
    } else if (val_type == 8) {
713
0
      offset = glusterfs_rpc_dissect_gfx_iatt(tree, tvb,
714
0
          hf_glusterfs_preparent_iatt, offset);
715
0
    } else if (val_type == 7) {
716
0
      val_len = 16;
717
0
      tvb_get_ntohguid(tvb, offset, &gfid);
718
0
      gfid_s = guid_to_str(wmem_packet_scope(), &gfid);
719
0
      dict_item = proto_tree_add_guid_format(subtree, hf_glusterfs_gfid,
720
0
                tvb, offset, val_len, &gfid,
721
0
                "%s: %s", key, gfid_s);
722
0
    } else if (val_type == 6) {
723
0
      val_len = tvb_get_ntohl(tvb, offset);
724
0
      offset += 4;
725
726
      /* read the value, possibly '\0' terminated */
727
728
      /* keys named "gfid-req" contain a GFID in hex */
729
0
      if (val_len == 16 && (
730
0
            !strncmp("gfid-req", key, 8) ||
731
0
            !strncmp("transaction_id", key, 14) ||
732
0
            !strncmp("originator_uuid", key, 15))) {
733
0
        tvb_get_ntohguid(tvb, offset, &gfid);
734
735
0
        gfid_s = guid_to_str(wmem_packet_scope(), &gfid);
736
0
        dict_item = proto_tree_add_guid_format(subtree, hf_glusterfs_gfid,
737
0
            tvb, offset, 16, &gfid,
738
0
            "%s: %s", key, gfid_s);
739
        /* this is a changelog in binary format */
740
0
      } else if (val_len == 12 && !strncmp("trusted.afr.", key, 12)) {
741
0
        dict_item = proto_tree_add_bytes_format(subtree, hf_gluster_trusted_afr_key, tvb, offset, 12,
742
0
            NULL, "%s: 0x%.8x%.8x%.8x", key,
743
0
            tvb_get_letohl(tvb, offset + 0),
744
0
            tvb_get_letohl(tvb, offset + 4),
745
0
            tvb_get_letohl(tvb, offset + 8));
746
0
      } else {
747
0
        value = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, val_len, ENC_ASCII);
748
0
        dict_item = proto_tree_add_string_format(subtree, hf_gluster_dict_value, tvb, offset, val_len, value, "%s: %s",
749
0
            key, value);
750
0
      }
751
0
    }
752
753
0
    offset += val_len;
754
0
    proto_item_set_len (dict_item, offset - start_offset2);
755
0
  }
756
757
0
  proto_item_set_len (subtree_item, offset - start_offset);
758
759
0
  return offset;
760
0
}
761
762
/*
763
  GlusterFS protocol error codes, from the GlusterFS source.
764
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.
774
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:
778
779
  Copyright (c) 2008-2012 Red Hat, Inc. <http://www.redhat.com>
780
  This file is part of GlusterFS.
781
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.
786
*/
787
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 */
830
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 */
918
919
  /* for robust mutexes */
920
  {130, "Owner died"},      /* GF_ERROR_CODE_OWNERDEAD */
921
  {131, "State not recoverable"},   /* GF_ERROR_CODE_NOTRECOVERABLE */
922
923
  /*
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.
928
   */
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 */
934
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 */
946
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 */
955
956
  /* Solaris */
957
  {801, "Facility is not active"},  /* GF_ERROR_CODE_NOTACTIVE */
958
  {802, "Locked lock was unmapped"},  /* GF_ERROR_CODE_LOCKUNMAPPED */
959
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 */
972
973
  {0, NULL}
974
};
975
static value_string_ext glusterfs_error_codes_ext = VALUE_STRING_EXT_INIT(glusterfs_error_codes);
976
977
int
978
gluster_dissect_common_reply(tvbuff_t *tvb, int offset,
979
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
980
0
{
981
0
  proto_item *errno_item;
982
0
  unsigned op_errno;
983
984
0
  offset = dissect_rpc_uint32(tvb, tree, hf_gluster_op_ret, offset);
985
986
0
  op_errno = tvb_get_ntohl(tvb, offset);
987
0
  errno_item = proto_tree_add_int(tree, hf_gluster_op_errno, tvb,
988
0
      offset, 4, op_errno);
989
0
  proto_item_append_text(errno_item, " (%s)", val_to_str_ext_const(op_errno, &glusterfs_error_codes_ext, "Unknown"));
990
0
  offset += 4;
991
992
0
  return offset;
993
0
}
994
995
static int
996
gluster_local_dissect_common_reply(tvbuff_t *tvb,
997
        packet_info *pinfo, proto_tree *tree, void* data)
998
0
{
999
0
  return gluster_dissect_common_reply(tvb, 0, pinfo, tree, data);
1000
0
}
1001
1002
static int
1003
_glusterfs_gfs3_common_readdir_reply(tvbuff_t *tvb, proto_tree *tree, int offset)
1004
0
{
1005
0
  proto_item *errno_item;
1006
0
  unsigned op_errno;
1007
1008
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_entries, offset);
1009
1010
0
  op_errno = tvb_get_ntohl(tvb, offset);
1011
0
  errno_item = proto_tree_add_int(tree, hf_gluster_op_errno, tvb,
1012
0
      offset, 4, op_errno);
1013
0
  if (op_errno == 0)
1014
0
    proto_item_append_text(errno_item, " (More replies follow)");
1015
0
  else if (op_errno == 2 /* GF_ERROR_CODE_NOENT */)
1016
0
    proto_item_append_text(errno_item, " (Last reply)");
1017
0
  offset += 4;
1018
1019
0
  return offset;
1020
0
}
1021
1022
static int
1023
glusterfs_gfs3_op_unlink_reply(tvbuff_t *tvb,
1024
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1025
0
{
1026
0
  int offset = 0;
1027
1028
0
  offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb,
1029
0
          hf_glusterfs_preparent_iatt, offset);
1030
0
  offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb,
1031
0
          hf_glusterfs_postparent_iatt, offset);
1032
1033
0
  return offset;
1034
0
}
1035
1036
static int
1037
glusterfs_gfs3_op_unlink_call(tvbuff_t *tvb,
1038
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1039
0
{
1040
0
  int offset = 0;
1041
1042
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_pargfid, offset);
1043
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_path, offset, NULL);
1044
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_bname, offset, NULL);
1045
0
  return offset;
1046
0
}
1047
1048
static int
1049
glusterfs_gfs3_op_statfs_reply(tvbuff_t *tvb, packet_info *pinfo,
1050
              proto_tree *tree, void* data)
1051
0
{
1052
0
  int offset = 0;
1053
1054
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
1055
0
  offset = glusterfs_rpc_dissect_statfs(tree, tvb, offset);
1056
0
  return offset;
1057
0
}
1058
1059
static int
1060
glusterfs_gfs3_op_statfs_call(tvbuff_t *tvb,
1061
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1062
0
{
1063
0
  int offset = 0;
1064
1065
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1066
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_path, offset, NULL);
1067
1068
0
  return offset;
1069
0
}
1070
1071
static int
1072
glusterfs_gfs3_op_flush_call(tvbuff_t *tvb,
1073
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1074
0
{
1075
0
  int offset = 0;
1076
1077
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1078
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
1079
0
  return offset;
1080
0
}
1081
1082
static int
1083
glusterfs_gfs3_op_setxattr_call(tvbuff_t *tvb,
1084
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1085
0
{
1086
0
  int offset = 0;
1087
1088
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1089
0
  offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
1090
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1091
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_path, offset, NULL);
1092
1093
0
  return offset;
1094
0
}
1095
1096
static int
1097
glusterfs_gfs3_op_opendir_reply(tvbuff_t *tvb, packet_info *pinfo,
1098
              proto_tree *tree, void* data)
1099
0
{
1100
0
  int offset = 0;
1101
1102
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
1103
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
1104
0
  return offset;
1105
0
}
1106
1107
static int
1108
glusterfs_gfs3_op_opendir_call(tvbuff_t *tvb,
1109
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1110
0
{
1111
0
  int offset = 0;
1112
1113
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1114
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_path, offset, NULL);
1115
1116
0
  return offset;
1117
0
}
1118
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)
1123
0
{
1124
0
  int offset = 0;
1125
1126
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
1127
0
  offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb, hf_glusterfs_iatt,
1128
0
                offset);
1129
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
1130
0
  offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb,
1131
0
          hf_glusterfs_preparent_iatt, offset);
1132
0
  offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb,
1133
0
          hf_glusterfs_postparent_iatt, offset);
1134
1135
0
  return offset;
1136
0
}
1137
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_)
1142
0
{
1143
0
  int offset = 0;
1144
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_pargfid, offset);
1145
0
  offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
1146
0
  offset = glusterfs_rpc_dissect_mode(tree, tvb, hf_glusterfs_mode, offset);
1147
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_path, offset, NULL);
1148
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_bname, offset, NULL);
1149
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1150
1151
0
  return offset;
1152
0
}
1153
1154
static int
1155
glusterfs_gfs3_op_lookup_reply(tvbuff_t *tvb, packet_info *pinfo,
1156
              proto_tree *tree, void* data)
1157
0
{
1158
0
  int offset = 0;
1159
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
1160
0
  offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb, hf_glusterfs_iatt,
1161
0
                offset);
1162
0
  offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb,
1163
0
          hf_glusterfs_postparent_iatt, offset);
1164
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1165
1166
0
  return offset;
1167
0
}
1168
1169
static int
1170
glusterfs_gfs3_op_lookup_call(tvbuff_t *tvb,
1171
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1172
0
{
1173
0
  int offset = 0;
1174
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1175
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_pargfid, offset);
1176
0
  offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
1177
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_path, offset, NULL);
1178
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_bname, offset, NULL);
1179
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1180
1181
0
  return offset;
1182
0
}
1183
1184
static int
1185
glusterfs_gfs3_op_inodelk_call(tvbuff_t *tvb,
1186
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1187
0
{
1188
0
  proto_item *flock_item;
1189
0
  proto_tree *flock_tree;
1190
0
  int start_offset;
1191
0
  int offset = 0;
1192
1193
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1194
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_cmd, offset);
1195
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_type, offset);
1196
1197
0
  start_offset = offset;
1198
0
  flock_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_glusterfs_flock, &flock_item, "Flock");
1199
0
  offset = glusterfs_rpc_dissect_gf_flock(flock_tree, tvb, offset);
1200
0
  proto_item_set_len (flock_item, offset - start_offset);
1201
1202
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_path, offset, NULL);
1203
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_volume, offset, NULL);
1204
0
  return offset;
1205
0
}
1206
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)
1210
0
{
1211
0
  proto_item *entry_item;
1212
0
  proto_tree *entry_tree;
1213
0
  const char* path = NULL;
1214
0
  int start_offset = offset;
1215
1216
0
  entry_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_glusterfs_entry, &entry_item, "Entry");
1217
1218
0
  offset = dissect_rpc_uint64(tvb, entry_tree, hf_glusterfs_entry_ino, offset);
1219
0
  offset = dissect_rpc_uint64(tvb, entry_tree, hf_glusterfs_entry_off, offset);
1220
0
  offset = dissect_rpc_uint32(tvb, entry_tree, hf_glusterfs_entry_len, offset);
1221
0
  offset = dissect_rpc_uint32(tvb, entry_tree, hf_glusterfs_entry_type, offset);
1222
0
  offset = dissect_rpc_string(tvb, entry_tree, hf_glusterfs_entry_path, offset, &path);
1223
1224
0
  proto_item_append_text(entry_item, " Path: %s", path);
1225
1226
0
  if (iatt) {
1227
0
    if (proto_4_0)
1228
0
      offset = glusterfs_rpc_dissect_gfx_iatt(entry_tree, tvb,
1229
0
                hf_glusterfs_iattx, offset);
1230
0
    else
1231
0
      offset = glusterfs_rpc_dissect_gf_iatt(entry_tree, tvb,
1232
0
                hf_glusterfs_iatt, offset);
1233
0
  }
1234
0
  if (dict) {
1235
0
    if (proto_4_0)
1236
0
      offset = gluster_rpc4_0_dissect_dict(entry_tree, tvb, hf_glusterfs_dict, offset);
1237
0
    else
1238
0
      offset = gluster_rpc_dissect_dict(entry_tree, tvb, hf_glusterfs_dict, offset);
1239
0
  }
1240
1241
0
  proto_item_set_len (entry_item, offset - start_offset);
1242
1243
0
  return offset;
1244
0
}
1245
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_)
1249
0
{
1250
0
  return _glusterfs_gfs_op_readdir_entry(tvb, offset, tree, true, false, false);
1251
0
}
1252
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_)
1256
0
{
1257
0
  return _glusterfs_gfs_op_readdir_entry(tvb, offset, tree, false, false, false);
1258
0
}
1259
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_)
1263
0
{
1264
0
  return _glusterfs_gfs_op_readdir_entry(tvb, offset, tree, true, false, true);
1265
0
}
1266
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_)
1270
0
{
1271
0
  return _glusterfs_gfs_op_readdir_entry(tvb, offset, tree, false, true, false);
1272
0
}
1273
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_)
1277
0
{
1278
0
  return _glusterfs_gfs_op_readdir_entry(tvb, offset, tree, true, true, true);
1279
0
}
1280
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_)
1285
0
{
1286
0
  int offset = 0;
1287
0
  offset = _glusterfs_gfs3_common_readdir_reply(tvb, tree, offset);
1288
0
  offset = dissect_rpc_list(tvb, pinfo, tree, offset,
1289
0
          glusterfs_gfs3_op_readdirp_entry, NULL);
1290
1291
0
  return offset;
1292
0
}
1293
1294
static int
1295
glusterfs_gfs3_op_readdirp_call(tvbuff_t *tvb,
1296
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1297
0
{
1298
0
  int offset = 0;
1299
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1300
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
1301
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
1302
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_size, offset);
1303
1304
0
  return offset;
1305
0
}
1306
1307
static int
1308
glusterfs_gfs3_op_setattr_reply(tvbuff_t *tvb, packet_info *pinfo,
1309
              proto_tree *tree, void* data)
1310
0
{
1311
0
  int offset = 0;
1312
1313
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
1314
0
  offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb,
1315
0
          hf_glusterfs_preop_iatt, offset);
1316
0
  offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb,
1317
0
          hf_glusterfs_postop_iatt, offset);
1318
1319
0
  return offset;
1320
0
}
1321
1322
static int
1323
glusterfs_rpc_dissect_setattr(proto_tree *tree, tvbuff_t *tvb, int offset)
1324
0
{
1325
0
  static int * const flag_bits[] = {
1326
0
    &hf_glusterfs_setattr_set_mode,
1327
0
    &hf_glusterfs_setattr_set_uid,
1328
0
    &hf_glusterfs_setattr_set_gid,
1329
0
    &hf_glusterfs_setattr_set_size,
1330
0
    &hf_glusterfs_setattr_set_atime,
1331
0
    &hf_glusterfs_setattr_set_mtime,
1332
0
    &hf_glusterfs_setattr_set_reserved,
1333
0
    NULL
1334
0
  };
1335
1336
0
  proto_tree_add_bitmask(tree, tvb, offset, hf_glusterfs_setattr_valid,
1337
0
      ett_glusterfs_setattr_valid, flag_bits, ENC_NA);
1338
0
  offset += 4;
1339
1340
0
  return offset;
1341
0
}
1342
1343
static int
1344
glusterfs_gfs3_op_setattr_call(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1345
0
{
1346
0
  int offset = 0;
1347
1348
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid,
1349
0
                offset);
1350
0
  offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb, hf_glusterfs_iatt,
1351
0
                offset);
1352
0
  offset = glusterfs_rpc_dissect_setattr(tree, tvb, offset);
1353
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_path, offset, NULL);
1354
1355
0
  return offset;
1356
0
}
1357
1358
/*GlusterFS 3_3 fops */
1359
1360
static int
1361
glusterfs_gfs3_3_op_stat_call(tvbuff_t *tvb,
1362
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1363
0
{
1364
0
  int offset = 0;
1365
1366
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1367
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1368
0
  return offset;
1369
1370
0
}
1371
1372
static int
1373
glusterfs_gfs3_3_op_stat_reply(tvbuff_t *tvb, packet_info *pinfo,
1374
               proto_tree *tree, void* data)
1375
0
{
1376
0
  int offset = 0;
1377
1378
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
1379
0
  offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb, hf_glusterfs_iatt,
1380
0
                offset);
1381
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict,
1382
0
                offset);
1383
1384
0
  return offset;
1385
0
}
1386
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)
1391
0
{
1392
0
  int offset = 0;
1393
1394
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
1395
0
  offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb, hf_glusterfs_iatt,
1396
0
                offset);
1397
0
  offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb,
1398
0
          hf_glusterfs_preparent_iatt, offset);
1399
0
  offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb,
1400
0
          hf_glusterfs_postparent_iatt, offset);
1401
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict,
1402
0
                offset);
1403
1404
0
  return offset;
1405
0
}
1406
1407
static int
1408
glusterfs_gfs3_3_op_mknod_call(tvbuff_t *tvb,
1409
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1410
0
{
1411
0
  int offset = 0;
1412
1413
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_pargfid, offset);
1414
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
1415
0
  offset = glusterfs_rpc_dissect_mode(tree, tvb, hf_glusterfs_mode, offset);
1416
0
  offset = glusterfs_rpc_dissect_mode(tree, tvb, hf_glusterfs_umask, offset);
1417
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_bname, offset, NULL);
1418
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1419
1420
0
  return offset;
1421
0
}
1422
1423
static int
1424
glusterfs_gfs3_3_op_mkdir_call(tvbuff_t *tvb,
1425
        packet_info *pinfo, proto_tree *tree, void* data _U_)
1426
0
{
1427
0
  int offset = 0;
1428
0
  const char *name = NULL;
1429
1430
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_pargfid, offset);
1431
0
  offset = glusterfs_rpc_dissect_mode(tree, tvb, hf_glusterfs_mode, offset);
1432
0
  offset = glusterfs_rpc_dissect_mode(tree, tvb, hf_glusterfs_umask, offset);
1433
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_bname, offset, &name);
1434
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1435
0
  col_append_fstr(pinfo->cinfo, COL_INFO, ", Filename: %s", name);
1436
1437
0
  return offset;
1438
0
}
1439
1440
static int
1441
glusterfs_gfs3_3_op_readlink_reply(tvbuff_t *tvb,
1442
          packet_info *pinfo, proto_tree *tree, void* data)
1443
0
{
1444
0
  int offset = 0;
1445
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
1446
0
  offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb, hf_glusterfs_iatt,
1447
0
                offset);
1448
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_path, offset,
1449
0
                  NULL);
1450
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict,
1451
0
                offset);
1452
0
  return offset;
1453
0
}
1454
1455
static int
1456
glusterfs_gfs3_3_op_readlink_call(tvbuff_t *tvb,
1457
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1458
0
{
1459
0
  int offset = 0;
1460
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1461
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_size, offset);
1462
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1463
1464
0
  return offset;
1465
0
}
1466
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)
1471
0
{
1472
0
  int offset = 0;
1473
1474
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
1475
0
  offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb,
1476
0
          hf_glusterfs_preparent_iatt, offset);
1477
0
  offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb,
1478
0
          hf_glusterfs_postparent_iatt, offset);
1479
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1480
1481
0
  return offset;
1482
0
}
1483
1484
static int
1485
glusterfs_gfs3_3_op_unlink_call(tvbuff_t *tvb,
1486
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1487
0
{
1488
0
  unsigned xflags;
1489
0
  int offset = 0;
1490
1491
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_pargfid, offset);
1492
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_bname, offset, NULL);
1493
0
  xflags = tvb_get_ntohl(tvb, offset);
1494
0
  proto_tree_add_uint_format(tree, hf_glusterfs_xflags, tvb, offset, 4, xflags, "Flags: 0%02o", xflags);
1495
0
  offset += 4;
1496
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1497
1498
0
  return offset;
1499
0
}
1500
1501
static int
1502
glusterfs_gfs3_3_op_rmdir_call(tvbuff_t *tvb,
1503
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1504
0
{
1505
0
  unsigned xflags;
1506
0
  int offset = 0;
1507
1508
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_pargfid, offset);
1509
0
  xflags = tvb_get_ntohl(tvb, offset);
1510
0
  proto_tree_add_uint_format(tree, hf_glusterfs_xflags, tvb, offset, 4, xflags, "Flags: 0%02o", xflags);
1511
0
  offset += 4;
1512
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_bname, offset, NULL);
1513
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1514
1515
0
  return offset;
1516
0
}
1517
1518
static int
1519
glusterfs_gfs3_3_op_symlink_call(tvbuff_t *tvb,
1520
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1521
0
{
1522
0
  int offset = 0;
1523
1524
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_pargfid, offset);
1525
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_bname, offset, NULL);
1526
0
  offset = glusterfs_rpc_dissect_mode(tree, tvb, hf_glusterfs_umask, offset);
1527
1528
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_linkname, offset, NULL);
1529
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1530
1531
0
  return offset;
1532
0
}
1533
1534
static int
1535
glusterfs_gfs3_3_op_rename_call(tvbuff_t *tvb,
1536
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1537
0
{
1538
0
  int offset = 0;
1539
1540
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_oldgfid, offset);
1541
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_newgfid, offset);
1542
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_oldbname, offset, NULL);
1543
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_newbname, offset, NULL);
1544
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1545
1546
0
  return offset;
1547
0
}
1548
1549
static int
1550
glusterfs_gfs3_3_op_rename_reply(tvbuff_t *tvb, packet_info *pinfo,
1551
              proto_tree *tree, void* data)
1552
0
{
1553
0
  proto_tree *old_tree, *new_tree;
1554
0
  proto_item *old_item, *new_item;
1555
0
  int start_offset;
1556
0
  int offset = 0;
1557
1558
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
1559
0
  offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb, hf_glusterfs_iatt,
1560
0
                offset);
1561
1562
0
  start_offset = offset;
1563
0
  old_tree = proto_tree_add_subtree(tree, tvb, offset, -1,
1564
0
        ett_glusterfs_parent_iatt, &old_item, "Old parent");
1565
0
  offset = glusterfs_rpc_dissect_gf_iatt(old_tree, tvb,
1566
0
          hf_glusterfs_preparent_iatt, offset);
1567
0
  offset = glusterfs_rpc_dissect_gf_iatt(old_tree, tvb,
1568
0
          hf_glusterfs_postparent_iatt, offset);
1569
0
  proto_item_set_len (old_item, offset - start_offset);
1570
1571
0
  start_offset = offset;
1572
0
  new_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_glusterfs_parent_iatt, &new_item, "New parent");
1573
0
  offset = glusterfs_rpc_dissect_gf_iatt(new_tree, tvb,
1574
0
          hf_glusterfs_preparent_iatt, offset);
1575
0
  offset = glusterfs_rpc_dissect_gf_iatt(new_tree, tvb,
1576
0
          hf_glusterfs_postparent_iatt, offset);
1577
0
  proto_item_set_len (new_item, offset - start_offset);
1578
1579
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1580
1581
0
  return offset;
1582
0
}
1583
1584
static int
1585
glusterfs_gfs3_3_op_link_call(tvbuff_t *tvb,
1586
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1587
0
{
1588
0
  int offset = 0;
1589
1590
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_oldgfid, offset);
1591
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_newgfid, offset);
1592
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_newbname, offset, NULL);
1593
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1594
1595
0
  return offset;
1596
0
}
1597
1598
static int
1599
glusterfs_gfs3_3_op_truncate_call(tvbuff_t *tvb,
1600
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1601
0
{
1602
0
  int offset = 0;
1603
1604
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1605
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
1606
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1607
1608
0
  return offset;
1609
0
}
1610
1611
static int
1612
glusterfs_gfs3_3_op_open_reply(tvbuff_t *tvb, packet_info *pinfo,
1613
              proto_tree *tree, void* data)
1614
0
{
1615
0
  int offset = 0;
1616
1617
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
1618
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
1619
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1620
0
  return offset;
1621
0
}
1622
1623
static int
1624
glusterfs_gfs3_3_op_open_call(tvbuff_t *tvb,
1625
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1626
0
{
1627
0
  int offset = 0;
1628
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1629
0
  offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
1630
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1631
1632
0
  return offset;
1633
0
}
1634
1635
static int
1636
glusterfs_gfs3_3_op_read_reply(tvbuff_t *tvb, packet_info *pinfo,
1637
              proto_tree *tree, void* data)
1638
0
{
1639
0
  int offset = 0;
1640
1641
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
1642
0
  offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb, hf_glusterfs_iatt,
1643
0
                offset);
1644
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_size, offset);
1645
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict,
1646
0
                offset);
1647
1648
0
  return offset;
1649
0
}
1650
1651
static int
1652
glusterfs_gfs3_3_op_read_call(tvbuff_t *tvb,
1653
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1654
0
{
1655
0
  int offset = 0;
1656
1657
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1658
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
1659
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
1660
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_size, offset);
1661
0
  offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
1662
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1663
1664
0
  return offset;
1665
0
}
1666
1667
static int
1668
glusterfs_gfs3_3_op_write_call(tvbuff_t *tvb,
1669
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1670
0
{
1671
0
  int offset = 0;
1672
1673
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1674
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
1675
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
1676
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_size, offset);
1677
0
  offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
1678
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1679
1680
0
  return offset;
1681
0
}
1682
1683
static int
1684
glusterfs_gfs3_3_op_statfs_reply(tvbuff_t *tvb, packet_info *pinfo,
1685
              proto_tree *tree, void* data)
1686
0
{
1687
0
  int offset = 0;
1688
1689
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
1690
0
  offset = glusterfs_rpc_dissect_statfs(tree, tvb, offset);
1691
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1692
1693
0
  return offset;
1694
0
}
1695
1696
static int
1697
glusterfs_gfs3_3_op_statfs_call(tvbuff_t *tvb,
1698
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1699
0
{
1700
0
  int offset = 0;
1701
1702
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1703
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1704
1705
0
  return offset;
1706
0
}
1707
1708
static int
1709
glusterfs_gfs3_3_op_flush_call(tvbuff_t *tvb,
1710
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1711
0
{
1712
0
  int offset = 0;
1713
1714
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1715
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
1716
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1717
1718
0
  return offset;
1719
0
}
1720
1721
static int
1722
glusterfs_gfs3_3_op_setxattr_call(tvbuff_t *tvb,
1723
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1724
0
{
1725
0
  int offset = 0;
1726
1727
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1728
0
  offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
1729
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1730
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1731
1732
0
  return offset;
1733
0
}
1734
1735
static int
1736
glusterfs_gfs3_3_op_getxattr_call(tvbuff_t *tvb,
1737
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1738
0
{
1739
0
  int offset = 0;
1740
1741
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1742
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_namelen, offset);
1743
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_name, offset, NULL);
1744
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1745
1746
0
  return offset;
1747
0
}
1748
1749
1750
static int
1751
glusterfs_gfs3_3_op_getxattr_reply(tvbuff_t *tvb,
1752
          packet_info *pinfo, proto_tree *tree, void* data)
1753
0
{
1754
0
  int offset = 0;
1755
1756
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
1757
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1758
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1759
1760
0
  return offset;
1761
0
}
1762
1763
static int
1764
glusterfs_gfs3_3_op_removexattr_call(tvbuff_t *tvb,
1765
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1766
0
{
1767
0
  int offset = 0;
1768
1769
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1770
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_name, offset, NULL);
1771
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1772
1773
0
  return offset;
1774
0
}
1775
1776
static int
1777
glusterfs_gfs3_3_op_fsync_call(tvbuff_t *tvb,
1778
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1779
0
{
1780
0
  static int * const flag_bits[] = {
1781
0
    &hf_glusterfs_fsync_flag_datasync,
1782
0
    &hf_glusterfs_fsync_flag_unknown,
1783
0
    NULL
1784
0
  };
1785
0
  int offset = 0;
1786
1787
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1788
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
1789
1790
0
  proto_tree_add_bitmask(tree, tvb, offset,
1791
0
      hf_glusterfs_fsync_flags,
1792
0
      ett_glusterfs_fsync_flags, flag_bits, ENC_NA);
1793
0
  offset += 4;
1794
1795
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1796
1797
0
  return offset;
1798
0
}
1799
1800
static int
1801
glusterfs_gfs3_3_op_opendir_reply(tvbuff_t *tvb,
1802
        packet_info *pinfo, proto_tree *tree, void* data)
1803
0
{
1804
0
  int offset = 0;
1805
1806
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
1807
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
1808
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1809
1810
0
  return offset;
1811
0
}
1812
1813
static int
1814
glusterfs_gfs3_3_op_opendir_call(tvbuff_t *tvb,
1815
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1816
0
{
1817
0
  int offset = 0;
1818
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1819
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1820
1821
0
  return offset;
1822
0
}
1823
1824
static int
1825
glusterfs_gfs3_3_op_create_reply(tvbuff_t *tvb, packet_info *pinfo,
1826
              proto_tree *tree, void* data)
1827
0
{
1828
0
  int offset = 0;
1829
1830
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
1831
0
  offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb, hf_glusterfs_iatt,
1832
0
                offset);
1833
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
1834
0
  offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb,
1835
0
          hf_glusterfs_preparent_iatt, offset);
1836
0
  offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb,
1837
0
          hf_glusterfs_postparent_iatt, offset);
1838
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1839
1840
0
  return offset;
1841
0
}
1842
1843
1844
static int
1845
glusterfs_gfs3_3_op_create_call(tvbuff_t *tvb,
1846
        packet_info *pinfo, proto_tree *tree, void* data _U_)
1847
0
{
1848
0
  const char *name = NULL;
1849
0
  int offset = 0;
1850
1851
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_pargfid, offset);
1852
0
  offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
1853
0
  offset = glusterfs_rpc_dissect_mode(tree, tvb, hf_glusterfs_mode, offset);
1854
0
  offset = glusterfs_rpc_dissect_mode(tree, tvb, hf_glusterfs_umask, offset);
1855
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_bname, offset, &name);
1856
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1857
0
  col_append_fstr(pinfo->cinfo, COL_INFO, ", Filename: %s", name);
1858
1859
0
  return offset;
1860
0
}
1861
1862
static int
1863
glusterfs_gfs3_3_op_ftruncate_call(tvbuff_t *tvb,
1864
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1865
0
{
1866
0
  int offset = 0;
1867
1868
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1869
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
1870
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
1871
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1872
1873
0
  return offset;
1874
0
}
1875
1876
static int
1877
glusterfs_gfs3_3_op_fstat_call(tvbuff_t *tvb,
1878
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1879
0
{
1880
0
  int offset = 0;
1881
1882
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1883
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
1884
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1885
1886
0
  return offset;
1887
0
}
1888
1889
static int
1890
glusterfs_gfs3_3_op_fstat_reply(tvbuff_t *tvb, packet_info *pinfo,
1891
              proto_tree *tree, void* data)
1892
0
{
1893
0
  int offset = 0;
1894
1895
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
1896
0
  offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb, hf_glusterfs_iatt,
1897
0
                offset);
1898
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict,
1899
0
                offset);
1900
1901
0
  return offset;
1902
0
}
1903
1904
static int
1905
glusterfs_gfs3_3_op_lk_call(tvbuff_t *tvb,
1906
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1907
0
{
1908
0
  int offset = 0;
1909
1910
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1911
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
1912
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_cmd, offset);
1913
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_type, offset);
1914
0
  offset = glusterfs_rpc_dissect_gf_2_flock(tree, tvb, offset);
1915
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1916
1917
0
  return offset;
1918
0
}
1919
1920
static int
1921
glusterfs_gfs3_3_op_lk_reply(tvbuff_t *tvb,
1922
        packet_info *pinfo, proto_tree *tree, void* data)
1923
0
{
1924
0
  int offset = 0;
1925
1926
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
1927
0
  offset = glusterfs_rpc_dissect_gf_2_flock(tree, tvb, offset);
1928
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1929
1930
0
  return offset;
1931
0
}
1932
1933
static int
1934
glusterfs_gfs3_3_op_access_call(tvbuff_t *tvb,
1935
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1936
0
{
1937
0
  int offset = 0;
1938
1939
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1940
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_mask, offset);
1941
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1942
0
  return offset;
1943
0
}
1944
1945
static int
1946
glusterfs_gfs3_3_op_lookup_call(tvbuff_t *tvb,
1947
        packet_info *pinfo, proto_tree *tree, void* data _U_)
1948
0
{
1949
0
  const char *name = NULL;
1950
0
  int length;
1951
0
  int offset = 0;
1952
1953
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1954
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_pargfid, offset);
1955
0
  offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
1956
0
  length = tvb_get_letohl(tvb, offset);
1957
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_bname, offset, &name);
1958
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1959
0
  if(length == 0)
1960
0
    col_append_str(pinfo->cinfo, COL_INFO, ", Filename: (nameless, by GFID)");
1961
0
  else
1962
0
    col_append_fstr(pinfo->cinfo, COL_INFO, ", Filename: %s", name);
1963
1964
0
  return offset;
1965
0
}
1966
1967
static int
1968
glusterfs_gfs3_3_op_readdir_reply(tvbuff_t *tvb,
1969
        packet_info *pinfo, proto_tree *tree, void* data _U_)
1970
0
{
1971
0
  int offset = 0;
1972
1973
0
  offset = _glusterfs_gfs3_common_readdir_reply(tvb, tree, offset);
1974
0
  offset = dissect_rpc_list(tvb, pinfo, tree, offset,
1975
0
          glusterfs_gfs3_3_op_readdir_entry, NULL);
1976
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1977
1978
0
  return offset;
1979
0
}
1980
1981
static int
1982
glusterfs_gfs3_3_op_readdir_call(tvbuff_t *tvb,
1983
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1984
0
{
1985
0
  int offset = 0;
1986
1987
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
1988
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
1989
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
1990
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_size, offset);
1991
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
1992
1993
0
  return offset;
1994
0
}
1995
1996
static int
1997
glusterfs_gfs3_3_op_inodelk_call(tvbuff_t *tvb,
1998
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1999
0
{
2000
0
  int offset = 0;
2001
2002
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2003
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_cmd, offset);
2004
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_type, offset);
2005
0
  offset = glusterfs_rpc_dissect_gf_2_flock(tree, tvb, offset);
2006
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_volume, offset, NULL);
2007
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2008
2009
0
  return offset;
2010
0
}
2011
2012
static int
2013
glusterfs_gfs3_3_op_finodelk_call(tvbuff_t *tvb,
2014
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2015
0
{
2016
0
  int offset = 0;
2017
2018
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2019
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2020
2021
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_cmd, offset);
2022
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_type, offset);
2023
0
  offset = glusterfs_rpc_dissect_gf_2_flock(tree, tvb, offset);
2024
2025
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_volume, offset, NULL);
2026
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2027
2028
0
  return offset;
2029
0
}
2030
2031
static int
2032
glusterfs_gfs3_3_op_entrylk_call(tvbuff_t *tvb,
2033
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2034
0
{
2035
0
  int offset = 0;
2036
2037
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2038
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_cmd, offset);
2039
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_type, offset);
2040
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_entrylk_namelen, offset);
2041
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_name, offset, NULL);
2042
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_volume, offset, NULL);
2043
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2044
2045
0
  return offset;
2046
0
}
2047
2048
static int
2049
glusterfs_gfs3_3_op_fentrylk_call(tvbuff_t *tvb,
2050
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2051
0
{
2052
0
  int offset = 0;
2053
2054
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2055
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2056
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_cmd, offset);
2057
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_type, offset);
2058
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_entrylk_namelen, offset);
2059
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_name, offset, NULL);
2060
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_volume, offset, NULL);
2061
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2062
2063
0
  return offset;
2064
0
}
2065
2066
static int
2067
glusterfs_gfs3_3_op_xattrop_reply(tvbuff_t *tvb,
2068
        packet_info *pinfo, proto_tree *tree, void* data)
2069
0
{
2070
0
  int offset = 0;
2071
2072
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
2073
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2074
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2075
2076
0
  return offset;
2077
0
}
2078
2079
static int
2080
glusterfs_gfs3_3_op_xattrop_call(tvbuff_t *tvb,
2081
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2082
0
{
2083
0
  int offset = 0;
2084
2085
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2086
0
  offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
2087
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2088
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2089
2090
0
  return offset;
2091
0
}
2092
2093
static int
2094
glusterfs_gfs3_3_op_fxattrop_call(tvbuff_t *tvb,
2095
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2096
0
{
2097
0
  int offset = 0;
2098
2099
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2100
0
  offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
2101
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2102
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2103
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2104
2105
0
  return offset;
2106
0
}
2107
2108
static int
2109
glusterfs_gfs3_3_op_fgetxattr_call(tvbuff_t *tvb,
2110
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2111
0
{
2112
0
  int offset = 0;
2113
2114
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2115
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2116
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_namelen, offset);
2117
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_name, offset, NULL);
2118
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2119
2120
0
  return offset;
2121
0
}
2122
2123
static int
2124
gluter_gfs3_3_op_fsetxattr_call(tvbuff_t *tvb,
2125
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2126
0
{
2127
0
  int offset = 0;
2128
2129
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2130
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2131
0
  offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
2132
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2133
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2134
2135
0
  return offset;
2136
0
}
2137
2138
static int
2139
glusterfs_gfs3_3_op_setattr_reply(tvbuff_t *tvb, packet_info *pinfo,
2140
              proto_tree *tree, void* data)
2141
0
{
2142
0
  int offset = 0;
2143
2144
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
2145
0
  offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb,
2146
0
          hf_glusterfs_preop_iatt, offset);
2147
0
  offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb,
2148
0
          hf_glusterfs_postop_iatt, offset);
2149
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2150
2151
0
  return offset;
2152
0
}
2153
2154
static int
2155
glusterfs_gfs3_3_op_setattr_call(tvbuff_t *tvb,
2156
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2157
0
{
2158
0
  int offset = 0;
2159
2160
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid,
2161
0
                offset);
2162
0
  offset = glusterfs_rpc_dissect_gf_iatt(tree, tvb, hf_glusterfs_iatt,
2163
0
                offset);
2164
0
  offset = glusterfs_rpc_dissect_setattr(tree, tvb, offset);
2165
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2166
2167
0
  return offset;
2168
0
}
2169
2170
static int
2171
glusterfs_gfs3_3_op_readdirp_reply(tvbuff_t *tvb,
2172
        packet_info *pinfo, proto_tree *tree, void* data _U_)
2173
0
{
2174
0
  int offset = 0;
2175
2176
0
  offset = _glusterfs_gfs3_common_readdir_reply(tvb, tree, offset);
2177
0
  offset = dissect_rpc_list(tvb, pinfo, tree, offset,
2178
0
          glusterfs_gfs3_3_op_readdirp_entry, NULL);
2179
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2180
2181
0
  return offset;
2182
0
}
2183
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_)
2188
0
{
2189
0
  int offset = 0;
2190
2191
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2192
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2193
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
2194
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_size, offset);
2195
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2196
2197
0
  return offset;
2198
0
}
2199
2200
static int
2201
glusterfs_gfs3_3_op_release_call(tvbuff_t *tvb,
2202
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2203
0
{
2204
0
  int offset = 0;
2205
2206
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2207
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2208
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2209
2210
0
  return offset;
2211
0
}
2212
2213
static int
2214
glusterfs_gfs3_3_op_releasedir_call(tvbuff_t *tvb,
2215
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2216
0
{
2217
0
  int offset = 0;
2218
2219
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2220
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2221
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2222
2223
0
  return offset;
2224
0
}
2225
2226
static int
2227
glusterfs_gfs3_3_op_fremovexattr_call(tvbuff_t *tvb,
2228
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2229
0
{
2230
0
  int offset = 0;
2231
2232
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2233
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2234
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_name, offset, NULL);
2235
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2236
2237
0
  return offset;
2238
0
}
2239
2240
static int
2241
glusterfs_gfs3_3_op_fallocate_call(tvbuff_t *tvb,
2242
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2243
0
{
2244
0
  int offset = 0;
2245
2246
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2247
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2248
0
  offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
2249
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
2250
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_size, offset);
2251
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2252
2253
0
  return offset;
2254
0
}
2255
2256
static int
2257
glusterfs_gfs3_3_op_zerofill_call(tvbuff_t *tvb,
2258
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2259
0
{
2260
0
  int offset = 0;
2261
2262
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2263
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2264
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
2265
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_size64, offset);
2266
2267
0
  return offset;
2268
0
}
2269
2270
static int
2271
glusterfs_gfs3_3_op_seek_reply(tvbuff_t *tvb, packet_info *pinfo,
2272
             proto_tree *tree, void* data)
2273
0
{
2274
0
  int offset = 0;
2275
2276
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
2277
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
2278
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2279
2280
0
  return offset;
2281
0
}
2282
2283
static int
2284
glusterfs_gfs3_3_op_seek_call(tvbuff_t *tvb, packet_info *pinfo _U_,
2285
            proto_tree *tree, void* data _U_)
2286
0
{
2287
0
  int offset = 0;
2288
2289
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2290
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2291
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
2292
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_whence, offset);
2293
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2294
2295
0
  return offset;
2296
0
}
2297
2298
/* This function is for common replay. RELEASE , RELEASEDIR and some other function use this method */
2299
2300
int
2301
glusterfs_gfs3_3_op_common_reply(tvbuff_t *tvb, packet_info *pinfo,
2302
              proto_tree *tree, void* data)
2303
0
{
2304
0
  int offset = 0;
2305
2306
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
2307
0
  offset = gluster_rpc_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2308
2309
0
  return offset;
2310
0
}
2311
2312
2313
/*GlusterFS 4_0 fops */
2314
2315
static int
2316
glusterfs_gfs4_0_op_stat_call(tvbuff_t *tvb,
2317
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2318
0
{
2319
0
  int offset = 0;
2320
2321
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2322
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2323
0
  return offset;
2324
2325
0
}
2326
2327
static int
2328
glusterfs_gfs4_0_op_common_iatt_reply(tvbuff_t *tvb, packet_info *pinfo,
2329
               proto_tree *tree, void* data)
2330
0
{
2331
0
  int offset = 0;
2332
2333
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
2334
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2335
0
  offset = glusterfs_rpc_dissect_gfx_iatt(tree, tvb, hf_glusterfs_iattx,
2336
0
                offset);
2337
0
  return offset;
2338
0
}
2339
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)
2344
0
{
2345
0
  int offset = 0;
2346
2347
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
2348
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict,
2349
0
                offset);
2350
0
  offset = glusterfs_rpc_dissect_gfx_iatt(tree, tvb, hf_glusterfs_iattx,
2351
0
                offset);
2352
0
  offset = glusterfs_rpc_dissect_gfx_iatt(tree, tvb,
2353
0
          hf_glusterfs_preparent_iattx, offset);
2354
0
  offset = glusterfs_rpc_dissect_gfx_iatt(tree, tvb,
2355
0
          hf_glusterfs_postparent_iattx, offset);
2356
2357
0
  return offset;
2358
0
}
2359
2360
static int
2361
glusterfs_gfs4_0_op_mknod_call(tvbuff_t *tvb,
2362
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2363
0
{
2364
0
  int offset = 0;
2365
2366
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_pargfid, offset);
2367
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
2368
0
  offset = glusterfs_rpc_dissect_mode(tree, tvb, hf_glusterfs_mode, offset);
2369
0
  offset = glusterfs_rpc_dissect_mode(tree, tvb, hf_glusterfs_umask, offset);
2370
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_bname, offset, NULL);
2371
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2372
2373
0
  return offset;
2374
0
}
2375
2376
static int
2377
glusterfs_gfs4_0_op_mkdir_call(tvbuff_t *tvb,
2378
        packet_info *pinfo, proto_tree *tree, void* data _U_)
2379
0
{
2380
0
  int offset = 0;
2381
0
  const char *name = NULL;
2382
2383
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_pargfid, offset);
2384
0
  offset = glusterfs_rpc_dissect_mode(tree, tvb, hf_glusterfs_mode, offset);
2385
0
  offset = glusterfs_rpc_dissect_mode(tree, tvb, hf_glusterfs_umask, offset);
2386
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_bname, offset, &name);
2387
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2388
0
  col_append_fstr(pinfo->cinfo, COL_INFO, ", Filename: %s", name);
2389
2390
0
  return offset;
2391
0
}
2392
2393
static int
2394
glusterfs_gfs4_0_op_readlink_reply(tvbuff_t *tvb,
2395
          packet_info *pinfo, proto_tree *tree, void* data)
2396
0
{
2397
0
  int offset = 0;
2398
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
2399
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict,
2400
0
                offset);
2401
0
  offset = glusterfs_rpc_dissect_gfx_iatt(tree, tvb, hf_glusterfs_iattx,
2402
0
                offset);
2403
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_path, offset,
2404
0
                  NULL);
2405
0
  return offset;
2406
0
}
2407
2408
static int
2409
glusterfs_gfs4_0_op_readlink_call(tvbuff_t *tvb,
2410
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2411
0
{
2412
0
  int offset = 0;
2413
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2414
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_size, offset);
2415
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2416
2417
0
  return offset;
2418
0
}
2419
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)
2424
0
{
2425
0
  int offset = 0;
2426
2427
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
2428
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2429
0
  offset = glusterfs_rpc_dissect_gfx_iatt(tree, tvb,
2430
0
          hf_glusterfs_preparent_iattx, offset);
2431
0
  offset = glusterfs_rpc_dissect_gfx_iatt(tree, tvb,
2432
0
          hf_glusterfs_postparent_iattx, offset);
2433
2434
0
  return offset;
2435
0
}
2436
2437
static int
2438
glusterfs_gfs4_0_op_unlink_call(tvbuff_t *tvb,
2439
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2440
0
{
2441
0
  unsigned xflags;
2442
0
  int offset = 0;
2443
2444
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_pargfid, offset);
2445
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_bname, offset, NULL);
2446
0
  xflags = tvb_get_ntohl(tvb, offset);
2447
0
  proto_tree_add_uint_format(tree, hf_glusterfs_xflags, tvb, offset, 4, xflags, "Flags: 0%02o", xflags);
2448
0
  offset += 4;
2449
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2450
2451
0
  return offset;
2452
0
}
2453
2454
static int
2455
glusterfs_gfs4_0_op_rmdir_call(tvbuff_t *tvb,
2456
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2457
0
{
2458
0
  unsigned xflags;
2459
0
  int offset = 0;
2460
2461
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_pargfid, offset);
2462
0
  xflags = tvb_get_ntohl(tvb, offset);
2463
0
  proto_tree_add_uint_format(tree, hf_glusterfs_xflags, tvb, offset, 4, xflags, "Flags: 0%02o", xflags);
2464
0
  offset += 4;
2465
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_bname, offset, NULL);
2466
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2467
2468
0
  return offset;
2469
0
}
2470
2471
static int
2472
glusterfs_gfs4_0_op_symlink_call(tvbuff_t *tvb,
2473
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2474
0
{
2475
0
  int offset = 0;
2476
2477
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_pargfid, offset);
2478
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_bname, offset, NULL);
2479
0
  offset = glusterfs_rpc_dissect_mode(tree, tvb, hf_glusterfs_umask, offset);
2480
2481
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_linkname, offset, NULL);
2482
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2483
2484
0
  return offset;
2485
0
}
2486
2487
static int
2488
glusterfs_gfs4_0_op_rename_call(tvbuff_t *tvb,
2489
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2490
0
{
2491
0
  int offset = 0;
2492
2493
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_oldgfid, offset);
2494
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_newgfid, offset);
2495
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_oldbname, offset, NULL);
2496
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_newbname, offset, NULL);
2497
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2498
2499
0
  return offset;
2500
0
}
2501
2502
static int
2503
glusterfs_gfs4_0_op_rename_reply(tvbuff_t *tvb, packet_info *pinfo,
2504
              proto_tree *tree, void* data)
2505
0
{
2506
0
  proto_tree *old_tree, *new_tree;
2507
0
  proto_item *old_item, *new_item;
2508
0
  int start_offset;
2509
0
  int offset = 0;
2510
2511
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
2512
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2513
0
  offset = glusterfs_rpc_dissect_gfx_iatt(tree, tvb, hf_glusterfs_iattx,
2514
0
                offset);
2515
2516
0
  start_offset = offset;
2517
0
  old_tree = proto_tree_add_subtree(tree, tvb, offset, -1,
2518
0
        ett_glusterfs_parent_iatt, &old_item, "Old parent");
2519
0
  offset = glusterfs_rpc_dissect_gfx_iatt(old_tree, tvb,
2520
0
          hf_glusterfs_preparent_iattx, offset);
2521
0
  offset = glusterfs_rpc_dissect_gfx_iatt(old_tree, tvb,
2522
0
          hf_glusterfs_postparent_iattx, offset);
2523
0
  proto_item_set_len (old_item, offset - start_offset);
2524
2525
0
  start_offset = offset;
2526
0
  new_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_glusterfs_parent_iatt, &new_item, "New parent");
2527
0
  offset = glusterfs_rpc_dissect_gfx_iatt(new_tree, tvb,
2528
0
          hf_glusterfs_preparent_iattx, offset);
2529
0
  offset = glusterfs_rpc_dissect_gfx_iatt(new_tree, tvb,
2530
0
          hf_glusterfs_postparent_iattx, offset);
2531
0
  proto_item_set_len (new_item, offset - start_offset);
2532
2533
0
  return offset;
2534
0
}
2535
2536
static int
2537
glusterfs_gfs4_0_op_link_call(tvbuff_t *tvb,
2538
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2539
0
{
2540
0
  int offset = 0;
2541
2542
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_oldgfid, offset);
2543
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_newgfid, offset);
2544
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_newbname, offset, NULL);
2545
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2546
2547
0
  return offset;
2548
0
}
2549
2550
static int
2551
glusterfs_gfs4_0_op_truncate_call(tvbuff_t *tvb,
2552
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2553
0
{
2554
0
  int offset = 0;
2555
2556
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2557
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
2558
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2559
2560
0
  return offset;
2561
0
}
2562
2563
static int
2564
glusterfs_gfs4_0_op_open_reply(tvbuff_t *tvb, packet_info *pinfo,
2565
              proto_tree *tree, void* data)
2566
0
{
2567
0
  int offset = 0;
2568
2569
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
2570
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2571
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2572
0
  return offset;
2573
0
}
2574
2575
static int
2576
glusterfs_gfs4_0_op_open_call(tvbuff_t *tvb,
2577
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2578
0
{
2579
0
  int offset = 0;
2580
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2581
0
  offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
2582
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2583
2584
0
  return offset;
2585
0
}
2586
2587
static int
2588
glusterfs_gfs4_0_op_read_reply(tvbuff_t *tvb, packet_info *pinfo,
2589
              proto_tree *tree, void* data)
2590
0
{
2591
0
  int offset = 0;
2592
2593
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
2594
0
  offset = glusterfs_rpc_dissect_gfx_iatt(tree, tvb, hf_glusterfs_iattx,
2595
0
                offset);
2596
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_size, offset);
2597
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict,
2598
0
                offset);
2599
2600
0
  return offset;
2601
0
}
2602
2603
static int
2604
glusterfs_gfs4_0_op_read_call(tvbuff_t *tvb,
2605
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2606
0
{
2607
0
  int offset = 0;
2608
2609
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2610
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2611
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
2612
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_size, offset);
2613
0
  offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
2614
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2615
2616
0
  return offset;
2617
0
}
2618
2619
static int
2620
glusterfs_gfs4_0_op_write_call(tvbuff_t *tvb,
2621
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2622
0
{
2623
0
  int offset = 0;
2624
2625
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2626
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2627
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
2628
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_size, offset);
2629
0
  offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
2630
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2631
2632
0
  return offset;
2633
0
}
2634
2635
static int
2636
glusterfs_gfs4_0_op_statfs_reply(tvbuff_t *tvb, packet_info *pinfo,
2637
              proto_tree *tree, void* data)
2638
0
{
2639
0
  int offset = 0;
2640
2641
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
2642
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2643
0
  offset = glusterfs_rpc_dissect_statfs(tree, tvb, offset);
2644
2645
0
  return offset;
2646
0
}
2647
2648
static int
2649
glusterfs_gfs4_0_op_statfs_call(tvbuff_t *tvb,
2650
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2651
0
{
2652
0
  int offset = 0;
2653
2654
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2655
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2656
2657
0
  return offset;
2658
0
}
2659
2660
static int
2661
glusterfs_gfs4_0_op_flush_call(tvbuff_t *tvb,
2662
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2663
0
{
2664
0
  int offset = 0;
2665
2666
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2667
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2668
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2669
2670
0
  return offset;
2671
0
}
2672
2673
static int
2674
glusterfs_gfs4_0_op_setxattr_call(tvbuff_t *tvb,
2675
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2676
0
{
2677
0
  int offset = 0;
2678
2679
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2680
0
  offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
2681
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2682
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2683
2684
0
  return offset;
2685
0
}
2686
2687
static int
2688
glusterfs_gfs4_0_op_getxattr_call(tvbuff_t *tvb,
2689
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2690
0
{
2691
0
  int offset = 0;
2692
2693
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2694
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_namelen, offset);
2695
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_name, offset, NULL);
2696
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2697
2698
0
  return offset;
2699
0
}
2700
2701
2702
static int
2703
glusterfs_gfs4_0_op_common_dict_reply(tvbuff_t *tvb,
2704
          packet_info *pinfo, proto_tree *tree, void* data)
2705
0
{
2706
0
  int offset = 0;
2707
2708
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
2709
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2710
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2711
0
  offset = glusterfs_rpc_dissect_gfx_iatt(tree, tvb,
2712
0
          hf_glusterfs_preop_iattx, offset);
2713
0
  offset = glusterfs_rpc_dissect_gfx_iatt(tree, tvb,
2714
0
          hf_glusterfs_postop_iattx, offset);
2715
2716
0
  return offset;
2717
0
}
2718
2719
static int
2720
glusterfs_gfs4_0_op_removexattr_call(tvbuff_t *tvb,
2721
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2722
0
{
2723
0
  int offset = 0;
2724
2725
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2726
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_name, offset, NULL);
2727
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2728
2729
0
  return offset;
2730
0
}
2731
2732
static int
2733
glusterfs_gfs4_0_op_fsync_call(tvbuff_t *tvb,
2734
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2735
0
{
2736
0
  static int * const flag_bits[] = {
2737
0
    &hf_glusterfs_fsync_flag_datasync,
2738
0
    &hf_glusterfs_fsync_flag_unknown,
2739
0
    NULL
2740
0
  };
2741
0
  int offset = 0;
2742
2743
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2744
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2745
2746
0
  proto_tree_add_bitmask(tree, tvb, offset,
2747
0
      hf_glusterfs_fsync_flags,
2748
0
      ett_glusterfs_fsync_flags, flag_bits, ENC_NA);
2749
0
  offset += 4;
2750
2751
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2752
2753
0
  return offset;
2754
0
}
2755
2756
static int
2757
glusterfs_gfs4_0_op_opendir_call(tvbuff_t *tvb,
2758
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2759
0
{
2760
0
  int offset = 0;
2761
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2762
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2763
2764
0
  return offset;
2765
0
}
2766
2767
static int
2768
glusterfs_gfs4_0_op_create_reply(tvbuff_t *tvb, packet_info *pinfo,
2769
              proto_tree *tree, void* data)
2770
0
{
2771
0
  int offset = 0;
2772
2773
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
2774
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2775
0
  offset = glusterfs_rpc_dissect_gfx_iatt(tree, tvb, hf_glusterfs_iattx,
2776
0
                offset);
2777
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2778
0
  offset = glusterfs_rpc_dissect_gfx_iatt(tree, tvb,
2779
0
          hf_glusterfs_preparent_iattx, offset);
2780
0
  offset = glusterfs_rpc_dissect_gfx_iatt(tree, tvb,
2781
0
          hf_glusterfs_postparent_iattx, offset);
2782
2783
0
  return offset;
2784
0
}
2785
2786
2787
static int
2788
glusterfs_gfs4_0_op_create_call(tvbuff_t *tvb,
2789
        packet_info *pinfo, proto_tree *tree, void* data _U_)
2790
0
{
2791
0
  const char *name = NULL;
2792
0
  int offset = 0;
2793
2794
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_pargfid, offset);
2795
0
  offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
2796
0
  offset = glusterfs_rpc_dissect_mode(tree, tvb, hf_glusterfs_mode, offset);
2797
0
  offset = glusterfs_rpc_dissect_mode(tree, tvb, hf_glusterfs_umask, offset);
2798
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_bname, offset, &name);
2799
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2800
0
  col_append_fstr(pinfo->cinfo, COL_INFO, ", Filename: %s", name);
2801
2802
0
  return offset;
2803
0
}
2804
2805
static int
2806
glusterfs_gfs4_0_op_ftruncate_call(tvbuff_t *tvb,
2807
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2808
0
{
2809
0
  int offset = 0;
2810
2811
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2812
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2813
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
2814
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2815
2816
0
  return offset;
2817
0
}
2818
2819
static int
2820
glusterfs_gfs4_0_op_fstat_call(tvbuff_t *tvb,
2821
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2822
0
{
2823
0
  int offset = 0;
2824
2825
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2826
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2827
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2828
2829
0
  return offset;
2830
0
}
2831
2832
static int
2833
glusterfs_gfs4_0_op_lk_call(tvbuff_t *tvb,
2834
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2835
0
{
2836
0
  int offset = 0;
2837
2838
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2839
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2840
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_cmd, offset);
2841
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_type, offset);
2842
0
  offset = glusterfs_rpc_dissect_gf_2_flock(tree, tvb, offset);
2843
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2844
2845
0
  return offset;
2846
0
}
2847
2848
static int
2849
glusterfs_gfs4_0_op_lk_reply(tvbuff_t *tvb,
2850
        packet_info *pinfo, proto_tree *tree, void* data)
2851
0
{
2852
0
  int offset = 0;
2853
2854
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
2855
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2856
0
  offset = glusterfs_rpc_dissect_gf_2_flock(tree, tvb, offset);
2857
2858
0
  return offset;
2859
0
}
2860
2861
static int
2862
glusterfs_gfs4_0_op_access_call(tvbuff_t *tvb,
2863
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2864
0
{
2865
0
  int offset = 0;
2866
2867
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2868
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_mask, offset);
2869
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2870
0
  return offset;
2871
0
}
2872
2873
static int
2874
glusterfs_gfs4_0_op_lookup_call(tvbuff_t *tvb,
2875
        packet_info *pinfo, proto_tree *tree, void* data _U_)
2876
0
{
2877
0
  const char *name = NULL;
2878
0
  int length;
2879
0
  int offset = 0;
2880
2881
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2882
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_pargfid, offset);
2883
0
  offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
2884
0
  length = tvb_get_letohl(tvb, offset);
2885
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_bname, offset, &name);
2886
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2887
0
  if(length == 0)
2888
0
    col_append_str(pinfo->cinfo, COL_INFO, ", Filename: (nameless, by GFID)");
2889
0
  else
2890
0
    col_append_fstr(pinfo->cinfo, COL_INFO, ", Filename: %s", name);
2891
2892
0
  return offset;
2893
0
}
2894
2895
static int
2896
glusterfs_gfs4_0_op_readdir_reply(tvbuff_t *tvb,
2897
        packet_info *pinfo, proto_tree *tree, void* data _U_)
2898
0
{
2899
0
  int offset = 0;
2900
2901
0
  offset = _glusterfs_gfs3_common_readdir_reply(tvb, tree, offset);
2902
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2903
0
  offset = dissect_rpc_list(tvb, pinfo, tree, offset,
2904
0
          glusterfs_gfs4_0_op_readdir_entry, NULL);
2905
2906
0
  return offset;
2907
0
}
2908
2909
static int
2910
glusterfs_gfs4_0_op_readdir_call(tvbuff_t *tvb,
2911
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2912
0
{
2913
0
  int offset = 0;
2914
2915
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2916
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2917
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
2918
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_size, offset);
2919
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2920
2921
0
  return offset;
2922
0
}
2923
2924
static int
2925
glusterfs_gfs4_0_op_inodelk_call(tvbuff_t *tvb,
2926
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2927
0
{
2928
0
  int offset = 0;
2929
2930
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2931
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_cmd, offset);
2932
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_type, offset);
2933
0
  offset = glusterfs_rpc_dissect_gf_2_flock(tree, tvb, offset);
2934
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_volume, offset, NULL);
2935
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2936
2937
0
  return offset;
2938
0
}
2939
2940
static int
2941
glusterfs_gfs4_0_op_finodelk_call(tvbuff_t *tvb,
2942
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2943
0
{
2944
0
  int offset = 0;
2945
2946
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2947
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2948
2949
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_cmd, offset);
2950
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_type, offset);
2951
0
  offset = glusterfs_rpc_dissect_gf_2_flock(tree, tvb, offset);
2952
2953
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_volume, offset, NULL);
2954
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2955
2956
0
  return offset;
2957
0
}
2958
2959
static int
2960
glusterfs_gfs4_0_op_entrylk_call(tvbuff_t *tvb,
2961
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2962
0
{
2963
0
  int offset = 0;
2964
2965
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2966
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_cmd, offset);
2967
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_type, offset);
2968
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_entrylk_namelen, offset);
2969
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_name, offset, NULL);
2970
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_volume, offset, NULL);
2971
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2972
2973
0
  return offset;
2974
0
}
2975
2976
static int
2977
glusterfs_gfs4_0_op_fentrylk_call(tvbuff_t *tvb,
2978
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2979
0
{
2980
0
  int offset = 0;
2981
2982
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
2983
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
2984
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_cmd, offset);
2985
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_type, offset);
2986
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_entrylk_namelen, offset);
2987
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_name, offset, NULL);
2988
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_volume, offset, NULL);
2989
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
2990
2991
0
  return offset;
2992
0
}
2993
2994
static int
2995
glusterfs_gfs4_0_op_xattrop_call(tvbuff_t *tvb,
2996
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
2997
0
{
2998
0
  int offset = 0;
2999
3000
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
3001
0
  offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
3002
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
3003
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
3004
3005
0
  return offset;
3006
0
}
3007
3008
static int
3009
glusterfs_gfs4_0_op_fxattrop_call(tvbuff_t *tvb,
3010
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
3011
0
{
3012
0
  int offset = 0;
3013
3014
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
3015
0
  offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
3016
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
3017
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
3018
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
3019
3020
0
  return offset;
3021
0
}
3022
3023
static int
3024
glusterfs_gfs4_0_op_fgetxattr_call(tvbuff_t *tvb,
3025
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
3026
0
{
3027
0
  int offset = 0;
3028
3029
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
3030
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
3031
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_namelen, offset);
3032
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_name, offset, NULL);
3033
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
3034
3035
0
  return offset;
3036
0
}
3037
3038
static int
3039
gluter_gfs4_0_op_fsetxattr_call(tvbuff_t *tvb,
3040
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
3041
0
{
3042
0
  int offset = 0;
3043
3044
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
3045
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
3046
0
  offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
3047
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
3048
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
3049
3050
0
  return offset;
3051
0
}
3052
3053
static int
3054
glusterfs_gfs4_0_op_common_2iatt_reply(tvbuff_t *tvb, packet_info *pinfo,
3055
              proto_tree *tree, void* data)
3056
0
{
3057
0
  int offset = 0;
3058
3059
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
3060
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
3061
0
  offset = glusterfs_rpc_dissect_gfx_iatt(tree, tvb,
3062
0
          hf_glusterfs_preop_iattx, offset);
3063
0
  offset = glusterfs_rpc_dissect_gfx_iatt(tree, tvb,
3064
0
          hf_glusterfs_postop_iattx, offset);
3065
3066
0
  return offset;
3067
0
}
3068
3069
static int
3070
glusterfs_gfs4_0_op_setattr_call(tvbuff_t *tvb,
3071
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
3072
0
{
3073
0
  int offset = 0;
3074
3075
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid,
3076
0
                offset);
3077
0
  offset = glusterfs_rpc_dissect_gfx_iatt(tree, tvb, hf_glusterfs_iattx,
3078
0
                offset);
3079
0
  offset = glusterfs_rpc_dissect_setattr(tree, tvb, offset);
3080
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
3081
3082
0
  return offset;
3083
0
}
3084
3085
static int
3086
glusterfs_gfs4_0_op_fsetattr_call(tvbuff_t *tvb,
3087
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
3088
0
{
3089
0
  int offset = 0;
3090
3091
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid,
3092
0
                offset);
3093
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
3094
0
  offset = glusterfs_rpc_dissect_gfx_iatt(tree, tvb, hf_glusterfs_iattx,
3095
0
                offset);
3096
0
  offset = glusterfs_rpc_dissect_setattr(tree, tvb, offset);
3097
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
3098
3099
0
  return offset;
3100
0
}
3101
3102
static int
3103
glusterfs_gfs4_0_op_readdirp_reply(tvbuff_t *tvb,
3104
        packet_info *pinfo, proto_tree *tree, void* data _U_)
3105
0
{
3106
0
  int offset = 0;
3107
3108
0
  offset = _glusterfs_gfs3_common_readdir_reply(tvb, tree, offset);
3109
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
3110
0
  offset = dissect_rpc_list(tvb, pinfo, tree, offset,
3111
0
          glusterfs_gfs4_0_op_readdirp_entry, NULL);
3112
3113
0
  return offset;
3114
0
}
3115
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_)
3120
0
{
3121
0
  int offset = 0;
3122
3123
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
3124
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
3125
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
3126
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_size, offset);
3127
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
3128
3129
0
  return offset;
3130
0
}
3131
3132
static int
3133
glusterfs_gfs4_0_op_release_call(tvbuff_t *tvb,
3134
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
3135
0
{
3136
0
  int offset = 0;
3137
3138
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
3139
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
3140
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
3141
3142
0
  return offset;
3143
0
}
3144
3145
static int
3146
glusterfs_gfs4_0_op_releasedir_call(tvbuff_t *tvb,
3147
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
3148
0
{
3149
0
  int offset = 0;
3150
3151
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
3152
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
3153
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
3154
3155
0
  return offset;
3156
0
}
3157
3158
static int
3159
glusterfs_gfs4_0_op_fremovexattr_call(tvbuff_t *tvb,
3160
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
3161
0
{
3162
0
  int offset = 0;
3163
3164
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
3165
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
3166
0
  offset = dissect_rpc_string(tvb, tree, hf_glusterfs_name, offset, NULL);
3167
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
3168
3169
0
  return offset;
3170
0
}
3171
3172
static int
3173
glusterfs_gfs4_0_op_fallocate_call(tvbuff_t *tvb,
3174
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
3175
0
{
3176
0
  int offset = 0;
3177
3178
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
3179
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
3180
0
  offset = glusterfs_rpc_dissect_flags(tree, tvb, offset);
3181
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
3182
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_size, offset);
3183
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
3184
3185
0
  return offset;
3186
0
}
3187
3188
static int
3189
glusterfs_gfs4_0_op_zerofill_call(tvbuff_t *tvb,
3190
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
3191
0
{
3192
0
  int offset = 0;
3193
3194
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
3195
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
3196
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
3197
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_size64, offset);
3198
3199
0
  return offset;
3200
0
}
3201
3202
static int
3203
glusterfs_gfs4_0_op_seek_reply(tvbuff_t *tvb, packet_info *pinfo,
3204
             proto_tree *tree, void* data)
3205
0
{
3206
0
  int offset = 0;
3207
3208
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
3209
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
3210
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
3211
3212
0
  return offset;
3213
0
}
3214
3215
static int
3216
glusterfs_gfs4_0_op_seek_call(tvbuff_t *tvb, packet_info *pinfo _U_,
3217
            proto_tree *tree, void* data _U_)
3218
0
{
3219
0
  int offset = 0;
3220
3221
0
  offset = glusterfs_rpc_dissect_gfid(tree, tvb, hf_glusterfs_gfid, offset);
3222
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_fd, offset);
3223
0
  offset = dissect_rpc_uint64(tvb, tree, hf_glusterfs_offset, offset);
3224
0
  offset = dissect_rpc_uint32(tvb, tree, hf_glusterfs_whence, offset);
3225
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
3226
3227
0
  return offset;
3228
0
}
3229
3230
/* This function is for common replay. RELEASE , RELEASEDIR and some other function use this method */
3231
3232
static int
3233
glusterfs_gfs4_0_op_common_reply(tvbuff_t *tvb, packet_info *pinfo,
3234
              proto_tree *tree, void* data)
3235
0
{
3236
0
  int offset = 0;
3237
3238
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
3239
0
  offset = gluster_rpc4_0_dissect_dict(tree, tvb, hf_glusterfs_dict, offset);
3240
3241
0
  return offset;
3242
0
}
3243
3244
3245
/*
3246
 * GLUSTER3_1_FOP_PROGRAM
3247
 * - xlators/protocol/client/src/client3_1-fops.c
3248
 * - xlators/protocol/server/src/server3_1-fops.c
3249
 */
3250
static const vsff glusterfs3_1_fop_proc[] = {
3251
  {
3252
    GFS3_OP_NULL,     "NULL",
3253
    dissect_rpc_void, dissect_rpc_void
3254
  },
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 },
3259
  {
3260
    GFS3_OP_UNLINK, "UNLINK",
3261
    glusterfs_gfs3_op_unlink_call, glusterfs_gfs3_op_unlink_reply
3262
  },
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 },
3271
  {
3272
    GFS3_OP_STATFS, "STATFS",
3273
    glusterfs_gfs3_op_statfs_call, glusterfs_gfs3_op_statfs_reply
3274
  },
3275
  {
3276
    GFS3_OP_FLUSH, "FLUSH",
3277
    glusterfs_gfs3_op_flush_call, gluster_local_dissect_common_reply
3278
  },
3279
  { GFS3_OP_FSYNC, "FSYNC", dissect_rpc_unknown, dissect_rpc_unknown },
3280
  {
3281
    GFS3_OP_SETXATTR, "SETXATTR",
3282
    glusterfs_gfs3_op_setxattr_call, gluster_local_dissect_common_reply
3283
  },
3284
  { GFS3_OP_GETXATTR,    "GETXATTR",    dissect_rpc_unknown, dissect_rpc_unknown },
3285
  { GFS3_OP_REMOVEXATTR, "REMOVEXATTR", dissect_rpc_unknown, dissect_rpc_unknown },
3286
  {
3287
    GFS3_OP_OPENDIR, "OPENDIR",
3288
    glusterfs_gfs3_op_opendir_call, glusterfs_gfs3_op_opendir_reply
3289
  },
3290
  { GFS3_OP_FSYNCDIR, "FSYNCDIR", dissect_rpc_unknown, dissect_rpc_unknown },
3291
  { GFS3_OP_ACCESS,   "ACCESS",   dissect_rpc_unknown, dissect_rpc_unknown },
3292
  {
3293
    GFS3_OP_CREATE, "CREATE",
3294
    glusterfs_gfs3_op_create_call, glusterfs_gfs3_op_create_reply
3295
  },
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 },
3299
  {
3300
    GFS3_OP_LOOKUP, "LOOKUP",
3301
    glusterfs_gfs3_op_lookup_call, glusterfs_gfs3_op_lookup_reply
3302
  },
3303
  { GFS3_OP_READDIR, "READDIR", dissect_rpc_unknown, dissect_rpc_unknown },
3304
  {
3305
    GFS3_OP_INODELK, "INODELK",
3306
    glusterfs_gfs3_op_inodelk_call, gluster_local_dissect_common_reply
3307
  },
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 },
3316
  {
3317
    GFS3_OP_SETATTR, "SETATTR",
3318
    glusterfs_gfs3_op_setattr_call, glusterfs_gfs3_op_setattr_reply
3319
  },
3320
  {
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
3324
  },
3325
  {
3326
    GFS3_OP_READDIRP, "READDIRP",
3327
    glusterfs_gfs3_op_readdirp_call, glusterfs_gfs3_op_readdirp_reply
3328
  },
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 }
3332
};
3333
3334
3335
/*
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
3339
 */
3340
static const vsff glusterfs3_3_fop_proc[] = {
3341
  {
3342
    GFS3_OP_NULL, "NULL",
3343
    dissect_rpc_void, dissect_rpc_void
3344
  },
3345
  {
3346
    GFS3_OP_STAT, "STAT",
3347
    glusterfs_gfs3_3_op_stat_call, glusterfs_gfs3_3_op_stat_reply
3348
  },
3349
  {
3350
    GFS3_OP_READLINK, "READLINK",
3351
    glusterfs_gfs3_3_op_readlink_call, glusterfs_gfs3_3_op_readlink_reply
3352
  },
3353
  {
3354
    GFS3_OP_MKNOD, "MKNOD",
3355
    glusterfs_gfs3_3_op_mknod_call, glusterfs_gfs3_3_op_mknod_reply
3356
  },
3357
  {
3358
    GFS3_OP_MKDIR, "MKDIR",
3359
    glusterfs_gfs3_3_op_mkdir_call, glusterfs_gfs3_3_op_mknod_reply
3360
  },
3361
  {
3362
    GFS3_OP_UNLINK, "UNLINK",
3363
    glusterfs_gfs3_3_op_unlink_call, glusterfs_gfs3_3_op_unlink_reply
3364
  },
3365
  {
3366
    GFS3_OP_RMDIR, "RMDIR",
3367
    glusterfs_gfs3_3_op_rmdir_call, glusterfs_gfs3_3_op_unlink_reply
3368
  },
3369
  {
3370
    GFS3_OP_SYMLINK, "SYMLINK",
3371
    glusterfs_gfs3_3_op_symlink_call, glusterfs_gfs3_3_op_mknod_reply
3372
  },
3373
  {
3374
    GFS3_OP_RENAME, "RENAME",
3375
    glusterfs_gfs3_3_op_rename_call, glusterfs_gfs3_3_op_rename_reply
3376
  },
3377
  {
3378
    GFS3_OP_LINK, "LINK",
3379
    glusterfs_gfs3_3_op_link_call, glusterfs_gfs3_3_op_mknod_reply
3380
  },
3381
  {
3382
    GFS3_OP_TRUNCATE, "TRUNCATE",
3383
    glusterfs_gfs3_3_op_truncate_call, glusterfs_gfs3_3_op_unlink_reply
3384
  },
3385
  {
3386
    GFS3_OP_OPEN, "OPEN",
3387
    glusterfs_gfs3_3_op_open_call, glusterfs_gfs3_3_op_open_reply
3388
  },
3389
  {
3390
    GFS3_OP_READ, "READ",
3391
    glusterfs_gfs3_3_op_read_call, glusterfs_gfs3_3_op_read_reply
3392
  },
3393
  {
3394
    GFS3_OP_WRITE, "WRITE",
3395
    glusterfs_gfs3_3_op_write_call, glusterfs_gfs3_3_op_setattr_reply
3396
  },
3397
  {
3398
    GFS3_OP_STATFS, "STATFS",
3399
    glusterfs_gfs3_3_op_statfs_call, glusterfs_gfs3_3_op_statfs_reply
3400
  },
3401
  {
3402
    GFS3_OP_FLUSH, "FLUSH",
3403
    glusterfs_gfs3_3_op_flush_call, glusterfs_gfs3_3_op_common_reply
3404
  },
3405
  {
3406
    GFS3_OP_FSYNC, "FSYNC",
3407
    glusterfs_gfs3_3_op_fsync_call, glusterfs_gfs3_3_op_setattr_reply
3408
  },
3409
  {
3410
    GFS3_OP_SETXATTR, "SETXATTR",
3411
    glusterfs_gfs3_3_op_setxattr_call, glusterfs_gfs3_3_op_common_reply
3412
  },
3413
  {
3414
    GFS3_OP_GETXATTR, "GETXATTR",
3415
    glusterfs_gfs3_3_op_getxattr_call, glusterfs_gfs3_3_op_getxattr_reply
3416
  },
3417
  {
3418
    GFS3_OP_REMOVEXATTR, "REMOVEXATTR",
3419
    glusterfs_gfs3_3_op_removexattr_call, glusterfs_gfs3_3_op_common_reply
3420
  },
3421
  {
3422
    GFS3_OP_OPENDIR, "OPENDIR",
3423
    glusterfs_gfs3_3_op_opendir_call, glusterfs_gfs3_3_op_opendir_reply
3424
  },
3425
  {
3426
    GFS3_OP_FSYNCDIR, "FSYNCDIR",
3427
    glusterfs_gfs3_3_op_fsync_call, glusterfs_gfs3_3_op_common_reply
3428
  },
3429
  {
3430
    GFS3_OP_ACCESS, "ACCESS",
3431
    glusterfs_gfs3_3_op_access_call, glusterfs_gfs3_3_op_common_reply
3432
  },
3433
  {
3434
    GFS3_OP_CREATE, "CREATE",
3435
    glusterfs_gfs3_3_op_create_call, glusterfs_gfs3_3_op_create_reply
3436
  },
3437
  {
3438
    GFS3_OP_FTRUNCATE, "FTRUNCATE",
3439
    glusterfs_gfs3_3_op_ftruncate_call, glusterfs_gfs3_3_op_unlink_reply
3440
  },
3441
  {
3442
    GFS3_OP_FSTAT, "FSTAT",
3443
    glusterfs_gfs3_3_op_fstat_call, glusterfs_gfs3_3_op_fstat_reply
3444
  },
3445
  {
3446
    GFS3_OP_LK, "LK",
3447
    glusterfs_gfs3_3_op_lk_call, glusterfs_gfs3_3_op_lk_reply
3448
  },
3449
  {
3450
    GFS3_OP_LOOKUP, "LOOKUP",
3451
    glusterfs_gfs3_3_op_lookup_call, glusterfs_gfs3_3_op_setattr_reply
3452
  },
3453
  {
3454
    GFS3_OP_READDIR, "READDIR",
3455
    glusterfs_gfs3_3_op_readdir_call, glusterfs_gfs3_3_op_readdir_reply
3456
  },
3457
  {
3458
    GFS3_OP_INODELK, "INODELK",
3459
    glusterfs_gfs3_3_op_inodelk_call, glusterfs_gfs3_3_op_common_reply
3460
  },
3461
  {
3462
    GFS3_OP_FINODELK, "FINODELK",
3463
    glusterfs_gfs3_3_op_finodelk_call, glusterfs_gfs3_3_op_common_reply
3464
  },
3465
  {
3466
    GFS3_OP_ENTRYLK, "ENTRYLK",
3467
    glusterfs_gfs3_3_op_entrylk_call, glusterfs_gfs3_3_op_common_reply
3468
  },
3469
  {
3470
    GFS3_OP_FENTRYLK, "FENTRYLK",
3471
    glusterfs_gfs3_3_op_fentrylk_call, glusterfs_gfs3_3_op_common_reply
3472
  },
3473
  {
3474
    GFS3_OP_XATTROP, "XATTROP",
3475
    glusterfs_gfs3_3_op_xattrop_call, glusterfs_gfs3_3_op_xattrop_reply
3476
  },
3477
  /*xattrop and fxattrop replay both are same */
3478
  {
3479
    GFS3_OP_FXATTROP, "FXATTROP",
3480
    glusterfs_gfs3_3_op_fxattrop_call, glusterfs_gfs3_3_op_xattrop_reply
3481
  },
3482
  {
3483
    GFS3_OP_FGETXATTR, "FGETXATTR",
3484
    glusterfs_gfs3_3_op_fgetxattr_call, glusterfs_gfs3_3_op_xattrop_reply
3485
  },
3486
  {
3487
    GFS3_OP_FSETXATTR, "FSETXATTR",
3488
    gluter_gfs3_3_op_fsetxattr_call, glusterfs_gfs3_3_op_common_reply
3489
  },
3490
  { GFS3_OP_RCHECKSUM, "RCHECKSUM", dissect_rpc_unknown, dissect_rpc_unknown },
3491
  {
3492
    GFS3_OP_SETATTR, "SETATTR",
3493
    glusterfs_gfs3_3_op_setattr_call, glusterfs_gfs3_3_op_setattr_reply
3494
  },
3495
  {
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
3499
  },
3500
  {
3501
    GFS3_OP_READDIRP, "READDIRP",
3502
    glusterfs_gfs3_3_op_readdirp_call, glusterfs_gfs3_3_op_readdirp_reply
3503
  },
3504
  {
3505
    GFS3_OP_RELEASE, "RELEASE",
3506
    glusterfs_gfs3_3_op_release_call, glusterfs_gfs3_3_op_common_reply
3507
  },
3508
  {
3509
    GFS3_OP_RELEASEDIR, "RELEASEDIR",
3510
    glusterfs_gfs3_3_op_releasedir_call, glusterfs_gfs3_3_op_common_reply
3511
  },
3512
  {
3513
    GFS3_OP_FREMOVEXATTR, "FREMOVEXATTR",
3514
    glusterfs_gfs3_3_op_fremovexattr_call, glusterfs_gfs3_3_op_common_reply
3515
  },
3516
  {
3517
    GFS3_OP_FALLOCATE, "FALLOCATE",
3518
    glusterfs_gfs3_3_op_fallocate_call, glusterfs_gfs3_3_op_setattr_reply
3519
  },
3520
  {
3521
    GFS3_OP_DISCARD, "DISCARD",
3522
    glusterfs_gfs3_3_op_readdirp_call, glusterfs_gfs3_3_op_setattr_reply
3523
  },
3524
  {
3525
    GFS3_OP_ZEROFILL, "ZEROFILL",
3526
    glusterfs_gfs3_3_op_zerofill_call, glusterfs_gfs3_3_op_setattr_reply
3527
  },
3528
  {
3529
    GFS3_OP_SEEK, "SEEK",
3530
    glusterfs_gfs3_3_op_seek_call, glusterfs_gfs3_3_op_seek_reply
3531
  },
3532
  { 0, NULL, NULL, NULL }
3533
};
3534
3535
3536
/*
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
3540
 */
3541
static const vsff glusterfs4_0_fop_proc[] = {
3542
  {
3543
    GFS3_OP_NULL, "NULL",
3544
    dissect_rpc_void, dissect_rpc_void
3545
  },
3546
  {
3547
    GFS3_OP_STAT, "STAT",
3548
    glusterfs_gfs4_0_op_stat_call, glusterfs_gfs4_0_op_common_iatt_reply
3549
  },
3550
  {
3551
    GFS3_OP_READLINK, "READLINK",
3552
    glusterfs_gfs4_0_op_readlink_call, glusterfs_gfs4_0_op_readlink_reply
3553
  },
3554
  {
3555
    GFS3_OP_MKNOD, "MKNOD",
3556
    glusterfs_gfs4_0_op_mknod_call, glusterfs_gfs4_0_op_common_3iatt_reply
3557
  },
3558
  {
3559
    GFS3_OP_MKDIR, "MKDIR",
3560
    glusterfs_gfs4_0_op_mkdir_call, glusterfs_gfs4_0_op_common_3iatt_reply
3561
  },
3562
  {
3563
    GFS3_OP_UNLINK, "UNLINK",
3564
    glusterfs_gfs4_0_op_unlink_call, glusterfs_gfs4_0_op_common_2parent_iatt_reply
3565
  },
3566
  {
3567
    GFS3_OP_RMDIR, "RMDIR",
3568
    glusterfs_gfs4_0_op_rmdir_call, glusterfs_gfs4_0_op_common_2parent_iatt_reply
3569
  },
3570
  {
3571
    GFS3_OP_SYMLINK, "SYMLINK",
3572
    glusterfs_gfs4_0_op_symlink_call, glusterfs_gfs4_0_op_common_3iatt_reply
3573
  },
3574
  {
3575
    GFS3_OP_RENAME, "RENAME",
3576
    glusterfs_gfs4_0_op_rename_call, glusterfs_gfs4_0_op_rename_reply
3577
  },
3578
  {
3579
    GFS3_OP_LINK, "LINK",
3580
    glusterfs_gfs4_0_op_link_call, glusterfs_gfs4_0_op_common_3iatt_reply
3581
  },
3582
  {
3583
    GFS3_OP_TRUNCATE, "TRUNCATE",
3584
    glusterfs_gfs4_0_op_truncate_call, glusterfs_gfs4_0_op_common_2iatt_reply
3585
  },
3586
  {
3587
    GFS3_OP_OPEN, "OPEN",
3588
    glusterfs_gfs4_0_op_open_call, glusterfs_gfs4_0_op_open_reply
3589
  },
3590
  {
3591
    GFS3_OP_READ, "READ",
3592
    glusterfs_gfs4_0_op_read_call, glusterfs_gfs4_0_op_read_reply
3593
  },
3594
  {
3595
    GFS3_OP_WRITE, "WRITE",
3596
    glusterfs_gfs4_0_op_write_call, glusterfs_gfs4_0_op_common_2iatt_reply
3597
  },
3598
  {
3599
    GFS3_OP_STATFS, "STATFS",
3600
    glusterfs_gfs4_0_op_statfs_call, glusterfs_gfs4_0_op_statfs_reply
3601
  },
3602
  {
3603
    GFS3_OP_FLUSH, "FLUSH",
3604
    glusterfs_gfs4_0_op_flush_call, glusterfs_gfs4_0_op_common_reply
3605
  },
3606
  {
3607
    GFS3_OP_FSYNC, "FSYNC",
3608
    glusterfs_gfs4_0_op_fsync_call, glusterfs_gfs4_0_op_common_2iatt_reply
3609
  },
3610
  {
3611
    GFS3_OP_SETXATTR, "SETXATTR",
3612
    glusterfs_gfs4_0_op_setxattr_call, glusterfs_gfs4_0_op_common_reply
3613
  },
3614
  {
3615
    GFS3_OP_GETXATTR, "GETXATTR",
3616
    glusterfs_gfs4_0_op_getxattr_call, glusterfs_gfs4_0_op_common_dict_reply
3617
  },
3618
  {
3619
    GFS3_OP_REMOVEXATTR, "REMOVEXATTR",
3620
    glusterfs_gfs4_0_op_removexattr_call, glusterfs_gfs4_0_op_common_reply
3621
  },
3622
  {
3623
    GFS3_OP_OPENDIR, "OPENDIR",
3624
    glusterfs_gfs4_0_op_opendir_call, glusterfs_gfs4_0_op_open_reply
3625
  },
3626
  {
3627
    GFS3_OP_FSYNCDIR, "FSYNCDIR",
3628
    glusterfs_gfs4_0_op_fsync_call, glusterfs_gfs4_0_op_common_reply
3629
  },
3630
  {
3631
    GFS3_OP_ACCESS, "ACCESS",
3632
    glusterfs_gfs4_0_op_access_call, glusterfs_gfs4_0_op_common_reply
3633
  },
3634
  {
3635
    GFS3_OP_CREATE, "CREATE",
3636
    glusterfs_gfs4_0_op_create_call, glusterfs_gfs4_0_op_create_reply
3637
  },
3638
  {
3639
    GFS3_OP_FTRUNCATE, "FTRUNCATE",
3640
    glusterfs_gfs4_0_op_ftruncate_call, glusterfs_gfs4_0_op_common_2iatt_reply
3641
  },
3642
  {
3643
    GFS3_OP_FSTAT, "FSTAT",
3644
    glusterfs_gfs4_0_op_fstat_call, glusterfs_gfs4_0_op_common_iatt_reply
3645
  },
3646
  {
3647
    GFS3_OP_LK, "LK",
3648
    glusterfs_gfs4_0_op_lk_call, glusterfs_gfs4_0_op_lk_reply
3649
  },
3650
  {
3651
    GFS3_OP_LOOKUP, "LOOKUP",
3652
    glusterfs_gfs4_0_op_lookup_call, glusterfs_gfs4_0_op_common_2iatt_reply
3653
  },
3654
  {
3655
    GFS3_OP_READDIR, "READDIR",
3656
    glusterfs_gfs4_0_op_readdir_call, glusterfs_gfs4_0_op_readdir_reply
3657
  },
3658
  {
3659
    GFS3_OP_INODELK, "INODELK",
3660
    glusterfs_gfs4_0_op_inodelk_call, glusterfs_gfs4_0_op_common_reply
3661
  },
3662
  {
3663
    GFS3_OP_FINODELK, "FINODELK",
3664
    glusterfs_gfs4_0_op_finodelk_call, glusterfs_gfs4_0_op_common_reply
3665
  },
3666
  {
3667
    GFS3_OP_ENTRYLK, "ENTRYLK",
3668
    glusterfs_gfs4_0_op_entrylk_call, glusterfs_gfs4_0_op_common_reply
3669
  },
3670
  {
3671
    GFS3_OP_FENTRYLK, "FENTRYLK",
3672
    glusterfs_gfs4_0_op_fentrylk_call, glusterfs_gfs4_0_op_common_reply
3673
  },
3674
  {
3675
    GFS3_OP_XATTROP, "XATTROP",
3676
    glusterfs_gfs4_0_op_xattrop_call, glusterfs_gfs4_0_op_common_dict_reply
3677
  },
3678
  /*xattrop and fxattrop replay both are same */
3679
  {
3680
    GFS3_OP_FXATTROP, "FXATTROP",
3681
    glusterfs_gfs4_0_op_fxattrop_call, glusterfs_gfs4_0_op_common_dict_reply
3682
  },
3683
  {
3684
    GFS3_OP_FGETXATTR, "FGETXATTR",
3685
    glusterfs_gfs4_0_op_fgetxattr_call, glusterfs_gfs4_0_op_common_dict_reply
3686
  },
3687
  {
3688
    GFS3_OP_FSETXATTR, "FSETXATTR",
3689
    gluter_gfs4_0_op_fsetxattr_call, glusterfs_gfs4_0_op_common_reply
3690
  },
3691
  { GFS3_OP_RCHECKSUM, "RCHECKSUM", dissect_rpc_unknown, dissect_rpc_unknown },
3692
  {
3693
    GFS3_OP_SETATTR, "SETATTR",
3694
    glusterfs_gfs4_0_op_setattr_call, glusterfs_gfs4_0_op_common_2iatt_reply
3695
  },
3696
  {
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
3700
  },
3701
  {
3702
    GFS3_OP_READDIRP, "READDIRP",
3703
    glusterfs_gfs4_0_op_readdirp_call, glusterfs_gfs4_0_op_readdirp_reply
3704
  },
3705
  {
3706
    GFS3_OP_RELEASE, "RELEASE",
3707
    glusterfs_gfs4_0_op_release_call, glusterfs_gfs4_0_op_common_reply
3708
  },
3709
  {
3710
    GFS3_OP_RELEASEDIR, "RELEASEDIR",
3711
    glusterfs_gfs4_0_op_releasedir_call, glusterfs_gfs4_0_op_common_reply
3712
  },
3713
  {
3714
    GFS3_OP_FREMOVEXATTR, "FREMOVEXATTR",
3715
    glusterfs_gfs4_0_op_fremovexattr_call, glusterfs_gfs4_0_op_common_reply
3716
  },
3717
  {
3718
    GFS3_OP_FALLOCATE, "FALLOCATE",
3719
    glusterfs_gfs4_0_op_fallocate_call, glusterfs_gfs4_0_op_common_2iatt_reply
3720
  },
3721
  {
3722
    GFS3_OP_DISCARD, "DISCARD",
3723
    glusterfs_gfs4_0_op_readdirp_call, glusterfs_gfs4_0_op_common_2iatt_reply
3724
  },
3725
  {
3726
    GFS3_OP_ZEROFILL, "ZEROFILL",
3727
    glusterfs_gfs4_0_op_zerofill_call, glusterfs_gfs4_0_op_common_2iatt_reply
3728
  },
3729
  {
3730
    GFS3_OP_SEEK, "SEEK",
3731
    glusterfs_gfs4_0_op_seek_call, glusterfs_gfs4_0_op_seek_reply
3732
  },
3733
  { 0, NULL, NULL, NULL }
3734
};
3735
3736
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 },
3741
};
3742
3743
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 }
3796
};
3797
static value_string_ext glusterfs3_1_fop_proc_vals_ext = VALUE_STRING_EXT_INIT(glusterfs3_1_fop_proc_vals);
3798
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 }
3811
};
3812
static value_string_ext glusterfs_entry_type_names_ext = VALUE_STRING_EXT_INIT(glusterfs_entry_type_names);
3813
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 }
3824
};
3825
static value_string_ext glusterfs_lk_cmd_names_ext = VALUE_STRING_EXT_INIT(glusterfs_lk_cmd_names);
3826
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 }
3834
};
3835
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 }
3841
};
3842
3843
static const value_string glusterfs_seek_whence[] = {
3844
  { GF_SEEK_DATA, "SEEK_DATA" },
3845
  { GF_SEEK_HOLE, "SEEK_HOLE" },
3846
  { 0, NULL }
3847
};
3848
3849
void
3850
proto_register_glusterfs(void)
3851
14
{
3852
  /* Setup list of header fields  See Section 1.6.1 for details */
3853
14
  static hf_register_info hf[] = {
3854
    /* programs */
3855
14
    { &hf_glusterfs_proc,
3856
14
      { "GlusterFS", "glusterfs.proc", FT_UINT32, BASE_DEC | BASE_EXT_STRING,
3857
14
        &glusterfs3_1_fop_proc_vals_ext, 0, NULL, HFILL }
3858
14
    },
3859
    /* fields used by multiple programs/procedures and other
3860
     * Gluster dissectors with gluster_dissect_common_reply() */
3861
14
    { &hf_gluster_op_ret,
3862
14
      { "Return value", "gluster.op_ret", FT_INT32, BASE_DEC,
3863
14
        NULL, 0, NULL, HFILL }
3864
14
    },
3865
14
    { &hf_gluster_op_errno,
3866
14
      { "Errno", "gluster.op_errno", FT_INT32, BASE_DEC,
3867
14
        NULL, 0, NULL, HFILL }
3868
14
    },
3869
    /* GlusterFS specific */
3870
14
    { &hf_glusterfs_gfid,
3871
14
      { "GFID", "glusterfs.gfid", FT_GUID,
3872
14
        BASE_NONE, NULL, 0, NULL, HFILL }
3873
14
    },
3874
14
    { &hf_glusterfs_pargfid,
3875
14
      { "Parent GFID", "glusterfs.pargfid", FT_GUID,
3876
14
        BASE_NONE, NULL, 0,
3877
14
        "GFID of the parent directory", HFILL }
3878
14
    },
3879
14
    { &hf_glusterfs_oldgfid,
3880
14
      { "Old GFID", "glusterfs.oldgfid", FT_GUID,
3881
14
        BASE_NONE, NULL, 0, NULL, HFILL }
3882
14
    },
3883
14
    { &hf_glusterfs_newgfid,
3884
14
      { "New GFID", "glusterfs.newgfid", FT_GUID,
3885
14
        BASE_NONE, NULL, 0, NULL, HFILL }
3886
14
    },
3887
14
    { &hf_glusterfs_path,
3888
14
      { "Path", "glusterfs.path", FT_STRING, BASE_NONE,
3889
14
        NULL, 0, NULL, HFILL }
3890
14
    },
3891
14
    { &hf_glusterfs_bname,
3892
14
      { "Basename", "glusterfs.bname", FT_STRING, BASE_NONE,
3893
14
        NULL, 0, NULL, HFILL }
3894
14
    },
3895
14
    { &hf_glusterfs_dict,
3896
14
      { "Dict", "glusterfs.dict", FT_STRING, BASE_NONE,
3897
14
        NULL, 0, NULL, HFILL }
3898
14
    },
3899
14
    { &hf_glusterfs_fd,
3900
14
      { "File Descriptor", "glusterfs.fd", FT_UINT64, BASE_DEC,
3901
14
        NULL, 0, NULL, HFILL }
3902
14
    },
3903
14
    { &hf_glusterfs_offset,
3904
14
      { "Offset", "glusterfs.offset", FT_UINT64, BASE_DEC,
3905
14
        NULL, 0, NULL, HFILL }
3906
14
    },
3907
14
    { &hf_glusterfs_size,
3908
14
      { "Size", "glusterfs.size", FT_UINT32, BASE_DEC,
3909
14
        NULL, 0, NULL, HFILL }
3910
14
    },
3911
14
    { &hf_glusterfs_size64,
3912
14
      { "Size", "glusterfs.size64", FT_UINT64, BASE_DEC,
3913
14
        NULL, 0, NULL, HFILL }
3914
14
    },
3915
14
    { &hf_glusterfs_type,
3916
14
      { "Type", "glusterfs.type", FT_INT32, BASE_DEC,
3917
14
        VALS(glusterfs_lk_type_names), 0, NULL, HFILL }
3918
14
    },
3919
14
    { &hf_glusterfs_cmd,
3920
14
      { "Command", "glusterfs.cmd", FT_INT32, BASE_DEC | BASE_EXT_STRING,
3921
14
        &glusterfs_lk_cmd_names_ext, 0, NULL, HFILL }
3922
14
    },
3923
14
    { &hf_glusterfs_volume,
3924
14
      { "Volume", "glusterfs.volume", FT_STRING, BASE_NONE,
3925
14
        NULL, 0, NULL, HFILL }
3926
14
    },
3927
14
    { &hf_glusterfs_namelen,
3928
14
      { "Name Length", "glusterfs.namelen", FT_UINT32, BASE_DEC,
3929
14
        NULL, 0, NULL, HFILL }
3930
14
    },
3931
14
    { &hf_glusterfs_linkname,
3932
14
      { "Linkname", "glusterfs.linkname", FT_STRING, BASE_NONE,
3933
14
        NULL, 0, NULL, HFILL }
3934
14
    },
3935
14
    { &hf_glusterfs_umask,
3936
14
      { "Umask", "glusterfs.umask", FT_UINT32, BASE_OCT,
3937
14
        NULL, 0, NULL, HFILL }
3938
14
    },
3939
14
    { &hf_glusterfs_mask,
3940
14
      { "Mask", "glusterfs.mask", FT_UINT32, BASE_OCT,
3941
14
        NULL, 0, NULL, HFILL }
3942
14
    },
3943
3944
14
    { &hf_glusterfs_entries, /* READDIRP returned <x> entries */
3945
14
      { "Entries returned", "glusterfs.entries", FT_INT32, BASE_DEC,
3946
14
        NULL, 0, NULL, HFILL }
3947
14
    },
3948
14
    { &hf_glusterfs_whence,
3949
14
      { "Whence", "glusterfs.whence", FT_UINT32, BASE_DEC,
3950
14
        VALS(glusterfs_seek_whence), 0, NULL, HFILL }
3951
14
    },
3952
    /* Flags passed on to OPEN, CREATE etc, based on */
3953
14
    { &hf_glusterfs_flags,
3954
14
      { "Flags", "glusterfs.flags", FT_UINT32, BASE_OCT,
3955
14
        NULL, 0, NULL, HFILL }
3956
14
    },
3957
14
    { &hf_glusterfs_flags_rdonly,
3958
14
      { "O_RDONLY", "glusterfs.flags.rdonly", FT_BOOLEAN, 32,
3959
14
        TFS(&glusterfs_notset_set), 0xffffffff, NULL, HFILL }
3960
14
    },
3961
14
    { &hf_glusterfs_flags_wronly,
3962
14
      { "O_WRONLY", "glusterfs.flags.wronly", FT_BOOLEAN, 32,
3963
14
        TFS(&tfs_set_notset), 00000001, NULL, HFILL }
3964
14
    },
3965
14
    { &hf_glusterfs_flags_rdwr,
3966
14
      { "O_RDWR", "glusterfs.flags.rdwr", FT_BOOLEAN, 32,
3967
14
        TFS(&tfs_set_notset), 00000002, NULL, HFILL }
3968
14
    },
3969
14
    { &hf_glusterfs_flags_accmode,
3970
14
      { "O_ACCMODE", "glusterfs.flags.accmode", FT_UINT32, BASE_DEC,
3971
14
        VALS(glusterfs_accmode_vals), 00000003, NULL, HFILL }
3972
14
    },
3973
14
    { &hf_glusterfs_flags_append,
3974
14
      { "O_APPEND", "glusterfs.flags.append", FT_BOOLEAN, 32,
3975
14
        TFS(&tfs_set_notset), 00002000, NULL, HFILL }
3976
14
    },
3977
14
    { &hf_glusterfs_flags_async,
3978
14
      { "O_ASYNC", "glusterfs.flags.async", FT_BOOLEAN, 32,
3979
14
        TFS(&tfs_set_notset), 00020000, NULL, HFILL }
3980
14
    },
3981
14
    { &hf_glusterfs_flags_cloexec,
3982
14
      { "O_CLOEXEC", "glusterfs.flags.cloexec", FT_BOOLEAN, 32,
3983
14
        TFS(&tfs_set_notset), 02000000, NULL, HFILL }
3984
14
    },
3985
14
    { &hf_glusterfs_flags_creat,
3986
14
      { "O_CREAT", "glusterfs.flags.creat", FT_BOOLEAN, 32,
3987
14
        TFS(&tfs_set_notset), 00000100, NULL, HFILL }
3988
14
    },
3989
14
    { &hf_glusterfs_flags_direct,
3990
14
      { "O_DIRECT", "glusterfs.flags.direct", FT_BOOLEAN, 32,
3991
14
        TFS(&tfs_set_notset), 00040000, NULL, HFILL }
3992
14
    },
3993
14
    { &hf_glusterfs_flags_directory,
3994
14
      { "O_DIRECTORY", "glusterfs.flags.directory", FT_BOOLEAN, 32,
3995
14
        TFS(&tfs_set_notset), 00200000, NULL, HFILL }
3996
14
    },
3997
14
    { &hf_glusterfs_flags_excl,
3998
14
      { "O_EXCL", "glusterfs.flags.excl", FT_BOOLEAN, 32,
3999
14
        TFS(&tfs_set_notset), 00000200, NULL, HFILL }
4000
14
    },
4001
14
    { &hf_glusterfs_flags_largefile,
4002
14
      { "O_LARGEFILE", "glusterfs.flags.largefile", FT_BOOLEAN, 32,
4003
14
        TFS(&tfs_set_notset), 00100000, NULL, HFILL }
4004
14
    },
4005
14
    { &hf_glusterfs_flags_noatime,
4006
14
      { "O_NOATIME", "glusterfs.flags.noatime", FT_BOOLEAN, 32,
4007
14
        TFS(&tfs_set_notset), 01000000, NULL, HFILL }
4008
14
    },
4009
14
    { &hf_glusterfs_flags_noctty,
4010
14
      { "O_NOCTTY", "glusterfs.flags.noctty", FT_BOOLEAN, 32,
4011
14
        TFS(&tfs_set_notset), 00000400, NULL, HFILL }
4012
14
    },
4013
14
    { &hf_glusterfs_flags_nofollow,
4014
14
      { "O_NOFOLLOW", "glusterfs.flags.nofollow", FT_BOOLEAN, 32,
4015
14
        TFS(&tfs_set_notset), 00400000, NULL, HFILL }
4016
14
    },
4017
    /* TODO: These 2 have the same mask.  Which one is correct? */
4018
14
    { &hf_glusterfs_flags_nonblock,
4019
14
      { "O_NONBLOCK", "glusterfs.flags.nonblock", FT_BOOLEAN, 32,
4020
14
        TFS(&tfs_set_notset), 00004000, NULL, HFILL }
4021
14
    },
4022
14
    { &hf_glusterfs_flags_ndelay,
4023
14
      { "O_NDELAY", "glusterfs.flags.ndelay", FT_BOOLEAN, 32,
4024
14
        TFS(&tfs_set_notset), 00004000, NULL, HFILL }
4025
14
    },
4026
    /* TODO: These 2 have the same mask.  Which one is correct? */
4027
14
    { &hf_glusterfs_flags_sync,
4028
14
      { "O_SYNC", "glusterfs.flags.sync", FT_BOOLEAN, 32,
4029
14
        TFS(&tfs_set_notset), 00010000, NULL, HFILL }
4030
14
    },
4031
14
    { &hf_glusterfs_flags_trunc,
4032
14
      { "O_TRUNC", "glusterfs.flags.trunc", FT_BOOLEAN, 32,
4033
14
        TFS(&tfs_set_notset), 00001000, NULL, HFILL }
4034
14
    },
4035
14
    { &hf_glusterfs_flags_reserved,
4036
14
      { "Unused", "glusterfs.flags.reserved", FT_BOOLEAN, 32,
4037
14
        TFS(&tfs_set_notset), 037774000074, NULL, HFILL }
4038
14
    },
4039
    /* access modes */
4040
14
    { &hf_glusterfs_mode,
4041
14
      { "Mode", "glusterfs.mode", FT_UINT32, BASE_OCT,
4042
14
        NULL, 0, "Access Permissions", HFILL }
4043
14
    },
4044
14
    { &hf_glusterfs_mode_suid,
4045
14
      { "S_ISUID", "glusterfs.mode.s_isuid", FT_BOOLEAN, 32,
4046
14
        TFS(&tfs_set_notset), (04000), "set-user-ID", HFILL }
4047
14
    },
4048
14
    { &hf_glusterfs_mode_sgid,
4049
14
      { "S_ISGID", "glusterfs.mode.s_isgid", FT_BOOLEAN, 32,
4050
14
        TFS(&tfs_set_notset), (02000), "set-group-ID", HFILL }
4051
14
    },
4052
14
    { &hf_glusterfs_mode_svtx,
4053
14
      { "S_ISVTX", "glusterfs.mode.s_isvtx", FT_BOOLEAN, 32,
4054
14
        TFS(&tfs_set_notset), (01000), "sticky bit", HFILL }
4055
14
    },
4056
14
    { &hf_glusterfs_mode_rusr,
4057
14
      { "S_IRUSR", "glusterfs.mode.s_irusr", FT_BOOLEAN, 32,
4058
14
        TFS(&tfs_set_notset), (00400), "read by owner", HFILL }
4059
14
    },
4060
14
    { &hf_glusterfs_mode_wusr,
4061
14
      { "S_IWUSR", "glusterfs.mode.s_iwusr", FT_BOOLEAN, 32,
4062
14
        TFS(&tfs_set_notset), (00200), "write by owner", HFILL }
4063
14
    },
4064
14
    { &hf_glusterfs_mode_xusr,
4065
14
      { "S_IXUSR", "glusterfs.mode.s_ixusr", FT_BOOLEAN, 32,
4066
14
        TFS(&tfs_set_notset), (00100), "execute/search by owner", HFILL }
4067
14
    },
4068
14
    { &hf_glusterfs_mode_rgrp,
4069
14
      { "S_IRGRP", "glusterfs.mode.s_irgrp", FT_BOOLEAN, 32,
4070
14
        TFS(&tfs_set_notset), (00040), "read by group", HFILL }
4071
14
    },
4072
14
    { &hf_glusterfs_mode_wgrp,
4073
14
      { "S_IWGRP", "glusterfs.mode.s_iwgrp", FT_BOOLEAN, 32,
4074
14
        TFS(&tfs_set_notset), (00020), "write by group", HFILL }
4075
14
    },
4076
14
    { &hf_glusterfs_mode_xgrp,
4077
14
      { "S_IXGRP", "glusterfs.mode.s_ixgrp", FT_BOOLEAN, 32,
4078
14
        TFS(&tfs_set_notset), (00010), "execute/search by group", HFILL }
4079
14
    },
4080
14
    { &hf_glusterfs_mode_roth,
4081
14
      { "S_IROTH", "glusterfs.mode.s_iroth", FT_BOOLEAN, 32,
4082
14
        TFS(&tfs_set_notset), (00004), "read by others", HFILL }
4083
14
    },
4084
14
    { &hf_glusterfs_mode_woth,
4085
14
      { "S_IWOTH", "glusterfs.mode.s_iwoth", FT_BOOLEAN, 32,
4086
14
        TFS(&tfs_set_notset), (00002), "write by others", HFILL }
4087
14
    },
4088
14
    { &hf_glusterfs_mode_xoth,
4089
14
      { "S_IXOTH", "glusterfs.mode.s_ixoth", FT_BOOLEAN, 32,
4090
14
        TFS(&tfs_set_notset), (00001), "execute/search by others", HFILL }
4091
14
    },
4092
14
    { &hf_glusterfs_mode_reserved,
4093
14
      { "Reserved", "glusterfs.mode.reserved", FT_BOOLEAN, 32,
4094
14
        TFS(&tfs_set_notset), (~07777), "execute/search by others", HFILL }
4095
14
    },
4096
    /* the dir-entry structure */
4097
14
    { &hf_glusterfs_entry_ino,
4098
14
      { "Inode", "glusterfs.entry.ino", FT_UINT64, BASE_DEC,
4099
14
        NULL, 0, NULL, HFILL }
4100
14
    },
4101
14
    { &hf_glusterfs_entry_off, /* like telldir() */
4102
14
      { "Offset", "glusterfs.entry.d_off", FT_UINT64, BASE_DEC,
4103
14
        NULL, 0, NULL, HFILL }
4104
14
    },
4105
14
    { &hf_glusterfs_entry_len, /* length of the path string */
4106
14
      { "Path length", "glusterfs.entry.len", FT_UINT32, BASE_DEC,
4107
14
        NULL, 0, NULL, HFILL }
4108
14
    },
4109
14
    { &hf_glusterfs_entry_type,
4110
14
      { "Type", "glusterfs.entry.d_type", FT_UINT32, BASE_DEC | BASE_EXT_STRING,
4111
14
        &glusterfs_entry_type_names_ext, 0, NULL, HFILL }
4112
14
    },
4113
14
    { &hf_glusterfs_entry_path,
4114
14
      { "Path", "glusterfs.entry.path", FT_STRING, BASE_NONE,
4115
14
        NULL, 0, NULL, HFILL }
4116
14
    },
4117
    /* the IATT structure */
4118
14
    { &hf_glusterfs_iatt,
4119
14
      { "IATT", "glusterfs.iatt", FT_NONE, BASE_NONE, NULL,
4120
14
        0, NULL, HFILL }
4121
14
    },
4122
14
    { &hf_glusterfs_preparent_iatt,
4123
14
      { "Pre-operation parent IATT", "glusterfs.preparent_iatt", FT_NONE, BASE_NONE, NULL,
4124
14
        0, NULL, HFILL }
4125
14
    },
4126
14
    { &hf_glusterfs_postparent_iatt,
4127
14
      { "Post-operation parent IATT", "glusterfs.postparent_iatt", FT_NONE, BASE_NONE, NULL,
4128
14
        0, NULL, HFILL }
4129
14
    },
4130
14
    { &hf_glusterfs_preop_iatt,
4131
14
      { "Pre-operation IATT", "glusterfs.preop_iatt", FT_NONE, BASE_NONE, NULL,
4132
14
        0, NULL, HFILL }
4133
14
    },
4134
14
    { &hf_glusterfs_postop_iatt,
4135
14
      { "Post-operation IATT", "glusterfs.postop_iatt", FT_NONE, BASE_NONE, NULL,
4136
14
        0, NULL, HFILL }
4137
14
    },
4138
14
    { &hf_glusterfs_ia_ino,
4139
14
      { "Inode", "glusterfs.ia_ino", FT_UINT64, BASE_DEC,
4140
14
        NULL, 0, NULL, HFILL }
4141
14
    },
4142
14
    { &hf_glusterfs_ia_dev,
4143
14
      { "Device", "glusterfs.ia_dev", FT_UINT64, BASE_HEX,
4144
14
        NULL, 0, NULL, HFILL }
4145
14
    },
4146
14
    { &hf_glusterfs_ia_mode,
4147
14
      { "Mode", "glusterfs.ia_mode", FT_UINT32, BASE_OCT,
4148
14
        NULL, 0, NULL, HFILL }
4149
14
    },
4150
14
    { &hf_glusterfs_ia_nlink,
4151
14
      { "Number of hard links", "glusterfs.ia_nlink",
4152
14
        FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL }
4153
14
    },
4154
14
    { &hf_glusterfs_ia_uid,
4155
14
      { "UID", "glusterfs.ia_uid", FT_INT32, BASE_DEC,
4156
14
        NULL, 0, NULL, HFILL }
4157
14
    },
4158
14
    { &hf_glusterfs_ia_gid,
4159
14
      { "GID", "glusterfs.ia_gid", FT_INT32, BASE_DEC,
4160
14
        NULL, 0, NULL, HFILL }
4161
14
    },
4162
14
    { &hf_glusterfs_ia_rdev,
4163
14
      { "Root device", "glusterfs.ia_rdev", FT_UINT64,
4164
14
        BASE_HEX, NULL, 0, NULL, HFILL }
4165
14
    },
4166
14
    { &hf_glusterfs_ia_size,
4167
14
      { "Size", "glusterfs.ia_size", FT_UINT64, BASE_DEC,
4168
14
        NULL, 0, NULL, HFILL }
4169
14
    },
4170
14
    { &hf_glusterfs_ia_blksize,
4171
14
      { "Block size", "glusterfs.ia_blksize", FT_INT32,
4172
14
        BASE_DEC, NULL, 0, NULL, HFILL }
4173
14
    },
4174
14
    { &hf_glusterfs_ia_blocks,
4175
14
      { "Blocks", "glusterfs.ia_blocks", FT_UINT64,
4176
14
        BASE_DEC, NULL, 0, NULL, HFILL }
4177
14
    },
4178
14
    { &hf_glusterfs_ia_atime,
4179
14
      { "Time of last access", "glusterfs.ia_atime",
4180
14
        FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
4181
14
        NULL, HFILL }
4182
14
    },
4183
14
    { &hf_glusterfs_ia_mtime,
4184
14
      { "Time of last modification", "glusterfs.ia_mtime",
4185
14
        FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
4186
14
        NULL, HFILL }
4187
14
    },
4188
14
    { &hf_glusterfs_ia_ctime,
4189
14
      { "Time of last status change", "glusterfs.ia_ctime",
4190
14
        FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
4191
14
        NULL, HFILL }
4192
14
    },
4193
4194
    /* the IATTx structure */
4195
14
    { &hf_glusterfs_iattx,
4196
14
      { "IATTX", "glusterfs.iattx", FT_NONE, BASE_NONE, NULL,
4197
14
        0, NULL, HFILL }
4198
14
    },
4199
14
    { &hf_glusterfs_preparent_iattx,
4200
14
      { "Pre-operation parent IATTX", "glusterfs.preparent_iattx", FT_NONE, BASE_NONE, NULL,
4201
14
        0, NULL, HFILL }
4202
14
    },
4203
14
    { &hf_glusterfs_postparent_iattx,
4204
14
      { "Post-operation parent IATTX", "glusterfs.postparent_iattx", FT_NONE, BASE_NONE, NULL,
4205
14
        0, NULL, HFILL }
4206
14
    },
4207
14
    { &hf_glusterfs_preop_iattx,
4208
14
      { "Pre-operation IATTX", "glusterfs.preop_iattx", FT_NONE, BASE_NONE, NULL,
4209
14
        0, NULL, HFILL }
4210
14
    },
4211
14
    { &hf_glusterfs_postop_iattx,
4212
14
      { "Post-operation IATTX", "glusterfs.postop_iattx", FT_NONE, BASE_NONE, NULL,
4213
14
        0, NULL, HFILL }
4214
14
    },
4215
14
    { &hf_glusterfs_iax_attributes,
4216
14
      { "IATT attributes", "glusterfs.iax_attributes", FT_UINT64,
4217
14
        BASE_HEX, NULL, 0, NULL, HFILL }
4218
14
    },
4219
14
    { &hf_glusterfs_iax_attributes_mask,
4220
14
      { "IATT attributes mask", "glusterfs.iax_attributes_mask", FT_UINT64,
4221
14
        BASE_HEX, NULL, 0, NULL, HFILL }
4222
14
    },
4223
14
    { &hf_glusterfs_iax_flags,
4224
14
      { "IATT flags", "glusterfs.iax_flags", FT_UINT64,
4225
14
        BASE_HEX, NULL, 0, NULL, HFILL }
4226
14
    },
4227
14
    { &hf_glusterfs_iax_atime,
4228
14
      { "Time of last access", "glusterfs.iax_atime",
4229
14
        FT_UINT64, BASE_DEC, NULL, 0,
4230
14
        NULL, HFILL }
4231
14
    },
4232
14
    { &hf_glusterfs_iax_mtime,
4233
14
      { "Time of last modification", "glusterfs.iax_mtime",
4234
14
        FT_UINT64, BASE_DEC, NULL, 0,
4235
14
        NULL, HFILL }
4236
14
    },
4237
14
    { &hf_glusterfs_iax_ctime,
4238
14
      { "Time of last status change", "glusterfs.iax_ctime",
4239
14
        FT_UINT64, BASE_DEC, NULL, 0,
4240
14
        NULL, HFILL }
4241
14
    },
4242
14
    { &hf_glusterfs_iax_btime,
4243
14
      { "Creation time", "glusterfs.iax_btime",
4244
14
        FT_UINT64, BASE_DEC, NULL, 0,
4245
14
        NULL, HFILL }
4246
14
    },
4247
14
    { &hf_glusterfs_iax_atime_nsec,
4248
14
      { "Time of last access(nsec)", "glusterfs.iax_atime_nsec",
4249
14
        FT_UINT64, BASE_DEC, NULL, 0,
4250
14
        NULL, HFILL }
4251
14
    },
4252
14
    { &hf_glusterfs_iax_mtime_nsec,
4253
14
      { "Time of last modification(nsec)", "glusterfs.iax_mtime_nsec",
4254
14
        FT_UINT64, BASE_DEC, NULL, 0,
4255
14
        NULL, HFILL }
4256
14
    },
4257
14
    { &hf_glusterfs_iax_ctime_nsec,
4258
14
      { "Time of last status change(nsec)", "glusterfs.iax_ctime_nsec",
4259
14
        FT_UINT64, BASE_DEC, NULL, 0,
4260
14
        NULL, HFILL }
4261
14
    },
4262
14
    { &hf_glusterfs_iax_btime_nsec,
4263
14
      { "Creation time(nsec)", "glusterfs.iax_btime_nsec",
4264
14
        FT_UINT64, BASE_DEC, NULL, 0,
4265
14
        NULL, HFILL }
4266
14
    },
4267
4268
    /* gf_flock */
4269
14
    { &hf_glusterfs_flock_type,
4270
14
      { "Type", "glusterfs.flock.type", FT_UINT32, BASE_DEC,
4271
14
        VALS(glusterfs_lk_type_names), 0, NULL, HFILL }
4272
14
    },
4273
14
    { &hf_glusterfs_flock_whence,
4274
14
      { "Whence", "glusterfs.flock.whence", FT_UINT32,
4275
14
        BASE_DEC, VALS(glusterfs_lk_whence), 0, NULL,
4276
14
        HFILL }
4277
14
    },
4278
14
    { &hf_glusterfs_flock_start,
4279
14
      { "Start", "glusterfs.flock.start", FT_UINT64,
4280
14
        BASE_DEC, NULL, 0, NULL, HFILL }
4281
14
    },
4282
14
    { &hf_glusterfs_flock_len,
4283
14
      { "Length", "glusterfs.flock.len", FT_UINT64, BASE_DEC,
4284
14
        NULL, 0, NULL, HFILL }
4285
14
    },
4286
14
    { &hf_glusterfs_flock_pid,
4287
14
      { "PID", "glusterfs.flock.pid", FT_INT32, BASE_DEC,
4288
14
        NULL, 0, NULL, HFILL }
4289
14
    },
4290
14
    { &hf_glusterfs_flock_owner,
4291
14
      { "Owner", "glusterfs.flock.owner", FT_BYTES,
4292
14
        BASE_NONE, NULL, 0, NULL, HFILL }
4293
14
    },
4294
4295
    /* statvfs descriptions from 'man 2 statvfs' on Linix */
4296
14
    { &hf_glusterfs_bsize,
4297
14
      { "File system block size", "glusterfs.statfs.bsize",
4298
14
        FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }
4299
14
    },
4300
14
    { &hf_glusterfs_frsize,
4301
14
      { "Fragment size", "glusterfs.statfs.frsize",
4302
14
        FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }
4303
14
    },
4304
14
    { &hf_glusterfs_blocks,
4305
14
      { "Size of fs in f_frsize units",
4306
14
        "glusterfs.statfs.blocks", FT_UINT64, BASE_DEC,
4307
14
        NULL, 0, NULL, HFILL }
4308
14
    },
4309
14
    { &hf_glusterfs_bfree,
4310
14
      { "# free blocks", "glusterfs.statfs.bfree", FT_UINT64,
4311
14
        BASE_DEC, NULL, 0, NULL, HFILL }
4312
14
    },
4313
14
    { &hf_glusterfs_bavail,
4314
14
      { "# free blocks for non-root",
4315
14
        "glusterfs.statfs.bavail", FT_UINT64, BASE_DEC,
4316
14
        NULL, 0, NULL, HFILL }
4317
14
    },
4318
14
    { &hf_glusterfs_files,
4319
14
      { "# inodes", "glusterfs.statfs.files", FT_UINT64,
4320
14
        BASE_DEC, NULL, 0, NULL, HFILL }
4321
14
    },
4322
14
    { &hf_glusterfs_ffree,
4323
14
      { "# free inodes", "glusterfs.statfs.ffree", FT_UINT64,
4324
14
        BASE_DEC, NULL, 0, NULL, HFILL }
4325
14
    },
4326
14
    { &hf_glusterfs_favail,
4327
14
      { "# free inodes for non-root",
4328
14
        "glusterfs.statfs.favail", FT_UINT64, BASE_DEC,
4329
14
        NULL, 0, NULL, HFILL }
4330
14
    },
4331
14
    { &hf_glusterfs_id,
4332
14
      { "File system ID", "glusterfs.statfs.fsid", FT_UINT64,
4333
14
        BASE_HEX, NULL, 0, NULL, HFILL }
4334
14
    },
4335
14
    { &hf_glusterfs_mnt_flags,
4336
14
      { "Mount flags", "glusterfs.statfs.flags", FT_UINT64,
4337
14
        BASE_HEX, NULL, 0, NULL, HFILL }
4338
14
    },
4339
    /* ST_* flags from /usr/include/bits/statvfs.h */
4340
14
    { &hf_glusterfs_mnt_flag_rdonly,
4341
14
      { "ST_RDONLY", "glusterfs.statfs.flag.rdonly",
4342
14
        FT_BOOLEAN, 64, TFS(&tfs_set_notset), 1, NULL,
4343
14
        HFILL }
4344
14
    },
4345
14
    { &hf_glusterfs_mnt_flag_nosuid,
4346
14
      { "ST_NOSUID", "glusterfs.statfs.flag.nosuid",
4347
14
        FT_BOOLEAN, 64, TFS(&tfs_set_notset), 2, NULL,
4348
14
        HFILL }
4349
14
    },
4350
14
    { &hf_glusterfs_mnt_flag_nodev,
4351
14
      { "ST_NODEV", "glusterfs.statfs.flag.nodev",
4352
14
        FT_BOOLEAN, 64, TFS(&tfs_set_notset), 4, NULL,
4353
14
        HFILL }
4354
14
    },
4355
14
    { &hf_glusterfs_mnt_flag_noexec,
4356
14
      { "ST_EXEC", "glusterfs.statfs.flag.noexec",
4357
14
        FT_BOOLEAN, 64, TFS(&tfs_set_notset), 8, NULL,
4358
14
        HFILL }
4359
14
    },
4360
14
    { &hf_glusterfs_mnt_flag_synchronous,
4361
14
      { "ST_SYNCHRONOUS",
4362
14
        "glusterfs.statfs.flag.synchronous",
4363
14
        FT_BOOLEAN, 64, TFS(&tfs_set_notset), 16, NULL,
4364
14
        HFILL }
4365
14
    },
4366
14
    { &hf_glusterfs_mnt_flag_mandlock,
4367
14
      { "ST_MANDLOCK", "glusterfs.statfs.flag.mandlock",
4368
14
        FT_BOOLEAN, 64, TFS(&tfs_set_notset), 64, NULL,
4369
14
        HFILL }
4370
14
    },
4371
14
    { &hf_glusterfs_mnt_flag_write,
4372
14
      { "ST_WRITE", "glusterfs.statfs.flag.write",
4373
14
        FT_BOOLEAN, 64, TFS(&tfs_set_notset), 128,
4374
14
        NULL, HFILL }
4375
14
    },
4376
14
    { &hf_glusterfs_mnt_flag_append,
4377
14
      { "ST_APPEND", "glusterfs.statfs.flag.append",
4378
14
        FT_BOOLEAN, 64, TFS(&tfs_set_notset), 256,
4379
14
        NULL, HFILL }
4380
14
    },
4381
14
    { &hf_glusterfs_mnt_flag_immutable,
4382
14
      { "ST_IMMUTABLE", "glusterfs.statfs.flag.immutable",
4383
14
        FT_BOOLEAN, 64, TFS(&tfs_set_notset), 512,
4384
14
        NULL, HFILL }
4385
14
    },
4386
14
    { &hf_glusterfs_mnt_flag_noatime,
4387
14
      { "ST_NOATIME", "glusterfs.statfs.flag.noatime",
4388
14
        FT_BOOLEAN, 64, TFS(&tfs_set_notset), 1024,
4389
14
        NULL, HFILL }
4390
14
    },
4391
14
    { &hf_glusterfs_mnt_flag_nodiratime,
4392
14
      { "ST_NODIRATIME", "glusterfs.statfs.flag.nodiratime",
4393
14
        FT_BOOLEAN, 64, TFS(&tfs_set_notset), 2048,
4394
14
        NULL, HFILL }
4395
14
    },
4396
14
    { &hf_glusterfs_mnt_flag_relatime,
4397
14
      { "ST_RELATIME", "glusterfs.statfs.flag.relatime",
4398
14
        FT_BOOLEAN, 64, TFS(&tfs_set_notset), 4096,
4399
14
        NULL, HFILL }
4400
14
    },
4401
14
    { &hf_glusterfs_namemax,
4402
14
      { "Maximum filename length",
4403
14
        "glusterfs.statfs.namemax", FT_UINT64,
4404
14
        BASE_DEC, NULL, 0, NULL, HFILL }
4405
14
    },
4406
14
    { &hf_glusterfs_setattr_valid,
4407
14
      { "Set attributes", "glusterfs.setattr.valid",
4408
14
        FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }
4409
14
    },
4410
    /* setattr.valid flags from libglusterfs/src/xlator.h */
4411
14
    { &hf_glusterfs_setattr_set_mode,
4412
14
      { "SET_ATTR_MODE", "glusterfs.setattr.set_mode",
4413
14
        FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001,
4414
14
        NULL, HFILL }
4415
14
    },
4416
14
    { &hf_glusterfs_setattr_set_uid,
4417
14
      { "SET_ATTR_UID", "glusterfs.setattr.set_uid",
4418
14
        FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002,
4419
14
        NULL, HFILL }
4420
14
    },
4421
14
    { &hf_glusterfs_setattr_set_gid,
4422
14
      { "SET_ATTR_GID", "glusterfs.setattr.set_gid",
4423
14
        FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000004,
4424
14
        NULL, HFILL }
4425
14
    },
4426
14
    { &hf_glusterfs_setattr_set_size,
4427
14
      { "SET_ATTR_SIZE", "glusterfs.setattr.set_size",
4428
14
        FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000008,
4429
14
        NULL, HFILL }
4430
14
    },
4431
14
    { &hf_glusterfs_setattr_set_atime,
4432
14
      { "SET_ATTR_ATIME", "glusterfs.setattr.set_atime",
4433
14
        FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000010,
4434
14
        NULL, HFILL }
4435
14
    },
4436
14
    { &hf_glusterfs_setattr_set_mtime,
4437
14
      { "SET_ATTR_MTIME", "glusterfs.setattr.set_mtime",
4438
14
        FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000020,
4439
14
        NULL, HFILL }
4440
14
    },
4441
14
    { &hf_glusterfs_setattr_set_reserved,
4442
14
      { "Reserved", "glusterfs.setattr.set_reserved",
4443
14
        FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0xffffffcf,
4444
14
        NULL, HFILL }
4445
14
    },
4446
14
    { &hf_glusterfs_xflags,
4447
14
      { "XFlags", "glusterfs.xflags", FT_UINT32, BASE_OCT,
4448
14
        NULL, 0, NULL, HFILL }
4449
14
    },
4450
14
    { &hf_glusterfs_oldbname,
4451
14
      { "OldBasename", "glusterfs.oldbname", FT_STRING, BASE_NONE,
4452
14
        NULL, 0, NULL, HFILL }
4453
14
    },
4454
14
    { &hf_glusterfs_newbname,
4455
14
      { "NewBasename", "glusterfs.newbname", FT_STRING, BASE_NONE,
4456
14
        NULL, 0, NULL, HFILL }
4457
14
    },
4458
14
    { &hf_glusterfs_name,
4459
14
      { "Name", "glusterfs.name", FT_STRING, BASE_NONE,
4460
14
        NULL, 0, NULL, HFILL }
4461
14
    },
4462
14
    { &hf_glusterfs_fsync_flags,
4463
14
      { "Flags", "glusterfs.fsync.flags", FT_UINT32, BASE_HEX,
4464
14
        NULL, 0, NULL, HFILL }
4465
14
    },
4466
14
    { &hf_glusterfs_fsync_flag_datasync,
4467
14
      { "DATASYNC", "glusterfs.fsync.datasync",
4468
14
        FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x1,
4469
14
        NULL, HFILL }
4470
14
    },
4471
14
    { &hf_glusterfs_fsync_flag_unknown,
4472
14
      { "Unknown", "glusterfs.fsync.unknown",
4473
14
        FT_BOOLEAN, 32, TFS(&tfs_set_notset), ~0x1,
4474
14
        NULL, HFILL }
4475
14
    },
4476
    /* For entry an fentry lk */
4477
14
    { &hf_glusterfs_entrylk_namelen,
4478
14
      { "File Descriptor", "glusterfs.entrylk.namelen", FT_UINT64, BASE_DEC,
4479
14
        NULL, 0, NULL, HFILL }
4480
14
    },
4481
14
    { &hf_gluster_dict_xdr_size,
4482
14
      { "XDR Size", "glusterfs.dict_xdr_size", FT_UINT32, BASE_DEC,
4483
14
        NULL, 0, NULL, HFILL }
4484
14
    },
4485
14
    { &hf_gluster_dict_size,
4486
14
      { "Size", "glusterfs.dict_size", FT_UINT32, BASE_DEC,
4487
14
        NULL, 0, NULL, HFILL }
4488
14
    },
4489
14
    { &hf_gluster_num_dict_items,
4490
14
      { "Items", "glusterfs.num_dict_items", FT_UINT32, BASE_DEC,
4491
14
        NULL, 0, NULL, HFILL }
4492
14
    },
4493
14
    { &hf_gluster_rpc_roundup_bytes,
4494
14
      { "RPC-roundup bytes", "glusterfs.rpc_roundup_bytes", FT_BYTES, BASE_NONE,
4495
14
        NULL, 0, NULL, HFILL }
4496
14
    },
4497
14
    { &hf_gluster_trusted_afr_key,
4498
14
      { "Key", "glusterfs.trusted_afr_key", FT_BYTES, BASE_NONE,
4499
14
        NULL, 0, NULL, HFILL }
4500
14
    },
4501
14
    { &hf_gluster_dict_value,
4502
14
      { "Value", "glusterfs.dict_value", FT_STRING, BASE_NONE,
4503
14
        NULL, 0, NULL, HFILL }
4504
14
    },
4505
14
  };
4506
4507
  /* Setup protocol subtree array */
4508
14
  static int *ett[] = {
4509
14
    &ett_glusterfs,
4510
14
    &ett_glusterfs_flags,
4511
14
    &ett_glusterfs_mnt_flags,
4512
14
    &ett_glusterfs_mode,
4513
14
    &ett_glusterfs_entry,
4514
14
    &ett_glusterfs_setattr_valid,
4515
14
    &ett_glusterfs_parent_iatt,
4516
14
    &ett_glusterfs_iatt,
4517
14
    &ett_glusterfs_flock,
4518
14
    &ett_glusterfs_fsync_flags,
4519
14
    &ett_gluster_dict,
4520
14
    &ett_gluster_dict_items
4521
14
  };
4522
4523
  /* Register the protocol name and description */
4524
14
  proto_glusterfs = proto_register_protocol("GlusterFS", "GlusterFS",
4525
14
                "glusterfs");
4526
14
  proto_register_subtree_array(ett, array_length(ett));
4527
14
  proto_register_field_array(proto_glusterfs, hf, array_length(hf));
4528
14
}
4529
4530
void
4531
proto_reg_handoff_glusterfs(void)
4532
14
{
4533
14
  rpc_init_prog(proto_glusterfs, GLUSTER3_1_FOP_PROGRAM, ett_glusterfs,
4534
14
      G_N_ELEMENTS(glusterfs_vers_info), glusterfs_vers_info);
4535
14
}
4536
4537
/*
4538
 * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
4539
 *
4540
 * Local variables:
4541
 * c-basic-offset: 8
4542
 * tab-width: 8
4543
 * indent-tabs-mode: t
4544
 * End:
4545
 *
4546
 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
4547
 * :indentSize=8:tabSize=8:noTabs=false:
4548
 */