Coverage Report

Created: 2026-06-30 07:22

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