Whamcloud - gitweb
LU-8174 mdt: remove use of typedef mds_reint_t
[fs/lustre-release.git] / lustre / contrib / wireshark / packet-lustre.c
1 /* packet-lustre.c
2  * Lustre 1.6 dissection (http://www.lustre.org/)
3  * Author: Laurent George <george@ocre.cea.fr>
4  * based on packet-agentx.c and packet-afs.c
5  * partially generated by Pidl
6  * 20080903
7  * Wireshark - Network traffic analyzer
8  * By Gerald Combs <gerald@wireshark.org>
9  * Copyright 1999 Gerald Combs
10  *
11  * C-Syle: 2 space indents
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software
25  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
26  *
27  * Copyright (c) 2011, 2016, Intel Corporation.
28  */
29
30 #ifdef HAVE_CONFIG_H
31 #include "config.h"
32 #endif
33
34
35 #include <glib.h>
36 #include <string.h>
37 #include <epan/packet.h>
38
39 #include "wireshark-compat.h"
40
41 #include <epan/dissectors/packet-windows-common.h>
42 #include "lustre_dlm_flags.h"
43
44 const true_false_string lnet_flags_set_truth = { "Set", "Unset" };
45
46 /* --------------------------------------------------------------------------------------- */
47 /* def and macro to know where we are the the lustre payload */
48 #define LUSTRE_MAGIC_OFFSET 8
49 #define LUSTRE_MSG_MAGIC_V1 0x0BD00BD0
50 #define LUSTRE_MSG_MAGIC_V2 0x0BD00BD3
51
52 #define LUSTRE_BUFCOUNT_OFF ((tvb_get_letohl(tvb, LUSTRE_MAGIC_OFFSET)== LUSTRE_MSG_MAGIC_V2) ? 0 : 60)
53 #define LUSTRE_BUFCOUNT ((tvb_get_letohl(tvb, LUSTRE_MAGIC_OFFSET)== LUSTRE_MSG_MAGIC_V2) \
54     ? (tvb_get_letohl(tvb, LUSTRE_BUFCOUNT_OFF)) : ((tvb_get_letohl(tvb, LUSTRE_BUFCOUNT_OFF))) )
55 /* remark : BUFLENOFF don't have the same meaning if it's for v1 or v2
56  * v1 : LUSTRE_BUFLEN_OFF = offset buflen[0] - 4 bytes.
57  * v2 : LUSTRE_BUFLEN_OFF = offset buflen[0]
58  */
59 #define LUSTRE_BUFLEN_OFF ((tvb_get_letohl(tvb, LUSTRE_MAGIC_OFFSET)== LUSTRE_MSG_MAGIC_V2) ? 32 : 60)
60
61 /* LUSTRE_BUFFER_LEN(buffnum) */
62 #define LUSTRE_BUFFER_LEN(_n) (LUSTRE_BUFCOUNT <= (_n) ? 0 \
63                                : tvb_get_letohl(tvb, LUSTRE_BUFLEN_OFF+\
64                                                 sizeof(guint32)*(_n)))
65
66 #define LUSTRE_REQ_REC_OFF                     1 /* normal request record offset */
67 #define LUSTRE_REPLY_REC_OFF                   1 /* normal reply record offset */
68
69 #define LUSTRE_DLM_INTENT_IT_OFF               2 /* intent lock it offset */
70 #define LUSTRE_DLM_INTENT_REC_OFF              3 /* intent lock record offset */
71 #define LUSTRE_DLM_LOCKREPLY_OFF               1 /* lockrep offset */
72 #define LUSTRE_DLM_REPLY_REC_OFF               2 /* reply record offset */
73 /* --------------------------------------------------------------------------------------- */
74
75
76 #define LUSTRE_PTLRPC_MSG_VERSION  0x00000003
77 #define LUSTRE_VERSION_MASK 0xffff0000
78 #define LUSTRE_OBD_VERSION  0x00010000
79 #define LUSTRE_MDS_VERSION  0x00020000
80 #define LUSTRE_OST_VERSION  0x00030000
81 #define LUSTRE_DLM_VERSION  0x00040000
82 #define LUSTRE_LOG_VERSION  0x00050000
83 #define LUSTRE_MGS_VERSION  0x00060000
84
85
86
87 #define LOV_MAGIC_V1    0x0BD10BD0
88 #define LOV_MAGIC_V3    0x0BD30BD0
89
90 /* defined in lustre/include/lustre/lustre_user.h */
91 #define LOV_MAXPOOLNAME 15
92
93 /* defined in lustre/include/lustre/lustre_idl.h */
94 typedef enum {
95         CONNMGR_REQUEST_PORTAL = 1,
96         CONNMGR_REPLY_PORTAL = 2,
97         OSC_REQUEST_PORTAL = 3,
98         OSC_REPLY_PORTAL = 4,
99         OSC_BULK_PORTAL = 5,
100         OST_IO_PORTAL = 6,
101         OST_CREATE_PORTAL = 7,
102         OST_BULK_PORTAL = 8,
103         MDC_REQUEST_PORTAL = 9,
104         MDC_REPLY_PORTAL = 10,
105         MDC_BULK_PORTAL = 11,
106         MDS_REQUEST_PORTAL = 12,
107         MDS_REPLY_PORTAL = 13,
108         MDS_BULK_PORTAL = 14,
109         LDLM_CB_REQUEST_PORTAL = 15,
110         LDLM_CB_REPLY_PORTAL = 16,
111         LDLM_CANCEL_REQUEST_PORTAL = 17,
112         LDLM_CANCEL_REPLY_PORTAL = 18,
113         PTLBD_REQUEST_PORTAL = 19,
114         PTLBD_REPLY_PORTAL = 20,
115         PTLBD_BULK_PORTAL = 21,
116         MDS_SETATTR_PORTAL = 22,
117         MDS_READPAGE_PORTAL = 23,
118         MDS_MDS_PORTAL = 24,
119         MGC_REPLY_PORTAL = 25,
120         MGS_REQUEST_PORTAL = 26,
121         MGS_REPLY_PORTAL = 27,
122         OST_REQUEST_PORTAL = 28,
123         FLD_REQUEST_PORTAL = 29,
124         SEQ_METADATA_PORTAL = 30,
125         SEQ_DATA_PORTAL = 31,
126         SEQ_CONTROLLER_PORTAL = 32,
127         MGS_BULK_PORTAL = 33
128 } portal_index_t;
129
130 static const value_string portal_indices[] = {
131         { CONNMGR_REQUEST_PORTAL, "CONNMGR_REQUEST_PORTAL"},
132         { CONNMGR_REPLY_PORTAL , "CONNMGR_REPLY_PORTAL"},
133         { OSC_REQUEST_PORTAL , "OSC_REQUEST_PORTAL(obsolete)"},
134         { OSC_REPLY_PORTAL , "OSC_REPLY_PORTAL"},
135         { OSC_BULK_PORTAL , "OSC_BULK_PORTAL(obsolete)"},
136         { OST_IO_PORTAL , "OST_IO_PORTAL"},
137         { OST_CREATE_PORTAL , "OST_CREATE_PORTAL"},
138         { OST_BULK_PORTAL , "OST_BULK_PORTAL"},
139         { MDC_REQUEST_PORTAL , "MDC_REQUEST_PORTAL(obsolete)"},
140         { MDC_REPLY_PORTAL , "MDC_REPLY_PORTAL"},
141         { MDC_BULK_PORTAL , "MDC_BULK_PORTAL(obsolete)"},
142         { MDS_REQUEST_PORTAL , "MDS_REQUEST_PORTAL"},
143         { MDS_REPLY_PORTAL , "MDS_REPLY_PORTAL(obsolete)"},
144         { MDS_BULK_PORTAL , "MDS_BULK_PORTAL"},
145         { LDLM_CB_REQUEST_PORTAL , "LDLM_CB_REQUEST_PORTAL"},
146         { LDLM_CB_REPLY_PORTAL , "LDLM_CB_REPLY_PORTAL"},
147         { LDLM_CANCEL_REQUEST_PORTAL , "LDLM_CANCEL_REQUEST_PORTAL"},
148         { LDLM_CANCEL_REPLY_PORTAL , "LDLM_CANCEL_REPLY_PORTAL"},
149         { PTLBD_REQUEST_PORTAL , "PTLBD_REQUEST_PORTAL(obsolete)"},
150         { PTLBD_REPLY_PORTAL , "PTLBD_REPLY_PORTAL(obsolete)"},
151         { PTLBD_BULK_PORTAL , "PTLBD_BULK_PORTAL(obsolete)"},
152         { MDS_SETATTR_PORTAL , "MDS_SETATTR_PORTAL"},
153         { MDS_READPAGE_PORTAL , "MDS_READPAGE_PORTAL"},
154         { MDS_MDS_PORTAL, "MDS_MDS_PORTAL"},
155         { MGC_REPLY_PORTAL , "MGC_REPLY_PORTAL"},
156         { MGS_REQUEST_PORTAL , "MGS_REQUEST_PORTAL"},
157         { MGS_REPLY_PORTAL , "MGS_REPLY_PORTAL"},
158         { OST_REQUEST_PORTAL , "OST_REQUEST_PORTAL"},
159         { FLD_REQUEST_PORTAL , "FLD_REQUEST_PORTAL"},
160         { SEQ_METADATA_PORTAL, "SEQ_METADATA_PORTAL"},
161         { SEQ_DATA_PORTAL, "SEQ_DATA_PORTAL"},
162         { SEQ_CONTROLLER_PORTAL, "SEQ_CONTROLLER_PORTAL"},
163         { MGS_BULK_PORTAL, "MGS_BULK_PORTAL"}
164 };
165
166 typedef enum {
167   OST_REPLY      =  0,       /* reply ? */
168   OST_GETATTR    =  1,
169   OST_SETATTR    =  2,
170   OST_READ       =  3,
171   OST_WRITE      =  4,
172   OST_CREATE     =  5,
173   OST_DESTROY    =  6,
174   OST_GET_INFO   =  7,
175   OST_CONNECT    =  8,
176   OST_DISCONNECT =  9,
177   OST_PUNCH      = 10,
178   OST_OPEN       = 11,
179   OST_CLOSE      = 12,
180   OST_STATFS     = 13,
181   /*      OST_SAN_READ   = 14,    deprecated */
182   /*      OST_SAN_WRITE  = 15,    deprecated */
183   OST_SYNC       = 16,
184   OST_SET_INFO   = 17,
185   OST_QUOTACHECK = 18,
186   OST_QUOTACTL   = 19,
187   OST_QUOTA_ADJUST_QUNIT = 20,
188   OST_LADVISE = 21,
189   OST_LAST_OPC
190 } ost_cmd_t ;
191
192
193 typedef enum {
194   OBD_PING = 400,
195   OBD_LOG_CANCEL,
196   OBD_QC_CALLBACK,
197   OBD_LAST_OPC
198 } obd_cmd_t;
199 #define OBD_FIRST_OPC OBD_PING
200
201 /* must be coherent with same declaration
202  * in lustre/include/lustre/lustre_idl.h
203  */
204 typedef enum {
205         MDS_GETATTR             = 33,
206         MDS_GETATTR_NAME        = 34,
207         MDS_CLOSE               = 35,
208         MDS_REINT               = 36,
209         MDS_READPAGE            = 37,
210         MDS_CONNECT             = 38,
211         MDS_DISCONNECT          = 39,
212         MDS_GET_ROOT            = 40,
213         MDS_STATFS              = 41,
214         MDS_PIN                 = 42,
215         MDS_UNPIN               = 43,
216         MDS_SYNC                = 44,
217         MDS_DONE_WRITING        = 45,
218         MDS_SET_INFO            = 46,
219         MDS_QUOTACHECK          = 47,
220         MDS_QUOTACTL            = 48,
221         MDS_GETXATTR            = 49,
222         MDS_SETXATTR            = 50,
223         MDS_WRITEPAGE           = 51,
224         MDS_IS_SUBDIR           = 52,
225         MDS_GET_INFO            = 53,
226         MDS_HSM_STATE_GET       = 54,
227         MDS_HSM_STATE_SET       = 55,
228         MDS_HSM_ACTION          = 56,
229         MDS_HSM_PROGRESS        = 57,
230         MDS_HSM_REQUEST         = 58,
231         MDS_HSM_CT_REGISTER     = 59,
232         MDS_HSM_CT_UNREGISTER   = 60,
233         MDS_SWAP_LAYOUTS        = 61,
234         MDS_LAST_OPC
235 } mds_cmd_t;
236 #define MDS_FIRST_OPC MDS_GETATTR
237
238 enum {
239         LAYOUT_INTENT_ACCESS    = 0,
240         LAYOUT_INTENT_READ      = 1,
241         LAYOUT_INTENT_WRITE     = 2,
242         LAYOUT_INTENT_GLIMPSE   = 3,
243         LAYOUT_INTENT_TRUNC     = 4,
244         LAYOUT_INTENT_RELEASE   = 5,
245         LAYOUT_INTENT_RESTORE   = 6
246 };
247
248 static const value_string lustre_layout_intent_opc_values[] = {
249         { LAYOUT_INTENT_ACCESS,         "ACCESS"},
250         { LAYOUT_INTENT_READ,           "READ"},
251         { LAYOUT_INTENT_WRITE,          "WRITE"},
252         { LAYOUT_INTENT_GLIMPSE,        "GLIMPSE"},
253         { LAYOUT_INTENT_TRUNC,          "TRUNC"},
254         { LAYOUT_INTENT_RELEASE,        "RELEASE"},
255         { LAYOUT_INTENT_RESTORE,        "RESTORE"},
256         { 0, NULL },
257 };
258
259 /* From lustre/include/obd.h */
260 #define IT_OPEN     0x0001
261 #define IT_CREAT    0x0002
262 #define IT_READDIR  0x0004
263 #define IT_GETATTR  0x0008
264 #define IT_LOOKUP   0x0010
265 #define IT_UNLINK   0x0020
266 #define IT_TRUNC        0x0040
267 #define IT_GETXATTR     0x0080
268 #define IT_EXEC         0x0100
269 #define IT_PIN          0x0200
270 #define IT_LAYOUT       0x0400
271 #define IT_QUOTA_DQACQ  0x0800
272 #define IT_QUOTA_CONN   0x1000
273 #define IT_SETXATTR     0x2000
274
275 /* lustre/include/uapi/linux/lustre/lustre_idl.h */
276 enum mds_reint_op {
277   REINT_SETATTR  = 1,
278   REINT_CREATE   = 2,
279   REINT_LINK     = 3,
280   REINT_UNLINK   = 4,
281   REINT_RENAME   = 5,
282   REINT_OPEN     = 6,
283   REINT_SETXATTR = 7,
284   REINT_RMENTRY  = 8,
285   REINT_MIGRATE  = 9,
286   REINT_MAX
287 };
288
289 enum ldlm_cmd {
290   LDLM_ENQUEUE     = 101,
291   LDLM_CONVERT     = 102,
292   LDLM_CANCEL      = 103,
293   LDLM_BL_CALLBACK = 104,
294   LDLM_CP_CALLBACK = 105,
295   LDLM_GL_CALLBACK = 106,
296   LDLM_SET_INFO    = 107,
297   LDLM_LAST_OPC
298 };
299 #define LDLM_FIRST_OPC LDLM_ENQUEUE
300
301 enum seq_rpc_opc {
302   SEQ_QUERY        = 700,
303   SEQ_LAST_OPC,
304   SEQ_FIRST_OPC    = SEQ_QUERY
305 };
306
307 enum fld_rpc_opc {
308   FLD_QUERY        = 900,
309   FLD_LAST_OPC,
310   FLD_FIRST_OPC    = FLD_QUERY
311 };
312
313 #define LDLM_ENQUEUE (101)
314 #define LDLM_CONVERT (102)
315 #define LDLM_CANCEL (103)
316 #define LDLM_BL_CALLBACK (104)
317 #define LDLM_CP_CALLBACK (105)
318 #define LDLM_GL_CALLBACK (106)
319 #define LCK_MINMODE (0)
320 #define LCK_EX (1)
321 #define LCK_PW (2)
322 #define LCK_PR (4)
323 #define LCK_CW (8)
324 #define LCK_CR (16)
325 #define LCK_NL (32)
326 #define LCK_GROUP (64)
327 #define LDLM_PLAIN (10)
328 #define LDLM_EXTENT (11)
329 #define LDLM_FLOCK (12)
330 #define LDLM_IBITS (13)
331 //#define MGS_CONNECT (250)
332 #define OBD_PING (400)
333
334 /*
335  * Opcodes for mountconf (mgs and mgc)
336  */
337 typedef enum {
338   MGS_CONNECT = 250,
339   MGS_DISCONNECT,
340   MGS_EXCEPTION,         /* node died, etc. */
341   MGS_TARGET_REG,        /* whenever target starts up */
342   MGS_TARGET_DEL,
343   MGS_SET_INFO,
344   MGS_CONFIG_READ,
345   MGS_LAST_OPC
346 } mgs_cmd_t;
347 #define MGS_FIRST_OPC MGS_CONNECT
348
349 /* llog protocol */
350 typedef enum {
351   LLOG_ORIGIN_HANDLE_CREATE       = 501,
352   LLOG_ORIGIN_HANDLE_NEXT_BLOCK   = 502,
353   LLOG_ORIGIN_HANDLE_READ_HEADER  = 503,
354   LLOG_ORIGIN_HANDLE_WRITE_REC    = 504,
355   LLOG_ORIGIN_HANDLE_CLOSE        = 505,
356   LLOG_ORIGIN_CONNECT             = 506,
357   LLOG_CATINFO                    = 507,  /* for lfs catinfo */
358   LLOG_ORIGIN_HANDLE_PREV_BLOCK   = 508,
359   LLOG_ORIGIN_HANDLE_DESTROY      = 509,  /* for destroy llog object*/
360   LLOG_LAST_OPC
361 } llog_cmd_t;
362
363 #define LLOG_FIRST_OPC LLOG_ORIGIN_HANDLE_CREATE
364 /*flag for the LLOG*/
365 #define LLOG_OP_MAGIC 0x10600000
366 #define LLOG_OP_MASK  0xfff00000
367
368 typedef enum {
369   LLOG_PAD_MAGIC   = LLOG_OP_MAGIC | 0x00000,
370   OST_SZ_REC       = LLOG_OP_MAGIC | 0x00f00,
371   OST_RAID1_REC    = LLOG_OP_MAGIC | 0x01000,
372   MDS_UNLINK_REC   = LLOG_OP_MAGIC | 0x10000 | (MDS_REINT << 8) | REINT_UNLINK,
373   MDS_SETATTR_REC  = LLOG_OP_MAGIC | 0x10000 | (MDS_REINT << 8) | REINT_SETATTR,
374   OBD_CFG_REC      = LLOG_OP_MAGIC | 0x20000,
375   PTL_CFG_REC      = LLOG_OP_MAGIC | 0x30000, /* obsolete */
376   LLOG_GEN_REC     = LLOG_OP_MAGIC | 0x40000,
377   LLOG_JOIN_REC    = LLOG_OP_MAGIC | 0x50000, /* obsolete */
378   LLOG_HDR_MAGIC   = LLOG_OP_MAGIC | 0x45539,
379   LLOG_LOGID_MAGIC = LLOG_OP_MAGIC | 0x4553b,
380 } llog_op_type;
381
382 /* LLOG flag */
383 /*defined in lustre/include/lustre/lustre_idl.h*/
384 #define LLOG_F_ZAP_WHEN_EMPTY   0x1
385 #define LLOG_F_IS_CAT           0x2
386 #define LLOG_F_IS_PLAIN         0x4
387
388 #define PTL_RPC_MSG_REQUEST 4711
389 #define PTL_RPC_MSG_ERR 4712
390 #define PTL_RPC_MSG_REPLY 4713
391
392 /* Connect flags from lustre_idl.h */
393 #define OBD_CONNECT_RDONLY                0x1ULL /*client has read-only access*/
394 #define OBD_CONNECT_INDEX                 0x2ULL /*connect specific LOV idx */
395 #define OBD_CONNECT_MDS                   0x4ULL /*connect from MDT to OST */
396 #define OBD_CONNECT_GRANT                 0x8ULL /*OSC gets grant at connect */
397 #define OBD_CONNECT_SRVLOCK              0x10ULL /*server takes locks for cli */
398 #define OBD_CONNECT_VERSION              0x20ULL /*Lustre versions in ocd */
399 #define OBD_CONNECT_REQPORTAL            0x40ULL /*Separate non-IO req portal */
400 #define OBD_CONNECT_ACL                  0x80ULL /*access control lists */
401 #define OBD_CONNECT_XATTR               0x100ULL /*client use extended attr */
402 #define OBD_CONNECT_CROW                0x200ULL /*MDS+OST create obj on write*/
403 #define OBD_CONNECT_TRUNCLOCK           0x400ULL /*locks on server for punch */
404 #define OBD_CONNECT_TRANSNO             0x800ULL /*replay sends init transno */
405 #define OBD_CONNECT_IBITS              0x1000ULL /*support for inodebits locks*/
406 #define OBD_CONNECT_JOIN               0x2000ULL /*files can be concatenated.
407                                                   *We do not support JOIN FILE
408                                                   *anymore, reserve this flags
409                                                   *just for preventing such bit
410                                                   *to be reused.*/
411 #define OBD_CONNECT_ATTRFID            0x4000ULL /*Server can GetAttr By Fid*/
412 #define OBD_CONNECT_NODEVOH            0x8000ULL /*No open hndl on specl nodes*/
413 #define OBD_CONNECT_RMT_CLIENT        0x10000ULL /*Remote client */
414 #define OBD_CONNECT_RMT_CLIENT_FORCE  0x20000ULL /*Remote client by force */
415 #define OBD_CONNECT_BRW_SIZE          0x40000ULL /*Max bytes per rpc */
416 #define OBD_CONNECT_QUOTA64           0x80000ULL /*Not used since 2.4 */
417 #define OBD_CONNECT_MDS_CAPA         0x100000ULL /*MDS capability */
418 #define OBD_CONNECT_OSS_CAPA         0x200000ULL /*OSS capability */
419 #define OBD_CONNECT_CANCELSET        0x400000ULL /*Early batched cancels. */
420 #define OBD_CONNECT_SOM              0x800000ULL /*Size on MDS */
421 #define OBD_CONNECT_AT              0x1000000ULL /*client uses AT */
422 #define OBD_CONNECT_LRU_RESIZE      0x2000000ULL /*LRU resize feature. */
423 #define OBD_CONNECT_MDS_MDS         0x4000000ULL /*MDS-MDS connection */
424 #define OBD_CONNECT_REAL            0x8000000ULL /*real connection */
425 #define OBD_CONNECT_CHANGE_QS      0x10000000ULL /*Not used since 2.4 */
426 #define OBD_CONNECT_CKSUM          0x20000000ULL /*support several cksum algos*/
427 #define OBD_CONNECT_FID            0x40000000ULL /*FID is supported by server */
428 #define OBD_CONNECT_VBR            0x80000000ULL /*version based recovery */
429
430 /* Ett declarations */
431 static gint ett_lustre_llog_log_llh_flags = -1 ;
432 static gint ett_lustre = -1;
433 static gint ett_lustre_lustre_handle_cookie = -1;
434 static gint ett_lustre_lustre_msg_v1 = -1;
435 static gint ett_lustre_lustre_handle_v1 = -1;
436 static gint ett_lustre_lustre_msg_v2 = -1;
437 static gint ett_lustre_ptlrpc_body = -1;
438 static gint ett_lustre_lustre_handle_v2 = -1;
439 static gint ett_lustre_obd_connect_data = -1;
440 static gint ett_lustre_lov_mds_md_v1 = -1;
441 static gint ett_lustre_lov_mds_md_v3 = -1;
442 static gint ett_lustre_lov_ost_data_v1 = -1;
443 static gint ett_lustre_obd_statfs = -1;
444 static gint ett_lustre_obd_ioobj = -1;
445 static gint ett_lustre_niobuf_remote = -1;
446 static gint ett_lustre_ost_lvb = -1;
447 static gint ett_lustre_ll_fid = -1;
448 static gint ett_lustre_mdt_body = -1;
449 static gint ett_lustre_mdt_rec_setattr = -1;
450 static gint ett_lustre_mdt_rec_create = -1;
451 static gint ett_lustre_mdt_rec_link = -1;
452 static gint ett_lustre_mdt_rec_unlink = -1;
453 static gint ett_lustre_mdt_rec_rename = -1;
454 static gint ett_lustre_mdt_rec_setxattr = -1;
455 static gint ett_lustre_obd_quotactl = -1;
456 static gint ett_lustre_obd_dqinfo = -1;
457 static gint ett_lustre_obd_dqblk = -1;
458 static gint ett_lustre_quota_adjust_qunit = -1;
459 static gint ett_lustre_lov_desc = -1;
460 static gint ett_lustre_obd_uuid = -1;
461 static gint ett_lustre_ldlm_res_id = -1;
462 static gint ett_lustre_ldlm_extent = -1;
463 static gint ett_lustre_ldlm_inodebits = -1;
464 static gint ett_lustre_ldlm_flock = -1;
465 static gint ett_lustre_ldlm_intent_opc = -1;
466 static gint ett_lustre_ldlm_resource_desc = -1;
467 static gint ett_lustre_ldlm_lock_desc = -1;
468 static gint ett_lustre_ldlm_request = -1;
469 static gint ett_lustre_lustre_handle = -1;
470 static gint ett_lustre_ldlm_reply = -1;
471 static gint ett_lustre_mgs_send_param = -1;
472 static gint ett_lustre_mgs_target_info = -1;
473 static gint ett_lustre_mgs_config_body = -1;
474 static gint ett_lustre_mgs_config_res = -1;
475 static gint ett_lustre_cfg_marker = -1;
476 static gint ett_lustre_llog_catid = -1;
477 static gint ett_lustre_llog_rec_hdr = -1;
478 static gint ett_lustre_llog_logid_rec = -1;
479 static gint ett_lustre_llog_logid = -1;
480 static gint ett_lustre_llog_rec_tail = -1;
481 static gint ett_lustre_lov_mds_md = -1;
482 static gint ett_lustre_llog_unlink_rec = -1;
483 static gint ett_lustre_llog_setattr_rec = -1;
484 static gint ett_lustre_llog_size_change_rec = -1;
485 static gint ett_lustre_llog_gen_rec = -1;
486 static gint ett_lustre_llog_log_hdr = -1;
487 static gint ett_lustre_llog_cookie = -1;
488 static gint ett_lustre_llogd_body = -1;
489 static gint ett_lustre_llogd_conn_body = -1;
490 static gint ett_lustre_llog_gen = -1;
491 static gint ett_lustre_obdo = -1;
492 static gint ett_lustre_ost_body = -1;
493 static gint ett_lustre_qunit_data = -1;
494 static gint ett_lustre_qunit_data_old2 = -1;
495 static gint ett_lustre_qunit_data_old = -1;
496 static gint ett_lustre_ldlm_lock_flags = -1 ;
497 static gint ett_lustre_seq_range = -1;
498 static gint ett_lustre_fld_range = -1;
499 static gint ett_lustre_mdt_ioepoch = -1;
500 static gint ett_lustre_capa = -1;
501 static gint ett_lustre_close_data = -1;
502 static gint ett_lustre_acl = -1;
503 static gint ett_lustre_ladvise = -1;
504 static gint ett_lustre_hsm_request = -1;
505 static gint ett_lustre_hsm_user_item = -1;
506 static gint ett_lustre_hsm_extent = -1;
507 static gint ett_lustre_hsm_progress = -1;
508 static gint ett_lustre_hsm_user_state = -1;
509 static gint ett_lustre_quota_body = -1;
510 static gint ett_lustre_lquota_id = -1;
511 static gint ett_lustre_layout_intent = -1;
512 static gint ett_lustre_xattrs = -1;
513 static gint ett_lustre_ost_id = -1;
514
515 /* -----------------------------------------------*/
516 /* Header field declarations */
517 static int hf_lustre_ptlrpc_body_pb = -1 ;
518 static int hf_lustre_ost_body = -1 ;
519 static int hf_lustre_obd_statfs = -1 ;
520 static int hf_lustre_obd_quotactl = -1 ;
521 static int hf_lustre_quota_adjust_qunit = -1 ;
522 static int hf_lustre_extra_padding = -1 ;
523 static int hf_lustre_ldlm_reply = -1 ;
524 static int hf_lustre_ldlm_request = -1 ;
525 static int hf_lustre_obd_uuid = -1 ;
526 static int hf_lustre_obd_connect_data = -1 ;
527 static int hf_lustre_ldlm_intent = -1;
528 static int hf_lustre_obd_ioobj = -1 ;
529 static int hf_lustre_niobuf_remote = -1 ;
530 static int hf_lustre_ost_key = -1 ;
531 static int hf_lustre_nio= -1 ;
532 static int hf_lustre_ost_val= -1;
533 static int hf_lustre_llogd_body = -1;
534 static int hf_lustre_llogd_log_hdr= -1;
535 static int hf_lustre_llog_logid_rec =-1 ;
536 static int hf_lustre_llogd_chunk= -1;
537 static int hf_lustre_llogd_keyword= -1;
538 static int hf_lustre_llogd_client= -1;
539 static int hf_lustre_llogd_name= -1;
540
541 static int hf_lustre_mds_xattr_name = -1;
542 static int hf_lustre_lov_mds_md_v1= -1;
543 static int hf_lustre_llog_cookie= -1;
544 static int hf_lustre_mds_md_data= -1;
545 static int hf_lustre_mds_reint_opcode= -1;
546 static int hf_lustre_mds_xattr_eadata = -1;
547 static int hf_lustre_mds_xattr_eadata_str = -1;
548
549 static int hf_lustre_reint_name= -1;
550 static int hf_lustre_reint_old_name= -1;
551 static int hf_lustre_reint_new_name= -1;
552
553 static int hf_lustre_mgs_target_info = -1 ;
554 static int hf_lustre_mgs_send_param = -1;
555
556 static int hf_lustre_mgs_config_body = -1;
557 static int hf_lustre_mgs_config_body_name = -1;
558 static int hf_lustre_mgs_config_body_offset = -1;
559 static int hf_lustre_mgs_config_body_type = -1;
560 static int hf_lustre_mgs_config_body_reserved = -1;
561 static int hf_lustre_mgs_config_body_bits = -1;
562 static int hf_lustre_mgs_config_body_units = -1;
563
564 static int hf_lustre_mgs_config_res = -1;
565 static int hf_lustre_mgs_config_res_offset = -1;
566 static int hf_lustre_mgs_config_res_size = -1;
567
568 static int hf_lustre_ost_lvb = -1 ;
569
570 #define hf_lustre_ldlm_ast_discard_data hf_lustre_ldlm_fl_ast_discard_data
571
572 static int hf_lustre_mdt_body = -1 ;
573 static int hf_lustre_mdt_body_fid1 = -1;
574 static int hf_lustre_mdt_body_fid2 = -1;
575 static int hf_lustre_mdt_body_handle = -1;
576 static int hf_lustre_mdt_body_valid = -1;
577 static int hf_lustre_mdt_body_size = -1;
578 static int hf_lustre_mdt_body_mtime = -1;
579 static int hf_lustre_mdt_body_atime = -1;
580 static int hf_lustre_mdt_body_ctime = -1;
581 static int hf_lustre_mdt_body_blocks = -1;
582 static int hf_lustre_mdt_body_ioepoch = -1;
583 static int hf_lustre_mdt_body_ino = -1;
584 static int hf_lustre_mdt_body_fsuid = -1;
585 static int hf_lustre_mdt_body_fsgid = -1;
586 static int hf_lustre_mdt_body_capability = -1;
587 static int hf_lustre_mdt_body_mode = -1;
588 static int hf_lustre_mdt_body_uid = -1;
589 static int hf_lustre_mdt_body_gid = -1;
590 static int hf_lustre_mdt_body_flags = -1;
591 static int hf_lustre_mdt_body_rdev = -1;
592 static int hf_lustre_mdt_body_nlink = -1;
593 static int hf_lustre_mdt_body_generation = -1;
594 static int hf_lustre_mdt_body_suppgid = -1;
595 static int hf_lustre_mdt_body_eadatasize = -1;
596 static int hf_lustre_mdt_body_aclsize = -1;
597 static int hf_lustre_mdt_body_max_mdsize = -1;
598 static int hf_lustre_mdt_body_max_cookiesize = -1;
599 static int hf_lustre_mdt_body_uid_h = -1;
600 static int hf_lustre_mdt_body_gid_h = -1;
601 static int hf_lustre_mdt_body_padding_5 = -1;
602 static int hf_lustre_mdt_body_padding_6 = -1;
603 static int hf_lustre_mdt_body_padding_7 = -1;
604 static int hf_lustre_mdt_body_padding_8 = -1;
605 static int hf_lustre_mdt_body_padding_9 = -1;
606 static int hf_lustre_mdt_body_padding_10 = -1;
607
608 static int hf_lustre_mdt_rec_setattr = -1 ;
609 static int hf_lustre_mdt_rec_setattr_sa_opcode = -1;
610 static int hf_lustre_mdt_rec_setattr_sa_cap = -1;
611 static int hf_lustre_mdt_rec_setattr_sa_fsuid = -1;
612 static int hf_lustre_mdt_rec_setattr_sa_fsuid_h = -1;
613 static int hf_lustre_mdt_rec_setattr_sa_fsgid = -1;
614 static int hf_lustre_mdt_rec_setattr_sa_fsgid_h = -1;
615 static int hf_lustre_mdt_rec_setattr_sa_suppgid = -1;
616 static int hf_lustre_mdt_rec_setattr_sa_suppgid_h = -1;
617 static int hf_lustre_mdt_rec_setattr_sa_padding_1 = -1;
618 static int hf_lustre_mdt_rec_setattr_sa_padding_1_h = -1;
619 static int hf_lustre_mdt_rec_setattr_sa_fid = -1;
620 static int hf_lustre_mdt_rec_setattr_sa_valid = -1;
621 static int hf_lustre_mdt_rec_setattr_sa_uid = -1;
622 static int hf_lustre_mdt_rec_setattr_sa_gid = -1;
623 static int hf_lustre_mdt_rec_setattr_sa_size = -1;
624 static int hf_lustre_mdt_rec_setattr_sa_blocks = -1;
625 static int hf_lustre_mdt_rec_setattr_sa_mtime = -1;
626 static int hf_lustre_mdt_rec_setattr_sa_atime = -1;
627 static int hf_lustre_mdt_rec_setattr_sa_ctime = -1;
628 static int hf_lustre_mdt_rec_setattr_sa_attr_flags = -1;
629 static int hf_lustre_mdt_rec_setattr_sa_mode = -1;
630 static int hf_lustre_mdt_rec_setattr_sa_padding_2 = -1;
631 static int hf_lustre_mdt_rec_setattr_sa_projid = -1;
632 static int hf_lustre_mdt_rec_setattr_sa_padding_4 = -1;
633 static int hf_lustre_mdt_rec_setattr_sa_padding_5 = -1;
634
635 static int hf_lustre_mdt_rec_create = -1 ;
636 static int hf_lustre_mdt_rec_create_cr_opcode = -1;
637 static int hf_lustre_mdt_rec_create_cr_cap = -1;
638 static int hf_lustre_mdt_rec_create_cr_fsuid = -1;
639 static int hf_lustre_mdt_rec_create_cr_fsuid_h = -1;
640 static int hf_lustre_mdt_rec_create_cr_fsgid = -1;
641 static int hf_lustre_mdt_rec_create_cr_fsgid_h = -1;
642 static int hf_lustre_mdt_rec_create_cr_suppgid1 = -1;
643 static int hf_lustre_mdt_rec_create_cr_suppgid1_h = -1;
644 static int hf_lustre_mdt_rec_create_cr_suppgid2 = -1;
645 static int hf_lustre_mdt_rec_create_cr_suppgid2_h = -1;
646 static int hf_lustre_mdt_rec_create_cr_fid1 = -1;
647 static int hf_lustre_mdt_rec_create_cr_fid2 = -1;
648 static int hf_lustre_mdt_rec_create_cr_old_handle = -1;
649 static int hf_lustre_mdt_rec_create_cr_time = -1;
650 static int hf_lustre_mdt_rec_create_cr_rdev = -1;
651 static int hf_lustre_mdt_rec_create_cr_ioepoch = -1;
652 static int hf_lustre_mdt_rec_create_cr_padding_1 = -1;
653 static int hf_lustre_mdt_rec_create_cr_mode = -1;
654 static int hf_lustre_mdt_rec_create_cr_bias = -1;
655 static int hf_lustre_mdt_rec_create_cr_flags_l = -1;
656 static int hf_lustre_mdt_rec_create_cr_flags_h = -1;
657 static int hf_lustre_mdt_rec_create_cr_umask = -1;
658 static int hf_lustre_mdt_rec_create_cr_padding_4 = -1;
659
660 static int hf_lustre_mdt_rec_link = -1 ;
661 static int hf_lustre_mdt_rec_link_lk_opcode = -1;
662 static int hf_lustre_mdt_rec_link_lk_cap = -1;
663 static int hf_lustre_mdt_rec_link_lk_fsuid = -1;
664 static int hf_lustre_mdt_rec_link_lk_fsuid_h = -1;
665 static int hf_lustre_mdt_rec_link_lk_fsgid = -1;
666 static int hf_lustre_mdt_rec_link_lk_fsgid_h = -1;
667 static int hf_lustre_mdt_rec_link_lk_suppgid1 = -1;
668 static int hf_lustre_mdt_rec_link_lk_suppgid1_h = -1;
669 static int hf_lustre_mdt_rec_link_lk_suppgid2 = -1;
670 static int hf_lustre_mdt_rec_link_lk_suppgid2_h = -1;
671 static int hf_lustre_mdt_rec_link_lk_fid1 = -1;
672 static int hf_lustre_mdt_rec_link_lk_fid2 = -1;
673 static int hf_lustre_mdt_rec_link_lk_time = -1;
674 static int hf_lustre_mdt_rec_link_lk_padding_1 = -1;
675 static int hf_lustre_mdt_rec_link_lk_padding_2 = -1;
676 static int hf_lustre_mdt_rec_link_lk_padding_3 = -1;
677 static int hf_lustre_mdt_rec_link_lk_padding_4 = -1;
678 static int hf_lustre_mdt_rec_link_lk_bias = -1;
679 static int hf_lustre_mdt_rec_link_lk_padding_5 = -1;
680 static int hf_lustre_mdt_rec_link_lk_padding_6 = -1;
681 static int hf_lustre_mdt_rec_link_lk_padding_7 = -1;
682 static int hf_lustre_mdt_rec_link_lk_padding_8 = -1;
683 static int hf_lustre_mdt_rec_link_lk_padding_9 = -1;
684
685 static int hf_lustre_mdt_rec_unlink = -1 ;
686 static int hf_lustre_mdt_rec_unlink_ul_opcode = -1;
687 static int hf_lustre_mdt_rec_unlink_ul_cap = -1;
688 static int hf_lustre_mdt_rec_unlink_ul_fsuid = -1;
689 static int hf_lustre_mdt_rec_unlink_ul_fsuid_h = -1;
690 static int hf_lustre_mdt_rec_unlink_ul_fsgid = -1;
691 static int hf_lustre_mdt_rec_unlink_ul_fsgid_h = -1;
692 static int hf_lustre_mdt_rec_unlink_ul_suppgid1 = -1;
693 static int hf_lustre_mdt_rec_unlink_ul_suppgid1_h = -1;
694 static int hf_lustre_mdt_rec_unlink_ul_suppgid2 = -1;
695 static int hf_lustre_mdt_rec_unlink_ul_suppgid2_h = -1;
696 static int hf_lustre_mdt_rec_unlink_ul_fid1 = -1;
697 static int hf_lustre_mdt_rec_unlink_ul_fid2 = -1;
698 static int hf_lustre_mdt_rec_unlink_ul_time = -1;
699 static int hf_lustre_mdt_rec_unlink_ul_padding_2 = -1;
700 static int hf_lustre_mdt_rec_unlink_ul_padding_3 = -1;
701 static int hf_lustre_mdt_rec_unlink_ul_padding_4 = -1;
702 static int hf_lustre_mdt_rec_unlink_ul_padding_5 = -1;
703 static int hf_lustre_mdt_rec_unlink_ul_bias = -1;
704 static int hf_lustre_mdt_rec_unlink_ul_mode = -1;
705 static int hf_lustre_mdt_rec_unlink_ul_padding_6 = -1;
706 static int hf_lustre_mdt_rec_unlink_ul_padding_7 = -1;
707 static int hf_lustre_mdt_rec_unlink_ul_padding_8 = -1;
708 static int hf_lustre_mdt_rec_unlink_ul_padding_9 = -1;
709
710 static int hf_lustre_mdt_rec_rename = -1 ;
711 static int hf_lustre_mdt_rec_rename_rn_opcode = -1;
712 static int hf_lustre_mdt_rec_rename_rn_cap = -1;
713 static int hf_lustre_mdt_rec_rename_rn_fsuid = -1;
714 static int hf_lustre_mdt_rec_rename_rn_fsuid_h = -1;
715 static int hf_lustre_mdt_rec_rename_rn_fsgid = -1;
716 static int hf_lustre_mdt_rec_rename_rn_fsgid_h = -1;
717 static int hf_lustre_mdt_rec_rename_rn_suppgid1 = -1;
718 static int hf_lustre_mdt_rec_rename_rn_suppgid1_h = -1;
719 static int hf_lustre_mdt_rec_rename_rn_suppgid2 = -1;
720 static int hf_lustre_mdt_rec_rename_rn_suppgid2_h = -1;
721 static int hf_lustre_mdt_rec_rename_rn_fid1 = -1;
722 static int hf_lustre_mdt_rec_rename_rn_fid2 = -1;
723 static int hf_lustre_mdt_rec_rename_rn_time = -1;
724 static int hf_lustre_mdt_rec_rename_rn_padding_1 = -1;
725 static int hf_lustre_mdt_rec_rename_rn_padding_2 = -1;
726 static int hf_lustre_mdt_rec_rename_rn_padding_3 = -1;
727 static int hf_lustre_mdt_rec_rename_rn_padding_4 = -1;
728 static int hf_lustre_mdt_rec_rename_rn_bias = -1;
729 static int hf_lustre_mdt_rec_rename_rn_mode = -1;
730 static int hf_lustre_mdt_rec_rename_rn_padding_5 = -1;
731 static int hf_lustre_mdt_rec_rename_rn_padding_6 = -1;
732 static int hf_lustre_mdt_rec_rename_rn_padding_7 = -1;
733 static int hf_lustre_mdt_rec_rename_rn_padding_8 = -1;
734
735 static int hf_lustre_mdt_rec_setxattr = -1 ;
736 static int hf_lustre_mdt_rec_setxattr_sx_opcode = -1;
737 static int hf_lustre_mdt_rec_setxattr_sx_cap = -1;
738 static int hf_lustre_mdt_rec_setxattr_sx_fsuid = -1;
739 static int hf_lustre_mdt_rec_setxattr_sx_fsuid_h = -1;
740 static int hf_lustre_mdt_rec_setxattr_sx_fsgid = -1;
741 static int hf_lustre_mdt_rec_setxattr_sx_fsgid_h = -1;
742 static int hf_lustre_mdt_rec_setxattr_sx_suppgid1 = -1;
743 static int hf_lustre_mdt_rec_setxattr_sx_suppgid1_h = -1;
744 static int hf_lustre_mdt_rec_setxattr_sx_suppgid2 = -1;
745 static int hf_lustre_mdt_rec_setxattr_sx_suppgid2_h = -1;
746 static int hf_lustre_mdt_rec_setxattr_sx_fid = -1;
747 static int hf_lustre_mdt_rec_setxattr_sx_padding_1 = -1;
748 static int hf_lustre_mdt_rec_setxattr_sx_padding_2 = -1;
749 static int hf_lustre_mdt_rec_setxattr_sx_padding_3 = -1;
750 static int hf_lustre_mdt_rec_setxattr_sx_valid = -1;
751 static int hf_lustre_mdt_rec_setxattr_sx_time = -1;
752 static int hf_lustre_mdt_rec_setxattr_sx_padding_5 = -1;
753 static int hf_lustre_mdt_rec_setxattr_sx_padding_6 = -1;
754 static int hf_lustre_mdt_rec_setxattr_sx_padding_7 = -1;
755 static int hf_lustre_mdt_rec_setxattr_sx_size = -1;
756 static int hf_lustre_mdt_rec_setxattr_sx_flags = -1;
757 static int hf_lustre_mdt_rec_setxattr_sx_padding_8 = -1;
758 static int hf_lustre_mdt_rec_setxattr_sx_padding_9 = -1;
759 static int hf_lustre_mdt_rec_setxattr_sx_padding_10 = -1;
760 static int hf_lustre_mdt_rec_setxattr_sx_padding_11 = -1;
761
762 static int hf_lustre_mdt_getinfo_key = -1;
763 static int hf_lustre_mdt_getinfo_vallen = -1;
764 static int hf_lustre_mdt_getinfo_data = -1;
765
766 static int hf_lustre_close_data = -1;
767 static int hf_lustre_close_fid = -1;
768 static int hf_lustre_close_data_ver = -1;
769 static int hf_lustre_close_reserved = -1;
770
771 static int hf_lustre_seq_opc = -1;
772 static int hf_lustre_seq_range = -1;
773 static int hf_lustre_seq_range_start = -1;
774 static int hf_lustre_seq_range_end = -1;
775 static int hf_lustre_seq_range_index = -1;
776 static int hf_lustre_seq_range_flags = -1;
777
778 static int hf_lustre_fld_opc = -1;
779 static int hf_lustre_fld_range = -1;
780 static int hf_lustre_fld_range_start = -1;
781 static int hf_lustre_fld_range_end = -1;
782 static int hf_lustre_fld_range_index = -1;
783 static int hf_lustre_fld_range_flags = -1;
784
785 static int hf_lustre_mdt_ioepoch = -1;
786 static int hf_lustre_mdt_ioepoch_handle = -1;
787 static int hf_lustre_mdt_ioepoch_ioepoch = -1;
788 static int hf_lustre_mdt_ioepoch_flags = -1;
789 static int hf_lustre_mdt_ioepoch_padding = -1;
790
791 static int hf_lustre_capa = -1;
792 static int hf_lustre_capa_fid = -1;
793 static int hf_lustre_capa_opc = -1;
794 static int hf_lustre_capa_uid = -1;
795 static int hf_lustre_capa_gid = -1;
796 static int hf_lustre_capa_flags = -1;
797 static int hf_lustre_capa_keyid = -1;
798 static int hf_lustre_capa_timeout = -1;
799 static int hf_lustre_capa_expiry = -1;
800 static int hf_lustre_capa_hmac = -1;
801
802 static int hf_lustre_acl = -1;
803
804 static int hf_lustre_ost_lvb_lvb_size = -1;
805 static int hf_lustre_ost_lvb_lvb_mtime = -1;
806 static int hf_lustre_ost_lvb_lvb_atime = -1;
807 static int hf_lustre_ost_lvb_lvb_ctime = -1;
808 static int hf_lustre_ost_lvb_lvb_blocks = -1;
809 static int hf_lustre_ost_lvb_lvb_mtime_ns = -1;
810 static int hf_lustre_ost_lvb_lvb_atime_ns = -1;
811 static int hf_lustre_ost_lvb_lvb_ctime_ns = -1;
812 static int hf_lustre_ost_lvb_lvb_padding = -1;
813
814 static int hf_lustre_xattrs = -1;
815 static int hf_lustre_xattrs_name = -1;
816 static int hf_lustre_xattrs_data = -1;
817 static int hf_lustre_xattrs_size = -1;
818
819 static int hf_lustre_lustre_handle_cookie = -1;
820 static int hf_lustre_ptlrpc_body_pb_last_committed = -1;
821 static int hf_lustre_ptlrpc_body_pb_version = -1;
822 static int hf_lustre_lustre_msg_v1_lm_bufcount = -1;
823 static int hf_lustre_obd_ioobj_ioo_id = -1;
824 static int hf_lustre_ptlrpc_body_pb_slv = -1;
825 static int hf_lustre_ptlrpc_body_pb_pre_version = -1;
826 static int hf_lustre_ptlrpc_body_pb_padding = -1;
827 static int hf_lustre_ptlrpc_body_pb_jobid = -1;
828 static int hf_lustre_lustre_msg_v1_lm_handle = -1;
829 static int hf_lustre_ptlrpc_body_pb_timeout = -1;
830 static int hf_lustre_obd_statfs_os_bavail = -1;
831 static int hf_lustre_obd_statfs_os_bsize = -1;
832 static int hf_lustre_lustre_msg_v2_lm_repsize = -1;
833 static int hf_lustre_lustre_msg_v1_lm_last_xid = -1;
834 static int hf_lustre_ll_fid_f_type = -1;
835 static int hf_lustre_lustre_msg_v2_lm_cksum = -1;
836 static int hf_lustre_lustre_msg_v2_lm_buflens = -1;
837 static int hf_lustre_lustre_msg_v1_lm_status = -1;
838 static int hf_lustre_lustre_msg_v1_lm_type = -1;
839 static int hf_lustre_niobuf_remote_len = -1;
840 static int hf_lustre_ptlrpc_body_pb_op_flags = -1;
841 static int hf_lustre_ptlrpc_body_pb_type = -1;
842 static int hf_lustre_obd_connect_data_ocd_nllg = -1;
843 static int hf_lustre_obd_connect_data_ocd_nllu = -1;
844 static int hf_lustre_ll_fid_generation = -1;
845 static int hf_lustre_obd_connect_data_ocd_ibits_known = -1;
846 static int hf_lustre_lustre_msg_v2_lm_padding_3 = -1;
847 static int hf_lustre_ptlrpc_body_pb_flags = -1;
848 static int hf_lustre_obd_statfs_os_spare4 = -1;
849 static int hf_lustre_obd_connect_data_ocd_group = -1;
850 static int hf_lustre_lov_ost_data_v1_l_object_seq = -1;
851 static int hf_lustre_obd_connect_data_ocd_brw_size = -1;
852 static int hf_lustre_ptlrpc_body_pb_limit = -1;
853 static int hf_lustre_obd_statfs_os_maxbytes = -1;
854 static int hf_lustre_obd_statfs_os_spare5 = -1;
855 static int hf_lustre_lustre_msg_v2_lm_flags = -1;
856 static int hf_lustre_obd_statfs_os_ffree = -1;
857 static int hf_lustre_obd_statfs_os_files = -1;
858 static int hf_lustre_lustre_msg_v1_lm_flags = -1;
859 static int hf_lustre_lustre_msg_v1_lm_last_committed = -1;
860 static int hf_lustre_obd_statfs_os_spare9 = -1;
861 static int hf_lustre_obd_connect_data_ocd_index = -1;
862 static int hf_lustre_opnum = -1;
863 static int hf_lustre_lustre_msg_v1_lm_buflens = -1;
864 static int hf_lustre_obd_statfs_os_spare1 = -1;
865 static int hf_lustre_obd_statfs_os_spare8 = -1;
866 static int hf_lustre_lustre_msg_v1_lm_conn_cnt = -1;
867 static int hf_lustre_ptlrpc_body_pb_transno = -1;
868 static int hf_lustre_ptlrpc_body_pb_service_time = -1;
869 static int hf_lustre_ptlrpc_body_pb_conn_cnt = -1;
870 static int hf_lustre_ptlrpc_body_pb_opc = -1;
871 static int hf_lustre_obd_connect_data_ocd_connect_flags = -1;
872 static int hf_lustre_lov_ost_data_v1_l_object_id = -1;
873 static int hf_lustre_lov_ost_data_v1_l_ost_gen = -1;
874 static int hf_lustre_obd_statfs_os_bfree = -1;
875 static int hf_lustre_obd_connect_data_ocd_version = -1;
876 static int hf_lustre_obd_statfs_os_namelen = -1;
877 static int hf_lustre_obd_statfs_os_blocks = -1;
878 static int hf_lustre_lustre_msg_v2_lm_secflvr = -1;
879 static int hf_lustre_lustre_msg_v1_lm_transno = -1;
880 static int hf_lustre_lustre_msg_v1_lm_opc = -1;
881 static int hf_lustre_obd_connect_data_ocd_grant = -1;
882 static int hf_lustre_obd_ioobj_ioo_bufcnt = -1;
883 static int hf_lustre_lustre_msg_v1_lm_version = -1;
884 static int hf_lustre_obd_statfs_os_spare7 = -1;
885 static int hf_lustre_obd_statfs_os_fsid = -1;
886 static int hf_lustre_obd_connect_data_ocd_cksum_types = -1;
887 static int hf_lustre_obd_connect_data_ocd_max_easize = -1;
888 static int hf_lustre_obd_connect_data_ocd_instance = -1;
889 static int hf_lustre_obd_connect_data_ocd_maxbytes = -1;
890 static int hf_lustre_obd_connect_data_ocd_maxmodrpcs = -1;
891 static int hf_lustre_obd_statfs_os_type = -1;
892 static int hf_lustre_obd_statfs_os_spare6 = -1;
893 static int hf_lustre_obd_statfs_os_state = -1;
894 static int hf_lustre_obd_statfs_os_spare3 = -1;
895 static int hf_lustre_lustre_msg_v2_lm_magic = -1;
896 static int hf_lustre_ptlrpc_body_pb_last_seen = -1;
897 static int hf_lustre_obd_ioobj_ioo_max_brw = -1;
898 static int hf_lustre_ptlrpc_body_pb_last_xid = -1;
899 static int hf_lustre_ptlrpc_body_pb_status = -1;
900 static int hf_lustre_niobuf_remote_flags = -1;
901 static int hf_lustre_ll_fid_id = -1;
902 static int hf_lustre_lustre_msg_v2_lm_padding_2 = -1;
903 static int hf_lustre_lov_ost_data_v1_l_ost_idx = -1;
904 static int hf_lustre_obd_ioobj_ioo_seq = -1;
905 static int hf_lustre_niobuf_remote_offset=-1;
906 static int hf_lustre_obd_statfs_os_spare2 = -1;
907 static int hf_lustre_lustre_msg_v2_lm_bufcount = -1;
908 static int hf_lustre_ptlrpc_body_pb_handle = -1;
909 static int hf_lustre_obd_connect_data_ocd_transno = -1;
910 static int hf_lustre_lustre_msg_v1_lm_magic = -1;
911 static int hf_lustre_llog_unlink_rec_lur_tail = -1;
912 static int hf_lustre_llog_size_change_rec_lsc_io_epoch = -1;
913 static int hf_lustre_mgs_target_info_mti_flags = -1;
914 static int hf_lustre_ldlm_reply_lock_policy_res1 = -1;
915 static int hf_lustre_llogd_body_lgd_len = -1;
916 static int hf_lustre_qunit_data_old_qd_id = -1;
917 static int hf_lustre_llog_logid_rec_padding1 = -1;
918 static int hf_lustre_quota_adjust_qunit_padding1 = -1;
919 static int hf_lustre_llog_size_change_rec_lsc_fid = -1;
920 static int hf_lustre_llog_rec_hdr_padding = -1;
921 static int hf_lustre_obdo_o_nlink = -1;
922 static int hf_lustre_ldlm_extent_gid = -1;
923 static int hf_lustre_obdo_o_uid = -1;
924 static int hf_lustre_obdo_o_valid = -1;
925 static int hf_lustre_ldlm_reply_lock_flags = -1;
926 static int hf_lustre_obdo_o_misc = -1;
927
928 static int hf_lustre_ldlm_request_lock_handle = -1;
929 static int hf_lustre_llog_logid_lgl_oid = -1;
930 static int hf_lustre_ldlm_inodebits_bits = -1;
931 static int hf_lustre_llog_log_hdr_llh_count = -1;
932 static int hf_lustre_llog_gen_rec_lgr_tail = -1;
933 static int hf_lustre_llog_catid_lci_padding3 = -1;
934 static int hf_lustre_qunit_data_qd_qunit = -1;
935 static int hf_lustre_llog_setattr_rec_padding = -1;
936 static int hf_lustre_llog_cookie_lgc_lgl = -1;
937 static int hf_lustre_obd_quotactl_qc_dqinfo = -1;
938 static int hf_lustre_llog_log_hdr_llh_bitmap = -1;
939 static int hf_lustre_obd_quotactl_qc_stat = -1;
940 static int hf_lustre_qunit_data_old2_qd_id = -1;
941 static int hf_lustre_llog_logid_rec_padding2 = -1;
942 static int hf_lustre_llog_logid_rec_padding5 = -1;
943 static int hf_lustre_ldlm_intent_opc = -1;
944 static int hf_lustre_llog_rec_hdr_lrh_type = -1;
945 static int hf_lustre_llog_rec_hdr_lrh_len = -1;
946 static int hf_lustre_llog_setattr_rec_lsr_uid = -1;
947 static int hf_lustre_lov_desc_ld_padding_1 = -1;
948 static int hf_lustre_obdo_o_padding_4 = -1;
949 static int hf_lustre_mgs_target_info_padding = -1;
950 static int hf_lustre_obd_quotactl_qc_dqblk = -1;
951 static int hf_lustre_llogd_conn_body_lgdc_gen = -1;
952 static int hf_lustre_llog_log_hdr_llh_tail = -1;
953 static int hf_lustre_obdo_o_size = -1;
954 static int hf_lustre_ldlm_extent_start = -1;
955 static int hf_lustre_llog_size_change_rec_lsc_hdr = -1;
956 static int hf_lustre_llog_logid_lgl_oseq = -1;
957 static int hf_lustre_llog_cookie_lgc_padding = -1;
958 static int hf_lustre_qunit_data_old_qd_type = -1;
959 static int hf_lustre_ldlm_flock_blocking_export = -1;
960 static int hf_lustre_lov_desc_ld_pattern = -1;
961 static int hf_lustre_qunit_data_qd_id = -1;
962 static int hf_lustre_mgs_target_info_mti_fsname = -1;
963 static int hf_lustre_ldlm_request_lock_flags = -1;
964 static int hf_lustre_obdo_o_mode = -1;
965 static int hf_lustre_mgs_target_info_mti_svname = -1;
966 static int hf_lustre_llogd_body_lgd_logid = -1;
967 static int hf_lustre_llog_log_hdr_llh_size = -1;
968 static int hf_lustre_obdo_o_handle = -1;
969 static int hf_lustre_obdo_o_atime = -1;
970 static int hf_lustre_quota_adjust_qunit_qaq_id = -1;
971 static int hf_lustre_ldlm_lock_desc_l_policy_data = -1;
972 static int hf_lustre_obd_quotactl_qc_cmd = -1;
973 static int hf_lustre_qunit_data_padding = -1;
974 static int hf_lustre_quota_adjust_qunit_qaq_flags = -1;
975 static int hf_lustre_ldlm_lock_desc_l_granted_mode = -1;
976 static int hf_lustre_obdo_o_seq = -1;
977 static int hf_lustre_obdo_o_gid = -1;
978 static int hf_lustre_llog_catid_lci_logid = -1;
979 static int hf_lustre_llog_rec_tail_lrt_index = -1;
980 static int hf_lustre_lov_desc_ld_default_stripe_count = -1;
981 static int hf_lustre_ldlm_resource_desc_lr_padding = -1;
982 static int hf_lustre_cfg_marker_cm_vers = -1;
983 static int hf_lustre_llog_unlink_rec_lur_hdr = -1;
984 static int hf_lustre_llogd_body_lgd_index = -1;
985 static int hf_lustre_cfg_marker_cm_tgtname = -1;
986 static int hf_lustre_llog_setattr_rec_lsr_ogen = -1;
987 static int hf_lustre_llog_logid_rec_lid_hdr = -1;
988 static int hf_lustre_obdo_o_ioepoch = -1;
989 static int hf_lustre_ost_body_oa = -1;
990 static int hf_lustre_llog_logid_rec_padding3 = -1;
991 static int hf_lustre_llog_log_hdr_llh_flags = -1;
992 static int hf_lustre_llog_setattr_rec_lsr_oid = -1;
993 static int hf_lustre_llog_size_change_rec_padding = -1;
994 static int hf_lustre_mgs_target_info_mti_config_ver = -1;
995 static int hf_lustre_cfg_marker_cm_createtime = -1;
996 static int hf_lustre_qunit_data_old_qd_count = -1;
997 static int hf_lustre_llog_catid_lci_padding1 = -1;
998 static int hf_lustre_lov_desc_ld_active_tgt_count = -1;
999 static int hf_lustre_obdo_o_lcookie = -1;
1000 static int hf_lustre_llog_gen_rec_lgr_gen = -1;
1001 static int hf_lustre_obdo_o_id = -1;
1002 static int hf_lustre_mgs_target_info_mti_uuid = -1;
1003 static int hf_lustre_llog_rec_hdr_lrh_index = -1;
1004 static int hf_lustre_llog_setattr_rec_lsr_hdr = -1;
1005 static int hf_lustre_mgs_target_info_mti_stripe_index = -1;
1006 static int hf_lustre_llog_gen_conn_cnt = -1;
1007 static int hf_lustre_obdo_o_padding_6 = -1;
1008 static int hf_lustre_llog_cookie_lgc_index = -1;
1009 static int hf_lustre_lov_desc_ld_uuid = -1;
1010 static int hf_lustre_ldlm_reply_lock_desc = -1;
1011 static int hf_lustre_lov_desc_ld_padding_0 = -1;
1012 static int hf_lustre_llog_unlink_rec_lur_ogen = -1;
1013 static int hf_lustre_cfg_marker_cm_flags = -1;
1014 static int hf_lustre_obdo_o_padding_3 = -1;
1015 static int hf_lustre_ldlm_request_lock_desc = -1;
1016 static int hf_lustre_obdo_o_flags = -1;
1017 static int hf_lustre_mgs_target_info_mti_params = -1;
1018 static int hf_lustre_llog_logid_lgl_ogen = -1;
1019 static int hf_lustre_cfg_marker_cm_comment = -1;
1020 static int hf_lustre_llog_unlink_rec_lur_oid = -1;
1021 static int hf_lustre_qunit_data_qd_count = -1;
1022 static int hf_lustre_obdo_o_mtime = -1;
1023 static int hf_lustre_obdo_o_blksize = -1;
1024 static int hf_lustre_ldlm_res_id_name = -1;
1025 static int hf_lustre_ldlm_reply_lock_handle = -1;
1026 static int hf_lustre_llogd_body_lgd_saved_index = -1;
1027 static int hf_lustre_qunit_data_old_qd_isblk = -1;
1028 static int hf_lustre_obdo_o_blocks = -1;
1029 static int hf_lustre_lov_desc_ld_padding_2 = -1;
1030 static int hf_lustre_llog_logid_rec_lid_tail = -1;
1031 static int hf_lustre_obdo_o_grant = -1;
1032 static int hf_lustre_obdo_o_uid_h = -1;
1033 static int hf_lustre_obdo_o_gid_h = -1;
1034 static int hf_lustre_quota_adjust_qunit_qaq_iunit_sz = -1;
1035 static int hf_lustre_llog_unlink_rec_padding = -1;
1036 static int hf_lustre_ldlm_lock_desc_l_req_mode = -1;
1037 static int hf_lustre_ldlm_extent_end = -1;
1038 static int hf_lustre_llog_gen_rec_lgr_hdr = -1;
1039 static int hf_lustre_llogd_body_lgd_llh_flags = -1;
1040 static int hf_lustre_llog_log_hdr_llh_cat_idx = -1;
1041 static int hf_lustre_llog_log_hdr_llh_bitmap_offset=-1;
1042 static int hf_lustre_ldlm_reply_lock_padding = -1;
1043 static int hf_lustre_obd_quotactl_qc_id = -1;
1044 static int hf_lustre_llog_logid_rec_padding4 = -1;
1045 static int hf_lustre_llog_setattr_rec_lsr_gid = -1;
1046 static int hf_lustre_obd_quotactl_qc_type = -1;
1047 static int hf_lustre_cfg_marker_padding = -1;
1048 static int hf_lustre_mgs_target_info_mti_nids = -1;
1049 static int hf_lustre_obdo_o_stripe_idx = -1;
1050 static int hf_lustre_llogd_conn_body_lgdc_logid = -1;
1051 static int hf_lustre_ldlm_flock_blocking_pid = -1;
1052 static int hf_lustre_lov_desc_ld_tgt_count = -1;
1053 static int hf_lustre_llogd_body_lgd_cur_offset=-1;
1054 static int hf_lustre_qunit_data_old2_qd_count = -1;
1055 static int hf_lustre_qunit_data_old2_qd_flags = -1;
1056 static int hf_lustre_ldlm_flock_start = -1;
1057 static int hf_lustre_quota_adjust_qunit_qaq_bunit_sz = -1;
1058 static int hf_lustre_ldlm_flock_pid = -1;
1059 static int hf_lustre_lov_desc_ld_default_stripe_size = -1;
1060 static int hf_lustre_llog_log_hdr_llh_tgtuuid = -1;
1061 static int hf_lustre_cfg_marker_cm_step = -1;
1062 static int hf_lustre_mgs_send_param_mgs_param = -1;
1063 static int hf_lustre_lov_desc_ld_default_stripe_offset=-1;
1064 static int hf_lustre_ldlm_resource_desc_lr_name = -1;
1065 static int hf_lustre_llog_rec_tail_lrt_len = -1;
1066 static int hf_lustre_llog_log_hdr_llh_timestamp = -1;
1067 static int hf_lustre_llog_catid_lci_padding2 = -1;
1068 static int hf_lustre_llogd_conn_body_lgdc_ctxt_idx = -1;
1069 static int hf_lustre_cfg_marker_cm_canceltime = -1;
1070 static int hf_lustre_mgs_target_info_mti_lustre_ver = -1;
1071 static int hf_lustre_obdo_o_parent_ver = -1;
1072 static int hf_lustre_qunit_data_qd_flags = -1;
1073 static int hf_lustre_llog_logid_rec_lid_id = -1;
1074 static int hf_lustre_obdo_o_parent_oid = -1;
1075 static int hf_lustre_llog_gen_mnt_cnt = -1;
1076 static int hf_lustre_llog_size_change_rec_lsc_tail = -1;
1077 static int hf_lustre_obdo_o_padding_5 = -1;
1078 static int hf_lustre_ldlm_lock_desc_l_resource = -1;
1079 static int hf_lustre_obdo_o_parent_seq = -1;
1080 static int hf_lustre_ldlm_request_lock_count = -1;
1081 static int hf_lustre_ldlm_flock_end = -1;
1082 static int hf_lustre_mgs_target_info_mti_nid_count = -1;
1083 static int hf_lustre_obdo_o_ctime = -1;
1084 static int hf_lustre_ldlm_reply_lock_policy_res2 = -1;
1085 static int hf_lustre_llogd_body_lgd_ctxt_idx = -1;
1086 static int hf_lustre_lov_desc_ld_qos_maxage = -1;
1087 static int hf_lustre_ldlm_resource_desc_lr_type = -1;
1088 static int hf_lustre_llog_setattr_rec_lsr_tail = -1;
1089 static int hf_lustre_llog_cookie_lgc_subsys = -1;
1090 static int hf_lustre_llog_log_hdr_llh_hdr = -1;
1091 static int hf_lustre_llog_log_hdr_llh_reserved = -1;
1092
1093 /* Header field declarations for field from lustre_user.h*/
1094 static int hf_lustre_obd_dqinfo_dqi_valid = -1;
1095 static int hf_lustre_obd_dqblk_dqb_isoftlimit = -1;
1096 static int hf_lustre_obd_dqblk_dqb_bhardlimit = -1;
1097 static int hf_lustre_obd_dqblk_dqb_curspace = -1;
1098 static int hf_lustre_obd_dqblk_dqb_itime = -1;
1099 static int hf_lustre_obd_dqblk_dqb_valid = -1;
1100 static int hf_lustre_obd_dqinfo_dqi_igrace = -1;
1101 static int hf_lustre_obd_dqinfo_dqi_bgrace = -1;
1102 static int hf_lustre_obd_dqblk_padding = -1;
1103 static int hf_lustre_obd_dqblk_dqb_curinodes = -1;
1104 static int hf_lustre_obd_dqblk_dqb_bsoftlimit = -1;
1105 static int hf_lustre_obd_dqinfo_dqi_flags = -1;
1106 static int hf_lustre_obd_dqblk_dqb_btime = -1;
1107 static int hf_lustre_obd_dqblk_dqb_ihardlimit = -1;
1108 static int hf_lustre_ldlm_intent_opc_open     = -1 ;
1109 static int hf_lustre_ldlm_intent_opc_creat    = -1;
1110 static int hf_lustre_ldlm_intent_opc_readdir  = -1;
1111 static int hf_lustre_ldlm_intent_opc_getattr  = -1;
1112 static int hf_lustre_ldlm_intent_opc_lookup   = -1;
1113 static int hf_lustre_ldlm_intent_opc_unlink   = -1;
1114 static int hf_lustre_ldlm_intent_opc_trunc    = -1;
1115 static int hf_lustre_ldlm_intent_opc_getxattr = -1;
1116 static int hf_lustre_ldlm_intent_opc_exec     = -1;
1117 static int hf_lustre_ldlm_intent_opc_pin      = -1;
1118 static int hf_lustre_ldlm_intent_opc_layout   = -1;
1119 static int hf_lustre_ldlm_intent_opc_q_dqacq  = -1;
1120 static int hf_lustre_ldlm_intent_opc_q_conn   = -1;
1121 static int hf_lustre_ldlm_intent_opc_setxattr = -1;
1122 static int hf_lustre_llog_hdr_llh_flag_zap_when_empty = -1;
1123 static int hf_lustre_llog_hdr_llh_flag_is_cat = -1;
1124 static int hf_lustre_llog_hdr_llh_flag_is_play = -1;
1125 static int hf_lustre_lu_ladvise = -1;
1126 static int hf_lustre_lu_ladvise_lla_start = -1;
1127 static int hf_lustre_lu_ladvise_lla_end = -1;
1128 static int hf_lustre_lu_ladvise_lla_advice = -1;
1129 static int hf_lustre_lu_ladvise_lla_padding = -1;
1130
1131 static int hf_lustre_ldlm_key = -1;
1132 static int hf_lustre_ldlm_value = -1;
1133
1134 static int hf_lustre_hsm_request = -1;
1135 static int hf_lustre_hsm_req_action = -1;
1136 static int hf_lustre_hsm_req_archive_id = -1;
1137 static int hf_lustre_hsm_req_flags = -1;
1138 static int hf_lustre_hsm_req_itemcount = -1;
1139 static int hf_lustre_hsm_req_data_len = -1;
1140
1141 static int hf_lustre_hsm_user_item = -1;
1142 static int hf_lustre_hsm_user_item_fid = -1;
1143 static int hf_lustre_hsm_user_item_extent = -1;
1144
1145 static int hf_lustre_hsm_extent = -1;
1146 static int hf_lustre_hsm_extent_offset = -1;
1147 static int hf_lustre_hsm_extent_length = -1;
1148
1149 static int hf_lustre_hsm_progress = -1;
1150 static int hf_lustre_hsm_prog_fid = -1;
1151 static int hf_lustre_hsm_prog_cookie = -1;
1152 static int hf_lustre_hsm_prog_extent = -1;
1153 static int hf_lustre_hsm_prog_flags = -1;
1154 static int hf_lustre_hsm_prog_errval = -1;
1155 static int hf_lustre_hsm_prog_data_ver = -1;
1156
1157 static int hf_lustre_hsm_state_get = -1;
1158 static int hf_lustre_hsm_us_states = -1;
1159 static int hf_lustre_hsm_us_archive_id = -1;
1160 static int hf_lustre_hsm_us_in_prog_state = -1;
1161 static int hf_lustre_hsm_us_in_prog_action = -1;
1162 static int hf_lustre_hsm_us_in_prog_location = -1;
1163 static int hf_lustre_hsm_us_ext_info = -1;
1164
1165 /* Quota Body */
1166 static int hf_lustre_qb = -1;
1167 static int hf_lustre_qb_fid = -1;
1168 static int hf_lustre_qb_id = -1;
1169 static int hf_lustre_qb_flags = -1;
1170 static int hf_lustre_qb_padding = -1;
1171 static int hf_lustre_qb_count = -1;
1172 static int hf_lustre_qb_usage = -1;
1173 static int hf_lustre_qb_slv_ver = -1;
1174 static int hf_lustre_qb_lockh = -1;
1175 static int hf_lustre_qb_glb_lockh = -1;
1176
1177 static int hf_lustre_qid_fid = -1;
1178 static int hf_lustre_qid_uid = -1;
1179 static int hf_lustre_qid_gid = -1;
1180
1181 /* Layout Intent */
1182 static int hf_lustre_layout_intent = -1;
1183 static int hf_lustre_layout_intent_opc = -1;
1184 static int hf_lustre_layout_intent_flags = -1;
1185 static int hf_lustre_layout_intent_start = -1;
1186 static int hf_lustre_layout_intent_end = -1;
1187
1188 /* mds md v1 and v3 */
1189 static int hf_lustre_lov_mds_md_lmm_magic = -1;
1190 static int hf_lustre_lov_mds_md_lmm_pattern = -1;
1191 static int hf_lustre_lov_mds_md_lmm_object_id = -1;     /* v1 only */
1192 static int hf_lustre_lov_mds_md_lmm_oi = -1;            /* v3 only */
1193 static int hf_lustre_lov_mds_md_lmm_object_seq = -1;    /* v1 only */
1194 static int hf_lustre_lov_mds_md_lmm_stripe_size = -1;
1195 static int hf_lustre_lov_mds_md_lmm_stripe_count = -1;
1196 static int hf_lustre_lov_mds_md_lmm_layout_gen = -1;
1197 static int hf_lustre_lov_mds_md_lmm_pool_name = -1;     /* v3 only */
1198 static int hf_lustre_lov_mds_md_lmm_objects = -1;
1199
1200 /* struct ost_id */
1201 static int hf_lustre_ost_id_oi_id = -1;
1202 static int hf_lustre_ost_id_oi_seq = -1;
1203
1204 static int hf_lustre_generic_data = -1;
1205 /* --------------------------------------------------------------------*/
1206
1207
1208 /* proto declaration */
1209 static gint proto_lustre = -1;
1210
1211 typedef int (dissect_func)(
1212     tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tree,
1213     int hfindex);
1214
1215 static dissect_func dissect_uint64, dissect_uint32, dissect_uint16, dissect_uint8;
1216
1217 #define  WSHARK_HEAD
1218 #include "lustre_dlm_flags_wshark.c"
1219 #undef   WSHARK_HEAD
1220
1221 static int ldlm_opcode_process(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree * tree _U_, guint64 intent_opc _U_) ;
1222 static int add_extra_padding(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree * tree _U_) ;
1223
1224
1225 /* ======================================================================== */
1226 /*the value_string*/
1227 const value_string lustre_ldlm_opcode[] = {
1228   { IT_OPEN    ,   "IT_OPEN    "},
1229   { IT_CREAT   ,   "IT_CREAT   "},
1230   { IT_READDIR ,   "IT_READDIR "},
1231   { IT_GETATTR ,   "IT_GETATTR "},
1232   { IT_LOOKUP  ,   "IT_LOOKUP  "},
1233   { IT_UNLINK  ,   "IT_UNLINK  "},
1234   { IT_GETXATTR,   "IT_GETXATTR"},
1235   { IT_EXEC    ,   "IT_EXEC    "},
1236   { IT_PIN     ,   "IT_PIN     "},
1237   { 0, NULL }
1238 };
1239
1240 const value_string lustre_lov_magic[] = {
1241   { LOV_MAGIC_V1,   "LOV_MAGIC_V1" },
1242   { LOV_MAGIC_V3,   "LOV_MAGIC_V3" },
1243   {0, NULL}
1244 };
1245
1246 const value_string lustre_llog_op_type[] = {
1247   {LLOG_PAD_MAGIC   ,"LLOG_PAD_MAGIC  "},
1248   {OST_SZ_REC       ,"OST_SZ_REC      "},
1249   {OST_RAID1_REC    ,"OST_RAID1_REC   "},
1250   {MDS_UNLINK_REC   ,"MDS_UNLINK_REC  "},
1251   {MDS_SETATTR_REC  ,"MDS_SETATTR_REC "},
1252   {OBD_CFG_REC      ,"OBD_CFG_REC     "},
1253   {PTL_CFG_REC      ,"PTL_CFG_REC     "},
1254   {LLOG_GEN_REC     ,"LLOG_GEN_REC    "},
1255   {LLOG_JOIN_REC    ,"LLOG_JOIN_REC   "},
1256   {LLOG_HDR_MAGIC   ,"LLOG_HDR_MAGIC  "},
1257   {LLOG_LOGID_MAGIC ,"LLOG_LOGID_MAGIC"},
1258   { 0, NULL }
1259 };
1260
1261 const value_string lustre_llog_hdr_llh_flags[]= {
1262   {LLOG_F_ZAP_WHEN_EMPTY , "LLOhdr_llh_G_F_ZAP_WHEN_EMPTY"},
1263   {LLOG_F_IS_CAT         , "LLOhdr_llh_G_F_IS_CAT"},
1264   {LLOG_F_IS_PLAIN       , "LLOG_F_IS_PLAIN"},
1265   { 0, NULL }
1266 };
1267
1268 const value_string lustre_mds_flags_vals[] = {
1269   {0x00000008, "LUSTRE_SYNC_FL        "},   /* Synchronous updates */
1270   {0x00000010, "LUSTRE_IMMUTABLE_FL   "},   /* Immutable file */
1271   {0x00000020, "LUSTRE_APPEND_FL      "},   /* writes to file may only append */
1272   {0x00000040, "LUSTRE_NODUMP_FL      "},   /* do not dump file */
1273   {0x00000080, "LUSTRE_NOATIME_FL     "},   /* do not update atime */
1274   {0x00001000, "LUSTRE_INDEX_FL       "},   /* hash-indexed directory */
1275   {0x00010000, "LUSTRE_DIRSYNC_FL     "},   /* dirsync behaviour (dir only) */
1276   {0x00020000, "LUSTRE_TOPDIR_FL      "},   /* Top of directory hierarchies */
1277   {0x00100000, "LUSTRE_DIRECTIO_FL    "},   /* Use direct i/o */
1278   {0x10000000, "LUSTRE_INLINE_DATA_FL "},   /* Inode has inline data. */
1279   { 0, NULL }
1280 };
1281
1282 const value_string lustre_mgs_config_body_types[] = {
1283   { 0,  "CONFIG" },
1284   { 1,  "SPTLRPC" },
1285   { 2,  "RECOVER" },
1286   { 3,  "MAX" },
1287   { 0, NULL }
1288 };
1289
1290 const value_string lustre_LMTypes[] = {
1291   { PTL_RPC_MSG_REQUEST, "request"},
1292   { PTL_RPC_MSG_ERR , "error"},
1293   { PTL_RPC_MSG_REPLY , "reply"},
1294   { 0, NULL }
1295 };
1296
1297 const value_string lustre_mds_reint_op_vals[] = {
1298   { REINT_SETATTR, "REINT_SETATTR" },
1299   { REINT_CREATE, "REINT_CREATE" },
1300   { REINT_LINK, "REINT_LINK" },
1301   { REINT_UNLINK, "REINT_UNLINK" },
1302   { REINT_RENAME, "REINT_RENAME" },
1303   { REINT_OPEN, "REINT_OPEN" },
1304   { REINT_SETXATTR, "REINT_SETXATTR" },
1305   { REINT_RMENTRY, "REINT_RMENTRY" },
1306   { REINT_MIGRATE, "REINT_MIGRATE" },
1307   { 0, NULL }
1308 };
1309 const value_string lustre_op_codes[] = {
1310   /*OST Opcodes*/
1311   {0 , "OST_REPLY"},
1312   {1 , "OST_GETATTR"},
1313   {2 , "OST_SETATTR"},
1314   {3 , "OST_READ"},
1315   {4 , "OST_WRITE"},
1316   {5 , "OST_CREATE"},
1317   {6 , "OST_DESTROY"},
1318   {7 , "OST_GET_INFO"},
1319   {8 , "OST_CONNECT"},
1320   {9 , "OST_DISCONNECT"},
1321   {10 , "OST_PUNCH"},
1322   {11 , "OST_OPEN"},
1323   {12 , "OST_CLOSE"},
1324   {13 , "OST_STATFS"},
1325   {14 , "OST_SAN_READ(deprecated)"},
1326   {15 , "OST_SAN_WRITE(deprecated)"},
1327   {16 , "OST_SYNC"},
1328   {17 , "OST_SET_INFO"},
1329   {18 , "OST_QUOTACHECK"},
1330   {19 , "OST_QUOTACTL"},
1331   {20 , "OST_QUOTA_ADJUST_QUNIT"},
1332   {21 , "OST_LADVISE"},
1333   {22 , "OST_LAST_OPC"},
1334   /*MDS Opcodes*/
1335   {33 , "MDS_GETATTR"},
1336   {34 , "MDS_GETATTR_NAME"},
1337   {35 , "MDS_CLOSE"},
1338   {36 , "MDS_REINT"},
1339   {37 , "MDS_READPAGE"},
1340   {38 , "MDS_CONNECT"},
1341   {39 , "MDS_DISCONNECT"},
1342   {40 , "MDS_GET_ROOT"},
1343   {41 , "MDS_STATFS"},
1344   {42 , "MDS_PIN"},
1345   {43 , "MDS_UNPIN"},
1346   {44 , "MDS_SYNC"},
1347   {45 , "MDS_DONE_WRITING"},
1348   {46 , "MDS_SET_INFO"},
1349   {47 , "MDS_QUOTACHECK"},
1350   {48 , "MDS_QUOTACTL"},
1351   {49 , "MDS_GETXATTR"},
1352   {50 , "MDS_SETXATTR"},
1353   {51 , "MDS_WRITEPAGE"},
1354   {52 , "MDS_IS_SUBDIR"},
1355   {53 , "MDS_GET_INFO"},
1356   {54 , "MDS_HSM_STATE_GET"},
1357   {55 , "MDS_HSM_STATE_SET"},
1358   {56 , "MDS_HSM_ACTION"},
1359   {57 , "MDS_HSM_PROGRESS"},
1360   {58 , "MDS_HSM_REQUEST"},
1361   {59 , "MDS_HSM_CT_REGISTER"},
1362   {60 , "MDS_HSM_CT_UNREGISTER"},
1363   {61 , "MDS_SWAP_LAYOUTS"},
1364   {62 , "MDS_LAST_OPC"},
1365   /*LDLM Opcodes*/
1366   {101 , "LDLM_ENQUEUE"},
1367   {102 , "LDLM_CONVERT"},
1368   {103 , "LDLM_CANCEL"},
1369   {104 , "LDLM_BL_CALLBACK"},
1370   {105 , "LDLM_CP_CALLBACK"},
1371   {106 , "LDLM_GL_CALLBACK"},
1372   {107 , "LDLM_SET_INFO"},
1373   {108 , "LDLM_LAST_OPC"},
1374   /*MGS Opcodes*/
1375   {250 , "MGS_CONNECT"},
1376   {251 , "MGS_DISCONNECT"},
1377   {252 , "MGS_EXCEPTION"},
1378   {253 , "MGS_TARGET_REG"},
1379   {254 , "MGS_TARGET_DEL"},
1380   {255 , "MGS_SET_INFO"},
1381   {256 , "MGS_CONFIG_READ"},
1382   {257 , "MGS_LAST_OPC"},
1383   /*OBD Opcodes*/
1384   {400 , "OBD_PING"},
1385   {401 , "OBD_LOG_CANCEL"},
1386   {402 , "OBD_QC_CALLBACK"},
1387   {403 , "OBD_LAST_OPC"},
1388   /* LLOG opcodes */
1389   { 501, "LLOG_ORIGIN_HANDLE_CREATE"},
1390   { 502, "LLOG_ORIGIN_HANDLE_NEXT_BLOCK"},
1391   { 503, "LLOG_ORIGIN_HANDLE_READ_HEADER"},
1392   { 504, "LLOG_ORIGIN_HANDLE_WRITE_REC"},
1393   { 505, "LLOG_ORIGIN_HANDLE_CLOSE"},
1394   { 506, "LLOG_ORIGIN_CONNECT"},
1395   { 507, "LLOG_CATINFO"},
1396   { 508, "LLOG_ORIGIN_HANDLE_PREV_BLOCK"},
1397   { 509, "LLOG_ORIGIN_HANDLE_DESTROY"},
1398   /* SEQ RPC opcodes */
1399   { 700, "SEQ_QUERY"},
1400   { 701, "SEQ_LAST_OPC"},
1401   /* FLD RPC opcodes */
1402   { 900, "FLD_QUERY"},
1403   { 901, "FLD_LAST_OPC"},
1404   { 0, NULL }
1405 };
1406
1407 /* detailled version the information came from : http://wiki.lustre.org/images/e/e5/LustreInternals_Architecture.pdf */
1408 const value_string lustre_ldlm_mode_vals[] = {
1409   { LCK_MINMODE, "MINMODE" },
1410   { LCK_EX, "Exclusive" },
1411   { LCK_PW, "Protected Write" },
1412   { LCK_PR, "Protected Read" },
1413   { LCK_CW, "Concurrent Write" },
1414   { LCK_CR, "Concurrent Read" },
1415   { LCK_NL, "Null" },
1416   { LCK_GROUP, "GROUP" },
1417   { 0, NULL }
1418 };
1419
1420 const value_string lustre_ldlm_type_vals[] = {
1421   { LDLM_PLAIN, "LDLM_PLAIN" },
1422   { LDLM_EXTENT,"LDLM_EXTENT" },
1423   { LDLM_FLOCK, "LDLM_FLOCK" },
1424   { LDLM_IBITS, "LDLM_IBITS" },
1425   { 0, NULL }
1426 };
1427
1428
1429 const value_string lustre_llog_cmd_t_vals[] = {
1430   { LLOG_ORIGIN_HANDLE_CREATE, "LLOG_ORIGIN_HANDLE_CREATE" },
1431   { LLOG_ORIGIN_HANDLE_NEXT_BLOCK, "LLOG_ORIGIN_HANDLE_NEXT_BLOCK" },
1432   { LLOG_ORIGIN_HANDLE_READ_HEADER, "LLOG_ORIGIN_HANDLE_READ_HEADER" },
1433   { LLOG_ORIGIN_HANDLE_WRITE_REC, "LLOG_ORIGIN_HANDLE_WRITE_REC" },
1434   { LLOG_ORIGIN_HANDLE_CLOSE, "LLOG_ORIGIN_HANDLE_CLOSE" },
1435   { LLOG_ORIGIN_CONNECT, "LLOG_ORIGIN_CONNECT" },
1436   { LLOG_CATINFO, "LLOG_CATINFO" },
1437   { LLOG_ORIGIN_HANDLE_PREV_BLOCK, "LLOG_ORIGIN_HANDLE_PREV_BLOCK" },
1438   { LLOG_ORIGIN_HANDLE_DESTROY, "LLOG_ORIGIN_HANDLE_DESTROY" },
1439   { 0, NULL }
1440 };
1441
1442 /* from lustre_user.h */
1443 enum hsm_user_action {
1444         HUA_NONE    =  1, /* no action (noop) */
1445         HUA_ARCHIVE = 10, /* copy to hsm */
1446         HUA_RESTORE = 11, /* prestage */
1447         HUA_RELEASE = 12, /* drop ost objects */
1448         HUA_REMOVE  = 13, /* remove from archive */
1449         HUA_CANCEL  = 14  /* cancel a request */
1450 };
1451 const value_string lustre_hsm_user_action_t_vals[] = {
1452   { HUA_NONE,           "NOOP" },
1453   { HUA_ARCHIVE,        "ARCHIVE" },
1454   { HUA_RESTORE,        "RESTORE" },
1455   { HUA_RELEASE,        "RELEASE" },
1456   { HUA_REMOVE,         "REMOVE" },
1457   { HUA_CANCEL,         "CANCEL" },
1458 };
1459
1460 enum hsm_states {
1461         HS_EXISTS       = 0x00000001,
1462         HS_DIRTY        = 0x00000002,
1463         HS_RELEASED     = 0x00000004,
1464         HS_ARCHIVED     = 0x00000008,
1465         HS_NORELEASE    = 0x00000010,
1466         HS_NOARCHIVE    = 0x00000020,
1467         HS_LOST         = 0x00000040,
1468 };
1469 const value_string lustre_hsm_states_t_vals[] = {
1470   { HS_EXISTS,          "EXISTS" },
1471   { HS_DIRTY,           "DIRTY" },
1472   { HS_RELEASED,        "RELEASED" },
1473   { HS_ARCHIVED,        "ARCHIVED" },
1474   { HS_NORELEASE,       "NORELEASED" },
1475   { HS_NOARCHIVE,       "NOARCHIVED" },
1476   { HS_LOST,            "LOST" },
1477 };
1478
1479 enum hsm_progress_states {
1480         HPS_WAITING     = 1,
1481         HPS_RUNNING     = 2,
1482         HPS_DONE        = 3,
1483 };
1484 const value_string lustre_hsm_progress_state_t_vals[] = {
1485   { HPS_WAITING,        "WAITING" },
1486   { HPS_RUNNING,        "RUNNING" },
1487   { HPS_DONE,           "DONE" },
1488 };
1489
1490 #ifndef ENABLE_STATIC
1491 const gchar version[] = VERSION;
1492
1493 /* Start the functions we need for the plugin stuff */
1494
1495 void
1496 plugin_register(void)
1497 {
1498         extern void proto_register_dcerpc_lustre(void);
1499
1500         proto_register_dcerpc_lustre();
1501 }
1502
1503 void
1504 plugin_reg_handoff(void)
1505 {
1506         extern void proto_reg_handoff_lustre(void);
1507
1508         proto_reg_handoff_lustre();
1509 }
1510 #endif
1511
1512
1513 /* ------------------------------------------------------------------- */
1514 /*                display  functions                                   */
1515 /* ------------------------------------------------------------------- */
1516 /* display str in left corner and in COL */
1517 /* @gint col :  the col where we add the information */
1518 static void display_info_str(proto_item *pi, column_info *cinfo, gint col,
1519                              const gchar *str)
1520 {
1521         if (NULL != pi)
1522                 proto_item_append_text(pi, str);
1523
1524         if (NULL != cinfo)
1525                 col_append_str(cinfo, col, str);
1526 }
1527
1528 /*
1529  * Need to be (re)written
1530  */
1531 static void display_info_fstr(proto_item *pi, column_info *cinfo, gint col,
1532                               const char *format, const gchar *str)
1533 {
1534         if (NULL != pi)
1535                 proto_item_append_text(pi, format, str);
1536
1537         if (NULL != cinfo)
1538                 col_append_fstr(cinfo, col, format, str);
1539 }
1540
1541
1542 /* -------------------------- basic dissect functions -------------------     */
1543 static int dissect_uint64(tvbuff_t *tvb, gint offset, packet_info *pinfo _U_,
1544                           proto_tree *tree, int hfindex)
1545 {
1546   proto_tree_add_item(tree, hfindex, tvb, offset, 8, TRUE);
1547   return offset+8;
1548 }
1549
1550 static int
1551 dissect_uint32(tvbuff_t *tvb, gint offset, packet_info *pinfo _U_,
1552                proto_tree *tree, int hfindex)
1553 {
1554   proto_tree_add_item(tree, hfindex, tvb, offset, 4, TRUE);
1555   return offset+4;
1556 }
1557
1558 static int
1559 dissect_uint16
1560 (tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tree, int hfindex)
1561 {
1562   proto_tree_add_item(tree, hfindex, tvb, offset, 2, TRUE);
1563   return offset+2;
1564 }
1565
1566 static int
1567 dissect_uint8
1568 (tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tree, int hfindex)
1569 {
1570   proto_tree_add_item(tree, hfindex, tvb, offset, 1, TRUE);
1571   return offset+1;
1572 }
1573
1574 /* -------------------------------------------------------------------------    */
1575
1576 /* dissect raw data */
1577 static int
1578 lustre_dissect_element_data(tvbuff_t *tvb _U_, int offset _U_,
1579                             packet_info *pinfo _U_, proto_tree *parent_tree _U_,
1580                             int hf_index _U_, guint32 buf_num)
1581 {
1582   proto_item *item = NULL;
1583
1584   guint32 data_len;
1585   int old_offset;
1586
1587   old_offset = offset;
1588
1589   data_len = LUSTRE_BUFFER_LEN(buf_num);
1590   if (data_len == 0)
1591     return offset;
1592
1593   item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, data_len, TRUE);
1594
1595   offset += data_len;
1596   proto_item_set_len(item, offset-old_offset);
1597   offset = add_extra_padding(tvb, offset, pinfo, parent_tree);
1598
1599   return offset;
1600 }
1601
1602 static int
1603 lustre_dissect_struct_element_data(tvbuff_t *tvb _U_, int offset _U_,
1604                                    packet_info *pinfo _U_, proto_tree *parent_tree _U_,
1605                                    int hf_index _U_, guint32 data_len)
1606 {
1607   proto_item *item = NULL;
1608
1609   if (data_len == 0)
1610     return offset;
1611
1612   item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, data_len, TRUE);
1613
1614   offset += data_len;
1615   proto_item_set_len(item, data_len);
1616   offset = add_extra_padding(tvb, offset, pinfo, parent_tree);
1617
1618   return offset;
1619 }
1620
1621 int
1622 lustre_dissect_struct_hmac(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_,
1623                            proto_tree *parent_tree _U_, int hf_index _U_, int max_length)
1624 {
1625   int i;
1626   int val;
1627   proto_item *item = NULL;
1628
1629   item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, 0, TRUE);
1630   for (i=0; i < max_length; ++i) {
1631     val = tvb_get_guint8(tvb, offset+i);
1632     proto_item_append_text(item, (i) ? "%02x" : ": %#02x", val);
1633   }
1634
1635   offset += max_length;
1636   proto_item_set_len(item, max_length);
1637   return offset;
1638 }
1639
1640 /* struct ost_id { */
1641 /*      union { */
1642 /*              struct { */
1643 /*                      __u64   oi_id; */
1644 /*                      __u64   oi_seq; */
1645 /*              } oi; */
1646 /*              struct lu_fid oi_fid; */
1647 /*      }; */
1648 /* }; */
1649 int
1650 lustre_dissect_struct_ostid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_,
1651                             proto_tree *parent_tree _U_, int hf_index _U_)
1652 {
1653   proto_item *item = NULL;
1654   proto_tree *tree = NULL;
1655   int old_offset;
1656
1657   old_offset=offset;
1658
1659   if (parent_tree) {
1660     item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, TRUE);
1661     tree = proto_item_add_subtree(item, ett_lustre_ost_id);
1662   }
1663
1664   offset = dissect_uint64(tvb, offset, pinfo, tree, hf_lustre_ost_id_oi_id);
1665   offset = dissect_uint64(tvb, offset, pinfo, tree, hf_lustre_ost_id_oi_seq);
1666
1667   proto_item_set_len(item, offset-old_offset);
1668
1669   return offset;
1670 }
1671 /* ------------------------------------------------------------------------ */
1672
1673
1674
1675 /* IDL: struct lustre_handle { */
1676 /* IDL:         uint64 cookie; */
1677 /* IDL: } */
1678
1679 static int
1680 lustre_dissect_element_handle_cookie(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
1681 {
1682   offset=dissect_uint64(tvb, offset, pinfo, tree, hf_lustre_lustre_handle_cookie);
1683
1684   return offset;
1685 }
1686
1687 int
1688 lustre_dissect_struct_handle_cookie(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, int hf_index _U_)
1689 {
1690   proto_item *item = NULL;
1691   proto_tree *tree = NULL;
1692   int old_offset;
1693
1694   old_offset=offset;
1695
1696   if (parent_tree) {
1697     item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, TRUE);
1698     tree = proto_item_add_subtree(item, ett_lustre_lustre_handle_cookie);
1699   }
1700
1701   offset=lustre_dissect_element_handle_cookie(tvb, offset, pinfo, tree);
1702
1703
1704   proto_item_set_len(item, offset-old_offset);
1705
1706   return offset;
1707 }
1708
1709 /* IDL: struct obd_connect_data { */
1710 /* IDL:         uint64 ocd_connect_flags; */
1711 /* IDL:         uint32 ocd_version; */
1712 /* IDL:         uint32 ocd_grant; */
1713 /* IDL:         uint32 ocd_index; */
1714 /* IDL:         uint32 ocd_brw_size; */
1715 /* IDL:         uint64 ocd_ibits_known; */
1716 /* IDL:         uint32 ocd_nllu; */
1717 /* IDL:         uint32 ocd_nllg; */
1718 /* IDL:         uint64 ocd_transno; */
1719 /* IDL:         uint32 ocd_group; */
1720 /* IDL:         uint32 ocd_cksum_types; */
1721 /* IDL:         uint64 padding1; */
1722 /* IDL:         uint64 padding2; */
1723 /* IDL: } */
1724
1725 static int
1726 lustre_dissect_element_obd_connect_data_ocd_connect_flags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
1727 {
1728   offset=dissect_uint64(tvb, offset, pinfo, tree, hf_lustre_obd_connect_data_ocd_connect_flags);
1729   return offset;
1730 }
1731
1732 static int
1733 lustre_dissect_element_obd_connect_data_ocd_version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
1734 {
1735         guint32 version;
1736         guint32 major, minor, patch, fix;
1737         proto_item *item;
1738
1739         version = tvb_get_letohl(tvb, offset);
1740         fix = version & 0xff;
1741         version >>= 8;
1742         patch = version & 0xff;
1743         version >>= 8;
1744         minor = version & 0xff;
1745         version >>= 8;
1746         major = version & 0xff;
1747
1748         item = proto_tree_add_item(tree, hf_lustre_obd_connect_data_ocd_version,
1749                                    tvb, offset, 0, TRUE);
1750         proto_item_append_text(item,  ": %d.%d.%d.%d",
1751                                major, minor, patch, fix);
1752         proto_item_set_len(item, 4);
1753
1754         offset += 4;
1755         return offset;
1756 }
1757
1758 static int
1759 lustre_dissect_element_obd_connect_data_ocd_grant(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
1760 {
1761   offset=dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_obd_connect_data_ocd_grant);
1762
1763   return offset;
1764 }
1765
1766 static int
1767 lustre_dissect_element_obd_connect_data_ocd_index(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
1768 {
1769   offset=dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_obd_connect_data_ocd_index);
1770
1771   return offset;
1772 }
1773
1774 static int
1775 lustre_dissect_element_obd_connect_data_ocd_brw_size(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
1776 {
1777   offset=dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_obd_connect_data_ocd_brw_size);
1778
1779   return offset;
1780 }
1781
1782 static int
1783 lustre_dissect_element_obd_connect_data_ocd_ibits_known(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
1784 {
1785   offset=dissect_uint64(tvb, offset, pinfo, tree, hf_lustre_obd_connect_data_ocd_ibits_known);
1786
1787   return offset;
1788 }
1789
1790 static int
1791 lustre_dissect_element_obd_connect_data_ocd_nllu(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
1792 {
1793   offset=dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_obd_connect_data_ocd_nllu);
1794
1795   return offset;
1796 }
1797
1798 static int
1799 lustre_dissect_element_obd_connect_data_ocd_cksum_types(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
1800 {
1801   offset=dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_obd_connect_data_ocd_cksum_types);
1802
1803   return offset;
1804 }
1805
1806 static int
1807 lustre_dissect_struct_obd_connect_data(tvbuff_t *tvb _U_, int offset _U_,
1808                                        packet_info *pinfo _U_,
1809                                        proto_tree *parent_tree _U_,
1810                                        int hf_index _U_, guint32 buf_num)
1811 {
1812         proto_item *item = NULL;
1813         proto_tree *tree = NULL;
1814         int old_offset;
1815         int data_len;
1816
1817         data_len = LUSTRE_BUFFER_LEN(buf_num);
1818         if (data_len == 0)
1819                 return offset;
1820
1821         old_offset = offset;
1822
1823         if (parent_tree) {
1824                 item = proto_tree_add_item(parent_tree, hf_index, tvb,
1825                                            offset, -1, TRUE);
1826                 tree = proto_item_add_subtree(item,
1827                                               ett_lustre_obd_connect_data);
1828         }
1829
1830         /* ocd_connect_flags = get_... */
1831         offset = lustre_dissect_element_obd_connect_data_ocd_connect_flags(tvb,
1832                         offset, pinfo, tree);
1833
1834         offset = lustre_dissect_element_obd_connect_data_ocd_version(tvb,
1835                         offset, pinfo, tree);
1836
1837         offset = lustre_dissect_element_obd_connect_data_ocd_grant(tvb,
1838                         offset, pinfo, tree);
1839
1840         offset = lustre_dissect_element_obd_connect_data_ocd_index(tvb,
1841                         offset, pinfo, tree);
1842
1843         offset = lustre_dissect_element_obd_connect_data_ocd_brw_size(tvb,
1844                         offset, pinfo, tree);
1845
1846         offset = lustre_dissect_element_obd_connect_data_ocd_ibits_known(tvb,
1847                         offset, pinfo, tree);
1848
1849         if (data_len == 72) {
1850                 offset = lustre_dissect_element_obd_connect_data_ocd_nllu(tvb,
1851                                 offset, pinfo, tree);
1852
1853         } else { /* if data_len == 192 */
1854                 /* Actually blocksize, inodespace, grant_extent */
1855                 offset = lustre_dissect_element_obd_connect_data_ocd_nllu(tvb,
1856                                 offset, pinfo, tree);
1857         }
1858
1859         offset = dissect_uint32(tvb, offset, pinfo, tree,
1860                         hf_lustre_obd_connect_data_ocd_nllg);
1861         offset = dissect_uint64(tvb, offset, pinfo, tree,
1862                         hf_lustre_obd_connect_data_ocd_transno);
1863         offset = dissect_uint32(tvb, offset, pinfo, tree,
1864                         hf_lustre_obd_connect_data_ocd_group);
1865         offset = lustre_dissect_element_obd_connect_data_ocd_cksum_types(tvb,
1866                         offset, pinfo, tree);
1867
1868         /* if (ocd_connect_flags & OBD_CONNECT_MAX_EASIZE) */
1869         offset = dissect_uint32(tvb, offset, pinfo, tree,
1870                         hf_lustre_obd_connect_data_ocd_max_easize);
1871
1872         offset = dissect_uint32(tvb, offset, pinfo, tree,
1873                         hf_lustre_obd_connect_data_ocd_instance);
1874         /* if (ocd_connect_flags & OBD_CONNECT_MAXBYTES) */
1875         offset = dissect_uint64(tvb, offset, pinfo, tree,
1876                         hf_lustre_obd_connect_data_ocd_maxbytes);
1877         if (data_len >= 74) /* && (flags & OBD_CONNECT_MULTIMODRPCS) */
1878                 offset = dissect_uint16(tvb, offset, pinfo, tree,
1879                                 hf_lustre_obd_connect_data_ocd_maxmodrpcs);
1880
1881         if (old_offset+data_len > offset) {
1882                 proto_tree_add_item(tree, hf_lustre_extra_padding,
1883                         tvb, offset, (old_offset+data_len)-offset, TRUE);
1884                 offset = old_offset+data_len;
1885         }
1886
1887         proto_item_set_len(item, offset-old_offset);
1888
1889         return offset;
1890 }
1891
1892
1893 /* IDL: struct lov_ost_data_v1 { */
1894 /* IDL:         uint64 l_object_id; */
1895 /* IDL:         uint64 l_object_seq; */
1896 /* IDL:         uint32 l_ost_gen; */
1897 /* IDL:         uint32 l_ost_idx; */
1898 /* IDL: } */
1899
1900 static int
1901 lustre_dissect_element_lov_ost_data_v1_l_object_id(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
1902 {
1903   offset=dissect_uint64(tvb, offset, pinfo, tree, hf_lustre_lov_ost_data_v1_l_object_id);
1904
1905   return offset;
1906 }
1907
1908 static int
1909 lustre_dissect_element_lov_ost_data_v1_l_object_seq(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
1910 {
1911   offset=dissect_uint64(tvb, offset, pinfo, tree, hf_lustre_lov_ost_data_v1_l_object_seq);
1912
1913   return offset;
1914 }
1915
1916 static int
1917 lustre_dissect_element_lov_ost_data_v1_l_ost_gen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
1918 {
1919   offset=dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_lov_ost_data_v1_l_ost_gen);
1920
1921   return offset;
1922 }
1923
1924 static int
1925 lustre_dissect_element_lov_ost_data_v1_l_ost_idx(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
1926 {
1927   offset=dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_lov_ost_data_v1_l_ost_idx);
1928
1929   return offset;
1930 }
1931
1932 int
1933 lustre_dissect_struct_lov_ost_data_v1(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, int hf_index _U_)
1934 {
1935   proto_item *item = NULL;
1936   proto_tree *tree = NULL;
1937   int old_offset;
1938
1939
1940
1941   old_offset=offset;
1942
1943   if (parent_tree) {
1944     item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, TRUE);
1945     tree = proto_item_add_subtree(item, ett_lustre_lov_ost_data_v1);
1946   }
1947
1948   offset=lustre_dissect_element_lov_ost_data_v1_l_object_id(tvb, offset, pinfo, tree);
1949
1950   offset=lustre_dissect_element_lov_ost_data_v1_l_object_seq(tvb, offset, pinfo, tree);
1951
1952   offset=lustre_dissect_element_lov_ost_data_v1_l_ost_gen(tvb, offset, pinfo, tree);
1953
1954   offset=lustre_dissect_element_lov_ost_data_v1_l_ost_idx(tvb, offset, pinfo, tree);
1955
1956
1957   proto_item_set_len(item, offset-old_offset);
1958
1959   return offset;
1960 }
1961
1962 /* IDL: struct lov_mds_md_v1 { */
1963 /* IDL:         uint32 lmm_magic; */
1964 /* IDL:         uint32 lmm_pattern; */
1965 /* IDL:         uint64 lmm_object_id; */
1966 /* IDL:         uint64 lmm_object_seq; */
1967 /* IDL:         uint32 lmm_stripe_size; */
1968 /* IDL:         uint16 lmm_stripe_count; */
1969 /* IDL:         uint16 lmm_layout_gen; */
1970 /* IDL:         struct lov_ost_data_v1 { */
1971 /* IDL: } lmm_objects[0]; <-- en fait on en a lmm_stripe_count */
1972 /* IDL: } */
1973
1974 int
1975 lustre_dissect_struct_lov_mds_md_v1(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, int hf_index _U_)
1976 {
1977         proto_item *item = NULL;
1978         proto_tree *tree = NULL;
1979         int old_offset, i;
1980
1981         guint16 stripe_count;
1982
1983         old_offset=offset;
1984
1985         if (parent_tree) {
1986                 item = proto_tree_add_item(parent_tree, hf_index,
1987                                            tvb, offset, -1, TRUE);
1988                 tree = proto_item_add_subtree(item, ett_lustre_lov_mds_md_v1);
1989         }
1990
1991         offset = dissect_uint32(tvb, offset, pinfo, tree,
1992                                 hf_lustre_lov_mds_md_lmm_magic);
1993         offset = dissect_uint32(tvb, offset, pinfo, tree,
1994                                 hf_lustre_lov_mds_md_lmm_pattern);
1995         offset = dissect_uint64(tvb, offset, pinfo, tree,
1996                                 hf_lustre_lov_mds_md_lmm_object_id);
1997         offset = dissect_uint64(tvb, offset, pinfo, tree,
1998                                 hf_lustre_lov_mds_md_lmm_object_seq);
1999         offset = dissect_uint32(tvb, offset, pinfo, tree,
2000                                 hf_lustre_lov_mds_md_lmm_stripe_size);
2001
2002         stripe_count = tvb_get_letohs(tvb, offset);
2003         offset = dissect_uint16(tvb, offset, pinfo, tree,
2004                                 hf_lustre_lov_mds_md_lmm_stripe_count);
2005         offset = dissect_uint16(tvb, offset, pinfo, tree,
2006                                 hf_lustre_lov_mds_md_lmm_layout_gen);
2007
2008         for (i = 0; i < stripe_count; ++i)
2009                 offset = lustre_dissect_struct_lov_ost_data_v1(tvb, offset,
2010                                 pinfo, tree, hf_lustre_lov_mds_md_lmm_objects);
2011
2012         proto_item_set_len(item, offset-old_offset);
2013
2014         return offset;
2015 }
2016
2017
2018 /* struct lov_mds_md_v3 {            /\* LOV EA mds/wire data (little-endian) *\/ */
2019 /*      __u32 lmm_magic;          /\* magic number = LOV_MAGIC_V3 *\/ */
2020 /*      __u32 lmm_pattern;        /\* LOV_PATTERN_RAID0, LOV_PATTERN_RAID1 *\/ */
2021 /*      struct ost_id   lmm_oi;   /\* LOV object ID *\/ */
2022 /*      __u32 lmm_stripe_size;    /\* size of stripe in bytes *\/ */
2023 /*      /\* lmm_stripe_count used to be __u32 *\/ */
2024 /*      __u16 lmm_stripe_count;   /\* num stripes in use for this object *\/ */
2025 /*      __u16 lmm_layout_gen;     /\* layout generation number *\/ */
2026 /*      char  lmm_pool_name[LOV_MAXPOOLNAME + 1]; /\* must be 32bit aligned *\/ */
2027 /*      struct lov_ost_data_v1 lmm_objects[0]; /\* per-stripe data *\/ */
2028 /* }; */
2029
2030 int
2031 lustre_dissect_struct_lov_mds_md_v3(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, int hf_index _U_)
2032 {
2033         proto_item *item = NULL;
2034         proto_tree *tree = NULL;
2035         int old_offset, i;
2036
2037         guint16 stripe_count;
2038
2039         old_offset=offset;
2040
2041         if (parent_tree) {
2042                 item = proto_tree_add_item(parent_tree, hf_index,
2043                                            tvb, offset, -1, TRUE);
2044                 tree = proto_item_add_subtree(item, ett_lustre_lov_mds_md_v3);
2045         }
2046
2047         offset = dissect_uint32(tvb, offset, pinfo, tree,
2048                                 hf_lustre_lov_mds_md_lmm_magic);
2049         offset = dissect_uint32(tvb, offset, pinfo, tree,
2050                                 hf_lustre_lov_mds_md_lmm_pattern);
2051         offset = lustre_dissect_struct_ostid(tvb, offset, pinfo, tree,
2052                                 hf_lustre_lov_mds_md_lmm_oi);
2053         offset = dissect_uint32(tvb, offset, pinfo, tree,
2054                                 hf_lustre_lov_mds_md_lmm_stripe_size);
2055
2056         stripe_count = tvb_get_letohs(tvb, offset);
2057         offset = dissect_uint16(tvb, offset, pinfo, tree,
2058                                 hf_lustre_lov_mds_md_lmm_stripe_count);
2059         offset = dissect_uint16(tvb, offset, pinfo, tree,
2060                                 hf_lustre_lov_mds_md_lmm_layout_gen);
2061         offset = lustre_dissect_struct_element_data(tvb, offset, pinfo, tree,
2062                                 hf_lustre_lov_mds_md_lmm_pool_name,
2063                                 LOV_MAXPOOLNAME+1);
2064
2065         for (i = 0; i < stripe_count; ++i)
2066                 offset = lustre_dissect_struct_lov_ost_data_v1(tvb, offset,
2067                                 pinfo, tree, hf_lustre_lov_mds_md_lmm_objects);
2068
2069         proto_item_set_len(item, offset-old_offset);
2070
2071         return offset;
2072 }
2073
2074 int
2075 lustre_dissect_struct_lov_mds_md(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_,
2076                                  proto_tree *parent_tree _U_,
2077                                  int hf_index _U_, int buff_num _U_)
2078 {
2079   int magic;
2080
2081   if(LUSTRE_BUFFER_LEN(buff_num) == 0)
2082     return offset;
2083
2084   magic=tvb_get_letohl(tvb, offset); /* TODO : replace this with a macro */
2085   switch(magic) {
2086   case LOV_MAGIC_V1:
2087     offset=lustre_dissect_struct_lov_mds_md_v1(tvb,offset,pinfo,parent_tree,
2088                                                hf_index);
2089     break;
2090   case LOV_MAGIC_V3:
2091     offset=lustre_dissect_struct_lov_mds_md_v3(tvb,offset,pinfo,parent_tree,
2092                                                hf_index);
2093     break;
2094   default:
2095     offset=lustre_dissect_element_data(tvb, offset, pinfo, parent_tree,
2096                                        hf_lustre_generic_data, buff_num);
2097     break;
2098   };
2099
2100   return offset;
2101 }
2102
2103
2104
2105 /* IDL: struct obd_statfs { */
2106 /* IDL:         uint64 os_type; */
2107 /* IDL:         uint64 os_blocks; */
2108 /* IDL:         uint64 os_bfree; */
2109 /* IDL:         uint64 os_bavail; */
2110 /* IDL:         uint64 os_files; */
2111 /* IDL:         uint64 os_ffree; */
2112 /* IDL:         uint8 os_fsid[40]; */
2113 /* IDL:         uint32 os_bsize; */
2114 /* IDL:         uint32 os_namelen; */
2115 /* IDL:         uint64 os_maxbytes; */
2116 /* IDL:         uint32 os_state; */
2117 /* IDL:         uint32 os_spare1; */
2118 /* IDL:         uint32 os_spare2; */
2119 /* IDL:         uint32 os_spare3; */
2120 /* IDL:         uint32 os_spare4; */
2121 /* IDL:         uint32 os_spare5; */
2122 /* IDL:         uint32 os_spare6; */
2123 /* IDL:         uint32 os_spare7; */
2124 /* IDL:         uint32 os_spare8; */
2125 /* IDL:         uint32 os_spare9; */
2126 /* IDL: } */
2127
2128 static int
2129 lustre_dissect_element_obd_statfs_os_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2130 {
2131   offset=dissect_uint64(tvb, offset, pinfo, tree, hf_lustre_obd_statfs_os_type);
2132
2133   return offset;
2134 }
2135
2136 static int
2137 lustre_dissect_element_obd_statfs_os_blocks(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2138 {
2139   offset=dissect_uint64(tvb, offset, pinfo, tree, hf_lustre_obd_statfs_os_blocks);
2140
2141   return offset;
2142 }
2143
2144 static int
2145 lustre_dissect_element_obd_statfs_os_bfree(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2146 {
2147   offset=dissect_uint64(tvb, offset, pinfo, tree, hf_lustre_obd_statfs_os_bfree);
2148
2149   return offset;
2150 }
2151
2152 static int
2153 lustre_dissect_element_obd_statfs_os_bavail(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2154 {
2155   offset=dissect_uint64(tvb, offset, pinfo, tree, hf_lustre_obd_statfs_os_bavail);
2156
2157   return offset;
2158 }
2159
2160 static int
2161 lustre_dissect_element_obd_statfs_os_files(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2162 {
2163   offset=dissect_uint64(tvb, offset, pinfo, tree, hf_lustre_obd_statfs_os_files);
2164
2165   return offset;
2166 }
2167
2168 static int
2169 lustre_dissect_element_obd_statfs_os_ffree(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2170 {
2171   offset=dissect_uint64(tvb, offset, pinfo, tree, hf_lustre_obd_statfs_os_ffree);
2172
2173   return offset;
2174 }
2175
2176 static int
2177 lustre_dissect_element_obd_statfs_os_fsid_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2178 {
2179   offset=dissect_uint8(tvb, offset, pinfo, tree, hf_lustre_obd_statfs_os_fsid);
2180
2181   return offset;
2182 }
2183
2184 static int
2185 lustre_dissect_element_obd_statfs_os_fsid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2186 {
2187   int i;
2188   for (i = 0; i < 40; i++)
2189     offset=lustre_dissect_element_obd_statfs_os_fsid_(tvb, offset, pinfo, tree);
2190
2191   return offset;
2192 }
2193
2194
2195
2196 static int
2197 lustre_dissect_element_obd_statfs_os_bsize(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2198 {
2199   offset=dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_obd_statfs_os_bsize);
2200
2201   return offset;
2202 }
2203
2204 static int
2205 lustre_dissect_element_obd_statfs_os_namelen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2206 {
2207   offset=dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_obd_statfs_os_namelen);
2208
2209   return offset;
2210 }
2211
2212 static int
2213 lustre_dissect_element_obd_statfs_os_maxbytes(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2214 {
2215   offset=dissect_uint64(tvb, offset, pinfo, tree, hf_lustre_obd_statfs_os_maxbytes);
2216
2217   return offset;
2218 }
2219
2220 static int
2221 lustre_dissect_element_obd_statfs_os_state(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2222 {
2223   offset=dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_obd_statfs_os_state);
2224
2225   return offset;
2226 }
2227
2228 static int
2229 lustre_dissect_element_obd_statfs_os_spare1(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2230 {
2231   offset=dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_obd_statfs_os_spare1);
2232
2233   return offset;
2234 }
2235
2236 static int
2237 lustre_dissect_element_obd_statfs_os_spare2(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2238 {
2239   offset=dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_obd_statfs_os_spare2);
2240
2241   return offset;
2242 }
2243
2244 static int
2245 lustre_dissect_element_obd_statfs_os_spare3(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2246 {
2247   offset=dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_obd_statfs_os_spare3);
2248
2249   return offset;
2250 }
2251
2252 static int
2253 lustre_dissect_element_obd_statfs_os_spare4(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2254 {
2255   offset=dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_obd_statfs_os_spare4);
2256
2257   return offset;
2258 }
2259
2260 static int
2261 lustre_dissect_element_obd_statfs_os_spare5(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2262 {
2263   offset=dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_obd_statfs_os_spare5);
2264
2265   return offset;
2266 }
2267
2268 static int
2269 lustre_dissect_element_obd_statfs_os_spare6(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2270 {
2271   offset=dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_obd_statfs_os_spare6);
2272
2273   return offset;
2274 }
2275
2276 static int
2277 lustre_dissect_element_obd_statfs_os_spare7(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2278 {
2279   offset=dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_obd_statfs_os_spare7);
2280
2281   return offset;
2282 }
2283
2284 static int
2285 lustre_dissect_element_obd_statfs_os_spare8(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2286 {
2287   offset=dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_obd_statfs_os_spare8);
2288
2289   return offset;
2290 }
2291
2292 static int
2293 lustre_dissect_element_obd_statfs_os_spare9(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2294 {
2295   offset=dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_obd_statfs_os_spare9);
2296
2297   return offset;
2298 }
2299
2300 int
2301 lustre_dissect_struct_obd_statfs(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, int hf_index _U_)
2302 {
2303   proto_item *item = NULL;
2304   proto_tree *tree = NULL;
2305   int old_offset;
2306
2307
2308
2309   old_offset=offset;
2310
2311   if (parent_tree) {
2312     item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, TRUE);
2313     tree = proto_item_add_subtree(item, ett_lustre_obd_statfs);
2314   }
2315
2316   offset=lustre_dissect_element_obd_statfs_os_type(tvb, offset, pinfo, tree);
2317
2318   offset=lustre_dissect_element_obd_statfs_os_blocks(tvb, offset, pinfo, tree);
2319
2320   offset=lustre_dissect_element_obd_statfs_os_bfree(tvb, offset, pinfo, tree);
2321
2322   offset=lustre_dissect_element_obd_statfs_os_bavail(tvb, offset, pinfo, tree);
2323
2324   offset=lustre_dissect_element_obd_statfs_os_files(tvb, offset, pinfo, tree);
2325
2326   offset=lustre_dissect_element_obd_statfs_os_ffree(tvb, offset, pinfo, tree);
2327
2328   offset=lustre_dissect_element_obd_statfs_os_fsid(tvb, offset, pinfo, tree);
2329
2330   offset=lustre_dissect_element_obd_statfs_os_bsize(tvb, offset, pinfo, tree);
2331
2332   offset=lustre_dissect_element_obd_statfs_os_namelen(tvb, offset, pinfo, tree);
2333
2334   offset=lustre_dissect_element_obd_statfs_os_maxbytes(tvb, offset, pinfo, tree);
2335
2336   offset=lustre_dissect_element_obd_statfs_os_state(tvb, offset, pinfo, tree);
2337
2338   offset=lustre_dissect_element_obd_statfs_os_spare1(tvb, offset, pinfo, tree);
2339
2340   offset=lustre_dissect_element_obd_statfs_os_spare2(tvb, offset, pinfo, tree);
2341
2342   offset=lustre_dissect_element_obd_statfs_os_spare3(tvb, offset, pinfo, tree);
2343
2344   offset=lustre_dissect_element_obd_statfs_os_spare4(tvb, offset, pinfo, tree);
2345
2346   offset=lustre_dissect_element_obd_statfs_os_spare5(tvb, offset, pinfo, tree);
2347
2348   offset=lustre_dissect_element_obd_statfs_os_spare6(tvb, offset, pinfo, tree);
2349
2350   offset=lustre_dissect_element_obd_statfs_os_spare7(tvb, offset, pinfo, tree);
2351
2352   offset=lustre_dissect_element_obd_statfs_os_spare8(tvb, offset, pinfo, tree);
2353
2354   offset=lustre_dissect_element_obd_statfs_os_spare9(tvb, offset, pinfo, tree);
2355
2356
2357   proto_item_set_len(item, offset-old_offset);
2358
2359   return offset;
2360 }
2361
2362 /* IDL: struct obd_ioobj { */
2363 /* IDL:         uint64 ioo_id; */
2364 /* IDL:         uint64 ioo_seq; */
2365 /* IDL:         uint32 ioo_max_brw; */
2366 /* IDL:         uint32 ioo_bufcnt; */
2367 /* IDL: } */
2368
2369 static int
2370 lustre_dissect_element_obd_ioobj_ioo_id(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2371 {
2372   offset=dissect_uint64(tvb, offset, pinfo, tree, hf_lustre_obd_ioobj_ioo_id);
2373
2374   return offset;
2375 }
2376
2377 static int
2378 lustre_dissect_element_obd_ioobj_ioo_seq(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2379 {
2380   offset=dissect_uint64(tvb, offset, pinfo, tree, hf_lustre_obd_ioobj_ioo_seq);
2381
2382   return offset;
2383 }
2384
2385 static int
2386 lustre_dissect_element_obd_ioobj_ioo_max_brw(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2387 {
2388   offset=dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_obd_ioobj_ioo_max_brw);
2389
2390   return offset;
2391 }
2392
2393 static int
2394 lustre_dissect_element_obd_ioobj_ioo_bufcnt(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2395 {
2396   offset=dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_obd_ioobj_ioo_bufcnt);
2397
2398   return offset;
2399 }
2400
2401 int
2402 lustre_dissect_struct_obd_ioobj(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, int hf_index _U_)
2403 {
2404   proto_item *item = NULL;
2405   proto_tree *tree = NULL;
2406   int old_offset;
2407
2408
2409
2410   old_offset=offset;
2411
2412   if (parent_tree) {
2413     item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, TRUE);
2414     tree = proto_item_add_subtree(item, ett_lustre_obd_ioobj);
2415   }
2416
2417   offset=lustre_dissect_element_obd_ioobj_ioo_id(tvb, offset, pinfo, tree);
2418
2419   offset=lustre_dissect_element_obd_ioobj_ioo_seq(tvb, offset, pinfo, tree);
2420
2421   offset=lustre_dissect_element_obd_ioobj_ioo_max_brw(tvb, offset, pinfo, tree);
2422
2423   offset=lustre_dissect_element_obd_ioobj_ioo_bufcnt(tvb, offset, pinfo, tree);
2424
2425
2426   proto_item_set_len(item, offset-old_offset);
2427
2428   return offset;
2429 }
2430
2431 /* IDL: struct niobuf_remote { */
2432 /* IDL:         uint64 offset; */
2433 /* IDL:         uint32 len; */
2434 /* IDL:         uint32 flags; */
2435 /* IDL: } */
2436
2437 static int
2438 lustre_dissect_element_niobuf_remote_offset(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2439 {
2440   offset=dissect_uint64(tvb, offset, pinfo, tree, hf_lustre_niobuf_remote_offset);
2441
2442   return offset;
2443 }
2444
2445 static int
2446 lustre_dissect_element_niobuf_remote_len(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2447 {
2448   offset=dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_niobuf_remote_len);
2449
2450   return offset;
2451 }
2452
2453 static int
2454 lustre_dissect_element_niobuf_remote_flags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2455 {
2456   offset=dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_niobuf_remote_flags);
2457
2458   return offset;
2459 }
2460
2461 int
2462 lustre_dissect_struct_niobuf_remote(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, int hf_index _U_)
2463 {
2464   proto_item *item = NULL;
2465   proto_tree *tree = NULL;
2466   int old_offset;
2467
2468
2469
2470   old_offset=offset;
2471
2472   if (parent_tree) {
2473     item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, TRUE);
2474     tree = proto_item_add_subtree(item, ett_lustre_niobuf_remote);
2475   }
2476
2477   offset=lustre_dissect_element_niobuf_remote_offset(tvb, offset, pinfo, tree);
2478
2479   offset=lustre_dissect_element_niobuf_remote_len(tvb, offset, pinfo, tree);
2480
2481   offset=lustre_dissect_element_niobuf_remote_flags(tvb, offset, pinfo, tree);
2482
2483
2484   proto_item_set_len(item, offset-old_offset);
2485
2486   return offset;
2487 }
2488
2489 /* IDL: struct ost_lvb { */
2490 /* IDL:         uint64 lvb_size; */
2491 /* IDL:         uint64 lvb_mtime; */
2492 /* IDL:         uint64 lvb_atime; */
2493 /* IDL:         uint64 lvb_ctime; */
2494 /* IDL:         uint64 lvb_blocks; */
2495 /* v1 of this type ends here */
2496 /*              uint32 lvb_mtime_ns; */
2497 /*              uint32 lvb_atime_ns; */
2498 /*              uint32 lvb_ctime_ns; */
2499 /*              uint32 lvb_padding; */
2500 /* IDL: } */
2501
2502 static int
2503 lustre_dissect_element_ost_lvb_lvb_time(tvbuff_t *tvb _U_, int offset _U_,
2504                                         packet_info *pinfo _U_,
2505                                         proto_tree *tree _U_,
2506                                         int hf_index _U_, int ns_offset _U_)
2507 {
2508         nstime_t ns;
2509         /* timestamp */
2510         ns.secs = tvb_get_letoh64(tvb, offset);
2511         if (ns_offset != 0)
2512                 ns.nsecs = tvb_get_letohl(tvb, offset+ns_offset);
2513         proto_tree_add_time(tree, hf_index, tvb, offset, 8, &ns);
2514         offset += 8;
2515         return offset;
2516 }
2517
2518 int
2519 lustre_dissect_struct_ost_lvb(tvbuff_t *tvb _U_, int offset _U_,
2520                               packet_info *pinfo _U_,
2521                               proto_tree *parent_tree _U_,
2522                               int hf_index _U_, int buff_num _U_)
2523 {
2524         proto_item *item = NULL;
2525         proto_tree *tree = NULL;
2526         int old_offset;
2527         int buff_len;
2528
2529         buff_len = LUSTRE_BUFFER_LEN(buff_num);
2530
2531         if (buff_len == 0)
2532                 return offset;
2533
2534         old_offset=offset;
2535
2536         if (parent_tree) {
2537                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, TRUE);
2538                 tree = proto_item_add_subtree(item, ett_lustre_ost_lvb);
2539         }
2540
2541         /* v1 format size is 40
2542          * v2 format size is 56 w/ ns for times
2543          */
2544
2545         offset = dissect_uint64(tvb, offset, pinfo, tree,
2546                                 hf_lustre_ost_lvb_lvb_size);
2547
2548         offset = lustre_dissect_element_ost_lvb_lvb_time(tvb, offset,
2549                         pinfo, tree, hf_lustre_ost_lvb_lvb_mtime,
2550                         (buff_len >= 56) ?32 :0);
2551
2552         offset = lustre_dissect_element_ost_lvb_lvb_time(tvb, offset,
2553                         pinfo, tree, hf_lustre_ost_lvb_lvb_atime,
2554                         (buff_len >= 56) ?28 :0);
2555
2556         offset = lustre_dissect_element_ost_lvb_lvb_time(tvb, offset,
2557                         pinfo, tree, hf_lustre_ost_lvb_lvb_ctime,
2558                         (buff_len >= 56) ?24 :0);
2559
2560         offset = dissect_uint64(tvb, offset, pinfo, tree,
2561                                 hf_lustre_ost_lvb_lvb_blocks);
2562
2563         /* post-v1 format */
2564         if (buff_len >= 56) {
2565                 offset = dissect_uint32(tvb, offset, pinfo, tree,
2566                                         hf_lustre_ost_lvb_lvb_mtime_ns);
2567                 offset = dissect_uint32(tvb, offset, pinfo, tree,
2568                                         hf_lustre_ost_lvb_lvb_atime_ns);
2569                 offset = dissect_uint32(tvb, offset, pinfo, tree,
2570                                         hf_lustre_ost_lvb_lvb_ctime_ns);
2571                 offset = dissect_uint32(tvb, offset, pinfo, tree,
2572                                         hf_lustre_ost_lvb_lvb_padding);
2573         }
2574         proto_item_set_len(item, offset-old_offset);
2575
2576         return offset;
2577 }
2578
2579
2580 /* IDL: struct ll_fid { */
2581 /* IDL:         uint64 id; */
2582 /* IDL:         uint32 generation; */
2583 /* IDL:         uint32 f_type; */
2584 /* IDL: } */
2585
2586 static int
2587 lustre_dissect_element_ll_fid_id(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2588 {
2589   offset=dissect_uint64(tvb, offset, pinfo, tree, hf_lustre_ll_fid_id);
2590
2591   return offset;
2592 }
2593
2594 static int
2595 lustre_dissect_element_ll_fid_generation(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2596 {
2597   offset=dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_ll_fid_generation);
2598
2599   return offset;
2600 }
2601
2602 static int
2603 lustre_dissect_element_ll_fid_f_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2604 {
2605   offset=dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_ll_fid_f_type);
2606
2607   return offset;
2608 }
2609
2610 int
2611 lustre_dissect_struct_lu_fid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, int hf_index _U_)
2612 {
2613   proto_item *item = NULL;
2614   proto_tree *tree = NULL;
2615   int old_offset;
2616
2617   old_offset=offset;
2618
2619   if (parent_tree) {
2620     item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, TRUE);
2621     tree = proto_item_add_subtree(item, ett_lustre_ll_fid);
2622   }
2623
2624   offset=lustre_dissect_element_ll_fid_id(tvb, offset, pinfo, tree);
2625
2626   offset=lustre_dissect_element_ll_fid_generation(tvb, offset, pinfo, tree);
2627
2628   offset=lustre_dissect_element_ll_fid_f_type(tvb, offset, pinfo, tree);
2629
2630
2631   proto_item_set_len(item, offset-old_offset);
2632
2633   return offset;
2634 }
2635
2636 /* IDL: struct obd_dqinfo { */
2637 /* IDL:   uint64 dqi_bgrace; */
2638 /* IDL:   uint64 dqi_igrace; */
2639 /* IDL:   uint32 dqi_flags; */
2640 /* IDL:   uint32 dqi_valid; */
2641 /* IDL: } */
2642
2643 static int
2644 lustre_dissect_element_obd_dqinfo_dqi_bgrace(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2645 {
2646   offset = dissect_uint64(tvb, offset, pinfo, tree, hf_lustre_obd_dqinfo_dqi_bgrace);
2647
2648   return offset;
2649 }
2650
2651 static int
2652 lustre_dissect_element_obd_dqinfo_dqi_igrace(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2653 {
2654   offset = dissect_uint64(tvb, offset, pinfo, tree, hf_lustre_obd_dqinfo_dqi_igrace);
2655
2656   return offset;
2657 }
2658
2659 static int
2660 lustre_dissect_element_obd_dqinfo_dqi_flags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2661 {
2662   offset = dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_obd_dqinfo_dqi_flags);
2663
2664   return offset;
2665 }
2666
2667 static int
2668 lustre_dissect_element_obd_dqinfo_dqi_valid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2669 {
2670   offset = dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_obd_dqinfo_dqi_valid);
2671
2672   return offset;
2673 }
2674
2675 int
2676 lustre_dissect_struct_obd_dqinfo(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, int hf_index _U_)
2677 {
2678   proto_item *item = NULL;
2679   proto_tree *tree = NULL;
2680   int old_offset;
2681
2682
2683
2684   old_offset = offset;
2685
2686   if (parent_tree) {
2687     item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, TRUE);
2688     tree = proto_item_add_subtree(item, ett_lustre_obd_dqinfo);
2689   }
2690
2691   offset = lustre_dissect_element_obd_dqinfo_dqi_bgrace(tvb, offset, pinfo, tree);
2692
2693   offset = lustre_dissect_element_obd_dqinfo_dqi_igrace(tvb, offset, pinfo, tree);
2694
2695   offset = lustre_dissect_element_obd_dqinfo_dqi_flags(tvb, offset, pinfo, tree);
2696
2697   offset = lustre_dissect_element_obd_dqinfo_dqi_valid(tvb, offset, pinfo, tree);
2698
2699
2700   proto_item_set_len(item, offset-old_offset);
2701
2702   return offset;
2703 }
2704
2705 /* IDL: struct obd_dqblk { */
2706 /* IDL:         uint64 dqb_bhardlimit; */
2707 /* IDL:         uint64 dqb_bsoftlimit; */
2708 /* IDL:         uint64 dqb_curspace; */
2709 /* IDL:         uint64 dqb_ihardlimit; */
2710 /* IDL:         uint64 dqb_isoftlimit; */
2711 /* IDL:         uint64 dqb_curinodes; */
2712 /* IDL:         uint64 dqb_btime; */
2713 /* IDL:         uint64 dqb_itime; */
2714 /* IDL:         uint32 dqb_valid; */
2715 /* IDL:         uint32 padding; */
2716 /* IDL: } */
2717
2718 static int
2719 lustre_dissect_element_obd_dqblk_dqb_bhardlimit(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2720 {
2721   offset = dissect_uint64(tvb, offset, pinfo, tree, hf_lustre_obd_dqblk_dqb_bhardlimit);
2722
2723   return offset;
2724 }
2725
2726 static int
2727 lustre_dissect_element_obd_dqblk_dqb_bsoftlimit(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2728 {
2729   offset = dissect_uint64(tvb, offset, pinfo, tree, hf_lustre_obd_dqblk_dqb_bsoftlimit);
2730
2731   return offset;
2732 }
2733
2734 static int
2735 lustre_dissect_element_obd_dqblk_dqb_curspace(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2736 {
2737   offset = dissect_uint64(tvb, offset, pinfo, tree, hf_lustre_obd_dqblk_dqb_curspace);
2738
2739   return offset;
2740 }
2741
2742 static int
2743 lustre_dissect_element_obd_dqblk_dqb_ihardlimit(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2744 {
2745   offset = dissect_uint64(tvb, offset, pinfo, tree, hf_lustre_obd_dqblk_dqb_ihardlimit);
2746
2747   return offset;
2748 }
2749
2750 static int
2751 lustre_dissect_element_obd_dqblk_dqb_isoftlimit(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2752 {
2753   offset = dissect_uint64(tvb, offset, pinfo, tree, hf_lustre_obd_dqblk_dqb_isoftlimit);
2754
2755   return offset;
2756 }
2757
2758 static int
2759 lustre_dissect_element_obd_dqblk_dqb_curinodes(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2760 {
2761   offset = dissect_uint64(tvb, offset, pinfo, tree, hf_lustre_obd_dqblk_dqb_curinodes);
2762
2763   return offset;
2764 }
2765
2766 static int
2767 lustre_dissect_element_obd_dqblk_dqb_btime(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2768 {
2769
2770   nstime_t ns;
2771   /* timestamp */
2772   ns.secs = tvb_get_letohl(tvb,offset);
2773   ns.nsecs=0;
2774   proto_tree_add_time(tree, hf_lustre_obd_dqblk_dqb_btime, tvb, offset, 8, &ns );
2775   offset+=8;
2776   return offset;
2777 }
2778
2779 static int
2780 lustre_dissect_element_obd_dqblk_dqb_itime(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2781 {
2782   nstime_t ns;
2783   /* timestamp */
2784   ns.secs = tvb_get_letohl(tvb,offset);
2785   ns.nsecs=0;
2786   proto_tree_add_time(tree, hf_lustre_obd_dqblk_dqb_itime, tvb, offset, 8, &ns );
2787   offset+=8;
2788
2789   return offset;
2790 }
2791
2792 static int
2793 lustre_dissect_element_obd_dqblk_dqb_valid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2794 {
2795   offset = dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_obd_dqblk_dqb_valid);
2796
2797   return offset;
2798 }
2799
2800 static int
2801 lustre_dissect_element_obd_dqblk_padding(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2802 {
2803   offset = dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_obd_dqblk_padding);
2804
2805   return offset;
2806 }
2807
2808 int
2809 lustre_dissect_struct_obd_dqblk(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, int hf_index _U_)
2810 {
2811   proto_item *item = NULL;
2812   proto_tree *tree = NULL;
2813   int old_offset;
2814
2815
2816
2817   old_offset = offset;
2818
2819   if (parent_tree) {
2820     item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, TRUE);
2821     tree = proto_item_add_subtree(item, ett_lustre_obd_dqblk);
2822   }
2823
2824   offset = lustre_dissect_element_obd_dqblk_dqb_bhardlimit(tvb, offset, pinfo, tree);
2825
2826   offset = lustre_dissect_element_obd_dqblk_dqb_bsoftlimit(tvb, offset, pinfo, tree);
2827
2828   offset = lustre_dissect_element_obd_dqblk_dqb_curspace(tvb, offset, pinfo, tree);
2829
2830   offset = lustre_dissect_element_obd_dqblk_dqb_ihardlimit(tvb, offset, pinfo, tree);
2831
2832   offset = lustre_dissect_element_obd_dqblk_dqb_isoftlimit(tvb, offset, pinfo, tree);
2833
2834   offset = lustre_dissect_element_obd_dqblk_dqb_curinodes(tvb, offset, pinfo, tree);
2835
2836   offset = lustre_dissect_element_obd_dqblk_dqb_btime(tvb, offset, pinfo, tree);
2837
2838   offset = lustre_dissect_element_obd_dqblk_dqb_itime(tvb, offset, pinfo, tree);
2839
2840   offset = lustre_dissect_element_obd_dqblk_dqb_valid(tvb, offset, pinfo, tree);
2841
2842   offset = lustre_dissect_element_obd_dqblk_padding(tvb, offset, pinfo, tree);
2843
2844
2845   proto_item_set_len(item, offset-old_offset);
2846
2847   return offset;
2848 }
2849
2850
2851 /* IDL: struct obd_quotactl { */
2852 /* IDL:         uint32 qc_cmd; */
2853 /* IDL:         uint32 qc_type; */
2854 /* IDL:         uint32 qc_id; */
2855 /* IDL:         uint32 qc_stat; */
2856 /* IDL:         struct obd_dqinfo { */
2857 /* IDL: } qc_dqinfo; */
2858 /* IDL:         struct obd_dqblk { */
2859 /* IDL: } qc_dqblk; */
2860 /* IDL: } */
2861
2862 static int
2863 lustre_dissect_element_obd_quotactl_qc_cmd(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2864 {
2865   offset=dissect_uint32(tvb, offset, pinfo, tree,  hf_lustre_obd_quotactl_qc_cmd);
2866
2867   return offset;
2868 }
2869
2870 static int
2871 lustre_dissect_element_obd_quotactl_qc_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2872 {
2873   offset=dissect_uint32(tvb, offset, pinfo, tree,  hf_lustre_obd_quotactl_qc_type);
2874
2875   return offset;
2876 }
2877
2878 static int
2879 lustre_dissect_element_obd_quotactl_qc_id(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2880 {
2881   offset=dissect_uint32(tvb, offset, pinfo, tree,  hf_lustre_obd_quotactl_qc_id);
2882
2883   return offset;
2884 }
2885
2886 static int
2887 lustre_dissect_element_obd_quotactl_qc_stat(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2888 {
2889   offset=dissect_uint32(tvb, offset, pinfo, tree,  hf_lustre_obd_quotactl_qc_stat);
2890
2891   return offset;
2892 }
2893
2894
2895
2896 static int
2897 lustre_dissect_element_obd_quotactl_qc_dqblk(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2898 {
2899   offset=lustre_dissect_struct_obd_dqblk(tvb,offset,pinfo,tree,hf_lustre_obd_quotactl_qc_dqblk);
2900   return offset;
2901 }
2902
2903 static int
2904 lustre_dissect_element_obd_quotactl_qc_dqinfo(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2905 {
2906   offset=lustre_dissect_struct_obd_dqinfo(tvb,offset,pinfo,tree,hf_lustre_obd_quotactl_qc_dqinfo);
2907   return offset;
2908 }
2909
2910 int
2911 lustre_dissect_struct_obd_quotactl(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, int hf_index _U_)
2912 {
2913   proto_item *item = NULL;
2914   proto_tree *tree = NULL;
2915   int old_offset;
2916
2917   old_offset=offset;
2918
2919   if (parent_tree) {
2920     item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, TRUE);
2921     tree = proto_item_add_subtree(item, ett_lustre_obd_quotactl);
2922   }
2923
2924   offset=lustre_dissect_element_obd_quotactl_qc_cmd(tvb, offset, pinfo, tree);
2925
2926   offset=lustre_dissect_element_obd_quotactl_qc_type(tvb, offset, pinfo, tree);
2927
2928   offset=lustre_dissect_element_obd_quotactl_qc_id(tvb, offset, pinfo, tree);
2929
2930   offset=lustre_dissect_element_obd_quotactl_qc_stat(tvb, offset, pinfo, tree);
2931
2932   offset=lustre_dissect_element_obd_quotactl_qc_dqinfo(tvb, offset, pinfo, tree);
2933
2934   offset=lustre_dissect_element_obd_quotactl_qc_dqblk(tvb, offset, pinfo, tree);
2935
2936
2937   proto_item_set_len(item, offset-old_offset);
2938
2939   return offset;
2940 }
2941
2942
2943 /* IDL: struct quota_adjust_qunit { */
2944 /* IDL:         uint32 qaq_flags; */
2945 /* IDL:         uint32 qaq_id; */
2946 /* IDL:         uint64 qaq_bunit_sz; */
2947 /* IDL:         uint64 qaq_iunit_sz; */
2948 /* IDL:         uint64 padding1; */
2949 /* IDL: } */
2950
2951 static int
2952 lustre_dissect_element_quota_adjust_qunit_qaq_flags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2953 {
2954   offset=dissect_uint32(tvb, offset, pinfo, tree,  hf_lustre_quota_adjust_qunit_qaq_flags);
2955
2956   return offset;
2957 }
2958
2959 static int
2960 lustre_dissect_element_quota_adjust_qunit_qaq_id(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2961 {
2962   offset=dissect_uint32(tvb, offset, pinfo, tree,  hf_lustre_quota_adjust_qunit_qaq_id);
2963
2964   return offset;
2965 }
2966
2967 static int
2968 lustre_dissect_element_quota_adjust_qunit_qaq_bunit_sz(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2969 {
2970   offset=dissect_uint64(tvb, offset, pinfo, tree,  hf_lustre_quota_adjust_qunit_qaq_bunit_sz);
2971
2972   return offset;
2973 }
2974
2975 static int
2976 lustre_dissect_element_quota_adjust_qunit_qaq_iunit_sz(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2977 {
2978   offset=dissect_uint64(tvb, offset, pinfo, tree,  hf_lustre_quota_adjust_qunit_qaq_iunit_sz);
2979
2980   return offset;
2981 }
2982
2983 static int
2984 lustre_dissect_element_quota_adjust_qunit_padding1(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
2985 {
2986   offset=dissect_uint64(tvb, offset, pinfo, tree,  hf_lustre_quota_adjust_qunit_padding1);
2987
2988   return offset;
2989 }
2990
2991 int
2992 lustre_dissect_struct_quota_adjust_qunit(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, int hf_index _U_)
2993 {
2994   proto_item *item = NULL;
2995   proto_tree *tree = NULL;
2996   int old_offset;
2997
2998
2999
3000   old_offset=offset;
3001
3002   if (parent_tree) {
3003     item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, TRUE);
3004     tree = proto_item_add_subtree(item, ett_lustre_quota_adjust_qunit);
3005   }
3006
3007   offset=lustre_dissect_element_quota_adjust_qunit_qaq_flags(tvb, offset, pinfo, tree);
3008
3009   offset=lustre_dissect_element_quota_adjust_qunit_qaq_id(tvb, offset, pinfo, tree);
3010
3011   offset=lustre_dissect_element_quota_adjust_qunit_qaq_bunit_sz(tvb, offset, pinfo, tree);
3012
3013   offset=lustre_dissect_element_quota_adjust_qunit_qaq_iunit_sz(tvb, offset, pinfo, tree);
3014
3015   offset=lustre_dissect_element_quota_adjust_qunit_padding1(tvb, offset, pinfo, tree);
3016
3017
3018   proto_item_set_len(item, offset-old_offset);
3019
3020   return offset;
3021 }
3022
3023 /* IDL: struct mdt_body { */
3024 /* IDL:         struct lu_fid { */
3025 /* IDL: } fid1; */
3026 /* IDL:         struct lu_fid { */
3027 /* IDL: } fid2; */
3028 /* IDL:         struct lustre_handle { */
3029 /* IDL: } handle; */
3030 /* IDL:         uint64 valid; */
3031 /* IDL:         uint64 size; */
3032 /* IDL:         uint64 mtime; */
3033 /* IDL:         uint64 atime; */
3034 /* IDL:         uint64 ctime; */
3035 /* IDL:         uint64 blocks; */
3036 /* IDL:         uint64 ioepoch; */
3037 /* IDL:         uint64 ino; */
3038 /* IDL:         uint32 fsuid; */
3039 /* IDL:         uint32 fsgid; */
3040 /* IDL:         uint32 capability; */
3041 /* IDL:         uint32 mode; */
3042 /* IDL:         uint32 uid; */
3043 /* IDL:         uint32 gid; */
3044 /* IDL:         uint32 flags; */
3045 /* IDL:         uint32 rdev; */
3046 /* IDL:         uint32 nlink; */
3047 /* IDL:         uint32 generation; */
3048 /* IDL:         uint32 suppgid; */
3049 /* IDL:         uint32 eadatasize; */
3050 /* IDL:         uint32 aclsize; */
3051 /* IDL:         uint32 max_mdsize; */
3052 /* IDL:         uint32 max_cookiesize; */
3053 /* IDL:         uint32 uid_h; */
3054 /* IDL:         uint32 gid_h; */
3055 /* IDL:         uint32 padding_5; */
3056 /* IDL:         uint64 padding_6; */
3057 /* IDL:         uint64 padding_7; */
3058 /* IDL:         uint64 padding_8; */
3059 /* IDL:         uint64 padding_9; */
3060 /* IDL:         uint64 padding_10; */
3061 /* IDL: } */
3062
3063 static int
3064 lustre_dissect_element_mdt_body_fid1(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
3065 {
3066   offset=lustre_dissect_struct_lu_fid(tvb,offset,pinfo,tree,hf_lustre_mdt_body_fid1);
3067   return offset;
3068 }
3069
3070 static int
3071 lustre_dissect_element_mdt_body_fid2(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
3072 {
3073   offset=lustre_dissect_struct_lu_fid(tvb,offset,pinfo,tree,hf_lustre_mdt_body_fid2);
3074   return offset;
3075 }
3076
3077 static int
3078 lustre_dissect_element_mdt_body_handle(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
3079 {
3080   offset=lustre_dissect_struct_handle_cookie(tvb,offset,pinfo,tree,hf_lustre_mdt_body_handle);
3081
3082   return offset;
3083 }
3084
3085 static int
3086 lustre_dissect_element_mdt_body_valid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
3087 {
3088   offset=dissect_uint64(tvb, offset, pinfo, tree,  hf_lustre_mdt_body_valid);
3089
3090   return offset;
3091 }
3092
3093 static int
3094 lustre_dissect_element_mdt_body_size(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
3095 {
3096   offset=dissect_uint64(tvb, offset, pinfo, tree,  hf_lustre_mdt_body_size);
3097
3098   return offset;
3099 }
3100
3101 static int
3102 lustre_dissect_element_mdt_body_mtime(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
3103 {
3104   nstime_t ns;
3105   /* timestamp */
3106   ns.secs = tvb_get_letohl(tvb,offset);
3107   ns.nsecs=0;
3108   proto_tree_add_time(tree, hf_lustre_mdt_body_mtime, tvb, offset, 8, &ns );
3109   offset+=8;
3110   return offset;
3111 }
3112
3113 static int
3114 lustre_dissect_element_mdt_body_atime(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
3115 {
3116   nstime_t ns;
3117   /* timestamp */
3118   ns.secs = tvb_get_letohl(tvb,offset);
3119   ns.nsecs=0;
3120   proto_tree_add_time(tree, hf_lustre_mdt_body_atime, tvb, offset, 8, &ns );
3121   offset+=8;
3122
3123   return offset;
3124 }
3125
3126 static int
3127 lustre_dissect_element_mdt_body_ctime(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
3128 {
3129   nstime_t ns;
3130   /* timestamp */
3131   ns.secs = tvb_get_letohl(tvb,offset);
3132   ns.nsecs=0;
3133   proto_tree_add_time(tree, hf_lustre_mdt_body_ctime, tvb, offset, 8, &ns );
3134   offset+=8;
3135   return offset;
3136 }
3137
3138 static int
3139 lustre_dissect_element_mdt_body_blocks(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
3140 {
3141   offset=dissect_uint64(tvb, offset, pinfo, tree,  hf_lustre_mdt_body_blocks);
3142
3143   return offset;
3144 }
3145
3146 static int
3147 lustre_dissect_element_mdt_body_ioepoch(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
3148 {
3149   offset=dissect_uint64(tvb, offset, pinfo, tree,  hf_lustre_mdt_body_ioepoch);
3150
3151   return offset;
3152 }
3153
3154 static int
3155 lustre_dissect_element_mdt_body_ino(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
3156 {
3157   offset=dissect_uint64(tvb, offset, pinfo, tree,  hf_lustre_mdt_body_ino);
3158
3159   return offset;
3160 }
3161
3162 static int
3163 lustre_dissect_element_mdt_body_fsuid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
3164 {
3165   offset=dissect_uint32(tvb, offset, pinfo, tree,  hf_lustre_mdt_body_fsuid);
3166
3167   return offset;
3168 }
3169
3170 static int
3171 lustre_dissect_element_mdt_body_fsgid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
3172 {
3173   offset=dissect_uint32(tvb, offset, pinfo, tree,  hf_lustre_mdt_body_fsgid);
3174
3175   return offset;
3176 }
3177
3178 static int
3179 lustre_dissect_element_mdt_body_capability(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
3180 {
3181   offset=dissect_uint32(tvb, offset, pinfo, tree,  hf_lustre_mdt_body_capability);
3182
3183   return offset;
3184 }
3185
3186 static int
3187 lustre_dissect_element_mdt_body_mode(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
3188 {
3189   offset=dissect_uint32(tvb, offset, pinfo, tree,  hf_lustre_mdt_body_mode);
3190
3191   return offset;
3192 }
3193
3194 static int
3195 lustre_dissect_element_mdt_body_uid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
3196 {
3197   offset=dissect_uint32(tvb, offset, pinfo, tree,  hf_lustre_mdt_body_uid);
3198
3199   return offset;
3200 }
3201
3202 static int
3203 lustre_dissect_element_mdt_body_gid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
3204 {
3205   offset=dissect_uint32(tvb, offset, pinfo, tree,  hf_lustre_mdt_body_gid);
3206
3207   return offset;
3208 }
3209
3210 static int
3211 lustre_dissect_element_mdt_body_flags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
3212 {
3213   offset=dissect_uint32(tvb, offset, pinfo, tree,  hf_lustre_mdt_body_flags);
3214
3215   return offset;
3216 }
3217
3218 static int
3219 lustre_dissect_element_mdt_body_rdev(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
3220 {
3221   offset=dissect_uint32(tvb, offset, pinfo, tree,  hf_lustre_mdt_body_rdev);
3222
3223   return offset;
3224 }
3225
3226 static int
3227 lustre_dissect_element_mdt_body_nlink(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
3228 {
3229   offset=dissect_uint32(tvb, offset, pinfo, tree,  hf_lustre_mdt_body_nlink);
3230
3231   return offset;
3232 }
3233
3234 static int
3235 lustre_dissect_element_mdt_body_generation(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
3236 {
3237   offset=dissect_uint32(tvb, offset, pinfo, tree,  hf_lustre_mdt_body_generation);
3238
3239   return offset;
3240 }
3241
3242 static int
3243 lustre_dissect_element_mdt_body_suppgid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
3244 {
3245   offset=dissect_uint32(tvb, offset, pinfo, tree,  hf_lustre_mdt_body_suppgid);
3246
3247   return offset;
3248 }
3249
3250 static int
3251 lustre_dissect_element_mdt_body_eadatasize(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
3252 {
3253   offset=dissect_uint32(tvb, offset, pinfo, tree,  hf_lustre_mdt_body_eadatasize);
3254
3255   return offset;
3256 }
3257
3258 static int
3259 lustre_dissect_element_mdt_body_aclsize(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
3260 {
3261   offset=dissect_uint32(tvb, offset, pinfo, tree,  hf_lustre_mdt_body_aclsize);
3262
3263   return offset;
3264 }
3265
3266 static int
3267 lustre_dissect_element_mdt_body_max_mdsize(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
3268 {
3269   offset=dissect_uint32(tvb, offset, pinfo, tree,  hf_lustre_mdt_body_max_mdsize);
3270
3271   return offset;
3272 }
3273
3274 static int
3275 lustre_dissect_element_mdt_body_max_cookiesize(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
3276 {
3277   offset=dissect_uint32(tvb, offset, pinfo, tree,  hf_lustre_mdt_body_max_cookiesize);
3278
3279   return offset;
3280 }
3281
3282 static int
3283 lustre_dissect_element_mdt_body_uid_h(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
3284 {
3285   offset=dissect_uint32(tvb, offset, pinfo, tree,  hf_lustre_mdt_body_uid_h);
3286
3287   return offset;
3288 }
3289
3290 static int
3291 lustre_dissect_element_mdt_body_gid_h(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
3292 {
3293   offset=dissect_uint32(tvb, offset, pinfo, tree,  hf_lustre_mdt_body_gid_h);
3294
3295   return offset;
3296 }
3297
3298 static int
3299 lustre_dissect_element_mdt_body_padding_5(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
3300 {
3301   offset=dissect_uint32(tvb, offset, pinfo, tree,  hf_lustre_mdt_body_padding_5);
3302
3303   return offset;
3304 }
3305
3306 static int
3307 lustre_dissect_element_mdt_body_padding_6(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
3308 {
3309   offset=dissect_uint64(tvb, offset, pinfo, tree,  hf_lustre_mdt_body_padding_6);
3310
3311   return offset;
3312 }
3313
3314 static int
3315 lustre_dissect_element_mdt_body_padding_7(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
3316 {
3317   offset=dissect_uint64(tvb, offset, pinfo, tree,  hf_lustre_mdt_body_padding_7);
3318
3319   return offset;
3320 }
3321
3322 static int
3323 lustre_dissect_element_mdt_body_padding_8(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
3324 {
3325   offset=dissect_uint64(tvb, offset, pinfo, tree,  hf_lustre_mdt_body_padding_8);
3326
3327   return offset;
3328 }
3329
3330 static int
3331 lustre_dissect_element_mdt_body_padding_9(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
3332 {
3333   offset=dissect_uint64(tvb, offset, pinfo, tree,  hf_lustre_mdt_body_padding_9);
3334
3335   return offset;
3336 }
3337
3338 static int
3339 lustre_dissect_element_mdt_body_padding_10(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
3340 {
3341   offset= dissect_uint64(tvb, offset, pinfo, tree,  hf_lustre_mdt_body_padding_10);
3342
3343   return offset;
3344 }
3345
3346 int
3347 lustre_dissect_struct_mdt_body(tvbuff_t *tvb _U_, int offset _U_,
3348                                packet_info *pinfo _U_,
3349                                proto_tree *parent_tree _U_,
3350                                int hf_index _U_)
3351 {
3352   proto_item *item = NULL;
3353   proto_tree *tree = NULL;
3354   int old_offset;
3355
3356
3357   old_offset=offset;
3358
3359   if (parent_tree) {
3360     item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, TRUE);
3361     tree = proto_item_add_subtree(item, ett_lustre_mdt_body);
3362   }
3363
3364   offset=lustre_dissect_element_mdt_body_fid1(tvb, offset, pinfo, tree);
3365
3366   offset=lustre_dissect_element_mdt_body_fid2(tvb, offset, pinfo, tree);
3367
3368   offset=lustre_dissect_element_mdt_body_handle(tvb, offset, pinfo, tree);
3369
3370   offset=lustre_dissect_element_mdt_body_valid(tvb, offset, pinfo, tree);
3371
3372   offset=lustre_dissect_element_mdt_body_size(tvb, offset, pinfo, tree);
3373
3374   offset=lustre_dissect_element_mdt_body_mtime(tvb, offset, pinfo, tree);
3375
3376   offset=lustre_dissect_element_mdt_body_atime(tvb, offset, pinfo, tree);
3377
3378   offset=lustre_dissect_element_mdt_body_ctime(tvb, offset, pinfo, tree);
3379
3380   offset=lustre_dissect_element_mdt_body_blocks(tvb, offset, pinfo, tree);
3381
3382   offset=lustre_dissect_element_mdt_body_ioepoch(tvb, offset, pinfo, tree);
3383
3384   offset=lustre_dissect_element_mdt_body_ino(tvb, offset, pinfo, tree);
3385
3386   offset=lustre_dissect_element_mdt_body_fsuid(tvb, offset, pinfo, tree);
3387
3388   offset=lustre_dissect_element_mdt_body_fsgid(tvb, offset, pinfo, tree);
3389
3390   offset=lustre_dissect_element_mdt_body_capability(tvb, offset, pinfo, tree);
3391
3392   offset=lustre_dissect_element_mdt_body_mode(tvb, offset, pinfo, tree);
3393
3394   offset=lustre_dissect_element_mdt_body_uid(tvb, offset, pinfo, tree);
3395
3396   offset=lustre_dissect_element_mdt_body_gid(tvb, offset, pinfo, tree);
3397
3398   offset=lustre_dissect_element_mdt_body_flags(tvb, offset, pinfo, tree);
3399
3400   offset=lustre_dissect_element_mdt_body_rdev(tvb, offset, pinfo, tree);
3401
3402   offset=lustre_dissect_element_mdt_body_nlink(tvb, offset, pinfo, tree);
3403
3404   offset=lustre_dissect_element_mdt_body_generation(tvb, offset, pinfo, tree);
3405
3406   offset=lustre_dissect_element_mdt_body_suppgid(tvb, offset, pinfo, tree);
3407
3408   offset=lustre_dissect_element_mdt_body_eadatasize(tvb, offset, pinfo, tree);
3409
3410   offset=lustre_dissect_element_mdt_body_aclsize(tvb, offset, pinfo, tree);
3411
3412   offset=lustre_dissect_element_mdt_body_max_mdsize(tvb, offset, pinfo, tree);
3413
3414   offset=lustre_dissect_element_mdt_body_max_cookiesize(tvb, offset, pinfo, tree);
3415
3416   offset=lustre_dissect_element_mdt_body_uid_h(tvb, offset, pinfo, tree);
3417
3418   offset=lustre_dissect_element_mdt_body_gid_h(tvb, offset, pinfo, tree);
3419
3420   offset=lustre_dissect_element_mdt_body_padding_5(tvb, offset, pinfo, tree);
3421
3422   offset=lustre_dissect_element_mdt_body_padding_6(tvb, offset, pinfo, tree);
3423
3424   offset=lustre_dissect_element_mdt_body_padding_7(tvb, offset, pinfo, tree);
3425
3426   offset=lustre_dissect_element_mdt_body_padding_8(tvb, offset, pinfo, tree);
3427
3428   offset=lustre_dissect_element_mdt_body_padding_9(tvb, offset, pinfo, tree);
3429
3430   offset=lustre_dissect_element_mdt_body_padding_10(tvb, offset, pinfo, tree);
3431
3432
3433   proto_item_set_len(item, offset-old_offset);
3434
3435   return offset;
3436 }
3437
3438 /* I don't find where this struct appear on wire.. need to search mdc_setattr_pack() */
3439 /* IDL: struct mdt_rec_setattr { */
3440 /* IDL:         uint32 sa_opcode; */
3441 /* IDL:         uint32 sa_cap; */
3442 /* IDL:         uint32 sa_fsuid; */
3443 /* IDL:         uint32 sa_fsuid_h; */
3444 /* IDL:         uint32 sa_fsgid; */
3445 /* IDL:         uint32 sa_fsgid_h; */
3446 /* IDL:         uint32 sa_suppgid; */
3447 /* IDL:         uint32 sa_suppgid_h; */
3448 /* IDL:         uint32 sa_padding_1; */
3449 /* IDL:         uint32 sa_padding_1_h; */
3450 /* IDL:         struct lu_fid { */
3451 /* IDL: } sa_fid; */
3452 /* IDL:         uint64 sa_valid; */
3453 /* IDL:         uint32 sa_uid; */
3454 /* IDL:         uint32 sa_gid; */
3455 /* IDL:         uint64 sa_size; */
3456 /* IDL:         uint64 sa_blocks; */
3457 /* IDL:         uint64 sa_mtime; */
3458 /* IDL:         uint64 sa_atime; */
3459 /* IDL:         uint64 sa_ctime; */
3460 /* IDL:         uint32 sa_attr_flags; */
3461 /* IDL:         uint32 sa_mode; */
3462 /* IDL:         uint32 sa_padding_2; */
3463 /* IDL:         uint32 sa_projid; */
3464 /* IDL:         uint32 sa_padding_4; */
3465 /* IDL:         uint32 sa_padding_5; */
3466 /* IDL: } */
3467
3468 static int
3469 lustre_dissect_element_mdt_rec_setattr_sa_opcode(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
3470 {
3471   offset=dissect_uint32(tvb, offset, pinfo, tree,  hf_lustre_mdt_rec_setattr_sa_opcode);
3472
3473   return offset;
3474 }
3475
3476 static int
3477 lustre_dissect_element_mdt_rec_setattr_sa_cap(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
3478 {
3479   offset=dissect_uint32(tvb, offset, pinfo, tree,  hf_lustre_mdt_rec_setattr_sa_cap);
3480
3481   return offset;
3482 }
3483