1 /* packet-ceph.c
2  * Routines for Ceph dissection
3  * Copyright 2014, Kevin Cox <kevincox@kevincox.ca>
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 #include "config.h"
13 
14 #include <epan/packet.h>
15 #include <epan/expert.h>
16 #include <epan/conversation.h>
17 #include <epan/to_str.h>
18 #include <epan/proto_data.h>
19 
20 void proto_reg_handoff_ceph(void);
21 void proto_register_ceph(void);
22 
23 /* Extending the Ceph Dissector.
24  *
25  * Hello, this is a quick overview of the insertion points in the Ceph dissector
26  * it is assumed that you know how dissectors work in general (if not please
27  * read 'doc/README.dissector' and related documents).
28  *
29  * If you have any questions feel free to contact Kevin <kevincox@kevincox.ca>.
30  *
31  * ## Adding a MSGR Tag
32  *
33  * To add a MSGR tag you must update the switch statements inside both
34  * `c_dissect_msgr()` to actually dissect the data and `c_pdu_end()` to
35  * calculate the length of the data.
36  *
37  * ## Adding a New Message.
38  *
39  * To add a new message type you simply create a new function
40  * `c_dissect_msg_{name}()` with the same signature as the others.  Please
41  * insert your function in order of the tag value like the others.
42  *
43  * Then you simply add it into the switch in `c_dissect_msg()` (also in the
44  * correct order).  Your message will then be dissected when encountered.
45  *
46  * ## Supporting new encodings.
47  *
48  * ### Message Encodings.
49  *
50  * The encoding version of messages is available in `data->head.ver` and the
51  * code should be modified to conditionally decode the new version of the
52  * message.
53  *
54  * ### Data Type Encodings.
55  *
56  * Data types encoded using Ceph's `ENCODE_START()` macro can be decoded by
57  * using `c_dissect_encoded()` to extract the version and length.  You can
58  * then conditionally decode using the version.
59  *
60  * Please rely on the length returned by `c_dissect_encoded()` to ensure future
61  * compatibility.
62  */
63 
64 static dissector_handle_t ceph_handle;
65 
66 /* Initialize the protocol and registered fields */
67 static int proto_ceph				 = -1;
68 static int hf_filter_data			 = -1;
69 static int hf_node_id				 = -1;
70 static int hf_node_type				 = -1;
71 static int hf_node_nonce			 = -1;
72 static int hf_entityinst_name			 = -1;
73 static int hf_entityinst_addr			 = -1;
74 static int hf_EntityName			 = -1;
75 static int hf_EntityName_type			 = -1;
76 static int hf_EntityName_id			 = -1;
77 static int hf_src_slug				 = -1;
78 static int hf_src_type				 = -1;
79 static int hf_dst_type				 = -1;
80 static int hf_dst_slug				 = -1;
81 static int hf_banner				 = -1;
82 static int hf_client_info			 = -1;
83 static int hf_server_info			 = -1;
84 static int hf_sockaddr				 = -1;
85 static int hf_inet_family			 = -1;
86 static int hf_port				 = -1;
87 static int hf_addr_ipv4				 = -1;
88 static int hf_addr_ipv6				 = -1;
89 static int hf_data_data				 = -1;
90 static int hf_data_size				 = -1;
91 static int hf_string_data			 = -1;
92 static int hf_string_size			 = -1;
93 static int hf_keepalive_time			 = -1;
94 static int hf_encoded_ver			 = -1;
95 static int hf_encoded_compat			 = -1;
96 static int hf_encoded_size			 = -1;
97 static int hf_version				 = -1;
98 static int hf_epoch				 = -1;
99 static int hf_pool				 = -1;
100 static int hf_key				 = -1;
101 static int hf_namespace				 = -1;
102 static int hf_hash				 = -1;
103 static int hf_pgid_ver				 = -1;
104 static int hf_pgid_pool				 = -1;
105 static int hf_pgid_seed				 = -1;
106 static int hf_pgid_preferred			 = -1;
107 static int hf_pg_create_epoch			 = -1;
108 static int hf_pg_create_parent			 = -1;
109 static int hf_pg_create_splitbits		 = -1;
110 static int hf_path_ver				 = -1;
111 static int hf_path_inode			 = -1;
112 static int hf_path_rel				 = -1;
113 static int hf_mds_release_inode			 = -1;
114 static int hf_mds_release_capid			 = -1;
115 static int hf_mds_release_new			 = -1;
116 static int hf_mds_release_wanted		 = -1;
117 static int hf_mds_release_seq			 = -1;
118 static int hf_mds_release_seq_issue		 = -1;
119 static int hf_mds_release_mseq			 = -1;
120 static int hf_mds_release_dname_seq		 = -1;
121 static int hf_mds_release_dname			 = -1;
122 static int hf_hitset_params			 = -1;
123 static int hf_hitset_params_type		 = -1;
124 static int hf_hitset_params_exphash_count	 = -1;
125 static int hf_hitset_params_exphash_hit		 = -1;
126 static int hf_snapinfo				 = -1;
127 static int hf_snapinfo_id			 = -1;
128 static int hf_snapinfo_time			 = -1;
129 static int hf_snapinfo_name			 = -1;
130 static int hf_pgpool				 = -1;
131 static int hf_pgpool_type			 = -1;
132 static int hf_pgpool_size			 = -1;
133 static int hf_pgpool_crush_ruleset		 = -1;
134 static int hf_pgpool_hash			 = -1;
135 static int hf_pgpool_pgnum			 = -1;
136 static int hf_pgpool_pgpnum			 = -1;
137 static int hf_pgpool_changed			 = -1;
138 static int hf_pgpool_snapseq			 = -1;
139 static int hf_pgpool_snapepoch			 = -1;
140 static int hf_pgpool_snap			 = -1;
141 static int hf_pgpool_snap_id			 = -1;
142 static int hf_pgpool_snapdel			 = -1;
143 static int hf_pgpool_snapdel_from		 = -1;
144 static int hf_pgpool_snapdel_to			 = -1;
145 static int hf_pgpool_uid			 = -1;
146 static int hf_pgpool_flags_low			 = -1;
147 static int hf_pgpool_flags_high			 = -1;
148 static int hf_pgpool_crash_reply_interval	 = -1;
149 static int hf_pgpool_min_size			 = -1;
150 static int hf_pgpool_quota_bytes		 = -1;
151 static int hf_pgpool_quota_objects		 = -1;
152 static int hf_pgpool_tier			 = -1;
153 static int hf_pgpool_tierof			 = -1;
154 static int hf_pgpool_cachemode			 = -1;
155 static int hf_pgpool_readtier			 = -1;
156 static int hf_pgpool_writetier			 = -1;
157 static int hf_pgpool_property			 = -1;
158 static int hf_pgpool_property_key		 = -1;
159 static int hf_pgpool_property_val		 = -1;
160 static int hf_pgpool_hitset_period		 = -1;
161 static int hf_pgpool_hitset_count		 = -1;
162 static int hf_pgpool_stripewidth		 = -1;
163 static int hf_pgpool_targetmaxsize		 = -1;
164 static int hf_pgpool_targetmaxobj		 = -1;
165 static int hf_pgpool_cache_targetdirtyratio	 = -1;
166 static int hf_pgpool_cache_targetfullratio	 = -1;
167 static int hf_pgpool_cache_flushage_min		 = -1;
168 static int hf_pgpool_cache_evictage_min		 = -1;
169 static int hf_pgpool_erasurecode_profile	 = -1;
170 static int hf_pgpool_lastforceresend		 = -1;
171 static int hf_pgpool_flag_hashpool		 = -1;
172 static int hf_pgpool_flag_full			 = -1;
173 static int hf_pgpool_flag_fake_ec_pool		 = -1;
174 static int hf_monmap				 = -1;
175 static int hf_monmap_fsid			 = -1;
176 static int hf_monmap_epoch			 = -1;
177 static int hf_monmap_address			 = -1;
178 static int hf_monmap_address_name		 = -1;
179 static int hf_monmap_address_addr		 = -1;
180 static int hf_monmap_changed			 = -1;
181 static int hf_monmap_created			 = -1;
182 static int hf_pg_stat_ver			 = -1;
183 static int hf_pg_stat_seq			 = -1;
184 static int hf_pg_stat_epoch			 = -1;
185 static int hf_pg_stat_state			 = -1;
186 static int hf_pg_stat_logstart			 = -1;
187 static int hf_pg_stat_logstartondisk		 = -1;
188 static int hf_pg_stat_created			 = -1;
189 static int hf_pg_stat_lastepochclean		 = -1;
190 static int hf_pg_stat_parent			 = -1;
191 static int hf_pg_stat_parent_splitbits		 = -1;
192 static int hf_pg_stat_lastscrub			 = -1;
193 static int hf_pg_stat_lastscrubstamp		 = -1;
194 static int hf_pg_stat_stats			 = -1;
195 static int hf_pg_stat_logsize			 = -1;
196 static int hf_pg_stat_logsizeondisk		 = -1;
197 static int hf_pg_stat_up			 = -1;
198 static int hf_pg_stat_acting			 = -1;
199 static int hf_pg_stat_lastfresh			 = -1;
200 static int hf_pg_stat_lastchange		 = -1;
201 static int hf_pg_stat_lastactive		 = -1;
202 static int hf_pg_stat_lastclean			 = -1;
203 static int hf_pg_stat_lastunstale		 = -1;
204 static int hf_pg_stat_mappingepoch		 = -1;
205 static int hf_pg_stat_lastdeepscrub		 = -1;
206 static int hf_pg_stat_lastdeepscrubstamp	 = -1;
207 static int hf_pg_stat_statsinvalid		 = -1;
208 static int hf_pg_stat_lastcleanscrubstamp	 = -1;
209 static int hf_pg_stat_lastbecameactive		 = -1;
210 static int hf_pg_stat_dirtystatsinvalid		 = -1;
211 static int hf_pg_stat_upprimary			 = -1;
212 static int hf_pg_stat_actingprimary		 = -1;
213 static int hf_pg_stat_omapstatsinvalid		 = -1;
214 static int hf_pg_stat_hitsetstatsinvalid	 = -1;
215 static int hf_crush				 = -1;
216 static int hf_osd_peerstat			 = -1;
217 static int hf_osd_peerstat_timestamp		 = -1;
218 static int hf_featureset_mask			 = -1;
219 static int hf_featureset_name			 = -1;
220 static int hf_featureset_name_val		 = -1;
221 static int hf_featureset_name_name		 = -1;
222 static int hf_compatset				 = -1;
223 static int hf_compatset_compat			 = -1;
224 static int hf_compatset_compatro		 = -1;
225 static int hf_compatset_incompat		 = -1;
226 static int hf_osd_superblock			 = -1;
227 static int hf_osd_superblock_clusterfsid	 = -1;
228 static int hf_osd_superblock_role		 = -1;
229 static int hf_osd_superblock_epoch		 = -1;
230 static int hf_osd_superblock_map_old		 = -1;
231 static int hf_osd_superblock_map_new		 = -1;
232 static int hf_osd_superblock_weight		 = -1;
233 static int hf_osd_superblock_mounted		 = -1;
234 static int hf_osd_superblock_osdfsid		 = -1;
235 static int hf_osd_superblock_clean		 = -1;
236 static int hf_osd_superblock_full		 = -1;
237 static int hf_osdinfo_ver			 = -1;
238 static int hf_osdinfo_lastclean_begin		 = -1;
239 static int hf_osdinfo_lastclean_end		 = -1;
240 static int hf_osdinfo_up_from			 = -1;
241 static int hf_osdinfo_up_through		 = -1;
242 static int hf_osdinfo_downat			 = -1;
243 static int hf_osdinfo_lostat			 = -1;
244 static int hf_osdxinfo_down			 = -1;
245 static int hf_osdxinfo_laggy_probability	 = -1;
246 static int hf_osdxinfo_laggy_interval		 = -1;
247 static int hf_osdxinfo_oldweight		 = -1;
248 static int hf_perfstat_commitlatency		 = -1;
249 static int hf_perfstat_applylatency		 = -1;
250 static int hf_osdstat				 = -1;
251 static int hf_osdstat_kb			 = -1;
252 static int hf_osdstat_kbused			 = -1;
253 static int hf_osdstat_kbavail			 = -1;
254 static int hf_osdstat_trimqueue			 = -1;
255 static int hf_osdstat_trimming			 = -1;
256 static int hf_osdstat_hbin			 = -1;
257 static int hf_osdstat_hbout			 = -1;
258 static int hf_osdstat_opqueue			 = -1;
259 static int hf_osdstat_fsperf			 = -1;
260 static int hf_osdmap				 = -1;
261 static int hf_osdmap_client			 = -1;
262 static int hf_osdmap_fsid			 = -1;
263 static int hf_osdmap_epoch			 = -1;
264 static int hf_osdmap_created			 = -1;
265 static int hf_osdmap_modified			 = -1;
266 static int hf_osdmap_pool			 = -1;
267 static int hf_osdmap_pool_id			 = -1;
268 static int hf_osdmap_poolname_item		 = -1;
269 static int hf_osdmap_poolname			 = -1;
270 static int hf_osdmap_poolmax			 = -1;
271 static int hf_osdmap_flags			 = -1;
272 static int hf_osdmap_osdmax			 = -1;
273 static int hf_osdmap_osd_state			 = -1;
274 static int hf_osdmap_osd_weight			 = -1;
275 static int hf_osdmap_osd_addr			 = -1;
276 static int hf_osdmap_pgtmp			 = -1;
277 static int hf_osdmap_pgtmp_pg			 = -1;
278 static int hf_osdmap_pgtmp_val			 = -1;
279 static int hf_osdmap_primarytmp			 = -1;
280 static int hf_osdmap_primarytmp_pg		 = -1;
281 static int hf_osdmap_primarytmp_val		 = -1;
282 static int hf_osdmap_osd_primaryaffinity	 = -1;
283 static int hf_osdmap_erasurecodeprofile		 = -1;
284 static int hf_osdmap_erasurecodeprofile_name	 = -1;
285 static int hf_osdmap_erasurecodeprofile_prop	 = -1;
286 static int hf_osdmap_erasurecodeprofile_k	 = -1;
287 static int hf_osdmap_erasurecodeprofile_v	 = -1;
288 static int hf_osdmap_osd			 = -1;
289 static int hf_osdmap_hbaddr_back		 = -1;
290 static int hf_osdmap_osd_info			 = -1;
291 static int hf_osdmap_blacklist			 = -1;
292 static int hf_osdmap_blacklist_addr		 = -1;
293 static int hf_osdmap_blacklist_time		 = -1;
294 static int hf_osdmap_cluster_addr		 = -1;
295 static int hf_osdmap_cluster_snapepoch		 = -1;
296 static int hf_osdmap_cluster_snap		 = -1;
297 static int hf_osdmap_osd_uuid			 = -1;
298 static int hf_osdmap_osd_xinfo			 = -1;
299 static int hf_osdmap_hbaddr_front		 = -1;
300 static int hf_osdmap_inc			 = -1;
301 static int hf_osdmap_inc_client			 = -1;
302 static int hf_osdmap_inc_fsid			 = -1;
303 static int hf_osdmap_inc_osd			 = -1;
304 static int hf_features_high			 = -1;
305 static int hf_features_low			 = -1;
306 static int hf_feature_uid			 = -1;
307 static int hf_feature_nosrcaddr			 = -1;
308 static int hf_feature_monclockcheck		 = -1;
309 static int hf_feature_flock			 = -1;
310 static int hf_feature_subscribe2		 = -1;
311 static int hf_feature_monnames			 = -1;
312 static int hf_feature_reconnect_seq		 = -1;
313 static int hf_feature_dirlayouthash		 = -1;
314 static int hf_feature_objectlocator		 = -1;
315 static int hf_feature_pgid64			 = -1;
316 static int hf_feature_incsubosdmap		 = -1;
317 static int hf_feature_pgpool3			 = -1;
318 static int hf_feature_osdreplymux		 = -1;
319 static int hf_feature_osdenc			 = -1;
320 static int hf_feature_omap			 = -1;
321 static int hf_feature_monenc			 = -1;
322 static int hf_feature_query_t			 = -1;
323 static int hf_feature_indep_pg_map		 = -1;
324 static int hf_feature_crush_tunables		 = -1;
325 static int hf_feature_chunky_scrub		 = -1;
326 static int hf_feature_mon_nullroute		 = -1;
327 static int hf_feature_mon_gv			 = -1;
328 static int hf_feature_backfill_reservation	 = -1;
329 static int hf_feature_msg_auth			 = -1;
330 static int hf_feature_recovery_reservation	 = -1;
331 static int hf_feature_crush_tunables2		 = -1;
332 static int hf_feature_createpoolid		 = -1;
333 static int hf_feature_reply_create_inode	 = -1;
334 static int hf_feature_osd_hbmsgs		 = -1;
335 static int hf_feature_mdsenc			 = -1;
336 static int hf_feature_osdhashpspool		 = -1;
337 static int hf_feature_mon_single_paxos		 = -1;
338 static int hf_feature_osd_snapmapper		 = -1;
339 static int hf_feature_mon_scrub			 = -1;
340 static int hf_feature_osd_packed_recovery	 = -1;
341 static int hf_feature_osd_cachepool		 = -1;
342 static int hf_feature_crush_v2			 = -1;
343 static int hf_feature_export_peer		 = -1;
344 static int hf_feature_osd_erasure_codes		 = -1;
345 static int hf_feature_osd_tmap2omap		 = -1;
346 static int hf_feature_osdmap_enc		 = -1;
347 static int hf_feature_mds_inline_data		 = -1;
348 static int hf_feature_crush_tunables3		 = -1;
349 static int hf_feature_osd_primary_affinity	 = -1;
350 static int hf_feature_msgr_keepalive2		 = -1;
351 static int hf_feature_reserved			 = -1;
352 static int hf_connect_host_type			 = -1;
353 static int hf_connect_seq_global		 = -1;
354 static int hf_connect_seq			 = -1;
355 static int hf_connect_proto_ver			 = -1;
356 static int hf_connect_auth_proto		 = -1;
357 static int hf_connect_auth_size			 = -1;
358 static int hf_connect_auth			 = -1;
359 static int hf_flags				 = -1;
360 static int hf_flag_lossy			 = -1;
361 static int hf_osd_flags				 = -1;
362 static int hf_osd_flag_ack			 = -1;
363 static int hf_osd_flag_onnvram			 = -1;
364 static int hf_osd_flag_ondisk			 = -1;
365 static int hf_osd_flag_retry			 = -1;
366 static int hf_osd_flag_read			 = -1;
367 static int hf_osd_flag_write			 = -1;
368 static int hf_osd_flag_ordersnap		 = -1;
369 static int hf_osd_flag_peerstat_old		 = -1;
370 static int hf_osd_flag_balance_reads		 = -1;
371 static int hf_osd_flag_parallelexec		 = -1;
372 static int hf_osd_flag_pgop			 = -1;
373 static int hf_osd_flag_exec			 = -1;
374 static int hf_osd_flag_exec_public		 = -1;
375 static int hf_osd_flag_localize_reads		 = -1;
376 static int hf_osd_flag_rwordered		 = -1;
377 static int hf_osd_flag_ignore_cache		 = -1;
378 static int hf_osd_flag_skiprwlocks		 = -1;
379 static int hf_osd_flag_ignore_overlay		 = -1;
380 static int hf_osd_flag_flush			 = -1;
381 static int hf_osd_flag_map_snap_clone		 = -1;
382 static int hf_osd_flag_enforce_snapc		 = -1;
383 static int hf_osd_op_type			 = -1;
384 static int hf_osd_op_data			 = -1;
385 static int hf_osd_op_extent_off			 = -1;
386 static int hf_osd_op_extent_size		 = -1;
387 static int hf_osd_op_extent_trunc_size		 = -1;
388 static int hf_osd_op_extent_trunc_seq		 = -1;
389 static int hf_osd_op_payload_size		 = -1;
390 static int hf_osd_redirect_oloc			 = -1;
391 static int hf_osd_redirect_obj			 = -1;
392 static int hf_osd_redirect_osdinstr		 = -1;
393 static int hf_osd_redirect_osdinstr_data	 = -1;
394 static int hf_osd_redirect_osdinstr_len		 = -1;
395 static int hf_statsum_bytes			 = -1;
396 static int hf_statsum_objects			 = -1;
397 static int hf_statsum_clones			 = -1;
398 static int hf_statsum_copies			 = -1;
399 static int hf_statsum_missing			 = -1;
400 static int hf_statsum_degraded			 = -1;
401 static int hf_statsum_unfound			 = -1;
402 static int hf_statsum_read_bytes		 = -1;
403 static int hf_statsum_read_kbytes		 = -1;
404 static int hf_statsum_written_bytes		 = -1;
405 static int hf_statsum_written_kbytes		 = -1;
406 static int hf_statsum_scrub_errors		 = -1;
407 static int hf_statsum_recovered			 = -1;
408 static int hf_statsum_bytes_recovered		 = -1;
409 static int hf_statsum_keys_recovered		 = -1;
410 static int hf_statsum_shallow_scrub_errors	 = -1;
411 static int hf_statsum_deep_scrub_errors		 = -1;
412 static int hf_statsum_dirty			 = -1;
413 static int hf_statsum_whiteouts			 = -1;
414 static int hf_statsum_omap			 = -1;
415 static int hf_statsum_hitset_archive		 = -1;
416 static int hf_connect				 = -1;
417 static int hf_connect_reply			 = -1;
418 static int hf_tag				 = -1;
419 static int hf_ack				 = -1;
420 static int hf_seq_existing			 = -1;
421 static int hf_seq_new				 = -1;
422 static int hf_head				 = -1;
423 static int hf_head_seq				 = -1;
424 static int hf_head_tid				 = -1;
425 static int hf_head_type				 = -1;
426 static int hf_head_priority			 = -1;
427 static int hf_head_version			 = -1;
428 static int hf_head_front_size			 = -1;
429 static int hf_head_middle_size			 = -1;
430 static int hf_head_data_size			 = -1;
431 static int hf_head_data_off			 = -1;
432 static int hf_head_srcname			 = -1;
433 static int hf_head_compat_version		 = -1;
434 static int hf_head_reserved			 = -1;
435 static int hf_head_crc				 = -1;
436 static int hf_foot				 = -1;
437 static int hf_foot_front_crc			 = -1;
438 static int hf_foot_middle_crc			 = -1;
439 static int hf_foot_data_crc			 = -1;
440 static int hf_foot_signature			 = -1;
441 static int hf_msg_front				 = -1;
442 static int hf_msg_middle			 = -1;
443 static int hf_msg_data				 = -1;
444 static int hf_statcollection			 = -1;
445 static int hf_paxos				 = -1;
446 static int hf_paxos_ver				 = -1;
447 static int hf_paxos_mon				 = -1;
448 static int hf_paxos_mon_tid			 = -1;
449 static int hf_msg_mon_map			 = -1;
450 static int hf_msg_statfs			 = -1;
451 static int hf_msg_statfs_fsid			 = -1;
452 static int hf_msg_statfsreply			 = -1;
453 static int hf_msg_statfsreply_fsid		 = -1;
454 static int hf_msg_statfsreply_ver		 = -1;
455 static int hf_msg_statfsreply_kb		 = -1;
456 static int hf_msg_statfsreply_kbused		 = -1;
457 static int hf_msg_statfsreply_kbavail		 = -1;
458 static int hf_msg_statfsreply_obj		 = -1;
459 static int hf_msg_mon_sub			 = -1;
460 static int hf_msg_mon_sub_item			 = -1;
461 static int hf_msg_mon_sub_item_len		 = -1;
462 static int hf_msg_mon_sub_what			 = -1;
463 static int hf_msg_mon_sub_start			 = -1;
464 static int hf_msg_mon_sub_flags			 = -1;
465 static int hf_msg_mon_sub_flags_onetime		 = -1;
466 static int hf_msg_mon_sub_ack			 = -1;
467 static int hf_msg_mon_sub_ack_interval		 = -1;
468 static int hf_msg_mon_sub_ack_fsid		 = -1;
469 static int hf_msg_auth				 = -1;
470 static int hf_msg_auth_proto			 = -1;
471 static int hf_msg_auth_supportedproto		 = -1;
472 static int hf_msg_auth_supportedproto_ver	 = -1;
473 static int hf_msg_auth_supportedproto_proto	 = -1;
474 static int hf_msg_auth_supportedproto_gid	 = -1;
475 static int hf_msg_auth_cephx			 = -1;
476 static int hf_msg_auth_cephx_req_type		 = -1;
477 static int hf_msg_auth_monmap_epoch		 = -1;
478 static int hf_msg_auth_reply			 = -1;
479 static int hf_msg_auth_reply_proto		 = -1;
480 static int hf_msg_auth_reply_result		 = -1;
481 static int hf_msg_auth_reply_global_id		 = -1;
482 static int hf_msg_auth_reply_msg		 = -1;
483 static int hf_msg_mon_getversion		 = -1;
484 static int hf_msg_mon_getversion_tid		 = -1;
485 static int hf_msg_mon_getversion_what		 = -1;
486 static int hf_msg_mon_getversionreply		 = -1;
487 static int hf_msg_mon_getversionreply_tid	 = -1;
488 static int hf_msg_mon_getversionreply_ver	 = -1;
489 static int hf_msg_mon_getversionreply_veroldest	 = -1;
490 static int hf_msg_mds_map			 = -1;
491 static int hf_msg_mds_map_fsid			 = -1;
492 static int hf_msg_mds_map_epoch			 = -1;
493 static int hf_msg_mds_map_datai			 = -1;
494 static int hf_msg_mds_map_data			 = -1;
495 static int hf_msg_mds_map_data_size		 = -1;
496 static int hf_msg_client_sess			 = -1;
497 static int hf_msg_client_sess_op		 = -1;
498 static int hf_msg_client_sess_seq		 = -1;
499 static int hf_msg_client_sess_time		 = -1;
500 static int hf_msg_client_sess_caps_max		 = -1;
501 static int hf_msg_client_sess_leases_max	 = -1;
502 static int hf_msg_client_req			 = -1;
503 static int hf_msg_client_req_oldest_tid		 = -1;
504 static int hf_msg_client_req_mdsmap_epoch	 = -1;
505 static int hf_msg_client_req_flags		 = -1;
506 static int hf_msg_client_req_retry		 = -1;
507 static int hf_msg_client_req_forward		 = -1;
508 static int hf_msg_client_req_releases		 = -1;
509 static int hf_msg_client_req_op			 = -1;
510 static int hf_msg_client_req_caller_uid		 = -1;
511 static int hf_msg_client_req_caller_gid		 = -1;
512 static int hf_msg_client_req_inode		 = -1;
513 static int hf_msg_client_req_path_src		 = -1;
514 static int hf_msg_client_req_path_dst		 = -1;
515 static int hf_msg_client_req_release		 = -1;
516 static int hf_msg_client_req_time		 = -1;
517 static int hf_msg_client_reqfwd			 = -1;
518 static int hf_msg_client_reqfwd_dst		 = -1;
519 static int hf_msg_client_reqfwd_fwd		 = -1;
520 static int hf_msg_client_reqfwd_resend		 = -1;
521 static int hf_msg_client_reply			 = -1;
522 static int hf_msg_client_reply_op		 = -1;
523 static int hf_msg_client_reply_result		 = -1;
524 static int hf_msg_client_reply_mdsmap_epoch	 = -1;
525 static int hf_msg_client_reply_safe		 = -1;
526 static int hf_msg_client_reply_isdentry		 = -1;
527 static int hf_msg_client_reply_istarget		 = -1;
528 static int hf_msg_client_reply_trace		 = -1;
529 static int hf_msg_client_reply_extra		 = -1;
530 static int hf_msg_client_reply_snaps		 = -1;
531 static int hf_msg_osd_map			 = -1;
532 static int hf_msg_osd_map_fsid			 = -1;
533 static int hf_msg_osd_map_inc			 = -1;
534 static int hf_msg_osd_map_inc_len		 = -1;
535 static int hf_msg_osd_map_map			 = -1;
536 static int hf_msg_osd_map_map_len		 = -1;
537 static int hf_msg_osd_map_epoch			 = -1;
538 static int hf_msg_osd_map_oldest		 = -1;
539 static int hf_msg_osd_map_newest		 = -1;
540 static int hf_msg_osd_op			 = -1;
541 static int hf_msg_osd_op_client_inc		 = -1;
542 static int hf_msg_osd_op_osdmap_epoch		 = -1;
543 static int hf_msg_osd_op_mtime			 = -1;
544 static int hf_msg_osd_op_reassert_version	 = -1;
545 static int hf_msg_osd_op_oloc			 = -1;
546 static int hf_msg_osd_op_pgid			 = -1;
547 static int hf_msg_osd_op_oid			 = -1;
548 static int hf_msg_osd_op_ops_len		 = -1;
549 static int hf_msg_osd_op_op			 = -1;
550 static int hf_msg_osd_op_snap_id		 = -1;
551 static int hf_msg_osd_op_snap_seq		 = -1;
552 static int hf_msg_osd_op_snaps_len		 = -1;
553 static int hf_msg_osd_op_snap			 = -1;
554 static int hf_msg_osd_op_retry_attempt		 = -1;
555 static int hf_msg_osd_op_payload		 = -1;
556 static int hf_msg_osd_opreply			 = -1;
557 static int hf_msg_osd_opreply_oid		 = -1;
558 static int hf_msg_osd_opreply_pgid		 = -1;
559 static int hf_msg_osd_opreply_result		 = -1;
560 static int hf_msg_osd_opreply_bad_replay_ver	 = -1;
561 static int hf_msg_osd_opreply_osdmap_epoch	 = -1;
562 static int hf_msg_osd_opreply_ops_len		 = -1;
563 static int hf_msg_osd_opreply_op		 = -1;
564 static int hf_msg_osd_opreply_retry_attempt	 = -1;
565 static int hf_msg_osd_opreply_rval		 = -1;
566 static int hf_msg_osd_opreply_replay_ver	 = -1;
567 static int hf_msg_osd_opreply_user_ver		 = -1;
568 static int hf_msg_osd_opreply_redirect		 = -1;
569 static int hf_msg_osd_opreply_payload		 = -1;
570 static int hf_msg_poolopreply			 = -1;
571 static int hf_msg_poolopreply_fsid		 = -1;
572 static int hf_msg_poolopreply_code		 = -1;
573 static int hf_msg_poolopreply_epoch		 = -1;
574 static int hf_msg_poolopreply_datai		 = -1;
575 static int hf_msg_poolopreply_data		 = -1;
576 static int hf_msg_poolopreply_data_size		 = -1;
577 static int hf_msg_poolop			 = -1;
578 static int hf_msg_poolop_fsid			 = -1;
579 static int hf_msg_poolop_pool			 = -1;
580 static int hf_msg_poolop_type			 = -1;
581 static int hf_msg_poolop_auid			 = -1;
582 static int hf_msg_poolop_snapid			 = -1;
583 static int hf_msg_poolop_name			 = -1;
584 static int hf_msg_poolop_crush_rule		 = -1;
585 static int hf_msg_poolop_crush_rule8		 = -1;
586 static int hf_msg_mon_cmd			 = -1;
587 static int hf_msg_mon_cmd_fsid			 = -1;
588 static int hf_msg_mon_cmd_arg			 = -1;
589 static int hf_msg_mon_cmd_arg_len		 = -1;
590 static int hf_msg_mon_cmd_str			 = -1;
591 static int hf_msg_mon_cmd_ack			 = -1;
592 static int hf_msg_mon_cmd_ack_code		 = -1;
593 static int hf_msg_mon_cmd_ack_res		 = -1;
594 static int hf_msg_mon_cmd_ack_arg		 = -1;
595 static int hf_msg_mon_cmd_ack_arg_len		 = -1;
596 static int hf_msg_mon_cmd_ack_arg_str		 = -1;
597 static int hf_msg_mon_cmd_ack_data		 = -1;
598 static int hf_msg_poolstats			 = -1;
599 static int hf_msg_poolstats_fsid		 = -1;
600 static int hf_msg_poolstats_pool		 = -1;
601 static int hf_msg_poolstatsreply		 = -1;
602 static int hf_msg_poolstatsreply_fsid		 = -1;
603 static int hf_msg_poolstatsreply_stat		 = -1;
604 static int hf_msg_poolstatsreply_pool		 = -1;
605 static int hf_msg_poolstatsreply_log_size	 = -1;
606 static int hf_msg_poolstatsreply_log_size_ondisk = -1;
607 static int hf_msg_mon_globalid_max		 = -1;
608 static int hf_msg_mon_election			 = -1;
609 static int hf_msg_mon_election_fsid		 = -1;
610 static int hf_msg_mon_election_op		 = -1;
611 static int hf_msg_mon_election_epoch		 = -1;
612 static int hf_msg_mon_election_quorum		 = -1;
613 static int hf_msg_mon_election_quorum_features	 = -1;
614 static int hf_msg_mon_election_defunct_one	 = -1;
615 static int hf_msg_mon_election_defunct_two	 = -1;
616 static int hf_msg_mon_election_sharing		 = -1;
617 static int hf_msg_mon_election_sharing_data	 = -1;
618 static int hf_msg_mon_election_sharing_size	 = -1;
619 static int hf_msg_mon_paxos			 = -1;
620 static int hf_msg_mon_paxos_epoch		 = -1;
621 static int hf_msg_mon_paxos_op			 = -1;
622 static int hf_msg_mon_paxos_first		 = -1;
623 static int hf_msg_mon_paxos_last		 = -1;
624 static int hf_msg_mon_paxos_pnfrom		 = -1;
625 static int hf_msg_mon_paxos_pn			 = -1;
626 static int hf_msg_mon_paxos_pnuncommitted	 = -1;
627 static int hf_msg_mon_paxos_lease		 = -1;
628 static int hf_msg_mon_paxos_sent		 = -1;
629 static int hf_msg_mon_paxos_latest_ver		 = -1;
630 static int hf_msg_mon_paxos_latest_val		 = -1;
631 static int hf_msg_mon_paxos_latest_val_data	 = -1;
632 static int hf_msg_mon_paxos_latest_val_size	 = -1;
633 static int hf_msg_mon_paxos_value		 = -1;
634 static int hf_msg_mon_paxos_ver			 = -1;
635 static int hf_msg_mon_paxos_val			 = -1;
636 static int hf_msg_mon_paxos_val_data		 = -1;
637 static int hf_msg_mon_paxos_val_size		 = -1;
638 static int hf_msg_mon_probe			 = -1;
639 static int hf_msg_mon_probe_fsid		 = -1;
640 static int hf_msg_mon_probe_type		 = -1;
641 static int hf_msg_mon_probe_name		 = -1;
642 static int hf_msg_mon_probe_quorum		 = -1;
643 static int hf_msg_mon_probe_paxos_first_ver	 = -1;
644 static int hf_msg_mon_probe_paxos_last_ver	 = -1;
645 static int hf_msg_mon_probe_ever_joined		 = -1;
646 static int hf_msg_mon_probe_req_features	 = -1;
647 static int hf_msg_osd_ping			 = -1;
648 static int hf_msg_osd_ping_fsid			 = -1;
649 static int hf_msg_osd_ping_mapepoch		 = -1;
650 static int hf_msg_osd_ping_peerepoch		 = -1;
651 static int hf_msg_osd_ping_op			 = -1;
652 static int hf_msg_osd_ping_time			 = -1;
653 static int hf_msg_osd_boot			 = -1;
654 static int hf_msg_osd_boot_addr_back		 = -1;
655 static int hf_msg_osd_boot_addr_cluster		 = -1;
656 static int hf_msg_osd_boot_epoch		 = -1;
657 static int hf_msg_osd_boot_addr_front		 = -1;
658 static int hf_msg_osd_boot_metadata		 = -1;
659 static int hf_msg_osd_boot_metadata_k		 = -1;
660 static int hf_msg_osd_boot_metadata_v		 = -1;
661 static int hf_msg_pgstats			 = -1;
662 static int hf_msg_pgstats_fsid			 = -1;
663 static int hf_msg_pgstats_pgstat		 = -1;
664 static int hf_msg_pgstats_pgstat_pg		 = -1;
665 static int hf_msg_pgstats_pgstat_stat		 = -1;
666 static int hf_msg_pgstats_epoch			 = -1;
667 static int hf_msg_pgstats_mapfor		 = -1;
668 static int hf_msg_osd_pg_create			 = -1;
669 static int hf_msg_osd_pg_create_epoch		 = -1;
670 static int hf_msg_osd_pg_create_mkpg		 = -1;
671 static int hf_msg_osd_pg_create_mkpg_pg		 = -1;
672 static int hf_msg_osd_pg_create_mkpg_create	 = -1;
673 static int hf_msg_client_caps			 = -1;
674 static int hf_msg_client_caps_op		 = -1;
675 static int hf_msg_client_caps_inode		 = -1;
676 static int hf_msg_client_caps_relam		 = -1;
677 static int hf_msg_client_caps_cap_id		 = -1;
678 static int hf_msg_client_caps_seq		 = -1;
679 static int hf_msg_client_caps_seq_issue		 = -1;
680 static int hf_msg_client_caps_new		 = -1;
681 static int hf_msg_client_caps_wanted		 = -1;
682 static int hf_msg_client_caps_dirty		 = -1;
683 static int hf_msg_client_caps_seq_migrate	 = -1;
684 static int hf_msg_client_caps_snap_follows	 = -1;
685 static int hf_msg_client_caps_uid		 = -1;
686 static int hf_msg_client_caps_gid		 = -1;
687 static int hf_msg_client_caps_mode		 = -1;
688 static int hf_msg_client_caps_nlink		 = -1;
689 static int hf_msg_client_caps_xattr_ver		 = -1;
690 static int hf_msg_client_caps_snap		 = -1;
691 static int hf_msg_client_caps_flock		 = -1;
692 static int hf_msg_client_caps_inline_ver	 = -1;
693 static int hf_msg_client_caps_inline_data	 = -1;
694 static int hf_msg_client_caps_xattr		 = -1;
695 static int hf_msg_client_caprel			 = -1;
696 static int hf_msg_client_caprel_cap		 = -1;
697 static int hf_msg_client_caprel_cap_inode	 = -1;
698 static int hf_msg_client_caprel_cap_id		 = -1;
699 static int hf_msg_client_caprel_cap_migrate	 = -1;
700 static int hf_msg_client_caprel_cap_seq		 = -1;
701 static int hf_msg_timecheck			 = -1;
702 static int hf_msg_timecheck_op			 = -1;
703 static int hf_msg_timecheck_epoch		 = -1;
704 static int hf_msg_timecheck_round		 = -1;
705 static int hf_msg_timecheck_time		 = -1;
706 static int hf_msg_timecheck_skew		 = -1;
707 static int hf_msg_timecheck_skew_node		 = -1;
708 static int hf_msg_timecheck_skew_skew		 = -1;
709 static int hf_msg_timecheck_latency		 = -1;
710 static int hf_msg_timecheck_latency_node	 = -1;
711 static int hf_msg_timecheck_latency_latency	 = -1;
712 
713 /* Initialize the expert items. */
714 static expert_field ei_unused	      = EI_INIT;
715 static expert_field ei_overrun	      = EI_INIT;
716 static expert_field ei_tag_unknown    = EI_INIT;
717 static expert_field ei_msg_unknown    = EI_INIT;
718 static expert_field ei_union_unknown  = EI_INIT;
719 static expert_field ei_ver_tooold     = EI_INIT;
720 static expert_field ei_ver_toonew     = EI_INIT;
721 static expert_field ei_oloc_both      = EI_INIT;
722 /* static expert_field ei_banner_invalid = EI_INIT; */
723 static expert_field ei_sizeillogical  = EI_INIT;
724 
725 /* Initialize the subtree pointers */
726 static gint ett_ceph			   = -1;
727 static gint ett_data			   = -1;
728 static gint ett_str			   = -1;
729 static gint ett_blob			   = -1;
730 static gint ett_sockaddr		   = -1;
731 static gint ett_entityaddr		   = -1;
732 static gint ett_entityname		   = -1;
733 static gint ett_EntityName		   = -1;
734 static gint ett_entityinst		   = -1;
735 static gint ett_kv			   = -1;
736 static gint ett_eversion		   = -1;
737 static gint ett_objectlocator		   = -1;
738 static gint ett_pg			   = -1;
739 static gint ett_pg_create		   = -1;
740 static gint ett_filepath		   = -1;
741 static gint ett_mds_release		   = -1;
742 static gint ett_hitset_params		   = -1;
743 static gint ett_snapinfo		   = -1;
744 static gint ett_pgpool			   = -1;
745 static gint ett_pgpool_snap		   = -1;
746 static gint ett_pgpool_snapdel		   = -1;
747 static gint ett_pgpool_property		   = -1;
748 static gint ett_mon_map			   = -1;
749 static gint ett_mon_map_address		   = -1;
750 static gint ett_osd_peerstat		   = -1;
751 static gint ett_featureset		   = -1;
752 static gint ett_featureset_name		   = -1;
753 static gint ett_compatset		   = -1;
754 static gint ett_osd_superblock		   = -1;
755 static gint ett_osd_info		   = -1;
756 static gint ett_osd_xinfo		   = -1;
757 static gint ett_perfstat		   = -1;
758 static gint ett_osdstat			   = -1;
759 static gint ett_pg_stat			   = -1;
760 static gint ett_osd_map			   = -1;
761 static gint ett_osd_map_client		   = -1;
762 static gint ett_osd_map_pool		   = -1;
763 static gint ett_osd_map_poolname	   = -1;
764 static gint ett_osd_map_pgtmp		   = -1;
765 static gint ett_osd_map_primarytmp	   = -1;
766 static gint ett_osd_map_erasurecodeprofile = -1;
767 static gint ett_osd_map_osd		   = -1;
768 static gint ett_osd_map_blacklist	   = -1;
769 static gint ett_osd_map_inc		   = -1;
770 static gint ett_osd_map_inc_client	   = -1;
771 static gint ett_osd_map_inc_osd		   = -1;
772 static gint ett_osd_op			   = -1;
773 static gint ett_redirect		   = -1;
774 static gint ett_statcollection		   = -1;
775 static gint ett_paxos			   = -1;
776 static gint ett_msg_mon_map		   = -1;
777 static gint ett_msg_statfs		   = -1;
778 static gint ett_msg_statfsreply		   = -1;
779 static gint ett_msg_mon_sub		   = -1;
780 static gint ett_msg_mon_sub_item	   = -1;
781 static gint ett_msg_mon_sub_flags	   = -1;
782 static gint ett_msg_mon_sub_ack		   = -1;
783 static gint ett_msg_auth		   = -1;
784 static gint ett_msg_auth_supportedproto	   = -1;
785 static gint ett_msg_auth_cephx		   = -1;
786 static gint ett_msg_authreply		   = -1;
787 static gint ett_msg_mon_getversion	   = -1;
788 static gint ett_msg_mon_getversionreply	   = -1;
789 static gint ett_msg_mds_map		   = -1;
790 static gint ett_msg_client_sess		   = -1;
791 static gint ett_msg_client_req		   = -1;
792 static gint ett_msg_client_reqfwd	   = -1;
793 static gint ett_msg_client_reply	   = -1;
794 static gint ett_msg_osd_map		   = -1;
795 static gint ett_msg_osd_map_inc		   = -1;
796 static gint ett_msg_osd_map_full	   = -1;
797 static gint ett_msg_osd_op		   = -1;
798 static gint ett_msg_osd_opreply		   = -1;
799 static gint ett_msg_poolopreply		   = -1;
800 static gint ett_msg_poolop		   = -1;
801 static gint ett_msg_mon_cmd		   = -1;
802 static gint ett_msg_mon_cmd_arg		   = -1;
803 static gint ett_msg_mon_cmdack		   = -1;
804 static gint ett_msg_mon_cmdack_arg	   = -1;
805 static gint ett_msg_poolstats		   = -1;
806 static gint ett_msg_poolstatsreply	   = -1;
807 static gint ett_msg_poolstatsreply_stat	   = -1;
808 static gint ett_msg_mon_election	   = -1;
809 static gint ett_msg_mon_paxos		   = -1;
810 static gint ett_msg_mon_paxos_value	   = -1;
811 static gint ett_msg_mon_probe		   = -1;
812 static gint ett_msg_osd_ping		   = -1;
813 static gint ett_msg_osd_boot		   = -1;
814 static gint ett_msg_pgstats		   = -1;
815 static gint ett_msg_pgstats_pgstat	   = -1;
816 static gint ett_msg_osd_pg_create	   = -1;
817 static gint ett_msg_osd_pg_create_mkpg	   = -1;
818 static gint ett_msg_client_caps		   = -1;
819 static gint ett_msg_client_caprel	   = -1;
820 static gint ett_msg_client_caprel_cap	   = -1;
821 static gint ett_msg_timecheck		   = -1;
822 static gint ett_msg_timecheck_skew	   = -1;
823 static gint ett_msg_timecheck_latency	   = -1;
824 static gint ett_head			   = -1;
825 static gint ett_foot			   = -1;
826 static gint ett_connect			   = -1;
827 static gint ett_connect_reply		   = -1;
828 static gint ett_filter_data		   = -1;
829 
830 static const guint8 *C_BANNER = (const guint8*)"ceph v";
831 
832 #define C_BANNER_SIZE     9
833 #define C_BANNER_SIZE_MIN 6
834 
835 /** Feature Flags */
836 /* Transmuted from ceph:/src/include/ceph_features.h */
837 #define C_FEATURE_UID		       (1U <<  0)
838 #define C_FEATURE_NOSRCADDR	       (1U <<  1)
839 #define C_FEATURE_MONCLOCKCHECK	       (1U <<  2)
840 #define C_FEATURE_FLOCK		       (1U <<  3)
841 #define C_FEATURE_SUBSCRIBE2	       (1U <<  4)
842 #define C_FEATURE_MONNAMES	       (1U <<  5)
843 #define C_FEATURE_RECONNECT_SEQ	       (1U <<  6)
844 #define C_FEATURE_DIRLAYOUTHASH	       (1U <<  7)
845 #define C_FEATURE_OBJECTLOCATOR	       (1U <<  8)
846 #define C_FEATURE_PGID64	       (1U <<  9)
847 #define C_FEATURE_INCSUBOSDMAP	       (1U << 10)
848 #define C_FEATURE_PGPOOL3	       (1U << 11)
849 #define C_FEATURE_OSDREPLYMUX	       (1U << 12)
850 #define C_FEATURE_OSDENC	       (1U << 13)
851 #define C_FEATURE_OMAP		       (1U << 14)
852 #define C_FEATURE_MONENC	       (1U << 15)
853 #define C_FEATURE_QUERY_T	       (1U << 16)
854 #define C_FEATURE_INDEP_PG_MAP	       (1U << 17)
855 #define C_FEATURE_CRUSH_TUNABLES       (1U << 18)
856 #define C_FEATURE_CHUNKY_SCRUB	       (1U << 19)
857 #define C_FEATURE_MON_NULLROUTE	       (1U << 20)
858 #define C_FEATURE_MON_GV	       (1U << 21)
859 #define C_FEATURE_BACKFILL_RESERVATION (1U << 22)
860 #define C_FEATURE_MSG_AUTH	       (1U << 23)
861 #define C_FEATURE_RECOVERY_RESERVATION (1U << 24)
862 #define C_FEATURE_CRUSH_TUNABLES2      (1U << 25)
863 #define C_FEATURE_CREATEPOOLID	       (1U << 26)
864 #define C_FEATURE_REPLY_CREATE_INODE   (1U << 27)
865 #define C_FEATURE_OSD_HBMSGS	       (1U << 28)
866 #define C_FEATURE_MDSENC	       (1U << 29)
867 #define C_FEATURE_OSDHASHPSPOOL	       (1U << 30)
868 #define C_FEATURE_MON_SINGLE_PAXOS     (1U << 31)
869 #define C_FEATURE_OSD_SNAPMAPPER       (1U <<  0)
870 #define C_FEATURE_MON_SCRUB	       (1U <<  1)
871 #define C_FEATURE_OSD_PACKED_RECOVERY  (1U <<  2)
872 #define C_FEATURE_OSD_CACHEPOOL	       (1U <<  3)
873 #define C_FEATURE_CRUSH_V2	       (1U <<  4)
874 #define C_FEATURE_EXPORT_PEER	       (1U <<  5)
875 #define C_FEATURE_OSD_ERASURE_CODES    (1U <<  6)
876 #define C_FEATURE_OSD_TMAP2OMAP	       (1U <<  6)
877 #define C_FEATURE_OSDMAP_ENC	       (1U <<  7)
878 #define C_FEATURE_MDS_INLINE_DATA      (1U <<  8)
879 #define C_FEATURE_CRUSH_TUNABLES3      (1U <<  9)
880 #define C_FEATURE_OSD_PRIMARY_AFFINITY (1U <<  9)
881 #define C_FEATURE_MSGR_KEEPALIVE2      (1U << 10)
882 #define C_FEATURE_RESERVED	       (1U << 31)
883 
884 /** Connect Message Flags */
885 #define C_FLAG_LOSSY	               (1U << 0)
886 
887 #define C_PGPOOL_FLAG_HASHPSPOOL       (1U << 0) /* hash pg seed and pool together (instead of adding) */
888 #define C_PGPOOL_FLAG_FULL	       (1U << 1) /* pool is full */
889 #define C_PGPOOL_FLAG_FAKE_EC_POOL     (1U << 2) /* require ReplicatedPG to act like an EC pg */
890 
891 /** Macros to create value_stings.
892  *
893  * These are a quick wrapper around the functions in value_string.h.  They
894  * create an enum `base` with the given values, a `value_string base_strings[]`
895  * and a function `const char `base_string(base val)` which gets the string
896  * for a value.
897  *
898  * Additionally, C_MAKE_STRINGS_EXT creates a
899  * `value_strings_ext base_strings_ext` and uses this for the `base_string`
900  * lookup.
901  *
902  * @param base The root name.
903  * @param chars The number of characters to use when displaying the value.
904  *		this is generally 2*bytes.
905  */
906 #define C_MAKE_STRINGS(base, chars) \
907 	typedef gint base; \
908 	VALUE_STRING_ENUM(base##_strings); \
909 	VALUE_STRING_ARRAY(base##_strings); \
910 	static const char *base##_string(base val) { \
911 		return val_to_str(val, base##_strings, "Unknown (0x0"#chars"X)"); \
912 	}
913 
914 #define C_MAKE_STRINGS_EXT(base, chars) \
915 	typedef gint base; \
916 	VALUE_STRING_ENUM(base##_strings); \
917 	VALUE_STRING_ARRAY(base##_strings); \
918 	\
919 	static value_string_ext \
920 	base##_strings_ext = VALUE_STRING_EXT_INIT(base##_strings); \
921 	\
922 	static const char *base##_string(base val) { \
923 		return val_to_str_ext(val, &base##_strings_ext, "Unknown (0x0"#chars"X)"); \
924 	}
925 
926 #define c_inet_strings_VALUE_STRING_LIST(V) \
927 	V(C_IPv4, 0x0002, "IPv4") \
928 	V(C_IPv6, 0x000A, "IPv6")
929 
930 typedef gint c_inet;
931 VALUE_STRING_ENUM(c_inet_strings);
932 VALUE_STRING_ARRAY(c_inet_strings);
933 
934 /** Message Tags */
935 #define c_tag_strings_VALUE_STRING_LIST(V) \
936 	V(C_TAG_READY,		0x01, "server->client: ready for messages")		     \
937 	V(C_TAG_RESETSESSION,	0x02, "server->client: reset, try again")		     \
938 	V(C_TAG_WAIT,		0x03, "server->client: wait for racing incoming connection") \
939 	V(C_TAG_RETRY_SESSION,	0x04, "server->client + cseq: try again with higher cseq")   \
940 	V(C_TAG_RETRY_GLOBAL,	0x05, "server->client + gseq: try again with higher gseq")   \
941 	V(C_TAG_CLOSE,		0x06, "closing pipe")					     \
942 	V(C_TAG_MSG,		0x07, "message")					     \
943 	V(C_TAG_ACK,		0x08, "message ack")					     \
944 	V(C_TAG_KEEPALIVE,	0x09, "just a keepalive byte!")				     \
945 	V(C_TAG_BADPROTOVER,	0x0A, "bad protocol version")				     \
946 	V(C_TAG_BADAUTHORIZER,	0x0B, "bad authorizer")					     \
947 	V(C_TAG_FEATURES,	0x0C, "insufficient features")				     \
948 	V(C_TAG_SEQ,		0x0D, "64-bit int follows with seen seq number")	     \
949 	V(C_TAG_KEEPALIVE2,	0x0E, "keepalive2")					     \
950 	V(C_TAG_KEEPALIVE2_ACK, 0x0F, "keepalive2 reply")				     \
951 
952 typedef gint c_tag;
953 VALUE_STRING_ENUM(c_tag_strings);
954 VALUE_STRING_ARRAY(c_tag_strings);
955 static value_string_ext c_tag_strings_ext = VALUE_STRING_EXT_INIT(c_tag_strings);
956 
957 /* Extracted from the Ceph tree.
958  *
959  * These are MSG_* constants for server <-> server (internal) messages. and
960  * CEPH_MSG_* for client <-> server messages.  There is no functional
961  * difference, just a naming convention.
962  */
963 #define c_msg_type_strings_VALUE_STRING_LIST(V) \
964 	V(C_MSG_UNKNOWN,		     0x0000, "Unknown (0x0000)")		  \
965 											  \
966 	V(C_CEPH_MSG_SHUTDOWN,		     0x0001, "C_CEPH_MSG_SHUTDOWN")		  \
967 	V(C_CEPH_MSG_PING,		     0x0002, "C_CEPH_MSG_PING")			  \
968 	V(C_CEPH_MSG_MON_MAP,		     0x0004, "C_CEPH_MSG_MON_MAP")		  \
969 	V(C_CEPH_MSG_MON_GET_MAP,	     0x0005, "C_CEPH_MSG_MON_GET_MAP")		  \
970 	V(C_CEPH_MSG_STATFS,		     0x000D, "C_CEPH_MSG_STATFS")		  \
971 	V(C_CEPH_MSG_STATFS_REPLY,	     0x000E, "C_CEPH_MSG_STATFS_REPLY")		  \
972 	V(C_CEPH_MSG_MON_SUBSCRIBE,	     0x000F, "C_CEPH_MSG_MON_SUBSCRIBE")	  \
973 	V(C_CEPH_MSG_MON_SUBSCRIBE_ACK,	     0x0010, "C_CEPH_MSG_MON_SUBSCRIBE_ACK")	  \
974 	V(C_CEPH_MSG_AUTH,		     0x0011, "C_CEPH_MSG_AUTH")			  \
975 	V(C_CEPH_MSG_AUTH_REPLY,	     0x0012, "C_CEPH_MSG_AUTH_REPLY")		  \
976 	V(C_CEPH_MSG_MON_GET_VERSION,	     0x0013, "C_CEPH_MSG_MON_GET_VERSION")	  \
977 	V(C_CEPH_MSG_MON_GET_VERSION_REPLY,  0x0014, "C_CEPH_MSG_MON_GET_VERSION_REPLY")  \
978 	V(C_CEPH_MSG_MDS_MAP,		     0x0015, "C_CEPH_MSG_MDS_MAP")		  \
979 	V(C_CEPH_MSG_CLIENT_SESSION,	     0x0016, "C_CEPH_MSG_CLIENT_SESSION")	  \
980 	V(C_CEPH_MSG_CLIENT_RECONNECT,	     0x0017, "C_CEPH_MSG_CLIENT_RECONNECT")	  \
981 	V(C_CEPH_MSG_CLIENT_REQUEST,	     0x0018, "C_CEPH_MSG_CLIENT_REQUEST")	  \
982 	V(C_CEPH_MSG_CLIENT_REQUEST_FORWARD, 0x0019, "C_CEPH_MSG_CLIENT_REQUEST_FORWARD") \
983 	V(C_CEPH_MSG_CLIENT_REPLY,	     0x001A, "C_CEPH_MSG_CLIENT_REPLY")		  \
984 	V(C_MSG_PAXOS,			     0x0028, "C_MSG_PAXOS")			  \
985 	V(C_CEPH_MSG_OSD_MAP,		     0x0029, "C_CEPH_MSG_OSD_MAP")		  \
986 	V(C_CEPH_MSG_OSD_OP,		     0x002A, "C_CEPH_MSG_OSD_OP")		  \
987 	V(C_CEPH_MSG_OSD_OPREPLY,	     0x002B, "C_CEPH_MSG_OSD_OPREPLY")		  \
988 	V(C_CEPH_MSG_WATCH_NOTIFY,	     0x002C, "C_CEPH_MSG_WATCH_NOTIFY")		  \
989 	V(C_MSG_FORWARD,		     0x002E, "C_MSG_FORWARD")			  \
990 	V(C_MSG_ROUTE,			     0x002F, "C_MSG_ROUTE")			  \
991 	V(C_MSG_POOLOPREPLY,		     0x0030, "C_MSG_POOLOPREPLY")		  \
992 	V(C_MSG_POOLOP,			     0x0031, "C_MSG_POOLOP")			  \
993 	V(C_MSG_MON_COMMAND,		     0x0032, "C_MSG_MON_COMMAND")		  \
994 	V(C_MSG_MON_COMMAND_ACK,	     0x0033, "C_MSG_MON_COMMAND_ACK")		  \
995 	V(C_MSG_LOG,			     0x0034, "C_MSG_LOG")			  \
996 	V(C_MSG_LOGACK,			     0x0035, "C_MSG_LOGACK")			  \
997 	V(C_MSG_MON_OBSERVE,		     0x0036, "C_MSG_MON_OBSERVE")		  \
998 	V(C_MSG_MON_OBSERVE_NOTIFY,	     0x0037, "C_MSG_MON_OBSERVE_NOTIFY")	  \
999 	V(C_MSG_CLASS,			     0x0038, "C_MSG_CLASS")			  \
1000 	V(C_MSG_CLASS_ACK,		     0x0039, "C_MSG_CLASS_ACK")			  \
1001 	V(C_MSG_GETPOOLSTATS,		     0x003A, "C_MSG_GETPOOLSTATS")		  \
1002 	V(C_MSG_GETPOOLSTATSREPLY,	     0x003B, "C_MSG_GETPOOLSTATSREPLY")		  \
1003 	V(C_MSG_MON_GLOBAL_ID,		     0x003C, "C_MSG_MON_GLOBAL_ID")		  \
1004 /*	V(C_CEPH_MSG_PRIO_LOW,		     0x0040, "C_CEPH_MSG_PRIO_LOW")		*/ \
1005 	V(C_MSG_MON_SCRUB,		     0x0040, "C_MSG_MON_SCRUB")			  \
1006 	V(C_MSG_MON_ELECTION,		     0x0041, "C_MSG_MON_ELECTION")		  \
1007 	V(C_MSG_MON_PAXOS,		     0x0042, "C_MSG_MON_PAXOS")			  \
1008 	V(C_MSG_MON_PROBE,		     0x0043, "C_MSG_MON_PROBE")			  \
1009 	V(C_MSG_MON_JOIN,		     0x0044, "C_MSG_MON_JOIN")			  \
1010 	V(C_MSG_MON_SYNC,		     0x0045, "C_MSG_MON_SYNC")			  \
1011 	V(C_MSG_OSD_PING,		     0x0046, "C_MSG_OSD_PING")			  \
1012 	V(C_MSG_OSD_BOOT,		     0x0047, "C_MSG_OSD_BOOT")			  \
1013 	V(C_MSG_OSD_FAILURE,		     0x0048, "C_MSG_OSD_FAILURE")		  \
1014 	V(C_MSG_OSD_ALIVE,		     0x0049, "C_MSG_OSD_ALIVE")			  \
1015 	V(C_MSG_OSD_MARK_ME_DOWN,	     0x004A, "C_MSG_OSD_MARK_ME_DOWN")		  \
1016 	V(C_MSG_OSD_SUBOP,		     0x004C, "C_MSG_OSD_SUBOP")			  \
1017 	V(C_MSG_OSD_SUBOPREPLY,		     0x004D, "C_MSG_OSD_SUBOPREPLY")		  \
1018 	V(C_MSG_OSD_PGTEMP,		     0x004E, "C_MSG_OSD_PGTEMP")		  \
1019 	V(C_MSG_OSD_PG_NOTIFY,		     0x0050, "C_MSG_OSD_PG_NOTIFY")		  \
1020 	V(C_MSG_OSD_PG_QUERY,		     0x0051, "C_MSG_OSD_PG_QUERY")		  \
1021 	V(C_MSG_OSD_PG_SUMMARY,		     0x0052, "C_MSG_OSD_PG_SUMMARY")		  \
1022 	V(C_MSG_OSD_PG_LOG,		     0x0053, "C_MSG_OSD_PG_LOG")		  \
1023 	V(C_MSG_OSD_PG_REMOVE,		     0x0054, "C_MSG_OSD_PG_REMOVE")		  \
1024 	V(C_MSG_OSD_PG_INFO,		     0x0055, "C_MSG_OSD_PG_INFO")		  \
1025 	V(C_MSG_OSD_PG_TRIM,		     0x0056, "C_MSG_OSD_PG_TRIM")		  \
1026 	V(C_MSG_PGSTATS,		     0x0057, "C_MSG_PGSTATS")			  \
1027 	V(C_MSG_PGSTATSACK,		     0x0058, "C_MSG_PGSTATSACK")		  \
1028 	V(C_MSG_OSD_PG_CREATE,		     0x0059, "C_MSG_OSD_PG_CREATE")		  \
1029 	V(C_MSG_REMOVE_SNAPS,		     0x005A, "C_MSG_REMOVE_SNAPS")		  \
1030 	V(C_MSG_OSD_SCRUB,		     0x005B, "C_MSG_OSD_SCRUB")			  \
1031 	V(C_MSG_OSD_PG_MISSING,		     0x005C, "C_MSG_OSD_PG_MISSING")		  \
1032 	V(C_MSG_OSD_REP_SCRUB,		     0x005D, "C_MSG_OSD_REP_SCRUB")		  \
1033 	V(C_MSG_OSD_PG_SCAN,		     0x005E, "C_MSG_OSD_PG_SCAN")		  \
1034 	V(C_MSG_OSD_PG_BACKFILL,	     0x005F, "C_MSG_OSD_PG_BACKFILL")		  \
1035 	V(C_MSG_COMMAND,		     0x0061, "C_MSG_COMMAND")			  \
1036 	V(C_MSG_COMMAND_REPLY,		     0x0062, "C_MSG_COMMAND_REPLY")		  \
1037 	V(C_MSG_OSD_BACKFILL_RESERVE,	     0x0063, "C_MSG_OSD_BACKFILL_RESERVE")	  \
1038 	V(C_MSG_MDS_BEACON,		     0x0064, "C_MSG_MDS_BEACON")		  \
1039 	V(C_MSG_MDS_SLAVE_REQUEST,	     0x0065, "C_MSG_MDS_SLAVE_REQUEST")		  \
1040 	V(C_MSG_MDS_TABLE_REQUEST,	     0x0066, "C_MSG_MDS_TABLE_REQUEST")		  \
1041 	V(C_MSG_OSD_PG_PUSH,		     0x0069, "C_MSG_OSD_PG_PUSH")		  \
1042 	V(C_MSG_OSD_PG_PULL,		     0x006A, "C_MSG_OSD_PG_PULL")		  \
1043 	V(C_MSG_OSD_PG_PUSH_REPLY,	     0x006B, "C_MSG_OSD_PG_PUSH_REPLY")		  \
1044 	V(C_MSG_OSD_EC_WRITE,		     0x006C, "C_MSG_OSD_EC_WRITE")		  \
1045 	V(C_MSG_OSD_EC_WRITE_REPLY,	     0x006D, "C_MSG_OSD_EC_WRITE_REPLY")	  \
1046 	V(C_MSG_OSD_EC_READ,		     0x006E, "C_MSG_OSD_EC_READ")		  \
1047 	V(C_MSG_OSD_EC_READ_REPLY,	     0x006F, "C_MSG_OSD_EC_READ_REPLY")		  \
1048 	V(C_CEPH_MSG_PRIO_DEFAULT,	     0x007F, "C_CEPH_MSG_PRIO_DEFAULT")		  \
1049 	V(C_MSG_OSD_RECOVERY_RESERVE,	     0x0096, "C_MSG_OSD_RECOVERY_RESERVE")	  \
1050 	V(C_CEPH_MSG_PRIO_HIGH,		     0x00C4, "C_CEPH_MSG_PRIO_HIGH")		  \
1051 	V(C_CEPH_MSG_PRIO_HIGHEST,	     0x00FF, "C_CEPH_MSG_PRIO_HIGHEST")		  \
1052 	V(C_MSG_MDS_RESOLVE,		     0x0200, "C_MSG_MDS_RESOLVE")		  \
1053 	V(C_MSG_MDS_RESOLVEACK,		     0x0201, "C_MSG_MDS_RESOLVEACK")		  \
1054 	V(C_MSG_MDS_CACHEREJOIN,	     0x0202, "C_MSG_MDS_CACHEREJOIN")		  \
1055 	V(C_MSG_MDS_DISCOVER,		     0x0203, "C_MSG_MDS_DISCOVER")		  \
1056 	V(C_MSG_MDS_DISCOVERREPLY,	     0x0204, "C_MSG_MDS_DISCOVERREPLY")		  \
1057 	V(C_MSG_MDS_INODEUPDATE,	     0x0205, "C_MSG_MDS_INODEUPDATE")		  \
1058 	V(C_MSG_MDS_DIRUPDATE,		     0x0206, "C_MSG_MDS_DIRUPDATE")		  \
1059 	V(C_MSG_MDS_CACHEEXPIRE,	     0x0207, "C_MSG_MDS_CACHEEXPIRE")		  \
1060 	V(C_MSG_MDS_DENTRYUNLINK,	     0x0208, "C_MSG_MDS_DENTRYUNLINK")		  \
1061 	V(C_MSG_MDS_FRAGMENTNOTIFY,	     0x0209, "C_MSG_MDS_FRAGMENTNOTIFY")	  \
1062 	V(C_MSG_MDS_OFFLOAD_TARGETS,	     0x020A, "C_MSG_MDS_OFFLOAD_TARGETS")	  \
1063 	V(C_MSG_MDS_DENTRYLINK,		     0x020C, "C_MSG_MDS_DENTRYLINK")		  \
1064 	V(C_MSG_MDS_FINDINO,		     0x020D, "C_MSG_MDS_FINDINO")		  \
1065 	V(C_MSG_MDS_FINDINOREPLY,	     0x020E, "C_MSG_MDS_FINDINOREPLY")		  \
1066 	V(C_MSG_MDS_OPENINO,		     0x020F, "C_MSG_MDS_OPENINO")		  \
1067 	V(C_MSG_MDS_OPENINOREPLY,	     0x0210, "C_MSG_MDS_OPENINOREPLY")		  \
1068 	V(C_MSG_MDS_LOCK,		     0x0300, "C_MSG_MDS_LOCK")			  \
1069 	V(C_MSG_MDS_INODEFILECAPS,	     0x0301, "C_MSG_MDS_INODEFILECAPS")		  \
1070 	V(C_CEPH_MSG_CLIENT_CAPS,	     0x0310, "C_CEPH_MSG_CLIENT_CAPS")		  \
1071 	V(C_CEPH_MSG_CLIENT_LEASE,	     0x0311, "C_CEPH_MSG_CLIENT_LEASE")		  \
1072 	V(C_CEPH_MSG_CLIENT_SNAP,	     0x0312, "C_CEPH_MSG_CLIENT_SNAP")		  \
1073 	V(C_CEPH_MSG_CLIENT_CAPRELEASE,	     0x0313, "C_CEPH_MSG_CLIENT_CAPRELEASE")	  \
1074 	V(C_MSG_MDS_EXPORTDIRDISCOVER,	     0x0449, "C_MSG_MDS_EXPORTDIRDISCOVER")	  \
1075 	V(C_MSG_MDS_EXPORTDIRDISCOVERACK,    0x0450, "C_MSG_MDS_EXPORTDIRDISCOVERACK")	  \
1076 	V(C_MSG_MDS_EXPORTDIRCANCEL,	     0x0451, "C_MSG_MDS_EXPORTDIRCANCEL")	  \
1077 	V(C_MSG_MDS_EXPORTDIRPREP,	     0x0452, "C_MSG_MDS_EXPORTDIRPREP")		  \
1078 	V(C_MSG_MDS_EXPORTDIRPREPACK,	     0x0453, "C_MSG_MDS_EXPORTDIRPREPACK")	  \
1079 	V(C_MSG_MDS_EXPORTDIRWARNING,	     0x0454, "C_MSG_MDS_EXPORTDIRWARNING")	  \
1080 	V(C_MSG_MDS_EXPORTDIRWARNINGACK,     0x0455, "C_MSG_MDS_EXPORTDIRWARNINGACK")	  \
1081 	V(C_MSG_MDS_EXPORTDIR,		     0x0456, "C_MSG_MDS_EXPORTDIR")		  \
1082 	V(C_MSG_MDS_EXPORTDIRACK,	     0x0457, "C_MSG_MDS_EXPORTDIRACK")		  \
1083 	V(C_MSG_MDS_EXPORTDIRNOTIFY,	     0x0458, "C_MSG_MDS_EXPORTDIRNOTIFY")	  \
1084 	V(C_MSG_MDS_EXPORTDIRNOTIFYACK,	     0x0459, "C_MSG_MDS_EXPORTDIRNOTIFYACK")	  \
1085 	V(C_MSG_MDS_EXPORTDIRFINISH,	     0x0460, "C_MSG_MDS_EXPORTDIRFINISH")	  \
1086 	V(C_MSG_MDS_EXPORTCAPS,		     0x0470, "C_MSG_MDS_EXPORTCAPS")		  \
1087 	V(C_MSG_MDS_EXPORTCAPSACK,	     0x0471, "C_MSG_MDS_EXPORTCAPSACK")		  \
1088 	V(C_MSG_MDS_HEARTBEAT,		     0x0500, "C_MSG_MDS_HEARTBEAT")		  \
1089 	V(C_MSG_TIMECHECK,		     0x0600, "C_MSG_TIMECHECK")			  \
1090 	V(C_MSG_MON_HEALTH,		     0x0601, "C_MSG_MON_HEALTH")
1091 
1092 C_MAKE_STRINGS_EXT(c_msg_type, 4)
1093 
1094 #define c_osd_optype_strings_VALUE_STRING_LIST(V) \
1095 	/*** Raw Codes ***/												\
1096 	V(C_OSD_OP_TYPE_LOCK,  0x0100, "C_OSD_OP_TYPE_LOCK")								\
1097 	V(C_OSD_OP_TYPE_DATA,  0x0200, "C_OSD_OP_TYPE_DATA")								\
1098 	V(C_OSD_OP_TYPE_ATTR,  0x0300, "C_OSD_OP_TYPE_ATTR")								\
1099 	V(C_OSD_OP_TYPE_EXEC,  0x0400, "C_OSD_OP_TYPE_EXEC")								\
1100 	V(C_OSD_OP_TYPE_PG,    0x0500, "C_OSD_OP_TYPE_PG")								\
1101 	V(C_OSD_OP_TYPE_MULTI, 0x0600, "C_OSD_OP_TYPE_MULTI") /* multiobject */						\
1102 	V(C_OSD_OP_TYPE,       0x0f00, "C_OSD_OP_TYPE")									\
1103 															\
1104 	/*** Sorted by value, keep it that way. ***/									\
1105 	V(C_OSD_OP_MODE_RD,	       0x1000,						 "C_OSD_OP_MODE_RD")		\
1106 	V(C_OSD_OP_READ,	       C_OSD_OP_MODE_RD	   | C_OSD_OP_TYPE_DATA	 | 0x01, "C_OSD_OP_READ")		\
1107 	V(C_OSD_OP_STAT,	       C_OSD_OP_MODE_RD	   | C_OSD_OP_TYPE_DATA	 | 0x02, "C_OSD_OP_STAT")		\
1108 	V(C_OSD_OP_MAPEXT,	       C_OSD_OP_MODE_RD	   | C_OSD_OP_TYPE_DATA	 | 0x03, "C_OSD_OP_MAPEXT")		\
1109 	V(C_OSD_OP_MASKTRUNC,	       C_OSD_OP_MODE_RD	   | C_OSD_OP_TYPE_DATA	 | 0x04, "C_OSD_OP_MASKTRUNC")		\
1110 	V(C_OSD_OP_SPARSE_READ,	       C_OSD_OP_MODE_RD	   | C_OSD_OP_TYPE_DATA	 | 0x05, "C_OSD_OP_SPARSE_READ")	\
1111 	V(C_OSD_OP_NOTIFY,	       C_OSD_OP_MODE_RD	   | C_OSD_OP_TYPE_DATA	 | 0x06, "C_OSD_OP_NOTIFY")		\
1112 	V(C_OSD_OP_NOTIFY_ACK,	       C_OSD_OP_MODE_RD	   | C_OSD_OP_TYPE_DATA	 | 0x07, "C_OSD_OP_NOTIFY_ACK")		\
1113 	V(C_OSD_OP_ASSERT_VER,	       C_OSD_OP_MODE_RD	   | C_OSD_OP_TYPE_DATA	 | 0x08, "C_OSD_OP_ASSERT_VER")		\
1114 	V(C_OSD_OP_LIST_WATCHERS,      C_OSD_OP_MODE_RD	   | C_OSD_OP_TYPE_DATA	 | 0x09, "C_OSD_OP_LIST_WATCHERS")	\
1115 	V(C_OSD_OP_LIST_SNAPS,	       C_OSD_OP_MODE_RD	   | C_OSD_OP_TYPE_DATA	 | 0x0A, "C_OSD_OP_LIST_SNAPS")		\
1116 	V(C_OSD_OP_SYNC_READ,	       C_OSD_OP_MODE_RD	   | C_OSD_OP_TYPE_DATA	 | 0x0B, "C_OSD_OP_SYNC_READ")		\
1117 	V(C_OSD_OP_TMAPGET,	       C_OSD_OP_MODE_RD	   | C_OSD_OP_TYPE_DATA	 | 0x0C, "C_OSD_OP_TMAPGET")		\
1118 	V(C_OSD_OP_OMAPGETKEYS,	       C_OSD_OP_MODE_RD	   | C_OSD_OP_TYPE_DATA	 | 0x11, "C_OSD_OP_OMAPGETKEYS")	\
1119 	V(C_OSD_OP_OMAPGETVALS,	       C_OSD_OP_MODE_RD	   | C_OSD_OP_TYPE_DATA	 | 0x12, "C_OSD_OP_OMAPGETVALS")	\
1120 	V(C_OSD_OP_OMAPGETHEADER,      C_OSD_OP_MODE_RD	   | C_OSD_OP_TYPE_DATA	 | 0x13, "C_OSD_OP_OMAPGETHEADER")	\
1121 	V(C_OSD_OP_OMAPGETVALSBYKEYS,  C_OSD_OP_MODE_RD	   | C_OSD_OP_TYPE_DATA	 | 0x14, "C_OSD_OP_OMAPGETVALSBYKEYS")	\
1122 	V(C_OSD_OP_OMAP_CMP,	       C_OSD_OP_MODE_RD	   | C_OSD_OP_TYPE_DATA	 | 0x19, "C_OSD_OP_OMAP_CMP")		\
1123 	V(C_OSD_OP_COPY_GET_CLASSIC,   C_OSD_OP_MODE_RD	   | C_OSD_OP_TYPE_DATA	 | 0x1B, "C_OSD_OP_COPY_GET_CLASSIC")	\
1124 	V(C_OSD_OP_ISDIRTY,	       C_OSD_OP_MODE_RD	   | C_OSD_OP_TYPE_DATA	 | 0x1D, "C_OSD_OP_ISDIRTY")		\
1125 	V(C_OSD_OP_COPY_GET,	       C_OSD_OP_MODE_RD	   | C_OSD_OP_TYPE_DATA	 | 0x1E, "C_OSD_OP_COPY_GET")		\
1126 	V(C_OSD_OP_GETXATTR,	       C_OSD_OP_MODE_RD	   | C_OSD_OP_TYPE_ATTR	 | 0x01, "C_OSD_OP_GETXATTR")		\
1127 	V(C_OSD_OP_GETXATTRS,	       C_OSD_OP_MODE_RD	   | C_OSD_OP_TYPE_ATTR	 | 0x02, "C_OSD_OP_GETXATTRS")		\
1128 	V(C_OSD_OP_CMPXATTR,	       C_OSD_OP_MODE_RD	   | C_OSD_OP_TYPE_ATTR	 | 0x03, "C_OSD_OP_CMPXATTR")		\
1129 	V(C_OSD_OP_CALL,	       C_OSD_OP_MODE_RD	   | C_OSD_OP_TYPE_EXEC	 | 0x01, "C_OSD_OP_CALL")		\
1130 	V(C_OSD_OP_PGLS,	       C_OSD_OP_MODE_RD	   | C_OSD_OP_TYPE_PG	 | 0x01, "C_OSD_OP_PGLS")		\
1131 	V(C_OSD_OP_PGLS_FILTER,	       C_OSD_OP_MODE_RD	   | C_OSD_OP_TYPE_PG	 | 0x02, "C_OSD_OP_PGLS_FILTER")	\
1132 	V(C_OSD_OP_PG_HITSET_LS,       C_OSD_OP_MODE_RD	   | C_OSD_OP_TYPE_PG	 | 0x03, "C_OSD_OP_PG_HITSET_LS")	\
1133 	V(C_OSD_OP_PG_HITSET_GET,      C_OSD_OP_MODE_RD	   | C_OSD_OP_TYPE_PG	 | 0x04, "C_OSD_OP_PG_HITSET_GET")	\
1134 	V(C_OSD_OP_ASSERT_SRC_VERSION, C_OSD_OP_MODE_RD	   | C_OSD_OP_TYPE_MULTI | 0x02, "C_OSD_OP_ASSERT_SRC_VERSION") \
1135 	V(C_OSD_OP_SRC_CMPXATTR,       C_OSD_OP_MODE_RD	   | C_OSD_OP_TYPE_MULTI | 0x03, "C_OSD_OP_SRC_CMPXATTR")	\
1136 	V(C_OSD_OP_MODE_WR,	       0x2000,						 "C_OSD_OP_MODE_WR")		\
1137 	V(C_OSD_OP_WRLOCK,	       C_OSD_OP_MODE_WR	   | C_OSD_OP_TYPE_LOCK	 | 0x01, "C_OSD_OP_WRLOCK")		\
1138 	V(C_OSD_OP_WRUNLOCK,	       C_OSD_OP_MODE_WR	   | C_OSD_OP_TYPE_LOCK	 | 0x02, "C_OSD_OP_WRUNLOCK")		\
1139 	V(C_OSD_OP_RDLOCK,	       C_OSD_OP_MODE_WR	   | C_OSD_OP_TYPE_LOCK	 | 0x03, "C_OSD_OP_RDLOCK")		\
1140 	V(C_OSD_OP_RDUNLOCK,	       C_OSD_OP_MODE_WR	   | C_OSD_OP_TYPE_LOCK	 | 0x04, "C_OSD_OP_RDUNLOCK")		\
1141 	V(C_OSD_OP_UPLOCK,	       C_OSD_OP_MODE_WR	   | C_OSD_OP_TYPE_LOCK	 | 0x05, "C_OSD_OP_UPLOCK")		\
1142 	V(C_OSD_OP_DNLOCK,	       C_OSD_OP_MODE_WR	   | C_OSD_OP_TYPE_LOCK	 | 0x06, "C_OSD_OP_DNLOCK")		\
1143 	V(C_OSD_OP_WRITE,	       C_OSD_OP_MODE_WR	   | C_OSD_OP_TYPE_DATA	 | 0x01, "C_OSD_OP_WRITE")		\
1144 	V(C_OSD_OP_WRITEFULL,	       C_OSD_OP_MODE_WR	   | C_OSD_OP_TYPE_DATA	 | 0x02, "C_OSD_OP_WRITEFULL")		\
1145 	V(C_OSD_OP_TRUNCATE,	       C_OSD_OP_MODE_WR	   | C_OSD_OP_TYPE_DATA	 | 0x03, "C_OSD_OP_TRUNCATE")		\
1146 	V(C_OSD_OP_ZERO,	       C_OSD_OP_MODE_WR	   | C_OSD_OP_TYPE_DATA	 | 0x04, "C_OSD_OP_ZERO")		\
1147 	V(C_OSD_OP_DELETE,	       C_OSD_OP_MODE_WR	   | C_OSD_OP_TYPE_DATA	 | 0x05, "C_OSD_OP_DELETE")		\
1148 	V(C_OSD_OP_APPEND,	       C_OSD_OP_MODE_WR	   | C_OSD_OP_TYPE_DATA	 | 0x06, "C_OSD_OP_APPEND")		\
1149 	V(C_OSD_OP_STARTSYNC,	       C_OSD_OP_MODE_WR	   | C_OSD_OP_TYPE_DATA	 | 0x07, "C_OSD_OP_STARTSYNC")		\
1150 	V(C_OSD_OP_SETTRUNC,	       C_OSD_OP_MODE_WR	   | C_OSD_OP_TYPE_DATA	 | 0x08, "C_OSD_OP_SETTRUNC")		\
1151 	V(C_OSD_OP_TRIMTRUNC,	       C_OSD_OP_MODE_WR	   | C_OSD_OP_TYPE_DATA	 | 0x09, "C_OSD_OP_TRIMTRUNC")		\
1152 	V(C_OSD_OP_TMAPPUT,	       C_OSD_OP_MODE_WR	   | C_OSD_OP_TYPE_DATA	 | 0x0B, "C_OSD_OP_TMAPPUT")		\
1153 	V(C_OSD_OP_CREATE,	       C_OSD_OP_MODE_WR	   | C_OSD_OP_TYPE_DATA	 | 0x0D, "C_OSD_OP_CREATE")		\
1154 	V(C_OSD_OP_ROLLBACK,	       C_OSD_OP_MODE_WR	   | C_OSD_OP_TYPE_DATA	 | 0x0E, "C_OSD_OP_ROLLBACK")		\
1155 	V(C_OSD_OP_WATCH,	       C_OSD_OP_MODE_WR	   | C_OSD_OP_TYPE_DATA	 | 0x0F, "C_OSD_OP_WATCH")		\
1156 	V(C_OSD_OP_OMAPSETVALS,	       C_OSD_OP_MODE_WR	   | C_OSD_OP_TYPE_DATA	 | 0x15, "C_OSD_OP_OMAPSETVALS")	\
1157 	V(C_OSD_OP_OMAPSETHEADER,      C_OSD_OP_MODE_WR	   | C_OSD_OP_TYPE_DATA	 | 0x16, "C_OSD_OP_OMAPSETHEADER")	\
1158 	V(C_OSD_OP_OMAPCLEAR,	       C_OSD_OP_MODE_WR	   | C_OSD_OP_TYPE_DATA	 | 0x17, "C_OSD_OP_OMAPCLEAR")		\
1159 	V(C_OSD_OP_OMAPRMKEYS,	       C_OSD_OP_MODE_WR	   | C_OSD_OP_TYPE_DATA	 | 0x18, "C_OSD_OP_OMAPRMKEYS")		\
1160 	V(C_OSD_OP_COPY_FROM,	       C_OSD_OP_MODE_WR	   | C_OSD_OP_TYPE_DATA	 | 0x1A, "C_OSD_OP_COPY_FROM")		\
1161 	V(C_OSD_OP_UNDIRTY,	       C_OSD_OP_MODE_WR	   | C_OSD_OP_TYPE_DATA	 | 0x1C, "C_OSD_OP_UNDIRTY")		\
1162 	V(C_OSD_OP_SETALLOCHINT,       C_OSD_OP_MODE_WR	   | C_OSD_OP_TYPE_DATA	 | 0x23, "C_OSD_OP_SETALLOCHINT")	\
1163 	V(C_OSD_OP_SETXATTR,	       C_OSD_OP_MODE_WR	   | C_OSD_OP_TYPE_ATTR	 | 0x01, "C_OSD_OP_SETXATTR")		\
1164 	V(C_OSD_OP_SETXATTRS,	       C_OSD_OP_MODE_WR	   | C_OSD_OP_TYPE_ATTR	 | 0x02, "C_OSD_OP_SETXATTRS")		\
1165 	V(C_OSD_OP_RESETXATTRS,	       C_OSD_OP_MODE_WR	   | C_OSD_OP_TYPE_ATTR	 | 0x03, "C_OSD_OP_RESETXATTRS")	\
1166 	V(C_OSD_OP_RMXATTR,	       C_OSD_OP_MODE_WR	   | C_OSD_OP_TYPE_ATTR	 | 0x04, "C_OSD_OP_RMXATTR")		\
1167 	V(C_OSD_OP_CLONERANGE,	       C_OSD_OP_MODE_WR	   | C_OSD_OP_TYPE_MULTI | 0x01, "C_OSD_OP_CLONERANGE")		\
1168 	V(C_OSD_OP_MODE_RMW,	       0x3000,						 "C_OSD_OP_MODE_RMW")		\
1169 	V(C_OSD_OP_TMAPUP,	       C_OSD_OP_MODE_RMW   | C_OSD_OP_TYPE_DATA	 | 0x0A, "C_OSD_OP_TMAPUP")		\
1170 	V(C_OSD_OP_TMAP2OMAP,	       C_OSD_OP_MODE_RMW   | C_OSD_OP_TYPE_DATA	 | 0x22, "C_OSD_OP_TMAP2OMAP")		\
1171 	V(C_OSD_OP_MODE_SUB,	       0x4000,						 "C_OSD_OP_MODE_SUB")		\
1172 	V(C_OSD_OP_PULL,	       C_OSD_OP_MODE_SUB			 | 0x01, "C_OSD_OP_PULL")		\
1173 	V(C_OSD_OP_PUSH,	       C_OSD_OP_MODE_SUB			 | 0x02, "C_OSD_OP_PUSH")		\
1174 	V(C_OSD_OP_BALANCEREADS,       C_OSD_OP_MODE_SUB			 | 0x03, "C_OSD_OP_BALANCEREADS")	\
1175 	V(C_OSD_OP_UNBALANCEREADS,     C_OSD_OP_MODE_SUB			 | 0x04, "C_OSD_OP_UNBALANCEREADS")	\
1176 	V(C_OSD_OP_SCRUB,	       C_OSD_OP_MODE_SUB			 | 0x05, "C_OSD_OP_SCRUB")		\
1177 	V(C_OSD_OP_SCRUB_RESERVE,      C_OSD_OP_MODE_SUB			 | 0x06, "C_OSD_OP_SCRUB_RESERVE")	\
1178 	V(C_OSD_OP_SCRUB_UNRESERVE,    C_OSD_OP_MODE_SUB			 | 0x07, "C_OSD_OP_SCRUB_UNRESERVE")	\
1179 	V(C_OSD_OP_SCRUB_STOP,	       C_OSD_OP_MODE_SUB			 | 0x08, "C_OSD_OP_SCRUB_STOP")		\
1180 	V(C_OSD_OP_SCRUB_MAP,	       C_OSD_OP_MODE_SUB			 | 0x09, "C_OSD_OP_SCRUB_MAP")		\
1181 	V(C_OSD_OP_MODE_CACHE,	       0x8000,						 "C_OSD_OP_MODE_CACHE")		\
1182 	V(C_OSD_OP_CACHE_FLUSH,	       C_OSD_OP_MODE_CACHE | C_OSD_OP_TYPE_DATA	 | 0x1F, "C_OSD_OP_CACHE_FLUSH")	\
1183 	V(C_OSD_OP_CACHE_EVICT,	       C_OSD_OP_MODE_CACHE | C_OSD_OP_TYPE_DATA	 | 0x20, "C_OSD_OP_CACHE_EVICT")	\
1184 	V(C_OSD_OP_CACHE_TRY_FLUSH,    C_OSD_OP_MODE_CACHE | C_OSD_OP_TYPE_DATA	 | 0x21, "C_OSD_OP_CACHE_TRY_FLUSH")	\
1185 	V(C_OSD_OP_MODE,	       0xf000,						 "C_OSD_OP_MODE")
1186 
1187 C_MAKE_STRINGS_EXT(c_osd_optype, 4)
1188 
1189 #define c_poolop_type_strings_VALUE_STRING_LIST(V) \
1190 	V(POOL_OP_CREATE,		 0x01, "Create")		    \
1191 	V(POOL_OP_DELETE,		 0x02, "Delete")		    \
1192 	V(POOL_OP_AUID_CHANGE,		 0x03, "Change Owner")		    \
1193 	V(POOL_OP_CREATE_SNAP,		 0x11, "Create Snapshot")	    \
1194 	V(POOL_OP_DELETE_SNAP,		 0x12, "Delete Snapshot")	    \
1195 	V(POOL_OP_CREATE_UNMANAGED_SNAP, 0x21, "Create Unmanaged Snapshot") \
1196 	V(POOL_OP_DELETE_UNMANAGED_SNAP, 0x22, "Delete Unmanaged Snapshot")
1197 
1198 C_MAKE_STRINGS(c_poolop_type, 2)
1199 
1200 #define c_mon_election_type_strings_VALUE_STRING_LIST(V) \
1201 	V(C_MON_ELECTION_PROPOSE, 0x00000001, "Propose")	      \
1202 	V(C_MON_ELECTION_ACK,	  0x00000002, "Acknowledge")	      \
1203 	V(C_MON_ELECTION_NAK,	  0x00000003, "Negative Acknowledge") \
1204 	V(C_MON_ELECTION_VICTORY, 0x00000004, "Victory")
1205 
1206 C_MAKE_STRINGS_EXT(c_mon_election_type, 8)
1207 
1208 #define c_mon_paxos_op_strings_VALUE_STRING_LIST(V) \
1209 	V(C_MON_PAXOS_COLLECT,	0x00000001, "Propose Round")	    \
1210 	V(C_MON_PAXOS_LAST,	0x00000002, "Accept Round")	    \
1211 	V(C_MON_PAXOS_BEGIN,	0x00000003, "Propose Value")	    \
1212 	V(C_MON_PAXOS_ACCEPT,	0x00000004, "Accept Value")	    \
1213 	V(C_MON_PAXOS_COMMIT,	0x00000005, "Commit")		    \
1214 	V(C_MON_PAXOS_LEASE,	0x00000006, "Extend Peon Lease")    \
1215 	V(C_MON_PAXOS_LEASEACK, 0x00000007, "Lease Acknowledgment")
1216 
1217 C_MAKE_STRINGS_EXT(c_mon_paxos_op, 8)
1218 
1219 #define c_mon_probe_type_strings_VALUE_STRING_LIST(V) \
1220 	V(C_MON_PROBE_PROBE,		0x00000001, "Probe")		\
1221 	V(C_MON_PROBE_REPLY,		0x00000002, "Reply")		\
1222 	V(C_MON_PROBE_SLURP,		0x00000003, "Slurp")		\
1223 	V(C_MON_PROBE_SLURP_LATEST,	0x00000004, "Slurp Latest")	\
1224 	V(C_MON_PROBE_DATA,		0x00000005, "Data")		\
1225 	V(C_MON_PROBE_MISSING_FEATURES, 0x00000006, "Missing Features")
1226 
1227 C_MAKE_STRINGS_EXT(c_mon_probe_type, 8)
1228 
1229 #define c_osd_ping_op_strings_VALUE_STRING_LIST(V) \
1230 	V(C_TIMECHECK_HEARTBEAT,       0x00, "Heartbeat")	 \
1231 	V(C_TIMECHECK_START_HEARTBEAT, 0x01, "Start Heartbeats") \
1232 	V(C_TIMECHECK_YOU_DIED,	       0x02, "You Died")	 \
1233 	V(C_TIMECHECK_STOP_HEARTBEAT,  0x03, "Stop Heartbeats")	 \
1234 	V(C_TIMECHECK_PING,	       0x04, "Ping")		 \
1235 	V(C_TIMECHECK_PING_REPLY,      0x05, "Pong")
1236 
1237 C_MAKE_STRINGS_EXT(c_osd_ping_op, 2)
1238 
1239 #define c_session_op_type_strings_VALUE_STRING_LIST(V) \
1240 	V(C_SESSION_REQUEST_OPEN,      0x00000000, "Request Open")	 \
1241 	V(C_SESSION_OPEN,	       0x00000001, "Open")		 \
1242 	V(C_SESSION_REQUEST_CLOSE,     0x00000002, "Request Close")	 \
1243 	V(C_SESSION_CLOSE,	       0x00000003, "Close")		 \
1244 	V(C_SESSION_REQUEST_RENEWCAPS, 0x00000004, "Request Renew Caps") \
1245 	V(C_SESSION_RENEWCAPS,	       0x00000005, "Renew Caps")	 \
1246 	V(C_SESSION_STALE,	       0x00000006, "Stale")		 \
1247 	V(C_SESSION_RECALL_STATE,      0x00000007, "Recall Stale")	 \
1248 	V(C_SESSION_FLUSHMSG,	       0x00000008, "Flush Message")	 \
1249 	V(C_SESSION_FLUSHMSG_ACK,      0x00000009, "Flush Message Ack")
1250 
1251 C_MAKE_STRINGS_EXT(c_session_op_type, 8)
1252 
1253 #define c_mds_op_type_strings_VALUE_STRING_LIST(V) \
1254 	V(C_MDS_OP_LOOKUP,	 0x00000100, "MDS_OP_LOOKUP")	    \
1255 	V(C_MDS_OP_GETATTR,	 0x00000101, "MDS_OP_GETATTR")	    \
1256 	V(C_MDS_OP_LOOKUPHASH,	 0x00000102, "MDS_OP_LOOKUPHASH")   \
1257 	V(C_MDS_OP_LOOKUPPARENT, 0x00000103, "MDS_OP_LOOKUPPARENT") \
1258 	V(C_MDS_OP_LOOKUPINO,	 0x00000104, "MDS_OP_LOOKUPINO")    \
1259 	V(C_MDS_OP_LOOKUPNAME,	 0x00000105, "MDS_OP_LOOKUPNAME")   \
1260 	V(C_MDS_OP_GETFILELOCK,	 0x00000110, "MDS_OP_GETFILELOCK")  \
1261 	V(C_MDS_OP_OPEN,	 0x00000302, "MDS_OP_OPEN")	    \
1262 	V(C_MDS_OP_READDIR,	 0x00000305, "MDS_OP_READDIR")	    \
1263 	V(C_MDS_OP_LOOKUPSNAP,	 0x00000400, "MDS_OP_LOOKUPSNAP")   \
1264 	V(C_MDS_OP_LSSNAP,	 0x00000402, "MDS_OP_LSSNAP")	    \
1265 	V(C_MDS_OP_WRITE,	 0x00001000, "MDS_OP_WRITE")	    \
1266 	V(C_MDS_OP_SETXATTR,	 0x00001105, "MDS_OP_SETXATTR")	    \
1267 	V(C_MDS_OP_RMXATTR,	 0x00001106, "MDS_OP_RMXATTR")	    \
1268 	V(C_MDS_OP_SETLAYOUT,	 0x00001107, "MDS_OP_SETLAYOUT")    \
1269 	V(C_MDS_OP_SETATTR,	 0x00001108, "MDS_OP_SETATTR")	    \
1270 	V(C_MDS_OP_SETFILELOCK,	 0x00001109, "MDS_OP_SETFILELOCK")  \
1271 	V(C_MDS_OP_SETDIRLAYOUT, 0x0000110a, "MDS_OP_SETDIRLAYOUT") \
1272 	V(C_MDS_OP_MKNOD,	 0x00001201, "MDS_OP_MKNOD")	    \
1273 	V(C_MDS_OP_LINK,	 0x00001202, "MDS_OP_LINK")	    \
1274 	V(C_MDS_OP_UNLINK,	 0x00001203, "MDS_OP_UNLINK")	    \
1275 	V(C_MDS_OP_RENAME,	 0x00001204, "MDS_OP_RENAME")	    \
1276 	V(C_MDS_OP_MKDIR,	 0x00001220, "MDS_OP_MKDIR")	    \
1277 	V(C_MDS_OP_RMDIR,	 0x00001221, "MDS_OP_RMDIR")	    \
1278 	V(C_MDS_OP_SYMLINK,	 0x00001222, "MDS_OP_SYMLINK")	    \
1279 	V(C_MDS_OP_CREATE,	 0x00001301, "MDS_OP_CREATE")	    \
1280 	V(C_MDS_OP_MKSNAP,	 0x00001400, "MDS_OP_MKSNAP")	    \
1281 	V(C_MDS_OP_RMSNAP,	 0x00001401, "MDS_OP_RMSNAP")	    \
1282 	V(C_MDS_OP_FRAGMENTDIR,	 0x00001500, "MDS_OP_FRAGMENTDIR")  \
1283 	V(C_MDS_OP_EXPORTDIR,	 0x00001501, "MDS_OP_EXPORTDIR")
1284 
1285 C_MAKE_STRINGS_EXT(c_mds_op_type, 8)
1286 
1287 #define c_cap_op_type_strings_VALUE_STRING_LIST(V) \
1288 	V(C_CAP_OP_GRANT,	  0x00000000, "mds->client grant")		      \
1289 	V(C_CAP_OP_REVOKE,	  0x00000001, "mds->client revoke")		      \
1290 	V(C_CAP_OP_TRUNC,	  0x00000002, "mds->client trunc notify")	      \
1291 	V(C_CAP_OP_EXPORT,	  0x00000003, "mds has exported the cap")	      \
1292 	V(C_CAP_OP_IMPORT,	  0x00000004, "mds has imported the cap")	      \
1293 	V(C_CAP_OP_UPDATE,	  0x00000005, "client->mds update")		      \
1294 	V(C_CAP_OP_DROP,	  0x00000006, "client->mds drop cap bits")	      \
1295 	V(C_CAP_OP_FLUSH,	  0x00000007, "client->mds cap writeback")	      \
1296 	V(C_CAP_OP_FLUSH_ACK,	  0x00000008, "mds->client flushed")		      \
1297 	V(C_CAP_OP_FLUSHSNAP,	  0x00000009, "client->mds flush snapped metadata")   \
1298 	V(C_CAP_OP_FLUSHSNAP_ACK, 0x0000000A, "mds->client flushed snapped metadata") \
1299 	V(C_CAP_OP_RELEASE,	  0x0000000B, "client->mds release (clean) cap")      \
1300 	V(C_CAP_OP_RENEW,	  0x0000000C, "client->mds renewal request")
1301 
1302 C_MAKE_STRINGS_EXT(c_cap_op_type, 8)
1303 
1304 #define c_timecheck_op_strings_VALUE_STRING_LIST(V) \
1305 	V(C_TIMECHECK_OP_PING,	 0x00000001, "Ping")   \
1306 	V(C_TIMECHECK_OP_PONG,	 0x00000002, "Pong")   \
1307 	V(C_TIMECHECK_OP_REPORT, 0x00000003, "Report")
1308 
1309 C_MAKE_STRINGS_EXT(c_timecheck_op, 8)
1310 
1311 #define c_pgpool_type_strings_VALUE_STRING_LIST(V) \
1312 	V(C_PGPOOL_REPLICATED, 0x01, "Replicated")    \
1313 	V(C_PGPOOL_RAID4,      0x02, "Raid4")	      \
1314 	V(C_PGPOOL_ERASURE,    0x03, "Erasure-coded")
1315 
1316 C_MAKE_STRINGS(c_pgpool_type, 2)
1317 
1318 #define c_pgpool_cachemode_strings_VALUE_STRING_LIST(V) \
1319 	V(C_PGPOOL_CACHEMODE_NONE,	0x00, "No caching")						\
1320 	V(C_PGPOOL_CACHEMODE_WRITEBACK, 0x01, "Write to cache, flush later")				\
1321 	V(C_PGPOOL_CACHEMODE_FORWARD,	0x02, "Forward if not in cache")				\
1322 	V(C_PGPOOL_CACHEMODE_READONLY,	0x03, "Handle reads, forward writes [not strongly consistent]")
1323 
1324 C_MAKE_STRINGS_EXT(c_pgpool_cachemode, 2)
1325 
1326 #define c_hitset_params_type_strings_VALUE_STRING_LIST(V) \
1327 	V(C_HITSET_PARAMS_TYPE_NONE,		0x00, "None")		 \
1328 	V(C_HITSET_PARAMS_TYPE_EXPLICIT_HASH,	0x01, "Explicit Hash")	 \
1329 	V(C_HITSET_PARAMS_TYPE_EXPLICIT_OBJECT, 0x02, "Explicit Object") \
1330 	V(C_HITSET_PARAMS_TYPE_BLOOM,		0x03, "Bloom Filter")
1331 
1332 C_MAKE_STRINGS_EXT(c_hitset_params_type, 2)
1333 
1334 #define c_auth_proto_strings_VALUE_STRING_LIST(V) \
1335 	V(C_AUTH_PROTO_UNKNOWN, 0x00, "Undecided") \
1336 	V(C_AUTH_PROTO_NONE,	0x01, "None")	   \
1337 	V(C_AUTH_PROTO_CEPHX,	0x02, "CephX")
1338 
1339 C_MAKE_STRINGS(c_auth_proto, 2)
1340 
1341 #define c_cephx_req_type_strings_VALUE_STRING_LIST(V) \
1342 	V(C_CEPHX_REQ_AUTH_SESSIONKEY, 0x0100, "Get Auth Session Key")		 \
1343 	V(C_CEPHX_REQ_PRINCIPAL_SESSIONKEY, 0x0200, "Get Principal Session Key") \
1344 	V(C_CEPHX_REQ_ROTATINGKEY, 0x0400, "Get Rotating Key")
1345 
1346 C_MAKE_STRINGS(c_cephx_req_type, 4)
1347 
1348 /** Node type database. */
1349 #define c_node_type_strings_LIST(V, W) \
1350 	V(C_NODE_TYPE_UNKNOWN, 0x00, W("Unknown",		"unknown")) \
1351 	V(C_NODE_TYPE_MON,     0x01, W("Monitor",		"mon"	 )) \
1352 	V(C_NODE_TYPE_MDS,     0x02, W("Meta Data Server",	"mds"	 )) \
1353 	V(C_NODE_TYPE_OSD,     0x04, W("Object Storage Daemon", "osd"	 )) \
1354 	V(C_NODE_TYPE_CLIENT,  0x08, W("Client",		"client" )) \
1355 	V(C_NODE_TYPE_AUTH,    0x20, W("Authentication Server", "auth"	 ))
1356 
1357 #define C_EXTRACT_1(a, b) a
1358 #define C_EXTRACT_2(a, b) b
1359 
1360 /** Extract the full names to create a value_string list. */
1361 #define c_node_type_strings_VALUE_STRING_LIST(V) \
1362 	c_node_type_strings_LIST(V, C_EXTRACT_1)
1363 
1364 C_MAKE_STRINGS(c_node_type, 2)
1365 
1366 /** Extract the abbreviations to create a value_string list. */
1367 #define c_node_type_abbr_strings_VALUE_STRING_LIST(V) \
1368 	c_node_type_strings_LIST(V, C_EXTRACT_2)
1369 
1370 VALUE_STRING_ARRAY(c_node_type_abbr_strings);
1371 
1372 static
c_node_type_abbr_string(c_node_type val)1373 const char *c_node_type_abbr_string(c_node_type val)
1374 {
1375 	return val_to_str(val, c_node_type_abbr_strings, "Unknown (0x%02x)");
1376 }
1377 
1378 #define C_MON_SUB_FLAG_ONETIME  0x01
1379 
1380 typedef enum _c_state {
1381 	C_STATE_NEW,
1382 	C_STATE_OPEN,
1383 	C_STATE_SEQ /* Waiting for sequence number. */
1384 } c_state;
1385 
1386 typedef struct _c_node_name {
1387 	const char *slug;
1388 	const char *type_str;
1389 	guint64 id;
1390 	c_node_type type;
1391 } c_entityname;
1392 
1393 static
c_node_name_init(c_entityname * d)1394 void c_node_name_init(c_entityname *d)
1395 {
1396 	d->slug	    = NULL;
1397 	d->type_str = NULL;
1398 	d->id	    = G_MAXUINT64;
1399 	d->type	    = C_NODE_TYPE_UNKNOWN;
1400 }
1401 
1402 typedef struct _c_node {
1403 	address addr;
1404 	c_entityname name;
1405 	c_state state;
1406 	guint16 port;
1407 } c_node;
1408 
1409 static
c_node_init(c_node * n)1410 void c_node_init(c_node *n)
1411 {
1412 	clear_address(&n->addr);
1413 	c_node_name_init(&n->name);
1414 	n->port = 0xFFFF;
1415 	n->state = C_STATE_NEW;
1416 }
1417 
1418 static
c_node_copy(c_node * src,c_node * dst)1419 c_node *c_node_copy(c_node *src, c_node *dst)
1420 {
1421 	dst->name = src->name;
1422 	copy_address_shallow(&dst->addr, &src->addr);
1423 	dst->port = src->port;
1424 	dst->state = src->state;
1425 
1426 	return dst;
1427 }
1428 
1429 typedef struct _c_conv_data {
1430 	c_node client; /* The node that initiated this connection. */
1431 	c_node server; /* The other node. */
1432 } c_conv_data;
1433 
1434 static
c_conv_data_init(c_conv_data * d)1435 void c_conv_data_init(c_conv_data *d)
1436 {
1437 	c_node_init(&d->client);
1438 	c_node_init(&d->server);
1439 }
1440 
1441 static
c_conv_data_copy(c_conv_data * src,c_conv_data * dst)1442 c_conv_data *c_conv_data_copy(c_conv_data *src, c_conv_data *dst)
1443 {
1444 	c_node_copy(&src->client, &dst->client);
1445 	c_node_copy(&src->server, &dst->server);
1446 
1447 	return dst;
1448 }
1449 
1450 static
c_conv_data_clone(c_conv_data * d)1451 c_conv_data *c_conv_data_clone(c_conv_data *d)
1452 {
1453 	return c_conv_data_copy(d, wmem_new(wmem_file_scope(), c_conv_data));
1454 }
1455 
1456 static
c_conv_data_new(void)1457 c_conv_data *c_conv_data_new(void)
1458 {
1459 	c_conv_data *r;
1460 	r = wmem_new(wmem_file_scope(), c_conv_data);
1461 	c_conv_data_init(r);
1462 	return r;
1463 }
1464 
1465 typedef struct _c_header {
1466 	guint64 seq;
1467 	guint64 tid;
1468 	c_msg_type type;
1469 	guint16 ver;
1470 	guint16 priority;
1471 	c_entityname src;
1472 } c_header;
1473 
1474 static
c_header_init(c_header * h)1475 void c_header_init(c_header *h)
1476 {
1477 	h->seq	    = 0;
1478 	h->tid	    = 0;
1479 	h->type	    = C_MSG_UNKNOWN;
1480 	h->priority = 0;
1481 	h->ver	    = 0;
1482 	memset(&h->src, 0, sizeof(h->src));
1483 }
1484 
1485 typedef struct _c_pkt_data {
1486 	conversation_t *conv;	/* The wireshark conversation. */
1487 	c_conv_data *convd;	/* The Ceph conversation data. */
1488 	c_node *src;		/* The node in convd that sent this message. */
1489 	c_node *dst;		/* The node in convd that is receiving this message. */
1490 
1491 	proto_item  *item_root;	/* The root proto_item for the message. */
1492 	packet_info *pinfo;
1493 
1494 	c_header header;	/* The MSG header. */
1495 } c_pkt_data;
1496 
1497 /** Initialize the packet data.
1498  *
1499  * The packet data structure holds all of the Ceph-specific data that is needed
1500  * to dissect the protocol.  This function initializes the structure.
1501  *
1502  * This function grabs the appropriate data either from previous packets in the
1503  * dissection, or creating a new data for new conversations.
1504  *
1505  * Lastly this function saves the state before every packet so that if we are
1506  * asked to dissect the same packet again the same state will be used as when
1507  * it was dissected initially.
1508  */
1509 static void
c_pkt_data_init(c_pkt_data * d,packet_info * pinfo,guint off)1510 c_pkt_data_init(c_pkt_data *d, packet_info *pinfo, guint off)
1511 {
1512 	/* Get conversation to store/retrieve connection data. */
1513 	d->conv = find_or_create_conversation(pinfo);
1514 	DISSECTOR_ASSERT_HINT(d->conv, "find_or_create_conversation() returned NULL");
1515 
1516 	if (pinfo->fd->visited)
1517 	{
1518 		/* Retrieve the saved state. */
1519 		d->convd = (c_conv_data*)p_get_proto_data(wmem_file_scope(), pinfo,
1520 							  proto_ceph, off);
1521 		DISSECTOR_ASSERT_HINT(d->convd, "Frame visited, but no saved state.");
1522 		/* Make a copy and use that so we don't mess up the original. */
1523 		d->convd = c_conv_data_copy(d->convd, wmem_new(wmem_packet_scope(), c_conv_data));
1524 	}
1525 	else
1526 	{
1527 		/*
1528 			If there is no saved state get the state from dissecting the
1529 			last packet.
1530 		*/
1531 		d->convd = (c_conv_data*)conversation_get_proto_data(d->conv, proto_ceph);
1532 	}
1533 
1534 	if (!d->convd) /* New conversation. */
1535 	{
1536 		d->convd = c_conv_data_new();
1537 		conversation_add_proto_data(d->conv, proto_ceph, d->convd);
1538 	}
1539 
1540 	/*
1541 	 * Set up src and dst pointers correctly, if the client port is
1542 	 * already set. Otherwise, we need to wait until we have enough
1543 	 * data to determine which is which.
1544 	 */
1545 	if (d->convd->client.port != 0xFFFF) {
1546 		if (addresses_equal(&d->convd->client.addr, &pinfo->src) &&
1547 		    d->convd->client.port == pinfo->srcport)
1548 		{
1549 			d->src = &d->convd->client;
1550 			d->dst = &d->convd->server;
1551 		}
1552 		else
1553 		{
1554 			d->src = &d->convd->server;
1555 			d->dst = &d->convd->client;
1556 		}
1557 		DISSECTOR_ASSERT(d->src);
1558 		DISSECTOR_ASSERT(d->dst);
1559 	}
1560 
1561 	c_header_init(&d->header);
1562 	d->item_root = NULL;
1563 	d->pinfo    = pinfo;
1564 }
1565 
1566 /** Save packet data.
1567  *
1568  * This function should be called on complete PDUs to save the state so that
1569  * it will be available when redissecting the packet again later..
1570  *
1571  * This function only actually saves the state when necessary.
1572  */
1573 static
c_pkt_data_save(c_pkt_data * d,packet_info * pinfo,guint off)1574 void c_pkt_data_save(c_pkt_data *d, packet_info *pinfo, guint off)
1575 {
1576 	if (!pinfo->fd->visited)
1577 	{
1578 		/*
1579 			Save a copy of the state for next time we dissect this packet.
1580 		*/
1581 		p_add_proto_data(wmem_file_scope(), pinfo, proto_ceph, off,
1582 						    c_conv_data_clone(d->convd));
1583 	}
1584 }
1585 
1586 /** Check if packet is from the client.
1587  *
1588  * Returns true iff the packet is from the client.
1589  */
1590 static
c_from_client(c_pkt_data * d)1591 gboolean c_from_client(c_pkt_data *d)
1592 {
1593 	return d->src == &d->convd->client;
1594 }
1595 
1596 /** Check if packet is from the server.
1597  *
1598  * See c_from_client()
1599  */
1600 static
c_from_server(c_pkt_data * d)1601 gboolean c_from_server(c_pkt_data *d)
1602 {
1603 	return d->src == &d->convd->server;
1604 }
1605 
1606 static
c_set_type(c_pkt_data * data,const char * type)1607 void c_set_type(c_pkt_data *data, const char *type)
1608 {
1609 	col_add_str(data->pinfo->cinfo, COL_INFO, type);
1610 	proto_item_append_text(data->item_root, " %s", type);
1611 }
1612 
1613 static
c_append_text(c_pkt_data * data,proto_item * ti,const char * fmt,...)1614 void c_append_text(c_pkt_data *data, proto_item *ti, const char *fmt, ...)
1615 {
1616 	va_list ap;
1617 	char buf[ITEM_LABEL_LENGTH];
1618 	va_start(ap, fmt);
1619 
1620 	g_vsnprintf(buf, sizeof(buf), fmt, ap);
1621 
1622 	proto_item_append_text(ti,		"%s", buf);
1623 	proto_item_append_text(data->item_root, "%s", buf);
1624 
1625 	va_end(ap);
1626 }
1627 
1628 /** Format a timespec.
1629  *
1630  * The returned string has packet lifetime.
1631  */
1632 static
c_format_timespec(tvbuff_t * tvb,guint off)1633 char *c_format_timespec(tvbuff_t *tvb, guint off)
1634 {
1635 	nstime_t t;
1636 	t.secs	= tvb_get_letohl(tvb, off);
1637 	t.nsecs = tvb_get_letohl(tvb, off+4);
1638 	return abs_time_to_str(wmem_packet_scope(), &t, ABSOLUTE_TIME_LOCAL, 1);
1639 }
1640 
1641 /** Format a UUID
1642  *
1643  * The returned string has packet lifetime.
1644  */
1645 static
c_format_uuid(tvbuff_t * tvb,guint off)1646 char *c_format_uuid(tvbuff_t *tvb, guint off)
1647 {
1648 	e_guid_t uuid;
1649 	tvb_get_guid(tvb, off, &uuid, ENC_BIG_ENDIAN);
1650 	return guid_to_str(wmem_packet_scope(), &uuid);
1651 }
1652 
1653 #define C_NEEDMORE      G_MAXUINT
1654 #define C_INVALID       0
1655 
1656 /*** Expert info warning functions. ***/
1657 
1658 /** Warn about unused data.
1659  *
1660  * Check if there is unused data and if there is warn about it.
1661  *
1662  * @param tree	The tree where the error should be added.
1663  * @param tvb	The buffer with the data.
1664  * @param start The start of the unused data.
1665  * @param end	Then end of the unused data.
1666  * @param data	The packet data.
1667  * @return True iff there was unused data.
1668  */
1669 static
c_warn_unused(proto_tree * tree,tvbuff_t * tvb,guint start,guint end,c_pkt_data * data)1670 gboolean c_warn_unused(proto_tree *tree,
1671 		       tvbuff_t *tvb, guint start, guint end, c_pkt_data *data)
1672 {
1673 	guint diff;
1674 
1675 	DISSECTOR_ASSERT_CMPUINT(start, <=, end);
1676 
1677 	diff = end - start;
1678 	if (!diff) return FALSE; /* no unused space. */
1679 
1680 	proto_tree_add_expert_format(tree, data->pinfo, &ei_unused,
1681 				     tvb, start, diff,
1682 				     "%u unused byte%s", diff, diff == 1? "":"s");
1683 
1684 	return TRUE;
1685 }
1686 
1687 /** Warn about dissection using more data then expected.
1688  *
1689  * Check if there is an overrun and if there is warn about it.
1690  *
1691  * @param tree	The tree where the error should be added.
1692  * @param tvb	The buffer with the data.
1693  * @param start The start of the overun.
1694  * @param end	Then end of the overrun.
1695  * @param data	The packet data.
1696  * @return True iff there was an overrun.
1697  */
1698 static
c_warn_overrun(proto_tree * tree,tvbuff_t * tvb,guint start,guint end,c_pkt_data * data)1699 gboolean c_warn_overrun(proto_tree *tree,
1700 			tvbuff_t *tvb, guint start, guint end, c_pkt_data *data)
1701 {
1702 	guint diff;
1703 
1704 	DISSECTOR_ASSERT_CMPUINT(start, <=, end);
1705 
1706 	diff = end - start;
1707 	if (!diff) return FALSE; /* no unused space. */
1708 
1709 	proto_tree_add_expert_format(tree, data->pinfo, &ei_overrun,
1710 				     tvb, start, diff,
1711 				     "%u overrun byte%s", diff, diff == 1? "":"s");
1712 
1713 	return TRUE;
1714 }
1715 
1716 /** Warn about incorrect offset.
1717  *
1718  * Check if the offset is at the expected location, otherwise warn about it.
1719  *
1720  * @param tree The tree where the error should be added.
1721  * @param tvb  The buffer with the data.
1722  * @param act  The actual offset.
1723  * @param exp  The expected offset.
1724  * @param data The packet data.
1725  * @return True iff there was a mismatch.
1726  */
1727 static
c_warn_size(proto_tree * tree,tvbuff_t * tvb,guint act,guint exp,c_pkt_data * data)1728 gboolean c_warn_size(proto_tree *tree,
1729 		     tvbuff_t *tvb, guint act, guint exp, c_pkt_data *data)
1730 {
1731 	if (act < exp) return c_warn_unused (tree, tvb, act, exp, data);
1732 	else	       return c_warn_overrun(tree, tvb, exp, act, data);
1733 }
1734 
1735 /** Warn about version mismatches.
1736  *
1737  * Check that the version is within the supported range, otherwise warn about
1738  * it.
1739  *
1740  * @param ti   The item to attach the warning to (probably the version item).
1741  * @param min  The minimum supported version.
1742  * @param max  The maximum supported version.
1743  * @param data The packet data.
1744  * @return A value less than zero if the version is to old and a value greater
1745  *	   then zero if the version is too new.	 Otherwise return zero.
1746  */
1747 static
c_warn_ver(proto_item * ti,gint act,gint min,gint max,c_pkt_data * data)1748 gshort c_warn_ver(proto_item *ti,
1749 		  gint act, gint min, gint max, c_pkt_data *data)
1750 {
1751 	DISSECTOR_ASSERT_CMPINT(min, <=, max);
1752 
1753 	if (act < min)
1754 	{
1755 		expert_add_info_format(data->pinfo, ti, &ei_ver_tooold,
1756 				       "Version %d is lower then the minimum "
1757 				       "supported version (%d).",
1758 				       act, min);
1759 		return -1;
1760 	}
1761 	if (act > max)
1762 	{
1763 		expert_add_info_format(data->pinfo, ti, &ei_ver_toonew,
1764 				       "Version %d is higher then the maximum "
1765 				       "supported version (%d).",
1766 				       act, max);
1767 		return 1;
1768 	}
1769 
1770 	return 0;
1771 }
1772 
1773 /***** Data Structure Dissectors *****/
1774 
1775 /** Dissect a length-delimited binary blob.
1776  */
1777 static
c_dissect_blob(proto_tree * root,int hf,int hf_data,int hf_len,tvbuff_t * tvb,guint off)1778 guint c_dissect_blob(proto_tree *root, int hf, int hf_data, int hf_len,
1779 		     tvbuff_t *tvb, guint off)
1780 {
1781 	proto_item *ti;
1782 	proto_tree *tree;
1783 	guint32 size;
1784 
1785 	size = tvb_get_letohl(tvb, off);
1786 
1787 	ti = proto_tree_add_item(root, hf, tvb, off, size+4, ENC_NA);
1788 	tree = proto_item_add_subtree(ti, ett_data);
1789 
1790 	proto_item_append_text(ti, ", Size: %"G_GINT32_MODIFIER"u", size);
1791 	if (size)
1792 	{
1793 		proto_item_append_text(ti, ", Data: %s",
1794 				       tvb_bytes_to_str(wmem_packet_scope(), tvb, off+4, size));
1795 	}
1796 
1797 	proto_tree_add_item(tree, hf_len,
1798 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
1799 	off += 4;
1800 	proto_tree_add_item(tree, hf_data,
1801 			    tvb, off, size, ENC_NA);
1802 	off += size;
1803 
1804 	return off;
1805 }
1806 
1807 /** Dissect a blob of data.
1808  *
1809  * This is intended for data that is not yet being dissected but will be later.
1810  */
1811 static
c_dissect_data(proto_tree * tree,int hf,tvbuff_t * tvb,guint off)1812 guint c_dissect_data(proto_tree *tree, int hf,
1813 		     tvbuff_t *tvb, guint off)
1814 {
1815 	return c_dissect_blob(tree, hf, hf_data_data, hf_data_size, tvb, off);
1816 }
1817 
1818 typedef struct _c_str {
1819 	char	*str;  /** The string data ('\0' terminated). */
1820 	guint32	 size; /** The number of bytes in the string. */
1821 } c_str;
1822 
1823 /** Dissect a length-delimited string.
1824  *
1825  * If \a out is provided the string will be stored there.
1826  */
1827 static
c_dissect_str(proto_tree * root,int hf,c_str * out,tvbuff_t * tvb,guint off)1828 guint c_dissect_str(proto_tree *root, int hf, c_str *out,
1829 		     tvbuff_t *tvb, guint off)
1830 {
1831 	proto_item *ti;
1832 	proto_tree *tree;
1833 	c_str d;
1834 
1835 	d.size = tvb_get_letohl(tvb, off);
1836 	d.str  = (char*)tvb_get_string_enc(wmem_packet_scope(),
1837 					   tvb, off+4, d.size, ENC_ASCII);
1838 
1839 	ti = proto_tree_add_string_format_value(root, hf, tvb, off, 4+d.size,
1840 						d.str,
1841 						"%s", d.str);
1842 	tree = proto_item_add_subtree(ti, ett_str);
1843 
1844 	proto_tree_add_item(tree, hf_string_size,
1845 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
1846 	off += 4;
1847 	proto_tree_add_item(tree, hf_string_data,
1848 			    tvb, off, d.size, ENC_UTF_8|ENC_NA);
1849 	off += d.size;
1850 
1851 	if (out) *out = d;
1852 
1853 	return off;
1854 }
1855 
1856 #define C_SIZE_SOCKADDR_STORAGE 128
1857 
1858 typedef struct _c_sockaddr {
1859 	const gchar *str;      /** A string representing the entire address. */
1860 	const gchar *addr_str; /** A string representing the address portion. */
1861 
1862 	c_inet af;	       /** Address family. */
1863 	guint16 port;	       /** Network Port. */
1864 } c_sockaddr;
1865 
1866 /** Dissect sockaddr structure.
1867  *
1868  * If \a out is provided the data will be stored there.
1869  */
1870 static
c_dissect_sockaddr(proto_tree * root,c_sockaddr * out,tvbuff_t * tvb,guint off)1871 guint c_dissect_sockaddr(proto_tree *root, c_sockaddr *out,
1872 			 tvbuff_t *tvb, guint off)
1873 {
1874 	proto_item *ti;
1875 	proto_tree *tree;
1876 	c_sockaddr d;
1877 
1878 	/*
1879 	struct sockaddr_storage {
1880 		guint16 family;
1881 		guint8	pad[???]; // Implementation defined.
1882 	};
1883 	struct sockaddr_in {
1884 		guint16 family;
1885 		guint16 port;
1886 		guint32 addr;
1887 		guint8	pad[8];
1888 	};
1889 	struct sockaddr_in6 {
1890 		guint16 family;
1891 		guint16 port;
1892 		guint32 flow;
1893 		guint8	addr[16];
1894 		guint32 scope;
1895 	};
1896 	*/
1897 
1898 	ti = proto_tree_add_item(root, hf_sockaddr,
1899 				 tvb, off, C_SIZE_SOCKADDR_STORAGE, ENC_NA);
1900 	tree = proto_item_add_subtree(ti, ett_sockaddr);
1901 
1902 	d.af = (c_inet)tvb_get_ntohs(tvb, off);
1903 
1904 	proto_tree_add_item(tree, hf_inet_family, tvb, off, 2, ENC_BIG_ENDIAN);
1905 
1906 	switch (d.af) {
1907 	case C_IPv4:
1908 		d.port	   = tvb_get_ntohs(tvb, off+2);
1909 		d.addr_str = tvb_ip_to_str(wmem_packet_scope(), tvb, off+4);
1910 
1911 		proto_tree_add_item(tree, hf_port, tvb, off+2, 2, ENC_BIG_ENDIAN);
1912 		proto_tree_add_item(tree, hf_addr_ipv4, tvb, off+4, 4, ENC_BIG_ENDIAN);
1913 		break;
1914 	case C_IPv6:
1915 		d.port	   = tvb_get_ntohs (tvb, off+2);
1916 		d.addr_str = tvb_ip6_to_str(wmem_packet_scope(), tvb, off+8);
1917 
1918 		proto_tree_add_item(tree, hf_port, tvb, off+2, 2, ENC_BIG_ENDIAN);
1919 		proto_tree_add_item(tree, hf_addr_ipv6, tvb, off+8, 16, ENC_NA);
1920 		break;
1921 	default:
1922 		d.port = 0;
1923 		d.addr_str = "Unknown INET";
1924 	}
1925 	off += C_SIZE_SOCKADDR_STORAGE; /* Skip over sockaddr_storage. */
1926 
1927 	d.str = wmem_strdup_printf(wmem_packet_scope(), "%s:%"G_GINT16_MODIFIER"u",
1928 				   d.addr_str,
1929 				   d.port);
1930 	proto_item_append_text(ti, ": %s", d.str);
1931 
1932 	if (out) *out = d;
1933 
1934 	return off;
1935 }
1936 
1937 #define C_SIZE_ENTITY_ADDR (4 + 4 + C_SIZE_SOCKADDR_STORAGE)
1938 
1939 typedef struct _c_entity_addr {
1940 	c_sockaddr addr;
1941 	const char *type_str;
1942 	c_node_type type;
1943 } c_entityaddr;
1944 
1945 static
c_dissect_entityaddr(proto_tree * root,int hf,c_entityaddr * out,tvbuff_t * tvb,guint off)1946 guint c_dissect_entityaddr(proto_tree *root, int hf, c_entityaddr *out,
1947 			   tvbuff_t *tvb, guint off)
1948 {
1949 	proto_item *ti;
1950 	proto_tree *tree;
1951 	c_entityaddr d;
1952 
1953 	/* entity_addr_t from ceph:/src/msg/msg_types.h */
1954 
1955 	ti = proto_tree_add_item(root, hf, tvb, off, C_SIZE_ENTITY_ADDR, ENC_NA);
1956 	tree = proto_item_add_subtree(ti, ett_entityaddr);
1957 
1958 	d.type = (c_node_type)tvb_get_letohl(tvb, off);
1959 	d.type_str = c_node_type_string(d.type);
1960 	proto_tree_add_item(tree, hf_node_type,
1961 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
1962 	off += 4;
1963 	proto_tree_add_item(tree, hf_node_nonce,
1964 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
1965 	off += 4;
1966 	off = c_dissect_sockaddr(tree, &d.addr, tvb, off);
1967 
1968 	proto_item_append_text(ti, ", Type: %s, Address: %s",
1969 			       d.type_str, d.addr.str);
1970 
1971 	if (out) *out = d;
1972 
1973 	return off;
1974 }
1975 
1976 #define C_SIZE_ENTITY_NAME 9
1977 
1978 /** Dissect a ceph_entity_name.
1979  *
1980  * If \a out is provided the data is stored there.
1981  */
1982 static
c_dissect_entityname(proto_tree * root,int hf,c_entityname * out,tvbuff_t * tvb,guint off,c_pkt_data * data _U_)1983 guint c_dissect_entityname(proto_tree *root, int hf, c_entityname *out,
1984 			   tvbuff_t *tvb, guint off, c_pkt_data *data _U_)
1985 {
1986 	/* From ceph:/src/include/msgr.h
1987 	struct ceph_entity_name {
1988 		__u8 type;	// CEPH_ENTITY_TYPE_*
1989 		__le64 num;
1990 	} __attribute__ ((packed));
1991 	*/
1992 
1993 	proto_item *ti;
1994 	proto_tree *tree;
1995 	c_entityname d;
1996 
1997 	ti = proto_tree_add_item(root, hf,
1998 				 tvb, off, C_SIZE_ENTITY_NAME, ENC_NA);
1999 	tree = proto_item_add_subtree(ti, ett_entityname);
2000 
2001 	d.type	   = (c_node_type)tvb_get_guint8(tvb, off);
2002 	d.type_str = c_node_type_abbr_string(d.type);
2003 	proto_tree_add_item(tree, hf_node_type,
2004 			    tvb, off, 1, ENC_LITTLE_ENDIAN);
2005 	off += 1;
2006 
2007 	d.id   = tvb_get_letoh64(tvb, off);
2008 	proto_tree_add_item(tree, hf_node_id,
2009 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
2010 	off += 8;
2011 
2012 	if (d.id == G_MAXUINT64)
2013 	{
2014 		d.slug = d.type_str;
2015 	}
2016 	else
2017 	{
2018 		d.slug = wmem_strdup_printf(wmem_packet_scope(), "%s%"G_GINT64_MODIFIER"u",
2019 					    d.type_str,
2020 					    d.id);
2021 	}
2022 
2023 	proto_item_append_text(ti, ": %s", d.slug);
2024 
2025 	if (out) *out = d;
2026 	return off;
2027 }
2028 
2029 typedef struct _c_entityinst {
2030 	c_entityname name;
2031 	c_entityaddr addr;
2032 } c_entityinst;
2033 
2034 /** Dissect an entity_inst_t.
2035  */
2036 static
c_dissect_entityinst(proto_tree * root,int hf,c_entityinst * out,tvbuff_t * tvb,guint off,c_pkt_data * data)2037 guint c_dissect_entityinst(proto_tree *root, int hf, c_entityinst *out,
2038 			   tvbuff_t *tvb, guint off, c_pkt_data *data)
2039 {
2040 	proto_item *ti;
2041 	proto_tree *tree;
2042 
2043 	c_entityinst d;
2044 
2045 	ti = proto_tree_add_item(root, hf, tvb, off, -1, ENC_NA);
2046 	tree = proto_item_add_subtree(ti, ett_entityinst);
2047 
2048 	off = c_dissect_entityname(tree, hf_entityinst_name, &d.name, tvb, off, data);
2049 	off = c_dissect_entityaddr(tree, hf_entityinst_addr, &d.addr, tvb, off);
2050 
2051 	proto_item_append_text(ti, ", Name: %s, Address: %s", d.name.slug, d.addr.addr.str);
2052 
2053 	if (out) *out = d;
2054 
2055 	proto_item_set_end(ti, tvb, off);
2056 	return off;
2057 }
2058 
2059 /** Dissect an EntityName.
2060  *
2061  * If \a out is provided the data is stored there.
2062  *
2063  * \note This is different then c_dissect_entityname()
2064  */
2065 static
c_dissect_EntityName(proto_tree * root,tvbuff_t * tvb,guint off,c_pkt_data * data _U_)2066 guint c_dissect_EntityName(proto_tree *root,
2067 			   tvbuff_t *tvb, guint off, c_pkt_data *data _U_)
2068 {
2069 	/* EntityName from ceph:/src/common/entity_name.h */
2070 
2071 	proto_item *ti;
2072 	proto_tree *tree;
2073 	c_node_type type;
2074 	c_str name;
2075 
2076 	ti = proto_tree_add_item(root, hf_EntityName,
2077 				 tvb, off, -1, ENC_NA);
2078 	tree = proto_item_add_subtree(ti, ett_EntityName);
2079 
2080 	type = (c_node_type)tvb_get_letohl(tvb, off);
2081 	proto_tree_add_item(tree, hf_EntityName_type,
2082 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
2083 	off += 4;
2084 
2085 	off = c_dissect_str(tree, hf_EntityName_id, &name, tvb, off);
2086 
2087 	proto_item_append_text(ti, ": %s.%s",
2088 			       c_node_type_abbr_string(type), name.str);
2089 
2090 	proto_item_set_end(ti, tvb, off);
2091 	return off;
2092 }
2093 
2094 /** Dissect a connection features list. */
2095 static
c_dissect_features(proto_tree * tree,tvbuff_t * tvb,guint off,c_pkt_data * data _U_)2096 guint c_dissect_features(proto_tree *tree,
2097 			 tvbuff_t *tvb, guint off, c_pkt_data *data _U_)
2098 {
2099 	static int * const lowword[] = {
2100 		&hf_feature_uid,
2101 		&hf_feature_nosrcaddr,
2102 		&hf_feature_monclockcheck,
2103 		&hf_feature_flock,
2104 		&hf_feature_subscribe2,
2105 		&hf_feature_monnames,
2106 		&hf_feature_reconnect_seq,
2107 		&hf_feature_dirlayouthash,
2108 		&hf_feature_objectlocator,
2109 		&hf_feature_pgid64,
2110 		&hf_feature_incsubosdmap,
2111 		&hf_feature_pgpool3,
2112 		&hf_feature_osdreplymux,
2113 		&hf_feature_osdenc,
2114 		&hf_feature_omap,
2115 		&hf_feature_monenc,
2116 		&hf_feature_query_t,
2117 		&hf_feature_indep_pg_map,
2118 		&hf_feature_crush_tunables,
2119 		&hf_feature_chunky_scrub,
2120 		&hf_feature_mon_nullroute,
2121 		&hf_feature_mon_gv,
2122 		&hf_feature_backfill_reservation,
2123 		&hf_feature_msg_auth,
2124 		&hf_feature_recovery_reservation,
2125 		&hf_feature_crush_tunables2,
2126 		&hf_feature_createpoolid,
2127 		&hf_feature_reply_create_inode,
2128 		&hf_feature_osd_hbmsgs,
2129 		&hf_feature_mdsenc,
2130 		&hf_feature_osdhashpspool,
2131 		&hf_feature_mon_single_paxos,
2132 		NULL
2133 	};
2134 	static int * const highword[] = {
2135 		&hf_feature_osd_snapmapper,
2136 		&hf_feature_mon_scrub,
2137 		&hf_feature_osd_packed_recovery,
2138 		&hf_feature_osd_cachepool,
2139 		&hf_feature_crush_v2,
2140 		&hf_feature_export_peer,
2141 		&hf_feature_osd_erasure_codes,
2142 		&hf_feature_osd_tmap2omap,
2143 		&hf_feature_osdmap_enc,
2144 		&hf_feature_mds_inline_data,
2145 		&hf_feature_crush_tunables3,
2146 		&hf_feature_osd_primary_affinity,
2147 		&hf_feature_msgr_keepalive2,
2148 		&hf_feature_reserved,
2149 		NULL
2150 	};
2151 
2152 	/* Wireshark doesn't have support for 64 bit bitfields so dissect as
2153 	   two 32 bit ones. */
2154 
2155 	proto_tree_add_bitmask(tree, tvb, off, hf_features_low, hf_features_low,
2156 			       lowword, ENC_LITTLE_ENDIAN);
2157 	off += 4;
2158 
2159 	proto_tree_add_bitmask(tree, tvb, off, hf_features_high, hf_features_high,
2160 			       highword, ENC_LITTLE_ENDIAN);
2161 	off += 4;
2162 
2163 	return off;
2164 }
2165 
2166 /** Dissect message flags. */
2167 static
c_dissect_flags(proto_tree * tree,tvbuff_t * tvb,guint off,c_pkt_data * data _U_)2168 guint c_dissect_flags(proto_tree *tree,
2169 		      tvbuff_t *tvb, guint off, c_pkt_data *data _U_)
2170 {
2171 	static int * const flags[] = {
2172 		&hf_flag_lossy,
2173 		NULL
2174 	};
2175 
2176 	proto_tree_add_bitmask(tree, tvb, off, hf_flags, hf_flags,
2177 			       flags, ENC_LITTLE_ENDIAN);
2178 
2179 	return off+1;
2180 }
2181 
2182 #define C_OSD_FLAG_ACK		    0x00000001   /* want (or is) "ack" ack */
2183 #define C_OSD_FLAG_ONNVRAM	    0x00000002   /* want (or is) "onnvram" ack */
2184 #define C_OSD_FLAG_ONDISK	    0x00000004   /* want (or is) "ondisk" ack */
2185 #define C_OSD_FLAG_RETRY	    0x00000008   /* resend attempt */
2186 #define C_OSD_FLAG_READ		    0x00000010   /* op may read */
2187 #define C_OSD_FLAG_WRITE	    0x00000020   /* op may write */
2188 #define C_OSD_FLAG_ORDERSNAP	    0x00000040   /* EOLDSNAP if snapc is out of order */
2189 #define C_OSD_FLAG_PEERSTAT_OLD	    0x00000080   /* DEPRECATED msg includes osd_peer_stat */
2190 #define C_OSD_FLAG_BALANCE_READS    0x00000100
2191 #define C_OSD_FLAG_PARALLELEXEC	    0x00000200   /* execute op in parallel */
2192 #define C_OSD_FLAG_PGOP		    0x00000400   /* pg op, no object */
2193 #define C_OSD_FLAG_EXEC		    0x00000800   /* op may exec */
2194 #define C_OSD_FLAG_EXEC_PUBLIC	    0x00001000   /* DEPRECATED op may exec (public) */
2195 #define C_OSD_FLAG_LOCALIZE_READS   0x00002000   /* read from nearby replica, if any */
2196 #define C_OSD_FLAG_RWORDERED	    0x00004000   /* order wrt concurrent reads */
2197 #define C_OSD_FLAG_IGNORE_CACHE	    0x00008000   /* ignore cache logic */
2198 #define C_OSD_FLAG_SKIPRWLOCKS	    0x00010000   /* skip rw locks */
2199 #define C_OSD_FLAG_IGNORE_OVERLAY   0x00020000   /* ignore pool overlay */
2200 #define C_OSD_FLAG_FLUSH	    0x00040000   /* this is part of flush */
2201 #define C_OSD_FLAG_MAP_SNAP_CLONE   0x00080000   /* map snap direct to clone id */
2202 #define C_OSD_FLAG_ENFORCE_SNAPC    0x00100000   /* use snapc provided even if pool uses pool snaps */
2203 
2204 /** Dissect OSD flags. */
2205 static
c_dissect_osd_flags(proto_tree * tree,tvbuff_t * tvb,guint off,c_pkt_data * data _U_)2206 guint c_dissect_osd_flags(proto_tree *tree,
2207 			  tvbuff_t *tvb, guint off, c_pkt_data *data _U_)
2208 {
2209 	static int * const flags[] = {
2210 		&hf_osd_flag_ack,
2211 		&hf_osd_flag_onnvram,
2212 		&hf_osd_flag_ondisk,
2213 		&hf_osd_flag_retry,
2214 		&hf_osd_flag_read,
2215 		&hf_osd_flag_write,
2216 		&hf_osd_flag_ordersnap,
2217 		&hf_osd_flag_peerstat_old,
2218 		&hf_osd_flag_balance_reads,
2219 		&hf_osd_flag_parallelexec,
2220 		&hf_osd_flag_pgop,
2221 		&hf_osd_flag_exec,
2222 		&hf_osd_flag_exec_public,
2223 		&hf_osd_flag_localize_reads,
2224 		&hf_osd_flag_rwordered,
2225 		&hf_osd_flag_ignore_cache,
2226 		&hf_osd_flag_skiprwlocks,
2227 		&hf_osd_flag_ignore_overlay,
2228 		&hf_osd_flag_flush,
2229 		&hf_osd_flag_map_snap_clone,
2230 		&hf_osd_flag_enforce_snapc,
2231 		NULL
2232 	};
2233 
2234 	proto_tree_add_bitmask(tree, tvb, off, hf_osd_flags, hf_osd_flags,
2235 			       flags, ENC_LITTLE_ENDIAN);
2236 
2237 	return off+4;
2238 }
2239 
2240 /** Dissect a map<string,string>
2241  */
2242 static
c_dissect_kv(proto_tree * root,int hf,int hf_k,int hf_v,tvbuff_t * tvb,guint off)2243 guint c_dissect_kv(proto_tree *root, int hf, int hf_k, int hf_v,
2244 		   tvbuff_t *tvb, guint off)
2245 {
2246 	proto_item *ti;
2247 	proto_tree *tree;
2248 	c_str k, v;
2249 
2250 	ti = proto_tree_add_item(root, hf, tvb, off, -1, ENC_LITTLE_ENDIAN);
2251 	tree = proto_item_add_subtree(ti, ett_kv);
2252 
2253 	off = c_dissect_str(tree, hf_k, &k, tvb, off);
2254 	off = c_dissect_str(tree, hf_v, &v, tvb, off);
2255 
2256 	proto_item_append_text(ti, ", %s = %s", k.str, v.str);
2257 	proto_item_set_end(ti, tvb, off);
2258 
2259 	return off;
2260 }
2261 
2262 typedef struct _c_encoded {
2263 	guint8	version; /** The version of the struct. */
2264 	guint8	compat;	 /** The oldest compatible version. */
2265 	guint32 size;	 /** The size of the struct in bytes */
2266 	guint	end;	 /** The end of the structure's data. */
2267 } c_encoded;
2268 
2269 /** Dissect and 'encoded' struct.
2270  *
2271  * @param enc The encoded structure to store data in.
2272  * @param minver The minimum version that is understood.
2273  * @param maxver The maximum version that is understood.
2274  * @return The offset of the data.
2275  */
2276 static
c_dissect_encoded(proto_tree * tree,c_encoded * enc,guint8 minver,guint8 maxver,tvbuff_t * tvb,guint off,c_pkt_data * data)2277 guint c_dissect_encoded(proto_tree *tree, c_encoded *enc,
2278 			guint8 minver, guint8 maxver,
2279 			tvbuff_t *tvb, guint off, c_pkt_data *data)
2280 {
2281 	proto_item *ti;
2282 
2283 	DISSECTOR_ASSERT_HINT(enc, "enc out parameter must be non-null.");
2284 
2285 	enc->version = tvb_get_guint8(tvb, off);
2286 	ti = proto_tree_add_item(tree, hf_encoded_ver,
2287 				 tvb, off++, 1, ENC_LITTLE_ENDIAN);
2288 	c_warn_ver(ti, enc->version, minver, maxver, data);
2289 	enc->compat = tvb_get_guint8(tvb, off);
2290 	proto_tree_add_item(tree, hf_encoded_compat,
2291 			    tvb, off++, 1, ENC_LITTLE_ENDIAN);
2292 
2293 	enc->size = tvb_get_letohl(tvb, off);
2294 	proto_tree_add_item(tree, hf_encoded_size,
2295 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
2296 	off += 4;
2297 
2298 	enc->end = off + enc->size;
2299 
2300 	return off;
2301 }
2302 
2303 #define C_SIZE_TIMESPEC  (4 + 4)
2304 
2305 #define C_SIZE_EVERSION  12
2306 
2307 /** Dissect a eversion_t */
2308 static
c_dissect_eversion(proto_tree * root,gint hf,tvbuff_t * tvb,guint off,c_pkt_data * data _U_)2309 guint c_dissect_eversion(proto_tree *root, gint hf,
2310 			 tvbuff_t *tvb, guint off, c_pkt_data *data _U_)
2311 {
2312 	proto_item *ti;
2313 	proto_tree *tree;
2314 	guint64 ver;
2315 	guint32 epoch;
2316 
2317 	/** eversion_t from ceph:/src/osd/osd_types.h */
2318 
2319 	ti   = proto_tree_add_item(root, hf, tvb, off, C_SIZE_EVERSION, ENC_NA);
2320 	tree = proto_item_add_subtree(ti, ett_eversion);
2321 
2322 	/*** version_t ***/
2323 	ver = tvb_get_letoh64(tvb, off);
2324 	proto_tree_add_item(tree, hf_version, tvb, off, 8, ENC_LITTLE_ENDIAN);
2325 	off += 8;
2326 
2327 	/*** epoch_t ***/
2328 	epoch = tvb_get_letohl(tvb, off);
2329 	proto_tree_add_item(tree, hf_epoch, tvb, off, 4, ENC_LITTLE_ENDIAN);
2330 	off += 4;
2331 
2332 	proto_item_append_text(ti,
2333 			       ", Version: %"G_GINT64_MODIFIER"d"
2334 			       ", Epoch: %"G_GINT32_MODIFIER"d",
2335 			       ver, epoch);
2336 
2337 	proto_item_set_end(ti, tvb, off);
2338 	return off;
2339 }
2340 
2341 /** Dissect an object locator. */
2342 static
c_dissect_object_locator(proto_tree * root,gint hf,tvbuff_t * tvb,guint off,c_pkt_data * data)2343 guint c_dissect_object_locator(proto_tree *root, gint hf,
2344 			       tvbuff_t *tvb, guint off, c_pkt_data *data)
2345 {
2346 	proto_item *ti;
2347 	proto_tree *tree;
2348 	c_encoded enchdr;
2349 	c_str key, nspace;
2350 	gint64 hash;
2351 
2352 	ti   = proto_tree_add_item(root, hf, tvb, off, -1, ENC_NA);
2353 	tree = proto_item_add_subtree(ti, ett_objectlocator);
2354 
2355 	off = c_dissect_encoded(tree, &enchdr, 3, 6, tvb, off, data);
2356 
2357 	proto_item_append_text(ti, ", Pool: %"G_GINT64_MODIFIER"d",
2358 			       tvb_get_letohi64(tvb, off));
2359 	proto_tree_add_item(tree, hf_pool, tvb, off, 8, ENC_LITTLE_ENDIAN);
2360 	off += 8;
2361 
2362 	off += 4; /* Skip over preferred == -1 that old code used. */
2363 
2364 	key.size = tvb_get_letohl(tvb, off);
2365 	if (key.size)
2366 	{
2367 		off = c_dissect_str(tree, hf_key, &key, tvb, off);
2368 		proto_item_append_text(ti, ", Key: \"%s\"", key.str);
2369 	}
2370 	else off += 4; /* If string is empty we should use hash. */
2371 
2372 	if (enchdr.version >= 5)
2373 	{
2374 		off = c_dissect_str(tree, hf_namespace, &nspace, tvb, off);
2375 		if (nspace.size)
2376 			proto_item_append_text(ti, ", Namespace: \"%s\"", nspace.str);
2377 	}
2378 
2379 	if (enchdr.version >= 6)
2380 	{
2381 		hash = tvb_get_letoh64(tvb, off);
2382 		if (hash >= 0)
2383 		{
2384 			proto_tree_add_item(tree, hf_hash, tvb, off, 8, ENC_LITTLE_ENDIAN);
2385 			proto_item_append_text(ti, ", Hash: %"G_GINT64_MODIFIER"d", hash);
2386 		}
2387 		off += 8;
2388 	}
2389 	else hash = -1;
2390 
2391 	if (key.size && hash >= 0)
2392 	{
2393 		proto_tree_add_expert(tree, data->pinfo, &ei_oloc_both, NULL, 0, 0);
2394 	}
2395 
2396 	c_warn_size(tree, tvb, off, enchdr.end, data);
2397 	off = enchdr.end;
2398 
2399 	proto_item_set_end(ti, tvb, off);
2400 	return off;
2401 }
2402 
2403 /** Dissect a placement group. */
2404 static
c_dissect_pg(proto_tree * root,gint hf,tvbuff_t * tvb,guint off,c_pkt_data * data)2405 guint c_dissect_pg(proto_tree *root, gint hf,
2406 		   tvbuff_t *tvb, guint off, c_pkt_data *data)
2407 {
2408 	proto_item *ti, *ti2;
2409 	proto_tree *tree;
2410 	guint8 ver;
2411 	gint32 preferred;
2412 
2413 	/** pg_t from ceph:/src/osd/osd_types.h */
2414 
2415 	ti   = proto_tree_add_item(root, hf, tvb, off, -1, ENC_NA);
2416 	tree = proto_item_add_subtree(ti, ett_pg);
2417 
2418 	ver = tvb_get_guint8(tvb, off);
2419 	ti2 = proto_tree_add_item(tree, hf_pgid_ver, tvb, off, 1, ENC_LITTLE_ENDIAN);
2420 	c_warn_ver(ti2, ver, 1, 1, data);
2421 	off += 1;
2422 
2423 	proto_item_append_text(ti, ", Pool: %"G_GINT64_MODIFIER"d",
2424 			       tvb_get_letoh64(tvb, off));
2425 	proto_tree_add_item(tree, hf_pgid_pool, tvb, off, 8, ENC_LITTLE_ENDIAN);
2426 	off += 8;
2427 
2428 	proto_item_append_text(ti, ", Seed: %08"G_GINT32_MODIFIER"X",
2429 			       tvb_get_letohl(tvb, off));
2430 	proto_tree_add_item(tree, hf_pgid_seed, tvb, off, 4, ENC_LITTLE_ENDIAN);
2431 	off += 4;
2432 
2433 	preferred = tvb_get_letohl(tvb, off);
2434 	if (preferred >= 0)
2435 		proto_item_append_text(ti, ", Prefer: %"G_GINT32_MODIFIER"d", preferred);
2436 	proto_tree_add_item(tree, hf_pgid_preferred, tvb, off, 4, ENC_LITTLE_ENDIAN);
2437 	off += 4;
2438 
2439 	proto_item_set_end(ti, tvb, off);
2440 	return off;
2441 }
2442 
2443 /** Dissect a placement group creation. */
2444 static
c_dissect_pg_create(proto_tree * root,gint hf,tvbuff_t * tvb,guint off,c_pkt_data * data)2445 guint c_dissect_pg_create(proto_tree *root, gint hf,
2446 			  tvbuff_t *tvb, guint off, c_pkt_data *data)
2447 {
2448 	proto_item *ti;
2449 	proto_tree *tree;
2450 	c_encoded enc;
2451 
2452 	/** pg_create_t from ceph:/src/osd/osd_types.h */
2453 
2454 	ti   = proto_tree_add_item(root, hf, tvb, off, -1, ENC_NA);
2455 	tree = proto_item_add_subtree(ti, ett_pg_create);
2456 
2457 	off = c_dissect_encoded(tree, &enc, 1, 1, tvb, off, data);
2458 
2459 	proto_tree_add_item(tree, hf_pg_create_epoch,
2460 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
2461 	off += 4;
2462 
2463 	off = c_dissect_pg(tree, hf_pg_create_parent, tvb, off, data);
2464 
2465 	proto_tree_add_item(tree, hf_pg_create_splitbits,
2466 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
2467 	off += 4;
2468 
2469 	c_warn_size(tree, tvb, off, enc.end, data);
2470 	off = enc.end;
2471 
2472 	proto_item_set_end(ti, tvb, off);
2473 	return off;
2474 }
2475 
2476 /** Dissect a filepath. */
2477 static
c_dissect_path(proto_tree * root,gint hf,tvbuff_t * tvb,guint off,c_pkt_data * data)2478 guint c_dissect_path(proto_tree *root, gint hf,
2479 		     tvbuff_t *tvb, guint off, c_pkt_data *data)
2480 {
2481 	proto_item *ti, *ti2;
2482 	proto_tree *tree;
2483 	guint64 inode;
2484 	c_str rel;
2485 	guint v;
2486 
2487 	/** filepath from ceph:/src/include/filepath.h */
2488 
2489 	ti   = proto_tree_add_item(root, hf, tvb, off, -1, ENC_NA);
2490 	tree = proto_item_add_subtree(ti, ett_filepath);
2491 
2492 	v = tvb_get_guint8(tvb, off);
2493 	ti2 = proto_tree_add_item(tree, hf_path_ver, tvb, off, 1, ENC_LITTLE_ENDIAN);
2494 	c_warn_ver(ti2, v, 1, 1, data);
2495 	off += 1;
2496 
2497 	inode = tvb_get_letoh64(tvb, off);
2498 	proto_tree_add_item(tree, hf_path_inode, tvb, off, 8, ENC_LITTLE_ENDIAN);
2499 	off += 8;
2500 
2501 	off = c_dissect_str(tree, hf_path_rel, &rel, tvb, off);
2502 
2503 	if (inode)
2504 		proto_item_append_text(ti, ", Inode: 0x%016"G_GINT64_MODIFIER"u", inode);
2505 	if (rel.size)
2506 		proto_item_append_text(ti, ", Rel: \"%s\"", rel.str);
2507 
2508 	proto_item_set_end(ti, tvb, off);
2509 	return off;
2510 }
2511 
2512 /** Dissect a capability release. */
2513 static
c_dissect_mds_release(proto_tree * root,gint hf,tvbuff_t * tvb,guint off,c_pkt_data * data _U_)2514 guint c_dissect_mds_release(proto_tree *root, gint hf,
2515 			    tvbuff_t *tvb, guint off, c_pkt_data *data _U_)
2516 {
2517 	proto_item *ti;
2518 	proto_tree *tree;
2519 	guint64 inode;
2520 
2521 	/** MClientRequest::Release from ceph:/src/messages/MClientRequest.h */
2522 
2523 	ti   = proto_tree_add_item(root, hf, tvb, off, -1, ENC_NA);
2524 	tree = proto_item_add_subtree(ti, ett_mds_release);
2525 
2526 	inode = tvb_get_letoh64(tvb, off);
2527 	proto_tree_add_item(tree, hf_mds_release_inode,
2528 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
2529 	off += 8;
2530 
2531 	proto_tree_add_item(tree, hf_mds_release_capid,
2532 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
2533 	off += 8;
2534 
2535 	proto_tree_add_item(tree, hf_mds_release_new,
2536 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
2537 	off += 4;
2538 
2539 	proto_tree_add_item(tree, hf_mds_release_wanted,
2540 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
2541 	off += 4;
2542 
2543 	proto_tree_add_item(tree, hf_mds_release_seq,
2544 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
2545 	off += 4;
2546 
2547 	proto_tree_add_item(tree, hf_mds_release_seq_issue,
2548 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
2549 	off += 4;
2550 
2551 	proto_tree_add_item(tree, hf_mds_release_mseq,
2552 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
2553 	off += 4;
2554 
2555 	proto_tree_add_item(tree, hf_mds_release_dname_seq,
2556 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
2557 	off += 4;
2558 
2559 	off = c_dissect_str(tree, hf_mds_release_dname, NULL, tvb, off);
2560 
2561 	proto_item_append_text(ti, ", Inode: 0x%016"G_GINT64_MODIFIER"u", inode);
2562 
2563 	proto_item_set_end(ti, tvb, off);
2564 	return off;
2565 }
2566 
2567 /** Dissect a HitSet::Params */
2568 static
c_dissect_hitset_params(proto_tree * root,tvbuff_t * tvb,guint off,c_pkt_data * data)2569 guint c_dissect_hitset_params(proto_tree *root,
2570 			      tvbuff_t *tvb, guint off, c_pkt_data *data)
2571 {
2572 	proto_item *ti, *ti2;
2573 	proto_tree *tree;
2574 	c_encoded enc, encimpl;
2575 	c_hitset_params_type type;
2576 	guint32 i;
2577 
2578 	/** HitSet::Params from ceph:/src/osd/HitSet.h */
2579 
2580 	ti   = proto_tree_add_item(root, hf_hitset_params, tvb, off, -1, ENC_NA);
2581 	tree = proto_item_add_subtree(ti, ett_hitset_params);
2582 
2583 	off = c_dissect_encoded(tree, &enc, 1, 1, tvb, off, data);
2584 
2585 	type = (c_hitset_params_type)tvb_get_guint8(tvb, off);
2586 	proto_item_append_text(ti, ", Type: %s", c_hitset_params_type_string(type));
2587 	ti2 = proto_tree_add_item(tree, hf_hitset_params_type,
2588 				  tvb, off, 1, ENC_LITTLE_ENDIAN);
2589 	off += 1;
2590 
2591 	switch (type)
2592 	{
2593 	case C_HITSET_PARAMS_TYPE_NONE:
2594 		break;
2595 	case C_HITSET_PARAMS_TYPE_EXPLICIT_HASH:
2596 		off = c_dissect_encoded(tree, &encimpl, 1, 1, tvb, off, data);
2597 
2598 		proto_tree_add_item(tree, hf_hitset_params_exphash_count,
2599 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
2600 		off += 8;
2601 
2602 		i = tvb_get_letohl(tvb, off);
2603 		off += 4;
2604 		while (i--)
2605 		{
2606 			proto_tree_add_item(tree, hf_hitset_params_exphash_hit,
2607 					    tvb, off, 4, ENC_LITTLE_ENDIAN);
2608 			off += 4;
2609 		}
2610 
2611 		c_warn_size(tree, tvb, off, encimpl.end, data);
2612 		off = encimpl.end;
2613 		break;
2614 	default:
2615 		expert_add_info(data->pinfo, ti2, &ei_union_unknown);
2616 		off = enc.end; /* Skip everything. */
2617 	}
2618 
2619 	c_warn_size(tree, tvb, off, enc.end, data);
2620 	off = enc.end;
2621 
2622 	return off;
2623 }
2624 
2625 
2626 /** Dissect a pool_snap_info_t */
2627 static
c_dissect_snapinfo(proto_tree * root,tvbuff_t * tvb,guint off,c_pkt_data * data)2628 guint c_dissect_snapinfo(proto_tree *root,
2629 			 tvbuff_t *tvb, guint off, c_pkt_data *data)
2630 {
2631 	proto_item *ti;
2632 	proto_tree *tree;
2633 	c_encoded enc;
2634 	guint64 id;
2635 	c_str name;
2636 	char *date;
2637 
2638 	/** pool_snap_info_t from ceph:/src/osd/osd_types.h */
2639 
2640 	ti   = proto_tree_add_item(root, hf_snapinfo, tvb, off, -1, ENC_NA);
2641 	tree = proto_item_add_subtree(ti, ett_snapinfo);
2642 
2643 	off = c_dissect_encoded(tree, &enc, 2, 2, tvb, off, data);
2644 
2645 	id = tvb_get_letoh64(tvb, off);
2646 	proto_tree_add_item(tree, hf_snapinfo_id,
2647 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
2648 	off += 8;
2649 
2650 	date = c_format_timespec(tvb, off);
2651 	proto_tree_add_item(tree, hf_snapinfo_time,
2652 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
2653 	off += 8;
2654 
2655 	off = c_dissect_str(tree, hf_snapinfo_name, &name, tvb, off);
2656 
2657 	proto_item_set_text(ti, ", ID: 0x%016"G_GINT64_MODIFIER"X"
2658 			    ", Name: %s, Date: %s",
2659 			    id,
2660 			    name.str,
2661 			    date);
2662 
2663 	c_warn_size(tree, tvb, off, enc.size, data);
2664 	off = enc.size;
2665 
2666 	return off;
2667 }
2668 
2669 /** Dissect a pg pool. */
2670 static
c_dissect_pgpool(proto_tree * root,tvbuff_t * tvb,guint off,c_pkt_data * data)2671 guint c_dissect_pgpool(proto_tree *root,
2672 		       tvbuff_t *tvb, guint off, c_pkt_data *data)
2673 {
2674 	proto_item *ti, *ti2;
2675 	proto_tree *tree, *subtree;
2676 	c_encoded enc;
2677 	guint32 i;
2678 	c_pgpool_type type;
2679 	c_pgpool_cachemode cachemode;
2680 
2681 	static int * const flags_low[] = {
2682 		&hf_pgpool_flag_hashpool,
2683 		&hf_pgpool_flag_full,
2684 		&hf_pgpool_flag_fake_ec_pool,
2685 		NULL
2686 	};
2687 	static int * const flags_high[] = {
2688 		NULL
2689 	};
2690 
2691 	/** pg_pool_t from ceph:/src/osd/osd_types.h */
2692 
2693 	ti   = proto_tree_add_item(root, hf_pgpool, tvb, off, -1, ENC_NA);
2694 	tree = proto_item_add_subtree(ti, ett_pgpool);
2695 
2696 	off = c_dissect_encoded(tree, &enc, 5, 15, tvb, off, data);
2697 
2698 	type = (c_pgpool_type)tvb_get_guint8(tvb, off);
2699 	proto_tree_add_item(tree, hf_pgpool_type,
2700 			    tvb, off, 1, ENC_LITTLE_ENDIAN);
2701 	off += 1;
2702 
2703 	proto_tree_add_item(tree, hf_pgpool_size,
2704 			    tvb, off, 1, ENC_LITTLE_ENDIAN);
2705 	off += 1;
2706 
2707 	proto_tree_add_item(tree, hf_pgpool_crush_ruleset,
2708 			    tvb, off, 1, ENC_LITTLE_ENDIAN);
2709 	off += 1;
2710 
2711 	proto_tree_add_item(tree, hf_pgpool_hash,
2712 			    tvb, off, 1, ENC_LITTLE_ENDIAN);
2713 	off += 1;
2714 
2715 	proto_tree_add_item(tree, hf_pgpool_pgnum,
2716 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
2717 	off += 4;
2718 
2719 	proto_tree_add_item(tree, hf_pgpool_pgpnum,
2720 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
2721 	off += 4;
2722 
2723 	off += 4 + 4; /* Always 0 in new code.	Ignored field. */
2724 
2725 	proto_tree_add_item(tree, hf_pgpool_changed,
2726 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
2727 	off += 4;
2728 
2729 	proto_tree_add_item(tree, hf_pgpool_snapseq,
2730 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
2731 	off += 8;
2732 
2733 	proto_tree_add_item(tree, hf_pgpool_snapepoch,
2734 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
2735 	off += 4;
2736 
2737 	i = tvb_get_letohl(tvb, off);
2738 	off += 4;
2739 	while (i--)
2740 	{
2741 		ti2 = proto_tree_add_item(tree, hf_pgpool_snap,
2742 					  tvb, off, -1, ENC_NA);
2743 		subtree = proto_item_add_subtree(ti2, ett_pgpool_snap);
2744 
2745 		proto_tree_add_item(subtree, hf_pgpool_snap_id,
2746 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
2747 		off += 8;
2748 
2749 		off = c_dissect_snapinfo(subtree, tvb, off, data);
2750 
2751 		proto_item_set_end(ti2, tvb, off);
2752 	}
2753 
2754 	i = tvb_get_letohl(tvb, off);
2755 	off += 4;
2756 	while (i--)
2757 	{
2758 		ti2 = proto_tree_add_item(tree, hf_pgpool_snapdel,
2759 					  tvb, off, -1, ENC_NA);
2760 		subtree = proto_item_add_subtree(ti2, ett_pgpool_snapdel);
2761 
2762 		proto_tree_add_item(subtree, hf_pgpool_snapdel_from,
2763 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
2764 		off += 8;
2765 		proto_tree_add_item(subtree, hf_pgpool_snapdel_to,
2766 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
2767 		off += 8;
2768 
2769 		proto_item_set_end(ti2, tvb, off);
2770 	}
2771 
2772 	proto_tree_add_item(tree, hf_pgpool_uid,
2773 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
2774 	off += 8;
2775 
2776 	proto_tree_add_bitmask(tree, tvb, off, hf_pgpool_flags_low, hf_pgpool_flags_low,
2777 			       flags_low, ENC_LITTLE_ENDIAN);
2778 	off += 4;
2779 	proto_tree_add_bitmask(tree, tvb, off, hf_pgpool_flags_high, hf_pgpool_flags_high,
2780 			       flags_high, ENC_LITTLE_ENDIAN);
2781 	off += 4;
2782 
2783 	proto_tree_add_item(tree, hf_pgpool_crash_reply_interval,
2784 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
2785 	off += 4;
2786 
2787 	proto_tree_add_item(tree, hf_pgpool_min_size,
2788 			    tvb, off, 1, ENC_LITTLE_ENDIAN);
2789 	off += 1;
2790 
2791 	proto_tree_add_item(tree, hf_pgpool_quota_bytes,
2792 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
2793 	off += 8;
2794 
2795 	proto_tree_add_item(tree, hf_pgpool_quota_objects,
2796 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
2797 	off += 8;
2798 
2799 	i = tvb_get_letohl(tvb, off);
2800 	off += 4;
2801 	while (i--)
2802 	{
2803 		proto_tree_add_item(tree, hf_pgpool_tier,
2804 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
2805 		off += 8;
2806 	}
2807 
2808 	proto_tree_add_item(tree, hf_pgpool_tierof,
2809 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
2810 	off += 8;
2811 
2812 	cachemode = (c_pgpool_cachemode)tvb_get_guint8(tvb, off);
2813 	proto_tree_add_item(tree, hf_pgpool_cachemode,
2814 			    tvb, off, 1, ENC_LITTLE_ENDIAN);
2815 	off += 1;
2816 
2817 	proto_tree_add_item(tree, hf_pgpool_readtier,
2818 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
2819 	off += 8;
2820 
2821 	proto_tree_add_item(tree, hf_pgpool_writetier,
2822 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
2823 	off += 8;
2824 
2825 	i = tvb_get_letohl(tvb, off);
2826 	off += 4;
2827 	while (i--)
2828 	{
2829 		c_str k, v;
2830 
2831 		ti2 = proto_tree_add_item(tree, hf_pgpool_property, tvb, off, -1, ENC_NA);
2832 		subtree = proto_item_add_subtree(ti2, ett_pgpool_property);
2833 
2834 		off = c_dissect_str(subtree, hf_pgpool_property_key, &k, tvb, off);
2835 		off = c_dissect_str(subtree, hf_pgpool_property_val, &v, tvb, off);
2836 
2837 		proto_item_append_text(ti2, ": %s=%s", k.str, v.str);
2838 
2839 		proto_item_set_end(ti2, tvb, off);
2840 	}
2841 
2842 	off = c_dissect_hitset_params(tree, tvb, off, data);
2843 
2844 	proto_tree_add_item(tree, hf_pgpool_hitset_period,
2845 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
2846 	off += 4;
2847 
2848 	proto_tree_add_item(tree, hf_pgpool_hitset_count,
2849 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
2850 	off += 4;
2851 
2852 	proto_tree_add_item(tree, hf_pgpool_stripewidth,
2853 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
2854 	off += 4;
2855 
2856 	proto_tree_add_item(tree, hf_pgpool_targetmaxsize,
2857 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
2858 	off += 8;
2859 
2860 	proto_tree_add_item(tree, hf_pgpool_targetmaxobj,
2861 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
2862 	off += 8;
2863 
2864 	proto_tree_add_item(tree, hf_pgpool_cache_targetdirtyratio,
2865 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
2866 	off += 4;
2867 
2868 	proto_tree_add_item(tree, hf_pgpool_cache_targetfullratio,
2869 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
2870 	off += 4;
2871 
2872 	proto_tree_add_item(tree, hf_pgpool_cache_flushage_min,
2873 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
2874 	off += 4;
2875 
2876 	proto_tree_add_item(tree, hf_pgpool_cache_evictage_min,
2877 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
2878 	off += 4;
2879 
2880 	off = c_dissect_str(tree, hf_pgpool_erasurecode_profile, NULL, tvb, off);
2881 
2882 	proto_tree_add_item(tree, hf_pgpool_lastforceresend,
2883 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
2884 	off += 4;
2885 
2886 	c_warn_size(tree, tvb, off, enc.end, data);
2887 	off = enc.end;
2888 
2889 	proto_item_append_text(ti, ", Type: %s, Cache Mode: %s",
2890 			       c_pgpool_type_string(type),
2891 			       c_pgpool_cachemode_string(cachemode));
2892 
2893 	return off;
2894 }
2895 
2896 /** Dissect a MonMap. */
2897 static
c_dissect_monmap(proto_tree * root,tvbuff_t * tvb,guint off,c_pkt_data * data)2898 guint c_dissect_monmap(proto_tree *root,
2899 		       tvbuff_t *tvb, guint off, c_pkt_data *data)
2900 {
2901 	proto_item *ti, *ti2;
2902 	proto_tree *tree, *subtree;
2903 	guint size, end;
2904 	guint32 i;
2905 	c_encoded enc;
2906 	c_str str;
2907 	c_entityaddr addr;
2908 
2909 	/** MonMap from ceph:/src/mon/MonMap.cc */
2910 
2911 	size = tvb_get_letohl(tvb, off);
2912 	end = off + 4 + size;
2913 
2914 	/* No data here. */
2915 	if (!size) return end;
2916 
2917 	ti   = proto_tree_add_item(root, hf_monmap, tvb, off, size, ENC_NA);
2918 	tree = proto_item_add_subtree(ti, ett_mon_map);
2919 
2920 	off += 4;
2921 
2922 	off = c_dissect_encoded(tree, &enc, 3, 3, tvb, off, data);
2923 	/* Check the blob size and encoded size match. */
2924 	c_warn_size(tree, tvb, enc.end, end, data);
2925 
2926 	proto_tree_add_item(tree, hf_monmap_fsid, tvb, off, 16, ENC_BIG_ENDIAN);
2927 	off += 16;
2928 
2929 	proto_tree_add_item(tree, hf_monmap_epoch, tvb, off, 4, ENC_LITTLE_ENDIAN);
2930 	off += 4;
2931 
2932 	i = tvb_get_letohl(tvb, off);
2933 	off += 4;
2934 	while (i--)
2935 	{
2936 		ti2 = proto_tree_add_item(tree, hf_monmap_address,
2937 					  tvb, off, -1, ENC_NA);
2938 		subtree = proto_item_add_subtree(ti2, ett_mon_map_address);
2939 
2940 		off = c_dissect_str(subtree, hf_monmap_address_name, &str, tvb, off);
2941 		off = c_dissect_entityaddr(subtree, hf_monmap_address_addr, &addr,
2942 					   tvb, off);
2943 
2944 		proto_item_append_text(ti2, ", Name: %s, Address: %s",
2945 				       str.str, addr.addr.addr_str);
2946 
2947 		proto_item_set_end(ti2, tvb, off);
2948 	}
2949 
2950 	proto_tree_add_item(tree, hf_monmap_changed, tvb, off, 8, ENC_LITTLE_ENDIAN);
2951 	off += 8;
2952 
2953 	proto_tree_add_item(tree, hf_monmap_created, tvb, off, 8, ENC_LITTLE_ENDIAN);
2954 	off += 8;
2955 
2956 	c_warn_size(tree, tvb, off, end, data);
2957 	off = end;
2958 
2959 	return off;
2960 }
2961 
2962 /** Dissect an osd_peer_stat_t */
2963 static
c_dissect_osd_peerstat(proto_tree * root,tvbuff_t * tvb,guint off,c_pkt_data * data)2964 guint c_dissect_osd_peerstat(proto_tree *root,
2965 			     tvbuff_t *tvb, guint off, c_pkt_data *data)
2966 {
2967 	proto_item *ti;
2968 	proto_tree *tree;
2969 	c_encoded enc;
2970 
2971 	/* osd_peer_stat_t from ceph:/src/osd/osd_types.h */
2972 
2973 	ti   = proto_tree_add_item(root, hf_osd_peerstat, tvb, off, -1, ENC_NA);
2974 	tree = proto_item_add_subtree(ti, ett_osd_peerstat);
2975 
2976 	off = c_dissect_encoded(tree, &enc, 1, 1, tvb, off, data);
2977 
2978 	proto_tree_add_item(tree, hf_osd_peerstat_timestamp,
2979 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
2980 	off += 8;
2981 
2982 	c_warn_size(tree, tvb, off, enc.end, data);
2983 	off = enc.end;
2984 
2985 	proto_item_set_end(ti, tvb, off);
2986 	return off;
2987 }
2988 
2989 /** Dissect a CompatSet::FeatureSet */
2990 static
c_dissect_featureset(proto_tree * root,int hf,tvbuff_t * tvb,guint off,c_pkt_data * data _U_)2991 guint c_dissect_featureset(proto_tree *root, int hf,
2992 			   tvbuff_t *tvb, guint off, c_pkt_data *data _U_)
2993 {
2994 	proto_item *ti;
2995 	proto_tree *tree;
2996 	guint32 i;
2997 	guint64 features;
2998 
2999 	/* CompatSet::FeatureSet from ceph:/src/include/FeatureSet.h */
3000 
3001 	ti   = proto_tree_add_item(root, hf, tvb, off, -1, ENC_NA);
3002 	tree = proto_item_add_subtree(ti, ett_featureset);
3003 
3004 	features = tvb_get_letoh64(tvb, off);
3005 	proto_tree_add_item(tree, hf_featureset_mask,
3006 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
3007 	off += 8;
3008 
3009 	i = tvb_get_letohl(tvb, off);
3010 	off += 4;
3011 	while (i--)
3012 	{
3013 		proto_item *ti2;
3014 		proto_tree *subtree;
3015 		guint64 val;
3016 		c_str name;
3017 
3018 		ti2 = proto_tree_add_item(tree, hf_featureset_name, tvb, off, -1, ENC_NA);
3019 		subtree = proto_item_add_subtree(ti2, ett_featureset_name);
3020 
3021 		val = tvb_get_letoh64(tvb, off);
3022 		proto_tree_add_item(subtree, hf_featureset_name_val,
3023 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
3024 		off += 8;
3025 
3026 		off = c_dissect_str(subtree, hf_featureset_name_name, &name, tvb, off);
3027 
3028 		proto_item_append_text(ti2, ", Value: %"G_GINT64_MODIFIER"u, Name: %s",
3029 				       val, name.str);
3030 		proto_item_set_end(ti2, tvb, off);
3031 	}
3032 
3033 	proto_item_append_text(ti, ", Features: 0x%016"G_GINT64_MODIFIER"X", features);
3034 	proto_item_set_end(ti, tvb, off);
3035 	return off;
3036 }
3037 
3038 /** Dissect a CompatSet */
3039 static
c_dissect_compatset(proto_tree * root,tvbuff_t * tvb,guint off,c_pkt_data * data)3040 guint c_dissect_compatset(proto_tree *root,
3041 			  tvbuff_t *tvb, guint off, c_pkt_data *data)
3042 {
3043 	proto_item *ti;
3044 	proto_tree *tree;
3045 
3046 	/* CompatSet from ceph:/src/include/CompatSet.h */
3047 
3048 	ti   = proto_tree_add_item(root, hf_compatset, tvb, off, -1, ENC_NA);
3049 	tree = proto_item_add_subtree(ti, ett_compatset);
3050 
3051 	off = c_dissect_featureset(tree, hf_compatset_compat,	tvb, off, data);
3052 	off = c_dissect_featureset(tree, hf_compatset_compatro, tvb, off, data);
3053 	off = c_dissect_featureset(tree, hf_compatset_incompat, tvb, off, data);
3054 
3055 	proto_item_set_end(ti, tvb, off);
3056 	return off;
3057 }
3058 
3059 /** Dissect an OSDSuperblock */
3060 static
c_dissect_osd_superblock(proto_tree * root,tvbuff_t * tvb,guint off,c_pkt_data * data)3061 guint c_dissect_osd_superblock(proto_tree *root,
3062 			       tvbuff_t *tvb, guint off, c_pkt_data *data)
3063 {
3064 	proto_item *ti;
3065 	proto_tree *tree;
3066 	c_encoded enc;
3067 	guint32 role, epoch;
3068 	double weight;
3069 
3070 	/* OSDSuperblock from ceph:/src/osd/osd_types.h */
3071 
3072 	ti   = proto_tree_add_item(root, hf_osd_superblock, tvb, off, -1, ENC_NA);
3073 	tree = proto_item_add_subtree(ti, ett_osd_superblock);
3074 
3075 	off = c_dissect_encoded(tree, &enc, 5, 6, tvb, off, data);
3076 
3077 	proto_tree_add_item(tree, hf_osd_superblock_clusterfsid,
3078 			    tvb, off, 16, ENC_BIG_ENDIAN);
3079 	off += 16;
3080 
3081 	role = tvb_get_letohl(tvb, off);
3082 	proto_tree_add_item(tree, hf_osd_superblock_role,
3083 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
3084 	off += 4;
3085 
3086 	epoch = tvb_get_letohl(tvb, off);
3087 	proto_tree_add_item(tree, hf_osd_superblock_epoch,
3088 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
3089 	off += 4;
3090 
3091 	proto_tree_add_item(tree, hf_osd_superblock_map_old,
3092 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
3093 	off += 4;
3094 
3095 	proto_tree_add_item(tree, hf_osd_superblock_map_new,
3096 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
3097 	off += 4;
3098 
3099 	weight = tvb_get_letohieee_double(tvb, off);
3100 	proto_tree_add_item(tree, hf_osd_superblock_weight,
3101 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
3102 	off += 8;
3103 
3104 	if (enc.version >= 2)
3105 		off = c_dissect_compatset(tree, tvb, off, data);
3106 
3107 	proto_tree_add_item(tree, hf_osd_superblock_clean,
3108 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
3109 	off += 4;
3110 
3111 	proto_tree_add_item(tree, hf_osd_superblock_mounted,
3112 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
3113 	off += 4;
3114 
3115 	proto_item_append_text(ti, ", Role: %"G_GINT32_MODIFIER"d, Weight: %lf"
3116 			       ", Boot Epoch: %"G_GINT32_MODIFIER"d",
3117 			       role, weight, epoch);
3118 	if (enc.version >= 4)
3119 	{
3120 		proto_item_append_text(ti, ", OSD FSID: %s", c_format_uuid(tvb, off));
3121 		proto_tree_add_item(tree, hf_osd_superblock_osdfsid,
3122 				    tvb, off, 16, ENC_BIG_ENDIAN);
3123 		off += 16;
3124 	}
3125 
3126 	if (enc.version >= 6)
3127 	{
3128 		proto_tree_add_item(tree, hf_osd_superblock_full,
3129 				    tvb, off, 4, ENC_LITTLE_ENDIAN);
3130 		off += 4;
3131 	}
3132 
3133 	c_warn_size(tree, tvb, off, enc.end, data);
3134 	off = enc.end;
3135 
3136 	proto_item_set_end(ti, tvb, off);
3137 	return off;
3138 }
3139 
3140 /** Dissect an osd_info_t. */
3141 static
c_dissect_osdinfo(proto_tree * root,int hf,tvbuff_t * tvb,guint off,c_pkt_data * data)3142 guint c_dissect_osdinfo(proto_tree *root, int hf,
3143 			tvbuff_t *tvb, guint off, c_pkt_data *data)
3144 {
3145 	proto_item *ti, *ti2;
3146 	proto_tree *tree;
3147 	guint8 ver;
3148 
3149 	/* osd_info_t from ceph:/src/osd/OSDMap.h */
3150 
3151 	ti   = proto_tree_add_item(root, hf, tvb, off, 25, ENC_NA);
3152 	tree = proto_item_add_subtree(ti, ett_osd_info);
3153 
3154 	ver = tvb_get_guint8(tvb, off);
3155 	ti2 = proto_tree_add_item(tree, hf_osdinfo_ver,
3156 				  tvb, off, 1, ENC_LITTLE_ENDIAN);
3157 	c_warn_ver(ti2, ver, 1, 1, data);
3158 	off += 1;
3159 
3160 	proto_tree_add_item(tree, hf_osdinfo_lastclean_begin,
3161 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
3162 	off += 4;
3163 
3164 	proto_tree_add_item(tree, hf_osdinfo_lastclean_end,
3165 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
3166 	off += 4;
3167 
3168 	proto_tree_add_item(tree, hf_osdinfo_up_from,
3169 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
3170 	off += 4;
3171 
3172 	proto_tree_add_item(tree, hf_osdinfo_up_through,
3173 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
3174 	off += 4;
3175 
3176 	proto_tree_add_item(tree, hf_osdinfo_downat,
3177 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
3178 	off += 4;
3179 
3180 	proto_tree_add_item(tree, hf_osdinfo_lostat,
3181 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
3182 	off += 4;
3183 
3184 	return off;
3185 }
3186 
3187 /** Dissect an osd_xinfo_t. */
3188 static
c_dissect_osd_xinfo(proto_tree * root,int hf,tvbuff_t * tvb,guint off,c_pkt_data * data)3189 guint c_dissect_osd_xinfo(proto_tree *root, int hf,
3190 			  tvbuff_t *tvb, guint off, c_pkt_data *data)
3191 {
3192 	proto_item *ti;
3193 	proto_tree *tree;
3194 	c_encoded enc;
3195 
3196 	/* osd_xinfo_t from ceph:/src/osd/OSDMap.h */
3197 
3198 	ti   = proto_tree_add_item(root, hf, tvb, off, -1, ENC_NA);
3199 	tree = proto_item_add_subtree(ti, ett_osd_xinfo);
3200 
3201 	off = c_dissect_encoded(tree, &enc, 1, 3, tvb, off, data);
3202 
3203 	proto_tree_add_item(tree, hf_osdxinfo_down,
3204 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
3205 	off += 8;
3206 
3207 	proto_tree_add_item(tree, hf_osdxinfo_laggy_probability,
3208 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
3209 	off += 4;
3210 
3211 	proto_tree_add_item(tree, hf_osdxinfo_laggy_interval,
3212 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
3213 	off += 4;
3214 
3215 	if (enc.version >= 2 )
3216 	{
3217 		off = c_dissect_features(tree, tvb, off, data);
3218 	}
3219 	if (enc.version >= 3)
3220 	{
3221 		proto_tree_add_item(tree, hf_osdxinfo_oldweight,
3222 				    tvb, off, 4, ENC_LITTLE_ENDIAN);
3223 		off += 4;
3224 	}
3225 
3226 	c_warn_size(tree, tvb, off, enc.end, data);
3227 	off = enc.end;
3228 	proto_item_set_end(ti, tvb, off);
3229 
3230 	return off;
3231 }
3232 
3233 /** Dissect an objectstore_perfstat_t. */
3234 static
c_dissect_perfstat(proto_tree * root,int hf,tvbuff_t * tvb,guint off,c_pkt_data * data)3235 guint c_dissect_perfstat(proto_tree *root, int hf,
3236 			 tvbuff_t *tvb, guint off, c_pkt_data *data)
3237 {
3238 	proto_item *ti;
3239 	proto_tree *tree;
3240 	c_encoded enc;
3241 
3242 	/* objectstore_perfstat_t from ceph:/src/osd/osd_types.h */
3243 
3244 	ti   = proto_tree_add_item(root, hf, tvb, off, -1, ENC_NA);
3245 	tree = proto_item_add_subtree(ti, ett_perfstat);
3246 
3247 	off = c_dissect_encoded(tree, &enc, 1, 1, tvb, off, data);
3248 
3249 	proto_tree_add_item(tree, hf_perfstat_commitlatency,
3250 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
3251 	off += 4;
3252 
3253 	proto_tree_add_item(tree, hf_perfstat_applylatency,
3254 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
3255 	off += 4;
3256 
3257 	c_warn_size(tree, tvb, off, enc.end, data);
3258 	off = enc.end;
3259 
3260 	proto_item_set_end(ti, tvb, off);
3261 	return off;
3262 }
3263 
3264 /** Dissect an osd_stat_t. */
3265 static
c_dissect_osd_stat(proto_tree * root,tvbuff_t * tvb,guint off,c_pkt_data * data)3266 guint c_dissect_osd_stat(proto_tree *root,
3267 			 tvbuff_t *tvb, guint off, c_pkt_data *data)
3268 {
3269 	proto_item *ti;
3270 	proto_tree *tree;
3271 	c_encoded enc, enc2;
3272 	guint32 i;
3273 
3274 	/* osd_stat_t from ceph:/src/osd/osd_types.h */
3275 
3276 	ti   = proto_tree_add_item(root, hf_osdstat, tvb, off, -1, ENC_NA);
3277 	tree = proto_item_add_subtree(ti, ett_pg_stat);
3278 
3279 	off = c_dissect_encoded(tree, &enc, 2, 4, tvb, off, data);
3280 
3281 	proto_tree_add_item(tree, hf_osdstat_kb,
3282 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
3283 	off += 8;
3284 
3285 	proto_tree_add_item(tree, hf_osdstat_kbused,
3286 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
3287 	off += 8;
3288 
3289 	proto_tree_add_item(tree, hf_osdstat_kbavail,
3290 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
3291 	off += 8;
3292 
3293 	proto_tree_add_item(tree, hf_osdstat_trimqueue,
3294 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
3295 	off += 4;
3296 
3297 	proto_tree_add_item(tree, hf_osdstat_trimming,
3298 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
3299 	off += 4;
3300 
3301 	i = tvb_get_letohl(tvb, off);
3302 	off += 4;
3303 	while (i--)
3304 	{
3305 		proto_tree_add_item(tree, hf_osdstat_hbin,
3306 				    tvb, off, 4, ENC_LITTLE_ENDIAN);
3307 		off += 4;
3308 	}
3309 
3310 	i = tvb_get_letohl(tvb, off);
3311 	off += 4;
3312 	while (i--)
3313 	{
3314 		proto_tree_add_item(tree, hf_osdstat_hbout,
3315 				    tvb, off, 4, ENC_LITTLE_ENDIAN);
3316 		off += 4;
3317 	}
3318 
3319 	if (enc.version >= 3)
3320 	{
3321 		off = c_dissect_encoded(tree, &enc2, 1, 1, tvb, off, data);
3322 		i = tvb_get_letohl(tvb, off);
3323 		off += 4;
3324 		if (i >= 1)
3325 			proto_tree_add_item(tree, hf_osdstat_opqueue,
3326 					    tvb, off, 4, ENC_LITTLE_ENDIAN);
3327 		off += 4*i; /* Skip older values because they are unitless and meaningless. */
3328 		c_warn_size(tree, tvb, off, enc2.end, data);
3329 		off = enc2.end;
3330 	}
3331 
3332 	if (enc.version >= 4)
3333 		off = c_dissect_perfstat(tree, hf_osdstat_fsperf, tvb, off, data);
3334 
3335 	c_warn_size(tree, tvb, off, enc.end, data);
3336 	off = enc.end;
3337 
3338 	proto_item_set_end(ti, tvb, off);
3339 	return off;
3340 }
3341 
3342 /** Dissect a CRUSH Ruleset. */
3343 static
c_dissect_crush(proto_tree * root,tvbuff_t * tvb,guint off,c_pkt_data * data _U_)3344 guint c_dissect_crush(proto_tree *root,
3345 		      tvbuff_t *tvb, guint off, c_pkt_data *data _U_)
3346 {
3347 	off = c_dissect_data(root, hf_crush, tvb, off);
3348 
3349 	return off;
3350 }
3351 
3352 /** Dissect an OSDMap. */
3353 static
c_dissect_osdmap(proto_tree * root,tvbuff_t * tvb,guint off,c_pkt_data * data)3354 guint c_dissect_osdmap(proto_tree *root,
3355 		       tvbuff_t *tvb, guint off, c_pkt_data *data)
3356 {
3357 	proto_item *ti, *ti2;
3358 	proto_tree *tree, *subtree;
3359 	guint size, end;
3360 	guint32 i;
3361 	c_encoded enc, enc2; /* There is an outer one, and multiple inner ones. */
3362 
3363 	/*** Storage for values that will be formatted and
3364 	 *** added to the root nodes.
3365 	 ***/
3366 	char *fsid;
3367 	char *time_created, *time_modified;
3368 
3369 	/* OSDMap from ceph:/src/osd/OSDMap.cc */
3370 
3371 	size = tvb_get_letohl(tvb, off);
3372 	end = off + 4 + size;
3373 
3374 	ti   = proto_tree_add_item(root, hf_osdmap, tvb, off, size, ENC_NA);
3375 	tree = proto_item_add_subtree(ti, ett_osd_map);
3376 
3377 	off += 4;
3378 
3379 	off = c_dissect_encoded(tree, &enc, 7, 7, tvb, off, data);
3380 	/* Check the blob size and encoded size match. */
3381 	c_warn_size(tree, tvb, enc.end, end, data);
3382 
3383 	/*** Start first inner ***/
3384 	ti2 = proto_tree_add_item(tree, hf_osdmap_client, tvb, off, -1, ENC_NA);
3385 	subtree = proto_item_add_subtree(ti2, ett_osd_map_client);
3386 
3387 	off = c_dissect_encoded(subtree, &enc2, 1, 3, tvb, off, data);
3388 	proto_item_set_len(ti2, enc2.size);
3389 
3390 	fsid = c_format_uuid(tvb, off);
3391 	proto_tree_add_item(subtree, hf_osdmap_fsid, tvb, off, 16, ENC_BIG_ENDIAN);
3392 	off += 16;
3393 
3394 	proto_tree_add_item(subtree, hf_osdmap_epoch,
3395 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
3396 	off += 4;
3397 
3398 	time_created = c_format_timespec(tvb, off);
3399 	proto_tree_add_item(subtree, hf_osdmap_created,
3400 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
3401 	off += 8;
3402 
3403 	time_modified = c_format_timespec(tvb, off);
3404 	proto_tree_add_item(subtree, hf_osdmap_modified,
3405 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
3406 	off += 8;
3407 
3408 	i = tvb_get_letohl(tvb, off);
3409 	off += 4;
3410 	while (i--)
3411 	{
3412 		proto_item *poolti;
3413 		proto_tree *pooltree;
3414 		guint64 id;
3415 
3416 		poolti = proto_tree_add_item(subtree, hf_osdmap_pool,
3417 					     tvb, off, -1, ENC_NA);
3418 		pooltree = proto_item_add_subtree(poolti, ett_osd_map_pool);
3419 
3420 		id = tvb_get_letoh64(tvb, off);
3421 		proto_tree_add_item(pooltree, hf_osdmap_pool_id,
3422 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
3423 		off += 8;
3424 
3425 		off = c_dissect_pgpool(pooltree, tvb, off, data);
3426 
3427 		proto_item_append_text(poolti, ", ID: 0x%016"G_GINT64_MODIFIER"X", id);
3428 
3429 		proto_item_set_end(poolti, tvb, off);
3430 	}
3431 
3432 	i = tvb_get_letohl(tvb, off);
3433 	off += 4;
3434 	while (i--)
3435 	{
3436 		proto_item *nameti;
3437 		proto_tree *nametree;
3438 		guint64 id;
3439 		c_str name;
3440 
3441 		nameti = proto_tree_add_item(subtree, hf_osdmap_poolname_item,
3442 					     tvb, off, -1, ENC_NA);
3443 		nametree = proto_item_add_subtree(nameti, ett_osd_map_poolname);
3444 
3445 		id = tvb_get_letoh64(tvb, off);
3446 		proto_tree_add_item(nametree, hf_osdmap_pool_id,
3447 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
3448 		off += 8;
3449 
3450 		off = c_dissect_str(nametree, hf_osdmap_poolname, &name, tvb, off);
3451 
3452 		proto_item_append_text(nameti,
3453 				       ", ID: 0x%016"G_GINT64_MODIFIER"X, Name: %s",
3454 				       id, name.str);
3455 		proto_item_set_end(nameti, tvb, off);
3456 	}
3457 
3458 	proto_tree_add_item(subtree, hf_osdmap_poolmax,
3459 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
3460 	off += 4;
3461 
3462 	proto_tree_add_item(subtree, hf_osdmap_flags,
3463 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
3464 	off += 4;
3465 
3466 	proto_tree_add_item(subtree, hf_osdmap_osdmax,
3467 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
3468 	off += 4;
3469 
3470 	i = tvb_get_letohl(tvb, off);
3471 	off += 4;
3472 	while (i--)
3473 	{
3474 		proto_tree_add_item(subtree, hf_osdmap_osd_state,
3475 				    tvb, off, 1, ENC_LITTLE_ENDIAN);
3476 		off += 1;
3477 	}
3478 
3479 	i = tvb_get_letohl(tvb, off);
3480 	off += 4;
3481 	while (i--)
3482 	{
3483 		proto_tree_add_item(subtree, hf_osdmap_osd_weight,
3484 				    tvb, off, 4, ENC_LITTLE_ENDIAN);
3485 		off += 4;
3486 	}
3487 
3488 	i = tvb_get_letohl(tvb, off);
3489 	off += 4;
3490 	while (i--)
3491 	{
3492 		off = c_dissect_entityaddr(subtree, hf_osdmap_osd_addr, NULL,
3493 					   tvb, off);
3494 	}
3495 
3496 	i = tvb_get_letohl(tvb, off);
3497 	off += 4;
3498 	while (i--)
3499 	{
3500 		guint32 j;
3501 		proto_item *pgtti;
3502 		proto_tree *pgttree;
3503 
3504 		pgtti = proto_tree_add_item(subtree, hf_osdmap_pgtmp,
3505 					   tvb, off, -1, ENC_NA);
3506 		pgttree = proto_item_add_subtree(pgtti, ett_osd_map_pgtmp);
3507 
3508 		off = c_dissect_pg(pgttree, hf_osdmap_pgtmp_pg, tvb, off, data);
3509 
3510 		j = tvb_get_letohl(tvb, off);
3511 		off += 4;
3512 		while (j--)
3513 		{
3514 			proto_tree_add_item(pgttree, hf_osdmap_pgtmp_val,
3515 					    tvb, off, 4, ENC_LITTLE_ENDIAN);
3516 			off += 4;
3517 		}
3518 
3519 		proto_item_set_end(pgtti, tvb, off);
3520 	}
3521 
3522 	i = tvb_get_letohl(tvb, off);
3523 	off += 4;
3524 	while (i--)
3525 	{
3526 		proto_item *pgtti;
3527 		proto_tree *pgttree;
3528 
3529 		pgtti = proto_tree_add_item(subtree, hf_osdmap_primarytmp,
3530 					   tvb, off, -1, ENC_NA);
3531 		pgttree = proto_item_add_subtree(pgtti, ett_osd_map_primarytmp);
3532 
3533 		off = c_dissect_pg(pgttree, hf_osdmap_primarytmp_pg, tvb, off, data);
3534 
3535 		proto_tree_add_item(pgttree, hf_osdmap_primarytmp_val,
3536 				    tvb, off, 4, ENC_LITTLE_ENDIAN);
3537 		off += 4;
3538 
3539 		proto_item_set_end(pgtti, tvb, off);
3540 	}
3541 
3542 	if (enc2.version >= 2)
3543 	{
3544 		i = tvb_get_letohl(tvb, off);
3545 		off += 4;
3546 		while (i--)
3547 		{
3548 			proto_tree_add_item(subtree, hf_osdmap_osd_primaryaffinity,
3549 					    tvb, off, 4, ENC_LITTLE_ENDIAN);
3550 			off += 4;
3551 		}
3552 	}
3553 
3554 	off = c_dissect_crush(subtree, tvb, off, data);
3555 
3556 	if (enc2.version >= 3)
3557 	{
3558 		i = tvb_get_letohl(tvb, off);
3559 		off += 4;
3560 		while (i--)
3561 		{
3562 			guint32 j;
3563 			proto_item *ecti;
3564 			proto_tree *ectree;
3565 			c_str profile;
3566 
3567 			ecti = proto_tree_add_item(subtree, hf_osdmap_erasurecodeprofile,
3568 						   tvb, off, -1, ENC_NA);
3569 			ectree = proto_item_add_subtree(ecti, ett_osd_map_erasurecodeprofile);
3570 
3571 			off = c_dissect_str(ectree, hf_osdmap_erasurecodeprofile_name, &profile,
3572 					    tvb, off);
3573 			proto_item_append_text(ecti, ", Name: %s", profile.str);
3574 
3575 			j = tvb_get_letohl(tvb, off);
3576 			off += 4;
3577 			while (j--)
3578 			{
3579 				off = c_dissect_kv(ectree, hf_osdmap_erasurecodeprofile_prop,
3580 						   hf_osdmap_erasurecodeprofile_k,
3581 						   hf_osdmap_erasurecodeprofile_v,
3582 						   tvb, off);
3583 			}
3584 
3585 			proto_item_set_end(ecti, tvb, off);
3586 		}
3587 	}
3588 
3589 	c_warn_size(subtree, tvb, off, enc2.end, data);
3590 	off = enc2.end;
3591 	/*** End first inner ***/
3592 
3593 	/*** Start second inner ***/
3594 	ti2 = proto_tree_add_item(tree, hf_osdmap_osd, tvb, off, -1, ENC_NA);
3595 	subtree = proto_item_add_subtree(ti2, ett_osd_map_osd);
3596 	off = c_dissect_encoded(subtree, &enc2, 1, 1, tvb, off, data);
3597 	proto_item_set_len(ti2, enc2.size);
3598 
3599 	i = tvb_get_letohl(tvb, off);
3600 	off += 4;
3601 	while (i--)
3602 	{
3603 		off = c_dissect_entityaddr(subtree, hf_osdmap_hbaddr_back, NULL,
3604 					   tvb, off);
3605 	}
3606 
3607 	i = tvb_get_letohl(tvb, off);
3608 	off += 4;
3609 	while (i--)
3610 	{
3611 		off = c_dissect_osdinfo(subtree, hf_osdmap_osd_info, tvb, off, data);
3612 	}
3613 
3614 	i = tvb_get_letohl(tvb, off);
3615 	off += 4;
3616 	while (i--)
3617 	{
3618 		proto_item *blti;
3619 		proto_tree *bltree;
3620 
3621 		blti = proto_tree_add_item(subtree, hf_osdmap_blacklist,
3622 					   tvb, off, -1, ENC_NA);
3623 		bltree = proto_item_add_subtree(blti, ett_osd_map_blacklist);
3624 
3625 		off = c_dissect_entityaddr(bltree, hf_osdmap_blacklist_addr, NULL,
3626 					   tvb, off);
3627 
3628 		proto_tree_add_item(bltree, hf_osdmap_blacklist_time,
3629 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
3630 		off += 8;
3631 
3632 		proto_item_set_end(blti, tvb, off);
3633 	}
3634 
3635 	i = tvb_get_letohl(tvb, off);
3636 	off += 4;
3637 	while (i--)
3638 	{
3639 		off = c_dissect_entityaddr(subtree, hf_osdmap_cluster_addr, NULL,
3640 					   tvb, off);
3641 	}
3642 
3643 	proto_tree_add_item(subtree, hf_osdmap_cluster_snapepoch,
3644 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
3645 	off += 4;
3646 
3647 	off = c_dissect_str(subtree, hf_osdmap_cluster_snap, NULL, tvb, off);
3648 
3649 	i = tvb_get_letohl(tvb, off);
3650 	off += 4;
3651 	while (i--)
3652 	{
3653 		proto_tree_add_item(subtree, hf_osdmap_osd_uuid,
3654 				    tvb, off, 16, ENC_LITTLE_ENDIAN);
3655 		off += 16;
3656 	}
3657 
3658 	i = tvb_get_letohl(tvb, off);
3659 	off += 4;
3660 	while (i--)
3661 	{
3662 		off = c_dissect_osd_xinfo(subtree, hf_osdmap_osd_xinfo, tvb, off, data);
3663 	}
3664 
3665 	i = tvb_get_letohl(tvb, off);
3666 	off += 4;
3667 	while (i--)
3668 	{
3669 		off = c_dissect_entityaddr(subtree, hf_osdmap_hbaddr_front, NULL,
3670 					   tvb, off);
3671 	}
3672 
3673 	c_warn_size(subtree, tvb, off, enc2.end, data);
3674 	off = enc2.end;
3675 	/*** End second inner ***/
3676 
3677 	proto_item_append_text(ti, ", FSID: %s, Created: %s, Modified: %s",
3678 			       fsid,
3679 			       time_created, time_modified);
3680 
3681 	c_warn_size(tree, tvb, off, end, data);
3682 	off = end;
3683 
3684 	return off;
3685 }
3686 
3687 /** Dissect an incremental OSDMap. */
3688 static
c_dissect_osdmap_inc(proto_tree * root,tvbuff_t * tvb,guint off,c_pkt_data * data)3689 guint c_dissect_osdmap_inc(proto_tree *root,
3690 			   tvbuff_t *tvb, guint off, c_pkt_data *data)
3691 {
3692 	proto_item *ti, *ti2;
3693 	proto_tree *tree, *subtree;
3694 	guint size, end;
3695 	c_encoded enc, enc2; /* There is an outer one, and multiple inner ones. */
3696 
3697 	/** OSDMap::Incremental from ceph:/src/osd/OSDMap.cc */
3698 
3699 	size = tvb_get_letohl(tvb, off);
3700 	end = off + 4 + size;
3701 
3702 	ti   = proto_tree_add_item(root, hf_osdmap_inc, tvb, off, size, ENC_NA);
3703 	tree = proto_item_add_subtree(ti, ett_osd_map_inc);
3704 
3705 	off += 4;
3706 
3707 	off = c_dissect_encoded(tree, &enc, 7, 7, tvb, off, data);
3708 	/* Check the blob size and encoded size match. */
3709 	c_warn_size(tree, tvb, enc.end, end, data);
3710 
3711 	/*** Start first inner ***/
3712 	ti2 = proto_tree_add_item(tree, hf_osdmap_inc_client, tvb, off, -1, ENC_NA);
3713 	subtree = proto_item_add_subtree(ti2, ett_osd_map_inc_client);
3714 
3715 	off = c_dissect_encoded(subtree, &enc2, 1, 3, tvb, off, data);
3716 	proto_item_set_len(ti2, enc2.size);
3717 
3718 	proto_tree_add_item(subtree, hf_osdmap_inc_fsid, tvb, off, 16, ENC_BIG_ENDIAN);
3719 	off += 16;
3720 
3721 	/* @TODO: Dissect. */
3722 
3723 	c_warn_size(subtree, tvb, off, enc2.end, data);
3724 	off = enc2.end;
3725 	/*** End first inner ***/
3726 
3727 	/*** Start second inner ***/
3728 	ti2 = proto_tree_add_item(tree, hf_osdmap_inc_osd, tvb, off, -1, ENC_NA);
3729 	subtree = proto_item_add_subtree(ti2, ett_osd_map_inc_osd);
3730 	off = c_dissect_encoded(subtree, &enc2, 1, 1, tvb, off, data);
3731 	proto_item_set_len(ti2, enc2.size);
3732 
3733 	/* @TODO: Dissect. */
3734 
3735 	c_warn_size(subtree, tvb, off, enc2.end, data);
3736 	off = enc2.end;
3737 	/*** End second inner ***/
3738 
3739 	c_warn_size(tree, tvb, off, end, data);
3740 	off = end;
3741 
3742 	return off;
3743 }
3744 
3745 typedef struct _c_osd_op {
3746 	c_osd_optype type;    /** The type of operation. */
3747 	const char *type_str; /** The type of operation as a string. */
3748 	guint32 payload_size; /** The size of the operation payload. */
3749 } c_osd_op;
3750 
3751 #define C_SIZE_OSD_OP_MIN 34
3752 
3753 /** Dissect OSD Operation. */
3754 static
c_dissect_osd_op(proto_tree * root,gint hf,c_osd_op * out,tvbuff_t * tvb,guint off,c_pkt_data * data)3755 guint c_dissect_osd_op(proto_tree *root, gint hf, c_osd_op *out,
3756 		       tvbuff_t *tvb, guint off, c_pkt_data *data)
3757 {
3758 	proto_item *ti, *ti2;
3759 	proto_tree *tree;
3760 	c_osd_op d;
3761 
3762 	guint64 offset, size;
3763 	guint64 trunc_size, trunc_seq;
3764 
3765 	/* From ceph:/src/include/rados.h
3766 	struct ceph_osd_op {
3767 		__le16 op;	     // CEPH_OSD_OP_*
3768 		__le32 flags;	     // CEPH_OSD_FLAG_*
3769 		union {
3770 			struct {
3771 				__le64 offset, length;
3772 				__le64 truncate_size;
3773 				__le32 truncate_seq;
3774 			} __attribute__ ((packed)) extent;
3775 			struct {
3776 				__le32 name_len;
3777 				__le32 value_len;
3778 				__u8 cmp_op;	   // CEPH_OSD_CMPXATTR_OP_*
3779 				__u8 cmp_mode;	   // CEPH_OSD_CMPXATTR_MODE_*
3780 			} __attribute__ ((packed)) xattr;
3781 			struct {
3782 				__u8 class_len;
3783 				__u8 method_len;
3784 				__u8 argc;
3785 				__le32 indata_len;
3786 			} __attribute__ ((packed)) cls;
3787 			struct {
3788 				__le64 count;
3789 				__le32 start_epoch; // for the pgls sequence
3790 			} __attribute__ ((packed)) pgls;
3791 			struct {
3792 				__le64 snapid;
3793 			} __attribute__ ((packed)) snap;
3794 			struct {
3795 				__le64 cookie;
3796 				__le64 ver;
3797 				__u8 flag; // 0 = unwatch, 1 = watch
3798 			} __attribute__ ((packed)) watch;
3799 			struct {
3800 				__le64 unused;
3801 				__le64 ver;
3802 			} __attribute__ ((packed)) assert_ver;
3803 			struct {
3804 				__le64 offset, length;
3805 				__le64 src_offset;
3806 			} __attribute__ ((packed)) clonerange;
3807 			struct {
3808 				__le64 max;	// max data in reply
3809 			} __attribute__ ((packed)) copy_get;
3810 			struct {
3811 				__le64 snapid;
3812 				__le64 src_version;
3813 				__u8 flags;
3814 			} __attribute__ ((packed)) copy_from;
3815 			struct {
3816 				struct ceph_timespec stamp;
3817 			} __attribute__ ((packed)) hit_set_get;
3818 			struct {
3819 				__u8 flags;
3820 			} __attribute__ ((packed)) tmap2omap;
3821 			struct {
3822 				__le64 expected_object_size;
3823 				__le64 expected_write_size;
3824 			} __attribute__ ((packed)) alloc_hint;
3825 		};
3826 		__le32 payload_size;
3827 	} __attribute__ ((packed));
3828 	*/
3829 
3830 	d.type = (c_osd_optype)tvb_get_letohs(tvb, off);
3831 
3832 	ti   = proto_tree_add_item(root, hf, tvb, off, -1, ENC_NA);
3833 	tree = proto_item_add_subtree(ti, ett_osd_op);
3834 
3835 	d.type_str = c_osd_optype_string(d.type);
3836 	proto_item_append_text(ti, ", Type: %s", d.type_str);
3837 	proto_tree_add_item(tree, hf_osd_op_type, tvb, off, 2, ENC_LITTLE_ENDIAN);
3838 	off += 2;
3839 
3840 	off = c_dissect_osd_flags(tree, tvb, off, data);
3841 
3842 	/***
3843 		Stop moving off here.  The size of the individual message doesn't
3844 		matter, only the size of the largest, which is added below.
3845 	***/
3846 
3847 	switch (d.type)
3848 	{
3849 	case C_OSD_OP_WRITE:
3850 	case C_OSD_OP_WRITEFULL:
3851 	case C_OSD_OP_ZERO:
3852 	case C_OSD_OP_TRUNCATE:
3853 	case C_OSD_OP_DELETE:
3854 	case C_OSD_OP_READ:
3855 	case C_OSD_OP_STAT:
3856 		offset = tvb_get_letoh64(tvb, off);
3857 		proto_tree_add_item(tree, hf_osd_op_extent_off,
3858 				    tvb, off,	 8, ENC_LITTLE_ENDIAN);
3859 		size = tvb_get_letoh64(tvb, off+8);
3860 		proto_tree_add_item(tree, hf_osd_op_extent_size,
3861 				    tvb, off+8,	 8, ENC_LITTLE_ENDIAN);
3862 		trunc_size = tvb_get_letoh64(tvb, off+16);
3863 		proto_tree_add_item(tree, hf_osd_op_extent_trunc_size,
3864 				    tvb, off+16, 8, ENC_LITTLE_ENDIAN);
3865 		trunc_seq = tvb_get_letohl(tvb, off+24);
3866 		proto_tree_add_item(tree, hf_osd_op_extent_trunc_seq,
3867 				    tvb, off+24, 4, ENC_LITTLE_ENDIAN);
3868 
3869 		proto_item_append_text(ti, ", Offset: %"G_GINT64_MODIFIER"u"
3870 				       ", Size: %"G_GINT64_MODIFIER"u",
3871 				       offset, size);
3872 		if (trunc_seq)
3873 			proto_item_append_text(ti, ", Truncate To: %"G_GINT64_MODIFIER"u",
3874 					       trunc_size);
3875 		break;
3876 	default:
3877 		ti2 = proto_tree_add_item(tree, hf_osd_op_data, tvb, off, 28, ENC_NA);
3878 		expert_add_info(data->pinfo, ti2, &ei_union_unknown);
3879 	}
3880 
3881 	off += 28;
3882 
3883 	d.payload_size = tvb_get_letohl(tvb, off);
3884 	proto_item_append_text(ti, ", Data Length: %"G_GINT32_MODIFIER"d",
3885 			       d.payload_size);
3886 	proto_tree_add_item(tree, hf_osd_op_payload_size,
3887 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
3888 	off += 4;
3889 
3890 	proto_item_set_end(ti, tvb, off);
3891 
3892 	if (out) *out = d;
3893 	return off;
3894 }
3895 
3896 /** Dissect a redirect. */
3897 static
c_dissect_redirect(proto_tree * root,gint hf,tvbuff_t * tvb,guint off,c_pkt_data * data)3898 guint c_dissect_redirect(proto_tree *root, gint hf,
3899 			 tvbuff_t *tvb, guint off, c_pkt_data *data)
3900 {
3901 	proto_item *ti;
3902 	proto_tree *tree;
3903 	c_encoded enc;
3904 
3905 	/** request_redirect_t from ceph:/src/osd/osd_types.h */
3906 
3907 	ti = proto_tree_add_item(root, hf, tvb, off, -1, ENC_NA);
3908 	tree = proto_item_add_subtree(ti, ett_redirect);
3909 
3910 	off = c_dissect_encoded(tree, &enc, 1, 1, tvb, off, data);
3911 
3912 	off = c_dissect_object_locator(tree, hf_osd_redirect_oloc, tvb, off, data);
3913 
3914 	if (tvb_get_letohl(tvb, off))
3915 	{
3916 		off = c_dissect_str(tree, hf_osd_redirect_obj, NULL, tvb, off);
3917 	}
3918 	else off += 4;
3919 
3920 	off = c_dissect_blob(tree, hf_osd_redirect_osdinstr,
3921 			     hf_osd_redirect_osdinstr_data, hf_osd_redirect_osdinstr_len,
3922 			     tvb, off);
3923 
3924 	c_warn_size(tree, tvb, off, enc.end, data);
3925 	off = enc.end;
3926 
3927 	proto_item_set_end(ti, tvb, off);
3928 	return off;
3929 }
3930 
3931 /** Dissect a statsum object. */
3932 static
c_dissect_statsum(proto_tree * tree,tvbuff_t * tvb,guint off,c_pkt_data * data)3933 guint c_dissect_statsum(proto_tree *tree,
3934 			tvbuff_t *tvb, guint off, c_pkt_data *data)
3935 {
3936 	c_encoded enc;
3937 
3938 	/** object_stat_sum_t from ceph:/src/osd/osd_types.h */
3939 
3940 	off = c_dissect_encoded(tree, &enc, 3, 9, tvb, off, data);
3941 
3942 	proto_tree_add_item(tree, hf_statsum_bytes,
3943 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
3944 	off += 8;
3945 	proto_tree_add_item(tree, hf_statsum_objects,
3946 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
3947 	off += 8;
3948 	proto_tree_add_item(tree, hf_statsum_clones,
3949 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
3950 	off += 8;
3951 	proto_tree_add_item(tree, hf_statsum_copies,
3952 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
3953 	off += 8;
3954 	proto_tree_add_item(tree, hf_statsum_missing,
3955 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
3956 	off += 8;
3957 	proto_tree_add_item(tree, hf_statsum_degraded,
3958 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
3959 	off += 8;
3960 	proto_tree_add_item(tree, hf_statsum_unfound,
3961 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
3962 	off += 8;
3963 	proto_tree_add_item(tree, hf_statsum_read_bytes,
3964 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
3965 	off += 8;
3966 	proto_tree_add_item(tree, hf_statsum_read_kbytes,
3967 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
3968 	off += 8;
3969 	proto_tree_add_item(tree, hf_statsum_written_bytes,
3970 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
3971 	off += 8;
3972 	proto_tree_add_item(tree, hf_statsum_written_kbytes,
3973 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
3974 	off += 8;
3975 	proto_tree_add_item(tree, hf_statsum_scrub_errors,
3976 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
3977 	off += 8;
3978 
3979 	if (enc.version >= 5)
3980 	{
3981 		proto_tree_add_item(tree, hf_statsum_recovered,
3982 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
3983 		off += 8;
3984 		proto_tree_add_item(tree, hf_statsum_bytes_recovered,
3985 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
3986 		off += 8;
3987 		proto_tree_add_item(tree, hf_statsum_keys_recovered,
3988 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
3989 		off += 8;
3990 	}
3991 	if (enc.version >= 6)
3992 	{
3993 		proto_tree_add_item(tree, hf_statsum_shallow_scrub_errors,
3994 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
3995 		off += 8;
3996 		proto_tree_add_item(tree, hf_statsum_deep_scrub_errors,
3997 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
3998 		off += 8;
3999 	}
4000 	if (enc.version >= 7)
4001 	{
4002 		proto_tree_add_item(tree, hf_statsum_dirty,
4003 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
4004 		off += 8;
4005 		proto_tree_add_item(tree, hf_statsum_whiteouts,
4006 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
4007 		off += 8;
4008 	}
4009 	if (enc.version >= 8)
4010 	{
4011 		proto_tree_add_item(tree, hf_statsum_omap,
4012 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
4013 		off += 8;
4014 	}
4015 	if (enc.version >= 9)
4016 	{
4017 		proto_tree_add_item(tree, hf_statsum_hitset_archive,
4018 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
4019 		off += 8;
4020 	}
4021 
4022 	c_warn_size(tree, tvb, off, enc.end, data);
4023 	off = enc.end;
4024 
4025 	return off;
4026 }
4027 
4028 /** Dissect a object_stat_collection_t object. */
4029 static
c_dissect_statcollection(proto_tree * root,int key,tvbuff_t * tvb,guint off,c_pkt_data * data)4030 guint c_dissect_statcollection(proto_tree *root, int key,
4031 			       tvbuff_t *tvb, guint off, c_pkt_data *data)
4032 {
4033 	proto_item *ti;
4034 	proto_tree *tree;
4035 	c_encoded enc;
4036 	guint32 i;
4037 
4038 	/** object_stat_collection_t from ceph:/src/osd/osd_types.h */
4039 
4040 	ti = proto_tree_add_item(root, hf_statcollection, tvb, off, -1, ENC_NA);
4041 	tree = proto_item_add_subtree(ti, ett_statcollection);
4042 
4043 	off = c_dissect_encoded(tree, &enc, 2, 2, tvb, off, data);
4044 
4045 	off = c_dissect_statsum(tree, tvb, off, data);
4046 	i = tvb_get_letohl(tvb, off);
4047 	off += 4;
4048 	while (i--)
4049 	{
4050 		off = c_dissect_str(tree, key, NULL, tvb, off);
4051 		off = c_dissect_statsum(tree, tvb, off, data);
4052 	}
4053 
4054 	c_warn_size(tree, tvb, off, enc.end, data);
4055 	off = enc.end;
4056 
4057 	proto_item_set_end(ti, tvb, off);
4058 	return off;
4059 }
4060 
4061 /** Dissect an pg_stat_t. */
4062 static
c_dissect_pg_stats(proto_tree * root,int hf,tvbuff_t * tvb,guint off,c_pkt_data * data)4063 guint c_dissect_pg_stats(proto_tree *root, int hf,
4064 			 tvbuff_t *tvb, guint off, c_pkt_data *data)
4065 {
4066 	proto_item *ti;
4067 	proto_tree *tree;
4068 	c_encoded enc;
4069 	guint32 i;
4070 
4071 	/* pg_stat_t from ceph:/src/osd/osd_types.h */
4072 
4073 	ti   = proto_tree_add_item(root, hf, tvb, off, -1, ENC_NA);
4074 	tree = proto_item_add_subtree(ti, ett_pg_stat);
4075 
4076 	off = c_dissect_encoded(tree, &enc, 8, 17, tvb, off, data);
4077 
4078 	off = c_dissect_eversion(tree, hf_pg_stat_ver, tvb, off, data);
4079 
4080 	proto_tree_add_item(tree, hf_pg_stat_seq,
4081 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
4082 	off += 8;
4083 
4084 	proto_tree_add_item(tree, hf_pg_stat_epoch,
4085 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
4086 	off += 4;
4087 
4088 	proto_tree_add_item(tree, hf_pg_stat_state,
4089 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
4090 	off += 4;
4091 
4092 	off = c_dissect_eversion(tree, hf_pg_stat_logstart, tvb, off, data);
4093 	off = c_dissect_eversion(tree, hf_pg_stat_logstartondisk, tvb, off, data);
4094 
4095 	proto_tree_add_item(tree, hf_pg_stat_created,
4096 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
4097 	off += 4;
4098 
4099 	proto_tree_add_item(tree, hf_pg_stat_lastepochclean,
4100 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
4101 	off += 4;
4102 
4103 	off = c_dissect_pg(tree, hf_pg_stat_parent, tvb, off, data);
4104 
4105 	proto_tree_add_item(tree, hf_pg_stat_parent_splitbits,
4106 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
4107 	off += 4;
4108 
4109 	off = c_dissect_eversion(tree, hf_pg_stat_lastscrub, tvb, off, data);
4110 
4111 	proto_tree_add_item(tree, hf_pg_stat_lastscrubstamp,
4112 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
4113 	off += 8;
4114 
4115 	off = c_dissect_statcollection(tree, hf_pg_stat_stats, tvb, off, data);
4116 
4117 	proto_tree_add_item(tree, hf_pg_stat_logsize,
4118 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
4119 	off += 8;
4120 
4121 	proto_tree_add_item(tree, hf_pg_stat_logsizeondisk,
4122 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
4123 	off += 8;
4124 
4125 	i = tvb_get_letohl(tvb, off);
4126 	off += 4;
4127 	while (i--)
4128 	{
4129 		proto_tree_add_item(tree, hf_pg_stat_up,
4130 				    tvb, off, 4, ENC_LITTLE_ENDIAN);
4131 		off += 4;
4132 	}
4133 
4134 	i = tvb_get_letohl(tvb, off);
4135 	off += 4;
4136 	while (i--)
4137 	{
4138 		proto_tree_add_item(tree, hf_pg_stat_acting,
4139 				    tvb, off, 4, ENC_LITTLE_ENDIAN);
4140 		off += 4;
4141 	}
4142 
4143 	if (enc.version >= 9)
4144 	{
4145 		proto_tree_add_item(tree, hf_pg_stat_lastfresh,
4146 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
4147 		off += 8;
4148 
4149 		proto_tree_add_item(tree, hf_pg_stat_lastchange,
4150 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
4151 		off += 8;
4152 
4153 		proto_tree_add_item(tree, hf_pg_stat_lastactive,
4154 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
4155 		off += 8;
4156 
4157 		proto_tree_add_item(tree, hf_pg_stat_lastclean,
4158 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
4159 		off += 8;
4160 
4161 		proto_tree_add_item(tree, hf_pg_stat_lastunstale,
4162 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
4163 		off += 8;
4164 
4165 		proto_tree_add_item(tree, hf_pg_stat_mappingepoch,
4166 				    tvb, off, 4, ENC_LITTLE_ENDIAN);
4167 		off += 4;
4168 	}
4169 	if (enc.version >= 10)
4170 	{
4171 		off = c_dissect_eversion(tree, hf_pg_stat_lastdeepscrub, tvb, off, data);
4172 
4173 		proto_tree_add_item(tree, hf_pg_stat_lastdeepscrubstamp,
4174 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
4175 		off += 8;
4176 	}
4177 	if (enc.version >= 11)
4178 	{
4179 		proto_tree_add_item(tree, hf_pg_stat_statsinvalid,
4180 				    tvb, off, 1, ENC_LITTLE_ENDIAN);
4181 		off += 1;
4182 	}
4183 	if (enc.version >= 12)
4184 	{
4185 		proto_tree_add_item(tree, hf_pg_stat_lastcleanscrubstamp,
4186 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
4187 		off += 8;
4188 	}
4189 	if (enc.version >= 13)
4190 	{
4191 		proto_tree_add_item(tree, hf_pg_stat_lastbecameactive,
4192 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
4193 		off += 8;
4194 	}
4195 	if (enc.version >= 14)
4196 	{
4197 		proto_tree_add_item(tree, hf_pg_stat_dirtystatsinvalid,
4198 				    tvb, off, 1, ENC_LITTLE_ENDIAN);
4199 		off += 1;
4200 	}
4201 	if (enc.version >= 15)
4202 	{
4203 		proto_tree_add_item(tree, hf_pg_stat_upprimary,
4204 				    tvb, off, 4, ENC_LITTLE_ENDIAN);
4205 		off += 4;
4206 
4207 		proto_tree_add_item(tree, hf_pg_stat_actingprimary,
4208 				    tvb, off, 4, ENC_LITTLE_ENDIAN);
4209 		off += 4;
4210 	}
4211 	if (enc.version >= 16)
4212 	{
4213 		proto_tree_add_item(tree, hf_pg_stat_omapstatsinvalid,
4214 				    tvb, off, 1, ENC_LITTLE_ENDIAN);
4215 		off += 1;
4216 	}
4217 	if (enc.version >= 17)
4218 	{
4219 		proto_tree_add_item(tree, hf_pg_stat_hitsetstatsinvalid,
4220 				    tvb, off, 1, ENC_LITTLE_ENDIAN);
4221 		off += 1;
4222 	}
4223 
4224 	c_warn_size(tree, tvb, off, enc.end, data);
4225 	off = enc.end;
4226 
4227 	proto_item_set_end(ti, tvb, off);
4228 	return off;
4229 }
4230 
4231 #define C_SIZE_PAXOS 18
4232 
4233 /** Dissect a Paxos Service Message */
4234 static
c_dissect_paxos(proto_tree * root,tvbuff_t * tvb,guint off,c_pkt_data * data _U_)4235 guint c_dissect_paxos(proto_tree *root,
4236 		      tvbuff_t *tvb, guint off, c_pkt_data *data _U_)
4237 {
4238 	proto_item *ti;
4239 	proto_tree *tree;
4240 
4241 	/** ceph:/src/messages/PaxosServiceMessage.h */
4242 
4243 	ti = proto_tree_add_item(root, hf_paxos, tvb, off, C_SIZE_PAXOS, ENC_NA);
4244 	tree = proto_item_add_subtree(ti, ett_paxos);
4245 
4246 	proto_tree_add_item(tree, hf_paxos_ver,
4247 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
4248 	off += 8;
4249 	proto_tree_add_item(tree, hf_paxos_mon,
4250 			    tvb, off, 2, ENC_LITTLE_ENDIAN);
4251 	off += 2;
4252 	proto_tree_add_item(tree, hf_paxos_mon_tid,
4253 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
4254 	off += 8;
4255 
4256 	return off;
4257 }
4258 
4259 
4260 /*** Message Dissectors ***/
4261 
4262 /** Used to handle unknown messages.
4263  *
4264  * Simply displays the front, middle and data portions as binary strings.
4265  */
4266 static
c_dissect_msg_unknown(proto_tree * tree,tvbuff_t * tvb,guint front_len,guint middle_len,guint data_len,c_pkt_data * data)4267 guint c_dissect_msg_unknown(proto_tree *tree,
4268 			    tvbuff_t *tvb,
4269 			    guint front_len, guint middle_len, guint data_len,
4270 			    c_pkt_data *data)
4271 {
4272 	guint off = 0;
4273 
4274 	c_set_type(data, c_msg_type_string(data->header.type));
4275 	proto_item_append_text(data->item_root,
4276 			       ", Type: %s, Front Len: %u, Middle Len: %u, Data Len %u",
4277 			       c_msg_type_string(data->header.type),
4278 			       front_len, middle_len, data_len);
4279 	expert_add_info(data->pinfo, tree, &ei_msg_unknown);
4280 
4281 	if (front_len)
4282 	{
4283 		proto_tree_add_item(tree, hf_msg_front, tvb, off, front_len, ENC_NA);
4284 		off += front_len;
4285 	}
4286 	if (middle_len)
4287 	{
4288 		proto_tree_add_item(tree, hf_msg_middle, tvb, off, middle_len, ENC_NA);
4289 		off += middle_len;
4290 	}
4291 	if (data_len)
4292 	{
4293 		proto_tree_add_item(tree, hf_msg_data, tvb, off, data_len, ENC_NA);
4294 		off += data_len;
4295 	}
4296 
4297 	return off;
4298 }
4299 
4300 /** Dissect ping 0x0002 */
4301 static
c_dissect_msg_ping(proto_tree * root _U_,tvbuff_t * tvb _U_,guint front_len _U_,guint middle_len _U_,guint data_len _U_,c_pkt_data * data)4302 guint c_dissect_msg_ping(proto_tree *root _U_,
4303 			 tvbuff_t *tvb _U_,
4304 			 guint front_len _U_, guint middle_len _U_, guint data_len _U_,
4305 			 c_pkt_data *data)
4306 {
4307 	/* ceph:/src/messages/MPing.h */
4308 	c_set_type(data, "Ping");
4309 	return 0;
4310 }
4311 
4312 /** Dissect monmap message 0x0004 */
4313 static
c_dissect_msg_mon_map(proto_tree * root,tvbuff_t * tvb,guint front_len,guint middle_len _U_,guint data_len _U_,c_pkt_data * data)4314 guint c_dissect_msg_mon_map(proto_tree *root,
4315 			    tvbuff_t *tvb,
4316 			    guint front_len, guint middle_len _U_, guint data_len _U_,
4317 			    c_pkt_data *data)
4318 {
4319 	proto_item *ti;
4320 	proto_tree *tree;
4321 
4322 	/* ceph:/src/messages/MMonMap.h */
4323 
4324 	c_set_type(data, "Mon Map");
4325 
4326 	ti = proto_tree_add_item(root, hf_msg_mon_map, tvb, 0, front_len, ENC_NA);
4327 	tree = proto_item_add_subtree(ti, ett_msg_mon_map);
4328 
4329 	return c_dissect_monmap(tree, tvb, 0, data);
4330 }
4331 
4332 /** Stat FS 0x000D */
4333 static
c_dissect_msg_statfs(proto_tree * root,tvbuff_t * tvb,guint front_len,guint middle_len _U_,guint data_len _U_,c_pkt_data * data)4334 guint c_dissect_msg_statfs(proto_tree *root,
4335 			   tvbuff_t *tvb,
4336 			   guint front_len, guint middle_len _U_, guint data_len _U_,
4337 			   c_pkt_data *data)
4338 {
4339 	proto_item *ti;
4340 	proto_tree *tree;
4341 	guint off = 0;
4342 
4343 	/* ceph:/src/messages/MStatfs.h */
4344 
4345 	c_set_type(data, "Stat FS");
4346 
4347 	off = c_dissect_paxos(root, tvb, off, data);
4348 
4349 	ti = proto_tree_add_item(root, hf_msg_statfs, tvb, off, front_len, ENC_NA);
4350 	tree = proto_item_add_subtree(ti, ett_msg_statfs);
4351 
4352 	proto_tree_add_item(tree, hf_msg_statfs_fsid,
4353 			    tvb, off, 16, ENC_BIG_ENDIAN);
4354 	off += 16;
4355 
4356 	return off;
4357 }
4358 
4359 /** Stat FS Reply 0x000E */
4360 static
c_dissect_msg_statfsreply(proto_tree * root,tvbuff_t * tvb,guint front_len,guint middle_len _U_,guint data_len _U_,c_pkt_data * data)4361 guint c_dissect_msg_statfsreply(proto_tree *root,
4362 				tvbuff_t *tvb,
4363 				guint front_len, guint middle_len _U_, guint data_len _U_,
4364 				c_pkt_data *data)
4365 {
4366 	proto_item *ti;
4367 	proto_tree *tree;
4368 	guint off = 0;
4369 
4370 	/* ceph:/src/messages/MStatfsReply.h */
4371 
4372 	c_set_type(data, "Stat FS Reply");
4373 
4374 	ti = proto_tree_add_item(root, hf_msg_statfsreply, tvb, off, front_len, ENC_NA);
4375 	tree = proto_item_add_subtree(ti, ett_msg_statfsreply);
4376 
4377 	proto_tree_add_item(tree, hf_msg_statfsreply_fsid,
4378 			    tvb, off, 16, ENC_BIG_ENDIAN);
4379 	off += 16;
4380 
4381 	proto_tree_add_item(tree, hf_msg_statfsreply_ver,
4382 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
4383 	off += 8;
4384 
4385 	proto_tree_add_item(tree, hf_msg_statfsreply_kb,
4386 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
4387 	off += 8;
4388 
4389 	proto_tree_add_item(tree, hf_msg_statfsreply_kbused,
4390 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
4391 	off += 8;
4392 
4393 	proto_tree_add_item(tree, hf_msg_statfsreply_kbavail,
4394 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
4395 	off += 8;
4396 
4397 	proto_tree_add_item(tree, hf_msg_statfsreply_obj,
4398 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
4399 	off += 8;
4400 
4401 	return off;
4402 }
4403 
4404 /** Mon subscribe message 0x000F */
4405 static
c_dissect_msg_mon_sub(proto_tree * root,tvbuff_t * tvb,guint front_len,guint middle_len _U_,guint data_len _U_,c_pkt_data * data)4406 guint c_dissect_msg_mon_sub(proto_tree *root,
4407 			    tvbuff_t *tvb,
4408 			    guint front_len, guint middle_len _U_, guint data_len _U_,
4409 			    c_pkt_data *data)
4410 {
4411 	proto_item *ti, *subti, *subti2;
4412 	proto_tree *tree, *subtree;
4413 	guint off = 0;
4414 	guint len;
4415 	c_str str;
4416 
4417 	/* ceph:/src/messages/MMonSubscribe.h */
4418 
4419 	c_set_type(data, "Mon Subscribe");
4420 
4421 	ti = proto_tree_add_item(root, hf_msg_mon_sub, tvb, off, front_len, ENC_NA);
4422 	tree = proto_item_add_subtree(ti, ett_msg_mon_sub);
4423 
4424 	c_append_text(data, ti, ", To: ");
4425 
4426 	len = tvb_get_letohl(tvb, off);
4427 	proto_tree_add_item(tree, hf_msg_mon_sub_item_len,
4428 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
4429 	off += 4;
4430 	while (len--)
4431 	{
4432 		/* From ceph:/src/include/ceph_fs.h
4433 		struct ceph_mon_subscribe_item {
4434 			__le64 start;
4435 			__u8 flags;
4436 		} __attribute__ ((packed))
4437 		*/
4438 
4439 		subti = proto_tree_add_item(tree, hf_msg_mon_sub_item,
4440 				    tvb, off, -1, ENC_NA);
4441 		subtree = proto_item_add_subtree(subti, ett_msg_mon_sub_item);
4442 
4443 		off = c_dissect_str(subtree, hf_msg_mon_sub_what, &str, tvb, off);
4444 
4445 		c_append_text(data, ti, "%s%s", str.str, len? ",":"");
4446 
4447 		proto_item_append_text(subti, " What: %s, Starting: %"G_GUINT64_FORMAT,
4448 				       str.str,
4449 				       tvb_get_letoh64(tvb, off));
4450 
4451 		proto_tree_add_item(subtree, hf_msg_mon_sub_start,
4452 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
4453 		off += 8;
4454 
4455 		/* Flags */
4456 		subti2 = proto_tree_add_item(subtree, hf_msg_mon_sub_flags,
4457 					     tvb, off, 1, ENC_LITTLE_ENDIAN);
4458 		/* Reuse subtree variable for flags. */
4459 		subtree = proto_item_add_subtree(subti2, ett_msg_mon_sub_flags);
4460 		proto_tree_add_item(subtree, hf_msg_mon_sub_flags_onetime,
4461 				    tvb, off, 1, ENC_LITTLE_ENDIAN);
4462 		off += 1;
4463 
4464 		proto_item_set_end(ti, tvb, off);
4465 	}
4466 
4467 	return off;
4468 }
4469 
4470 /** Mon subscription ack 0x0010 */
4471 static
c_dissect_msg_mon_sub_ack(proto_tree * root,tvbuff_t * tvb,guint front_len,guint middle_len _U_,guint data_len _U_,c_pkt_data * data)4472 guint c_dissect_msg_mon_sub_ack(proto_tree *root,
4473 				tvbuff_t *tvb,
4474 				guint front_len, guint middle_len _U_, guint data_len _U_,
4475 				c_pkt_data *data)
4476 {
4477 	proto_item *ti;
4478 	proto_tree *tree;
4479 	guint off = 0;
4480 
4481 	/* ceph:/src/messages/MMonSubscribeAck.h */
4482 
4483 	c_set_type(data, "Mon Subscribe Ack");
4484 
4485 	ti = proto_tree_add_item(root, hf_msg_mon_sub_ack, tvb, off, front_len, ENC_NA);
4486 	tree = proto_item_add_subtree(ti, ett_msg_mon_sub_ack);
4487 
4488 	proto_tree_add_item(tree, hf_msg_mon_sub_ack_interval,
4489 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
4490 	off += 4;
4491 	proto_tree_add_item(tree, hf_msg_mon_sub_ack_fsid,
4492 			    tvb, off, 16, ENC_BIG_ENDIAN);
4493 	off += 16;
4494 
4495 	return off;
4496 }
4497 
4498 /** Authentication Request 0x0011. */
4499 static
c_dissect_msg_auth(proto_tree * root,tvbuff_t * tvb,guint front_len,guint middle_len _U_,guint data_len _U_,c_pkt_data * data)4500 guint c_dissect_msg_auth(proto_tree *root,
4501 			 tvbuff_t *tvb,
4502 			 guint front_len, guint middle_len _U_, guint data_len _U_,
4503 			 c_pkt_data *data)
4504 {
4505 	proto_item *ti, *ti2;
4506 	proto_tree *tree, *subtree;
4507 	guint off = 0, expectedoff;
4508 	guint8 ver;
4509 	guint32 i, len;
4510 	c_auth_proto proto;
4511 
4512 	/* ceph:/src/messages/MAuth.h */
4513 
4514 	c_set_type(data, "Auth");
4515 
4516 	off = c_dissect_paxos(root, tvb, off, data);
4517 
4518 	ti = proto_tree_add_item(root, hf_msg_auth, tvb, off, front_len-off, ENC_NA);
4519 	tree = proto_item_add_subtree(ti, ett_msg_auth);
4520 
4521 	proto = (c_auth_proto)tvb_get_letohl(tvb, off);
4522 	proto_tree_add_item(tree, hf_msg_auth_proto,
4523 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
4524 	off += 4;
4525 
4526 	expectedoff = off + 4 + tvb_get_letohl(tvb, off);
4527 	off += 4;
4528 
4529 	switch (proto)
4530 	{
4531 	case C_AUTH_PROTO_UNKNOWN:
4532 		/* auth_payload is a set of supported protocols. */
4533 		ti2 = proto_tree_add_item(tree, hf_msg_auth_supportedproto,
4534 					  tvb, off, -1, ENC_NA);
4535 		subtree = proto_item_add_subtree(ti2, ett_msg_auth_supportedproto);
4536 
4537 		ver = tvb_get_guint8(tvb, off);
4538 		c_warn_ver(ti2, ver, 1, 1, data);
4539 		proto_tree_add_item(tree, hf_msg_auth_supportedproto_ver,
4540 				    tvb, off, 1, ENC_LITTLE_ENDIAN);
4541 		off += 1;
4542 
4543 		len = tvb_get_letohl(tvb, off);
4544 		off += 4;
4545 		for (i = 0; i < len; i++)
4546 		{
4547 			c_auth_proto sp;
4548 			sp = (c_auth_proto)tvb_get_letohl(tvb, off);
4549 			proto_item_append_text(ti2, i?",%s":": %s", c_auth_proto_string(sp));
4550 			proto_tree_add_item(subtree, hf_msg_auth_supportedproto_proto,
4551 					    tvb, off, 4, ENC_LITTLE_ENDIAN);
4552 			off += 4;
4553 		}
4554 
4555 		off = c_dissect_EntityName(subtree, tvb, off, data);
4556 
4557 		proto_tree_add_item(subtree, hf_msg_auth_supportedproto_gid,
4558 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
4559 		off += 8;
4560 		break;
4561 	case C_AUTH_PROTO_CEPHX:
4562 	{
4563 		c_cephx_req_type type;
4564 
4565 		ti2 = proto_tree_add_item(tree, hf_msg_auth_cephx, tvb, off, -1, ENC_NA);
4566 		subtree = proto_item_add_subtree(ti2, ett_msg_auth_cephx);
4567 
4568 		type = (c_cephx_req_type)tvb_get_letohs(tvb, off);
4569 		proto_tree_add_item(subtree, hf_msg_auth_cephx_req_type,
4570 				    tvb, off, 2, ENC_LITTLE_ENDIAN);
4571 		off += 2;
4572 
4573 		switch (type)
4574 		{
4575 		default:
4576 			expert_add_info(data->pinfo, ti2, &ei_union_unknown);
4577 		}
4578 
4579 		proto_item_append_text(ti2, ", Request Type: %s",
4580 				       c_cephx_req_type_string(type));
4581 		break;
4582 	}
4583 	default:
4584 		expert_add_info(data->pinfo, ti, &ei_union_unknown);
4585 	}
4586 
4587 	c_warn_size(tree, tvb, off, expectedoff, data);
4588 	off = expectedoff;
4589 
4590 	if (off+4 == front_len) { /* If there is an epoch. */
4591 		proto_tree_add_item(tree, hf_msg_auth_monmap_epoch,
4592 				    tvb, off, 4, ENC_LITTLE_ENDIAN);
4593 		off += 4;
4594 	}
4595 
4596 	c_append_text(data, ti, ", Proto: %s", c_auth_proto_string(proto));
4597 
4598 	return off;
4599 }
4600 
4601 /** Authentication response. 0x0012 */
4602 static
c_dissect_msg_auth_reply(proto_tree * root,tvbuff_t * tvb,guint front_len,guint middle_len _U_,guint data_len _U_,c_pkt_data * data)4603 guint c_dissect_msg_auth_reply(proto_tree *root,
4604 			       tvbuff_t *tvb,
4605 			       guint front_len, guint middle_len _U_, guint data_len _U_,
4606 			       c_pkt_data *data)
4607 {
4608 	proto_item *ti;
4609 	proto_tree *tree;
4610 	guint off = 0, expectedoff;
4611 	c_auth_proto proto;
4612 
4613 	/* ceph:/src/messages/MAuthReply.h */
4614 
4615 	c_set_type(data, "Auth Reply");
4616 
4617 	ti = proto_tree_add_item(root, hf_msg_auth_reply, tvb, off, front_len, ENC_NA);
4618 	tree = proto_item_add_subtree(ti, ett_msg_authreply);
4619 
4620 	proto = (c_auth_proto)tvb_get_letohl(tvb, off);
4621 	proto_tree_add_item(tree, hf_msg_auth_reply_proto,
4622 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
4623 	off += 4;
4624 	proto_tree_add_item(tree, hf_msg_auth_reply_result,
4625 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
4626 	off += 4;
4627 	proto_tree_add_item(tree, hf_msg_auth_reply_global_id,
4628 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
4629 	off += 8;
4630 
4631 	expectedoff = off + 4 + tvb_get_letohl(tvb, off);
4632 	off += 4;
4633 
4634 	switch (proto)
4635 	{
4636 	default:
4637 		expert_add_info(data->pinfo, ti, &ei_union_unknown);
4638 	}
4639 
4640 	c_warn_size(tree, tvb, off, expectedoff, data);
4641 	off = expectedoff;
4642 
4643 	off = c_dissect_str(tree, hf_msg_auth_reply_msg, NULL, tvb, off);
4644 
4645 	c_append_text(data, ti, ", Proto: %s", c_auth_proto_string(proto));
4646 
4647 	return off;
4648 }
4649 
4650 /** Get map versions. 0x0013 */
4651 static
c_dissect_msg_mon_getversion(proto_tree * root,tvbuff_t * tvb,guint front_len,guint middle_len _U_,guint data_len _U_,c_pkt_data * data)4652 guint c_dissect_msg_mon_getversion(proto_tree *root,
4653 				   tvbuff_t *tvb,
4654 				   guint front_len, guint middle_len _U_, guint data_len _U_,
4655 				   c_pkt_data *data)
4656 {
4657 	proto_item *ti;
4658 	proto_tree *tree;
4659 	guint off = 0;
4660 	guint64 tid;
4661 	c_str what;
4662 
4663 	/* ceph:/src/messages/MMonGetVersion.h */
4664 
4665 	c_set_type(data, "Monitor Get Version");
4666 
4667 	ti = proto_tree_add_item(root, hf_msg_mon_getversion, tvb, off, front_len, ENC_NA);
4668 	tree = proto_item_add_subtree(ti, ett_msg_mon_getversion);
4669 
4670 	tid = tvb_get_letoh64(tvb, off);
4671 	proto_tree_add_item(tree, hf_msg_mon_getversion_tid,
4672 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
4673 	off += 8;
4674 
4675 	off = c_dissect_str(tree, hf_msg_mon_getversion_what, &what, tvb, off);
4676 
4677 
4678 	c_append_text(data, ti, ", TID: %"G_GINT64_MODIFIER"u, What: %s",
4679 		      tid, what.str);
4680 
4681 	return off;
4682 }
4683 
4684 
4685 /** Get map versions response. 0x0014 */
4686 static
c_dissect_msg_mon_getversionreply(proto_tree * root,tvbuff_t * tvb,guint front_len,guint middle_len _U_,guint data_len _U_,c_pkt_data * data)4687 guint c_dissect_msg_mon_getversionreply(proto_tree *root,
4688 					tvbuff_t *tvb,
4689 					guint front_len,
4690 					guint middle_len _U_,
4691 					guint data_len _U_,
4692 					c_pkt_data *data)
4693 {
4694 	proto_item *ti;
4695 	proto_tree *tree;
4696 	guint off = 0;
4697 	guint64 tid;
4698 	guint64 ver, veroldest;
4699 
4700 	/* ceph:/src/messages/MMonGetVersionReply.h */
4701 
4702 	c_set_type(data, "Monitor Get Version Reply");
4703 
4704 	ti = proto_tree_add_item(root, hf_msg_mon_getversionreply, tvb, off, front_len, ENC_NA);
4705 	tree = proto_item_add_subtree(ti, ett_msg_mon_getversionreply);
4706 
4707 	tid = tvb_get_letoh64(tvb, off);
4708 	proto_tree_add_item(tree, hf_msg_mon_getversionreply_tid,
4709 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
4710 	off += 8;
4711 
4712 	ver = tvb_get_letoh64(tvb, off);
4713 	proto_tree_add_item(tree, hf_msg_mon_getversionreply_ver,
4714 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
4715 	off += 8;
4716 
4717 	veroldest = tvb_get_letoh64(tvb, off);
4718 	proto_tree_add_item(tree, hf_msg_mon_getversionreply_veroldest,
4719 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
4720 	off += 8;
4721 
4722 	c_append_text(data, ti, ", TID: %"G_GINT64_MODIFIER"u"
4723 		      ", Version: %"G_GINT64_MODIFIER"u"
4724 		      ", Oldest Version: %"G_GINT64_MODIFIER"u",
4725 		      tid, ver, veroldest);
4726 
4727 	return off;
4728 }
4729 
4730 /** MDS Map 0x0015 */
4731 static
c_dissect_msg_mds_map(proto_tree * root,tvbuff_t * tvb,guint front_len,guint middle_len _U_,guint data_len _U_,c_pkt_data * data)4732 guint c_dissect_msg_mds_map(proto_tree *root,
4733 			    tvbuff_t *tvb,
4734 			    guint front_len, guint middle_len _U_, guint data_len _U_,
4735 			    c_pkt_data *data)
4736 {
4737 	proto_item *ti;
4738 	proto_tree *tree;
4739 	guint off = 0;
4740 
4741 	/* ceph:/src/messages/MMDSMap.h */
4742 
4743 	c_set_type(data, "MDS Map");
4744 
4745 	ti = proto_tree_add_item(root, hf_msg_mds_map, tvb, off, front_len, ENC_NA);
4746 	tree = proto_item_add_subtree(ti, ett_msg_mds_map);
4747 
4748 	proto_tree_add_item(tree, hf_msg_mds_map_fsid,
4749 			    tvb, off, 16, ENC_BIG_ENDIAN);
4750 	off += 16;
4751 
4752 	proto_tree_add_item(tree, hf_msg_mds_map_epoch,
4753 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
4754 	off += 4;
4755 
4756 	/* @TODO: Dissect map data. */
4757 
4758 	off = c_dissect_blob(tree, hf_msg_mds_map_datai,
4759 			     hf_msg_mds_map_data, hf_msg_mds_map_data_size,
4760 			     tvb, off);
4761 
4762 	return off;
4763 }
4764 
4765 /** Client Session 0x0016 */
4766 static
c_dissect_msg_client_sess(proto_tree * root,tvbuff_t * tvb,guint front_len,guint middle_len _U_,guint data_len _U_,c_pkt_data * data)4767 guint c_dissect_msg_client_sess(proto_tree *root,
4768 				tvbuff_t *tvb,
4769 				guint front_len, guint middle_len _U_, guint data_len _U_,
4770 				c_pkt_data *data)
4771 {
4772 	proto_item *ti;
4773 	proto_tree *tree;
4774 	guint off = 0;
4775 	c_session_op_type op;
4776 
4777 	/* ceph:/src/messages/MClientSession.h */
4778 
4779 	c_set_type(data, "Client Session");
4780 
4781 	ti = proto_tree_add_item(root, hf_msg_client_sess, tvb, off, front_len, ENC_NA);
4782 	tree = proto_item_add_subtree(ti, ett_msg_client_sess);
4783 
4784 	op = (c_session_op_type)tvb_get_letohl(tvb, off);
4785 	proto_tree_add_item(tree, hf_msg_client_sess_op,
4786 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
4787 	off += 4;
4788 
4789 	proto_tree_add_item(tree, hf_msg_client_sess_seq,
4790 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
4791 	off += 8;
4792 
4793 	proto_tree_add_item(tree, hf_msg_client_sess_time,
4794 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
4795 	off += 8;
4796 
4797 	proto_tree_add_item(tree, hf_msg_client_sess_caps_max,
4798 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
4799 	off += 4;
4800 
4801 	proto_tree_add_item(tree, hf_msg_client_sess_leases_max,
4802 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
4803 	off += 4;
4804 
4805 	c_append_text(data, ti, ", Operation: %s", c_session_op_type_string(op));
4806 
4807 	return off;
4808 }
4809 
4810 /** Client Request 0x0018 */
4811 static
c_dissect_msg_client_req(proto_tree * root,tvbuff_t * tvb,guint front_len,guint middle_len _U_,guint data_len _U_,c_pkt_data * data)4812 guint c_dissect_msg_client_req(proto_tree *root,
4813 			       tvbuff_t *tvb,
4814 			       guint front_len, guint middle_len _U_, guint data_len _U_,
4815 			       c_pkt_data *data)
4816 {
4817 	proto_item *ti;
4818 	proto_tree *tree;
4819 	guint off = 0;
4820 	guint32 i;
4821 	c_mds_op_type type;
4822 
4823 	/* ceph:/src/messages/MClientRequest.h */
4824 
4825 	c_set_type(data, "Client Request");
4826 
4827 	ti = proto_tree_add_item(root, hf_msg_client_req, tvb, off, front_len, ENC_NA);
4828 	tree = proto_item_add_subtree(ti, ett_msg_client_req);
4829 
4830 	proto_tree_add_item(tree, hf_msg_client_req_oldest_tid,
4831 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
4832 	off += 8;
4833 
4834 	proto_tree_add_item(tree, hf_msg_client_req_mdsmap_epoch,
4835 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
4836 	off += 4;
4837 
4838 	proto_tree_add_item(tree, hf_msg_client_req_flags,
4839 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
4840 	off += 4;
4841 
4842 	proto_tree_add_item(tree, hf_msg_client_req_retry,
4843 			    tvb, off, 1, ENC_LITTLE_ENDIAN);
4844 	off += 1;
4845 
4846 	proto_tree_add_item(tree, hf_msg_client_req_forward,
4847 			    tvb, off, 1, ENC_LITTLE_ENDIAN);
4848 	off += 1;
4849 
4850 	i = tvb_get_letohs(tvb, off);
4851 	proto_tree_add_item(tree, hf_msg_client_req_releases,
4852 			    tvb, off, 2, ENC_LITTLE_ENDIAN);
4853 	off += 2;
4854 
4855 	type = (c_mds_op_type)tvb_get_letohl(tvb, off);
4856 	proto_tree_add_item(tree, hf_msg_client_req_op,
4857 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
4858 	off += 4;
4859 
4860 	proto_tree_add_item(tree, hf_msg_client_req_caller_uid,
4861 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
4862 	off += 4;
4863 
4864 	proto_tree_add_item(tree, hf_msg_client_req_caller_gid,
4865 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
4866 	off += 4;
4867 
4868 	proto_tree_add_item(tree, hf_msg_client_req_inode,
4869 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
4870 	off += 8;
4871 
4872 	off += 48; /* @TODO: Message specific data. */
4873 
4874 	off = c_dissect_path(tree, hf_msg_client_req_path_src, tvb, off, data);
4875 	off = c_dissect_path(tree, hf_msg_client_req_path_dst, tvb, off, data);
4876 
4877 	while (i--)
4878 	{
4879 		off = c_dissect_mds_release(tree, hf_msg_client_req_release,
4880 					    tvb, off, data);
4881 	}
4882 
4883 	if (data->header.ver >= 2)
4884 	{
4885 		proto_tree_add_item(tree, hf_msg_client_req_time,
4886 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
4887 		off += 8;
4888 	}
4889 
4890 	c_append_text(data, ti, ", Operation: %s", c_mds_op_type_string(type));
4891 
4892 	return off;
4893 }
4894 
4895 /** Client Request Forward 0x0019 */
4896 static
c_dissect_msg_client_reqfwd(proto_tree * root,tvbuff_t * tvb,guint front_len,guint middle_len _U_,guint data_len _U_,c_pkt_data * data)4897 guint c_dissect_msg_client_reqfwd(proto_tree *root,
4898 				  tvbuff_t *tvb,
4899 				  guint front_len, guint middle_len _U_, guint data_len _U_,
4900 				  c_pkt_data *data)
4901 {
4902 	proto_item *ti;
4903 	proto_tree *tree;
4904 	guint off = 0;
4905 	guint32 to, fwd;
4906 	guint8 resend;
4907 
4908 	/* ceph:/src/messages/MClientRequestForward.h */
4909 
4910 	c_set_type(data, "Client Request Forward");
4911 
4912 	ti = proto_tree_add_item(root, hf_msg_client_reqfwd, tvb, off, front_len, ENC_NA);
4913 	tree = proto_item_add_subtree(ti, ett_msg_client_reqfwd);
4914 
4915 	to = tvb_get_letohl(tvb, off);
4916 	proto_tree_add_item(tree, hf_msg_client_reqfwd_dst,
4917 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
4918 	off += 4;
4919 
4920 	fwd = tvb_get_letohl(tvb, off);
4921 	proto_tree_add_item(tree, hf_msg_client_reqfwd_fwd,
4922 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
4923 	off += 4;
4924 
4925 	resend = tvb_get_guint8(tvb, off);
4926 	proto_tree_add_item(tree, hf_msg_client_reqfwd_resend,
4927 			    tvb, off, 1, ENC_LITTLE_ENDIAN);
4928 	off += 1;
4929 
4930 	c_append_text(data, ti, ", To: mds%"G_GINT32_MODIFIER"u, Resend: %s, "
4931 		      "Forwards: %"G_GINT32_MODIFIER"u",
4932 		      to, resend? "True":"False", fwd);
4933 
4934 	return off;
4935 }
4936 
4937 /** Client Reply 0x001A */
4938 static
c_dissect_msg_client_reply(proto_tree * root,tvbuff_t * tvb,guint front_len,guint middle_len _U_,guint data_len _U_,c_pkt_data * data)4939 guint c_dissect_msg_client_reply(proto_tree *root,
4940 				 tvbuff_t *tvb,
4941 				 guint front_len, guint middle_len _U_, guint data_len _U_,
4942 				 c_pkt_data *data)
4943 {
4944 	proto_item *ti;
4945 	proto_tree *tree;
4946 	guint off = 0;
4947 	c_mds_op_type type;
4948 
4949 	/* ceph:/src/messages/MClientReply.h */
4950 
4951 	c_set_type(data, "Client Reply");
4952 
4953 	ti = proto_tree_add_item(root, hf_msg_client_reply, tvb, off, front_len, ENC_NA);
4954 	tree = proto_item_add_subtree(ti, ett_msg_client_reply);
4955 
4956 	type = (c_mds_op_type)tvb_get_letohl(tvb, off);
4957 	proto_tree_add_item(tree, hf_msg_client_reply_op,
4958 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
4959 	off += 4;
4960 
4961 	proto_tree_add_item(tree, hf_msg_client_reply_result,
4962 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
4963 	off += 4;
4964 
4965 	proto_tree_add_item(tree, hf_msg_client_reply_mdsmap_epoch,
4966 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
4967 	off += 4;
4968 
4969 	proto_tree_add_item(tree, hf_msg_client_reply_safe,
4970 			    tvb, off, 1, ENC_LITTLE_ENDIAN);
4971 	off += 1;
4972 
4973 	proto_tree_add_item(tree, hf_msg_client_reply_isdentry,
4974 			    tvb, off, 1, ENC_LITTLE_ENDIAN);
4975 	off += 1;
4976 
4977 	proto_tree_add_item(tree, hf_msg_client_reply_istarget,
4978 			    tvb, off, 1, ENC_LITTLE_ENDIAN);
4979 	off += 1;
4980 
4981 	/* @TODO: Dissect these. */
4982 	off = c_dissect_data(tree, hf_msg_client_reply_trace, tvb, off);
4983 	off = c_dissect_data(tree, hf_msg_client_reply_extra, tvb, off);
4984 	off = c_dissect_data(tree, hf_msg_client_reply_snaps, tvb, off);
4985 
4986 	c_append_text(data, ti, ", Operation: %s", c_mds_op_type_string(type));
4987 
4988 	return off;
4989 }
4990 
4991 /** OSD Map 0x0029 */
4992 static
c_dissect_msg_osd_map(proto_tree * root,tvbuff_t * tvb,guint front_len,guint middle_len _U_,guint data_len _U_,c_pkt_data * data)4993 guint c_dissect_msg_osd_map(proto_tree *root,
4994 			    tvbuff_t *tvb,
4995 			    guint front_len, guint middle_len _U_, guint data_len _U_,
4996 			    c_pkt_data *data)
4997 {
4998 	proto_item *ti, *ti2;
4999 	proto_tree *tree, *subtree;
5000 	guint off = 0;
5001 	guint32 i;
5002 	guint32 epoch;
5003 
5004 	/* ceph:/src/messages/MOSDMap.h */
5005 
5006 	c_set_type(data, "OSD Map");
5007 
5008 	ti = proto_tree_add_item(root, hf_msg_osd_map, tvb, off, front_len, ENC_NA);
5009 	tree = proto_item_add_subtree(ti, ett_msg_osd_map);
5010 
5011 	proto_tree_add_item(tree, hf_msg_osd_map_fsid,
5012 			    tvb, off, 16, ENC_BIG_ENDIAN);
5013 	off += 16;
5014 
5015 	/*** Incremental Items ***/
5016 	i = tvb_get_letohl(tvb, off);
5017 	proto_tree_add_item(tree, hf_msg_osd_map_inc_len,
5018 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
5019 	c_append_text(data, ti, ", Incremental Items: %u", i);
5020 
5021 	off += 4;
5022 	while (i--)
5023 	{
5024 		ti2 = proto_tree_add_item(tree, hf_msg_osd_map_inc,
5025 				    tvb, off, -1, ENC_NA);
5026 		subtree = proto_item_add_subtree(ti2, ett_msg_osd_map_inc);
5027 
5028 		epoch = tvb_get_letohl(tvb, off);
5029 		proto_tree_add_item(subtree, hf_msg_osd_map_epoch,
5030 				    tvb, off, 4, ENC_LITTLE_ENDIAN);
5031 		off += 4;
5032 
5033 		off = c_dissect_osdmap_inc(subtree, tvb, off, data);
5034 
5035 		proto_item_append_text(ti2, ", For Epoch: %"G_GINT32_MODIFIER"u", epoch);
5036 		proto_item_set_end(ti2, tvb, off);
5037 	}
5038 
5039 	/*** Non-incremental Items ***/
5040 	i = tvb_get_letohl(tvb, off);
5041 	proto_tree_add_item(tree, hf_msg_osd_map_map_len,
5042 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
5043 	c_append_text(data, ti, ", Items: %u", i);
5044 	off += 4;
5045 	while (i--)
5046 	{
5047 		ti2 = proto_tree_add_item(tree, hf_msg_osd_map_map,
5048 					  tvb, off, -1, ENC_NA);
5049 		subtree = proto_item_add_subtree(ti2, ett_msg_osd_map_full);
5050 
5051 		epoch = tvb_get_letohl(tvb, off);
5052 		proto_tree_add_item(subtree, hf_msg_osd_map_epoch,
5053 				    tvb, off, 4, ENC_LITTLE_ENDIAN);
5054 		off += 4;
5055 
5056 		off = c_dissect_osdmap(subtree, tvb, off, data);
5057 
5058 		proto_item_append_text(ti2, ", For Epoch: %"G_GINT32_MODIFIER"u", epoch);
5059 		proto_item_set_end(ti2, tvb, off);
5060 	}
5061 
5062 	if (data->header.ver >= 2)
5063 	{
5064 		proto_tree_add_item(tree, hf_msg_osd_map_oldest,
5065 				    tvb, off, 4, ENC_LITTLE_ENDIAN);
5066 		off += 4;
5067 		proto_tree_add_item(tree, hf_msg_osd_map_newest,
5068 				    tvb, off, 4, ENC_LITTLE_ENDIAN);
5069 		off += 4;
5070 	}
5071 
5072 	return off;
5073 }
5074 
5075 /** OSD Operation (0x002A)
5076  */
5077 static
c_dissect_msg_osd_op(proto_tree * root,tvbuff_t * tvb,guint front_len,guint middle_len _U_,guint data_len _U_,c_pkt_data * data)5078 guint c_dissect_msg_osd_op(proto_tree *root,
5079 			   tvbuff_t *tvb,
5080 			   guint front_len, guint middle_len _U_, guint data_len _U_,
5081 			   c_pkt_data *data)
5082 {
5083 	proto_item *ti, *ti2;
5084 	proto_tree *tree;
5085 	guint off = 0;
5086 	guint16 opslen, i;
5087 	c_osd_op *ops;
5088 	c_str str;
5089 
5090 	/* ceph:/src/messages/MOSDOp.h */
5091 
5092 	c_set_type(data, "OSD Operation");
5093 
5094 	ti = proto_tree_add_item(root, hf_msg_osd_op, tvb, off, front_len, ENC_NA);
5095 	tree = proto_item_add_subtree(ti, ett_msg_osd_op);
5096 
5097 	proto_tree_add_item(tree, hf_msg_osd_op_client_inc,
5098 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
5099 	off += 4;
5100 
5101 	proto_tree_add_item(tree, hf_msg_osd_op_osdmap_epoch,
5102 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
5103 	off += 4;
5104 
5105 	off = c_dissect_osd_flags(tree, tvb, off, data);
5106 
5107 	proto_tree_add_item(tree, hf_msg_osd_op_mtime,
5108 			    tvb, off, 8, ENC_TIME_SECS_NSECS|ENC_LITTLE_ENDIAN);
5109 	off += 8;
5110 
5111 	off = c_dissect_eversion(tree, hf_msg_osd_op_reassert_version,
5112 				 tvb, off, data);
5113 
5114 	off = c_dissect_object_locator(tree, hf_msg_osd_op_oloc, tvb, off, data);
5115 
5116 	off = c_dissect_pg(tree, hf_msg_osd_op_pgid, tvb, off, data);
5117 
5118 	off = c_dissect_str(tree, hf_msg_osd_op_oid, &str, tvb, off);
5119 
5120 	opslen = tvb_get_letohs(tvb, off);
5121 	c_append_text(data, ti, ", Operations: %"G_GINT32_MODIFIER"d", opslen);
5122 	ti2 = proto_tree_add_item(tree, hf_msg_osd_op_ops_len,
5123 				  tvb, off, 2, ENC_LITTLE_ENDIAN);
5124 	off += 2;
5125 	if (opslen > (tvb_reported_length(tvb)-off)/C_SIZE_OSD_OP_MIN)
5126 	{
5127 		/*
5128 			If the size is huge (maybe it was mangled on the wire) we want to
5129 			avoid allocating massive amounts of memory to handle it.  So, if
5130 			it is larger then can possibly fit in the rest of the message bail
5131 			out.
5132 		*/
5133 		expert_add_info(data->pinfo, ti2, &ei_sizeillogical);
5134 		return off;
5135 	}
5136 	ops = wmem_alloc_array(wmem_packet_scope(), c_osd_op, opslen);
5137 	for (i = 0; i < opslen; i++)
5138 	{
5139 		off = c_dissect_osd_op(tree, hf_msg_osd_op_op, &ops[i], tvb, off, data);
5140 	}
5141 
5142 	proto_tree_add_item(tree, hf_msg_osd_op_snap_id,
5143 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
5144 	off += 8;
5145 	proto_tree_add_item(tree, hf_msg_osd_op_snap_seq,
5146 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
5147 	off += 8;
5148 
5149 	i = tvb_get_letohl(tvb, off);
5150 	proto_tree_add_item(tree, hf_msg_osd_op_snaps_len,
5151 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
5152 	off += 4;
5153 	while (i--)
5154 	{
5155 		proto_tree_add_item(tree, hf_msg_osd_op_snap,
5156 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
5157 		off += 8;
5158 	}
5159 
5160 	if (data->header.ver >= 4)
5161 	{
5162 		proto_tree_add_item(tree, hf_msg_osd_op_retry_attempt,
5163 				    tvb, off, 4, ENC_LITTLE_ENDIAN);
5164 		off += 4;
5165 	}
5166 
5167 	c_warn_size(tree, tvb, off, front_len, data);
5168 
5169 	for (i = 0; i < opslen; i++)
5170 	{
5171 		proto_tree_add_item(tree, hf_msg_osd_op_payload,
5172 				    tvb, off, ops[i].payload_size, ENC_NA);
5173 		off += ops[i].payload_size;
5174 	}
5175 
5176 	return off;
5177 }
5178 
5179 /** OSD Operation Reply (0x002B)
5180  */
5181 static
c_dissect_msg_osd_opreply(proto_tree * root,tvbuff_t * tvb,guint front_len,guint middle_len _U_,guint data_len _U_,c_pkt_data * data)5182 guint c_dissect_msg_osd_opreply(proto_tree *root,
5183 				tvbuff_t *tvb,
5184 				guint front_len, guint middle_len _U_, guint data_len _U_,
5185 				c_pkt_data *data)
5186 {
5187 	proto_item *ti, *ti2;
5188 	proto_tree *tree;
5189 	guint off = 0;
5190 	c_str str;
5191 	guint32 i;
5192 	guint32 opslen;
5193 	c_osd_op *ops;
5194 
5195 	/* ceph:/src/messages/MOSDOpReply.h */
5196 
5197 	c_set_type(data, "OSD Operation Reply");
5198 
5199 	ti = proto_tree_add_item(root, hf_msg_osd_opreply, tvb, off, front_len, ENC_NA);
5200 	tree = proto_item_add_subtree(ti, ett_msg_osd_opreply);
5201 
5202 	off = c_dissect_str(tree, hf_msg_osd_opreply_oid, &str, tvb, off);
5203 
5204 	off = c_dissect_pg(tree, hf_msg_osd_opreply_pgid, tvb, off, data);
5205 
5206 	off = c_dissect_osd_flags(tree, tvb, off, data);
5207 	off += 4; /* flags is 64 bit but the higher bits are ignored. */
5208 
5209 	proto_tree_add_item(tree, hf_msg_osd_opreply_result,
5210 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
5211 	off += 4;
5212 
5213 	off = c_dissect_eversion(tree, hf_msg_osd_opreply_bad_replay_ver,
5214 				 tvb, off, data);
5215 
5216 	proto_tree_add_item(tree, hf_msg_osd_opreply_osdmap_epoch,
5217 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
5218 	off += 4;
5219 
5220 	opslen = tvb_get_letohl(tvb, off);
5221 	ti2 = proto_tree_add_item(tree, hf_msg_osd_opreply_ops_len,
5222 				  tvb, off, 4, ENC_LITTLE_ENDIAN);
5223 	off += 4;
5224 	if (opslen >= (tvb_reported_length(tvb)-off)/C_SIZE_OSD_OP_MIN)
5225 	{
5226 		/*
5227 			If the size is huge (maybe it was mangled on the wire) we want to
5228 			avoid allocating massive amounts of memory to handle it.  So, if
5229 			it is larger then can possible fit in the rest of the message bail
5230 			out.
5231 		*/
5232 		expert_add_info(data->pinfo, ti2, &ei_sizeillogical);
5233 		return off;
5234 	}
5235 	ops = wmem_alloc_array(wmem_packet_scope(), c_osd_op, opslen);
5236 	for (i = 0; i < opslen; i++)
5237 	{
5238 		off = c_dissect_osd_op(tree, hf_msg_osd_opreply_op, &ops[i],
5239 				       tvb, off, data);
5240 	}
5241 
5242 	if (data->header.ver >= 3)
5243 	{
5244 		proto_tree_add_item(tree, hf_msg_osd_opreply_retry_attempt,
5245 				    tvb, off, 4, ENC_LITTLE_ENDIAN);
5246 		off += 4;
5247 	}
5248 
5249 	if (data->header.ver >= 4)
5250 	{
5251 		for (i = 0; i < opslen; i++)
5252 		{
5253 			proto_tree_add_item(tree, hf_msg_osd_opreply_rval,
5254 					    tvb, off, 4, ENC_LITTLE_ENDIAN);
5255 			off += 4;
5256 		}
5257 	}
5258 
5259 	if (data->header.ver >= 5)
5260 	{
5261 		off = c_dissect_eversion(tree, hf_msg_osd_opreply_replay_ver,
5262 					 tvb, off, data);
5263 		proto_tree_add_item(tree, hf_msg_osd_opreply_user_ver,
5264 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
5265 		off += 8;
5266 	}
5267 
5268 	if (data->header.ver >= 6)
5269 	{
5270 		off = c_dissect_redirect(tree, hf_msg_osd_opreply_redirect,
5271 					 tvb, off, data);
5272 	}
5273 
5274 	c_warn_size(tree, tvb, off, front_len, data);
5275 	off = front_len;
5276 
5277 	if (data->header.ver >= 4)
5278 	{
5279 		for (i = 0; i < opslen; i++)
5280 		{
5281 			proto_tree_add_item(tree, hf_msg_osd_opreply_payload,
5282 					    tvb, off, ops[i].payload_size, ENC_NA);
5283 			off += ops[i].payload_size;
5284 		}
5285 	}
5286 
5287 	return off;
5288 }
5289 
5290 /** Pool Op Reply 0x0030 */
5291 static
c_dissect_msg_poolopreply(proto_tree * root,tvbuff_t * tvb,guint front_len,guint middle_len _U_,guint data_len _U_,c_pkt_data * data)5292 guint c_dissect_msg_poolopreply(proto_tree *root,
5293 				tvbuff_t *tvb,
5294 				guint front_len, guint middle_len _U_, guint data_len _U_,
5295 				c_pkt_data *data)
5296 {
5297 	proto_item *ti;
5298 	proto_tree *tree;
5299 	guint off = 0;
5300 	gint32 code;
5301 	guint8 b;
5302 
5303 	/* ceph:/src/messages/MPoolOpReply.h */
5304 
5305 	c_set_type(data, "Pool Operation Reply");
5306 
5307 	off = c_dissect_paxos(root, tvb, off, data);
5308 
5309 	ti = proto_tree_add_item(root, hf_msg_poolopreply, tvb, off, front_len, ENC_NA);
5310 	tree = proto_item_add_subtree(ti, ett_msg_poolopreply);
5311 
5312 	proto_tree_add_item(tree, hf_msg_poolopreply_fsid,
5313 			    tvb, off, 16, ENC_BIG_ENDIAN);
5314 	off += 16;
5315 
5316 	code = tvb_get_letohl(tvb, off);
5317 	proto_tree_add_item(tree, hf_msg_poolopreply_code,
5318 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
5319 	off += 4;
5320 
5321 	proto_tree_add_item(tree, hf_msg_poolopreply_epoch,
5322 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
5323 	off += 4;
5324 
5325 	b = tvb_get_guint8(tvb, off);
5326 	off += 1;
5327 	if (b)
5328 		off = c_dissect_blob(tree, hf_msg_poolopreply_datai,
5329 				     hf_msg_poolopreply_data, hf_msg_poolopreply_data_size,
5330 				     tvb, off);
5331 
5332 	c_append_text(data, ti, ", Response Code: %"G_GINT32_MODIFIER"u", code);
5333 
5334 	return off;
5335 }
5336 
5337 /** Pool Op 0x0031
5338  * Why this is a higher value than the reply?  Who knows?
5339  */
5340 static
c_dissect_msg_poolop(proto_tree * root,tvbuff_t * tvb,guint front_len,guint middle_len _U_,guint data_len _U_,c_pkt_data * data)5341 guint c_dissect_msg_poolop(proto_tree *root,
5342 			   tvbuff_t *tvb,
5343 			   guint front_len, guint middle_len _U_, guint data_len _U_,
5344 			   c_pkt_data *data)
5345 {
5346 	proto_item *ti;
5347 	proto_tree *tree;
5348 	guint off = 0;
5349 	gint32 pool;
5350 	c_poolop_type type;
5351 	c_str name;
5352 
5353 	/* ceph:/src/messages/MPoolOp.h */
5354 
5355 	c_set_type(data, "Pool Operation");
5356 
5357 	off = c_dissect_paxos(root, tvb, off, data);
5358 
5359 	ti = proto_tree_add_item(root, hf_msg_poolop, tvb, off, front_len, ENC_NA);
5360 	tree = proto_item_add_subtree(ti, ett_msg_poolop);
5361 
5362 	proto_tree_add_item(tree, hf_msg_poolop_fsid,
5363 			    tvb, off, 16, ENC_BIG_ENDIAN);
5364 	off += 16;
5365 
5366 	pool = tvb_get_letohl(tvb, off);
5367 	proto_tree_add_item(tree, hf_msg_poolop_pool,
5368 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
5369 	off += 4;
5370 
5371 	if (data->header.ver < 2)
5372 		off = c_dissect_str(tree, hf_msg_poolop_name, &name, tvb, off);
5373 
5374 	type = (c_poolop_type)tvb_get_letohl(tvb, off);
5375 	proto_tree_add_item(tree, hf_msg_poolop_type,
5376 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
5377 	off += 4;
5378 
5379 	proto_tree_add_item(tree, hf_msg_poolop_auid,
5380 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
5381 	off += 8;
5382 
5383 	proto_tree_add_item(tree, hf_msg_poolop_snapid,
5384 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
5385 	off += 8;
5386 
5387 	if (data->header.ver >= 2)
5388 		off = c_dissect_str(tree, hf_msg_poolop_name, &name, tvb, off);
5389 
5390 	if (data->header.ver >= 4)
5391 	{
5392 		off += 1; /* Skip padding byte. */
5393 		proto_tree_add_item(tree, hf_msg_poolop_crush_rule,
5394 				    tvb, off, 2, ENC_LITTLE_ENDIAN);
5395 		off += 2;
5396 	}
5397 	else if (data->header.ver == 3)
5398 	{
5399 		proto_tree_add_item(tree, hf_msg_poolop_crush_rule8,
5400 				    tvb, off, 1, ENC_LITTLE_ENDIAN);
5401 		off += 1;
5402 	}
5403 
5404 	c_append_text(data, ti,
5405 		      ", Type: %s, Name: %s, Pool: %"G_GINT32_MODIFIER"d",
5406 		      c_poolop_type_string(type),
5407 		      name.str,
5408 		      pool);
5409 
5410 	return off;
5411 }
5412 
5413 /** Monitor Command 0x0032 */
5414 static
c_dissect_msg_mon_cmd(proto_tree * root,tvbuff_t * tvb,guint front_len,guint middle_len _U_,guint data_len _U_,c_pkt_data * data)5415 guint c_dissect_msg_mon_cmd(proto_tree *root,
5416 			    tvbuff_t *tvb,
5417 			    guint front_len, guint middle_len _U_, guint data_len _U_,
5418 			    c_pkt_data *data)
5419 {
5420 	proto_item *ti;
5421 	proto_tree *tree, *subtree;
5422 	guint off = 0;
5423 	guint32 i;
5424 	c_str str;
5425 
5426 	/* ceph:/src/messages/MMonCommand.h */
5427 
5428 	c_set_type(data, "Mon Command");
5429 
5430 	off = c_dissect_paxos(root, tvb, off, data);
5431 
5432 	ti = proto_tree_add_item(root, hf_msg_mon_cmd, tvb, off, front_len, ENC_NA);
5433 	tree = proto_item_add_subtree(ti, ett_msg_mon_cmd);
5434 
5435 	proto_tree_add_item(tree, hf_msg_mon_cmd_fsid,
5436 			    tvb, off, 16, ENC_BIG_ENDIAN);
5437 	off += 16;
5438 
5439 	i = tvb_get_letohl(tvb, off);
5440 	proto_tree_add_item(tree, hf_msg_mon_cmd_arg_len,
5441 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
5442 	off += 4;
5443 	while (i--)
5444 	{
5445 		ti = proto_tree_add_item(tree, hf_msg_mon_cmd_arg,
5446 					 tvb, off, -1, ENC_NA);
5447 		subtree = proto_item_add_subtree(ti, ett_msg_mon_cmd_arg);
5448 
5449 		off = c_dissect_str(subtree, hf_msg_mon_cmd_str, &str, tvb, off);
5450 
5451 		c_append_text(data, ti, " %s", str.str);
5452 
5453 		proto_item_set_end(ti, tvb, off);
5454 	}
5455 
5456 	return off;
5457 }
5458 
5459 /** Mon Command ACK 0x0033 */
5460 static
c_dissect_msg_mon_cmd_ack(proto_tree * root,tvbuff_t * tvb,guint front_len,guint middle_len _U_,guint data_len,c_pkt_data * data)5461 guint c_dissect_msg_mon_cmd_ack(proto_tree *root,
5462 				tvbuff_t *tvb,
5463 				guint front_len, guint middle_len _U_, guint data_len,
5464 				c_pkt_data *data)
5465 {
5466 	proto_item *ti;
5467 	proto_tree *tree, *subtree;
5468 	guint off = 0;
5469 	guint32 i;
5470 
5471 	/* ceph:/src/messages/MMonCommandAck.h */
5472 
5473 	c_set_type(data, "Mon Command Result");
5474 
5475 	off = c_dissect_paxos(root, tvb, off, data);
5476 
5477 	ti = proto_tree_add_item(root, hf_msg_mon_cmd_ack,
5478 				 tvb, off, front_len+data_len, ENC_NA);
5479 	tree = proto_item_add_subtree(ti, ett_msg_mon_cmdack);
5480 
5481 	proto_tree_add_item(tree, hf_msg_mon_cmd_ack_code,
5482 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
5483 	off += 4;
5484 	off = c_dissect_str(tree, hf_msg_mon_cmd_ack_res, NULL, tvb, off);
5485 
5486 	i = tvb_get_letohl(tvb, off);
5487 	proto_tree_add_item(tree, hf_msg_mon_cmd_ack_arg_len,
5488 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
5489 	off += 4;
5490 	while (i--)
5491 	{
5492 		ti = proto_tree_add_item(tree, hf_msg_mon_cmd_ack_arg, tvb, off, -1, ENC_NA);
5493 		subtree = proto_item_add_subtree(ti, ett_msg_mon_cmdack_arg);
5494 
5495 		off = c_dissect_str(subtree, hf_msg_mon_cmd_ack_arg_str, NULL,
5496 				    tvb, off);
5497 
5498 		proto_item_set_end(ti, tvb, off);
5499 	}
5500 
5501 	c_warn_size(tree, tvb, off, front_len, data);
5502 
5503 	proto_tree_add_item(tree, hf_msg_mon_cmd_ack_data,
5504 			    tvb, front_len, data_len, ENC_UTF_8|ENC_NA);
5505 
5506 	return front_len+data_len;
5507 }
5508 
5509 /** Get Pool Stats 0x003A */
5510 static
c_dissect_msg_poolstats(proto_tree * root,tvbuff_t * tvb,guint front_len,guint middle_len _U_,guint data_len _U_,c_pkt_data * data)5511 guint c_dissect_msg_poolstats(proto_tree *root,
5512 			      tvbuff_t *tvb,
5513 			      guint front_len, guint middle_len _U_, guint data_len _U_,
5514 			      c_pkt_data *data)
5515 {
5516 	proto_item *ti;
5517 	proto_tree *tree;
5518 	guint off = 0;
5519 	guint32 i;
5520 	c_str str;
5521 
5522 	/* ceph:/src/messages/MGetPoolStats.h */
5523 
5524 	c_set_type(data, "Pool Stats");
5525 
5526 	off = c_dissect_paxos(root, tvb, off, data);
5527 
5528 	ti = proto_tree_add_item(root, hf_msg_poolstats, tvb, off, front_len, ENC_NA);
5529 	tree = proto_item_add_subtree(ti, ett_msg_poolstats);
5530 
5531 	c_append_text(data, ti, ", For: ");
5532 
5533 	proto_tree_add_item(tree, hf_msg_poolstats_fsid,
5534 			    tvb, off, 16, ENC_BIG_ENDIAN);
5535 	off += 16;
5536 
5537 	i = tvb_get_letohl(tvb, off);
5538 	off += 4;
5539 	while (i--)
5540 	{
5541 		off = c_dissect_str(tree, hf_msg_poolstats_pool, &str, tvb, off);
5542 		c_append_text(data, ti, "%s%s", str.str, i? ",":" ");
5543 	}
5544 
5545 	return off;
5546 }
5547 
5548 /** Pool Stats Reply 0x003B */
5549 static
c_dissect_msg_poolstatsreply(proto_tree * root,tvbuff_t * tvb,guint front_len,guint middle_len _U_,guint data_len _U_,c_pkt_data * data)5550 guint c_dissect_msg_poolstatsreply(proto_tree *root,
5551 				   tvbuff_t *tvb,
5552 				   guint front_len, guint middle_len _U_, guint data_len _U_,
5553 				   c_pkt_data *data)
5554 {
5555 	proto_item *ti, *ti2;
5556 	proto_tree *tree, *subtree;
5557 	guint off = 0;
5558 	guint32 i;
5559 	c_str str;
5560 	c_encoded encstat;
5561 
5562 	/* ceph:/src/messages/MGetPoolStatsReply.h */
5563 
5564 	c_set_type(data, "Pool Stats Reply");
5565 
5566 	off = c_dissect_paxos(root, tvb, off, data);
5567 
5568 	ti = proto_tree_add_item(root, hf_msg_poolstatsreply, tvb, off, front_len, ENC_NA);
5569 	tree = proto_item_add_subtree(ti, ett_msg_poolstatsreply);
5570 
5571 	c_append_text(data, ti, ", For: ");
5572 
5573 	proto_tree_add_item(tree, hf_msg_poolstatsreply_fsid,
5574 			    tvb, off, 16, ENC_BIG_ENDIAN);
5575 	off += 16;
5576 
5577 	i = tvb_get_letohl(tvb, off);
5578 	off += 4;
5579 	while (i--)
5580 	{
5581 		ti2 = proto_tree_add_item(tree, hf_msg_poolstatsreply_stat,
5582 					  tvb, off, -1, ENC_NA);
5583 		subtree = proto_item_add_subtree(ti2, ett_msg_poolstatsreply_stat);
5584 
5585 		off = c_dissect_str(subtree, hf_msg_poolstatsreply_pool, &str, tvb, off);
5586 		c_append_text(data, ti, "%s%s", str.str, i? ",":" ");
5587 		proto_item_append_text(ti2, ", For: %s", str.str);
5588 
5589 		/*** pool_stat_t from ceph:/src/osd/osd_types.h ***/
5590 		off = c_dissect_encoded(subtree, &encstat, 5, 5, tvb, off, data);
5591 
5592 		off = c_dissect_statcollection(subtree, hf_msg_poolstatsreply_pool, tvb, off, data);
5593 
5594 		proto_tree_add_item(subtree, hf_msg_poolstatsreply_log_size,
5595 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
5596 		off += 8;
5597 		proto_tree_add_item(subtree, hf_msg_poolstatsreply_log_size_ondisk,
5598 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
5599 		off += 8;
5600 		/*** END pool_stat_t ***/
5601 		c_warn_size(subtree, tvb, off, encstat.end, data);
5602 		off = encstat.end;
5603 	}
5604 
5605 	return off;
5606 }
5607 
5608 /** Monitor Global ID 0x003C */
5609 static
c_dissect_msg_mon_globalid(proto_tree * root,tvbuff_t * tvb,guint front_len _U_,guint middle_len _U_,guint data_len _U_,c_pkt_data * data)5610 guint c_dissect_msg_mon_globalid(proto_tree *root,
5611 				 tvbuff_t *tvb,
5612 				 guint front_len _U_, guint middle_len _U_, guint data_len _U_,
5613 				 c_pkt_data *data)
5614 {
5615 	guint off = 0;
5616 
5617 	/* ceph:/src/messages/MMonGlobalID.h */
5618 
5619 	c_set_type(data, "Mon Global ID");
5620 
5621 	off = c_dissect_paxos(root, tvb, off, data);
5622 	proto_tree_add_item(root, hf_msg_mon_globalid_max,
5623 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
5624 	off += 8;
5625 
5626 	return off;
5627 }
5628 
5629 /** Monitor Election 0x0041 */
5630 static
c_dissect_msg_mon_election(proto_tree * root,tvbuff_t * tvb,guint front_len,guint middle_len _U_,guint data_len _U_,c_pkt_data * data)5631 guint c_dissect_msg_mon_election(proto_tree *root,
5632 				 tvbuff_t *tvb,
5633 				 guint front_len, guint middle_len _U_, guint data_len _U_,
5634 				 c_pkt_data *data)
5635 {
5636 	proto_item *ti;
5637 	proto_tree *tree;
5638 	guint off = 0;
5639 	guint32 i;
5640 	c_mon_election_type type;
5641 
5642 	/* ceph:/src/messages/MMonElection.h */
5643 
5644 	c_set_type(data, "Mon Election");
5645 
5646 	ti = proto_tree_add_item(root, hf_msg_mon_election,
5647 			    tvb, off, front_len, ENC_NA);
5648 	tree = proto_item_add_subtree(ti, ett_msg_mon_election);
5649 
5650 	proto_tree_add_item(tree, hf_msg_mon_election_fsid,
5651 			    tvb, off, 16, ENC_BIG_ENDIAN);
5652 	off += 16;
5653 
5654 	type = (c_mon_election_type)tvb_get_letohl(tvb, off);
5655 	proto_tree_add_item(tree, hf_msg_mon_election_op,
5656 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
5657 	off += 4;
5658 
5659 	proto_tree_add_item(tree, hf_msg_mon_election_epoch,
5660 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
5661 	off += 4;
5662 
5663 	off = c_dissect_monmap(tree, tvb, off, data);
5664 
5665 	i = tvb_get_letohl(tvb, off);
5666 	off += 4;
5667 	while (i--)
5668 	{
5669 		proto_tree_add_item(tree, hf_msg_mon_election_quorum,
5670 				    tvb, off, 4, ENC_LITTLE_ENDIAN);
5671 		off += 4;
5672 	}
5673 
5674 	proto_tree_add_item(tree, hf_msg_mon_election_quorum_features,
5675 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
5676 	off += 8;
5677 
5678 	proto_tree_add_item(tree, hf_msg_mon_election_defunct_one,
5679 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
5680 	off += 8;
5681 	proto_tree_add_item(tree, hf_msg_mon_election_defunct_two,
5682 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
5683 	off += 8;
5684 
5685 	off = c_dissect_blob(tree, hf_msg_mon_election_sharing,
5686 			     hf_msg_mon_election_sharing_data, hf_msg_mon_election_sharing_size,
5687 			     tvb, off);
5688 
5689 	c_append_text(data, ti, ", Operation: %s", c_mon_election_type_string(type));
5690 
5691 	return off;
5692 }
5693 
5694 /** Monitor Paxos 0x0042 */
5695 static
c_dissect_msg_mon_paxos(proto_tree * root,tvbuff_t * tvb,guint front_len,guint middle_len _U_,guint data_len _U_,c_pkt_data * data)5696 guint c_dissect_msg_mon_paxos(proto_tree *root,
5697 			      tvbuff_t *tvb,
5698 			      guint front_len, guint middle_len _U_, guint data_len _U_,
5699 			      c_pkt_data *data)
5700 {
5701 	proto_item *ti;
5702 	proto_tree *tree;
5703 	guint off = 0;
5704 	guint32 i;
5705 	guint64 pn;
5706 	c_mon_paxos_op op;
5707 
5708 	/* ceph:/src/messages/MMonPaxos.h */
5709 
5710 	c_set_type(data, "Mon Paxos");
5711 
5712 	ti = proto_tree_add_item(root, hf_msg_mon_paxos, tvb, off, front_len, ENC_NA);
5713 	tree = proto_item_add_subtree(ti, ett_msg_mon_paxos);
5714 
5715 	proto_tree_add_item(tree, hf_msg_mon_paxos_epoch,
5716 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
5717 	off += 4;
5718 
5719 	op = (c_mon_paxos_op)tvb_get_letohl(tvb, off);
5720 	proto_tree_add_item(tree, hf_msg_mon_paxos_op,
5721 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
5722 	off += 4;
5723 
5724 	proto_tree_add_item(tree, hf_msg_mon_paxos_first,
5725 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
5726 	off += 8;
5727 
5728 	proto_tree_add_item(tree, hf_msg_mon_paxos_last,
5729 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
5730 	off += 8;
5731 
5732 	proto_tree_add_item(tree, hf_msg_mon_paxos_pnfrom,
5733 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
5734 	off += 8;
5735 
5736 	pn = tvb_get_letoh64(tvb, off);
5737 	proto_tree_add_item(tree, hf_msg_mon_paxos_pn,
5738 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
5739 	off += 8;
5740 
5741 	proto_tree_add_item(tree, hf_msg_mon_paxos_pnuncommitted,
5742 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
5743 	off += 8;
5744 
5745 	proto_tree_add_item(tree, hf_msg_mon_paxos_lease,
5746 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
5747 	off += 8;
5748 
5749 	if (data->header.ver >= 1)
5750 	{
5751 		proto_tree_add_item(tree, hf_msg_mon_paxos_sent,
5752 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
5753 		off += 8;
5754 	}
5755 
5756 	proto_tree_add_item(tree, hf_msg_mon_paxos_latest_ver,
5757 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
5758 	off += 8;
5759 
5760 	off = c_dissect_blob(tree, hf_msg_mon_paxos_latest_val,
5761 			     hf_msg_mon_paxos_latest_val_data,
5762 			     hf_msg_mon_paxos_latest_val_size,
5763 			     tvb, off);
5764 
5765 	i = tvb_get_letohl(tvb, off);
5766 	off += 4;
5767 	while (i--)
5768 	{
5769 		proto_item *ti2;
5770 		proto_tree *subtree;
5771 		guint64 ver;
5772 
5773 		ti2 = proto_tree_add_item(tree, hf_msg_mon_paxos_value, tvb, off, -1, ENC_NA);
5774 		subtree = proto_item_add_subtree(ti2, ett_msg_mon_paxos_value);
5775 
5776 		ver = tvb_get_letoh64(tvb, off);
5777 		proto_tree_add_item(subtree, hf_msg_mon_paxos_ver,
5778 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
5779 		off += 8;
5780 
5781 		off = c_dissect_blob(subtree, hf_msg_mon_paxos_val,
5782 				     hf_msg_mon_paxos_val_data, hf_msg_mon_paxos_val_size,
5783 				     tvb, off);
5784 
5785 		proto_item_append_text(ti2, ", Version: %"G_GINT64_MODIFIER"u", ver);
5786 		proto_item_set_end(ti2, tvb, off);
5787 	}
5788 
5789 	c_append_text(data, ti, ", Op: %s, Proposal Number: %"G_GINT64_MODIFIER"u",
5790 		      c_mon_paxos_op_string(op), pn);
5791 
5792 	return off;
5793 }
5794 
5795 /** Monitor Probe 0x0043 */
5796 static
c_dissect_msg_mon_probe(proto_tree * root,tvbuff_t * tvb,guint front_len,guint middle_len _U_,guint data_len _U_,c_pkt_data * data)5797 guint c_dissect_msg_mon_probe(proto_tree *root,
5798 			     tvbuff_t *tvb,
5799 			     guint front_len, guint middle_len _U_, guint data_len _U_,
5800 			     c_pkt_data *data)
5801 {
5802 	proto_item *ti;
5803 	proto_tree *tree;
5804 	guint off = 0;
5805 	guint32 i;
5806 	c_mon_probe_type type;
5807 	c_str name;
5808 
5809 	/* ceph:/src/messages/MMonProbe.h */
5810 
5811 	c_set_type(data, "Mon Probe");
5812 
5813 	ti = proto_tree_add_item(root, hf_msg_mon_probe, tvb, off, front_len, ENC_NA);
5814 	tree = proto_item_add_subtree(ti, ett_msg_mon_probe);
5815 
5816 	proto_tree_add_item(tree, hf_msg_mon_probe_fsid,
5817 			    tvb, off, 16, ENC_BIG_ENDIAN);
5818 	off += 16;
5819 
5820 	type = (c_mon_probe_type)tvb_get_letohl(tvb, off);
5821 	proto_tree_add_item(tree, hf_msg_mon_probe_type,
5822 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
5823 	off += 4;
5824 
5825 	off = c_dissect_str(tree, hf_msg_mon_probe_name, &name, tvb, off);
5826 
5827 	i = tvb_get_letohl(tvb, off);
5828 	off += 4;
5829 	while (i--)
5830 	{
5831 		proto_tree_add_item(tree, hf_msg_mon_probe_quorum,
5832 				    tvb, off, 4, ENC_LITTLE_ENDIAN);
5833 		off += 4;
5834 	}
5835 
5836 	off = c_dissect_monmap(tree, tvb, off, data);
5837 
5838 	proto_tree_add_item(tree, hf_msg_mon_probe_ever_joined,
5839 			    tvb, off, 1, ENC_LITTLE_ENDIAN);
5840 	off += 1;
5841 	proto_tree_add_item(tree, hf_msg_mon_probe_paxos_first_ver,
5842 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
5843 	off += 8;
5844 	proto_tree_add_item(tree, hf_msg_mon_probe_paxos_last_ver,
5845 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
5846 	off += 8;
5847 
5848 	if (data->header.ver >= 6)
5849 	{
5850 		proto_tree_add_item(tree, hf_msg_mon_probe_req_features,
5851 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
5852 		off += 8;
5853 	}
5854 
5855 	c_append_text(data, ti, ", Type: %s, Name: %s",
5856 		      c_mon_probe_type_string(type),
5857 		      name.str);
5858 
5859 	return off;
5860 }
5861 
5862 /** OSD Ping (0x0046) */
5863 static
c_dissect_msg_osd_ping(proto_tree * root,tvbuff_t * tvb,guint front_len,guint middle_len _U_,guint data_len _U_,c_pkt_data * data)5864 guint c_dissect_msg_osd_ping(proto_tree *root,
5865 			     tvbuff_t *tvb,
5866 			     guint front_len, guint middle_len _U_, guint data_len _U_,
5867 			     c_pkt_data *data)
5868 {
5869 	proto_item *ti;
5870 	proto_tree *tree;
5871 	guint off = 0;
5872 	c_osd_ping_op op;
5873 
5874 	/* ceph:/src/messages/MOSDPing.h */
5875 
5876 	c_set_type(data, "OSD Ping");
5877 
5878 	ti = proto_tree_add_item(root, hf_msg_osd_ping, tvb, off, front_len, ENC_NA);
5879 	tree = proto_item_add_subtree(ti, ett_msg_osd_ping);
5880 
5881 	proto_tree_add_item(tree, hf_msg_osd_ping_fsid,
5882 			    tvb, off, 16, ENC_BIG_ENDIAN);
5883 	off += 16;
5884 
5885 	proto_tree_add_item(tree, hf_msg_osd_ping_mapepoch,
5886 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
5887 	off += 4;
5888 
5889 	proto_tree_add_item(tree, hf_msg_osd_ping_peerepoch,
5890 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
5891 	off += 4;
5892 
5893 	op = (c_osd_ping_op)tvb_get_guint8(tvb, off);
5894 	proto_tree_add_item(tree, hf_msg_osd_ping_op,
5895 			    tvb, off, 1, ENC_LITTLE_ENDIAN);
5896 	off += 1;
5897 
5898 	off = c_dissect_osd_peerstat(tree, tvb, off, data);
5899 
5900 	if (data->header.ver >= 2)
5901 	{
5902 		proto_tree_add_item(tree, hf_msg_osd_ping_time,
5903 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
5904 		off += 8;
5905 	}
5906 
5907 	c_append_text(data, ti, ", Operation: %s", c_osd_ping_op_string(op));
5908 	return off;
5909 }
5910 
5911 /** OSD Boot (0x0047) */
5912 static
c_dissect_msg_osd_boot(proto_tree * root,tvbuff_t * tvb,guint front_len,guint middle_len _U_,guint data_len _U_,c_pkt_data * data)5913 guint c_dissect_msg_osd_boot(proto_tree *root,
5914 			     tvbuff_t *tvb,
5915 			     guint front_len, guint middle_len _U_, guint data_len _U_,
5916 			     c_pkt_data *data)
5917 {
5918 	proto_item *ti;
5919 	proto_tree *tree;
5920 	guint off = 0;
5921 	guint32 i;
5922 
5923 	/* ceph:/src/messages/MOSDBoot.h */
5924 
5925 	c_set_type(data, "OSD Boot");
5926 
5927 	off = c_dissect_paxos(root, tvb, off, data);
5928 
5929 	ti = proto_tree_add_item(root, hf_msg_osd_boot, tvb, off, front_len, ENC_NA);
5930 	tree = proto_item_add_subtree(ti, ett_msg_osd_boot);
5931 
5932 	off = c_dissect_osd_superblock(tree, tvb, off, data);
5933 
5934 	off = c_dissect_entityaddr(tree, hf_msg_osd_boot_addr_back, NULL, tvb, off);
5935 
5936 	if (data->header.ver >= 2)
5937 	{
5938 		off = c_dissect_entityaddr(tree, hf_msg_osd_boot_addr_cluster, NULL, tvb, off);
5939 	}
5940 	if (data->header.ver >= 3)
5941 	{
5942 		proto_tree_add_item(tree, hf_msg_osd_boot_epoch,
5943 				    tvb, off, 4, ENC_LITTLE_ENDIAN);
5944 		off += 4;
5945 	}
5946 	if (data->header.ver >= 4)
5947 	{
5948 		off = c_dissect_entityaddr(tree, hf_msg_osd_boot_addr_front, NULL, tvb, off);
5949 	}
5950 	if (data->header.ver >= 5)
5951 	{
5952 		i = tvb_get_letohl(tvb, off);
5953 		off += 4;
5954 		while (i--)
5955 		{
5956 			off = c_dissect_kv(tree, hf_msg_osd_boot_metadata,
5957 					   hf_msg_osd_boot_metadata_k, hf_msg_osd_boot_metadata_v,
5958 					   tvb, off);
5959 		}
5960 	}
5961 
5962 	return off;
5963 }
5964 
5965 /** PG Stats (0x0057) */
5966 static
c_dissect_msg_pgstats(proto_tree * root,tvbuff_t * tvb,guint front_len,guint middle_len _U_,guint data_len _U_,c_pkt_data * data)5967 guint c_dissect_msg_pgstats(proto_tree *root,
5968 			    tvbuff_t *tvb,
5969 			    guint front_len, guint middle_len _U_, guint data_len _U_,
5970 			    c_pkt_data *data)
5971 {
5972 	proto_item *ti;
5973 	proto_tree *tree;
5974 	guint off = 0;
5975 	guint32 i;
5976 
5977 	/* ceph:/src/messages/MPGStats.h */
5978 
5979 	c_set_type(data, "PG Stats");
5980 
5981 	off = c_dissect_paxos(root, tvb, off, data);
5982 
5983 	ti = proto_tree_add_item(root, hf_msg_pgstats, tvb, off, front_len, ENC_NA);
5984 	tree = proto_item_add_subtree(ti, ett_msg_pgstats);
5985 
5986 	proto_tree_add_item(tree, hf_msg_pgstats_fsid,
5987 			    tvb, off, 16, ENC_LITTLE_ENDIAN);
5988 	off += 16;
5989 
5990 	off = c_dissect_osd_stat(tree, tvb, off, data);
5991 
5992 	i = tvb_get_letohl(tvb, off);
5993 	off += 4;
5994 	while (i--)
5995 	{
5996 		proto_item *ti2;
5997 		proto_tree *subtree;
5998 
5999 		ti2 = proto_tree_add_item(tree, hf_msg_pgstats_pgstat, tvb, off, -1, ENC_NA);
6000 		subtree = proto_item_add_subtree(ti2, ett_msg_pgstats_pgstat);
6001 
6002 		off = c_dissect_pg(subtree, hf_msg_pgstats_pgstat_pg, tvb, off, data);
6003 		off = c_dissect_pg_stats(subtree, hf_msg_pgstats_pgstat_stat, tvb, off, data);
6004 
6005 		proto_item_set_end(ti2, tvb, off);
6006 	}
6007 
6008 	proto_tree_add_item(tree, hf_msg_pgstats_epoch,
6009 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
6010 	off += 4;
6011 
6012 	proto_tree_add_item(tree, hf_msg_pgstats_mapfor,
6013 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
6014 	off += 8;
6015 
6016 	return off;
6017 }
6018 
6019 /** OSD PG Create (0x0059) */
6020 static
c_dissect_msg_osd_pg_create(proto_tree * root,tvbuff_t * tvb,guint front_len,guint middle_len _U_,guint data_len _U_,c_pkt_data * data)6021 guint c_dissect_msg_osd_pg_create(proto_tree *root,
6022 				  tvbuff_t *tvb,
6023 				  guint front_len, guint middle_len _U_, guint data_len _U_,
6024 				  c_pkt_data *data)
6025 {
6026 	proto_item *ti;
6027 	proto_tree *tree;
6028 	guint off = 0;
6029 	guint32 i;
6030 
6031 	/* ceph:/src/messages/MOSDPGCreate.h */
6032 
6033 	c_set_type(data, "OSD PG Create");
6034 
6035 	ti = proto_tree_add_item(root, hf_msg_osd_pg_create, tvb, off, front_len, ENC_NA);
6036 	tree = proto_item_add_subtree(ti, ett_msg_osd_pg_create);
6037 
6038 	proto_tree_add_item(tree, hf_msg_osd_pg_create_epoch,
6039 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
6040 	off += 8;
6041 
6042 	i = tvb_get_letohl(tvb, off);
6043 	off += 4;
6044 	while (i--)
6045 	{
6046 		proto_item *ti2;
6047 		proto_tree *subtree;
6048 
6049 		ti2 = proto_tree_add_item(tree, hf_msg_osd_pg_create_mkpg,
6050 					  tvb, off, -1, ENC_NA);
6051 		subtree = proto_item_add_subtree(ti2, ett_msg_osd_pg_create_mkpg);
6052 
6053 		off = c_dissect_pg(subtree, hf_msg_osd_pg_create_mkpg_pg, tvb, off, data);
6054 		off = c_dissect_pg_create(subtree, hf_msg_osd_pg_create_mkpg_create, tvb, off, data);
6055 
6056 		proto_item_set_end(ti2, tvb, off);
6057 	}
6058 
6059 	return off;
6060 }
6061 
6062 /** Client Caps 0x0310 */
6063 static
c_dissect_msg_client_caps(proto_tree * root,tvbuff_t * tvb,guint front_len,guint middle_len,guint data_len _U_,c_pkt_data * data)6064 guint c_dissect_msg_client_caps(proto_tree *root,
6065 				tvbuff_t *tvb,
6066 				guint front_len, guint middle_len, guint data_len _U_,
6067 				c_pkt_data *data)
6068 {
6069 	proto_item *ti;
6070 	proto_tree *tree;
6071 	guint off = 0;
6072 	c_cap_op_type op;
6073 	guint64 inode, relam;
6074 	guint32 snap_trace_len, xattr_len;
6075 
6076 	/* ceph:/src/messages/MClientCaps.h */
6077 
6078 	c_set_type(data, "Client Capabilities");
6079 
6080 	ti = proto_tree_add_item(root, hf_msg_client_caps, tvb, off, front_len, ENC_NA);
6081 	tree = proto_item_add_subtree(ti, ett_msg_client_caps);
6082 
6083 	op = (c_cap_op_type)tvb_get_letohl(tvb, off);
6084 	proto_tree_add_item(tree, hf_msg_client_caps_op,
6085 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
6086 	off += 4;
6087 
6088 	inode = tvb_get_letoh64(tvb, off);
6089 	proto_tree_add_item(tree, hf_msg_client_caps_inode,
6090 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
6091 	off += 8;
6092 
6093 	relam = tvb_get_letoh64(tvb, off);
6094 	proto_tree_add_item(tree, hf_msg_client_caps_relam,
6095 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
6096 	off += 8;
6097 
6098 	proto_tree_add_item(tree, hf_msg_client_caps_cap_id,
6099 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
6100 	off += 8;
6101 
6102 	proto_tree_add_item(tree, hf_msg_client_caps_seq,
6103 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
6104 	off += 4;
6105 
6106 	proto_tree_add_item(tree, hf_msg_client_caps_seq_issue,
6107 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
6108 	off += 4;
6109 
6110 	proto_tree_add_item(tree, hf_msg_client_caps_new,
6111 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
6112 	off += 4;
6113 
6114 	proto_tree_add_item(tree, hf_msg_client_caps_wanted,
6115 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
6116 	off += 4;
6117 
6118 	proto_tree_add_item(tree, hf_msg_client_caps_dirty,
6119 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
6120 	off += 4;
6121 
6122 	proto_tree_add_item(tree, hf_msg_client_caps_seq_migrate,
6123 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
6124 	off += 4;
6125 
6126 	proto_tree_add_item(tree, hf_msg_client_caps_snap_follows,
6127 			    tvb, off, 8, ENC_BIG_ENDIAN);
6128 	off += 8;
6129 
6130 	snap_trace_len = tvb_get_letohl(tvb, off);
6131 	off += 4;
6132 
6133 	proto_tree_add_item(tree, hf_msg_client_caps_uid,
6134 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
6135 	off += 4;
6136 
6137 	proto_tree_add_item(tree, hf_msg_client_caps_gid,
6138 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
6139 	off += 4;
6140 
6141 	proto_tree_add_item(tree, hf_msg_client_caps_mode,
6142 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
6143 	off += 4;
6144 
6145 	proto_tree_add_item(tree, hf_msg_client_caps_nlink,
6146 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
6147 	off += 4;
6148 
6149 	xattr_len = tvb_get_letohl(tvb, off);
6150 	off += 4;
6151 
6152 	proto_tree_add_item(tree, hf_msg_client_caps_xattr_ver,
6153 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
6154 	off += 8;
6155 
6156 	off += 84; /* @TODO: Union. */
6157 
6158 	proto_tree_add_item(tree, hf_msg_client_caps_snap,
6159 			    tvb, off, snap_trace_len, ENC_NA);
6160 	off += snap_trace_len;
6161 
6162 	if (data->header.ver >= 2)
6163 	{
6164 		off = c_dissect_data(tree, hf_msg_client_caps_flock, tvb, off);
6165 	}
6166 
6167 	if (data->header.ver >= 3 && op == C_CAP_OP_IMPORT)
6168 	{
6169 		/* ceph:/src/include/ceph_fs.h
6170 		struct ceph_mds_cap_peer {
6171 			__le64 cap_id;
6172 			__le32 seq;
6173 			__le32 mseq;
6174 			__le32 mds;
6175 			__u8   flags;
6176 		} __attribute__ ((packed));
6177 		*/
6178 		/* @TODO: Parse this. */
6179 		off += 21;
6180 	}
6181 
6182 	if (data->header.ver >= 4)
6183 	{
6184 		proto_tree_add_item(tree, hf_msg_client_caps_inline_ver,
6185 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
6186 		off += 8;
6187 		off = c_dissect_data(tree, hf_msg_client_caps_inline_data, tvb, off);
6188 	}
6189 
6190 	c_warn_size(tree, tvb, off, front_len, data);
6191 	c_warn_size(tree, tvb, front_len+xattr_len, front_len+middle_len, data);
6192 
6193 	proto_tree_add_item(tree, hf_msg_client_caps_xattr,
6194 			    tvb, front_len, middle_len, ENC_NA);
6195 
6196 	proto_item_append_text(ti, ", Op: %s"
6197 			       ", Inode: 0x%016"G_GINT64_MODIFIER"X"
6198 			       ", Relam: 0x%"G_GINT64_MODIFIER"X",
6199 			       c_cap_op_type_string(op),
6200 			       inode, relam);
6201 
6202 	return front_len+middle_len;
6203 }
6204 
6205 /** Client Cap Release 0x0310 */
6206 static
c_dissect_msg_client_caprel(proto_tree * root,tvbuff_t * tvb,guint front_len,guint middle_len,guint data_len _U_,c_pkt_data * data)6207 guint c_dissect_msg_client_caprel(proto_tree *root,
6208 				  tvbuff_t *tvb,
6209 				  guint front_len, guint middle_len, guint data_len _U_,
6210 				  c_pkt_data *data)
6211 {
6212 	proto_item *ti;
6213 	proto_tree *tree, *subtree;
6214 	guint off = 0;
6215 	guint32 i;
6216 
6217 	/* ceph:/src/messages/MClientCapRelease.h */
6218 
6219 	c_set_type(data, "Client Cap Release");
6220 
6221 	ti = proto_tree_add_item(root, hf_msg_client_caprel, tvb, off, front_len, ENC_NA);
6222 	tree = proto_item_add_subtree(ti, ett_msg_client_caprel);
6223 
6224 	i = (c_cap_op_type)tvb_get_letohl(tvb, off);
6225 	proto_item_append_text(ti, ", Caps: %"G_GINT32_MODIFIER"u", i);
6226 	off += 4;
6227 	while (i--)
6228 	{
6229 		ti = proto_tree_add_item(tree, hf_msg_client_caprel_cap, tvb, off, -1, ENC_NA);
6230 		subtree = proto_item_add_subtree(ti, ett_msg_client_caprel_cap);
6231 
6232 		proto_tree_add_item(subtree, hf_msg_client_caprel_cap_inode,
6233 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
6234 		off += 8;
6235 
6236 		proto_tree_add_item(subtree, hf_msg_client_caprel_cap_id,
6237 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
6238 		off += 8;
6239 
6240 		proto_tree_add_item(subtree, hf_msg_client_caprel_cap_migrate,
6241 				    tvb, off, 4, ENC_LITTLE_ENDIAN);
6242 		off += 4;
6243 
6244 		proto_tree_add_item(subtree, hf_msg_client_caprel_cap_seq,
6245 				    tvb, off, 4, ENC_LITTLE_ENDIAN);
6246 		off += 4;
6247 
6248 		proto_item_set_end(ti, tvb, off);
6249 	}
6250 
6251 	return front_len+middle_len;
6252 }
6253 
6254 /** Time Check 0x0600 */
6255 static
c_dissect_msg_timecheck(proto_tree * root,tvbuff_t * tvb,guint front_len,guint middle_len _U_,guint data_len _U_,c_pkt_data * data)6256 guint c_dissect_msg_timecheck(proto_tree *root,
6257 			      tvbuff_t *tvb,
6258 			      guint front_len, guint middle_len _U_, guint data_len _U_,
6259 			      c_pkt_data *data)
6260 {
6261 	proto_item *ti;
6262 	proto_tree *tree;
6263 	guint off = 0;
6264 	guint32 i;
6265 	c_timecheck_op op;
6266 	guint64 epoch, round;
6267 
6268 	/* ceph:/src/messages/MTimeCheck.h */
6269 
6270 	c_set_type(data, "Time Check");
6271 
6272 	ti = proto_tree_add_item(root, hf_msg_timecheck, tvb, off, front_len, ENC_NA);
6273 	tree = proto_item_add_subtree(ti, ett_msg_timecheck);
6274 
6275 	op = (c_timecheck_op)tvb_get_letohl(tvb, off);
6276 	proto_tree_add_item(tree, hf_msg_timecheck_op,
6277 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
6278 	off += 4;
6279 
6280 	epoch = tvb_get_letoh64(tvb, off);
6281 	proto_tree_add_item(tree, hf_msg_timecheck_epoch,
6282 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
6283 	off += 8;
6284 
6285 	round = tvb_get_letoh64(tvb, off);
6286 	proto_tree_add_item(tree, hf_msg_timecheck_round,
6287 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
6288 	off += 8;
6289 
6290 	c_append_text(data, ti, ", Operation: %s, Epoch: %"G_GINT64_MODIFIER"u"
6291 		      ", Round: %"G_GINT64_MODIFIER"u",
6292 		      c_timecheck_op_string(op),
6293 		      epoch, round);
6294 
6295 	if (op == C_TIMECHECK_OP_PONG)
6296 	{
6297 		c_append_text(data, ti, ", Time: %s", c_format_timespec(tvb, off));
6298 		proto_tree_add_item(tree, hf_msg_timecheck_time,
6299 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
6300 	}
6301 	off += 8; /* Still in the message, but zeroed and meaningless. */
6302 
6303 	i = tvb_get_letohl(tvb, off);
6304 	off += 4;
6305 	while (i--)
6306 	{
6307 		proto_item *ti2;
6308 		proto_tree *subtree;
6309 		c_entityinst inst;
6310 		double skew;
6311 
6312 		ti2 = proto_tree_add_item(tree, hf_msg_timecheck_skew, tvb, off, -1, ENC_NA);
6313 		subtree = proto_item_add_subtree(ti2, ett_msg_timecheck_skew);
6314 
6315 		off = c_dissect_entityinst(subtree, hf_msg_timecheck_skew_node, &inst,
6316 					   tvb, off, data);
6317 
6318 		skew = tvb_get_letohieee_double(tvb, off);
6319 		proto_tree_add_item(subtree, hf_msg_timecheck_skew_skew,
6320 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
6321 		off += 8;
6322 
6323 		proto_item_append_text(ti2, ", Node: %s, Skew: %lf", inst.name.slug, skew);
6324 		proto_item_set_end(ti2, tvb, off);
6325 	}
6326 
6327 	i = tvb_get_letohl(tvb, off);
6328 	off += 4;
6329 	while (i--)
6330 	{
6331 		proto_item *ti2;
6332 		proto_tree *subtree;
6333 		c_entityinst inst;
6334 		double ping;
6335 
6336 		ti2 = proto_tree_add_item(tree, hf_msg_timecheck_latency, tvb, off, -1, ENC_NA);
6337 		subtree = proto_item_add_subtree(ti2, ett_msg_timecheck_latency);
6338 
6339 		off = c_dissect_entityinst(subtree, hf_msg_timecheck_latency_node, &inst,
6340 					   tvb, off, data);
6341 
6342 		ping = tvb_get_letohieee_double(tvb, off);
6343 		proto_tree_add_item(subtree, hf_msg_timecheck_latency_latency,
6344 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
6345 		off += 8;
6346 
6347 		proto_item_append_text(ti2, ", Node: %s, Latency: %lf", inst.name.slug, ping);
6348 		proto_item_set_end(ti2, tvb, off);
6349 	}
6350 
6351 	return off;
6352 }
6353 
6354 /*** MSGR Dissectors ***/
6355 
6356 #define C_OFF_HEAD0  0
6357 #define C_SIZE_HEAD0 ((64+64+16+16+16)/8)
6358 
6359 #define C_OFF_HEAD1  C_SIZE_HEAD0
6360 #define C_SIZE_HEAD1 ((32+32+32+16)/8)
6361 
6362 #define C_OFF_HEAD2  (C_OFF_HEAD1 + C_SIZE_HEAD1 + C_SIZE_ENTITY_NAME)
6363 #define C_SIZE_HEAD2 ((16+16+32)/8)
6364 
6365 #define C_SIZE_HEAD  (C_OFF_HEAD2 + C_SIZE_HEAD2)
6366 
6367 #define C_SIZE_FOOT  ((32+32+32+64+8)/8)
6368 
6369 /** Dissect a MSG message.
6370  *
6371  * These are Ceph's business messages and are generally sent to specific
6372  * node types.
6373  */
6374 static
c_dissect_msg(proto_tree * tree,tvbuff_t * tvb,guint off,c_pkt_data * data)6375 guint c_dissect_msg(proto_tree *tree,
6376 		    tvbuff_t *tvb, guint off, c_pkt_data *data)
6377 {
6378 	tvbuff_t *subtvb;
6379 	proto_item *ti;
6380 	proto_tree *subtree;
6381 	c_msg_type type;
6382 	guint32 front_len, middle_len, data_len;
6383 	guint size, parsedsize;
6384 
6385 	front_len  = tvb_get_letohl(tvb, off + C_OFF_HEAD1 + 0);
6386 	middle_len = tvb_get_letohl(tvb, off + C_OFF_HEAD1 + 4);
6387 	data_len   = tvb_get_letohl(tvb, off + C_OFF_HEAD1 + 8);
6388 
6389 	/*** Header ***/
6390 
6391 	/* From ceph:/src/include/msgr.h
6392 	struct ceph_msg_header {
6393 		__le64 seq;	  // message seq# for this session
6394 		__le64 tid;	  // transaction id
6395 		__le16 type;	  // message type
6396 		__le16 priority;  // priority.	higher value == higher priority
6397 		__le16 version;	  // version of message encoding
6398 
6399 		__le32 front_len; // bytes in main payload
6400 		__le32 middle_len;// bytes in middle payload
6401 		__le32 data_len;  // bytes of data payload
6402 		__le16 data_off;  // sender: include full offset; receiver: mask against ~PAGE_MASK
6403 
6404 		struct ceph_entity_name src;
6405 
6406 		// oldest code we think can decode this.  unknown if zero.
6407 		__le16 compat_version;
6408 		__le16 reserved;
6409 		__le32 crc; // header crc32c
6410 	} __attribute__ ((packed));
6411 	*/
6412 
6413 	ti = proto_tree_add_item(tree, hf_head, tvb, off, C_SIZE_HEAD, ENC_NA);
6414 	subtree = proto_item_add_subtree(ti, ett_head);
6415 
6416 	data->header.seq = tvb_get_letoh64(tvb, off);
6417 	proto_tree_add_item(subtree, hf_head_seq,
6418 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
6419 	off += 8;
6420 	data->header.tid = tvb_get_letoh64(tvb, off);
6421 	proto_tree_add_item(subtree, hf_head_tid,
6422 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
6423 	off += 8;
6424 
6425 	data->header.type = type = (c_msg_type)tvb_get_letohs(tvb, off);
6426 	proto_tree_add_item(subtree, hf_head_type,
6427 			    tvb, off, 2, ENC_LITTLE_ENDIAN);
6428 	off += 2;
6429 
6430 	data->header.priority = tvb_get_letohs(tvb, off);
6431 	proto_tree_add_item(subtree, hf_head_priority,
6432 			    tvb, off, 2, ENC_LITTLE_ENDIAN);
6433 	off += 2;
6434 	data->header.ver = tvb_get_letohs(tvb, off);
6435 	proto_tree_add_item(subtree, hf_head_version,
6436 			    tvb, off, 2, ENC_LITTLE_ENDIAN);
6437 	off += 2;
6438 
6439 	proto_tree_add_item(subtree, hf_head_front_size,
6440 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
6441 	off += 4;
6442 	proto_tree_add_item(subtree, hf_head_middle_size,
6443 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
6444 	off += 4;
6445 	proto_tree_add_item(subtree, hf_head_data_size,
6446 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
6447 	off += 4;
6448 	proto_tree_add_item(subtree, hf_head_data_off,
6449 			    tvb, off, 2, ENC_LITTLE_ENDIAN);
6450 	off += 2;
6451 
6452 	off = c_dissect_entityname(subtree, hf_head_srcname, &data->header.src,
6453 				   tvb, off, data);
6454 
6455 	/*** Copy the data to the state structure. ***/
6456 
6457 	/* Save memory by copying only if different, they are *usually* the same. */
6458 	if (!data->src->name.slug ||
6459 	    strcmp(data->src->name.slug, data->header.src.slug) != 0)
6460 		data->src->name.slug = wmem_strdup(wmem_file_scope(),
6461 						   data->header.src.slug);
6462 	if (!data->src->name.type_str ||
6463 	    strcmp(data->src->name.type_str, data->header.src.type_str) != 0)
6464 		data->src->name.type_str = wmem_strdup(wmem_file_scope(),
6465 						       data->header.src.type_str);
6466 
6467 	data->src->name.type = data->header.src.type;
6468 	data->src->name.id   = data->header.src.id;
6469 
6470 	proto_tree_add_item(subtree, hf_head_compat_version,
6471 			    tvb, off, 2, ENC_LITTLE_ENDIAN);
6472 	off += 2;
6473 	proto_tree_add_item(subtree, hf_head_reserved,
6474 			    tvb, off, 2, ENC_LITTLE_ENDIAN);
6475 	off += 2;
6476 	proto_tree_add_item(subtree, hf_head_crc,
6477 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
6478 	off += 4;
6479 
6480 	proto_item_append_text(ti, ", Type: %s, From: %s",
6481 			       c_msg_type_string(type),
6482 			       data->header.src.slug);
6483 	if (front_len ) proto_item_append_text(ti, ", Front Len: %d", front_len);
6484 	if (middle_len) proto_item_append_text(ti, ", Mid Len: %d",   middle_len);
6485 	if (data_len  ) proto_item_append_text(ti, ", Data Len: %d",  data_len);
6486 
6487 	/*** Body ***/
6488 
6489 	subtvb = tvb_new_subset_length(tvb, off, front_len+middle_len+data_len);
6490 
6491 	switch (type)
6492 	{
6493 #define C_CALL(name) name(tree, subtvb, front_len, middle_len, data_len, data)
6494 #define C_HANDLE(tag, name) case tag: parsedsize = C_CALL(name); break;
6495 
6496 	C_HANDLE(C_CEPH_MSG_PING,		    c_dissect_msg_ping)
6497 	C_HANDLE(C_CEPH_MSG_MON_MAP,		    c_dissect_msg_mon_map)
6498 	C_HANDLE(C_CEPH_MSG_STATFS,		    c_dissect_msg_statfs)
6499 	C_HANDLE(C_CEPH_MSG_STATFS_REPLY,	    c_dissect_msg_statfsreply)
6500 	C_HANDLE(C_CEPH_MSG_MON_SUBSCRIBE,	    c_dissect_msg_mon_sub)
6501 	C_HANDLE(C_CEPH_MSG_MON_SUBSCRIBE_ACK,	    c_dissect_msg_mon_sub_ack)
6502 	C_HANDLE(C_CEPH_MSG_AUTH,		    c_dissect_msg_auth)
6503 	C_HANDLE(C_CEPH_MSG_AUTH_REPLY,		    c_dissect_msg_auth_reply)
6504 	C_HANDLE(C_CEPH_MSG_MON_GET_VERSION,	    c_dissect_msg_mon_getversion)
6505 	C_HANDLE(C_CEPH_MSG_MON_GET_VERSION_REPLY,  c_dissect_msg_mon_getversionreply)
6506 	C_HANDLE(C_CEPH_MSG_MDS_MAP,		    c_dissect_msg_mds_map)
6507 	C_HANDLE(C_CEPH_MSG_CLIENT_SESSION,	    c_dissect_msg_client_sess)
6508 	C_HANDLE(C_CEPH_MSG_CLIENT_REQUEST,	    c_dissect_msg_client_req)
6509 	C_HANDLE(C_CEPH_MSG_CLIENT_REQUEST_FORWARD, c_dissect_msg_client_reqfwd)
6510 	C_HANDLE(C_CEPH_MSG_CLIENT_REPLY,	    c_dissect_msg_client_reply)
6511 	C_HANDLE(C_CEPH_MSG_OSD_MAP,		    c_dissect_msg_osd_map)
6512 	C_HANDLE(C_CEPH_MSG_OSD_OP,		    c_dissect_msg_osd_op)
6513 	C_HANDLE(C_CEPH_MSG_OSD_OPREPLY,	    c_dissect_msg_osd_opreply)
6514 	C_HANDLE(C_MSG_POOLOPREPLY,		    c_dissect_msg_poolopreply)
6515 	C_HANDLE(C_MSG_POOLOP,			    c_dissect_msg_poolop)
6516 	C_HANDLE(C_MSG_MON_COMMAND,		    c_dissect_msg_mon_cmd)
6517 	C_HANDLE(C_MSG_MON_COMMAND_ACK,		    c_dissect_msg_mon_cmd_ack)
6518 	C_HANDLE(C_MSG_GETPOOLSTATS,		    c_dissect_msg_poolstats)
6519 	C_HANDLE(C_MSG_GETPOOLSTATSREPLY,	    c_dissect_msg_poolstatsreply)
6520 	C_HANDLE(C_MSG_MON_GLOBAL_ID,		    c_dissect_msg_mon_globalid)
6521 	C_HANDLE(C_MSG_MON_ELECTION,		    c_dissect_msg_mon_election)
6522 	C_HANDLE(C_MSG_MON_PAXOS,		    c_dissect_msg_mon_paxos)
6523 	C_HANDLE(C_MSG_MON_PROBE,		    c_dissect_msg_mon_probe)
6524 	C_HANDLE(C_MSG_OSD_PING,		    c_dissect_msg_osd_ping)
6525 	C_HANDLE(C_MSG_OSD_BOOT,		    c_dissect_msg_osd_boot)
6526 	C_HANDLE(C_MSG_PGSTATS,			    c_dissect_msg_pgstats)
6527 	C_HANDLE(C_MSG_OSD_PG_CREATE,		    c_dissect_msg_osd_pg_create)
6528 	C_HANDLE(C_CEPH_MSG_CLIENT_CAPS,	    c_dissect_msg_client_caps)
6529 	C_HANDLE(C_CEPH_MSG_CLIENT_CAPRELEASE,	    c_dissect_msg_client_caprel)
6530 	C_HANDLE(C_MSG_TIMECHECK,		    c_dissect_msg_timecheck)
6531 
6532 	default:
6533 		parsedsize = C_CALL(c_dissect_msg_unknown);
6534 #undef C_CALL
6535 #undef C_HANDLE
6536 	}
6537 
6538 	size = front_len + middle_len + data_len;
6539 
6540 	/* Did the message dissector use all the data? */
6541 	c_warn_size(tree, tvb, off+parsedsize, off+size, data);
6542 
6543 	off += size;
6544 
6545 	/*** Footer ***/
6546 
6547 	/* From ceph:/src/include/msgr.h
6548 	struct ceph_msg_footer {
6549 		__le32 front_crc, middle_crc, data_crc;
6550 		// sig holds the 64 bits of the digital signature for the message PLR
6551 		__le64	sig;
6552 		__u8 flags;
6553 	} __attribute__ ((packed));
6554 	*/
6555 
6556 	ti = proto_tree_add_item(tree, hf_foot, tvb, off, C_SIZE_FOOT, ENC_NA);
6557 	subtree = proto_item_add_subtree(ti, ett_foot);
6558 
6559 	proto_tree_add_item(subtree, hf_foot_front_crc,
6560 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
6561 	off += 4;
6562 	proto_tree_add_item(subtree, hf_foot_middle_crc,
6563 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
6564 	off += 4;
6565 	proto_tree_add_item(subtree, hf_foot_data_crc,
6566 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
6567 	off += 4;
6568 
6569 	proto_tree_add_item(subtree, hf_foot_signature,
6570 			    tvb, off, 8, ENC_LITTLE_ENDIAN);
6571 	off += 8;
6572 	off = c_dissect_flags(subtree, tvb, off, data);
6573 
6574 	return off;
6575 }
6576 
6577 #define C_SIZE_CONNECT          33
6578 #define C_SIZE_CONNECT_REPLY    25
6579 #define C_CONNECT_REPLY_OFF_OFFLEN 20
6580 #define C_SIZE_HELLO_S          (2*C_SIZE_ENTITY_ADDR)
6581 #define C_SIZE_HELLO_C          (C_SIZE_ENTITY_ADDR + C_SIZE_CONNECT)
6582 #define C_HELLO_OFF_AUTHLEN     (C_SIZE_ENTITY_ADDR + 28)
6583 
6584 /** Dissect a connection request. */
6585 static
c_dissect_connect(proto_tree * root,tvbuff_t * tvb,guint off,c_pkt_data * data)6586 guint c_dissect_connect(proto_tree *root,
6587 			tvbuff_t *tvb, guint off, c_pkt_data *data)
6588 {
6589 	/* From ceph:/src/include/msgr.h
6590 	struct ceph_msg_connect {
6591 		__le64 features;
6592 		__le32 host_type;
6593 		__le32 global_seq;
6594 		__le32 connect_seq;
6595 		__le32 protocol_version;
6596 		__le32 authorizer_protocol;
6597 		__le32 authorizer_len;
6598 		__u8  flags;
6599 	} __attribute__(packed);
6600 	*/
6601 
6602 	proto_item *ti;
6603 	proto_tree *tree;
6604 	guint32 authsize;
6605 
6606 	authsize = tvb_get_letohl(tvb, off+28);
6607 
6608 	ti = proto_tree_add_item(root, hf_connect, tvb, off, C_SIZE_CONNECT, ENC_NA);
6609 	tree = proto_item_add_subtree(ti, ett_connect);
6610 
6611 	off = c_dissect_features(tree, tvb, off, data);
6612 
6613 	proto_tree_add_item(tree, hf_connect_host_type,
6614 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
6615 	off += 4;
6616 	proto_tree_add_item(tree, hf_connect_seq_global,
6617 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
6618 	off += 4;
6619 	proto_tree_add_item(tree, hf_connect_seq,
6620 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
6621 	off += 4;
6622 	proto_tree_add_item(tree, hf_connect_proto_ver,
6623 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
6624 	off += 4;
6625 	proto_tree_add_item(tree, hf_connect_auth_proto,
6626 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
6627 	off += 4;
6628 	proto_tree_add_item(tree, hf_connect_auth_size,
6629 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
6630 	off += 4;
6631 
6632 	off = c_dissect_flags(tree, tvb, off, data);
6633 
6634 	/* @TODO: Parse auth. */
6635 	proto_tree_add_item(tree, hf_connect_auth,
6636 			    tvb, off, authsize, ENC_NA);
6637 	off += authsize;
6638 
6639 	return off;
6640 }
6641 
6642 /** Dissect a connection reply. */
6643 static
c_dissect_connect_reply(proto_tree * root,tvbuff_t * tvb,guint off,c_pkt_data * data)6644 guint c_dissect_connect_reply(proto_tree *root,
6645 			      tvbuff_t *tvb, guint off, c_pkt_data *data)
6646 {
6647 	/* From ceph:/src/include/msgr.h
6648 	struct ceph_msg_connect_reply {
6649 		__u8 tag; // Handled outside.
6650 		__le64 features;
6651 		__le32 global_seq;
6652 		__le32 connect_seq;
6653 		__le32 protocol_version;
6654 		__le32 authorizer_len;
6655 		__u8 flags;
6656 	} __attribute__ ((packed));
6657 	*/
6658 
6659 	proto_item *ti;
6660 	proto_tree *tree;
6661 	guint32 authsize;
6662 
6663 	authsize = tvb_get_letohl(tvb, off+C_CONNECT_REPLY_OFF_OFFLEN);
6664 
6665 	c_set_type(data, "Connect Reply");
6666 
6667 	ti = proto_tree_add_item(root, hf_connect_reply,
6668 				 tvb, off, C_SIZE_CONNECT_REPLY, ENC_NA);
6669 	tree = proto_item_add_subtree(ti, ett_connect_reply);
6670 
6671 	off = c_dissect_features(tree, tvb, off, data);
6672 
6673 	proto_tree_add_item(tree, hf_connect_seq_global,
6674 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
6675 	off += 4;
6676 	proto_tree_add_item(tree, hf_connect_seq,
6677 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
6678 	off += 4;
6679 	proto_tree_add_item(tree, hf_connect_proto_ver,
6680 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
6681 	off += 4;
6682 	proto_tree_add_item(tree, hf_connect_auth_size,
6683 			    tvb, off, 4, ENC_LITTLE_ENDIAN);
6684 	off += 4;
6685 
6686 	off = c_dissect_flags(tree, tvb, off, data);
6687 
6688 	/* @TODO: Parse auth. */
6689 	proto_tree_add_item(tree, hf_connect_auth,
6690 			    tvb, off, authsize, ENC_NA);
6691 	off += authsize;
6692 
6693 	return off;
6694 }
6695 
6696 /** Do the connection initiation dance.
6697  *
6698  * This handles the data that is sent before the protocol is actually started.
6699  */
6700 static
c_dissect_new(proto_tree * tree,tvbuff_t * tvb,guint off,c_pkt_data * data)6701 guint c_dissect_new(proto_tree *tree,
6702 		    tvbuff_t *tvb, guint off, c_pkt_data *data)
6703 {
6704 	gint bansize;
6705 
6706 	/*
6707 		Since the packet is larger than the max banner length we can read it
6708 		all in safely.
6709 	*/
6710 	G_STATIC_ASSERT(C_BANNER_SIZE+1 <= C_BANNER_SIZE_MIN+C_SIZE_HELLO_C);
6711 	G_STATIC_ASSERT(C_BANNER_SIZE+1 <= C_BANNER_SIZE_MIN+C_SIZE_HELLO_S);
6712 
6713 	if (tvb_memeql(tvb, off, C_BANNER, C_BANNER_SIZE_MIN) != 0)
6714 		return C_INVALID;
6715 
6716 	bansize = tvb_strnlen(tvb, off, C_BANNER_SIZE+1);
6717 	if (bansize != C_BANNER_SIZE) /* Note -1 != C_BANNER_SIZE */
6718 		return C_INVALID;
6719 
6720 	proto_tree_add_item(tree, hf_banner, tvb, off, bansize, ENC_ASCII|ENC_NA);
6721 	off += bansize;
6722 
6723 	c_set_type(data, "Connect");
6724 
6725 	if (c_from_server(data))
6726 		off = c_dissect_entityaddr(tree, hf_server_info, NULL, tvb, off);
6727 
6728 	off = c_dissect_entityaddr(tree, hf_client_info, NULL, tvb, off);
6729 
6730 	if (c_from_client(data))
6731 		off = c_dissect_connect(tree, tvb, off, data);
6732 
6733 	data->src->state = C_STATE_OPEN;
6734 
6735 	return off;
6736 }
6737 
6738 static
c_unknowntagnext(tvbuff_t * tvb,guint off)6739 gboolean c_unknowntagnext(tvbuff_t *tvb, guint off)
6740 {
6741 	if (!tvb_bytes_exist(tvb, off, 1)) return FALSE;
6742 
6743 	return (try_val_to_str_ext(tvb_get_guint8(tvb, off), &c_tag_strings_ext) == NULL);
6744 }
6745 
6746 /* Dissect a MSGR message.
6747  *
6748  * MSGR is Ceph's outer message protocol.
6749  */
6750 static
c_dissect_msgr(proto_tree * tree,tvbuff_t * tvb,guint off,c_pkt_data * data)6751 guint c_dissect_msgr(proto_tree *tree,
6752 		     tvbuff_t *tvb, guint off, c_pkt_data *data)
6753 {
6754 	proto_item *ti;
6755 	c_tag tag;
6756 	guint unknowntagcount = 1;
6757 
6758 	tag = (c_tag)tvb_get_guint8(tvb, off);
6759 	ti = proto_tree_add_item(tree, hf_tag, tvb, off, 1, ENC_LITTLE_ENDIAN);
6760 	off += 1;
6761 
6762 	switch (tag)
6763 	{
6764 	case C_TAG_READY:
6765 	case C_TAG_RESETSESSION:
6766 	case C_TAG_WAIT:
6767 	case C_TAG_RETRY_SESSION:
6768 	case C_TAG_RETRY_GLOBAL:
6769 	case C_TAG_BADPROTOVER:
6770 	case C_TAG_BADAUTHORIZER:
6771 	case C_TAG_FEATURES:
6772 		off = c_dissect_connect_reply(tree, tvb, off, data);
6773 		break;
6774 	case C_TAG_SEQ:
6775 		off = c_dissect_connect_reply(tree, tvb, off, data);
6776 		proto_tree_add_item(tree, hf_seq_existing,
6777 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
6778 		off += 8;
6779 
6780 		data->dst->state = C_STATE_SEQ;
6781 		break;
6782 	case C_TAG_CLOSE:
6783 		c_set_type(data, "CLOSE");
6784 		data->src->state = C_STATE_NEW;
6785 		break;
6786 	case C_TAG_MSG:
6787 		off = c_dissect_msg(tree, tvb, off, data);
6788 		break;
6789 	case C_TAG_ACK:
6790 		c_set_type(data, "ACK");
6791 		proto_item_append_text(data->item_root, ", Seq: %u",
6792 				       tvb_get_letohl(tvb, off));
6793 		proto_tree_add_item(tree, hf_ack,
6794 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
6795 		off += 8;
6796 		break;
6797 	case C_TAG_KEEPALIVE:
6798 		c_set_type(data, "KEEPALIVE");
6799 		/* No data. */
6800 		break;
6801 	case C_TAG_KEEPALIVE2:
6802 	case C_TAG_KEEPALIVE2_ACK:
6803 		c_set_type(data, "KEEPALIVE2");
6804 		proto_tree_add_item(tree, hf_keepalive_time,
6805 				    tvb, off, 8, ENC_LITTLE_ENDIAN);
6806 		off += 8;
6807 		break;
6808 	default:
6809 		/*
6810 			The default is to do nothing.  We have no way of knowing how
6811 			long an unknown message will be.  Our best bet is to read
6812 			just the tag (which we did above) and try to interpret the
6813 			next byte as a message.	 In the best case we step through
6814 			the unknown message and when we hit the next known message
6815 			we can continue.
6816 
6817 			Stepping through byte-by-byte is slow, and creates a lot of
6818 			"Unknown Tag" items (where only the first one is really
6819 			meaningful) but we don't want to miss the next message if we
6820 			can help it.
6821 
6822 			Worst case is the message contains a byte that we think is a
6823 			message.  In this case we will interpret garbage from there
6824 			creating bogus items in the dissection results.	 After we
6825 			"dissect" that "PDU" we go back to the start and hope we get
6826 			lucky and find ourselves realigned.
6827 		*/
6828 
6829 		/* Batch multiple unknowns together. */
6830 		while (c_unknowntagnext(tvb, off)) {
6831 			off++;
6832 			unknowntagcount++;
6833 		}
6834 
6835 		c_set_type(data, wmem_strdup_printf(wmem_packet_scope(),
6836 						    "UNKNOWN x%u",
6837 						    unknowntagcount));
6838 		expert_add_info(data->pinfo, ti, &ei_tag_unknown);
6839 	}
6840 
6841 	return off;
6842 }
6843 
6844 /* Dissect a Protocol Data Unit
6845  */
6846 static
c_dissect_pdu(proto_tree * root,tvbuff_t * tvb,guint off,c_pkt_data * data)6847 guint c_dissect_pdu(proto_tree *root,
6848 		    tvbuff_t *tvb, guint off, c_pkt_data *data)
6849 {
6850 	proto_item *ti, *tif;
6851 	proto_tree *tree, *tree_filter;
6852 
6853 	ti = proto_tree_add_item(root, proto_ceph, tvb, off, -1, ENC_NA);
6854 	tree = proto_item_add_subtree(ti, ett_ceph);
6855 
6856 	data->item_root = ti;
6857 
6858 	tif = proto_tree_add_item(tree, hf_filter_data, tvb, off, -1, ENC_NA);
6859 	tree_filter = proto_item_add_subtree(tif, ett_filter_data);
6860 
6861 	switch (data->src->state)
6862 	{
6863 		case C_STATE_NEW:
6864 			off = c_dissect_new(tree, tvb, off, data);
6865 			break;
6866 		case C_STATE_SEQ:
6867 			c_set_type(data, "Sequence Number");
6868 			proto_item_append_text(data->item_root, ", Seq: %"G_GINT64_MODIFIER"u",
6869 					       tvb_get_letoh64(tvb, off));
6870 			proto_tree_add_item(tree, hf_seq_new, tvb, off, 8, ENC_LITTLE_ENDIAN);
6871 			off += 8;
6872 			data->src->state = C_STATE_OPEN;
6873 			break;
6874 		default:
6875 			off = c_dissect_msgr(tree, tvb, off, data);
6876 	}
6877 
6878 	if (tree_filter) {
6879 		proto_item *fi;
6880 		const char *srcn, *dstn;
6881 
6882 		/* Provide readable defaults. */
6883 		srcn = data->src->name.slug? data->src->name.slug : "Unknown";
6884 		dstn = data->dst->name.slug? data->dst->name.slug : "Unknown";
6885 
6886 		/*** General Filter Data ***/
6887 		fi = proto_tree_add_string(tree_filter, hf_src_slug,
6888 					   NULL, 0, 0, srcn);
6889 		proto_item_set_generated(fi);
6890 		fi = proto_tree_add_uint(tree_filter, hf_src_type,
6891 					 NULL, 0, 0, data->src->name.type);
6892 		proto_item_set_generated(fi);
6893 		fi = proto_tree_add_string(tree_filter, hf_dst_slug,
6894 					   NULL, 0, 0, dstn);
6895 		proto_item_set_generated(fi);
6896 		fi = proto_tree_add_uint(tree_filter, hf_dst_type,
6897 					 NULL, 0, 0, data->dst->name.type);
6898 		proto_item_set_generated(fi);
6899 
6900 		proto_item_set_end(tif, tvb, off);
6901 	}
6902 
6903 	proto_item_set_end(ti,	tvb, off);
6904 
6905 	return off;
6906 }
6907 
6908 static
c_pdu_end(tvbuff_t * tvb,packet_info * pinfo,guint off,c_pkt_data * data)6909 guint c_pdu_end(tvbuff_t *tvb, packet_info *pinfo, guint off, c_pkt_data *data)
6910 {
6911 	c_inet	af;
6912 
6913 	/*
6914 	 * If we don't already know, then figure out which end of the
6915 	 * connection is the client. It's icky, but the only way to know is to
6916 	 * see whether the info after the first entity_addr_t looks like
6917 	 * another entity_addr_t.
6918 	 */
6919 	if (data->convd->client.port == 0xFFFF) {
6920 		if (!tvb_bytes_exist(tvb, off, C_BANNER_SIZE + C_SIZE_ENTITY_ADDR + 8 + 2))
6921 			return C_NEEDMORE;
6922 
6923 		/* We have enough to determine client vs. server */
6924 		af = (c_inet)tvb_get_ntohs(tvb, off + C_BANNER_SIZE + C_SIZE_ENTITY_ADDR + 8);
6925 		if (af != C_IPv4 && af != C_IPv6) {
6926 			/* Client */
6927 			copy_address_wmem(wmem_file_scope(), &data->convd->client.addr, &pinfo->src);
6928 			data->convd->client.port = pinfo->srcport;
6929 			copy_address_wmem(wmem_file_scope(), &data->convd->server.addr, &pinfo->dst);
6930 			data->convd->server.port = pinfo->destport;
6931 			data->src = &data->convd->client;
6932 			data->dst = &data->convd->server;
6933 		} else {
6934 			/* Server */
6935 			copy_address_wmem(wmem_file_scope(), &data->convd->server.addr, &pinfo->src);
6936 			data->convd->server.port = pinfo->srcport;
6937 			copy_address_wmem(wmem_file_scope(), &data->convd->client.addr, &pinfo->dst);
6938 			data->convd->client.port = pinfo->destport;
6939 			data->src = &data->convd->server;
6940 			data->dst = &data->convd->client;
6941 		}
6942 	}
6943 
6944 	switch (data->src->state)
6945 	{
6946 	case C_STATE_NEW:
6947 		if (c_from_client(data))
6948 		{
6949 			if (!tvb_bytes_exist(tvb, off+C_BANNER_SIZE+C_HELLO_OFF_AUTHLEN, 4))
6950 				return C_NEEDMORE;
6951 			return off + C_BANNER_SIZE + C_SIZE_HELLO_C
6952 				   + tvb_get_letohl(tvb, off+C_BANNER_SIZE+C_HELLO_OFF_AUTHLEN);
6953 		}
6954 		else
6955 			return off + C_BANNER_SIZE + C_SIZE_HELLO_S;
6956 	case C_STATE_SEQ:
6957 		return off + 8;
6958 	default:
6959 		switch ((c_tag)tvb_get_guint8(tvb, off++))
6960 		{
6961 		case C_TAG_READY:
6962 		case C_TAG_RESETSESSION:
6963 		case C_TAG_WAIT:
6964 		case C_TAG_RETRY_SESSION:
6965 		case C_TAG_RETRY_GLOBAL:
6966 		case C_TAG_BADPROTOVER:
6967 		case C_TAG_BADAUTHORIZER:
6968 		case C_TAG_FEATURES:
6969 			if (!tvb_bytes_exist(tvb, off+C_CONNECT_REPLY_OFF_OFFLEN, 4))
6970 				return C_NEEDMORE;
6971 			return off + C_SIZE_CONNECT_REPLY
6972 				   + tvb_get_letohl(tvb, off+C_CONNECT_REPLY_OFF_OFFLEN);
6973 		case C_TAG_SEQ:
6974 			if (!tvb_bytes_exist(tvb, off+C_CONNECT_REPLY_OFF_OFFLEN, 4))
6975 				return C_NEEDMORE;
6976 			return off + C_SIZE_CONNECT_REPLY + 8
6977 				   + tvb_get_letohl(tvb, off+C_CONNECT_REPLY_OFF_OFFLEN);
6978 		case C_TAG_CLOSE:
6979 			return off;
6980 			break;
6981 		case C_TAG_MSG:
6982 		{
6983 			guint32 front_len, middle_len, data_len;
6984 
6985 			if (!tvb_bytes_exist(tvb, off+C_OFF_HEAD1, C_SIZE_HEAD1))
6986 				return C_NEEDMORE;
6987 
6988 			front_len  = tvb_get_letohl(tvb, off + C_OFF_HEAD1 + 0);
6989 			middle_len = tvb_get_letohl(tvb, off + C_OFF_HEAD1 + 4);
6990 			data_len   = tvb_get_letohl(tvb, off + C_OFF_HEAD1 + 8);
6991 
6992 			return off + C_SIZE_HEAD+front_len+middle_len+data_len+C_SIZE_FOOT;
6993 		}
6994 		case C_TAG_ACK:
6995 			return off + 8;
6996 		case C_TAG_KEEPALIVE:
6997 			return off;
6998 		case C_TAG_KEEPALIVE2:
6999 		case C_TAG_KEEPALIVE2_ACK:
7000 			return off+C_SIZE_TIMESPEC;
7001 		default:
7002 			while (c_unknowntagnext(tvb, off))
7003 				off++;
7004 
7005 			return off;
7006 		}
7007 	}
7008 }
7009 
7010 static
dissect_ceph(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,void * pdata _U_)7011 int dissect_ceph(tvbuff_t *tvb, packet_info *pinfo,
7012 		 proto_tree *tree, void *pdata _U_)
7013 {
7014 	guint off, offt, offt2;
7015 	c_pkt_data data;
7016 
7017 	col_set_str(pinfo->cinfo, COL_PROTOCOL, "Ceph");
7018 	col_clear(pinfo->cinfo, COL_INFO);
7019 
7020 	off = 0;
7021 	while (off < tvb_reported_length(tvb))
7022 	{
7023 		c_pkt_data_init(&data, pinfo, off);
7024 
7025 		/* Save snapshot before dissection changes it. */
7026 		/*
7027 			If some data has already been dissected in this frame we *must*
7028 			save the state so we can remember that the rest of the frame is
7029 			an incomplete PDU.
7030 		*/
7031 		if (off)
7032 			c_pkt_data_save(&data, pinfo, off);
7033 
7034 		offt = c_pdu_end(tvb, pinfo, off, &data);
7035 		if (offt == C_INVALID)
7036 		{
7037 			return 0;
7038 		}
7039 		if (offt == C_NEEDMORE) /* Need more data to determine PDU length. */
7040 		{
7041 			pinfo->desegment_offset = off;
7042 			pinfo->desegment_len	= DESEGMENT_ONE_MORE_SEGMENT;
7043 			return 1;
7044 		}
7045 		if (offt > tvb_reported_length(tvb)) /* Know PDU length, get rest */
7046 		{
7047 			pinfo->desegment_offset = off;
7048 			pinfo->desegment_len	= offt - tvb_reported_length(tvb);
7049 			return 1;
7050 		}
7051 
7052 		/*
7053 			If we didn't save above, save now.  This is a complete PDU so
7054 			we need to save the state.
7055 		*/
7056 		if (!off)
7057 			c_pkt_data_save(&data, pinfo, off);
7058 
7059 		col_append_sep_str(pinfo->cinfo, COL_INFO, " | ", "");
7060 		col_set_fence(pinfo->cinfo, COL_INFO);
7061 
7062 		offt2 = c_dissect_pdu(tree, tvb, off, &data);
7063 		if (!offt2) return 0;
7064 		DISSECTOR_ASSERT_CMPINT(offt2, ==, offt);
7065 
7066 		off = offt;
7067 	}
7068 
7069 	return off; /* Perfect Fit. */
7070 }
7071 
7072 /** An old style dissector proxy.
7073  *
7074  * Proxies the old style dissector interface to the new style.
7075  */
7076 static
dissect_ceph_old(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,void * data)7077 int dissect_ceph_old(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
7078 {
7079 	dissect_ceph(tvb, pinfo, tree, data);
7080 	return tvb_captured_length(tvb);
7081 }
7082 
7083 static
dissect_ceph_heur(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,void * data)7084 gboolean dissect_ceph_heur(tvbuff_t *tvb, packet_info *pinfo,
7085 			   proto_tree *tree, void *data)
7086 {
7087 	conversation_t *conv;
7088 
7089 	if (tvb_memeql(tvb, 0, C_BANNER, C_BANNER_SIZE_MIN) != 0) return FALSE;
7090 
7091 	/*** It's ours! ***/
7092 
7093 	conv = find_or_create_conversation(pinfo);
7094 	/* Mark it as ours. */
7095 	conversation_set_dissector(conv, ceph_handle);
7096 
7097 	dissect_ceph(tvb, pinfo, tree, data);
7098 	return TRUE;
7099 }
7100 
7101 /* Register the protocol with Wireshark.
7102  */
7103 void
proto_register_ceph(void)7104 proto_register_ceph(void)
7105 {
7106 	expert_module_t *expert_ceph;
7107 
7108 	static hf_register_info hf[] = {
7109 		{ &hf_filter_data, {
7110 			"Filter Data", "ceph.filter",
7111 			FT_NONE, BASE_NONE, NULL, 0,
7112 			"A bunch of properties for convenient filtering.", HFILL
7113 		} },
7114 		{ &hf_node_id, {
7115 			"ID", "ceph.node_id",
7116 			FT_UINT64, BASE_DEC, NULL, 0,
7117 			"The numeric ID of the node.", HFILL
7118 		} },
7119 		{ &hf_node_type, {
7120 			"Source Node Type", "ceph.node_type",
7121 			FT_UINT8, BASE_HEX, VALS(c_node_type_strings), 0,
7122 			"The type of source node.", HFILL
7123 		} },
7124 		{ &hf_node_nonce, {
7125 			"Nonce", "ceph.node_nonce",
7126 			FT_UINT32, BASE_HEX, NULL, 0,
7127 			"Meaningless number to differentiate between nodes on "
7128 			"the same system.", HFILL
7129 		} },
7130 		{ &hf_entityinst_name, {
7131 			"Name", "ceph.entityinst.name",
7132 			FT_NONE, BASE_NONE, NULL, 0,
7133 			NULL, HFILL
7134 		} },
7135 		{ &hf_entityinst_addr, {
7136 			"Address", "ceph.entityinst.addr",
7137 			FT_NONE, BASE_NONE, NULL, 0,
7138 			NULL, HFILL
7139 		} },
7140 		{ &hf_EntityName, {
7141 			"Entity Name", "ceph.EntityName",
7142 			FT_NONE, BASE_NONE, NULL, 0,
7143 			NULL, HFILL
7144 		} },
7145 		{ &hf_EntityName_type, {
7146 			"Type", "ceph.EntityName.type",
7147 			FT_UINT32, BASE_HEX, NULL, 0,
7148 			NULL, HFILL
7149 		} },
7150 		{ &hf_EntityName_id, {
7151 			"ID", "ceph.EntityName.id",
7152 			FT_STRING, BASE_NONE, NULL, 0,
7153 			NULL, HFILL
7154 		} },
7155 		{ &hf_src_slug, {
7156 			"Source Node Name", "ceph.src",
7157 			FT_STRING, BASE_NONE, NULL, 0,
7158 			NULL, HFILL
7159 		} },
7160 		{ &hf_src_type, {
7161 			"Source Node Type", "ceph.src.type",
7162 			FT_UINT8, BASE_HEX, VALS(c_node_type_abbr_strings), 0,
7163 			NULL, HFILL
7164 		} },
7165 		{ &hf_dst_slug, {
7166 			"Destination Node Name", "ceph.dst",
7167 			FT_STRING, BASE_NONE, NULL, 0,
7168 			NULL, HFILL
7169 		} },
7170 		{ &hf_dst_type, {
7171 			"Destination Node Type", "ceph.dst.type",
7172 			FT_UINT8, BASE_HEX, VALS(c_node_type_abbr_strings), 0,
7173 			NULL, HFILL
7174 		} },
7175 		{ &hf_banner, {
7176 			"Version", "ceph.ver",
7177 			FT_STRINGZ, BASE_NONE, NULL, 0,
7178 			"The protocol version string.", HFILL
7179 		} },
7180 		{ &hf_client_info, {
7181 			"Client's Identity", "ceph.client_info",
7182 			FT_NONE, BASE_NONE, NULL, 0,
7183 			NULL, HFILL
7184 		} },
7185 		{ &hf_server_info, {
7186 			"Server's Identity", "ceph.server_info",
7187 			FT_NONE, BASE_NONE, NULL, 0,
7188 			NULL, HFILL
7189 		} },
7190 		{ &hf_sockaddr, {
7191 			"Network Address", "ceph.sockaddr",
7192 			FT_NONE, BASE_NONE, NULL, 0,
7193 			NULL, HFILL
7194 		} },
7195 		{ &hf_inet_family, {
7196 			"Address Family", "ceph.af",
7197 			FT_UINT16, BASE_HEX, VALS(c_inet_strings), 0,
7198 			"The address family of the client as seen by the server.", HFILL
7199 		} },
7200 		{ &hf_port, {
7201 			"Port", "ceph.client.port",
7202 			FT_UINT16, BASE_DEC, NULL, 0,
7203 			"The port of the client as seen by the server.", HFILL
7204 		} },
7205 		{ &hf_addr_ipv4, {
7206 			"IPv4 Address", "ceph.client.ip4",
7207 			FT_IPv4, BASE_NONE, NULL, 0,
7208 			"The IP address of the client as seen by the server.", HFILL
7209 		} },
7210 		{ &hf_addr_ipv6, {
7211 			"IPv6 Address", "ceph.client.ipv6",
7212 			FT_IPv6, BASE_NONE, NULL, 0,
7213 			"The IP address of the client as seen by the server.", HFILL
7214 		} },
7215 		{ &hf_data_data, {
7216 			"Data", "ceph.data.data",
7217 			FT_BYTES, BASE_NONE, NULL, 0,
7218 			NULL, HFILL
7219 		} },
7220 		{ &hf_data_size, {
7221 			"Size", "ceph.data.size",
7222 			FT_UINT32, BASE_DEC, NULL, 0,
7223 			NULL, HFILL
7224 		} },
7225 		{ &hf_string_data, {
7226 			"Data", "ceph.string.data",
7227 			FT_STRING, BASE_NONE, NULL, 0,
7228 			NULL, HFILL
7229 		} },
7230 		{ &hf_string_size, {
7231 			"Size", "ceph.string.size",
7232 			FT_UINT32, BASE_DEC, NULL, 0,
7233 			NULL, HFILL
7234 		} },
7235 		{ &hf_keepalive_time, {
7236 			"Timestamp", "ceph.keepalive.time",
7237 			FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
7238 			NULL, HFILL
7239 		} },
7240 		{ &hf_encoded_ver, {
7241 			"Encoding Version", "ceph.enc.ver",
7242 			FT_UINT8, BASE_DEC, NULL, 0,
7243 			NULL, HFILL
7244 		} },
7245 		{ &hf_encoded_compat, {
7246 			"Minimum compatible version", "ceph.enc.compat",
7247 			FT_UINT8, BASE_DEC, NULL, 0,
7248 			NULL, HFILL
7249 		} },
7250 		{ &hf_encoded_size, {
7251 			"Size", "ceph.nanoseconds",
7252 			FT_UINT32, BASE_DEC, NULL, 0,
7253 			"Size of encoded message.", HFILL
7254 		} },
7255 		{ &hf_version, {
7256 			"Version", "ceph.version",
7257 			FT_UINT64, BASE_DEC, NULL, 0,
7258 			NULL, HFILL
7259 		} },
7260 		{ &hf_epoch, {
7261 			"Epoch", "ceph.epoch",
7262 			FT_UINT32, BASE_DEC, NULL, 0,
7263 			NULL, HFILL
7264 		} },
7265 		{ &hf_pool, {
7266 			"Pool", "ceph.pool",
7267 			FT_INT64, BASE_DEC, NULL, 0,
7268 			NULL, HFILL
7269 		} },
7270 		{ &hf_key, {
7271 			"Object Key", "ceph.key",
7272 			FT_STRING, BASE_NONE, NULL, 0,
7273 			NULL, HFILL
7274 		} },
7275 		{ &hf_namespace, {
7276 			"Namespace", "ceph.namespace",
7277 			FT_STRING, BASE_NONE, NULL, 0,
7278 			NULL, HFILL
7279 		} },
7280 		{ &hf_hash, {
7281 			"Object Hash", "ceph.hash",
7282 			FT_INT64, BASE_DEC, NULL, 0,
7283 			NULL, HFILL
7284 		} },
7285 		{ &hf_pgid_ver, {
7286 			"Placement Group Version", "ceph.pg.ver",
7287 			FT_UINT8, BASE_DEC, NULL, 0,
7288 			NULL, HFILL
7289 		} },
7290 		{ &hf_pgid_pool, {
7291 			"Pool", "ceph.pg.pool",
7292 			FT_UINT64, BASE_HEX, NULL, 0,
7293 			NULL, HFILL
7294 		} },
7295 		{ &hf_pgid_seed, {
7296 			"Seed", "ceph.pg.seed",
7297 			FT_UINT32, BASE_HEX, NULL, 0,
7298 			NULL, HFILL
7299 		} },
7300 		{ &hf_pgid_preferred, {
7301 			"Preferred", "ceph.pg.preferred",
7302 			FT_INT32, BASE_DEC, NULL, 0,
7303 			NULL, HFILL
7304 		} },
7305 		{ &hf_pg_create_epoch, {
7306 			"Epoch Created", "ceph.pg_create.epoch",
7307 			FT_UINT32, BASE_DEC, NULL, 0,
7308 			NULL, HFILL
7309 		} },
7310 		{ &hf_pg_create_parent, {
7311 			"Parent", "ceph.pg_create.parent",
7312 			FT_NONE, BASE_NONE, NULL, 0,
7313 			NULL, HFILL
7314 		} },
7315 		{ &hf_pg_create_splitbits, {
7316 			"Split Bits", "ceph.pg_create.splitbits",
7317 			FT_INT32, BASE_DEC, NULL, 0,
7318 			NULL, HFILL
7319 		} },
7320 		{ &hf_path_ver, {
7321 			"Encoding Version", "ceph.path.ver",
7322 			FT_UINT8, BASE_HEX, NULL, 0,
7323 			NULL, HFILL
7324 		} },
7325 		{ &hf_path_inode, {
7326 			"Inode", "ceph.path.inode",
7327 			FT_UINT64, BASE_HEX, NULL, 0,
7328 			NULL, HFILL
7329 		} },
7330 		{ &hf_path_rel, {
7331 			"Relative component", "ceph.path.rel",
7332 			FT_STRING, BASE_NONE, NULL, 0,
7333 			NULL, HFILL
7334 		} },
7335 		{ &hf_mds_release_inode, {
7336 			"Inode", "ceph.mds_release.inode",
7337 			FT_UINT64, BASE_HEX, NULL, 0,
7338 			NULL, HFILL
7339 		} },
7340 		{ &hf_mds_release_capid, {
7341 			"Capability ID", "ceph.mds_release.capid",
7342 			FT_UINT64, BASE_HEX, NULL, 0,
7343 			NULL, HFILL
7344 		} },
7345 		{ &hf_mds_release_new, {
7346 			"New Capabilities", "ceph.mds_release.new",
7347 			FT_UINT32, BASE_HEX, NULL, 0,
7348 			NULL, HFILL
7349 		} },
7350 		{ &hf_mds_release_wanted, {
7351 			"Wanted Capabilities", "ceph.mds_release.wanted",
7352 			FT_UINT32, BASE_HEX, NULL, 0,
7353 			NULL, HFILL
7354 		} },
7355 		{ &hf_mds_release_seq, {
7356 			"Seq", "ceph.mds_release.seq",
7357 			FT_UINT32, BASE_HEX, NULL, 0,
7358 			NULL, HFILL
7359 		} },
7360 		{ &hf_mds_release_seq_issue, {
7361 			"Seq Issue", "ceph.mds_release.seq_issue",
7362 			FT_UINT32, BASE_HEX, NULL, 0,
7363 			NULL, HFILL
7364 		} },
7365 		{ &hf_mds_release_mseq, {
7366 			"Migration Sequence", "ceph.mds_release.mseq",
7367 			FT_UINT32, BASE_HEX, NULL, 0,
7368 			NULL, HFILL
7369 		} },
7370 		{ &hf_mds_release_dname_seq, {
7371 			"DName Seq", "ceph.mds_release.dname_seq",
7372 			FT_UINT32, BASE_HEX, NULL, 0,
7373 			NULL, HFILL
7374 		} },
7375 		{ &hf_mds_release_dname, {
7376 			"DName", "ceph.mds_release.dname",
7377 			FT_STRING, BASE_NONE, NULL, 0,
7378 			NULL, HFILL
7379 		} },
7380 		{ &hf_hitset_params, {
7381 			"HitSet Parameters", "ceph.hitset_params",
7382 			FT_NONE, BASE_NONE, NULL, 0,
7383 			NULL, HFILL
7384 		} },
7385 		{ &hf_hitset_params_type, {
7386 			"Type", "ceph.hitset_params.type",
7387 			FT_UINT8, BASE_HEX|BASE_EXT_STRING, &c_hitset_params_type_strings_ext, 0,
7388 			NULL, HFILL
7389 		} },
7390 		{ &hf_hitset_params_exphash_count, {
7391 			"Count", "ceph.hitset_params.exphash.count",
7392 			FT_UINT64, BASE_DEC, NULL, 0,
7393 			NULL, HFILL
7394 		} },
7395 		{ &hf_hitset_params_exphash_hit, {
7396 			"Hit", "ceph.hitset_params.exphash.hit",
7397 			FT_UINT32, BASE_DEC, NULL, 0,
7398 			NULL, HFILL
7399 		} },
7400 		{ &hf_snapinfo, {
7401 			"Snapshot Info", "ceph.snapinfo",
7402 			FT_NONE, BASE_NONE, NULL, 0,
7403 			NULL, HFILL
7404 		} },
7405 		{ &hf_snapinfo_id, {
7406 			"ID", "ceph.snapinfo.id",
7407 			FT_UINT64, BASE_HEX, NULL, 0,
7408 			NULL, HFILL
7409 		} },
7410 		{ &hf_snapinfo_time, {
7411 			"Timestamp", "ceph.snapinfo.timestamp",
7412 			FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
7413 			NULL, HFILL
7414 		} },
7415 		{ &hf_snapinfo_name, {
7416 			"Name", "ceph.snapinfo.name",
7417 			FT_STRING, BASE_NONE, NULL, 0,
7418 			NULL, HFILL
7419 		} },
7420 		{ &hf_pgpool, {
7421 			"Placement Group Pool", "ceph.pgpool",
7422 			FT_NONE, BASE_NONE, NULL, 0,
7423 			NULL, HFILL
7424 		} },
7425 		{ &hf_pgpool_type, {
7426 			"Type", "ceph.pgpool.type",
7427 			FT_UINT8, BASE_HEX, VALS(c_pgpool_type_strings), 0,
7428 			NULL, HFILL
7429 		} },
7430 		{ &hf_pgpool_size, {
7431 			"Size", "ceph.pgpool.size",
7432 			FT_UINT8, BASE_DEC, NULL, 0,
7433 			NULL, HFILL
7434 		} },
7435 		{ &hf_pgpool_crush_ruleset, {
7436 			"CRUSH Ruleset", "ceph.pgpool.crush_ruleset",
7437 			FT_UINT8, BASE_DEC, NULL, 0,
7438 			NULL, HFILL
7439 		} },
7440 		{ &hf_pgpool_hash, {
7441 			"Object Hash", "ceph.pgpool.hash",
7442 			FT_UINT8, BASE_HEX, NULL, 0,
7443 			NULL, HFILL
7444 		} },
7445 		{ &hf_pgpool_pgnum, {
7446 			"PG Count", "ceph.pgpool.pgnum",
7447 			FT_UINT32, BASE_DEC, NULL, 0,
7448 			NULL, HFILL
7449 		} },
7450 		{ &hf_pgpool_pgpnum, {
7451 			"PGP Count", "ceph.pgpool.pgpnum",
7452 			FT_UINT32, BASE_DEC, NULL, 0,
7453 			NULL, HFILL
7454 		} },
7455 		{ &hf_pgpool_changed, {
7456 			"Last Changed", "ceph.pgpool.changed",
7457 			FT_UINT32, BASE_DEC, NULL, 0,
7458 			NULL, HFILL
7459 		} },
7460 		{ &hf_pgpool_snapseq, {
7461 			"Snap Sequence", "ceph.pgpool.snapseq",
7462 			FT_UINT64, BASE_HEX, NULL, 0,
7463 			NULL, HFILL
7464 		} },
7465 		{ &hf_pgpool_snapepoch, {
7466 			"Epoch", "ceph.pgpool.snapepoch",
7467 			FT_UINT32, BASE_DEC, NULL, 0,
7468 			NULL, HFILL
7469 		} },
7470 		{ &hf_pgpool_snap, {
7471 			"Snapshot", "ceph.pgpool.snap",
7472 			FT_NONE, BASE_NONE, NULL, 0,
7473 			NULL, HFILL
7474 		} },
7475 		{ &hf_pgpool_snap_id, {
7476 			"ID", "ceph.pgpool.snap.id",
7477 			FT_UINT64, BASE_HEX, NULL, 0,
7478 			NULL, HFILL
7479 		} },
7480 		{ &hf_pgpool_snapdel, {
7481 			"Deleted Snapshots", "ceph.pgpool.snapdel",
7482 			FT_NONE, BASE_NONE, NULL, 0,
7483 			NULL, HFILL
7484 		} },
7485 		{ &hf_pgpool_snapdel_from, {
7486 			"From", "ceph.pgpool.snapdel.from",
7487 			FT_UINT64, BASE_HEX, NULL, 0,
7488 			NULL, HFILL
7489 		} },
7490 		{ &hf_pgpool_snapdel_to, {
7491 			"To", "ceph.pgpool.snapdel.to",
7492 			FT_UINT64, BASE_HEX, NULL, 0,
7493 			NULL, HFILL
7494 		} },
7495 		{ &hf_pgpool_uid, {
7496 			"User ID", "ceph.pgpool.uid",
7497 			FT_UINT64, BASE_DEC, NULL, 0,
7498 			NULL, HFILL
7499 		} },
7500 		{ &hf_pgpool_flags_low, {
7501 			"Flags", "ceph.pgpool.flags",
7502 			FT_UINT32, BASE_HEX, NULL, 0,
7503 			NULL, HFILL
7504 		} },
7505 		{ &hf_pgpool_flags_high, {
7506 			"Flags", "ceph.pgpool.flags",
7507 			FT_UINT32, BASE_HEX, NULL, 0,
7508 			NULL, HFILL
7509 		} },
7510 		{ &hf_pgpool_crash_reply_interval, {
7511 			"Crash Replay Interval", "ceph.pgpool.crash_reply_interval",
7512 			FT_UINT32, BASE_DEC, NULL, 0,
7513 			"Seconds to allow clients to replay ACKed but "
7514 			"unCOMMITted requests.", HFILL
7515 		} },
7516 		{ &hf_pgpool_min_size, {
7517 			"Minimum number of OSDs", "ceph.pgpool.min_size",
7518 			FT_UINT8, BASE_DEC, NULL, 0,
7519 			NULL, HFILL
7520 		} },
7521 		{ &hf_pgpool_quota_bytes, {
7522 			"Maximum number of bytes", "ceph.pgpool.quota_bytes",
7523 			FT_UINT64, BASE_DEC, NULL, 0,
7524 			NULL, HFILL
7525 		} },
7526 		{ &hf_pgpool_quota_objects, {
7527 			"Maximum number of objects", "ceph.pgpool.quota_objects",
7528 			FT_UINT64, BASE_DEC, NULL, 0,
7529 			NULL, HFILL
7530 		} },
7531 		{ &hf_pgpool_tier, {
7532 			"Tier", "ceph.msg.tier",
7533 			FT_UINT64, BASE_HEX, NULL, 0,
7534 			"A pool that is a tier of this tier.", HFILL
7535 		} },
7536 		{ &hf_pgpool_tierof, {
7537 			"Tier of", "ceph.pgpool.tierof",
7538 			FT_UINT64, BASE_HEX, NULL, 0,
7539 			"The pool that this pool is a tier of.", HFILL
7540 		} },
7541 		{ &hf_pgpool_cachemode, {
7542 			"Cache Mode", "ceph.pgpool.cache_mode",
7543 			FT_UINT8, BASE_HEX|BASE_EXT_STRING, &c_pgpool_cachemode_strings_ext, 0,
7544 			NULL, HFILL
7545 		} },
7546 		{ &hf_pgpool_readtier, {
7547 			"Read Tier", "ceph.pgpool.read_tier",
7548 			FT_UINT64, BASE_HEX, NULL, 0,
7549 			NULL, HFILL
7550 		} },
7551 		{ &hf_pgpool_writetier, {
7552 			"Write Tier", "ceph.pgpool.write_tier",
7553 			FT_UINT64, BASE_HEX, NULL, 0,
7554 			NULL, HFILL
7555 		} },
7556 		{ &hf_pgpool_property, {
7557 			"Property", "ceph.pgpool.property",
7558 			FT_NONE, BASE_NONE, NULL, 0,
7559 			NULL, HFILL
7560 		} },
7561 		{ &hf_pgpool_property_key, {
7562 			"Key", "ceph.pgpool.property.key",
7563 			FT_STRING, BASE_NONE, NULL, 0,
7564 			NULL, HFILL
7565 		} },
7566 		{ &hf_pgpool_property_val, {
7567 			"Value", "ceph.pgpool.property.val",
7568 			FT_STRING, BASE_NONE, NULL, 0,
7569 			NULL, HFILL
7570 		} },
7571 		{ &hf_pgpool_hitset_period, {
7572 			"HitSet Period", "ceph.hitset_period",
7573 			FT_UINT32, BASE_DEC, NULL, 0,
7574 			"The period of HitSet segments in seconds.", HFILL
7575 		} },
7576 		{ &hf_pgpool_hitset_count, {
7577 			"HitSet count", "ceph.pgpool.hitset_count",
7578 			FT_UINT32, BASE_DEC, NULL, 0,
7579 			"The number of HitSet periods to retain.", HFILL
7580 		} },
7581 		{ &hf_pgpool_stripewidth, {
7582 			"Stripe Width", "ceph.pgpool.stripewidth",
7583 			FT_UINT32, BASE_DEC, NULL, 0,
7584 			NULL, HFILL
7585 		} },
7586 		{ &hf_pgpool_targetmaxsize, {
7587 			"Target Maximum Bytes", "ceph.pgpool.targetmaxsize",
7588 			FT_UINT64, BASE_DEC, NULL, 0,
7589 			NULL, HFILL
7590 		} },
7591 		{ &hf_pgpool_targetmaxobj, {
7592 			"Target Maximum Objects", "ceph.pgpool.targetmaxobj",
7593 			FT_UINT64, BASE_DEC, NULL, 0,
7594 			NULL, HFILL
7595 		} },
7596 		{ &hf_pgpool_cache_targetdirtyratio, {
7597 			"Cache Target Dirty Ratio", "ceph.pgpool.cache.targetdirtyratio",
7598 			FT_UINT32, BASE_DEC, NULL, 0,
7599 			"Fraction of cache to leave dirty.", HFILL
7600 		} },
7601 		{ &hf_pgpool_cache_targetfullratio, {
7602 			"Cache Target Full Ratio", "ceph.msg.targetfullratio",
7603 			FT_UINT32, BASE_DEC, NULL, 0,
7604 			"Fraction of target to fill before evicting in earnest.", HFILL
7605 		} },
7606 		{ &hf_pgpool_cache_flushage_min, {
7607 			"Cache Minimum Flush Age", "ceph.pgpool.cache.flushage_min",
7608 			FT_UINT32, BASE_DEC, NULL, 0,
7609 			NULL, HFILL
7610 		} },
7611 		{ &hf_pgpool_cache_evictage_min, {
7612 			"Cache Minimum Evict Age", "ceph.pgpool.cache.evictage_min",
7613 			FT_UINT32, BASE_DEC, NULL, 0,
7614 			NULL, HFILL
7615 		} },
7616 		{ &hf_pgpool_erasurecode_profile, {
7617 			"Erasure Code Profile", "ceph.pgpool.erasurecode_profile",
7618 			FT_STRING, BASE_NONE, NULL, 0,
7619 			NULL, HFILL
7620 		} },
7621 		{ &hf_pgpool_lastforceresend, {
7622 			"Last Force Resend", "ceph.pgpool.lastforceresend",
7623 			FT_UINT32, BASE_DEC, NULL, 0,
7624 			"Last epoch that forced clients to resend.", HFILL
7625 		} },
7626 		{ &hf_pgpool_flag_hashpool, {
7627 			"Hash Seed and Pool Together", "ceph.pgpool.flag.hashpool",
7628 			FT_BOOLEAN, 32, TFS(&tfs_true_false), C_PGPOOL_FLAG_HASHPSPOOL,
7629 			NULL, HFILL
7630 		} },
7631 		{ &hf_pgpool_flag_full, {
7632 			"Pool Full", "ceph.pgpool.flag.full",
7633 			FT_BOOLEAN, 32, TFS(&tfs_true_false), C_PGPOOL_FLAG_FULL,
7634 			NULL, HFILL
7635 		} },
7636 		{ &hf_pgpool_flag_fake_ec_pool, {
7637 			"Fake Erasure-Coded Pool", "ceph.pgpool.flag.fake_ec_pool",
7638 			FT_BOOLEAN, 32, TFS(&tfs_true_false), C_PGPOOL_FLAG_FAKE_EC_POOL,
7639 			NULL, HFILL
7640 		} },
7641 		{ &hf_monmap, {
7642 			"Monmap", "ceph.monmap.data",
7643 			FT_NONE, BASE_NONE, NULL, 0,
7644 			NULL, HFILL
7645 		} },
7646 		{ &hf_monmap_fsid, {
7647 			"FSID", "ceph.monmap.fsid",
7648 			FT_GUID, BASE_NONE, NULL, 0,
7649 			NULL, HFILL
7650 		} },
7651 		{ &hf_monmap_epoch, {
7652 			"Epoch", "ceph.monmap.epoch",
7653 			FT_UINT32, BASE_DEC, NULL, 0,
7654 			NULL, HFILL
7655 		} },
7656 		{ &hf_monmap_address, {
7657 			"Monitor Address", "ceph.monmap.address",
7658 			FT_NONE, BASE_NONE, NULL, 0,
7659 			NULL, HFILL
7660 		} },
7661 		{ &hf_monmap_address_name, {
7662 			"Name", "ceph.monmap.address.name",
7663 			FT_STRING, BASE_NONE, NULL, 0,
7664 			NULL, HFILL
7665 		} },
7666 		{ &hf_monmap_address_addr, {
7667 			"Address", "ceph.monmap.address.addr",
7668 			FT_NONE, BASE_NONE, NULL, 0,
7669 			NULL, HFILL
7670 		} },
7671 		{ &hf_monmap_changed, {
7672 			"Last Changed", "ceph.monmap.changed",
7673 			FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
7674 			NULL, HFILL
7675 		} },
7676 		{ &hf_monmap_created, {
7677 			"Time Created", "ceph.monmap.created",
7678 			FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
7679 			NULL, HFILL
7680 		} },
7681 		{ &hf_pg_stat_ver, {
7682 			"Version", "ceph.pg_stat.ver",
7683 			FT_NONE, BASE_NONE, NULL, 0,
7684 			NULL, HFILL
7685 		} },
7686 		{ &hf_pg_stat_seq, {
7687 			"Reported Sequence Number", "ceph.pg_stat.seq",
7688 			FT_UINT64, BASE_DEC, NULL, 0,
7689 			NULL, HFILL
7690 		} },
7691 		{ &hf_pg_stat_epoch, {
7692 			"Reported Epoch", "ceph.pg_stat.epoch",
7693 			FT_UINT32, BASE_DEC, NULL, 0,
7694 			NULL, HFILL
7695 		} },
7696 		{ &hf_pg_stat_state, {
7697 			"State", "ceph.pg_stat.state",
7698 			FT_UINT32, BASE_DEC, NULL, 0,
7699 			NULL, HFILL
7700 		} },
7701 		{ &hf_pg_stat_logstart, {
7702 			"Log Start", "ceph.pg_stat.logstart",
7703 			FT_NONE, BASE_NONE, NULL, 0,
7704 			NULL, HFILL
7705 		} },
7706 		{ &hf_pg_stat_logstartondisk, {
7707 			"On-disk Log Start", "ceph.pg_stat.logstartondisk",
7708 			FT_NONE, BASE_NONE, NULL, 0,
7709 			NULL, HFILL
7710 		} },
7711 		{ &hf_pg_stat_created, {
7712 			"Created", "ceph.pg_stat.created",
7713 			FT_UINT32, BASE_DEC, NULL, 0,
7714 			NULL, HFILL
7715 		} },
7716 		{ &hf_pg_stat_lastepochclean, {
7717 			"Last Epoch Clean", "ceph.pg_stat.lastepochclean",
7718 			FT_UINT32, BASE_DEC, NULL, 0,
7719 			NULL, HFILL
7720 		} },
7721 		{ &hf_pg_stat_parent, {
7722 			"Parent", "ceph.pg_stat.parent",
7723 			FT_NONE, BASE_NONE, NULL, 0,
7724 			NULL, HFILL
7725 		} },
7726 		{ &hf_pg_stat_parent_splitbits, {
7727 			"Parent Split Bits", "ceph.pg_stat.parent_splitbits",
7728 			FT_UINT32, BASE_HEX, NULL, 0,
7729 			NULL, HFILL
7730 		} },
7731 		{ &hf_pg_stat_lastscrub, {
7732 			"Last Scrub", "ceph.pg_stat.lastscrub",
7733 			FT_NONE, BASE_NONE, NULL, 0,
7734 			NULL, HFILL
7735 		} },
7736 		{ &hf_pg_stat_lastscrubstamp, {
7737 			"Last Scrub Timestamp", "ceph.pg_stat.lastscrubstamp",
7738 			FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
7739 			NULL, HFILL
7740 		} },
7741 		{ &hf_pg_stat_stats, {
7742 			"Stats", "ceph.pg_stat.stats",
7743 			FT_NONE, BASE_NONE, NULL, 0,
7744 			NULL, HFILL
7745 		} },
7746 		{ &hf_pg_stat_logsize, {
7747 			"Log Size", "ceph.pg_stat.logsize",
7748 			FT_UINT64, BASE_DEC, NULL, 0,
7749 			NULL, HFILL
7750 		} },
7751 		{ &hf_pg_stat_logsizeondisk, {
7752 			"Log Size On-disk", "ceph.pg_stat.logsizeondisk",
7753 			FT_UINT64, BASE_DEC, NULL, 0,
7754 			NULL, HFILL
7755 		} },
7756 		{ &hf_pg_stat_up, {
7757 			"Up", "ceph.pg_stat.up",
7758 			FT_UINT32, BASE_DEC, NULL, 0,
7759 			NULL, HFILL
7760 		} },
7761 		{ &hf_pg_stat_acting, {
7762 			"Acting", "ceph.pg_stat.acting",
7763 			FT_UINT32, BASE_DEC, NULL, 0,
7764 			NULL, HFILL
7765 		} },
7766 		{ &hf_pg_stat_lastfresh, {
7767 			"Last Fresh", "ceph.pg_stat.lastfresh",
7768 			FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
7769 			NULL, HFILL
7770 		} },
7771 		{ &hf_pg_stat_lastchange, {
7772 			"Last Change", "ceph.pg_stat.lastchange",
7773 			FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
7774 			NULL, HFILL
7775 		} },
7776 		{ &hf_pg_stat_lastactive, {
7777 			"Last Active", "ceph.pg_stat.lastactive",
7778 			FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
7779 			NULL, HFILL
7780 		} },
7781 		{ &hf_pg_stat_lastclean, {
7782 			"Last Clean", "ceph.pg_stat.lastclean",
7783 			FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
7784 			NULL, HFILL
7785 		} },
7786 		{ &hf_pg_stat_lastunstale, {
7787 			"Last Not Stale", "ceph.pg_stat.lastunstale",
7788 			FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
7789 			NULL, HFILL
7790 		} },
7791 		{ &hf_pg_stat_mappingepoch, {
7792 			"Mapping Epoch", "ceph.pg_stat.mappingepoch",
7793 			FT_UINT32, BASE_DEC, NULL, 0,
7794 			NULL, HFILL
7795 		} },
7796 		{ &hf_pg_stat_lastdeepscrub, {
7797 			"Last Deep Scrub", "ceph.pg_stat.lastdeepscrub",
7798 			FT_NONE, BASE_NONE, NULL, 0,
7799 			NULL, HFILL
7800 		} },
7801 		{ &hf_pg_stat_lastdeepscrubstamp, {
7802 			"Time of Last Deep Scrub", "ceph.pg_stat.lastdeepscrubstamp",
7803 			FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
7804 			NULL, HFILL
7805 		} },
7806 		{ &hf_pg_stat_statsinvalid, {
7807 			"Stats Invalid", "ceph.pg_stat.statsinvalid",
7808 			FT_BOOLEAN, BASE_NONE, NULL, 0,
7809 			NULL, HFILL
7810 		} },
7811 		{ &hf_pg_stat_lastcleanscrubstamp, {
7812 			"Time of Last Clean Scrub", "ceph.pg_stat.lastcleanscrubstamp",
7813 			FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
7814 			NULL, HFILL
7815 		} },
7816 		{ &hf_pg_stat_lastbecameactive, {
7817 			"Last Became Active", "ceph.pg_stat.lastbecameactive",
7818 			FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
7819 			NULL, HFILL
7820 		} },
7821 		{ &hf_pg_stat_dirtystatsinvalid, {
7822 			"Dirty Stats Invalid", "ceph.pg_stat.dirtystatusinvalid",
7823 			FT_BOOLEAN, BASE_NONE, NULL, 0,
7824 			NULL, HFILL
7825 		} },
7826 		{ &hf_pg_stat_upprimary, {
7827 			"Up Primary", "ceph.pg_stat.upprimary",
7828 			FT_INT32, BASE_DEC, NULL, 0,
7829 			NULL, HFILL
7830 		} },
7831 		{ &hf_pg_stat_actingprimary, {
7832 			"Acting Primary", "ceph.pg_stat.actingprimary",
7833 			FT_INT32, BASE_DEC, NULL, 0,
7834 			NULL, HFILL
7835 		} },
7836 		{ &hf_pg_stat_omapstatsinvalid, {
7837 			"OMap Stats Invalid", "ceph.pg_stat.omapstatsinvalid",
7838 			FT_BOOLEAN, BASE_NONE, NULL, 0,
7839 			NULL, HFILL
7840 		} },
7841 		{ &hf_pg_stat_hitsetstatsinvalid, {
7842 			"HitSet Stats Invalid", "ceph.pg_stat.hitsetstatsinvalid",
7843 			FT_BOOLEAN, BASE_NONE, NULL, 0,
7844 			NULL, HFILL
7845 		} },
7846 		{ &hf_osd_superblock, {
7847 			"Superblock", "ceph.osd_superblock",
7848 			FT_NONE, BASE_NONE, NULL, 0,
7849 			NULL, HFILL
7850 		} },
7851 		{ &hf_osd_superblock_clusterfsid, {
7852 			"Cluster FSID", "ceph.osd_superblock.fsid",
7853 			FT_GUID, BASE_NONE, NULL, 0,
7854 			NULL, HFILL
7855 		} },
7856 		{ &hf_osd_superblock_role, {
7857 			"Role", "ceph.osd_superblock.role",
7858 			FT_INT32, BASE_DEC, NULL, 0,
7859 			NULL, HFILL
7860 		} },
7861 		{ &hf_osd_superblock_epoch, {
7862 			"Epoch", "ceph.osd_superblock.epoch",
7863 			FT_UINT32, BASE_DEC, NULL, 0,
7864 			NULL, HFILL
7865 		} },
7866 		{ &hf_osd_superblock_map_old, {
7867 			"Oldest Map", "ceph.osd_superblock.map_old",
7868 			FT_UINT32, BASE_DEC, NULL, 0,
7869 			NULL, HFILL
7870 		} },
7871 		{ &hf_osd_superblock_map_new, {
7872 			"Newest Map", "ceph.osd_superblock.map_new",
7873 			FT_UINT32, BASE_DEC, NULL, 0,
7874 			NULL, HFILL
7875 		} },
7876 		{ &hf_osd_superblock_weight, {
7877 			"Weight", "ceph.osd_superblock.weight",
7878 			FT_DOUBLE, BASE_NONE, NULL, 0,
7879 			NULL, HFILL
7880 		} },
7881 		{ &hf_osd_superblock_mounted, {
7882 			"Mounted", "ceph.osd_superblock.mounted",
7883 			FT_UINT32, BASE_DEC, NULL, 0,
7884 			"Last epoch mounted.", HFILL
7885 		} },
7886 		{ &hf_osd_superblock_osdfsid, {
7887 			"OSD FSID", "ceph.osd_superblock.osdfsid",
7888 			FT_GUID, BASE_NONE, NULL, 0,
7889 			NULL, HFILL
7890 		} },
7891 		{ &hf_osd_superblock_clean, {
7892 			"Clean Through", "ceph.osd_superblock.clean",
7893 			FT_UINT32, BASE_DEC, NULL, 0,
7894 			"Last epoch active and clean.", HFILL
7895 		} },
7896 		{ &hf_osd_superblock_full, {
7897 			"Last Marked Full", "ceph.osd_superblock.full",
7898 			FT_UINT32, BASE_DEC, NULL, 0,
7899 			"Last epoch OSDMap was marked full.", HFILL
7900 		} },
7901 		{ &hf_osdinfo_ver, {
7902 			"Encoding Version", "ceph.osdinfo.ver",
7903 			FT_UINT8, BASE_DEC, NULL, 0,
7904 			NULL, HFILL
7905 		} },
7906 		{ &hf_osdinfo_lastclean_begin, {
7907 			"Last Clean Begin", "ceph.osdinfo.lastclean.begin",
7908 			FT_UINT32, BASE_DEC, NULL, 0,
7909 			"The start of the last interval that ended with "
7910 			"a clean shutdown.", HFILL
7911 		} },
7912 		{ &hf_osdinfo_lastclean_end, {
7913 			"Last Clean End", "ceph.osdinfo.lastclean.end",
7914 			FT_UINT32, BASE_DEC, NULL, 0,
7915 			"The end of the last interval that ended with a "
7916 			"clean shutdown.", HFILL
7917 		} },
7918 		{ &hf_osdinfo_up_from, {
7919 			"Up From", "ceph.osdinfo.up.from",
7920 			FT_UINT32, BASE_DEC, NULL, 0,
7921 			"Epoch OSD was marked up.", HFILL
7922 		} },
7923 		{ &hf_osdinfo_up_through, {
7924 			"Up Through", "ceph.osdinfo.up.through",
7925 			FT_UINT32, BASE_DEC, NULL, 0,
7926 			"Last epoch before OSD died.", HFILL
7927 		} },
7928 		{ &hf_osdinfo_downat, {
7929 			"Down At", "ceph.osdinfo.downat",
7930 			FT_UINT32, BASE_DEC, NULL, 0,
7931 			"First epoch after OSD died.", HFILL
7932 		} },
7933 		{ &hf_osdinfo_lostat, {
7934 			"Lost At", "ceph.osdinfo.lostat",
7935 			FT_UINT32, BASE_DEC, NULL, 0,
7936 			"Last epoch where the data was decided \"lost\".", HFILL
7937 		} },
7938 		{ &hf_osdxinfo_down, {
7939 			"Down At", "ceph.osdxinfo.downat",
7940 			FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
7941 			"Time when OSD was last marked down.", HFILL
7942 		} },
7943 		{ &hf_osdxinfo_laggy_probability, {
7944 			"Laggy Probability", "ceph.osdxinfo.laggy.probability",
7945 			FT_UINT32, BASE_DEC, NULL, 0,
7946 			"Probability that the OSD is laggy. (out of 0xFFFFFFFF)", HFILL
7947 		} },
7948 		{ &hf_osdxinfo_laggy_interval, {
7949 			"Laggy Interval", "ceph.osdxinfo.laggy.interval",
7950 			FT_UINT32, BASE_DEC, NULL, 0,
7951 			"Average interval between being marked laggy and recovering.", HFILL
7952 		} },
7953 		{ &hf_osdxinfo_oldweight, {
7954 			"Old Weight", "ceph.osdxinfo.oldweight",
7955 			FT_UINT32, BASE_DEC, NULL, 0,
7956 			NULL, HFILL
7957 		} },
7958 		{ &hf_perfstat_commitlatency, {
7959 			"Commit Latency", "ceph.perfstat.commitlatency",
7960 			FT_UINT32, BASE_DEC, NULL, 0,
7961 			NULL, HFILL
7962 		} },
7963 		{ &hf_perfstat_applylatency, {
7964 			"Apply Latency", "ceph.perfstat.applylatency",
7965 			FT_UINT32, BASE_DEC, NULL, 0,
7966 			NULL, HFILL
7967 		} },
7968 		{ &hf_osdstat, {
7969 			"OSD Stats", "ceph.osdstat",
7970 			FT_NONE, BASE_NONE, NULL, 0,
7971 			NULL, HFILL
7972 		} },
7973 		{ &hf_osdstat_kb, {
7974 			"KiB", "ceph.osdstat.kb",
7975 			FT_UINT64, BASE_DEC, NULL, 0,
7976 			NULL, HFILL
7977 		} },
7978 		{ &hf_osdstat_kbused, {
7979 			"KiB Used", "ceph.osdstat.kbused",
7980 			FT_UINT64, BASE_DEC, NULL, 0,
7981 			NULL, HFILL
7982 		} },
7983 		{ &hf_osdstat_kbavail, {
7984 			"KiB Available", "ceph.osdstat.kbavail",
7985 			FT_UINT64, BASE_DEC, NULL, 0,
7986 			NULL, HFILL
7987 		} },
7988 		{ &hf_osdstat_trimqueue, {
7989 			"Trim Queue", "ceph.osdstat.trimqueue",
7990 			FT_UINT32, BASE_DEC, NULL, 0,
7991 			NULL, HFILL
7992 		} },
7993 		{ &hf_osdstat_hbin, {
7994 			"Heartbeats In", "ceph.osdstat.hbin",
7995 			FT_UINT32, BASE_DEC, NULL, 0,
7996 			NULL, HFILL
7997 		} },
7998 		{ &hf_osdstat_hbout, {
7999 			"Heartbeats Out", "ceph.osdstat.hbout",
8000 			FT_UINT32, BASE_DEC, NULL, 0,
8001 			NULL, HFILL
8002 		} },
8003 		{ &hf_osdstat_opqueue, {
8004 			"Op Queue", "ceph.osdstat.opqueue",
8005 			FT_UINT32, BASE_DEC, NULL, 0,
8006 			NULL, HFILL
8007 		} },
8008 		{ &hf_osdstat_fsperf, {
8009 			"Filesystem Performance", "ceph.osdstat.fsperf",
8010 			FT_NONE, BASE_NONE, NULL, 0,
8011 			NULL, HFILL
8012 		} },
8013 		{ &hf_osdstat_trimming, {
8014 			"Number Trimming", "ceph.osdstat.trimming",
8015 			FT_UINT32, BASE_DEC, NULL, 0,
8016 			NULL, HFILL
8017 		} },
8018 		{ &hf_osdmap, {
8019 			"OSD Map", "ceph.osdmap",
8020 			FT_NONE, BASE_NONE, NULL, 0,
8021 			NULL, HFILL
8022 		} },
8023 		{ &hf_osdmap_client, {
8024 			"Client-Usable Data", "ceph.osdmap.client",
8025 			FT_NONE, BASE_NONE, NULL, 0,
8026 			NULL, HFILL
8027 		} },
8028 		{ &hf_osdmap_fsid, {
8029 			"FSID", "ceph.osdmap.fsid",
8030 			FT_GUID, BASE_NONE, NULL, 0,
8031 			NULL, HFILL
8032 		} },
8033 		{ &hf_osdmap_epoch, {
8034 			"Epoch", "ceph.osdmap.epoch",
8035 			FT_UINT32, BASE_DEC, NULL, 0,
8036 			NULL, HFILL
8037 		} },
8038 		{ &hf_osdmap_created, {
8039 			"Time Created", "ceph.osdmap.created",
8040 			FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
8041 			NULL, HFILL
8042 		} },
8043 		{ &hf_osdmap_modified, {
8044 			"Last Modified", "ceph.osdmap.modified",
8045 			FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
8046 			NULL, HFILL
8047 		} },
8048 		{ &hf_osdmap_pool, {
8049 			"Pool", "ceph.osdmap.pool",
8050 			FT_NONE, BASE_NONE, NULL, 0,
8051 			NULL, HFILL
8052 		} },
8053 		{ &hf_osdmap_pool_id, {
8054 			"ID", "ceph.osdmap.pool.id",
8055 			FT_UINT64, BASE_HEX, NULL, 0,
8056 			NULL, HFILL
8057 		} },
8058 		{ &hf_osdmap_poolname_item, {
8059 			"Pool Name", "ceph.osdmap.poolname.item",
8060 			FT_NONE, BASE_NONE, NULL, 0,
8061 			NULL, HFILL
8062 		} },
8063 		{ &hf_osdmap_poolname, {
8064 			"Name", "ceph.osdmap.poolname",
8065 			FT_STRING, BASE_NONE, NULL, 0,
8066 			NULL, HFILL
8067 		} },
8068 		{ &hf_osdmap_poolmax, {
8069 			"Highest Pool ID", "ceph.osdmap.poolmax",
8070 			FT_INT32, BASE_DEC, NULL, 0,
8071 			NULL, HFILL
8072 		} },
8073 		{ &hf_osdmap_flags, {
8074 			"Flags", "ceph.osdmap.flags",
8075 			FT_UINT32, BASE_HEX, NULL, 0,
8076 			NULL, HFILL
8077 		} },
8078 		{ &hf_osdmap_osdmax, {
8079 			"Highest OSD Number", "ceph.osdmap.osdmax",
8080 			FT_INT32, BASE_DEC, NULL, 0,
8081 			NULL, HFILL
8082 		} },
8083 		{ &hf_osdmap_osd_state, {
8084 			"OSD State", "ceph.osdmap.osd.state",
8085 			FT_UINT8, BASE_HEX, NULL, 0,
8086 			NULL, HFILL
8087 		} },
8088 		{ &hf_osdmap_osd_weight, {
8089 			"OSD Weight", "ceph.osdmap.osd.weight",
8090 			FT_UINT32, BASE_DEC, NULL, 0,
8091 			NULL, HFILL
8092 		} },
8093 		{ &hf_osdmap_osd_addr, {
8094 			"OSD Address", "ceph.osdmap.address",
8095 			FT_NONE, BASE_NONE, NULL, 0,
8096 			NULL, HFILL
8097 		} },
8098 		{ &hf_osdmap_pgtmp, {
8099 			"Temporary Placement Group Mapping", "ceph.osdmap.pgtmp",
8100 			FT_NONE, BASE_NONE, NULL, 0,
8101 			NULL, HFILL
8102 		} },
8103 		{ &hf_osdmap_pgtmp_pg, {
8104 			"Placement Group", "ceph.osdmap.pgtmp.pg",
8105 			FT_NONE, BASE_NONE, NULL, 0,
8106 			NULL, HFILL
8107 		} },
8108 		{ &hf_osdmap_pgtmp_val, {
8109 			"Value", "ceph.osdmap.pgtmp.val",
8110 			FT_UINT32, BASE_DEC, NULL, 0,
8111 			NULL, HFILL
8112 		} },
8113 		{ &hf_osdmap_primarytmp, {
8114 			"Temporary Primary Mapping", "ceph.osdmap.primarytmp",
8115 			FT_NONE, BASE_NONE, NULL, 0,
8116 			NULL, HFILL
8117 		} },
8118 		{ &hf_osdmap_primarytmp_pg, {
8119 			"Placement Group", "ceph.osdmap.primarytmp.pg",
8120 			FT_NONE, BASE_NONE, NULL, 0,
8121 			NULL, HFILL
8122 		} },
8123 		{ &hf_osdmap_primarytmp_val, {
8124 			"Value", "ceph.osdmap.primarytmp.val",
8125 			FT_UINT32, BASE_DEC, NULL, 0,
8126 			NULL, HFILL
8127 		} },
8128 		{ &hf_osdmap_osd_primaryaffinity, {
8129 			"Primary Affinity", "ceph.osdmap.osd.primaryaffinity",
8130 			FT_UINT32, BASE_DEC, NULL, 0,
8131 			NULL, HFILL
8132 		} },
8133 		{ &hf_crush, {
8134 			"CRUSH Rules", "ceph.crush",
8135 			FT_NONE, BASE_NONE, NULL, 0,
8136 			NULL, HFILL
8137 		} },
8138 		{ &hf_osd_peerstat, {
8139 			"Peer Stat", "ceph.osd.peerstat",
8140 			FT_NONE, BASE_NONE, NULL, 0,
8141 			NULL, HFILL
8142 		} },
8143 		{ &hf_osd_peerstat_timestamp, {
8144 			"Timestamp", "ceph.osd.peerstat.timestamp",
8145 			FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
8146 			NULL, HFILL
8147 		} },
8148 		{ &hf_featureset_mask, {
8149 			"Feature Mask", "ceph.featureset.mask",
8150 			FT_UINT64, BASE_DEC, NULL, 0,
8151 			NULL, HFILL
8152 		} },
8153 		{ &hf_featureset_name, {
8154 			"Name", "ceph.featureset.name",
8155 			FT_NONE, BASE_NONE, NULL, 0,
8156 			NULL, HFILL
8157 		} },
8158 		{ &hf_featureset_name_val, {
8159 			"Value", "ceph.featureset.name.val",
8160 			FT_UINT64, BASE_DEC, NULL, 0,
8161 			NULL, HFILL
8162 		} },
8163 		{ &hf_featureset_name_name, {
8164 			"Name", "ceph.featureset.name.name",
8165 			FT_STRING, BASE_NONE, NULL, 0,
8166 			NULL, HFILL
8167 		} },
8168 		{ &hf_compatset, {
8169 			"Compat Set", "ceph.compatset",
8170 			FT_NONE, BASE_NONE, NULL, 0,
8171 			NULL, HFILL
8172 		} },
8173 		{ &hf_compatset_compat, {
8174 			"Compatible", "ceph.compatset.compat",
8175 			FT_NONE, BASE_NONE, NULL, 0,
8176 			NULL, HFILL
8177 		} },
8178 		{ &hf_compatset_compatro, {
8179 			"Read-Only Compatible", "ceph.compatset.rocompat",
8180 			FT_NONE, BASE_NONE, NULL, 0,
8181 			NULL, HFILL
8182 		} },
8183 		{ &hf_compatset_incompat, {
8184 			"Incompatible", "ceph.compatset.incompat",
8185 			FT_NONE, BASE_NONE, NULL, 0,
8186 			NULL, HFILL
8187 		} },
8188 		{ &hf_osdmap_erasurecodeprofile, {
8189 			"Erasure Code Profile", "ceph.osdmap.erasurecodeprofile",
8190 			FT_NONE, BASE_NONE, NULL, 0,
8191 			NULL, HFILL
8192 		} },
8193 		{ &hf_osdmap_erasurecodeprofile_name, {
8194 			"Profile Name", "ceph.osdmap.erasurecodeprofile.name",
8195 			FT_STRING, BASE_NONE, NULL, 0,
8196 			NULL, HFILL
8197 		} },
8198 		{ &hf_osdmap_erasurecodeprofile_prop, {
8199 			"Property", "ceph.osdmap.erasurecodeprofile.prop",
8200 			FT_NONE, BASE_NONE, NULL, 0,
8201 			NULL, HFILL
8202 		} },
8203 		{ &hf_osdmap_erasurecodeprofile_k, {
8204 			"Key", "ceph.osdmap.erasurecodeprofile.key",
8205 			FT_STRING, BASE_NONE, NULL, 0,
8206 			NULL, HFILL
8207 		} },
8208 		{ &hf_osdmap_erasurecodeprofile_v, {
8209 			"Value", "ceph.osdmap.erasurecodeprofile.value",
8210 			FT_STRING, BASE_NONE, NULL, 0,
8211 			NULL, HFILL
8212 		} },
8213 		{ &hf_osdmap_osd, {
8214 			"OSD-Only Data", "ceph.osdmap.osd",
8215 			FT_NONE, BASE_NONE, NULL, 0,
8216 			NULL, HFILL
8217 		} },
8218 		{ &hf_osdmap_hbaddr_back, {
8219 			"Cluster-side Heartbeat Address", "ceph.osdmap.nbbackaddr",
8220 			FT_NONE, BASE_NONE, NULL, 0,
8221 			"The address checked to ensure the OSD is reachable by "
8222 			"the cluster.", HFILL
8223 		} },
8224 		{ &hf_osdmap_osd_info, {
8225 			"OSD Info", "ceph.osdmap.osd.info",
8226 			FT_NONE, BASE_NONE, NULL, 0,
8227 			NULL, HFILL
8228 		} },
8229 		{ &hf_osdmap_blacklist, {
8230 			"Blacklist", "ceph.osdmap.blacklist",
8231 			FT_NONE, BASE_NONE, NULL, 0,
8232 			NULL, HFILL
8233 		} },
8234 		{ &hf_osdmap_blacklist_addr, {
8235 			"Address", "ceph.osdmap.blacklist.addr",
8236 			FT_NONE, BASE_NONE, NULL, 0,
8237 			NULL, HFILL
8238 		} },
8239 		{ &hf_osdmap_blacklist_time, {
8240 			"Time", "ceph.osdmap.blacklist.time",
8241 			FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
8242 			NULL, HFILL
8243 		} },
8244 		{ &hf_osdmap_cluster_addr, {
8245 			"Cluster Address", "ceph.osdmap.cluster.addr",
8246 			FT_NONE, BASE_NONE, NULL, 0,
8247 			NULL, HFILL
8248 		} },
8249 		{ &hf_osdmap_cluster_snapepoch, {
8250 			"Cluster Snapshot Epoch", "ceph.osdmap.cluster.snapepoch",
8251 			FT_UINT32, BASE_DEC, NULL, 0,
8252 			NULL, HFILL
8253 		} },
8254 		{ &hf_osdmap_cluster_snap, {
8255 			"Cluster Snapshot", "ceph.osdmap.cluster.snap",
8256 			FT_STRING, BASE_NONE, NULL, 0,
8257 			NULL, HFILL
8258 		} },
8259 		{ &hf_osdmap_osd_uuid, {
8260 			"OSD UUID", "ceph.osdmap.osd.uuid",
8261 			FT_GUID, BASE_NONE, NULL, 0,
8262 			NULL, HFILL
8263 		} },
8264 		{ &hf_osdmap_osd_xinfo, {
8265 			"OSD xinfo", "ceph.osdmap.osd.xinfo",
8266 			FT_NONE, BASE_NONE, NULL, 0,
8267 			NULL, HFILL
8268 		} },
8269 		{ &hf_osdmap_hbaddr_front, {
8270 			"Client-side Heartbeat Address", "ceph.osdmap.hbfrontaddr",
8271 			FT_NONE, BASE_NONE, NULL, 0,
8272 			"The address checked to ensure the OSD is reachable "
8273 			"by the client.", HFILL
8274 		} },
8275 		{ &hf_osdmap_inc, {
8276 			"Incremental OSD Map", "ceph.osdmap_inc",
8277 			FT_NONE, BASE_NONE, NULL, 0,
8278 			NULL, HFILL
8279 		} },
8280 		{ &hf_osdmap_inc_client, {
8281 			"Client-Usable Data", "ceph.osdmap_inc.client",
8282 			FT_NONE, BASE_NONE, NULL, 0,
8283 			NULL, HFILL
8284 		} },
8285 		{ &hf_osdmap_inc_fsid, {
8286 			"FSID", "ceph.osdmap_inc.fsid",
8287 			FT_GUID, BASE_NONE, NULL, 0,
8288 			NULL, HFILL
8289 		} },
8290 		{ &hf_osdmap_inc_osd, {
8291 			"OSD-Only Data", "ceph.osdmap_inc.osd",
8292 			FT_NONE, BASE_NONE, NULL, 0,
8293 			NULL, HFILL
8294 		} },
8295 		{ &hf_connect, {
8296 			"Connection Negotiation", "ceph.connect",
8297 			FT_NONE, BASE_NONE, NULL, 0,
8298 			NULL, HFILL
8299 		} },
8300 		{ &hf_features_low, {
8301 			"Features", "ceph.connect.features.low",
8302 			FT_UINT32, BASE_HEX, NULL, 0,
8303 			NULL, HFILL
8304 		} },
8305 		{ &hf_features_high, {
8306 			"Features", "ceph.connect.features.high",
8307 			FT_UINT32, BASE_HEX, NULL, 0,
8308 			NULL, HFILL
8309 		} },
8310 		{ &hf_feature_uid, {
8311 			"UID", "ceph.features.uid",
8312 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_UID,
8313 			NULL, HFILL
8314 		} },
8315 		{ &hf_feature_nosrcaddr, {
8316 			"NOSRCADDR", "ceph.features.nosrcaddr",
8317 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_NOSRCADDR,
8318 			NULL, HFILL
8319 		} },
8320 		{ &hf_feature_monclockcheck, {
8321 			"MONCLOCKCHECK", "ceph.features.monclockcheck",
8322 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_MONCLOCKCHECK,
8323 			NULL, HFILL
8324 		} },
8325 		{ &hf_feature_flock, {
8326 			"FLOCK", "ceph.features.flock",
8327 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_FLOCK,
8328 			NULL, HFILL
8329 		} },
8330 		{ &hf_feature_subscribe2, {
8331 			"SUBSCRIBE2", "ceph.features.subscribe2",
8332 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_SUBSCRIBE2,
8333 			NULL, HFILL
8334 		} },
8335 		{ &hf_feature_monnames, {
8336 			"MONNAMES", "ceph.features.monnames",
8337 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_MONNAMES,
8338 			NULL, HFILL
8339 		} },
8340 		{ &hf_feature_reconnect_seq, {
8341 			"RECONNECT_SEQ", "ceph.features.reconnect_seq",
8342 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_RECONNECT_SEQ,
8343 			NULL, HFILL
8344 		} },
8345 		{ &hf_feature_dirlayouthash, {
8346 			"DIRLAYOUTHASH", "ceph.features.dirlayouthash",
8347 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_DIRLAYOUTHASH,
8348 			NULL, HFILL
8349 		} },
8350 		{ &hf_feature_objectlocator, {
8351 			"OBJECTLOCATOR", "ceph.features.objectlocator",
8352 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_OBJECTLOCATOR,
8353 			NULL, HFILL
8354 		} },
8355 		{ &hf_feature_pgid64, {
8356 			"PGID64", "ceph.features.pgid64",
8357 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_PGID64,
8358 			NULL, HFILL
8359 		} },
8360 		{ &hf_feature_incsubosdmap, {
8361 			"INCSUBOSDMAP", "ceph.features.incsubosdmap",
8362 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_INCSUBOSDMAP,
8363 			NULL, HFILL
8364 		} },
8365 		{ &hf_feature_pgpool3, {
8366 			"PGPOOL3", "ceph.features.pgpool3",
8367 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_PGPOOL3,
8368 			NULL, HFILL
8369 		} },
8370 		{ &hf_feature_osdreplymux, {
8371 			"OSDREPLYMUX", "ceph.features.osdreplymux",
8372 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_OSDREPLYMUX,
8373 			NULL, HFILL
8374 		} },
8375 		{ &hf_feature_osdenc, {
8376 			"OSDENC", "ceph.features.osdenc",
8377 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_OSDENC,
8378 			NULL, HFILL
8379 		} },
8380 		{ &hf_feature_omap, {
8381 			"OMAP", "ceph.features.omap",
8382 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_OMAP,
8383 			NULL, HFILL
8384 		} },
8385 		{ &hf_feature_monenc, {
8386 			"MONENC", "ceph.features.monenc",
8387 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_MONENC,
8388 			NULL, HFILL
8389 		} },
8390 		{ &hf_feature_query_t, {
8391 			"QUERY_T", "ceph.features.query_t",
8392 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_QUERY_T,
8393 			NULL, HFILL
8394 		} },
8395 		{ &hf_feature_indep_pg_map, {
8396 			"INDEP_PG_MAP", "ceph.features.indep_pg_map",
8397 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_INDEP_PG_MAP,
8398 			NULL, HFILL
8399 		} },
8400 		{ &hf_feature_crush_tunables, {
8401 			"CRUSH_TUNABLES", "ceph.features.crush_tunables",
8402 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_CRUSH_TUNABLES,
8403 			NULL, HFILL
8404 		} },
8405 		{ &hf_feature_chunky_scrub, {
8406 			"CHUNKY_SCRUB", "ceph.features.chunky_scrub",
8407 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_CHUNKY_SCRUB,
8408 			NULL, HFILL
8409 		} },
8410 		{ &hf_feature_mon_nullroute, {
8411 			"MON_NULLROUTE", "ceph.features.mon_nullroute",
8412 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_MON_NULLROUTE,
8413 			NULL, HFILL
8414 		} },
8415 		{ &hf_feature_mon_gv, {
8416 			"MON_GV", "ceph.features.mon_gv",
8417 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_MON_GV,
8418 			NULL, HFILL
8419 		} },
8420 		{ &hf_feature_backfill_reservation, {
8421 			"BACKFILL_RESERVATION", "ceph.features.backfill_reservation",
8422 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_BACKFILL_RESERVATION,
8423 			NULL, HFILL
8424 		} },
8425 		{ &hf_feature_msg_auth, {
8426 			"MSG_AUTH", "ceph.features.msg_auth",
8427 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_MSG_AUTH,
8428 			NULL, HFILL
8429 		} },
8430 		{ &hf_feature_recovery_reservation, {
8431 			"RECOVERY_RESERVATION", "ceph.features.recovery_reservation",
8432 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_RECOVERY_RESERVATION,
8433 			NULL, HFILL
8434 		} },
8435 		{ &hf_feature_crush_tunables2, {
8436 			"CRUSH_TUNABLES2", "ceph.features.crush_tunables2",
8437 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_CRUSH_TUNABLES2,
8438 			NULL, HFILL
8439 		} },
8440 		{ &hf_feature_createpoolid, {
8441 			"CREATEPOOLID", "ceph.features.createpoolid",
8442 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_CREATEPOOLID,
8443 			NULL, HFILL
8444 		} },
8445 		{ &hf_feature_reply_create_inode, {
8446 			"REPLY_CREATE_INODE", "ceph.features.reply_create_inode",
8447 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_REPLY_CREATE_INODE,
8448 			NULL, HFILL
8449 		} },
8450 		{ &hf_feature_osd_hbmsgs, {
8451 			"OSD_HBMSGS", "ceph.features.osd_hbmsgs",
8452 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_OSD_HBMSGS,
8453 			NULL, HFILL
8454 		} },
8455 		{ &hf_feature_mdsenc, {
8456 			"MDSENC", "ceph.features.mdsenc",
8457 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_MDSENC,
8458 			NULL, HFILL
8459 		} },
8460 		{ &hf_feature_osdhashpspool, {
8461 			"OSDHASHPSPOOL", "ceph.features.osdhashpspool",
8462 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_OSDHASHPSPOOL,
8463 			NULL, HFILL
8464 		} },
8465 		{ &hf_feature_mon_single_paxos, {
8466 			"MON_SINGLE_PAXOS", "ceph.features.mon_single_paxos",
8467 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_MON_SINGLE_PAXOS,
8468 			NULL, HFILL
8469 		} },
8470 		{ &hf_feature_osd_snapmapper, {
8471 			"OSD_SNAPMAPPER", "ceph.features.osd_snapmapper",
8472 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_OSD_SNAPMAPPER,
8473 			NULL, HFILL
8474 		} },
8475 		{ &hf_feature_mon_scrub, {
8476 			"MON_SCRUB", "ceph.features.mon_scrub",
8477 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_MON_SCRUB,
8478 			NULL, HFILL
8479 		} },
8480 		{ &hf_feature_osd_packed_recovery, {
8481 			"OSD_PACKED_RECOVERY", "ceph.features.osd_packed_recovery",
8482 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_OSD_PACKED_RECOVERY,
8483 			NULL, HFILL
8484 		} },
8485 		{ &hf_feature_osd_cachepool, {
8486 			"OSD_CACHEPOOL", "ceph.features.osd_cachepool",
8487 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_OSD_CACHEPOOL,
8488 			NULL, HFILL
8489 		} },
8490 		{ &hf_feature_crush_v2, {
8491 			"CRUSH_V2", "ceph.features.crush_v2",
8492 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_CRUSH_V2,
8493 			NULL, HFILL
8494 		} },
8495 		{ &hf_feature_export_peer, {
8496 			"EXPORT_PEER", "ceph.features.export_peer",
8497 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_EXPORT_PEER,
8498 			NULL, HFILL
8499 		} },
8500 		{ &hf_feature_osd_erasure_codes, {
8501 			"OSD_ERASURE_CODES", "ceph.features.osd_erasure_codes",
8502 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_OSD_ERASURE_CODES,
8503 			NULL, HFILL
8504 		} },
8505 		{ &hf_feature_osd_tmap2omap, {
8506 			"OSD_TMAP2OMAP", "ceph.features.osd_tmap2omap",
8507 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_OSD_TMAP2OMAP,
8508 			NULL, HFILL
8509 		} },
8510 		{ &hf_feature_osdmap_enc, {
8511 			"OSDMAP_ENC", "ceph.features.osdmap_enc",
8512 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_OSDMAP_ENC,
8513 			NULL, HFILL
8514 		} },
8515 		{ &hf_feature_mds_inline_data, {
8516 			"MDS_INLINE_DATA", "ceph.features.mds_inline_data",
8517 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_MDS_INLINE_DATA,
8518 			NULL, HFILL
8519 		} },
8520 		{ &hf_feature_crush_tunables3, {
8521 			"CRUSH_TUNABLES3", "ceph.features.crush_tunables3",
8522 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_CRUSH_TUNABLES3,
8523 			NULL, HFILL
8524 		} },
8525 		{ &hf_feature_osd_primary_affinity, {
8526 			"OSD_PRIMARY_AFFINITY", "ceph.features.osd_primary_affinity",
8527 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_OSD_PRIMARY_AFFINITY,
8528 			NULL, HFILL
8529 		} },
8530 		{ &hf_feature_msgr_keepalive2, {
8531 			"MSGR_KEEPALIVE2", "ceph.features.msgr_keepalive2",
8532 			FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), C_FEATURE_MSGR_KEEPALIVE2,
8533 			NULL, HFILL
8534 		} },
8535 		{ &hf_feature_reserved, {
8536 			"RESERVED", "ceph.features.reserved",
8537 			FT_BOOLEAN, 32, TFS(&tfs_set_notset), C_FEATURE_RESERVED,
8538 			NULL, HFILL
8539 		} },
8540 		{ &hf_connect_host_type, {
8541 			"Host Type", "ceph.connect.host",
8542 			FT_UINT32, BASE_HEX, VALS(c_node_type_strings), 0,
8543 			"The type of host.", HFILL
8544 		} },
8545 		{ &hf_connect_seq_global, {
8546 			"Global Sequence Number", "ceph.connect.global_seq",
8547 			FT_UINT32, BASE_DEC, NULL, 0,
8548 			"The number of connections initiated by this host.", HFILL
8549 		} },
8550 		{ &hf_connect_seq, {
8551 			"Sequence Number", "ceph.connect.seq",
8552 			FT_UINT32, BASE_DEC, NULL, 0,
8553 			"The number of connections initiated this session.", HFILL
8554 		} },
8555 		{ &hf_connect_proto_ver, {
8556 			"Protocol Version", "ceph.connect.ver",
8557 			FT_UINT32, BASE_DEC, NULL, 0,
8558 			"The protocol version to use.", HFILL
8559 		} },
8560 		{ &hf_connect_auth_proto, {
8561 			"Authentication Protocol", "ceph.connect.auth.proto",
8562 			FT_UINT32, BASE_DEC, NULL, 0,
8563 			"The authentication protocol to use.", HFILL
8564 		} },
8565 		{ &hf_connect_auth_size, {
8566 			"Authentication Size", "ceph.connect.auth.size",
8567 			FT_UINT32, BASE_DEC, NULL, 0,
8568 			"The size of the authentication.", HFILL
8569 		} },
8570 		{ &hf_connect_auth, {
8571 			"Authentication", "ceph.connect.auth",
8572 			FT_BYTES, BASE_NONE, NULL, 0,
8573 			"Authentication data.", HFILL
8574 		} },
8575 		{ &hf_flags, {
8576 			"Flags", "ceph.connect.flags",
8577 			FT_UINT8, BASE_HEX, NULL, 0,
8578 			NULL, HFILL
8579 		} },
8580 		{ &hf_flag_lossy, {
8581 			"Lossy", "ceph.flags.lossy",
8582 			FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), C_FLAG_LOSSY,
8583 			"Messages may be safely dropped.", HFILL
8584 		} },
8585 		{ &hf_osd_flags, {
8586 			"OSD Flags", "ceph.osd_flags",
8587 			FT_UINT32, BASE_HEX, NULL, 0,
8588 			NULL, HFILL
8589 		} },
8590 		{ &hf_osd_flag_ack, {
8591 			"ACK", "ceph.osd_flags.ack",
8592 			FT_BOOLEAN, 32, TFS(&tfs_yes_no), C_OSD_FLAG_ACK,
8593 			"want (or is) \"ack\" ack", HFILL
8594 		} },
8595 		{ &hf_osd_flag_onnvram, {
8596 			"ACK on NVRAM", "ceph.osd_flags.onnvram",
8597 			FT_BOOLEAN, 32, TFS(&tfs_yes_no), C_OSD_FLAG_ONNVRAM,
8598 			"want (or is) \"onnvram\" ack", HFILL
8599 		} },
8600 		{ &hf_osd_flag_ondisk, {
8601 			"ACK on DISK", "ceph.osd_flags.ondisk",
8602 			FT_BOOLEAN, 32, TFS(&tfs_yes_no), C_OSD_FLAG_ONDISK,
8603 			"want (or is) \"ondisk\" ack", HFILL
8604 		} },
8605 		{ &hf_osd_flag_retry, {
8606 			"Retry", "ceph.osd_flags.retry",
8607 			FT_BOOLEAN, 32, TFS(&tfs_yes_no), C_OSD_FLAG_RETRY,
8608 			"resend attempt", HFILL
8609 		} },
8610 		{ &hf_osd_flag_read, {
8611 			"Read", "ceph.osd_flags.read",
8612 			FT_BOOLEAN, 32, TFS(&tfs_yes_no), C_OSD_FLAG_READ,
8613 			"op may read", HFILL
8614 		} },
8615 		{ &hf_osd_flag_write, {
8616 			"Write", "ceph.osd_flags.write",
8617 			FT_BOOLEAN, 32, TFS(&tfs_yes_no), C_OSD_FLAG_WRITE,
8618 			"op may write", HFILL
8619 		} },
8620 		{ &hf_osd_flag_ordersnap, {
8621 			"ORDERSNAP", "ceph.osd_flags.ordersnap",
8622 			FT_BOOLEAN, 32, TFS(&tfs_yes_no), C_OSD_FLAG_ORDERSNAP,
8623 			"EOLDSNAP if snapc is out of order", HFILL
8624 		} },
8625 		{ &hf_osd_flag_peerstat_old, {
8626 			"PEERSTAT_OLD", "ceph.osd_flags.peerstat_old",
8627 			FT_BOOLEAN, 32, TFS(&tfs_yes_no), C_OSD_FLAG_PEERSTAT_OLD,
8628 			"DEPRECATED msg includes osd_peer_stat", HFILL
8629 		} },
8630 		{ &hf_osd_flag_balance_reads, {
8631 			"BALANCE_READS", "ceph.osd_flags.balance_reads",
8632 			FT_BOOLEAN, 32, TFS(&tfs_yes_no), C_OSD_FLAG_BALANCE_READS,
8633 			NULL, HFILL
8634 		} },
8635 		{ &hf_osd_flag_parallelexec, {
8636 			"PARALLELEXEC", "ceph.osd_flags.parallelexec",
8637 			FT_BOOLEAN, 32, TFS(&tfs_yes_no), C_OSD_FLAG_PARALLELEXEC,
8638 			"execute op in parallel", HFILL
8639 		} },
8640 		{ &hf_osd_flag_pgop, {
8641 			"PGOP", "ceph.osd_flags.pgop",
8642 			FT_BOOLEAN, 32, TFS(&tfs_yes_no), C_OSD_FLAG_PGOP,
8643 			"pg op, no object", HFILL
8644 		} },
8645 		{ &hf_osd_flag_exec, {
8646 			"EXEC", "ceph.osd_flags.exec",
8647 			FT_BOOLEAN, 32, TFS(&tfs_yes_no), C_OSD_FLAG_EXEC,
8648 			"op may exec", HFILL
8649 		} },
8650 		{ &hf_osd_flag_exec_public, {
8651 			"EXEC_PUBLIC", "ceph.osd_flags.exec_public",
8652 			FT_BOOLEAN, 32, TFS(&tfs_yes_no), C_OSD_FLAG_EXEC_PUBLIC,
8653 			"DEPRECATED op may exec (public)", HFILL
8654 		} },
8655 		{ &hf_osd_flag_localize_reads, {
8656 			"LOCALIZE_READS", "ceph.osd_flags.localize_reads",
8657 			FT_BOOLEAN, 32, TFS(&tfs_yes_no), C_OSD_FLAG_LOCALIZE_READS,
8658 			"read from nearby replica, if any", HFILL
8659 		} },
8660 		{ &hf_osd_flag_rwordered, {
8661 			"RWORDERED", "ceph.osd_flags.rwordered",
8662 			FT_BOOLEAN, 32, TFS(&tfs_yes_no), C_OSD_FLAG_RWORDERED,
8663 			"order wrt concurrent reads", HFILL
8664 		} },
8665 		{ &hf_osd_flag_ignore_cache, {
8666 			"IGNORE_CACHE", "ceph.osd_flags.ignore_cache",
8667 			FT_BOOLEAN, 32, TFS(&tfs_yes_no), C_OSD_FLAG_IGNORE_CACHE,
8668 			"ignore cache logic", HFILL
8669 		} },
8670 		{ &hf_osd_flag_skiprwlocks, {
8671 			"SKIPRWLOCKS", "ceph.osd_flags.skiprwlocks",
8672 			FT_BOOLEAN, 32, TFS(&tfs_yes_no), C_OSD_FLAG_SKIPRWLOCKS,
8673 			"skip rw locks", HFILL
8674 		} },
8675 		{ &hf_osd_flag_ignore_overlay, {
8676 			"IGNORE_OVERLAY", "ceph.osd_flags.ignore_overlay",
8677 			FT_BOOLEAN, 32, TFS(&tfs_yes_no), C_OSD_FLAG_IGNORE_OVERLAY,
8678 			"ignore pool overlay", HFILL
8679 		} },
8680 		{ &hf_osd_flag_flush, {
8681 			"FLUSH", "ceph.osd_flags.flush",
8682 			FT_BOOLEAN, 32, TFS(&tfs_yes_no), C_OSD_FLAG_FLUSH,
8683 			"this is part of flush", HFILL
8684 		} },
8685 		{ &hf_osd_flag_map_snap_clone, {
8686 			"MAP_SNAP_CLONE", "ceph.osd_flags.map_snap_clone",
8687 			FT_BOOLEAN, 32, TFS(&tfs_yes_no), C_OSD_FLAG_MAP_SNAP_CLONE,
8688 			"map snap direct to clone id", HFILL
8689 		} },
8690 		{ &hf_osd_flag_enforce_snapc, {
8691 			"ENFORCE_SNAPC", "ceph.osd_flags.enforce_snapc",
8692 			FT_BOOLEAN, 32, TFS(&tfs_yes_no), C_OSD_FLAG_ENFORCE_SNAPC,
8693 			"use snapc provided even if pool uses pool snaps", HFILL
8694 		} },
8695 		{ &hf_osd_op_type, {
8696 			"Operation", "ceph.osd_op.op",
8697 			FT_UINT16, BASE_HEX|BASE_EXT_STRING, &c_osd_optype_strings_ext, 0,
8698 			NULL, HFILL
8699 		} },
8700 		{ &hf_osd_op_data, {
8701 			"Operation Specific Data", "ceph.osd_op.data",
8702 			FT_BYTES, BASE_NONE, NULL, 0,
8703 			NULL, HFILL
8704 		} },
8705 		{ &hf_osd_op_extent_off, {
8706 			"Offset", "ceph.osd_op.extent.offset",
8707 			FT_UINT64, BASE_DEC, NULL, 0,
8708 			NULL, HFILL
8709 		} },
8710 		{ &hf_osd_op_extent_size, {
8711 			"Size", "ceph.osd_op.extent.size",
8712 			FT_UINT64, BASE_DEC, NULL, 0,
8713 			NULL, HFILL
8714 		} },
8715 		{ &hf_osd_op_extent_trunc_size, {
8716 			"Truncate Size", "ceph.osd_op.extent.trunc_size",
8717 			FT_UINT64, BASE_DEC, NULL, 0,
8718 			NULL, HFILL
8719 		} },
8720 		{ &hf_osd_op_extent_trunc_seq, {
8721 			"Truncate Sequence", "ceph.osd_op.extent.trunc_seq",
8722 			FT_UINT64, BASE_DEC, NULL, 0,
8723 			NULL, HFILL
8724 		} },
8725 		{ &hf_osd_op_payload_size, {
8726 			"Payload Size", "ceph.osd_op.payload_size",
8727 			FT_UINT32, BASE_DEC, NULL, 0,
8728 			NULL, HFILL
8729 		} },
8730 		{ &hf_osd_redirect_oloc, {
8731 			"Object Locater", "ceph.osd_redirect.oloc",
8732 			FT_NONE, BASE_NONE, NULL, 0,
8733 			NULL, HFILL
8734 		} },
8735 		{ &hf_osd_redirect_obj, {
8736 			"Object Name", "ceph.osd_redirect.obj",
8737 			FT_BYTES, BASE_NONE, NULL, 0,
8738 			"Redirect to this object.", HFILL
8739 		} },
8740 		{ &hf_osd_redirect_osdinstr, {
8741 			"OSD Instructions", "ceph.osd_redirect.osd_instructions",
8742 			FT_NONE, BASE_NONE, NULL, 0,
8743 			"Instructions to pass to the new target.", HFILL
8744 		} },
8745 		{ &hf_osd_redirect_osdinstr_data, {
8746 			"Data", "ceph.osd_redirect.osd_instructions_data",
8747 			FT_BYTES, BASE_NONE, NULL, 0,
8748 			NULL, HFILL
8749 		} },
8750 		{ &hf_osd_redirect_osdinstr_len, {
8751 			"Length", "ceph.osd_redirect.osd_instructions_len",
8752 			FT_UINT32, BASE_DEC, NULL, 0,
8753 			NULL, HFILL
8754 		} },
8755 		{ &hf_statsum_bytes, {
8756 			"Bytes", "ceph.statsum.bytes",
8757 			FT_UINT64, BASE_DEC, NULL, 0,
8758 			"The space used in bytes.", HFILL
8759 		} },
8760 		{ &hf_statsum_objects, {
8761 			"Objects", "ceph.statsum.objects",
8762 			FT_UINT64, BASE_DEC, NULL, 0,
8763 			"The number of logical objects.", HFILL
8764 		} },
8765 		{ &hf_statsum_clones, {
8766 			"Clones", "ceph.statsum.clones",
8767 			FT_UINT64, BASE_DEC, NULL, 0,
8768 			NULL, HFILL
8769 		} },
8770 		{ &hf_statsum_copies, {
8771 			"Copies", "ceph.statsum.copies",
8772 			FT_UINT64, BASE_DEC, NULL, 0,
8773 			"The total number of objects including redundant "
8774 			"copies (objects*replicas).", HFILL
8775 		} },
8776 		{ &hf_statsum_missing, {
8777 			"Missing Objects", "ceph.statsum.missing",
8778 			FT_UINT64, BASE_DEC, NULL, 0,
8779 			NULL, HFILL
8780 		} },
8781 		{ &hf_statsum_degraded, {
8782 			"Degraded Objects", "ceph.statsum.degraded",
8783 			FT_UINT64, BASE_DEC, NULL, 0,
8784 			"Number of objects that are on at least one OSD but "
8785 			"less then they should be.", HFILL
8786 		} },
8787 		{ &hf_statsum_unfound, {
8788 			"Unfound Objects", "ceph.statsum.unfound",
8789 			FT_UINT64, BASE_DEC, NULL, 0,
8790 			"Number of objects with no copies.", HFILL
8791 		} },
8792 		{ &hf_statsum_read_bytes, {
8793 			"Bytes Read", "ceph.statsum.read_bytes",
8794 			FT_UINT64, BASE_DEC, NULL, 0,
8795 			NULL, HFILL
8796 		} },
8797 		{ &hf_statsum_read_kbytes, {
8798 			"Kibibytes Read", "ceph.statsum.read_kbytes",
8799 			FT_UINT64, BASE_DEC, NULL, 0,
8800 			"The number of KiB (2^10) read.", HFILL
8801 		} },
8802 		{ &hf_statsum_written_bytes, {
8803 			"Bytes Written", "ceph.statsum.written_bytes",
8804 			FT_UINT64, BASE_DEC, NULL, 0,
8805 			NULL, HFILL
8806 		} },
8807 		{ &hf_statsum_written_kbytes, {
8808 			"Kibibytes Written", "ceph.statsum.written_kbytes",
8809 			FT_UINT64, BASE_DEC, NULL, 0,
8810 			"The number of KiB (2^10) written.", HFILL
8811 		} },
8812 		{ &hf_statsum_scrub_errors, {
8813 			"Scrub Errors", "ceph.statsum.scrub_errors",
8814 			FT_UINT64, BASE_DEC, NULL, 0,
8815 			"Total scrub errors. (shallow+deep)", HFILL
8816 		} },
8817 		{ &hf_statsum_recovered, {
8818 			"Recovered Objects", "ceph.statsum.recovered",
8819 			FT_UINT64, BASE_DEC, NULL, 0,
8820 			NULL, HFILL
8821 		} },
8822 		{ &hf_statsum_bytes_recovered, {
8823 			"Recovered Bytes", "ceph.statsum.bytes_recovered",
8824 			FT_UINT64, BASE_DEC, NULL, 0,
8825 			NULL, HFILL
8826 		} },
8827 		{ &hf_statsum_keys_recovered, {
8828 			"Keys Recovered", "ceph.statsum.keys_recovered",
8829 			FT_UINT64, BASE_DEC, NULL, 0,
8830 			NULL, HFILL
8831 		} },
8832 		{ &hf_statsum_shallow_scrub_errors, {
8833 			"Shallow Scrub Errors", "ceph.statsum.shallow_scrub_errors",
8834 			FT_UINT64, BASE_DEC, NULL, 0,
8835 			NULL, HFILL
8836 		} },
8837 		{ &hf_statsum_deep_scrub_errors, {
8838 			"Deep Scrub Errors", "ceph.statsum.deep_scrub_errors",
8839 			FT_UINT64, BASE_DEC, NULL, 0,
8840 			NULL, HFILL
8841 		} },
8842 		{ &hf_statsum_dirty, {
8843 			"Dirty Objects", "ceph.statsum.dirty",
8844 			FT_UINT64, BASE_DEC, NULL, 0,
8845 			NULL, HFILL
8846 		} },
8847 		{ &hf_statsum_whiteouts, {
8848 			"Whiteouts", "ceph.statsum.whiteouts",
8849 			FT_UINT64, BASE_DEC, NULL, 0,
8850 			NULL, HFILL
8851 		} },
8852 		{ &hf_statsum_omap, {
8853 			"OMAP Objects", "ceph.statsum.omap",
8854 			FT_UINT64, BASE_DEC, NULL, 0,
8855 			NULL, HFILL
8856 		} },
8857 		{ &hf_statsum_hitset_archive, {
8858 			"Hit Set Archive", "ceph.statsum.hitset_archive",
8859 			FT_UINT64, BASE_DEC, NULL, 0,
8860 			NULL, HFILL
8861 		} },
8862 		{ &hf_connect_reply, {
8863 			"Connection Negotiation Reply", "ceph.connect_reply",
8864 			FT_NONE, BASE_NONE, NULL, 0,
8865 			NULL, HFILL
8866 		} },
8867 		{ &hf_tag, {
8868 			"Tag", "ceph.tag",
8869 			FT_UINT8, BASE_HEX|BASE_EXT_STRING, &c_tag_strings_ext, 0,
8870 			NULL, HFILL
8871 		} },
8872 		{ &hf_ack, {
8873 			"Acknowledgment", "ceph.ack",
8874 			FT_UINT64, BASE_DEC, NULL, 0,
8875 			NULL, HFILL
8876 		} },
8877 		{ &hf_seq_existing, {
8878 			"Existing Sequence Number", "ceph.seq_existing",
8879 			FT_UINT64, BASE_DEC, NULL, 0,
8880 			NULL, HFILL
8881 		} },
8882 		{ &hf_seq_new, {
8883 			"Newly Acknowledged Sequence Number", "ceph.seq_new",
8884 			FT_UINT64, BASE_DEC, NULL, 0,
8885 			NULL, HFILL
8886 		} },
8887 		{ &hf_head, {
8888 			"Message Header", "ceph.head",
8889 			FT_NONE, BASE_NONE, NULL, 0,
8890 			NULL, HFILL
8891 		} },
8892 		{ &hf_head_seq, {
8893 			"Sequence Number", "ceph.seq",
8894 			FT_UINT64, BASE_DEC, NULL, 0,
8895 			NULL, HFILL
8896 		} },
8897 		{ &hf_head_tid, {
8898 			"Transaction ID", "ceph.tid",
8899 			FT_UINT64, BASE_DEC, NULL, 0,
8900 			NULL, HFILL
8901 		} },
8902 		{ &hf_head_type, {
8903 			"Type", "ceph.type",
8904 			FT_UINT16, BASE_HEX|BASE_EXT_STRING, &c_msg_type_strings_ext, 0,
8905 			"Message type.", HFILL
8906 		} },
8907 		{ &hf_head_priority, {
8908 			"Priority", "ceph.priority",
8909 			FT_UINT16, BASE_DEC, NULL, 0,
8910 			"The priority of this message, higher the more urgent.", HFILL
8911 		} },
8912 		{ &hf_head_version, {
8913 			"Version", "ceph.head_version",
8914 			FT_UINT16, BASE_DEC, NULL, 0,
8915 			NULL, HFILL
8916 		} },
8917 		{ &hf_head_front_size, {
8918 			"Front Size", "ceph.front_size",
8919 			FT_UINT32, BASE_DEC, NULL, 0,
8920 			NULL, HFILL
8921 		} },
8922 		{ &hf_head_middle_size, {
8923 			"Middle Size", "ceph.middle_size",
8924 			FT_UINT32, BASE_DEC, NULL, 0,
8925 			NULL, HFILL
8926 		} },
8927 		{ &hf_head_data_size, {
8928 			"Data Size", "ceph.data_size",
8929 			FT_UINT32, BASE_DEC, NULL, 0,
8930 			NULL, HFILL
8931 		} },
8932 		{ &hf_head_data_off, {
8933 			"Data Offset", "ceph.data_off",
8934 			FT_UINT16, BASE_DEC, NULL, 0,
8935 			NULL, HFILL
8936 		} },
8937 		{ &hf_head_srcname, {
8938 			"Source Name", "ceph.node",
8939 			FT_NONE, BASE_NONE, NULL, 0,
8940 			NULL, HFILL
8941 		} },
8942 		{ &hf_head_compat_version, {
8943 			"Compatibility Version", "ceph.compat_version",
8944 			FT_UINT64, BASE_DEC, NULL, 0,
8945 			"The oldest code that can probably decode this message.", HFILL
8946 		} },
8947 		{ &hf_head_reserved, {
8948 			"Reserved", "ceph.reserved",
8949 			FT_UINT16, BASE_HEX, NULL, 0,
8950 			NULL, HFILL
8951 		} },
8952 		{ &hf_head_crc, {
8953 			"CRC Checksum", "ceph.crc",
8954 			FT_UINT32, BASE_HEX, NULL, 0,
8955 			NULL, HFILL
8956 		} },
8957 		{ &hf_foot, {
8958 			"Message Footer", "ceph.foot",
8959 			FT_NONE, BASE_NONE, NULL, 0,
8960 			NULL, HFILL
8961 		} },
8962 		{ &hf_foot_front_crc, {
8963 			"Front Checksum", "ceph.foot.front_crc",
8964 			FT_UINT32, BASE_HEX, NULL, 0,
8965 			NULL, HFILL
8966 		} },
8967 		{ &hf_foot_middle_crc, {
8968 			"Middle Checksum", "ceph.foot.middle_crc",
8969 			FT_UINT32, BASE_HEX, NULL, 0,
8970 			NULL, HFILL
8971 		} },
8972 		{ &hf_foot_data_crc, {
8973 			"Data Checksum", "ceph.foot.data_crc",
8974 			FT_UINT32, BASE_HEX, NULL, 0,
8975 			NULL, HFILL
8976 		} },
8977 		{ &hf_foot_signature, {
8978 			"Signature", "ceph.foot.signature",
8979 			FT_UINT64, BASE_HEX, NULL, 0,
8980 			NULL, HFILL
8981 		} },
8982 		{ &hf_msg_front, {
8983 			"Front", "ceph.front",
8984 			FT_BYTES, BASE_NONE, NULL, 0,
8985 			NULL, HFILL
8986 		} },
8987 		{ &hf_msg_middle, {
8988 			"Middle", "ceph.mid",
8989 			FT_BYTES, BASE_NONE, NULL, 0,
8990 			NULL, HFILL
8991 		} },
8992 		{ &hf_msg_data, {
8993 			"Data", "ceph.data",
8994 			FT_BYTES, BASE_NONE, NULL, 0,
8995 			NULL, HFILL
8996 		} },
8997 		{ &hf_statcollection, {
8998 			"Stats", "ceph.statcollection",
8999 			FT_NONE, BASE_NONE, NULL, 0,
9000 			NULL, HFILL
9001 		} },
9002 		{ &hf_paxos, {
9003 			"Paxos Message", "ceph.paxos",
9004 			FT_NONE, BASE_NONE, NULL, 0,
9005 			NULL, HFILL
9006 		} },
9007 		{ &hf_paxos_ver, {
9008 			"Paxos Version", "ceph.paxos.ver",
9009 			FT_UINT64, BASE_DEC, NULL, 0,
9010 			NULL, HFILL
9011 		} },
9012 		{ &hf_paxos_mon, {
9013 			"Mon", "ceph.paxos.mon",
9014 			FT_INT16, BASE_DEC, NULL, 0,
9015 			NULL, HFILL
9016 		} },
9017 		{ &hf_paxos_mon_tid, {
9018 			"Mon Transaction ID", "ceph.paxos.tid",
9019 			FT_UINT64, BASE_DEC, NULL, 0,
9020 			NULL, HFILL
9021 		} },
9022 		{ &hf_msg_mon_map, {
9023 			"Mon Map Message", "ceph.msg.mon_map",
9024 			FT_NONE, BASE_NONE, NULL, 0,
9025 			NULL, HFILL
9026 		} },
9027 		{ &hf_msg_statfs, {
9028 			"Stat Filesystem", "ceph.msg.statfs",
9029 			FT_NONE, BASE_NONE, NULL, 0,
9030 			NULL, HFILL
9031 		} },
9032 		{ &hf_msg_statfs_fsid, {
9033 			"FSID", "ceph.msg.statfs.fsid",
9034 			FT_GUID, BASE_NONE, NULL, 0,
9035 			NULL, HFILL
9036 		} },
9037 		{ &hf_msg_statfsreply, {
9038 			"Stat Filesystem Reply", "ceph.msg.statfsreply",
9039 			FT_NONE, BASE_NONE, NULL, 0,
9040 			NULL, HFILL
9041 		} },
9042 		{ &hf_msg_statfsreply_fsid, {
9043 			"FSID", "ceph.msg.statfsreply.fsid",
9044 			FT_GUID, BASE_NONE, NULL, 0,
9045 			NULL, HFILL
9046 		} },
9047 		{ &hf_msg_statfsreply_ver, {
9048 			"Version", "ceph.msg.statfsreply.ver",
9049 			FT_UINT64, BASE_DEC, NULL, 0,
9050 			NULL, HFILL
9051 		} },
9052 		{ &hf_msg_statfsreply_kb, {
9053 			"Kibibytes", "ceph.msg.statfsreply.kb",
9054 			FT_UINT64, BASE_DEC, NULL, 0,
9055 			NULL, HFILL
9056 		} },
9057 		{ &hf_msg_statfsreply_kbused, {
9058 			"Kibibytes Used", "ceph.msg.statfsreply.kbused",
9059 			FT_UINT64, BASE_DEC, NULL, 0,
9060 			NULL, HFILL
9061 		} },
9062 		{ &hf_msg_statfsreply_kbavail, {
9063 			"Kibibytes Available", "ceph.msg.statfsreply.kbavail",
9064 			FT_UINT64, BASE_DEC, NULL, 0,
9065 			NULL, HFILL
9066 		} },
9067 		{ &hf_msg_statfsreply_obj, {
9068 			"Number of Objects", "ceph.msg.statfsreply.obj",
9069 			FT_UINT64, BASE_DEC, NULL, 0,
9070 			NULL, HFILL
9071 		} },
9072 		{ &hf_msg_mon_sub, {
9073 			"Mon Subscribe Message", "ceph.msg.mon_sub",
9074 			FT_NONE, BASE_NONE, NULL, 0,
9075 			NULL, HFILL
9076 		} },
9077 		{ &hf_msg_mon_sub_item, {
9078 			"Subscription Item", "ceph.msg.mon_sub.item",
9079 			FT_NONE, BASE_NONE, NULL, 0,
9080 			NULL, HFILL
9081 		} },
9082 		{ &hf_msg_mon_sub_item_len, {
9083 			"Number of items", "ceph.msg.mon_sub.item_len",
9084 			FT_UINT32, BASE_DEC, NULL, 0,
9085 			NULL, HFILL
9086 		} },
9087 		{ &hf_msg_mon_sub_what, {
9088 			"What", "ceph.msg.mon_sub.what",
9089 			FT_STRING, BASE_NONE, NULL, 0,
9090 			"What to subscribe to.", HFILL
9091 		} },
9092 		{ &hf_msg_mon_sub_start, {
9093 			"Start Time", "ceph.msg.mon_sub.start",
9094 			FT_UINT64, BASE_DEC, NULL, 0,
9095 			NULL, HFILL
9096 		} },
9097 		{ &hf_msg_mon_sub_flags, {
9098 			"Flags", "ceph.msg.mon_sub.flags",
9099 			FT_UINT8, BASE_HEX, NULL, 0,
9100 			NULL, HFILL
9101 		} },
9102 		{ &hf_msg_mon_sub_flags_onetime, {
9103 			"One Time", "ceph.msg.mon_sub.flags.onetime",
9104 			FT_BOOLEAN, 8, TFS(&tfs_yes_no), C_MON_SUB_FLAG_ONETIME,
9105 			NULL, HFILL
9106 		} },
9107 		{ &hf_msg_mon_sub_ack, {
9108 			"Subscription Acknowledgment", "ceph.msg.mon_sub_ack",
9109 			FT_NONE, BASE_NONE, NULL, 0,
9110 			NULL, HFILL
9111 		} },
9112 		{ &hf_msg_mon_sub_ack_interval, {
9113 			"Interval", "ceph.msg.mon_sub_ack.interval",
9114 			FT_UINT32, BASE_DEC, NULL, 0,
9115 			NULL, HFILL
9116 		} },
9117 		{ &hf_msg_mon_sub_ack_fsid, {
9118 			"FSID", "ceph.msg.mon_sub_ack.fsid",
9119 			FT_GUID, BASE_NONE, NULL, 0,
9120 			NULL, HFILL
9121 		} },
9122 		{ &hf_msg_auth, {
9123 			"Auth Message", "ceph.msg.auth",
9124 			FT_NONE, BASE_NONE, NULL, 0,
9125 			NULL, HFILL
9126 		} },
9127 		{ &hf_msg_auth_proto, {
9128 			"Protocol", "ceph.msg.auth.proto",
9129 			FT_UINT32, BASE_HEX, VALS(c_auth_proto_strings), 0,
9130 			NULL, HFILL
9131 		} },
9132 		{ &hf_msg_auth_supportedproto, {
9133 			"Supported Protocols", "ceph.msg.auth.supportedproto",
9134 			FT_NONE, BASE_NONE, NULL, 0,
9135 			NULL, HFILL
9136 		} },
9137 		{ &hf_msg_auth_supportedproto_ver, {
9138 			"Encoding Version", "ceph.msg.auth.supportedproto.ver",
9139 			FT_UINT8, BASE_DEC, NULL, 0,
9140 			NULL, HFILL
9141 		} },
9142 		{ &hf_msg_auth_supportedproto_proto, {
9143 			"Supported Protocol", "ceph.msg.auth.supportedproto.proto",
9144 			FT_UINT32, BASE_HEX, VALS(c_auth_proto_strings), 0,
9145 			NULL, HFILL
9146 		} },
9147 		{ &hf_msg_auth_supportedproto_gid, {
9148 			"Global ID", "ceph.msg.auth.supportedproto.gid",
9149 			FT_UINT64, BASE_HEX, NULL, 0,
9150 			NULL, HFILL
9151 		} },
9152 		{ &hf_msg_auth_cephx, {
9153 			"CephX", "ceph.msg.auth.cephx",
9154 			FT_NONE, BASE_NONE, NULL, 0,
9155 			NULL, HFILL
9156 		} },
9157 		{ &hf_msg_auth_cephx_req_type, {
9158 			"Type", "ceph.msg.auth.cephx.req.type",
9159 			FT_UINT16, BASE_HEX, VALS(c_cephx_req_type_strings), 0,
9160 			NULL, HFILL
9161 		} },
9162 		{ &hf_msg_auth_monmap_epoch, {
9163 			"Monmap epoch", "ceph.msg.auth.monmap_epoch",
9164 			FT_UINT32, BASE_DEC, NULL, 0,
9165 			NULL, HFILL
9166 		} },
9167 		{ &hf_msg_auth_reply, {
9168 			"Auth Reply Message", "ceph.msg.auth_reply",
9169 			FT_NONE, BASE_NONE, NULL, 0,
9170 			NULL, HFILL
9171 		} },
9172 		{ &hf_msg_auth_reply_proto, {
9173 			"Protocol", "ceph.msg.auth_reply.proto",
9174 			FT_UINT32, BASE_HEX, VALS(c_auth_proto_strings), 0,
9175 			NULL, HFILL
9176 		} },
9177 		{ &hf_msg_auth_reply_result, {
9178 			"Result", "ceph.msg.auth_reply.result",
9179 			FT_INT32, BASE_DEC, NULL, 0,
9180 			NULL, HFILL
9181 		} },
9182 		{ &hf_msg_auth_reply_global_id, {
9183 			"Global ID", "ceph.msg.auth_reply.id",
9184 			FT_UINT64, BASE_HEX, NULL, 0,
9185 			NULL, HFILL
9186 		} },
9187 		{ &hf_msg_auth_reply_msg, {
9188 			"Message", "ceph.msg.auth_reply.msg",
9189 			FT_STRING, BASE_NONE, NULL, 0,
9190 			NULL, HFILL
9191 		} },
9192 		{ &hf_msg_mon_getversion, {
9193 			"Get Version", "ceph.msg.mon.getversion",
9194 			FT_NONE, BASE_NONE, NULL, 0,
9195 			NULL, HFILL
9196 		} },
9197 		{ &hf_msg_mon_getversion_tid, {
9198 			"Transaction ID", "ceph.msg.mon.getversion.tid",
9199 			FT_UINT64, BASE_DEC, NULL, 0,
9200 			NULL, HFILL
9201 		} },
9202 		{ &hf_msg_mon_getversion_what, {
9203 			"What", "ceph.msg.mon.getversion.what",
9204 			FT_STRING, BASE_NONE, NULL, 0,
9205 			NULL, HFILL
9206 		} },
9207 		{ &hf_msg_mon_getversionreply, {
9208 			"Get Version Reply", "ceph.msg.mon.getversionreply",
9209 			FT_NONE, BASE_NONE, NULL, 0,
9210 			NULL, HFILL
9211 		} },
9212 		{ &hf_msg_mon_getversionreply_tid, {
9213 			"Transaction ID", "ceph.msg.mon.getversionreply.tid",
9214 			FT_UINT64, BASE_DEC, NULL, 0,
9215 			NULL, HFILL
9216 		} },
9217 		{ &hf_msg_mon_getversionreply_ver, {
9218 			"Version", "ceph.msg.mon.getversionreply.ver",
9219 			FT_UINT64, BASE_DEC, NULL, 0,
9220 			NULL, HFILL
9221 		} },
9222 		{ &hf_msg_mon_getversionreply_veroldest, {
9223 			"Oldest Version", "ceph.msg.mon.getversionreply.veroldest",
9224 			FT_UINT64, BASE_DEC, NULL, 0,
9225 			NULL, HFILL
9226 		} },
9227 		{ &hf_msg_mds_map, {
9228 			"OSD Map Message", "ceph.msg.osd_map",
9229 			FT_NONE, BASE_NONE, NULL, 0,
9230 			NULL, HFILL
9231 		} },
9232 		{ &hf_msg_mds_map_fsid, {
9233 			"FSID", "ceph.msg.osd_map.fsid",
9234 			FT_GUID, BASE_NONE, NULL, 0,
9235 			NULL, HFILL
9236 		} },
9237 		{ &hf_msg_mds_map_epoch, {
9238 			"Epoch", "ceph.msg.osd_map.epoch",
9239 			FT_UINT32, BASE_DEC, NULL, 0,
9240 			NULL, HFILL
9241 		} },
9242 		{ &hf_msg_mds_map_datai, {
9243 			"OSD Map Data", "ceph.msg.osd_map.datai",
9244 			FT_NONE, BASE_NONE, NULL, 0,
9245 			NULL, HFILL
9246 		} },
9247 		{ &hf_msg_mds_map_data, {
9248 			"Data", "ceph.msg.osd_map.data",
9249 			FT_BYTES, BASE_NONE, NULL, 0,
9250 			NULL, HFILL
9251 		} },
9252 		{ &hf_msg_mds_map_data_size, {
9253 			"Size", "ceph.msg.osd_map.size",
9254 			FT_UINT32, BASE_DEC, NULL, 0,
9255 			NULL, HFILL
9256 		} },
9257 		{ &hf_msg_client_sess, {
9258 			"Client Session", "ceph.msg.client_sess",
9259 			FT_NONE, BASE_NONE, NULL, 0,
9260 			NULL, HFILL
9261 		} },
9262 		{ &hf_msg_client_sess_op, {
9263 			"Operation", "ceph.msg.client_sess.op",
9264 			FT_UINT32, BASE_HEX|BASE_EXT_STRING, &c_session_op_type_strings_ext, 0,
9265 			NULL, HFILL
9266 		} },
9267 		{ &hf_msg_client_sess_seq, {
9268 			"Sequence Number", "ceph.msg.client_sess.seq",
9269 			FT_UINT64, BASE_DEC, NULL, 0,
9270 			NULL, HFILL
9271 		} },
9272 		{ &hf_msg_client_sess_time, {
9273 			"Timestamp", "ceph.msg.client_sess.time",
9274 			FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
9275 			NULL, HFILL
9276 		} },
9277 		{ &hf_msg_client_sess_caps_max, {
9278 			"Maximum Capabilities", "ceph.msg.client_sess.caps_max",
9279 			FT_UINT32, BASE_DEC, NULL, 0,
9280 			NULL, HFILL
9281 		} },
9282 		{ &hf_msg_client_sess_leases_max, {
9283 			"Maximum Leases", "ceph.msg.client_sess.leases_max",
9284 			FT_UINT32, BASE_DEC, NULL, 0,
9285 			NULL, HFILL
9286 		} },
9287 		{ &hf_msg_client_req, {
9288 			"Client Request", "ceph.msg.client_req",
9289 			FT_NONE, BASE_NONE, NULL, 0,
9290 			NULL, HFILL
9291 		} },
9292 		{ &hf_msg_client_req_oldest_tid, {
9293 			"Oldest TID", "ceph.msg.client_req.oldest_tid",
9294 			FT_UINT64, BASE_DEC, NULL, 0,
9295 			NULL, HFILL
9296 		} },
9297 		{ &hf_msg_client_req_mdsmap_epoch, {
9298 			"MDS Map Epoch", "ceph.msg.client_req.mdsmap_epoch",
9299 			FT_UINT32, BASE_DEC, NULL, 0,
9300 			NULL, HFILL
9301 		} },
9302 		{ &hf_msg_client_req_flags, {
9303 			"Flags", "ceph.msg.client_req.flags",
9304 			FT_UINT8, BASE_HEX, NULL, 0,
9305 			NULL, HFILL
9306 		} },
9307 		{ &hf_msg_client_req_retry, {
9308 			"Number of Retries", "ceph.msg.client_req.retry",
9309 			FT_UINT8, BASE_DEC, NULL, 0,
9310 			NULL, HFILL
9311 		} },
9312 		{ &hf_msg_client_req_forward, {
9313 			"Number of Forwards", "ceph.msg.client_req.forward",
9314 			FT_UINT8, BASE_DEC, NULL, 0,
9315 			NULL, HFILL
9316 		} },
9317 		{ &hf_msg_client_req_releases, {
9318 			"Number of Releases", "ceph.msg.client_req.releases",
9319 			FT_UINT16, BASE_DEC, NULL, 0,
9320 			NULL, HFILL
9321 		} },
9322 		{ &hf_msg_client_req_op, {
9323 			"Operation", "ceph.msg.client_req.op",
9324 			FT_UINT32, BASE_HEX|BASE_EXT_STRING, &c_mds_op_type_strings_ext, 0,
9325 			NULL, HFILL
9326 		} },
9327 		{ &hf_msg_client_req_caller_uid, {
9328 			"Caller User ID", "ceph.msg.client_req.caller_uid",
9329 			FT_UINT32, BASE_DEC, NULL, 0,
9330 			NULL, HFILL
9331 		} },
9332 		{ &hf_msg_client_req_caller_gid, {
9333 			"Caller Group ID", "ceph.msg.client_req.caller_gid",
9334 			FT_UINT32, BASE_DEC, NULL, 0,
9335 			NULL, HFILL
9336 		} },
9337 		{ &hf_msg_client_req_inode, {
9338 			"Inode", "ceph.msg.client_req.inode",
9339 			FT_UINT64, BASE_DEC, NULL, 0,
9340 			NULL, HFILL
9341 		} },
9342 		{ &hf_msg_client_req_path_src, {
9343 			"Path", "ceph.msg.client_req.path_src",
9344 			FT_NONE, BASE_NONE, NULL, 0,
9345 			NULL, HFILL
9346 		} },
9347 		{ &hf_msg_client_req_path_dst, {
9348 			"Second Path", "ceph.msg.client_req.path_dst",
9349 			FT_NONE, BASE_NONE, NULL, 0,
9350 			NULL, HFILL
9351 		} },
9352 		{ &hf_msg_client_req_release, {
9353 			"Release", "ceph.msg.client_req.release",
9354 			FT_NONE, BASE_NONE, NULL, 0,
9355 			NULL, HFILL
9356 		} },
9357 		{ &hf_msg_client_req_time, {
9358 			"Timestamp", "ceph.msg.client_req.time",
9359 			FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
9360 			NULL, HFILL
9361 		} },
9362 		{ &hf_msg_client_reqfwd, {
9363 			"Client Request Forward", "ceph.msg.client_reqfwd",
9364 			FT_NONE, BASE_NONE, NULL, 0,
9365 			NULL, HFILL
9366 		} },
9367 		{ &hf_msg_client_reqfwd_dst, {
9368 			"Destination MDS", "ceph.msg.client_reqfwd.dst",
9369 			FT_UINT32, BASE_DEC, NULL, 0,
9370 			NULL, HFILL
9371 		} },
9372 		{ &hf_msg_client_reqfwd_fwd, {
9373 			"Number of Forwards", "ceph.msg.client_reqfwd.fwd",
9374 			FT_UINT32, BASE_DEC, NULL, 0,
9375 			NULL, HFILL
9376 		} },
9377 		{ &hf_msg_client_reqfwd_resend, {
9378 			"Resend", "ceph.msg.client_reqfwd.resend",
9379 			FT_BOOLEAN, BASE_NONE, NULL, 0,
9380 			"Does the client have to resend the request?", HFILL
9381 		} },
9382 		{ &hf_msg_client_reply, {
9383 			"Client Reply", "ceph.msg.client_reply",
9384 			FT_NONE, BASE_NONE, NULL, 0,
9385 			NULL, HFILL
9386 		} },
9387 		{ &hf_msg_client_reply_op, {
9388 			"Operation", "ceph.msg.client_reply.op",
9389 			FT_UINT32, BASE_DEC|BASE_EXT_STRING, &c_mds_op_type_strings_ext, 0,
9390 			NULL, HFILL
9391 		} },
9392 		{ &hf_msg_client_reply_result, {
9393 			"Result", "ceph.msg.client_reply.result",
9394 			FT_UINT32, BASE_DEC, NULL, 0,
9395 			NULL, HFILL
9396 		} },
9397 		{ &hf_msg_client_reply_mdsmap_epoch, {
9398 			"MDS Map Epoch", "ceph.msg.client_reply.mdsmap_epoch",
9399 			FT_UINT32, BASE_DEC, NULL, 0,
9400 			NULL, HFILL
9401 		} },
9402 		{ &hf_msg_client_reply_isdentry, {
9403 			"Is Dentry", "ceph.msg.client_reply.isdentry",
9404 			FT_BOOLEAN, BASE_NONE, NULL, 0,
9405 			NULL, HFILL
9406 		} },
9407 		{ &hf_msg_client_reply_istarget, {
9408 			"Is Target", "ceph.msg.client_reply.istarget",
9409 			FT_BOOLEAN, BASE_NONE, NULL, 0,
9410 			NULL, HFILL
9411 		} },
9412 		{ &hf_msg_client_reply_trace, {
9413 			"Trace", "ceph.msg.client_reply.trace",
9414 			FT_NONE, BASE_NONE, NULL, 0,
9415 			NULL, HFILL
9416 		} },
9417 		{ &hf_msg_client_reply_extra, {
9418 			"Extra", "ceph.msg.client_reply.extra",
9419 			FT_NONE, BASE_NONE, NULL, 0,
9420 			NULL, HFILL
9421 		} },
9422 		{ &hf_msg_client_reply_snaps, {
9423 			"Snapshots", "ceph.msg.client_reply.snaps",
9424 			FT_NONE, BASE_NONE, NULL, 0,
9425 			NULL, HFILL
9426 		} },
9427 		{ &hf_msg_client_reply_safe, {
9428 			"Committed to Permanent Storage", "ceph.msg.client_reply.safe",
9429 			FT_BOOLEAN, BASE_NONE, NULL, 0,
9430 			NULL, HFILL
9431 		} },
9432 		{ &hf_msg_osd_map, {
9433 			"OSD Map Message", "ceph.msg.osd_map",
9434 			FT_NONE, BASE_NONE, NULL, 0,
9435 			NULL, HFILL
9436 		} },
9437 		{ &hf_msg_osd_map_fsid, {
9438 			"FSID", "ceph.msg.osd_map.fsid",
9439 			FT_GUID, BASE_NONE, NULL, 0,
9440 			NULL, HFILL
9441 		} },
9442 		{ &hf_msg_osd_map_inc, {
9443 			"Incremental Map", "ceph.msg.osd_map.inc",
9444 			FT_NONE, BASE_NONE, NULL, 0,
9445 			NULL, HFILL
9446 		} },
9447 		{ &hf_msg_osd_map_inc_len, {
9448 			"Incremental Map Count", "ceph.msg.osd_map.inc_len",
9449 			FT_UINT32, BASE_DEC, NULL, 0,
9450 			NULL, HFILL
9451 		} },
9452 		{ &hf_msg_osd_map_map, {
9453 			"Map", "ceph.msg.osd_map.map",
9454 			FT_NONE, BASE_NONE, NULL, 0,
9455 			NULL, HFILL
9456 		} },
9457 		{ &hf_msg_osd_map_map_len, {
9458 			"Map Count", "ceph.msg.osd_map.map_size",
9459 			FT_UINT32, BASE_DEC, NULL, 0,
9460 			NULL, HFILL
9461 		} },
9462 		{ &hf_msg_osd_map_epoch, {
9463 			"Epoch", "ceph.msg.osd_map.epoch",
9464 			FT_UINT32, BASE_DEC, NULL, 0,
9465 			NULL, HFILL
9466 		} },
9467 		{ &hf_msg_osd_map_oldest, {
9468 			"Oldest Map", "ceph.msg.osd_map.oldest",
9469 			FT_UINT32, BASE_DEC, NULL, 0,
9470 			NULL, HFILL
9471 		} },
9472 		{ &hf_msg_osd_map_newest, {
9473 			"Newest Map", "ceph.msg.osd_map.newest",
9474 			FT_UINT32, BASE_DEC, NULL, 0,
9475 			NULL, HFILL
9476 		} },
9477 		{ &hf_msg_osd_op, {
9478 			"OSD Operation", "ceph.msg.osd_op",
9479 			FT_NONE, BASE_NONE, NULL, 0,
9480 			NULL, HFILL
9481 		} },
9482 		{ &hf_msg_osd_op_client_inc, {
9483 			"Client Inc", "ceph.msg.osd_op.client_inc",
9484 			FT_UINT32, BASE_DEC, NULL, 0,
9485 			NULL, HFILL
9486 		} },
9487 		{ &hf_msg_osd_op_osdmap_epoch, {
9488 			"OSD Map Epoch", "ceph.msg.osd_op.osdmap_epoch",
9489 			FT_UINT32, BASE_DEC, NULL, 0,
9490 			NULL, HFILL
9491 		} },
9492 		{ &hf_msg_osd_op_mtime, {
9493 			"Modification Time", "ceph.msg.osd_op.mtime",
9494 			FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
9495 			NULL, HFILL
9496 		} },
9497 		{ &hf_msg_osd_op_reassert_version, {
9498 			"Reassert Version", "ceph.msg.osd_op.reassert_version",
9499 			FT_NONE, BASE_NONE, NULL, 0,
9500 			NULL, HFILL
9501 		} },
9502 		{ &hf_msg_osd_op_oloc, {
9503 			"Object Locater", "ceph.msg.osd_op.oloc",
9504 			FT_NONE, BASE_NONE, NULL, 0,
9505 			NULL, HFILL
9506 		} },
9507 		{ &hf_msg_osd_op_pgid, {
9508 			"Placement Group ID", "ceph.msg.osd_op.pgid",
9509 			FT_NONE, BASE_NONE, NULL, 0,
9510 			NULL, HFILL
9511 		} },
9512 		{ &hf_msg_osd_op_oid, {
9513 			"Object ID", "ceph.msg.osd_op.oid",
9514 			FT_STRING, BASE_NONE, NULL, 0,
9515 			NULL, HFILL
9516 		} },
9517 		{ &hf_msg_osd_op_ops_len, {
9518 			"Operation Count", "ceph.msg.osd_op.ops_len",
9519 			FT_UINT16, BASE_DEC, NULL, 0,
9520 			NULL, HFILL
9521 		} },
9522 		{ &hf_msg_osd_op_op, {
9523 			"Operation", "ceph.msg.osd_op.op",
9524 			FT_NONE, BASE_NONE, NULL, 0,
9525 			NULL, HFILL
9526 		} },
9527 		{ &hf_msg_osd_op_snap_id, {
9528 			"Snapshot ID", "ceph.msg.osd_op.snap_id",
9529 			FT_UINT64, BASE_DEC, NULL, 0,
9530 			NULL, HFILL
9531 		} },
9532 		{ &hf_msg_osd_op_snap_seq, {
9533 			"Snapshot Sequence", "ceph.msg.osd_op.snap_seq",
9534 			FT_UINT64, BASE_DEC, NULL, 0,
9535 			NULL, HFILL
9536 		} },
9537 		{ &hf_msg_osd_op_snaps_len, {
9538 			"Snapshot Count", "ceph.msg.osd_op.snaps_len",
9539 			FT_UINT32, BASE_DEC, NULL, 0,
9540 			NULL, HFILL
9541 		} },
9542 		{ &hf_msg_osd_op_snap, {
9543 			"Snapshot", "ceph.msg.osd_op.snaps",
9544 			FT_UINT64, BASE_DEC, NULL, 0,
9545 			NULL, HFILL
9546 		} },
9547 		{ &hf_msg_osd_op_retry_attempt, {
9548 			"Retry Attempt", "ceph.msg.osd_op.retry",
9549 			FT_INT32, BASE_DEC, NULL, 0,
9550 			NULL, HFILL
9551 		} },
9552 		{ &hf_msg_osd_op_payload, {
9553 			"Operation Payload", "ceph.msg.osd_op.op_payload",
9554 			FT_BYTES, BASE_NONE, NULL, 0,
9555 			NULL, HFILL
9556 		} },
9557 		{ &hf_msg_osd_opreply, {
9558 			"OSD Operation Reply", "ceph.msg.osd_opreply",
9559 			FT_NONE, BASE_NONE, NULL, 0,
9560 			NULL, HFILL
9561 		} },
9562 		{ &hf_msg_osd_opreply_oid, {
9563 			"Object ID", "ceph.msg.osd_opreply.oid",
9564 			FT_STRING, BASE_NONE, NULL, 0,
9565 			NULL, HFILL
9566 		} },
9567 		{ &hf_msg_osd_opreply_pgid, {
9568 			"Placement Group ID", "ceph.msg.osd_opreply.pgid",
9569 			FT_NONE, BASE_NONE, NULL, 0,
9570 			NULL, HFILL
9571 		} },
9572 		{ &hf_msg_osd_opreply_result, {
9573 			"Result", "ceph.msg.osd_opreply.result",
9574 			FT_INT32, BASE_DEC, NULL, 0,
9575 			NULL, HFILL
9576 		} },
9577 		{ &hf_msg_osd_opreply_bad_replay_ver, {
9578 			"Bad Replay Version", "ceph.msg.osd_opreply.bad_replay_ver",
9579 			FT_NONE, BASE_NONE, NULL, 0,
9580 			NULL, HFILL
9581 		} },
9582 		{ &hf_msg_osd_opreply_replay_ver, {
9583 			"Replay Version", "ceph.msg.osd_opreply.replay_ver",
9584 			FT_NONE, BASE_NONE, NULL, 0,
9585 			NULL, HFILL
9586 		} },
9587 		{ &hf_msg_osd_opreply_user_ver, {
9588 			"User Version", "ceph.msg.osd_opreply.user_ver",
9589 			FT_UINT64, BASE_DEC, NULL, 0,
9590 			NULL, HFILL
9591 		} },
9592 		{ &hf_msg_osd_opreply_redirect, {
9593 			"Redirect", "ceph.msg.osd_opreply.redirect",
9594 			FT_NONE, BASE_NONE, NULL, 0,
9595 			NULL, HFILL
9596 		} },
9597 		{ &hf_msg_osd_opreply_osdmap_epoch, {
9598 			"OSD Map Epoch", "ceph.msg.osd_opreply.osdmap_epoch",
9599 			FT_UINT32, BASE_DEC, NULL, 0,
9600 			NULL, HFILL
9601 		} },
9602 		{ &hf_msg_osd_opreply_ops_len, {
9603 			"Operation Count", "ceph.msg.osd_opreply.ops_len",
9604 			FT_UINT16, BASE_DEC, NULL, 0,
9605 			NULL, HFILL
9606 		} },
9607 		{ &hf_msg_osd_opreply_op, {
9608 			"Operation", "ceph.msg.osd_opreply.op",
9609 			FT_NONE, BASE_NONE, NULL, 0,
9610 			NULL, HFILL
9611 		} },
9612 		{ &hf_msg_osd_opreply_retry_attempt, {
9613 			"Retry Attempt", "ceph.msg.osd_opreply.retry",
9614 			FT_INT32, BASE_DEC, NULL, 0,
9615 			NULL, HFILL
9616 		} },
9617 		{ &hf_msg_osd_opreply_rval, {
9618 			"Operation Return Value", "ceph.msg.osd_opreply.rval",
9619 			FT_INT32, BASE_DEC, NULL, 0,
9620 			NULL, HFILL
9621 		} },
9622 		{ &hf_msg_osd_opreply_payload, {
9623 			"Operation Result", "ceph.msg.osd_opreply.payload",
9624 			FT_BYTES, BASE_NONE, NULL, 0,
9625 			NULL, HFILL
9626 		} },
9627 		{ &hf_msg_poolopreply, {
9628 			"Pool Operation", "ceph.msg.poolopreply",
9629 			FT_NONE, BASE_NONE, NULL, 0,
9630 			NULL, HFILL
9631 		} },
9632 		{ &hf_msg_poolopreply_fsid, {
9633 			"FSID", "ceph.msg.poolopreply.fsid",
9634 			FT_GUID, BASE_NONE, NULL, 0,
9635 			NULL, HFILL
9636 		} },
9637 		{ &hf_msg_poolopreply_code, {
9638 			"Response Code", "ceph.msg.poolopreply.code",
9639 			FT_UINT32, BASE_DEC, NULL, 0,
9640 			NULL, HFILL
9641 		} },
9642 		{ &hf_msg_poolopreply_epoch, {
9643 			"Epoch", "ceph.msg.poolopreply.epoch",
9644 			FT_UINT32, BASE_DEC, NULL, 0,
9645 			NULL, HFILL
9646 		} },
9647 		{ &hf_msg_poolopreply_datai, {
9648 			"Data", "ceph.msg.poolopreply.datai",
9649 			FT_UINT32, BASE_DEC, NULL, 0,
9650 			NULL, HFILL
9651 		} },
9652 		{ &hf_msg_poolopreply_data, {
9653 			"Data", "ceph.msg.poolopreply.data",
9654 			FT_BYTES, BASE_NONE, NULL, 0,
9655 			NULL, HFILL
9656 		} },
9657 		{ &hf_msg_poolopreply_data_size, {
9658 			"Size", "ceph.msg.poolopreply.data_size",
9659 			FT_UINT32, BASE_DEC, NULL, 0,
9660 			NULL, HFILL
9661 		} },
9662 		{ &hf_msg_poolop, {
9663 			"Pool Operation", "ceph.msg.poolop",
9664 			FT_NONE, BASE_NONE, NULL, 0,
9665 			NULL, HFILL
9666 		} },
9667 		{ &hf_msg_poolop_fsid, {
9668 			"FSID", "ceph.msg.poolop.fsid",
9669 			FT_GUID, BASE_NONE, NULL, 0,
9670 			NULL, HFILL
9671 		} },
9672 		{ &hf_msg_poolop_pool, {
9673 			"Pool", "ceph.msg.poolop.pool",
9674 			FT_UINT32, BASE_DEC, NULL, 0,
9675 			NULL, HFILL
9676 		} },
9677 		{ &hf_msg_poolop_type, {
9678 			"Type", "ceph.msg.poolop.type",
9679 			FT_UINT32, BASE_HEX, VALS(c_poolop_type_strings), 0,
9680 			NULL, HFILL
9681 		} },
9682 		{ &hf_msg_poolop_auid, {
9683 			"AUID", "ceph.msg.poolop.auid",
9684 			FT_UINT64, BASE_DEC, NULL, 0,
9685 			NULL, HFILL
9686 		} },
9687 		{ &hf_msg_poolop_snapid, {
9688 			"Snapshot ID", "ceph.msg.poolop.snap",
9689 			FT_UINT64, BASE_DEC, NULL, 0,
9690 			NULL, HFILL
9691 		} },
9692 		{ &hf_msg_poolop_name, {
9693 			"Name", "ceph.msg.poolop.name",
9694 			FT_STRING, BASE_NONE, NULL, 0,
9695 			NULL, HFILL
9696 		} },
9697 		{ &hf_msg_poolop_crush_rule, {
9698 			"Crush Rule", "ceph.msg.poolop.crush_rule",
9699 			FT_UINT16, BASE_DEC, NULL, 0,
9700 			NULL, HFILL
9701 		} },
9702 		{ &hf_msg_poolop_crush_rule8, {
9703 			"Crush Rule", "ceph.msg.poolop.crush_rule",
9704 			FT_UINT8, BASE_DEC, NULL, 0,
9705 			NULL, HFILL
9706 		} },
9707 		{ &hf_msg_mon_cmd, {
9708 			"Mon Command", "ceph.msg.mon_cmd",
9709 			FT_NONE, BASE_NONE, NULL, 0,
9710 			NULL, HFILL
9711 		} },
9712 		{ &hf_msg_mon_cmd_fsid, {
9713 			"FSID", "ceph.msg.mon_cmd.fsid",
9714 			FT_GUID, BASE_NONE, NULL, 0,
9715 			NULL, HFILL
9716 		} },
9717 		{ &hf_msg_mon_cmd_arg, {
9718 			"Argument", "ceph.msg.mon_cmd.arg",
9719 			FT_NONE, BASE_NONE, NULL, 0,
9720 			NULL, HFILL
9721 		} },
9722 		{ &hf_msg_mon_cmd_arg_len, {
9723 			"Argument Count", "ceph.msg.mon_cmd.arg_len",
9724 			FT_UINT32, BASE_DEC, NULL, 0,
9725 			NULL, HFILL
9726 		} },
9727 		{ &hf_msg_mon_cmd_str, {
9728 			"String", "ceph.msg.mon_cmd.str",
9729 			FT_STRING, BASE_NONE, NULL, 0,
9730 			NULL, HFILL
9731 		} },
9732 		{ &hf_msg_mon_cmd_ack, {
9733 			"Mon Command Result", "ceph.msg.mon_cmd_ack",
9734 			FT_NONE, BASE_NONE, NULL, 0,
9735 			NULL, HFILL
9736 		} },
9737 		{ &hf_msg_mon_cmd_ack_code, {
9738 			"Result Code", "ceph.msg.mon_cmd_ack.code",
9739 			FT_INT32, BASE_DEC, NULL, 0,
9740 			NULL, HFILL
9741 		} },
9742 		{ &hf_msg_mon_cmd_ack_res, {
9743 			"Result String", "ceph.msg.mon_cmd_ack.result",
9744 			FT_STRING, BASE_NONE, NULL, 0,
9745 			NULL, HFILL
9746 		} },
9747 		{ &hf_msg_mon_cmd_ack_arg, {
9748 			"Argument", "ceph.msg.mon_cmd_ack.arg",
9749 			FT_NONE, BASE_NONE, NULL, 0,
9750 			NULL, HFILL
9751 		} },
9752 		{ &hf_msg_mon_cmd_ack_arg_len, {
9753 			"Argument Count", "ceph.msg.mon_cmd_ack.arg_len",
9754 			FT_UINT32, BASE_DEC, NULL, 0,
9755 			NULL, HFILL
9756 		} },
9757 		{ &hf_msg_mon_cmd_ack_arg_str, {
9758 			"String", "ceph.msg.mon_cmd_ack.str",
9759 			FT_STRING, BASE_NONE, NULL, 0,
9760 			NULL, HFILL
9761 		} },
9762 		{ &hf_msg_mon_cmd_ack_data, {
9763 			"Data", "ceph.msg.mon_cmd_ack.data",
9764 			FT_STRING, BASE_NONE, NULL, 0,
9765 			NULL, HFILL
9766 		} },
9767 		{ &hf_msg_poolstats, {
9768 			"Pool Stats", "ceph.msg.poolstats",
9769 			FT_NONE, BASE_NONE, NULL, 0,
9770 			NULL, HFILL
9771 		} },
9772 		{ &hf_msg_poolstats_fsid, {
9773 			"FSID", "ceph.msg.poolstats.fsid",
9774 			FT_GUID, BASE_NONE, NULL, 0,
9775 			NULL, HFILL
9776 		} },
9777 		{ &hf_msg_poolstats_pool, {
9778 			"Pool", "ceph.msg.poolstats.pool",
9779 			FT_STRING, BASE_NONE, NULL, 0,
9780 			NULL, HFILL
9781 		} },
9782 		{ &hf_msg_poolstatsreply, {
9783 			"Pool Stats", "ceph.msg.poolstatsreply",
9784 			FT_NONE, BASE_NONE, NULL, 0,
9785 			NULL, HFILL
9786 		} },
9787 		{ &hf_msg_poolstatsreply_fsid, {
9788 			"FSID", "ceph.msg.poolstatsreply.fsid",
9789 			FT_GUID, BASE_NONE, NULL, 0,
9790 			NULL, HFILL
9791 		} },
9792 		{ &hf_msg_poolstatsreply_stat, {
9793 			"Stats", "ceph.msg.poolstatsreply.pool.stat",
9794 			FT_NONE, BASE_NONE, NULL, 0,
9795 			NULL, HFILL
9796 		} },
9797 		{ &hf_msg_poolstatsreply_pool, {
9798 			"Pool", "ceph.msg.poolstatsreply.pool",
9799 			FT_STRING, BASE_NONE, NULL, 0,
9800 			NULL, HFILL
9801 		} },
9802 		{ &hf_msg_poolstatsreply_log_size, {
9803 			"Log Size", "ceph.msg.poolstatsreply.log_size",
9804 			FT_INT64, BASE_DEC, NULL, 0,
9805 			NULL, HFILL
9806 		} },
9807 		{ &hf_msg_poolstatsreply_log_size_ondisk, {
9808 			"On-Disk Log Size", "ceph.msg.poolstatsreply.log_size_ondisk",
9809 			FT_INT64, BASE_DEC, NULL, 0,
9810 			NULL, HFILL
9811 		} },
9812 		{ &hf_msg_mon_globalid_max, {
9813 			"Old Max ID", "ceph.msg.mon.globalid.max",
9814 			FT_UINT64, BASE_HEX, NULL, 0,
9815 			NULL, HFILL
9816 		} },
9817 		{ &hf_msg_mon_election, {
9818 			"Monitor Election", "ceph.msg.mon_election",
9819 			FT_NONE, BASE_NONE, NULL, 0,
9820 			NULL, HFILL
9821 		} },
9822 		{ &hf_msg_mon_election_fsid, {
9823 			"FSID", "ceph.msg.mon_election.fsid",
9824 			FT_GUID, BASE_NONE, NULL, 0,
9825 			NULL, HFILL
9826 		} },
9827 		{ &hf_msg_mon_election_op, {
9828 			"Type", "ceph.msg.mon_election.op",
9829 			FT_INT32, BASE_DEC|BASE_EXT_STRING, &c_mon_election_type_strings_ext, 0,
9830 			NULL, HFILL
9831 		} },
9832 		{ &hf_msg_mon_election_epoch, {
9833 			"Epoch", "ceph.msg.mon_election.epoch",
9834 			FT_UINT32, BASE_DEC, NULL, 0,
9835 			NULL, HFILL
9836 		} },
9837 		{ &hf_msg_mon_election_quorum, {
9838 			"Quorum", "ceph.msg.mon_election.quorum",
9839 			FT_INT64, BASE_DEC, NULL, 0,
9840 			NULL, HFILL
9841 		} },
9842 		{ &hf_msg_mon_election_quorum_features, {
9843 			"Epoch", "ceph.msg.mon_election.quorum_features",
9844 			FT_UINT64, BASE_HEX, NULL, 0,
9845 			NULL, HFILL
9846 		} },
9847 		{ &hf_msg_mon_election_defunct_one, {
9848 			"Defunct One", "ceph.msg.mon_election.defunct_one",
9849 			FT_UINT64, BASE_DEC, NULL, 0,
9850 			NULL, HFILL
9851 		} },
9852 		{ &hf_msg_mon_election_defunct_two, {
9853 			"Defunct Two", "ceph.msg.mon_election.defunct_two",
9854 			FT_UINT64, BASE_DEC, NULL, 0,
9855 			NULL, HFILL
9856 		} },
9857 		{ &hf_msg_mon_election_sharing, {
9858 			"Sharing", "ceph.msg.mon_election.sharing",
9859 			FT_NONE, BASE_NONE, NULL, 0,
9860 			NULL, HFILL
9861 		} },
9862 		{ &hf_msg_mon_election_sharing_data, {
9863 			"Data", "ceph.msg.mon_election.sharing_data",
9864 			FT_BYTES, BASE_NONE, NULL, 0,
9865 			NULL, HFILL
9866 		} },
9867 		{ &hf_msg_mon_election_sharing_size, {
9868 			"Size", "ceph.msg.mon_election.sharing_size",
9869 			FT_UINT32, BASE_DEC, NULL, 0,
9870 			NULL, HFILL
9871 		} },
9872 		{ &hf_msg_mon_paxos, {
9873 			"Paxos", "ceph.msg.mon_paxos",
9874 			FT_NONE, BASE_NONE, NULL, 0,
9875 			NULL, HFILL
9876 		} },
9877 		{ &hf_msg_mon_paxos_epoch, {
9878 			"Epoch", "ceph.msg.mon_paxos.epoch",
9879 			FT_UINT32, BASE_DEC, NULL, 0,
9880 			NULL, HFILL
9881 		} },
9882 		{ &hf_msg_mon_paxos_op, {
9883 			"Op", "ceph.msg.mon_paxos.op",
9884 			FT_INT32, BASE_DEC|BASE_EXT_STRING, &c_mon_paxos_op_strings_ext, 0,
9885 			NULL, HFILL
9886 		} },
9887 		{ &hf_msg_mon_paxos_first, {
9888 			"First Committed", "ceph.msg.mon_paxos.first",
9889 			FT_UINT64, BASE_DEC, NULL, 0,
9890 			NULL, HFILL
9891 		} },
9892 		{ &hf_msg_mon_paxos_last, {
9893 			"Last Committed", "ceph.msg.mon_paxos.last",
9894 			FT_UINT64, BASE_DEC, NULL, 0,
9895 			NULL, HFILL
9896 		} },
9897 		{ &hf_msg_mon_paxos_pnfrom, {
9898 			"Greatest Seen Proposal Number", "ceph.msg.mon_paxos.pnfrom",
9899 			FT_UINT64, BASE_DEC, NULL, 0,
9900 			NULL, HFILL
9901 		} },
9902 		{ &hf_msg_mon_paxos_pn, {
9903 			"Proposal Number", "ceph.msg.mon_paxos.pn",
9904 			FT_UINT64, BASE_DEC, NULL, 0,
9905 			NULL, HFILL
9906 		} },
9907 		{ &hf_msg_mon_paxos_pnuncommitted, {
9908 			"Previous Proposal Number", "ceph.msg.mon_paxos.pnuncommitted",
9909 			FT_UINT64, BASE_DEC, NULL, 0,
9910 			NULL, HFILL
9911 		} },
9912 		{ &hf_msg_mon_paxos_lease, {
9913 			"Lease Timestamp", "ceph.msg.mon_paxos.lease",
9914 			FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
9915 			NULL, HFILL
9916 		} },
9917 		{ &hf_msg_mon_paxos_sent, {
9918 			"Sent Timestamp", "ceph.msg.mon_paxos.sent",
9919 			FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
9920 			NULL, HFILL
9921 		} },
9922 		{ &hf_msg_mon_paxos_latest_ver, {
9923 			"Latest Version", "ceph.msg.mon_paxos.latest_ver",
9924 			FT_UINT64, BASE_DEC, NULL, 0,
9925 			NULL, HFILL
9926 		} },
9927 		{ &hf_msg_mon_paxos_latest_val, {
9928 			"Latest Value", "ceph.msg.mon_paxos.latest_val",
9929 			FT_NONE, BASE_NONE, NULL, 0,
9930 			NULL, HFILL
9931 		} },
9932 		{ &hf_msg_mon_paxos_latest_val_data, {
9933 			"Data", "ceph.msg.mon_paxos.latest_val.data",
9934 			FT_BYTES, BASE_NONE, NULL, 0,
9935 			NULL, HFILL
9936 		} },
9937 		{ &hf_msg_mon_paxos_latest_val_size, {
9938 			"Size", "ceph.msg.mon_paxos.latest_val.size",
9939 			FT_UINT32, BASE_DEC, NULL, 0,
9940 			NULL, HFILL
9941 		} },
9942 		{ &hf_msg_mon_paxos_value, {
9943 			"Proposal", "ceph.msg.mon_paxos.value",
9944 			FT_NONE, BASE_NONE, NULL, 0,
9945 			NULL, HFILL
9946 		} },
9947 		{ &hf_msg_mon_paxos_ver, {
9948 			"Version", "ceph.msg.mon_paxos.ver",
9949 			FT_UINT64, BASE_DEC, NULL, 0,
9950 			NULL, HFILL
9951 		} },
9952 		{ &hf_msg_mon_paxos_val, {
9953 			"Value", "ceph.msg.mon_paxos.val",
9954 			FT_NONE, BASE_NONE, NULL, 0,
9955 			NULL, HFILL
9956 		} },
9957 		{ &hf_msg_mon_paxos_val_data, {
9958 			"Data", "ceph.msg.mon_paxos.val.data",
9959 			FT_BYTES, BASE_NONE, NULL, 0,
9960 			NULL, HFILL
9961 		} },
9962 		{ &hf_msg_mon_paxos_val_size, {
9963 			"Size", "ceph.msg.mon_paxos.val.size",
9964 			FT_UINT32, BASE_DEC, NULL, 0,
9965 			NULL, HFILL
9966 		} },
9967 		{ &hf_msg_mon_probe, {
9968 			"Monitor Probe", "ceph.msg.mon_probe",
9969 			FT_NONE, BASE_NONE, NULL, 0,
9970 			NULL, HFILL
9971 		} },
9972 		{ &hf_msg_mon_probe_fsid, {
9973 			"FSID", "ceph.msg.mon_probe.fsid",
9974 			FT_GUID, BASE_NONE, NULL, 0,
9975 			NULL, HFILL
9976 		} },
9977 		{ &hf_msg_mon_probe_type, {
9978 			"Type", "ceph.msg.mon_probe.type",
9979 			FT_INT32, BASE_DEC|BASE_EXT_STRING, &c_mon_probe_type_strings_ext, 0,
9980 			NULL, HFILL
9981 		} },
9982 		{ &hf_msg_mon_probe_name, {
9983 			"Name", "ceph.msg.mon_probe.name",
9984 			FT_STRING, BASE_NONE, NULL, 0,
9985 			NULL, HFILL
9986 		} },
9987 		{ &hf_msg_mon_probe_quorum, {
9988 			"Quorum", "ceph.msg.mon_probe.quorum",
9989 			FT_INT32, BASE_DEC, NULL, 0,
9990 			NULL, HFILL
9991 		} },
9992 		{ &hf_msg_mon_probe_paxos_first_ver, {
9993 			"Paxos First Version", "ceph.msg.mon_probe.paxos_first_ver",
9994 			FT_UINT64, BASE_DEC, NULL, 0,
9995 			NULL, HFILL
9996 		} },
9997 		{ &hf_msg_mon_probe_paxos_last_ver, {
9998 			"Paxos Last Version", "ceph.msg.mon_probe.paxos_last_ver",
9999 			FT_UINT64, BASE_DEC, NULL, 0,
10000 			NULL, HFILL
10001 		} },
10002 		{ &hf_msg_mon_probe_ever_joined, {
10003 			"Has Ever Joined?", "ceph.msg.mon_probe.has_ever_joined",
10004 			FT_BOOLEAN, BASE_NONE, NULL, 0,
10005 			NULL, HFILL
10006 		} },
10007 		{ &hf_msg_mon_probe_req_features, {
10008 			"Required Features", "ceph.msg.mon_probe.required_features",
10009 			FT_UINT64, BASE_HEX, NULL, 0,
10010 			NULL, HFILL
10011 		} },
10012 		{ &hf_msg_osd_ping, {
10013 			"OSD Ping", "ceph.msg.osd.ping",
10014 			FT_NONE, BASE_NONE, NULL, 0,
10015 			NULL, HFILL
10016 		} },
10017 		{ &hf_msg_osd_ping_fsid, {
10018 			"FSID", "ceph.msg.osd.ping.fsid",
10019 			FT_GUID, BASE_NONE, NULL, 0,
10020 			NULL, HFILL
10021 		} },
10022 		{ &hf_msg_osd_ping_mapepoch, {
10023 			"OSD Map Epoch", "ceph.msg.osd.ping.mapepoch",
10024 			FT_UINT32, BASE_DEC, NULL, 0,
10025 			NULL, HFILL
10026 		} },
10027 		{ &hf_msg_osd_ping_peerepoch, {
10028 			"Peer as of Epoch", "ceph.msg.osd.ping.peerepoch",
10029 			FT_UINT32, BASE_DEC, NULL, 0,
10030 			NULL, HFILL
10031 		} },
10032 		{ &hf_msg_osd_ping_op, {
10033 			"Operation", "ceph.msg.osd.ping.op",
10034 			FT_UINT8, BASE_HEX|BASE_EXT_STRING, &c_osd_ping_op_strings_ext, 0,
10035 			NULL, HFILL
10036 		} },
10037 		{ &hf_msg_osd_ping_time, {
10038 			"Timestamp", "ceph.msg.osd.ping.time",
10039 			FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
10040 			NULL, HFILL
10041 		} },
10042 		{ &hf_msg_osd_boot, {
10043 			"OSD Boot", "ceph.msg.osd_boot",
10044 			FT_NONE, BASE_NONE, NULL, 0,
10045 			NULL, HFILL
10046 		} },
10047 		{ &hf_msg_osd_boot_addr_back, {
10048 			"Back Address", "ceph.msg.osd_boot.addr.back",
10049 			FT_NONE, BASE_NONE, NULL, 0,
10050 			NULL, HFILL
10051 		} },
10052 		{ &hf_msg_osd_boot_addr_cluster, {
10053 			"Cluster Address", "ceph.msg.osd_boot.addr.cluster",
10054 			FT_NONE, BASE_NONE, NULL, 0,
10055 			NULL, HFILL
10056 		} },
10057 		{ &hf_msg_osd_boot_epoch, {
10058 			"Boot Epoch", "ceph.msg.osd_boot.epoch",
10059 			FT_UINT32, BASE_DEC, NULL, 0,
10060 			NULL, HFILL
10061 		} },
10062 		{ &hf_msg_osd_boot_addr_front, {
10063 			"Front Address", "ceph.msg.osd_boot.addr.front",
10064 			FT_NONE, BASE_NONE, NULL, 0,
10065 			NULL, HFILL
10066 		} },
10067 		{ &hf_msg_osd_boot_metadata, {
10068 			"Metadata", "ceph.msg.osd_boot.metadata",
10069 			FT_NONE, BASE_NONE, NULL, 0,
10070 			NULL, HFILL
10071 		} },
10072 		{ &hf_msg_osd_boot_metadata_k, {
10073 			"Key", "ceph.msg.osd_boot.metadata.k",
10074 			FT_STRING, BASE_NONE, NULL, 0,
10075 			NULL, HFILL
10076 		} },
10077 		{ &hf_msg_osd_boot_metadata_v, {
10078 			"Value", "ceph.msg.osd_boot.metadata.v",
10079 			FT_STRING, BASE_NONE, NULL, 0,
10080 			NULL, HFILL
10081 		} },
10082 		{ &hf_msg_pgstats, {
10083 			"Placement Group Stats", "ceph.msg.pgstats",
10084 			FT_NONE, BASE_NONE, NULL, 0,
10085 			NULL, HFILL
10086 		} },
10087 		{ &hf_msg_pgstats_fsid, {
10088 			"FSID", "ceph.msg.pgstats.fsid",
10089 			FT_GUID, BASE_NONE, NULL, 0,
10090 			NULL, HFILL
10091 		} },
10092 		{ &hf_msg_pgstats_pgstat, {
10093 			"PG Stats", "ceph.msg.pgstats.pgstat",
10094 			FT_NONE, BASE_NONE, NULL, 0,
10095 			NULL, HFILL
10096 		} },
10097 		{ &hf_msg_pgstats_pgstat_pg, {
10098 			"Placement Group", "ceph.msg.pgstats.pgstat.pg",
10099 			FT_NONE, BASE_NONE, NULL, 0,
10100 			NULL, HFILL
10101 		} },
10102 		{ &hf_msg_pgstats_pgstat_stat, {
10103 			"Stats", "ceph.msg.pgstats.pgstat.stat",
10104 			FT_NONE, BASE_NONE, NULL, 0,
10105 			NULL, HFILL
10106 		} },
10107 		{ &hf_msg_pgstats_epoch, {
10108 			"Epoch", "ceph.msg.pgstats.epoch",
10109 			FT_UINT32, BASE_DEC, NULL, 0,
10110 			NULL, HFILL
10111 		} },
10112 		{ &hf_msg_pgstats_mapfor, {
10113 			"Has Map For", "ceph.msg.pgstats.mapfor",
10114 			FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
10115 			NULL, HFILL
10116 		} },
10117 		{ &hf_msg_osd_pg_create, {
10118 			"PG Create", "ceph.msg.osd.pg.create",
10119 			FT_NONE, BASE_NONE, NULL, 0,
10120 			NULL, HFILL
10121 		} },
10122 		{ &hf_msg_osd_pg_create_epoch, {
10123 			"Epoch", "ceph.msg.osd.pg.create.epoch",
10124 			FT_UINT64, BASE_DEC, NULL, 0,
10125 			NULL, HFILL
10126 		} },
10127 		{ &hf_msg_osd_pg_create_mkpg, {
10128 			"Creation Request", "ceph.msg.osd.pg.create.mkpg",
10129 			FT_NONE, BASE_NONE, NULL, 0,
10130 			NULL, HFILL
10131 		} },
10132 		{ &hf_msg_osd_pg_create_mkpg_pg, {
10133 			"PG", "ceph.msg.osd.pg.create.mkpg.pg",
10134 			FT_NONE, BASE_NONE, NULL, 0,
10135 			NULL, HFILL
10136 		} },
10137 		{ &hf_msg_osd_pg_create_mkpg_create, {
10138 			"Creation Options", "ceph.msg.osd.pg.create.mkpg.create",
10139 			FT_NONE, BASE_NONE, NULL, 0,
10140 			NULL, HFILL
10141 		} },
10142 		{ &hf_msg_client_caps, {
10143 			"Client Caps", "ceph.msg.client_caps",
10144 			FT_NONE, BASE_NONE, NULL, 0,
10145 			NULL, HFILL
10146 		} },
10147 		{ &hf_msg_client_caps_op, {
10148 			"Operation", "ceph.msg.client_caps.op",
10149 			FT_UINT32, BASE_HEX|BASE_EXT_STRING, &c_cap_op_type_strings_ext, 0,
10150 			NULL, HFILL
10151 		} },
10152 		{ &hf_msg_client_caps_inode, {
10153 			"Inode", "ceph.msg.client_caps.inode",
10154 			FT_UINT64, BASE_HEX, NULL, 0,
10155 			NULL, HFILL
10156 		} },
10157 		{ &hf_msg_client_caps_relam, {
10158 			"Relam", "ceph.msg.client_caps.relam",
10159 			FT_UINT64, BASE_DEC, NULL, 0,
10160 			NULL, HFILL
10161 		} },
10162 		{ &hf_msg_client_caps_cap_id, {
10163 			"Cap ID", "ceph.msg.client_caps.cap_id",
10164 			FT_UINT64, BASE_HEX, NULL, 0,
10165 			NULL, HFILL
10166 		} },
10167 		{ &hf_msg_client_caps_seq, {
10168 			"Sequence", "ceph.msg.client_caps.seq",
10169 			FT_UINT32, BASE_DEC, NULL, 0,
10170 			NULL, HFILL
10171 		} },
10172 		{ &hf_msg_client_caps_seq_issue, {
10173 			"Issue Sequence", "ceph.msg.client_caps.seq_issue",
10174 			FT_UINT32, BASE_DEC, NULL, 0,
10175 			NULL, HFILL
10176 		} },
10177 		{ &hf_msg_client_caps_new, {
10178 			"New Capabilities", "ceph.msg.client_caps.new",
10179 			FT_UINT32, BASE_HEX, NULL, 0,
10180 			NULL, HFILL
10181 		} },
10182 		{ &hf_msg_client_caps_wanted, {
10183 			"Wanted Capabilities", "ceph.msg.client_caps.wanted",
10184 			FT_UINT32, BASE_DEC, NULL, 0,
10185 			NULL, HFILL
10186 		} },
10187 		{ &hf_msg_client_caps_dirty, {
10188 			"Dirty Capabilities", "ceph.msg.client_caps.dirty",
10189 			FT_UINT32, BASE_DEC, NULL, 0,
10190 			NULL, HFILL
10191 		} },
10192 		{ &hf_msg_client_caps_seq_migrate, {
10193 			"Migrate Sequence", "ceph.msg.client_caps_seq.migrate",
10194 			FT_UINT32, BASE_DEC, NULL, 0,
10195 			NULL, HFILL
10196 		} },
10197 		{ &hf_msg_client_caps_snap_follows, {
10198 			"Snapshot Follows", "ceph.msg.client_caps.snap_follows",
10199 			FT_UINT64, BASE_DEC, NULL, 0,
10200 			NULL, HFILL
10201 		} },
10202 		{ &hf_msg_client_caps_uid, {
10203 			"User ID", "ceph.msg.client_caps.uid",
10204 			FT_UINT32, BASE_DEC, NULL, 0,
10205 			NULL, HFILL
10206 		} },
10207 		{ &hf_msg_client_caps_gid, {
10208 			"Group ID", "ceph.msg.client_caps.gid",
10209 			FT_UINT32, BASE_DEC, NULL, 0,
10210 			NULL, HFILL
10211 		} },
10212 		{ &hf_msg_client_caps_mode, {
10213 			"Mode", "ceph.msg.client_caps.mode",
10214 			FT_UINT32, BASE_DEC, NULL, 0,
10215 			NULL, HFILL
10216 		} },
10217 		{ &hf_msg_client_caps_nlink, {
10218 			"Number of Links", "ceph.msg.client_caps.nlink",
10219 			FT_UINT32, BASE_DEC, NULL, 0,
10220 			NULL, HFILL
10221 		} },
10222 		{ &hf_msg_client_caps_xattr_ver, {
10223 			"Xattr Version", "ceph.msg.client_caps.xattr_ver",
10224 			FT_UINT64, BASE_DEC, NULL, 0,
10225 			NULL, HFILL
10226 		} },
10227 		{ &hf_msg_client_caps_snap, {
10228 			"Snapshot Data", "ceph.msg.client_caps.snap",
10229 			FT_BYTES, BASE_NONE, NULL, 0,
10230 			NULL, HFILL
10231 		} },
10232 		{ &hf_msg_client_caps_flock, {
10233 			"Flock", "ceph.msg.client_caps.flock",
10234 			FT_NONE, BASE_NONE, NULL, 0,
10235 			NULL, HFILL
10236 		} },
10237 		{ &hf_msg_client_caps_inline_ver, {
10238 			"Inline Version", "ceph.msg.client_caps.inline_ver",
10239 			FT_UINT64, BASE_DEC, NULL, 0,
10240 			NULL, HFILL
10241 		} },
10242 		{ &hf_msg_client_caps_inline_data, {
10243 			"Inline Data", "ceph.msg.client_caps.inline_data",
10244 			FT_NONE, BASE_NONE, NULL, 0,
10245 			NULL, HFILL
10246 		} },
10247 		{ &hf_msg_client_caps_xattr, {
10248 			"Xattr", "ceph.msg.client_caps.xattr",
10249 			FT_BYTES, BASE_NONE, NULL, 0,
10250 			NULL, HFILL
10251 		} },
10252 		{ &hf_msg_client_caprel, {
10253 			"Capability Release", "ceph.msg.client_caprel",
10254 			FT_NONE, BASE_NONE, NULL, 0,
10255 			NULL, HFILL
10256 		} },
10257 		{ &hf_msg_client_caprel_cap, {
10258 			"Capability", "ceph.msg.client_caprel.cap",
10259 			FT_NONE, BASE_NONE, NULL, 0,
10260 			NULL, HFILL
10261 		} },
10262 		{ &hf_msg_client_caprel_cap_inode, {
10263 			"Inode", "ceph.msg.client_caprel.cap.inode",
10264 			FT_UINT64, BASE_HEX, NULL, 0,
10265 			NULL, HFILL
10266 		} },
10267 		{ &hf_msg_client_caprel_cap_id, {
10268 			"Capability ID", "ceph.msg.client_caprel.cap.id",
10269 			FT_UINT64, BASE_HEX, NULL, 0,
10270 			NULL, HFILL
10271 		} },
10272 		{ &hf_msg_client_caprel_cap_migrate, {
10273 			"Migrate Sequence", "ceph.msg.client_caprel_cap.migrate",
10274 			FT_UINT32, BASE_DEC, NULL, 0,
10275 			NULL, HFILL
10276 		} },
10277 		{ &hf_msg_client_caprel_cap_seq, {
10278 			"Sequence", "ceph.msg.client_caprel_cap.seq",
10279 			FT_UINT32, BASE_DEC, NULL, 0,
10280 			NULL, HFILL
10281 		} },
10282 		{ &hf_msg_timecheck, {
10283 			"Timecheck", "ceph.msg.timecheck",
10284 			FT_NONE, BASE_NONE, NULL, 0,
10285 			NULL, HFILL
10286 		} },
10287 		{ &hf_msg_timecheck_op, {
10288 			"Operation", "ceph.msg.timecheck.op",
10289 			FT_UINT32, BASE_HEX|BASE_EXT_STRING, &c_timecheck_op_strings_ext, 0,
10290 			NULL, HFILL
10291 		} },
10292 		{ &hf_msg_timecheck_epoch, {
10293 			"Epoch", "ceph.msg.timecheck.epoch",
10294 			FT_UINT64, BASE_DEC, NULL, 0,
10295 			NULL, HFILL
10296 		} },
10297 		{ &hf_msg_timecheck_round, {
10298 			"Round", "ceph.msg.timecheck.round",
10299 			FT_UINT64, BASE_DEC, NULL, 0,
10300 			NULL, HFILL
10301 		} },
10302 		{ &hf_msg_timecheck_time, {
10303 			"Time", "ceph.msg.timecheck.time",
10304 			FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
10305 			NULL, HFILL
10306 		} },
10307 		{ &hf_msg_timecheck_skew, {
10308 			"Skew", "ceph.msg.timecheck.skew",
10309 			FT_NONE, BASE_NONE, NULL, 0,
10310 			NULL, HFILL
10311 		} },
10312 		{ &hf_msg_timecheck_skew_node, {
10313 			"Node", "ceph.msg.timecheck.skew.node",
10314 			FT_NONE, BASE_NONE, NULL, 0,
10315 			NULL, HFILL
10316 		} },
10317 		{ &hf_msg_timecheck_skew_skew, {
10318 			"Skew", "ceph.msg.timecheck.skew.skew",
10319 			FT_DOUBLE, BASE_NONE, NULL, 0,
10320 			NULL, HFILL
10321 		} },
10322 		{ &hf_msg_timecheck_latency, {
10323 			"Latency", "ceph.msg.timecheck.latency",
10324 			FT_NONE, BASE_NONE, NULL, 0,
10325 			NULL, HFILL
10326 		} },
10327 		{ &hf_msg_timecheck_latency_node, {
10328 			"Node", "ceph.msg.timecheck.latency.node",
10329 			FT_NONE, BASE_NONE, NULL, 0,
10330 			NULL, HFILL
10331 		} },
10332 		{ &hf_msg_timecheck_latency_latency, {
10333 			"Latency", "ceph.msg.timecheck.latency.latency",
10334 			FT_DOUBLE, BASE_NONE, NULL, 0,
10335 			NULL, HFILL
10336 		} },
10337 	};
10338 
10339 	/* Setup protocol subtree array */
10340 	static gint *ett[] = {
10341 		&ett_ceph,
10342 		&ett_data,
10343 		&ett_str,
10344 		&ett_blob,
10345 		&ett_sockaddr,
10346 		&ett_entityaddr,
10347 		&ett_entityname,
10348 		&ett_EntityName,
10349 		&ett_entityinst,
10350 		&ett_kv,
10351 		&ett_eversion,
10352 		&ett_objectlocator,
10353 		&ett_pg,
10354 		&ett_pg_create,
10355 		&ett_filepath,
10356 		&ett_mds_release,
10357 		&ett_hitset_params,
10358 		&ett_snapinfo,
10359 		&ett_pgpool,
10360 		&ett_pgpool_snap,
10361 		&ett_pgpool_snapdel,
10362 		&ett_pgpool_property,
10363 		&ett_mon_map,
10364 		&ett_mon_map_address,
10365 		&ett_osd_peerstat,
10366 		&ett_featureset,
10367 		&ett_featureset_name,
10368 		&ett_compatset,
10369 		&ett_osd_superblock,
10370 		&ett_osd_info,
10371 		&ett_osd_xinfo,
10372 		&ett_perfstat,
10373 		&ett_osdstat,
10374 		&ett_pg_stat,
10375 		&ett_osd_map,
10376 		&ett_osd_map_client,
10377 		&ett_osd_map_pool,
10378 		&ett_osd_map_poolname,
10379 		&ett_osd_map_pgtmp,
10380 		&ett_osd_map_primarytmp,
10381 		&ett_osd_map_erasurecodeprofile,
10382 		&ett_osd_map_osd,
10383 		&ett_osd_map_blacklist,
10384 		&ett_osd_map_inc,
10385 		&ett_osd_map_inc_client,
10386 		&ett_osd_map_inc_osd,
10387 		&ett_osd_op,
10388 		&ett_redirect,
10389 		&ett_statcollection,
10390 		&ett_paxos,
10391 		&ett_msg_mon_map,
10392 		&ett_msg_statfs,
10393 		&ett_msg_statfsreply,
10394 		&ett_msg_mon_sub,
10395 		&ett_msg_mon_sub_item,
10396 		&ett_msg_mon_sub_flags,
10397 		&ett_msg_mon_sub_ack,
10398 		&ett_msg_auth,
10399 		&ett_msg_auth_supportedproto,
10400 		&ett_msg_auth_cephx,
10401 		&ett_msg_authreply,
10402 		&ett_msg_mon_getversion,
10403 		&ett_msg_mon_getversionreply,
10404 		&ett_msg_mds_map,
10405 		&ett_msg_client_sess,
10406 		&ett_msg_client_req,
10407 		&ett_msg_client_reqfwd,
10408 		&ett_msg_client_reply,
10409 		&ett_msg_osd_map,
10410 		&ett_msg_osd_map_inc,
10411 		&ett_msg_osd_map_full,
10412 		&ett_msg_osd_op,
10413 		&ett_msg_osd_opreply,
10414 		&ett_msg_poolopreply,
10415 		&ett_msg_poolop,
10416 		&ett_msg_mon_cmd,
10417 		&ett_msg_mon_cmd_arg,
10418 		&ett_msg_mon_cmdack,
10419 		&ett_msg_mon_cmdack_arg,
10420 		&ett_msg_poolstats,
10421 		&ett_msg_poolstatsreply,
10422 		&ett_msg_poolstatsreply_stat,
10423 		&ett_msg_mon_election,
10424 		&ett_msg_mon_paxos,
10425 		&ett_msg_mon_paxos_value,
10426 		&ett_msg_mon_probe,
10427 		&ett_msg_osd_ping,
10428 		&ett_msg_osd_boot,
10429 		&ett_msg_pgstats,
10430 		&ett_msg_pgstats_pgstat,
10431 		&ett_msg_osd_pg_create,
10432 		&ett_msg_osd_pg_create_mkpg,
10433 		&ett_msg_client_caps,
10434 		&ett_msg_client_caprel,
10435 		&ett_msg_client_caprel_cap,
10436 		&ett_msg_timecheck,
10437 		&ett_msg_timecheck_skew,
10438 		&ett_msg_timecheck_latency,
10439 		&ett_head,
10440 		&ett_foot,
10441 		&ett_connect,
10442 		&ett_connect_reply,
10443 		&ett_filter_data,
10444 	};
10445 
10446 	/* Expert info items. */
10447 	static ei_register_info ei[] = {
10448 		{ &ei_unused, {
10449 			"ceph.unused", PI_UNDECODED, PI_WARN,
10450 			"Unused data in message.  This usually indicates an error by the "
10451 			"sender or a bug in the dissector.", EXPFILL
10452 		} },
10453 		{ &ei_overrun, {
10454 			"ceph.overrun", PI_UNDECODED, PI_WARN,
10455 			"There was less data then expected.  This usually indicates an "
10456 			"error by the sender or a bug in the dissector.", EXPFILL
10457 		} },
10458 		{ &ei_tag_unknown, {
10459 			"ceph.tag_unknown", PI_UNDECODED, PI_ERROR,
10460 			"Unknown tag.  This is either an error by the sender or an "
10461 			"indication that the dissector is out of date.", EXPFILL
10462 		} },
10463 		{ &ei_msg_unknown, {
10464 			"ceph.msg_unknown", PI_UNDECODED, PI_WARN,
10465 			"Unknown message type. This most likely means that the dissector "
10466 			"is out of date.  However it could also be an error by the "
10467 			"sender ", EXPFILL
10468 		} },
10469 		{ &ei_union_unknown, {
10470 			"ceph.union_unknown", PI_UNDECODED, PI_WARN,
10471 			"This data's meaning depends on other information in the message "
10472 			"but the dissector doesn't know what type it is.", EXPFILL
10473 		} },
10474 		{ &ei_ver_tooold, {
10475 			"ceph.ver.tooold", PI_UNDECODED, PI_WARN,
10476 			"This data is in an older format that is not supported by the "
10477 			"dissector.", EXPFILL
10478 		} },
10479 		{ &ei_ver_toonew, {
10480 			"ceph.ver.toonew", PI_UNDECODED, PI_WARN,
10481 			"This data is in a newer format that is not supported by the "
10482 			"dissector.", EXPFILL
10483 		} },
10484 		{ &ei_oloc_both, {
10485 			"ceph.oloc.both", PI_MALFORMED, PI_ERROR,
10486 			"Only one of the key or hash should be present, however both are.",
10487 			EXPFILL
10488 		} },
10489 #if 0
10490 		{ &ei_banner_invalid, {
10491 			"ceph.banner.invalid", PI_MALFORMED, PI_ERROR,
10492 			"Banner was invalid.", EXPFILL
10493 		} },
10494 #endif
10495 		{ &ei_sizeillogical, {
10496 			"ceph.sizeillogical", PI_MALFORMED, PI_ERROR,
10497 			"The claimed size is impossible.", EXPFILL
10498 		} },
10499 	};
10500 
10501 	/* Register the protocol name and description */
10502 	proto_ceph = proto_register_protocol("Ceph", "Ceph", "ceph");
10503 
10504 	/* Required function calls to register the header fields and subtrees */
10505 	proto_register_field_array(proto_ceph, hf, array_length(hf));
10506 	proto_register_subtree_array(ett, array_length(ett));
10507 	expert_ceph = expert_register_protocol(proto_ceph);
10508 	expert_register_field_array(expert_ceph, ei, array_length(ei));
10509 }
10510 
10511 void
proto_reg_handoff_ceph(void)10512 proto_reg_handoff_ceph(void)
10513 {
10514 	ceph_handle = create_dissector_handle(dissect_ceph_old, proto_ceph);
10515 
10516 	heur_dissector_add("tcp", dissect_ceph_heur, "Ceph over TCP", "ceph_tcp", proto_ceph, HEURISTIC_ENABLE);
10517 }
10518 
10519 /*
10520  * Editor modelines  -	https://www.wireshark.org/tools/modelines.html
10521  *
10522  * Local variables:
10523  * c-basic-offset: 8
10524  * tab-width: 8
10525  * indent-tabs-mode: t
10526  * End:
10527  *
10528  * vi: set shiftwidth=8 tabstop=8 noexpandtab:
10529  * :indentSize=8:tabSize=8:noTabs=false:
10530  */
10531