Coverage Report

Created: 2026-01-02 06:13

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/wireshark/epan/dissectors/packet-gluster_cli.c
Line
Count
Source
1
/* packet-gluster_cli.c
2
 * Routines for Gluster CLI 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
 * - http://git.gluster.com/?p=glusterfs.git
16
 * - https://github.com/gluster/glusterfs
17
 *
18
 * The coding-style is roughly the same as the one use in the Linux kernel,
19
 * see http://www.kernel.org/doc/Documentation/CodingStyle.
20
 */
21
22
#include "config.h"
23
24
#include <epan/packet.h>
25
26
#include "packet-rpc.h"
27
#include "packet-gluster.h"
28
29
void proto_register_gluster_cli(void);
30
void proto_reg_handoff_gluster_cli(void);
31
32
/* Initialize the protocol and registered fields */
33
static int proto_gluster_cli;
34
35
/* programs and procedures */
36
static int hf_gluster_cli_proc;
37
static int hf_gluster_cli_2_proc;
38
static int hf_gluster_dict;
39
static int hf_gluster_path;
40
static int hf_gluster_lazy;
41
static int hf_gluster_label;
42
static int hf_gluster_unused;
43
static int hf_gluster_wd;
44
static int hf_gluster_op_errstr;
45
static int hf_gluster_hostname;
46
static int hf_gluster_port;
47
static int hf_gluster_flags;
48
49
/* Initialize the subtree pointers */
50
static int ett_gluster_cli;
51
52
/* CLI Operations */
53
static int
54
gluster_cli_2_common_call(tvbuff_t *tvb,
55
        packet_info *pinfo, proto_tree *tree, void* data _U_)
56
0
{
57
0
  return gluster_rpc_dissect_dict(tree, pinfo, tvb, hf_gluster_dict, 0);
58
0
}
59
60
static int
61
gluster_cli_2_common_reply(tvbuff_t *tvb, packet_info *pinfo,
62
              proto_tree *tree, void* data)
63
0
{
64
0
  int offset = 0;
65
66
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
67
0
  offset = dissect_rpc_string(tvb, pinfo, tree, hf_gluster_op_errstr, offset,
68
0
                NULL);
69
0
  offset = gluster_rpc_dissect_dict(tree, pinfo, tvb, hf_gluster_dict, offset);
70
71
0
  return offset;
72
0
}
73
74
static int
75
gluster_cli_2_probe_reply(tvbuff_t *tvb, packet_info *pinfo,
76
              proto_tree *tree, void* data)
77
0
{
78
0
  int offset = 0;
79
80
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
81
0
  offset = dissect_rpc_uint32(tvb, tree, hf_gluster_port, offset);
82
0
  offset = dissect_rpc_string(tvb, pinfo, tree, hf_gluster_hostname, offset,
83
0
                NULL);
84
0
  offset = dissect_rpc_string(tvb, pinfo, tree, hf_gluster_op_errstr, offset,
85
0
                NULL);
86
87
0
  return offset;
88
0
}
89
90
static int
91
gluster_cli_2_probe_call(tvbuff_t *tvb,
92
        packet_info *pinfo, proto_tree *tree, void* data _U_)
93
0
{
94
0
  int offset = 0;
95
96
0
  offset = dissect_rpc_string(tvb, pinfo, tree, hf_gluster_hostname, offset,
97
0
                NULL);
98
0
  offset = dissect_rpc_uint32(tvb, tree, hf_gluster_port, offset);
99
100
0
  return offset;
101
0
}
102
103
static int
104
gluster_cli_2_deprobe_reply(tvbuff_t *tvb, packet_info *pinfo,
105
              proto_tree *tree, void* data)
106
0
{
107
0
  int offset = 0;
108
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
109
0
  offset = dissect_rpc_string(tvb, pinfo, tree, hf_gluster_hostname, offset,
110
0
                NULL);
111
112
0
  return offset;
113
0
}
114
115
static int
116
gluster_cli_2_deprobe_call(tvbuff_t *tvb,
117
        packet_info *pinfo, proto_tree *tree, void* data _U_)
118
0
{
119
0
  int offset = 0;
120
0
  offset = dissect_rpc_string(tvb, pinfo, tree, hf_gluster_hostname, offset,
121
0
                NULL);
122
0
  offset = dissect_rpc_uint32(tvb, tree, hf_gluster_port, offset);
123
0
  offset = dissect_rpc_uint32(tvb, tree, hf_gluster_flags, offset);
124
125
0
  return offset;
126
0
}
127
128
static int
129
gluster_cli_2_fsm_log_call(tvbuff_t *tvb,
130
        packet_info *pinfo, proto_tree *tree, void* data _U_)
131
0
{
132
0
  return dissect_rpc_string(tvb, pinfo, tree, hf_gluster_wd, 0, NULL);
133
0
}
134
135
static int
136
gluster_cli_2_getwd_reply(tvbuff_t *tvb, packet_info *pinfo,
137
              proto_tree *tree, void* data)
138
0
{
139
0
  int offset = 0;
140
141
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
142
0
  offset = dissect_rpc_string(tvb, pinfo, tree, hf_gluster_wd, offset, NULL);
143
144
0
  return offset;
145
0
}
146
147
static int
148
gluster_cli_2_getwd_call(tvbuff_t *tvb,
149
        packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
150
0
{
151
0
  return dissect_rpc_uint32(tvb, tree, hf_gluster_unused, 0);
152
0
}
153
154
static int
155
gluster_cli_2_mount_call(tvbuff_t *tvb,
156
        packet_info *pinfo, proto_tree *tree, void* data _U_)
157
0
{
158
0
  int offset = 0;
159
160
0
  offset = dissect_rpc_string(tvb, pinfo, tree, hf_gluster_label, offset,
161
0
                NULL);
162
0
  offset = gluster_rpc_dissect_dict(tree, pinfo, tvb, hf_gluster_dict, offset);
163
164
0
  return offset;
165
0
}
166
167
static int
168
gluster_cli_2_mount_reply(tvbuff_t *tvb, packet_info *pinfo,
169
              proto_tree *tree, void* data)
170
0
{
171
0
  int offset = 0;
172
173
0
  offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
174
0
  offset = dissect_rpc_string(tvb, pinfo, tree, hf_gluster_path, offset, NULL);
175
176
0
  return offset;
177
0
}
178
179
static int
180
gluster_cli_2_umount_call(tvbuff_t *tvb,
181
        packet_info *pinfo, proto_tree *tree, void* data _U_)
182
0
{
183
0
  int offset = 0;
184
185
0
  offset = dissect_rpc_uint32(tvb, tree, hf_gluster_lazy, offset);
186
0
  offset = dissect_rpc_string(tvb, pinfo, tree, hf_gluster_path, offset, NULL);
187
188
0
  return offset;
189
0
}
190
191
static int
192
gluster_cli_dissect_common_reply(tvbuff_t *tvb,
193
        packet_info *pinfo, proto_tree *tree, void* data)
194
0
{
195
0
  return gluster_dissect_common_reply(tvb, 0, pinfo, tree, data);
196
0
}
197
198
/* procedures for GLUSTER_CLI_PROGRAM */
199
static const vsff gluster_cli_proc[] = {
200
  { GLUSTER_CLI_NULL,             "NULL",             dissect_rpc_void, dissect_rpc_void },
201
  { GLUSTER_CLI_PROBE,            "PROBE",            dissect_rpc_unknown, dissect_rpc_unknown },
202
  { GLUSTER_CLI_DEPROBE,          "DEPROBE",          dissect_rpc_unknown, dissect_rpc_unknown },
203
  { GLUSTER_CLI_LIST_FRIENDS,     "LIST_FRIENDS",     dissect_rpc_unknown, dissect_rpc_unknown },
204
  { GLUSTER_CLI_CREATE_VOLUME,    "CREATE_VOLUME",    dissect_rpc_unknown, dissect_rpc_unknown },
205
  { GLUSTER_CLI_GET_VOLUME,       "GET_VOLUME",       dissect_rpc_unknown, dissect_rpc_unknown },
206
  { GLUSTER_CLI_GET_NEXT_VOLUME,  "GET_NEXT_VOLUME",  dissect_rpc_unknown, dissect_rpc_unknown },
207
  { GLUSTER_CLI_DELETE_VOLUME,    "DELETE_VOLUME",    dissect_rpc_unknown, dissect_rpc_unknown },
208
  { GLUSTER_CLI_START_VOLUME,     "START_VOLUME",     dissect_rpc_unknown, dissect_rpc_unknown },
209
  { GLUSTER_CLI_STOP_VOLUME,      "STOP_VOLUME",      dissect_rpc_unknown, dissect_rpc_unknown },
210
  { GLUSTER_CLI_RENAME_VOLUME,    "RENAME_VOLUME",    dissect_rpc_unknown, dissect_rpc_unknown },
211
  { GLUSTER_CLI_DEFRAG_VOLUME,    "DEFRAG_VOLUME",    dissect_rpc_unknown, dissect_rpc_unknown },
212
  { GLUSTER_CLI_SET_VOLUME,       "SET_VOLUME",       dissect_rpc_unknown, dissect_rpc_unknown },
213
  { GLUSTER_CLI_ADD_BRICK,        "ADD_BRICK",        dissect_rpc_unknown, dissect_rpc_unknown },
214
  { GLUSTER_CLI_REMOVE_BRICK,     "REMOVE_BRICK",     dissect_rpc_unknown, dissect_rpc_unknown },
215
  { GLUSTER_CLI_REPLACE_BRICK,    "REPLACE_BRICK",    dissect_rpc_unknown, dissect_rpc_unknown },
216
  { GLUSTER_CLI_LOG_FILENAME,     "LOG_FILENAME",     dissect_rpc_unknown, dissect_rpc_unknown },
217
  { GLUSTER_CLI_LOG_LOCATE,       "LOG_LOCATE",       dissect_rpc_unknown, dissect_rpc_unknown },
218
  { GLUSTER_CLI_LOG_ROTATE,       "LOG_ROTATE",       dissect_rpc_unknown, dissect_rpc_unknown },
219
  { GLUSTER_CLI_GETSPEC,          "GETSPEC",          dissect_rpc_unknown, dissect_rpc_unknown },
220
  { GLUSTER_CLI_PMAP_PORTBYBRICK, "PMAP_PORTBYBRICK", dissect_rpc_unknown, dissect_rpc_unknown },
221
  { GLUSTER_CLI_SYNC_VOLUME,      "SYNC_VOLUME",      dissect_rpc_unknown, dissect_rpc_unknown },
222
  { GLUSTER_CLI_RESET_VOLUME,     "RESET_VOLUME",     dissect_rpc_unknown, dissect_rpc_unknown },
223
  { GLUSTER_CLI_FSM_LOG,          "FSM_LOG",          dissect_rpc_unknown, dissect_rpc_unknown },
224
  { GLUSTER_CLI_GSYNC_SET,        "GSYNC_SET",        dissect_rpc_unknown, dissect_rpc_unknown },
225
  { GLUSTER_CLI_PROFILE_VOLUME,   "PROFILE_VOLUME",   dissect_rpc_unknown, dissect_rpc_unknown },
226
  { GLUSTER_CLI_QUOTA,            "QUOTA",            dissect_rpc_unknown, dissect_rpc_unknown },
227
  { GLUSTER_CLI_TOP_VOLUME,       "TOP_VOLUME",       dissect_rpc_unknown, dissect_rpc_unknown },
228
  { GLUSTER_CLI_GETWD,            "GETWD",            dissect_rpc_unknown, dissect_rpc_unknown },
229
  { GLUSTER_CLI_LOG_LEVEL,        "LOG_LEVEL",        dissect_rpc_unknown, dissect_rpc_unknown },
230
  { GLUSTER_CLI_STATUS_VOLUME,    "STATUS_VOLUME",    dissect_rpc_unknown, dissect_rpc_unknown },
231
  { GLUSTER_CLI_MOUNT,            "MOUNT",            dissect_rpc_unknown, dissect_rpc_unknown },
232
  { GLUSTER_CLI_UMOUNT,           "UMOUNT",           dissect_rpc_unknown, dissect_rpc_unknown },
233
  { GLUSTER_CLI_HEAL_VOLUME,      "HEAL_VOLUME",      dissect_rpc_unknown, dissect_rpc_unknown },
234
  { GLUSTER_CLI_STATEDUMP_VOLUME, "STATEDUMP_VOLUME", dissect_rpc_unknown, dissect_rpc_unknown },
235
  { 0, NULL, NULL, NULL }
236
};
237
238
/* procedures for GLUSTER_CLI_PROGRAM  version 2*/
239
static const vsff gluster_cli_2_proc[] = {
240
  {
241
    GLUSTER_CLI_2_NULL, "NULL",
242
    gluster_cli_2_common_call, gluster_cli_2_common_reply
243
  },
244
  {
245
    GLUSTER_CLI_2_PROBE, "PROBE",
246
    gluster_cli_2_probe_call, gluster_cli_2_probe_reply
247
  },
248
  {
249
    GLUSTER_CLI_2_DEPROBE, "DEPROBE",
250
    gluster_cli_2_deprobe_call, gluster_cli_2_deprobe_reply
251
  },
252
  {
253
    GLUSTER_CLI_2_LIST_FRIENDS, "LIST_FRIENDS",
254
    gluster_cli_2_common_call, gluster_cli_2_common_reply
255
  },
256
  {
257
    GLUSTER_CLI_2_CREATE_VOLUME, "CREATE_VOLUME",
258
    gluster_cli_2_common_call, gluster_cli_2_common_reply
259
  },
260
  {
261
    GLUSTER_CLI_2_GET_VOLUME, "GET_VOLUME",
262
    gluster_cli_2_common_call, gluster_cli_2_common_reply
263
  },
264
  {
265
    GLUSTER_CLI_2_GET_NEXT_VOLUME, "GET_NEXT_VOLUME",
266
    gluster_cli_2_common_call, gluster_cli_2_common_reply
267
  },
268
  {
269
    GLUSTER_CLI_2_DELETE_VOLUME, "DELETE_VOLUME",
270
    gluster_cli_2_common_call, gluster_cli_2_common_reply
271
  },
272
  {
273
    GLUSTER_CLI_2_START_VOLUME, "START_VOLUME",
274
    gluster_cli_2_common_call, gluster_cli_2_common_reply
275
  },
276
  {
277
    GLUSTER_CLI_2_STOP_VOLUME, "STOP_VOLUME",
278
    gluster_cli_2_common_call, gluster_cli_2_common_reply
279
  },
280
  {
281
    GLUSTER_CLI_2_RENAME_VOLUME, "RENAME_VOLUME",
282
    gluster_cli_2_common_call, gluster_cli_2_common_reply
283
  },
284
  {
285
    GLUSTER_CLI_2_DEFRAG_VOLUME, "DEFRAG_VOLUME" ,
286
    gluster_cli_2_common_call, gluster_cli_2_common_reply
287
  },
288
  {
289
    GLUSTER_CLI_2_SET_VOLUME, "SET_VOLUME",
290
    gluster_cli_2_common_call, gluster_cli_2_common_reply
291
  },
292
  {
293
    GLUSTER_CLI_2_ADD_BRICK, "ADD_BRICK",
294
    gluster_cli_2_common_call, gluster_cli_2_common_reply
295
  },
296
  {
297
    GLUSTER_CLI_2_REMOVE_BRICK, "REMOVE_BRICK",
298
    gluster_cli_2_common_call, gluster_cli_2_common_reply
299
  },
300
  {
301
    GLUSTER_CLI_2_REPLACE_BRICK, "REPLACE_BRICK",
302
    gluster_cli_2_common_call, gluster_cli_2_common_reply
303
  },
304
  {
305
    GLUSTER_CLI_2_LOG_ROTATE, "LOG_ROTATE",
306
    gluster_cli_2_common_call, gluster_cli_2_common_reply
307
  },
308
  {
309
    GLUSTER_CLI_2_GETSPEC, "GETSPEC",
310
    gluster_cli_2_common_call, gluster_cli_2_common_reply
311
  },
312
  {
313
    GLUSTER_CLI_2_PMAP_PORTBYBRICK, "PMAP_PORTBYBRICK",
314
    gluster_cli_2_common_call, gluster_cli_2_common_reply
315
  },
316
  {
317
    GLUSTER_CLI_2_SYNC_VOLUME, "SYNC_VOLUME",
318
    gluster_cli_2_common_call, gluster_cli_2_common_reply
319
  },
320
  {
321
    GLUSTER_CLI_2_RESET_VOLUME, "RESET_VOLUME",
322
    gluster_cli_2_common_call, gluster_cli_2_common_reply
323
  },
324
  {
325
    GLUSTER_CLI_2_FSM_LOG, "FSM_LOG",
326
    gluster_cli_2_fsm_log_call, gluster_cli_2_common_reply
327
  },
328
  {
329
    GLUSTER_CLI_2_GSYNC_SET, "GSYNC_SET",
330
    gluster_cli_2_common_call, gluster_cli_2_common_reply
331
  },
332
  {
333
    GLUSTER_CLI_2_PROFILE_VOLUME, "PROFILE_VOLUME",
334
    gluster_cli_2_common_call, gluster_cli_2_common_reply
335
  },
336
  {
337
    GLUSTER_CLI_2_QUOTA, "QUOTA",
338
    gluster_cli_2_common_call, gluster_cli_2_common_reply
339
  },
340
  {
341
    GLUSTER_CLI_2_TOP_VOLUME, "TOP_VOLUME",
342
    gluster_cli_2_common_call, gluster_cli_2_common_reply
343
  },
344
  {
345
    GLUSTER_CLI_2_GETWD, "GETWD",
346
    gluster_cli_2_getwd_call, gluster_cli_2_getwd_reply
347
  },
348
  {
349
    GLUSTER_CLI_2_STATUS_VOLUME, "STATUS_VOLUME",
350
    gluster_cli_2_common_call, gluster_cli_2_common_reply
351
  },
352
  {
353
    GLUSTER_CLI_2_STATUS_ALL, "STATUS_ALL",
354
    gluster_cli_2_common_call, gluster_cli_2_common_reply
355
  },
356
  {
357
    GLUSTER_CLI_2_MOUNT, "MOUNT",
358
    gluster_cli_2_mount_call, gluster_cli_2_mount_reply
359
  },
360
  {
361
    GLUSTER_CLI_2_UMOUNT, "UMOUNT",
362
    gluster_cli_2_umount_call, gluster_cli_dissect_common_reply
363
  },
364
  {
365
    GLUSTER_CLI_2_HEAL_VOLUME, "HEAL_VOLUME",
366
    gluster_cli_2_common_call, gluster_cli_2_common_reply
367
  },
368
  {
369
    GLUSTER_CLI_2_STATEDUMP_VOLUME, "STATEDUMP_VOLUME",
370
    gluster_cli_2_common_call, gluster_cli_2_common_reply
371
  },
372
  {
373
    GLUSTER_CLI_2_LIST_VOLUME, "LIST_VOLUME",
374
    gluster_cli_2_common_call, gluster_cli_2_common_reply
375
  },
376
  {
377
    GLUSTER_CLI_2_CLRLOCKS_VOLUME, "CLRLOCKS_VOLUME",
378
    gluster_cli_2_common_call, gluster_cli_2_common_reply
379
  },
380
  { 0, NULL , NULL, NULL}
381
};
382
383
384
static const rpc_prog_vers_info gluster_cli_vers_info[] = {
385
  { 1, gluster_cli_proc, &hf_gluster_cli_proc },
386
  { 2, gluster_cli_2_proc, &hf_gluster_cli_2_proc }
387
};
388
389
390
static const value_string gluster_cli_proc_vals[] = {
391
  { GLUSTER_CLI_NULL,             "NULL" },
392
  { GLUSTER_CLI_PROBE,            "PROBE" },
393
  { GLUSTER_CLI_DEPROBE,          "DEPROBE" },
394
  { GLUSTER_CLI_LIST_FRIENDS,     "LIST_FRIENDS" },
395
  { GLUSTER_CLI_CREATE_VOLUME,    "CREATE_VOLUME" },
396
  { GLUSTER_CLI_GET_VOLUME,       "GET_VOLUME" },
397
  { GLUSTER_CLI_GET_NEXT_VOLUME,  "GET_NEXT_VOLUME" },
398
  { GLUSTER_CLI_DELETE_VOLUME,    "DELETE_VOLUME" },
399
  { GLUSTER_CLI_START_VOLUME,     "START_VOLUME" },
400
  { GLUSTER_CLI_STOP_VOLUME,      "STOP_VOLUME" },
401
  { GLUSTER_CLI_RENAME_VOLUME,    "RENAME_VOLUME" },
402
  { GLUSTER_CLI_DEFRAG_VOLUME,    "DEFRAG_VOLUME" },
403
  { GLUSTER_CLI_SET_VOLUME,       "SET_VOLUME" },
404
  { GLUSTER_CLI_ADD_BRICK,        "ADD_BRICK" },
405
  { GLUSTER_CLI_REMOVE_BRICK,     "REMOVE_BRICK" },
406
  { GLUSTER_CLI_REPLACE_BRICK,    "REPLACE_BRICK" },
407
  { GLUSTER_CLI_LOG_FILENAME,     "LOG_FILENAME" },
408
  { GLUSTER_CLI_LOG_LOCATE,       "LOG_LOCATE" },
409
  { GLUSTER_CLI_LOG_ROTATE,       "LOG_ROTATE" },
410
  { GLUSTER_CLI_GETSPEC,          "GETSPEC" },
411
  { GLUSTER_CLI_PMAP_PORTBYBRICK, "PMAP_PORTBYBRICK" },
412
  { GLUSTER_CLI_SYNC_VOLUME,      "SYNC_VOLUME" },
413
  { GLUSTER_CLI_RESET_VOLUME,     "RESET_VOLUME" },
414
  { GLUSTER_CLI_FSM_LOG,          "FSM_LOG" },
415
  { GLUSTER_CLI_GSYNC_SET,        "GSYNC_SET" },
416
  { GLUSTER_CLI_PROFILE_VOLUME,   "PROFILE_VOLUME" },
417
  { GLUSTER_CLI_QUOTA,            "QUOTA" },
418
  { GLUSTER_CLI_TOP_VOLUME,       "TOP_VOLUME" },
419
  { GLUSTER_CLI_GETWD,            "GETWD" },
420
  { GLUSTER_CLI_LOG_LEVEL,        "LOG_LEVEL" },
421
  { GLUSTER_CLI_STATUS_VOLUME,    "STATUS_VOLUME" },
422
  { GLUSTER_CLI_MOUNT,            "MOUNT" },
423
  { GLUSTER_CLI_UMOUNT,           "UMOUNT" },
424
  { GLUSTER_CLI_HEAL_VOLUME,      "HEAL_VOLUME" },
425
  { GLUSTER_CLI_STATEDUMP_VOLUME, "STATEDUMP_VOLUME" },
426
  { 0, NULL }
427
};
428
static value_string_ext gluster_cli_proc_vals_ext = VALUE_STRING_EXT_INIT(gluster_cli_proc_vals);
429
430
static const value_string gluster_cli_2_proc_vals[] = {
431
  { GLUSTER_CLI_2_NULL,             "NULL" },
432
  { GLUSTER_CLI_2_PROBE,            "PROBE" },
433
  { GLUSTER_CLI_2_DEPROBE,          "DEPROBE" },
434
  { GLUSTER_CLI_2_LIST_FRIENDS,     "LIST_FRIENDS" },
435
  { GLUSTER_CLI_2_CREATE_VOLUME,    "CREATE_VOLUME" },
436
  { GLUSTER_CLI_2_GET_VOLUME,       "GET_VOLUME" },
437
  { GLUSTER_CLI_2_GET_NEXT_VOLUME,  "GET_NEXT_VOLUME" },
438
  { GLUSTER_CLI_2_DELETE_VOLUME,    "DELETE_VOLUME" },
439
  { GLUSTER_CLI_2_START_VOLUME,     "START_VOLUME" },
440
  { GLUSTER_CLI_2_STOP_VOLUME,      "STOP_VOLUME" },
441
  { GLUSTER_CLI_2_RENAME_VOLUME,    "RENAME_VOLUME" },
442
  { GLUSTER_CLI_2_DEFRAG_VOLUME,    "DEFRAG_VOLUME" },
443
  { GLUSTER_CLI_2_SET_VOLUME,       "SET_VOLUME" },
444
  { GLUSTER_CLI_2_ADD_BRICK,        "ADD_BRICK" },
445
  { GLUSTER_CLI_2_REMOVE_BRICK,     "REMOVE_BRICK" },
446
  { GLUSTER_CLI_2_REPLACE_BRICK,    "REPLACE_BRICK" },
447
  { GLUSTER_CLI_2_LOG_ROTATE,       "LOG_ROTATE" },
448
  { GLUSTER_CLI_2_GETSPEC,          "GETSPEC" },
449
  { GLUSTER_CLI_2_PMAP_PORTBYBRICK, "PMAP_PORTBYBRICK" },
450
  { GLUSTER_CLI_2_SYNC_VOLUME,      "SYNC_VOLUME" },
451
  { GLUSTER_CLI_2_RESET_VOLUME,     "RESET_VOLUME" },
452
  { GLUSTER_CLI_2_FSM_LOG,          "FSM_LOG" },
453
  { GLUSTER_CLI_2_GSYNC_SET,        "GSYNC_SET" },
454
  { GLUSTER_CLI_2_PROFILE_VOLUME,   "PROFILE_VOLUME" },
455
  { GLUSTER_CLI_2_QUOTA,            "QUOTA" },
456
  { GLUSTER_CLI_2_TOP_VOLUME,       "TOP_VOLUME" },
457
  { GLUSTER_CLI_2_GETWD,            "GETWD" },
458
  { GLUSTER_CLI_2_STATUS_VOLUME,    "STATUS_VOLUME" },
459
  { GLUSTER_CLI_2_STATUS_ALL,       "STATUS_ALL" },
460
  { GLUSTER_CLI_2_MOUNT,            "MOUNT" },
461
  { GLUSTER_CLI_2_UMOUNT,           "UMOUNT" },
462
  { GLUSTER_CLI_2_HEAL_VOLUME,      "HEAL_VOLUME" },
463
  { GLUSTER_CLI_2_STATEDUMP_VOLUME, "STATEDUMP_VOLUME" },
464
  { GLUSTER_CLI_2_LIST_VOLUME,      "LIST_VOLUME"},
465
  { GLUSTER_CLI_2_CLRLOCKS_VOLUME,  "CLRLOCKS_VOLUME" },
466
  { 0, NULL }
467
};
468
static value_string_ext gluster_cli_2_proc_vals_ext = VALUE_STRING_EXT_INIT(gluster_cli_2_proc_vals);
469
470
void
471
proto_register_gluster_cli(void)
472
14
{
473
  /* Setup list of header fields  See Section 1.6.1 for details */
474
14
  static hf_register_info hf[] = {
475
    /* programs */
476
14
    { &hf_gluster_cli_proc,
477
14
      { "Gluster CLI", "gluster.cli.proc", FT_UINT32,
478
14
        BASE_DEC | BASE_EXT_STRING, &gluster_cli_proc_vals_ext, 0, NULL,
479
14
        HFILL }
480
14
    },
481
14
    { &hf_gluster_cli_2_proc,
482
14
      { "Gluster CLI", "gluster.cli.proc", FT_UINT32,
483
14
        BASE_DEC | BASE_EXT_STRING, &gluster_cli_2_proc_vals_ext, 0,
484
14
        NULL, HFILL }
485
14
    },
486
14
    { &hf_gluster_dict,
487
14
      { "Dict", "gluster.dict", FT_STRING, BASE_NONE, NULL,
488
14
        0, NULL, HFILL }
489
14
    },
490
14
    { &hf_gluster_path,
491
14
      { "Path", "gluster.path", FT_STRING, BASE_NONE, NULL,
492
14
        0, NULL, HFILL }
493
14
    },
494
14
    { &hf_gluster_lazy,
495
14
      { "Lazy", "gluster.lazy", FT_UINT32, BASE_HEX, NULL,
496
14
        0, NULL, HFILL }
497
14
    },
498
14
    { &hf_gluster_label,
499
14
      { "Label", "gluster.label", FT_STRING, BASE_NONE, NULL,
500
14
        0, NULL, HFILL }
501
14
    },
502
14
    { &hf_gluster_unused,
503
14
      { "Unused", "gluster.unused", FT_UINT32, BASE_HEX,
504
14
        NULL, 0, NULL, HFILL }
505
14
    },
506
14
    { &hf_gluster_wd,
507
14
      { "Path", "gluster.wd", FT_STRING, BASE_NONE, NULL, 0,
508
14
        NULL, HFILL }
509
14
    },
510
14
    { &hf_gluster_op_errstr,
511
14
      { "Error", "gluster.op_errstr", FT_STRING, BASE_NONE,
512
14
        NULL, 0, NULL, HFILL }
513
14
    },
514
14
    { &hf_gluster_hostname,
515
14
      { "Hostname", "gluster.hostname", FT_STRING, BASE_NONE,
516
14
        NULL, 0, NULL, HFILL }
517
14
    },
518
14
    { &hf_gluster_port,
519
14
      { "Port", "gluster.port", FT_UINT32, BASE_DEC, NULL, 0,
520
14
        NULL, HFILL }
521
14
    },
522
14
    { &hf_gluster_flags,
523
14
      { "Flags", "gluster.flag", FT_UINT32, BASE_HEX, NULL,
524
14
        0, NULL, HFILL }
525
14
    }
526
14
  };
527
528
  /* Setup protocol subtree array */
529
14
  static int *ett[] = {
530
14
    &ett_gluster_cli
531
14
  };
532
533
  /* Register the protocol name and description */
534
14
  proto_gluster_cli = proto_register_protocol("Gluster CLI", "Gluster CLI", "gluster.cli");
535
14
  proto_register_subtree_array(ett, array_length(ett));
536
14
  proto_register_field_array(proto_gluster_cli, hf, array_length(hf));
537
14
}
538
539
void
540
proto_reg_handoff_gluster_cli(void)
541
14
{
542
14
  rpc_init_prog(proto_gluster_cli, GLUSTER_CLI_PROGRAM, ett_gluster_cli,
543
      G_N_ELEMENTS(gluster_cli_vers_info), gluster_cli_vers_info);
544
14
}
545
546
/*
547
 * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
548
 *
549
 * Local variables:
550
 * c-basic-offset: 8
551
 * tab-width: 8
552
 * indent-tabs-mode: t
553
 * End:
554
 *
555
 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
556
 * :indentSize=8:tabSize=8:noTabs=false:
557
 */