Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-lustre.c
blob3af321e12b2ad6d88b4985f40980121110499a5a
1 /* packet-lustre.c
2 * Routines for lustre dissection
3 * Copyright (c) 2011, 2016, 2017 Intel Corporation.
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
13 * This is accurate for Lustre dissection as of Lustre 2.10.2 - November 2017
16 #include <config.h>
17 #include <epan/packet.h>
18 #include <epan/expert.h>
19 #include <epan/tfs.h>
20 #include <wsutil/array.h>
22 #include "packet-tcp.h"
23 #include "packet-lnet.h"
25 void proto_reg_handoff_lustre(void);
26 void proto_register_lustre(void);
28 static dissector_handle_t lustre_handle;
30 /* Initialize the protocol and registered fields */
31 static int proto_lustre;
33 static int hf_lustre_lustre_msg_v1_lm_magic;
34 static int hf_lustre_lustre_msg_v1_lm_handle;
35 static int hf_lustre_lustre_msg_v1_lm_last_xid;
36 static int hf_lustre_lustre_msg_v1_lm_status;
37 static int hf_lustre_lustre_msg_v1_lm_type;
38 static int hf_lustre_lustre_msg_v1_lm_flags;
39 static int hf_lustre_lustre_msg_v1_lm_last_committed;
40 static int hf_lustre_lustre_msg_v1_lm_buflens;
41 static int hf_lustre_lustre_msg_v1_lm_conn_cnt;
42 static int hf_lustre_lustre_msg_v1_lm_transno;
43 static int hf_lustre_lustre_msg_v1_lm_opc;
44 static int hf_lustre_lustre_msg_v1_lm_version;
45 static int hf_lustre_lustre_msg_v1_lm_bufcount;
46 static int hf_lustre_lustre_msg_v2_lm_magic;
47 static int hf_lustre_lustre_msg_v2_lm_bufcount;
48 static int hf_lustre_lustre_msg_v2_lm_repsize;
49 static int hf_lustre_lustre_msg_v2_lm_cksum;
50 static int hf_lustre_lustre_msg_v2_lm_buflens;
51 static int hf_lustre_lustre_msg_v2_lm_flags;
52 static int hf_lustre_lustre_msg_v2_lm_secflvr;
53 static int hf_lustre_lustre_msg_v2_lm_padding_2;
54 static int hf_lustre_lustre_msg_v2_lm_padding_3;
55 static int hf_lustre_extra_padding;
56 static int hf_lustre_target_uuid;
57 static int hf_lustre_client_uuid;
58 static int hf_lustre_mdt_body;
59 static int hf_lustre_mdt_body_fid1;
60 static int hf_lustre_mdt_body_fid2;
61 static int hf_lustre_mdt_body_handle;
62 static int hf_lustre_mdt_body_valid;
63 static int hf_lustre_mdt_body_size;
64 static int hf_lustre_mdt_body_mtime;
65 static int hf_lustre_mdt_body_atime;
66 static int hf_lustre_mdt_body_ctime;
67 static int hf_lustre_mdt_body_blocks;
68 static int hf_lustre_mdt_body_ioepoch;
69 static int hf_lustre_mdt_body_ino;
70 static int hf_lustre_mdt_body_fsuid;
71 static int hf_lustre_mdt_body_fsgid;
72 static int hf_lustre_mdt_body_capability;
73 static int hf_lustre_mdt_body_mode;
74 static int hf_lustre_mdt_body_uid;
75 static int hf_lustre_mdt_body_gid;
76 static int hf_lustre_mdt_body_flags;
77 static int hf_lustre_mdt_body_rdev;
78 static int hf_lustre_mdt_body_nlink;
79 static int hf_lustre_mdt_body_generation;
80 static int hf_lustre_mdt_body_suppgid;
81 static int hf_lustre_mdt_body_eadatasize;
82 static int hf_lustre_mdt_body_aclsize;
83 static int hf_lustre_mdt_body_max_mdsize;
84 static int hf_lustre_mdt_body_max_cookiesize;
85 static int hf_lustre_mdt_body_uid_h;
86 static int hf_lustre_mdt_body_gid_h;
87 static int hf_lustre_mdt_body_projid;
88 static int hf_lustre_mdt_body_dom_size;
89 static int hf_lustre_mdt_body_dom_blocks;
90 static int hf_lustre_mdt_body_btime;
91 static int hf_lustre_mdt_body_padding_9;
92 static int hf_lustre_mdt_body_padding_10;
93 static int hf_lustre_close_data;
94 static int hf_lustre_close_fid;
95 static int hf_lustre_close_handle;
96 static int hf_lustre_close_data_ver;
97 static int hf_lustre_close_reserved;
98 static int hf_lustre_mdt_key;
99 static int hf_lustre_mdt_val;
100 static int hf_lustre_mdt_vallen;
101 static int hf_lustre_mdt_rec_reint;
102 static int hf_lustre_mdt_rec_reint_opcode;
103 static int hf_lustre_mdt_rec_reint_cap;
104 static int hf_lustre_mdt_rec_reint_fsuid;
105 static int hf_lustre_mdt_rec_reint_fsuid_h;
106 static int hf_lustre_mdt_rec_reint_fsgid;
107 static int hf_lustre_mdt_rec_reint_fsgid_h;
108 static int hf_lustre_mdt_rec_reint_suppgid1;
109 static int hf_lustre_mdt_rec_reint_suppgid1_h;
110 static int hf_lustre_mdt_rec_reint_suppgid2;
111 static int hf_lustre_mdt_rec_reint_suppgid2_h;
112 static int hf_lustre_mdt_rec_reint_mtime;
113 static int hf_lustre_mdt_rec_reint_atime;
114 static int hf_lustre_mdt_rec_reint_ctime;
115 static int hf_lustre_mdt_rec_reint_time;
116 static int hf_lustre_mdt_rec_reint_size32;
117 static int hf_lustre_mdt_rec_reint_size64;
118 static int hf_lustre_mdt_rec_reint_blocks;
119 static int hf_lustre_mdt_rec_reint_bias;
120 static int hf_lustre_mdt_rec_reint_mode;
121 static int hf_lustre_mdt_rec_reint_flags;
122 static int hf_lustre_mdt_rec_reint_flags_h;
123 static int hf_lustre_mdt_rec_reint_attr_flags;
124 static int hf_lustre_mdt_rec_reint_umask;
125 static int hf_lustre_mdt_rec_reint_padding;
126 static int hf_lustre_mdt_rec_reint_fid1;
127 static int hf_lustre_mdt_rec_reint_fid2;
128 static int hf_lustre_mdt_rec_reint_old_handle;
129 static int hf_lustre_mdt_rec_reint_rdev;
130 static int hf_lustre_mdt_rec_reint_valid;
131 static int hf_lustre_mdt_rec_reint_ioepoch;
132 static int hf_lustre_mdt_rec_reint_uid;
133 static int hf_lustre_mdt_rec_reint_gid;
134 static int hf_lustre_mdt_rec_reint_projid;
135 static int hf_lustre_mdt_ioepoch;
136 static int hf_lustre_mdt_ioepoch_ioepoch;
137 static int hf_lustre_mdt_ioepoch_handle;
138 static int hf_lustre_mdt_ioepoch_flags;
139 static int hf_lustre_mdt_ioepoch_padding;
140 static int hf_lustre_ptlrpc_body_pb;
141 static int hf_lustre_ptlrpc_body_pb_last_committed;
142 static int hf_lustre_ptlrpc_body_pb_version;
143 static int hf_lustre_ptlrpc_body_pb_slv;
144 static int hf_lustre_ptlrpc_body_pb_pre_version;
145 static int hf_lustre_ptlrpc_body_pb_padding;
146 static int hf_lustre_ptlrpc_body_pb_jobid;
147 static int hf_lustre_ptlrpc_body_pb_timeout;
148 static int hf_lustre_ptlrpc_body_pb_op_flags;
149 static int hf_lustre_ptlrpc_body_pb_type;
150 static int hf_lustre_ptlrpc_body_pb_flags;
151 static int hf_lustre_ptlrpc_body_pb_limit;
152 static int hf_lustre_ptlrpc_body_pb_transno;
153 static int hf_lustre_ptlrpc_body_pb_service_time;
154 static int hf_lustre_ptlrpc_body_pb_conn_cnt;
155 static int hf_lustre_ptlrpc_body_pb_opc;
156 static int hf_lustre_ptlrpc_body_pb_last_seen;
157 static int hf_lustre_ptlrpc_body_pb_last_xid;
158 static int hf_lustre_ptlrpc_body_pb_status;
159 static int hf_lustre_ptlrpc_body_pb_handle;
160 static int hf_lustre_mdc_swap_layouts;
161 static int hf_lustre_mdc_swap_layouts_flags;
162 static int hf_lustre_hsm_current_action;
163 static int hf_lustre_hsm_current_action_state;
164 static int hf_lustre_hsm_current_action_action;
165 static int hf_lustre_hsm_archive;
166 static int hf_lustre_hsm_archive_id;
167 static int hf_lustre_hsm_req;
168 static int hf_lustre_hsm_req_action;
169 static int hf_lustre_hsm_req_archive_id;
170 static int hf_lustre_hsm_req_flags;
171 static int hf_lustre_hsm_req_itemcount;
172 static int hf_lustre_hsm_req_data_len;
173 static int hf_lustre_hsm_extent;
174 static int hf_lustre_hsm_extent_offset;
175 static int hf_lustre_hsm_extent_length;
176 static int hf_lustre_hsm_prog;
177 static int hf_lustre_hsm_prog_fid;
178 static int hf_lustre_hsm_prog_cookie;
179 static int hf_lustre_hsm_prog_flags;
180 static int hf_lustre_hsm_prog_errval;
181 static int hf_lustre_hsm_prog_data_ver;
182 static int hf_lustre_hsm_prog_padding1;
183 static int hf_lustre_hsm_prog_padding2;
184 static int hf_lustre_hsm_user_state;
185 static int hf_lustre_hsm_us_states;
186 static int hf_lustre_hsm_us_archive_id;
187 static int hf_lustre_hsm_us_in_prog_state;
188 static int hf_lustre_hsm_us_in_prog_action;
189 static int hf_lustre_hsm_us_ext_info;
190 static int hf_lustre_hsm_state_set;
191 static int hf_lustre_hsm_hss_valid;
192 static int hf_lustre_hsm_hss_archive_id;
193 static int hf_lustre_hsm_hss_setmask;
194 static int hf_lustre_hsm_hss_clearmask;
195 static int hf_lustre_obd_ioobj;
196 static int hf_lustre_obd_ioobj_ioo_bufcnt;
197 static int hf_lustre_obd_ioobj_ioo_id;
198 static int hf_lustre_obd_ioobj_ioo_max_brw;
199 static int hf_lustre_obd_ioobj_ioo_seq;
200 static int hf_lustre_obd_statfs;
201 static int hf_lustre_obd_statfs_os_type;
202 static int hf_lustre_obd_statfs_os_bavail;
203 static int hf_lustre_obd_statfs_os_bsize;
204 static int hf_lustre_obd_statfs_os_maxbytes;
205 static int hf_lustre_obd_statfs_os_ffree;
206 static int hf_lustre_obd_statfs_os_files;
207 static int hf_lustre_obd_statfs_os_bfree;
208 static int hf_lustre_obd_statfs_os_namelen;
209 static int hf_lustre_obd_statfs_os_blocks;
210 static int hf_lustre_obd_statfs_os_fsid;
211 static int hf_lustre_obd_statfs_os_state;
212 static int hf_lustre_obd_statfs_os_fprecreated;
213 static int hf_lustre_obd_statfs_os_granted;
214 static int hf_lustre_obd_statfs_os_spare;
215 static int hf_lustre_obd_connect_data;
216 static int hf_lustre_obd_connect_data_ocd_version;
217 static int hf_lustre_obd_connect_data_ocd_grant;
218 static int hf_lustre_obd_connect_data_ocd_nllg;
219 static int hf_lustre_obd_connect_data_ocd_nllu;
220 static int hf_lustre_obd_connect_data_ocd_grant_blkbits;
221 static int hf_lustre_obd_connect_data_ocd_grant_inobits;
222 static int hf_lustre_obd_connect_data_ocd_grant_tax_kb;
223 static int hf_lustre_obd_connect_data_ocd_grant_max_blks;
224 static int hf_lustre_obd_connect_data_ocd_padding;
225 static int hf_lustre_obd_connect_data_ocd_ibits_known;
226 static int hf_lustre_obd_connect_data_ocd_group;
227 static int hf_lustre_obd_connect_data_ocd_brw_size;
228 static int hf_lustre_obd_connect_data_ocd_index;
229 static int hf_lustre_obd_connect_data_ocd_connect_flags;
230 static int hf_lustre_obd_connect_data_ocd_connect_flags2;
231 static int hf_lustre_obd_connect_data_ocd_cksum_types;
232 static int hf_lustre_obd_connect_data_ocd_max_easize;
233 static int hf_lustre_obd_connect_data_ocd_instance;
234 static int hf_lustre_obd_connect_data_ocd_maxbytes;
235 static int hf_lustre_obd_connect_data_ocd_maxmodrpcs;
236 static int hf_lustre_obd_connect_data_ocd_transno;
237 static int hf_lustre_obd_uuid;
238 static int hf_lustre_obd_quotactl;
239 static int hf_lustre_obd_quotactl_qc_stat;
240 static int hf_lustre_obd_quotactl_qc_cmd;
241 static int hf_lustre_obd_quotactl_qc_id;
242 static int hf_lustre_obd_quotactl_qc_type;
243 static int hf_lustre_obd_dqinfo;
244 static int hf_lustre_obd_dqinfo_dqi_valid;
245 static int hf_lustre_obd_dqinfo_dqi_igrace;
246 static int hf_lustre_obd_dqinfo_dqi_bgrace;
247 static int hf_lustre_obd_dqinfo_dqi_flags;
248 static int hf_lustre_obd_dqblk;
249 static int hf_lustre_obd_dqblk_dqb_isoftlimit;
250 static int hf_lustre_obd_dqblk_dqb_bhardlimit;
251 static int hf_lustre_obd_dqblk_dqb_curspace;
252 static int hf_lustre_obd_dqblk_dqb_itime;
253 static int hf_lustre_obd_dqblk_dqb_valid;
254 static int hf_lustre_obd_dqblk_padding;
255 static int hf_lustre_obd_dqblk_dqb_curinodes;
256 static int hf_lustre_obd_dqblk_dqb_bsoftlimit;
257 static int hf_lustre_obd_dqblk_dqb_btime;
258 static int hf_lustre_obd_dqblk_dqb_ihardlimit;
259 static int hf_lustre_ost_body;
260 static int hf_lustre_ost_key;
261 static int hf_lustre_ost_val;
262 static int hf_lustre_ost_lvb;
263 static int hf_lustre_ost_lvb_atime;
264 static int hf_lustre_ost_lvb_ctime;
265 static int hf_lustre_ost_lvb_mtime;
266 static int hf_lustre_ost_lvb_mtime_ns;
267 static int hf_lustre_ost_lvb_atime_ns;
268 static int hf_lustre_ost_lvb_ctime_ns;
269 static int hf_lustre_ost_lvb_padding;
270 static int hf_lustre_ost_lvb_size;
271 static int hf_lustre_ost_lvb_blocks;
272 static int hf_lustre_ost_id;
273 static int hf_lustre_ost_id_fid;
274 static int hf_lustre_ost_id_oi;
275 static int hf_lustre_ost_layout;
276 static int hf_lustre_ost_layout_stripe_size;
277 static int hf_lustre_ost_layout_stripe_count;
278 static int hf_lustre_ost_layout_comp_start;
279 static int hf_lustre_ost_layout_comp_end;
280 static int hf_lustre_ost_layout_comp_id;
281 static int hf_lustre_lu_ladvise_hdr;
282 static int hf_lustre_lu_ladvise_hdr_magic;
283 static int hf_lustre_lu_ladvise_hdr_count;
284 static int hf_lustre_lu_ladvise_hdr_flags;
285 static int hf_lustre_lu_ladvise_hdr_value1;
286 static int hf_lustre_lu_ladvise_hdr_value2;
287 static int hf_lustre_lu_ladvise_hdr_value3;
288 static int hf_lustre_lu_ladvise;
289 static int hf_lustre_lu_ladvise_advice;
290 static int hf_lustre_lu_ladvise_value1;
291 static int hf_lustre_lu_ladvise_value2;
292 static int hf_lustre_lu_ladvise_start;
293 static int hf_lustre_lu_ladvise_end;
294 static int hf_lustre_lu_ladvise_value3;
295 static int hf_lustre_lu_ladvise_value4;
296 static int hf_lustre_llogd_body;
297 static int hf_lustre_llogd_body_lgd_len;
298 static int hf_lustre_llogd_body_lgd_logid;
299 static int hf_lustre_llogd_body_lgd_index;
300 static int hf_lustre_llogd_body_lgd_saved_index;
301 static int hf_lustre_llogd_body_lgd_llh_flags;
302 static int hf_lustre_llogd_body_lgd_cur_offset;
303 static int hf_lustre_llogd_body_lgd_ctxt_idx;
304 static int hf_lustre_llogd_conn_body;
305 static int hf_lustre_llogd_conn_body_lgdc_gen;
306 static int hf_lustre_llogd_conn_body_lgdc_logid;
307 static int hf_lustre_llogd_conn_body_lgdc_ctxt_idx;
308 static int hf_lustre_llog_rec;
309 static int hf_lustre_llog_rec_hdr;
310 static int hf_lustre_llog_rec_tail;
311 static int hf_lustre_llog_rec_hdr_lrh_type;
312 static int hf_lustre_llog_rec_hdr_lrh_len;
313 static int hf_lustre_llog_rec_hdr_lrh_index;
314 static int hf_lustre_llog_rec_hdr_lrh_id;
315 static int hf_lustre_llog_rec_tail_lrt_index;
316 static int hf_lustre_llog_rec_tail_lrt_len;
317 static int hf_lustre_llog_log_hdr;
318 static int hf_lustre_llog_log_hdr_tgtuuid;
319 static int hf_lustre_llog_log_hdr_cat_idx;
320 static int hf_lustre_llog_log_hdr_bitmap_offset;
321 static int hf_lustre_llog_log_hdr_flags;
322 static int hf_lustre_llog_log_hdr_size;
323 static int hf_lustre_llog_log_hdr_tail;
324 static int hf_lustre_llog_log_hdr_bitmap;
325 static int hf_lustre_llog_log_hdr_count;
326 static int hf_lustre_llog_log_hdr_timestamp;
327 static int hf_lustre_llog_log_hdr_hdr;
328 static int hf_lustre_llog_log_hdr_reserved;
329 static int hf_lustre_llog_hdr_flag_zap_when_empty;
330 static int hf_lustre_llog_hdr_flag_is_cat;
331 static int hf_lustre_llog_hdr_flag_is_plain;
332 static int hf_lustre_llog_hdr_flag_ext_jobid;
333 static int hf_lustre_llog_hdr_flag_is_fixsize;
334 static int hf_lustre_llog_gen_rec;
335 static int hf_lustre_llog_gen_rec_hdr;
336 static int hf_lustre_llog_gen_rec_tail;
337 static int hf_lustre_llog_gen_rec_gen;
338 static int hf_lustre_llog_gen_rec_padding;
339 static int hf_lustre_llog_logid_rec;
340 static int hf_lustre_llog_logid_rec_hdr;
341 static int hf_lustre_llog_logid_rec_tail;
342 static int hf_lustre_llog_logid_rec_id;
343 static int hf_lustre_llog_logid_rec_padding;
344 static int hf_lustre_llog_logid_lgl_ogen;
345 static int hf_lustre_llog_unlink_rec;
346 static int hf_lustre_llog_unlink_rec_hdr;
347 static int hf_lustre_llog_unlink_rec_tail;
348 static int hf_lustre_llog_unlink_rec_oseq;
349 static int hf_lustre_llog_unlink_rec_oid;
350 static int hf_lustre_llog_unlink_rec_count;
351 static int hf_lustre_llog_unlink64_rec;
352 static int hf_lustre_llog_unlink64_rec_hdr;
353 static int hf_lustre_llog_unlink64_rec_fid;
354 static int hf_lustre_llog_unlink64_rec_count;
355 static int hf_lustre_llog_unlink64_rec_padding;
356 static int hf_lustre_llog_unlink64_rec_tail;
357 static int hf_lustre_llog_setattr64_rec;
358 static int hf_lustre_llog_setattr64_rec_hdr;
359 static int hf_lustre_llog_setattr64_rec_uid;
360 static int hf_lustre_llog_setattr64_rec_uid_h;
361 static int hf_lustre_llog_setattr64_rec_gid;
362 static int hf_lustre_llog_setattr64_rec_gid_h;
363 static int hf_lustre_llog_setattr64_rec_valid;
364 static int hf_lustre_llog_setattr64_rec_tail;
365 static int hf_lustre_llog_size_change_rec;
366 static int hf_lustre_llog_size_change_rec_hdr;
367 static int hf_lustre_llog_size_change_rec_io_epoch;
368 static int hf_lustre_llog_size_change_rec_fid;
369 static int hf_lustre_llog_size_change_rec_tail;
370 static int hf_lustre_llog_size_change_rec_padding;
371 static int hf_lustre_llog_cookie;
372 static int hf_lustre_llog_cookie_lgc_lgl;
373 static int hf_lustre_llog_cookie_lgc_padding;
374 static int hf_lustre_llog_cookie_lgc_index;
375 static int hf_lustre_llog_cookie_lgc_subsys;
376 static int hf_lustre_llog_gen_conn_cnt;
377 static int hf_lustre_llog_gen_mnt_cnt;
378 static int hf_lustre_llog_setattr_rec;
379 static int hf_lustre_llog_setattr_rec_hdr;
380 static int hf_lustre_llog_setattr_rec_oseq;
381 static int hf_lustre_llog_setattr_rec_padding;
382 static int hf_lustre_llog_setattr_rec_uid;
383 static int hf_lustre_llog_setattr_rec_oid;
384 static int hf_lustre_llog_setattr_rec_gid;
385 static int hf_lustre_llog_setattr_rec_tail;
386 static int hf_lustre_llog_changelog_rec;
387 static int hf_lustre_llog_changelog_rec_hdr;
388 static int hf_lustre_llog_changelog_rec_tail;
389 static int hf_lustre_changelog_rec;
390 static int hf_lustre_changelog_rec_namelen;
391 static int hf_lustre_changelog_rec_flags;
392 static int hf_lustre_changelog_rec_type;
393 static int hf_lustre_changelog_rec_index;
394 static int hf_lustre_changelog_rec_prev;
395 static int hf_lustre_changelog_rec_time;
396 static int hf_lustre_changelog_rec_tfid;
397 static int hf_lustre_changelog_rec_markerflags;
398 static int hf_lustre_changelog_rec_padding;
399 static int hf_lustre_changelog_rec_pfid;
400 static int hf_lustre_changelog_ext_rename_sfid;
401 static int hf_lustre_changelog_ext_rename_spfid;
402 static int hf_lustre_changelog_ext_jobid_jobid;
403 static int hf_lustre_changelog_extra_flags_extra_flags;
404 static int hf_lustre_changelog_ext_name;
405 static int hf_lustre_lustre_cfg;
406 static int hf_lustre_lustre_cfg_version;
407 static int hf_lustre_lustre_cfg_command;
408 static int hf_lustre_lustre_cfg_num;
409 static int hf_lustre_lustre_cfg_flags;
410 static int hf_lustre_lustre_cfg_nid;
411 static int hf_lustre_lustre_cfg_padding;
412 static int hf_lustre_lustre_cfg_bufcount;
413 static int hf_lustre_lustre_cfg_buflen;
414 static int hf_lustre_lustre_cfg_buffer;
415 static int hf_lustre_cfg_marker;
416 static int hf_lustre_cfg_marker_step;
417 static int hf_lustre_cfg_marker_flags;
418 static int hf_lustre_cfg_marker_vers;
419 static int hf_lustre_cfg_marker_padding;
420 static int hf_lustre_cfg_marker_createtime;
421 static int hf_lustre_cfg_marker_canceltime;
422 static int hf_lustre_cfg_marker_tgtname;
423 static int hf_lustre_cfg_marker_comment;
424 static int hf_lustre_rcs;
425 static int hf_lustre_rcs_rc;
426 static int hf_lustre_fid_array;
427 static int hf_lustre_fid_array_fid;
428 static int hf_lustre_niobuf_remote;
429 static int hf_lustre_niobuf_remote_len;
430 static int hf_lustre_niobuf_remote_flags;
431 static int hf_lustre_niobuf_remote_offset;
432 static int hf_lustre_lov_ost_data_v1;
433 static int hf_lustre_lov_ost_data_v1_l_ost_gen;
434 static int hf_lustre_lov_ost_data_v1_l_ost_idx;
435 static int hf_lustre_lmv_mds_md;
436 static int hf_lustre_lmv_mds_md_magic;
437 static int hf_lustre_lmv_mds_md_stripe_count;
438 static int hf_lustre_lmv_mds_md_master_mdt_index;
439 static int hf_lustre_lmv_mds_md_hash_type;
440 static int hf_lustre_lmv_mds_md_status;
441 static int hf_lustre_lmv_mds_md_layout_version;
442 static int hf_lustre_lmv_mds_md_padding;
443 static int hf_lustre_lmv_mds_md_pool_name;
444 static int hf_lustre_lmv_mds_md_stripe_fid;
445 static int hf_lustre_lmv_user_md_v1;
446 static int hf_lustre_lmv_user_md_v1_magic;
447 static int hf_lustre_lmv_user_md_v1_stripe_count;
448 static int hf_lustre_lmv_user_md_v1_stripe_offset;
449 static int hf_lustre_lmv_user_md_v1_hash_type;
450 static int hf_lustre_lmv_user_md_v1_type;
451 static int hf_lustre_lmv_user_md_v1_max_inherit;
452 static int hf_lustre_lmv_user_md_v1_max_inherit_rr;
453 static int hf_lustre_lmv_user_md_v1_padding;
454 static int hf_lustre_lmv_user_md_v1_pool_name;
455 static int hf_lustre_lmv_user_md_v1_objects;
456 static int hf_lustre_lmv_user_mds_data;
457 static int hf_lustre_lmv_user_mds_data_fid;
458 static int hf_lustre_lmv_user_mds_data_padding;
459 static int hf_lustre_lmv_user_mds_data_mds;
460 static int hf_lustre_lov_mds_md;
461 static int hf_lustre_lov_mds_md_lmm_magic;
462 static int hf_lustre_lov_mds_md_lmm_stripe_size;
463 static int hf_lustre_lov_mds_md_lmm_object_id;
464 static int hf_lustre_lov_mds_md_lmm_object_seq;
465 static int hf_lustre_lov_mds_md_lmm_stripe_count;
466 static int hf_lustre_lov_mds_md_lmm_pattern;
467 static int hf_lustre_lov_mds_md_lmm_layout_gen;
468 static int hf_lustre_lov_mds_md_lmm_pool_name;
469 static int hf_lustre_lov_desc;
470 static int hf_lustre_lov_desc_padding;
471 static int hf_lustre_lov_desc_pattern;
472 static int hf_lustre_lov_desc_default_stripe_count;
473 static int hf_lustre_lov_desc_magic;
474 static int hf_lustre_lov_desc_uuid;
475 static int hf_lustre_lov_desc_tgt_count;
476 static int hf_lustre_lov_desc_default_stripe_size;
477 static int hf_lustre_lov_desc_default_stripe_offset;
478 static int hf_lustre_lov_desc_qos_maxage;
479 static int hf_lustre_quota_body;
480 static int hf_lustre_qb_flags;
481 static int hf_lustre_qb_fid;
482 static int hf_lustre_qb_padding;
483 static int hf_lustre_qb_lockh;
484 static int hf_lustre_qb_glb_lockh;
485 static int hf_lustre_qb_count;
486 static int hf_lustre_qb_usage;
487 static int hf_lustre_qb_slv_ver;
488 static int hf_lustre_quota_adjust_qunit;
489 static int hf_lustre_quota_adjust_qunit_qaq_id;
490 static int hf_lustre_quota_adjust_qunit_qaq_flags;
491 static int hf_lustre_quota_adjust_qunit_qaq_iunit_sz;
492 static int hf_lustre_quota_adjust_qunit_qaq_bunit_sz;
493 static int hf_lustre_quota_adjust_qunit_padding1;
494 static int hf_lustre_lquota_id;
495 static int hf_lustre_qid_fid;
496 static int hf_lustre_qid_uid;
497 static int hf_lustre_qid_gid;
498 static int hf_lustre_ldlm_extent_gid;
499 static int hf_lustre_ldlm_extent_start;
500 static int hf_lustre_ldlm_extent_end;
501 static int hf_lustre_ldlm_flock_owner;
502 static int hf_lustre_ldlm_flock_pid;
503 static int hf_lustre_ldlm_flock_start;
504 static int hf_lustre_ldlm_flock_end;
505 static int hf_lustre_ldlm_flock_padding;
506 static int hf_lustre_ldlm_request;
507 static int hf_lustre_ldlm_request_lock_handle;
508 static int hf_lustre_ldlm_request_lock_flags;
509 static int hf_lustre_ldlm_request_lock_count;
510 static int hf_lustre_ldlm_reply;
511 static int hf_lustre_ldlm_reply_lock_flags;
512 static int hf_lustre_ldlm_reply_lock_policy_res1;
513 static int hf_lustre_ldlm_reply_lock_policy_res2;
514 static int hf_lustre_ldlm_reply_lock_handle;
515 static int hf_lustre_ldlm_reply_lock_padding;
516 static int hf_lustre_ldlm_inodebits_bits;
517 static int hf_lustre_ldlm_inodebits_try_bits;
518 static int hf_lustre_ldlm_lock_desc;
519 static int hf_lustre_ldlm_lock_desc_l_policy_data;
520 static int hf_lustre_ldlm_lock_desc_l_granted_mode;
521 static int hf_lustre_ldlm_lock_desc_l_req_mode;
522 static int hf_lustre_ldlm_res_id;
523 static int hf_lustre_ldlm_res_id_name;
524 static int hf_lustre_ldlm_res_id_bits;
525 static int hf_lustre_ldlm_res_id_string;
526 static int hf_lustre_ldlm_res_id_type;
527 static int hf_lustre_ldlm_resource_desc;
528 static int hf_lustre_ldlm_resource_desc_lr_type;
529 static int hf_lustre_ldlm_resource_desc_lr_padding;
530 static int hf_lustre_ldlm_intent_opc;
531 static int hf_lustre_ldlm_intent_opc_open;
532 static int hf_lustre_ldlm_intent_opc_creat;
533 static int hf_lustre_ldlm_intent_opc_readdir;
534 static int hf_lustre_ldlm_intent_opc_getattr;
535 static int hf_lustre_ldlm_intent_opc_lookup;
536 static int hf_lustre_ldlm_intent_opc_unlink;
537 static int hf_lustre_ldlm_intent_opc_trunc;
538 static int hf_lustre_ldlm_intent_opc_getxattr;
539 static int hf_lustre_ldlm_intent_opc_exec;
540 static int hf_lustre_ldlm_intent_opc_pin;
541 static int hf_lustre_ldlm_intent_opc_layout;
542 static int hf_lustre_ldlm_intent_opc_q_dqacq;
543 static int hf_lustre_ldlm_intent_opc_q_conn;
544 static int hf_lustre_ldlm_intent_opc_setxattr;
545 static int hf_lustre_ldlm_gl_barrier_desc;
546 static int hf_lustre_ldlm_gl_barrier_desc_status;
547 static int hf_lustre_ldlm_gl_barrier_desc_timeout;
548 static int hf_lustre_ldlm_gl_barrier_desc_padding;
549 static int hf_lustre_ldlm_gl_lquota_desc;
550 static int hf_lustre_ldlm_gl_lquota_desc_flags;
551 static int hf_lustre_ldlm_gl_lquota_desc_ver;
552 static int hf_lustre_ldlm_gl_lquota_desc_hardlimit;
553 static int hf_lustre_ldlm_gl_lquota_desc_softlimit;
554 static int hf_lustre_ldlm_gl_lquota_desc_time;
555 static int hf_lustre_ldlm_gl_lquota_desc_pad2;
556 static int hf_lustre_ldlm_key;
557 static int hf_lustre_ldlm_val;
558 static int hf_lustre_barrier_lvb;
559 static int hf_lustre_barrier_lvb_status;
560 static int hf_lustre_barrier_lvb_index;
561 static int hf_lustre_barrier_lvb_padding;
562 static int hf_lustre_mgs_target_info;
563 static int hf_lustre_mgs_target_info_mti_flags;
564 static int hf_lustre_mgs_target_info_mti_fsname;
565 static int hf_lustre_mgs_target_info_mti_svname;
566 static int hf_lustre_mgs_target_info_mti_config_ver;
567 static int hf_lustre_mgs_target_info_mti_uuid;
568 static int hf_lustre_mgs_target_info_mti_stripe_index;
569 static int hf_lustre_mgs_target_info_mti_params;
570 static int hf_lustre_mgs_target_info_mti_nids;
571 static int hf_lustre_mgs_target_info_mti_lustre_ver;
572 static int hf_lustre_mgs_target_info_mti_nid_count;
573 static int hf_lustre_mgs_target_info_mti_instance;
574 static int hf_lustre_mgs_target_info_padding;
575 static int hf_lustre_mgs_send_param;
576 static int hf_lustre_mgs_config_body;
577 static int hf_lustre_mgs_config_body_name;
578 static int hf_lustre_mgs_config_body_offset;
579 static int hf_lustre_mgs_config_body_type;
580 static int hf_lustre_mgs_config_body_nm_cur_pass;
581 static int hf_lustre_mgs_config_body_bits;
582 static int hf_lustre_mgs_config_body_units;
583 static int hf_lustre_mgs_config_res;
584 static int hf_lustre_mgs_config_res_offset;
585 static int hf_lustre_mgs_config_res_size;
586 static int hf_lustre_mgs_config_res_nm_cur_pass;
587 static int hf_lustre_lustre_handle;
588 static int hf_lustre_lustre_handle_cookie;
589 static int hf_lustre_lu_fid_f_seq;
590 static int hf_lustre_lu_fid_f_oid;
591 static int hf_lustre_lu_fid_f_ver;
592 static int hf_lustre_ost_oi_id;
593 static int hf_lustre_ost_oi_seq;
594 static int hf_lustre_obdo;
595 static int hf_lustre_obdo_o_nlink;
596 static int hf_lustre_obdo_o_uid;
597 static int hf_lustre_obdo_o_valid;
598 static int hf_lustre_obdo_o_misc;
599 static int hf_lustre_obdo_o_padding_4;
600 static int hf_lustre_obdo_o_size;
601 static int hf_lustre_obdo_o_mode;
602 static int hf_lustre_obdo_o_handle;
603 static int hf_lustre_obdo_o_atime;
604 static int hf_lustre_obdo_o_gid;
605 static int hf_lustre_obdo_o_ioepoch;
606 static int hf_lustre_obdo_o_data_version;
607 static int hf_lustre_obdo_o_projid;
608 //static int hf_lustre_obdo_o_lcookie;
609 static int hf_lustre_obdo_o_padding_6;
610 static int hf_lustre_obdo_o_padding_3;
611 static int hf_lustre_obdo_o_flags;
612 static int hf_lustre_obdo_o_mtime;
613 static int hf_lustre_obdo_o_blksize;
614 static int hf_lustre_obdo_o_blocks;
615 static int hf_lustre_obdo_o_grant;
616 static int hf_lustre_obdo_o_uid_h;
617 static int hf_lustre_obdo_o_gid_h;
618 static int hf_lustre_obdo_o_stripe_idx;
619 static int hf_lustre_obdo_o_parent_ver;
620 static int hf_lustre_obdo_o_parent_oid;
621 static int hf_lustre_obdo_o_padding_5;
622 static int hf_lustre_obdo_o_parent_seq;
623 static int hf_lustre_obdo_o_ctime;
624 static int hf_lustre_xattr_list;
625 static int hf_lustre_xattr;
626 static int hf_lustre_xattr_name;
627 static int hf_lustre_xattr_data;
628 static int hf_lustre_xattr_size;
629 static int hf_lustre_seq_opc;
630 static int hf_lustre_seq_range;
631 static int hf_lustre_seq_range_start;
632 static int hf_lustre_seq_range_end;
633 static int hf_lustre_seq_range_index;
634 static int hf_lustre_seq_range_flags;
635 static int hf_lustre_fld_opc;
636 static int hf_lustre_capa;
637 static int hf_lustre_capa_fid;
638 static int hf_lustre_capa_opc;
639 static int hf_lustre_capa_uid;
640 static int hf_lustre_capa_gid;
641 static int hf_lustre_capa_flags;
642 static int hf_lustre_capa_keyid;
643 static int hf_lustre_capa_timeout;
644 static int hf_lustre_capa_expiry;
645 static int hf_lustre_capa_hmac;
646 static int hf_lustre_acl;
647 static int hf_lustre_hsm_user_item;
648 static int hf_lustre_hsm_user_item_fid;
649 static int hf_lustre_layout_intent;
650 static int hf_lustre_layout_intent_opc;
651 static int hf_lustre_layout_intent_flags;
652 static int hf_lustre_layout_intent_start;
653 static int hf_lustre_layout_intent_end;
654 static int hf_lustre_data;
655 static int hf_lustre_name;
656 static int hf_lustre_filename;
657 static int hf_lustre_secctx_name;
658 static int hf_lustre_selinux_pol;
659 static int hf_lustre_target;
660 static int hf_lustre_eadata;
661 static int hf_lustre_idx_info;
662 static int hf_lustre_idx_info_magic;
663 static int hf_lustre_idx_info_flags;
664 static int hf_lustre_idx_info_count;
665 static int hf_lustre_idx_info_attrs;
666 static int hf_lustre_idx_info_fid;
667 static int hf_lustre_idx_info_hash_start;
668 static int hf_lustre_idx_info_hash_end;
669 static int hf_lustre_idx_info_keysize;
670 static int hf_lustre_idx_info_recsize;
671 static int hf_lustre_idx_info_padding;
672 static int hf_lustre_out_update_header;
673 static int hf_lustre_out_update_header_magic;
674 static int hf_lustre_out_update_header_count;
675 static int hf_lustre_out_update_header_inline_length;
676 static int hf_lustre_out_update_header_reply_size;
677 static int hf_lustre_out_update_header_inline_data;
678 static int hf_lustre_out_update_buffer;
679 static int hf_lustre_out_update_buffer_size;
680 static int hf_lustre_out_update_buffer_padding;
681 static int hf_lustre_obj_update_reply;
682 static int hf_lustre_obj_update_reply_magic;
683 static int hf_lustre_obj_update_reply_count;
684 static int hf_lustre_obj_update_reply_padding;
685 static int hf_lustre_obj_update_reply_lens;
686 static int hf_lustre_obj_update_request;
687 static int hf_lustre_obj_update_request_magic;
688 static int hf_lustre_obj_update_request_count;
689 static int hf_lustre_obj_update_request_padding;
690 static int hf_lustre_obj_update_result;
691 static int hf_lustre_obj_update_result_rc;
692 static int hf_lustre_obj_update_result_datalen;
693 static int hf_lustre_obj_update_result_padding;
694 static int hf_lustre_obj_update_result_data;
695 static int hf_lustre_obj_update;
696 static int hf_lustre_obj_update_type;
697 static int hf_lustre_obj_update_params_count;
698 static int hf_lustre_obj_update_result_size;
699 static int hf_lustre_obj_update_flags;
700 static int hf_lustre_obj_update_padding;
701 static int hf_lustre_obj_update_batchid;
702 static int hf_lustre_obj_update_fid;
703 static int hf_lustre_obj_update_param;
704 static int hf_lustre_obj_update_param_len;
705 static int hf_lustre_obj_update_param_padding;
706 static int hf_lustre_obj_update_param_buf;
707 static int hf_lustre_lfsck_request;
708 static int hf_lustre_lfsck_request_event;
709 static int hf_lustre_lfsck_request_index;
710 static int hf_lustre_lfsck_request_flags;
711 static int hf_lustre_lfsck_request_valid;
712 static int hf_lustre_lfsck_request_speed;
713 static int hf_lustre_lfsck_request_status;
714 static int hf_lustre_lfsck_request_version;
715 static int hf_lustre_lfsck_request_active;
716 static int hf_lustre_lfsck_request_param;
717 static int hf_lustre_lfsck_request_async_windows;
718 static int hf_lustre_lfsck_request_flags2;
719 static int hf_lustre_lfsck_request_fid;
720 static int hf_lustre_lfsck_request_fid2;
721 static int hf_lustre_lfsck_request_comp_id;
722 static int hf_lustre_lfsck_request_padding;
723 static int hf_lustre_lfsck_reply;
724 static int hf_lustre_lfsck_reply_status;
725 static int hf_lustre_lfsck_reply_padding;
726 static int hf_lustre_lfsck_reply_repaired;
728 /* Ett declarations */
729 static int ett_lustre;
730 static int ett_lustre_lustre_handle_cookie;
731 static int ett_lustre_lustre_msg_v1;
732 static int ett_lustre_lustre_handle_v1;
733 static int ett_lustre_lustre_msg_v2;
734 static int ett_lustre_ptlrpc_body;
735 static int ett_lustre_lustre_handle_v2;
736 static int ett_lustre_obd_connect_data;
737 static int ett_lustre_lov_ost_data_v1;
738 static int ett_lustre_obd_statfs;
739 static int ett_lustre_obd_ioobj;
740 static int ett_lustre_niobuf_remote;
741 static int ett_lustre_rcs;
742 static int ett_lustre_fid_array;
743 static int ett_lustre_ost_lvb;
744 static int ett_lustre_lu_fid;
745 static int ett_lustre_mdc_swap_layouts;
746 static int ett_lustre_mdt_body;
747 static int ett_lustre_mdt_rec_reint;
748 static int ett_lustre_obd_quotactl;
749 static int ett_lustre_obd_dqinfo;
750 static int ett_lustre_obd_dqblk;
751 static int ett_lustre_quota_adjust_qunit;
752 static int ett_lustre_lov_desc;
753 static int ett_lustre_obd_uuid;
754 static int ett_lustre_ldlm_res_id;
755 static int ett_lustre_ldlm_extent;
756 static int ett_lustre_ldlm_inodebits;
757 static int ett_lustre_ldlm_flock;
758 static int ett_lustre_ldlm_intent_opc;
759 static int ett_lustre_ldlm_resource_desc;
760 static int ett_lustre_ldlm_lock_desc;
761 static int ett_lustre_ldlm_request;
762 static int ett_lustre_lustre_handle;
763 static int ett_lustre_ldlm_reply;
764 static int ett_lustre_ldlm_gl_barrier_desc;
765 static int ett_lustre_ldlm_gl_lquota_desc;
766 static int ett_lustre_mgs_target_info;
767 static int ett_lustre_mgs_config_body;
768 static int ett_lustre_mgs_config_res;
769 static int ett_lustre_llog_rec;
770 static int ett_lustre_llog_rec_hdr;
771 static int ett_lustre_llog_rec_tail;
772 static int ett_lustre_llog_logid_rec;
773 static int ett_lustre_llog_logid;
774 static int ett_lustre_lmv_mds_md;
775 static int ett_lustre_lmv_user_md_v1;
776 static int ett_lustre_lmv_user_mds_data;
777 static int ett_lustre_lov_mds_md;
778 static int ett_lustre_llog_unlink_rec;
779 static int ett_lustre_llog_unlink64_rec;
780 static int ett_lustre_llog_setattr_rec;
781 static int ett_lustre_llog_setattr64_rec;
782 static int ett_lustre_llog_size_change_rec;
783 static int ett_lustre_llog_gen_rec;
784 static int ett_lustre_llog_changelog_rec;
785 static int ett_lustre_llog_log_hdr;
786 static int ett_lustre_llog_hdr_flags;
787 static int ett_lustre_llog_cookie;
788 static int ett_lustre_llogd_body;
789 static int ett_lustre_llogd_conn_body;
790 static int ett_lustre_llog_gen;
791 static int ett_lustre_changelog_rec;
792 static int ett_lustre_lustre_cfg;
793 static int ett_lustre_cfg_marker;
794 static int ett_lustre_obdo;
795 static int ett_lustre_ost_body;
796 static int ett_lustre_ldlm_lock_flags;
797 static int ett_lustre_seq_range;
798 static int ett_lustre_mdt_ioepoch;
799 static int ett_lustre_capa;
800 static int ett_lustre_idx_info;
801 static int ett_lustre_close_data;
802 static int ett_lustre_acl;
803 static int ett_lustre_ladvise_hdr;
804 static int ett_lustre_ladvise;
805 static int ett_lustre_hsm_request;
806 static int ett_lustre_hsm_archive;
807 static int ett_lustre_hsm_current_action;
808 static int ett_lustre_hsm_user_item;
809 static int ett_lustre_hsm_extent;
810 static int ett_lustre_hsm_state_set;
811 static int ett_lustre_hsm_progress;
812 static int ett_lustre_hsm_user_state;
813 static int ett_lustre_quota_body;
814 static int ett_lustre_lquota_id;
815 static int ett_lustre_layout_intent;
816 static int ett_lustre_xattrs;
817 static int ett_lustre_xattr_item;
818 static int ett_lustre_ost_id;
819 static int ett_lustre_ost_id_oi;
820 static int ett_lustre_ost_layout;
821 static int ett_lustre_eadata;
822 static int ett_lustre_out_update_header;
823 static int ett_lustre_out_update_header_data;
824 static int ett_lustre_out_update_buffer;
825 static int ett_lustre_obj_update_reply;
826 static int ett_lustre_obj_update_result;
827 static int ett_lustre_object_update_request;
828 static int ett_lustre_object_update;
829 static int ett_lustre_object_update_param;
830 static int ett_lustre_lfsck_request;
831 static int ett_lustre_lfsck_reply;
832 static int ett_lustre_barrier_lvb;
834 static expert_field ei_lustre_buflen;
835 static expert_field ei_lustre_badopc;
836 static expert_field ei_lustre_badmagic;
837 static expert_field ei_lustre_obsopc;
839 /* --------------------------------------------------------------------------------------- */
840 /* def and macro to know where we are the the lustre payload */
841 #define LUSTRE_MAGIC_OFFSET 8
843 #define LUSTRE_BUFCOUNT_OFF ((tvb_get_letohl(tvb, LUSTRE_MAGIC_OFFSET)== MSG_MAGIC_V2) ? 0 : 60)
844 #define LUSTRE_BUFCOUNT ((tvb_get_letohl(tvb, LUSTRE_MAGIC_OFFSET)== MSG_MAGIC_V2) \
845 ? (tvb_get_letohl(tvb, LUSTRE_BUFCOUNT_OFF)) : ((tvb_get_letohl(tvb, LUSTRE_BUFCOUNT_OFF))) )
846 /* remark : BUFLENOFF don't have the same meaning if it's for v1 or v2
847 * v1 : LUSTRE_BUFLEN_OFF = offset buflen[0] - 4 bytes.
848 * v2 : LUSTRE_BUFLEN_OFF = offset buflen[0]
850 #define LUSTRE_BUFLEN_OFF ((tvb_get_letohl(tvb, LUSTRE_MAGIC_OFFSET)== MSG_MAGIC_V2) ? 32 : 60)
852 /* LUSTRE_BUFFER_LEN(buffnum) */
853 #define LUSTRE_BUFFER_LEN(_n) (LUSTRE_BUFCOUNT <= (_n) ? 0 \
854 : tvb_get_letohl(tvb, LUSTRE_BUFLEN_OFF+ \
855 4*(_n)))
857 #define LUSTRE_REC_OFF 1 /* normal request/reply record offset */
859 /* --------------------------------------------------------------------------------------- */
861 #define LUSTRE_PTLRPC_MSG_VERSION 0x00000003
862 #define LUSTRE_VERSION_MASK 0xffff0000
863 #if 0 /* @@ NOT USED */
864 #define LUSTRE_OBD_VERSION 0x00010000
865 #define LUSTRE_MDS_VERSION 0x00020000
866 #define LUSTRE_OST_VERSION 0x00030000
867 #define LUSTRE_DLM_VERSION 0x00040000
868 #define LUSTRE_LOG_VERSION 0x00050000
869 #define LUSTRE_MGS_VERSION 0x00060000
870 #endif
871 #define LMV_HASH_TYPE_MASK 0x0000ffff
873 #define lustre_magic_VALUE_STRING_LIST(XXX) \
874 XXX(MSG_MAGIC_V1, 0x0BD00BD0) \
875 XXX(MSG_MAGIC_V2, 0x0BD00BD3) \
876 XXX(LOV_MAGIC_V1, 0x0BD10BD0) \
877 XXX(LOV_MAGIC_V3, 0x0BD30BD0) \
878 XXX(LMV_MAGIC_V1, 0x0CD20CD0) \
879 XXX(LMV_USER_MAGIC, 0x0CD30CD0) \
880 XXX(LMV_MAGIC_STRIPE, 0x0CD40CD0) \
881 XXX(LMV_MAGIC_FOREIGN, 0x0CD50CD0) \
882 XXX(LADVISE_MAGIC, 0x1ADF1CE0) \
883 XXX(IDX_INFO_MAGIC, 0x3D37CC37)
884 VALUE_STRING_ENUM2(lustre_magic);
885 VALUE_STRING_ARRAY2(lustre_magic);
887 #define lov_pattern_vals_VALUE_STRING_LIST(XXX) \
888 XXX(LOV_PATTERN_NONE, 0x000, "NONE") \
889 XXX(LOV_PATTERN_RAID0, 0x001, "RAID0") \
890 XXX(LOV_PATTERN_RAID1, 0x002, "RAID1") \
891 XXX(LOV_PATTERN_MDT, 0x100, "MDT") \
892 XXX(LOV_PATTERN_CMOBD, 0x200, "CMOBD")
893 VALUE_STRING_ENUM(lov_pattern_vals);
894 VALUE_STRING_ARRAY(lov_pattern_vals);
896 #define lmv_hash_type_vals_VALUE_STRING_LIST(XXX) \
897 XXX(LMV_HASH_TYPE_ALL_CHARS, 1, "all_char") \
898 XXX(LMV_HASH_TYPE_FNV_1A_64, 2, "fnv_1a_64") \
899 XXX(LMV_HASH_TYPE_CRUSH, 3, "crush") \
900 XXX(LMV_HASH_TYPE_CRUSH2, 4, "crush2")
902 VALUE_STRING_ENUM(lmv_hash_type_vals);
903 VALUE_STRING_ARRAY(lmv_hash_type_vals);
905 #define capa_flags_vals_VALUE_STRING_LIST(XXX) \
906 XXX(CAPA_OPC_BODY_WRITE, 1<<0) \
907 XXX(CAPA_OPC_BODY_READ, 1<<1) \
908 XXX(CAPA_OPC_INDEX_LOOKUP, 1<<2) \
909 XXX(CAPA_OPC_INDEX_INSERT, 1<<3) \
910 XXX(CAPA_OPC_INDEX_DELETE, 1<<4) \
911 XXX(CAPA_OPC_OSS_WRITE, 1<<5) \
912 XXX(CAPA_OPC_OSS_READ, 1<<6) \
913 XXX(CAPA_OPC_OSS_TRUNC, 1<<7) \
914 XXX(CAPA_OPC_OSS_DESTROY, 1<<8) \
915 XXX(CAPA_OPC_META_WRITE, 1<<9) \
916 XXX(CAPA_OPC_META_READ, 1<<10)
917 //VALUE_STRING_ENUM2(capa_flags_vals);
918 VALUE_STRING_ARRAY2(capa_flags_vals);
920 #define lustre_op_codes_VALUE_STRING_LIST(XXX) \
921 XXX(OST_REPLY, 0) \
922 XXX(OST_GETATTR, 1) \
923 XXX(OST_SETATTR, 2) \
924 XXX(OST_READ, 3) \
925 XXX(OST_WRITE, 4) \
926 XXX(OST_CREATE, 5) \
927 XXX(OST_DESTROY, 6) \
928 XXX(OST_GET_INFO, 7) \
929 XXX(OST_CONNECT, 8) \
930 XXX(OST_DISCONNECT, 9) \
931 XXX(OST_PUNCH, 10) \
932 XXX(OST_OPEN, 11) \
933 XXX(OST_CLOSE, 12) \
934 XXX(OST_STATFS, 13) \
935 XXX(OST_SYNC, 16) \
936 XXX(OST_SET_INFO, 17) \
937 XXX(OST_QUOTACHECK, 18) \
938 XXX(OST_QUOTACTL, 19) \
939 XXX(OST_QUOTA_ADJUST_QUNIT, 20) \
940 XXX(OST_LADVISE, 21) \
941 XXX(OST_LAST_OPC, 22) \
942 XXX(MDS_GETATTR, 33) \
943 XXX(MDS_GETATTR_NAME, 34) \
944 XXX(MDS_CLOSE, 35) \
945 XXX(MDS_REINT, 36) \
946 XXX(MDS_READPAGE, 37) \
947 XXX(MDS_CONNECT, 38) \
948 XXX(MDS_DISCONNECT, 39) \
949 XXX(MDS_GET_ROOT, 40) \
950 XXX(MDS_STATFS, 41) \
951 XXX(MDS_PIN, 42) \
952 XXX(MDS_UNPIN, 43) \
953 XXX(MDS_SYNC, 44) \
954 XXX(MDS_DONE_WRITING, 45) \
955 XXX(MDS_SET_INFO, 46) \
956 XXX(MDS_QUOTACHECK, 47) \
957 XXX(MDS_QUOTACTL, 48) \
958 XXX(MDS_GETXATTR, 49) \
959 XXX(MDS_SETXATTR, 50) \
960 XXX(MDS_WRITEPAGE, 51) \
961 XXX(MDS_IS_SUBDIR, 52) \
962 XXX(MDS_GET_INFO, 53) \
963 XXX(MDS_HSM_STATE_GET, 54) \
964 XXX(MDS_HSM_STATE_SET, 55) \
965 XXX(MDS_HSM_ACTION, 56) \
966 XXX(MDS_HSM_PROGRESS, 57) \
967 XXX(MDS_HSM_REQUEST, 58) \
968 XXX(MDS_HSM_CT_REGISTER, 59) \
969 XXX(MDS_HSM_CT_UNREGISTER, 60) \
970 XXX(MDS_SWAP_LAYOUTS, 61) \
971 XXX(MDS_RMFID, 62) \
972 XXX(MDS_LAST_OPC, 63) \
973 XXX(LDLM_ENQUEUE, 101) \
974 XXX(LDLM_CONVERT, 102) \
975 XXX(LDLM_CANCEL, 103) \
976 XXX(LDLM_BL_CALLBACK, 104) \
977 XXX(LDLM_CP_CALLBACK, 105) \
978 XXX(LDLM_GL_CALLBACK, 106) \
979 XXX(LDLM_SET_INFO, 107) \
980 XXX(LDLM_LAST_OPC, 108) \
981 XXX(MGS_CONNECT, 250) \
982 XXX(MGS_DISCONNECT, 251) \
983 XXX(MGS_EXCEPTION, 252) \
984 XXX(MGS_TARGET_REG, 253) \
985 XXX(MGS_TARGET_DEL, 254) \
986 XXX(MGS_SET_INFO, 255) \
987 XXX(MGS_CONFIG_READ, 256) \
988 XXX(MGS_LAST_OPC, 257) \
989 XXX(OBD_PING, 400) \
990 XXX(OBD_LOG_CANCEL, 401) \
991 XXX(OBD_QC_CALLBACK, 402) \
992 XXX(OBD_IDX_READ, 403) \
993 XXX(OBD_LAST_OPC, 404) \
994 XXX(LLOG_ORIGIN_HANDLE_CREATE, 501) \
995 XXX(LLOG_ORIGIN_HANDLE_NEXT_BLOCK, 502) \
996 XXX(LLOG_ORIGIN_HANDLE_READ_HEADER, 503) \
997 XXX(LLOG_ORIGIN_HANDLE_WRITE_REC, 504) \
998 XXX(LLOG_ORIGIN_HANDLE_CLOSE, 505) \
999 XXX(LLOG_ORIGIN_CONNECT, 506) \
1000 XXX(LLOG_CATINFO, 507) \
1001 XXX(LLOG_ORIGIN_HANDLE_PREV_BLOCK, 508) \
1002 XXX(LLOG_ORIGIN_HANDLE_DESTROY, 509) \
1003 XXX(LLOG_LAST_OPC, 510) \
1004 XXX(QUOTA_DQACQ, 601) \
1005 XXX(QUOTA_DQREL, 602) \
1006 XXX(QUOTA_LAST_OPC, 603) \
1007 XXX(SEQ_QUERY, 700) \
1008 XXX(SEQ_LAST_OPC, 701) \
1009 XXX(SEC_CTX_INIT, 801) \
1010 XXX(SEC_CTX_INIT_CONT, 802) \
1011 XXX(SEC_CTX_FINI, 803) \
1012 XXX(SEC_LAST_OPC, 804) \
1013 XXX(FLD_QUERY, 900) \
1014 XXX(FLD_READ, 901) \
1015 XXX(FLD_LAST_OPC, 902) \
1016 XXX(OUT_UPDATE, 1000) \
1017 XXX(OUT_UPDATE_LAST_OPC, 1001) \
1018 XXX(LFSCK_NOTIFY, 1101) \
1019 XXX(LFSCK_QUERY, 1102) \
1020 XXX(LFSCK_LAST_OPC, 1103)
1022 VALUE_STRING_ENUM2(lustre_op_codes);
1023 VALUE_STRING_ARRAY2(lustre_op_codes);
1025 #define OST_FIRST_OPC OST_REPLY
1026 #define QUOTA_FIRST_OPC QUOTA_DQACQ
1027 #define MDS_FIRST_OPC MDS_GETATTR
1028 #define OUT_UPDATE_FIRST_OPC OUT_UPDATE
1029 #define FLD_FIRST_OPC FLD_QUERY
1030 #define SEQ_FIRST_OPC SEQ_QUERY
1031 #define LFSCK_FIRST_OPC LFSCK_NOTIFY
1032 #define LDLM_FIRST_OPC LDLM_ENQUEUE
1033 #define MGS_FIRST_OPC MGS_CONNECT
1034 #define OBD_FIRST_OPC OBD_PING
1035 #define LLOG_FIRST_OPC LLOG_ORIGIN_HANDLE_CREATE
1036 #define SEC_FIRST_OPC SEC_CTX_INIT
1039 #define lustre_LMTypes_VALUE_STRING_LIST(XXX) \
1040 XXX(PTL_RPC_MSG_REQUEST, 4711, "request") \
1041 XXX(PTL_RPC_MSG_ERR, 4712, "error") \
1042 XXX(PTL_RPC_MSG_REPLY, 4713, "reply")
1044 VALUE_STRING_ENUM(lustre_LMTypes);
1045 VALUE_STRING_ARRAY(lustre_LMTypes);
1047 static const true_false_string lnet_flags_set_truth = { "Set", "Unset" };
1049 #define lustre_layout_intent_opc_vals_VALUE_STRING_LIST(XXX) \
1050 XXX(LAYOUT_INTENT_ACCESS, 0, "ACCESS") \
1051 XXX(LAYOUT_INTENT_READ, 1, "READ") \
1052 XXX(LAYOUT_INTENT_WRITE, 2, "WRITE") \
1053 XXX(LAYOUT_INTENT_GLIMPSE, 3, "GLIMPSE") \
1054 XXX(LAYOUT_INTENT_TRUNC, 4, "TRUNCATE") \
1055 XXX(LAYOUT_INTENT_RELEASE, 5, "RELEASE") \
1056 XXX(LAYOUT_INTENT_RESTORE, 6, "RESTORE")
1057 //VALUE_STRING_ENUM(lustre_layout_intent_opc_vals);
1058 VALUE_STRING_ARRAY(lustre_layout_intent_opc_vals);
1060 #define obd_statfs_state_VALUE_STRING_LIST(XXX) \
1061 XXX(OS_STATE_DEGRADED, 0x00000001, "Degraded") \
1062 XXX(OS_STATE_READONLY, 0x00000002, "ReadOnly") \
1063 XXX(OS_STATE_ENOSPC, 0x00000020, "No Space") \
1064 XXX(OS_STATE_ENOINO, 0x00000040, "No Indoes") \
1065 XXX(OS_STATE_SUM, 0x00000100, "Sum") \
1066 XXX(OS_STATE_NONROT, 0x00000200, "Non-Rotating")
1068 //VALUE_STRING_ENUM(obd_statfs_state);
1069 VALUE_STRING_ARRAY(obd_statfs_state);
1070 /********************************************************************
1072 * OST Definitions
1076 #define lu_ladvise_type_vals_VALUE_STRING_LIST(XXX) \
1077 XXX(LU_LADVISE_WILLREAD, 1, "willread") \
1078 XXX(LU_LADVISE_DONTNEED, 2, "dontneed")
1079 //VALUE_STRING_ENUM2(lu_ladvise_type_vals);
1080 VALUE_STRING_ARRAY(lu_ladvise_type_vals);
1083 /********************************************************************
1085 * MDS Definitions
1089 #define mds_reint_vals_VALUE_STRING_LIST(XXX) \
1090 XXX(REINT_SETATTR, 1, "SETATTR") \
1091 XXX(REINT_CREATE, 2, "CREATE") \
1092 XXX(REINT_LINK, 3, "LINK") \
1093 XXX(REINT_UNLINK, 4, "UNLINK") \
1094 XXX(REINT_RENAME, 5, "RENAME") \
1095 XXX(REINT_OPEN, 6, "OPEN") \
1096 XXX(REINT_SETXATTR, 7, "SETXATTR") \
1097 XXX(REINT_RMENTRY, 8, "RMENTRY") \
1098 XXX(REINT_MIGRATE, 9, "MIGRATE")
1099 VALUE_STRING_ENUM(mds_reint_vals);
1100 VALUE_STRING_ARRAY(mds_reint_vals);
1102 #define lustre_mds_flags_vals_VALUE_STRING_LIST(XXX) \
1103 XXX(LUSTRE_SYNC_FL, 0x00000008) \
1104 XXX(LUSTRE_IMMUTABLE_FL, 0x00000010) \
1105 XXX(LUSTRE_APPEND_FL, 0x00000020) \
1106 XXX(LUSTRE_NODUMP_FL, 0x00000040) \
1107 XXX(LUSTRE_NOATIME_FL, 0x00000080) \
1108 XXX(LUSTRE_INDEX_FL, 0x00001000) \
1109 XXX(LUSTRE_DIRSYNC_FL, 0x00010000) \
1110 XXX(LUSTRE_TOPDIR_FL, 0x00020000) \
1111 XXX(LUSTRE_DIRECTIO_FL, 0x00100000) \
1112 XXX(LUSTRE_INLINE_DATA_FL, 0x10000000) \
1113 XXX(LUSTRE_PROJINHERIT_FL, 0x20000000) \
1114 XXX(LUSTRE_ORPHAN_FL, 0x00002000)
1115 //VALUE_STRING_ENUM2(lustre_mds_flags_vals);
1116 VALUE_STRING_ARRAY2(lustre_mds_flags_vals);
1118 /********************************************************************
1120 * MGS Definitions
1124 #define mgs_config_body_type_vals_VALUE_STRING_LIST(XXX) \
1125 XXX(CONFIG_T_CONFIG, 0, "CONFIG") \
1126 XXX(CONFIG_T_SPTLRPC, 1, "SPTLRPC") \
1127 XXX(CONFIG_T_RECOVER, 2, "RECOVER") \
1128 XXX(CONFIG_T_PARAMS, 3, "PARAMS") \
1129 XXX(CONFIG_T_NODEMAP, 4, "NODEMAP") \
1130 XXX(CONFIG_T_BARRIER, 5, "BARRIER")
1131 VALUE_STRING_ENUM(mgs_config_body_type_vals);
1132 VALUE_STRING_ARRAY(mgs_config_body_type_vals);
1135 /********************************************************************
1137 * LDLM Definitions
1141 #define lustre_ldlm_mode_vals_VALUE_STRING_LIST(XXX) \
1142 XXX(LCK_MINMODE, 0, "MINMODE") \
1143 XXX(LCK_EX, 1, "Exclusive") \
1144 XXX(LCK_PW, 2, "Protected Write") \
1145 XXX(LCK_PR, 4, "Protected Read") \
1146 XXX(LCK_CW, 8, "Concurrent Write") \
1147 XXX(LCK_CR, 16, "Concurrent Read") \
1148 XXX(LCK_NL, 32, "Null") \
1149 XXX(LCK_GROUP, 64, "Group") \
1150 XXX(LCK_COS, 128, "Commit on Sharing")
1152 VALUE_STRING_ENUM(lustre_ldlm_mode_vals);
1153 VALUE_STRING_ARRAY(lustre_ldlm_mode_vals);
1155 #define lustre_ldlm_type_vals_VALUE_STRING_LIST(XXX) \
1156 XXX(LDLM_PLAIN, 10) \
1157 XXX(LDLM_EXTENT, 11) \
1158 XXX(LDLM_FLOCK, 12) \
1159 XXX(LDLM_IBITS, 13)
1160 VALUE_STRING_ENUM2(lustre_ldlm_type_vals);
1161 VALUE_STRING_ARRAY2(lustre_ldlm_type_vals);
1163 #define lustre_ldlm_intent_flags_VALUE_STRING_LIST(XXX) \
1164 XXX(IT_OPEN, 0x00000001) \
1165 XXX(IT_CREAT, 0x00000002) \
1166 XXX(IT_OPEN_CREAT, 0x00000003) \
1167 XXX(IT_READDIR, 0x00000004) \
1168 XXX(IT_GETATTR, 0x00000008) \
1169 XXX(IT_LOOKUP, 0x00000010) \
1170 XXX(IT_UNLINK, 0x00000020) \
1171 XXX(IT_TRUNC, 0x00000040) \
1172 XXX(IT_GETXATTR, 0x00000080) \
1173 XXX(IT_EXEC, 0x00000100) \
1174 XXX(IT_PIN, 0x00000200) \
1175 XXX(IT_LAYOUT, 0x00000400) \
1176 XXX(IT_QUOTA_DQACQ, 0x00000800) \
1177 XXX(IT_QUOTA_CONN, 0x00001000) \
1178 XXX(IT_SETXATTR, 0x00002000)
1179 VALUE_STRING_ENUM2(lustre_ldlm_intent_flags);
1180 //VALUE_STRING_ARRAY2(lustre_ldlm_intent_flags);
1182 #define lustre_barrier_status_vals_VALUE_STRING_LIST(XXX) \
1183 XXX(BS_INIT, 0) \
1184 XXX(BS_FREEZING_P1, 1) \
1185 XXX(BS_FREEZING_P2, 2) \
1186 XXX(BS_FROZEN, 3) \
1187 XXX(BS_THAWING, 4) \
1188 XXX(BS_THAWED, 5) \
1189 XXX(BS_FAILED, 6) \
1190 XXX(BS_EXPIRED, 7) \
1191 XXX(BS_RESCAN, 8)
1192 VALUE_STRING_ENUM2(lustre_barrier_status_vals);
1193 VALUE_STRING_ARRAY2(lustre_barrier_status_vals);
1195 #define LDLM_FL_LOCK_CHANGED 0x0000000000000001ULL
1196 #define LDLM_FL_BLOCK_GRANTED 0x0000000000000002ULL
1197 #define LDLM_FL_BLOCK_CONV 0x0000000000000004ULL
1198 #define LDLM_FL_BLOCK_WAIT 0x0000000000000008ULL
1199 #define LDLM_FL_AST_SENT 0x0000000000000020ULL
1200 #define LDLM_FL_REPLAY 0x0000000000000100ULL
1201 #define LDLM_FL_INTENT_ONLY 0x0000000000000200ULL
1202 #define LDLM_FL_HAS_INTENT 0x0000000000001000ULL
1203 #define LDLM_FL_FLOCK_DEADLOCK 0x0000000000008000ULL
1204 #define LDLM_FL_DISCARD_DATA 0x0000000000010000ULL
1205 #define LDLM_FL_NO_TIMEOUT 0x0000000000020000ULL
1206 #define LDLM_FL_BLOCK_NOWAIT 0x0000000000040000ULL
1207 #define LDLM_FL_TEST_LOCK 0x0000000000080000ULL
1208 #define LDLM_FL_MATCH_LOCK 0x0000000000100000ULL
1209 #define LDLM_FL_CANCEL_ON_BLOCK 0x0000000000800000ULL
1210 #define LDLM_FL_COS_INCOMPAT 0x0000000001000000ULL
1211 #define LDLM_FL_DENY_ON_CONTENTION 0x0000000040000000ULL
1212 #define LDLM_FL_AST_DISCARD_DATA 0x0000000080000000ULL
1213 /* ---- 32 Bits ---- */
1214 #define LDLM_FL_FAIL_LOC 0x0000000100000000ULL
1215 #define LDLM_FL_SKIPPED 0x0000000200000000ULL
1216 #define LDLM_FL_CBPENDING 0x0000000400000000ULL
1217 #define LDLM_FL_WAIT_NOREPROC 0x0000000800000000ULL
1218 #define LDLM_FL_CANCEL 0x0000001000000000ULL
1219 #define LDLM_FL_LOCAL_ONLY 0x0000002000000000ULL
1220 #define LDLM_FL_FAILED 0x0000004000000000ULL
1221 #define LDLM_FL_CANCELING 0x0000008000000000ULL
1222 #define LDLM_FL_LOCAL 0x0000010000000000ULL
1223 #define LDLM_FL_LVB_READY 0x0000020000000000ULL
1224 #define LDLM_FL_KMS_IGNORE 0x0000040000000000ULL
1225 #define LDLM_FL_CP_REQD 0x0000080000000000ULL
1226 #define LDLM_FL_CLEANED 0x0000100000000000ULL
1227 #define LDLM_FL_ATOMIC_CB 0x0000200000000000ULL
1228 #define LDLM_FL_BL_AST 0x0000400000000000ULL
1229 #define LDLM_FL_BL_DONE 0x0000800000000000ULL
1230 #define LDLM_FL_NO_LRU 0x0001000000000000ULL
1231 #define LDLM_FL_FAIL_NOTIFIED 0x0002000000000000ULL
1232 #define LDLM_FL_DESTROYED 0x0004000000000000ULL
1233 #define LDLM_FL_SERVER_LOCK 0x0008000000000000ULL
1234 #define LDLM_FL_RES_LOCKED 0x0010000000000000ULL
1235 #define LDLM_FL_WAITED 0x0020000000000000ULL
1236 #define LDLM_FL_NS_SRV 0x0040000000000000ULL
1237 #define LDLM_FL_EXCL 0x0080000000000000ULL
1238 #define LDLM_FL_RESENT 0x0100000000000000ULL
1239 #define LDLM_FL_COS_ENABLED 0x0200000000000000ULL
1241 #if 0
1242 static const value_string lustre_ldlm_flags_vals[] = {
1243 {LDLM_FL_LOCK_CHANGED, "LDLM_FL_LOCK_CHANGED"},
1244 {LDLM_FL_BLOCK_GRANTED, "LDLM_FL_BLOCK_GRANTED"},
1245 {LDLM_FL_BLOCK_CONV, "LDLM_FL_BLOCK_CONV"},
1246 {LDLM_FL_BLOCK_WAIT, "LDLM_FL_BLOCK_WAIT"},
1247 {LDLM_FL_AST_SENT, "LDLM_FL_AST_SENT"},
1248 {LDLM_FL_REPLAY, "LDLM_FL_REPLAY"},
1249 {LDLM_FL_INTENT_ONLY, "LDLM_FL_INTENT_ONLY"},
1250 {LDLM_FL_HAS_INTENT, "LDLM_FL_HAS_INTENT"},
1251 {LDLM_FL_FLOCK_DEADLOCK, "LDLM_FL_FLOCK_DEADLOCK"},
1252 {LDLM_FL_DISCARD_DATA, "LDLM_FL_DISCARD_DATA"},
1253 {LDLM_FL_NO_TIMEOUT, "LDLM_FL_NO_TIMEOUT"},
1254 {LDLM_FL_BLOCK_NOWAIT, "LDLM_FL_BLOCK_NOWAIT"},
1255 {LDLM_FL_TEST_LOCK, "LDLM_FL_TEST_LOCK"},
1256 {LDLM_FL_CANCEL_ON_BLOCK, "LDLM_FL_CANCEL_ON_BLOCK"},
1257 {LDLM_FL_COS_INCOMPAT, "LDLM_FL_COS_INCOMPAT"},
1258 {LDLM_FL_DENY_ON_CONTENTION, "LDLM_FL_DENY_ON_CONTENTION"},
1259 {LDLM_FL_AST_DISCARD_DATA, "LDLM_FL_AST_DISCARD_DATA"},
1260 { 0, NULL }
1262 #endif
1264 /********************************************************************
1266 * LLOG Definitions
1270 #define LLOG_OP_MAGIC 0x10600000
1271 //#define LLOG_OP_MASK 0xfff00000
1272 #define llog_op_types_VALUE_STRING_LIST(XXX) \
1273 XXX(LLOG_PAD_MAGIC, LLOG_OP_MAGIC | 0x00000) \
1274 XXX(OST_SZ_REC, LLOG_OP_MAGIC | 0x00f00) \
1275 XXX(OST_RAID1_REC, LLOG_OP_MAGIC | 0x01000) \
1276 XXX(MDS_UNLINK_REC, LLOG_OP_MAGIC | 0x10000 | (MDS_REINT << 8) | REINT_UNLINK) \
1277 XXX(MDS_UNLINK64_REC, LLOG_OP_MAGIC | 0x90000 | (MDS_REINT << 8) | REINT_UNLINK) \
1278 XXX(MDS_SETATTR_REC, LLOG_OP_MAGIC | 0x10000 | (MDS_REINT << 8) | REINT_SETATTR) \
1279 XXX(MDS_SETATTR64_REC, LLOG_OP_MAGIC | 0x90000 | (MDS_REINT << 8) | REINT_SETATTR) \
1280 XXX(OBD_CFG_REC, LLOG_OP_MAGIC | 0x20000) \
1281 XXX(PTL_CFG_REC, LLOG_OP_MAGIC | 0x30000) \
1282 XXX(LLOG_GEN_REC, LLOG_OP_MAGIC | 0x40000) \
1283 XXX(LLOG_JOIN_REC, LLOG_OP_MAGIC | 0x50000) \
1284 XXX(CHANGELOG_REC, LLOG_OP_MAGIC | 0x60000) \
1285 XXX(CHANGELOG_USER_REC, LLOG_OP_MAGIC | 0x70000) \
1286 XXX(HSM_AGENT_REC, LLOG_OP_MAGIC | 0x80000) \
1287 XXX(UPDATE_REC, LLOG_OP_MAGIC | 0xa0000) \
1288 XXX(LLOG_HDR_MAGIC, LLOG_OP_MAGIC | 0x45539) \
1289 XXX(LLOG_LOGID_MAGIC, LLOG_OP_MAGIC | 0x4553b)
1290 VALUE_STRING_ENUM2(llog_op_types);
1291 VALUE_STRING_ARRAY2(llog_op_types);
1293 #define llog_hdr_llh_flags_VALUE_STRING_LIST(XXX) \
1294 XXX(LLOG_F_ZAP_WHEN_EMPTY, 0x01, "LLOhdr_llh_G_F_ZAP_WHEN_EMPTY") \
1295 XXX(LLOG_F_IS_CAT, 0x02, "LLOhdr_llh_G_F_IS_CAT") \
1296 XXX(LLOG_F_IS_PLAIN, 0x04, "LLOG_F_IS_PLAIN") \
1297 XXX(LLOG_F_EXT_JOBID, 0x08, "LLOG_F_EXT_JOBID") \
1298 XXX(LLOG_F_IS_FIXSIZE, 0x10, "LLOG_F_IS_FIXSIZE")
1299 VALUE_STRING_ENUM(llog_hdr_llh_flags);
1300 //VALUE_STRING_ARRAY(llog_hdr_llh_flags);
1302 #define llog_ctxt_id_vals_VALUE_STRING_LIST(XXX) \
1303 XXX(LLOG_CONFIG_ORIG_CTXT, 0) \
1304 XXX(LLOG_CONFIG_REPL_CTXT, 1) \
1305 XXX(LLOG_MDS_OST_ORIG_CTXT, 2) \
1306 XXX(LLOG_MDS_OST_REPL_CTXT, 3) \
1307 XXX(LLOG_SIZE_ORIG_CTXT, 4) \
1308 XXX(LLOG_SIZE_REPL_CTXT, 5) \
1309 XXX(LLOG_TEST_ORIG_CTXT, 8) \
1310 XXX(LLOG_TEST_REPL_CTXT, 9) \
1311 XXX(LLOG_CHANGELOG_ORIG_CTXT, 12) \
1312 XXX(LLOG_CHANGELOG_REPL_CTXT, 13) \
1313 XXX(LLOG_CHANGELOG_USER_ORIG_CTXT, 14) \
1314 XXX(LLOG_AGENT_ORIG_CTXT, 15) \
1315 XXX(LLOG_UPDATELOG_ORIG_CTXT, 16) \
1316 XXX(LLOG_UPDATELOG_REPL_CTXT, 17)
1317 //VALUE_STRING_ENUM2(llog_ctxt_id_vals);
1318 VALUE_STRING_ARRAY2(llog_ctxt_id_vals);
1320 #define changelog_rec_type_vals_VALUE_STRING_LIST(XXX) \
1321 XXX(CL_MARK, 0) \
1322 XXX(CL_CREATE, 1) \
1323 XXX(CL_MKDIR, 2) \
1324 XXX(CL_HARDLINK, 3) \
1325 XXX(CL_SOFTLINK, 4) \
1326 XXX(CL_MKNOD, 5) \
1327 XXX(CL_UNLINK, 6) \
1328 XXX(CL_RMDIR, 7) \
1329 XXX(CL_RENAME, 8) \
1330 XXX(CL_EXT, 9) \
1331 XXX(CL_OPEN, 10) \
1332 XXX(CL_CLOSE, 11) \
1333 XXX(CL_LAYOUT, 12) \
1334 XXX(CL_TRUNC, 13) \
1335 XXX(CL_SETATTR, 14) \
1336 XXX(CL_XATTR, 15) \
1337 XXX(CL_HSM, 16) \
1338 XXX(CL_MTIME, 17) \
1339 XXX(CL_CTIME, 18) \
1340 XXX(CL_ATIME, 19) \
1341 XXX(CL_MIGRATE, 20) \
1342 XXX(CL_FLRW, 21) \
1343 XXX(CL_RESYNC, 22)
1344 VALUE_STRING_ENUM2(changelog_rec_type_vals);
1345 VALUE_STRING_ARRAY2(changelog_rec_type_vals);
1347 #define changelog_rec_flags_vals_VALUE_STRING_LIST(XXX) \
1348 XXX(CLF_VERSION, 0x1000) \
1349 XXX(CLF_RENAME, 0x2000) \
1350 XXX(CLF_JOBID, 0x4000) \
1351 XXX(CLF_EXTRA_FLAGS, 0x8000)
1352 VALUE_STRING_ENUM2(changelog_rec_flags_vals);
1353 //VALUE_STRING_ARRAY2(changelog_rec_flags_vals);
1355 #define lcfg_command_type_vals_VALUE_STRING_LIST(XXX) \
1356 XXX(LCFG_ATTACH, 0x00cf001) \
1357 XXX(LCFG_DETACH, 0x00cf002) \
1358 XXX(LCFG_SETUP, 0x00cf003) \
1359 XXX(LCFG_CLEANUP, 0x00cf004) \
1360 XXX(LCFG_ADD_UUID, 0x00cf005) \
1361 XXX(LCFG_DEL_UUID, 0x00cf006) \
1362 XXX(LCFG_MOUNTOPT, 0x00cf007) \
1363 XXX(LCFG_DEL_MOUNTOPT, 0x00cf008) \
1364 XXX(LCFG_SET_TIMEOUT, 0x00cf009) \
1365 XXX(LCFG_SET_UPCALL, 0x00cf00a) \
1366 XXX(LCFG_ADD_CONN, 0x00cf00b) \
1367 XXX(LCFG_DEL_CONN, 0x00cf00c) \
1368 XXX(LCFG_LOV_ADD_OBD, 0x00cf00d) \
1369 XXX(LCFG_LOV_DEL_OBD, 0x00cf00e) \
1370 XXX(LCFG_PARAM, 0x00cf00f) \
1371 XXX(LCFG_MARKER, 0x00cf010) \
1372 XXX(LCFG_LOG_START, 0x00ce011) \
1373 XXX(LCFG_LOG_END, 0x00ce012) \
1374 XXX(LCFG_LOV_ADD_INA, 0x00ce013) \
1375 XXX(LCFG_ADD_MDC, 0x00cf014) \
1376 XXX(LCFG_DEL_MDC, 0x00cf015) \
1377 XXX(LCFG_SPTLRPC_CONF, 0x00ce016) \
1378 XXX(LCFG_POOL_NEW, 0x00ce020) \
1379 XXX(LCFG_POOL_ADD, 0x00ce021) \
1380 XXX(LCFG_POOL_REM, 0x00ce022) \
1381 XXX(LCFG_POOL_DEL, 0x00ce023) \
1382 XXX(LCFG_SET_LDLM_TIMEOUT, 0x00ce030) \
1383 XXX(LCFG_PRE_CLEANUP, 0x00cf031) \
1384 XXX(LCFG_SET_PARAM, 0x00ce032) \
1385 XXX(LCFG_NODEMAP_ADD, 0x00ce040) \
1386 XXX(LCFG_NODEMAP_DEL, 0x00ce041) \
1387 XXX(LCFG_NODEMAP_ADD_RANGE, 0x00ce042) \
1388 XXX(LCFG_NODEMAP_DEL_RANGE, 0x00ce043) \
1389 XXX(LCFG_NODEMAP_ADD_UIDMAP, 0x00ce044) \
1390 XXX(LCFG_NODEMAP_DEL_UIDMAP, 0x00ce045) \
1391 XXX(LCFG_NODEMAP_ADD_GIDMAP, 0x00ce046) \
1392 XXX(LCFG_NODEMAP_DEL_GIDMAP, 0x00ce047) \
1393 XXX(LCFG_NODEMAP_ACTIVATE, 0x00ce048) \
1394 XXX(LCFG_NODEMAP_ADMIN, 0x00ce049) \
1395 XXX(LCFG_NODEMAP_TRUSTED, 0x00ce050) \
1396 XXX(LCFG_NODEMAP_SQUASH_UID, 0x00ce051) \
1397 XXX(LCFG_NODEMAP_SQUASH_GID, 0x00ce052) \
1398 XXX(LCFG_NODEMAP_ADD_SHKEY, 0x00ce053) \
1399 XXX(LCFG_NODEMAP_DEL_SHKEY, 0x00ce054) \
1400 XXX(LCFG_NODEMAP_TEST_NID, 0x00ce055) \
1401 XXX(LCFG_NODEMAP_TEST_ID, 0x00ce056) \
1402 XXX(LCFG_NODEMAP_SET_FILESET, 0x00ce057) \
1403 XXX(LCFG_NODEMAP_DENY_UNKNOWN, 0x00ce058) \
1404 XXX(LCFG_NODEMAP_MAP_MODE, 0x00ce059)
1405 VALUE_STRING_ENUM2(lcfg_command_type_vals);
1406 VALUE_STRING_ARRAY2(lcfg_command_type_vals);
1408 /********************************************************************
1410 * HSM Definitions
1414 #define hsm_state_vals_VALUE_STRING_LIST(XXX) \
1415 XXX(HS_NONE, 0x00000000) \
1416 XXX(HS_EXISTS, 0x00000001) \
1417 XXX(HS_DIRTY, 0x00000002) \
1418 XXX(HS_RELEASED, 0x00000004) \
1419 XXX(HS_ARCHIVED, 0x00000008) \
1420 XXX(HS_NORELEASE, 0x00000010) \
1421 XXX(HS_NOARCHIVE, 0x00000020) \
1422 XXX(HS_LOST, 0x00000040)
1423 VALUE_STRING_ARRAY2(hsm_state_vals);
1425 #define hsm_user_action_vals_VALUE_STRING_LIST(XXX) \
1426 XXX(HUA_NONE, 1, "NONE") \
1427 XXX(HUA_ARCHIVE, 10, "ARCHIVE") \
1428 XXX(HUA_RESTORE, 11, "RESTORE") \
1429 XXX(HUA_RELEASE, 12, "RELEASE") \
1430 XXX(HUA_REMOVE, 13, "REMOVE") \
1431 XXX(HUA_CANCEL, 14, "CANCEL")
1432 //VALUE_STRING_ENUM(hsm_user_action_vals);
1433 VALUE_STRING_ARRAY(hsm_user_action_vals);
1435 #define hsm_progress_state_vals_VALUE_STRING_LIST(XXX) \
1436 XXX(HPS_WAITING, 1, "Waiting") \
1437 XXX(HPS_RUNNING, 2, "Running") \
1438 XXX(HPS_DONE, 3, "Done")
1439 //VALUE_STRING_ENUM(hsm_progress_state_vals);
1440 VALUE_STRING_ARRAY(hsm_progress_state_vals);
1442 #define hss_valid_VALUE_STRING_LIST(XXX) \
1443 XXX(HSS_SETMASK, 0x01) \
1444 XXX(HSS_CLEARMASK, 0x02) \
1445 XXX(HSS_ARCHIVE_ID, 0x04)
1446 VALUE_STRING_ARRAY2(hss_valid);
1448 /********************************************************************
1450 * Quota Definitions
1454 #define quota_cmd_vals_VALUE_STRING_LIST(XXX) \
1455 XXX(Q_SYNC, 0x800001) \
1456 XXX(Q_QUOTAON, 0x800002) \
1457 XXX(Q_QUOTAOFF, 0x800003) \
1458 XXX(Q_GETFMT, 0x800004) \
1459 XXX(Q_GETINFO, 0x800005) \
1460 XXX(Q_SETINFO, 0x800006) \
1461 XXX(Q_GETQUOTA, 0x800007) \
1462 XXX(Q_SETQUOTA, 0x800008) \
1463 XXX(Q_GETNEXTQUOTA, 0x800009) \
1464 XXX(LUSTRE_Q_INVALIDATE, 0x80000b) \
1465 XXX(LUSTRE_Q_FINVALIDATE, 0x80000c) \
1466 XXX(Q_QUOTACHECK, 0x800100) \
1467 XXX(Q_INITQUOTA, 0x800101) \
1468 XXX(Q_GETOINFO, 0x800102) \
1469 XXX(Q_GETOQUOTA, 0x800103) \
1470 XXX(Q_FINVALIDATE, 0x800104)
1471 VALUE_STRING_ARRAY2(quota_cmd_vals);
1473 #define quota_type_vals_VALUE_STRING_LIST(XXX) \
1474 XXX(USRQUOTA, 0) \
1475 XXX(GRPQUOTA, 1) \
1476 XXX(PRJQUOTA, 2)
1477 VALUE_STRING_ARRAY2(quota_type_vals);
1479 /********************************************************************
1481 * SEQ Definitions
1485 #define seq_op_vals_VALUE_STRING_LIST(XXX) \
1486 XXX(SEQ_ALLOC_SUPER, 0) \
1487 XXX(SEQ_ALLOC_META, 1)
1488 //VALUE_STRING_ENUM2(seq_op_vals);
1489 VALUE_STRING_ARRAY2(seq_op_vals);
1491 #define seq_range_flag_vals_VALUE_STRING_LIST(XXX) \
1492 XXX(LU_SEQ_RANGE_MDT, 0x0, "MDT") \
1493 XXX(LU_SEQ_RANGE_OST, 0x1, "OST") \
1494 XXX(LU_SEQ_RANGE_ANY, 0x3, "ANY")
1495 //VALUE_STRING_ENUM(seq_range_flag_vals);
1496 VALUE_STRING_ARRAY(seq_range_flag_vals);
1498 /********************************************************************
1500 * FLD Definitions
1504 #define fld_op_vals_VALUE_STRING_LIST(XXX) \
1505 XXX(FLD_CREATE, 0, "Create") \
1506 XXX(FLD_DELETE, 1, "Delete") \
1507 XXX(FLD_LOOKUP, 2, "Lookup")
1508 //VALUE_STRING_ENUM(fld_op_vals);
1509 VALUE_STRING_ARRAY(fld_op_vals);
1511 /********************************************************************
1513 * Out Update Definitions
1516 // These can't be in enum because they are bigger than MAXINT
1517 #define OUT_UPDATE_HEADER_MAGIC 0xBDDF0001
1518 static const value_string out_update_header_magic_vals[] = {
1519 {OUT_UPDATE_HEADER_MAGIC, "OUT_UPDATE_HEADER_MAGIC"},
1520 {0, NULL}
1522 #define UPDATE_REQUEST_MAGIC_V1 0xBDDE0001
1523 #define UPDATE_REQUEST_MAGIC_V2 0xBDDE0002
1525 static const value_string update_request_magic_vals[] = {
1526 {UPDATE_REQUEST_MAGIC_V1, "UPDATE_REQUEST_MAGIC_V1"},
1527 {UPDATE_REQUEST_MAGIC_V2, "UPDATE_REQUEST_MAGIC_V2"},
1528 {0, NULL}
1531 #define update_reply_magic_vals_VALUE_STRING_LIST(XXX) \
1532 XXX(UPDATE_REPLY_MAGIC_V1, 0x00BD0001) \
1533 XXX(UPDATE_REPLY_MAGIC_V2, 0x00BD0002)
1534 VALUE_STRING_ENUM2(update_reply_magic_vals);
1535 VALUE_STRING_ARRAY2(update_reply_magic_vals);
1537 #define update_type_vals_VALUE_STRING_LIST(XXX) \
1538 XXX(OUT_START, 0) \
1539 XXX(OUT_CREATE, 1) \
1540 XXX(OUT_DESTROY, 2) \
1541 XXX(OUT_REF_ADD, 3) \
1542 XXX(OUT_REF_DEL, 4) \
1543 XXX(OUT_ATTR_SET, 5) \
1544 XXX(OUT_ATTR_GET, 6) \
1545 XXX(OUT_XATTR_SET, 7) \
1546 XXX(OUT_XATTR_GET, 8) \
1547 XXX(OUT_INDEX_LOOKUP, 9) \
1548 XXX(OUT_INDEX_INSERT, 10) \
1549 XXX(OUT_INDEX_DELETE, 11) \
1550 XXX(OUT_WRITE, 12) \
1551 XXX(OUT_XATTR_DEL, 13) \
1552 XXX(OUT_PUNCH, 14) \
1553 XXX(OUT_READ, 15) \
1554 XXX(OUT_NOOP, 16)
1555 VALUE_STRING_ENUM2(update_type_vals);
1556 VALUE_STRING_ARRAY2(update_type_vals);
1558 /********************************************************************
1559 * LFSCK Definitions
1562 #define lfsck_events_vals_VALUE_STRING_LIST(XXX) \
1563 XXX(LE_LASTID_REBUILDING, 1) \
1564 XXX(LE_LASTID_REBUILT, 2) \
1565 XXX(LE_PHASE1_DONE, 3) \
1566 XXX(LE_PHASE2_DONE, 4) \
1567 XXX(LE_START, 5) \
1568 XXX(LE_STOP, 6) \
1569 XXX(LE_QUERY, 7) \
1570 XXX(LE_FID_ACCESSED, 8) \
1571 XXX(LE_PEER_EXIT, 9) \
1572 XXX(LE_CONDITIONAL_DESTROY, 10) \
1573 XXX(LE_PAIRS_VERIFY, 11) \
1574 XXX(LE_SET_LMV_MASTER, 15) \
1575 XXX(LE_SET_LMV_SLAVE, 16)
1576 //VALUE_STRING_ENUM2(lfsck_events_vals);
1577 VALUE_STRING_ARRAY2(lfsck_events_vals);
1579 #define lfsck_start_valid_vals_VALUE_STRING_LIST(XXX) \
1580 XXX(LSV_SPEED_LIMIT, 0x00000001) \
1581 XXX(LSV_ERROR_HANDLE, 0x00000002) \
1582 XXX(LSV_DRYRUN, 0x00000004) \
1583 XXX(LSV_ASYNC_WINDOWS, 0x00000008) \
1584 XXX(LSV_CREATE_OSTOBJ, 0x00000010) \
1585 XXX(LSV_CREATE_MDTOBJ, 0x00000020) \
1586 XXX(LSV_DELAY_CREATE_OSTOBJ, 0x00000040)
1587 VALUE_STRING_ENUM2(lfsck_start_valid_vals);
1588 //VALUE_STRING_ARRAY2(lfsck_start_valid_vals);
1590 #define lfsck_status_vals_VALUE_STRING_LIST(XXX) \
1591 XXX(LS_INIT, 0) \
1592 XXX(LS_SCANNING_PHASE1, 1) \
1593 XXX(LS_SCANNING_PHASE2, 2) \
1594 XXX(LS_COMPLETED, 3) \
1595 XXX(LS_FAILED, 4) \
1596 XXX(LS_STOPPED, 5) \
1597 XXX(LS_PAUSED, 6) \
1598 XXX(LS_CRASHED, 7) \
1599 XXX(LS_PARTIAL, 8) \
1600 XXX(LS_CO_FAILED, 9) \
1601 XXX(LS_CO_STOPPED, 10) \
1602 XXX(LS_CO_PAUSED, 11)
1603 //VALUE_STRING_ENUM2(lfsck_status_vals);
1604 VALUE_STRING_ARRAY2(lfsck_status_vals);
1606 #define lfsck_type_vals_VALUE_STRING_LIST(XXX) \
1607 XXX(LFSCK_TYPE_SCRUB, 0x0000) \
1608 XXX(LFSCK_TYPE_LAYOUT, 0x0001) \
1609 XXX(LFSCK_TYPE_NAMESPACE, 0x0004) \
1610 XXX(LFSCK_TYPES_SUPPORTED, 0x0005) \
1611 XXX(LFSCK_TYPES_ALL, 0xFFFF)
1612 /* LFSCK_TYPES_SUPPORTED = (LFSCK_TYPE_SCRUB | LFSCK_TYPE_LAYOUT | LFSCK_TYPE_NAMESPACE) */
1613 //VALUE_STRING_ENUM2(lfsck_type_vals);
1614 VALUE_STRING_ARRAY2(lfsck_type_vals);
1616 /******************************************************************** \
1618 * Helper Functions
1620 \********************************************************************/
1621 #define buffer_padding_length(_o) ((8 - ((_o) % 8)) % 8)
1623 static int
1624 add_extra_padding(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree * tree)
1626 uint32_t padding_len;
1628 padding_len = buffer_padding_length(offset);
1629 if (padding_len) {
1630 proto_tree_add_item(tree, hf_lustre_extra_padding, tvb, offset, padding_len, ENC_NA);
1631 offset+=padding_len;
1633 return offset;
1637 /********************************************************************\
1639 * Conversation
1641 \********************************************************************/
1643 typedef struct _lustre_conv_info_t {
1644 wmem_map_t *pdus;
1645 } lustre_conv_info_t;
1647 typedef struct lustre_trans {
1648 uint32_t opcode;
1649 uint64_t sub_opcode; /* i.e. intent, reint */
1650 uint64_t match_bits;
1651 } lustre_trans_t;
1653 static lustre_trans_t *
1654 lustre_get_trans(packet_info *pinfo, struct lnet_trans_info *info)
1656 conversation_t *conversation;
1657 lustre_conv_info_t *conv_info;
1658 lustre_trans_t *trans;
1660 // Ignore ports because this is kernel level and there can only be one Lustre instance per server
1661 conversation = find_conversation(pinfo->num, &pinfo->src, &pinfo->dst, conversation_pt_to_conversation_type(pinfo->ptype),
1662 0, 0, 0);
1663 if (conversation == NULL)
1664 conversation = conversation_new(pinfo->num, &pinfo->src,
1665 &pinfo->dst, conversation_pt_to_conversation_type(pinfo->ptype), 0, 0, 0);
1667 conv_info = (lustre_conv_info_t *)conversation_get_proto_data(conversation, proto_lustre);
1668 if (!conv_info) {
1669 conv_info = wmem_new0(wmem_file_scope(), lustre_conv_info_t);
1670 conv_info->pdus = wmem_map_new(wmem_file_scope(), g_direct_hash, g_direct_equal);
1672 conversation_add_proto_data(conversation, proto_lustre, conv_info);
1675 trans = (lustre_trans_t *)wmem_map_lookup(conv_info->pdus, GUINT_TO_POINTER(info->match_bits));
1676 if (trans == NULL) {
1677 void *ptr;
1678 trans = wmem_new0(wmem_file_scope(),lustre_trans_t);
1679 trans->match_bits = info->match_bits;
1681 ptr = wmem_map_insert(conv_info->pdus, GUINT_TO_POINTER(trans->match_bits), trans);
1682 if (ptr != NULL) {
1683 /* XXX - Is this even possible? ?*/
1684 trans = (lustre_trans_t *)ptr;
1685 REPORT_DISSECTOR_BUG("ERROR: packet-lustre: conversation replaced: "
1686 "trans:{opcode:%u sub_opcode:%" PRIu64 " match_bits:%" PRIx64 "} "
1687 "with match_bits:%" PRIx64,
1688 trans->opcode, trans->sub_opcode, trans->match_bits, info->match_bits);
1692 return trans;
1695 /********************************************************************\
1697 * Generic Buffer Dumps
1699 \********************************************************************/
1701 static int
1702 display_buffer_data(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *parent_tree, uint32_t buf_num, const char *msg)
1704 proto_item *item;
1705 uint32_t data_len;
1707 data_len = LUSTRE_BUFFER_LEN(buf_num);
1708 if (data_len == 0)
1709 return offset;
1711 item = proto_tree_add_item(parent_tree, hf_lustre_data, tvb, offset, data_len, ENC_NA);
1712 offset += data_len;
1714 if (msg != NULL)
1715 proto_item_append_text(item, ": %s", msg);
1717 offset = add_extra_padding(tvb, offset, pinfo, parent_tree);
1719 return offset;
1722 static int
1723 display_buffer_string(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int offset, int hf_index, uint32_t buf_num)
1725 uint32_t string_len;
1727 string_len = LUSTRE_BUFFER_LEN(buf_num);
1728 if (string_len == 0)
1729 return offset;
1731 proto_tree_add_item(parent_tree, hf_index, tvb, offset, string_len, ENC_NA);
1733 offset += string_len;
1734 offset = add_extra_padding(tvb, offset, pinfo, parent_tree);
1736 return offset;
1739 /********************************************************************\
1741 * Sub Structures
1743 \********************************************************************/
1745 static void
1746 lustre_fmt_ver( char *result, uint32_t version )
1748 uint32_t major, minor, patch, fix;
1750 fix = version & 0xff;
1751 version >>= 8;
1752 patch = version & 0xff;
1753 version >>= 8;
1754 minor = version & 0xff;
1755 version >>= 8;
1756 major = version & 0xff;
1757 snprintf( result, ITEM_LABEL_LENGTH, "%d.%d.%d.%d", major, minor, patch, fix);
1760 static int
1761 dissect_struct_lustre_handle(tvbuff_t *tvb, int offset, proto_tree *parent_tree, int hf_index)
1763 proto_tree *tree;
1764 proto_item *item;
1766 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, 8, ENC_NA);
1767 tree = proto_item_add_subtree(item, ett_lustre_lustre_handle_cookie);
1769 proto_tree_add_item(tree, hf_lustre_lustre_handle_cookie, tvb, offset, 8, ENC_LITTLE_ENDIAN);
1770 offset += 8;
1772 return offset;
1775 static int
1776 dissect_struct_lu_fid(tvbuff_t *tvb, int offset, proto_tree *parent_tree, int hf_index)
1778 proto_tree *tree;
1779 proto_item *item;
1780 uint64_t seq;
1781 uint32_t val;
1783 /* struct lu_fid { */
1784 /* __u64 f_seq; */
1785 /* __u32 f_oid; */
1786 /* __u32 f_ver; */
1787 /* }; */
1790 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, 16, ENC_NA);
1791 tree = proto_item_add_subtree(item, ett_lustre_lu_fid);
1793 proto_tree_add_item_ret_uint64(tree, hf_lustre_lu_fid_f_seq, tvb, offset, 8, ENC_LITTLE_ENDIAN, &seq);
1794 proto_item_append_text(item, ": [%#" PRIx64 ":", seq);
1795 offset += 8;
1797 proto_tree_add_item_ret_uint(tree, hf_lustre_lu_fid_f_oid, tvb, offset, 4, ENC_LITTLE_ENDIAN, &val);
1798 proto_item_append_text(item, "%#x:", val);
1799 offset += 4;
1801 proto_tree_add_item_ret_uint(tree, hf_lustre_lu_fid_f_ver, tvb, offset, 4, ENC_LITTLE_ENDIAN, &val);
1802 proto_item_append_text(item, "%#x]", val);
1803 offset += 4;
1805 return offset;
1808 static int
1809 dissect_struct_obd_uuid(tvbuff_t *tvb, int offset, proto_tree *parent_tree, int hf_index)
1811 proto_tree *tree;
1812 proto_item *item;
1814 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, 40, ENC_NA);
1815 tree = proto_item_add_subtree(item, ett_lustre_obd_uuid);
1816 /* #define UUID_MAX 40 */
1817 /* struct obd_uuid { */
1818 /* char uuid[UUID_MAX]; */
1819 /* }; */
1820 proto_tree_add_item(tree, hf_lustre_obd_uuid, tvb, offset, 40, ENC_ASCII);
1821 offset += 40;
1823 return offset;
1826 static int
1827 dissect_struct_ost_id(tvbuff_t *tvb, int offset, proto_tree *parent_tree)
1829 proto_tree *tree, *oi_tree;
1830 proto_item *item;
1832 /* struct ost_id { */
1833 /* union { */
1834 /* struct { */
1835 /* __u64 oi_id; */
1836 /* __u64 oi_seq; */
1837 /* } oi; */
1838 /* struct lu_fid oi_fid; */
1839 /* }; */
1840 /* }; */
1842 item = proto_tree_add_item(parent_tree, hf_lustre_ost_id, tvb, offset, 16, ENC_NA);
1843 tree = proto_item_add_subtree(item, ett_lustre_ost_id);
1845 /* FID */
1846 dissect_struct_lu_fid(tvb, offset, tree, hf_lustre_ost_id_fid);
1848 /* !OR! OI */
1849 item = proto_tree_add_item(tree, hf_lustre_ost_id_oi, tvb, offset, 16, ENC_NA);
1850 oi_tree = proto_item_add_subtree(item, ett_lustre_ost_id_oi);
1851 proto_tree_add_item(oi_tree, hf_lustre_ost_oi_id, tvb, offset, 8, ENC_LITTLE_ENDIAN);
1852 offset += 8;
1853 proto_tree_add_item(oi_tree, hf_lustre_ost_oi_seq, tvb, offset, 8, ENC_LITTLE_ENDIAN);
1854 offset += 8;
1856 return offset;
1859 static int
1860 dissect_struct_ost_layout(tvbuff_t *tvb, int offset, proto_tree *parent_tree)
1862 proto_tree *tree;
1863 proto_item *item;
1865 item = proto_tree_add_item(parent_tree, hf_lustre_ost_layout, tvb, offset, 28, ENC_NA);
1866 tree = proto_item_add_subtree(item, ett_lustre_ost_layout);
1868 /* struct ost_layout { */
1869 /* __u32 ol_stripe_size; */
1870 /* __u32 ol_stripe_count; */
1871 /* __u64 ol_comp_start; */
1872 /* __u64 ol_comp_end; */
1873 /* __u32 ol_comp_id; */
1874 /* } __attribute__((packed)); */
1876 proto_tree_add_item(tree, hf_lustre_ost_layout_stripe_size, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1877 offset += 4;
1878 proto_tree_add_item(tree, hf_lustre_ost_layout_stripe_count, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1879 offset += 4;
1880 proto_tree_add_item(tree, hf_lustre_ost_layout_comp_start, tvb, offset, 8, ENC_LITTLE_ENDIAN);
1881 offset += 8;
1882 proto_tree_add_item(tree, hf_lustre_ost_layout_comp_end, tvb, offset, 8, ENC_LITTLE_ENDIAN);
1883 offset += 8;
1884 proto_tree_add_item(tree, hf_lustre_ost_layout_comp_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1885 offset += 4;
1887 return offset;
1890 static int
1891 dissect_struct_obdo(tvbuff_t *tvb, int offset, proto_tree *parent_tree)
1893 proto_tree *tree;
1894 proto_item *item;
1895 int old_offset;
1897 old_offset = offset;
1899 item = proto_tree_add_item(parent_tree, hf_lustre_obdo, tvb, offset, -1, ENC_NA);
1900 tree = proto_item_add_subtree(item, ett_lustre_obdo);
1902 /* struct obdo { */
1903 /* __u64 o_valid; /\* hot fields in this obdo *\/ */
1904 /* struct ost_id o_oi; */
1905 /* __u64 o_parent_seq; */
1906 /* __u64 o_size; /\* o_size-o_blocks == ost_lvb *\/ */
1907 /* __s64 o_mtime; */
1908 /* __s64 o_atime; */
1909 /* __s64 o_ctime; */
1910 /* __u64 o_blocks; /\* brw: cli sent cached bytes *\/ */
1911 /* __u64 o_grant; */
1912 /* __u32 o_blksize; /\* optimal IO blocksize *\/ */
1913 /* __u32 o_mode; /\* brw: cli sent cache remain *\/ */
1914 /* __u32 o_uid; */
1915 /* __u32 o_gid; */
1916 /* __u32 o_flags; */
1917 /* __u32 o_nlink; /\* brw: checksum *\/ */
1918 /* __u32 o_parent_oid; */
1919 /* __u32 o_misc; /\* brw: o_dropped *\/ */
1921 /* __u64 o_ioepoch; /\* epoch in ost writes *\/ */
1922 /* __u32 o_stripe_idx; /\* holds stripe idx *\/ */
1923 /* __u32 o_parent_ver; */
1924 /* struct lustre_handle o_handle; /\* brw: lock handle to prolong * locks *\/ */
1925 /* /\* Originally, the field is llog_cookie for destroy with unlink cookie */
1926 /* * from MDS, it is obsolete in 2.8. Then reuse it by client to transfer */
1927 /* * layout and PFL information in IO, setattr RPCs. Since llog_cookie is */
1928 /* * not used on wire any longer, remove it from the obdo, then it can be */
1929 /* * enlarged freely in the further without affect related RPCs. */
1930 /* * */
1931 /* * sizeof(ost_layout) + sieof(__u32) == sizeof(llog_cookie). *\/ */
1932 /* #if VERSION < 2.8.0 */
1933 /* struct llog_cookie o_lcookie; */
1934 /* #else // VERSION >= 2.10 */
1935 /* struct ost_layout o_layout; */
1936 /* __u32 o_padding_3; */
1937 /* #endif */
1938 /* __u32 o_uid_h; */
1939 /* __u32 o_gid_h; */
1941 /* __u64 o_data_version; */
1942 /* __u32 o_projid; */
1943 /* __u32 o_padding_4; /\* also fix */
1944 /* * lustre_swab_obdo() *\/ */
1945 /* __u64 o_padding_5; */
1946 /* __u64 o_padding_6; */
1947 /* }; */
1949 // @@ make into bitmap of OBD_MD_FL*
1950 proto_tree_add_item(tree, hf_lustre_obdo_o_valid, tvb, offset, 8, ENC_LITTLE_ENDIAN);
1951 offset += 8;
1952 offset = dissect_struct_ost_id(tvb, offset, tree);
1953 proto_tree_add_item(tree, hf_lustre_obdo_o_parent_seq, tvb, offset, 8, ENC_LITTLE_ENDIAN);
1954 offset += 8;
1955 proto_tree_add_item(tree, hf_lustre_obdo_o_size, tvb, offset, 8, ENC_LITTLE_ENDIAN);
1956 offset += 8;
1957 proto_tree_add_item(tree, hf_lustre_obdo_o_mtime, tvb, offset, 8, ENC_LITTLE_ENDIAN);
1958 offset += 8;
1959 proto_tree_add_item(tree, hf_lustre_obdo_o_atime, tvb, offset, 8, ENC_LITTLE_ENDIAN);
1960 offset += 8;
1961 proto_tree_add_item(tree, hf_lustre_obdo_o_ctime, tvb, offset, 8, ENC_LITTLE_ENDIAN);
1962 offset += 8;
1963 proto_tree_add_item(tree, hf_lustre_obdo_o_blocks, tvb, offset, 8, ENC_LITTLE_ENDIAN);
1964 offset += 8;
1965 proto_tree_add_item(tree, hf_lustre_obdo_o_grant, tvb, offset, 8, ENC_LITTLE_ENDIAN);
1966 offset += 8;
1967 proto_tree_add_item(tree, hf_lustre_obdo_o_blksize, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1968 offset += 4;
1969 proto_tree_add_item(tree, hf_lustre_obdo_o_mode, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1970 offset += 4;
1971 proto_tree_add_item(tree, hf_lustre_obdo_o_uid, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1972 offset += 4;
1973 proto_tree_add_item(tree, hf_lustre_obdo_o_gid, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1974 offset += 4;
1975 proto_tree_add_item(tree, hf_lustre_obdo_o_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1976 offset += 4;
1977 proto_tree_add_item(tree, hf_lustre_obdo_o_nlink, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1978 offset += 4;
1979 proto_tree_add_item(tree, hf_lustre_obdo_o_parent_oid, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1980 offset += 4;
1981 proto_tree_add_item(tree, hf_lustre_obdo_o_misc, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1982 offset += 4;
1983 proto_tree_add_item(tree, hf_lustre_obdo_o_ioepoch, tvb, offset, 8, ENC_LITTLE_ENDIAN);
1984 offset += 8;
1985 proto_tree_add_item(tree, hf_lustre_obdo_o_stripe_idx, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1986 offset += 4;
1987 proto_tree_add_item(tree, hf_lustre_obdo_o_parent_ver, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1988 offset += 4;
1989 offset = dissect_struct_lustre_handle(tvb, offset, tree, hf_lustre_obdo_o_handle);
1990 /* pre-2.8 llog_cookie o_lcookie - o_valid & OBD_MD_FLCOOKIE */
1992 /* 2.10 and later */
1993 offset = dissect_struct_ost_layout(tvb, offset, tree);
1994 proto_tree_add_item(tree, hf_lustre_obdo_o_padding_3, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1995 offset += 4;
1997 proto_tree_add_item(tree, hf_lustre_obdo_o_uid_h, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1998 offset += 4;
1999 proto_tree_add_item(tree, hf_lustre_obdo_o_gid_h, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2000 offset += 4;
2001 proto_tree_add_item(tree, hf_lustre_obdo_o_data_version, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2002 offset += 8;
2003 proto_tree_add_item(tree, hf_lustre_obdo_o_projid, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2004 offset += 4;
2005 proto_tree_add_item(tree, hf_lustre_obdo_o_padding_4, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2006 offset += 4;
2007 proto_tree_add_item(tree, hf_lustre_obdo_o_padding_5, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2008 offset += 8;
2009 proto_tree_add_item(tree, hf_lustre_obdo_o_padding_6, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2010 offset += 8;
2012 proto_item_set_len(tree, offset-old_offset);
2013 return offset;
2016 static int
2017 dissect_struct_llog_logid(tvbuff_t *tvb, int offset, proto_tree *parent_tree, int hf_index)
2019 proto_tree *tree;
2020 proto_item *item;
2022 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, 20, ENC_NA);
2023 tree = proto_item_add_subtree(item, ett_lustre_llog_logid);
2025 offset = dissect_struct_ost_id(tvb, offset, tree);
2026 proto_tree_add_item(tree, hf_lustre_llog_logid_lgl_ogen, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2027 offset += 4;
2029 return offset;
2032 static int
2033 dissect_struct_llog_gen(tvbuff_t *tvb, int offset, proto_tree *parent_tree, int hf_index)
2035 proto_tree *tree;
2036 proto_item *item;
2038 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, 16, ENC_NA);
2039 tree = proto_item_add_subtree(item, ett_lustre_llog_gen);
2041 proto_tree_add_item(tree, hf_lustre_llog_gen_conn_cnt, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2042 offset += 8;
2043 proto_tree_add_item(tree, hf_lustre_llog_gen_mnt_cnt, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2044 offset += 8;
2046 return offset;
2049 static int
2050 dissect_struct_llog_rec_hdr(tvbuff_t *tvb, int offset, proto_tree *parent_tree, int hf_index)
2052 proto_tree *tree;
2053 proto_item *item;
2054 uint32_t ind, type;
2056 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, 16, ENC_NA);
2057 tree = proto_item_add_subtree(item, ett_lustre_llog_rec_hdr);
2059 /* struct llog_rec_hdr { */
2060 /* __u32 lrh_len; */
2061 /* __u32 lrh_index; */
2062 /* __u32 lrh_type; */
2063 /* __u32 lrh_id; */
2064 /* }; */
2066 proto_tree_add_item(tree, hf_lustre_llog_rec_hdr_lrh_len, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2067 offset += 4;
2068 proto_tree_add_item_ret_uint(tree, hf_lustre_llog_rec_hdr_lrh_index, tvb, offset, 4, ENC_LITTLE_ENDIAN, &ind);
2069 offset += 4;
2070 proto_tree_add_item_ret_uint(tree, hf_lustre_llog_rec_hdr_lrh_type, tvb, offset, 4, ENC_LITTLE_ENDIAN, &type);
2071 offset += 4;
2072 proto_tree_add_item(tree, hf_lustre_llog_rec_hdr_lrh_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2073 offset += 4;
2075 proto_item_append_text(parent_tree, " [%02d]: %s", ind, val_to_str(type, llog_op_types, "Unknown(%x)"));
2077 return offset;
2080 static int
2081 dissect_struct_llog_rec_tail(tvbuff_t *tvb, int offset, proto_tree *parent_tree, int hf_index)
2083 proto_tree *tree;
2084 proto_item *item;
2086 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, 8, ENC_NA);
2087 tree = proto_item_add_subtree(item, ett_lustre_llog_rec_tail);
2089 proto_tree_add_item(tree, hf_lustre_llog_rec_tail_lrt_len, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2090 offset += 4;
2091 proto_tree_add_item(tree, hf_lustre_llog_rec_tail_lrt_index, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2092 offset += 4;
2094 return offset;
2097 static int
2098 dissect_struct_lquota_id(tvbuff_t *tvb, int offset, proto_tree *parent_tree)
2100 proto_tree *tree;
2101 proto_item *item;
2103 item = proto_tree_add_item(parent_tree, hf_lustre_lquota_id, tvb, offset, 16, ENC_NA);
2104 tree = proto_item_add_subtree(item, ett_lustre_lquota_id);
2106 /* union lquota_id { */
2107 /* struct lu_fid qid_fid; /\* FID for per-directory quota *\/ */
2108 /* __u64 qid_uid; /\* user identifier *\/ */
2109 /* __u64 qid_gid; /\* group identifier *\/ */
2110 /* }; */
2112 dissect_struct_lu_fid(tvb, offset, tree, hf_lustre_qid_fid);
2113 proto_tree_add_item(tree, hf_lustre_qid_uid, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2114 proto_tree_add_item(tree, hf_lustre_qid_gid, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2115 offset+=16;
2117 return offset;
2119 static int
2120 dissect_struct_object_update(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree)
2122 proto_tree *tree, *ptree;
2123 proto_item *item;
2124 unsigned count, i, len;
2125 int old_offset;
2127 old_offset = offset;
2129 item = proto_tree_add_item(parent_tree, hf_lustre_obj_update, tvb, offset, -1, ENC_NA);
2130 tree = proto_item_add_subtree(item, ett_lustre_object_update);
2132 /* struct object_update { */
2133 /* __u16 ou_type; /\* enum update_type *\/ */
2134 /* __u16 ou_params_count; /\* update parameters count *\/ */
2135 /* __u32 ou_result_size; /\* how many bytes can return *\/ */
2136 /* __u32 ou_flags; /\* enum update_flag *\/ */
2137 /* __u32 ou_padding1; /\* padding 1 *\/ */
2138 /* __u64 ou_batchid; /\* op transno on master *\/ */
2139 /* struct lu_fid ou_fid; /\* object to be updated *\/ */
2140 /* struct object_update_param ou_params[0]; /\* update params *\/ */
2141 /* }; */
2142 /* struct object_update_param { */
2143 /* __u16 oup_len; /\* length of this parameter *\/ */
2144 /* __u16 oup_padding; */
2145 /* __u32 oup_padding2; */
2146 /* char oup_buf[0]; */
2147 /* }; */
2148 proto_tree_add_item(tree, hf_lustre_obj_update_type, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2149 offset += 2;
2150 proto_tree_add_item_ret_uint(tree, hf_lustre_obj_update_params_count, tvb, offset, 2, ENC_LITTLE_ENDIAN, &count);
2151 offset += 2;
2152 proto_tree_add_item(tree, hf_lustre_obj_update_result_size, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2153 offset += 4;
2154 proto_tree_add_item(tree, hf_lustre_obj_update_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2155 offset += 4;
2156 proto_tree_add_item(tree, hf_lustre_obj_update_padding, tvb, offset, 4, ENC_NA);
2157 offset += 4;
2158 proto_tree_add_item(tree, hf_lustre_obj_update_batchid, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2159 offset += 8;
2160 offset = dissect_struct_lu_fid(tvb, offset, tree, hf_lustre_obj_update_fid);
2161 for (i = 0; i < count; ++i) {
2162 item = proto_tree_add_item(tree, hf_lustre_obj_update_param, tvb, offset, -1, ENC_NA);
2163 proto_item_append_text(item, ": [%d]", i);
2164 ptree = proto_item_add_subtree(item, ett_lustre_object_update_param);
2166 proto_tree_add_item_ret_uint(ptree, hf_lustre_obj_update_param_len, tvb, offset, 2, ENC_LITTLE_ENDIAN, &len);
2167 offset += 2;
2168 proto_tree_add_item(ptree, hf_lustre_obj_update_param_padding, tvb, offset, 6, ENC_NA);
2169 offset += 6;
2170 proto_tree_add_item(ptree, hf_lustre_obj_update_param_buf, tvb, offset, len, ENC_NA);
2171 offset += len;
2172 proto_item_set_len(ptree, 8+len);
2173 offset = add_extra_padding(tvb, offset, pinfo, tree);
2176 proto_item_set_len(tree, offset-old_offset);
2177 return offset;
2180 static int
2181 dissect_struct_object_update_request(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree)
2183 proto_tree *tree;
2184 proto_item *item;
2185 unsigned count, i, magic;
2186 int old_offset;
2188 old_offset = offset;
2190 item = proto_tree_add_item(parent_tree, hf_lustre_obj_update_request, tvb, offset, -1, ENC_NA);
2191 tree = proto_item_add_subtree(item, ett_lustre_object_update_request);
2193 /* struct object_update_request { */
2194 /* __u32 ourq_magic; */
2195 /* __u16 ourq_count; /\* number of ourq_updates[] *\/ */
2196 /* __u16 ourq_padding; */
2197 /* struct object_update ourq_updates[0]; */
2198 /* }; */
2200 proto_tree_add_item_ret_uint(tree, hf_lustre_obj_update_request_magic, tvb, offset, 4, ENC_LITTLE_ENDIAN, &magic);
2201 if (magic != UPDATE_REQUEST_MAGIC_V2)
2202 expert_add_info(pinfo, tree, &ei_lustre_badmagic);
2203 offset += 4;
2204 proto_tree_add_item_ret_uint(tree, hf_lustre_obj_update_request_count, tvb, offset, 2, ENC_LITTLE_ENDIAN, &count);
2205 offset += 2;
2206 proto_tree_add_item(tree, hf_lustre_obj_update_request_padding, tvb, offset, 2, ENC_NA);
2207 offset += 2;
2209 for (i = 0; i < count; ++i)
2210 offset = dissect_struct_object_update(tvb, offset, pinfo, tree);
2212 proto_item_set_len(tree, offset-old_offset);
2214 return offset;
2217 static int
2218 dissect_struct_lov_desc(tvbuff_t *tvb, int offset, proto_tree *parent_tree)
2220 proto_tree *tree;
2221 proto_item *item;
2223 /* struct lov_desc { */
2224 /* __u32 ld_tgt_count; /\* how many OBD's *\/ */
2225 /* __u32 ld_active_tgt_count; /\* how many active *\/ -- MAGIC on wire */
2226 /* __s32 ld_default_stripe_count; /\* how many objects are used *\/ */
2227 /* __u32 ld_pattern; /\* default PATTERN_RAID0 *\/ */
2228 /* __u64 ld_default_stripe_size; /\* in bytes *\/ */
2229 /* __s64 ld_default_stripe_offset; /\* starting OST index *\/ */
2230 /* __u32 ld_padding_0; /\* unused *\/ */
2231 /* __u32 ld_qos_maxage; /\* in second *\/ */
2232 /* __u32 ld_padding_1; /\* also fix lustre_swab_lov_desc *\/ */
2233 /* __u32 ld_padding_2; /\* also fix lustre_swab_lov_desc *\/ */
2234 /* struct obd_uuid ld_uuid; */
2235 /* }; */
2237 item = proto_tree_add_item(parent_tree, hf_lustre_lov_desc, tvb, offset, 88, ENC_NA);
2238 tree = proto_item_add_subtree(item, ett_lustre_lov_desc);
2240 proto_tree_add_item(tree, hf_lustre_lov_desc_tgt_count, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2241 offset += 4;
2242 proto_tree_add_item(tree, hf_lustre_lov_desc_magic, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2243 offset += 4;
2244 proto_tree_add_item(tree, hf_lustre_lov_desc_default_stripe_count, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2245 offset += 4;
2246 proto_tree_add_item(tree, hf_lustre_lov_desc_pattern, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2247 offset += 4;
2248 proto_tree_add_item(tree, hf_lustre_lov_desc_default_stripe_size, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2249 offset += 8;
2250 proto_tree_add_item(tree, hf_lustre_lov_desc_default_stripe_offset, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2251 offset += 8;
2252 proto_tree_add_item(tree, hf_lustre_lov_desc_padding, tvb, offset, 4, ENC_NA);
2253 offset += 4;
2254 proto_tree_add_item(tree, hf_lustre_lov_desc_qos_maxage, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2255 offset += 4;
2256 proto_tree_add_item(tree, hf_lustre_lov_desc_padding, tvb, offset, 8, ENC_NA);
2257 offset += 8;
2258 offset = dissect_struct_obd_uuid(tvb, offset, tree, hf_lustre_lov_desc_uuid);
2260 return offset;
2262 /********************************************************************
2264 * LLOG Sub Structures
2268 static int
2269 dissect_struct_changelog_rec(tvbuff_t *tvb, int offset, proto_tree *parent_tree)
2271 proto_tree *tree;
2272 proto_item *item;
2273 unsigned namelen, flags, type;
2274 int old_offset = offset;
2276 /* struct changelog_rec { */
2277 /* __u16 cr_namelen; */
2278 /* __u16 cr_flags; /\**< \a changelog_rec_flags *\/ */
2279 /* __u32 cr_type; /\**< \a changelog_rec_type *\/ */
2280 /* __u64 cr_index; /\**< changelog record number *\/ */
2281 /* __u64 cr_prev; /\**< last index for this target fid *\/ */
2282 /* __u64 cr_time; */
2283 /* union { */
2284 /* struct lu_fid cr_tfid; /\**< target fid *\/ */
2285 /* __u32 cr_markerflags; /\**< CL_MARK flags *\/ */
2286 /* }; */
2287 /* struct lu_fid cr_pfid; /\**< parent fid *\/ */
2288 /* }; 32+16+16+extras */
2289 /* after changelog_rec, there are optional fields based on cr_flags
2290 * CLF_RENAME :: struct changelog_ext_rename { struct lu_fid cr_sfid, cr_spfid; }
2291 * CLF_JOBID :: struct changelog_ext_jobid { char cr_jobid[LUSTRE_JOBID_SIZE==32]; }
2292 * CLF_EXTRA_FLAGS :: struct changelog_ext_extra_flags { __u64 cr_extra_flags; }
2293 * cr_namelen>0 :: char name[cr_namelen+'\0']
2295 item = proto_tree_add_item(parent_tree, hf_lustre_changelog_rec, tvb, offset, -1, ENC_NA);
2296 tree = proto_item_add_subtree(item, ett_lustre_changelog_rec);
2298 proto_tree_add_item_ret_uint(tree, hf_lustre_changelog_rec_namelen, tvb, offset, 2, ENC_LITTLE_ENDIAN, &namelen);
2299 offset += 2;
2300 proto_tree_add_item_ret_uint(tree, hf_lustre_changelog_rec_flags, tvb, offset, 2, ENC_LITTLE_ENDIAN, &flags);
2301 offset += 2;
2302 proto_tree_add_item_ret_uint(tree, hf_lustre_changelog_rec_type, tvb, offset, 4, ENC_LITTLE_ENDIAN, &type);
2303 offset += 4;
2304 proto_tree_add_item(tree, hf_lustre_changelog_rec_index, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2305 offset += 8;
2306 proto_tree_add_item(tree, hf_lustre_changelog_rec_prev, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2307 offset += 8;
2308 proto_tree_add_item(tree, hf_lustre_changelog_rec_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2309 offset += 8;
2310 if (type == CL_MARK) {
2311 proto_tree_add_item(tree, hf_lustre_changelog_rec_markerflags, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2312 offset += 4;
2313 proto_tree_add_item(tree, hf_lustre_changelog_rec_padding, tvb, offset, 12, ENC_NA);
2314 offset += 12;
2315 } else
2316 offset = dissect_struct_lu_fid(tvb, offset, tree, hf_lustre_changelog_rec_tfid);
2317 offset = dissect_struct_lu_fid(tvb, offset, tree, hf_lustre_changelog_rec_pfid);
2318 /* end of struct changelog_rec */
2319 if (flags & CLF_RENAME) {
2320 offset = dissect_struct_lu_fid(tvb, offset, tree, hf_lustre_changelog_ext_rename_sfid);
2321 offset = dissect_struct_lu_fid(tvb, offset, tree, hf_lustre_changelog_ext_rename_spfid);
2323 if (flags & CLF_JOBID) {
2324 proto_tree_add_item(tree, hf_lustre_changelog_ext_jobid_jobid, tvb, offset, 32, ENC_ASCII);
2325 offset += 32;
2327 if (flags & CLF_EXTRA_FLAGS) {
2328 proto_tree_add_item(tree, hf_lustre_changelog_extra_flags_extra_flags, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2329 offset += 8;
2331 if (namelen > 0) {
2332 proto_tree_add_item(tree, hf_lustre_changelog_ext_name, tvb, offset, namelen, ENC_ASCII);
2333 offset += namelen;
2336 proto_item_set_len(item, offset-old_offset);
2337 return offset;
2340 static int
2341 dissect_struct_cfg_marker(tvbuff_t *tvb, int offset, proto_tree *parent_tree)
2343 proto_tree *tree;
2344 proto_item *item;
2346 item = proto_tree_add_item(parent_tree, hf_lustre_cfg_marker, tvb, offset, 160, ENC_NA);
2347 tree = proto_item_add_subtree(item, ett_lustre_cfg_marker);
2349 /* struct cfg_marker { */
2350 /* __u32 cm_step; /\* aka config version *\/ */
2351 /* __u32 cm_flags; */
2352 /* __u32 cm_vers; /\* lustre release version number *\/ */
2353 /* __u32 cm_padding; /\* 64 bit align *\/ */
2354 /* __s64 cm_createtime; /\*when this record was first created *\/ */
2355 /* __s64 cm_canceltime; /\*when this record is no longer valid*\/ */
2356 /* char cm_tgtname[MTI_NAME_MAXLEN]; */
2357 /* char cm_comment[MTI_NAME_MAXLEN]; */
2358 /* }; */
2360 proto_tree_add_item(tree, hf_lustre_cfg_marker_step, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2361 offset += 4;
2362 proto_tree_add_item(tree, hf_lustre_cfg_marker_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2363 offset += 4;
2364 proto_tree_add_item(tree, hf_lustre_cfg_marker_vers, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2365 offset += 4;
2366 proto_tree_add_item(tree, hf_lustre_cfg_marker_padding, tvb, offset, 4, ENC_NA);
2367 offset += 4;
2368 proto_tree_add_item(tree, hf_lustre_cfg_marker_createtime, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2369 offset += 8;
2370 proto_tree_add_item(tree, hf_lustre_cfg_marker_canceltime, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2371 offset += 8;
2372 proto_tree_add_item(tree, hf_lustre_cfg_marker_tgtname, tvb, offset, 64, ENC_ASCII);
2373 offset += 64;
2374 proto_tree_add_item(tree, hf_lustre_cfg_marker_comment, tvb, offset, 64, ENC_ASCII);
2375 offset += 64;
2377 return offset;
2380 static int
2381 dissect_struct_lustre_cfg(tvbuff_t *tvb, int offset, proto_tree *parent_tree)
2383 proto_tree *tree;
2384 proto_item *item;
2385 int old_offset, buf_offset;
2386 unsigned count, i, cmd, len;
2388 old_offset = offset;
2390 /* struct lustre_cfg {
2391 * __u32 lcfg_version;
2392 * __u32 lcfg_command;
2393 * __u32 lcfg_num;
2394 * __u32 lcfg_flags;
2395 * __u64 lcfg_nid;
2396 * __u32 lcfg_nal; // not used any more
2397 * __u32 lcfg_bufcount;
2398 * __u32 lcfg_buflens[];
2399 * };
2402 item = proto_tree_add_item(parent_tree, hf_lustre_lustre_cfg, tvb, offset, -1, ENC_NA);
2403 tree = proto_item_add_subtree(item, ett_lustre_lustre_cfg);
2405 proto_tree_add_item(tree, hf_lustre_lustre_cfg_version, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2406 offset += 4;
2407 proto_tree_add_item_ret_uint(tree, hf_lustre_lustre_cfg_command, tvb, offset, 4, ENC_LITTLE_ENDIAN, &cmd);
2408 offset += 4;
2409 proto_tree_add_item(tree, hf_lustre_lustre_cfg_num, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2410 offset += 4;
2411 proto_tree_add_item(tree, hf_lustre_lustre_cfg_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2412 offset += 4;
2413 offset = lnet_dissect_struct_nid(tvb, tree, offset, hf_lustre_lustre_cfg_nid);
2414 proto_tree_add_item(tree, hf_lustre_lustre_cfg_padding, tvb, offset, 4, ENC_NA);
2415 offset += 4;
2416 proto_tree_add_item_ret_uint(tree, hf_lustre_lustre_cfg_bufcount, tvb, offset, 4, ENC_LITTLE_ENDIAN, &count);
2417 offset += 4;
2419 buf_offset = offset;
2420 for (i = 0; i < count; ++i) {
2421 proto_tree_add_item(tree, hf_lustre_lustre_cfg_buflen, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2422 offset += 4;
2424 offset = add_extra_padding(tvb, offset, NULL, tree);
2425 proto_item_append_text(item, ": %s", val_to_str(cmd, lcfg_command_type_vals, "Unknown(%x)"));
2426 switch (cmd) {
2427 case LCFG_MARKER:
2428 offset = dissect_struct_cfg_marker(tvb, offset, tree);
2429 break;
2430 case LCFG_SETUP:
2431 if (count == 2) {
2432 len = tvb_get_letohl(tvb, buf_offset);
2433 len += buffer_padding_length(len+offset);
2434 proto_tree_add_item(tree, hf_lustre_lustre_cfg_buffer, tvb, offset, len, ENC_ASCII);
2435 offset += len;
2436 offset = dissect_struct_lov_desc(tvb, offset, tree);
2437 break;
2439 // ELSE FALL THROUGH
2440 default:
2441 for (i = 0; i < count; ++i) {
2442 len = tvb_get_letohl(tvb, buf_offset+(4*i));
2443 len += buffer_padding_length(len+offset);
2444 proto_tree_add_item(tree, hf_lustre_lustre_cfg_buffer, tvb, offset, len, ENC_ASCII);
2445 offset += len;
2447 break;
2449 proto_item_set_len(item, offset-old_offset);
2450 return offset;
2453 /********************************************************************
2455 * LDLM Sub Structures
2458 static int
2459 dissect_struct_ldlm_lock_desc(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, uint64_t *ltype)
2461 proto_tree *tree, *res_tree, *id_tree, *l_tree;
2462 proto_item *item;
2463 int i;
2464 uint32_t type;
2466 /* struct ldlm_lock_desc { */
2467 /* struct ldlm_resource_desc l_resource; */
2468 /* enum ldlm_mode l_req_mode; */
2469 /* enum ldlm_mode l_granted_mode; */
2470 /* union ldlm_wire_policy_data l_policy_data; */
2471 /* }; */
2472 /* struct ldlm_resource_desc { */
2473 /* enum ldlm_type lr_type; */
2474 /* __u32 lr_pad; /\* also fix lustre_swab_ldlm_resource_desc *\/ */
2475 /* struct ldlm_res_id lr_name; */
2476 /* }; */
2477 /* struct ldlm_res_id { */
2478 /* __u64 name[RES_NAME_SIZE]; */
2479 /* }; */
2480 /* RES_NAME_SIZE == 4 */
2481 /* SIZE == (4+4+32)+4+4+(32)*/
2483 item = proto_tree_add_item(parent_tree, hf_lustre_ldlm_lock_desc, tvb, offset, 80, ENC_NA);
2484 tree = proto_item_add_subtree(item, ett_lustre_ldlm_lock_desc);
2486 item = proto_tree_add_item(tree, hf_lustre_ldlm_resource_desc, tvb, offset, 40, ENC_NA);
2487 res_tree = proto_item_add_subtree(item, ett_lustre_ldlm_resource_desc);
2488 proto_tree_add_item_ret_uint(res_tree, hf_lustre_ldlm_resource_desc_lr_type, tvb, offset, 4, ENC_LITTLE_ENDIAN, &type);
2489 offset += 4;
2490 proto_tree_add_item(res_tree, hf_lustre_ldlm_resource_desc_lr_padding, tvb, offset, 4, ENC_NA);
2491 offset += 4;
2492 for (i = 0; i < 4; ++i) {
2493 item = proto_tree_add_item(res_tree, hf_lustre_ldlm_res_id, tvb, offset, 8, ENC_NA);
2494 id_tree = proto_item_add_subtree(item, ett_lustre_ldlm_res_id);
2495 proto_item_append_text(item, " [%d]", i);
2496 switch (type) {
2497 case LDLM_IBITS:
2498 proto_tree_add_item(id_tree, hf_lustre_ldlm_res_id_bits, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2499 break;
2500 case LDLM_PLAIN:
2501 if (i == 1) {
2502 if (ltype)
2503 *ltype = tvb_get_letoh64(tvb, offset);
2504 proto_tree_add_item(id_tree, hf_lustre_ldlm_res_id_type, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2505 } else
2506 proto_tree_add_item(id_tree, hf_lustre_ldlm_res_id_string, tvb, offset, 8, ENC_ASCII);
2507 break;
2508 default:
2509 proto_tree_add_item(id_tree, hf_lustre_ldlm_res_id_name, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2510 break;
2512 offset += 8;
2515 proto_tree_add_item(tree, hf_lustre_ldlm_lock_desc_l_req_mode, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2516 offset += 4;
2517 proto_tree_add_item(tree, hf_lustre_ldlm_lock_desc_l_granted_mode, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2518 offset += 4;
2520 /* union ldlm_wire_policy_data { */
2521 /* struct ldlm_extent l_extent; */
2522 /* struct ldlm_flock_wire l_flock; */
2523 /* struct ldlm_inodebits l_inodebits; */
2524 /* } */
2525 /* sizeof(ldlm_wire_policy_data) == 32 */
2526 switch (type) {
2527 case LDLM_EXTENT:
2528 item = proto_tree_add_item(tree, hf_lustre_ldlm_lock_desc_l_policy_data, tvb, offset, 24, ENC_NA);
2529 l_tree = proto_item_add_subtree(item, ett_lustre_ldlm_extent);
2530 /* struct ldlm_extent { */
2531 /* __u64 start; */
2532 /* __u64 end; */
2533 /* __u64 gid; */
2534 /* }; */
2535 proto_tree_add_item(l_tree, hf_lustre_ldlm_extent_start, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2536 offset += 8;
2537 proto_tree_add_item(l_tree, hf_lustre_ldlm_extent_end, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2538 offset += 8;
2539 proto_tree_add_item(l_tree, hf_lustre_ldlm_extent_gid, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2540 offset += 8;
2541 proto_tree_add_item(tree, hf_lustre_extra_padding, tvb, offset, 8, ENC_NA);
2542 offset += 8;
2543 break;
2544 case LDLM_PLAIN:
2545 case LDLM_FLOCK:
2546 item = proto_tree_add_item(tree, hf_lustre_ldlm_lock_desc_l_policy_data, tvb, offset, 32, ENC_NA);
2547 l_tree = proto_item_add_subtree(item, ett_lustre_ldlm_flock);
2548 /* struct ldlm_flock_wire { */
2549 /* __u64 lfw_start; */
2550 /* __u64 lfw_end; */
2551 /* __u64 lfw_owner; */
2552 /* __u32 lfw_padding; */
2553 /* __u32 lfw_pid; */
2554 /* }; */
2555 proto_tree_add_item(l_tree, hf_lustre_ldlm_flock_start, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2556 offset += 8;
2557 proto_tree_add_item(l_tree, hf_lustre_ldlm_flock_end, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2558 offset += 8;
2559 proto_tree_add_item(l_tree, hf_lustre_ldlm_flock_owner, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2560 offset += 8;
2561 proto_tree_add_item(l_tree, hf_lustre_ldlm_flock_padding, tvb, offset, 4, ENC_NA);
2562 offset += 4;
2563 proto_tree_add_item(l_tree, hf_lustre_ldlm_flock_pid, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2564 offset += 4;
2565 break;
2566 case LDLM_IBITS:
2567 item = proto_tree_add_item(tree, hf_lustre_ldlm_lock_desc_l_policy_data, tvb, offset, 8, ENC_NA);
2568 l_tree = proto_item_add_subtree(item, ett_lustre_ldlm_flock);
2569 /* struct ldlm_inodebits { */
2570 /* __u64 bits; */
2571 /* __u64 try_bits; */
2572 /* }; */
2573 proto_tree_add_item(l_tree, hf_lustre_ldlm_inodebits_bits, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2574 offset += 8;
2575 proto_tree_add_item(l_tree, hf_lustre_ldlm_inodebits_try_bits, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2576 offset += 8;
2577 proto_tree_add_item(l_tree, hf_lustre_extra_padding, tvb, offset, 16, ENC_NA);
2578 offset += 16;
2579 break;
2580 case 0: /* no actual locking */
2581 proto_tree_add_item(tree, hf_lustre_extra_padding, tvb, offset, 32, ENC_NA);
2582 offset += 32;
2583 break;
2584 default:
2585 expert_add_info_format(pinfo, tree, &ei_lustre_badopc, "Unknown Lock Type: %d", type);
2586 break;
2589 offset = add_extra_padding(tvb, offset, pinfo, parent_tree);
2590 return offset;
2593 static int
2594 dissect_struct_seq_range(tvbuff_t *tvb, int offset, proto_tree *parent_tree, unsigned buf_num)
2596 proto_tree *tree;
2597 proto_item *item;
2598 int data_len;
2600 data_len = LUSTRE_BUFFER_LEN(buf_num);
2601 if (data_len == 0)
2602 return offset;
2604 /* struct lu_seq_range { */
2605 /* __u64 lsr_start; */
2606 /* __u64 lsr_end; */
2607 /* __u32 lsr_index; */
2608 /* __u32 lsr_flags; */
2609 /* }; */
2611 item = proto_tree_add_item(parent_tree, hf_lustre_seq_range, tvb, offset, 24, ENC_NA);
2612 tree = proto_item_add_subtree(item, ett_lustre_seq_range);
2614 proto_tree_add_item(tree, hf_lustre_seq_range_start, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2615 offset += 8;
2616 proto_tree_add_item(tree, hf_lustre_seq_range_end, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2617 offset += 8;
2618 proto_tree_add_item(tree, hf_lustre_seq_range_index, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2619 offset += 4;
2620 proto_tree_add_item(tree, hf_lustre_seq_range_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2621 offset += 4;
2623 return offset;
2626 static int
2627 dissect_struct_ldlm_gl_barrier_desc(tvbuff_t *tvb, int offset, proto_tree *parent_tree, unsigned buf_num)
2629 proto_tree *tree;
2630 proto_item *item;
2631 unsigned data_len;
2633 data_len = LUSTRE_BUFFER_LEN(buf_num);
2634 if (data_len == 0)
2635 return offset;
2637 /* struct ldlm_gl_barrier_desc { */
2638 /* __u32 lgbd_status; */
2639 /* __u32 lgbd_timeout; */
2640 /* __u64 lgbd_padding; */
2641 /* }; */
2643 item = proto_tree_add_item(parent_tree, hf_lustre_ldlm_gl_barrier_desc, tvb, offset, 16, ENC_NA);
2644 tree = proto_item_add_subtree(item, ett_lustre_ldlm_gl_barrier_desc);
2646 proto_tree_add_item(tree, hf_lustre_ldlm_gl_barrier_desc_status, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2647 offset += 4;
2648 proto_tree_add_item(tree, hf_lustre_ldlm_gl_barrier_desc_timeout, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2649 offset += 4;
2650 proto_tree_add_item(tree, hf_lustre_ldlm_gl_barrier_desc_padding, tvb, offset, 8, ENC_NA);
2651 offset += 8;
2653 return offset;
2656 static int
2657 dissect_struct_ldlm_gl_lquota_desc(tvbuff_t *tvb, int offset, proto_tree *parent_tree, unsigned buf_num)
2659 proto_tree *tree;
2660 proto_item *item;
2661 unsigned data_len;
2663 data_len = LUSTRE_BUFFER_LEN(buf_num);
2664 if (data_len == 0)
2665 return offset;
2667 /* struct ldlm_gl_lquota_desc { */
2668 /* union lquota_id gl_id; /\* quota ID subject to the glimpse *\/ */
2669 /* __u64 gl_flags; /\* see LQUOTA_FL* below *\/ */
2670 /* __u64 gl_ver; /\* new index version *\/ */
2671 /* __u64 gl_hardlimit; /\* new hardlimit or qunit value *\/ */
2672 /* __u64 gl_softlimit; /\* new softlimit *\/ */
2673 /* __u64 gl_time; */
2674 /* __u64 gl_pad2; */
2675 /* }; */
2677 item = proto_tree_add_item(parent_tree, hf_lustre_ldlm_gl_lquota_desc, tvb, offset, 64, ENC_NA);
2678 tree = proto_item_add_subtree(item, ett_lustre_ldlm_gl_lquota_desc);
2680 offset = dissect_struct_lquota_id(tvb, offset, tree);
2681 proto_tree_add_item(tree, hf_lustre_ldlm_gl_lquota_desc_flags, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2682 offset += 8;
2683 proto_tree_add_item(tree, hf_lustre_ldlm_gl_lquota_desc_ver, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2684 offset += 8;
2685 proto_tree_add_item(tree, hf_lustre_ldlm_gl_lquota_desc_hardlimit, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2686 offset += 8;
2687 proto_tree_add_item(tree, hf_lustre_ldlm_gl_lquota_desc_softlimit, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2688 offset += 8;
2689 proto_tree_add_item(tree, hf_lustre_ldlm_gl_lquota_desc_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2690 offset += 8;
2691 proto_tree_add_item(tree, hf_lustre_ldlm_gl_lquota_desc_pad2, tvb, offset, 8, ENC_NA);
2692 offset += 8;
2694 return offset;
2697 static int
2698 dissect_struct_ldlm_gl_desc(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, lustre_trans_t *trans, unsigned buf_num)
2700 unsigned data_len;
2701 int old_offset;
2703 data_len = LUSTRE_BUFFER_LEN(buf_num);
2704 if (data_len == 0)
2705 return offset;
2707 old_offset = offset;
2709 /* union ldlm_gl_desc { */
2710 /* struct ldlm_gl_lquota_desc lquota_desc; */
2711 /* struct ldlm_gl_barrier_desc barrier_desc; */
2712 /* }; SIZE == 64 */
2714 switch (trans->sub_opcode) {
2715 case CONFIG_T_BARRIER:
2716 /* Size == 16 */
2717 offset = dissect_struct_ldlm_gl_barrier_desc(tvb, offset, parent_tree, buf_num);
2718 data_len = old_offset+64-offset;
2719 proto_tree_add_item(parent_tree, hf_lustre_extra_padding, tvb, offset, data_len, ENC_NA);
2720 offset += data_len;
2721 break;
2722 case CONFIG_T_CONFIG:
2723 /* Size == 64 */
2724 offset = dissect_struct_ldlm_gl_lquota_desc(tvb, offset, parent_tree, buf_num);
2725 break;
2726 default:
2727 offset = display_buffer_data(tvb, pinfo, offset, parent_tree, buf_num, "GLIMPSE DESC");
2728 break;
2731 return offset;
2734 static int
2735 dissect_struct_ldlm_request(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, uint64_t *type, unsigned buf_num)
2737 proto_tree *tree;
2738 proto_item *item;
2739 unsigned old_offset, data_len, count, i;
2741 data_len = LUSTRE_BUFFER_LEN(buf_num);
2742 if (data_len == 0)
2743 return offset;
2745 old_offset = offset;
2747 /* struct ldlm_request { */
2748 /* __u32 lock_flags; */
2749 /* __u32 lock_count; */
2750 /* struct ldlm_lock_desc lock_desc; */
2751 /* struct lustre_handle lock_handle[LDLM_LOCKREQ_HANDLES]; */
2752 /* }; */
2753 /* LDLM_LOCKREQ_HANDLES == 2 */
2754 /* sizeof(ldlm_request) == 8+72+ 8*MAX(2,lock_count) */
2756 item = proto_tree_add_item(parent_tree, hf_lustre_ldlm_request, tvb, offset, -1, ENC_NA);
2757 tree = proto_item_add_subtree(item, ett_lustre_ldlm_request);
2759 /* @@ change to bitmask on LDLM_FL_* */
2760 proto_tree_add_item(tree, hf_lustre_ldlm_request_lock_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2761 offset += 4;
2762 /* There are always at least 2 buffers */
2763 proto_tree_add_item_ret_uint(tree, hf_lustre_ldlm_request_lock_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &count);
2764 if (count < 2)
2765 count = 2;
2766 offset += 4;
2767 offset = dissect_struct_ldlm_lock_desc(tvb, offset, pinfo, tree, type);
2768 for (i = 0; i < count; ++i)
2769 offset = dissect_struct_lustre_handle(tvb, offset, tree, hf_lustre_ldlm_request_lock_handle);
2771 proto_item_set_len(tree, offset-old_offset);
2772 return offset;
2775 static int
2776 dissect_struct_ldlm_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, uint64_t *type, unsigned buf_num)
2778 proto_tree *tree;
2779 proto_item *item;
2780 int data_len;
2782 data_len = LUSTRE_BUFFER_LEN(buf_num);
2783 if (data_len == 0)
2784 return offset;
2786 /* struct ldlm_reply { */
2787 /* __u32 lock_flags; */
2788 /* __u32 lock_padding; /\* also fix lustre_swab_ldlm_reply *\/ */
2789 /* struct ldlm_lock_desc lock_desc; */
2790 /* struct lustre_handle lock_handle; */
2791 /* __u64 lock_policy_res1; */
2792 /* __u64 lock_policy_res2; */
2793 /* }; */
2794 /* SIZE == 24+80+8 */
2796 item = proto_tree_add_item(parent_tree, hf_lustre_ldlm_reply, tvb, offset, 112, ENC_NA);
2797 tree = proto_item_add_subtree(item, ett_lustre_ldlm_reply);
2799 proto_tree_add_item(tree, hf_lustre_ldlm_reply_lock_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2800 offset += 4;
2801 proto_tree_add_item(tree, hf_lustre_ldlm_reply_lock_padding, tvb, offset, 4, ENC_NA);
2802 offset += 4;
2803 offset = dissect_struct_ldlm_lock_desc(tvb, offset, pinfo, tree, type);
2804 offset = dissect_struct_lustre_handle(tvb, offset, tree, hf_lustre_ldlm_reply_lock_handle);
2805 proto_tree_add_item(tree, hf_lustre_ldlm_reply_lock_policy_res1, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2806 offset += 8;
2807 proto_tree_add_item(tree, hf_lustre_ldlm_reply_lock_policy_res2, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2808 offset += 8;
2810 return offset;
2813 /********************************************************************\
2815 * MGS Buffer Structures
2817 \********************************************************************/
2818 static int
2819 dissect_struct_mgs_config_body(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *parent_tree, lustre_trans_t *trans)
2821 proto_tree *tree;
2822 proto_item *item;
2824 item = proto_tree_add_item(parent_tree, hf_lustre_mgs_config_body, tvb, offset, 80, ENC_NA);
2825 tree = proto_item_add_subtree(item, ett_lustre_mgs_config_body);
2827 /* struct mgs_config_body { */
2828 /* char mcb_name[MTI_NAME_MAXLEN]; /\* logname *\/ */
2829 /* __u64 mcb_offset; /\* next index of config log to request *\/ */
2830 /* __u16 mcb_type; /\* type of log: CONFIG_T_[CONFIG|RECOVER] *\/ */
2831 /* __u8 mcb_nm_cur_pass; */
2832 /* __u8 mcb_bits; /\* bits unit size of config log *\/ */
2833 /* __u32 mcb_units; /\* # of units for bulk transfer *\/ */
2834 /* }; */
2835 /* MTI_NAME_MAXLEN == 64 */
2837 proto_tree_add_item(tree, hf_lustre_mgs_config_body_name, tvb, offset, 64, ENC_ASCII);
2838 offset += 64;
2839 proto_tree_add_item(tree, hf_lustre_mgs_config_body_offset, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2840 offset += 8;
2841 trans->sub_opcode = tvb_get_letohs(tvb, offset);
2842 proto_tree_add_item(tree, hf_lustre_mgs_config_body_type, tvb, offset, 2, ENC_LITTLE_ENDIAN);
2843 offset += 2;
2844 proto_tree_add_item(tree, hf_lustre_mgs_config_body_nm_cur_pass, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2845 offset += 1;
2846 proto_tree_add_item(tree, hf_lustre_mgs_config_body_bits, tvb, offset, 1, ENC_LITTLE_ENDIAN);
2847 offset += 1;
2848 proto_tree_add_item(tree, hf_lustre_mgs_config_body_units, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2849 offset += 4;
2852 return offset;
2855 static int
2856 dissect_struct_mgs_config_res(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *parent_tree, lustre_trans_t *trans)
2858 proto_tree *tree;
2859 proto_item *item;
2861 item = proto_tree_add_item(parent_tree, hf_lustre_mgs_config_res, tvb, offset, 16, ENC_NA);
2862 tree = proto_item_add_subtree(item, ett_lustre_mgs_config_res);
2864 /* struct mgs_config_res { */
2865 /* __u64 mcr_offset; /\* index of last config log *\/ */
2866 /* union { */
2867 /* __u64 mcr_size; /\* size of the log *\/ */
2868 /* __u64 mcr_nm_cur_pass; /\* current nodemap config pass *\/ */
2869 /* }; */
2870 /* }; */
2872 proto_tree_add_item(tree, hf_lustre_mgs_config_res_offset, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2873 offset += 8;
2874 if (trans->sub_opcode == CONFIG_T_NODEMAP)
2875 proto_tree_add_item(tree, hf_lustre_mgs_config_res_nm_cur_pass, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2876 else
2877 proto_tree_add_item(tree, hf_lustre_mgs_config_res_size, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2878 offset += 8;
2880 return offset;
2883 static int
2884 dissect_struct_mgs_target_info(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *parent_tree, uint32_t buf_num)
2886 proto_tree *tree;
2887 proto_item *item;
2888 uint32_t data_len, old_offset, i, count;
2890 data_len = LUSTRE_BUFFER_LEN(buf_num);
2891 if (data_len == 0)
2892 return offset;
2894 old_offset = offset;
2896 item = proto_tree_add_item(parent_tree, hf_lustre_mgs_target_info, tvb, offset, -1, ENC_NA);
2897 tree = proto_item_add_subtree(item, ett_lustre_mgs_config_res);
2899 /* #define MTI_NAME_MAXLEN 64 */
2900 /* #define MTI_PARAM_MAXLEN 4096 */
2901 /* #define MTI_NIDS_MAX 32 */
2902 /* struct mgs_target_info { */
2903 /* __u32 mti_lustre_ver; */
2904 /* __u32 mti_stripe_index; */
2905 /* __u32 mti_config_ver; */
2906 /* __u32 mti_flags; */
2907 /* __u32 mti_nid_count; */
2908 /* __u32 mti_instance; /\* Running instance of target *\/ */
2909 /* char mti_fsname[MTI_NAME_MAXLEN]; */
2910 /* char mti_svname[MTI_NAME_MAXLEN]; */
2911 /* char mti_uuid[sizeof(struct obd_uuid)]; */
2912 /* __u64 mti_nids[MTI_NIDS_MAX]; /\* host nids (lnet_nid_t)*\/ */
2913 /* char mti_params[MTI_PARAM_MAXLEN]; */
2914 /* }; */
2916 proto_tree_add_item(tree, hf_lustre_mgs_target_info_mti_lustre_ver, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2917 offset += 4;
2918 proto_tree_add_item(tree, hf_lustre_mgs_target_info_mti_stripe_index, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2919 offset += 4;
2920 proto_tree_add_item(tree, hf_lustre_mgs_target_info_mti_config_ver, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2921 offset += 4;
2922 proto_tree_add_item(tree, hf_lustre_mgs_target_info_mti_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2923 offset += 4;
2924 proto_tree_add_item_ret_uint(tree, hf_lustre_mgs_target_info_mti_nid_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &count);
2925 offset += 4;
2926 proto_tree_add_item(tree, hf_lustre_mgs_target_info_mti_instance, tvb, offset, 4, ENC_LITTLE_ENDIAN);
2927 offset += 4;
2928 proto_tree_add_item(tree, hf_lustre_mgs_target_info_mti_fsname, tvb, offset, 64, ENC_NA);
2929 offset += 64;
2930 proto_tree_add_item(tree, hf_lustre_mgs_target_info_mti_svname, tvb, offset, 64, ENC_NA);
2931 offset += 64;
2932 proto_tree_add_item(tree, hf_lustre_mgs_target_info_mti_uuid, tvb, offset, 40, ENC_ASCII);
2933 offset += 40;
2934 for (i = 0; i < count; ++i)
2935 offset = lnet_dissect_struct_nid(tvb, tree, offset, hf_lustre_mgs_target_info_mti_nids);
2936 i = (32-count) * 8;
2937 proto_tree_add_item(tree, hf_lustre_mgs_target_info_padding, tvb, offset, i, ENC_NA);
2938 offset += i;
2939 i = MIN(4096, data_len-(offset-old_offset));
2940 proto_tree_add_item(tree, hf_lustre_mgs_target_info_mti_params, tvb, offset, i, ENC_NA);
2941 offset += i;
2943 proto_item_set_len(item, offset-old_offset);
2944 return offset;
2947 /********************************************************************\
2949 * MDS Buffer Structures
2951 \********************************************************************/
2953 static int
2954 dissect_struct_acl(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, uint32_t buf_num)
2956 proto_tree *tree;
2957 proto_item *item;
2958 int data_len;
2960 data_len = LUSTRE_BUFFER_LEN(buf_num);
2961 if (data_len == 0)
2962 return offset;
2964 item = proto_tree_add_item(parent_tree, hf_lustre_acl, tvb, offset, data_len, ENC_NA);
2965 tree = proto_item_add_subtree(item, ett_lustre_acl);
2967 proto_tree_add_item(tree, hf_lustre_data, tvb, offset, data_len, ENC_NA);
2968 offset += data_len;
2970 offset = add_extra_padding(tvb, offset, pinfo, parent_tree);
2972 return offset;
2975 static int
2976 dissect_struct_mdt_ioepoch(tvbuff_t *tvb, int offset, proto_tree *parent_tree, uint32_t buf_num)
2978 proto_tree *tree;
2979 proto_item *item;
2980 int data_len;
2982 data_len = LUSTRE_BUFFER_LEN(buf_num);
2983 if (data_len == 0)
2984 return offset;
2986 item = proto_tree_add_item(parent_tree, hf_lustre_mdt_ioepoch, tvb, offset, 24, ENC_NA);
2987 tree = proto_item_add_subtree(item, ett_lustre_mdt_ioepoch);
2989 /* struct mdt_ioepoch { */
2990 /* struct lustre_handle mio_handle; */
2991 /* __u64 mio_unused1; /\* was ioepoch *\/ */
2992 /* __u32 mio_unused2; /\* was flags *\/ */
2993 /* __u32 mio_padding; */
2994 /* } */
2995 /* sizeof(mdt_ioepoch) == 24 */
2997 offset = dissect_struct_lustre_handle(tvb, offset, tree, hf_lustre_mdt_ioepoch_handle);
2998 proto_tree_add_item(tree, hf_lustre_mdt_ioepoch_ioepoch, tvb, offset, 8, ENC_LITTLE_ENDIAN);
2999 offset += 8;
3000 proto_tree_add_item(tree, hf_lustre_mdt_ioepoch_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3001 offset += 4;
3002 proto_tree_add_item(tree, hf_lustre_mdt_ioepoch_padding, tvb, offset, 4, ENC_NA);
3003 offset += 4;
3005 return offset;
3008 static int
3009 dissect_struct_close_data(tvbuff_t *tvb, int offset, proto_tree *parent_tree, uint32_t buf_num)
3011 proto_tree *tree;
3012 proto_item *item;
3013 int data_len;
3015 data_len = LUSTRE_BUFFER_LEN(buf_num);
3016 if (data_len == 0)
3017 return offset;
3019 item = proto_tree_add_item(parent_tree, hf_lustre_close_data, tvb, offset, 96, ENC_NA);
3020 tree = proto_item_add_subtree(item, ett_lustre_close_data);
3022 /* struct close_data { */
3023 /* struct lustre_handle cd_handle; */
3024 /* struct lu_fid cd_fid; */
3025 /* __u64 cd_data_version; */
3026 /* __u64 cd_reserved[8]; */
3027 /* }; */
3028 /* sizeof(mdt_ioepoch) == 8+16+8+64 */
3030 offset = dissect_struct_lustre_handle(tvb, offset, tree, hf_lustre_close_handle);
3031 offset = dissect_struct_lu_fid(tvb, offset, tree, hf_lustre_close_fid);
3032 proto_tree_add_item(tree, hf_lustre_close_data_ver, tvb, offset, 8, ENC_LITTLE_ENDIAN);
3033 offset += 8;
3034 proto_tree_add_item(tree, hf_lustre_close_reserved, tvb, offset, 64, ENC_NA);
3035 offset += 64;
3037 return offset;
3040 static int
3041 dissect_struct_mdt_rec_reint(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, unsigned buf_num)
3043 proto_tree *tree;
3044 proto_tree *item;
3045 unsigned data_len, opcode;
3047 data_len = LUSTRE_BUFFER_LEN(buf_num);
3048 if (data_len == 0)
3049 return offset;
3051 /* struct mdt_rec_reint { LINK CREATE RENAME SETXATTR SETATTR
3052 * 0 __u32 rr_opcode; UNLINK
3053 * 4 __u32 rr_cap;
3054 * 8 __u32 rr_fsuid;
3055 * 12 __u32 rr_fsuid_h;
3056 * 16 __u32 rr_fsgid;
3057 * 20 __u32 rr_fsgid_h;
3058 * 24 __u32 rr_suppgid1;
3059 * 28 __u32 rr_suppgid1_h;
3060 * 32 __u32 rr_suppgid2; pad
3061 * 36 __u32 rr_suppgid2_h; pad
3062 * 40 lu_fid rr_fid1;
3063 * -- All above is the same
3064 * 56 lu_fid rr_fid2; pad,pad,pad valid,uid,gid
3065 * 72 __s64 rr_mtime; time COOKIE time valid size
3066 * 80 __s64 rr_atime; pad time pad time blocks
3067 * 88 __s64 rr_ctime; pad rdev pad pad mtime
3068 * 96 __u64 rr_size; pad ioepoch pad pad atime
3069 * 104 __u64 rr_blocks; pad pad pad pad ctime
3070 * 112 __u32 rr_bias; mode size attr_flags
3071 * 116 __u32 rr_mode; pad bias flags
3072 * 120 __u32 rr_flags; pad pad pad bias
3073 * 124 __u32 rr_flags_h; pad pad pad projid
3074 * 128 __u32 rr_umask; pad pad pad pad
3075 * 132 __u32 rr_padding_4;
3076 * }; */
3077 /* sizeof(mdt_rec_reint) == 136 */
3079 item = proto_tree_add_item(parent_tree, hf_lustre_mdt_rec_reint, tvb, offset, 136, ENC_NA);
3080 tree = proto_item_add_subtree(item, ett_lustre_mdt_rec_reint);
3082 if (data_len != 136)
3083 expert_add_info_format(pinfo, tree, &ei_lustre_buflen,
3084 "Buffer Length mismatch: expected:136 !== length:%u", data_len);
3086 proto_tree_add_item_ret_uint(tree, hf_lustre_mdt_rec_reint_opcode, tvb, offset, 4, ENC_LITTLE_ENDIAN, &opcode);
3087 proto_item_append_text(tree, " %s", val_to_str(opcode, mds_reint_vals, "BAD(%d)"));
3088 offset += 4;
3089 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_cap, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3090 offset += 4;
3091 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_fsuid, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3092 offset += 4;
3093 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_fsuid_h, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3094 offset += 4;
3095 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_fsgid, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3096 offset += 4;
3097 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_fsgid_h, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3098 offset += 4;
3099 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_suppgid1, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3100 offset += 4;
3101 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_suppgid1_h, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3102 offset += 4;
3103 /* Byte: 32 */
3104 if (opcode == REINT_SETATTR) {
3105 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_padding, tvb, offset, 8, ENC_NA);
3106 offset += 8;
3107 } else {
3108 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_suppgid2, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3109 offset += 4;
3110 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_suppgid2_h, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3111 offset += 4;
3113 /* Byte: 40 */
3114 offset = dissect_struct_lu_fid(tvb, offset, tree, hf_lustre_mdt_rec_reint_fid1);
3115 if (opcode == REINT_SETXATTR) {
3116 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_padding, tvb, offset, 16, ENC_NA);
3117 offset += 16;
3118 } else if (opcode == REINT_SETATTR) {
3119 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_valid, tvb, offset, 8, ENC_LITTLE_ENDIAN);
3120 offset += 8;
3121 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_uid, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3122 offset += 4;
3123 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_gid, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3124 offset += 4;
3125 } else { /* DEFAULT */
3126 offset = dissect_struct_lu_fid(tvb, offset, tree, hf_lustre_mdt_rec_reint_fid2);
3128 /* Byte: 72 */
3129 if (opcode == REINT_CREATE) {
3130 offset = dissect_struct_lustre_handle(tvb, offset, tree, hf_lustre_mdt_rec_reint_old_handle);
3131 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
3132 offset += 8;
3133 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_rdev, tvb, offset, 8, ENC_LITTLE_ENDIAN);
3134 offset += 8;
3135 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_ioepoch, tvb, offset, 8, ENC_LITTLE_ENDIAN);
3136 offset += 8;
3137 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_padding, tvb, offset, 8, ENC_NA);
3138 offset += 8;
3139 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_mode, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3140 offset += 4;
3141 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_bias, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3142 offset += 4;
3144 } else if (opcode == REINT_SETXATTR) {
3145 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_valid, tvb, offset, 8, ENC_LITTLE_ENDIAN);
3146 offset += 8;
3147 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
3148 offset += 8;
3149 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_padding, tvb, offset, 24, ENC_NA);
3150 offset += 24;
3151 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_size32, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3152 offset += 4;
3153 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3154 offset += 4;
3156 } else if (opcode == REINT_SETATTR) {
3157 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_size64, tvb, offset, 8, ENC_LITTLE_ENDIAN);
3158 offset += 8;
3159 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_blocks, tvb, offset, 8, ENC_LITTLE_ENDIAN);
3160 offset += 8;
3161 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_mtime, tvb, offset, 8, ENC_LITTLE_ENDIAN);
3162 offset += 8;
3163 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_atime, tvb, offset, 8, ENC_LITTLE_ENDIAN);
3164 offset += 8;
3165 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_ctime, tvb, offset, 8, ENC_LITTLE_ENDIAN);
3166 offset += 8;
3167 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_attr_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3168 offset += 4;
3169 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_mode, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3170 offset += 4;
3172 } else {
3173 if (opcode == REINT_LINK || opcode == REINT_RENAME || opcode == REINT_UNLINK) {
3174 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
3175 offset += 8;
3176 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_padding, tvb, offset, 32, ENC_NA);
3177 offset += 32;
3179 } else { /* DEFAULT */
3180 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_mtime, tvb, offset, 8, ENC_LITTLE_ENDIAN);
3181 offset += 8;
3182 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_atime, tvb, offset, 8, ENC_LITTLE_ENDIAN);
3183 offset += 8;
3184 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_ctime, tvb, offset, 8, ENC_LITTLE_ENDIAN);
3185 offset += 8;
3186 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_size64, tvb, offset, 8, ENC_LITTLE_ENDIAN);
3187 offset += 8;
3188 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_blocks, tvb, offset, 8, ENC_LITTLE_ENDIAN);
3189 offset += 8;
3191 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_bias, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3192 offset += 4;
3193 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_mode, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3194 offset += 4;
3197 /* Byte: 120 */
3198 if (opcode == REINT_LINK || opcode == REINT_RENAME || opcode == REINT_UNLINK || opcode == REINT_SETXATTR) {
3199 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_padding, tvb, offset, 12, ENC_NA);
3200 offset += 12;
3202 } else if (opcode == REINT_SETATTR) {
3203 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_bias, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3204 offset += 4;
3205 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_projid, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3206 offset += 4;
3208 } else {
3209 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3210 offset += 4;
3211 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_flags_h, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3212 offset += 4;
3213 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_umask, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3214 offset += 4;
3216 /* Byte: 132 */
3217 proto_tree_add_item(tree, hf_lustre_mdt_rec_reint_padding, tvb, offset, 4, ENC_NA);
3218 offset += 4;
3220 offset = add_extra_padding(tvb, offset, pinfo, parent_tree);
3222 return offset;
3225 static int
3226 dissect_struct_lmv_mds_md_v1(tvbuff_t *tvb, packet_info *pinfo _U_, int offset, proto_tree *parent_tree, unsigned buf_num)
3228 proto_tree *tree;
3229 proto_item *item;
3230 unsigned old_offset, count, i, magic;
3232 count = LUSTRE_BUFFER_LEN(buf_num);
3234 if (count == 0)
3235 return offset;
3237 old_offset = offset;
3238 /* /\* LMV layout EA, and it will be stored both in master and slave object *\/ */
3239 /* struct lmv_mds_md_v1 { */
3240 /* __u32 lmv_magic; */
3241 /* __u32 lmv_stripe_count; */
3242 /* __u32 lmv_master_mdt_index; /\* On master object, it is master */
3243 /* * MDT index, on slave object, it */
3244 /* * is stripe index of the slave obj *\/ */
3245 /* __u32 lmv_hash_type; /\* dir stripe policy, i.e. indicate */
3246 /* * which hash function to be used, */
3247 /* * Note: only lower 16 bits is being */
3248 /* * used for now. Higher 16 bits will */
3249 /* * be used to mark the object status, */
3250 /* * for example migrating or dead. *\/ */
3251 /* __u32 lmv_layout_version; /\* Used for directory restriping *\/ */
3252 /* __u32 lmv_padding1; */
3253 /* __u64 lmv_padding2; */
3254 /* __u64 lmv_padding3; */
3255 /* char lmv_pool_name[16]; /\* pool name *\/ */
3256 /* struct lu_fid lmv_stripe_fids[0]; /\* FIDs for each stripe *\/ */
3257 /* }; */
3259 item = proto_tree_add_item(parent_tree, hf_lustre_lmv_mds_md, tvb, offset, -1, ENC_NA);
3260 tree = proto_item_add_subtree(item, ett_lustre_lmv_mds_md);
3262 proto_tree_add_item_ret_uint(tree, hf_lustre_lmv_mds_md_magic, tvb, offset, 4, ENC_LITTLE_ENDIAN, &magic);
3263 offset += 4;
3264 proto_tree_add_item_ret_uint(tree, hf_lustre_lmv_mds_md_stripe_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &count);
3265 offset += 4;
3266 proto_tree_add_item(tree, hf_lustre_lmv_mds_md_master_mdt_index, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3267 offset += 4;
3268 proto_tree_add_item(tree, hf_lustre_lmv_mds_md_hash_type, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3269 proto_tree_add_item(tree, hf_lustre_lmv_mds_md_status, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3270 offset += 4;
3271 proto_tree_add_item(tree, hf_lustre_lmv_mds_md_layout_version, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3272 offset += 4;
3273 proto_tree_add_item(tree, hf_lustre_lmv_mds_md_padding, tvb, offset, 20, ENC_NA);
3274 offset += 20;
3275 proto_tree_add_item(tree, hf_lustre_lmv_mds_md_pool_name, tvb, offset, 16, ENC_ASCII);
3276 offset += 16;
3278 for (i = 0; i < count && magic == LMV_MAGIC_V1; ++i)
3279 offset = dissect_struct_lu_fid(tvb, offset, tree, hf_lustre_lmv_mds_md_stripe_fid);
3281 proto_item_set_len(item, offset-old_offset);
3283 return offset;
3286 static int
3287 dissect_struct_lmv_user_mds_data(tvbuff_t *tvb, int offset, proto_tree *parent_tree, int hf_index)
3289 proto_tree *tree;
3290 proto_item *item;
3292 /* struct lmv_user_mds_data { */
3293 /* struct lu_fid lum_fid; */
3294 /* __u32 lum_padding; */
3295 /* __u32 lum_mds; */
3296 /* }; */
3298 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, 24, ENC_NA);
3299 tree = proto_item_add_subtree(item, ett_lustre_lmv_user_mds_data);
3301 offset = dissect_struct_lu_fid(tvb, offset, tree, hf_lustre_lmv_user_mds_data_fid);
3303 proto_tree_add_item(tree, hf_lustre_lmv_user_mds_data_padding, tvb, offset, 4, ENC_NA);
3304 offset += 4;
3305 proto_tree_add_item(tree, hf_lustre_lmv_user_mds_data_mds, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3306 offset += 4;
3308 return offset;
3311 static int
3312 dissect_struct_lmv_user_md(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *parent_tree, unsigned buf_num)
3314 proto_tree *tree;
3315 proto_item *item;
3316 unsigned old_offset, buf_len, i, magic, count;
3318 buf_len = LUSTRE_BUFFER_LEN(buf_num);
3320 if (buf_len == 0)
3321 return offset;
3323 old_offset = offset;
3325 /* struct lmv_user_md_v1 { */
3326 /* __u32 lum_magic; /\* must be the first field *\/ */
3327 /* __u32 lum_stripe_count; /\* dirstripe count *\/ */
3328 /* __u32 lum_stripe_offset; /\* MDT idx for default dirstripe *\/ */
3329 /* __u32 lum_hash_type; /\* Dir stripe policy *\/ */
3330 /* __u32 lum_type; /\* LMV type: default *\/ */
3331 /* __u8 lum_max_inherit; /\* inherit depth of default LMV *\/ */
3332 /* __u8 lum_max_inherit_rr; /\* inherit depth of default LMV to round-robin mkdir *\/ */
3333 /* __u16 lum_padding1; */
3334 /* __u32 lum_padding2; */
3335 /* __u32 lum_padding3; */
3336 /* char lum_pool_name[LOV_MAXPOOLNAME + 1]; */
3337 /* struct lmv_user_mds_data lum_objects[0]; */
3338 /* }; */
3340 item = proto_tree_add_item(parent_tree, hf_lustre_lmv_user_md_v1, tvb, offset, -1, ENC_NA);
3341 tree = proto_item_add_subtree(item, ett_lustre_lmv_user_md_v1);
3343 proto_tree_add_item_ret_uint(tree, hf_lustre_lmv_user_md_v1_magic, tvb, offset, 4, ENC_LITTLE_ENDIAN, &magic);
3344 offset += 4;
3345 // @@ if magic == LMV_MAGIC_FOREIGN { -> lmv_foreign_md }
3347 proto_tree_add_item_ret_uint(tree, hf_lustre_lmv_user_md_v1_stripe_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &count);
3348 offset += 4;
3349 proto_tree_add_item(tree, hf_lustre_lmv_user_md_v1_stripe_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3350 offset += 4;
3351 proto_tree_add_item(tree, hf_lustre_lmv_user_md_v1_hash_type, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3352 offset += 4;
3353 proto_tree_add_item(tree, hf_lustre_lmv_user_md_v1_type, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3354 offset += 4;
3355 proto_tree_add_item(tree, hf_lustre_lmv_user_md_v1_max_inherit, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3356 offset += 1;
3357 proto_tree_add_item(tree, hf_lustre_lmv_user_md_v1_max_inherit_rr, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3358 offset += 1;
3359 proto_tree_add_item(tree, hf_lustre_lmv_user_md_v1_padding, tvb, offset, 10, ENC_NA);
3360 offset += 10;
3361 proto_tree_add_item(tree, hf_lustre_lmv_user_md_v1_pool_name, tvb, offset, 16, ENC_ASCII);
3362 offset += 16;
3364 if (buf_len + old_offset >= (unsigned)offset + 24) {
3365 for (i = 0; i < count && magic == LMV_USER_MAGIC; ++i)
3366 offset = dissect_struct_lmv_user_mds_data(tvb, offset, tree, hf_lustre_lmv_user_md_v1_objects);
3367 } else {
3368 offset = add_extra_padding(tvb, offset, pinfo, parent_tree);
3371 if (offset-old_offset != buf_len)
3372 expert_add_info(pinfo, tree, &ei_lustre_buflen);
3373 proto_item_set_len(item, offset-old_offset);
3375 return offset;
3378 static int
3379 dissect_struct_lov_mds_md(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, unsigned buf_num)
3381 proto_tree *tree, *ost_tree;
3382 proto_item *item, *lov_item;
3383 unsigned data_len, old_offset, stripe_count, i;
3384 uint32_t magic;
3386 old_offset = offset;
3387 data_len = LUSTRE_BUFFER_LEN(buf_num);
3389 if (data_len == 0)
3390 return offset;
3392 magic = tvb_get_letohl(tvb, offset);
3394 switch (magic) {
3395 case LOV_MAGIC_V1:
3396 item = proto_tree_add_item(parent_tree, hf_lustre_lov_mds_md, tvb, offset, -1, ENC_NA);
3397 tree = proto_item_add_subtree(item, ett_lustre_lov_mds_md);
3398 proto_item_append_text(item, " V1");
3399 break;
3400 case LOV_MAGIC_V3:
3401 item = proto_tree_add_item(parent_tree, hf_lustre_lov_mds_md, tvb, offset, -1, ENC_NA);
3402 tree = proto_item_add_subtree(item, ett_lustre_lov_mds_md);
3403 proto_item_append_text(item, " V3");
3404 break;
3405 case LMV_MAGIC_V1:
3406 case LMV_MAGIC_STRIPE: /* this uses struct lmv_mds_md, but without fids */
3407 return dissect_struct_lmv_mds_md_v1(tvb, pinfo, offset, parent_tree, buf_num);
3408 default:
3409 // This is for speculative processing of LDLM Intent Reply
3410 // IT_LAYOUT, and thus not an error
3411 return display_buffer_data(tvb, pinfo, offset, parent_tree, buf_num, "DLM LVB");
3414 /* struct lov_mds_md_v1 { */
3415 /* uint32 lmm_magic; */
3416 /* uint32 lmm_pattern; */
3417 /* uint64 lmm_object_id; */
3418 /* uint64 lmm_object_seq; */
3419 /* uint32 lmm_stripe_size; */
3420 /* uint16 lmm_stripe_count; */
3421 /* uint16 lmm_layout_gen; */
3422 /* struct lov_ost_data_v1 lmm_objects[0]; <-- en fait on en a lmm_stripe_count */
3423 /* } */
3424 /* struct lov_mds_md_v3 { /\* LOV EA mds/wire data (little-endian) *\/ */
3425 /* __u32 lmm_magic; /\* magic number = LOV_MAGIC_V3 *\/ */
3426 /* __u32 lmm_pattern; /\* LOV_PATTERN_RAID0, LOV_PATTERN_RAID1 *\/ */
3427 /* struct ost_id lmm_oi; /\* LOV object ID *\/ */
3428 /* __u32 lmm_stripe_size; /\* size of stripe in bytes *\/ */
3429 /* /\* lmm_stripe_count used to be __u32 *\/ */
3430 /* __u16 lmm_stripe_count; /\* num stripes in use for this object *\/ */
3431 /* __u16 lmm_layout_gen; /\* layout generation number *\/ */
3432 /* char lmm_pool_name[LOV_MAXPOOLNAME + 1]; /\* must be 32bit aligned *\/ */
3433 /* struct lov_ost_data_v1 lmm_objects[0]; /\* per-stripe data *\/ */
3434 /* }; LOV_MAXPOOLNAME == 15 */
3436 proto_tree_add_item(tree, hf_lustre_lov_mds_md_lmm_magic, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3437 offset += 4;
3438 proto_tree_add_item(tree, hf_lustre_lov_mds_md_lmm_pattern, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3439 offset += 4;
3440 switch (magic) {
3441 case LOV_MAGIC_V1:
3442 proto_tree_add_item(tree, hf_lustre_lov_mds_md_lmm_object_id, tvb, offset, 8, ENC_LITTLE_ENDIAN);
3443 offset += 8;
3444 proto_tree_add_item(tree, hf_lustre_lov_mds_md_lmm_object_seq, tvb, offset, 8, ENC_LITTLE_ENDIAN);
3445 offset += 8;
3446 break;
3447 case LOV_MAGIC_V3:
3448 offset = dissect_struct_ost_id(tvb, offset, tree);
3449 break;
3451 proto_tree_add_item(tree, hf_lustre_lov_mds_md_lmm_stripe_size, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3452 offset += 4;
3453 proto_tree_add_item_ret_uint(tree, hf_lustre_lov_mds_md_lmm_stripe_count, tvb, offset, 2, ENC_LITTLE_ENDIAN, &stripe_count);
3454 offset += 2;
3455 proto_tree_add_item(tree, hf_lustre_lov_mds_md_lmm_layout_gen, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3456 offset += 2;
3457 if (magic == LOV_MAGIC_V3) {
3458 proto_tree_add_item(tree, hf_lustre_lov_mds_md_lmm_pool_name, tvb, offset, 16, ENC_ASCII);
3459 offset += 16;
3462 /* This may happen when, server is just returning the stripe
3463 count, but not the stripe data (ie default stripe_count on a
3464 directory) */
3465 if (data_len-(offset-old_offset) != stripe_count*24)
3466 stripe_count = (data_len-(offset-old_offset))/24;
3468 for (i = 0; i < stripe_count; ++i) {
3469 lov_item = proto_tree_add_item(tree, hf_lustre_lov_ost_data_v1, tvb, offset, 24, ENC_NA);
3470 ost_tree = proto_item_add_subtree(lov_item, ett_lustre_lov_ost_data_v1);
3471 proto_item_append_text(lov_item, " [%u]", i);
3472 offset = dissect_struct_ost_id(tvb, offset, ost_tree);
3473 proto_tree_add_item(ost_tree, hf_lustre_lov_ost_data_v1_l_ost_gen, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3474 offset += 4;
3475 proto_tree_add_item(ost_tree, hf_lustre_lov_ost_data_v1_l_ost_idx, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3476 offset += 4;
3479 if (offset-old_offset != data_len)
3480 expert_add_info(pinfo, tree, &ei_lustre_buflen);
3481 proto_item_set_len(item, data_len);
3482 return offset;
3485 static int
3486 dissect_struct_llog_cookie_array(tvbuff_t *tvb, int offset, proto_tree *parent_tree, unsigned buf_num)
3488 proto_tree *tree;
3489 proto_item *item;
3490 unsigned data_len, i;
3492 data_len = LUSTRE_BUFFER_LEN(buf_num);
3494 for (i = 0; i < data_len/24; ++i) {
3495 item = proto_tree_add_item(parent_tree, hf_lustre_llog_cookie, tvb, offset, 24, ENC_NA);
3496 tree = proto_item_add_subtree(item, ett_lustre_llog_cookie);
3497 proto_item_append_text(item, " [%d]", i);
3499 /* struct llog_cookie { */
3500 /* struct llog_logid lgc_lgl; */
3501 /* __u32 lgc_subsys; */
3502 /* __u32 lgc_index; */
3503 /* __u32 lgc_padding; */
3504 /* } */
3505 /* sizeof(llog_cookie) == 12 + 20 */
3506 offset = dissect_struct_llog_logid(tvb, offset, tree, hf_lustre_llog_cookie_lgc_lgl);
3507 proto_tree_add_item(tree, hf_lustre_llog_cookie_lgc_subsys, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3508 offset += 4;
3509 proto_tree_add_item(tree, hf_lustre_llog_cookie_lgc_index, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3510 offset += 4;
3511 proto_tree_add_item(tree, hf_lustre_llog_cookie_lgc_padding, tvb, offset, 4, ENC_NA);
3512 offset += 4;
3515 return offset;
3518 static int
3519 dissect_struct_mdc_swap_layouts(tvbuff_t *tvb, int offset, proto_tree *parent_tree, unsigned buf_num)
3521 proto_tree *tree;
3522 proto_item *item;
3523 unsigned data_len;
3525 data_len = LUSTRE_BUFFER_LEN(buf_num);
3527 if (data_len == 0)
3528 return offset;
3530 item = proto_tree_add_item(parent_tree, hf_lustre_mdc_swap_layouts, tvb, offset, 8, ENC_NA);
3531 tree = proto_item_add_subtree(item, ett_lustre_mdc_swap_layouts);
3532 /* struct mdc_swap_layouts { */
3533 /* __u64 msl_flags; */
3534 /* } */
3536 proto_tree_add_item(tree, hf_lustre_mdc_swap_layouts_flags, tvb, offset, 8, ENC_LITTLE_ENDIAN);
3537 offset += 8;
3539 return offset;
3542 static int
3543 dissect_struct_hsm_request(tvbuff_t *tvb, int offset, proto_tree *parent_tree)
3545 proto_tree *tree;
3546 proto_item *item;
3548 item = proto_tree_add_item(parent_tree, hf_lustre_hsm_req, tvb, offset, 24, ENC_NA);
3549 tree = proto_item_add_subtree(item, ett_lustre_hsm_request);
3551 /* struct hsm_request { */
3552 /* __u32 hr_action; /\* enum hsm_user_action *\/ */
3553 /* __u32 hr_archive_id; /\* archive id, used only with HUA_ARCHIVE *\/ */
3554 /* __u64 hr_flags; /\* request flags *\/ */
3555 /* __u32 hr_itemcount; /\* item count in hur_user_item vector *\/ */
3556 /* __u32 hr_data_len; */
3557 /* }; */
3559 proto_tree_add_item(tree, hf_lustre_hsm_req_action, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3560 offset += 4;
3561 proto_tree_add_item(tree, hf_lustre_hsm_req_archive_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3562 offset += 4;
3563 proto_tree_add_item(tree, hf_lustre_hsm_req_flags, tvb, offset, 8, ENC_LITTLE_ENDIAN);
3564 offset += 8;
3565 proto_tree_add_item(tree, hf_lustre_hsm_req_itemcount, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3566 offset += 4;
3567 proto_tree_add_item(tree, hf_lustre_hsm_req_data_len, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3568 offset += 4;
3570 return offset;
3573 static int
3574 dissect_struct_hsm_extent(tvbuff_t *tvb, int offset, proto_tree *parent_tree)
3576 proto_tree *tree;
3577 proto_item *item;
3579 item = proto_tree_add_item(parent_tree, hf_lustre_hsm_extent, tvb, offset, 16, ENC_NA);
3580 tree = proto_item_add_subtree(item, ett_lustre_hsm_extent);
3582 proto_tree_add_item(tree, hf_lustre_hsm_extent_offset, tvb, offset, 8, ENC_LITTLE_ENDIAN);
3583 offset += 8;
3584 proto_tree_add_item(tree, hf_lustre_hsm_extent_length, tvb, offset, 8, ENC_LITTLE_ENDIAN);
3585 offset += 8;
3587 return offset;
3590 static int
3591 dissect_struct_hsm_progress(tvbuff_t *tvb, int offset, proto_tree *parent_tree)
3593 proto_tree *tree;
3594 proto_item *item;
3596 item = proto_tree_add_item(parent_tree, hf_lustre_hsm_prog, tvb, offset, 64, ENC_NA);
3597 tree = proto_item_add_subtree(item, ett_lustre_hsm_progress);
3598 /* struct hsm_progress_kernel { */
3599 /* /\* Field taken from struct hsm_progress *\/ */
3600 /* lustre_fid hpk_fid; */
3601 /* __u64 hpk_cookie; */
3602 /* struct hsm_extent hpk_extent; */
3603 /* __u16 hpk_flags; */
3604 /* __u16 hpk_errval; /\* positive val *\/ */
3605 /* __u32 hpk_padding1; */
3606 /* /\* Additional fields *\/ */
3607 /* __u64 hpk_data_version; */
3608 /* __u64 hpk_padding2; */
3609 /* } */
3611 offset = dissect_struct_lu_fid(tvb, offset, tree, hf_lustre_hsm_prog_fid);
3612 proto_tree_add_item(tree, hf_lustre_hsm_prog_cookie, tvb, offset, 8, ENC_LITTLE_ENDIAN);
3613 offset += 8;
3614 offset = dissect_struct_hsm_extent(tvb, offset, tree);
3615 proto_tree_add_item(tree, hf_lustre_hsm_prog_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3616 offset += 2;
3617 proto_tree_add_item(tree, hf_lustre_hsm_prog_errval, tvb, offset, 1, ENC_LITTLE_ENDIAN);
3618 offset += 2;
3619 proto_tree_add_item(tree, hf_lustre_hsm_prog_padding1, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3620 offset += 4;
3621 proto_tree_add_item(tree, hf_lustre_hsm_prog_data_ver, tvb, offset, 8, ENC_LITTLE_ENDIAN);
3622 offset += 8;
3623 proto_tree_add_item(tree, hf_lustre_hsm_prog_padding2, tvb, offset, 8, ENC_LITTLE_ENDIAN);
3624 offset += 8;
3626 return offset;
3629 static int
3630 dissect_struct_hsm_user_state(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, unsigned buf_num)
3632 proto_tree *tree;
3633 proto_item *item;
3634 unsigned data_len;
3636 data_len = LUSTRE_BUFFER_LEN(buf_num);
3637 if (data_len == 0)
3638 return offset;
3640 if (data_len < 32)
3641 expert_add_info_format(pinfo, parent_tree, &ei_lustre_buflen, "Buffer Length expected >= 32 length:%u", data_len);
3643 item = proto_tree_add_item(parent_tree, hf_lustre_hsm_user_state, tvb, offset, data_len, ENC_NA);
3644 tree = proto_item_add_subtree(item, ett_lustre_hsm_user_state);
3645 /* struct hsm_user_state { */
3646 /* /\** Current HSM states, from enum hsm_states. *\/ */
3647 /* __u32 hus_states; */
3648 /* __u32 hus_archive_id; */
3649 /* /\** The current undergoing action, if there is one *\/ */
3650 /* __u32 hus_in_progress_state; */
3651 /* __u32 hus_in_progress_action; */
3652 /* struct hsm_extent hus_in_progress_location; */
3653 /* char hus_extended_info[]; */
3654 /* }; */
3656 proto_tree_add_item(tree, hf_lustre_hsm_us_states, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3657 offset += 4;
3658 proto_tree_add_item(tree, hf_lustre_hsm_us_archive_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3659 offset += 4;
3660 proto_tree_add_item(tree, hf_lustre_hsm_us_in_prog_state, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3661 offset += 4;
3662 proto_tree_add_item(tree, hf_lustre_hsm_us_in_prog_action, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3663 offset += 4;
3664 offset = dissect_struct_hsm_extent(tvb, offset, tree);
3666 data_len -= 32;
3667 if (data_len > 0) {
3668 proto_tree_add_item(tree, hf_lustre_hsm_us_ext_info, tvb, offset, data_len, ENC_NA);
3669 offset += data_len;
3672 return offset;
3675 static int
3676 dissect_struct_hsm_state_set(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, unsigned buf_num)
3678 proto_tree *tree;
3679 proto_item *item;
3680 unsigned data_len;
3682 data_len = LUSTRE_BUFFER_LEN(buf_num);
3683 if (data_len == 0)
3684 return offset;
3686 if (data_len < 24)
3687 expert_add_info_format(pinfo, parent_tree, &ei_lustre_buflen,
3688 "Buffer Length expected >= 24 length:%u", data_len);
3690 item = proto_tree_add_item(parent_tree, hf_lustre_hsm_state_set, tvb, offset, data_len, ENC_NA);
3691 tree = proto_item_add_subtree(item, ett_lustre_hsm_state_set);
3692 /* struct hsm_state_set { */
3693 /* __u32 hss_valid; */
3694 /* __u32 hss_archive_id; */
3695 /* __u64 hss_setmask; */
3696 /* __u64 hss_clearmask; */
3697 /* }; */
3699 proto_tree_add_item(tree, hf_lustre_hsm_hss_valid, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3700 offset += 4;
3701 proto_tree_add_item(tree, hf_lustre_hsm_hss_archive_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3702 offset += 4;
3703 // both of the following are 64-bit ints, but hold a mask that is used with 32-bit ints
3704 // elsewhere
3705 proto_tree_add_item(tree, hf_lustre_hsm_hss_setmask, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3706 offset += 8;
3707 proto_tree_add_item(tree, hf_lustre_hsm_hss_clearmask, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3708 offset += 8;
3710 return offset;
3713 static int
3714 dissect_struct_hsm_user_item_array(tvbuff_t *tvb, int offset, proto_tree *parent_tree, unsigned buf_num)
3716 proto_tree *tree;
3717 proto_item *item;
3718 unsigned data_len, i;
3720 data_len = LUSTRE_BUFFER_LEN(buf_num);
3721 if (data_len == 0)
3722 return offset;
3724 /* struct hsm_user_item { */
3725 /* lustre_fid hui_fid; */
3726 /* struct hsm_extent hui_extent; */
3727 /* } */
3728 /* sizeof(hsm_user_item) == 16+16 */
3730 for (i = 0; i < data_len/32; ++i) {
3731 item = proto_tree_add_item(parent_tree, hf_lustre_hsm_user_item, tvb, offset, 32, ENC_NA);
3732 proto_item_append_text(item, " [%d]", i);
3733 tree = proto_item_add_subtree(item, ett_lustre_hsm_user_item);
3734 offset = dissect_struct_lu_fid(tvb, offset, tree, hf_lustre_hsm_user_item_fid);
3735 offset = dissect_struct_hsm_extent(tvb, offset, tree);
3737 return offset;
3740 static int
3741 dissect_struct_hsm_current_action(tvbuff_t *tvb, int offset, proto_tree *parent_tree, unsigned buf_num)
3743 proto_tree *tree;
3744 proto_item *item;
3745 unsigned data_len;
3747 data_len = LUSTRE_BUFFER_LEN(buf_num);
3748 if (data_len == 0)
3749 return offset;
3751 /* 4+4+16 */
3752 /* struct hsm_current_action { */
3753 /* /\** The current undergoing action, if there is one *\/ */
3754 /* /\* state is one of hsm_progress_states *\/ */
3755 /* __u32 hca_state; */
3756 /* /\* action is one of hsm_user_action *\/ */
3757 /* __u32 hca_action; */
3758 /* struct hsm_extent hca_location; */
3759 /* }; */
3761 item = proto_tree_add_item(parent_tree, hf_lustre_hsm_current_action, tvb, offset, 24, ENC_NA);
3762 tree = proto_item_add_subtree(item, ett_lustre_hsm_current_action);
3763 proto_tree_add_item(tree, hf_lustre_hsm_current_action_state, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3764 offset += 4;
3765 proto_tree_add_item(tree, hf_lustre_hsm_current_action_action, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3766 offset += 4;
3767 offset = dissect_struct_hsm_extent(tvb, offset, tree);
3769 return offset;
3772 static int
3773 dissect_hsm_archive(tvbuff_t *tvb, int offset, proto_tree *parent_tree, unsigned buf_num)
3775 proto_tree *tree;
3776 proto_item *item;
3777 unsigned data_len, i;
3779 data_len = LUSTRE_BUFFER_LEN(buf_num);
3781 item = proto_tree_add_item(parent_tree, hf_lustre_hsm_archive, tvb, offset, data_len, ENC_NA);
3782 tree = proto_item_add_subtree(item, ett_lustre_hsm_archive);
3783 // @@ First item may be count for older clients c.f. lustre/mdt/mdt_hsm.c::mdt_hsm_ct_register()
3784 for (i = 0; i < data_len/4; ++i) {
3785 proto_tree_add_item(tree, hf_lustre_hsm_archive_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3786 offset += 4;
3789 offset = add_extra_padding(tvb, offset, NULL, tree);
3790 return offset;
3794 /********************************************************************
3796 * Out Buffer Structures
3800 static int
3801 dissect_struct_out_update_header(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, unsigned buf_num)
3803 proto_tree *tree, *data_tree;
3804 proto_item *item;
3805 unsigned i, count, magic, length;
3806 int old_offset, data_len;
3808 old_offset = offset;
3810 data_len = LUSTRE_BUFFER_LEN(buf_num);
3811 if (data_len == 0)
3812 return offset;
3814 /* struct out_update_header { */
3815 /* __u32 ouh_magic; */
3816 /* __u32 ouh_count; */
3817 /* __u32 ouh_inline_length; */
3818 /* __u32 ouh_reply_size; */
3819 /* __u32 ouh_inline_data[0]; */
3820 /* }; */
3821 /* SIZE = 20 + inline_length */
3823 item = proto_tree_add_item(parent_tree, hf_lustre_out_update_header, tvb, offset, -1, ENC_NA);
3824 tree = proto_item_add_subtree(item, ett_lustre_out_update_header);
3826 proto_tree_add_item_ret_uint(tree, hf_lustre_out_update_header_magic, tvb, offset, 4, ENC_LITTLE_ENDIAN, &magic);
3827 offset += 4;
3828 if (magic != OUT_UPDATE_HEADER_MAGIC)
3829 expert_add_info(pinfo, tree, &ei_lustre_badmagic);
3830 proto_tree_add_item_ret_uint(tree, hf_lustre_out_update_header_count, tvb, offset, 4, ENC_LITTLE_ENDIAN, &count);
3831 offset += 4;
3832 proto_tree_add_item_ret_uint(tree, hf_lustre_out_update_header_inline_length, tvb, offset, 4, ENC_LITTLE_ENDIAN, &length);
3833 offset += 4;
3834 proto_tree_add_item(tree, hf_lustre_out_update_header_reply_size, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3835 offset += 4;
3837 item = proto_tree_add_item(tree, hf_lustre_out_update_header_inline_data, tvb, offset, length, ENC_NA);
3838 if (length > 0) {
3839 data_tree = proto_item_add_subtree(item, ett_lustre_out_update_header_data);
3840 if (magic == OUT_UPDATE_HEADER_MAGIC) {
3841 /* ouh_inline_data -> array[ouh_count] of struct object_update_request */
3842 for (i = 0; i < count; ++i)
3843 offset = dissect_struct_object_update_request(tvb, offset, pinfo, tree);
3845 // @@ limit size?
3846 if (offset-old_offset != data_len)
3847 expert_add_info(pinfo, tree, &ei_lustre_buflen);
3848 proto_item_set_len(tree, offset-old_offset);
3850 } else {
3851 proto_item_set_len(data_tree, data_len-20);
3852 proto_item_set_len(tree, data_len);
3856 if (data_len > offset-old_offset) {
3857 expert_add_info(pinfo, tree, &ei_lustre_buflen);
3858 offset = old_offset + data_len;
3860 proto_item_set_len(tree, offset-old_offset);
3861 offset = add_extra_padding(tvb, offset, pinfo, parent_tree);
3863 return offset;
3867 static int
3868 dissect_struct_out_update_buffer(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, unsigned buf_num)
3870 proto_tree *tree;
3871 proto_item *item;
3872 unsigned data_len, i;
3873 int old_offset;
3875 old_offset = offset;
3877 data_len = LUSTRE_BUFFER_LEN(buf_num);
3878 if (data_len == 0)
3879 return offset;
3881 /* struct out_update_buffer { */
3882 /* __u32 oub_size; */
3883 /* __u32 oub_padding; */
3884 /* }; */
3886 for (i = 0; i < data_len/8; ++i) {
3887 item = proto_tree_add_item(parent_tree, hf_lustre_out_update_buffer, tvb, offset, 8, ENC_NA);
3888 proto_item_append_text(item, " [%d]", i);
3889 tree = proto_item_add_subtree(item, ett_lustre_out_update_buffer);
3891 proto_tree_add_item(tree, hf_lustre_out_update_buffer_size, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3892 offset += 4;
3893 proto_tree_add_item(tree, hf_lustre_out_update_buffer_padding, tvb, offset, 4, ENC_NA);
3894 offset += 4;
3897 if ((int)data_len != offset-old_offset)
3898 expert_add_info(pinfo, parent_tree, &ei_lustre_buflen);
3900 return offset;
3903 static int
3904 dissect_struct_obj_update_result(tvbuff_t *tvb, int offset, proto_tree *parent_tree)
3906 proto_tree *tree;
3907 proto_item *item;
3908 unsigned data_len;
3909 int old_offset;
3911 old_offset = offset;
3913 /* struct object_update_result { */
3914 /* __u32 our_rc; */
3915 /* __u16 our_datalen; */
3916 /* __u16 our_padding; */
3917 /* __u32 our_data[0]; */
3918 /* }; */
3920 item = proto_tree_add_item(parent_tree, hf_lustre_obj_update_result, tvb, offset, 8, ENC_NA);
3921 tree = proto_item_add_subtree(item, ett_lustre_obj_update_result);
3923 proto_tree_add_item(tree, hf_lustre_obj_update_result_rc, tvb, offset, 4, ENC_LITTLE_ENDIAN);
3924 offset += 4;
3925 proto_tree_add_item_ret_uint(tree, hf_lustre_obj_update_result_datalen, tvb, offset, 2, ENC_LITTLE_ENDIAN, &data_len);
3926 offset += 2;
3927 proto_tree_add_item(tree, hf_lustre_obj_update_result_padding, tvb, offset, 2, ENC_NA);
3928 offset += 2;
3929 proto_tree_add_item(tree, hf_lustre_obj_update_result_data, tvb, offset, data_len, ENC_NA);
3930 offset += data_len;
3932 proto_item_set_len(tree, offset-old_offset);
3933 return offset;
3936 static int
3937 dissect_struct_obj_update_reply(tvbuff_t *tvb, int offset, packet_info * pinfo, proto_tree *parent_tree, unsigned buf_num)
3939 proto_tree *tree;
3940 proto_item *item;
3941 unsigned data_len, i, magic, count;
3942 int old_offset;
3944 data_len = LUSTRE_BUFFER_LEN(buf_num);
3945 if (data_len == 0)
3946 return offset;
3948 old_offset = offset;
3950 /* struct object_update_reply { */
3951 /* __u32 ourp_magic; */
3952 /* __u16 ourp_count; */
3953 /* __u16 ourp_padding; */
3954 /* __u16 ourp_lens[0]; */
3955 /* }; */
3957 item = proto_tree_add_item(parent_tree, hf_lustre_obj_update_reply, tvb, offset, 8, ENC_NA);
3958 tree = proto_item_add_subtree(item, ett_lustre_obj_update_reply);
3960 /* @@ Check V1? */
3961 proto_tree_add_item_ret_uint(tree, hf_lustre_obj_update_reply_magic, tvb, offset, 4, ENC_LITTLE_ENDIAN, &magic);
3962 if (magic != UPDATE_REPLY_MAGIC_V2) /* Currently (Lustre 2.10.2) the default */
3963 expert_add_info(pinfo, tree, &ei_lustre_badmagic);
3964 offset += 4;
3965 proto_tree_add_item_ret_uint(tree, hf_lustre_obj_update_reply_count, tvb, offset, 2, ENC_LITTLE_ENDIAN, &count);
3966 offset += 2;
3967 proto_tree_add_item(tree, hf_lustre_obj_update_reply_padding, tvb, offset, 2, ENC_NA);
3968 offset += 2;
3970 for (i = 0; i < count; ++i) {
3971 item = proto_tree_add_item(tree, hf_lustre_obj_update_reply_lens, tvb, offset, 2, ENC_LITTLE_ENDIAN);
3972 proto_item_append_text(item, " [%d]", i);
3973 offset += 2;
3976 // @@ add check above lengths don't agree with below .our_data_len
3977 for (i = 0; i < count; ++i) {
3978 offset = dissect_struct_obj_update_result(tvb, offset, tree);
3981 if (data_len > (unsigned)(offset-old_offset)) {
3982 expert_add_info(pinfo, tree, &ei_lustre_buflen);
3983 offset = old_offset + data_len;
3985 proto_item_set_len(tree, offset-old_offset);
3986 return offset;
3990 /********************************************************************
3992 * I/O Buffer Structures
3996 static int
3997 dissect_struct_obd_ioobj(tvbuff_t *tvb, int offset, proto_tree *parent_tree, unsigned buf_num)
3999 proto_tree *tree;
4000 proto_item *item;
4001 unsigned data_len, i;
4003 data_len = LUSTRE_BUFFER_LEN(buf_num);
4005 /* struct obd_ioobj { */
4006 /* uint64 ioo_id; */
4007 /* uint64 ioo_seq; */
4008 /* uint32 ioo_max_brw; */
4009 /* uint32 ioo_bufcnt; */
4010 /* } */
4011 /* sizeof(struct obd_ioobj) == 24 */
4013 for (i = 0; i < data_len/24; ++i) {
4014 item = proto_tree_add_item(parent_tree, hf_lustre_obd_ioobj, tvb, offset, 24, ENC_NA);
4015 proto_item_append_text(item, " [%d]", i);
4016 tree = proto_item_add_subtree(item, ett_lustre_obd_ioobj);
4017 proto_tree_add_item(tree, hf_lustre_obd_ioobj_ioo_id, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4018 offset += 8;
4019 proto_tree_add_item(tree, hf_lustre_obd_ioobj_ioo_seq, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4020 offset += 8;
4021 proto_tree_add_item(tree, hf_lustre_obd_ioobj_ioo_max_brw, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4022 offset += 4;
4023 proto_tree_add_item(tree, hf_lustre_obd_ioobj_ioo_bufcnt, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4024 offset += 4;
4027 return offset;
4030 static int
4031 dissect_struct_niobuf_remote(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, unsigned buf_num)
4033 proto_tree *tree;
4034 proto_item *item;
4035 unsigned data_len, i;
4037 data_len = LUSTRE_BUFFER_LEN(buf_num);
4039 /* struct niobuf_remote { */
4040 /* __u64 rnb_offset; */
4041 /* __u32 rnb_len; */
4042 /* __u32 rnb_flags; */
4043 /* }; */
4044 /* sizeof(struct niobuf_remote) == 16 */
4046 for (i = 0; i < data_len/16; ++i) {
4047 item = proto_tree_add_item(parent_tree, hf_lustre_niobuf_remote, tvb, offset, 16, ENC_NA);
4048 proto_item_append_text(item, " [%d]", i);
4049 tree = proto_item_add_subtree(item, ett_lustre_niobuf_remote);
4050 proto_tree_add_item(tree, hf_lustre_niobuf_remote_offset, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4051 offset += 8;
4052 proto_tree_add_item(tree, hf_lustre_niobuf_remote_len, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4053 offset += 4;
4054 proto_tree_add_item(tree, hf_lustre_niobuf_remote_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4055 offset += 4;
4058 offset = add_extra_padding(tvb, offset, pinfo, parent_tree);
4059 return offset;
4062 static int
4063 dissect_rc_array(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, unsigned buf_num)
4065 proto_tree *tree;
4066 proto_item *item;
4067 unsigned data_len, i;
4069 data_len = LUSTRE_BUFFER_LEN(buf_num);
4071 item = proto_tree_add_item(parent_tree, hf_lustre_rcs, tvb, offset, data_len, ENC_NA);
4072 tree = proto_item_add_subtree(item, ett_lustre_rcs);
4073 for (i = 0; i < data_len/4; ++i) {
4074 proto_tree_add_item(tree, hf_lustre_rcs_rc, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4075 offset += 4;
4078 offset = add_extra_padding(tvb, offset, pinfo, tree);
4079 return offset;
4082 static int
4083 dissect_struct_fid_array(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, unsigned buf_num)
4085 proto_tree *tree;
4086 proto_item *item;
4087 unsigned data_len, i, num;
4089 data_len = LUSTRE_BUFFER_LEN(buf_num);
4090 if (data_len == 0)
4091 return offset;
4093 item = proto_tree_add_item(parent_tree, hf_lustre_fid_array, tvb, offset, data_len, ENC_NA);
4094 tree = proto_item_add_subtree(item, ett_lustre_fid_array);
4096 num = data_len/16;
4097 for (i = 0; i < num; ++i) {
4098 offset = dissect_struct_lu_fid(tvb, offset, tree, hf_lustre_fid_array_fid);
4101 offset = add_extra_padding(tvb, offset, pinfo, tree);
4102 return offset;
4105 static int
4106 dissect_struct_quota_body(tvbuff_t *tvb, int offset, proto_tree *parent_tree, unsigned buf_num)
4108 proto_tree *tree;
4109 proto_item *item;
4110 unsigned data_len;
4112 data_len = LUSTRE_BUFFER_LEN(buf_num);
4113 if (data_len == 0)
4114 return offset;
4116 item = proto_tree_add_item(parent_tree, hf_lustre_quota_body, tvb, offset, 104, ENC_NA);
4117 tree = proto_item_add_subtree(item, ett_lustre_quota_body);
4119 /* struct quota_body { */
4120 /* struct lu_fid qb_fid; /\* FID of global index packing the pool ID */
4121 /* * and type (data or metadata) as well as */
4122 /* * the quota type (user or group). *\/ */
4123 /* union lquota_id qb_id; /\* uid or gid or directory FID *\/ */
4124 /* __u32 qb_flags; /\* see below *\/ */
4125 /* __u32 qb_padding; */
4126 /* __u64 qb_count; /\* acquire/release count (kbytes/inodes) *\/ */
4127 /* __u64 qb_usage; /\* current slave usage (kbytes/inodes) *\/ */
4128 /* __u64 qb_slv_ver; /\* slave index file version *\/ */
4129 /* struct lustre_handle qb_lockh; /\* per-ID lock handle *\/ */
4130 /* struct lustre_handle qb_glb_lockh; /\* global lock handle *\/ */
4131 /* __u64 qb_padding1[4]; */
4132 /* }; */
4134 offset = dissect_struct_lu_fid(tvb, offset, tree, hf_lustre_qb_fid);
4135 offset = dissect_struct_lquota_id(tvb, offset, tree);
4136 // @@ Add parsing QUOTA_DQACQ_FL_*
4137 proto_tree_add_item(tree, hf_lustre_qb_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4138 offset += 4;
4139 proto_tree_add_item(tree, hf_lustre_qb_padding, tvb, offset, 4, ENC_NA);
4140 offset += 4;
4141 proto_tree_add_item(tree, hf_lustre_qb_count, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4142 offset += 8;
4143 proto_tree_add_item(tree, hf_lustre_qb_usage, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4144 offset += 8;
4145 proto_tree_add_item(tree, hf_lustre_qb_slv_ver, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4146 offset += 8;
4147 offset = dissect_struct_lustre_handle(tvb, offset, tree, hf_lustre_qb_lockh);
4148 offset = dissect_struct_lustre_handle(tvb, offset, tree, hf_lustre_qb_glb_lockh);
4149 proto_tree_add_item(tree, hf_lustre_qb_padding, tvb, offset, 32, ENC_NA);
4150 offset += 32;
4152 return offset;
4155 static int
4156 dissect_struct_obd_quotactl(tvbuff_t *tvb, int offset, proto_tree *parent_tree)
4158 proto_tree *tree, *sub_tree;
4159 proto_item *item;
4161 item = proto_tree_add_item(parent_tree, hf_lustre_obd_quotactl, tvb, offset, 112, ENC_NA);
4162 tree = proto_item_add_subtree(item, ett_lustre_obd_quotactl);
4164 /* struct obd_quotactl { */
4165 /* __u32 qc_cmd; */
4166 /* __u32 qc_type; /\* see Q_* flag below *\/ */
4167 /* __u32 qc_id; */
4168 /* __u32 qc_stat; */
4169 /* struct obd_dqinfo qc_dqinfo; */
4170 /* struct obd_dqblk qc_dqblk; */
4171 /* sizeof(obd_quotactl) == 16 + 24 + 72 */
4172 /* }; */
4174 proto_tree_add_item(tree, hf_lustre_obd_quotactl_qc_cmd, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4175 offset += 4;
4176 proto_tree_add_item(tree, hf_lustre_obd_quotactl_qc_type, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4177 offset += 4;
4178 proto_tree_add_item(tree, hf_lustre_obd_quotactl_qc_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4179 offset += 4;
4180 proto_tree_add_item(tree, hf_lustre_obd_quotactl_qc_stat, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4181 offset += 4;
4183 item = proto_tree_add_item(parent_tree, hf_lustre_obd_dqinfo, tvb, offset, 24, ENC_NA);
4184 sub_tree = proto_item_add_subtree(item, ett_lustre_obd_dqinfo);
4185 /* struct obd_dqinfo { */
4186 /* __u64 dqi_bgrace; */
4187 /* __u64 dqi_igrace; */
4188 /* __u32 dqi_flags; */
4189 /* __u32 dqi_valid; */
4190 /* }; */
4192 proto_tree_add_item(sub_tree, hf_lustre_obd_dqinfo_dqi_bgrace, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4193 offset += 8;
4194 proto_tree_add_item(sub_tree, hf_lustre_obd_dqinfo_dqi_igrace, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4195 offset += 8;
4196 proto_tree_add_item(sub_tree, hf_lustre_obd_dqinfo_dqi_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4197 offset += 4;
4198 proto_tree_add_item(sub_tree, hf_lustre_obd_dqinfo_dqi_valid, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4199 offset += 4;
4201 item = proto_tree_add_item(parent_tree, hf_lustre_obd_dqblk, tvb, offset, 72, ENC_NA);
4202 sub_tree = proto_item_add_subtree(item, ett_lustre_obd_dqblk);
4203 /* struct obd_dqblk { */
4204 /* __u64 dqb_bhardlimit; */
4205 /* __u64 dqb_bsoftlimit; */
4206 /* __u64 dqb_curspace; */
4207 /* __u64 dqb_ihardlimit; */
4208 /* __u64 dqb_isoftlimit; */
4209 /* __u64 dqb_curinodes; */
4210 /* __u64 dqb_btime; */
4211 /* __u64 dqb_itime; */
4212 /* __u32 dqb_valid; */
4213 /* __u32 dqb_padding; */
4214 /* }; */
4215 proto_tree_add_item(sub_tree, hf_lustre_obd_dqblk_dqb_bhardlimit, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4216 offset += 8;
4217 proto_tree_add_item(sub_tree, hf_lustre_obd_dqblk_dqb_bsoftlimit, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4218 offset += 8;
4219 proto_tree_add_item(sub_tree, hf_lustre_obd_dqblk_dqb_curspace, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4220 offset += 8;
4221 proto_tree_add_item(sub_tree, hf_lustre_obd_dqblk_dqb_ihardlimit, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4222 offset += 8;
4223 proto_tree_add_item(sub_tree, hf_lustre_obd_dqblk_dqb_isoftlimit, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4224 offset += 8;
4225 proto_tree_add_item(sub_tree, hf_lustre_obd_dqblk_dqb_curinodes, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4226 offset += 8;
4227 proto_tree_add_item(sub_tree, hf_lustre_obd_dqblk_dqb_btime, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4228 offset += 8;
4229 proto_tree_add_item(sub_tree, hf_lustre_obd_dqblk_dqb_itime, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4230 offset += 8;
4231 proto_tree_add_item(sub_tree, hf_lustre_obd_dqblk_dqb_valid, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4232 offset += 4;
4233 proto_tree_add_item(sub_tree, hf_lustre_obd_dqblk_padding, tvb, offset, 4, ENC_NA);
4234 offset += 4;
4236 return offset;
4239 static int
4240 dissect_struct_lu_ladvise_hdr(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree)
4242 proto_tree *tree;
4243 proto_item *item;
4244 uint32_t val;
4246 /* struct ladvise_hdr { */
4247 /* __u32 lah_magic; /\* LADVISE_MAGIC *\/ */
4248 /* __u32 lah_count; /\* number of advices *\/ */
4249 /* __u64 lah_flags; /\* from enum ladvise_flag *\/ */
4250 /* __u32 lah_value1; /\* unused *\/ */
4251 /* __u32 lah_value2; /\* unused *\/ */
4252 /* __u64 lah_value3; /\* unused *\/ */
4253 /* struct lu_ladvise lah_advise[0]; /\* advices in this header *\/ */
4254 /* sizeof(ladvise_hdr) == 32 */
4255 /* }; */
4257 item = proto_tree_add_item(parent_tree, hf_lustre_lu_ladvise_hdr, tvb, offset, 32, ENC_NA);
4258 tree = proto_item_add_subtree(item, ett_lustre_ladvise_hdr);
4260 proto_tree_add_item_ret_uint(tree, hf_lustre_lu_ladvise_hdr_magic, tvb, offset, 4, ENC_LITTLE_ENDIAN, &val);
4261 offset += 4;
4262 if (val != LADVISE_MAGIC)
4263 expert_add_info(pinfo, tree, &ei_lustre_badmagic);
4264 proto_tree_add_item(tree, hf_lustre_lu_ladvise_hdr_count, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4265 offset += 4;
4266 proto_tree_add_item(tree, hf_lustre_lu_ladvise_hdr_flags, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4267 offset += 8;
4268 proto_tree_add_item(tree, hf_lustre_lu_ladvise_hdr_value1, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4269 offset += 4;
4270 proto_tree_add_item(tree, hf_lustre_lu_ladvise_hdr_value2, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4271 offset += 4;
4272 proto_tree_add_item(tree, hf_lustre_lu_ladvise_hdr_value3, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4273 offset += 8;
4275 return offset;
4278 static int
4279 dissect_struct_lu_ladvise(tvbuff_t *tvb, int offset, proto_tree *parent_tree)
4281 proto_tree *tree;
4282 proto_item *item;
4284 /* struct ladvise { */
4285 /* __u16 lla_advice; /\* advice type *\/ */
4286 /* __u16 lla_value1; /\* values for different advice types *\/ */
4287 /* __u32 lla_value2; */
4288 /* __u64 lla_start; /\* first byte of extent for advice *\/ */
4289 /* __u64 lla_end; /\* last byte of extent for advice *\/ */
4290 /* __u32 lla_value3; */
4291 /* __u32 lla_value4; */
4292 /* sizeof(ladvise) == 32 */
4293 /* }; */
4295 item = proto_tree_add_item(parent_tree, hf_lustre_lu_ladvise, tvb, offset, 32, ENC_NA);
4296 tree = proto_item_add_subtree(item, ett_lustre_ladvise);
4298 proto_tree_add_item(tree, hf_lustre_lu_ladvise_advice, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4299 offset += 2;
4300 proto_tree_add_item(tree, hf_lustre_lu_ladvise_value1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4301 offset += 2;
4302 proto_tree_add_item(tree, hf_lustre_lu_ladvise_value2, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4303 offset += 4;
4304 proto_tree_add_item(tree, hf_lustre_lu_ladvise_start, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4305 offset += 8;
4306 proto_tree_add_item(tree, hf_lustre_lu_ladvise_end, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4307 offset += 8;
4308 proto_tree_add_item(tree, hf_lustre_lu_ladvise_value3, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4309 offset += 4;
4310 proto_tree_add_item(tree, hf_lustre_lu_ladvise_value4, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4311 offset += 4;
4313 return offset;
4318 /******************************************************************** \
4320 * Main Buffer Structures
4322 \********************************************************************/
4325 * Decode struct ptlrpc and return opcode and pb_type to caller,
4326 * because they're needed to dissect further buffers.
4328 static int
4329 dissect_struct_ptlrpc_body(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int offset, unsigned buf_len,
4330 lustre_trans_t *trans, uint32_t *pb_type)
4332 proto_tree *tree;
4333 proto_item *item;
4334 uint32_t pb_version, opcode, i, old_offset;
4336 old_offset = offset;
4338 item = proto_tree_add_item(parent_tree, hf_lustre_ptlrpc_body_pb, tvb, offset, -1, ENC_NA);
4339 tree = proto_item_add_subtree(item, ett_lustre_ptlrpc_body);
4341 /* struct ptlrpc_body { */
4342 /* struct lustre_handle { */
4343 /* } pb_handle; */
4344 /* uint32 pb_type; */
4345 /* uint32 pb_version; */
4346 /* uint32 pb_opc; */
4347 /* uint32 pb_status; */
4348 /* uint64 pb_last_xid; */
4349 /* uint64 pb_last_seen; */
4350 /* uint64 pb_last_committed; */
4351 /* uint64 pb_transno; */
4352 /* uint32 pb_flags; */
4353 /* uint32 pb_op_flags; */
4354 /* uint32 pb_conn_cnt; */
4355 /* uint32 pb_timeout; */
4356 /* uint32 pb_service_time; */
4357 /* uint32 pb_limit; */
4358 /* uint64 pb_slv; */
4359 /* } */
4360 /* SIZE == 8+80 */
4362 offset = dissect_struct_lustre_handle(tvb, offset, tree, hf_lustre_ptlrpc_body_pb_handle);
4364 proto_tree_add_item_ret_uint(tree, hf_lustre_ptlrpc_body_pb_type, tvb, offset, 4, ENC_LITTLE_ENDIAN, pb_type);
4365 offset += 4;
4367 proto_tree_add_item_ret_uint(tree, hf_lustre_ptlrpc_body_pb_version, tvb, offset, 4, ENC_LITTLE_ENDIAN, &pb_version);
4368 pb_version &= ~LUSTRE_VERSION_MASK;
4369 offset += 4;
4371 proto_tree_add_item_ret_uint(tree, hf_lustre_ptlrpc_body_pb_opc, tvb, offset, 4, ENC_LITTLE_ENDIAN, &opcode);
4372 offset += 4;
4373 if (*pb_type == PTL_RPC_MSG_REQUEST)
4374 trans->opcode = opcode;
4375 else if (trans->opcode != opcode) {
4376 expert_add_info_format(pinfo, tree, &ei_lustre_badopc, "Mismatched: PTLRPC:%s != Conversation:%s (match_bits:%" PRIx64 ")",
4377 val_to_str(opcode, lustre_op_codes, "Unknown(%d)"),
4378 val_to_str(trans->opcode, lustre_op_codes, "Unknown(%d)"), trans->match_bits);
4379 trans->opcode = opcode;
4382 proto_tree_add_item(tree, hf_lustre_ptlrpc_body_pb_status, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4383 offset += 4;
4385 proto_tree_add_item(tree, hf_lustre_ptlrpc_body_pb_last_xid, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4386 offset += 8;
4388 proto_tree_add_item(tree, hf_lustre_ptlrpc_body_pb_last_seen, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4389 offset += 8;
4391 proto_tree_add_item(tree, hf_lustre_ptlrpc_body_pb_last_committed, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4392 offset += 8;
4394 proto_tree_add_item(tree, hf_lustre_ptlrpc_body_pb_transno, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4395 offset += 8;
4397 proto_tree_add_item(tree, hf_lustre_ptlrpc_body_pb_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4398 offset += 4;
4400 proto_tree_add_item(tree, hf_lustre_ptlrpc_body_pb_op_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4401 offset += 4;
4403 proto_tree_add_item(tree, hf_lustre_ptlrpc_body_pb_conn_cnt, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4404 offset += 4;
4406 proto_tree_add_item(tree, hf_lustre_ptlrpc_body_pb_timeout, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4407 offset += 4;
4409 proto_tree_add_item(tree, hf_lustre_ptlrpc_body_pb_service_time, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4410 offset += 4;
4412 proto_tree_add_item(tree, hf_lustre_ptlrpc_body_pb_limit, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4413 offset += 4;
4415 proto_tree_add_item(tree, hf_lustre_ptlrpc_body_pb_slv, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4416 offset += 8;
4418 /* pb_pre_versions */
4419 for(i = 0; i < 4; ++i) {
4420 proto_tree_add_item(tree, hf_lustre_ptlrpc_body_pb_pre_version, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4421 offset += 8;
4424 proto_tree_add_item(tree, hf_lustre_ptlrpc_body_pb_padding, tvb, offset, 32, ENC_NA);
4425 offset += 32;
4427 if (pb_version == LUSTRE_PTLRPC_MSG_VERSION && offset-old_offset < buf_len) {
4428 /* the length of the string is 32 bytes max, with \0 inside */
4429 proto_tree_add_item(tree, hf_lustre_ptlrpc_body_pb_jobid, tvb, offset, 32, ENC_ASCII);
4430 offset+=32;
4434 if (offset-old_offset != buf_len)
4435 expert_add_info(pinfo, , &ei_lustre_buflen);
4437 proto_item_set_len(item, offset-old_offset);
4439 /* Add Opcode and PB Type to info lines */
4440 proto_item_append_text(parent_tree, "%s %s ", val_to_str(opcode, lustre_op_codes, "Unknown(%d)"),
4441 val_to_str(*pb_type, lustre_LMTypes, "Unknown(%d)"));
4442 col_append_fstr(pinfo->cinfo, COL_INFO, "%s %s ", val_to_str(opcode, lustre_op_codes, "Unknown(%d)"),
4443 val_to_str(*pb_type, lustre_LMTypes, "Unknown(%d)"));
4445 //sanity_check(tvb, pinfo, offset-old_offset);
4446 return offset;
4449 static int
4450 dissect_struct_ost_lvb(tvbuff_t *tvb, int offset, proto_tree *parent_tree, uint32_t buf_num)
4452 proto_tree *tree;
4453 proto_item *item;
4454 int data_len;
4456 data_len = LUSTRE_BUFFER_LEN(buf_num);
4457 if (data_len == 0)
4458 return offset;
4460 item = proto_tree_add_item(parent_tree, hf_lustre_ost_lvb, tvb, offset, 56, ENC_NA);
4461 tree = proto_item_add_subtree(item, ett_lustre_ost_lvb);
4463 /* struct ost_lvb { */
4464 /* __u64 lvb_size; */
4465 /* __s64 lvb_mtime; */
4466 /* __s64 lvb_atime; */
4467 /* __s64 lvb_ctime; */
4468 /* __u64 lvb_blocks; */
4469 /* __u32 lvb_mtime_ns; */
4470 /* __u32 lvb_atime_ns; */
4471 /* __u32 lvb_ctime_ns; */
4472 /* __u32 lvb_padding; */
4473 /* }; */
4475 proto_tree_add_item(tree, hf_lustre_ost_lvb_size, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4476 offset += 8;
4477 proto_tree_add_item(tree, hf_lustre_ost_lvb_mtime, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4478 offset += 8;
4479 proto_tree_add_item(tree, hf_lustre_ost_lvb_atime, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4480 offset += 8;
4481 proto_tree_add_item(tree, hf_lustre_ost_lvb_ctime, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4482 offset += 8;
4483 proto_tree_add_item(tree, hf_lustre_ost_lvb_blocks, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4484 offset += 8;
4485 proto_tree_add_item(tree, hf_lustre_ost_lvb_mtime_ns, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4486 offset += 4;
4487 proto_tree_add_item(tree, hf_lustre_ost_lvb_atime_ns, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4488 offset += 4;
4489 proto_tree_add_item(tree, hf_lustre_ost_lvb_ctime_ns, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4490 offset += 4;
4491 proto_tree_add_item(tree, hf_lustre_ost_lvb_padding, tvb, offset, 4, ENC_NA);
4492 offset += 4;
4494 return offset;
4497 static int
4498 dissect_struct_capa(tvbuff_t *tvb, int offset, proto_tree *parent_tree, uint32_t buf_num)
4500 proto_tree *tree;
4501 proto_item *item;
4502 int data_len;
4504 /* struct lustre_capa { */
4505 /* struct lu_fid lc_fid; /\** fid *\/ */
4506 /* __u64 lc_opc; /\** operations allowed *\/ */
4507 /* __u64 lc_uid; /\** file owner *\/ */
4508 /* __u64 lc_gid; /\** file group *\/ */
4509 /* __u32 lc_flags; /\** HMAC algorithm & flags *\/ */
4510 /* __u32 lc_keyid; /\** key# used for the capability *\/ */
4511 /* __u32 lc_timeout; /\** capa timeout value (sec) *\/ */
4512 /* __u32 lc_expiry; /\** expiry time (sec) *\/ */
4513 /* __u8 lc_hmac[CAPA_HMAC_MAX_LEN]; /\** HMAC *\/ */
4514 /* } old_offset = offset; */
4516 data_len = LUSTRE_BUFFER_LEN(buf_num);
4517 if (data_len == 0)
4518 return offset;
4520 item = proto_tree_add_item(parent_tree, hf_lustre_capa, tvb, offset, 120, ENC_NA);
4521 tree = proto_item_add_subtree(item, ett_lustre_capa);
4523 offset = dissect_struct_lu_fid(tvb, offset,tree, hf_lustre_capa_fid);
4524 proto_tree_add_item(tree, hf_lustre_capa_opc, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4525 offset += 8;
4526 proto_tree_add_item(tree, hf_lustre_capa_uid, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4527 offset += 8;
4528 proto_tree_add_item(tree, hf_lustre_capa_gid, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4529 offset += 8;
4530 proto_tree_add_item(tree, hf_lustre_capa_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4531 offset += 4;
4532 proto_tree_add_item(tree, hf_lustre_capa_keyid, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4533 offset += 4;
4534 proto_tree_add_item(tree, hf_lustre_capa_timeout, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4535 offset += 4;
4536 proto_tree_add_item(tree, hf_lustre_capa_expiry, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4537 offset += 4;
4538 /* CAPA_HMAC_MAX_LEN == 64 */
4539 proto_tree_add_item(tree, hf_lustre_capa_hmac, tvb, offset, 64, ENC_NA);
4540 offset += 64;
4542 return offset;
4545 static int
4546 dissect_struct_llogd_body(tvbuff_t *tvb, int offset, proto_tree *parent_tree, uint32_t buf_num)
4548 proto_tree *tree;
4549 proto_item *item;
4550 int data_len;
4551 static int * const flags[] = {
4552 &hf_lustre_llog_hdr_flag_zap_when_empty,
4553 &hf_lustre_llog_hdr_flag_is_cat,
4554 &hf_lustre_llog_hdr_flag_is_plain,
4555 &hf_lustre_llog_hdr_flag_ext_jobid,
4556 &hf_lustre_llog_hdr_flag_is_fixsize,
4557 NULL
4560 data_len = LUSTRE_BUFFER_LEN(buf_num);
4561 if (data_len == 0)
4562 return offset;
4564 item = proto_tree_add_item(parent_tree, hf_lustre_llogd_body, tvb, offset, 48, ENC_NA);
4565 tree = proto_item_add_subtree(item, ett_lustre_llogd_body);
4567 /* struct llogd_body { */
4568 /* struct llog_logid lgd_logid; */
4569 /* __u32 lgd_ctxt_idx; */
4570 /* __u32 lgd_llh_flags; */
4571 /* __u32 lgd_index; */
4572 /* __u32 lgd_saved_index; */
4573 /* __u32 lgd_len; */
4574 /* __u64 lgd_cur_offset; */
4575 /* } */
4576 /* SIZE = 20+28 */
4578 offset = dissect_struct_llog_logid(tvb, offset, tree, hf_lustre_llogd_body_lgd_logid);
4579 proto_tree_add_item(tree, hf_lustre_llogd_body_lgd_ctxt_idx, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4580 offset += 4;
4581 proto_tree_add_bitmask(tree, tvb, offset, hf_lustre_llogd_body_lgd_llh_flags, ett_lustre_llog_hdr_flags, flags, ENC_LITTLE_ENDIAN);
4582 offset += 4;
4583 proto_tree_add_item(tree, hf_lustre_llogd_body_lgd_index, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4584 offset += 4;
4585 proto_tree_add_item(tree, hf_lustre_llogd_body_lgd_saved_index, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4586 offset += 4;
4587 proto_tree_add_item(tree, hf_lustre_llogd_body_lgd_len, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4588 offset += 4;
4589 proto_tree_add_item(tree, hf_lustre_llogd_body_lgd_cur_offset, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4590 offset += 8;
4592 return offset;
4595 static int
4596 dissect_struct_llogd_conn_body(tvbuff_t *tvb, int offset, proto_tree *parent_tree, uint32_t buf_num)
4598 proto_tree *tree;
4599 proto_item *item;
4600 int data_len;
4602 data_len = LUSTRE_BUFFER_LEN(buf_num);
4603 if (data_len == 0)
4604 return offset;
4606 item = proto_tree_add_item(parent_tree, hf_lustre_llogd_conn_body, tvb, offset, 40, ENC_NA);
4607 tree = proto_item_add_subtree(item, ett_lustre_llogd_conn_body);
4609 /* struct llogd_conn_body { */
4610 /* struct llog_gen lgdc_gen; */
4611 /* struct llog_logid lgdc_logid; */
4612 /* __u32 lgdc_ctxt_idx; */
4613 /* } */
4614 /* SIZE == 16+20+4 */
4616 offset = dissect_struct_llog_gen(tvb, offset, tree, hf_lustre_llogd_conn_body_lgdc_gen);
4617 offset = dissect_struct_llog_logid(tvb, offset, tree, hf_lustre_llogd_conn_body_lgdc_logid);
4618 proto_tree_add_item(tree, hf_lustre_llogd_conn_body_lgdc_ctxt_idx, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4619 offset += 4;
4621 return offset;
4624 static int
4625 dissect_struct_llog_log_hdr(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, uint32_t buf_num)
4627 proto_tree *tree;
4628 proto_item *item;
4629 uint32_t len, data_len, old_offset, i;
4631 static int * const flags[] = {
4632 &hf_lustre_llog_hdr_flag_zap_when_empty,
4633 &hf_lustre_llog_hdr_flag_is_cat,
4634 &hf_lustre_llog_hdr_flag_is_plain,
4635 &hf_lustre_llog_hdr_flag_ext_jobid,
4636 &hf_lustre_llog_hdr_flag_is_fixsize,
4637 NULL
4640 data_len = LUSTRE_BUFFER_LEN(buf_num);
4641 if (data_len == 0)
4642 return offset;
4644 old_offset = offset;
4646 item = proto_tree_add_item(parent_tree, hf_lustre_llog_log_hdr, tvb, offset, -1, ENC_NA);
4647 tree = proto_item_add_subtree(item, ett_lustre_llog_log_hdr);
4649 /* struct llog_log_hdr { */
4650 /* struct llog_rec_hdr llh_hdr; */
4651 /* __s64 llh_timestamp; */
4652 /* __u32 llh_count; */
4653 /* __u32 llh_bitmap_offset; */
4654 /* __u32 llh_size; */
4655 /* __u32 llh_flags; */
4656 /* /\* for a catalog the first/oldest and still in-use plain slot is just */
4657 /* * next to it. It will serve as the upper limit after Catalog has */
4658 /* * wrapped around *\/ */
4659 /* __u32 llh_cat_idx; */
4660 /* struct obd_uuid llh_tgtuuid; */
4661 /* __u32 llh_reserved[LLOG_HEADER_SIZE/sizeof(__u32)-23]; */
4662 /* /\* These fields must always be at the end of the llog_log_hdr. */
4663 /* * Note: llh_bitmap size is variable because llog chunk size could be */
4664 /* * bigger than LLOG_MIN_CHUNK_SIZE, i.e. sizeof(llog_log_hdr) > 8192 */
4665 /* * bytes, and the real size is stored in llh_hdr.lrh_len, which means */
4666 /* * llh_tail should only be referred by LLOG_HDR_TAIL(). */
4667 /* * But this structure is also used by client/server llog interface */
4668 /* * (see llog_client.c), it will be kept in its original way to avoid */
4669 /* * compatibility issue. *\/ */
4670 /* __u32 llh_bitmap[LLOG_BITMAP_BYTES / sizeof(__u32)]; */
4671 /* struct llog_rec_tail llh_tail; */
4672 /* } */
4673 /* sizeof(llh_reserved) == 1*sizeof(uint32) */
4674 /* Size = 16+28+40+1+?+8 */
4676 /* llog_rec_hdr.lrh_len is first */
4677 len = tvb_get_letohl(tvb, offset);
4678 if (data_len != len)
4679 expert_add_info_format(pinfo, tree, &ei_lustre_buflen,
4680 "Buffer Length mismatch: buffer:%u !== internal length:%u", data_len, len);
4682 offset = dissect_struct_llog_rec_hdr(tvb, offset, tree, hf_lustre_llog_log_hdr_hdr);
4683 proto_tree_add_item(tree, hf_lustre_llog_log_hdr_timestamp, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4684 offset += 8;
4685 proto_tree_add_item(tree, hf_lustre_llog_log_hdr_count, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4686 offset += 4;
4687 proto_tree_add_item(tree, hf_lustre_llog_log_hdr_bitmap_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4688 offset += 4;
4689 proto_tree_add_item(tree, hf_lustre_llog_log_hdr_size, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4690 offset += 4;
4691 proto_tree_add_bitmask(tree, tvb, offset, hf_lustre_llog_log_hdr_flags, ett_lustre_llog_hdr_flags, flags, ENC_LITTLE_ENDIAN);
4692 offset += 4;
4693 proto_tree_add_item(tree, hf_lustre_llog_log_hdr_cat_idx, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4694 offset += 4;
4695 offset = dissect_struct_obd_uuid(tvb, offset, tree, hf_lustre_llog_log_hdr_tgtuuid);
4696 proto_tree_add_item(tree, hf_lustre_llog_log_hdr_reserved, tvb, offset, 4, ENC_NA);
4697 offset += 4;
4699 /* bitmap size is llh_hdr.lrh_len - current offset - sizeof(llog_rec_tail) */
4700 len -= (offset - old_offset) + 8;
4701 for (i = 0; i < len/4; ++i) {
4702 proto_tree_add_item(tree, hf_lustre_llog_log_hdr_bitmap, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4703 offset += 4;
4706 offset = dissect_struct_llog_rec_tail(tvb, offset, tree, hf_lustre_llog_log_hdr_tail);
4707 proto_item_set_len(tree, offset-old_offset);
4708 return offset;
4711 static int
4712 dissect_struct_idx_info(tvbuff_t *tvb, int offset, proto_tree *parent_tree, uint32_t buf_num)
4714 proto_tree *tree;
4715 proto_item *item;
4716 int data_len;
4718 data_len = LUSTRE_BUFFER_LEN(buf_num);
4719 if (data_len == 0)
4720 return offset;
4722 item = proto_tree_add_item(parent_tree, hf_lustre_idx_info, tvb, offset, 80, ENC_NA);
4723 tree = proto_item_add_subtree(item, ett_lustre_idx_info);
4725 /* struct idx_info { */
4726 /* __u32 ii_magic; */
4727 /* /\* reply: see idx_info_flags below *\/ */
4728 /* __u32 ii_flags; */
4729 /* __u16 ii_count; */
4730 /* __u16 ii_pad0; */
4731 /* __u32 ii_attrs; */
4732 /* /\* request & reply: index file identifier (FID) *\/ */
4733 /* struct lu_fid ii_fid; */
4734 /* /\* reply: version of the index file before starting to walk the index. */
4735 /* * Please note that the version can be modified at any time during the */
4736 /* * transfer *\/ */
4737 /* __u64 ii_version; */
4738 /* /\* request: hash to start with: */
4739 /* * reply: hash of the first entry of the first lu_idxpage and hash */
4740 /* * of the entry to read next if any *\/ */
4741 /* __u64 ii_hash_start; */
4742 /* __u64 ii_hash_end; */
4743 /* /\* reply: size of keys in lu_idxpages, minimal one if II_FL_VARKEY is */
4744 /* * set *\/ */
4745 /* __u16 ii_keysize; */
4746 /* /\* reply: size of records in lu_idxpages, minimal one if II_FL_VARREC */
4747 /* * is set *\/ */
4748 /* __u16 ii_recsize; */
4749 /* __u32 ii_pad1; */
4750 /* __u64 ii_pad2; */
4751 /* __u64 ii_pad3; */
4752 /* }; */
4753 /* SIZE = 64+16 */
4755 proto_tree_add_item(tree, hf_lustre_idx_info_magic, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4756 offset += 4;
4757 proto_tree_add_item(tree, hf_lustre_idx_info_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4758 offset += 4;
4759 proto_tree_add_item(tree, hf_lustre_idx_info_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4760 offset += 2;
4761 proto_tree_add_item(tree, hf_lustre_idx_info_padding, tvb, offset, 2, ENC_NA);
4762 offset += 2;
4763 proto_tree_add_item(tree, hf_lustre_idx_info_attrs, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4764 offset += 4;
4765 offset = dissect_struct_lu_fid(tvb, offset,tree, hf_lustre_idx_info_fid);
4766 proto_tree_add_item(tree, hf_lustre_idx_info_hash_start, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4767 offset += 8;
4768 proto_tree_add_item(tree, hf_lustre_idx_info_hash_end, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4769 offset += 8;
4770 proto_tree_add_item(tree, hf_lustre_idx_info_keysize, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4771 offset += 2;
4772 proto_tree_add_item(tree, hf_lustre_idx_info_recsize, tvb, offset, 2, ENC_LITTLE_ENDIAN);
4773 offset += 2;
4774 proto_tree_add_item(tree, hf_lustre_idx_info_padding, tvb, offset, 12, ENC_NA);
4775 offset += 12;
4777 return offset;
4780 static int
4781 dissect_struct_ldlm_intent(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, lustre_trans_t *trans, uint32_t buf_num)
4783 //proto_tree *tree;
4784 uint32_t data_len;
4786 static int * const flags[] = {
4787 &hf_lustre_ldlm_intent_opc_open,
4788 &hf_lustre_ldlm_intent_opc_creat,
4789 &hf_lustre_ldlm_intent_opc_readdir,
4790 &hf_lustre_ldlm_intent_opc_getattr,
4791 &hf_lustre_ldlm_intent_opc_lookup,
4792 &hf_lustre_ldlm_intent_opc_unlink,
4793 &hf_lustre_ldlm_intent_opc_trunc,
4794 &hf_lustre_ldlm_intent_opc_getxattr,
4795 &hf_lustre_ldlm_intent_opc_exec,
4796 &hf_lustre_ldlm_intent_opc_pin,
4797 &hf_lustre_ldlm_intent_opc_layout,
4798 &hf_lustre_ldlm_intent_opc_q_dqacq,
4799 &hf_lustre_ldlm_intent_opc_q_conn,
4800 &hf_lustre_ldlm_intent_opc_setxattr,
4801 NULL
4804 data_len = LUSTRE_BUFFER_LEN(buf_num);
4805 if (data_len == 0)
4806 return offset;
4808 if (data_len != 8)
4809 expert_add_info(pinfo, parent_tree, &ei_lustre_buflen);
4811 trans->sub_opcode = tvb_get_letoh64(tvb, offset);
4812 proto_tree_add_bitmask(parent_tree, tvb, offset, hf_lustre_ldlm_intent_opc, ett_lustre_ldlm_intent_opc, flags, ENC_LITTLE_ENDIAN);
4813 offset += 8;
4815 col_append_str(pinfo->cinfo, COL_INFO, "[ intent:");
4816 if (trans->sub_opcode & IT_OPEN )
4817 col_append_str(pinfo->cinfo, COL_INFO, " open");
4818 if (trans->sub_opcode & IT_CREAT )
4819 col_append_str(pinfo->cinfo, COL_INFO, " create");
4820 if (trans->sub_opcode & IT_READDIR )
4821 col_append_str(pinfo->cinfo, COL_INFO, " readdir");
4822 if (trans->sub_opcode & IT_GETATTR )
4823 col_append_str(pinfo->cinfo, COL_INFO, " getattr");
4824 if (trans->sub_opcode & IT_LOOKUP )
4825 col_append_str(pinfo->cinfo, COL_INFO, " lookup");
4826 if (trans->sub_opcode & IT_UNLINK )
4827 col_append_str(pinfo->cinfo, COL_INFO, " unlink");
4828 if (trans->sub_opcode & IT_TRUNC )
4829 col_append_str(pinfo->cinfo, COL_INFO, " trunc");
4830 if (trans->sub_opcode & IT_GETXATTR)
4831 col_append_str(pinfo->cinfo, COL_INFO, " getxattr");
4832 if (trans->sub_opcode & IT_EXEC )
4833 col_append_str(pinfo->cinfo, COL_INFO, " exec");
4834 if (trans->sub_opcode & IT_PIN )
4835 col_append_str(pinfo->cinfo, COL_INFO, " pin");
4836 if (trans->sub_opcode & IT_LAYOUT )
4837 col_append_str(pinfo->cinfo, COL_INFO, " layout");
4838 if (trans->sub_opcode & IT_QUOTA_DQACQ)
4839 col_append_str(pinfo->cinfo, COL_INFO, " quota_dqacq");
4840 if (trans->sub_opcode & IT_QUOTA_CONN )
4841 col_append_str(pinfo->cinfo, COL_INFO, " quota_conn");
4842 if (trans->sub_opcode & IT_SETXATTR )
4843 col_append_str(pinfo->cinfo, COL_INFO, " setxattr");
4844 col_append_str(pinfo->cinfo, COL_INFO, " ] ");
4846 return offset;
4849 static int
4850 dissect_struct_quota_adjust_qunit(tvbuff_t *tvb, int offset, proto_tree *parent_tree, uint32_t buf_num)
4852 proto_tree *tree;
4853 proto_item *item;
4854 int data_len;
4856 data_len = LUSTRE_BUFFER_LEN(buf_num);
4857 if (data_len == 0)
4858 return offset;
4860 item = proto_tree_add_item(parent_tree, hf_lustre_quota_adjust_qunit, tvb, offset, 32, ENC_NA);
4861 tree = proto_item_add_subtree(item, ett_lustre_quota_adjust_qunit);
4863 /* struct quota_adjust_qunit { */
4864 /* __u32 qaq_flags; */
4865 /* __u32 qaq_id; */
4866 /* __u64 qaq_bunit_sz; */
4867 /* __u64 qaq_iunit_sz; */
4868 /* __u64 padding1; */
4869 /* }; */
4871 proto_tree_add_item(tree, hf_lustre_quota_adjust_qunit_qaq_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4872 offset += 4;
4873 proto_tree_add_item(tree, hf_lustre_quota_adjust_qunit_qaq_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4874 offset += 4;
4875 proto_tree_add_item(tree, hf_lustre_quota_adjust_qunit_qaq_bunit_sz, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4876 offset += 8;
4877 proto_tree_add_item(tree, hf_lustre_quota_adjust_qunit_qaq_iunit_sz, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4878 offset += 8;
4879 proto_tree_add_item(tree, hf_lustre_quota_adjust_qunit_padding1, tvb, offset, 8, ENC_LITTLE_ENDIAN);
4880 offset += 8;
4882 return offset;
4885 static int
4886 dissect_xattr_buffers(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *parent_tree, uint32_t buff_num)
4888 /* ldlm_intent_getxattr_server : [eadata][eavals][eavals_lens] *
4889 * array length == sizeof(eavals_lens)/sizeof(uint32)
4890 * Buff 1: NAME - array of strings (name of xattr)
4891 * Buff 2: DATA - array of data (data of xattr)
4892 * Buff 3: LEN - array of data lengths (in buff 2)
4894 int count, i;
4895 int namestart, namelen, datastart, datalen, lenstart, lenlen;
4896 int nameoffset, dataoffset, lenoffset;
4897 proto_tree *tree, *xattr_tree;
4898 proto_item *item;
4900 namelen = LUSTRE_BUFFER_LEN(buff_num);
4901 datalen = LUSTRE_BUFFER_LEN(buff_num+1);
4902 lenlen = LUSTRE_BUFFER_LEN(buff_num+2);
4904 count = lenlen / 4;
4906 namestart = nameoffset = offset;
4907 datastart = namestart + namelen;
4908 datastart += buffer_padding_length(datastart);
4909 dataoffset = datastart;
4910 lenstart = datastart + datalen;
4911 lenstart += buffer_padding_length(lenstart);
4912 lenoffset = lenstart;
4914 item = proto_tree_add_item(parent_tree, hf_lustre_xattr_list, tvb, offset, -1, ENC_NA);
4915 xattr_tree = proto_item_add_subtree(item, ett_lustre_xattrs);
4917 offset = display_buffer_data(tvb, pinfo, offset, xattr_tree, buff_num, "NAMES");
4918 offset = display_buffer_data(tvb, pinfo, offset, xattr_tree, buff_num+1, "DATA");
4919 offset = display_buffer_data(tvb, pinfo, offset, xattr_tree, buff_num+2, "LENS");
4921 for (i = 0; i < count; ++i) {
4922 int namesize;
4923 int datasize;
4925 datasize = tvb_get_letohl(tvb, lenoffset);
4927 namesize = tvb_strnlen(tvb, nameoffset, namelen - (nameoffset - namestart))+1;
4929 item = proto_tree_add_item(xattr_tree, hf_lustre_xattr, tvb, nameoffset, namesize, ENC_NA);
4930 tree = proto_item_add_subtree(item, ett_lustre_xattr_item);
4932 //@@ Add name to text
4933 proto_item_append_text(item, " [%d]", i);
4934 proto_tree_add_item(tree, hf_lustre_xattr_name, tvb, nameoffset, namesize, ENC_ASCII);
4935 nameoffset += namesize;
4937 proto_tree_add_item(tree, hf_lustre_xattr_data, tvb, dataoffset, datasize, ENC_NA);
4938 dataoffset += datasize;
4940 proto_tree_add_item(tree, hf_lustre_xattr_size, tvb, lenoffset, 4, ENC_LITTLE_ENDIAN);
4941 lenoffset += 4;
4944 offset += buffer_padding_length(offset);
4945 proto_item_set_len(xattr_tree, offset-namestart);
4946 return offset;
4949 static int
4950 dissect_struct_barrier_lvb(tvbuff_t *tvb, int offset, proto_tree *parent_tree, uint32_t buf_num)
4952 proto_tree *tree;
4953 proto_item *item;
4954 int data_len;
4956 data_len = LUSTRE_BUFFER_LEN(buf_num);
4957 if (data_len == 0)
4958 return offset;
4960 item = proto_tree_add_item(parent_tree, hf_lustre_barrier_lvb, tvb, offset, 16, ENC_NA);
4961 tree = proto_item_add_subtree(item, ett_lustre_barrier_lvb);
4963 /* struct barrier_lvb { */
4964 /* __u32 lvb_status; */
4965 /* __u32 lvb_index; */
4966 /* __u64 lvb_padding; */
4967 /* }; */
4969 proto_tree_add_item(tree, hf_lustre_barrier_lvb_status, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4970 offset += 4;
4971 proto_tree_add_item(tree, hf_lustre_barrier_lvb_index, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4972 offset += 4;
4973 proto_tree_add_item(tree, hf_lustre_barrier_lvb_padding, tvb, offset, 8, ENC_NA);
4974 offset += 8;
4976 return offset;
4979 static int
4980 dissect_struct_eadata(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, uint32_t buf_num)
4982 uint32_t data_len;
4984 data_len = LUSTRE_BUFFER_LEN(buf_num);
4985 if (data_len == 0)
4986 return offset;
4988 proto_tree_add_item(parent_tree, hf_lustre_eadata, tvb, offset, data_len, ENC_NA);
4989 offset += data_len;
4991 offset = add_extra_padding(tvb, offset, pinfo, parent_tree);
4993 return offset;
4996 static int
4997 dissect_struct_layout_intent(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, uint32_t buf_num)
4999 proto_tree *tree;
5000 proto_item *item;
5001 uint32_t data_len;
5003 data_len = LUSTRE_BUFFER_LEN(buf_num);
5004 if (data_len == 0)
5005 return offset;
5007 item = proto_tree_add_item(parent_tree, hf_lustre_layout_intent, tvb, offset, 24, ENC_NA);
5008 tree = proto_item_add_subtree(item, ett_lustre_layout_intent);
5010 if (data_len != 24)
5011 expert_add_info_format(pinfo, tree, &ei_lustre_buflen,
5012 "Buffer Length mismatch: expected:24 !== length:%u", data_len);
5014 /* struct layout_intent { */
5015 /* __u32 li_opc; /\* intent operation for enqueue, read, write etc *\/ */
5016 /* __u32 li_flags; */
5017 /* __u64 li_start; */
5018 /* __u64 li_end; */
5019 /* } */
5020 proto_tree_add_item(tree, hf_lustre_layout_intent_opc, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5021 offset += 4;
5022 proto_tree_add_item(tree, hf_lustre_layout_intent_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5023 offset += 4;
5024 proto_tree_add_item(tree, hf_lustre_layout_intent_start, tvb, offset, 8, ENC_LITTLE_ENDIAN);
5025 offset += 8;
5026 proto_tree_add_item(tree, hf_lustre_layout_intent_end, tvb, offset, 8, ENC_LITTLE_ENDIAN);
5027 offset += 8;
5029 return offset;
5032 static int
5033 dissect_struct_ost_body(tvbuff_t *tvb, int offset, proto_tree *parent_tree)
5035 proto_tree *tree;
5036 proto_item *item;
5037 int old_offset;
5039 old_offset = offset;
5041 /* struct ost_body { */
5042 /* struct obdo oa; */
5043 /* }; */
5045 item = proto_tree_add_item(parent_tree, hf_lustre_ost_body, tvb, offset, -1, ENC_NA);
5046 tree = proto_item_add_subtree(item, ett_lustre_ost_body);
5048 offset = dissect_struct_obdo(tvb, offset, tree);
5050 proto_item_set_len(tree, offset-old_offset);
5051 return offset;
5054 static int
5055 dissect_struct_mdt_body(tvbuff_t *tvb, int offset, proto_tree *parent_tree, uint32_t buf_num)
5057 proto_tree *tree;
5058 proto_item *item;
5059 uint32_t data_len;
5061 data_len = LUSTRE_BUFFER_LEN(buf_num);
5062 if (data_len == 0)
5063 return offset;
5065 item = proto_tree_add_item(parent_tree, hf_lustre_mdt_body, tvb, offset, 216, ENC_NA);
5066 tree = proto_item_add_subtree(item, ett_lustre_mdt_body);
5067 /* struct mdt_body { */
5068 /* struct lu_fid { } fid1; */
5069 /* struct lu_fid { } fid2; */
5070 /* struct lustre_handle { } handle; */
5071 /* uint64 valid; */
5072 /* uint64 size; */
5073 /* uint64 mtime; */
5074 /* uint64 atime; */
5075 /* uint64 ctime; */
5076 /* uint64 blocks; */
5077 /* uint64 ioepoch; mbo_version in 2.11+ */
5078 /* uint64 ino; t_state in 2.4+ */
5079 /* uint32 fsuid; */
5080 /* uint32 fsgid; */
5081 /* uint32 capability; */
5082 /* uint32 mode; */
5083 /* uint32 uid; */
5084 /* uint32 gid; */
5085 /* uint32 flags; */
5086 /* uint32 rdev; */
5087 /* uint32 nlink; */
5088 /* uint32 generation; layout_gen in 2.4+ */
5089 /* uint32 suppgid; */
5090 /* uint32 eadatasize; */
5091 /* uint32 aclsize; */
5092 /* uint32 max_mdsize; */
5093 /* uint32 max_cookiesize; unused in 2.8+ */
5094 /* uint32 uid_h; */
5095 /* uint32 gid_h; */
5096 /* uint32 projid; */
5097 /* uint64 dom_size; */
5098 /* uint64 dom_blocks; */
5099 /* uint64 btime; */
5100 /* uint64 padding_9; */
5101 /* uint64 padding_10; */
5102 /* } */
5104 offset = dissect_struct_lu_fid(tvb, offset, tree, hf_lustre_mdt_body_fid1);
5105 offset = dissect_struct_lu_fid(tvb, offset, tree, hf_lustre_mdt_body_fid2);
5106 offset = dissect_struct_lustre_handle(tvb, offset, tree, hf_lustre_mdt_body_handle);
5107 // @@ make into bitmap of OBD_MD_FL*
5108 proto_tree_add_item(tree, hf_lustre_mdt_body_valid, tvb, offset, 8, ENC_LITTLE_ENDIAN);
5109 offset += 8;
5110 proto_tree_add_item(tree, hf_lustre_mdt_body_size, tvb, offset, 8, ENC_LITTLE_ENDIAN);
5111 offset += 8;
5112 proto_tree_add_item(tree, hf_lustre_mdt_body_mtime, tvb, offset, 8, ENC_LITTLE_ENDIAN);
5113 offset += 8;
5114 proto_tree_add_item(tree, hf_lustre_mdt_body_atime, tvb, offset, 8, ENC_LITTLE_ENDIAN);
5115 offset += 8;
5116 proto_tree_add_item(tree, hf_lustre_mdt_body_ctime, tvb, offset, 8, ENC_LITTLE_ENDIAN);
5117 offset += 8;
5118 proto_tree_add_item(tree, hf_lustre_mdt_body_blocks, tvb, offset, 8, ENC_LITTLE_ENDIAN);
5119 offset += 8;
5120 proto_tree_add_item(tree, hf_lustre_mdt_body_ioepoch, tvb, offset, 8, ENC_LITTLE_ENDIAN);
5121 offset += 8;
5122 proto_tree_add_item(tree, hf_lustre_mdt_body_ino, tvb, offset, 8, ENC_LITTLE_ENDIAN);
5123 offset += 8;
5124 proto_tree_add_item(tree, hf_lustre_mdt_body_fsuid, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5125 offset += 4;
5126 proto_tree_add_item(tree, hf_lustre_mdt_body_fsgid, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5127 offset += 4;
5128 proto_tree_add_item(tree, hf_lustre_mdt_body_capability, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5129 offset += 4;
5130 proto_tree_add_item(tree, hf_lustre_mdt_body_mode, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5131 offset += 4;
5132 proto_tree_add_item(tree, hf_lustre_mdt_body_uid, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5133 offset += 4;
5134 proto_tree_add_item(tree, hf_lustre_mdt_body_gid, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5135 offset += 4;
5136 proto_tree_add_item(tree, hf_lustre_mdt_body_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5137 offset += 4;
5138 proto_tree_add_item(tree, hf_lustre_mdt_body_rdev, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5139 offset += 4;
5140 proto_tree_add_item(tree, hf_lustre_mdt_body_nlink, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5141 offset += 4;
5142 proto_tree_add_item(tree, hf_lustre_mdt_body_generation, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5143 offset += 4;
5144 proto_tree_add_item(tree, hf_lustre_mdt_body_suppgid, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5145 offset += 4;
5146 proto_tree_add_item(tree, hf_lustre_mdt_body_eadatasize, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5147 offset += 4;
5148 proto_tree_add_item(tree, hf_lustre_mdt_body_aclsize, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5149 offset += 4;
5150 proto_tree_add_item(tree, hf_lustre_mdt_body_max_mdsize, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5151 offset += 4;
5152 proto_tree_add_item(tree, hf_lustre_mdt_body_max_cookiesize, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5153 offset += 4;
5154 proto_tree_add_item(tree, hf_lustre_mdt_body_uid_h, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5155 offset += 4;
5156 proto_tree_add_item(tree, hf_lustre_mdt_body_gid_h, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5157 offset += 4;
5158 proto_tree_add_item(tree, hf_lustre_mdt_body_projid, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5159 offset += 4;
5160 proto_tree_add_item(tree, hf_lustre_mdt_body_dom_size, tvb, offset, 8, ENC_LITTLE_ENDIAN);
5161 offset += 8;
5162 proto_tree_add_item(tree, hf_lustre_mdt_body_dom_blocks, tvb, offset, 8, ENC_LITTLE_ENDIAN);
5163 offset += 8;
5164 proto_tree_add_item(tree, hf_lustre_mdt_body_btime, tvb, offset, 8, ENC_LITTLE_ENDIAN);
5165 offset += 8;
5166 proto_tree_add_item(tree, hf_lustre_mdt_body_padding_9, tvb, offset, 8, ENC_LITTLE_ENDIAN);
5167 offset += 8;
5168 proto_tree_add_item(tree, hf_lustre_mdt_body_padding_10, tvb, offset, 8, ENC_LITTLE_ENDIAN);
5169 offset += 8;
5171 return offset;
5174 static int
5175 dissect_struct_obd_statfs(tvbuff_t *tvb, int offset, proto_tree *parent_tree)
5177 proto_tree *tree;
5178 proto_item *item;
5179 uint32_t i;
5181 item = proto_tree_add_item(parent_tree, hf_lustre_obd_statfs, tvb, offset, 144, ENC_NA);
5182 tree = proto_item_add_subtree(item, ett_lustre_obd_statfs);
5184 /* struct obd_statfs { */
5185 /* __u64 os_type; */
5186 /* __u64 os_blocks; */
5187 /* __u64 os_bfree; */
5188 /* __u64 os_bavail; */
5189 /* __u64 os_files; */
5190 /* __u64 os_ffree; */
5191 /* __u8 os_fsid[40]; */
5192 /* __u32 os_bsize; */
5193 /* __u32 os_namelen; */
5194 /* __u64 os_maxbytes; */
5195 /* __u32 os_state; /\**< obd_statfs_state OS_STATE_* flag *\/ */
5196 /* __u32 os_fprecreated; */
5197 /* __u32 os_granted; */
5198 /* __u32 os_spare3; */
5199 /* __u32 os_spare4; */
5200 /* __u32 os_spare5; */
5201 /* __u32 os_spare6; */
5202 /* __u32 os_spare7; */
5203 /* __u32 os_spare8; */
5204 /* __u32 os_spare9; */
5205 /* }; */
5207 proto_tree_add_item(tree, hf_lustre_obd_statfs_os_type, tvb, offset, 8, ENC_LITTLE_ENDIAN);
5208 offset += 8;
5209 proto_tree_add_item(tree, hf_lustre_obd_statfs_os_blocks, tvb, offset, 8, ENC_LITTLE_ENDIAN);
5210 offset += 8;
5211 proto_tree_add_item(tree, hf_lustre_obd_statfs_os_bfree, tvb, offset, 8, ENC_LITTLE_ENDIAN);
5212 offset += 8;
5213 proto_tree_add_item(tree, hf_lustre_obd_statfs_os_bavail, tvb, offset, 8, ENC_LITTLE_ENDIAN);
5214 offset += 8;
5215 proto_tree_add_item(tree, hf_lustre_obd_statfs_os_files, tvb, offset, 8, ENC_LITTLE_ENDIAN);
5216 offset += 8;
5217 proto_tree_add_item(tree, hf_lustre_obd_statfs_os_ffree, tvb, offset, 8, ENC_LITTLE_ENDIAN);
5218 offset += 8;
5219 proto_tree_add_item(tree, hf_lustre_obd_statfs_os_fsid, tvb, offset, 40, ENC_ASCII);
5220 offset += 40;
5221 proto_tree_add_item(tree, hf_lustre_obd_statfs_os_bsize, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5222 offset += 4;
5223 proto_tree_add_item(tree, hf_lustre_obd_statfs_os_namelen, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5224 offset += 4;
5225 proto_tree_add_item(tree, hf_lustre_obd_statfs_os_maxbytes, tvb, offset, 8, ENC_LITTLE_ENDIAN);
5226 offset += 8;
5227 proto_tree_add_item(tree, hf_lustre_obd_statfs_os_state, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5228 offset += 4;
5229 proto_tree_add_item(tree, hf_lustre_obd_statfs_os_fprecreated, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5230 offset += 4;
5231 proto_tree_add_item(tree, hf_lustre_obd_statfs_os_granted, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5232 offset += 4;
5234 for (i = 2; i <= 8; ++i) {
5235 proto_tree_add_item(tree, hf_lustre_obd_statfs_os_spare, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5236 offset += 4;
5239 return offset;
5242 static int
5243 dissect_struct_obd_connect_data(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *parent_tree)
5245 proto_tree *tree;
5246 proto_item *item;
5247 uint32_t version;
5248 int old_offset, len;
5250 old_offset = offset;
5251 item = proto_tree_add_item(parent_tree, hf_lustre_obd_connect_data, tvb, offset, -1, ENC_NA);
5252 tree = proto_item_add_subtree(item, ett_lustre_obd_connect_data);
5254 /* struct obd_connect_data { */
5255 /* __u64 ocd_connect_flags; /\* OBD_CONNECT_* per above *\/ */
5256 /* __u32 ocd_version; /\* lustre release version number *\/ */
5257 /* __u32 ocd_grant; /\* initial cache grant amount (bytes) *\/ */
5258 /* __u32 ocd_index; /\* LOV index to connect to *\/ */
5259 /* __u32 ocd_brw_size; /\* Maximum BRW size in bytes *\/ */
5260 /* __u64 ocd_ibits_known; /\* inode bits this client understands *\/ */
5261 /* __u8 ocd_grant_blkbits; /\* log2 of the backend filesystem blocksize *\/ */
5262 /* __u8 ocd_grant_inobits; /\* log2 of the per-inode space consumption *\/ */
5263 /* __u16 ocd_grant_tax_kb; /\* extent insertion overhead, in 1K blocks *\/ */
5264 /* __u32 ocd_grant_max_blks;/\* maximum number of blocks per extent *\/ */
5265 /* __u64 ocd_transno; /\* first transno from client to be replayed *\/ */
5266 /* __u32 ocd_group; /\* MDS group on OST *\/ */
5267 /* __u32 ocd_cksum_types; /\* supported checksum algorithms *\/ */
5268 /* __u32 ocd_max_easize; /\* How big LOV EA can be on MDS *\/ */
5269 /* __u32 ocd_instance; /\* instance # of this target *\/ */
5270 /* __u64 ocd_maxbytes; /\* Maximum stripe size in bytes *\/ */
5271 /* /\* Fields after ocd_maxbytes are only accessible by the receiver */
5272 /* * if the corresponding flag in ocd_connect_flags is set. Accessing */
5273 /* * any field after ocd_maxbytes on the receiver without a valid flag */
5274 /* * may result in out-of-bound memory access and kernel oops. *\/ */
5275 /* __u16 ocd_maxmodrpcs; /\* Maximum modify RPCs in parallel *\/ */
5276 /* __u16 padding0; /\* added 2.1.0. also fix lustre_swab_connect *\/ */
5277 /* __u32 padding1; /\* added 2.1.0. also fix lustre_swab_connect *\/ */
5278 /* __u64 ocd_connect_flags2; */
5279 /* __u64 padding3; /\* added 2.1.0. also fix lustre_swab_connect *\/ */
5280 /* __u64 padding4; /\* added 2.1.0. also fix lustre_swab_connect *\/ */
5281 /* __u64 padding5; /\* added 2.1.0. also fix lustre_swab_connect *\/ */
5282 /* __u64 padding6; /\* added 2.1.0. also fix lustre_swab_connect *\/ */
5283 /* __u64 padding7; /\* added 2.1.0. also fix lustre_swab_connect *\/ */
5284 /* __u64 padding8; /\* added 2.1.0. also fix lustre_swab_connect *\/ */
5285 /* __u64 padding9; /\* added 2.1.0. also fix lustre_swab_connect *\/ */
5286 /* __u64 paddingA; /\* added 2.1.0. also fix lustre_swab_connect *\/ */
5287 /* __u64 paddingB; /\* added 2.1.0. also fix lustre_swab_connect *\/ */
5288 /* __u64 paddingC; /\* added 2.1.0. also fix lustre_swab_connect *\/ */
5289 /* __u64 paddingD; /\* added 2.1.0. also fix lustre_swab_connect *\/ */
5290 /* __u64 paddingE; /\* added 2.1.0. also fix lustre_swab_connect *\/ */
5291 /* __u64 paddingF; /\* added 2.1.0. also fix lustre_swab_connect *\/ */
5292 /* }; */
5294 proto_tree_add_item(tree, hf_lustre_obd_connect_data_ocd_connect_flags, tvb, offset, 8, ENC_LITTLE_ENDIAN);
5295 offset += 8;
5296 proto_tree_add_item_ret_uint(tree, hf_lustre_obd_connect_data_ocd_version, tvb, offset, 4, ENC_LITTLE_ENDIAN, &version);
5297 offset += 4;
5298 proto_tree_add_item(tree, hf_lustre_obd_connect_data_ocd_grant, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5299 offset += 4;
5300 proto_tree_add_item(tree, hf_lustre_obd_connect_data_ocd_index, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5301 offset += 4;
5302 proto_tree_add_item(tree, hf_lustre_obd_connect_data_ocd_brw_size, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5303 offset += 4;
5304 proto_tree_add_item(tree, hf_lustre_obd_connect_data_ocd_ibits_known, tvb, offset, 8, ENC_LITTLE_ENDIAN);
5305 offset += 8;
5306 if (version < 0x02013900) { /* changed between 2.1.56 and 2.1.57 (a pre 2.2 tag) */
5307 /* uint32 ocd_nllu; */
5308 /* uint32 ocd_nllg; */
5309 proto_tree_add_item(tree, hf_lustre_obd_connect_data_ocd_nllu, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5310 offset += 4;
5311 proto_tree_add_item(tree, hf_lustre_obd_connect_data_ocd_nllg, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5312 offset += 4;
5313 } else if (version < 0x02083300) { /* changed for 2.8.51 */
5314 /* __u8 ocd_blocksize; /\* log2 of the backend filesystem blocksize *\/ */
5315 /* __u8 ocd_inodespace; /\* log2 of the per-inode space consumption *\/ */
5316 /* __u16 ocd_grant_extent; /\* per-extent grant overhead, in 1K blocks *\/ */
5317 /* __u32 ocd_unused; /\* also fix lustre_swab_connect *\/ */
5318 proto_tree_add_item(tree, hf_lustre_obd_connect_data_ocd_grant_blkbits, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5319 offset += 1;
5320 proto_tree_add_item(tree, hf_lustre_obd_connect_data_ocd_grant_inobits, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5321 offset += 1;
5322 proto_tree_add_item(tree, hf_lustre_obd_connect_data_ocd_grant_tax_kb, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5323 offset += 2;
5324 proto_tree_add_item(tree, hf_lustre_obd_connect_data_ocd_padding, tvb, offset, 4, ENC_NA);
5325 offset += 4;
5327 } else {
5328 proto_tree_add_item(tree, hf_lustre_obd_connect_data_ocd_grant_blkbits, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5329 offset += 1;
5330 proto_tree_add_item(tree, hf_lustre_obd_connect_data_ocd_grant_inobits, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5331 offset += 1;
5332 proto_tree_add_item(tree, hf_lustre_obd_connect_data_ocd_grant_tax_kb, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5333 offset += 2;
5334 proto_tree_add_item(tree, hf_lustre_obd_connect_data_ocd_grant_max_blks, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5335 offset += 4;
5337 proto_tree_add_item(tree, hf_lustre_obd_connect_data_ocd_transno, tvb, offset, 8, ENC_LITTLE_ENDIAN);
5338 offset += 8;
5339 proto_tree_add_item(tree, hf_lustre_obd_connect_data_ocd_group, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5340 offset += 4;
5341 proto_tree_add_item(tree, hf_lustre_obd_connect_data_ocd_cksum_types, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5342 offset += 4;
5343 /* the following show up in 2.1.0, 2.2.0, and 2.1.0 respectively */
5344 proto_tree_add_item(tree, hf_lustre_obd_connect_data_ocd_max_easize, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5345 offset += 4;
5346 proto_tree_add_item(tree, hf_lustre_obd_connect_data_ocd_instance, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5347 offset += 4;
5348 proto_tree_add_item(tree, hf_lustre_obd_connect_data_ocd_maxbytes, tvb, offset, 8, ENC_LITTLE_ENDIAN);
5349 offset += 8;
5350 /* Rest of fields were added in 2.1.0 */
5351 if (version >= 0x02010000) {
5352 proto_tree_add_item(tree, hf_lustre_obd_connect_data_ocd_maxmodrpcs, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5353 offset += 2;
5354 proto_tree_add_item(tree, hf_lustre_obd_connect_data_ocd_padding, tvb, offset, 6, ENC_NA);
5355 offset += 6;
5356 proto_tree_add_item(tree, hf_lustre_obd_connect_data_ocd_connect_flags2, tvb, offset, 8, ENC_LITTLE_ENDIAN);
5357 offset += 8;
5359 // Padding runs padding3 through paddingF
5360 len = (0x10-3)*8;
5361 proto_tree_add_item(tree, hf_lustre_obd_connect_data_ocd_padding, tvb, offset, len, ENC_NA);
5362 offset += len;
5365 proto_item_set_len(item, offset-old_offset);
5366 return offset;
5369 static int
5370 dissect_struct_lfsck_request(tvbuff_t *tvb, int offset, proto_tree *parent_tree, uint32_t buf_num)
5372 proto_tree *tree;
5373 proto_item *item;
5374 int data_len;
5375 uint32_t valid;
5377 data_len = LUSTRE_BUFFER_LEN(buf_num);
5378 if (data_len == 0)
5379 return offset;
5381 item = proto_tree_add_item(parent_tree, hf_lustre_lfsck_request, tvb, offset, 96, ENC_NA);
5382 tree = proto_item_add_subtree(item, ett_lustre_lfsck_request);
5384 /* struct lfsck_request { */
5385 /* __u32 lr_event; */
5386 /* __u32 lr_index; */
5387 /* __u32 lr_flags; */
5388 /* __u32 lr_valid; */
5389 /* union { */
5390 /* __u32 lr_speed; */
5391 /* __u32 lr_status; */
5392 /* }; */
5393 /* __u16 lr_version; */
5394 /* __u16 lr_active; */
5395 /* __u16 lr_param; */
5396 /* __u16 lr_async_windows; */
5397 /* __u32 lr_flags2; */
5398 /* struct lu_fid lr_fid; */
5399 /* struct lu_fid lr_fid2; */
5400 /* __u32 lr_comp_id; */
5401 /* __u32 lr_padding_0; */
5402 /* __u64 lr_padding_1; */
5403 /* __u64 lr_padding_2; */
5404 /* __u64 lr_padding_3; */
5405 /* }; */
5406 /* SIZE = 64+2*16 */
5408 proto_tree_add_item(tree, hf_lustre_lfsck_request_event, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5409 offset += 4;
5410 proto_tree_add_item(tree, hf_lustre_lfsck_request_index, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5411 offset += 4;
5412 /* @@ bitmap of lfsck_event_flags */
5413 proto_tree_add_item(tree, hf_lustre_lfsck_request_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5414 offset += 4;
5415 /* @@ bitmap of lfsk_start_valid */
5416 proto_tree_add_item_ret_uint(tree, hf_lustre_lfsck_request_valid, tvb, offset, 4, ENC_LITTLE_ENDIAN, &valid);
5417 offset += 4;
5418 /* determine union based on lr_valid */
5419 if (valid & LSV_SPEED_LIMIT)
5420 proto_tree_add_item(tree, hf_lustre_lfsck_request_speed, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5421 else
5422 proto_tree_add_item(tree, hf_lustre_lfsck_request_status, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5423 offset += 4;
5424 proto_tree_add_item(tree, hf_lustre_lfsck_request_version, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5425 offset += 2;
5426 proto_tree_add_item(tree, hf_lustre_lfsck_request_active, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5427 offset += 2;
5428 proto_tree_add_item(tree, hf_lustre_lfsck_request_param, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5429 offset += 2;
5430 proto_tree_add_item(tree, hf_lustre_lfsck_request_async_windows, tvb, offset, 2, ENC_LITTLE_ENDIAN);
5431 offset += 2;
5432 /* @@ bitmap of lfsck_flags */
5433 proto_tree_add_item(tree, hf_lustre_lfsck_request_flags2, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5434 offset += 4;
5435 offset = dissect_struct_lu_fid(tvb, offset, tree, hf_lustre_lfsck_request_fid);
5436 offset = dissect_struct_lu_fid(tvb, offset, tree, hf_lustre_lfsck_request_fid2);
5437 proto_tree_add_item(tree, hf_lustre_lfsck_request_comp_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5438 offset += 4;
5439 proto_tree_add_item(tree, hf_lustre_lfsck_request_padding, tvb, offset, 28, ENC_NA);
5440 offset += 28;
5442 return offset;
5445 static int
5446 dissect_struct_lfsck_reply(tvbuff_t *tvb, int offset, proto_tree *parent_tree, uint32_t buf_num)
5448 proto_tree *tree;
5449 proto_item *item;
5450 int data_len;
5452 data_len = LUSTRE_BUFFER_LEN(buf_num);
5453 if (data_len == 0)
5454 return offset;
5456 item = proto_tree_add_item(parent_tree, hf_lustre_lfsck_reply, tvb, offset, 16, ENC_NA);
5457 tree = proto_item_add_subtree(item, ett_lustre_lfsck_reply);
5459 proto_tree_add_item(tree, hf_lustre_lfsck_reply_status, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5460 offset += 4;
5461 proto_tree_add_item(tree, hf_lustre_lfsck_reply_padding, tvb, offset, 4, ENC_NA);
5462 offset += 4;
5463 proto_tree_add_item(tree, hf_lustre_lfsck_reply_repaired, tvb, offset, 8, ENC_LITTLE_ENDIAN);
5464 offset += 8;
5466 return offset;
5469 static int
5470 dissect_llog_eadata(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *parent_tree, uint32_t buf_num)
5472 proto_tree *tree;
5473 proto_item *item;
5474 uint32_t data_len, opcode, len, old_offset;
5476 data_len = LUSTRE_BUFFER_LEN(buf_num);
5477 if (data_len == 0)
5478 return offset;
5480 /* EADATA in question is an llog record (see lustre/utils/llog_reader.c::print_records()),
5481 * and lustre/obdclass/llog_swab.c::lustre_swab_llog_rec() */
5482 /* All llog_*_rec structs start with llog_rec_hdr */
5484 // First element of llog_rec_hdr is record length
5485 while ((len = tvb_get_letohl(tvb, offset)) > 0) {
5486 opcode = tvb_get_letohl(tvb, offset+8);
5488 old_offset = offset;
5489 switch (opcode) {
5490 case LLOG_PAD_MAGIC:
5491 len = tvb_get_letohl(tvb, offset);
5492 item = proto_tree_add_item(parent_tree, hf_lustre_llog_rec, tvb, offset, len, ENC_NA);
5493 tree = proto_item_add_subtree(item, ett_lustre_llog_rec);
5494 offset = dissect_struct_llog_rec_hdr(tvb, offset, tree, hf_lustre_llog_rec_hdr);
5495 offset = add_extra_padding(tvb, offset, pinfo, tree);
5496 /* no internal data */
5497 offset = dissect_struct_llog_rec_tail(tvb, offset, tree, hf_lustre_llog_rec_tail);
5498 break;
5499 case OST_SZ_REC:
5500 item = proto_tree_add_item(parent_tree, hf_lustre_llog_size_change_rec, tvb, offset, 64, ENC_NA);
5501 tree = proto_item_add_subtree(item, ett_lustre_llog_size_change_rec);
5502 /* struct llog_size_change_rec { */
5503 /* struct llog_rec_hdr lsc_hdr; */
5504 /* struct ll_fid lsc_fid; */
5505 /* __u32 lsc_ioepoch; */
5506 /* __u32 lsc_padding1; */
5507 /* __u64 lsc_padding2; */
5508 /* __u64 lsc_padding3; */
5509 /* struct llog_rec_tail lsc_tail; */
5510 /* } SIZE = 16+16+24+8 */
5511 offset = dissect_struct_llog_rec_hdr(tvb, offset, tree, hf_lustre_llog_size_change_rec_hdr);
5512 offset = dissect_struct_lu_fid(tvb, offset, tree, hf_lustre_llog_size_change_rec_fid);
5513 proto_tree_add_item(tree, hf_lustre_llog_size_change_rec_io_epoch, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5514 offset += 4;
5515 proto_tree_add_item(tree, hf_lustre_llog_size_change_rec_padding, tvb, offset, 20, ENC_NA);
5516 offset += 20;
5517 offset = dissect_struct_llog_rec_tail(tvb, offset, tree, hf_lustre_llog_size_change_rec_tail);
5518 break;
5519 case OST_RAID1_REC:
5520 /* Obsolete, never used */
5521 offset = dissect_struct_llog_rec_hdr(tvb, offset, parent_tree, hf_lustre_llog_rec_hdr);
5522 expert_add_info(pinfo, parent_tree, &ei_lustre_badopc);
5523 expert_add_info(pinfo, parent_tree, &ei_lustre_obsopc);
5524 break;
5525 case MDS_UNLINK_REC:
5526 item = proto_tree_add_item(parent_tree, hf_lustre_llog_unlink_rec, tvb, offset, 40, ENC_NA);
5527 tree = proto_item_add_subtree(item, ett_lustre_llog_unlink_rec);
5528 /* struct llog_unlink_rec { */
5529 /* struct llog_rec_hdr lur_hdr; */
5530 /* __u64 lur_oid; */
5531 /* __u32 lur_oseq; */
5532 /* __u32 lur_count; */
5533 /* struct llog_rec_tail lur_tail; */
5534 /* } SIZE = 16+16+8 */
5535 /* Obsolete after 2.5.0 */
5536 expert_add_info(pinfo, tree, &ei_lustre_obsopc);
5537 offset = dissect_struct_llog_rec_hdr(tvb, offset, tree, hf_lustre_llog_unlink_rec_hdr);
5538 proto_tree_add_item(tree, hf_lustre_llog_unlink_rec_oid, tvb, offset, 8, ENC_LITTLE_ENDIAN);
5539 offset += 8;
5540 proto_tree_add_item(tree, hf_lustre_llog_unlink_rec_oseq, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5541 offset += 4;
5542 proto_tree_add_item(tree, hf_lustre_llog_unlink_rec_count, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5543 offset += 4;
5544 offset = dissect_struct_llog_rec_tail(tvb, offset, tree, hf_lustre_llog_unlink_rec_tail);
5545 break;
5546 case MDS_UNLINK64_REC:
5547 item = proto_tree_add_item(parent_tree, hf_lustre_llog_unlink64_rec, tvb, offset, 60, ENC_NA);
5548 tree = proto_item_add_subtree(item, ett_lustre_llog_unlink64_rec);
5549 /* struct llog_unlink64_rec { */
5550 /* struct llog_rec_hdr lur_hdr; */
5551 /* struct lu_fid lur_fid; */
5552 /* __u32 lur_count; /\* to destroy the lost precreated *\/ */
5553 /* __u32 lur_padding1; */
5554 /* __u64 lur_padding2; */
5555 /* __u64 lur_padding3; */
5556 /* struct llog_rec_tail lur_tail; */
5557 /* } SIZE = 16+16+20+8 */
5558 offset = dissect_struct_llog_rec_hdr(tvb, offset, tree, hf_lustre_llog_unlink64_rec_hdr);
5559 offset = dissect_struct_lu_fid(tvb, offset, tree, hf_lustre_llog_unlink64_rec_fid);
5560 proto_tree_add_item(tree, hf_lustre_llog_unlink64_rec_count, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5561 offset += 4;
5562 proto_tree_add_item(tree, hf_lustre_llog_unlink64_rec_padding, tvb, offset, 20, ENC_NA);
5563 offset += 20;
5564 offset = dissect_struct_llog_rec_tail(tvb, offset, tree, hf_lustre_llog_unlink64_rec_tail);
5565 break;
5566 case MDS_SETATTR_REC:
5567 item = proto_tree_add_item(parent_tree, hf_lustre_llog_setattr_rec, tvb, offset, 40, ENC_NA);
5568 tree = proto_item_add_subtree(item, ett_lustre_llog_setattr_rec);
5569 /* Obsolete since 1.8.0 */
5570 expert_add_info(pinfo, tree, &ei_lustre_obsopc);
5571 /* struct llog_setattr_rec { */
5572 /* struct llog_rec_hdr lsr_hdr; */
5573 /* __u64 lsr_oid; */
5574 /* __u32 lsr_oseq; */
5575 /* __u32 lsr_uid; */
5576 /* __u32 lsr_gid; */
5577 /* __u32 lsr_padding; */
5578 /* struct llog_rec_tail lsr_tail; */
5579 /* } SIZE = 16+16+8 */
5580 offset = dissect_struct_llog_rec_hdr(tvb, offset, tree, hf_lustre_llog_setattr_rec_hdr);
5581 proto_tree_add_item(tree, hf_lustre_llog_setattr_rec_oid, tvb, offset, 8, ENC_LITTLE_ENDIAN);
5582 offset += 8;
5583 proto_tree_add_item(tree, hf_lustre_llog_setattr_rec_oseq, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5584 offset += 4;
5585 proto_tree_add_item(tree, hf_lustre_llog_setattr_rec_uid, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5586 offset += 4;
5587 proto_tree_add_item(tree, hf_lustre_llog_setattr_rec_gid, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5588 offset += 4;
5589 proto_tree_add_item(tree, hf_lustre_llog_setattr_rec_padding, tvb, offset, 4, ENC_NA);
5590 offset += 4;
5591 offset = dissect_struct_llog_rec_tail(tvb, offset, tree, hf_lustre_llog_setattr_rec_tail);
5592 break;
5593 case MDS_SETATTR64_REC:
5594 item = proto_tree_add_item(parent_tree, hf_lustre_llog_setattr64_rec, tvb, offset, 60, ENC_NA);
5595 tree = proto_item_add_subtree(item, ett_lustre_llog_setattr64_rec);
5596 /* struct llog_setattr64_rec { */
5597 /* struct llog_rec_hdr lsr_hdr; */
5598 /* struct ost_id lsr_oi; */
5599 /* __u32 lsr_uid; */
5600 /* __u32 lsr_uid_h; */
5601 /* __u32 lsr_gid; */
5602 /* __u32 lsr_gid_h; */
5603 /* __u64 lsr_valid; */
5604 /* struct llog_rec_tail lsr_tail; */
5605 /* } */
5606 offset = dissect_struct_llog_rec_hdr(tvb, offset, tree, hf_lustre_llog_setattr64_rec_hdr);
5607 offset = dissect_struct_ost_id(tvb, offset, tree);
5608 proto_tree_add_item(tree, hf_lustre_llog_setattr64_rec_uid, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5609 offset += 4;
5610 proto_tree_add_item(tree, hf_lustre_llog_setattr64_rec_uid_h, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5611 offset += 4;
5612 proto_tree_add_item(tree, hf_lustre_llog_setattr64_rec_gid, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5613 offset += 4;
5614 proto_tree_add_item(tree, hf_lustre_llog_setattr64_rec_gid_h, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5615 offset += 4;
5616 proto_tree_add_item(tree, hf_lustre_llog_setattr64_rec_valid, tvb, offset, 4, ENC_NA);
5617 offset += 4;
5618 offset = dissect_struct_llog_rec_tail(tvb, offset, tree, hf_lustre_llog_setattr64_rec_tail);
5619 break;
5620 case OBD_CFG_REC:
5621 /* struct llog_rec_hdr
5622 * struct lustre_cfg
5623 * struct llog_rec_tail
5625 len = tvb_get_letohl(tvb, offset);
5626 item = proto_tree_add_item(parent_tree, hf_lustre_llog_rec, tvb, offset, len, ENC_NA);
5627 tree = proto_item_add_subtree(item, ett_lustre_llog_rec);
5628 offset = dissect_struct_llog_rec_hdr(tvb, offset, tree, hf_lustre_llog_rec_hdr);
5629 offset = dissect_struct_lustre_cfg(tvb, offset, tree);
5630 offset = dissect_struct_llog_rec_tail(tvb, offset, tree, hf_lustre_llog_rec_tail);
5631 break;
5632 case PTL_CFG_REC:
5633 /* Obsolete in 1.4.0 */
5634 dissect_struct_llog_rec_hdr(tvb, offset, parent_tree, hf_lustre_llog_rec_hdr);
5635 expert_add_info(pinfo, parent_tree, &ei_lustre_obsopc);
5636 offset = dissect_struct_eadata(tvb, offset, pinfo, parent_tree, buf_num);
5637 break;
5638 case LLOG_GEN_REC:
5639 /* struct llog_gen_rec { */
5640 /* struct llog_rec_hdr lgr_hdr; */
5641 /* struct llog_gen lgr_gen; */
5642 /* __u64 padding1; */
5643 /* __u64 padding2; */
5644 /* __u64 padding3; */
5645 /* struct llog_rec_tail lgr_tail; */
5646 /* }; 16+16+24+8 */
5647 item = proto_tree_add_item(parent_tree, hf_lustre_llog_gen_rec, tvb, offset, 64, ENC_NA);
5648 tree = proto_item_add_subtree(item, ett_lustre_llog_gen_rec);
5649 offset = dissect_struct_llog_rec_hdr(tvb, offset, tree, hf_lustre_llog_gen_rec_hdr);
5650 offset = dissect_struct_llog_gen(tvb, offset, tree, hf_lustre_llog_gen_rec_gen);
5651 proto_tree_add_item(tree, hf_lustre_llog_gen_rec_padding, tvb, offset, 24, ENC_NA);
5652 offset += 24;
5653 offset = dissect_struct_llog_rec_tail(tvb, offset, tree, hf_lustre_llog_gen_rec_tail);
5654 break;
5655 case LLOG_JOIN_REC:
5656 /* Obsolete in 1.8.0 */
5657 offset = dissect_struct_llog_rec_hdr(tvb, offset, parent_tree, hf_lustre_llog_rec_hdr);
5658 expert_add_info(pinfo, parent_tree, &ei_lustre_obsopc);
5659 offset = dissect_struct_eadata(tvb, offset, pinfo, parent_tree, buf_num);
5660 break;
5661 case CHANGELOG_REC:
5662 len = tvb_get_letohl(tvb, offset);
5663 item = proto_tree_add_item(parent_tree, hf_lustre_llog_changelog_rec, tvb, offset, len, ENC_NA);
5664 tree = proto_item_add_subtree(item, ett_lustre_llog_changelog_rec);
5665 /* struct llog_changelog_rec { */
5666 /* struct llog_rec_hdr cr_hdr; */
5667 /* struct changelog_rec cr; /\**< Variable length field *\/ */
5668 /* struct llog_rec_tail cr_do_not_use; /\**< for_sizeof_only *\/ */
5669 /* } 16+cr+8 */
5670 offset = dissect_struct_llog_rec_hdr(tvb, offset, tree, hf_lustre_llog_changelog_rec_hdr);
5671 offset = dissect_struct_changelog_rec(tvb, offset, tree);
5672 offset = dissect_struct_llog_rec_tail(tvb, offset, tree, hf_lustre_llog_changelog_rec_tail);
5673 break;
5674 case CHANGELOG_USER_REC:
5675 /* struct llog_changelog_user_rec { */
5676 /* struct llog_rec_hdr cur_hdr; */
5677 /* __u32 cur_id; */
5678 /* __u32 cur_padding; */
5679 /* __u64 cur_endrec; */
5680 /* struct llog_rec_tail cur_tail; */
5681 /* } */
5682 //@@ HERE
5683 dissect_struct_llog_rec_hdr(tvb, offset, parent_tree, hf_lustre_llog_rec_hdr);
5684 offset = dissect_struct_eadata(tvb, offset, pinfo, parent_tree, buf_num);
5685 break;
5686 case HSM_AGENT_REC:
5687 /* struct llog_agent_req_rec { */
5688 /* struct llog_rec_hdr arr_hdr; /\**< record header *\/ */
5689 /* __u32 arr_status; /\**< status of the request *\/ */
5690 /* /\* must match enum */
5691 /* * agent_req_status *\/ */
5692 /* __u32 arr_archive_id; /\**< backend archive number *\/ */
5693 /* __u64 arr_flags; /\**< req flags *\/ */
5694 /* __u64 arr_compound_id; /\**< compound cookie *\/ */
5695 /* __u64 arr_req_create; /\**< req. creation time *\/ */
5696 /* __u64 arr_req_change; /\**< req. status change time *\/ */
5697 /* struct hsm_action_item arr_hai; /\**< req. to the agent *\/ */
5698 /* struct llog_rec_tail arr_tail; /\**< record tail for_sizezof_only *\/ */
5699 /* } */
5700 dissect_struct_llog_rec_hdr(tvb, offset, parent_tree, hf_lustre_llog_rec_hdr);
5701 offset = dissect_struct_eadata(tvb, offset, pinfo, parent_tree, buf_num);
5702 //@@ HERE
5703 break;
5704 case UPDATE_REC:
5705 /* struct llog_update_record { */
5706 /* struct llog_rec_hdr lur_hdr; */
5707 /* struct update_records lur_update_rec; */
5708 /* /\* Note ur_update_rec has a variable size, so comment out */
5709 /* * the following ur_tail, in case someone use it directly */
5710 /* * */
5711 /* * struct llog_rec_tail lur_tail; */
5712 /* *\/ */
5713 /* }; */
5714 dissect_struct_llog_rec_hdr(tvb, offset, parent_tree, hf_lustre_llog_rec_hdr);
5715 offset = dissect_struct_eadata(tvb, offset, pinfo, parent_tree, buf_num);
5716 //@@ HERE
5717 break;
5718 case LLOG_HDR_MAGIC:
5719 offset = dissect_struct_llog_log_hdr(tvb, offset, pinfo, parent_tree, buf_num);
5720 break;
5721 case LLOG_LOGID_MAGIC:
5722 /* struct llog_logid_rec { */
5723 /* struct llog_rec_hdr lid_hdr; */
5724 /* struct llog_logid lid_id; */
5725 /* __u32 lid_padding1; */
5726 /* __u64 lid_padding2; */
5727 /* __u64 lid_padding3; */
5728 /* struct llog_rec_tail lid_tail; */
5729 /* } */
5730 item = proto_tree_add_item(parent_tree, hf_lustre_llog_logid_rec, tvb, offset, len, ENC_NA);
5731 tree = proto_item_add_subtree(item, ett_lustre_llog_logid_rec);
5732 offset = dissect_struct_llog_rec_hdr(tvb, offset, parent_tree, hf_lustre_llog_logid_rec_hdr);
5733 offset = dissect_struct_llog_logid(tvb, offset, tree, hf_lustre_llog_logid_rec_id);
5734 proto_tree_add_item(tree, hf_lustre_llog_logid_rec_padding, tvb, offset, 12, ENC_NA);
5735 offset += 12;
5736 offset = dissect_struct_llog_rec_tail(tvb, offset, tree, hf_lustre_llog_logid_rec_tail);
5737 break;
5738 default:
5739 expert_add_info_format(pinfo, parent_tree, &ei_lustre_badopc, "UNKNOWN LLOG REC Type: %u", opcode);
5740 break;
5743 if (offset-old_offset != len) {
5744 expert_add_info_format(pinfo, parent_tree, &ei_lustre_buflen,
5745 "LLOG REC: Bad Parse Length (opc:%u len:%u parsed:%d)", opcode, len, (offset-old_offset));
5746 offset = old_offset + len;
5747 break;
5751 offset = add_extra_padding(tvb, offset, pinfo, parent_tree);
5752 return offset;
5755 static int
5756 dissect_generic_connect(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
5758 /* [targetuuid][clientuuid][lustre_handle][obd_connect_data] */
5759 offset = dissect_struct_obd_uuid(tvb, offset, tree, hf_lustre_target_uuid);
5760 offset = dissect_struct_obd_uuid(tvb, offset, tree, hf_lustre_client_uuid);
5761 offset = dissect_struct_lustre_handle(tvb, offset, tree, hf_lustre_lustre_handle);
5762 offset = dissect_struct_obd_connect_data(tvb, offset, pinfo, tree);
5764 return offset;
5767 /******************************************************************** \
5769 * OPCODE Processing
5771 * decode these via lustre/ptlrpc/layout.c
5773 \********************************************************************/
5775 static int
5776 process_opcode_ost(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, lustre_trans_t *trans, uint32_t pb_type)
5778 switch (trans->opcode){
5779 case OST_REPLY: /* obsolete so nothing */
5780 break;
5781 case OST_GETATTR:
5782 case OST_SETATTR:
5783 case OST_PUNCH:
5784 case OST_SYNC:
5785 /* REQ: [OST_BODY][CAPA]
5786 * REP: [OST_BODY] */
5787 offset = dissect_struct_ost_body(tvb, offset, tree);
5788 if (pb_type == PTL_RPC_MSG_REQUEST)
5789 offset = dissect_struct_capa(tvb, offset, tree, LUSTRE_REC_OFF+1);
5790 break;
5792 case OST_READ: /* OST_BRW_READ */
5793 /* REQ: [OST_BODY][[obd_ioobj]][[niobuf_remote]][capa]
5794 * REP: [OST_BODY] */
5795 offset = dissect_struct_ost_body(tvb, offset, tree);
5796 if (pb_type == PTL_RPC_MSG_REQUEST) {
5797 offset = dissect_struct_obd_ioobj(tvb, offset, tree, LUSTRE_REC_OFF+1);
5798 offset = dissect_struct_niobuf_remote(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+2);
5799 offset = dissect_struct_capa(tvb, offset, tree, LUSTRE_REC_OFF+3);
5801 break;
5803 case OST_WRITE: /* OST_BRW_WRITE */
5804 /* REQ: [OST_BODY][[obd_ioobj]][[niobuf_remote]][capa]
5805 * REP: [OST_BODY][RCS] */
5806 offset = dissect_struct_ost_body(tvb, offset, tree);
5807 if (pb_type == PTL_RPC_MSG_REQUEST) {
5808 // @@ iooobj.buf_count determines number of niobufs
5809 // niobuf have BUFFERS after them
5810 offset = dissect_struct_obd_ioobj(tvb, offset, tree, LUSTRE_REC_OFF+1);
5811 offset = dissect_struct_niobuf_remote(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+2);
5812 offset = dissect_struct_capa(tvb, offset, tree, LUSTRE_REC_OFF+3);
5814 if (pb_type == PTL_RPC_MSG_REPLY)
5815 offset = dissect_rc_array(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+1);
5816 break;
5818 case OST_CREATE:
5819 offset = dissect_struct_ost_body(tvb, offset, tree);
5820 break;
5822 case OST_DESTROY:
5823 /* REQ: [OST_BODY][DLM_REQ][CAPA]
5824 * REP: [OST_BODY] */
5825 offset = dissect_struct_ost_body(tvb, offset, tree);
5826 if (pb_type == PTL_RPC_MSG_REPLY)
5827 break;
5829 offset = dissect_struct_ldlm_request(tvb, offset, pinfo, tree, NULL, LUSTRE_REC_OFF+1);
5830 offset = dissect_struct_capa(tvb, offset, tree, LUSTRE_REC_OFF+2);
5831 break;
5833 case OST_GET_INFO:
5834 /* REQ: [GETINFO_KEY]
5835 * REP: [GENERIC_DATA] */
5836 if (pb_type == PTL_RPC_MSG_REQUEST)
5837 offset = display_buffer_string(tvb, pinfo, tree, offset, hf_lustre_ost_key, LUSTRE_REC_OFF);
5838 if (pb_type == PTL_RPC_MSG_REPLY)
5839 offset = display_buffer_string(tvb, pinfo, tree, offset, hf_lustre_ost_val, LUSTRE_REC_OFF);
5840 break;
5842 case OST_CONNECT:
5843 /* REQ: CONNECT CLIENT CHAIN == [targetuuid][clientuuid][lustre_handle][obd_connect_data]
5844 * REP: [OBD_CONNECT_DATA] */
5845 if (pb_type == PTL_RPC_MSG_REQUEST)
5846 offset = dissect_generic_connect(tvb, offset, pinfo, tree);
5847 if (pb_type == PTL_RPC_MSG_REPLY)
5848 offset = dissect_struct_obd_connect_data(tvb, offset, pinfo, tree);
5849 break;
5851 case OST_DISCONNECT:
5852 /* no data */
5853 break;
5855 case OST_OPEN:
5856 case OST_CLOSE:
5857 /* no data - code is obsolete */
5858 break;
5860 case OST_STATFS:
5861 /* REQ: no data
5862 PRE: [obd_statfs] */
5863 if (pb_type == PTL_RPC_MSG_REQUEST)
5864 break;
5865 offset = dissect_struct_obd_statfs(tvb, offset, tree);
5866 break;
5868 case OST_SET_INFO:
5869 /* REQ: [KEY][VAL]
5870 REP: no data */
5871 if (pb_type == PTL_RPC_MSG_REPLY)
5872 break;
5873 offset = display_buffer_string(tvb, pinfo, tree, offset, hf_lustre_ost_key, LUSTRE_REC_OFF);
5874 offset = display_buffer_string(tvb, pinfo, tree, offset, hf_lustre_ost_val, LUSTRE_REC_OFF+1);
5875 break;
5877 case OST_QUOTACHECK: /* OBSOLETED after 2.4 */
5878 expert_add_info(pinfo, tree, &ei_lustre_obsopc);
5879 if (pb_type == PTL_RPC_MSG_REQUEST)
5880 offset = dissect_struct_obd_quotactl(tvb, offset, tree);
5881 /* nothing in reply */
5882 break;
5884 case OST_QUOTACTL:
5885 /* REQ: [QUOTACTL]
5886 * REP: [QUOTACTL] */
5887 offset = dissect_struct_obd_quotactl(tvb, offset, tree);
5888 break;
5890 case OST_QUOTA_ADJUST_QUNIT: /* OBSOLETED after 2.4 */
5891 expert_add_info(pinfo, tree, &ei_lustre_obsopc);
5892 /* [quota_adjust_qunit] */
5893 offset = dissect_struct_quota_adjust_qunit(tvb, offset, tree, LUSTRE_REC_OFF);
5894 break;
5896 case OST_LADVISE:
5897 /* REQ: [OST_BODY][LADVISE_HDR][LADVISE]
5898 * REP: [OST_BODY] */
5899 /*[ost_body] in both case */
5900 offset = dissect_struct_ost_body(tvb, offset, tree);
5901 if (pb_type == PTL_RPC_MSG_REPLY)
5902 break;
5904 offset = dissect_struct_lu_ladvise_hdr(tvb, offset, pinfo, tree);
5905 offset = dissect_struct_lu_ladvise(tvb, offset, tree);
5906 break;
5907 default:
5908 expert_add_info_format(pinfo, tree, &ei_lustre_badopc, "UNKNOWN OST OPCODE: %d (type: %d)", trans->opcode, pb_type);
5909 break;
5911 return offset;
5914 static int
5915 process_opcode_reint_req(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree * tree, lustre_trans_t *trans)
5917 trans->sub_opcode = tvb_get_letohl(tvb, offset);
5919 offset = dissect_struct_mdt_rec_reint(tvb, offset, pinfo, tree, LUSTRE_REC_OFF);
5920 if (trans->sub_opcode == REINT_RMENTRY)
5921 return offset;
5922 offset = dissect_struct_capa(tvb, offset, tree, LUSTRE_REC_OFF+1);
5924 switch(trans->sub_opcode) {
5925 case REINT_SETATTR:
5926 /* [REC REINT][CAPA1][MDT EPOCH][EADATA][LOGCOOKIES][DLM REQ] */
5927 offset = dissect_struct_mdt_ioepoch(tvb, offset, tree, LUSTRE_REC_OFF+2);
5928 offset = dissect_struct_eadata(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+3);
5929 offset = dissect_struct_llog_cookie_array(tvb, offset, tree, LUSTRE_REC_OFF+4);
5930 offset = dissect_struct_ldlm_request(tvb, offset, pinfo, tree, NULL, LUSTRE_REC_OFF+5);
5931 break;
5932 case REINT_CREATE:
5933 /* Create Types:
5934 * [REC REINT][CAPA1][NAME]
5935 * ACL: [EADATA][DLM REQ][FILE SECCTX NAME][FILE SECCTX]
5936 * SLAVE: [EADATA][DLM REQ]
5937 * SYM: [SYMTGT][DLM REQ][FILE SECCTX NAME][FILE SECCTX]
5939 offset = display_buffer_string(tvb, pinfo, tree, offset, hf_lustre_filename, LUSTRE_REC_OFF+2);
5940 // This could also be string for symlink
5941 offset = dissect_struct_eadata(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+3);
5942 offset = dissect_struct_ldlm_request(tvb, offset, pinfo, tree, NULL, LUSTRE_REC_OFF+4);
5943 offset = display_buffer_string(tvb, pinfo, tree, offset, hf_lustre_secctx_name, LUSTRE_REC_OFF+5);
5944 offset = display_buffer_data(tvb, pinfo, offset, tree, LUSTRE_REC_OFF+6, "Security Context");
5945 break;
5946 case REINT_LINK:
5947 /* [REC REINT][CAPA1][CAPA2][NAME][DLM REQ] */
5948 offset = dissect_struct_capa(tvb, offset, tree, LUSTRE_REC_OFF+2);
5949 offset = display_buffer_string(tvb, pinfo, tree, offset, hf_lustre_filename, LUSTRE_REC_OFF+3);
5950 offset = dissect_struct_ldlm_request(tvb, offset, pinfo, tree, NULL, LUSTRE_REC_OFF+4);
5951 break;
5952 case REINT_UNLINK:
5953 /* [REC REINT][CAPA1][NAME][DLM REQ] */
5954 offset = display_buffer_string(tvb, pinfo, tree, offset, hf_lustre_filename, LUSTRE_REC_OFF+2);
5955 offset = dissect_struct_ldlm_request(tvb, offset, pinfo, tree, NULL, LUSTRE_REC_OFF+3);
5956 break;
5957 case REINT_RENAME:
5958 /* [REC REINT][CAPA1][CAPA2][NAME][SYMTGT][DLM REQ] */
5959 offset = dissect_struct_capa(tvb, offset, tree, LUSTRE_REC_OFF+2);
5960 offset = display_buffer_string(tvb, pinfo, tree, offset, hf_lustre_filename, LUSTRE_REC_OFF+3);
5961 offset = display_buffer_string(tvb, pinfo, tree, offset, hf_lustre_target, LUSTRE_REC_OFF+4);
5962 offset = dissect_struct_ldlm_request(tvb, offset, pinfo, tree, NULL, LUSTRE_REC_OFF+5);
5963 break;
5964 case REINT_OPEN:
5965 /* [REC REINT][CAPA1][CAPA2][NAME][EADATA][FILE SECCTX NAME][FILE SECCTX] */
5966 offset = dissect_struct_capa(tvb, offset, tree, LUSTRE_REC_OFF+2);
5967 offset = display_buffer_string(tvb, pinfo, tree, offset, hf_lustre_filename, LUSTRE_REC_OFF+3);
5968 offset = dissect_struct_eadata(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+4);
5969 offset = display_buffer_string(tvb, pinfo, tree, offset, hf_lustre_secctx_name, LUSTRE_REC_OFF+5);
5970 offset = display_buffer_data(tvb, pinfo, offset, tree, LUSTRE_REC_OFF+6, "Security Context");
5971 break;
5972 case REINT_SETXATTR:
5973 /* [REC REINT][CAPA1][NAME][EADATA][DLM REQ] */
5974 offset = display_buffer_string(tvb, pinfo, tree, offset, hf_lustre_filename, LUSTRE_REC_OFF+2);
5975 offset = dissect_struct_eadata(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+3);
5976 offset = dissect_struct_ldlm_request(tvb, offset, pinfo, tree, NULL, LUSTRE_REC_OFF+4);
5977 break;
5978 case REINT_RMENTRY:
5979 /* nothing further - and will never get here */
5980 break;
5981 case REINT_MIGRATE:
5982 /* [REC REINT][CAPA1][CAPA2][NAME][SYMTGT][DLM REQ][MDT EPOCH][CLOSE DATA] */
5983 offset = dissect_struct_capa(tvb, offset, tree, LUSTRE_REC_OFF+2);
5984 offset = display_buffer_string(tvb, pinfo, tree, offset, hf_lustre_filename, LUSTRE_REC_OFF+3);
5985 offset = display_buffer_string(tvb, pinfo, tree, offset, hf_lustre_secctx_name, LUSTRE_REC_OFF+4);
5986 offset = dissect_struct_ldlm_request(tvb, offset, pinfo, tree, NULL, LUSTRE_REC_OFF+5);
5987 offset = dissect_struct_mdt_ioepoch(tvb, offset, tree, LUSTRE_REC_OFF+6);
5988 offset = dissect_struct_close_data(tvb, offset, tree, LUSTRE_REC_OFF+7);
5989 break;
5992 return offset;
5995 static int
5996 process_opcode_reint_rep(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree * tree, lustre_trans_t *trans)
5998 offset = dissect_struct_mdt_body(tvb, offset, tree, LUSTRE_REC_OFF);
6000 /* trans->sub_opcode is set during REQUEST */
6001 switch(trans->sub_opcode) {
6002 case REINT_SETATTR:
6003 case REINT_OPEN:
6004 /* [MDT BODY][MDT MD][ACL][CAPA1][CAPA2] */
6005 offset = dissect_struct_lov_mds_md(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+1);
6006 offset = dissect_struct_acl(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+2);
6007 offset = dissect_struct_capa(tvb, offset ,tree, LUSTRE_REC_OFF+3);
6008 offset = dissect_struct_capa(tvb, offset ,tree, LUSTRE_REC_OFF+4);
6009 break;
6010 case REINT_CREATE:
6011 /* [MDT BODY][CAPA] */
6012 offset = dissect_struct_capa(tvb, offset, tree, LUSTRE_REC_OFF+1);
6013 break;
6014 case REINT_LINK:
6015 case REINT_SETXATTR:
6016 case REINT_RMENTRY:
6017 /* [MDT BODY] */
6018 break;
6019 case REINT_UNLINK:
6020 case REINT_RENAME:
6021 case REINT_MIGRATE:
6022 /* [MDT BODY][MDT MD][LOGCOOKIES][CAPA1][CAPA2] */
6023 offset = dissect_struct_lov_mds_md(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+1);
6024 offset = dissect_struct_llog_cookie_array(tvb, offset, tree, LUSTRE_REC_OFF+2);
6025 offset = dissect_struct_capa(tvb, offset ,tree, LUSTRE_REC_OFF+3);
6026 offset = dissect_struct_capa(tvb, offset ,tree, LUSTRE_REC_OFF+4);
6027 break;
6030 return offset;
6033 static int
6034 process_opcode_mds(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree * tree, lustre_trans_t *trans, uint32_t pb_type)
6036 switch (trans->opcode) {
6037 case MDS_GETATTR_NAME:
6038 /* REQ: [MDT BODY][CAPA][NAME]
6039 * REP: [MDT BODY][mdt_md][acl][capa1][capa2] */
6040 case MDS_GETATTR:
6041 /* REQ: [MDT BODY][CAPA]
6042 * REP: [MDT BODY][mdt_md][acl][capa1][capa2] */
6043 offset = dissect_struct_mdt_body(tvb, offset, tree, LUSTRE_REC_OFF);
6044 if (pb_type == PTL_RPC_MSG_REQUEST) {
6045 offset = dissect_struct_capa(tvb, offset, tree, LUSTRE_REC_OFF+1);
6046 if (trans->opcode == MDS_GETATTR_NAME)
6047 offset = display_buffer_string(tvb, pinfo, tree, offset, hf_lustre_name, LUSTRE_REC_OFF+2);
6049 if (pb_type == PTL_RPC_MSG_REPLY) {
6050 offset = dissect_struct_lov_mds_md(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+1);
6051 offset = dissect_struct_acl(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+2);
6052 offset = dissect_struct_capa(tvb, offset, tree, LUSTRE_REC_OFF+3);
6053 offset = dissect_struct_capa(tvb, offset, tree, LUSTRE_REC_OFF+4);
6055 break;
6057 case MDS_CLOSE:
6058 /* REQ: [MDT IOEPOCH][REINT][CAPA]
6059 * REP: [MDT BODY][MDT MD][LOGCOOKIES][CAPA1][CAPA2] */
6060 if (pb_type == PTL_RPC_MSG_REQUEST) {
6061 offset = dissect_struct_mdt_ioepoch(tvb, offset, tree, LUSTRE_REC_OFF);
6062 offset = dissect_struct_mdt_rec_reint(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+1);
6063 offset = dissect_struct_capa(tvb, offset, tree, LUSTRE_REC_OFF+2);
6064 offset = dissect_struct_close_data(tvb, offset, tree, LUSTRE_REC_OFF+3);
6066 if (pb_type == PTL_RPC_MSG_REPLY) {
6067 offset = dissect_struct_mdt_body(tvb, offset, tree, LUSTRE_REC_OFF);
6068 offset = dissect_struct_lov_mds_md(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+1);
6069 offset = dissect_struct_llog_cookie_array(tvb, offset, tree, LUSTRE_REC_OFF+2);
6070 offset = dissect_struct_capa(tvb, offset ,tree, LUSTRE_REC_OFF+3);
6071 offset = dissect_struct_capa(tvb, offset ,tree, LUSTRE_REC_OFF+4);
6073 break;
6075 case MDS_REINT:
6076 /* the structure depend on the intent_opcode */
6077 if (pb_type == PTL_RPC_MSG_REQUEST)
6078 offset = process_opcode_reint_req(tvb, offset, pinfo, tree, trans);
6079 if (pb_type == PTL_RPC_MSG_REPLY)
6080 offset = process_opcode_reint_rep(tvb, offset, pinfo, tree, trans);
6082 break;
6084 case MDS_CONNECT:
6085 /* REQ: generic connect chain ([targetuuid][clientuuid][lustre_handle][obd_connect_data])
6086 * REP: [CONNECT DATA] */
6087 if (pb_type == PTL_RPC_MSG_REQUEST)
6088 offset = dissect_generic_connect(tvb, offset, pinfo, tree);
6089 if (pb_type == PTL_RPC_MSG_REPLY || pb_type == PTL_RPC_MSG_ERR) /*[obd_connect_data]*/
6090 offset = dissect_struct_obd_connect_data(tvb, offset, pinfo, tree);
6091 break;
6093 case MDS_DISCONNECT:
6094 /* no data */
6095 break;
6097 case MDS_GET_ROOT:
6098 /* REQ: [mdt body][NAME] */
6099 /* REP: [mdt body][capa] */
6100 offset = dissect_struct_mdt_body(tvb, offset, tree, LUSTRE_REC_OFF);
6101 if (pb_type == PTL_RPC_MSG_REQUEST)
6102 offset = display_buffer_string(tvb, pinfo, tree, offset, hf_lustre_name, LUSTRE_REC_OFF+1);
6103 if (pb_type == PTL_RPC_MSG_REPLY)
6104 offset = dissect_struct_capa(tvb, offset, tree, LUSTRE_REC_OFF+1);
6105 break;
6107 case MDS_STATFS:
6108 /* REQ: no data
6109 * REP: [OBD STATFS] */
6110 if (pb_type == PTL_RPC_MSG_REPLY)
6111 offset = dissect_struct_obd_statfs(tvb, offset, tree);
6112 break;
6114 /* case MDS_PIN: NEVER USED In a release */
6115 /* case MDS_UNPIN: NEVER USED In a release */
6117 case MDS_READPAGE: // OUT OF ORDER
6118 /* page transport: MDS BULK PORTAL */
6119 case MDS_SYNC:
6120 /* REQ: [MDT BODY][CAPA]
6121 * REP: [MDT BODY] */
6122 offset = dissect_struct_mdt_body(tvb, offset, tree, LUSTRE_REC_OFF);
6123 if (pb_type == PTL_RPC_MSG_REQUEST)
6124 offset = dissect_struct_capa(tvb, offset, tree, LUSTRE_REC_OFF+1);
6125 break;
6127 case MDS_DONE_WRITING:
6128 /* Obsolete since 2.8.0 */
6129 expert_add_info(pinfo, tree, &ei_lustre_obsopc);
6130 /* [mdt_body] */
6131 offset = dissect_struct_mdt_body(tvb, offset, tree, LUSTRE_REC_OFF);
6132 break;
6134 case MDS_SET_INFO:
6135 /* Missing from lustre/ptlrpc/layout.c */
6136 /* REQ: [KEY][VAL]
6137 * REP: no data */
6138 if (pb_type == PTL_RPC_MSG_REQUEST) {
6139 offset = display_buffer_string(tvb, pinfo, tree, offset, hf_lustre_filename, LUSTRE_REC_OFF);
6140 offset = display_buffer_string(tvb, pinfo, tree, offset, hf_lustre_mdt_val, LUSTRE_REC_OFF+1);
6142 break;
6144 case MDS_QUOTACHECK:
6145 /* Obsolete since 2.8.0 */
6146 expert_add_info(pinfo, tree, &ei_lustre_obsopc);
6147 /* REQ: [obd_quotactl]
6148 * REP: no data */
6149 if (pb_type == PTL_RPC_MSG_REQUEST)
6150 offset = dissect_struct_obd_quotactl(tvb, offset, tree);
6151 break;
6153 case MDS_QUOTACTL:
6154 /* REQ: [obd_quotactl]
6155 * REP: [obd_quotactl] */
6156 offset = dissect_struct_obd_quotactl(tvb, offset, tree);
6157 break;
6159 case MDS_GETXATTR:
6160 /* REQ: [MDT BODY][CAPA][NAME][EADATA]
6161 * REP: [MDT BODY][EADATA] */
6162 offset = dissect_struct_mdt_body(tvb, offset, tree, LUSTRE_REC_OFF);
6163 if (pb_type == PTL_RPC_MSG_REQUEST) {
6164 offset = dissect_struct_capa(tvb, offset, tree, LUSTRE_REC_OFF+1);
6165 offset = display_buffer_string(tvb, pinfo, tree, offset, hf_lustre_name, LUSTRE_REC_OFF+2);
6166 offset = dissect_struct_eadata(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+3);
6168 if (pb_type == PTL_RPC_MSG_REPLY)
6169 offset = dissect_struct_eadata(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+1);
6170 break;
6172 case MDS_SETXATTR:
6173 /* Obsolete since 2.0.0, should use MDS_REINT.REINT_SETXATTR */
6174 /* REQ: [mdt_body]
6175 * REP: no data */
6176 expert_add_info(pinfo, tree, &ei_lustre_obsopc);
6177 if(pb_type==PTL_RPC_MSG_REQUEST)
6178 offset = dissect_struct_mdt_body(tvb, offset, tree, LUSTRE_REC_OFF);
6179 break;
6181 case MDS_WRITEPAGE:
6182 /* Not used, apparently */
6183 expert_add_info_format(pinfo, tree, &ei_lustre_badopc, "MDS WRITEPAGE: Unknown decoding");
6184 break;
6186 /* case MDS_IS_SUBDIR: obsolete, never used in a release */
6188 case MDS_GET_INFO:
6189 /* REQ: [KEY][LENGTH]
6190 * REP: [VAL] */
6191 if (pb_type == PTL_RPC_MSG_REQUEST) {
6192 // @@TODO this is actually a string + fill + optional struct : lustre/include/obd.h KEY_*
6193 offset = display_buffer_string(tvb, pinfo, tree, offset, hf_lustre_mdt_key, LUSTRE_REC_OFF);
6194 // "fid2path" -> [getinfo_fid2path][lu_fid]
6196 // BUFFER: LUSTRE_REC_OFF+1
6197 proto_tree_add_item(tree, hf_lustre_mdt_vallen, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6199 if (pb_type == PTL_RPC_MSG_REPLY)
6200 offset = display_buffer_data(tvb, pinfo, offset, tree, LUSTRE_REC_OFF, NULL);
6201 break;
6203 case MDS_HSM_STATE_GET:
6204 /* REQ: [mdt_body][capa]
6205 * REP: [MDT BODY][][HSM USER STATE] */
6206 offset = dissect_struct_mdt_body(tvb, offset, tree, LUSTRE_REC_OFF);
6207 if (pb_type == PTL_RPC_MSG_REQUEST)
6208 offset = dissect_struct_capa(tvb, offset, tree, LUSTRE_REC_OFF+1);
6209 if (pb_type == PTL_RPC_MSG_REPLY)
6210 offset = dissect_struct_hsm_user_state(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+1);
6211 break;
6213 case MDS_HSM_STATE_SET:
6214 /* REQ: [mdt_body][capa][hsm_state_set]
6215 * REP: no data */
6216 if (pb_type == PTL_RPC_MSG_REQUEST) {
6217 offset = dissect_struct_mdt_body(tvb, offset, tree, LUSTRE_REC_OFF);
6218 offset = dissect_struct_capa(tvb, offset, tree, LUSTRE_REC_OFF+1);
6219 offset = dissect_struct_hsm_state_set(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+2);
6221 break;
6223 case MDS_HSM_ACTION:
6224 /* REQ: [mdt_body][capa]
6225 * REP: [mdt_body][hsm_current_action] */
6226 offset = dissect_struct_mdt_body(tvb, offset, tree, LUSTRE_REC_OFF);
6227 if (pb_type == PTL_RPC_MSG_REQUEST)
6228 offset = dissect_struct_capa(tvb, offset, tree, LUSTRE_REC_OFF+1);
6229 if (pb_type == PTL_RPC_MSG_REPLY)
6230 offset = dissect_struct_hsm_current_action(tvb, offset, tree, LUSTRE_REC_OFF+1);
6231 break;
6233 case MDS_HSM_PROGRESS:
6234 /* REQ: [mdt_body][hsm_progress]
6235 * REP: no data */
6236 if (pb_type == PTL_RPC_MSG_REQUEST) {
6237 offset = dissect_struct_mdt_body(tvb, offset, tree, LUSTRE_REC_OFF);
6238 offset = dissect_struct_hsm_progress(tvb, offset, tree);
6240 break;
6242 case MDS_HSM_REQUEST:
6243 /* REQ: [mdt_body][hsm_request][array of hsm_user_item][generic_data]
6244 * REP: no data */
6245 if (pb_type == PTL_RPC_MSG_REQUEST) {
6246 offset = dissect_struct_mdt_body(tvb, offset, tree, LUSTRE_REC_OFF);
6247 offset = dissect_struct_hsm_request(tvb, offset, tree);
6248 offset = dissect_struct_hsm_user_item_array(tvb, offset, tree, LUSTRE_REC_OFF+2);
6249 offset = display_buffer_data(tvb, pinfo, offset, tree, LUSTRE_REC_OFF+3, NULL);
6251 break;
6253 case MDS_HSM_CT_REGISTER:
6254 /* REQ: [mdt_body][hsm_archive]
6255 * REP: no data */
6256 if (pb_type == PTL_RPC_MSG_REQUEST) {
6257 offset = dissect_struct_mdt_body(tvb, offset, tree, LUSTRE_REC_OFF);
6258 offset = dissect_hsm_archive(tvb, offset, tree, LUSTRE_REC_OFF+1);
6260 break;
6262 case MDS_HSM_CT_UNREGISTER:
6263 /* REQ: [mdt_body]
6264 * REP: no data */
6265 if (pb_type == PTL_RPC_MSG_REQUEST)
6266 offset = dissect_struct_mdt_body(tvb, offset, tree, LUSTRE_REC_OFF);
6267 break;
6269 case MDS_SWAP_LAYOUTS:
6270 /* REQ: [mdt_body][swap_layouts][capa1][capa2][dlm_req]
6271 * REP: no data */
6272 if (pb_type == PTL_RPC_MSG_REQUEST) {
6273 offset = dissect_struct_mdt_body(tvb, offset, tree, LUSTRE_REC_OFF);
6274 offset = dissect_struct_mdc_swap_layouts(tvb, offset, tree, LUSTRE_REC_OFF+1);
6275 offset = dissect_struct_capa(tvb, offset, tree, LUSTRE_REC_OFF+2);
6276 offset = dissect_struct_capa(tvb, offset, tree, LUSTRE_REC_OFF+3);
6277 offset = dissect_struct_ldlm_request(tvb, offset, pinfo, tree, NULL, LUSTRE_REC_OFF+4);
6279 break;
6281 case MDS_RMFID:
6282 /* REQ: [mdt_body][fid_array][capa1][capa2]
6283 * REP: [mdt_body][fid_array][rcs] */
6284 offset = dissect_struct_mdt_body(tvb, offset, tree, LUSTRE_REC_OFF);
6285 offset = dissect_struct_fid_array(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+1);
6286 if (pb_type == PTL_RPC_MSG_REQUEST) {
6287 offset = dissect_struct_capa(tvb, offset, tree, LUSTRE_REC_OFF+2);
6288 offset = dissect_struct_capa(tvb, offset, tree, LUSTRE_REC_OFF+3);
6289 } else if (pb_type == PTL_RPC_MSG_REPLY)
6290 offset = dissect_rc_array(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+2);
6291 break;
6293 default:
6294 expert_add_info_format(pinfo, tree, &ei_lustre_badopc, "UNKNOWN MDS OPCODE: %d (type: %d)", trans->opcode, pb_type);
6295 break;
6298 return offset;
6301 static int
6302 process_ldlm_intent_req(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree * tree, lustre_trans_t *trans)
6304 /* > 2 buffers means LDLM_INTENT */
6305 if (LUSTRE_BUFCOUNT <= 2)
6306 return offset;
6308 /* REQ: [DLM REQ][INTENT]
6309 * Basic: --
6310 * Default: [REC REINT]
6311 * OPEN: [REC REINT][CAPA1][CAPA2][NAME][EADATA][SECCTX NAME][SECCTX]
6312 * CREATE: [REC REINT][CAPA1][NAME][EADATA][SECCTX NAME][SECCTX]([SELINUX])
6313 * GETATTR: [MDT BODY][CAPA1][NAME]
6314 * UNLINK: [REC REINT][CAPA1][NAME]
6315 * LAYOUT: [LAYOUT INTENT][EADATA]
6316 * GETXATTR: [MDT BODY][CAPA1]
6317 * QUOTA*: [QUOTA BODY]
6319 /* could also sanity check: ldlm_request.lock_flags & LDLM_FL_HAS_INTENT */
6320 offset = dissect_struct_ldlm_intent(tvb, offset, pinfo, tree, trans, LUSTRE_REC_OFF+1);
6322 switch (trans->sub_opcode) {
6323 case IT_OPEN_CREAT:
6324 case IT_OPEN:
6325 offset = dissect_struct_mdt_rec_reint(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+2);
6326 offset = dissect_struct_capa(tvb, offset, tree, LUSTRE_REC_OFF+3);
6327 offset = dissect_struct_capa(tvb, offset, tree, LUSTRE_REC_OFF+4);
6328 offset = display_buffer_string(tvb, pinfo, tree, offset, hf_lustre_filename, LUSTRE_REC_OFF+5);
6329 offset = dissect_struct_eadata(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+6);
6330 offset = display_buffer_string(tvb, pinfo, tree, offset, hf_lustre_secctx_name, LUSTRE_REC_OFF+7);
6331 offset = display_buffer_data(tvb, pinfo, offset, tree, LUSTRE_REC_OFF+8, "Security Context");
6332 break;
6333 case IT_CREAT:
6334 offset = dissect_struct_mdt_rec_reint(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+2);
6335 offset = dissect_struct_capa(tvb, offset, tree, LUSTRE_REC_OFF+3);
6336 offset = display_buffer_string(tvb, pinfo, tree, offset, hf_lustre_filename, LUSTRE_REC_OFF+4);
6337 offset = dissect_struct_eadata(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+5);
6338 offset = display_buffer_string(tvb, pinfo, tree, offset, hf_lustre_secctx_name, LUSTRE_REC_OFF+6);
6339 offset = display_buffer_data(tvb, pinfo, offset, tree, LUSTRE_REC_OFF+7, "Security Context");
6340 offset = display_buffer_string(tvb, pinfo, tree, offset, hf_lustre_selinux_pol, LUSTRE_REC_OFF+8);
6341 break;
6342 case IT_LOOKUP: /* lustre/lmv/lmv_intent.c::lmv_intent_remote() */
6343 case IT_GETATTR:
6344 offset = dissect_struct_mdt_body(tvb, offset, tree, LUSTRE_REC_OFF);
6345 offset = dissect_struct_capa(tvb, offset, tree, LUSTRE_REC_OFF+3);
6346 offset = display_buffer_string(tvb, pinfo, tree, offset, hf_lustre_filename, LUSTRE_REC_OFF+4);
6347 break;
6348 case IT_UNLINK:
6349 offset = dissect_struct_mdt_rec_reint(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+2);
6350 offset = dissect_struct_capa(tvb, offset, tree, LUSTRE_REC_OFF+3);
6351 offset = display_buffer_string(tvb, pinfo, tree, offset, hf_lustre_filename, LUSTRE_REC_OFF+4);
6352 break;
6353 case IT_LAYOUT:
6354 offset = dissect_struct_layout_intent(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+2);
6355 offset = dissect_struct_eadata(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+3);
6356 break;
6357 case IT_GETXATTR:
6358 offset = dissect_struct_mdt_body(tvb, offset, tree, LUSTRE_REC_OFF);
6359 offset = dissect_struct_capa(tvb, offset, tree, LUSTRE_REC_OFF+3);
6360 break;
6361 case IT_QUOTA_DQACQ:
6362 case IT_QUOTA_CONN:
6363 offset = dissect_struct_quota_body(tvb, offset, tree, LUSTRE_REC_OFF+2);
6364 break;
6365 default:
6366 offset = dissect_struct_mdt_rec_reint(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+2);
6367 break;
6370 return offset;
6373 static int
6374 process_ldlm_intent_rep(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree * tree, lustre_trans_t *trans)
6376 /* LDLM_ENQUEUE:
6377 * REP: [DLM REP][DLM LVB]
6378 * INTENT:
6379 * REP: [DLM REP]...
6380 * Default: [MDT BODY][MDT MD][ACL]
6381 * LAYOUT: [DLM LVB]
6382 * GETATTR: [MDT BODY][MDT MD][ACL][CAPA1][SEC CTX][DEFAULT MDT MD][FILE ENC CTX]
6383 * CREATE: same as GETATTR
6384 * OPEN: [MDT BODY][MDT MD][ACL][CAPA1][CAPA2]([NIOBUF])([SECCTX])
6385 * QUOTA: [DLM LVB][QUOTA BODY]
6386 * GETXATTR: [MDT BODY][MDT MD][ACL][EADATA][EAVALS][EAVALS LENS]
6388 offset = dissect_struct_ldlm_reply(tvb, offset, pinfo, tree, NULL, LUSTRE_REC_OFF);
6389 switch (trans->sub_opcode) {
6390 case 0: /* LDLM_ENQUEUE - no INTENT */
6391 case IT_LAYOUT:
6392 /* if tvb_get_letohl(tvb, offset) == LOV_MAGIC_V1 then DLMLVB :: lov_mds_md_v1 */
6393 offset = dissect_struct_lov_mds_md(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+1);
6394 break;
6395 case IT_GETATTR:
6396 case IT_CREAT:
6397 offset = dissect_struct_mdt_body(tvb, offset, tree, LUSTRE_REC_OFF+1);
6398 offset = dissect_struct_lov_mds_md(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+2);
6399 offset = dissect_struct_acl(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+3);
6400 offset = dissect_struct_capa(tvb, offset, tree, LUSTRE_REC_OFF+4);
6401 offset = display_buffer_data(tvb, pinfo, offset, tree, LUSTRE_REC_OFF+5, "Security Context");
6402 offset = dissect_struct_lmv_user_md(tvb, pinfo, offset, tree, LUSTRE_REC_OFF+6);
6403 offset = display_buffer_data(tvb, pinfo, offset, tree, LUSTRE_REC_OFF+7, "Encryption Context");
6404 break;
6405 case IT_OPEN_CREAT:
6406 case IT_OPEN:
6407 offset = dissect_struct_mdt_body(tvb, offset, tree, LUSTRE_REC_OFF+1);
6408 offset = dissect_struct_lov_mds_md(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+2);
6409 offset = dissect_struct_acl(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+3);
6410 offset = dissect_struct_capa(tvb, offset, tree, LUSTRE_REC_OFF+4);
6411 offset = dissect_struct_capa(tvb, offset, tree, LUSTRE_REC_OFF+5);
6412 offset = dissect_struct_niobuf_remote(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+6);
6413 offset = display_buffer_data(tvb, pinfo, offset, tree, LUSTRE_REC_OFF+7, "Security Context");
6414 break;
6415 case IT_QUOTA_DQACQ:
6416 case IT_QUOTA_CONN:
6417 offset = dissect_struct_lov_mds_md(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+1);
6418 offset = dissect_struct_quota_body(tvb, offset, tree, LUSTRE_REC_OFF+2);
6419 break;
6420 case IT_GETXATTR:
6421 offset = dissect_struct_mdt_body(tvb, offset, tree, LUSTRE_REC_OFF+1);
6422 offset = dissect_struct_lov_mds_md(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+2);
6423 offset = dissect_struct_acl(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+3);
6424 /* this sucks up [EADATA][EAVALS][EAVALS LENS] */
6425 offset = dissect_xattr_buffers(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+4);
6426 break;
6427 default:
6428 offset = dissect_struct_mdt_body(tvb, offset, tree, LUSTRE_REC_OFF+1);
6429 offset = dissect_struct_lov_mds_md(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+2);
6430 offset = dissect_struct_acl(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+3);
6431 break;
6433 return offset;
6436 static int
6437 process_opcode_ldlm(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree * tree, lustre_trans_t *trans, uint32_t pb_type)
6439 if (pb_type == PTL_RPC_MSG_REQUEST)
6440 switch (trans->opcode) {
6441 case LDLM_ENQUEUE:
6442 /* REQ: [DLM REQ]{[INTENT]...} */
6443 offset = dissect_struct_ldlm_request(tvb, offset, pinfo, tree, NULL, LUSTRE_REC_OFF);
6444 offset = process_ldlm_intent_req(tvb, offset, pinfo, tree, trans);
6445 break;
6446 case LDLM_GL_CALLBACK:
6447 /* REQ: [DLM REQ][[GL DESC]]
6448 * LDLM_GL_CALLBACK_DESC has gl_desc as tertiary buffer
6450 offset = dissect_struct_ldlm_request(tvb, offset, pinfo, tree, &trans->sub_opcode, LUSTRE_REC_OFF);
6451 offset = dissect_struct_ldlm_gl_desc(tvb, offset, pinfo, tree, trans, LUSTRE_REC_OFF+1);
6452 break;
6453 case LDLM_CONVERT:
6454 case LDLM_CANCEL:
6455 case LDLM_BL_CALLBACK:
6456 /* REQ: [DLM REQ] */
6457 offset = dissect_struct_ldlm_request(tvb, offset, pinfo, tree, NULL, LUSTRE_REC_OFF);
6458 break;
6459 case LDLM_CP_CALLBACK:
6460 /* REQ: [DLM REQ][DLM LVB] */
6461 offset = dissect_struct_ldlm_request(tvb, offset, pinfo, tree, NULL, LUSTRE_REC_OFF);
6462 /* lustre/ldlm/ldlm_lockd.c::ldlm_handle_cp_callback()
6463 * if extent lock, lvb data is ost_lvb struct, no other
6464 * options seem to exist */
6465 offset = dissect_struct_ost_lvb(tvb, offset, tree, LUSTRE_REC_OFF+1);
6466 break;
6467 case LDLM_SET_INFO:
6468 /* not in lustreptlrpc/layout.c
6469 * in lustre/ldlm/ldlm_lockd.c::ldlm_handle_setinfo() treat like RQF_OBD_SET_INFO */
6470 /* REQ: [KEY][VAL] */
6471 offset = display_buffer_string(tvb, pinfo, tree, offset, hf_lustre_ldlm_key, LUSTRE_REC_OFF);
6472 offset = display_buffer_string(tvb, pinfo, tree, offset, hf_lustre_ldlm_val, LUSTRE_REC_OFF+1);
6473 break;
6474 default:
6475 expert_add_info_format(pinfo, tree, &ei_lustre_badopc, "UNKNOWN LDLM OPCODE: %d (type: %d)", trans->opcode, pb_type);
6476 break;
6479 if (pb_type == PTL_RPC_MSG_REPLY)
6480 switch (trans->opcode) {
6481 case LDLM_ENQUEUE:
6482 offset = process_ldlm_intent_rep(tvb, offset, pinfo, tree, trans);
6483 break;
6484 case LDLM_CONVERT:
6485 /* REP: [DLM REP] */
6486 offset = dissect_struct_ldlm_reply(tvb, offset, pinfo, tree, NULL, LUSTRE_REC_OFF);
6487 break;
6488 case LDLM_CANCEL:
6489 case LDLM_BL_CALLBACK:
6490 case LDLM_CP_CALLBACK:
6491 /* no data */
6492 break;
6493 case LDLM_GL_CALLBACK:
6494 /* REP: [DLM LVB] */
6495 offset = dissect_struct_barrier_lvb(tvb, offset, tree, LUSTRE_REC_OFF);
6496 break;
6497 case LDLM_SET_INFO:
6498 /* no data - c.f. Request reasoning, this processed as RFQ_OBD_SET_INFO */
6499 break;
6500 default:
6501 expert_add_info_format(pinfo, tree, &ei_lustre_badopc, "UNKNOWN LDLM OPCODE: %d (type: %d)", trans->opcode, pb_type);
6502 break;
6504 return offset;
6507 static int
6508 process_opcode_mgs(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, lustre_trans_t *trans, uint32_t pb_type)
6510 switch (trans->opcode){
6511 case MGS_CONNECT:
6512 /* REQ: generic connect chain ([targetuuid][clientuuid][lustre_handle][obd_connect_data])
6513 * REP: [CONNECT DATA] */
6514 if (pb_type == PTL_RPC_MSG_REQUEST)
6515 offset = dissect_generic_connect(tvb, offset, pinfo, tree);
6516 if (pb_type == PTL_RPC_MSG_REPLY || pb_type == PTL_RPC_MSG_ERR)
6517 offset = dissect_struct_obd_connect_data(tvb, offset, pinfo, tree);
6518 break;
6519 case MGS_DISCONNECT:
6520 /* no data */
6521 break;
6522 case MGS_EXCEPTION:
6523 /* no data */
6524 break;
6525 case MGS_TARGET_REG:
6526 /* REQ: [mgs_target_info]
6527 * REP: [mgs_target_info] */
6528 offset = dissect_struct_mgs_target_info(tvb, offset, pinfo, tree, LUSTRE_REC_OFF);
6529 break;
6530 case MGS_TARGET_DEL:
6531 /* no data */
6532 break;
6533 case MGS_SET_INFO:
6534 /* REQ: [mgs_send_param]
6535 * REP: [mgs_send_param] */
6536 offset = display_buffer_string(tvb, pinfo, tree, offset, hf_lustre_mgs_send_param, LUSTRE_REC_OFF);
6537 break;
6538 case MGS_CONFIG_READ:
6539 /* REQ: [mgs_config_body]
6540 * REP: [mgs_config_res] */
6541 if (pb_type==PTL_RPC_MSG_REQUEST)
6542 offset = dissect_struct_mgs_config_body(tvb, offset, pinfo, tree, trans);
6543 if (pb_type==PTL_RPC_MSG_REPLY)
6544 offset = dissect_struct_mgs_config_res(tvb, offset, pinfo, tree, trans);
6545 break;
6546 default:
6547 expert_add_info_format(pinfo, tree, &ei_lustre_badopc, "UNKNOWN MGS OPCODE: %d (type: %d)", trans->opcode, pb_type);
6548 break;
6550 return offset;
6554 static int
6555 process_opcode_obd(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, lustre_trans_t *trans, uint32_t pb_type)
6557 switch (trans->opcode) {
6558 case OBD_PING:
6559 /* no data */
6560 break;
6561 case OBD_LOG_CANCEL:
6562 /* REQ: [LOGCOOKIES]
6563 REP: no data */
6564 if (pb_type==PTL_RPC_MSG_REQUEST)
6565 offset = dissect_struct_llog_cookie_array(tvb, offset, tree, LUSTRE_REC_OFF);
6566 break;
6567 case OBD_QC_CALLBACK: /* not used since 2.4 */
6568 expert_add_info(pinfo, tree, &ei_lustre_obsopc);
6569 break;
6570 case OBD_IDX_READ:
6571 /* REQ: [idx_info]
6572 REP: [idx_info] */
6573 offset = dissect_struct_idx_info(tvb, offset, tree, LUSTRE_REC_OFF);
6574 break;
6575 default:
6576 expert_add_info_format(pinfo, tree, &ei_lustre_badopc, "UNKNOWN OBD OPCODE: %d (type: %d)", trans->opcode, pb_type);
6578 return offset;
6581 static int
6582 process_opcode_llog(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, lustre_trans_t *trans, uint32_t pb_type)
6584 switch (trans->opcode) {
6585 case LLOG_ORIGIN_HANDLE_CREATE:
6586 /* REQ: [LLOG BODY][NAME][MDT BODY]
6587 REP: [LLOG BODY] */
6588 offset = dissect_struct_llogd_body(tvb, offset, tree, LUSTRE_REC_OFF);
6589 if (pb_type == PTL_RPC_MSG_REQUEST) {
6590 offset = display_buffer_string(tvb, pinfo, tree, offset, hf_lustre_name, LUSTRE_REC_OFF+1);
6591 offset = dissect_struct_mdt_body(tvb, offset, tree, LUSTRE_REC_OFF+2);
6593 break;
6594 case LLOG_ORIGIN_HANDLE_NEXT_BLOCK:
6595 case LLOG_ORIGIN_HANDLE_PREV_BLOCK:
6596 /* REQ: [LLOG BODY]
6597 REP: [LLOG BODY][EADATA] */
6598 offset = dissect_struct_llogd_body(tvb, offset, tree, LUSTRE_REC_OFF);
6599 if (pb_type == PTL_RPC_MSG_REPLY)
6600 offset = dissect_llog_eadata(tvb, offset, pinfo, tree, LUSTRE_REC_OFF+1);
6601 break;
6602 case LLOG_ORIGIN_HANDLE_READ_HEADER:
6603 /* REQ: [LLOG BODY]
6604 REP: [LLOG LOG HDR] */
6605 if (pb_type == PTL_RPC_MSG_REQUEST)
6606 offset = dissect_struct_llogd_body(tvb, offset, tree, LUSTRE_REC_OFF);
6607 if (pb_type == PTL_RPC_MSG_REPLY)
6608 offset = dissect_struct_llog_log_hdr(tvb, offset, pinfo, tree, LUSTRE_REC_OFF);
6609 break;
6610 case LLOG_ORIGIN_CONNECT:
6611 /* REQ: [LLOG CONN BODY]
6612 REP: no data */
6613 if (pb_type == PTL_RPC_MSG_REQUEST)
6614 offset = dissect_struct_llogd_conn_body(tvb, offset, tree, LUSTRE_REC_OFF);
6615 break;
6616 case LLOG_ORIGIN_HANDLE_DESTROY:
6617 /* REQ: [LLOG BODY]
6618 REP: [LLOG BODY] */
6619 offset = dissect_struct_llogd_body(tvb, offset, tree, LUSTRE_REC_OFF);
6620 break;
6621 case LLOG_CATINFO:
6622 expert_add_info(pinfo, tree, &ei_lustre_obsopc);
6623 /* @@ data? */
6624 break;
6625 case LLOG_ORIGIN_HANDLE_WRITE_REC:
6626 expert_add_info(pinfo, tree, &ei_lustre_obsopc);
6627 /* @@ obsolete since AT LEAST 2.0 */
6628 break;
6629 case LLOG_ORIGIN_HANDLE_CLOSE:
6630 /* no data */
6631 break;
6632 default:
6633 expert_add_info_format(pinfo, tree, &ei_lustre_badopc, "UNKNOWN LLOG OPCODE: %d (type: %d)", trans->opcode, pb_type);
6635 return offset;
6638 static int
6639 process_opcode_quota(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, lustre_trans_t *trans, uint32_t pb_type)
6641 switch (trans->opcode) {
6642 case QUOTA_DQACQ:
6643 /* REQ: [QUOTA BODY]
6644 REP: [QUOTA BODY] */
6645 offset = dissect_struct_quota_body(tvb, offset, tree, LUSTRE_REC_OFF);
6646 break;
6647 case QUOTA_DQREL:
6648 /* no data */
6649 break;
6650 default:
6651 expert_add_info_format(pinfo, tree, &ei_lustre_badopc, "UNKNOWN QUOTA OPCODE: %d (type: %d)", trans->opcode, pb_type);
6653 return offset;
6656 static int
6657 process_opcode_seq(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, lustre_trans_t *trans, uint32_t pb_type)
6659 int buffer = LUSTRE_REC_OFF;
6660 switch (trans->opcode) {
6661 case SEQ_QUERY:
6662 /* REQ: [SEQ OPC][SEQ RANGE]
6663 REP: [SEQ RANGE] */
6664 if (pb_type == PTL_RPC_MSG_REQUEST) {
6665 trans->sub_opcode = tvb_get_letohl(tvb, offset);
6666 proto_tree_add_item(tree, hf_lustre_seq_opc, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6667 offset += 4;
6668 offset = add_extra_padding(tvb, offset, pinfo, tree);
6669 ++buffer;
6671 offset = dissect_struct_seq_range(tvb, offset, tree, buffer);
6672 break;
6673 default:
6674 expert_add_info_format(pinfo, tree, &ei_lustre_badopc, "UNKNOWN SEQ OPCODE: %d (type: %d)", trans->opcode, pb_type);
6676 return offset;
6679 static int
6680 process_opcode_fld(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, lustre_trans_t *trans, uint32_t pb_type)
6682 int buffer = LUSTRE_REC_OFF;
6683 switch (trans->opcode) {
6684 case FLD_QUERY:
6685 /* REQ: [FLD OPC][FLD MDFLD]
6686 REP: [FLD MDFLD] */
6687 if (pb_type == PTL_RPC_MSG_REQUEST) {
6688 trans->sub_opcode = tvb_get_letohl(tvb, offset);
6689 proto_tree_add_item(tree, hf_lustre_fld_opc, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6690 offset += 4;
6691 offset = add_extra_padding(tvb, offset, pinfo, tree);
6692 ++buffer;
6694 offset = dissect_struct_seq_range(tvb, offset, tree, buffer);
6695 break;
6696 case FLD_READ:
6697 /* REQ: [FLD MDFLD]
6698 REP: [GENERIC DATA] */
6699 if (pb_type == PTL_RPC_MSG_REQUEST)
6700 offset = dissect_struct_seq_range(tvb, offset, tree, buffer);
6701 if (pb_type == PTL_RPC_MSG_REPLY)
6702 offset = display_buffer_data(tvb, pinfo, offset, tree, buffer, NULL);
6703 break;
6704 default:
6705 expert_add_info_format(pinfo, tree, &ei_lustre_badopc, "UNKNOWN FLD OPCODE: %d (type: %d)", trans->opcode, pb_type);
6707 return offset;
6710 static int
6711 process_opcode_out_update(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, lustre_trans_t *trans, uint32_t pb_type)
6713 int buffer = LUSTRE_REC_OFF;
6714 switch (trans->opcode) {
6715 case OUT_UPDATE:
6716 /* REQ: [OUT UDPATE HEADER][OUT UPDATE BUFFER]
6717 REP: [OUT UPDATE REPLY] */
6718 if (pb_type == PTL_RPC_MSG_REQUEST) {
6719 offset = dissect_struct_out_update_header(tvb, offset, pinfo, tree, buffer++);
6720 offset = dissect_struct_out_update_buffer(tvb, offset, pinfo, tree, buffer);
6722 if (pb_type == PTL_RPC_MSG_REPLY)
6723 offset = dissect_struct_obj_update_reply(tvb, offset, pinfo, tree, buffer);
6724 break;
6725 default:
6726 expert_add_info_format(pinfo, tree, &ei_lustre_badopc, "UNKNOWN OUT OPCODE: %d (type: %d)", trans->opcode, pb_type);
6728 return offset;
6731 static int
6732 process_opcode_lfsck(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, lustre_trans_t *trans, uint32_t pb_type)
6734 int buffer = LUSTRE_REC_OFF;
6735 switch (trans->opcode) {
6736 case LFSCK_NOTIFY:
6737 /* REQ: [LFSCK REQ]
6738 REP: no data */
6739 if (pb_type == PTL_RPC_MSG_REQUEST)
6740 offset = dissect_struct_lfsck_request(tvb, offset, tree, buffer);
6741 break;
6742 case LFSCK_QUERY:
6743 /* REQ: [LFSCK REQ]
6744 REP: [LFSCK REP] */
6745 if (pb_type == PTL_RPC_MSG_REQUEST)
6746 offset = dissect_struct_lfsck_request(tvb, offset, tree, buffer);
6747 if (pb_type == PTL_RPC_MSG_REPLY)
6748 offset = dissect_struct_lfsck_reply(tvb, offset, tree, buffer);
6749 break;
6750 default:
6751 expert_add_info_format(pinfo, tree, &ei_lustre_badopc, "UNKNOWN LFSCK OPCODE: %d (type: %d)", trans->opcode, pb_type);
6753 return offset;
6756 /******************************************************************** \
6758 * Message Dissectors and Helpers
6760 \********************************************************************/
6761 /* process lustre opcode :
6762 check if opcode is in range_opcode, and call the corresponding opcode process function */
6763 static int
6764 lustre_opcode_process(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree * tree, lustre_trans_t *trans, uint32_t pb_type)
6766 /* No more buffers to process */
6767 if (LUSTRE_BUFCOUNT == 1)
6768 return offset;
6770 /* OST opcodes */
6771 if (trans->opcode <= OST_LAST_OPC)
6772 return process_opcode_ost(tvb, offset, pinfo, tree, trans, pb_type);
6774 /* MDS opcodes */
6775 if ((trans->opcode >= MDS_FIRST_OPC) && (trans->opcode < MDS_LAST_OPC))
6776 return process_opcode_mds(tvb, offset, pinfo, tree, trans, pb_type);
6778 /*LDLM Opcodes*/
6779 if ((trans->opcode >= LDLM_FIRST_OPC) && (trans->opcode < LDLM_LAST_OPC))
6780 return process_opcode_ldlm(tvb, offset, pinfo, tree, trans, pb_type);
6782 /* MGS Opcodes */
6783 if ((trans->opcode >= MGS_FIRST_OPC) && (trans->opcode < MGS_LAST_OPC))
6784 return process_opcode_mgs(tvb, offset, pinfo, tree, trans, pb_type);
6786 /* ODB Opcodes */
6787 if ((trans->opcode >= OBD_FIRST_OPC) && (trans->opcode < OBD_LAST_OPC))
6788 return process_opcode_obd(tvb, offset, pinfo, tree, trans, pb_type);
6790 /* LLOG Opcodes */
6791 if ((trans->opcode >= LLOG_FIRST_OPC) && (trans->opcode < LLOG_LAST_OPC))
6792 return process_opcode_llog(tvb, offset, pinfo, tree, trans, pb_type);
6794 /* QUOTA Opcodes */
6795 if ((trans->opcode >= QUOTA_FIRST_OPC) && (trans->opcode < QUOTA_LAST_OPC))
6796 return process_opcode_quota(tvb, offset, pinfo, tree, trans, pb_type);
6798 /* SEQ Opcodes */
6799 if ((trans->opcode >= SEQ_FIRST_OPC) && (trans->opcode < SEQ_LAST_OPC))
6800 return process_opcode_seq(tvb, offset, pinfo, tree, trans, pb_type);
6802 /* SEC Opcodes */
6803 if ((trans->opcode >= SEC_FIRST_OPC) && (trans->opcode < SEC_LAST_OPC))
6804 /* Currently not implemented */
6805 return offset;
6807 /* FLD Opcodes */
6808 if ((trans->opcode >= FLD_FIRST_OPC) && (trans->opcode < FLD_LAST_OPC))
6809 return process_opcode_fld(tvb, offset, pinfo, tree, trans, pb_type);
6811 /* OUT Opcodes */
6812 if ((trans->opcode >= OUT_UPDATE_FIRST_OPC) && (trans->opcode < OUT_UPDATE_LAST_OPC))
6813 return process_opcode_out_update(tvb, offset, pinfo, tree, trans, pb_type);
6815 /* LFSCK Opcodes */
6816 if ((trans->opcode >= LFSCK_FIRST_OPC) && (trans->opcode < LFSCK_LAST_OPC))
6817 return process_opcode_lfsck(tvb, offset, pinfo, tree, trans, pb_type);
6819 /* Unrecognized OPCODE */
6820 expert_add_info_format(pinfo, tree, &ei_lustre_badopc, "BAD OPCODE: %d (type: %d)", trans->opcode, pb_type);
6822 return offset;
6825 static int
6826 dissect_struct_msg_v1(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, lustre_trans_t *trans)
6828 //proto_item *item = NULL;
6829 uint32_t bufcount, i;
6830 int old_offset;
6832 old_offset = offset;
6834 /* struct lustre_msg_v1 { */
6835 /* struct lustre_handle lm_handle; */
6836 /* __u32 lm_magic; */
6837 /* __u32 lm_type; */
6838 /* __u32 lm_version; */
6839 /* __u32 lm_opc; */
6840 /* __u64 lm_last_xid; */
6841 /* __u64 lm_last_committed; */
6842 /* __u64 lm_transno; */
6843 /* __u32 lm_status; */
6844 /* __u32 lm_flags; */
6845 /* __u32 lm_conn_cnt; */
6846 /* __u32 lm_bufcount; */
6847 /* __u32 lm_buflens[0]; */
6848 /* }; */
6849 offset = dissect_struct_lustre_handle(tvb, offset, tree, hf_lustre_lustre_msg_v1_lm_handle);
6850 proto_tree_add_item(tree, hf_lustre_lustre_msg_v1_lm_magic, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6851 offset += 4;
6852 proto_tree_add_item(tree, hf_lustre_lustre_msg_v1_lm_type, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6853 offset += 4;
6854 proto_tree_add_item(tree, hf_lustre_lustre_msg_v1_lm_version, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6855 offset += 4;
6856 proto_tree_add_item_ret_uint(tree, hf_lustre_lustre_msg_v1_lm_opc, tvb, offset, 4, ENC_LITTLE_ENDIAN, &trans->opcode);
6857 offset += 4;
6858 proto_tree_add_item(tree, hf_lustre_lustre_msg_v1_lm_last_xid, tvb, offset, 8, ENC_LITTLE_ENDIAN);
6859 offset += 8;
6860 proto_tree_add_item(tree, hf_lustre_lustre_msg_v1_lm_last_committed, tvb, offset, 8, ENC_LITTLE_ENDIAN);
6861 offset += 8;
6862 proto_tree_add_item(tree, hf_lustre_lustre_msg_v1_lm_transno, tvb, offset, 8, ENC_LITTLE_ENDIAN);
6863 offset += 8;
6864 proto_tree_add_item(tree, hf_lustre_lustre_msg_v1_lm_status, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6865 offset += 4;
6866 proto_tree_add_item(tree, hf_lustre_lustre_msg_v1_lm_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6867 offset += 4;
6868 proto_tree_add_item(tree, hf_lustre_lustre_msg_v1_lm_conn_cnt, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6869 offset += 4;
6870 proto_tree_add_item_ret_uint(tree, hf_lustre_lustre_msg_v1_lm_bufcount, tvb, offset, 4, ENC_LITTLE_ENDIAN, &bufcount);
6871 offset += 4;
6873 for (i = 0; i < bufcount; ++i) {
6874 proto_tree_add_item(tree, hf_lustre_lustre_msg_v1_lm_buflens, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6875 offset += 4;
6877 // add padding if bufcount is odd
6878 if (bufcount & 1) {
6879 proto_tree_add_item(tree, hf_lustre_extra_padding, tvb, offset, 4, ENC_NA);
6880 offset += 4;
6883 /* @@ HERE - Something, something, something ... */
6885 proto_item_set_len(tree, offset-old_offset);
6887 return offset;
6890 static int
6891 dissect_struct_msg_v2(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, lustre_trans_t *trans)
6893 uint32_t bufcount;
6894 int old_offset;
6895 uint32_t i;
6896 uint32_t buf_len_offset;
6897 uint32_t current_buf_len;
6898 uint32_t pb_type;
6900 old_offset = offset;
6902 /* struct lustre_msg_v2 { */
6903 /* uint32 lm_bufcount; */
6904 /* uint32 lm_secflvr; */
6905 /* uint32 lm_magic; */
6906 /* uint32 lm_repsize; */
6907 /* uint32 lm_cksum; */
6908 /* uint32 lm_flags; */
6909 /* uint32 lm_padding_2; */
6910 /* uint32 lm_padding_3; */
6911 /* uint32 lm_buflens[0]; */
6912 /* } */
6913 proto_tree_add_item_ret_uint(tree, hf_lustre_lustre_msg_v2_lm_bufcount, tvb, offset, 4, ENC_LITTLE_ENDIAN, &bufcount);
6914 offset += 4;
6915 proto_tree_add_item(tree, hf_lustre_lustre_msg_v2_lm_secflvr, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6916 offset += 4;
6917 proto_tree_add_item(tree, hf_lustre_lustre_msg_v2_lm_magic, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6918 offset += 4;
6919 proto_tree_add_item(tree, hf_lustre_lustre_msg_v2_lm_repsize, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6920 offset += 4;
6921 proto_tree_add_item(tree, hf_lustre_lustre_msg_v2_lm_cksum, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6922 offset += 4;
6923 proto_tree_add_item(tree, hf_lustre_lustre_msg_v2_lm_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6924 offset += 4;
6925 proto_tree_add_item(tree, hf_lustre_lustre_msg_v2_lm_padding_2, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6926 offset += 4;
6927 proto_tree_add_item(tree, hf_lustre_lustre_msg_v2_lm_padding_3, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6928 offset += 4;
6930 buf_len_offset=offset;
6931 for (i = 0; i < bufcount; ++i) {
6932 proto_tree_add_item(tree, hf_lustre_lustre_msg_v2_lm_buflens, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6933 offset += 4;
6936 /* we add an extra padding if bufcount is odd */
6937 if (bufcount & 1) {
6938 proto_tree_add_item(tree, hf_lustre_extra_padding, tvb, offset, 4, ENC_NA);
6939 offset += 4;
6942 current_buf_len = tvb_get_letohl(tvb, buf_len_offset);
6943 offset = dissect_struct_ptlrpc_body(tvb, pinfo, tree, offset, current_buf_len, trans, &pb_type);
6945 offset = lustre_opcode_process(tvb, offset, pinfo, tree, trans, pb_type);
6947 proto_item_set_len(tree, offset-old_offset);
6949 return offset;
6953 /********************************************************************\
6955 * Core Functions
6957 \********************************************************************/
6959 /* Code to actually dissect the packets */
6960 static int
6961 dissect_lustre(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
6963 uint32_t magic_number;
6964 unsigned offset = 0;
6965 proto_item *ti = NULL;
6966 proto_tree *lustre_tree = NULL;
6967 struct lnet_trans_info *info = (struct lnet_trans_info *)data;
6968 lustre_trans_t *trans = lustre_get_trans(pinfo, info);
6970 col_set_str(pinfo->cinfo, COL_PROTOCOL, "Lustre");
6971 col_clear(pinfo->cinfo, COL_INFO);
6973 ti = proto_tree_add_item(tree, proto_lustre, tvb, 0, -1, ENC_NA);
6974 lustre_tree = proto_item_add_subtree(ti, ett_lustre);
6976 magic_number = tvb_get_letohl(tvb, 8);
6978 switch (magic_number) {
6979 case MSG_MAGIC_V1:
6980 /* This hasn't been used since before Lustre 1.8.0 */
6981 expert_add_info(pinfo, tree, &ei_lustre_obsopc);
6982 proto_item_append_text(lustre_tree, " V1 ");
6983 offset = dissect_struct_msg_v1(tvb, offset, pinfo, lustre_tree, trans);
6984 break;
6986 case MSG_MAGIC_V2:
6987 /* put some nice info */
6988 proto_item_append_text(lustre_tree, " V2 ");
6989 offset = dissect_struct_msg_v2(tvb, offset, pinfo, lustre_tree, trans);
6990 break;
6992 default:
6993 expert_add_info(pinfo, lustre_tree, &ei_lustre_badmagic);
6994 break;
6997 return offset;
7000 void
7001 proto_reg_handoff_lustre(void)
7003 /* we use Lustre only if we get ptl_index = One of this code (we have removed the bulk code) */
7004 /* in LNET we test if the message is a put or not before adding an lnet.ptl_index value */
7005 dissector_add_uint("lnet.ptl_index", MDS_MDS_PORTAL, lustre_handle);
7006 dissector_add_uint("lnet.ptl_index", MDC_REPLY_PORTAL, lustre_handle);
7007 dissector_add_uint("lnet.ptl_index", CONNMGR_REQUEST_PORTAL, lustre_handle);
7008 dissector_add_uint("lnet.ptl_index", CONNMGR_REPLY_PORTAL, lustre_handle);
7009 dissector_add_uint("lnet.ptl_index", OSC_REPLY_PORTAL, lustre_handle);
7010 dissector_add_uint("lnet.ptl_index", OST_IO_PORTAL, lustre_handle);
7011 dissector_add_uint("lnet.ptl_index", OST_CREATE_PORTAL, lustre_handle);
7012 dissector_add_uint("lnet.ptl_index", MDC_REPLY_PORTAL, lustre_handle);
7013 dissector_add_uint("lnet.ptl_index", MDS_REQUEST_PORTAL, lustre_handle);
7014 dissector_add_uint("lnet.ptl_index", LDLM_CB_REQUEST_PORTAL, lustre_handle);
7015 dissector_add_uint("lnet.ptl_index", LDLM_CB_REPLY_PORTAL, lustre_handle);
7016 dissector_add_uint("lnet.ptl_index", LDLM_CANCEL_REQUEST_PORTAL, lustre_handle);
7017 dissector_add_uint("lnet.ptl_index", LDLM_CANCEL_REPLY_PORTAL, lustre_handle);
7018 dissector_add_uint("lnet.ptl_index", MDS_SETATTR_PORTAL, lustre_handle);
7019 dissector_add_uint("lnet.ptl_index", MDS_READPAGE_PORTAL, lustre_handle);
7020 dissector_add_uint("lnet.ptl_index", MGC_REPLY_PORTAL, lustre_handle);
7021 dissector_add_uint("lnet.ptl_index", MGS_REQUEST_PORTAL, lustre_handle);
7022 dissector_add_uint("lnet.ptl_index", MGS_REPLY_PORTAL, lustre_handle);
7023 dissector_add_uint("lnet.ptl_index", OST_REQUEST_PORTAL, lustre_handle);
7024 dissector_add_uint("lnet.ptl_index", FLD_REQUEST_PORTAL, lustre_handle);
7025 dissector_add_uint("lnet.ptl_index", SEQ_METADATA_PORTAL, lustre_handle);
7026 dissector_add_uint("lnet.ptl_index", SEQ_DATA_PORTAL, lustre_handle);
7027 dissector_add_uint("lnet.ptl_index", SEQ_CONTROLLER_PORTAL, lustre_handle);
7031 /* Register the protocol with Wireshark.
7033 * This format is required because a script is used to build the C function that
7034 * calls all the protocol registration.
7036 void
7037 proto_register_lustre(void)
7039 static hf_register_info hf[] = {
7040 /* Message V1 */
7041 { &hf_lustre_lustre_msg_v1_lm_magic,
7042 { "Lm Magic", "lustre.lustre_msg_v1.lm_magic", FT_UINT32, BASE_HEX, VALS(lustre_magic), 0, NULL, HFILL }},
7043 { &hf_lustre_lustre_msg_v1_lm_handle,
7044 { "Lm Handle", "lustre.lustre_msg_v1.lm_handle", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7045 { &hf_lustre_lustre_msg_v1_lm_last_xid,
7046 { "Lm Last Xid", "lustre.lustre_msg_v1.lm_last_xid", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
7047 { &hf_lustre_lustre_msg_v1_lm_status,
7048 { "Lm Status", "lustre.lustre_msg_v1.lm_status", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7049 { &hf_lustre_lustre_msg_v1_lm_type,
7050 { "Lm Type", "lustre.lustre_msg_v1.lm_type", FT_UINT32, BASE_DEC, VALS(lustre_LMTypes), 0, NULL, HFILL }},
7051 { &hf_lustre_lustre_msg_v1_lm_flags,
7052 { "Lm Flags", "lustre.lustre_msg_v1.lm_flags", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
7053 { &hf_lustre_lustre_msg_v1_lm_last_committed,
7054 { "Lm Last Committed", "lustre.lustre_msg_v1.lm_last_committed", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
7055 { &hf_lustre_lustre_msg_v1_lm_buflens,
7056 { "Lm Buflens", "lustre.lustre_msg_v1.lm_buflens", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7057 { &hf_lustre_lustre_msg_v1_lm_conn_cnt,
7058 { "Lm Conn Cnt", "lustre.lustre_msg_v1.lm_conn_cnt", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7059 { &hf_lustre_lustre_msg_v1_lm_transno,
7060 { "Lm Transno", "lustre.lustre_msg_v1.lm_transno", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
7061 { &hf_lustre_lustre_msg_v1_lm_opc,
7062 { "Lm Opc", "lustre.lustre_msg_v1.lm_opc", FT_UINT32, BASE_DEC, VALS(lustre_op_codes), 0, NULL, HFILL }},
7063 { &hf_lustre_lustre_msg_v1_lm_version,
7064 { "Lm Version", "lustre.lustre_msg_v1.lm_version", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7065 { &hf_lustre_lustre_msg_v1_lm_bufcount,
7066 { "Lm Bufcount", "lustre.lustre_msg_v1.lm_bufcount", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7068 /* Message V2 */
7069 { &hf_lustre_lustre_msg_v2_lm_magic,
7070 { "Lm Magic", "lustre.lustre_msg_v2.lm_magic", FT_UINT32, BASE_HEX, VALS(lustre_magic), 0, NULL, HFILL }},
7071 { &hf_lustre_lustre_msg_v2_lm_bufcount,
7072 { "Lm Bufcount", "lustre.lustre_msg_v2.lm_bufcount", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7073 { &hf_lustre_lustre_msg_v2_lm_repsize,
7074 { "Lm Repsize", "lustre.lustre_msg_v2.lm_repsize", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7075 { &hf_lustre_lustre_msg_v2_lm_cksum,
7076 { "Lm Cksum", "lustre.lustre_msg_v2.lm_cksum", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7077 { &hf_lustre_lustre_msg_v2_lm_buflens,
7078 { "Lm Buflens", "lustre.lustre_msg_v2.lm_buflens", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7079 { &hf_lustre_lustre_msg_v2_lm_flags,
7080 { "Lm Flags", "lustre.lustre_msg_v2.lm_flags", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
7081 { &hf_lustre_lustre_msg_v2_lm_secflvr,
7082 { "Lm Secflvr", "lustre.lustre_msg_v2.lm_secflvr", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
7083 { &hf_lustre_lustre_msg_v2_lm_padding_2,
7084 { "Lm Padding 2", "lustre.lustre_msg_v2.lm_padding_2", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7085 { &hf_lustre_lustre_msg_v2_lm_padding_3,
7086 { "Lm Padding 3", "lustre.lustre_msg_v2.lm_padding_3", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7088 /************************************************************
7089 * PTRL RPC
7092 /* PTRL RPC BODY */
7093 { &hf_lustre_ptlrpc_body_pb,
7094 { "PTL RPC Body", "lustre.ptlrpc_body", FT_NONE, BASE_NONE, NULL , 0 , NULL, HFILL }},
7095 { &hf_lustre_ptlrpc_body_pb_last_committed,
7096 { "Pb Last Committed", "lustre.ptlrpc_body.pb_last_committed", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
7097 { &hf_lustre_ptlrpc_body_pb_version,
7098 { "Pb Version", "lustre.ptlrpc_body.pb_version", FT_UINT32, BASE_DEC, NULL, ~LUSTRE_VERSION_MASK, NULL, HFILL }},
7099 { &hf_lustre_ptlrpc_body_pb_slv,
7100 { "Pb Slv", "lustre.ptlrpc_body.pb_slv", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
7101 { &hf_lustre_ptlrpc_body_pb_pre_version,
7102 { "Pb Pre-Version", "lustre.ptlrpc_body.pb_pre_version", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
7103 { &hf_lustre_ptlrpc_body_pb_padding,
7104 { "Pb Padding", "lustre.ptlrpc_body.pb_padding", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7105 { &hf_lustre_ptlrpc_body_pb_jobid,
7106 { "Pb JobId", "lustre.ptlrpc_body.pb_jobid", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
7107 { &hf_lustre_ptlrpc_body_pb_timeout,
7108 { "Pb Timeout", "lustre.ptlrpc_body.pb_timeout", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7109 { &hf_lustre_ptlrpc_body_pb_op_flags,
7110 { "Pb Op Flags", "lustre.ptlrpc_body.pb_op_flags", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
7111 { &hf_lustre_ptlrpc_body_pb_type,
7112 { "Pb Type", "lustre.ptlrpc_body.pb_type", FT_UINT32, BASE_DEC, VALS(lustre_LMTypes), 0, NULL, HFILL }},
7113 { &hf_lustre_ptlrpc_body_pb_flags,
7114 { "Pb Flags", "lustre.ptlrpc_body.pb_flags", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
7115 { &hf_lustre_ptlrpc_body_pb_limit,
7116 { "Pb Limit", "lustre.ptlrpc_body.pb_limit", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7117 { &hf_lustre_ptlrpc_body_pb_transno,
7118 { "Pb Transno", "lustre.ptlrpc_body.pb_transno", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
7119 { &hf_lustre_ptlrpc_body_pb_service_time,
7120 { "Pb Service Time", "lustre.ptlrpc_body.pb_service_time",FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7121 { &hf_lustre_ptlrpc_body_pb_conn_cnt,
7122 { "Pb Conn Cnt", "lustre.ptlrpc_body.pb_conn_cnt", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7123 { &hf_lustre_ptlrpc_body_pb_opc,
7124 { "Pb Opc", "lustre.ptlrpc_body.pb_opc", FT_UINT32, BASE_DEC, VALS(lustre_op_codes), 0, NULL, HFILL }},
7125 { &hf_lustre_ptlrpc_body_pb_last_seen,
7126 { "Pb Last Seen", "lustre.ptlrpc_body.pb_last_seen", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
7127 { &hf_lustre_ptlrpc_body_pb_last_xid,
7128 { "Pb Last Xid", "lustre.ptlrpc_body.pb_last_xid", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
7129 { &hf_lustre_ptlrpc_body_pb_status,
7130 { "Pb Status", "lustre.ptlrpc_body.pb_status", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7131 { &hf_lustre_ptlrpc_body_pb_handle,
7132 { "Pb Handle", "lustre.ptlrpc_body.pb_handle", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7134 /************************************************************
7135 * MDT
7138 { &hf_lustre_mdt_key,
7139 { "MDT key", "lustre.mdt_key", FT_STRING, BASE_NONE, NULL , 0 , NULL, HFILL}},
7140 { &hf_lustre_mdt_val,
7141 { "MDT val", "lustre.mdt_val", FT_STRING, BASE_NONE, NULL , 0 , NULL, HFILL}},
7143 /* MDT Getinfo */
7144 { &hf_lustre_mdt_vallen,
7145 { "MDT Val Len", "lustre.vallen", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } },
7147 /* MDT BODY */
7148 { &hf_lustre_mdt_body,
7149 { "MDT Body", "lustre.mdt_body", FT_NONE, BASE_NONE, NULL , 0 , NULL, HFILL }},
7150 { &hf_lustre_mdt_body_fid1,
7151 { "Fid1", "lustre.mdt_body.fid1", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7152 { &hf_lustre_mdt_body_fid2,
7153 { "Fid2", "lustre.mdt_body.fid2", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7154 { &hf_lustre_mdt_body_handle,
7155 { "Handle", "lustre.mdt_body.handle", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7156 { &hf_lustre_mdt_body_valid,
7157 { "Valid", "lustre.mdt_body.valid", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL }},
7158 { &hf_lustre_mdt_body_size,
7159 { "Size", "lustre.mdt_body.size", FT_UINT64, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
7160 { &hf_lustre_mdt_body_mtime,
7161 { "Mtime", "lustre.mdt_body.mtime",FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0, NULL, HFILL } },
7162 { &hf_lustre_mdt_body_atime,
7163 { "Atime", "lustre.mdt_body.atime",FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0, NULL, HFILL } },
7164 { &hf_lustre_mdt_body_ctime,
7165 { "Ctime", "lustre.mdt_body.ctime",FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0, NULL, HFILL } },
7166 { &hf_lustre_mdt_body_blocks,
7167 { "Blocks", "lustre.mdt_body.blocks", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
7168 { &hf_lustre_mdt_body_ioepoch,
7169 { "Ioepoch", "lustre.mdt_body.ioepoch", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
7170 { &hf_lustre_mdt_body_ino,
7171 { "Ino", "lustre.mdt_body.ino", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
7172 { &hf_lustre_mdt_body_fsuid,
7173 { "Fsuid", "lustre.mdt_body.fsuid", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7174 { &hf_lustre_mdt_body_fsgid,
7175 { "Fsgid", "lustre.mdt_body.fsgid", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7176 { &hf_lustre_mdt_body_capability,
7177 { "Capability", "lustre.mdt_body.capability", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
7178 { &hf_lustre_mdt_body_mode,
7179 { "Mode", "lustre.mdt_body.mode", FT_UINT32, BASE_OCT, NULL, 0, NULL, HFILL }},
7180 { &hf_lustre_mdt_body_uid,
7181 { "Uid", "lustre.mdt_body.uid", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7182 { &hf_lustre_mdt_body_gid,
7183 { "Gid", "lustre.mdt_body.gid", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7184 { &hf_lustre_mdt_body_flags,
7185 { "Flags", "lustre.mdt_body.flags", FT_UINT32, BASE_HEX, VALS(lustre_mds_flags_vals) , 0, NULL, HFILL }},
7186 { &hf_lustre_mdt_body_rdev,
7187 { "Rdev", "lustre.mdt_body.rdev", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7188 { &hf_lustre_mdt_body_nlink,
7189 { "Nlink", "lustre.mdt_body.nlink", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7190 { &hf_lustre_mdt_body_generation,
7191 { "Generation", "lustre.mdt_body.generation", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7192 { &hf_lustre_mdt_body_suppgid,
7193 { "Suppgid", "lustre.mdt_body.suppgid", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7194 { &hf_lustre_mdt_body_eadatasize,
7195 { "Eadatasize", "lustre.mdt_body.eadatasize", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7196 { &hf_lustre_mdt_body_aclsize,
7197 { "Aclsize", "lustre.mdt_body.aclsize", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7198 { &hf_lustre_mdt_body_max_mdsize,
7199 { "Max Mdsize", "lustre.mdt_body.max_mdsize", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7200 { &hf_lustre_mdt_body_max_cookiesize,
7201 { "Max Cookiesize", "lustre.mdt_body.max_cookiesize", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7202 { &hf_lustre_mdt_body_uid_h,
7203 { "Uid H", "lustre.mdt_body.uid_h", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7204 { &hf_lustre_mdt_body_gid_h,
7205 { "Gid H", "lustre.mdt_body.gid_h", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7206 { &hf_lustre_mdt_body_projid,
7207 { "Projid", "lustre.mdt_body.projid", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7208 { &hf_lustre_mdt_body_dom_size,
7209 { "Dom Size", "lustre.mdt_body.dom_size", FT_UINT64, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
7210 { &hf_lustre_mdt_body_dom_blocks,
7211 { "Dom Blocks", "lustre.mdt_body.dom_blocks", FT_UINT64, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
7212 { &hf_lustre_mdt_body_btime,
7213 { "Dom Btime", "lustre.mdt_body.btime", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0, NULL, HFILL }},
7214 { &hf_lustre_mdt_body_padding_9,
7215 { "Padding 9", "lustre.mdt_body.padding_9", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
7216 { &hf_lustre_mdt_body_padding_10,
7217 { "Padding 10", "lustre.mdt_body.padding_10", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
7219 /* Close Data */
7220 { &hf_lustre_close_data,
7221 { "MDT Close", "lustre.mdt_close", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7222 { &hf_lustre_close_fid,
7223 { "Close FID", "lustre.mdt_close.fid", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7224 { &hf_lustre_close_handle,
7225 { "Close Handle", "lustre.mdt_close.handle", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7226 { &hf_lustre_close_data_ver,
7227 { "Close Data Ver", "lustre.mdt_close.data_ver", FT_UINT64, BASE_HEX, NULL, 0, "Data version", HFILL } },
7228 { &hf_lustre_close_reserved,
7229 { "Close Reserved Space", "lustre.mdt_close.reserved", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7231 /* MDT REC REINT */
7232 { &hf_lustre_mdt_rec_reint,
7233 { "MDT ReInt", "lustre.mdt_rec_reint", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7234 { &hf_lustre_mdt_rec_reint_opcode,
7235 { "Opcode", "lustre.mdt_rec_reint.opcode", FT_UINT32, BASE_DEC, VALS(mds_reint_vals), 0, NULL, HFILL }},
7236 { &hf_lustre_mdt_rec_reint_cap,
7237 { "Cap", "lustre.mdt_rec_reint.cap", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
7238 { &hf_lustre_mdt_rec_reint_fsuid,
7239 { "Fsuid", "lustre.mdt_rec_reint.fsuid", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7240 { &hf_lustre_mdt_rec_reint_fsuid_h,
7241 { "Fsuid H", "lustre.mdt_rec_reint.fsuid_h", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7242 { &hf_lustre_mdt_rec_reint_fsgid,
7243 { "Fsgid", "lustre.mdt_rec_reint.fsgid", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7244 { &hf_lustre_mdt_rec_reint_fsgid_h,
7245 { "Fsgid H", "lustre.mdt_rec_reint.fsgid_h", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7246 { &hf_lustre_mdt_rec_reint_suppgid1,
7247 { "Suppgid1", "lustre.mdt_rec_reint.suppgid1", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7248 { &hf_lustre_mdt_rec_reint_suppgid1_h,
7249 { "Suppgid1 H", "lustre.mdt_rec_reint.suppgid1_h", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7250 { &hf_lustre_mdt_rec_reint_suppgid2,
7251 { "Suppgid2", "lustre.mdt_rec_reint.suppgid2", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7252 { &hf_lustre_mdt_rec_reint_suppgid2_h,
7253 { "Suppgid2 H", "lustre.mdt_rec_reint.suppgid2_h", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7254 { &hf_lustre_mdt_rec_reint_fid1,
7255 { "Fid1", "lustre.mdt_rec_reint.fid1", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7256 { &hf_lustre_mdt_rec_reint_fid2,
7257 { "Fid2", "lustre.mdt_rec_reint.fid2", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7258 { &hf_lustre_mdt_rec_reint_old_handle,
7259 { "Old Handle", "lustre.mdt_rec_reint.old_handle", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7261 { &hf_lustre_mdt_rec_reint_mtime,
7262 { "Mod Time", "lustre.mdt_rec_reint.mtime", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0, NULL, HFILL } },
7263 { &hf_lustre_mdt_rec_reint_atime,
7264 { "Acc Time", "lustre.mdt_rec_reint.atime", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0, NULL, HFILL } },
7265 { &hf_lustre_mdt_rec_reint_ctime,
7266 { "Cr Time", "lustre.mdt_rec_reint.ctime", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0, NULL, HFILL } },
7267 { &hf_lustre_mdt_rec_reint_size64,
7268 { "Size", "lustre.mdt_rec_reint.size64", FT_UINT64, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
7269 { &hf_lustre_mdt_rec_reint_blocks,
7270 { "Blocks", "lustre.mdt_rec_reint.blocks", FT_UINT64, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
7271 { &hf_lustre_mdt_rec_reint_bias,
7272 { "Bias", "lustre.mdt_rec_reint.bias", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
7273 { &hf_lustre_mdt_rec_reint_mode,
7274 { "Mode", "lustre.mdt_rec_reint.mode", FT_UINT32, BASE_OCT, NULL, 0, NULL, HFILL }},
7275 { &hf_lustre_mdt_rec_reint_flags,
7276 { "Flags(L)", "lustre.mdt_rec_reint.flags", FT_UINT32, BASE_OCT, NULL, 0, "Low order flags", HFILL }},
7277 { &hf_lustre_mdt_rec_reint_flags_h,
7278 { "Flags(H)", "lustre.mdt_rec_reint.flags_h", FT_UINT32, BASE_OCT, NULL, 0, "High order flags", HFILL }},
7279 { &hf_lustre_mdt_rec_reint_attr_flags,
7280 { "Attr Flags", "lustre.mdt_rec_reint.attr_flags", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
7281 { &hf_lustre_mdt_rec_reint_umask,
7282 { "Umask", "lustre.mdt_rec_reint.umask", FT_UINT32, BASE_OCT, NULL, 0, NULL, HFILL }},
7284 { &hf_lustre_mdt_rec_reint_time,
7285 { "Time", "lustre.mdt_rec_reint.time", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0, NULL, HFILL } },
7286 { &hf_lustre_mdt_rec_reint_size32,
7287 { "Size", "lustre.mdt_rec_reint.size32", FT_UINT32, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
7288 { &hf_lustre_mdt_rec_reint_rdev,
7289 { "RDev", "lustre.mdt_rec_reint.rdev", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
7290 { &hf_lustre_mdt_rec_reint_ioepoch,
7291 { "Ioepoch", "lustre.mdt_rec_reint.ioepoch", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL } },
7292 { &hf_lustre_mdt_rec_reint_valid,
7293 { "Valid", "lustre.mdt_rec_reint.valid", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL }},
7294 { &hf_lustre_mdt_rec_reint_uid,
7295 { "Uid", "lustre.mdt_rec_reint.uid", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7296 { &hf_lustre_mdt_rec_reint_gid,
7297 { "Gid", "lustre.mdt_rec_reint.gid", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7298 { &hf_lustre_mdt_rec_reint_projid,
7299 { "ProjID", "lustre.mdt_rec_reint.projid", FT_UINT32, BASE_DEC, NULL, 0, "Project ID", HFILL }},
7300 { &hf_lustre_mdt_rec_reint_padding,
7301 { "Padding", "lustre.mdt_rec_reint.padding", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7303 /* struct mdt_ioepoch */
7304 { &hf_lustre_mdt_ioepoch,
7305 { "MDT ioepoch", "lustre.mdt_ioepoch", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7306 { &hf_lustre_mdt_ioepoch_ioepoch,
7307 { "Ioepoch", "lustre.mdt_ioepoch.ioepoch", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL } },
7308 { &hf_lustre_mdt_ioepoch_flags,
7309 { "Flags", "lustre.mdt_ioepoch.flags", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } },
7310 { &hf_lustre_mdt_ioepoch_padding,
7311 { "Padding", "lustre.mdt_ioepoch.padding", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7312 { &hf_lustre_mdt_ioepoch_handle,
7313 { "Handle", "lustre.mdt_ioepoch.handle", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7315 /* struct mdc_swap_layouts */
7316 { &hf_lustre_mdc_swap_layouts,
7317 { "MDC Swap Layouts", "lustre.mdc_swap_layouts", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7318 { &hf_lustre_mdc_swap_layouts_flags,
7319 { "Flags", "lustre.mdc_swap_layouts.flags", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL } },
7322 /************************************************************
7323 * HSM
7326 /* HSM Request */
7327 { &hf_lustre_hsm_req,
7328 { "HSM Request", "lustre.hsm_req", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7329 { &hf_lustre_hsm_req_action,
7330 { "HR Action", "lustre.hsm_req.action", FT_UINT32, BASE_HEX, VALS(hsm_user_action_vals), 0, NULL, HFILL } },
7331 { &hf_lustre_hsm_req_archive_id,
7332 { "HR Archive ID", "lustre.hsm_req.archive_id", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } },
7333 { &hf_lustre_hsm_req_flags,
7334 { "HR Flags", "lustre.hsm_req.flags", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL } },
7335 { &hf_lustre_hsm_req_itemcount,
7336 { "HR Itemcount", "lustre.hsm_req.itemcount", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } },
7337 { &hf_lustre_hsm_req_data_len,
7338 { "HR Data Length", "lustre.hsm_req.data_len", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } },
7340 /* HSM EXTENT */
7341 { &hf_lustre_hsm_extent,
7342 { "HSM Extent", "lustre.hsm_extent", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7343 { &hf_lustre_hsm_extent_offset,
7344 { "Offset", "lustre.hsm_extent.offset", FT_UINT64, BASE_DEC_HEX, NULL, 0, NULL, HFILL } },
7345 { &hf_lustre_hsm_extent_length,
7346 { "Length", "lustre.hsm_extent.len", FT_UINT64, BASE_DEC_HEX, NULL, 0, NULL, HFILL } },
7348 /* HSM PROGRESS */
7349 { &hf_lustre_hsm_prog,
7350 { "HSM Progress", "lustre.hsm_progress", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7351 { &hf_lustre_hsm_prog_fid,
7352 { "HSM Prog FID", "lustre.hsm_progress.fid", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7353 { &hf_lustre_hsm_prog_cookie,
7354 { "HSM Prog Cookie", "lustre.hsm_progress.cookie", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL } },
7355 { &hf_lustre_hsm_prog_flags,
7356 { "HSM Prog Flags", "lustre.hsm_progress.flags", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } },
7357 { &hf_lustre_hsm_prog_errval,
7358 { "HSM Prog Error Val", "lustre.hsm_progress.errval", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } },
7359 { &hf_lustre_hsm_prog_data_ver,
7360 { "HSM Prog Data Version", "lustre.hsm_progress.data_ver", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL } },
7361 { &hf_lustre_hsm_prog_padding1,
7362 { "HSM Padding1", "lustre.hsm_progress.padding1", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } },
7363 { &hf_lustre_hsm_prog_padding2,
7364 { "HSM Padding2", "lustre.hsm_progress.padding2", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL } },
7366 /* HSM STATE GET */
7367 { &hf_lustre_hsm_user_state,
7368 { "HSM User State", "lustre.hsm_state_get", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7369 { &hf_lustre_hsm_us_states,
7370 { "States", "lustre.hsm_state_get.states", FT_UINT32, BASE_HEX, VALS(hsm_state_vals), 0, NULL, HFILL } },
7371 { &hf_lustre_hsm_us_archive_id,
7372 { "Archive ID", "lustre.hsm_state_get.archive_id", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } },
7373 { &hf_lustre_hsm_us_in_prog_state,
7374 { "In Progress State", "lustre.hsm_state_get.in_prog.state",
7375 FT_UINT32, BASE_HEX, VALS(hsm_progress_state_vals), 0, NULL, HFILL } },
7376 { &hf_lustre_hsm_us_in_prog_action,
7377 { "In Progress Action", "lustre.hsm_state_get.in_prog.action",
7378 FT_UINT32, BASE_HEX, VALS(hsm_user_action_vals), 0, NULL, HFILL } },
7379 { &hf_lustre_hsm_us_ext_info,
7380 { "Extended Info", "lustre.hsm_state_get.ext_info", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7382 /* HSM STATE SET */
7383 { &hf_lustre_hsm_state_set,
7384 { "HSM State Set", "lustre.hsm_state_set", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7385 { &hf_lustre_hsm_hss_valid,
7386 { "Valid", "lustre.hsm_state_set.valid", FT_UINT32, BASE_HEX, VALS(hss_valid), 0, NULL, HFILL } },
7387 { &hf_lustre_hsm_hss_archive_id,
7388 { "Archive Id", "lustre.hsm_state_set.archive_id", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } },
7389 { &hf_lustre_hsm_hss_setmask,
7390 { "Set Mask", "lustre.hsm_state_set.setmask",
7391 FT_UINT32, BASE_HEX, VALS(hsm_state_vals), 0, NULL, HFILL } },
7392 { &hf_lustre_hsm_hss_clearmask,
7393 { "Clear Mask", "lustre.hsm_state_set.clearmask",
7394 FT_UINT32, BASE_HEX, VALS(hsm_state_vals), 0, NULL, HFILL } },
7396 /* HSM CURRENT ACTION */
7397 { &hf_lustre_hsm_current_action,
7398 { "HSM Current Action", "lustre.hsm_current_action", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7399 { &hf_lustre_hsm_current_action_state,
7400 { "State", "lustre.hsm_current_action.state", FT_UINT32, BASE_HEX, VALS(hsm_progress_state_vals), 0, NULL, HFILL } },
7401 { &hf_lustre_hsm_current_action_action,
7402 { "Action", "lustre.hsm_current_action.action", FT_UINT32, BASE_HEX, VALS(hsm_user_action_vals), 0, NULL, HFILL } },
7404 /* HSM ARCHIVE */
7405 { &hf_lustre_hsm_archive,
7406 { "HSM Archive", "lustre.hsm_archive", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7407 { &hf_lustre_hsm_archive_id,
7408 { "ID", "lustre.hsm_archive.id", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7411 /************************************************************
7412 * OBD
7415 /* OBD IO Object */
7416 { &hf_lustre_obd_ioobj,
7417 { "OBD IO OBJ", "lustre.obd_ioobj", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7418 { &hf_lustre_obd_ioobj_ioo_id,
7419 { "Ioo Id", "lustre.obd_ioobj.ioo_id", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
7420 { &hf_lustre_obd_ioobj_ioo_seq,
7421 { "Ioo Gr", "lustre.obd_ioobj.ioo_seq", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
7422 { &hf_lustre_obd_ioobj_ioo_max_brw,
7423 { "Ioo Max BRW Size", "lustre.obd_ioobj.ioo_max_brw", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } },
7424 { &hf_lustre_obd_ioobj_ioo_bufcnt,
7425 { "Ioo Bufcnt", "lustre.obd_ioobj.ioo_bufcnt", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7427 /* OBD STATFS */
7428 { &hf_lustre_obd_statfs,
7429 { "OBD Statfs", "lustre.obd_statfs", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7430 { &hf_lustre_obd_statfs_os_type,
7431 { "Os Type", "lustre.obd_statfs.os_type", FT_UINT64, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
7432 { &hf_lustre_obd_statfs_os_bavail,
7433 { "Os Bavail", "lustre.obd_statfs.os_bavail", FT_UINT64, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
7434 { &hf_lustre_obd_statfs_os_bsize,
7435 { "Os Bsize", "lustre.obd_statfs.os_bsize", FT_UINT32, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
7436 { &hf_lustre_obd_statfs_os_maxbytes,
7437 { "Os Maxbytes", "lustre.obd_statfs.os_maxbytes", FT_UINT64, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
7438 { &hf_lustre_obd_statfs_os_ffree,
7439 { "Os Ffree", "lustre.obd_statfs.os_ffree", FT_UINT64, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
7440 { &hf_lustre_obd_statfs_os_files,
7441 { "Os Files", "lustre.obd_statfs.os_files", FT_UINT64, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
7442 { &hf_lustre_obd_statfs_os_bfree,
7443 { "Os Bfree", "lustre.obd_statfs.os_bfree", FT_UINT64, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
7444 { &hf_lustre_obd_statfs_os_namelen,
7445 { "Os Namelen", "lustre.obd_statfs.os_namelen", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7446 { &hf_lustre_obd_statfs_os_blocks,
7447 { "Os Blocks", "lustre.obd_statfs.os_blocks", FT_UINT64, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
7448 { &hf_lustre_obd_statfs_os_fsid,
7449 { "Os Fsid", "lustre.obd_statfs.os_fsid", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
7450 { &hf_lustre_obd_statfs_os_state,
7451 { "Os State", "lustre.obd_statfs.os_state", FT_UINT32, BASE_HEX, VALS(obd_statfs_state), 0, NULL, HFILL }},
7452 { &hf_lustre_obd_statfs_os_fprecreated,
7453 { "Os F Precreate", "lustre.obd_statfs.os_fprecreated", FT_UINT32, BASE_DEC, NULL, 0, "objs available now to the caller", HFILL }},
7454 { &hf_lustre_obd_statfs_os_granted,
7455 { "Os Granted", "lustre.obd_statfs.os_granted", FT_UINT32, BASE_DEC_HEX, NULL, 0, "space granted for MDS", HFILL }},
7456 { &hf_lustre_obd_statfs_os_spare,
7457 { "Os Spare", "lustre.obd_statfs.os_spare", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7459 /* OBD Connect Data */
7460 { &hf_lustre_obd_connect_data,
7461 { "OBD Connect Data", "lustre.obd_connect_data", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7462 { &hf_lustre_obd_connect_data_ocd_connect_flags,
7463 { "Ocd Connect Flags", "lustre.obd_connect_data.ocd_connect_flags", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL } },
7464 { &hf_lustre_obd_connect_data_ocd_version,
7465 { "Ocd Version", "lustre.obd_connect_data.ocd_version", FT_UINT32, BASE_CUSTOM, CF_FUNC(lustre_fmt_ver), 0, NULL, HFILL } },
7466 { &hf_lustre_obd_connect_data_ocd_grant,
7467 { "Ocd Grant", "lustre.obd_connect_data.ocd_grant", FT_UINT32, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
7468 { &hf_lustre_obd_connect_data_ocd_index,
7469 { "Ocd Index", "lustre.obd_connect_data.ocd_index", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7470 { &hf_lustre_obd_connect_data_ocd_brw_size,
7471 { "Ocd Brw Size", "lustre.obd_connect_data.ocd_brw_size", FT_UINT32, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
7472 { &hf_lustre_obd_connect_data_ocd_ibits_known,
7473 { "Ocd Ibits Known", "lustre.obd_connect_data.ocd_ibits_known", FT_UINT64, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
7474 /* reversioned elements */
7475 { &hf_lustre_obd_connect_data_ocd_nllg,
7476 { "Ocd Nllg", "lustre.obd_connect_data.ocd_nllg", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7477 { &hf_lustre_obd_connect_data_ocd_nllu,
7478 { "Ocd Nllu", "lustre.obd_connect_data.ocd_nllu", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7479 { &hf_lustre_obd_connect_data_ocd_grant_blkbits,
7480 { "Ocd Grant blkbits", "lustre.obd_connect_data.grant_blkbits", FT_UINT8, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
7481 { &hf_lustre_obd_connect_data_ocd_grant_inobits,
7482 { "Ocd Grant inobits", "lustre.obd_connect_data.grant_inobits", FT_UINT8, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
7483 { &hf_lustre_obd_connect_data_ocd_grant_tax_kb,
7484 { "Ocd Grant tax kb", "lustre.obd_connect_data.grant_tax_kb", FT_UINT16, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
7485 { &hf_lustre_obd_connect_data_ocd_grant_max_blks,
7486 { "Ocd Grant max blks", "lustre.obd_connect_data.grant_max_blks", FT_UINT32, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
7487 /* end */
7488 { &hf_lustre_obd_connect_data_ocd_transno,
7489 { "Ocd Transno", "lustre.obd_connect_data.ocd_transno", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
7490 { &hf_lustre_obd_connect_data_ocd_group,
7491 { "Ocd Group", "lustre.obd_connect_data.ocd_group", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7492 { &hf_lustre_obd_connect_data_ocd_cksum_types,
7493 { "Ocd Cksum Types", "lustre.obd_connect_data.ocd_cksum_types", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } },
7494 { &hf_lustre_obd_connect_data_ocd_max_easize,
7495 { "Ocd Max LOV EA Size", "lustre.obd_connect_data.ocd_max_easize", FT_UINT32, BASE_DEC_HEX, NULL, 0, NULL, HFILL } },
7496 { &hf_lustre_obd_connect_data_ocd_instance,
7497 { "Ocd Instance", "lustre.obd_connect_data.ocd_instance", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } },
7498 { &hf_lustre_obd_connect_data_ocd_maxbytes,
7499 { "Ocd Max Stripe Size (Bytes)", "lustre.obd_connect_data.ocd_maxbytes", FT_UINT64, BASE_DEC_HEX, NULL, 0, NULL, HFILL } },
7500 { &hf_lustre_obd_connect_data_ocd_maxmodrpcs,
7501 { "Ocd Max Parallel Modify RPCs", "lustre.obd_connect_data.ocd_maxmodrpcs", FT_UINT16, BASE_DEC_HEX, NULL, 0, NULL, HFILL } },
7502 { &hf_lustre_obd_connect_data_ocd_connect_flags2,
7503 { "Ocd Connect Flags", "lustre.obd_connect_data.ocd_connect_flags2", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL } },
7504 { &hf_lustre_obd_connect_data_ocd_padding,
7505 { "Ocd Padding", "lustre.obd_connect_data.padding", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7507 /* OBD UID */
7508 { &hf_lustre_obd_uuid,
7509 { "obd uuid name", "lustre.obd_uuid", FT_STRING, BASE_NONE, NULL , 0 , NULL, HFILL}},
7511 /* OBD Quota Control */
7512 { &hf_lustre_obd_quotactl,
7513 { "OBD QuotaCtl", "lustre.obd_quotactl", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7514 { &hf_lustre_obd_quotactl_qc_stat,
7515 { "Qc Stat", "lustre.obd_quotactl.qc_stat", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7516 { &hf_lustre_obd_quotactl_qc_cmd,
7517 { "Qc Cmd", "lustre.obd_quotactl.qc_cmd", FT_UINT32, BASE_HEX, VALS(quota_cmd_vals), 0, NULL, HFILL }},
7518 { &hf_lustre_obd_quotactl_qc_id,
7519 { "Qc Id", "lustre.obd_quotactl.qc_id", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7520 { &hf_lustre_obd_quotactl_qc_type,
7521 { "Qc Type", "lustre.obd_quotactl.qc_type", FT_UINT32, BASE_DEC, VALS(quota_type_vals), 0, NULL, HFILL }},
7523 /* Data Quota Info */
7524 { &hf_lustre_obd_dqblk,
7525 { "OBD DQ BLK", "lustre.obd_dqblk", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7526 { &hf_lustre_obd_dqblk_dqb_isoftlimit,
7527 { "Dqb Isoftlimit", "lustre.obd_dqblk.dqb_isoftlimit", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
7528 { &hf_lustre_obd_dqblk_dqb_bhardlimit,
7529 { "Dqb Bhardlimit", "lustre.obd_dqblk.dqb_bhardlimit", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
7530 { &hf_lustre_obd_dqblk_dqb_curspace,
7531 { "Dqb Curspace", "lustre.obd_dqblk.dqb_curspace", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
7532 { &hf_lustre_obd_dqblk_dqb_itime,
7533 { "Dqb Itime", "lustre.obd_dqblk.dqb_itime", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0, NULL, HFILL } },
7534 { &hf_lustre_obd_dqblk_dqb_valid,
7535 { "Dqb Valid", "lustre.obd_dqblk.dqb_valid", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
7536 { &hf_lustre_obd_dqblk_padding,
7537 { "Padding", "lustre.obd_dqblk.padding", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7538 { &hf_lustre_obd_dqblk_dqb_curinodes,
7539 { "Dqb Curinodes", "lustre.obd_dqblk.dqb_curinodes", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
7540 { &hf_lustre_obd_dqblk_dqb_bsoftlimit,
7541 { "Dqb Bsoftlimit", "lustre.obd_dqblk.dqb_bsoftlimit", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
7542 { &hf_lustre_obd_dqblk_dqb_btime,
7543 { "Dqb Btime", "lustre.obd_dqblk.dqb_btime", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0, NULL, HFILL } },
7544 { &hf_lustre_obd_dqblk_dqb_ihardlimit,
7545 { "Dqb Ihardlimit", "lustre.obd_dqblk.dqb_ihardlimit", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL } },
7547 /* Data Quota BLK */
7548 { &hf_lustre_obd_dqinfo,
7549 { "OBD DQ Info", "lustre.obd_dqinfo", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7550 { &hf_lustre_obd_dqinfo_dqi_valid,
7551 { "Dqi Valid", "lustre.obd_dqinfo.dqi_valid", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
7552 { &hf_lustre_obd_dqinfo_dqi_igrace,
7553 { "Dqi Igrace", "lustre.obd_dqinfo.dqi_igrace", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
7554 { &hf_lustre_obd_dqinfo_dqi_bgrace,
7555 { "Dqi Bgrace", "lustre.obd_dqinfo.dqi_bgrace", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
7556 { &hf_lustre_obd_dqinfo_dqi_flags,
7557 { "Dqi Flags", "lustre.obd_dqinfo.dqi_flags", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
7559 /************************************************************
7560 * OST
7563 { &hf_lustre_ost_body,
7564 { "OST Body", "lustre.ost_body", FT_NONE, BASE_NONE, NULL , 0 , NULL, HFILL}},
7565 { &hf_lustre_ost_key,
7566 { "lustre ost key", "lustre.ost_key", FT_STRING, BASE_NONE, NULL , 0 , NULL, HFILL}},
7567 { &hf_lustre_ost_val,
7568 { "lustre ost val", "lustre.ost_val", FT_STRING, BASE_NONE, NULL , 0 , NULL, HFILL}},
7570 /* OST LVB */
7571 { &hf_lustre_ost_lvb,
7572 { "OST LVB", "lustre.ost_lvb", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7573 { &hf_lustre_ost_lvb_atime,
7574 { "Lvb Atime", "lustre.ost_lvb.lvb_atime", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0, NULL, HFILL } },
7575 { &hf_lustre_ost_lvb_ctime,
7576 { "Lvb Ctime", "lustre.ost_lvb.lvb_ctime",FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0, NULL, HFILL } },
7577 { &hf_lustre_ost_lvb_mtime,
7578 { "Lvb Mtime", "lustre.ost_lvb.lvb_mtime",FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0, NULL, HFILL } },
7579 { &hf_lustre_ost_lvb_mtime_ns,
7580 { "Lvb Mtime NS", "lustre.ost_lvb.lvb_mtime_ns", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7581 { &hf_lustre_ost_lvb_atime_ns,
7582 { "Lvb Atime NS", "lustre.ost_lvb.lvb_atime_ns", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7583 { &hf_lustre_ost_lvb_ctime_ns,
7584 { "Lvb Ctime NS", "lustre.ost_lvb.lvb_ctime_ns", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7585 { &hf_lustre_ost_lvb_size,
7586 { "Lvb Size", "lustre.ost_lvb.lvb_size", FT_UINT64, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
7587 { &hf_lustre_ost_lvb_blocks,
7588 { "Lvb Blocks", "lustre.ost_lvb.lvb_blocks", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
7589 { &hf_lustre_ost_lvb_padding,
7590 { "padding", "lustre.ost_lvb.padding", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7592 /* OST ID */
7593 { &hf_lustre_ost_id,
7594 { "OST ID [UNION]", "lustre.ost_id", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7595 { &hf_lustre_ost_id_fid,
7596 { "FID", "lustre.ost_id.fid", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7597 { &hf_lustre_ost_id_oi,
7598 { "OI", "lustre.ost_id.oi", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7600 /* OST Layout */
7601 { &hf_lustre_ost_layout,
7602 { "OST Layout", "lustre.ost_layout", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7603 { &hf_lustre_ost_layout_stripe_size,
7604 { "OL Strip Size", "lustre.ost_layout.stripe_size", FT_UINT32, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
7605 { &hf_lustre_ost_layout_stripe_count,
7606 { "OL Strip Count", "lustre.ost_layout.stripe_count", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7607 { &hf_lustre_ost_layout_comp_start,
7608 { "OL Comp Start", "lustre.ost_layout.comp_start", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL }},
7609 { &hf_lustre_ost_layout_comp_end,
7610 { "OL Comp End", "lustre.ost_layout.comp_end", FT_UINT64, BASE_HEX_DEC, NULL, 0, NULL, HFILL }},
7611 { &hf_lustre_ost_layout_comp_id,
7612 { "OL Comp ID", "lustre.ost_layout.comp_id", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7614 { &hf_lustre_lu_ladvise_hdr,
7615 { "LAdvise Hdr", "lustre.lu_ladvise_hdr", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7616 { &hf_lustre_lu_ladvise_hdr_magic,
7617 { "LAH Magic", "lustre.lu_ladvise_hdr.lah_magic", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
7618 { &hf_lustre_lu_ladvise_hdr_count,
7619 { "LAH Count", "lustre.lu_ladvise_hdr.lah_count", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7620 { &hf_lustre_lu_ladvise_hdr_flags,
7621 { "LAH Flags", "lustre.lu_ladvise_hdr.lah_flags", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL }},
7622 { &hf_lustre_lu_ladvise_hdr_value1,
7623 { "LAH Value1", "lustre.lu_ladvise_hdr.lah_value1", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7624 { &hf_lustre_lu_ladvise_hdr_value2,
7625 { "LAH Value2", "lustre.lu_ladvise_hdr.lah_value2", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7626 { &hf_lustre_lu_ladvise_hdr_value3,
7627 { "LAH Value3", "lustre.lu_ladvise_hdr.lah_value3", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
7629 { &hf_lustre_lu_ladvise,
7630 { "LAdvise", "lustre.lu_ladvise", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7631 { &hf_lustre_lu_ladvise_advice,
7632 { "LAH Advice", "lustre.lu_ladvise.lla_advice", FT_UINT16, BASE_HEX, VALS(lu_ladvise_type_vals), 0, "advice type", HFILL }},
7633 { &hf_lustre_lu_ladvise_value1,
7634 { "LAH Value1", "lustre.lu_ladvise.lla_value1", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
7635 { &hf_lustre_lu_ladvise_value2,
7636 { "LAH Value2", "lustre.lu_ladvise.lla_value2", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7637 { &hf_lustre_lu_ladvise_start,
7638 { "LAH Flags", "lustre.lu_ladvise.lla_start", FT_UINT64, BASE_HEX, NULL, 0, "first byte of extent for advice", HFILL }},
7639 { &hf_lustre_lu_ladvise_end,
7640 { "LAH Flags", "lustre.lu_ladvise.lla_end", FT_UINT64, BASE_HEX, NULL, 0, "last byte of extent for advice", HFILL }},
7641 { &hf_lustre_lu_ladvise_value3,
7642 { "LAH Value3", "lustre.lu_ladvise.lla_value3", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7643 { &hf_lustre_lu_ladvise_value4,
7644 { "LAH Value4", "lustre.lu_ladvise.lla_value4", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7646 /************************************************************
7647 * LLOG
7650 /* llogd */
7652 { &hf_lustre_llogd_body,
7653 { "llogd body", "lustre.llogd_body", FT_NONE, BASE_NONE, NULL , 0 , NULL, HFILL}},
7654 { &hf_lustre_llogd_body_lgd_len,
7655 { "Lgd Len", "lustre.llogd_body.lgd_len", FT_UINT32, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
7656 { &hf_lustre_llogd_body_lgd_logid,
7657 { "Lgd Logid", "lustre.llogd_body.lgd_logid", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7658 { &hf_lustre_llogd_body_lgd_index,
7659 { "Lgd Index", "lustre.llogd_body.lgd_index", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7660 { &hf_lustre_llogd_body_lgd_saved_index,
7661 { "Lgd Saved Index", "lustre.llogd_body.lgd_saved_index", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7662 { &hf_lustre_llogd_body_lgd_llh_flags,
7663 { "Lgd Llh Flags", "lustre.llogd_body.lgd_llh_flags", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
7664 { &hf_lustre_llogd_body_lgd_cur_offset,
7665 { "Lgd Cur Offset", "lustre.llogd_body.lgd_cur_offset", FT_UINT64, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
7666 { &hf_lustre_llogd_body_lgd_ctxt_idx,
7667 { "Lgd Ctxt Idx", "lustre.llogd_body.lgd_ctxt_idx", FT_UINT32, BASE_DEC, VALS(llog_ctxt_id_vals), 0, NULL, HFILL }},
7669 { &hf_lustre_llogd_conn_body,
7670 { "LLOGd Conn Body", "lustre.llogd_conn_body", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7671 { &hf_lustre_llogd_conn_body_lgdc_gen,
7672 { "Lgdc Gen", "lustre.llogd_conn_body.lgdc_gen", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7673 { &hf_lustre_llogd_conn_body_lgdc_logid,
7674 { "Lgdc Logid", "lustre.llogd_conn_body.lgdc_logid", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7675 { &hf_lustre_llogd_conn_body_lgdc_ctxt_idx,
7676 { "Lgdc Ctxt Idx", "lustre.llogd_conn_body.lgdc_ctxt_idx", FT_UINT32, BASE_DEC, VALS(llog_ctxt_id_vals), 0, NULL, HFILL }},
7678 /* llog */
7680 /* Generic LLOG Record Entry */
7681 { &hf_lustre_llog_rec,
7682 { "LLOG Record", "lustre.llog_rec", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7683 { &hf_lustre_llog_rec_hdr,
7684 { "LLOG REC Hdr", "lustre.llog_rec_hdr", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7685 { &hf_lustre_llog_rec_tail,
7686 { "LLOG REC Tail", "lustre.llog_rec_tail", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7688 /* LLOG REC Header */
7689 { &hf_lustre_llog_rec_hdr_lrh_type,
7690 { "Lrh Type", "lustre.llog_rec_hdr.lrh_type", FT_UINT32, BASE_HEX, VALS(llog_op_types), 0, NULL, HFILL }},
7691 { &hf_lustre_llog_rec_hdr_lrh_len,
7692 { "Lrh Len", "lustre.llog_rec_hdr.lrh_len", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7693 { &hf_lustre_llog_rec_hdr_lrh_index,
7694 { "Lrh Index", "lustre.llog_rec_hdr.lrh_index", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7695 { &hf_lustre_llog_rec_hdr_lrh_id,
7696 { "Lrh Id", "lustre.llog_rec_hdr.lrh_id", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7698 /* LLOG REC Tail */
7699 { &hf_lustre_llog_rec_tail_lrt_index,
7700 { "Lrt Index", "lustre.llog_rec_tail.lrt_index", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7701 { &hf_lustre_llog_rec_tail_lrt_len,
7702 { "Lrt Len", "lustre.llog_rec_tail.lrt_len", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7704 /* LLOG Log Header */
7705 { &hf_lustre_llog_log_hdr,
7706 { "LLOG Log Hdr", "lustre.llogd_log_hdr", FT_NONE, BASE_NONE, NULL , 0 , NULL, HFILL}},
7707 { &hf_lustre_llog_log_hdr_tgtuuid,
7708 { "Llh Tgtuuid", "lustre.llog_log_hdr.llh_tgtuuid", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7709 { &hf_lustre_llog_log_hdr_cat_idx,
7710 { "Llh Cat Idx", "lustre.llog_log_hdr.llh_cat_idx", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7711 { &hf_lustre_llog_log_hdr_bitmap_offset,
7712 { "Llh Bitmap Offset", "lustre.llog_log_hdr.llh_bitmap_offset", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7713 { &hf_lustre_llog_log_hdr_flags,
7714 { "Llh Flags", "lustre.llog_log_hdr.llh_flags", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
7715 { &hf_lustre_llog_log_hdr_size,
7716 { "Llh Size", "lustre.llog_log_hdr.llh_size", FT_UINT32, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
7717 { &hf_lustre_llog_log_hdr_tail,
7718 { "Llh Tail", "lustre.llog_log_hdr.llh_tail", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7719 { &hf_lustre_llog_log_hdr_bitmap,
7720 { "Llh Bitmap", "lustre.llog_log_hdr.llh_bitmap", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
7721 { &hf_lustre_llog_log_hdr_count,
7722 { "Llh Count", "lustre.llog_log_hdr.llh_count", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7723 { &hf_lustre_llog_log_hdr_timestamp,
7724 { "Llh Timestamp", "lustre.llog_log_hdr.llh_timestamp", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0, NULL, HFILL } },
7725 { &hf_lustre_llog_log_hdr_hdr,
7726 { "Llh Hdr", "lustre.llog_log_hdr.llh_hdr", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7727 { &hf_lustre_llog_log_hdr_reserved,
7728 { "Llh Reserved", "lustre.llog_log_hdr.llh_reserved", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7729 /* LLOG log header flags */
7730 { &hf_lustre_llog_hdr_flag_zap_when_empty,
7731 {"LLOG_F_ZAP_WHEN_EMPTY", "lustre.llog_log_hdr.llh_flags.zap_when_empty", FT_BOOLEAN, 32,
7732 TFS(&lnet_flags_set_truth), LLOG_F_ZAP_WHEN_EMPTY, NULL, HFILL } },
7733 { &hf_lustre_llog_hdr_flag_is_cat,
7734 { "LLOG_F_IS_CAT", "lustre.llog_log_hdr.llh_flags.is_cat", FT_BOOLEAN, 32,
7735 TFS(&lnet_flags_set_truth), LLOG_F_IS_CAT, NULL, HFILL } },
7736 { &hf_lustre_llog_hdr_flag_is_plain,
7737 { "LLOG_F_IS_PLAIN", "lustre.llog_log_hdr.llh_flags.is_plain", FT_BOOLEAN, 32,
7738 TFS(&lnet_flags_set_truth), LLOG_F_IS_PLAIN, NULL, HFILL } },
7739 { &hf_lustre_llog_hdr_flag_ext_jobid,
7740 { "LLOG_F_EXT_JOBID", "lustre.llog_log_hdr.llh_flags.ext_jobid", FT_BOOLEAN, 32,
7741 TFS(&lnet_flags_set_truth), LLOG_F_EXT_JOBID, NULL, HFILL } },
7742 { &hf_lustre_llog_hdr_flag_is_fixsize,
7743 { "LLOG_F_IS_FIXSIZE", "lustre.llog_log_hdr.llh_flags.is_fixsize", FT_BOOLEAN, 32,
7744 TFS(&lnet_flags_set_truth), LLOG_F_IS_FIXSIZE, NULL, HFILL } },
7746 /* LLOG LOGID REC */
7747 { &hf_lustre_llog_logid_rec,
7748 { "LLOG LogID Rec", "lustre.llog_logid_rec", FT_NONE, BASE_NONE, NULL , 0 , NULL, HFILL}},
7749 { &hf_lustre_llog_logid_rec_hdr,
7750 { "Lid Hdr", "lustre.llog_logid_rec.hdr", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7751 { &hf_lustre_llog_logid_rec_tail,
7752 { "Lid Tail", "lustre.llog_logid_rec.tail", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7753 { &hf_lustre_llog_logid_rec_id,
7754 { "Lid Id", "lustre.llog_logid_rec.id", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7755 { &hf_lustre_llog_logid_rec_padding,
7756 { "Padding", "lustre.llog_logid_rec.padding", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7758 /* LLOG LOGID */
7759 { &hf_lustre_llog_logid_lgl_ogen,
7760 { "Lgl Ogen", "lustre.llog_logid.lgl_ogen", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7762 /* LLOG GEN REC */
7763 { &hf_lustre_llog_gen_rec,
7764 { "LLOG Gen Rec", "lustre.llog_gen_rec", FT_NONE, BASE_NONE, NULL , 0 , NULL, HFILL}},
7765 { &hf_lustre_llog_gen_rec_hdr,
7766 { "Lgr Hdr", "lustre.llog_gen_rec.hdr", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7767 { &hf_lustre_llog_gen_rec_tail,
7768 { "Lgr Tail", "lustre.llog_gen_rec.tail", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7769 { &hf_lustre_llog_gen_rec_gen,
7770 { "Lgr Gen", "lustre.llog_gen_rec.gen", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7771 { &hf_lustre_llog_gen_rec_padding,
7772 { "padding", "lustre.llog_gen_rec.padding", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7774 /* LLOG UNLINK REC */
7775 { &hf_lustre_llog_unlink_rec,
7776 { "LLOG Unlink", "lustre.llog_unlink_rec", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7777 { &hf_lustre_llog_unlink_rec_hdr,
7778 { "Lur Hdr", "lustre.llog_unlink_rec.hdr", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7779 { &hf_lustre_llog_unlink_rec_tail,
7780 { "Lur Tail", "lustre.llog_unlink_rec.tail", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7781 { &hf_lustre_llog_unlink_rec_oseq,
7782 { "Lur Oseq", "lustre.llog_unlink_rec.oseq", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7783 { &hf_lustre_llog_unlink_rec_oid,
7784 { "Lur Oid", "lustre.llog_unlink_rec.oid", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
7785 { &hf_lustre_llog_unlink_rec_count,
7786 { "Padding", "lustre.llog_unlink_rec.count", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7788 /* LLOG Size Change */
7789 { &hf_lustre_llog_unlink64_rec,
7790 { "LLOG Unlink64", "lustre.llog_unlink64_rec", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7791 { &hf_lustre_llog_unlink64_rec_hdr,
7792 { "Lsc Hdr", "lustre.llog_unlink64_rec.hdr", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7793 { &hf_lustre_llog_unlink64_rec_count,
7794 { "Lsc Count", "lustre.llog_unlink64_rec.count", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7795 { &hf_lustre_llog_unlink64_rec_fid,
7796 { "Lsc Fid", "lustre.llog_unlink64_rec.fid", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7797 { &hf_lustre_llog_unlink64_rec_tail,
7798 { "Lsc Tail", "lustre.llog_unlink64_rec.tail", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7799 { &hf_lustre_llog_unlink64_rec_padding,
7800 { "Padding", "lustre.llog_unlink64_rec.padding", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7803 /* LLOG Size Change */
7804 { &hf_lustre_llog_size_change_rec,
7805 { "LLOG Size Chg", "lustre.llog_size_change_rec", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7806 { &hf_lustre_llog_size_change_rec_hdr,
7807 { "Lsc Hdr", "lustre.llog_size_change_rec.hdr", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7808 { &hf_lustre_llog_size_change_rec_io_epoch,
7809 { "Lsc Io Epoch", "lustre.llog_size_change_rec.io_epoch", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7810 { &hf_lustre_llog_size_change_rec_fid,
7811 { "Lsc Fid", "lustre.llog_size_change_rec.fid", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7812 { &hf_lustre_llog_size_change_rec_tail,
7813 { "Lsc Tail", "lustre.llog_size_change_rec.tail", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7814 { &hf_lustre_llog_size_change_rec_padding,
7815 { "Padding", "lustre.llog_size_change_rec.padding", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7817 /* LLOG Cookie */
7818 { &hf_lustre_llog_cookie,
7819 { "LLOG Cookie", "lustre.llog_cookie", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7820 { &hf_lustre_llog_cookie_lgc_lgl,
7821 { "Lgc lgl", "lustre.llog_cookie.lgc_lgl", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7822 { &hf_lustre_llog_cookie_lgc_padding,
7823 { "Lgc Padding", "lustre.llog_cookie.lgc_padding", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7824 { &hf_lustre_llog_cookie_lgc_index,
7825 { "Lgc Index", "lustre.llog_cookie.lgc_index", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7826 { &hf_lustre_llog_cookie_lgc_subsys,
7827 { "Lgc Subsys", "lustre.llog_cookie.lgc_subsys", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7829 /* LLOG CHANGELOG REC */
7830 { &hf_lustre_llog_changelog_rec,
7831 { "LLOG ChangeLog", "lustre.llog_changelog_rec", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7832 { &hf_lustre_llog_changelog_rec_hdr,
7833 { "Cr Hdr", "lustre.llog_changelog_rec.hdr", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7834 { &hf_lustre_llog_changelog_rec_tail,
7835 { "Cr Tail", "lustre.llog_changelog_rec.tail", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7837 { &hf_lustre_changelog_rec,
7838 { "ChangeLog", "lustre.changelog_rec", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7839 { &hf_lustre_changelog_rec_namelen,
7840 { "Cr Name Len", "lustre.changelog_rec.namelen", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
7841 { &hf_lustre_changelog_rec_flags,
7842 { "Cr Flags", "lustre.changelog_rec.flags", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
7843 { &hf_lustre_changelog_rec_type,
7844 { "Cr Type", "lustre.changelog_rec.type", FT_UINT32, BASE_DEC, VALS(changelog_rec_type_vals), 0, NULL, HFILL }},
7845 { &hf_lustre_changelog_rec_index,
7846 { "Cr Index", "lustre.changelog_rec.index", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
7847 { &hf_lustre_changelog_rec_prev,
7848 { "Cr Prev", "lustre.changelog_rec.prev", FT_UINT64, BASE_DEC, NULL, 0, "Previous Index", HFILL }},
7849 { &hf_lustre_changelog_rec_time,
7850 { "Cr Time", "lustre.changelog_rec.time", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0, NULL, HFILL }},
7851 { &hf_lustre_changelog_rec_tfid,
7852 { "Cr TFid", "lustre.changelog_rec.tfid", FT_NONE, BASE_NONE, NULL, 0, "Target FID", HFILL } },
7853 { &hf_lustre_changelog_rec_markerflags,
7854 { "Cr Mrk Flags", "lustre.changelog_rec.markerflags", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
7855 { &hf_lustre_changelog_rec_padding,
7856 { "padding", "lustre.changelog_rec.padding", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7857 { &hf_lustre_changelog_rec_pfid,
7858 { "Cr PFid", "lustre.changelog_rec.pfid", FT_NONE, BASE_NONE, NULL, 0, "Parent FID", HFILL } },
7860 { &hf_lustre_changelog_ext_rename_sfid,
7861 { "Cr sFid", "lustre.changelog_ext_rename.sfid", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7862 { &hf_lustre_changelog_ext_rename_spfid,
7863 { "Cr spFid", "lustre.changelog_ext_rename.spfid", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7865 { &hf_lustre_changelog_ext_jobid_jobid,
7866 { "Cr JobID", "lustre.changelog_ext_jobid.jobid", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } },
7868 { &hf_lustre_changelog_extra_flags_extra_flags,
7869 { "Cr Extra Flags", "lustre.changelog_extra_flags.extra_flags", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL }},
7871 { &hf_lustre_changelog_ext_name,
7872 { "Cr Name", "lustre.changelog_ext_name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } },
7874 /* LLOG GEN */
7875 { &hf_lustre_llog_gen_conn_cnt,
7876 { "Conn Cnt", "lustre.llog_gen.conn_cnt", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
7877 { &hf_lustre_llog_gen_mnt_cnt,
7878 { "Mnt Cnt", "lustre.llog_gen.mnt_cnt", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
7880 /* LLOG SETATTR REC */
7881 { &hf_lustre_llog_setattr_rec,
7882 { "LLOG SetAttr", "lustre.llog_setattr_rec", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7883 { &hf_lustre_llog_setattr_rec_hdr,
7884 { "Lsr Hdr", "lustre.llog_setattr_rec.hdr", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7885 { &hf_lustre_llog_setattr_rec_oseq,
7886 { "Lsr Oseq", "lustre.llog_setattr_rec.oseq", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7887 { &hf_lustre_llog_setattr_rec_padding,
7888 { "Padding", "lustre.llog_setattr_rec.padding", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7889 { &hf_lustre_llog_setattr_rec_uid,
7890 { "Lsr Uid", "lustre.llog_setattr_rec.uid", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7891 { &hf_lustre_llog_setattr_rec_oid,
7892 { "Lsr Oid", "lustre.llog_setattr_rec.oid", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
7893 { &hf_lustre_llog_setattr_rec_gid,
7894 { "Lsr Gid", "lustre.llog_setattr_rec.gid", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7895 { &hf_lustre_llog_setattr_rec_tail,
7896 { "Lsr Tail", "lustre.llog_setattr_rec.tail", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7898 /* Lustre CFG */
7899 { &hf_lustre_lustre_cfg,
7900 { "Lustre CFG", "lustre.lustre_cfg", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7901 { &hf_lustre_lustre_cfg_version,
7902 { "Lcfg Version", "lustre.lustre_cfg.version", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } },
7903 { &hf_lustre_lustre_cfg_command,
7904 { "Lcfg Cmd", "lustre.lustre_cfg.command", FT_UINT32, BASE_HEX, VALS(lcfg_command_type_vals), 0, NULL, HFILL } },
7905 { &hf_lustre_lustre_cfg_num,
7906 { "Lcfg Num", "lustre.lustre_cfg.num", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } },
7907 { &hf_lustre_lustre_cfg_flags,
7908 { "Lcfg Flags", "lustre.lustre_cfg.flags", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } },
7909 { &hf_lustre_lustre_cfg_nid,
7910 { "Lcfg Nid", "lustre.lustre_cfg.nid", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7911 { &hf_lustre_lustre_cfg_padding,
7912 { "padding", "lustre.lustre_cfg.padding", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7913 { &hf_lustre_lustre_cfg_bufcount,
7914 { "Lcfg Buf Cnt", "lustre.lustre_cfg.bufcount", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } },
7915 { &hf_lustre_lustre_cfg_buflen,
7916 { "Lcfg Buf Len", "lustre.lustre_cfg.buflen", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } },
7917 { &hf_lustre_lustre_cfg_buffer,
7918 { "Lcfg Buffer", "lustre.lustre_cfg.buffer", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } },
7920 /* CFG MARKER */
7921 { &hf_lustre_cfg_marker,
7922 { "CFG Marker", "lustre.cfg_marker", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7923 { &hf_lustre_cfg_marker_step,
7924 { "CM Step", "lustre.cfg_maker.step", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } },
7925 { &hf_lustre_cfg_marker_flags,
7926 { "CM Flags", "lustre.cfg_maker.flags", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } },
7927 { &hf_lustre_cfg_marker_vers,
7928 { "CM Vers", "lustre.cfg_maker.vers", FT_UINT32, BASE_CUSTOM, CF_FUNC(lustre_fmt_ver), 0, NULL, HFILL } },
7929 { &hf_lustre_cfg_marker_padding,
7930 { "padding", "lustre.cfg_maker.padding", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7931 { &hf_lustre_cfg_marker_createtime,
7932 { "CM Create Time", "lustre.cfg_maker.createtime", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0, NULL, HFILL } },
7933 { &hf_lustre_cfg_marker_canceltime,
7934 { "CM Cancel Time", "lustre.cfg_maker.canceltime", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0, NULL, HFILL } },
7935 { &hf_lustre_cfg_marker_tgtname,
7936 { "CM Tgt Name", "lustre.cfg_maker.tgtname", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } },
7937 { &hf_lustre_cfg_marker_comment,
7938 { "CM Comment", "lustre.cfg_maker.comment", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } },
7940 /* LLOG SETATTR64 REC */
7941 { &hf_lustre_llog_setattr64_rec,
7942 { "LLOG SetAttr", "lustre.llog_setattr64_rec", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7943 { &hf_lustre_llog_setattr64_rec_hdr,
7944 { "Lsr Hdr", "lustre.llog_setattr64_rec.hdr", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7945 { &hf_lustre_llog_setattr64_rec_uid,
7946 { "Lsr Uid", "lustre.llog_setattr64_rec.uid", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7947 { &hf_lustre_llog_setattr64_rec_uid_h,
7948 { "Lsr Uid", "lustre.llog_setattr64_rec.uid_h", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7949 { &hf_lustre_llog_setattr64_rec_gid,
7950 { "Lsr Gid", "lustre.llog_setattr64_rec.gid", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7951 { &hf_lustre_llog_setattr64_rec_gid_h,
7952 { "Lsr Gid", "lustre.llog_setattr64_rec.gid_h", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7953 { &hf_lustre_llog_setattr64_rec_valid,
7954 { "Lsr Oid", "lustre.llog_setattr64_rec.valid", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL }},
7955 { &hf_lustre_llog_setattr64_rec_tail,
7956 { "Lsr Tail", "lustre.llog_setattr64_rec.tail", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
7958 /************************************************************
7959 * NIO
7962 /* NIO Remote Buffer */
7963 { &hf_lustre_niobuf_remote,
7964 { "NIO Buffer", "lustre.niobuf_remote", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7965 { &hf_lustre_niobuf_remote_offset,
7966 { "Offset", "lustre.niobuf_remote.offset", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL }},
7967 { &hf_lustre_niobuf_remote_len,
7968 { "Length", "lustre.niobuf_remote.len", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7969 { &hf_lustre_niobuf_remote_flags,
7970 { "Flags", "lustre.niobuf_remote.flags", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
7972 { &hf_lustre_rcs,
7973 { "RCs", "lustre.rcs", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7974 { &hf_lustre_rcs_rc,
7975 { "RC", "lustre.rcs.rc", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7977 /* FID Array */
7978 { &hf_lustre_fid_array,
7979 { "Fid Array", "lustre.fid_array", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7980 { &hf_lustre_fid_array_fid,
7981 { "FID", "lustre.fid_array.fid", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7983 /************************************************************
7984 * LOV
7987 /* LOV OST Data */
7988 { &hf_lustre_lov_ost_data_v1,
7989 { "LOV OST Data V1", "lustre.lov_ost_data_v1", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7990 { &hf_lustre_lov_ost_data_v1_l_ost_gen,
7991 { "L Ost Gen", "lustre.lov_ost_data_v1.l_ost_gen", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7992 { &hf_lustre_lov_ost_data_v1_l_ost_idx,
7993 { "L Ost Idx", "lustre.lov_ost_data_v1.l_ost_idx", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7995 /* LMV MDS MD */
7996 { &hf_lustre_lmv_mds_md,
7997 { "LMV MDS MD", "lustre.lmv_mds_md", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7998 { &hf_lustre_lmv_mds_md_magic,
7999 { "Lmv Magic", "lustre.lmv_mds_md.magic", FT_UINT32, BASE_HEX, VALS(lustre_magic), 0, NULL, HFILL }},
8000 { &hf_lustre_lmv_mds_md_stripe_count,
8001 { "Lmv Stripe Count", "lustre.lmv_mds_md.stripe_count", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8002 { &hf_lustre_lmv_mds_md_master_mdt_index,
8003 { "Lmv Mast MDT Ind", "lustre.lmv_mds_md.master_mdt_index", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8004 { &hf_lustre_lmv_mds_md_hash_type,
8005 { "Lmv Hash Type", "lustre.lmv_mds_md.hash_type", FT_UINT32, BASE_DEC, VALS(lmv_hash_type_vals), LMV_HASH_TYPE_MASK, NULL, HFILL }},
8006 { &hf_lustre_lmv_mds_md_status,
8007 { "Lmv Status", "lustre.lmv_mds_md.status", FT_UINT32, BASE_HEX, NULL, ~LMV_HASH_TYPE_MASK, NULL, HFILL }},
8008 { &hf_lustre_lmv_mds_md_layout_version,
8009 { "Lmv Layout Ver", "lustre.lmv_mds_md.layout_version", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8010 { &hf_lustre_lmv_mds_md_padding,
8011 { "Lmv padding", "lustre.lmv_mds_md.padding", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
8012 { &hf_lustre_lmv_mds_md_pool_name,
8013 { "Lmv Pool Name", "lustre.lmv_mds_md.pool_name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
8014 { &hf_lustre_lmv_mds_md_stripe_fid,
8015 { "Lmv Stripe FID", "lustre.lmv_mds_md.stripe_fid", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
8017 /* LMV USER MD */
8018 { &hf_lustre_lmv_user_md_v1,
8019 { "LMV USER MD", "lustre.lmv_user_md_v1", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
8020 { &hf_lustre_lmv_user_md_v1_magic,
8021 { "Lum Magic", "lustre.lmv_user_md_v1.magic", FT_UINT32, BASE_HEX, VALS(lustre_magic), 0, NULL, HFILL }},
8022 { &hf_lustre_lmv_user_md_v1_stripe_count,
8023 { "Lum Stripe Count", "lustre.lmv_user_md_v1.stripe_count", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8024 { &hf_lustre_lmv_user_md_v1_stripe_offset,
8025 { "Lum Stripe Offset", "lustre.lmv_user_md_v1.stripe_offset", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8026 { &hf_lustre_lmv_user_md_v1_hash_type,
8027 { "Lum Hash Type", "lustre.lmv_user_md_v1.hash_type", FT_UINT32, BASE_DEC, VALS(lmv_hash_type_vals), LMV_HASH_TYPE_MASK, NULL, HFILL }},
8028 { &hf_lustre_lmv_user_md_v1_type,
8029 { "Lum Type", "lustre.lmv_user_md_v1.type", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
8030 { &hf_lustre_lmv_user_md_v1_max_inherit,
8031 { "Lum Max Inherit Depth", "lustre.lmv_user_md_v1.max_inherit", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
8032 { &hf_lustre_lmv_user_md_v1_max_inherit_rr,
8033 { "Lum Max Inherit RR", "lustre.lmv_user_md_v1.max_inherit_rr", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
8034 { &hf_lustre_lmv_user_md_v1_padding,
8035 { "Lum padding", "lustre.lmv_user_md_v1.padding", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
8036 { &hf_lustre_lmv_user_md_v1_pool_name,
8037 { "Lum Pool Name", "lustre.lmv_user_md_v1.pool_name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
8038 { &hf_lustre_lmv_user_md_v1_objects,
8039 { "Lum Objects", "lustre.lmv_user_md_v1.objects", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
8041 /* LMV USER MDS DATA */
8042 { &hf_lustre_lmv_user_mds_data,
8043 { "LMV USER MDS DATA", "lustre.lmv_user_mds_data", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
8044 { &hf_lustre_lmv_user_mds_data_fid,
8045 { "Lum Fid", "lustre.lmv_user_mds_data.fid", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8046 { &hf_lustre_lmv_user_mds_data_padding,
8047 { "Lum padding", "lustre.lmv_user_mds_data.padding", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8048 { &hf_lustre_lmv_user_mds_data_mds,
8049 { "Lum Mds", "lustre.lmv_user_mds_data.mds", FT_UINT32, BASE_DEC_HEX, NULL, 0, NULL, HFILL } },
8051 /* LOV MDS MD */
8052 { &hf_lustre_lov_mds_md,
8053 { "LOV MDS MD", "lustre.lov_mds_md", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
8054 { &hf_lustre_lov_mds_md_lmm_magic,
8055 { "Lmm Magic", "lustre.lov_mds_md.lmm_magic", FT_UINT32, BASE_HEX, VALS(lustre_magic), 0, NULL, HFILL }},
8056 { &hf_lustre_lov_mds_md_lmm_pattern,
8057 { "Lmm Pattern", "lustre.lov_mds_md.lmm_pattern", FT_UINT32, BASE_HEX, VALS(lov_pattern_vals), 0, NULL, HFILL }},
8058 { &hf_lustre_lov_mds_md_lmm_object_id,
8059 { "Lmm Object Id", "lustre.lov_mds_md.lmm_object_id", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
8060 { &hf_lustre_lov_mds_md_lmm_object_seq,
8061 { "Lmm Object SEQ", "lustre.lov_mds_md.lmm_object_seq", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
8062 { &hf_lustre_lov_mds_md_lmm_stripe_size,
8063 { "Lmm Stripe Size", "lustre.lov_mds_md.lmm_stripe_size", FT_UINT32, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
8064 { &hf_lustre_lov_mds_md_lmm_stripe_count,
8065 { "Lmm Stripe Count", "lustre.lov_mds_md.lmm_stripe_count", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
8066 { &hf_lustre_lov_mds_md_lmm_layout_gen,
8067 { "Lmm Layout Generation", "lustre.lov_mds_md.lmm_layout_gen", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
8068 { &hf_lustre_lov_mds_md_lmm_pool_name,
8069 { "Lmm Poolname", "lustre.lov_mds_md.lmm_poolname", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } },
8071 /* LOV Desc */
8072 { &hf_lustre_lov_desc,
8073 { "LOV Desc", "lustre.lov_desc", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
8074 { &hf_lustre_lov_desc_pattern,
8075 { "Ld Pattern", "lustre.lov_desc.pattern", FT_UINT32, BASE_HEX, VALS(lov_pattern_vals), 0, NULL, HFILL }},
8076 { &hf_lustre_lov_desc_default_stripe_count,
8077 { "Ld Default Stripe Count", "lustre.lov_desc.default_stripe_count", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8078 { &hf_lustre_lov_desc_magic,
8079 { "Ld Magic", "lustre.lov_desc.magic", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
8080 { &hf_lustre_lov_desc_tgt_count,
8081 { "Ld Tgt Count", "lustre.lov_desc.tgt_count", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8082 { &hf_lustre_lov_desc_default_stripe_size,
8083 { "Ld Default Stripe Size", "lustre.lov_desc.default_stripe_size", FT_UINT64, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
8084 { &hf_lustre_lov_desc_default_stripe_offset,
8085 { "Ld Default Stripe Offset", "lustre.lov_desc.default_stripe_offset", FT_INT64, BASE_DEC, NULL, 0, NULL, HFILL }},
8086 { &hf_lustre_lov_desc_qos_maxage,
8087 { "Ld Qos Maxage", "lustre.lov_desc.qos_maxage", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8088 { &hf_lustre_lov_desc_padding,
8089 { "Ld Padding", "lustre.lov_desc.padding", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
8090 { &hf_lustre_lov_desc_uuid,
8091 { "Ld Uuid", "lustre.lov_desc.uuid", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8093 /************************************************************
8094 * QUOTA
8097 /* QUOTA BODY */
8098 { &hf_lustre_quota_body,
8099 { "Quota Body", "lustre.quota_body", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8100 { &hf_lustre_qb_fid,
8101 { "FID", "lustre.quota_body.fid", FT_NONE, BASE_NONE, NULL, 0, "FID of global index packing the pool ID", HFILL } },
8102 { &hf_lustre_qb_lockh,
8103 { "Lock H", "lustre.quota_body.lockh", FT_NONE, BASE_NONE, NULL, 0, "Per-ID lock handle", HFILL } },
8104 { &hf_lustre_qb_glb_lockh,
8105 { "Glb Lock H", "lustre.quota_body.gbl_lockh", FT_NONE, BASE_NONE, NULL, 0, "Global lock handle", HFILL } },
8106 { &hf_lustre_qb_padding,
8107 { "padding", "lustre.quota_body.padding", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8108 { &hf_lustre_qb_flags, /* @@ add VALS(QUOTA_DQACQ_FL_vals) */
8109 { "Flags", "lustre.quota_body.flags", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } },
8110 { &hf_lustre_qb_count,
8111 { "Count", "lustre.quota_body.count", FT_UINT64, BASE_DEC, NULL, 0, "acquire/release count (kbytes/inodes)", HFILL } },
8112 { &hf_lustre_qb_usage,
8113 { "Usage", "lustre.quota_body.usage", FT_UINT64, BASE_DEC, NULL, 0, "current slave usage (kbytes/inodes)", HFILL } },
8114 { &hf_lustre_qb_slv_ver,
8115 { "Slave Ver", "lustre.quota_body.slv_ver", FT_UINT64, BASE_DEC, NULL, 0, "slave index file version", HFILL } },
8117 /* Quota Adjust */
8118 { &hf_lustre_quota_adjust_qunit,
8119 { "obd quota adjust qunit", "lustre.quota_adjust_qunit", FT_NONE, BASE_NONE, NULL , 0 , NULL, HFILL }},
8120 { &hf_lustre_quota_adjust_qunit_qaq_id,
8121 { "Qaq Id", "lustre.quota_adjust_qunit.qaq_id", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8122 { &hf_lustre_quota_adjust_qunit_qaq_flags,
8123 { "Qaq Flags", "lustre.quota_adjust_qunit.qaq_flags", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
8124 { &hf_lustre_quota_adjust_qunit_qaq_iunit_sz,
8125 { "Qaq Iunit Sz", "lustre.quota_adjust_qunit.qaq_iunit_sz", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
8126 { &hf_lustre_quota_adjust_qunit_qaq_bunit_sz,
8127 { "Qaq Bunit Sz", "lustre.quota_adjust_qunit.qaq_bunit_sz", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
8128 { &hf_lustre_quota_adjust_qunit_padding1,
8129 { "Padding1", "lustre.quota_adjust_qunit.padding1", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
8131 /* LQUOTA ID */
8132 { &hf_lustre_lquota_id,
8133 { "LQuota ID [UNION]", "lustre.lquota_id", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8134 { &hf_lustre_qid_fid,
8135 { "FID", "lustre.lquota_id.fid", FT_NONE, BASE_NONE, NULL, 0, "Directory FID", HFILL } },
8136 { &hf_lustre_qid_uid,
8137 { "UID", "lustre.lquota_id.uid", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL } },
8138 { &hf_lustre_qid_gid,
8139 { "GID", "lustre.lquota_id.gid", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL } },
8141 /************************************************************
8142 * LDLM
8145 /* LDLM EXTENT */
8146 { &hf_lustre_ldlm_extent_gid,
8147 { "Gid", "lustre.ldlm_extent.gid", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
8148 { &hf_lustre_ldlm_extent_start,
8149 { "Start", "lustre.ldlm_extent.start", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
8150 { &hf_lustre_ldlm_extent_end,
8151 { "End", "lustre.ldlm_extent.end", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
8153 /* LDLM FLOCK */
8154 { &hf_lustre_ldlm_flock_start,
8155 { "Start", "lustre.ldlm_flock.start", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
8156 { &hf_lustre_ldlm_flock_end,
8157 { "End", "lustre.ldlm_flock.end", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
8158 { &hf_lustre_ldlm_flock_owner,
8159 { "Owner", "lustre.ldlm_flock.owner", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
8160 { &hf_lustre_ldlm_flock_padding,
8161 { "Pid", "lustre.ldlm_flock.padding", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
8162 { &hf_lustre_ldlm_flock_pid,
8163 { "Pid", "lustre.ldlm_flock.pid", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8165 /* LDLM Request */
8166 { &hf_lustre_ldlm_request,
8167 { "ldlm request", "lustre.ldlm_request", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL}},
8168 { &hf_lustre_ldlm_request_lock_handle,
8169 { "Lock Handle", "lustre.ldlm_request.lock_handle", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8170 { &hf_lustre_ldlm_request_lock_flags,
8171 { "Lock Flags", "lustre.ldlm_request.lock_flags", FT_UINT32, BASE_HEX, NULL, 0 , NULL, HFILL }},
8172 { &hf_lustre_ldlm_request_lock_count,
8173 { "Lock Count", "lustre.ldlm_request.lock_count", FT_UINT32, BASE_HEX_DEC, NULL, 0, NULL, HFILL }},
8175 /* LDLM Reply */
8176 { &hf_lustre_ldlm_reply,
8177 { "LDLM Reply", "lustre.ldlm_reply", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL}},
8178 { &hf_lustre_ldlm_reply_lock_flags,
8179 { "Lock Flags", "lustre.ldlm_reply.lock_flags", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
8180 { &hf_lustre_ldlm_reply_lock_policy_res1,
8181 { "Lock Policy Res1", "lustre.ldlm_reply.lock_policy_res1", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
8182 { &hf_lustre_ldlm_reply_lock_policy_res2,
8183 { "Lock Policy Res2", "lustre.ldlm_reply.lock_policy_res2", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
8184 { &hf_lustre_ldlm_reply_lock_handle,
8185 { "Lock Handle", "lustre.ldlm_reply.lock_handle", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8186 { &hf_lustre_ldlm_reply_lock_padding,
8187 { "Lock Padding", "lustre.ldlm_reply.lock_padding", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
8189 /* LDLM INODE */
8190 { &hf_lustre_ldlm_inodebits_bits,
8191 { "Bits", "lustre.ldlm_inodebits.bits", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL }},
8192 { &hf_lustre_ldlm_inodebits_try_bits,
8193 { "Try Bits", "lustre.ldlm_inodebits.try_bits", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL }},
8195 /* LDLM Lock Desc */
8196 { &hf_lustre_ldlm_lock_desc,
8197 { "LDLM Desc", "lustre.ldlm_lock_desc", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8198 { &hf_lustre_ldlm_lock_desc_l_policy_data,
8199 { "L Policy Data", "lustre.ldlm_lock_desc.l_policy_data", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8200 { &hf_lustre_ldlm_lock_desc_l_granted_mode,
8201 { "L Granted Mode", "lustre.ldlm_lock_desc.l_granted_mode", FT_UINT32, BASE_DEC, VALS(lustre_ldlm_mode_vals), 0, NULL, HFILL }},
8202 { &hf_lustre_ldlm_lock_desc_l_req_mode,
8203 { "L Req Mode", "lustre.ldlm_lock_desc.l_req_mode", FT_UINT32, BASE_DEC, VALS(lustre_ldlm_mode_vals), 0, NULL, HFILL }},
8205 /* LDLM Resource ID */
8206 { &hf_lustre_ldlm_res_id,
8207 { "LDLM Res ID", "lustre.ldlm_res_id", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
8208 { &hf_lustre_ldlm_res_id_name,
8209 { "Name", "lustre.ldlm_res_id.name", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
8210 { &hf_lustre_ldlm_res_id_bits,
8211 { "Bits", "lustre.ldlm_res_id.bits", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL }},
8212 { &hf_lustre_ldlm_res_id_string,
8213 { "String", "lustre.ldlm_res_id.string", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
8214 { &hf_lustre_ldlm_res_id_type,
8215 { "Type", "lustre.ldlm_res_id.type", FT_UINT32, BASE_HEX, VALS(mgs_config_body_type_vals), 0, NULL, HFILL }},
8217 /* LDLM Resource Desc */
8218 { &hf_lustre_ldlm_resource_desc,
8219 { "LDLM Resc Desc", "lustre.ldlm_resource_desc", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8220 { &hf_lustre_ldlm_resource_desc_lr_type,
8221 { "Lr Type", "lustre.ldlm_resource_desc.lr_type", FT_UINT32, BASE_DEC, VALS(lustre_ldlm_type_vals), 0, NULL, HFILL }},
8222 { &hf_lustre_ldlm_resource_desc_lr_padding,
8223 { "Lr Padding", "lustre.ldlm_resource_desc.lr_padding", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
8225 /* LDLM GL Barrier Desc */
8226 { &hf_lustre_ldlm_gl_barrier_desc,
8227 { "LDLM GL Barrier Desc", "lustre.ldlm_gl_barrier_desc", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8228 { &hf_lustre_ldlm_gl_barrier_desc_status,
8229 { "Status", "lustre.ldlm_gl_barrier_desc.status", FT_UINT32, BASE_HEX, VALS(lustre_barrier_status_vals), 0, NULL, HFILL }},
8230 { &hf_lustre_ldlm_gl_barrier_desc_timeout,
8231 { "Timeout", "lustre.ldlm_gl_barrier_desc.timeout", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8232 { &hf_lustre_ldlm_gl_barrier_desc_padding,
8233 { "Padding", "lustre.ldlm_gl_barrier_desc.padding", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
8235 /* LDLM GL LQuota Desc */
8236 { &hf_lustre_ldlm_gl_lquota_desc,
8237 { "LDLM GL lQuota Desc", "lustre.ldlm_gl_lquota_desc", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8238 { &hf_lustre_ldlm_gl_lquota_desc_flags,
8239 { "Flags", "lustre.ldlm_gl_lquota_desc.flags", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL }},
8240 { &hf_lustre_ldlm_gl_lquota_desc_ver,
8241 { "Ver", "lustre.ldlm_gl_lquota_desc.ver", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
8242 { &hf_lustre_ldlm_gl_lquota_desc_hardlimit,
8243 { "Hardlimit", "lustre.ldlm_gl_lquota_desc.hardlimit", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
8244 { &hf_lustre_ldlm_gl_lquota_desc_softlimit,
8245 { "Softlimit", "lustre.ldlm_gl_lquota_desc.softlimit", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
8246 { &hf_lustre_ldlm_gl_lquota_desc_time,
8247 { "Time", "lustre.ldlm_gl_lquota_desc.time", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
8248 { &hf_lustre_ldlm_gl_lquota_desc_pad2,
8249 { "padding", "lustre.ldlm_gl_lquota_desc.padding", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
8251 /* LDLM Intent */
8252 /*all this flags are uint64, but I don't find the way to use something like TFS() with a Uint64*/
8253 /*like TFS() with a Uint64 */
8254 { &hf_lustre_ldlm_intent_opc,
8255 { "intent opcode", "lustre.ldlm_intent.opc", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL}},
8256 { &hf_lustre_ldlm_intent_opc_open,
8257 { "open", "lustre.ldlm_intent.opc_open", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), IT_OPEN, NULL, HFILL } },
8258 { &hf_lustre_ldlm_intent_opc_creat,
8259 { "create", "lustre.ldlm_intent.opc_create", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), IT_CREAT , NULL, HFILL } },
8260 { &hf_lustre_ldlm_intent_opc_readdir,
8261 { "readdir", "lustre.ldlm_intent.opc_readdir", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), IT_READDIR , NULL, HFILL } },
8262 { &hf_lustre_ldlm_intent_opc_getattr,
8263 { "getattr", "lustre.ldlm_intent.opc_getattr", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), IT_GETATTR, NULL, HFILL } },
8264 { &hf_lustre_ldlm_intent_opc_lookup,
8265 { "lookup", "lustre.ldlm_intent.opc_lookup", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), IT_LOOKUP , NULL, HFILL } },
8266 { &hf_lustre_ldlm_intent_opc_unlink,
8267 { "unlink", "lustre.ldlm_intent.opc_unlink", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), IT_UNLINK , NULL, HFILL } },
8268 { &hf_lustre_ldlm_intent_opc_trunc,
8269 { "trunc", "lustre.ldlm_intent.opc_trunc", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), IT_TRUNC , NULL, HFILL } },
8270 { &hf_lustre_ldlm_intent_opc_getxattr,
8271 { "getxattr", "lustre.ldlm_intent.opc_getxattr", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), IT_GETXATTR , NULL, HFILL } },
8272 { &hf_lustre_ldlm_intent_opc_exec,
8273 { "exec", "lustre.ldlm_intent.opc_exec", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), IT_EXEC , NULL, HFILL } },
8274 { &hf_lustre_ldlm_intent_opc_pin,
8275 { "pin", "lustre.ldlm_intent.opc_pin", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), IT_PIN , NULL, HFILL } },
8276 { &hf_lustre_ldlm_intent_opc_layout,
8277 { "layout", "lustre.ldlm_intent.opc_layout", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), IT_LAYOUT , NULL, HFILL } },
8278 { &hf_lustre_ldlm_intent_opc_q_dqacq,
8279 { "quota dqacq", "lustre.ldlm_intent.opc_quota_dqacq", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), IT_QUOTA_DQACQ , NULL, HFILL } },
8280 { &hf_lustre_ldlm_intent_opc_q_conn,
8281 { "quota conn", "lustre.ldlm_intent.opc_quota_conn", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), IT_QUOTA_CONN , NULL, HFILL } },
8282 { &hf_lustre_ldlm_intent_opc_setxattr,
8283 { "setxattr", "lustre.ldlm_intent.opc_setxattr", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), IT_SETXATTR , NULL, HFILL } },
8285 /* LDLM SET INFO */
8286 { &hf_lustre_ldlm_key,
8287 { "LDLM Set Info Key", "lustre.ldlm.key", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
8288 { &hf_lustre_ldlm_val,
8289 { "LDLM Set Info Value", "lustre.ldlm.value", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8291 /* Barrier LVB */
8292 { &hf_lustre_barrier_lvb,
8293 { "Barrier LVB", "lustre.barrier_lvb", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8294 { &hf_lustre_barrier_lvb_status,
8295 { "Lvb Status", "lustre.barrier_lvb.status", FT_UINT32, BASE_HEX, VALS(lustre_barrier_status_vals), 0, NULL, HFILL }},
8296 { &hf_lustre_barrier_lvb_index,
8297 { "Lvb Index", "lustre.barrier_lvb.index", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8298 { &hf_lustre_barrier_lvb_padding,
8299 { "Lvb Padding", "lustre.barrier_lvb.padding", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
8301 /************************************************************
8302 * MGS
8305 /* MGS Target Info */
8306 { &hf_lustre_mgs_target_info,
8307 { "MGS Target Info", "lustre.mgs_target_info", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
8308 { &hf_lustre_mgs_target_info_mti_flags,
8309 { "Mti Flags", "lustre.mgs_target_info.mti_flags", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
8310 { &hf_lustre_mgs_target_info_mti_fsname,
8311 { "Mti Fsname", "lustre.mgs_target_info.mti_fsname", FT_STRINGZPAD, BASE_NONE, NULL, 0, NULL, HFILL }},
8312 { &hf_lustre_mgs_target_info_mti_svname,
8313 { "Mti Svname", "lustre.mgs_target_info.mti_svname", FT_STRINGZPAD, BASE_NONE, NULL, 0, NULL, HFILL }},
8314 { &hf_lustre_mgs_target_info_mti_config_ver,
8315 { "Mti Config Ver", "lustre.mgs_target_info.mti_config_ver", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8316 { &hf_lustre_mgs_target_info_mti_uuid,
8317 { "Mti Uuid", "lustre.mgs_target_info.mti_uuid", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
8318 { &hf_lustre_mgs_target_info_mti_stripe_index,
8319 { "Mti Stripe Index", "lustre.mgs_target_info.mti_stripe_index", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8320 { &hf_lustre_mgs_target_info_mti_params,
8321 { "Mti Params", "lustre.mgs_target_info.mti_params", FT_STRINGZPAD, BASE_NONE, NULL, 0, NULL, HFILL }},
8322 { &hf_lustre_mgs_target_info_mti_nids,
8323 { "Mti Nids", "lustre.mgs_target_info.mti_nids", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
8324 { &hf_lustre_mgs_target_info_mti_lustre_ver,
8325 { "Mti Lustre Ver", "lustre.mgs_target_info.mti_lustre_ver", FT_UINT32, BASE_CUSTOM, CF_FUNC(lustre_fmt_ver), 0, NULL, HFILL }},
8326 { &hf_lustre_mgs_target_info_mti_nid_count,
8327 { "Mti Nid Count", "lustre.mgs_target_info.mti_nid_count", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8328 { &hf_lustre_mgs_target_info_mti_instance,
8329 { "Mti Instance", "lustre.mgs_target_info.mti_instance", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
8330 { &hf_lustre_mgs_target_info_padding,
8331 { "Padding", "lustre.mgs_target_info.padding", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
8333 /* MGS Send Params */
8334 { &hf_lustre_mgs_send_param,
8335 { "Mgs Param", "lustre.mgs_send_param", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
8337 /* MGS Config Body */
8338 { &hf_lustre_mgs_config_body,
8339 { "MGS Config Body", "lustre.mgs_config_body", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
8340 { &hf_lustre_mgs_config_body_name,
8341 { "mcb name", "lustre.mgs_config_body.name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
8342 { &hf_lustre_mgs_config_body_offset,
8343 { "mcb offset", "lustre.mgs_config_body.offset", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
8344 { &hf_lustre_mgs_config_body_type,
8345 { "mcb type", "lustre.mgs_config_body.type", FT_UINT16, BASE_DEC, VALS(mgs_config_body_type_vals), 0, NULL, HFILL }},
8346 { &hf_lustre_mgs_config_body_nm_cur_pass,
8347 { "mcb # cur pass", "lustre.mgs_config_body.nm_cur_pass", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
8348 { &hf_lustre_mgs_config_body_bits,
8349 { "mcb bit shift", "lustre.mgs_config_body.bits", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
8350 { &hf_lustre_mgs_config_body_units,
8351 { "mcb units", "lustre.mgs_config_body.units", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8353 /* MGS Config Response */
8354 { &hf_lustre_mgs_config_res,
8355 { "mgs config res", "lustre.mgs_config_res", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
8356 { &hf_lustre_mgs_config_res_offset,
8357 { "mcr offset", "lustre.mgs_config_res.offset", FT_UINT64, BASE_DEC, NULL, 0, "Index of Last config log", HFILL }},
8358 { &hf_lustre_mgs_config_res_size,
8359 { "mcr size", "lustre.mgs_config_res.size", FT_UINT64, BASE_DEC_HEX, NULL, 0, "Size of Log", HFILL }},
8360 { &hf_lustre_mgs_config_res_nm_cur_pass,
8361 { "mcr # cur pass", "lustre.mgs_config_res.nm_cur_pass", FT_UINT64, BASE_DEC, NULL, 0, "Current NODEMAP config pass", HFILL }},
8363 /************************************************************
8364 * OUT Update
8367 /* Out Update Header */
8368 { &hf_lustre_out_update_header,
8369 { "Out Update Header", "lustre.out_update_header", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8370 { &hf_lustre_out_update_header_magic,
8371 { "Ouh Magic", "lustre.out_update_header.magic", FT_UINT32, BASE_HEX, VALS(out_update_header_magic_vals), 0, NULL, HFILL }},
8372 { &hf_lustre_out_update_header_count,
8373 { "Ouh Count", "lustre.out_update_header.count", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8374 { &hf_lustre_out_update_header_inline_length,
8375 { "Ouh Inline Len", "lustre.out_update_header.inline_length", FT_UINT32, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
8376 { &hf_lustre_out_update_header_reply_size,
8377 { "Ouh Reply Sz", "lustre.out_update_header.reply_size", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8378 { &hf_lustre_out_update_header_inline_data,
8379 { "Ouh Inline Data", "lustre.out_update_header.inline_data", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
8381 /* Out Update Buffer */
8382 { &hf_lustre_out_update_buffer,
8383 { "Out Update Buffer", "lustre.out_update_buffer", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8384 { &hf_lustre_out_update_buffer_size,
8385 { "Oub Size", "lustre.out_update_buffer.size", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8386 { &hf_lustre_out_update_buffer_padding,
8387 { "Oub padding", "lustre.out_update_buffer.padding", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
8389 /* Object Update Reply */
8390 { &hf_lustre_obj_update_reply,
8391 { "Object Update Reply", "lustre.obj_update_reply", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8392 { &hf_lustre_obj_update_reply_magic,
8393 { "Ourp Magic", "lustre.obj_update_reply.magic", FT_UINT32, BASE_HEX, VALS(update_reply_magic_vals), 0, NULL, HFILL }},
8394 { &hf_lustre_obj_update_reply_count,
8395 { "Ourp Count", "lustre.obj_update_reply.count", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
8396 { &hf_lustre_obj_update_reply_padding,
8397 { "Ourp padding", "lustre.obj_update_reply.padding", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
8398 { &hf_lustre_obj_update_reply_lens,
8399 { "Ourp Lens", "lustre.obj_update_reply.lens", FT_UINT16, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
8401 /* Object Update Request */
8402 { &hf_lustre_obj_update_request,
8403 { "Object Update Request", "lustre.obj_update_request", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8404 { &hf_lustre_obj_update_request_magic,
8405 { "Ourq Magic", "lustre.obj_update_request.magic", FT_UINT32, BASE_HEX, VALS(update_request_magic_vals), 0, NULL, HFILL }},
8406 { &hf_lustre_obj_update_request_count,
8407 { "Ourq Count", "lustre.obj_update_request.count", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
8408 { &hf_lustre_obj_update_request_padding,
8409 { "Ourq padding", "lustre.obj_update_request.padding", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
8411 /* Object Update Result */
8412 { &hf_lustre_obj_update_result,
8413 { "Object Update Result", "lustre.obj_update_result", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8414 { &hf_lustre_obj_update_result_rc,
8415 { "OURes Rc", "lustre.obj_update_result.rc", FT_UINT32, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
8416 { &hf_lustre_obj_update_result_datalen,
8417 { "OURes Data Len", "lustre.obj_update_result.datalen", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
8418 { &hf_lustre_obj_update_result_padding,
8419 { "OURes padding", "lustre.obj_update_result.padding", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
8420 { &hf_lustre_obj_update_result_data,
8421 { "OURes Data", "lustre.obj_update_result.data", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
8423 /* Object Update */
8424 { &hf_lustre_obj_update,
8425 { "Object Update", "lustre.obj_update", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8426 { &hf_lustre_obj_update_type,
8427 { "Ou Type", "lustre.obj_update.type", FT_UINT16, BASE_HEX, VALS(update_type_vals), 0, NULL, HFILL }},
8428 { &hf_lustre_obj_update_params_count,
8429 { "Ou Param Count", "lustre.obj_update.params_count", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
8430 { &hf_lustre_obj_update_result_size,
8431 { "Ou Result Sz", "lustre.obj_update.result_size", FT_UINT32, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
8432 { &hf_lustre_obj_update_flags,
8433 { "Ou Flags", "lustre.obj_update.flags", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
8434 { &hf_lustre_obj_update_padding,
8435 { "Ou padding", "lustre.obj_update.padding", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
8436 { &hf_lustre_obj_update_batchid,
8437 { "Ou Batch ID", "lustre.obj_update.batchid", FT_UINT64, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
8438 { &hf_lustre_obj_update_fid,
8439 { "Ou Fid", "lustre.obj_update.fid", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
8441 /* Object Update Param */
8442 { &hf_lustre_obj_update_param,
8443 { "Object Update Param", "lustre.obj_update_param", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8444 { &hf_lustre_obj_update_param_len,
8445 { "Oup Len", "lustre.obj_update_params.len", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
8446 { &hf_lustre_obj_update_param_padding,
8447 { "Oup padding", "lustre.obj_update_params.padding", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
8448 { &hf_lustre_obj_update_param_buf,
8449 { "Oup Buf", "lustre.obj_update_params.buf", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
8451 /************************************************************
8452 * LFSCK
8455 /* Request */
8456 { &hf_lustre_lfsck_request,
8457 { "LFSCK Request", "lustre.lfsck_request", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8458 { &hf_lustre_lfsck_request_event,
8459 { "LR Event", "lustre.lfsck_request.event", FT_UINT32, BASE_DEC, VALS(lfsck_events_vals), 0, NULL, HFILL } },
8460 { &hf_lustre_lfsck_request_index,
8461 { "LR Index", "lustre.lfsck_request.index", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } },
8462 { &hf_lustre_lfsck_request_flags,
8463 { "LR Flags", "lustre.lfsck_request.flags", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } },
8464 { &hf_lustre_lfsck_request_valid,
8465 { "LR Valid", "lustre.lfsck_request.valid", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } },
8466 { &hf_lustre_lfsck_request_speed,
8467 { "LR Speed", "lustre.lfsck_request.speed", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } },
8468 { &hf_lustre_lfsck_request_status,
8469 { "LR Status", "lustre.lfsck_request.status", FT_UINT32, BASE_DEC, VALS(lfsck_status_vals), 0, NULL, HFILL } },
8470 { &hf_lustre_lfsck_request_version,
8471 { "LR Version", "lustre.lfsck_request.version", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } },
8472 { &hf_lustre_lfsck_request_active,
8473 { "LR Active", "lustre.lfsck_request.active", FT_UINT16, BASE_HEX, VALS(lfsck_type_vals), 0, NULL, HFILL } },
8474 { &hf_lustre_lfsck_request_param,
8475 { "LR Param", "lustre.lfsck_request.param", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } },
8476 { &hf_lustre_lfsck_request_async_windows,
8477 { "LR Async Win", "lustre.lfsck_request.async_windows", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } },
8478 { &hf_lustre_lfsck_request_flags2,
8479 { "LR Flags2", "lustre.lfsck_request.flags2", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } },
8480 { &hf_lustre_lfsck_request_fid,
8481 { "LR Fid", "lustre.lfsck_request.fid", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8482 { &hf_lustre_lfsck_request_fid2,
8483 { "LR Fid2", "lustre.lfsck_request.fid2", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8484 { &hf_lustre_lfsck_request_comp_id,
8485 { "LR Comp ID", "lustre.lfsck_request.comp_id", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } },
8486 { &hf_lustre_lfsck_request_padding,
8487 { "LR padding", "lustre.lfsck_request.padding", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8489 /* Reply */
8490 { &hf_lustre_lfsck_reply,
8491 { "LFSCK Reply", "lustre.lfsck_reply", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8492 { &hf_lustre_lfsck_reply_status,
8493 { "LP Status", "lustre.lfsck_reply.status", FT_UINT32, BASE_DEC, VALS(lfsck_status_vals), 0, NULL, HFILL } },
8494 { &hf_lustre_lfsck_reply_padding,
8495 { "LP padding", "lustre.lfsck_reply.padding", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8496 { &hf_lustre_lfsck_reply_repaired,
8497 { "LP Repaired", "lustre.lfsck_reply.repaired", FT_UINT64, BASE_DEC_HEX, NULL, 0, NULL, HFILL } },
8500 /************************************************************
8501 * OTHER
8504 /* Cookie */
8505 { &hf_lustre_lustre_handle,
8506 { "Handle", "lustre.lustre_handle", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8507 { &hf_lustre_lustre_handle_cookie,
8508 { "Cookie", "lustre.lustre_handle.cookie", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL } },
8510 /* LU FID */
8511 { &hf_lustre_lu_fid_f_seq,
8512 { "Seq", "lustre.lu_fid.f_seq", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL }},
8513 { &hf_lustre_lu_fid_f_oid,
8514 { "OID", "lustre.ll_fid.f_oid", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
8515 { &hf_lustre_lu_fid_f_ver,
8516 { "Version", "lustre.ll_fid.f_ver", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
8518 { &hf_lustre_ost_oi_id,
8519 { "O Id", "lustre.ost_io.id", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
8520 { &hf_lustre_ost_oi_seq,
8521 { "O SEQ", "lustre.ost_oi.seq", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
8523 /* OBDO */
8524 { &hf_lustre_obdo,
8525 { "OBDO", "lustre.obdo", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
8526 { &hf_lustre_obdo_o_valid,
8527 { "O Valid", "lustre.obdo.o_valid", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL }},
8528 /* .o_oi here */
8529 { &hf_lustre_obdo_o_parent_seq,
8530 { "O Parent SEQ", "lustre.obdo.o_parent_seq", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL }},
8531 { &hf_lustre_obdo_o_size,
8532 { "O Size", "lustre.obdo.o_size", FT_UINT64, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
8533 { &hf_lustre_obdo_o_mtime,
8534 { "O Mtime", "lustre.obdo.o_mtime",FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0, NULL, HFILL } },
8535 { &hf_lustre_obdo_o_atime,
8536 { "O Atime", "lustre.obdo.o_atime",FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0, NULL, HFILL } },
8537 { &hf_lustre_obdo_o_ctime,
8538 { "O Ctime", "lustre.obdo.o_ctime", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0, NULL, HFILL } },
8539 { &hf_lustre_obdo_o_blocks,
8540 { "O Blocks", "lustre.obdo.o_blocks", FT_UINT64, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
8541 { &hf_lustre_obdo_o_grant,
8542 { "O Grant", "lustre.obdo.o_grant", FT_UINT64, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
8543 { &hf_lustre_obdo_o_blksize,
8544 { "O Blksize", "lustre.obdo.o_blksize", FT_UINT32, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
8545 { &hf_lustre_obdo_o_mode,
8546 { "O Mode", "lustre.obdo.o_mode", FT_UINT32, BASE_OCT, NULL, 0, NULL, HFILL }},
8547 { &hf_lustre_obdo_o_uid,
8548 { "O Uid", "lustre.obdo.o_uid", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8549 { &hf_lustre_obdo_o_gid,
8550 { "O Gid", "lustre.obdo.o_gid", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8551 { &hf_lustre_obdo_o_flags,
8552 { "O Flags", "lustre.obdo.o_flags", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
8553 { &hf_lustre_obdo_o_nlink,
8554 { "O Nlink", "lustre.obdo.o_nlink", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8555 { &hf_lustre_obdo_o_parent_oid,
8556 { "O Parent OID", "lustre.obdo.o_parent_oid", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
8557 { &hf_lustre_obdo_o_misc,
8558 { "O Misc", "lustre.obdo.o_misc", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8559 { &hf_lustre_obdo_o_ioepoch,
8560 { "O IOEpoch", "lustre.obdo.o_ioepoch", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
8561 { &hf_lustre_obdo_o_stripe_idx,
8562 { "O Stripe Idx", "lustre.obdo.o_stripe_idx", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8563 { &hf_lustre_obdo_o_parent_ver,
8564 { "O Parent VER", "lustre.obdo.o_parent_ver", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
8565 { &hf_lustre_obdo_o_handle,
8566 { "O Handle", "lustre.obdo.o_handle", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8567 /* .o_handle / .o_lcookie here */
8568 { &hf_lustre_obdo_o_padding_3,
8569 { "O Padding 3", "lustre.obdo.o_padding_3", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
8570 { &hf_lustre_obdo_o_uid_h,
8571 { "O Uid H", "lustre.obdo.o_uid_h", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8572 { &hf_lustre_obdo_o_gid_h,
8573 { "O Gid H", "lustre.obdo.o_gid_h", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8574 { &hf_lustre_obdo_o_data_version,
8575 { "O Data Version", "lustre.obdo.o_data_version", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
8576 { &hf_lustre_obdo_o_projid,
8577 { "O Proj ID", "lustre.obdo.o_projid", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8578 { &hf_lustre_obdo_o_padding_4,
8579 { "O Padding 4", "lustre.obdo.o_padding_4", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
8580 { &hf_lustre_obdo_o_padding_5,
8581 { "O Padding 5", "lustre.obdo.o_padding_5", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
8582 { &hf_lustre_obdo_o_padding_6,
8583 { "O Padding 6", "lustre.obdo.o_padding_6", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
8585 /* XATTR */
8586 { &hf_lustre_xattr_list,
8587 { "XATTR List", "lustre.xattr_list", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
8588 { &hf_lustre_xattr,
8589 { "XATTR", "lustre.xattr", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
8590 { &hf_lustre_xattr_name,
8591 { "xattr name", "lustre.xattr.name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
8592 { &hf_lustre_xattr_data,
8593 { "xattr data", "lustre.xattr.data", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
8594 { &hf_lustre_xattr_size,
8595 { "xattr size", "lustre.xattr.size", FT_UINT32, BASE_DEC_HEX, NULL, 0, NULL, HFILL }},
8597 /* SEQ */
8598 { &hf_lustre_seq_opc,
8599 { "Seq OPC", "lustre.seq_opc", FT_UINT32, BASE_DEC, VALS(seq_op_vals), 0, NULL, HFILL } },
8600 { &hf_lustre_seq_range,
8601 { "Seq Range", "lustre.seq_range", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8602 { &hf_lustre_seq_range_start,
8603 { "Seq Range Start", "lustre.seq_range.start", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL } },
8604 { &hf_lustre_seq_range_end,
8605 { "Seq Range End", "lustre.seq_range.end", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL } },
8606 { &hf_lustre_seq_range_index,
8607 { "Seq Range Index", "lustre.seq_range.index", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } },
8608 { &hf_lustre_seq_range_flags,
8609 { "Seq Range Flags", "lustre.seq_range.flags", FT_UINT32, BASE_HEX, VALS(seq_range_flag_vals), 0, NULL, HFILL } },
8611 /* FLD */
8612 { &hf_lustre_fld_opc,
8613 { "FLD OPC", "lustre.fld_opc", FT_UINT32, BASE_DEC, VALS(fld_op_vals), 0, NULL, HFILL } },
8615 /* struct lustre_capa */
8616 { &hf_lustre_capa,
8617 { "Capability", "lustre.capa", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8618 { &hf_lustre_capa_fid,
8619 { "Capa fid", "lustre.capa.fid", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8620 { &hf_lustre_capa_opc,
8621 { "Capa opc", "lustre.capa.opc", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL } },
8622 { &hf_lustre_capa_uid,
8623 { "Capa uid", "lustre.capa.uid", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL } },
8624 { &hf_lustre_capa_gid,
8625 { "Capa gid", "lustre.capa.gid", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL } },
8626 { &hf_lustre_capa_flags,
8627 { "Capa flags", "lustre.capa.flags", FT_UINT32, BASE_HEX, VALS(capa_flags_vals), 0, NULL, HFILL } },
8628 { &hf_lustre_capa_keyid,
8629 { "Capa keyid", "lustre.capa.keyid", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } },
8630 { &hf_lustre_capa_timeout,
8631 { "Capa timeout", "lustre.capa.timeout", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } },
8632 { &hf_lustre_capa_expiry,
8633 { "Capa expiry", "lustre.capa.expiry", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } },
8634 { &hf_lustre_capa_hmac,
8635 { "Capa hmac", "lustre.capa.hmac", FT_BYTES, SEP_COLON, NULL, 0, NULL, HFILL } },
8637 /* struct idx_info */
8638 { &hf_lustre_idx_info,
8639 { "Index Info", "lustre.idx_info", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8640 { &hf_lustre_idx_info_magic,
8641 { "II Magic", "lustre.idx_info.magic", FT_UINT32, BASE_HEX, VALS(lustre_magic), 0, NULL, HFILL } },
8642 { &hf_lustre_idx_info_flags,
8643 { "II Flags", "lustre.idx_info.flags", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } },
8644 { &hf_lustre_idx_info_count,
8645 { "II Count", "lustre.idx_info.count", FT_UINT16, BASE_DEC, NULL, 0, "number of lu_idxpage (to be) transferred", HFILL } },
8646 { &hf_lustre_idx_info_attrs,
8647 { "II Attrs", "lustre.idx_info.attrs", FT_UINT32, BASE_HEX, NULL, 0, "requested attributes passed down to the iterator API", HFILL } },
8648 { &hf_lustre_idx_info_fid,
8649 { "II fid", "lustre.idx_info.fid", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8650 { &hf_lustre_idx_info_hash_start,
8651 { "II Hash Start", "lustre.idx_info.hash_start", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL } },
8652 { &hf_lustre_idx_info_hash_end,
8653 { "II Hash End", "lustre.idx_info.hash_end", FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL } },
8654 { &hf_lustre_idx_info_keysize,
8655 { "II Key size", "lustre.idx_info.keysize", FT_UINT16, BASE_DEC, NULL, 0, "size of keys in lu_idxpages", HFILL } },
8656 { &hf_lustre_idx_info_recsize,
8657 { "II Rec size", "lustre.idx_info.recsize", FT_UINT16, BASE_DEC, NULL, 0, "size of records in lu_idxpages", HFILL } },
8658 { &hf_lustre_idx_info_padding,
8659 { "padding", "lustre.idx_info.padding", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8661 /* ACL */
8662 { &hf_lustre_acl,
8663 { "ACL", "lustre.acl", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8665 /* USER ITEM */
8666 { &hf_lustre_hsm_user_item,
8667 { "HSM User Item", "lustre.user_item", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8668 { &hf_lustre_hsm_user_item_fid,
8669 { "HSM User Item FID", "lustre.user_item.fid", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8671 /* Intent Layout */
8672 { &hf_lustre_layout_intent,
8673 { "Layout Intent", "lustre.layout_intent", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
8674 { &hf_lustre_layout_intent_opc,
8675 { "Op Code", "lustre.layout_intent.opc", FT_UINT32, BASE_HEX, VALS(lustre_layout_intent_opc_vals), 0, NULL, HFILL } },
8676 { &hf_lustre_layout_intent_flags,
8677 { "Flags", "lustre.layout_intent.flags", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } },
8678 { &hf_lustre_layout_intent_start,
8679 { "Start", "lustre.layout_intent.start", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL } },
8680 { &hf_lustre_layout_intent_end,
8681 { "End", "lustre.layout_intent.end", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL } },
8683 { &hf_lustre_eadata,
8684 { "EA Data", "lustre.eadata", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL}},
8686 { &hf_lustre_extra_padding,
8687 { "extra padding", "lustre.extra_padding", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL}},
8689 { &hf_lustre_target_uuid,
8690 { "Target UUID", "lustre.target_uuid", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL}},
8691 { &hf_lustre_client_uuid,
8692 { "Client UUID", "lustre.client_uuid", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL}},
8694 { &hf_lustre_filename,
8695 { "filename", "lustre.filename", FT_STRING, BASE_NONE, NULL , 0 , NULL, HFILL}},
8696 { &hf_lustre_selinux_pol,
8697 { "SELinux Policy", "lustre.selinux_pol", FT_STRING, BASE_NONE, NULL , 0 , NULL, HFILL}},
8698 { &hf_lustre_target,
8699 { "target", "lustre.target", FT_STRING, BASE_NONE, NULL , 0 , NULL, HFILL}},
8700 { &hf_lustre_secctx_name,
8701 { "Sec Ctx Name", "lustre.secctx_name", FT_STRING, BASE_NONE, NULL , 0 , NULL, HFILL}},
8702 { &hf_lustre_data,
8703 { "data", "lustre.data", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL}},
8704 { &hf_lustre_name,
8705 { "name", "lustre.name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL}},
8708 static int *ett[] = {
8709 &ett_lustre,
8710 &ett_lustre_lustre_handle_cookie,
8711 &ett_lustre_lustre_msg_v1,
8712 &ett_lustre_lustre_handle_v1,
8713 &ett_lustre_lustre_msg_v2,
8714 &ett_lustre_ptlrpc_body,
8715 &ett_lustre_lustre_handle_v2,
8716 &ett_lustre_obd_connect_data,
8717 &ett_lustre_lov_ost_data_v1,
8718 &ett_lustre_obd_statfs,
8719 &ett_lustre_obd_ioobj,
8720 &ett_lustre_niobuf_remote,
8721 &ett_lustre_rcs,
8722 &ett_lustre_fid_array,
8723 &ett_lustre_ost_lvb,
8724 &ett_lustre_lu_fid,
8725 &ett_lustre_obd_quotactl,
8726 &ett_lustre_obd_dqinfo,
8727 &ett_lustre_obd_dqblk,
8728 &ett_lustre_quota_adjust_qunit,
8729 &ett_lustre_mdc_swap_layouts,
8730 &ett_lustre_mdt_body,
8731 &ett_lustre_mdt_rec_reint,
8732 &ett_lustre_lov_desc,
8733 &ett_lustre_obd_uuid,
8734 &ett_lustre_ldlm_res_id,
8735 &ett_lustre_ldlm_extent,
8736 &ett_lustre_ldlm_inodebits,
8737 &ett_lustre_ldlm_flock,
8738 &ett_lustre_ldlm_intent_opc,
8739 &ett_lustre_ldlm_resource_desc,
8740 &ett_lustre_ldlm_lock_desc,
8741 &ett_lustre_ldlm_request,
8742 &ett_lustre_lustre_handle,
8743 &ett_lustre_ldlm_reply,
8744 &ett_lustre_ldlm_gl_barrier_desc,
8745 &ett_lustre_ldlm_gl_lquota_desc,
8746 &ett_lustre_mgs_target_info,
8747 &ett_lustre_mgs_config_body,
8748 &ett_lustre_mgs_config_res,
8749 &ett_lustre_cfg_marker,
8750 &ett_lustre_llog_logid,
8751 &ett_lustre_lmv_mds_md,
8752 &ett_lustre_lmv_user_md_v1,
8753 &ett_lustre_lmv_user_mds_data,
8754 &ett_lustre_lov_mds_md,
8755 &ett_lustre_llog_rec,
8756 &ett_lustre_llog_rec_hdr,
8757 &ett_lustre_llog_rec_tail,
8758 &ett_lustre_llog_logid_rec,
8759 &ett_lustre_llog_unlink_rec,
8760 &ett_lustre_llog_setattr_rec,
8761 &ett_lustre_llog_unlink64_rec,
8762 &ett_lustre_llog_setattr64_rec,
8763 &ett_lustre_llog_size_change_rec,
8764 &ett_lustre_llog_gen,
8765 &ett_lustre_llog_gen_rec,
8766 &ett_lustre_llog_changelog_rec,
8767 &ett_lustre_changelog_rec,
8768 &ett_lustre_lustre_cfg,
8769 &ett_lustre_llog_log_hdr,
8770 &ett_lustre_llog_cookie,
8771 &ett_lustre_llogd_body,
8772 &ett_lustre_llogd_conn_body,
8773 &ett_lustre_obdo,
8774 &ett_lustre_ost_body,
8775 &ett_lustre_ldlm_lock_flags,
8776 &ett_lustre_llog_hdr_flags,
8777 &ett_lustre_seq_range,
8778 &ett_lustre_mdt_ioepoch,
8779 &ett_lustre_capa,
8780 &ett_lustre_idx_info,
8781 &ett_lustre_eadata,
8782 &ett_lustre_close_data,
8783 &ett_lustre_acl,
8784 &ett_lustre_ladvise_hdr,
8785 &ett_lustre_ladvise,
8786 &ett_lustre_hsm_current_action,
8787 &ett_lustre_hsm_request,
8788 &ett_lustre_hsm_archive,
8789 &ett_lustre_hsm_user_item,
8790 &ett_lustre_hsm_extent,
8791 &ett_lustre_hsm_state_set,
8792 &ett_lustre_hsm_progress,
8793 &ett_lustre_hsm_user_state,
8794 &ett_lustre_quota_body,
8795 &ett_lustre_lquota_id,
8796 &ett_lustre_layout_intent,
8797 &ett_lustre_xattrs,
8798 &ett_lustre_xattr_item,
8799 &ett_lustre_ost_id,
8800 &ett_lustre_ost_id_oi,
8801 &ett_lustre_ost_layout,
8802 &ett_lustre_out_update_header,
8803 &ett_lustre_out_update_header_data,
8804 &ett_lustre_out_update_buffer,
8805 &ett_lustre_obj_update_reply,
8806 &ett_lustre_obj_update_result,
8807 &ett_lustre_object_update_request,
8808 &ett_lustre_object_update,
8809 &ett_lustre_object_update_param,
8810 &ett_lustre_lfsck_request,
8811 &ett_lustre_lfsck_reply,
8812 &ett_lustre_barrier_lvb,
8815 /* Setup protocol expert items */
8816 expert_module_t *expert_lustre;
8817 static ei_register_info ei[] = {
8818 { &ei_lustre_buflen,
8819 { "lustre.bad_buflen", PI_MALFORMED, PI_ERROR, "Buffer length mis-match", EXPFILL } },
8820 { &ei_lustre_badopc,
8821 { "lustre.bad_opcode", PI_PROTOCOL, PI_WARN, "BAD OPCODE", EXPFILL } },
8822 { &ei_lustre_badmagic,
8823 { "lustre.bad_magic", PI_PROTOCOL, PI_WARN, "BAD Magic Value", EXPFILL } },
8824 { &ei_lustre_obsopc,
8825 { "lustre.old_opcode", PI_DEPRECATED, PI_NOTE, "Deprecated Opcode", EXPFILL } },
8828 proto_lustre = proto_register_protocol("Lustre", "lustre", "lustre");
8830 proto_register_field_array(proto_lustre, hf, array_length(hf));
8831 proto_register_subtree_array(ett, array_length(ett));
8833 expert_lustre = expert_register_protocol(proto_lustre);
8834 expert_register_field_array(expert_lustre, ei, array_length(ei));
8836 lustre_handle = register_dissector("lustre", dissect_lustre, proto_lustre);
8840 * Editor modelines - https://www.wireshark.org/tools/modelines.html
8842 * Local variables:
8843 * c-basic-offset: 4
8844 * tab-width: 8
8845 * indent-tabs-mode: nil
8846 * End:
8848 * vi: set shiftwidth=4 tabstop=8 expandtab:
8849 * :indentSize=4:tabSize=8:noTabs=true: