Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-gluster_cli.c
blobe70d4bce5cfa8714705bbdf28c5a13a7925f9f30
1 /* packet-gluster_cli.c
2 * Routines for Gluster CLI dissection
3 * Copyright 2012, Niels de Vos <ndevos@redhat.com>
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
12 * References to source files point in general to the glusterfs sources.
13 * There is currently no RFC or other document where the protocol is
14 * completely described. The glusterfs sources can be found at:
15 * - http://git.gluster.com/?p=glusterfs.git
16 * - https://github.com/gluster/glusterfs
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.
22 #include "config.h"
24 #include <epan/packet.h>
26 #include "packet-rpc.h"
27 #include "packet-gluster.h"
29 void proto_register_gluster_cli(void);
30 void proto_reg_handoff_gluster_cli(void);
32 /* Initialize the protocol and registered fields */
33 static int proto_gluster_cli;
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;
49 /* Initialize the subtree pointers */
50 static int ett_gluster_cli;
52 /* CLI Operations */
53 static int
54 gluster_cli_2_common_call(tvbuff_t *tvb,
55 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
57 return gluster_rpc_dissect_dict(tree, tvb, hf_gluster_dict, 0);
60 static int
61 gluster_cli_2_common_reply(tvbuff_t *tvb, packet_info *pinfo,
62 proto_tree *tree, void* data)
64 int offset = 0;
66 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
67 offset = dissect_rpc_string(tvb, tree, hf_gluster_op_errstr, offset,
68 NULL);
69 offset = gluster_rpc_dissect_dict(tree, tvb, hf_gluster_dict, offset);
71 return offset;
74 static int
75 gluster_cli_2_probe_reply(tvbuff_t *tvb, packet_info *pinfo,
76 proto_tree *tree, void* data)
78 int offset = 0;
80 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
81 offset = dissect_rpc_uint32(tvb, tree, hf_gluster_port, offset);
82 offset = dissect_rpc_string(tvb, tree, hf_gluster_hostname, offset,
83 NULL);
84 offset = dissect_rpc_string(tvb, tree, hf_gluster_op_errstr, offset,
85 NULL);
87 return offset;
90 static int
91 gluster_cli_2_probe_call(tvbuff_t *tvb,
92 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
94 int offset = 0;
96 offset = dissect_rpc_string(tvb, tree, hf_gluster_hostname, offset,
97 NULL);
98 offset = dissect_rpc_uint32(tvb, tree, hf_gluster_port, offset);
100 return offset;
103 static int
104 gluster_cli_2_deprobe_reply(tvbuff_t *tvb, packet_info *pinfo,
105 proto_tree *tree, void* data)
107 int offset = 0;
108 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
109 offset = dissect_rpc_string(tvb, tree, hf_gluster_hostname, offset,
110 NULL);
112 return offset;
115 static int
116 gluster_cli_2_deprobe_call(tvbuff_t *tvb,
117 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
119 int offset = 0;
120 offset = dissect_rpc_string(tvb, tree, hf_gluster_hostname, offset,
121 NULL);
122 offset = dissect_rpc_uint32(tvb, tree, hf_gluster_port, offset);
123 offset = dissect_rpc_uint32(tvb, tree, hf_gluster_flags, offset);
125 return offset;
128 static int
129 gluster_cli_2_fsm_log_call(tvbuff_t *tvb,
130 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
132 return dissect_rpc_string(tvb, tree, hf_gluster_wd, 0, NULL);
135 static int
136 gluster_cli_2_getwd_reply(tvbuff_t *tvb, packet_info *pinfo,
137 proto_tree *tree, void* data)
139 int offset = 0;
141 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
142 offset = dissect_rpc_string(tvb, tree, hf_gluster_wd, offset, NULL);
144 return offset;
147 static int
148 gluster_cli_2_getwd_call(tvbuff_t *tvb,
149 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
151 return dissect_rpc_uint32(tvb, tree, hf_gluster_unused, 0);
154 static int
155 gluster_cli_2_mount_call(tvbuff_t *tvb,
156 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
158 int offset = 0;
160 offset = dissect_rpc_string(tvb, tree, hf_gluster_label, offset,
161 NULL);
162 offset = gluster_rpc_dissect_dict(tree, tvb, hf_gluster_dict, offset);
164 return offset;
167 static int
168 gluster_cli_2_mount_reply(tvbuff_t *tvb, packet_info *pinfo,
169 proto_tree *tree, void* data)
171 int offset = 0;
173 offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data);
174 offset = dissect_rpc_string(tvb, tree, hf_gluster_path, offset, NULL);
176 return offset;
179 static int
180 gluster_cli_2_umount_call(tvbuff_t *tvb,
181 packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
183 int offset = 0;
185 offset = dissect_rpc_uint32(tvb, tree, hf_gluster_lazy, offset);
186 offset = dissect_rpc_string(tvb, tree, hf_gluster_path, offset, NULL);
188 return offset;
191 static int
192 gluster_cli_dissect_common_reply(tvbuff_t *tvb,
193 packet_info *pinfo, proto_tree *tree, void* data)
195 return gluster_dissect_common_reply(tvb, 0, pinfo, tree, data);
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 }
238 /* procedures for GLUSTER_CLI_PROGRAM version 2*/
239 static const vsff gluster_cli_2_proc[] = {
241 GLUSTER_CLI_2_NULL, "NULL",
242 gluster_cli_2_common_call, gluster_cli_2_common_reply
245 GLUSTER_CLI_2_PROBE, "PROBE",
246 gluster_cli_2_probe_call, gluster_cli_2_probe_reply
249 GLUSTER_CLI_2_DEPROBE, "DEPROBE",
250 gluster_cli_2_deprobe_call, gluster_cli_2_deprobe_reply
253 GLUSTER_CLI_2_LIST_FRIENDS, "LIST_FRIENDS",
254 gluster_cli_2_common_call, gluster_cli_2_common_reply
257 GLUSTER_CLI_2_CREATE_VOLUME, "CREATE_VOLUME",
258 gluster_cli_2_common_call, gluster_cli_2_common_reply
261 GLUSTER_CLI_2_GET_VOLUME, "GET_VOLUME",
262 gluster_cli_2_common_call, gluster_cli_2_common_reply
265 GLUSTER_CLI_2_GET_NEXT_VOLUME, "GET_NEXT_VOLUME",
266 gluster_cli_2_common_call, gluster_cli_2_common_reply
269 GLUSTER_CLI_2_DELETE_VOLUME, "DELETE_VOLUME",
270 gluster_cli_2_common_call, gluster_cli_2_common_reply
273 GLUSTER_CLI_2_START_VOLUME, "START_VOLUME",
274 gluster_cli_2_common_call, gluster_cli_2_common_reply
277 GLUSTER_CLI_2_STOP_VOLUME, "STOP_VOLUME",
278 gluster_cli_2_common_call, gluster_cli_2_common_reply
281 GLUSTER_CLI_2_RENAME_VOLUME, "RENAME_VOLUME",
282 gluster_cli_2_common_call, gluster_cli_2_common_reply
285 GLUSTER_CLI_2_DEFRAG_VOLUME, "DEFRAG_VOLUME" ,
286 gluster_cli_2_common_call, gluster_cli_2_common_reply
289 GLUSTER_CLI_2_SET_VOLUME, "SET_VOLUME",
290 gluster_cli_2_common_call, gluster_cli_2_common_reply
293 GLUSTER_CLI_2_ADD_BRICK, "ADD_BRICK",
294 gluster_cli_2_common_call, gluster_cli_2_common_reply
297 GLUSTER_CLI_2_REMOVE_BRICK, "REMOVE_BRICK",
298 gluster_cli_2_common_call, gluster_cli_2_common_reply
301 GLUSTER_CLI_2_REPLACE_BRICK, "REPLACE_BRICK",
302 gluster_cli_2_common_call, gluster_cli_2_common_reply
305 GLUSTER_CLI_2_LOG_ROTATE, "LOG_ROTATE",
306 gluster_cli_2_common_call, gluster_cli_2_common_reply
309 GLUSTER_CLI_2_GETSPEC, "GETSPEC",
310 gluster_cli_2_common_call, gluster_cli_2_common_reply
313 GLUSTER_CLI_2_PMAP_PORTBYBRICK, "PMAP_PORTBYBRICK",
314 gluster_cli_2_common_call, gluster_cli_2_common_reply
317 GLUSTER_CLI_2_SYNC_VOLUME, "SYNC_VOLUME",
318 gluster_cli_2_common_call, gluster_cli_2_common_reply
321 GLUSTER_CLI_2_RESET_VOLUME, "RESET_VOLUME",
322 gluster_cli_2_common_call, gluster_cli_2_common_reply
325 GLUSTER_CLI_2_FSM_LOG, "FSM_LOG",
326 gluster_cli_2_fsm_log_call, gluster_cli_2_common_reply
329 GLUSTER_CLI_2_GSYNC_SET, "GSYNC_SET",
330 gluster_cli_2_common_call, gluster_cli_2_common_reply
333 GLUSTER_CLI_2_PROFILE_VOLUME, "PROFILE_VOLUME",
334 gluster_cli_2_common_call, gluster_cli_2_common_reply
337 GLUSTER_CLI_2_QUOTA, "QUOTA",
338 gluster_cli_2_common_call, gluster_cli_2_common_reply
341 GLUSTER_CLI_2_TOP_VOLUME, "TOP_VOLUME",
342 gluster_cli_2_common_call, gluster_cli_2_common_reply
345 GLUSTER_CLI_2_GETWD, "GETWD",
346 gluster_cli_2_getwd_call, gluster_cli_2_getwd_reply
349 GLUSTER_CLI_2_STATUS_VOLUME, "STATUS_VOLUME",
350 gluster_cli_2_common_call, gluster_cli_2_common_reply
353 GLUSTER_CLI_2_STATUS_ALL, "STATUS_ALL",
354 gluster_cli_2_common_call, gluster_cli_2_common_reply
357 GLUSTER_CLI_2_MOUNT, "MOUNT",
358 gluster_cli_2_mount_call, gluster_cli_2_mount_reply
361 GLUSTER_CLI_2_UMOUNT, "UMOUNT",
362 gluster_cli_2_umount_call, gluster_cli_dissect_common_reply
365 GLUSTER_CLI_2_HEAL_VOLUME, "HEAL_VOLUME",
366 gluster_cli_2_common_call, gluster_cli_2_common_reply
369 GLUSTER_CLI_2_STATEDUMP_VOLUME, "STATEDUMP_VOLUME",
370 gluster_cli_2_common_call, gluster_cli_2_common_reply
373 GLUSTER_CLI_2_LIST_VOLUME, "LIST_VOLUME",
374 gluster_cli_2_common_call, gluster_cli_2_common_reply
377 GLUSTER_CLI_2_CLRLOCKS_VOLUME, "CLRLOCKS_VOLUME",
378 gluster_cli_2_common_call, gluster_cli_2_common_reply
380 { 0, NULL , NULL, NULL}
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 }
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 }
428 static value_string_ext gluster_cli_proc_vals_ext = VALUE_STRING_EXT_INIT(gluster_cli_proc_vals);
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 }
468 static value_string_ext gluster_cli_2_proc_vals_ext = VALUE_STRING_EXT_INIT(gluster_cli_2_proc_vals);
470 void
471 proto_register_gluster_cli(void)
473 /* Setup list of header fields See Section 1.6.1 for details */
474 static hf_register_info hf[] = {
475 /* programs */
476 { &hf_gluster_cli_proc,
477 { "Gluster CLI", "gluster.cli.proc", FT_UINT32,
478 BASE_DEC | BASE_EXT_STRING, &gluster_cli_proc_vals_ext, 0, NULL,
479 HFILL }
481 { &hf_gluster_cli_2_proc,
482 { "Gluster CLI", "gluster.cli.proc", FT_UINT32,
483 BASE_DEC | BASE_EXT_STRING, &gluster_cli_2_proc_vals_ext, 0,
484 NULL, HFILL }
486 { &hf_gluster_dict,
487 { "Dict", "gluster.dict", FT_STRING, BASE_NONE, NULL,
488 0, NULL, HFILL }
490 { &hf_gluster_path,
491 { "Path", "gluster.path", FT_STRING, BASE_NONE, NULL,
492 0, NULL, HFILL }
494 { &hf_gluster_lazy,
495 { "Lazy", "gluster.lazy", FT_UINT32, BASE_HEX, NULL,
496 0, NULL, HFILL }
498 { &hf_gluster_label,
499 { "Label", "gluster.label", FT_STRING, BASE_NONE, NULL,
500 0, NULL, HFILL }
502 { &hf_gluster_unused,
503 { "Unused", "gluster.unused", FT_UINT32, BASE_HEX,
504 NULL, 0, NULL, HFILL }
506 { &hf_gluster_wd,
507 { "Path", "gluster.wd", FT_STRING, BASE_NONE, NULL, 0,
508 NULL, HFILL }
510 { &hf_gluster_op_errstr,
511 { "Error", "gluster.op_errstr", FT_STRING, BASE_NONE,
512 NULL, 0, NULL, HFILL }
514 { &hf_gluster_hostname,
515 { "Hostname", "gluster.hostname", FT_STRING, BASE_NONE,
516 NULL, 0, NULL, HFILL }
518 { &hf_gluster_port,
519 { "Port", "gluster.port", FT_UINT32, BASE_DEC, NULL, 0,
520 NULL, HFILL }
522 { &hf_gluster_flags,
523 { "Flags", "gluster.flag", FT_UINT32, BASE_HEX, NULL,
524 0, NULL, HFILL }
528 /* Setup protocol subtree array */
529 static int *ett[] = {
530 &ett_gluster_cli
533 /* Register the protocol name and description */
534 proto_gluster_cli = proto_register_protocol("Gluster CLI", "Gluster CLI", "gluster.cli");
535 proto_register_subtree_array(ett, array_length(ett));
536 proto_register_field_array(proto_gluster_cli, hf, array_length(hf));
539 void
540 proto_reg_handoff_gluster_cli(void)
542 rpc_init_prog(proto_gluster_cli, GLUSTER_CLI_PROGRAM, ett_gluster_cli,
543 G_N_ELEMENTS(gluster_cli_vers_info), gluster_cli_vers_info);
547 * Editor modelines - https://www.wireshark.org/tools/modelines.html
549 * Local variables:
550 * c-basic-offset: 8
551 * tab-width: 8
552 * indent-tabs-mode: t
553 * End:
555 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
556 * :indentSize=8:tabSize=8:noTabs=false: