Whamcloud - gitweb
LU-28 fileset: add fileset mount support
[fs/lustre-release.git] / lustre / contrib / wireshark / packet-lustre.c
index f53c85f..e07576b 100644 (file)
@@ -37,6 +37,7 @@
 #include <epan/packet.h>
 
 #include <epan/dissectors/packet-windows-common.h>
+#include "lustre_dlm_flags.h"
 
 const true_false_string lnet_flags_set_truth = { "Set", "Unset" };
 
@@ -180,6 +181,7 @@ typedef enum {
   OST_QUOTACHECK = 18,
   OST_QUOTACTL   = 19,
   OST_QUOTA_ADJUST_QUNIT = 20,
+  OST_LADVISE = 21,
   OST_LAST_OPC
 } ost_cmd_t ;
 
@@ -203,7 +205,7 @@ typedef enum {
        MDS_READPAGE            = 37,
        MDS_CONNECT             = 38,
        MDS_DISCONNECT          = 39,
-       MDS_GETSTATUS           = 40,
+       MDS_GET_ROOT            = 40,
        MDS_STATFS              = 41,
        MDS_PIN                 = 42,
        MDS_UNPIN               = 43,
@@ -256,7 +258,7 @@ typedef enum {
   REINT_MAX
 } mds_reint_t;
 
-typedef enum {
+enum ldlm_cmd {
   LDLM_ENQUEUE     = 101,
   LDLM_CONVERT     = 102,
   LDLM_CANCEL      = 103,
@@ -264,7 +266,7 @@ typedef enum {
   LDLM_CP_CALLBACK = 105,
   LDLM_GL_CALLBACK = 106,
   LDLM_LAST_OPC
-} ldlm_cmd_t;
+};
 #define LDLM_FIRST_OPC LDLM_ENQUEUE
 
 enum seq_rpc_opc {
@@ -279,9 +281,6 @@ enum fld_rpc_opc {
   FLD_FIRST_OPC    = FLD_QUERY
 };
 
-#define  WIRESHARK_COMPILE
-#include "lustre_dlm_flags.h"
-
 #define LDLM_ENQUEUE (101)
 #define LDLM_CONVERT (102)
 #define LDLM_CANCEL (103)
@@ -1024,17 +1023,28 @@ static int hf_lustre_ldlm_intent_opc_pin      = -1;
 static int hf_lustre_llog_hdr_llh_flag_zap_when_empty = -1;
 static int hf_lustre_llog_hdr_llh_flag_is_cat = -1;
 static int hf_lustre_llog_hdr_llh_flag_is_play = -1;
+static int hf_lustre_lu_ladvise = -1;
+static int hf_lustre_lu_ladvise_lla_start = -1;
+static int hf_lustre_lu_ladvise_lla_end = -1;
+static int hf_lustre_lu_ladvise_lla_advice = -1;
+static int hf_lustre_lu_ladvise_lla_padding = -1;
 /* --------------------------------------------------------------------*/
 
 
 /* proto declaration */
 static gint proto_lustre = -1;
 
+typedef int (dissect_func)(
+    tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tree,
+    int hfindex);
 
+static dissect_func dissect_uint64, dissect_uint32, dissect_uint16, dissect_uint8;
 
+#define  WSHARK_HEAD
+#include "lustre_dlm_flags_wshark.c"
+#undef   WSHARK_HEAD
 
 static int ldlm_opcode_process(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree * tree _U_, guint64 intent_opc _U_) ;
-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_);
 static int add_extra_padding(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree * tree _U_) ;
 
 
@@ -1081,13 +1091,16 @@ const value_string lustre_llog_hdr_llh_flags[]= {
 };
 
 const value_string lustre_mds_flags_vals[] = {
-  {0x1,        "LUSTRE_BFLAG_UNCOMMITTED_WRITES"},
-  {0x80000000, "LUSTRE_BFLAG_EXT_FLAGS"},   /* == EXT3_RESERVED_FL */
   {0x00000008, "LUSTRE_SYNC_FL        "},   /* Synchronous updates */
   {0x00000010, "LUSTRE_IMMUTABLE_FL   "},   /* Immutable file */
   {0x00000020, "LUSTRE_APPEND_FL      "},   /* writes to file may only append */
+  {0x00000040, "LUSTRE_NODUMP_FL      "},   /* do not dump file */
   {0x00000080, "LUSTRE_NOATIME_FL     "},   /* do not update atime */
+  {0x00001000, "LUSTRE_INDEX_FL       "},   /* hash-indexed directory */
   {0x00010000, "LUSTRE_DIRSYNC_FL     "},   /* dirsync behaviour (dir only) */
+  {0x00020000, "LUSTRE_TOPDIR_FL      "},   /* Top of directory hierarchies */
+  {0x00100000, "LUSTRE_DIRECTIO_FL    "},   /* Use direct i/o */
+  {0x10000000, "LUSTRE_INLINE_DATA_FL "},   /* Inode has inline data. */
   { 0, NULL }
 };
 
@@ -1138,7 +1151,9 @@ const value_string lustre_op_codes[] = {
   {17 , "OST_SET_INFO"},
   {18 , "OST_QUOTACHECK"},
   {19 , "OST_QUOTACTL"},
-  {20 , "OST_LAST_OPC"},
+  {20 , "OST_QUOTA_ADJUST_QUNIT"},
+  {21 , "OST_LADVISE"},
+  {22 , "OST_LAST_OPC"},
   /*MDS Opcodes*/
   {33 , "MDS_GETATTR"},
   {34 , "MDS_GETATTR_NAME"},
@@ -1147,7 +1162,7 @@ const value_string lustre_op_codes[] = {
   {37 , "MDS_READPAGE"},
   {38 , "MDS_CONNECT"},
   {39 , "MDS_DISCONNECT"},
-  {40 , "MDS_GETSTATUS"},
+  {40 , "MDS_GET_ROOT"},
   {41 , "MDS_STATFS"},
   {42 , "MDS_PIN"},
   {43 , "MDS_UNPIN"},
@@ -1210,7 +1225,7 @@ const value_string lustre_op_codes[] = {
   { 901, "FLD_LAST_OPC"},
   { 0, NULL }
 };
-/*const value_string lustre_ldlm_mode_t_vals[] = {*/
+/*const value_string lustre_ldlm_mode_vals[] = {*/
 /*    { LCK_MINMODE, "MINMODE" },*/
 /*    { LCK_EX, "EX" },*/
 /*    { LCK_PW, "PW" },*/
@@ -1223,7 +1238,7 @@ const value_string lustre_op_codes[] = {
 /*};*/
 
 /* detailled version the information came from : http://wiki.lustre.org/images/e/e5/LustreInternals_Architecture.pdf */
-const value_string lustre_ldlm_mode_t_vals[] = {
+const value_string lustre_ldlm_mode_vals[] = {
   { LCK_MINMODE, "MINMODE" },
   { LCK_EX, "Exclusive" },
   { LCK_PW, "Protected Write" },
@@ -1235,7 +1250,7 @@ const value_string lustre_ldlm_mode_t_vals[] = {
   { 0, NULL }
 };
 
-const value_string lustre_ldlm_type_t_vals[] = {
+const value_string lustre_ldlm_type_vals[] = {
   { LDLM_PLAIN, "LDLM_PLAIN" },
   { LDLM_EXTENT,"LDLM_EXTENT" },
   { LDLM_FLOCK, "LDLM_FLOCK" },
@@ -5144,7 +5159,7 @@ lustre_dissect_struct_ldlm_res_id(tvbuff_t *tvb _U_, int offset _U_, packet_info
 /* IDL: } */
 
 int
-lustre_dissect_enum_ldlm_mode_t(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_)
+lustre_dissect_enum_ldlm_mode(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_)
 {
   offset=dissect_uint32(tvb, offset, pinfo, tree, hf_index);
   return offset;
@@ -5160,7 +5175,7 @@ lustre_dissect_enum_ldlm_mode_t(tvbuff_t *tvb _U_, int offset _U_, packet_info *
 /* IDL: } */
 
 int
-lustre_dissect_enum_ldlm_type_t(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_)
+lustre_dissect_enum_ldlm_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int hf_index _U_)
 {
   offset=dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_ldlm_resource_desc_lr_type );
   return offset;
@@ -5424,9 +5439,9 @@ lustre_dissect_struct_ldlm_intent(tvbuff_t *tvb _U_, int offset _U_, packet_info
 }
 
 /* IDL: struct ldlm_resource_desc { */
-/* IDL:        ldlm_type_t lr_type; */
-/* IDL:        uint32 lr_padding; */
-/* IDL:        struct ldlm_res_id { */
+/* IDL:                enum ldlm_type lr_type; */
+/* IDL:                uint32 lr_padding; */
+/* IDL:                struct ldlm_res_id { */
 /* IDL: } lr_name; */
 /* IDL: } */
 
@@ -5434,7 +5449,7 @@ static int
 lustre_dissect_element_ldlm_resource_desc_lr_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
 {
   /*    offset=dissect_uint32(tvb, offset, pinfo, tree,  hf_lustre_ldlm_resource_desc_lr_type);*/
-  offset=lustre_dissect_enum_ldlm_type_t(tvb, offset, pinfo, tree,  hf_lustre_ldlm_resource_desc_lr_type);
+  offset=lustre_dissect_enum_ldlm_type(tvb, offset, pinfo, tree,  hf_lustre_ldlm_resource_desc_lr_type);
   return offset;
 }
 
@@ -5483,11 +5498,11 @@ lustre_dissect_struct_ldlm_resource_desc(tvbuff_t *tvb _U_, int offset _U_, pack
 
 
 /* IDL: struct ldlm_lock_desc { */
-/* IDL:        struct ldlm_resource_desc { */
-/* IDL: } l_resource; */
-/* IDL:        ldlm_mode_t l_req_mode; */
-/* IDL:        ldlm_mode_t l_granted_mode; */
-/* IDL:        ldlm_policy_data_t l_policy_data; */
+/* IDL:                struct ldlm_resource_desc { */
+/* IDL:                } l_resource; */
+/* IDL:                enum ldlm_mode l_req_mode; */
+/* IDL:                enum ldlm_mode l_granted_mode; */
+/* IDL:                union ldlm_policy_data l_policy_data; */
 /* IDL: } */
 
 static int
@@ -5500,7 +5515,7 @@ lustre_dissect_element_ldlm_lock_desc_l_resource(tvbuff_t *tvb _U_, int offset _
 static int
 lustre_dissect_element_ldlm_lock_desc_l_req_mode(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
 {
-  offset=lustre_dissect_enum_ldlm_mode_t(tvb, offset, pinfo, tree,  hf_lustre_ldlm_lock_desc_l_req_mode);
+  offset=lustre_dissect_enum_ldlm_mode(tvb, offset, pinfo, tree,  hf_lustre_ldlm_lock_desc_l_req_mode);
 
   return offset;
 }
@@ -5508,7 +5523,7 @@ lustre_dissect_element_ldlm_lock_desc_l_req_mode(tvbuff_t *tvb _U_, int offset _
 static int
 lustre_dissect_element_ldlm_lock_desc_l_granted_mode(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
 {
-  offset=lustre_dissect_enum_ldlm_mode_t(tvb, offset, pinfo, tree,  hf_lustre_ldlm_lock_desc_l_granted_mode);
+  offset=lustre_dissect_enum_ldlm_mode(tvb, offset, pinfo, tree,  hf_lustre_ldlm_lock_desc_l_granted_mode);
 
   return offset;
 }
@@ -5570,7 +5585,7 @@ lustre_dissect_struct_ldlm_lock_desc(tvbuff_t *tvb _U_, int offset _U_, packet_i
 
   lock_req_mode = tvb_get_letohl(tvb,offset);
 
-  display_info_fstr(parent_tree->parent, pinfo->cinfo, COL_INFO, "[%s]", val_to_str(lock_req_mode, lustre_ldlm_mode_t_vals, "Unknown lock"));
+  display_info_fstr(parent_tree->parent, pinfo->cinfo, COL_INFO, "[%s]", val_to_str(lock_req_mode, lustre_ldlm_mode_vals, "Unknown lock"));
 
   offset=lustre_dissect_element_ldlm_lock_desc_l_req_mode(tvb, offset, pinfo, tree);
 
@@ -5586,12 +5601,12 @@ lustre_dissect_struct_ldlm_lock_desc(tvbuff_t *tvb _U_, int offset _U_, packet_i
 
 
 /* IDL: struct ldlm_request { */
-/* IDL:        uint32 lock_flags; */
-/* IDL:        uint32 lock_count; */
-/* IDL:        struct ldlm_lock_desc { */
-/* IDL: } lock_desc; */
-/* IDL:        struct lustre_handle { */
-/* IDL: } lock_handle[2]; */
+/* IDL:                uint32 lock_flags; */
+/* IDL:                uint32 lock_count; */
+/* IDL:                struct ldlm_lock_desc { */
+/* IDL:                } lock_desc; */
+/* IDL:                struct lustre_handle { */
+/* IDL:                } lock_handle[2]; */
 /* IDL: } */
 
 
@@ -5669,62 +5684,6 @@ lustre_dissect_struct_ldlm_request(tvbuff_t *tvb _U_, int offset _U_, packet_inf
   return offset;
 }
 
-
-/* IDL: struct ldlm_reply { */
-/* IDL:        uint32 lock_flags; */
-/* IDL:        uint32 lock_padding; */
-/* IDL:        struct ldlm_lock_desc { */
-/* IDL: } lock_desc; */
-/* IDL:        struct lustre_handle { */
-/* IDL: } lock_handle; */
-/* IDL:        uint64 lock_policy_res1; */
-/* IDL:        uint64 lock_policy_res2; */
-/* IDL: } */
-
-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_)
-{
-  proto_item *item = NULL;
-  proto_tree *tree = NULL;
-
-  if (parent_tree) {
-    item = proto_tree_add_item(parent_tree,hf_index, tvb, offset, 4, TRUE);
-    tree = proto_item_add_subtree(item, ett_lustre_ldlm_lock_flags);
-  }
-  dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_ldlm_fl_ast_discard_data);
-  dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_ldlm_fl_deny_on_contention);
-  dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_ldlm_fl_bl_done           );
-  dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_ldlm_fl_bl_ast            );
-  dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_ldlm_fl_atomic_cb         );
-  dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_ldlm_fl_cleaned           );
-  dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_ldlm_fl_cp_reqd           );
-  dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_ldlm_fl_cancel_on_block   );
-  dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_ldlm_fl_no_lru            );
-  dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_ldlm_fl_kms_ignore        );
-  dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_ldlm_fl_lvb_ready         );
-  dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_ldlm_fl_test_lock         );
-  dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_ldlm_fl_block_nowait      );
-  dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_ldlm_fl_no_timeout        );
-  dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_ldlm_fl_discard_data      );
-  dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_ldlm_fl_warn              );
-  dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_ldlm_fl_local             );
-  dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_ldlm_fl_canceling         );
-  dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_ldlm_fl_has_intent        );
-  dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_ldlm_fl_failed            );
-  dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_ldlm_fl_local_only        );
-  dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_ldlm_fl_intent_only       );
-  dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_ldlm_fl_replay            );
-  dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_ldlm_fl_cancel            );
-  dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_ldlm_fl_wait_noreproc     );
-  dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_ldlm_fl_ast_sent          );
-  dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_ldlm_fl_cbpending         );
-  dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_ldlm_fl_block_wait        );
-  dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_ldlm_fl_block_conv        );
-  dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_ldlm_fl_block_granted     );
-  offset=dissect_uint32(tvb, offset, pinfo, tree, hf_lustre_ldlm_fl_lock_changed      );
-  return offset;
-}
-
 static int
 lustre_dissect_element_ldlm_reply_lock_padding(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
 {
@@ -8430,6 +8389,83 @@ lustre_dissect_generic_connect(tvbuff_t *tvb _U_, int offset _U_, packet_info *p
   return offset;
 }
 
+int
+lustre_dissect_struct_capa(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_,
+                          proto_tree *parent_tree _U_, int hf_index _U_, guint32 buf_num)
+{
+  proto_item *item = NULL;
+  proto_tree *tree = NULL;
+  int old_offset;
+  int data_len;
+
+  old_offset=offset;
+
+  data_len = LUSTRE_BUFFER_LEN(buf_num);
+  if (data_len == 0)
+    return offset;
+
+  if (parent_tree) {
+    item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, TRUE);
+    tree = proto_item_add_subtree(item, ett_lustre_capa);
+  }
+
+  offset=lustre_dissect_struct_lu_fid(tvb,offset,pinfo,tree,hf_lustre_capa_fid);
+
+  offset=lustre_dissect_element_capa_opc(tvb,offset,pinfo,tree);
+
+  offset=dissect_uint64(tvb,offset,pinfo,tree,hf_lustre_capa_uid);
+
+  offset=dissect_uint64(tvb,offset,pinfo,tree,hf_lustre_capa_gid);
+
+  offset=lustre_dissect_element_capa_flags(tvb,offset,pinfo,tree);
+
+  offset=dissect_uint32(tvb,offset,pinfo,tree,hf_lustre_capa_keyid);
+
+  offset=dissect_uint32(tvb,offset,pinfo,tree,hf_lustre_capa_timeout);
+
+  offset=dissect_uint32(tvb,offset,pinfo,tree,hf_lustre_capa_expiry);
+
+  offset=lustre_dissect_struct_hmac(tvb,offset,pinfo,tree, hf_lustre_capa_hmac, 64);
+
+  if (item)
+    proto_item_set_len(item, offset-old_offset);
+  return offset;
+}
+
+
+int
+lustre_dissect_struct_lu_ladvise(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_,
+                                proto_tree *parent_tree _U_, int hf_index _U_, guint32 buf_num)
+{
+  proto_item *item = NULL;
+  proto_tree *tree = NULL;
+  int old_offset;
+  int data_len;
+
+  old_offset=offset;
+
+  data_len = LUSTRE_BUFFER_LEN(buf_num);
+  if (data_len == 0)
+    return offset;
+
+  if (parent_tree) {
+    item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, TRUE);
+    tree = proto_item_add_subtree(item, ett_lustre_ladvise);
+  }
+
+  offset=dissect_uint64(tvb,offset,pinfo,tree,hf_lustre_lu_ladvise_lla_start);
+
+  offset=dissect_uint64(tvb,offset,pinfo,tree,hf_lustre_lu_ladvise_lla_end);
+
+  offset=dissect_uint64(tvb,offset,pinfo,tree,hf_lustre_lu_ladvise_lla_advice);
+
+  offset=dissect_uint64(tvb,offset,pinfo,tree,hf_lustre_lu_ladvise_lla_padding);
+
+  if (item)
+    proto_item_set_len(item, offset-old_offset);
+  return offset;
+}
+
 static int
 lustre_ost_opcode_process(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree * tree _U_, guint32 opc _U_, guint32 pb_type)
 {
@@ -8535,6 +8571,14 @@ lustre_ost_opcode_process(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo
     case OST_QUOTA_ADJUST_QUNIT:
       /* [quota_adjust_qunit] in both case ? */
       offset=lustre_dissect_struct_quota_adjust_qunit(tvb, offset, pinfo, tree, hf_lustre_quota_adjust_qunit) ;
+    case OST_LADVISE:
+      /*[ost_body] in both case */
+      offset=lustre_dissect_struct_ost_body(tvb, offset, pinfo, tree, hf_lustre_ost_body) ;
+      if (pb_type == PTL_RPC_MSG_REQUEST) {
+         offset=lustre_dissect_struct_capa(tvb, offset, pinfo, tree, hf_lustre_capa, LUSTRE_REQ_REC_OFF+1);
+         offset=lustre_dissect_struct_lu_ladvise(tvb, offset, pinfo, tree, hf_lustre_lu_ladvise, LUSTRE_REQ_REC_OFF+2);
+      }
+      break;
   };
   return offset;
 }
@@ -8546,7 +8590,7 @@ lustre_mds_opcode_process(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo
     case MDS_DISCONNECT:
       /*[nothing]*/
       break;
-    case MDS_GETSTATUS:
+    case MDS_GET_ROOT:
       /*request: [mds body]*/
       /*reply:   [mds body][capa] */
       offset=lustre_dissect_struct_mdt_body(tvb, offset, pinfo, tree, hf_lustre_mdt_body) ;
@@ -10478,37 +10522,9 @@ void proto_register_dcerpc_lustre(void)
     { &hf_lustre_ldlm_reply_lock_flags,
       { "Lock Flags", "lustre.ldlm_reply.lock_flags", FT_UINT32,BASE_HEX, NULL, 0, "", HFILL }},
 
-    {&hf_lustre_ldlm_fl_lock_changed, {"LDLM_FL_LOCK_CHANGED", "lustre.ldlm_fl_lock_changed", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), LDLM_FL_LOCK_CHANGED, "", HFILL } },
-    {&hf_lustre_ldlm_fl_block_granted, {"LDLM_FL_BLOCK_GRANTED", "lustre.ldlm_fl_block_granted", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), LDLM_FL_BLOCK_GRANTED, "", HFILL } },
-    {&hf_lustre_ldlm_fl_block_conv, {"LDLM_FL_BLOCK_CONV", "lustre.ldlm_fl_block_conv", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), LDLM_FL_BLOCK_CONV, "", HFILL } },
-    {&hf_lustre_ldlm_fl_block_wait, {"LDLM_FL_BLOCK_WAIT", "lustre.ldlm_fl_block_wait", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), LDLM_FL_BLOCK_WAIT, "", HFILL } },
-    {&hf_lustre_ldlm_fl_cbpending, {"LDLM_FL_CBPENDING", "lustre.ldlm_fl_cbpending", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), LDLM_FL_CBPENDING, "", HFILL } },
-    {&hf_lustre_ldlm_fl_ast_sent, {"LDLM_FL_AST_SENT", "lustre.ldlm_fl_ast_sent", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), LDLM_FL_AST_SENT, "", HFILL } },
-    {&hf_lustre_ldlm_fl_wait_noreproc, {"LDLM_FL_WAIT_NOREPROC", "lustre.ldlm_fl_wait_noreproc", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), LDLM_FL_WAIT_NOREPROC, "", HFILL } },
-    {&hf_lustre_ldlm_fl_cancel, {"LDLM_FL_CANCEL", "lustre.ldlm_fl_cancel", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), LDLM_FL_CANCEL, "", HFILL } },
-    {&hf_lustre_ldlm_fl_replay, {"LDLM_FL_REPLAY", "lustre.ldlm_fl_replay", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), LDLM_FL_REPLAY, "", HFILL } },
-    {&hf_lustre_ldlm_fl_intent_only, {"LDLM_FL_INTENT_ONLY", "lustre.ldlm_fl_intent_only", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), LDLM_FL_INTENT_ONLY, "", HFILL } },
-    {&hf_lustre_ldlm_fl_local_only, {"LDLM_FL_LOCAL_ONLY", "lustre.ldlm_fl_local_only", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), LDLM_FL_LOCAL_ONLY, "", HFILL } },
-    {&hf_lustre_ldlm_fl_failed, {"LDLM_FL_FAILED", "lustre.ldlm_fl_failed", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), LDLM_FL_FAILED, "", HFILL } },
-    {&hf_lustre_ldlm_fl_has_intent, {"LDLM_FL_HAS_INTENT", "lustre.ldlm_fl_has_intent", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), LDLM_FL_HAS_INTENT, "", HFILL } },
-    {&hf_lustre_ldlm_fl_canceling, {"LDLM_FL_CANCELING", "lustre.ldlm_fl_canceling", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), LDLM_FL_CANCELING, "", HFILL } },
-    {&hf_lustre_ldlm_fl_local, {"LDLM_FL_LOCAL", "lustre.ldlm_fl_local", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), LDLM_FL_LOCAL, "", HFILL } },
-    {&hf_lustre_ldlm_fl_warn, {"LDLM_FL_WARN", "lustre.ldlm_fl_warn", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), LDLM_FL_WARN, "", HFILL } },
-    {&hf_lustre_ldlm_fl_discard_data, {"LDLM_FL_DISCARD_DATA", "lustre.ldlm_fl_discard_data", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), LDLM_FL_DISCARD_DATA, "", HFILL } },
-    {&hf_lustre_ldlm_fl_no_timeout, {"LDLM_FL_NO_TIMEOUT", "lustre.ldlm_fl_no_timeout", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), LDLM_FL_NO_TIMEOUT, "", HFILL } },
-    {&hf_lustre_ldlm_fl_block_nowait, {"LDLM_FL_BLOCK_NOWAIT", "lustre.ldlm_fl_block_nowait", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), LDLM_FL_BLOCK_NOWAIT, "", HFILL } },
-    {&hf_lustre_ldlm_fl_test_lock, {"LDLM_FL_TEST_LOCK", "lustre.ldlm_fl_test_lock", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), LDLM_FL_TEST_LOCK, "", HFILL } },
-    {&hf_lustre_ldlm_fl_lvb_ready, {"LDLM_FL_LVB_READY", "lustre.ldlm_fl_lvb_ready", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), LDLM_FL_LVB_READY, "", HFILL } },
-    {&hf_lustre_ldlm_fl_kms_ignore, {"LDLM_FL_KMS_IGNORE", "lustre.ldlm_fl_kms_ignore", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), LDLM_FL_KMS_IGNORE, "", HFILL } },
-    {&hf_lustre_ldlm_fl_no_lru, {"LDLM_FL_NO_LRU", "lustre.ldlm_fl_no_lru", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), LDLM_FL_NO_LRU, "", HFILL } },
-    {&hf_lustre_ldlm_fl_cancel_on_block, {"LDLM_FL_CANCEL_ON_BLOCK", "lustre.ldlm_fl_cancel_on_block", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), LDLM_FL_CANCEL_ON_BLOCK, "", HFILL } },
-    {&hf_lustre_ldlm_fl_cp_reqd, {"LDLM_FL_CP_REQD", "lustre.ldlm_fl_cp_reqd", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), LDLM_FL_CP_REQD, "", HFILL } },
-    {&hf_lustre_ldlm_fl_cleaned, {"LDLM_FL_CLEANED", "lustre.ldlm_fl_cleaned", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), LDLM_FL_CLEANED, "", HFILL } },
-    {&hf_lustre_ldlm_fl_atomic_cb, {"LDLM_FL_ATOMIC_CB", "lustre.ldlm_fl_atomic_cb", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), LDLM_FL_ATOMIC_CB, "", HFILL } },
-    {&hf_lustre_ldlm_fl_bl_ast, {"LDLM_FL_BL_AST", "lustre.ldlm_fl_bl_ast", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), LDLM_FL_BL_AST, "", HFILL } },
-    {&hf_lustre_ldlm_fl_bl_done, {"LDLM_FL_BL_DONE", "lustre.ldlm_fl_bl_done", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), LDLM_FL_BL_DONE, "", HFILL } },
-    {&hf_lustre_ldlm_fl_deny_on_contention, {"LDLM_FL_DENY_ON_CONTENTION", "lustre.ldlm_fl_deny_on_contention", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), LDLM_FL_DENY_ON_CONTENTION, "", HFILL } },
-    {&hf_lustre_ldlm_fl_ast_discard_data, {"LDLM_AST_DISCARD_DATA", "lustre.ldlm_ast_discard_data", FT_BOOLEAN, 32, TFS(&lnet_flags_set_truth), LDLM_FL_AST_DISCARD_DATA, "", HFILL } },
+#define  WSHARK_INIT_DATA
+#include "lustre_dlm_flags_wshark.c"
+#undef   WSHARK_INIT_DATA
 
     { &hf_lustre_obdo_o_misc,
       { "O Misc", "lustre.obdo.o_misc", FT_UINT32, BASE_DEC, NULL, 0, "", HFILL }},
@@ -10638,7 +10654,7 @@ void proto_register_dcerpc_lustre(void)
     { &hf_lustre_quota_adjust_qunit_qaq_flags,
       { "Qaq Flags", "lustre.quota_adjust_qunit.qaq_flags", FT_UINT32, BASE_DEC, NULL, 0, "", HFILL }},
     { &hf_lustre_ldlm_lock_desc_l_granted_mode,
-      { "L Granted Mode", "lustre.ldlm_lock_desc.l_granted_mode", FT_UINT16, BASE_DEC, VALS(lustre_ldlm_mode_t_vals), 0, "", HFILL }},
+      { "L Granted Mode", "lustre.ldlm_lock_desc.l_granted_mode", FT_UINT16, BASE_DEC, VALS(lustre_ldlm_mode_vals), 0, "", HFILL }},
     { &hf_lustre_obdo_o_seq,
       { "O SEQ", "lustre.obdo.o_seq", FT_UINT64, BASE_DEC, NULL, 0, "", HFILL }},
     { &hf_lustre_obdo_o_gid,
@@ -10777,7 +10793,7 @@ void proto_register_dcerpc_lustre(void)
     { &hf_lustre_llog_unlink_rec_padding,
       { "Padding", "lustre.llog_unlink_rec.padding", FT_UINT32, BASE_DEC, NULL, 0, "", HFILL }},
     { &hf_lustre_ldlm_lock_desc_l_req_mode,
-      { "L Req Mode", "lustre.ldlm_lock_desc.l_req_mode", FT_UINT16, BASE_DEC, VALS(lustre_ldlm_mode_t_vals), 0, "", HFILL }},
+      { "L Req Mode", "lustre.ldlm_lock_desc.l_req_mode", FT_UINT16, BASE_DEC, VALS(lustre_ldlm_mode_vals), 0, "", HFILL }},
     { &hf_lustre_ldlm_extent_end,
       { "End", "lustre.ldlm_extent.end", FT_UINT64, BASE_DEC, NULL, 0, "", HFILL }},
     { &hf_lustre_llog_gen_rec_lgr_hdr,
@@ -10921,7 +10937,7 @@ void proto_register_dcerpc_lustre(void)
     { &hf_lustre_lov_desc_ld_qos_maxage,
       { "Ld Qos Maxage", "lustre.lov_desc.ld_qos_maxage", FT_UINT32, BASE_DEC, NULL, 0, "", HFILL }},
     { &hf_lustre_ldlm_resource_desc_lr_type,
-      { "Lr Type", "lustre.ldlm_resource_desc.lr_type", FT_UINT16, BASE_DEC, VALS(lustre_ldlm_type_t_vals), 0, "", HFILL }},
+      { "Lr Type", "lustre.ldlm_resource_desc.lr_type", FT_UINT16, BASE_DEC, VALS(lustre_ldlm_type_vals), 0, "", HFILL }},
     { &hf_lustre_llog_setattr_rec_lsr_tail,
       { "Lsr Tail", "lustre.llog_setattr_rec.lsr_tail", FT_NONE,
                    BASE_NONE, NULL, 0, "", HFILL } },
@@ -11111,6 +11127,7 @@ void proto_register_dcerpc_lustre(void)
     &ett_lustre_mdt_ioepoch,
     &ett_lustre_capa,
     &ett_lustre_acl,
+    &ett_lustre_ladvise,
        };
 
   proto_lustre = proto_register_protocol("Lustre", "lustre", "lustre");
@@ -11125,26 +11142,26 @@ void proto_reg_handoff_lustre(void)
   lustre_handle=create_dissector_handle(dissect_lustre, proto_lustre);
   /* we use Lustre only if we get ptl_index = One of this code (we have removed the bulk code) */
   /* in LNET we test if the message is a put or not before adding an lnet.ptl_index value */
-  dissector_add("lnet.ptl_index", MDC_REPLY_PORTAL          , lustre_handle);
-  dissector_add("lnet.ptl_index", CONNMGR_REQUEST_PORTAL    , lustre_handle);
-  dissector_add("lnet.ptl_index", CONNMGR_REPLY_PORTAL      , lustre_handle);
-  dissector_add("lnet.ptl_index", OSC_REPLY_PORTAL          , lustre_handle);
-  dissector_add("lnet.ptl_index", OST_IO_PORTAL             , lustre_handle);
-  dissector_add("lnet.ptl_index", OST_CREATE_PORTAL         , lustre_handle);
-  dissector_add("lnet.ptl_index", MDC_REPLY_PORTAL          , lustre_handle);
-  dissector_add("lnet.ptl_index", MDS_REQUEST_PORTAL        , lustre_handle);
-  dissector_add("lnet.ptl_index", LDLM_CB_REQUEST_PORTAL    , lustre_handle);
-  dissector_add("lnet.ptl_index", LDLM_CB_REPLY_PORTAL      , lustre_handle);
-  dissector_add("lnet.ptl_index", LDLM_CANCEL_REQUEST_PORTAL, lustre_handle);
-  dissector_add("lnet.ptl_index", LDLM_CANCEL_REPLY_PORTAL  , lustre_handle);
-  dissector_add("lnet.ptl_index", MDS_SETATTR_PORTAL        , lustre_handle);
-  dissector_add("lnet.ptl_index", MDS_READPAGE_PORTAL       , lustre_handle);
-  dissector_add("lnet.ptl_index", MGC_REPLY_PORTAL          , lustre_handle);
-  dissector_add("lnet.ptl_index", MGS_REQUEST_PORTAL        , lustre_handle);
-  dissector_add("lnet.ptl_index", MGS_REPLY_PORTAL          , lustre_handle);
-  dissector_add("lnet.ptl_index", OST_REQUEST_PORTAL        , lustre_handle);
-  dissector_add("lnet.ptl_index", FLD_REQUEST_PORTAL, lustre_handle);
-  dissector_add("lnet.ptl_index", SEQ_METADATA_PORTAL, lustre_handle);
-  dissector_add("lnet.ptl_index", SEQ_DATA_PORTAL, lustre_handle);
-  dissector_add("lnet.ptl_index", SEQ_CONTROLLER_PORTAL, lustre_handle);
+  dissector_add_uint("lnet.ptl_index", MDC_REPLY_PORTAL          , lustre_handle);
+  dissector_add_uint("lnet.ptl_index", CONNMGR_REQUEST_PORTAL    , lustre_handle);
+  dissector_add_uint("lnet.ptl_index", CONNMGR_REPLY_PORTAL      , lustre_handle);
+  dissector_add_uint("lnet.ptl_index", OSC_REPLY_PORTAL          , lustre_handle);
+  dissector_add_uint("lnet.ptl_index", OST_IO_PORTAL             , lustre_handle);
+  dissector_add_uint("lnet.ptl_index", OST_CREATE_PORTAL         , lustre_handle);
+  dissector_add_uint("lnet.ptl_index", MDC_REPLY_PORTAL          , lustre_handle);
+  dissector_add_uint("lnet.ptl_index", MDS_REQUEST_PORTAL        , lustre_handle);
+  dissector_add_uint("lnet.ptl_index", LDLM_CB_REQUEST_PORTAL    , lustre_handle);
+  dissector_add_uint("lnet.ptl_index", LDLM_CB_REPLY_PORTAL      , lustre_handle);
+  dissector_add_uint("lnet.ptl_index", LDLM_CANCEL_REQUEST_PORTAL, lustre_handle);
+  dissector_add_uint("lnet.ptl_index", LDLM_CANCEL_REPLY_PORTAL  , lustre_handle);
+  dissector_add_uint("lnet.ptl_index", MDS_SETATTR_PORTAL        , lustre_handle);
+  dissector_add_uint("lnet.ptl_index", MDS_READPAGE_PORTAL       , lustre_handle);
+  dissector_add_uint("lnet.ptl_index", MGC_REPLY_PORTAL          , lustre_handle);
+  dissector_add_uint("lnet.ptl_index", MGS_REQUEST_PORTAL        , lustre_handle);
+  dissector_add_uint("lnet.ptl_index", MGS_REPLY_PORTAL          , lustre_handle);
+  dissector_add_uint("lnet.ptl_index", OST_REQUEST_PORTAL        , lustre_handle);
+  dissector_add_uint("lnet.ptl_index", FLD_REQUEST_PORTAL, lustre_handle);
+  dissector_add_uint("lnet.ptl_index", SEQ_METADATA_PORTAL, lustre_handle);
+  dissector_add_uint("lnet.ptl_index", SEQ_DATA_PORTAL, lustre_handle);
+  dissector_add_uint("lnet.ptl_index", SEQ_CONTROLLER_PORTAL, lustre_handle);
 }