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