/src/wireshark/epan/dissectors/packet-glusterd.c
Line | Count | Source |
1 | | /* packet-gluster_glusterd.c |
2 | | * Routines for Gluster Daemon Management dissection |
3 | | * Copyright 2012, Niels de Vos <ndevos@redhat.com> |
4 | | * With contributions from: |
5 | | * Shreedhara LG <shreedharlg@gmail.com> |
6 | | * |
7 | | * Wireshark - Network traffic analyzer |
8 | | * By Gerald Combs <gerald@wireshark.org> |
9 | | * Copyright 1998 Gerald Combs |
10 | | * |
11 | | * SPDX-License-Identifier: GPL-2.0-or-later |
12 | | * |
13 | | * |
14 | | * References to source files point in general to the glusterfs sources. |
15 | | * There is currently no RFC or other document where the protocol is |
16 | | * completely described. The glusterfs sources can be found at: |
17 | | * - https://github.com/gluster/glusterfs |
18 | | * |
19 | | * The coding-style is roughly the same as the one use in the Linux kernel, |
20 | | * see http://www.kernel.org/doc/Documentation/CodingStyle. |
21 | | */ |
22 | | |
23 | | #include "config.h" |
24 | | |
25 | | #include <epan/packet.h> |
26 | | |
27 | | #include "packet-rpc.h" |
28 | | #include "packet-gluster.h" |
29 | | |
30 | | void proto_register_gluster_gd_mgmt(void); |
31 | | void proto_reg_handoff_gluster_gd_mgmt(void); |
32 | | |
33 | | /* Initialize the protocol and registered fields */ |
34 | | static int proto_glusterd; |
35 | | static int proto_gd_mgmt; |
36 | | static int proto_gd_brick; |
37 | | static int proto_gd_friend; |
38 | | |
39 | | /* programs and procedures */ |
40 | | static int hf_gd_mgmt_proc; |
41 | | static int hf_gd_mgmt_2_proc; |
42 | | static int hf_gd_mgmt_3_proc; |
43 | | static int hf_gd_mgmt_brick_2_proc; |
44 | | static int hf_glusterd_friend_proc; |
45 | | |
46 | | /* fields used by multiple programs/procedures */ |
47 | | static int hf_glusterd_dict; |
48 | | static int hf_glusterd_op; |
49 | | static int hf_glusterd_op_ret; |
50 | | static int hf_glusterd_op_errstr; |
51 | | static int hf_glusterd_uuid; |
52 | | static int hf_glusterd_tnx_id; |
53 | | static int hf_glusterd_hostname; |
54 | | static int hf_glusterd_port; |
55 | | static int hf_glusterd_vols; |
56 | | static int hf_glusterd_buf; |
57 | | static int hf_glusterd_name; |
58 | | |
59 | | /* Initialize the subtree pointers */ |
60 | | static int ett_gd_mgmt; |
61 | | static int ett_gd_brick; |
62 | | static int ett_gd_friend; |
63 | | |
64 | | /* the UUID is the same as a GlusterFS GFID, except it's encoded per byte */ |
65 | | static int |
66 | | gluster_gd_mgmt_dissect_uuid(tvbuff_t *tvb, proto_tree *tree, int hfindex, |
67 | | int offset) |
68 | 0 | { |
69 | 0 | if (tree) { |
70 | 0 | e_guid_t uuid; |
71 | 0 | int start_offset = offset; |
72 | |
|
73 | 0 | uuid.data1 = (tvb_get_ntohl(tvb, offset) & 0xff) << 24 | |
74 | 0 | (tvb_get_ntohl(tvb, offset+4) & 0xff) << 16 | |
75 | 0 | (tvb_get_ntohl(tvb, offset+8) & 0xff) << 8 | |
76 | 0 | (tvb_get_ntohl(tvb, offset+12) & 0xff); |
77 | 0 | offset += 16; |
78 | 0 | uuid.data2 = (tvb_get_ntohl(tvb, offset) & 0xff) << 8 | |
79 | 0 | (tvb_get_ntohl(tvb, offset+4) & 0xff); |
80 | 0 | offset += 8; |
81 | 0 | uuid.data3 = (tvb_get_ntohl(tvb, offset) & 0xff) << 8 | |
82 | 0 | (tvb_get_ntohl(tvb, offset+4) & 0xff); |
83 | 0 | offset += 8; |
84 | 0 | uuid.data4[0] = tvb_get_ntohl(tvb, offset); |
85 | 0 | offset += 4; |
86 | 0 | uuid.data4[1] = tvb_get_ntohl(tvb, offset); |
87 | 0 | offset += 4; |
88 | 0 | uuid.data4[2] = tvb_get_ntohl(tvb, offset); |
89 | 0 | offset += 4; |
90 | 0 | uuid.data4[3] = tvb_get_ntohl(tvb, offset); |
91 | 0 | offset += 4; |
92 | 0 | uuid.data4[4] = tvb_get_ntohl(tvb, offset); |
93 | 0 | offset += 4; |
94 | 0 | uuid.data4[5] = tvb_get_ntohl(tvb, offset); |
95 | 0 | offset += 4; |
96 | 0 | uuid.data4[6] = tvb_get_ntohl(tvb, offset); |
97 | 0 | offset += 4; |
98 | 0 | uuid.data4[7] = tvb_get_ntohl(tvb, offset); |
99 | 0 | offset += 4; |
100 | 0 | proto_tree_add_guid(tree, hfindex, tvb, start_offset, 4*16, &uuid); |
101 | 0 | } else |
102 | 0 | offset += 16 * 4; |
103 | |
|
104 | 0 | return offset; |
105 | 0 | } |
106 | | |
107 | | static int |
108 | | gluster_gd_mgmt_probe_reply(tvbuff_t *tvb, packet_info *pinfo, |
109 | | proto_tree *tree, void* data) |
110 | 0 | { |
111 | 0 | int offset = 0; |
112 | |
|
113 | 0 | offset = gluster_gd_mgmt_dissect_uuid(tvb, tree, hf_glusterd_uuid, |
114 | 0 | offset); |
115 | 0 | offset = dissect_rpc_string(tvb, pinfo, tree, hf_glusterd_hostname, offset, |
116 | 0 | NULL); |
117 | 0 | offset = dissect_rpc_uint32(tvb, tree, hf_glusterd_port, offset); |
118 | 0 | offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data); |
119 | |
|
120 | 0 | return offset; |
121 | 0 | } |
122 | | |
123 | | static int |
124 | | gluster_gd_mgmt_probe_call(tvbuff_t *tvb, packet_info *pinfo, |
125 | | proto_tree *tree, void* data _U_) |
126 | 0 | { |
127 | 0 | int offset = 0; |
128 | 0 | offset = gluster_gd_mgmt_dissect_uuid(tvb, tree, hf_glusterd_uuid, |
129 | 0 | offset); |
130 | 0 | offset = dissect_rpc_string(tvb, pinfo, tree, hf_glusterd_hostname, offset, |
131 | 0 | NULL); |
132 | 0 | offset = dissect_rpc_uint32(tvb, tree, hf_glusterd_port, offset); |
133 | |
|
134 | 0 | return offset; |
135 | 0 | } |
136 | | |
137 | | static int |
138 | | gluster_gd_mgmt_friend_add_reply(tvbuff_t *tvb, |
139 | | packet_info *pinfo, proto_tree *tree, void* data) |
140 | 0 | { |
141 | 0 | int offset = 0; |
142 | |
|
143 | 0 | offset = gluster_gd_mgmt_dissect_uuid(tvb, tree, hf_glusterd_uuid, |
144 | 0 | offset); |
145 | 0 | offset = dissect_rpc_string(tvb, pinfo, tree, hf_glusterd_hostname, offset, |
146 | 0 | NULL); |
147 | 0 | offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data); |
148 | 0 | offset = dissect_rpc_uint32(tvb, tree, hf_glusterd_port, offset); |
149 | |
|
150 | 0 | return offset; |
151 | 0 | } |
152 | | |
153 | | static int |
154 | | gluster_gd_mgmt_friend_add_call(tvbuff_t *tvb, |
155 | | packet_info *pinfo, proto_tree *tree, void* data _U_) |
156 | 0 | { |
157 | 0 | int offset = 0; |
158 | |
|
159 | 0 | offset = gluster_gd_mgmt_dissect_uuid(tvb, tree, hf_glusterd_uuid, |
160 | 0 | offset); |
161 | 0 | offset = dissect_rpc_string(tvb, pinfo, tree, hf_glusterd_hostname, offset, |
162 | 0 | NULL); |
163 | 0 | offset = dissect_rpc_uint32(tvb, tree, hf_glusterd_port, offset); |
164 | 0 | offset = gluster_rpc_dissect_dict(tree, pinfo, tvb, hf_glusterd_vols, offset); |
165 | |
|
166 | 0 | return offset; |
167 | 0 | } |
168 | | |
169 | | /* gluster_gd_mgmt_cluster_lock_reply is used for LOCK and UNLOCK */ |
170 | | static int |
171 | | gluster_gd_mgmt_cluster_lock_reply(tvbuff_t *tvb, |
172 | | packet_info *pinfo, proto_tree *tree, void* data) |
173 | 0 | { |
174 | 0 | int offset = 0; |
175 | |
|
176 | 0 | offset = gluster_gd_mgmt_dissect_uuid(tvb, tree, hf_glusterd_uuid, |
177 | 0 | offset); |
178 | 0 | offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data); |
179 | |
|
180 | 0 | return offset; |
181 | 0 | } |
182 | | |
183 | | /* gluster_gd_mgmt_cluster_lock_call is used for LOCK and UNLOCK */ |
184 | | static int |
185 | | gluster_gd_mgmt_cluster_lock_call(tvbuff_t *tvb, |
186 | | packet_info *pinfo _U_, proto_tree *tree, void* data _U_) |
187 | 0 | { |
188 | 0 | return gluster_gd_mgmt_dissect_uuid(tvb, tree, hf_glusterd_uuid, 0); |
189 | 0 | } |
190 | | |
191 | | static int |
192 | | gluster_gd_mgmt_stage_op_reply(tvbuff_t *tvb, packet_info *pinfo, |
193 | | proto_tree *tree, void* data) |
194 | 0 | { |
195 | 0 | int offset = 0; |
196 | 0 | offset = gluster_gd_mgmt_dissect_uuid(tvb, tree, hf_glusterd_uuid, |
197 | 0 | offset); |
198 | 0 | offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data); |
199 | 0 | offset = dissect_rpc_string(tvb, pinfo, tree, hf_glusterd_op_errstr, offset, |
200 | 0 | NULL); |
201 | 0 | offset = gluster_rpc_dissect_dict(tree, pinfo, tvb, hf_glusterd_dict, offset); |
202 | 0 | return offset; |
203 | 0 | } |
204 | | |
205 | | static int |
206 | | gluster_gd_mgmt_stage_op_call(tvbuff_t *tvb, |
207 | | packet_info *pinfo, proto_tree *tree, void* data _U_) |
208 | 0 | { |
209 | 0 | int offset = 0; |
210 | 0 | offset = gluster_gd_mgmt_dissect_uuid(tvb, tree, hf_glusterd_uuid, |
211 | 0 | offset); |
212 | 0 | offset = dissect_rpc_uint32(tvb, tree, hf_glusterd_op, offset); |
213 | 0 | offset = gluster_rpc_dissect_dict(tree, pinfo, tvb, hf_glusterd_dict, offset); |
214 | |
|
215 | 0 | return offset; |
216 | 0 | } |
217 | | |
218 | | static int |
219 | | gluster_gd_mgmt_commit_op_reply(tvbuff_t *tvb, packet_info *pinfo, |
220 | | proto_tree *tree, void* data) |
221 | 0 | { |
222 | 0 | int offset = 0; |
223 | 0 | offset = gluster_gd_mgmt_dissect_uuid(tvb, tree, hf_glusterd_uuid, |
224 | 0 | offset); |
225 | 0 | offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data); |
226 | 0 | offset = gluster_rpc_dissect_dict(tree, pinfo, tvb, hf_glusterd_buf, offset); |
227 | 0 | offset = dissect_rpc_string(tvb, pinfo, tree, hf_glusterd_op_errstr, offset, |
228 | 0 | NULL); |
229 | 0 | return offset; |
230 | 0 | } |
231 | | |
232 | | static int |
233 | | gluster_gd_mgmt_commit_op_call(tvbuff_t *tvb, |
234 | | packet_info *pinfo, proto_tree *tree, void* data _U_) |
235 | 0 | { |
236 | 0 | int offset = 0; |
237 | 0 | offset = gluster_gd_mgmt_dissect_uuid(tvb, tree, hf_glusterd_uuid, |
238 | 0 | offset); |
239 | 0 | offset = dissect_rpc_uint32(tvb, tree, hf_glusterd_op, offset); |
240 | 0 | offset = gluster_rpc_dissect_dict(tree, pinfo, tvb, hf_glusterd_buf, |
241 | 0 | offset); |
242 | |
|
243 | 0 | return offset; |
244 | 0 | } |
245 | | |
246 | | static int |
247 | | gluster_gd_mgmt_friend_update_reply(tvbuff_t *tvb, |
248 | | packet_info *pinfo, proto_tree *tree, void* data) |
249 | 0 | { |
250 | 0 | int offset = 0; |
251 | 0 | offset = gluster_gd_mgmt_dissect_uuid(tvb, tree, hf_glusterd_uuid, |
252 | 0 | offset); |
253 | 0 | offset = dissect_rpc_uint32(tvb, tree, hf_glusterd_op, offset); |
254 | 0 | offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data); |
255 | |
|
256 | 0 | return offset; |
257 | 0 | } |
258 | | |
259 | | static int |
260 | | gluster_gd_mgmt_friend_update_call(tvbuff_t *tvb, |
261 | | packet_info *pinfo, proto_tree *tree, void* data _U_) |
262 | 0 | { |
263 | 0 | int offset = 0; |
264 | 0 | offset = gluster_gd_mgmt_dissect_uuid(tvb, tree, hf_glusterd_uuid, |
265 | 0 | offset); |
266 | 0 | offset = gluster_rpc_dissect_dict(tree, pinfo, tvb, hf_glusterd_vols, |
267 | 0 | offset); |
268 | 0 | offset = dissect_rpc_uint32(tvb, tree, hf_glusterd_port, offset); |
269 | |
|
270 | 0 | return offset; |
271 | 0 | } |
272 | | |
273 | | /* Below procedure is used for version 2 */ |
274 | | static int |
275 | | glusterd_mgmt_2_cluster_lock_reply(tvbuff_t *tvb, |
276 | | packet_info *pinfo, proto_tree *tree, void* data) |
277 | 0 | { |
278 | 0 | int offset = 0; |
279 | 0 | offset = gluster_gd_mgmt_dissect_uuid(tvb, tree, hf_glusterd_uuid, |
280 | 0 | offset); |
281 | 0 | offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data); |
282 | |
|
283 | 0 | return offset; |
284 | 0 | } |
285 | | |
286 | | /* glusterd__mgmt_2_cluster_lock_call is used for LOCK and UNLOCK */ |
287 | | static int |
288 | | glusterd_mgmt_2_cluster_lock_call(tvbuff_t *tvb, |
289 | | packet_info *pinfo _U_, proto_tree *tree, void* data _U_) |
290 | 0 | { |
291 | 0 | return gluster_gd_mgmt_dissect_uuid(tvb, tree, hf_glusterd_uuid, 0); |
292 | 0 | } |
293 | | |
294 | | static int |
295 | | glusterd_mgmt_2_stage_op_reply(tvbuff_t *tvb, packet_info *pinfo, |
296 | | proto_tree *tree, void* data) |
297 | 0 | { |
298 | 0 | int offset = 0; |
299 | 0 | offset = gluster_gd_mgmt_dissect_uuid(tvb, tree, hf_glusterd_uuid, |
300 | 0 | offset); |
301 | 0 | offset = dissect_rpc_uint32(tvb, tree, hf_glusterd_op, offset); |
302 | 0 | offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data); |
303 | 0 | offset = dissect_rpc_string(tvb, pinfo, tree, hf_glusterd_op_errstr, offset, |
304 | 0 | NULL); |
305 | 0 | offset = gluster_rpc_dissect_dict(tree, pinfo, tvb, hf_glusterd_dict, offset); |
306 | |
|
307 | 0 | return offset; |
308 | 0 | } |
309 | | |
310 | | static int |
311 | | glusterd_mgmt_2_stage_op_call(tvbuff_t *tvb, |
312 | | packet_info *pinfo, proto_tree *tree, void* data _U_) |
313 | 0 | { |
314 | 0 | int offset = 0; |
315 | 0 | offset = gluster_gd_mgmt_dissect_uuid(tvb, tree, hf_glusterd_uuid, |
316 | 0 | offset); |
317 | 0 | offset = dissect_rpc_uint32(tvb, tree, hf_glusterd_op, offset); |
318 | 0 | offset = gluster_rpc_dissect_dict(tree, pinfo, tvb, hf_glusterd_dict, offset); |
319 | |
|
320 | 0 | return offset; |
321 | 0 | } |
322 | | |
323 | | static int |
324 | | glusterd_mgmt_2_commit_op_reply(tvbuff_t *tvb, packet_info *pinfo, |
325 | | proto_tree *tree, void* data) |
326 | 0 | { |
327 | 0 | int offset = 0; |
328 | 0 | offset = gluster_gd_mgmt_dissect_uuid(tvb, tree, hf_glusterd_uuid, |
329 | 0 | offset); |
330 | 0 | offset = dissect_rpc_uint32(tvb, tree, hf_glusterd_op, offset); |
331 | 0 | offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data); |
332 | 0 | offset = gluster_rpc_dissect_dict(tree, pinfo, tvb, hf_glusterd_buf, offset); |
333 | 0 | offset = dissect_rpc_string(tvb, pinfo, tree, hf_glusterd_op_errstr, offset, |
334 | 0 | NULL); |
335 | |
|
336 | 0 | return offset; |
337 | 0 | } |
338 | | |
339 | | static int |
340 | | glusterd_mgmt_2_commit_op_call(tvbuff_t *tvb, |
341 | | packet_info *pinfo, proto_tree *tree, void* data _U_) |
342 | 0 | { |
343 | 0 | int offset = 0; |
344 | 0 | offset = gluster_gd_mgmt_dissect_uuid(tvb, tree, hf_glusterd_uuid, |
345 | 0 | offset); |
346 | 0 | offset = dissect_rpc_uint32(tvb, tree, hf_glusterd_op, offset); |
347 | 0 | offset = gluster_rpc_dissect_dict(tree, pinfo, tvb, hf_glusterd_buf, offset); |
348 | |
|
349 | 0 | return offset; |
350 | 0 | } |
351 | | |
352 | | /* glusterd_mgmt_3_lock_call is used for LOCK and UNLOCK */ |
353 | | static int |
354 | | glusterd_mgmt_3_lock_call(tvbuff_t *tvb, packet_info *pinfo, |
355 | | proto_tree *tree, void* data _U_) |
356 | 0 | { |
357 | 0 | int offset = 0; |
358 | 0 | offset = gluster_gd_mgmt_dissect_uuid(tvb, tree, hf_glusterd_uuid, |
359 | 0 | offset); |
360 | 0 | offset = gluster_gd_mgmt_dissect_uuid(tvb, tree, hf_glusterd_tnx_id, |
361 | 0 | offset); |
362 | 0 | offset = dissect_rpc_uint32(tvb, tree, hf_glusterd_op, offset); |
363 | 0 | offset = gluster_rpc_dissect_dict(tree, pinfo, tvb, hf_glusterd_dict, offset); |
364 | |
|
365 | 0 | return offset; |
366 | 0 | } |
367 | | |
368 | | static int |
369 | | glusterd_mgmt_3_lock_reply(tvbuff_t *tvb, packet_info *pinfo, |
370 | | proto_tree *tree, void* data) |
371 | 0 | { |
372 | 0 | int offset = 0; |
373 | 0 | offset = gluster_gd_mgmt_dissect_uuid(tvb, tree, hf_glusterd_uuid, |
374 | 0 | offset); |
375 | 0 | offset = gluster_gd_mgmt_dissect_uuid(tvb, tree, hf_glusterd_tnx_id, |
376 | 0 | offset); |
377 | 0 | offset = gluster_rpc_dissect_dict(tree, pinfo, tvb, hf_glusterd_dict, offset); |
378 | 0 | offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data); |
379 | 0 | return offset; |
380 | 0 | } |
381 | | |
382 | | static int |
383 | | glusterd_mgmt_3_pre_val_call(tvbuff_t *tvb, |
384 | | packet_info *pinfo, proto_tree *tree, void* data _U_) |
385 | 0 | { |
386 | 0 | int offset = 0; |
387 | 0 | offset = gluster_gd_mgmt_dissect_uuid(tvb, tree, hf_glusterd_uuid, |
388 | 0 | offset); |
389 | 0 | offset = dissect_rpc_uint32(tvb, tree, hf_glusterd_op, offset); |
390 | 0 | offset = gluster_rpc_dissect_dict(tree, pinfo, tvb, hf_glusterd_dict, offset); |
391 | |
|
392 | 0 | return offset; |
393 | 0 | } |
394 | | |
395 | | static int |
396 | | glusterd_mgmt_3_pre_val_reply(tvbuff_t *tvb, packet_info *pinfo, |
397 | | proto_tree *tree, void* data) |
398 | 0 | { |
399 | 0 | int offset = 0; |
400 | 0 | offset = gluster_gd_mgmt_dissect_uuid(tvb, tree, hf_glusterd_uuid, |
401 | 0 | offset); |
402 | 0 | offset = dissect_rpc_uint32(tvb, tree, hf_glusterd_op, offset); |
403 | 0 | offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data); |
404 | 0 | offset = dissect_rpc_string(tvb, pinfo, tree, hf_glusterd_op_errstr, offset, |
405 | 0 | NULL); |
406 | 0 | offset = gluster_rpc_dissect_dict(tree, pinfo, tvb, hf_glusterd_dict, offset); |
407 | 0 | return offset; |
408 | 0 | } |
409 | | |
410 | | static int |
411 | | glusterd_mgmt_3_commit_reply(tvbuff_t *tvb, packet_info *pinfo, |
412 | | proto_tree *tree, void* data) |
413 | 0 | { |
414 | 0 | int offset = 0; |
415 | 0 | offset = gluster_gd_mgmt_dissect_uuid(tvb, tree, hf_glusterd_uuid, |
416 | 0 | offset); |
417 | 0 | offset = dissect_rpc_uint32(tvb, tree, hf_glusterd_op, offset); |
418 | 0 | offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data); |
419 | 0 | offset = gluster_rpc_dissect_dict(tree, pinfo, tvb, hf_glusterd_dict, offset); |
420 | 0 | offset = dissect_rpc_string(tvb, pinfo, tree, hf_glusterd_op_errstr, offset, |
421 | 0 | NULL); |
422 | 0 | return offset; |
423 | 0 | } |
424 | | |
425 | | static int |
426 | | glusterd_mgmt_3_post_val_call(tvbuff_t *tvb, |
427 | | packet_info *pinfo, proto_tree *tree, void* data _U_) |
428 | 0 | { |
429 | 0 | int offset = 0; |
430 | 0 | offset = gluster_gd_mgmt_dissect_uuid(tvb, tree, hf_glusterd_uuid, |
431 | 0 | offset); |
432 | 0 | offset = dissect_rpc_uint32(tvb, tree, hf_glusterd_op, offset); |
433 | 0 | offset = dissect_rpc_uint32(tvb, tree, hf_glusterd_op_ret, offset); |
434 | 0 | offset = gluster_rpc_dissect_dict(tree, pinfo, tvb, hf_glusterd_dict, offset); |
435 | |
|
436 | 0 | return offset; |
437 | 0 | } |
438 | | |
439 | | |
440 | | /* Brick management common function */ |
441 | | |
442 | | static int |
443 | | glusterd_brick_2_common_reply(tvbuff_t *tvb, packet_info *pinfo, |
444 | | proto_tree *tree, void* data) |
445 | 0 | { |
446 | 0 | int offset = 0; |
447 | 0 | offset = gluster_dissect_common_reply(tvb, offset, pinfo, tree, data); |
448 | 0 | offset = dissect_rpc_string(tvb, pinfo, tree, hf_glusterd_op_errstr, offset, |
449 | 0 | NULL); |
450 | 0 | offset = gluster_rpc_dissect_dict(tree, pinfo, tvb, hf_glusterd_dict, offset); |
451 | |
|
452 | 0 | return offset; |
453 | 0 | } |
454 | | |
455 | | static int |
456 | | glusterd_brick_2_common_call(tvbuff_t *tvb, |
457 | | packet_info *pinfo, proto_tree *tree, void* data _U_) |
458 | 0 | { |
459 | 0 | int offset = 0; |
460 | 0 | offset = dissect_rpc_string(tvb, pinfo, tree, hf_glusterd_name, offset, |
461 | 0 | NULL); |
462 | 0 | offset = dissect_rpc_uint32(tvb, tree, hf_glusterd_op, offset); |
463 | 0 | offset = gluster_rpc_dissect_dict(tree, pinfo, tvb, hf_glusterd_dict, offset); |
464 | |
|
465 | 0 | return offset; |
466 | 0 | } |
467 | | |
468 | | /* |
469 | | * GD_MGMT_PROGRAM |
470 | | * - xlators/mgmt/glusterd/src/glusterd-handler.c: "GlusterD svc mgmt" |
471 | | * - xlators/mgmt/glusterd/src/glusterd-rpc-ops.c: "glusterd clnt mgmt" |
472 | | */ |
473 | | static const vsff gd_mgmt_proc[] = { |
474 | | { |
475 | | GD_MGMT_NULL, "NULL", |
476 | | dissect_rpc_void, dissect_rpc_void |
477 | | }, |
478 | | { |
479 | | GD_MGMT_PROBE_QUERY, "PROBE_QUERY", |
480 | | gluster_gd_mgmt_probe_call, gluster_gd_mgmt_probe_reply |
481 | | }, |
482 | | { |
483 | | GD_MGMT_FRIEND_ADD, "FRIEND_ADD", |
484 | | gluster_gd_mgmt_friend_add_call, |
485 | | gluster_gd_mgmt_friend_add_reply |
486 | | }, |
487 | | { |
488 | | GD_MGMT_CLUSTER_LOCK, "CLUSTER_LOCK", |
489 | | gluster_gd_mgmt_cluster_lock_call, |
490 | | gluster_gd_mgmt_cluster_lock_reply |
491 | | }, |
492 | | { |
493 | | GD_MGMT_CLUSTER_UNLOCK, "CLUSTER_UNLOCK", |
494 | | /* UNLOCK seems to be the same a LOCK, re-use the function */ |
495 | | gluster_gd_mgmt_cluster_lock_call, |
496 | | gluster_gd_mgmt_cluster_lock_reply |
497 | | }, |
498 | | { |
499 | | GD_MGMT_STAGE_OP, "STAGE_OP", |
500 | | gluster_gd_mgmt_stage_op_call, gluster_gd_mgmt_stage_op_reply |
501 | | }, |
502 | | { |
503 | | GD_MGMT_COMMIT_OP, "COMMIT_OP", |
504 | | gluster_gd_mgmt_commit_op_call, gluster_gd_mgmt_commit_op_reply |
505 | | }, |
506 | | { GD_MGMT_FRIEND_REMOVE, "FRIEND_REMOVE", dissect_rpc_unknown, dissect_rpc_unknown}, |
507 | | { |
508 | | GD_MGMT_FRIEND_UPDATE, "FRIEND_UPDATE", |
509 | | gluster_gd_mgmt_friend_update_call, |
510 | | gluster_gd_mgmt_friend_update_reply |
511 | | }, |
512 | | { GD_MGMT_CLI_PROBE, "CLI_PROBE", dissect_rpc_unknown, dissect_rpc_unknown}, |
513 | | { GD_MGMT_CLI_DEPROBE, "CLI_DEPROBE", dissect_rpc_unknown, dissect_rpc_unknown}, |
514 | | { GD_MGMT_CLI_LIST_FRIENDS, "CLI_LIST_FRIENDS", dissect_rpc_unknown, dissect_rpc_unknown}, |
515 | | { GD_MGMT_CLI_CREATE_VOLUME, "CLI_CREATE_VOLUME", dissect_rpc_unknown, dissect_rpc_unknown}, |
516 | | { GD_MGMT_CLI_GET_VOLUME, "CLI_GET_VOLUME", dissect_rpc_unknown, dissect_rpc_unknown}, |
517 | | { GD_MGMT_CLI_DELETE_VOLUME, "CLI_DELETE_VOLUME", dissect_rpc_unknown, dissect_rpc_unknown}, |
518 | | { GD_MGMT_CLI_START_VOLUME, "CLI_START_VOLUME", dissect_rpc_unknown, dissect_rpc_unknown}, |
519 | | { GD_MGMT_CLI_STOP_VOLUME, "CLI_STOP_VOLUME", dissect_rpc_unknown, dissect_rpc_unknown}, |
520 | | { GD_MGMT_CLI_RENAME_VOLUME, "CLI_RENAME_VOLUME", dissect_rpc_unknown, dissect_rpc_unknown}, |
521 | | { GD_MGMT_CLI_DEFRAG_VOLUME, "CLI_DEFRAG_VOLUME", dissect_rpc_unknown, dissect_rpc_unknown}, |
522 | | { GD_MGMT_CLI_SET_VOLUME, "CLI_DEFRAG_VOLUME", dissect_rpc_unknown, dissect_rpc_unknown}, |
523 | | { GD_MGMT_CLI_ADD_BRICK, "CLI_ADD_BRICK", dissect_rpc_unknown, dissect_rpc_unknown}, |
524 | | { GD_MGMT_CLI_REMOVE_BRICK, "CLI_REMOVE_BRICK", dissect_rpc_unknown, dissect_rpc_unknown}, |
525 | | { GD_MGMT_CLI_REPLACE_BRICK, "CLI_REPLACE_BRICK", dissect_rpc_unknown, dissect_rpc_unknown}, |
526 | | { GD_MGMT_CLI_LOG_FILENAME, "CLI_LOG_FILENAME", dissect_rpc_unknown, dissect_rpc_unknown}, |
527 | | { GD_MGMT_CLI_LOG_LOCATE, "CLI_LOG_LOCATE", dissect_rpc_unknown, dissect_rpc_unknown}, |
528 | | { GD_MGMT_CLI_LOG_ROTATE, "CLI_LOG_ROTATE", dissect_rpc_unknown, dissect_rpc_unknown}, |
529 | | { GD_MGMT_CLI_SYNC_VOLUME, "CLI_SYNC_VOLUME", dissect_rpc_unknown, dissect_rpc_unknown}, |
530 | | { GD_MGMT_CLI_RESET_VOLUME, "CLI_RESET_VOLUME", dissect_rpc_unknown, dissect_rpc_unknown}, |
531 | | { GD_MGMT_CLI_FSM_LOG, "CLI_FSM_LOG", dissect_rpc_unknown, dissect_rpc_unknown}, |
532 | | { GD_MGMT_CLI_GSYNC_SET, "CLI_GSYNC_SET", dissect_rpc_unknown, dissect_rpc_unknown}, |
533 | | { GD_MGMT_CLI_PROFILE_VOLUME, "CLI_PROFILE_VOLUME", dissect_rpc_unknown, dissect_rpc_unknown}, |
534 | | { GD_MGMT_BRICK_OP, "BRICK_OP", dissect_rpc_unknown, dissect_rpc_unknown}, |
535 | | { GD_MGMT_CLI_LOG_LEVEL, "CLI_LOG_LEVEL", dissect_rpc_unknown, dissect_rpc_unknown}, |
536 | | { GD_MGMT_CLI_STATUS_VOLUME, "CLI_STATUS_VOLUME", dissect_rpc_unknown, dissect_rpc_unknown}, |
537 | | { 0, NULL, NULL, NULL} |
538 | | }; |
539 | | |
540 | | static const vsff gd_mgmt_2_proc[] = { |
541 | | { |
542 | | GLUSTERD_MGMT_2_NULL, "NULL", |
543 | | dissect_rpc_void, dissect_rpc_void |
544 | | }, |
545 | | { |
546 | | GLUSTERD_MGMT_2_CLUSTER_LOCK, "CLUSTER_LOCK", |
547 | | glusterd_mgmt_2_cluster_lock_call, |
548 | | glusterd_mgmt_2_cluster_lock_reply |
549 | | }, |
550 | | { |
551 | | GLUSTERD_MGMT_2_CLUSTER_UNLOCK, "CLUSTER_UNLOCK", |
552 | | /* UNLOCK seems to be the same a LOCK, re-use the function */ |
553 | | glusterd_mgmt_2_cluster_lock_call, |
554 | | glusterd_mgmt_2_cluster_lock_reply |
555 | | }, |
556 | | { |
557 | | GLUSTERD_MGMT_2_STAGE_OP, "STAGE_OP", |
558 | | glusterd_mgmt_2_stage_op_call, glusterd_mgmt_2_stage_op_reply |
559 | | }, |
560 | | { |
561 | | GLUSTERD_MGMT_2_COMMIT_OP, "COMMIT_OP", |
562 | | glusterd_mgmt_2_commit_op_call, glusterd_mgmt_2_commit_op_reply |
563 | | }, |
564 | | { 0, NULL, NULL, NULL} |
565 | | }; |
566 | | |
567 | | static const vsff gd_mgmt_3_proc[] = { |
568 | | { |
569 | | GLUSTERD_MGMT_3_NULL, "NULL", |
570 | | dissect_rpc_void, dissect_rpc_void |
571 | | }, |
572 | | { |
573 | | GLUSTERD_MGMT_3_LOCK, "LOCK", |
574 | | glusterd_mgmt_3_lock_call, |
575 | | glusterd_mgmt_3_lock_reply |
576 | | }, |
577 | | { |
578 | | GLUSTERD_MGMT_3_PRE_VALIDATE, "PRE_VALIDATE", |
579 | | glusterd_mgmt_3_pre_val_call, |
580 | | glusterd_mgmt_3_pre_val_reply |
581 | | }, |
582 | | { |
583 | | GLUSTERD_MGMT_3_BRICK_OP, "BRICK_OP", |
584 | | glusterd_mgmt_3_pre_val_call, |
585 | | glusterd_mgmt_3_pre_val_reply |
586 | | }, |
587 | | { |
588 | | GLUSTERD_MGMT_3_COMMIT, "COMMIT", |
589 | | glusterd_mgmt_3_pre_val_call, |
590 | | glusterd_mgmt_3_commit_reply |
591 | | }, |
592 | | { |
593 | | GLUSTERD_MGMT_3_POST_VALIDATE, "POST_VALIDATE", |
594 | | glusterd_mgmt_3_post_val_call, |
595 | | glusterd_mgmt_3_pre_val_reply |
596 | | }, |
597 | | { |
598 | | GLUSTERD_MGMT_3_UNLOCK, "UNLOCK", |
599 | | /* UNLOCK seems to be the same a LOCK, re-use the function */ |
600 | | glusterd_mgmt_3_lock_call, |
601 | | glusterd_mgmt_3_lock_reply |
602 | | }, |
603 | | { 0, NULL, NULL, NULL} |
604 | | }; |
605 | | |
606 | | static const rpc_prog_vers_info glusterd_mgmt_vers_info[] = { |
607 | | { 1, gd_mgmt_proc, &hf_gd_mgmt_proc }, |
608 | | { 2, gd_mgmt_2_proc, &hf_gd_mgmt_2_proc }, |
609 | | { 3, gd_mgmt_3_proc, &hf_gd_mgmt_3_proc } |
610 | | }; |
611 | | |
612 | | static const vsff gd_mgmt_brick_2_proc[] = { |
613 | | { |
614 | | GLUSTERD_2_BRICK_NULL, "NULL", |
615 | | dissect_rpc_void, dissect_rpc_void |
616 | | }, |
617 | | { |
618 | | GLUSTERD_2_BRICK_TERMINATE, "TERMINATE", |
619 | | glusterd_brick_2_common_call, glusterd_brick_2_common_reply |
620 | | }, |
621 | | { |
622 | | GLUSTERD_2_BRICK_XLATOR_INFO, "XLATOR_INFO", |
623 | | glusterd_brick_2_common_call, glusterd_brick_2_common_reply |
624 | | }, |
625 | | { |
626 | | GLUSTERD_2_BRICK_XLATOR_OP, "XLATOR_OP" , |
627 | | glusterd_brick_2_common_call, glusterd_brick_2_common_reply |
628 | | }, |
629 | | { |
630 | | GLUSTERD_2_BRICK_STATUS, "STATUS", |
631 | | glusterd_brick_2_common_call, glusterd_brick_2_common_reply |
632 | | }, |
633 | | { |
634 | | GLUSTERD_2_BRICK_OP, "OP", |
635 | | glusterd_brick_2_common_call, glusterd_brick_2_common_reply |
636 | | }, |
637 | | { |
638 | | GLUSTERD_2_BRICK_XLATOR_DEFRAG, "XLATOR_DEFRAG", |
639 | | glusterd_brick_2_common_call, glusterd_brick_2_common_reply |
640 | | }, |
641 | | { |
642 | | GLUSTERD_2_NODE_PROFILE, "NODE_PROFILE", |
643 | | glusterd_brick_2_common_call, glusterd_brick_2_common_reply |
644 | | }, |
645 | | { |
646 | | GLUSTERD_2_NODE_STATUS, "NODE_STATUS", |
647 | | glusterd_brick_2_common_call, glusterd_brick_2_common_reply |
648 | | }, |
649 | | { 0, NULL, NULL, NULL } |
650 | | }; |
651 | | |
652 | | static const rpc_prog_vers_info gd_mgmt_brick_vers_info[] = { |
653 | | { 2, gd_mgmt_brick_2_proc, &hf_gd_mgmt_brick_2_proc }, |
654 | | }; |
655 | | |
656 | | static const vsff glusterd_friend_proc[] = { |
657 | | { GLUSTERD_FRIEND_NULL, "NULL" , dissect_rpc_void , dissect_rpc_void }, |
658 | | { GLUSTERD_PROBE_QUERY, "PROBE_QUERY" , dissect_rpc_unknown , dissect_rpc_unknown }, |
659 | | { GLUSTERD_FRIEND_ADD, "ADD" , dissect_rpc_unknown , dissect_rpc_unknown }, |
660 | | { GLUSTERD_FRIEND_REMOVE, "REMOVE", dissect_rpc_unknown , dissect_rpc_unknown }, |
661 | | { GLUSTERD_FRIEND_UPDATE, "UPDATE" , dissect_rpc_unknown , dissect_rpc_unknown }, |
662 | | { 0, NULL, NULL, NULL } |
663 | | }; |
664 | | |
665 | | static const rpc_prog_vers_info glusterd_friend_vers_info[] = { |
666 | | { 2, glusterd_friend_proc, &hf_glusterd_friend_proc }, |
667 | | }; |
668 | | |
669 | | static const value_string gd_mgmt_proc_vals[] = { |
670 | | { GD_MGMT_NULL, "NULL" }, |
671 | | { GD_MGMT_PROBE_QUERY, "PROBE_QUERY" }, |
672 | | { GD_MGMT_FRIEND_ADD, "FRIEND_ADD" }, |
673 | | { GD_MGMT_CLUSTER_LOCK, "CLUSTER_LOCK" }, |
674 | | { GD_MGMT_CLUSTER_UNLOCK, "CLUSTER_UNLOCK" }, |
675 | | { GD_MGMT_STAGE_OP, "STAGE_OP" }, |
676 | | { GD_MGMT_COMMIT_OP, "COMMIT_OP" }, |
677 | | { GD_MGMT_FRIEND_REMOVE, "FRIEND_REMOVE" }, |
678 | | { GD_MGMT_FRIEND_UPDATE, "FRIEND_UPDATE" }, |
679 | | { GD_MGMT_CLI_PROBE, "CLI_PROBE" }, |
680 | | { GD_MGMT_CLI_DEPROBE, "CLI_DEPROBE" }, |
681 | | { GD_MGMT_CLI_LIST_FRIENDS, "CLI_LIST_FRIENDS" }, |
682 | | { GD_MGMT_CLI_CREATE_VOLUME, "CLI_CREATE_VOLUME" }, |
683 | | { GD_MGMT_CLI_GET_VOLUME, "CLI_GET_VOLUME" }, |
684 | | { GD_MGMT_CLI_DELETE_VOLUME, "CLI_DELETE_VOLUME" }, |
685 | | { GD_MGMT_CLI_START_VOLUME, "CLI_START_VOLUME" }, |
686 | | { GD_MGMT_CLI_STOP_VOLUME, "CLI_STOP_VOLUME" }, |
687 | | { GD_MGMT_CLI_RENAME_VOLUME, "CLI_RENAME_VOLUME" }, |
688 | | { GD_MGMT_CLI_DEFRAG_VOLUME, "CLI_DEFRAG_VOLUME" }, |
689 | | { GD_MGMT_CLI_SET_VOLUME, "CLI_DEFRAG_VOLUME" }, |
690 | | { GD_MGMT_CLI_ADD_BRICK, "CLI_ADD_BRICK" }, |
691 | | { GD_MGMT_CLI_REMOVE_BRICK, "CLI_REMOVE_BRICK" }, |
692 | | { GD_MGMT_CLI_REPLACE_BRICK, "CLI_REPLACE_BRICK" }, |
693 | | { GD_MGMT_CLI_LOG_FILENAME, "CLI_LOG_FILENAME" }, |
694 | | { GD_MGMT_CLI_LOG_LOCATE, "CLI_LOG_LOCATE" }, |
695 | | { GD_MGMT_CLI_LOG_ROTATE, "CLI_LOG_ROTATE" }, |
696 | | { GD_MGMT_CLI_SYNC_VOLUME, "CLI_SYNC_VOLUME" }, |
697 | | { GD_MGMT_CLI_RESET_VOLUME, "CLI_RESET_VOLUME" }, |
698 | | { GD_MGMT_CLI_FSM_LOG, "CLI_FSM_LOG" }, |
699 | | { GD_MGMT_CLI_GSYNC_SET, "CLI_GSYNC_SET" }, |
700 | | { GD_MGMT_CLI_PROFILE_VOLUME, "CLI_PROFILE_VOLUME" }, |
701 | | { GD_MGMT_BRICK_OP, "BRICK_OP" }, |
702 | | { GD_MGMT_CLI_LOG_LEVEL, "CLI_LOG_LEVEL" }, |
703 | | { GD_MGMT_CLI_STATUS_VOLUME, "CLI_STATUS_VOLUME" }, |
704 | | { 0, NULL } |
705 | | }; |
706 | | static value_string_ext gd_mgmt_proc_vals_ext = VALUE_STRING_EXT_INIT(gd_mgmt_proc_vals); |
707 | | |
708 | | static const value_string gd_mgmt_2_proc_vals[] = { |
709 | | { GLUSTERD_MGMT_2_NULL, "NULL" }, |
710 | | { GLUSTERD_MGMT_2_CLUSTER_LOCK, "CLUSTER_LOCK" }, |
711 | | { GLUSTERD_MGMT_2_CLUSTER_UNLOCK, "CLUSTER_UNLOCK" }, |
712 | | { GLUSTERD_MGMT_2_STAGE_OP, "STAGE_OP"}, |
713 | | { GLUSTERD_MGMT_2_COMMIT_OP, "COMMIT_OP"}, |
714 | | { 0, NULL } |
715 | | }; |
716 | | static value_string_ext gd_mgmt_2_proc_vals_ext = VALUE_STRING_EXT_INIT(gd_mgmt_2_proc_vals); |
717 | | |
718 | | static const value_string gd_mgmt_3_proc_vals[] = { |
719 | | { GLUSTERD_MGMT_3_NULL, "NULL" }, |
720 | | { GLUSTERD_MGMT_3_LOCK, "LOCK" }, |
721 | | { GLUSTERD_MGMT_3_UNLOCK, "UNLOCK" }, |
722 | | { 0, NULL } |
723 | | }; |
724 | | static value_string_ext gd_mgmt_3_proc_vals_ext = VALUE_STRING_EXT_INIT(gd_mgmt_3_proc_vals); |
725 | | |
726 | | static const value_string gd_mgmt_brick_2_proc_vals[] = { |
727 | | { GLUSTERD_2_BRICK_NULL, "NULL" }, /* 0 */ |
728 | | { GLUSTERD_2_BRICK_TERMINATE, "TERMINATE" }, |
729 | | { GLUSTERD_2_BRICK_XLATOR_INFO, "XLATOR_INFO" }, |
730 | | { GLUSTERD_2_BRICK_XLATOR_OP, "XLATOR_OP" }, |
731 | | { GLUSTERD_2_BRICK_STATUS, "STATUS" }, |
732 | | { GLUSTERD_2_BRICK_OP, "OP" }, |
733 | | { GLUSTERD_2_BRICK_XLATOR_DEFRAG, "XLATOR_DEFRAG" }, |
734 | | { GLUSTERD_2_NODE_PROFILE, "NODE_PROFILE" }, |
735 | | { GLUSTERD_2_NODE_STATUS, "NODE_PROFILE" }, |
736 | | { 0, NULL } |
737 | | }; |
738 | | static value_string_ext gd_mgmt_brick_2_proc_vals_ext = VALUE_STRING_EXT_INIT(gd_mgmt_brick_2_proc_vals); |
739 | | |
740 | | static const value_string glusterd_op_vals[] = { |
741 | | { GD_OP_NONE, "NONE" }, |
742 | | { GD_OP_CREATE_VOLUME, "CREATE_VOLUME" }, |
743 | | { GD_OP_START_BRICK, "START_BRICK" }, |
744 | | { GD_OP_STOP_BRICK, "STOP_BRICK" }, |
745 | | { GD_OP_DELETE_VOLUME, "DELETE_VOLUME" }, |
746 | | { GD_OP_START_VOLUME, "START_VOLUME" }, |
747 | | { GD_OP_STOP_VOLUME, "STOP_VOLUME" }, |
748 | | { GD_OP_DEFRAG_VOLUME, "DEFRAG_VOLUME" }, |
749 | | { GD_OP_ADD_BRICK, "ADD_BRICK" }, |
750 | | { GD_OP_REMOVE_BRICK, "REMOVE_BRICK" }, |
751 | | { GD_OP_REPLACE_BRICK, "REPLACE_BRICK" }, |
752 | | { GD_OP_SET_VOLUME, "SET_VOLUME" }, |
753 | | { GD_OP_RESET_VOLUME, "RESET_VOLUME" }, |
754 | | { GD_OP_SYNC_VOLUME, "SYNC_VOLUME" }, |
755 | | { GD_OP_LOG_ROTATE, "LOG_ROTATE" }, |
756 | | { GD_OP_GSYNC_SET, "GSYNC_SET" }, |
757 | | { GD_OP_PROFILE_VOLUME, "PROFILE_VOLUME" }, |
758 | | { GD_OP_QUOTA, "QUOTA" }, |
759 | | { GD_OP_STATUS_VOLUME, "STATUS_VOLUME" }, |
760 | | { GD_OP_REBALANCE, "REBALANCE" }, |
761 | | { GD_OP_HEAL_VOLUME, "HEAL_VOLUME" }, |
762 | | { GD_OP_STATEDUMP_VOLUME, "STATEDUMP_VOLUME" }, |
763 | | { GD_OP_LIST_VOLUME, "LIST_VOLUME" }, |
764 | | { GD_OP_CLEARLOCKS_VOLUME, "CLEARLOCKS_VOLUME" }, |
765 | | { GD_OP_DEFRAG_BRICK_VOLUME, "DEFRAG_BRICK_VOLUME" }, |
766 | | { GD_OP_COPY_FILE, "Copy File" }, |
767 | | { GD_OP_SYS_EXEC, "Execute system commands" }, |
768 | | { GD_OP_GSYNC_CREATE, "Geo-replication Create" }, |
769 | | { GD_OP_SNAP, "Snapshot" }, |
770 | | { 0, NULL } |
771 | | }; |
772 | | static value_string_ext glusterd_op_vals_ext = VALUE_STRING_EXT_INIT(glusterd_op_vals); |
773 | | |
774 | | static const value_string glusterd_friend_proc_vals[] = { |
775 | | { GLUSTERD_FRIEND_NULL, "NULL" }, |
776 | | { GLUSTERD_PROBE_QUERY, "PROBE_QUERY" }, |
777 | | { GLUSTERD_FRIEND_ADD, "ADD" }, |
778 | | { GLUSTERD_FRIEND_REMOVE, "REMOVE" }, |
779 | | { GLUSTERD_FRIEND_UPDATE, "UPDATE" }, |
780 | | { 0, NULL } |
781 | | }; |
782 | | static value_string_ext glusterd_friend_proc_vals_ext = VALUE_STRING_EXT_INIT(glusterd_friend_proc_vals); |
783 | | |
784 | | void |
785 | | proto_register_gluster_gd_mgmt(void) |
786 | 14 | { |
787 | | /* Setup list of header fields See Section 1.6.1 for details */ |
788 | 14 | static hf_register_info hf[] = { |
789 | | /* programs */ |
790 | 14 | { &hf_gd_mgmt_proc, |
791 | 14 | { "Gluster Daemon Management", "glusterd.mgmt.proc", |
792 | 14 | FT_UINT32, BASE_DEC | BASE_EXT_STRING, &gd_mgmt_proc_vals_ext, |
793 | 14 | 0, NULL, HFILL } |
794 | 14 | }, |
795 | 14 | { &hf_gd_mgmt_2_proc, |
796 | 14 | { "Gluster Daemon Management", "glusterd.mgmt.proc", |
797 | 14 | FT_UINT32, BASE_DEC | BASE_EXT_STRING, &gd_mgmt_2_proc_vals_ext, |
798 | 14 | 0, NULL, HFILL } |
799 | 14 | }, |
800 | 14 | { &hf_gd_mgmt_3_proc, |
801 | 14 | { "Gluster Daemon Management", "glusterd.mgmt.proc", |
802 | 14 | FT_UINT32, BASE_DEC | BASE_EXT_STRING, &gd_mgmt_3_proc_vals_ext, |
803 | 14 | 0, NULL, HFILL } |
804 | 14 | }, |
805 | 14 | { &hf_gd_mgmt_brick_2_proc, |
806 | 14 | { "Gluster Daemon Brick Operations", |
807 | 14 | "glusterd.brick.proc", FT_UINT32, BASE_DEC | BASE_EXT_STRING, |
808 | 14 | &gd_mgmt_brick_2_proc_vals_ext, 0, NULL, |
809 | 14 | HFILL } |
810 | 14 | }, |
811 | 14 | { &hf_glusterd_friend_proc , |
812 | 14 | { "Gluster Daemon Friend Operations", |
813 | 14 | "glusterd.friend.proc", FT_UINT32, BASE_DEC | BASE_EXT_STRING, |
814 | 14 | &glusterd_friend_proc_vals_ext, 0, NULL, |
815 | 14 | HFILL } |
816 | 14 | }, |
817 | 14 | { &hf_glusterd_dict, |
818 | 14 | { "Dict", "glusterd.dict", FT_STRING, BASE_NONE, |
819 | 14 | NULL, 0, NULL, HFILL } |
820 | 14 | }, |
821 | 14 | { &hf_glusterd_op, |
822 | 14 | { "Operation", "glusterd.op", FT_UINT32, BASE_DEC | BASE_EXT_STRING, |
823 | 14 | &glusterd_op_vals_ext, 0, NULL, HFILL } |
824 | 14 | }, |
825 | 14 | { &hf_glusterd_op_ret, |
826 | 14 | { "Return of previous operation", "glusterd.op_ret", |
827 | 14 | FT_UINT32, BASE_DEC, NULL , 0, NULL, HFILL } |
828 | 14 | }, |
829 | 14 | { &hf_glusterd_op_errstr, |
830 | 14 | { "Error", "glusterd.op_errstr", FT_STRING, |
831 | 14 | BASE_NONE, NULL, 0, NULL, HFILL } |
832 | 14 | }, |
833 | 14 | { &hf_glusterd_uuid, |
834 | 14 | { "UUID", "glusterd.uuid", FT_GUID, |
835 | 14 | BASE_NONE, NULL, 0, NULL, HFILL } |
836 | 14 | }, |
837 | 14 | { &hf_glusterd_tnx_id, |
838 | 14 | { "Transaction ID", "glusterd.tnx_id", FT_GUID, |
839 | 14 | BASE_NONE, NULL, 0, NULL, HFILL } |
840 | 14 | }, |
841 | 14 | { &hf_glusterd_hostname, |
842 | 14 | { "Hostname", "glusterd.hostname", FT_STRING, |
843 | 14 | BASE_NONE, NULL, 0, NULL, HFILL } |
844 | 14 | }, |
845 | 14 | { &hf_glusterd_port, |
846 | 14 | { "Port", "glusterd.port", FT_INT32, BASE_DEC, |
847 | 14 | NULL, 0, NULL, HFILL } |
848 | 14 | }, |
849 | 14 | { &hf_glusterd_vols, |
850 | 14 | { "Volumes", "glusterd.vols", FT_STRING, BASE_NONE, |
851 | 14 | NULL, 0, NULL, HFILL } |
852 | 14 | }, |
853 | 14 | { &hf_glusterd_buf, |
854 | 14 | { "Buffer", "glusterd.buffer", FT_STRING, BASE_NONE, |
855 | 14 | NULL, 0, NULL, HFILL } |
856 | 14 | }, |
857 | 14 | { &hf_glusterd_name, |
858 | 14 | { "Name", "glusterd.name", FT_STRING, BASE_NONE, |
859 | 14 | NULL, 0, NULL, HFILL } |
860 | 14 | } |
861 | 14 | }; |
862 | | |
863 | | /* Setup protocol subtree array */ |
864 | 14 | static int *ett[] = { |
865 | 14 | &ett_gd_mgmt, |
866 | 14 | &ett_gd_brick, |
867 | 14 | &ett_gd_friend |
868 | 14 | }; |
869 | | |
870 | | /* Register the protocol name and description */ |
871 | 14 | proto_glusterd = proto_register_protocol("Gluster Daemon", "GlusterD", "glusterd"); |
872 | 14 | proto_register_subtree_array(ett, array_length(ett)); |
873 | 14 | proto_register_field_array(proto_glusterd, hf, array_length(hf)); |
874 | | |
875 | 14 | proto_gd_mgmt = proto_register_protocol_in_name_only("Gluster Daemon Management", |
876 | 14 | "GlusterD Management", "glusterd.mgmt", proto_glusterd, FT_PROTOCOL); |
877 | 14 | proto_gd_brick = proto_register_protocol_in_name_only( |
878 | 14 | "Gluster Daemon Brick Operations", |
879 | 14 | "GlusterD Brick", "glusterd.brick", proto_glusterd, FT_PROTOCOL); |
880 | 14 | proto_gd_friend = proto_register_protocol_in_name_only( |
881 | 14 | "Gluster Daemon Friend Operations", |
882 | 14 | "GlusterD Friend", "glusterd.friend", proto_glusterd, FT_PROTOCOL); |
883 | 14 | } |
884 | | |
885 | | void |
886 | | proto_reg_handoff_gluster_gd_mgmt(void) |
887 | 14 | { |
888 | 14 | rpc_init_prog(proto_gd_mgmt, GD_MGMT_PROGRAM, ett_gd_mgmt, |
889 | 14 | G_N_ELEMENTS(glusterd_mgmt_vers_info), glusterd_mgmt_vers_info); |
890 | | |
891 | 14 | rpc_init_prog(proto_gd_brick, GD_BRICK_PROGRAM, ett_gd_brick, |
892 | 14 | G_N_ELEMENTS(gd_mgmt_brick_vers_info), gd_mgmt_brick_vers_info); |
893 | | |
894 | 14 | rpc_init_prog(proto_gd_friend, GD_FRIEND_PROGRAM, ett_gd_friend, |
895 | | G_N_ELEMENTS(glusterd_friend_vers_info), glusterd_friend_vers_info); |
896 | 14 | } |
897 | | |
898 | | /* |
899 | | * Editor modelines - https://www.wireshark.org/tools/modelines.html |
900 | | * |
901 | | * Local variables: |
902 | | * c-basic-offset: 8 |
903 | | * tab-width: 8 |
904 | | * indent-tabs-mode: t |
905 | | * End: |
906 | | * |
907 | | * vi: set shiftwidth=8 tabstop=8 noexpandtab: |
908 | | * :indentSize=8:tabSize=8:noTabs=false: |
909 | | */ |