From Ronald Henderson: make "format_text()", on Windows, escape all
[obnox/wireshark/wip.git] / packet-nfs.c
index d42a7e61debd8c178130b8ca5000e3f2cf3f5fe6..7fc755d27dd2fcf221389d1ee310e13fc4880e5a 100644 (file)
@@ -1,9 +1,8 @@
 /* packet-nfs.c
  * Routines for nfs dissection
  * Copyright 1999, Uwe Girlich <Uwe.Girlich@philosys.de>
- * Copyright 2000-2001, Mike Frisch <frisch@hummingbird.com> (NFSv4 decoding)
- *
- * $Id: packet-nfs.c,v 1.62 2002/01/14 12:22:58 girlich Exp $
+ * Copyright 2000-2002, Mike Frisch <frisch@hummingbird.com> (NFSv4 decoding)
+ * $Id: packet-nfs.c,v 1.84 2002/12/02 23:43:28 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
 #endif
 
 
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-
 #include <string.h>
 
 
@@ -45,6 +40,9 @@
 
 static int proto_nfs = -1;
 
+static int hf_nfs_procedure_v2 = -1;
+static int hf_nfs_procedure_v3 = -1;
+static int hf_nfs_procedure_v4 = -1;
 static int hf_nfs_fh_length = -1;
 static int hf_nfs_fh_hash = -1;
 static int hf_nfs_fh_fsid_major = -1;
@@ -123,7 +121,6 @@ static int hf_nfs_pathconf_no_trunc = -1;
 static int hf_nfs_pathconf_chown_restricted = -1;
 static int hf_nfs_pathconf_case_insensitive = -1;
 static int hf_nfs_pathconf_case_preserving = -1;
-static int hf_nfs_data_follows = -1;
 
 static int hf_nfs_atime = -1;
 static int hf_nfs_atime_sec = -1;
@@ -199,7 +196,6 @@ static int hf_nfs_mand_attr = -1;
 static int hf_nfs_recc_attr = -1;
 static int hf_nfs_time_how4 = -1;
 static int hf_nfs_attrlist4 = -1;
-static int hf_nfs_fattr4_expire_type = -1;
 static int hf_nfs_fattr4_link_support = -1;
 static int hf_nfs_fattr4_symlink_support = -1;
 static int hf_nfs_fattr4_named_attr = -1;
@@ -248,6 +244,8 @@ static int hf_nfs_lock_type4 = -1;
 static int hf_nfs_reclaim4 = -1;
 static int hf_nfs_length4 = -1;
 static int hf_nfs_changeid4 = -1;
+static int hf_nfs_changeid4_before = -1;
+static int hf_nfs_changeid4_after = -1;
 static int hf_nfs_nfstime4_seconds = -1;
 static int hf_nfs_nfstime4_nseconds = -1;
 static int hf_nfs_fsid4_major = -1;
@@ -282,6 +280,10 @@ static int hf_nfs_attrdircreate = -1;
 static int hf_nfs_client_id4_id = -1;
 static int hf_nfs_stateid4_other = -1;
 static int hf_nfs_lock4_reclaim = -1;
+static int hf_nfs_acl4 = -1;
+static int hf_nfs_callback_ident = -1;
+static int hf_nfs_r_netid = -1;
+static int hf_nfs_r_addr = -1;
 
 static gint ett_nfs = -1;
 static gint ett_nfs_fh_encoding = -1;
@@ -380,13 +382,118 @@ static gint ett_nfs_fs_location4 = -1;
 static gint ett_nfs_open4_result_flags = -1;
 static gint ett_nfs_secinfo4_flavor_info = -1;
 static gint ett_nfs_stateid4 = -1;
+static gint ett_nfs_fattr4_fh_expire_type = -1;
+static gint ett_nfs_ace4 = -1;
+static gint ett_nfs_clientaddr4 = -1;
+static gint ett_nfs_aceflag4 = -1;
+static gint ett_nfs_acemask4 = -1;
+
+
+/* fhandle displayfilters to match also corresponding request/response
+   packet in addition to the one containing the actual filehandle */
+gboolean nfs_fhandle_reqrep_matching = FALSE;
+static GMemChunk *nfs_fhandle_data_chunk = NULL;
+static int nfs_fhandle_data_init_count = 100;
+static GHashTable *nfs_fhandle_data_table = NULL;
+GHashTable *nfs_fhandle_frame_table = NULL;
+
+static gint
+nfs_fhandle_data_equal(gconstpointer k1, gconstpointer k2)
+{
+       const nfs_fhandle_data_t *key1 = (const nfs_fhandle_data_t *)k1;
+       const nfs_fhandle_data_t *key2 = (const nfs_fhandle_data_t *)k2;
+
+       return (key1->len==key2->len)
+            &&(!memcmp(key1->fh, key2->fh, key1->len));
+}
+static guint
+nfs_fhandle_data_hash(gconstpointer k)
+{
+       const nfs_fhandle_data_t *key = (const nfs_fhandle_data_t *)k;
+       int i;
+       int hash;
+
+       hash=0;
+       for(i=0;i<key->len;i++)
+               hash ^= key->fh[i];
+
+       return hash;
+}
+static gboolean
+nfs_fhandle_data_free_all(gpointer key_arg _U_, gpointer value, gpointer user_data _U_)
+{
+       nfs_fhandle_data_t *nns = (nfs_fhandle_data_t *)value;
+
+       if(nns->fh){
+               tvb_free(nns->tvb);
+               nns->tvb=NULL;
+               g_free((gpointer)nns->fh);
+               nns->fh=NULL;
+               nns->len=0;
+       }
+
+       return TRUE;
+}
+static gint
+nfs_fhandle_frame_equal(gconstpointer k1, gconstpointer k2)
+{
+       guint32 key1 = (guint32)k1;
+       guint32 key2 = (guint32)k2;
+
+       return key1==key2;
+}
+static guint
+nfs_fhandle_frame_hash(gconstpointer k)
+{
+       guint32 key = (guint32)k;
+
+       return key;
+}
+static gboolean
+nfs_fhandle_frame_free_all(gpointer key_arg _U_, gpointer value _U_, gpointer user_data _U_)
+{
+       return TRUE;
+}
+static void
+nfs_fhandle_reqrep_matching_init(void)
+{
+       if (nfs_fhandle_frame_table != NULL) {
+               g_hash_table_foreach_remove(nfs_fhandle_frame_table,
+                               nfs_fhandle_frame_free_all, NULL);
+       } else {
+               nfs_fhandle_frame_table=g_hash_table_new(nfs_fhandle_frame_hash,
+                       nfs_fhandle_frame_equal);
+       }
+
+
+       if (nfs_fhandle_data_table != NULL) {
+               g_hash_table_foreach_remove(nfs_fhandle_data_table,
+                               nfs_fhandle_data_free_all, NULL);
+       } else {
+               nfs_fhandle_data_table=g_hash_table_new(nfs_fhandle_data_hash,
+                       nfs_fhandle_data_equal);
+       }
+
+       if(nfs_fhandle_data_chunk){
+               g_mem_chunk_destroy(nfs_fhandle_data_chunk);
+               nfs_fhandle_data_chunk = NULL;
+       }
+
+       if(nfs_fhandle_reqrep_matching){
+               nfs_fhandle_data_chunk = g_mem_chunk_new("nfs_fhandle_data_chunk",
+                       sizeof(nfs_fhandle_data_t),
+                       nfs_fhandle_data_init_count * sizeof(nfs_fhandle_data_t),
+                       G_ALLOC_ONLY);
+       }
+
+}
 
 
 /* file name snooping */
 gboolean nfs_file_name_snooping = FALSE;
 gboolean nfs_file_name_full_snooping = FALSE;
 typedef struct nfs_name_snoop {
-       int fh_len;
+       int fh_length;
        unsigned char *fh;
        int name_len;
        unsigned char *name;
@@ -398,8 +505,8 @@ typedef struct nfs_name_snoop {
 
 typedef struct nfs_name_snoop_key {
        int key;
-       int fh_len;
-       unsigned char *fh;
+       int fh_length;
+       const unsigned char *fh;
 } nfs_name_snoop_key_t;
 
 static GMemChunk *nfs_name_snoop_chunk = NULL;
@@ -415,22 +522,22 @@ static GHashTable *nfs_name_snoop_known = NULL;
 static gint
 nfs_name_snoop_matched_equal(gconstpointer k1, gconstpointer k2)
 {
-       nfs_name_snoop_key_t *key1 = (nfs_name_snoop_key_t *)k1;
-       nfs_name_snoop_key_t *key2 = (nfs_name_snoop_key_t *)k2;
+       const nfs_name_snoop_key_t *key1 = (const nfs_name_snoop_key_t *)k1;
+       const nfs_name_snoop_key_t *key2 = (const nfs_name_snoop_key_t *)k2;
 
        return (key1->key==key2->key)
-            &&(key1->fh_len==key2->fh_len)
-            &&(!memcmp(key1->fh, key2->fh, key1->fh_len));
+            &&(key1->fh_length==key2->fh_length)
+            &&(!memcmp(key1->fh, key2->fh, key1->fh_length));
 }
 static guint
 nfs_name_snoop_matched_hash(gconstpointer k)
 {
-       nfs_name_snoop_key_t *key = (nfs_name_snoop_key_t *)k;
+       const nfs_name_snoop_key_t *key = (const nfs_name_snoop_key_t *)k;
        int i;
-       int hash;
+       guint hash;
 
        hash=key->key;
-       for(i=0;i<key->fh_len;i++)
+       for(i=0;i<key->fh_length;i++)
                hash ^= key->fh[i];
 
        return hash;
@@ -451,7 +558,7 @@ nfs_name_snoop_unmatched_hash(gconstpointer k)
        return key;
 }
 static gboolean
-nfs_name_snoop_unmatched_free_all(gpointer key_arg, gpointer value, gpointer user_data)
+nfs_name_snoop_unmatched_free_all(gpointer key_arg _U_, gpointer value, gpointer user_data _U_)
 {
        nfs_name_snoop_t *nns = (nfs_name_snoop_t *)value;
 
@@ -473,7 +580,7 @@ nfs_name_snoop_unmatched_free_all(gpointer key_arg, gpointer value, gpointer use
        if(nns->fh){
                g_free((gpointer)nns->fh);
                nns->fh=NULL;
-               nns->fh_len=0;
+               nns->fh_length=0;
        }
        return TRUE;
 }
@@ -525,18 +632,18 @@ nfs_name_snoop_init(void)
                        nfs_name_snoop_key_init_count * sizeof(nfs_name_snoop_key_t),
                        G_ALLOC_ONLY);
        }
-               
+
 }
 
 void
 nfs_name_snoop_add_name(int xid, tvbuff_t *tvb, int name_offset, int name_len, int parent_offset, int parent_len, unsigned char *name)
 {
        nfs_name_snoop_t *nns, *old_nns;
-       unsigned char *ptr=NULL;
+       const unsigned char *ptr=NULL;
 
        /* filter out all '.' and '..' names */
        if(!name){
-               ptr=(unsigned char *)tvb_get_ptr(tvb, name_offset, name_len);
+               ptr=(const unsigned char *)tvb_get_ptr(tvb, name_offset, name_len);
                if(ptr[0]=='.'){
                        if(ptr[1]==0){
                                return;
@@ -551,7 +658,7 @@ nfs_name_snoop_add_name(int xid, tvbuff_t *tvb, int name_offset, int name_len, i
 
        nns=g_mem_chunk_alloc(nfs_name_snoop_chunk);
 
-       nns->fh_len=0;
+       nns->fh_length=0;
        nns->fh=NULL;
 
        if(parent_len){
@@ -578,7 +685,7 @@ nfs_name_snoop_add_name(int xid, tvbuff_t *tvb, int name_offset, int name_len, i
        /* remove any old entry for this */
        old_nns=g_hash_table_lookup(nfs_name_snoop_unmatched, (gconstpointer)xid);
        if(old_nns){
-               /* if we havnt seen the reply yet, then there are no
+               /* if we haven't seen the reply yet, then there are no
                   matched entries for it, thus we can dealloc the arrays*/
                if(!old_nns->fh){
                        g_free(old_nns->name);
@@ -598,8 +705,9 @@ nfs_name_snoop_add_name(int xid, tvbuff_t *tvb, int name_offset, int name_len, i
 }
 
 static void
-nfs_name_snoop_add_fh(int xid, tvbuff_t *tvb, int fh_offset, int fh_len)
+nfs_name_snoop_add_fh(int xid, tvbuff_t *tvb, int fh_offset, int fh_length)
 {
+       unsigned char *fh;
        nfs_name_snoop_t *nns, *old_nns;
        nfs_name_snoop_key_t *key;
 
@@ -616,13 +724,14 @@ nfs_name_snoop_add_fh(int xid, tvbuff_t *tvb, int fh_offset, int fh_len)
        }
 
        /* oki, we have a new entry */
-       nns->fh=g_malloc(fh_len);
-       memcpy(nns->fh, tvb_get_ptr(tvb, fh_offset, fh_len), fh_len);
-       nns->fh_len=fh_len;
-       
+       fh=g_malloc(fh_length);
+       memcpy(fh, tvb_get_ptr(tvb, fh_offset, fh_length), fh_length);
+       nns->fh=fh;
+       nns->fh_length=fh_length;
+
        key=g_mem_chunk_alloc(nfs_name_snoop_key_chunk);
        key->key=0;
-       key->fh_len=nns->fh_len;
+       key->fh_length=nns->fh_length;
        key->fh    =nns->fh;
 
        /* already have something matched for this fh, remove it from
@@ -660,7 +769,7 @@ nfs_full_name_snoop(nfs_name_snoop_t *nns, int *len, unsigned char **name, unsig
        }
 
        key.key=0;
-       key.fh_len=nns->parent_len;
+       key.fh_length=nns->parent_len;
        key.fh=nns->parent;
 
        parent_nns=g_hash_table_lookup(nfs_name_snoop_matched, &key);
@@ -684,7 +793,7 @@ nfs_full_name_snoop(nfs_name_snoop_t *nns, int *len, unsigned char **name, unsig
 }
 
 static void
-nfs_name_snoop_fh(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int fh_offset, int fh_len)
+nfs_name_snoop_fh(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int fh_offset, int fh_length, gboolean hidden)
 {
        nfs_name_snoop_key_t key;
        nfs_name_snoop_t *nns = NULL;
@@ -692,15 +801,15 @@ nfs_name_snoop_fh(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int fh_of
        /* if this is a new packet, see if we can register the mapping */
        if(!pinfo->fd->flags.visited){
                key.key=0;
-               key.fh_len=fh_len;
-               key.fh=(unsigned char *)tvb_get_ptr(tvb, fh_offset, fh_len);
+               key.fh_length=fh_length;
+               key.fh=(const unsigned char *)tvb_get_ptr(tvb, fh_offset, fh_length);
 
                nns=g_hash_table_lookup(nfs_name_snoop_matched, &key);
                if(nns){
                        nfs_name_snoop_key_t *k;
                        k=g_mem_chunk_alloc(nfs_name_snoop_key_chunk);
                        k->key=pinfo->fd->num;
-                       k->fh_len=nns->fh_len;
+                       k->fh_length=nns->fh_length;
                        k->fh=nns->fh;
                        g_hash_table_insert(nfs_name_snoop_known, k, nns);
 
@@ -720,19 +829,29 @@ nfs_name_snoop_fh(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int fh_of
        /* see if we know this mapping */
        if(!nns){
                key.key=pinfo->fd->num;
-               key.fh_len=fh_len;
-               key.fh=(unsigned char *)tvb_get_ptr(tvb, fh_offset, fh_len);
+               key.fh_length=fh_length;
+               key.fh=(const unsigned char *)tvb_get_ptr(tvb, fh_offset, fh_length);
 
                nns=g_hash_table_lookup(nfs_name_snoop_known, &key);
        }
 
        /* if we know the mapping, print the filename */
        if(nns){
-               proto_tree_add_string_format(tree, hf_nfs_name, tvb, 
-                       fh_offset, 0, nns->name, "Name: %s", nns->name);
+               if(hidden){
+                       proto_tree_add_string_hidden(tree, hf_nfs_name, tvb,
+                               fh_offset, 0, nns->name);
+               }else {
+                       proto_tree_add_string_format(tree, hf_nfs_name, tvb,
+                               fh_offset, 0, nns->name, "Name: %s", nns->name);
+               }
                if(nns->full_name){
-                       proto_tree_add_string_format(tree, hf_nfs_full_name, tvb, 
-                               fh_offset, 0, nns->name, "Full Name: %s", nns->full_name);
+                       if(hidden){
+                               proto_tree_add_string_hidden(tree, hf_nfs_full_name, tvb,
+                                       fh_offset, 0, nns->name);
+                       } else {
+                               proto_tree_add_string_format(tree, hf_nfs_full_name, tvb,
+                                       fh_offset, 0, nns->name, "Full Name: %s", nns->full_name);
+                       }
                }
        }
 }
@@ -760,7 +879,7 @@ static const value_string names_fhtype[] =
 
 static void
 dissect_fhandle_data_SVR4(tvbuff_t* tvb, int offset, proto_tree *tree,
-    int fhlen)
+    int fhlen _U_)
 {
        guint32 nof = offset;
 
@@ -780,12 +899,12 @@ dissect_fhandle_data_SVR4(tvbuff_t* tvb, int offset, proto_tree *tree,
        if (tree) {
                proto_item* fsid_item = NULL;
                proto_tree* fsid_tree = NULL;
-       
+
                fsid_item = proto_tree_add_text(tree, tvb,
-                       fsid_O, fsid_L, 
+                       fsid_O, fsid_L,
                        "file system ID: %d,%d", fsid_major, fsid_minor);
                if (fsid_item) {
-                       fsid_tree = proto_item_add_subtree(fsid_item, 
+                       fsid_tree = proto_item_add_subtree(fsid_item,
                                        ett_nfs_fh_fsid);
                        proto_tree_add_uint(fsid_tree, hf_nfs_fh_fsid_major,
                                tvb, fsid_O,   2, fsid_major);
@@ -826,7 +945,7 @@ dissect_fhandle_data_SVR4(tvbuff_t* tvb, int offset, proto_tree *tree,
        guint32 fn_data_gen_L;
        guint32 gen;
        guint32 fn_L;
-       
+
        fn_O = nof;
        fn_len_O = fn_O;
        fn_len_L = 2;
@@ -842,11 +961,11 @@ dissect_fhandle_data_SVR4(tvbuff_t* tvb, int offset, proto_tree *tree,
        if (tree) {
                proto_item* fn_item = NULL;
                proto_tree* fn_tree = NULL;
-       
+
                fn_item = proto_tree_add_uint(tree, hf_nfs_fh_fn, tvb,
                        fn_O, fn_L, inode);
                if (fn_item) {
-                       fn_tree = proto_item_add_subtree(fn_item, 
+                       fn_tree = proto_item_add_subtree(fn_item,
                                        ett_nfs_fh_fn);
                        proto_tree_add_uint(fn_tree, hf_nfs_fh_fn_len,
                                tvb, fn_len_O, fn_len_L, fn_len);
@@ -873,7 +992,7 @@ dissect_fhandle_data_SVR4(tvbuff_t* tvb, int offset, proto_tree *tree,
        guint32 xfn_data_gen_L;
        guint32 xgen;
        guint32 xfn_L;
-       
+
        xfn_O = nof;
        xfn_len_O = xfn_O;
        xfn_len_L = 2;
@@ -889,11 +1008,11 @@ dissect_fhandle_data_SVR4(tvbuff_t* tvb, int offset, proto_tree *tree,
        if (tree) {
                proto_item* xfn_item = NULL;
                proto_tree* xfn_tree = NULL;
-       
+
                xfn_item = proto_tree_add_uint(tree, hf_nfs_fh_xfn, tvb,
                        xfn_O, xfn_L, xinode);
                if (xfn_item) {
-                       xfn_tree = proto_item_add_subtree(xfn_item, 
+                       xfn_tree = proto_item_add_subtree(xfn_item,
                                        ett_nfs_fh_xfn);
                        proto_tree_add_uint(xfn_tree, hf_nfs_fh_xfn_len,
                                tvb, xfn_len_O, xfn_len_L, xfn_len);
@@ -911,7 +1030,7 @@ dissect_fhandle_data_SVR4(tvbuff_t* tvb, int offset, proto_tree *tree,
 
 static void
 dissect_fhandle_data_LINUX_KNFSD_LE(tvbuff_t* tvb, int offset, proto_tree *tree,
-    int fhlen)
+    int fhlen _U_)
 {
        guint32 dentry;
        guint32 inode;
@@ -950,10 +1069,10 @@ dissect_fhandle_data_LINUX_KNFSD_LE(tvbuff_t* tvb, int offset, proto_tree *tree,
                proto_tree* fsid_tree = NULL;
 
                fsid_item = proto_tree_add_text(tree, tvb,
-                       offset+12, 4, 
+                       offset+12, 4,
                        "file system ID: %d,%d", fsid_major, fsid_minor);
                if (fsid_item) {
-                       fsid_tree = proto_item_add_subtree(fsid_item, 
+                       fsid_tree = proto_item_add_subtree(fsid_item,
                                        ett_nfs_fh_fsid);
                        proto_tree_add_uint(fsid_tree, hf_nfs_fh_fsid_major,
                                tvb, offset+13, 1, fsid_major);
@@ -968,10 +1087,10 @@ dissect_fhandle_data_LINUX_KNFSD_LE(tvbuff_t* tvb, int offset, proto_tree *tree,
                proto_tree* xfsid_tree = NULL;
 
                xfsid_item = proto_tree_add_text(tree, tvb,
-                       offset+16, 4, 
+                       offset+16, 4,
                        "exported file system ID: %d,%d", xfsid_major, xfsid_minor);
                if (xfsid_item) {
-                       xfsid_tree = proto_item_add_subtree(xfsid_item, 
+                       xfsid_tree = proto_item_add_subtree(xfsid_item,
                                        ett_nfs_fh_xfsid);
                        proto_tree_add_uint(xfsid_tree, hf_nfs_fh_xfsid_major,
                                tvb, offset+17, 1, xfsid_major);
@@ -990,9 +1109,9 @@ dissect_fhandle_data_LINUX_KNFSD_LE(tvbuff_t* tvb, int offset, proto_tree *tree,
 
 /* Checked with RedHat Linux 5.2 (nfs-server 2.2beta47 user-land nfsd) */
 
-void
+static void
 dissect_fhandle_data_LINUX_NFSD_LE(tvbuff_t* tvb, int offset, proto_tree *tree,
-    int fhlen)
+    int fhlen _U_)
 {
        /* pseudo inode */
        {
@@ -1018,7 +1137,7 @@ dissect_fhandle_data_LINUX_NFSD_LE(tvbuff_t* tvb, int offset, proto_tree *tree,
                                "hash path: %s",
                                tvb_bytes_to_str(tvb,offset+5,hashlen));
                if (hash_item) {
-                       hash_tree = proto_item_add_subtree(hash_item, 
+                       hash_tree = proto_item_add_subtree(hash_item,
                                        ett_nfs_fh_hp);
                        if (hash_tree) {
                                proto_tree_add_uint(hash_tree,
@@ -1062,7 +1181,7 @@ static const value_string fileid_type_names[] = {
 
 static void
 dissect_fhandle_data_LINUX_KNFSD_NEW(tvbuff_t* tvb, int offset, proto_tree *tree,
-    int fhlen)
+    int fhlen _U_)
 {
        guint8 version;
        guint8 auth_type;
@@ -1105,7 +1224,7 @@ dissect_fhandle_data_LINUX_KNFSD_NEW(tvbuff_t* tvb, int offset, proto_tree *tree
                        goto out;
                }
        }
-               
+
        switch (auth_type) {
                case 0: {
                        /* no authentication */
@@ -1132,11 +1251,11 @@ dissect_fhandle_data_LINUX_KNFSD_NEW(tvbuff_t* tvb, int offset, proto_tree *tree
                        fsid_inode = tvb_get_letohl(tvb, offset + 4);
                        if (tree) {
                                proto_item* fsid_item = proto_tree_add_text(tree, tvb,
-                                       offset+0, 8, 
+                                       offset+0, 8,
                                        "file system ID: %u,%u (inode %u)",
                                        fsid_major, fsid_minor, fsid_inode);
                                if (fsid_item) {
-                                       proto_tree* fsid_tree = proto_item_add_subtree(fsid_item, 
+                                       proto_tree* fsid_tree = proto_item_add_subtree(fsid_item,
                                                ett_nfs_fh_fsid);
                                        if (fsid_tree) {
                                                proto_tree_add_uint(fsid_tree, hf_nfs_fh_fsid_major,
@@ -1259,63 +1378,96 @@ dissect_fhandle_data_unknown(tvbuff_t *tvb, int offset, proto_tree *tree,
 
 static void
 dissect_fhandle_data(tvbuff_t *tvb, int offset, packet_info *pinfo,
-    proto_tree *tree, unsigned int fhlen)
+    proto_tree *tree, unsigned int fhlen, gboolean hidden)
 {
        unsigned int fhtype = FHT_UNKNOWN;
 
-       if(nfs_file_name_snooping){
-               if(!pinfo->fd->flags.visited){
-                       rpc_call_info_value *civ=pinfo->private_data;
-
-                       /* MOUNT v1,v2 MNT replies might give us a filehandle*/
-                       if( (civ->prog==100005)
-                         &&(civ->proc==1)
-                         &&((civ->vers==1)||(civ->vers==2))
-                         &&(!civ->request)
-                       ) {
-                               nfs_name_snoop_add_fh(civ->xid, tvb, 
-                                       offset, fhlen);
-                       }
-               }
-
-               nfs_name_snoop_fh(pinfo, tree, tvb, offset, fhlen);
-       }
-
        /* filehandle too long */
        if (fhlen>64) goto type_ready;
        /* Not all bytes there. Any attempt to deduce the type would be
           senseless. */
        if (!tvb_bytes_exist(tvb,offset,fhlen)) goto type_ready;
 
+       /* this is to set up fhandle display filters to find both packets
+          of an RPC call */
+       if(nfs_fhandle_reqrep_matching && (!hidden) ){
+               nfs_fhandle_data_t *old_fhd=NULL;
+               unsigned char *fh;
+
+               if( !pinfo->fd->flags.visited ){
+                       nfs_fhandle_data_t fhd;
+
+                       /* first check if we have seen this fhandle before */
+                       fhd.len=fhlen;
+                       fhd.fh=(const unsigned char *)tvb_get_ptr(tvb, offset, fhlen);
+                       old_fhd=g_hash_table_lookup(nfs_fhandle_data_table,
+                               (gconstpointer)&fhd);
+                       if(!old_fhd){
+                               /* oh, a new fhandle, alloc struct and store it in the table*/
+                               old_fhd=g_mem_chunk_alloc(nfs_fhandle_data_chunk);
+                               old_fhd->len=fhlen;
+                               fh=g_malloc(fhlen);
+                               memcpy(fh, fhd.fh, fhlen);
+                               old_fhd->fh=fh;
+                               old_fhd->tvb=tvb_new_real_data(old_fhd->fh, old_fhd->len, old_fhd->len);
+                               g_hash_table_insert(nfs_fhandle_data_table,
+                                       (gpointer)old_fhd, (gpointer)old_fhd);
+                       }
+
+                       /* XXX here we should really check that we havent stored
+                          this fhandle for this frame number already.
+                          We should also make sure we can handle when we have multiple
+                          fhandles seen for the same frame, which WILL happen for certain
+                          nfs calls. For now, we dont handle this and those calls will
+                          not work properly with this feature
+                       */
+                       g_hash_table_insert(nfs_fhandle_frame_table,
+                                       (gpointer)pinfo->fd->num,
+                                       (gpointer)old_fhd);
+               }
+       }
+
        /* create a semiunique hash value for the filehandle */
        {
                guint32 fhhash;
                guint32 i;
 
                for(fhhash=0,i=0;i<(fhlen-3);i+=4){
-                       fhhash ^= tvb_get_ntohl(tvb, offset+i);
+                       guint32 val;
+                       val = tvb_get_ntohl(tvb, offset+i);
+                       fhhash ^= val;
+                       fhhash += val;
                }
-               proto_tree_add_uint(tree, hf_nfs_fh_hash, tvb, offset, fhlen,
-                       fhhash);
+               if(hidden){
+                       proto_tree_add_uint_hidden(tree, hf_nfs_fh_hash, tvb, offset,
+                               fhlen, fhhash);
+               } else {
+                       proto_tree_add_uint(tree, hf_nfs_fh_hash, tvb, offset,
+                               fhlen, fhhash);
+               }
+       }
+       if(nfs_file_name_snooping){
+               nfs_name_snoop_fh(pinfo, tree, tvb, offset, fhlen, hidden);
        }
-               
-       /* calculate (heuristically) fhtype */
-       switch (fhlen) {
-               case 12: {
+
+       if(!hidden){
+               /* calculate (heuristically) fhtype */
+               switch (fhlen) {
+               case 12:
                        if (tvb_get_ntohl(tvb,offset) == 0x01000000) {
-                               fhtype=FHT_LINUX_KNFSD_NEW;
-                       }
-               } break;
-               case 20: {
+                                       fhtype=FHT_LINUX_KNFSD_NEW;
+                               }
+                       break;
+               case 20:
                        if (tvb_get_ntohl(tvb,offset) == 0x01000001) {
                                fhtype=FHT_LINUX_KNFSD_NEW;
                        }
-               } break;
-               case 24: {
+                       break;
+               case 24:
                        if (tvb_get_ntohl(tvb,offset) == 0x01000002) {
                                fhtype=FHT_LINUX_KNFSD_NEW;
                        }
-               } break;
+                       break;
                case 32: {
                        guint32 len1;
                        guint32 len2;
@@ -1335,7 +1487,7 @@ dissect_fhandle_data(tvbuff_t *tvb, int offset, packet_info *pinfo,
                                int wrong=0;
                                for (len2=5+len1;len2<32;len2++) {
                                        if (tvb_get_guint8(tvb,offset+len2)) {
-                                               wrong=1;        
+                                               wrong=1;
                                                break;
                                        }
                                }
@@ -1352,15 +1504,18 @@ dissect_fhandle_data(tvbuff_t *tvb, int offset, packet_info *pinfo,
                                        }
                                }
                        }
-               } break;
+                       } break;
+               }
        }
 
 type_ready:
 
-       proto_tree_add_text(tree, tvb, offset, 0, 
-               "type: %s", val_to_str(fhtype, names_fhtype, "Unknown"));
+       if(!hidden){
+               proto_tree_add_text(tree, tvb, offset, 0,
+                       "type: %s", val_to_str(fhtype, names_fhtype, "Unknown"));
+
 
-       switch (fhtype) {
+               switch (fhtype) {
                case FHT_SVR4:
                        dissect_fhandle_data_SVR4          (tvb, offset, tree,
                            fhlen);
@@ -1381,6 +1536,15 @@ type_ready:
                default:
                        dissect_fhandle_data_unknown(tvb, offset, tree, fhlen);
                break;
+               }
+       }
+}
+
+void
+dissect_fhandle_hidden(packet_info *pinfo, proto_tree *tree, nfs_fhandle_data_t *nfd)
+{
+       if(nfd && nfd->len){
+               dissect_fhandle_data(nfd->tvb, 0, pinfo, tree, nfd->len, TRUE);
        }
 }
 
@@ -1391,7 +1555,7 @@ type_ready:
 
 
 /* RFC 1094, Page 12..14 */
-const value_string names_nfs_stat[] =
+static const value_string names_nfs_stat[] =
 {
        {       0,      "OK" },
        {       1,      "ERR_PERM" },
@@ -1420,63 +1584,65 @@ const value_string names_nfs_stat[] =
 };
 
 /* NFSv4 Draft Specification, Page 198-199 */
-const value_string names_nfs_stat4[] = {
-       {       0,                      "NFS4_OK"                                                       },
-       {       1,                      "NFS4ERR_PERM"                                          },
-       {       2,                      "NFS4ERR_NOENT"                                 },
-       {       5,                      "NFS4ERR_IO"                                            },
-       {       6,                      "NFS4ERR_NXIO"                                          },
-       {       13,             "NFS4ERR_ACCES"                                 },
-       {       17,             "NFS4ERR_EXIST"                                 },
-       {       18,             "NFS4ERR_XDEV"                                          },
-       {       19,             "NFS4ERR_NODEV"                                 },
-       {       20,             "NFS4ERR_NOTDIR"                                        },
-       {       21,             "NFS4ERR_ISDIR"                                 },
-       {       22,             "NFS4ERR_INVAL"                                 },
-       {       27,             "NFS4ERR_FBIG"                                          },
-       {       28,             "NFS4ERR_NOSPC"                                 },
-       {       30,             "NFS4ERR_ROFS"                                          },
-       {       31,             "NFS4ERR_MLINK"                                 },
-       {       63,             "NFS4ERR_NAMETOOLONG"                   },
-       {       66,             "NFS4ERR_NOTEMPTY"                              },
-       {       69,             "NFS4ERR_DQUOT"                                 },
-       {       70,             "NFS4ERR_STALE"                                 },
+static const value_string names_nfs_stat4[] = {
+       {       0,      "NFS4_OK"                                       },
+       {       1,      "NFS4ERR_PERM"                                  },
+       {       2,      "NFS4ERR_NOENT"                                 },
+       {       5,      "NFS4ERR_IO"                                    },
+       {       6,      "NFS4ERR_NXIO"                                  },
+       {       13,     "NFS4ERR_ACCES"                                 },
+       {       17,     "NFS4ERR_EXIST"                                 },
+       {       18,     "NFS4ERR_XDEV"                                  },
+       {       19,     "NFS4ERR_NODEV"                                 },
+       {       20,     "NFS4ERR_NOTDIR"                                },
+       {       21,     "NFS4ERR_ISDIR"                                 },
+       {       22,     "NFS4ERR_INVAL"                                 },
+       {       27,     "NFS4ERR_FBIG"                                  },
+       {       28,     "NFS4ERR_NOSPC"                                 },
+       {       30,     "NFS4ERR_ROFS"                                  },
+       {       31,     "NFS4ERR_MLINK"                                 },
+       {       63,     "NFS4ERR_NAMETOOLONG"                           },
+       {       66,     "NFS4ERR_NOTEMPTY"                              },
+       {       69,     "NFS4ERR_DQUOT"                                 },
+       {       70,     "NFS4ERR_STALE"                                 },
        {       10001,  "NFS4ERR_BADHANDLE"                             },
        {       10003,  "NFS4ERR_BAD_COOKIE"                            },
-       {       10004,  "NFS4ERR_NOTSUPP"                                       },
+       {       10004,  "NFS4ERR_NOTSUPP"                               },
        {       10005,  "NFS4ERR_TOOSMALL"                              },
-       {       10006,  "NFS4ERR_SERVERFAULT"                   },
-       {       10007,  "NFS4ERR_BADTYPE"                                       },
+       {       10006,  "NFS4ERR_SERVERFAULT"                           },
+       {       10007,  "NFS4ERR_BADTYPE"                               },
        {       10008,  "NFS4ERR_DELAY"                                 },
-       {       10009,  "NFS4ERR_SAME"                                          },
-       {       10010,  "NFS4ERR_DENIED"                                        },
-       {       10011,  "NFS4ERR_EXPIRED"                                       },
-       {       10012,  "NFS4ERR_LOCKED"                                        },
+       {       10009,  "NFS4ERR_SAME"                                  },
+       {       10010,  "NFS4ERR_DENIED"                                },
+       {       10011,  "NFS4ERR_EXPIRED"                               },
+       {       10012,  "NFS4ERR_LOCKED"                                },
        {       10013,  "NFS4ERR_GRACE"                                 },
        {       10014,  "NFS4ERR_FHEXPIRED"                             },
-       {       10015,  "NFS4ERR_SHARE_DENIED"                  },
+       {       10015,  "NFS4ERR_SHARE_DENIED"                          },
        {       10016,  "NFS4ERR_WRONGSEC"                              },
        {       10017,  "NFS4ERR_CLID_INUSE"                            },
        {       10018,  "NFS4ERR_RESOURCE"                              },
        {       10019,  "NFS4ERR_MOVED"                                 },
-       {       10020,  "NFS4ERR_NOFILEHANDLE"                  },
-       {       10021,  "NFS4ERR_MINOR_VERS_MISMATCH"   },
-       {       10022,  "NFS4ERR_STALE_CLIENTID"                },
-       {       10023,  "NFS4ERR_STALE_STATEID"                 },
-       {       10024,  "NFS4ERR_OLD_STATEID"                   },
-       {       10025,  "NFS4ERR_BAD_STATEID"                   },
+       {       10020,  "NFS4ERR_NOFILEHANDLE"                          },
+       {       10021,  "NFS4ERR_MINOR_VERS_MISMATCH"                   },
+       {       10022,  "NFS4ERR_STALE_CLIENTID"                        },
+       {       10023,  "NFS4ERR_STALE_STATEID"                         },
+       {       10024,  "NFS4ERR_OLD_STATEID"                           },
+       {       10025,  "NFS4ERR_BAD_STATEID"                           },
        {       10026,  "NFS4ERR_BAD_SEQID"                             },
        {       10027,  "NFS4ERR_NOT_SAME"                              },
        {       10028,  "NFS4ERR_LOCK_RANGE"                            },
-       {       10029,  "NFS4ERR_SYMLINK"                                       },
-       {       10030,  "NFS4ERR_READDIR_NOSPC"                 },
-       {       10031,  "NFS4ERR_LEASE_MOVED"                   },
-       {       10032,  "NFS4ERR_ATTRNOTSUPP"                   },
+       {       10029,  "NFS4ERR_SYMLINK"                               },
+       {       10030,  "NFS4ERR_READDIR_NOSPC"                         },
+       {       10031,  "NFS4ERR_LEASE_MOVED"                           },
+       {       10032,  "NFS4ERR_ATTRNOTSUPP"                           },
        {       10033,  "NFS4ERR_NO_GRACE"                              },
-       {       10034,  "NFS4ERR_RECLAIM_BAD"                   },
-       {       10035,  "NFS4ERR_RECLAIM_CONFLICT"              },
-       {       10036,  "NFS4ERR_BADXDR"                                        },
+       {       10034,  "NFS4ERR_RECLAIM_BAD"                           },
+       {       10035,  "NFS4ERR_RECLAIM_CONFLICT"                      },
+       {       10036,  "NFS4ERR_BADXDR"                                },
        {       10037,  "NFS4ERR_LOCKS_HELD"                            },
+       {       10038,  "NFS4ERR_OPENMODE"      },
+       {       10039,  "NFS4ERR_BADOWNER"      },
        { 0, NULL }
 };
 
@@ -1484,20 +1650,20 @@ const value_string names_nfs_stat4[] = {
 /* This function has been modified to support NFSv4 style error codes as
  * well as being backwards compatible with NFSv2 and NFSv3.
  */
-int
-dissect_stat_internal(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_stat_internal(tvbuff_t *tvb, int offset,
        proto_tree *tree, guint32* status, int nfsvers)
 {
        guint32 stat;
 
        stat = tvb_get_ntohl(tvb, offset+0);
-       
+
        if (tree) {
                /* this gives the right NFSv2 number<->message relation */
                /* and makes it searchable via "nfs.status" */
                proto_tree_add_uint_format(tree, hf_nfs_nfsstat3, tvb,
-                       offset+0, 4, stat, "Status: %s (%u)", 
-                       val_to_str(stat, 
+                       offset+0, 4, stat, "Status: %s (%u)",
+                       val_to_str(stat,
                                (nfsvers != 4)? names_nfs_stat: names_nfs_stat4,"%u"), stat);
        }
 
@@ -1510,38 +1676,37 @@ dissect_stat_internal(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
 
 /* RFC 1094, Page 12..14 */
-int
-dissect_stat(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
+static int
+dissect_stat(tvbuff_t *tvb, int offset, proto_tree *tree,
        guint32 *status)
 {
-       return dissect_stat_internal(tvb, offset, pinfo, tree, status, !4);
+       return dissect_stat_internal(tvb, offset, tree, status, !4);
 }
 
 
 /* RFC 1094, Page 12..14 */
-int
-dissect_nfs2_stat_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree* tree)
+static int
+dissect_nfs2_stat_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree* tree)
 {
        guint32 status;
 
-       offset = dissect_stat(tvb, offset, pinfo, tree, &status);
+       offset = dissect_stat(tvb, offset, tree, &status);
 
        return offset;
 }
 
 
-int
-dissect_nfs_nfsstat4(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_nfs_nfsstat4(tvbuff_t *tvb, int offset,
        proto_tree *tree, guint32 *status)
 {
-       return dissect_stat_internal(tvb, offset, pinfo, tree, status, 4);
+       return dissect_stat_internal(tvb, offset, tree, status, 4);
 }
 
 
 /* RFC 1094, Page 15 */
-int
-dissect_ftype(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
-char* name)
+static int
+dissect_ftype(tvbuff_t *tvb, int offset, proto_tree *tree, char* name)
 {
        guint32 ftype;
        char* ftype_name = NULL;
@@ -1559,7 +1724,7 @@ char* name)
 
        ftype = tvb_get_ntohl(tvb, offset+0);
        ftype_name = val_to_str(ftype, nfs2_ftype, "%u");
-       
+
        if (tree) {
                proto_tree_add_text(tree, tvb, offset, 4,
                        "%s: %s (%u)", name, ftype_name, ftype);
@@ -1595,20 +1760,29 @@ dissect_fhandle(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
                  &&(!civ->request)
                  &&((civ->proc==4)||(civ->proc==9)||(civ->proc==14))
                ) {
-                       nfs_name_snoop_add_fh(civ->xid, tvb, 
+                       nfs_name_snoop_add_fh(civ->xid, tvb,
+                               offset, 32);
+               }
+
+               /* MOUNT v1,v2 MNT replies might give us a filehandle*/
+               if( (civ->prog==100005)
+                 &&(civ->proc==1)
+                 &&((civ->vers==1)||(civ->vers==2))
+                 &&(!civ->request)
+               ) {
+                       nfs_name_snoop_add_fh(civ->xid, tvb,
                                offset, 32);
                }
        }
 
-       if (ftree)
-               dissect_fhandle_data(tvb, offset, pinfo, ftree, FHSIZE);
+       dissect_fhandle_data(tvb, offset, pinfo, ftree, FHSIZE, FALSE);
 
        offset += FHSIZE;
        return offset;
 }
 
 /* RFC 1094, Page 15 */
-int
+static int
 dissect_nfs2_fhandle_call(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
 {
        offset = dissect_fhandle(tvb, offset, pinfo, tree, "object");
@@ -1618,8 +1792,8 @@ dissect_nfs2_fhandle_call(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_t
 
 
 /* RFC 1094, Page 15 */
-int
-dissect_timeval(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_time, int hf_time_sec, int hf_time_usec)
+static int
+dissect_timeval(tvbuff_t *tvb, int offset, proto_tree *tree, int hf_time, int hf_time_sec, int hf_time_usec)
 {
        guint32 seconds;
        guint32 useconds;
@@ -1652,7 +1826,7 @@ dissect_timeval(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
 
 
 /* RFC 1094, Page 16 */
-const value_string nfs2_mode_names[] = {
+static const value_string nfs2_mode_names[] = {
        {       0040000,        "Directory"     },
        {       0020000,        "Character Special Device"      },
        {       0060000,        "Block Special Device"  },
@@ -1662,16 +1836,15 @@ const value_string nfs2_mode_names[] = {
        {       0000000,        NULL            },
 };
 
-int
-dissect_mode(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
-char* name)
+static int
+dissect_mode(tvbuff_t *tvb, int offset, proto_tree *tree, char* name)
 {
        guint32 mode;
        proto_item* mode_item = NULL;
        proto_tree* mode_tree = NULL;
 
        mode = tvb_get_ntohl(tvb, offset+0);
-       
+
        if (tree) {
                mode_item = proto_tree_add_text(tree, tvb, offset, 4,
                        "%s: 0%o", name, mode);
@@ -1715,34 +1888,34 @@ char* name)
 
 
 /* RFC 1094, Page 15 */
-int
-dissect_fattr(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, char* name)
+static int
+dissect_fattr(tvbuff_t *tvb, int offset, proto_tree *tree, char* name)
 {
        proto_item* fattr_item = NULL;
        proto_tree* fattr_tree = NULL;
        int old_offset = offset;
 
        if (tree) {
-               fattr_item = proto_tree_add_text(tree, tvb, offset,
-                       tvb_length_remaining(tvb, offset), "%s", name);
+               fattr_item = proto_tree_add_text(tree, tvb, offset, -1,
+                       "%s", name);
                fattr_tree = proto_item_add_subtree(fattr_item, ett_nfs_fattr);
        }
 
-       offset = dissect_ftype(tvb, offset, pinfo, fattr_tree, "type");
-       offset = dissect_mode(tvb, offset, pinfo, fattr_tree, "mode");
-       offset = dissect_rpc_uint32(tvb, pinfo, fattr_tree, hf_nfs_fattr_nlink, offset);
-       offset = dissect_rpc_uint32(tvb, pinfo, fattr_tree, hf_nfs_fattr_uid, offset);
-       offset = dissect_rpc_uint32(tvb, pinfo, fattr_tree, hf_nfs_fattr_gid, offset);
-       offset = dissect_rpc_uint32(tvb, pinfo, fattr_tree, hf_nfs_fattr_size, offset);
-       offset = dissect_rpc_uint32(tvb, pinfo, fattr_tree, hf_nfs_fattr_blocksize, offset);
-       offset = dissect_rpc_uint32(tvb, pinfo, fattr_tree, hf_nfs_fattr_rdev, offset);
-       offset = dissect_rpc_uint32(tvb, pinfo, fattr_tree, hf_nfs_fattr_blocks, offset);
-       offset = dissect_rpc_uint32(tvb, pinfo, fattr_tree, hf_nfs_fattr_fsid, offset);
-       offset = dissect_rpc_uint32(tvb, pinfo, fattr_tree, hf_nfs_fattr_fileid, offset);
+       offset = dissect_ftype(tvb, offset, fattr_tree, "type");
+       offset = dissect_mode(tvb, offset, fattr_tree, "mode");
+       offset = dissect_rpc_uint32(tvb, fattr_tree, hf_nfs_fattr_nlink, offset);
+       offset = dissect_rpc_uint32(tvb, fattr_tree, hf_nfs_fattr_uid, offset);
+       offset = dissect_rpc_uint32(tvb, fattr_tree, hf_nfs_fattr_gid, offset);
+       offset = dissect_rpc_uint32(tvb, fattr_tree, hf_nfs_fattr_size, offset);
+       offset = dissect_rpc_uint32(tvb, fattr_tree, hf_nfs_fattr_blocksize, offset);
+       offset = dissect_rpc_uint32(tvb, fattr_tree, hf_nfs_fattr_rdev, offset);
+       offset = dissect_rpc_uint32(tvb, fattr_tree, hf_nfs_fattr_blocks, offset);
+       offset = dissect_rpc_uint32(tvb, fattr_tree, hf_nfs_fattr_fsid, offset);
+       offset = dissect_rpc_uint32(tvb, fattr_tree, hf_nfs_fattr_fileid, offset);
 
-       offset = dissect_timeval(tvb, offset, pinfo, fattr_tree, hf_nfs_atime, hf_nfs_atime_sec, hf_nfs_atime_usec);
-       offset = dissect_timeval(tvb, offset, pinfo, fattr_tree, hf_nfs_mtime, hf_nfs_mtime_sec, hf_nfs_mtime_usec);
-       offset = dissect_timeval(tvb, offset, pinfo, fattr_tree, hf_nfs_ctime, hf_nfs_ctime_sec, hf_nfs_ctime_usec);
+       offset = dissect_timeval(tvb, offset, fattr_tree, hf_nfs_atime, hf_nfs_atime_sec, hf_nfs_atime_usec);
+       offset = dissect_timeval(tvb, offset, fattr_tree, hf_nfs_mtime, hf_nfs_mtime_sec, hf_nfs_mtime_usec);
+       offset = dissect_timeval(tvb, offset, fattr_tree, hf_nfs_ctime, hf_nfs_ctime_sec, hf_nfs_ctime_usec);
 
        /* now we know, that fattr is shorter */
        if (fattr_item) {
@@ -1754,28 +1927,28 @@ dissect_fattr(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, c
 
 
 /* RFC 1094, Page 17 */
-int
-dissect_sattr(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, char* name)
+static int
+dissect_sattr(tvbuff_t *tvb, int offset, proto_tree *tree, char* name)
 {
        proto_item* sattr_item = NULL;
        proto_tree* sattr_tree = NULL;
        int old_offset = offset;
 
        if (tree) {
-               sattr_item = proto_tree_add_text(tree, tvb, offset,
-                       tvb_length_remaining(tvb, offset), "%s", name);
+               sattr_item = proto_tree_add_text(tree, tvb, offset, -1,
+                       "%s", name);
                sattr_tree = proto_item_add_subtree(sattr_item, ett_nfs_sattr);
        }
 
        if (tvb_get_ntohl(tvb, offset+0) != 0xffffffff)
-               offset = dissect_mode(tvb, offset, pinfo, sattr_tree, "mode");
+               offset = dissect_mode(tvb, offset, sattr_tree, "mode");
        else {
                proto_tree_add_text(sattr_tree, tvb, offset, 4, "mode: no value");
                offset += 4;
        }
 
        if (tvb_get_ntohl(tvb, offset+0) != 0xffffffff)
-               offset = dissect_rpc_uint32(tvb, pinfo, sattr_tree, hf_nfs_fattr_uid,
+               offset = dissect_rpc_uint32(tvb, sattr_tree, hf_nfs_fattr_uid,
                        offset);
        else {
                proto_tree_add_text(sattr_tree, tvb, offset, 4, "uid: no value");
@@ -1783,7 +1956,7 @@ dissect_sattr(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, c
        }
 
        if (tvb_get_ntohl(tvb, offset+0) != 0xffffffff)
-               offset = dissect_rpc_uint32(tvb, pinfo, sattr_tree, hf_nfs_fattr_gid,
+               offset = dissect_rpc_uint32(tvb, sattr_tree, hf_nfs_fattr_gid,
                        offset);
        else {
                proto_tree_add_text(sattr_tree, tvb, offset, 4, "gid: no value");
@@ -1791,7 +1964,7 @@ dissect_sattr(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, c
        }
 
        if (tvb_get_ntohl(tvb, offset+0) != 0xffffffff)
-               offset = dissect_rpc_uint32(tvb, pinfo, sattr_tree, hf_nfs_fattr_size,
+               offset = dissect_rpc_uint32(tvb, sattr_tree, hf_nfs_fattr_size,
                        offset);
        else {
                proto_tree_add_text(sattr_tree, tvb, offset, 4, "size: no value");
@@ -1799,14 +1972,14 @@ dissect_sattr(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, c
        }
 
        if (tvb_get_ntohl(tvb, offset+0) != 0xffffffff) {
-               offset = dissect_timeval(tvb, offset, pinfo, sattr_tree, hf_nfs_atime, hf_nfs_atime_sec, hf_nfs_atime_usec);
+               offset = dissect_timeval(tvb, offset, sattr_tree, hf_nfs_atime, hf_nfs_atime_sec, hf_nfs_atime_usec);
        } else {
                proto_tree_add_text(sattr_tree, tvb, offset, 8, "atime: no value");
                offset += 8;
        }
 
        if (tvb_get_ntohl(tvb, offset+0) != 0xffffffff) {
-               offset = dissect_timeval(tvb, offset, pinfo, sattr_tree, hf_nfs_mtime, hf_nfs_mtime_sec, hf_nfs_mtime_usec);
+               offset = dissect_timeval(tvb, offset, sattr_tree, hf_nfs_mtime, hf_nfs_mtime_sec, hf_nfs_mtime_usec);
        } else {
                proto_tree_add_text(sattr_tree, tvb, offset, 8, "mtime: no value");
                offset += 8;
@@ -1822,33 +1995,34 @@ dissect_sattr(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, c
 
 
 /* RFC 1094, Page 17 */
-int
-dissect_filename(tvbuff_t *tvb, int offset, packet_info *pinfo,
+static int
+dissect_filename(tvbuff_t *tvb, int offset,
     proto_tree *tree, int hf, char **string_ret)
 {
-       offset = dissect_rpc_string(tvb, pinfo, tree, hf, offset, string_ret);
+       offset = dissect_rpc_string(tvb, tree, hf, offset, string_ret);
        return offset;
 }
 
 
 /* RFC 1094, Page 17 */
-int
-dissect_path(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf)
+static int
+dissect_path(tvbuff_t *tvb, int offset, proto_tree *tree, int hf)
 {
-       offset = dissect_rpc_string(tvb, pinfo, tree, hf, offset, NULL);
+       offset = dissect_rpc_string(tvb, tree, hf, offset, NULL);
        return offset;
 }
 
 
 /* RFC 1094, Page 17,18 */
-int
-dissect_attrstat(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree){
+static int
+dissect_attrstat(tvbuff_t *tvb, int offset, proto_tree *tree)
+{
        guint32 status;
 
-       offset = dissect_stat(tvb, offset, pinfo, tree, &status);
+       offset = dissect_stat(tvb, offset, tree, &status);
        switch (status) {
                case 0:
-                       offset = dissect_fattr(tvb, offset, pinfo, tree, "attributes");
+                       offset = dissect_fattr(tvb, offset, tree, "attributes");
                break;
                default:
                        /* do nothing */
@@ -1860,17 +2034,17 @@ dissect_attrstat(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree
 
 
 /* RFC 1094, Page 17,18 */
-int
-dissect_nfs2_attrstat_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree* tree)
+static int
+dissect_nfs2_attrstat_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree* tree)
 {
-       offset = dissect_attrstat(tvb, offset, pinfo, tree);
+       offset = dissect_attrstat(tvb, offset, tree);
 
        return offset;
 }
 
 
 /* RFC 1094, Page 18 */
-int
+static int
 dissect_diropargs(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, char* name)
 {
        proto_item* diropargs_item = NULL;
@@ -1878,8 +2052,8 @@ dissect_diropargs(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tre
        int old_offset = offset;
 
        if (tree) {
-               diropargs_item = proto_tree_add_text(tree, tvb, offset,
-                       tvb_length_remaining(tvb, offset), "%s", name);
+               diropargs_item = proto_tree_add_text(tree, tvb, offset, -1,
+                       "%s", name);
                diropargs_tree = proto_item_add_subtree(diropargs_item, ett_nfs_diropargs);
        }
 
@@ -1893,14 +2067,14 @@ dissect_diropargs(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tre
                  &&(civ->request)
                  &&((civ->proc==4)||(civ->proc==9)||(civ->proc==14))
                ) {
-                       nfs_name_snoop_add_name(civ->xid, tvb, 
+                       nfs_name_snoop_add_name(civ->xid, tvb,
                                offset+36, tvb_get_ntohl(tvb, offset+32),
                                offset, 32, NULL);
                }
        }
 
        offset = dissect_fhandle (tvb,offset,pinfo,diropargs_tree,"dir");
-       offset = dissect_filename(tvb,offset,pinfo,diropargs_tree,hf_nfs_name,NULL);
+       offset = dissect_filename(tvb,offset,      diropargs_tree,hf_nfs_name,NULL);
 
        /* now we know, that diropargs is shorter */
        if (diropargs_item) {
@@ -1912,7 +2086,7 @@ dissect_diropargs(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tre
 
 
 /* RFC 1094, Page 18 */
-int
+static int
 dissect_nfs2_diropargs_call(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
 {
        offset = dissect_diropargs(tvb, offset, pinfo, tree, "where");
@@ -1922,16 +2096,16 @@ dissect_nfs2_diropargs_call(tvbuff_t *tvb, int offset, packet_info *pinfo, proto
 
 
 /* RFC 1094, Page 18 */
-int
+static int
 dissect_diropres(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
 {
        guint32 status;
 
-       offset = dissect_stat(tvb, offset, pinfo, tree, &status);
+       offset = dissect_stat(tvb, offset, tree, &status);
        switch (status) {
                case 0:
                        offset = dissect_fhandle(tvb, offset, pinfo, tree, "file");
-                       offset = dissect_fattr  (tvb, offset, pinfo, tree, "attributes");
+                       offset = dissect_fattr  (tvb, offset, tree, "attributes");
                break;
                default:
                        /* do nothing */
@@ -1943,18 +2117,17 @@ dissect_diropres(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree
 
 
 /* nfsdata is simply a chunk of RPC opaque data (length, data, fill bytes) */
-int
-dissect_nfsdata(tvbuff_t *tvb, int offset, packet_info *pinfo, 
-       proto_tree *tree, int hf)
+static int
+dissect_nfsdata(tvbuff_t *tvb, int offset, proto_tree *tree, int hf)
 {
-       offset = dissect_rpc_data(tvb, pinfo, tree, hf, offset);
+       offset = dissect_rpc_data(tvb, tree, hf, offset);
        return offset;
 }
 
 
 /* RFC 1094, Page 18 */
-int
-dissect_nfs2_diropres_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_nfs2_diropres_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree* tree)
 {
        offset = dissect_diropres(tvb, offset, pinfo, tree);
@@ -1963,28 +2136,28 @@ dissect_nfs2_diropres_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
 
 /* RFC 1094, Page 6 */
-int
-dissect_nfs2_setattr_call(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_nfs2_setattr_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree *tree)
 {
        offset = dissect_fhandle(tvb, offset, pinfo, tree, "file"      );
-       offset = dissect_sattr  (tvb, offset, pinfo, tree, "attributes");
+       offset = dissect_sattr  (tvb, offset,        tree, "attributes");
 
        return offset;
 }
 
 
 /* RFC 1094, Page 6 */
-int
-dissect_nfs2_readlink_reply(tvbuff_t *tvb, int offset, packet_info *pinfo
+static int
+dissect_nfs2_readlink_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
        proto_tree *tree)
 {
        guint32 status;
 
-       offset = dissect_stat(tvb, offset, pinfo, tree, &status);
+       offset = dissect_stat(tvb, offset, tree, &status);
        switch (status) {
                case 0:
-                       offset = dissect_path(tvb, offset, pinfo, tree, hf_nfs_readlink_data);
+                       offset = dissect_path(tvb, offset, tree, hf_nfs_readlink_data);
                break;
                default:
                        /* do nothing */
@@ -1996,8 +2169,8 @@ dissect_nfs2_readlink_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
 
 /* RFC 1094, Page 7 */
-int
-dissect_nfs2_read_call(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_nfs2_read_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree *tree)
 {
        guint32 offset_value;
@@ -2009,11 +2182,11 @@ dissect_nfs2_read_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
        count        = tvb_get_ntohl(tvb, offset+4);
        totalcount   = tvb_get_ntohl(tvb, offset+8);
        if (tree) {
-               proto_tree_add_uint(tree, hf_nfs_read_offset, tvb, 
+               proto_tree_add_uint(tree, hf_nfs_read_offset, tvb,
                offset+0, 4, offset_value);
-               proto_tree_add_uint(tree, hf_nfs_read_count, tvb, 
+               proto_tree_add_uint(tree, hf_nfs_read_count, tvb,
                offset+4, 4, count);
-               proto_tree_add_uint(tree, hf_nfs_read_totalcount, tvb, 
+               proto_tree_add_uint(tree, hf_nfs_read_totalcount, tvb,
                offset+8, 4, totalcount);
        }
        offset += 12;
@@ -2023,17 +2196,17 @@ dissect_nfs2_read_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
 
 /* RFC 1094, Page 7 */
-int
-dissect_nfs2_read_reply(tvbuff_t *tvb, int offset, packet_info *pinfo
+static int
+dissect_nfs2_read_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
        proto_tree* tree)
 {
        guint32 status;
 
-       offset = dissect_stat(tvb, offset, pinfo, tree, &status);
+       offset = dissect_stat(tvb, offset, tree, &status);
        switch (status) {
                case 0:
-                       offset = dissect_fattr(tvb, offset, pinfo, tree, "attributes");
-                       offset = dissect_nfsdata(tvb, offset, pinfo, tree, hf_nfs_data); 
+                       offset = dissect_fattr(tvb, offset, tree, "attributes");
+                       offset = dissect_nfsdata(tvb, offset, tree, hf_nfs_data);
                break;
                default:
                        /* do nothing */
@@ -2045,8 +2218,8 @@ dissect_nfs2_read_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
 
 /* RFC 1094, Page 8 */
-int
-dissect_nfs2_write_call(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_nfs2_write_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree *tree)
 {
        guint32 beginoffset;
@@ -2058,36 +2231,36 @@ dissect_nfs2_write_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
        offset_value = tvb_get_ntohl(tvb, offset+4);
        totalcount   = tvb_get_ntohl(tvb, offset+8);
        if (tree) {
-               proto_tree_add_uint(tree, hf_nfs_write_beginoffset, tvb, 
+               proto_tree_add_uint(tree, hf_nfs_write_beginoffset, tvb,
                offset+0, 4, beginoffset);
-               proto_tree_add_uint(tree, hf_nfs_write_offset, tvb, 
+               proto_tree_add_uint(tree, hf_nfs_write_offset, tvb,
                offset+4, 4, offset_value);
-               proto_tree_add_uint(tree, hf_nfs_write_totalcount, tvb, 
+               proto_tree_add_uint(tree, hf_nfs_write_totalcount, tvb,
                offset+8, 4, totalcount);
        }
        offset += 12;
 
-       offset = dissect_nfsdata(tvb, offset, pinfo, tree, hf_nfs_data); 
+       offset = dissect_nfsdata(tvb, offset, tree, hf_nfs_data);
 
        return offset;
 }
 
 
 /* RFC 1094, Page 8 */
-int
-dissect_nfs2_createargs_call(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_nfs2_createargs_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree *tree)
 {
        offset = dissect_diropargs(tvb, offset, pinfo, tree, "where"     );
-       offset = dissect_sattr    (tvb, offset, pinfo, tree, "attributes");
+       offset = dissect_sattr    (tvb, offset,        tree, "attributes");
 
        return offset;
 }
 
 
 /* RFC 1094, Page 9 */
-int
-dissect_nfs2_rename_call(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_nfs2_rename_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree *tree)
 {
        offset = dissect_diropargs(tvb, offset, pinfo, tree, "from");
@@ -2098,8 +2271,8 @@ dissect_nfs2_rename_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
 
 /* RFC 1094, Page 9 */
-int
-dissect_nfs2_link_call(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_nfs2_link_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree *tree)
 {
        offset = dissect_fhandle  (tvb, offset, pinfo, tree, "from");
@@ -2110,21 +2283,21 @@ dissect_nfs2_link_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
 
 /* RFC 1094, Page 10 */
-int
-dissect_nfs2_symlink_call(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_nfs2_symlink_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree *tree)
 {
        offset = dissect_diropargs(tvb, offset, pinfo, tree, "from"           );
-       offset = dissect_path     (tvb, offset, pinfo, tree, hf_nfs_symlink_to);
-       offset = dissect_sattr    (tvb, offset, pinfo, tree, "attributes"     );
+       offset = dissect_path     (tvb, offset,        tree, hf_nfs_symlink_to);
+       offset = dissect_sattr    (tvb, offset,        tree, "attributes"     );
 
        return offset;
 }
 
 
 /* RFC 1094, Page 11 */
-int
-dissect_nfs2_readdir_call(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_nfs2_readdir_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree *tree)
 {
        guint32 cookie;
@@ -2146,8 +2319,8 @@ dissect_nfs2_readdir_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
 
 /* RFC 1094, Page 11 */
-int
-dissect_readdir_entry(tvbuff_t *tvb, int offset, packet_info *pinfo
+static int
+dissect_readdir_entry(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
        proto_tree* tree)
 {
        proto_item* entry_item = NULL;
@@ -2159,7 +2332,7 @@ dissect_readdir_entry(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
        if (tree) {
                entry_item = proto_tree_add_item(tree, hf_nfs_readdir_entry, tvb,
-                       offset+0, tvb_length_remaining(tvb, offset), FALSE);
+                       offset+0, -1, FALSE);
                entry_tree = proto_item_add_subtree(entry_item, ett_nfs_readdir_entry);
        }
 
@@ -2169,13 +2342,13 @@ dissect_readdir_entry(tvbuff_t *tvb, int offset, packet_info *pinfo,
                        offset+0, 4, fileid);
        offset += 4;
 
-       offset = dissect_filename(tvb, offset, pinfo, entry_tree,
+       offset = dissect_filename(tvb, offset, entry_tree,
                hf_nfs_readdir_entry_name, &name);
        if (entry_item)
                proto_item_set_text(entry_item, "Entry: file ID %u, name %s",
                fileid, name);
        g_free(name);
-       
+
        cookie = tvb_get_ntohl(tvb, offset + 0);
        if (entry_tree)
                proto_tree_add_uint(entry_tree, hf_nfs_readdir_entry_cookie, tvb,
@@ -2191,17 +2364,17 @@ dissect_readdir_entry(tvbuff_t *tvb, int offset, packet_info *pinfo,
 }
 
 /* RFC 1094, Page 11 */
-int
-dissect_nfs2_readdir_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_nfs2_readdir_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree* tree)
 {
        guint32 status;
        guint32 eof_value;
 
-       offset = dissect_stat(tvb, offset, pinfo, tree, &status);
+       offset = dissect_stat(tvb, offset, tree, &status);
        switch (status) {
                case 0:
-                       offset = dissect_rpc_list(tvb, pinfo, tree, offset, 
+                       offset = dissect_rpc_list(tvb, pinfo, tree, offset,
                                dissect_readdir_entry);
                        eof_value = tvb_get_ntohl(tvb, offset+0);
                        if (tree)
@@ -2219,8 +2392,8 @@ dissect_nfs2_readdir_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
 
 /* RFC 1094, Page 12 */
-int
-dissect_nfs2_statfs_reply(tvbuff_t *tvb, int offset, packet_info *pinfo
+static int
+dissect_nfs2_statfs_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
        proto_tree* tree)
 {
        guint32 status;
@@ -2230,7 +2403,7 @@ dissect_nfs2_statfs_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
        guint32 bfree;
        guint32 bavail;
 
-       offset = dissect_stat(tvb, offset, pinfo, tree, &status);
+       offset = dissect_stat(tvb, offset, tree, &status);
        switch (status) {
                case 0:
                        tsize  = tvb_get_ntohl(tvb, offset+ 0);
@@ -2302,6 +2475,29 @@ static const vsff nfs2_proc[] = {
        dissect_nfs2_fhandle_call,      dissect_nfs2_statfs_reply },
        { 0,NULL,NULL,NULL }
 };
+
+static const value_string nfsv2_proc_vals[] = {
+       { 0,    "NULL" },
+       { 1,    "GETATTR" },
+       { 2,    "SETATTR" },
+       { 3,    "ROOT" },
+       { 4,    "LOOKUP" },
+       { 5,    "READLINK" },
+       { 6,    "READ" },
+       { 7,    "WRITECACHE" },
+       { 8,    "WRITE" },
+       { 9,    "CREATE" },
+       { 10,   "REMOVE" },
+       { 11,   "RENAME" },
+       { 12,   "LINK" },
+       { 13,   "SYMLINK" },
+       { 14,   "MKDIR" },
+       { 15,   "RMDIR" },
+       { 16,   "READDIR" },
+       { 17,   "STATFS" },
+       { 0,    NULL }
+};
+
 /* end of NFS Version 2 */
 
 
@@ -2311,28 +2507,26 @@ static const vsff nfs2_proc[] = {
 
 
 /* RFC 1813, Page 15 */
-int
-dissect_filename3(tvbuff_t *tvb, int offset, packet_info *pinfo,
+static int
+dissect_filename3(tvbuff_t *tvb, int offset,
     proto_tree *tree, int hf, char **string_ret)
 {
-       offset = dissect_rpc_string(tvb, pinfo, tree, hf, offset, string_ret);
+       offset = dissect_rpc_string(tvb, tree, hf, offset, string_ret);
        return offset;
 }
 
 
 /* RFC 1813, Page 15 */
-int
-dissect_nfspath3(tvbuff_t *tvb, int offset, packet_info *pinfo, 
-       proto_tree *tree, int hf)
+static int
+dissect_nfspath3(tvbuff_t *tvb, int offset, proto_tree *tree, int hf)
 {
-       offset = dissect_rpc_string(tvb, pinfo, tree, hf, offset, NULL);
+       offset = dissect_rpc_string(tvb, tree, hf, offset, NULL);
        return offset;
 }
 
 /* RFC 1813, Page 15 */
-int
-dissect_cookieverf3(tvbuff_t *tvb, int offset, packet_info *pinfo, 
-       proto_tree *tree)
+static int
+dissect_cookieverf3(tvbuff_t *tvb, int offset, proto_tree *tree)
 {
        proto_tree_add_text(tree, tvb, offset, NFS3_COOKIEVERFSIZE,
                "Verifier: Opaque Data");
@@ -2342,9 +2536,8 @@ dissect_cookieverf3(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
 
 /* RFC 1813, Page 16 */
-int
-dissect_createverf3(tvbuff_t *tvb, int offset, packet_info *pinfo, 
-       proto_tree *tree)
+static int
+dissect_createverf3(tvbuff_t *tvb, int offset, proto_tree *tree)
 {
        proto_tree_add_text(tree, tvb, offset, NFS3_CREATEVERFSIZE,
                "Verifier: Opaque Data");
@@ -2354,9 +2547,8 @@ dissect_createverf3(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
 
 /* RFC 1813, Page 16 */
-int
-dissect_writeverf3(tvbuff_t *tvb, int offset, packet_info *pinfo, 
-       proto_tree *tree)
+static int
+dissect_writeverf3(tvbuff_t *tvb, int offset, proto_tree *tree)
 {
        proto_tree_add_text(tree, tvb, offset, NFS3_WRITEVERFSIZE,
                "Verifier: Opaque Data");
@@ -2365,16 +2557,15 @@ dissect_writeverf3(tvbuff_t *tvb, int offset, packet_info *pinfo,
 }
 
 /* RFC 1813, Page 16 */
-int
-dissect_mode3(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
-       char* name)
+static int
+dissect_mode3(tvbuff_t *tvb, int offset, proto_tree *tree, char* name)
 {
        guint32 mode3;
        proto_item* mode3_item = NULL;
        proto_tree* mode3_tree = NULL;
 
        mode3 = tvb_get_ntohl(tvb, offset+0);
-       
+
        if (tree) {
                mode3_item = proto_tree_add_text(tree, tvb, offset, 4,
                        "%s: 0%o", name, mode3);
@@ -2415,7 +2606,7 @@ dissect_mode3(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
 }
 
 /* RFC 1813, Page 16,17 */
-const value_string names_nfs_nfsstat3[] =
+static const value_string names_nfs_nfsstat3[] =
 {
        {       0,      "OK" },
        {       1,      "ERR_PERM" },
@@ -2451,14 +2642,14 @@ const value_string names_nfs_nfsstat3[] =
 
 
 /* RFC 1813, Page 16 */
-int
-dissect_nfsstat3(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_nfsstat3(tvbuff_t *tvb, int offset,
        proto_tree *tree,guint32 *status)
 {
        guint32 nfsstat3;
 
        nfsstat3 = tvb_get_ntohl(tvb, offset+0);
-       
+
        if (tree) {
                proto_tree_add_uint(tree, hf_nfs_nfsstat3, tvb,
                        offset, 4, nfsstat3);
@@ -2470,7 +2661,7 @@ dissect_nfsstat3(tvbuff_t *tvb, int offset, packet_info *pinfo,
 }
 
 
-const value_string names_nfs_ftype3[] =
+static const value_string names_nfs_ftype3[] =
 {
        {       NF3REG, "Regular File" },
        {       NF3DIR, "Directory" },
@@ -2484,14 +2675,14 @@ const value_string names_nfs_ftype3[] =
 
 
 /* RFC 1813, Page 20 */
-int
-dissect_ftype3(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
+static int
+dissect_ftype3(tvbuff_t *tvb, int offset, proto_tree *tree,
        int hf, guint32* ftype3)
 {
        guint32 type;
 
        type = tvb_get_ntohl(tvb, offset+0);
-       
+
        if (tree) {
                proto_tree_add_uint(tree, hf, tvb, offset, 4, type);
        }
@@ -2503,9 +2694,8 @@ dissect_ftype3(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
 
 
 /* RFC 1813, Page 20 */
-int
-dissect_specdata3(tvbuff_t *tvb, int offset, packet_info *pinfo, 
-       proto_tree *tree, char* name)
+static int
+dissect_specdata3(tvbuff_t *tvb, int offset, proto_tree *tree, char* name)
 {
        guint32 specdata1;
        guint32 specdata2;
@@ -2515,7 +2705,7 @@ dissect_specdata3(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
        specdata1 = tvb_get_ntohl(tvb, offset+0);
        specdata2 = tvb_get_ntohl(tvb, offset+4);
-       
+
        if (tree) {
                specdata3_item = proto_tree_add_text(tree, tvb, offset, 8,
                        "%s: %u,%u", name, specdata1, specdata2);
@@ -2538,7 +2728,7 @@ dissect_specdata3(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
 /* RFC 1813, Page 21 */
 int
-dissect_nfs_fh3(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+dissect_nfs_fh3(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree *tree, char *name)
 {
        guint fh3_len;
@@ -2546,12 +2736,12 @@ dissect_nfs_fh3(tvbuff_t *tvb, int offset, packet_info *pinfo,
        guint fh3_fill;
        proto_item* fitem = NULL;
        proto_tree* ftree = NULL;
-       int fh_offset,fh_len;
+       int fh_offset,fh_length;
 
        fh3_len = tvb_get_ntohl(tvb, offset+0);
        fh3_len_full = rpc_roundup(fh3_len);
        fh3_fill = fh3_len_full - fh3_len;
-       
+
        if (tree) {
                fitem = proto_tree_add_text(tree, tvb, offset, 4+fh3_len_full,
                        "%s", name);
@@ -2569,10 +2759,10 @@ dissect_nfs_fh3(tvbuff_t *tvb, int offset, packet_info *pinfo,
                  &&(!civ->request)
                  &&((civ->proc==3)||(civ->proc==8)||(civ->proc==9))
                ) {
-                       fh_len=tvb_get_ntohl(tvb, offset);
+                       fh_length=tvb_get_ntohl(tvb, offset);
                        fh_offset=offset+4;
-                       nfs_name_snoop_add_fh(civ->xid, tvb, 
-                               fh_offset, fh_len);
+                       nfs_name_snoop_add_fh(civ->xid, tvb,
+                               fh_offset, fh_length);
                }
 
                /* MOUNT v3 MNT replies might give us a filehandle */
@@ -2581,16 +2771,16 @@ dissect_nfs_fh3(tvbuff_t *tvb, int offset, packet_info *pinfo,
                  &&(!civ->request)
                  &&(civ->proc==1)
                ) {
-                       fh_len=tvb_get_ntohl(tvb, offset);
+                       fh_length=tvb_get_ntohl(tvb, offset);
                        fh_offset=offset+4;
-                       nfs_name_snoop_add_fh(civ->xid, tvb, 
-                               fh_offset, fh_len);
+                       nfs_name_snoop_add_fh(civ->xid, tvb,
+                               fh_offset, fh_length);
                }
        }
 
        proto_tree_add_uint(ftree, hf_nfs_fh_length, tvb, offset+0, 4,
                        fh3_len);
-       dissect_fhandle_data(tvb, offset+4, pinfo, ftree, fh3_len);
+       dissect_fhandle_data(tvb, offset+4, pinfo, ftree, fh3_len, FALSE);
 
        offset += 4 + fh3_len_full;
        return offset;
@@ -2598,8 +2788,8 @@ dissect_nfs_fh3(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
 
 /* RFC 1813, Page 21 */
-int
-dissect_nfstime3(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_nfstime3(tvbuff_t *tvb, int offset,
        proto_tree *tree, int hf_time, int hf_time_sec, int hf_time_nsec)
 {
        guint32 seconds;
@@ -2613,7 +2803,7 @@ dissect_nfstime3(tvbuff_t *tvb, int offset, packet_info *pinfo,
        nseconds = tvb_get_ntohl(tvb, offset+4);
        ts.secs = seconds;
        ts.nsecs = nseconds;
-       
+
        if (tree) {
                time_item = proto_tree_add_time(tree, hf_time, tvb, offset, 8,
                                &ts);
@@ -2633,9 +2823,8 @@ dissect_nfstime3(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
 
 /* RFC 1813, Page 22 */
-int
-dissect_fattr3(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
-       char* name)
+static int
+dissect_fattr3(tvbuff_t *tvb, int offset, proto_tree *tree, char* name)
 {
        proto_item* fattr3_item = NULL;
        proto_tree* fattr3_tree = NULL;
@@ -2643,31 +2832,31 @@ dissect_fattr3(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
        guint32 type;
 
        if (tree) {
-               fattr3_item = proto_tree_add_text(tree, tvb, offset,
-                       tvb_length_remaining(tvb, offset), "%s", name);
+               fattr3_item = proto_tree_add_text(tree, tvb, offset, -1,
+                       "%s", name);
                fattr3_tree = proto_item_add_subtree(fattr3_item, ett_nfs_fattr3);
        }
 
-       offset = dissect_ftype3(tvb,offset,pinfo,fattr3_tree,hf_nfs_fattr3_type,&type);
-       offset = dissect_mode3(tvb,offset,pinfo,fattr3_tree,"mode");
-       offset = dissect_rpc_uint32(tvb, pinfo, fattr3_tree, hf_nfs_fattr3_nlink,
+       offset = dissect_ftype3(tvb,offset,fattr3_tree,hf_nfs_fattr3_type,&type);
+       offset = dissect_mode3(tvb,offset,fattr3_tree,"mode");
+       offset = dissect_rpc_uint32(tvb, fattr3_tree, hf_nfs_fattr3_nlink,
                offset);
-       offset = dissect_rpc_uint32(tvb, pinfo, fattr3_tree, hf_nfs_fattr3_uid,
+       offset = dissect_rpc_uint32(tvb, fattr3_tree, hf_nfs_fattr3_uid,
                offset);
-       offset = dissect_rpc_uint32(tvb, pinfo, fattr3_tree, hf_nfs_fattr3_gid,
+       offset = dissect_rpc_uint32(tvb, fattr3_tree, hf_nfs_fattr3_gid,
                offset);
-       offset = dissect_rpc_uint64(tvb, pinfo, fattr3_tree, hf_nfs_fattr3_size, 
+       offset = dissect_rpc_uint64(tvb, fattr3_tree, hf_nfs_fattr3_size,
                offset);
-       offset = dissect_rpc_uint64(tvb, pinfo, fattr3_tree, hf_nfs_fattr3_used,
+       offset = dissect_rpc_uint64(tvb, fattr3_tree, hf_nfs_fattr3_used,
                offset);
-       offset = dissect_specdata3(tvb,offset,pinfo,fattr3_tree,"rdev");
-       offset = dissect_rpc_uint64(tvb, pinfo, fattr3_tree, hf_nfs_fattr3_fsid,
+       offset = dissect_specdata3(tvb,offset,fattr3_tree,"rdev");
+       offset = dissect_rpc_uint64(tvb, fattr3_tree, hf_nfs_fattr3_fsid,
                offset);
-       offset = dissect_rpc_uint64(tvb, pinfo, fattr3_tree, hf_nfs_fattr3_fileid,
+       offset = dissect_rpc_uint64(tvb, fattr3_tree, hf_nfs_fattr3_fileid,
                offset);
-       offset = dissect_nfstime3 (tvb,offset,pinfo,fattr3_tree,hf_nfs_atime,hf_nfs_atime_sec,hf_nfs_atime_nsec);
-       offset = dissect_nfstime3 (tvb,offset,pinfo,fattr3_tree,hf_nfs_mtime,hf_nfs_mtime_sec,hf_nfs_mtime_nsec);
-       offset = dissect_nfstime3 (tvb,offset,pinfo,fattr3_tree,hf_nfs_ctime,hf_nfs_ctime_sec,hf_nfs_ctime_nsec);
+       offset = dissect_nfstime3 (tvb,offset,fattr3_tree,hf_nfs_atime,hf_nfs_atime_sec,hf_nfs_atime_nsec);
+       offset = dissect_nfstime3 (tvb,offset,fattr3_tree,hf_nfs_mtime,hf_nfs_mtime_sec,hf_nfs_mtime_nsec);
+       offset = dissect_nfstime3 (tvb,offset,fattr3_tree,hf_nfs_ctime,hf_nfs_ctime_sec,hf_nfs_ctime_nsec);
 
        /* now we know, that fattr3 is shorter */
        if (fattr3_item) {
@@ -2678,7 +2867,7 @@ dissect_fattr3(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
 }
 
 
-const value_string value_follows[] =
+static const value_string value_follows[] =
        {
                { 0, "no value" },
                { 1, "value follows"},
@@ -2687,9 +2876,8 @@ const value_string value_follows[] =
 
 
 /* RFC 1813, Page 23 */
-int
-dissect_post_op_attr(tvbuff_t *tvb, int offset, packet_info *pinfo, 
-       proto_tree *tree, char* name)
+static int
+dissect_post_op_attr(tvbuff_t *tvb, int offset, proto_tree *tree, char* name)
 {
        proto_item* post_op_attr_item = NULL;
        proto_tree* post_op_attr_tree = NULL;
@@ -2697,27 +2885,27 @@ dissect_post_op_attr(tvbuff_t *tvb, int offset, packet_info *pinfo,
        guint32 attributes_follow;
 
        if (tree) {
-               post_op_attr_item = proto_tree_add_text(tree, tvb, offset,
-                       tvb_length_remaining(tvb, offset), "%s", name);
-               post_op_attr_tree = proto_item_add_subtree(post_op_attr_item, 
+               post_op_attr_item = proto_tree_add_text(tree, tvb, offset, -1,
+                       "%s", name);
+               post_op_attr_tree = proto_item_add_subtree(post_op_attr_item,
                        ett_nfs_post_op_attr);
        }
 
        attributes_follow = tvb_get_ntohl(tvb, offset+0);
        proto_tree_add_text(post_op_attr_tree, tvb, offset, 4,
-               "attributes_follow: %s (%u)", 
+               "attributes_follow: %s (%u)",
                val_to_str(attributes_follow,value_follows,"Unknown"), attributes_follow);
        offset += 4;
        switch (attributes_follow) {
                case TRUE:
-                       offset = dissect_fattr3(tvb, offset, pinfo, post_op_attr_tree,
+                       offset = dissect_fattr3(tvb, offset, post_op_attr_tree,
                                        "attributes");
                break;
                case FALSE:
                        /* void */
                break;
        }
-       
+
        /* now we know, that post_op_attr_tree is shorter */
        if (post_op_attr_item) {
                proto_item_set_len(post_op_attr_item, offset - old_offset);
@@ -2728,25 +2916,24 @@ dissect_post_op_attr(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
 
 /* RFC 1813, Page 24 */
-int
-dissect_wcc_attr(tvbuff_t *tvb, int offset, packet_info *pinfo, 
-       proto_tree *tree, char* name)
+static int
+dissect_wcc_attr(tvbuff_t *tvb, int offset, proto_tree *tree, char* name)
 {
        proto_item* wcc_attr_item = NULL;
        proto_tree* wcc_attr_tree = NULL;
        int old_offset = offset;
 
        if (tree) {
-               wcc_attr_item = proto_tree_add_text(tree, tvb, offset,
-                       tvb_length_remaining(tvb, offset), "%s", name);
-               wcc_attr_tree = proto_item_add_subtree(wcc_attr_item, 
+               wcc_attr_item = proto_tree_add_text(tree, tvb, offset, -1,
+                       "%s", name);
+               wcc_attr_tree = proto_item_add_subtree(wcc_attr_item,
                        ett_nfs_wcc_attr);
        }
 
-       offset = dissect_rpc_uint64(tvb, pinfo, wcc_attr_tree, hf_nfs_wcc_attr_size, 
+       offset = dissect_rpc_uint64(tvb, wcc_attr_tree, hf_nfs_wcc_attr_size,
                offset);
-       offset = dissect_nfstime3(tvb, offset, pinfo, wcc_attr_tree, hf_nfs_mtime, hf_nfs_mtime_sec, hf_nfs_mtime_nsec);
-       offset = dissect_nfstime3(tvb, offset, pinfo, wcc_attr_tree, hf_nfs_ctime, hf_nfs_ctime_sec, hf_nfs_ctime_nsec);
+       offset = dissect_nfstime3(tvb, offset, wcc_attr_tree, hf_nfs_mtime, hf_nfs_mtime_sec, hf_nfs_mtime_nsec);
+       offset = dissect_nfstime3(tvb, offset, wcc_attr_tree, hf_nfs_ctime, hf_nfs_ctime_sec, hf_nfs_ctime_nsec);
        /* now we know, that wcc_attr_tree is shorter */
        if (wcc_attr_item) {
                proto_item_set_len(wcc_attr_item, offset - old_offset);
@@ -2757,9 +2944,8 @@ dissect_wcc_attr(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
 
 /* RFC 1813, Page 24 */
-int
-dissect_pre_op_attr(tvbuff_t *tvb, int offset, packet_info *pinfo, 
-       proto_tree *tree, char* name)
+static int
+dissect_pre_op_attr(tvbuff_t *tvb, int offset, proto_tree *tree, char* name)
 {
        proto_item* pre_op_attr_item = NULL;
        proto_tree* pre_op_attr_tree = NULL;
@@ -2767,27 +2953,27 @@ dissect_pre_op_attr(tvbuff_t *tvb, int offset, packet_info *pinfo,
        guint32 attributes_follow;
 
        if (tree) {
-               pre_op_attr_item = proto_tree_add_text(tree, tvb, offset,
-                       tvb_length_remaining(tvb, offset), "%s", name);
-               pre_op_attr_tree = proto_item_add_subtree(pre_op_attr_item, 
+               pre_op_attr_item = proto_tree_add_text(tree, tvb, offset, -1,
+                       "%s", name);
+               pre_op_attr_tree = proto_item_add_subtree(pre_op_attr_item,
                        ett_nfs_pre_op_attr);
        }
 
        attributes_follow = tvb_get_ntohl(tvb, offset+0);
        proto_tree_add_text(pre_op_attr_tree, tvb, offset, 4,
-               "attributes_follow: %s (%u)", 
+               "attributes_follow: %s (%u)",
                val_to_str(attributes_follow,value_follows,"Unknown"), attributes_follow);
        offset += 4;
        switch (attributes_follow) {
                case TRUE:
-                       offset = dissect_wcc_attr(tvb, offset, pinfo, pre_op_attr_tree,
+                       offset = dissect_wcc_attr(tvb, offset, pre_op_attr_tree,
                                        "attributes");
                break;
                case FALSE:
                        /* void */
                break;
        }
-       
+
        /* now we know, that pre_op_attr_tree is shorter */
        if (pre_op_attr_item) {
                proto_item_set_len(pre_op_attr_item, offset - old_offset);
@@ -2798,23 +2984,22 @@ dissect_pre_op_attr(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
 
 /* RFC 1813, Page 24 */
-int
-dissect_wcc_data(tvbuff_t *tvb, int offset, packet_info *pinfo, 
-       proto_tree *tree, char* name)
+static int
+dissect_wcc_data(tvbuff_t *tvb, int offset, proto_tree *tree, char* name)
 {
        proto_item* wcc_data_item = NULL;
        proto_tree* wcc_data_tree = NULL;
        int old_offset = offset;
 
        if (tree) {
-               wcc_data_item = proto_tree_add_text(tree, tvb, offset,
-                       tvb_length_remaining(tvb, offset), "%s", name);
-               wcc_data_tree = proto_item_add_subtree(wcc_data_item, 
+               wcc_data_item = proto_tree_add_text(tree, tvb, offset, -1,
+                       "%s", name);
+               wcc_data_tree = proto_item_add_subtree(wcc_data_item,
                        ett_nfs_wcc_data);
        }
 
-       offset = dissect_pre_op_attr (tvb, offset, pinfo, wcc_data_tree, "before");
-       offset = dissect_post_op_attr(tvb, offset, pinfo, wcc_data_tree, "after" );
+       offset = dissect_pre_op_attr (tvb, offset, wcc_data_tree, "before");
+       offset = dissect_post_op_attr(tvb, offset, wcc_data_tree, "after" );
 
        /* now we know, that wcc_data is shorter */
        if (wcc_data_item) {
@@ -2826,8 +3011,8 @@ dissect_wcc_data(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
 
 /* RFC 1813, Page 25 */
-int
-dissect_post_op_fh3(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_post_op_fh3(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree *tree, char* name)
 {
        proto_item* post_op_fh3_item = NULL;
@@ -2836,15 +3021,15 @@ dissect_post_op_fh3(tvbuff_t *tvb, int offset, packet_info *pinfo,
        guint32 handle_follows;
 
        if (tree) {
-               post_op_fh3_item = proto_tree_add_text(tree, tvb, offset,
-                       tvb_length_remaining(tvb, offset), "%s", name);
-               post_op_fh3_tree = proto_item_add_subtree(post_op_fh3_item, 
+               post_op_fh3_item = proto_tree_add_text(tree, tvb, offset, -1,
+                       "%s", name);
+               post_op_fh3_tree = proto_item_add_subtree(post_op_fh3_item,
                        ett_nfs_post_op_fh3);
        }
 
        handle_follows = tvb_get_ntohl(tvb, offset+0);
        proto_tree_add_text(post_op_fh3_tree, tvb, offset, 4,
-               "handle_follows: %s (%u)", 
+               "handle_follows: %s (%u)",
                val_to_str(handle_follows,value_follows,"Unknown"), handle_follows);
        offset += 4;
        switch (handle_follows) {
@@ -2856,7 +3041,7 @@ dissect_post_op_fh3(tvbuff_t *tvb, int offset, packet_info *pinfo,
                        /* void */
                break;
        }
-       
+
        /* now we know, that post_op_fh3_tree is shorter */
        if (post_op_fh3_item) {
                proto_item_set_len(post_op_fh3_item, offset - old_offset);
@@ -2867,9 +3052,8 @@ dissect_post_op_fh3(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
 
 /* RFC 1813, Page 25 */
-int
-dissect_set_mode3(tvbuff_t *tvb, int offset, packet_info *pinfo, 
-       proto_tree *tree, char* name)
+static int
+dissect_set_mode3(tvbuff_t *tvb, int offset, proto_tree *tree, char* name)
 {
        proto_item* set_mode3_item = NULL;
        proto_tree* set_mode3_tree = NULL;
@@ -2881,10 +3065,9 @@ dissect_set_mode3(tvbuff_t *tvb, int offset, packet_info *pinfo,
        set_it_name = val_to_str(set_it,value_follows,"Unknown");
 
        if (tree) {
-               set_mode3_item = proto_tree_add_text(tree, tvb, offset,
-                       tvb_length_remaining(tvb, offset), "%s: %s",
-                       name, set_it_name);
-               set_mode3_tree = proto_item_add_subtree(set_mode3_item, 
+               set_mode3_item = proto_tree_add_text(tree, tvb, offset, -1,
+                       "%s: %s", name, set_it_name);
+               set_mode3_tree = proto_item_add_subtree(set_mode3_item,
                        ett_nfs_set_mode3);
        }
 
@@ -2896,14 +3079,14 @@ dissect_set_mode3(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
        switch (set_it) {
                case 1:
-                       offset = dissect_mode3(tvb, offset, pinfo, set_mode3_tree,
+                       offset = dissect_mode3(tvb, offset, set_mode3_tree,
                                        "mode");
                break;
                default:
                        /* void */
                break;
        }
-       
+
        /* now we know, that set_mode3 is shorter */
        if (set_mode3_item) {
                proto_item_set_len(set_mode3_item, offset - old_offset);
@@ -2914,9 +3097,8 @@ dissect_set_mode3(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
 
 /* RFC 1813, Page 26 */
-int
-dissect_set_uid3(tvbuff_t *tvb, int offset, packet_info *pinfo, 
-       proto_tree *tree, char* name)
+static int
+dissect_set_uid3(tvbuff_t *tvb, int offset, proto_tree *tree, char* name)
 {
        proto_item* set_uid3_item = NULL;
        proto_tree* set_uid3_tree = NULL;
@@ -2928,10 +3110,9 @@ dissect_set_uid3(tvbuff_t *tvb, int offset, packet_info *pinfo,
        set_it_name = val_to_str(set_it,value_follows,"Unknown");
 
        if (tree) {
-               set_uid3_item = proto_tree_add_text(tree, tvb, offset,
-                       tvb_length_remaining(tvb, offset), "%s: %s",
-                       name, set_it_name);
-               set_uid3_tree = proto_item_add_subtree(set_uid3_item, 
+               set_uid3_item = proto_tree_add_text(tree, tvb, offset, -1,
+                       "%s: %s", name, set_it_name);
+               set_uid3_tree = proto_item_add_subtree(set_uid3_item,
                        ett_nfs_set_uid3);
        }
 
@@ -2943,7 +3124,7 @@ dissect_set_uid3(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
        switch (set_it) {
                case 1:
-                       offset = dissect_rpc_uint32(tvb, pinfo, set_uid3_tree,
+                       offset = dissect_rpc_uint32(tvb, set_uid3_tree,
                                                                 hf_nfs_uid3, offset);
                break;
                default:
@@ -2961,9 +3142,8 @@ dissect_set_uid3(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
 
 /* RFC 1813, Page 26 */
-int
-dissect_set_gid3(tvbuff_t *tvb, int offset, packet_info *pinfo, 
-       proto_tree *tree, char* name)
+static int
+dissect_set_gid3(tvbuff_t *tvb, int offset, proto_tree *tree, char* name)
 {
        proto_item* set_gid3_item = NULL;
        proto_tree* set_gid3_tree = NULL;
@@ -2975,10 +3155,9 @@ dissect_set_gid3(tvbuff_t *tvb, int offset, packet_info *pinfo,
        set_it_name = val_to_str(set_it,value_follows,"Unknown");
 
        if (tree) {
-               set_gid3_item = proto_tree_add_text(tree, tvb, offset,
-                       tvb_length_remaining(tvb, offset), "%s: %s",
-                       name, set_it_name);
-               set_gid3_tree = proto_item_add_subtree(set_gid3_item, 
+               set_gid3_item = proto_tree_add_text(tree, tvb, offset, -1,
+                       "%s: %s", name, set_it_name);
+               set_gid3_tree = proto_item_add_subtree(set_gid3_item,
                        ett_nfs_set_gid3);
        }
 
@@ -2990,7 +3169,7 @@ dissect_set_gid3(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
        switch (set_it) {
                case 1:
-                       offset = dissect_rpc_uint32(tvb, pinfo, set_gid3_tree, 
+                       offset = dissect_rpc_uint32(tvb, set_gid3_tree,
                                hf_nfs_gid3, offset);
                break;
                default:
@@ -3008,9 +3187,8 @@ dissect_set_gid3(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
 
 /* RFC 1813, Page 26 */
-int
-dissect_set_size3(tvbuff_t *tvb, int offset, packet_info *pinfo, 
-       proto_tree *tree, char* name)
+static int
+dissect_set_size3(tvbuff_t *tvb, int offset, proto_tree *tree, char* name)
 {
        proto_item* set_size3_item = NULL;
        proto_tree* set_size3_tree = NULL;
@@ -3022,10 +3200,9 @@ dissect_set_size3(tvbuff_t *tvb, int offset, packet_info *pinfo,
        set_it_name = val_to_str(set_it,value_follows,"Unknown");
 
        if (tree) {
-               set_size3_item = proto_tree_add_text(tree, tvb, offset,
-                       tvb_length_remaining(tvb, offset), "%s: %s",
-                       name, set_it_name);
-               set_size3_tree = proto_item_add_subtree(set_size3_item, 
+               set_size3_item = proto_tree_add_text(tree, tvb, offset, -1,
+                       "%s: %s", name, set_it_name);
+               set_size3_tree = proto_item_add_subtree(set_size3_item,
                        ett_nfs_set_size3);
        }
 
@@ -3037,7 +3214,7 @@ dissect_set_size3(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
        switch (set_it) {
                case 1:
-                       offset = dissect_rpc_uint64(tvb, pinfo, set_size3_tree,
+                       offset = dissect_rpc_uint64(tvb, set_size3_tree,
                                hf_nfs_set_size3_size, offset);
                break;
                default:
@@ -3059,7 +3236,7 @@ dissect_set_size3(tvbuff_t *tvb, int offset, packet_info *pinfo,
 #define SET_TO_SERVER_TIME 1
 #define SET_TO_CLIENT_TIME 2
 
-const value_string time_how[] =
+static const value_string time_how[] =
        {
                { DONT_CHANGE,  "don't change" },
                { SET_TO_SERVER_TIME, "set to server time" },
@@ -3069,9 +3246,8 @@ const value_string time_how[] =
 
 
 /* RFC 1813, Page 26 */
-int
-dissect_set_atime(tvbuff_t *tvb, int offset, packet_info *pinfo, 
-       proto_tree *tree, char* name)
+static int
+dissect_set_atime(tvbuff_t *tvb, int offset, proto_tree *tree, char* name)
 {
        proto_item* set_atime_item = NULL;
        proto_tree* set_atime_tree = NULL;
@@ -3083,10 +3259,9 @@ dissect_set_atime(tvbuff_t *tvb, int offset, packet_info *pinfo,
        set_it_name = val_to_str(set_it,time_how,"Unknown");
 
        if (tree) {
-               set_atime_item = proto_tree_add_text(tree, tvb, offset,
-                       tvb_length_remaining(tvb, offset), "%s: %s",
-                       name, set_it_name);
-               set_atime_tree = proto_item_add_subtree(set_atime_item, 
+               set_atime_item = proto_tree_add_text(tree, tvb, offset, -1,
+                       "%s: %s", name, set_it_name);
+               set_atime_tree = proto_item_add_subtree(set_atime_item,
                        ett_nfs_set_atime);
        }
 
@@ -3099,7 +3274,7 @@ dissect_set_atime(tvbuff_t *tvb, int offset, packet_info *pinfo,
        switch (set_it) {
                case SET_TO_CLIENT_TIME:
                        if (set_atime_item) {
-                               offset = dissect_nfstime3(tvb, offset, pinfo, set_atime_tree,
+                               offset = dissect_nfstime3(tvb, offset, set_atime_tree,
                                        hf_nfs_atime, hf_nfs_atime_sec, hf_nfs_atime_nsec);
                        }
                break;
@@ -3118,9 +3293,8 @@ dissect_set_atime(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
 
 /* RFC 1813, Page 26 */
-int
-dissect_set_mtime(tvbuff_t *tvb, int offset, packet_info *pinfo, 
-       proto_tree *tree, char* name)
+static int
+dissect_set_mtime(tvbuff_t *tvb, int offset, proto_tree *tree, char* name)
 {
        proto_item* set_mtime_item = NULL;
        proto_tree* set_mtime_tree = NULL;
@@ -3132,10 +3306,9 @@ dissect_set_mtime(tvbuff_t *tvb, int offset, packet_info *pinfo,
        set_it_name = val_to_str(set_it,time_how,"Unknown");
 
        if (tree) {
-               set_mtime_item = proto_tree_add_text(tree, tvb, offset,
-                       tvb_length_remaining(tvb, offset), "%s: %s",
-                       name, set_it_name);
-               set_mtime_tree = proto_item_add_subtree(set_mtime_item, 
+               set_mtime_item = proto_tree_add_text(tree, tvb, offset, -1,
+                       "%s: %s", name, set_it_name);
+               set_mtime_tree = proto_item_add_subtree(set_mtime_item,
                        ett_nfs_set_mtime);
        }
 
@@ -3148,7 +3321,7 @@ dissect_set_mtime(tvbuff_t *tvb, int offset, packet_info *pinfo,
        switch (set_it) {
                case SET_TO_CLIENT_TIME:
                        if (set_mtime_item) {
-                               offset = dissect_nfstime3(tvb, offset, pinfo, set_mtime_tree,
+                               offset = dissect_nfstime3(tvb, offset, set_mtime_tree,
                                        hf_nfs_atime, hf_nfs_atime_sec, hf_nfs_atime_nsec);
                        }
                break;
@@ -3167,26 +3340,25 @@ dissect_set_mtime(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
 
 /* RFC 1813, Page 25..27 */
-int
-dissect_sattr3(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
-       char* name)
+static int
+dissect_sattr3(tvbuff_t *tvb, int offset, proto_tree *tree, char* name)
 {
        proto_item* sattr3_item = NULL;
        proto_tree* sattr3_tree = NULL;
        int old_offset = offset;
 
        if (tree) {
-               sattr3_item = proto_tree_add_text(tree, tvb, offset,
-                       tvb_length_remaining(tvb, offset), "%s", name);
+               sattr3_item = proto_tree_add_text(tree, tvb, offset, -1,
+                       "%s", name);
                sattr3_tree = proto_item_add_subtree(sattr3_item, ett_nfs_sattr3);
        }
 
-       offset = dissect_set_mode3(tvb, offset, pinfo, sattr3_tree, "mode");
-       offset = dissect_set_uid3 (tvb, offset, pinfo, sattr3_tree, "uid");
-       offset = dissect_set_gid3 (tvb, offset, pinfo, sattr3_tree, "gid");
-       offset = dissect_set_size3(tvb, offset, pinfo, sattr3_tree, "size");
-       offset = dissect_set_atime(tvb, offset, pinfo, sattr3_tree, "atime");
-       offset = dissect_set_mtime(tvb, offset, pinfo, sattr3_tree, "mtime");
+       offset = dissect_set_mode3(tvb, offset, sattr3_tree, "mode");
+       offset = dissect_set_uid3 (tvb, offset, sattr3_tree, "uid");
+       offset = dissect_set_gid3 (tvb, offset, sattr3_tree, "gid");
+       offset = dissect_set_size3(tvb, offset, sattr3_tree, "size");
+       offset = dissect_set_atime(tvb, offset, sattr3_tree, "atime");
+       offset = dissect_set_mtime(tvb, offset, sattr3_tree, "mtime");
 
        /* now we know, that sattr3 is shorter */
        if (sattr3_item) {
@@ -3198,8 +3370,8 @@ dissect_sattr3(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
 
 
 /* RFC 1813, Page 27 */
-int
-dissect_diropargs3(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_diropargs3(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree *tree, char* name)
 {
        proto_item* diropargs3_item = NULL;
@@ -3209,9 +3381,9 @@ dissect_diropargs3(tvbuff_t *tvb, int offset, packet_info *pinfo,
        int name_offset, name_len;
 
        if (tree) {
-               diropargs3_item = proto_tree_add_text(tree, tvb, offset,
-                       tvb_length_remaining(tvb, offset), "%s", name);
-               diropargs3_tree = proto_item_add_subtree(diropargs3_item, 
+               diropargs3_item = proto_tree_add_text(tree, tvb, offset, -1,
+                       "%s", name);
+               diropargs3_tree = proto_item_add_subtree(diropargs3_item,
                        ett_nfs_diropargs3);
        }
 
@@ -3220,7 +3392,7 @@ dissect_diropargs3(tvbuff_t *tvb, int offset, packet_info *pinfo,
        offset = dissect_nfs_fh3(tvb, offset, pinfo, diropargs3_tree, "dir");
        name_offset=offset+4;
        name_len=tvb_get_ntohl(tvb, offset);
-       offset = dissect_filename3(tvb, offset, pinfo, diropargs3_tree, 
+       offset = dissect_filename3(tvb, offset, diropargs3_tree,
                hf_nfs_name, NULL);
 
        /* are we snooping fh to filenames ?*/
@@ -3233,7 +3405,7 @@ dissect_diropargs3(tvbuff_t *tvb, int offset, packet_info *pinfo,
                  &&(civ->request)
                  &&((civ->proc==3)||(civ->proc==8)||(civ->proc==9))
                ) {
-                       nfs_name_snoop_add_name(civ->xid, tvb, 
+                       nfs_name_snoop_add_name(civ->xid, tvb,
                                name_offset, name_len,
                                parent_offset, parent_len, NULL);
                }
@@ -3250,8 +3422,8 @@ dissect_diropargs3(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
 
 /* RFC 1813, Page 27 */
-int
-dissect_nfs3_diropargs3_call(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_nfs3_diropargs3_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree *tree)
 {
        offset = dissect_diropargs3(tvb, offset, pinfo, tree, "object");
@@ -3261,8 +3433,8 @@ dissect_nfs3_diropargs3_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
 
 /* RFC 1813, Page 40 */
-int
-dissect_access(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
+static int
+dissect_access(tvbuff_t *tvb, int offset, proto_tree *tree,
        char* name)
 {
        guint32 access;
@@ -3270,7 +3442,7 @@ dissect_access(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
        proto_tree* access_tree = NULL;
 
        access = tvb_get_ntohl(tvb, offset+0);
-       
+
        if (tree) {
                access_item = proto_tree_add_text(tree, tvb, offset, 4,
                        "%s: 0x%02x", name, access);
@@ -3299,8 +3471,8 @@ dissect_access(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
 
 
 /* NFS3 file handle dissector */
-int
-dissect_nfs3_nfs_fh3_call(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_nfs3_nfs_fh3_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree* tree)
 {
        offset = dissect_nfs_fh3(tvb, offset, pinfo, tree, "object");
@@ -3308,23 +3480,9 @@ dissect_nfs3_nfs_fh3_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
 }
 
 
-/* generic NFS3 reply dissector */
-int
-dissect_nfs3_any_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, 
-       proto_tree* tree)
-{
-       guint32 status;
-
-       offset = dissect_nfsstat3(tvb, offset, pinfo, tree, &status);
-
-       return offset;
-
-}
-
-
 /* RFC 1813, Page 32,33 */
-int
-dissect_nfs3_getattr_call(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_nfs3_getattr_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree* tree)
 {
        offset = dissect_nfs_fh3(tvb, offset, pinfo, tree, "object");
@@ -3333,30 +3491,29 @@ dissect_nfs3_getattr_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
 
 /* RFC 1813, Page 32,33 */
-int
-dissect_nfs3_getattr_reply(tvbuff_t *tvb, int offset, packet_info *pinfo
+static int
+dissect_nfs3_getattr_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
        proto_tree* tree)
 {
        guint32 status;
 
-       offset = dissect_nfsstat3(tvb, offset, pinfo, tree, &status);
+       offset = dissect_nfsstat3(tvb, offset, tree, &status);
        switch (status) {
                case 0:
-                       offset = dissect_fattr3(tvb, offset, pinfo, tree, "obj_attributes");
+                       offset = dissect_fattr3(tvb, offset, tree, "obj_attributes");
                break;
                default:
                        /* void */
                break;
        }
-               
+
        return offset;
 }
 
 
 /* RFC 1813, Page 33 */
-int
-dissect_sattrguard3(tvbuff_t *tvb, int offset, packet_info *pinfo, 
-       proto_tree* tree, char *name)
+static int
+dissect_sattrguard3(tvbuff_t *tvb, int offset, proto_tree* tree, char *name)
 {
        proto_item* sattrguard3_item = NULL;
        proto_tree* sattrguard3_tree = NULL;
@@ -3368,10 +3525,9 @@ dissect_sattrguard3(tvbuff_t *tvb, int offset, packet_info *pinfo,
        check_name = val_to_str(check,value_follows,"Unknown");
 
        if (tree) {
-               sattrguard3_item = proto_tree_add_text(tree, tvb, offset,
-                       tvb_length_remaining(tvb, offset), "%s: %s",
-                       name, check_name);
-               sattrguard3_tree = proto_item_add_subtree(sattrguard3_item, 
+               sattrguard3_item = proto_tree_add_text(tree, tvb, offset, -1,
+                       "%s: %s", name, check_name);
+               sattrguard3_tree = proto_item_add_subtree(sattrguard3_item,
                        ett_nfs_sattrguard3);
        }
 
@@ -3383,7 +3539,7 @@ dissect_sattrguard3(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
        switch (check) {
                case TRUE:
-                       offset = dissect_nfstime3(tvb, offset, pinfo, sattrguard3_tree,
+                       offset = dissect_nfstime3(tvb, offset, sattrguard3_tree,
                                        hf_nfs_ctime, hf_nfs_ctime_sec, hf_nfs_ctime_nsec);
                break;
                case FALSE:
@@ -3401,41 +3557,41 @@ dissect_sattrguard3(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
 
 /* RFC 1813, Page 33..36 */
-int
-dissect_nfs3_setattr_call(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_nfs3_setattr_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree* tree)
 {
        offset = dissect_nfs_fh3    (tvb, offset, pinfo, tree, "object");
-       offset = dissect_sattr3     (tvb, offset, pinfo, tree, "new_attributes");
-       offset = dissect_sattrguard3(tvb, offset, pinfo, tree, "guard");
+       offset = dissect_sattr3     (tvb, offset,        tree, "new_attributes");
+       offset = dissect_sattrguard3(tvb, offset,        tree, "guard");
        return offset;
 }
 
 
 /* RFC 1813, Page 33..36 */
-int
-dissect_nfs3_setattr_reply(tvbuff_t *tvb, int offset, packet_info *pinfo
+static int
+dissect_nfs3_setattr_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
        proto_tree* tree)
 {
        guint32 status;
 
-       offset = dissect_nfsstat3(tvb, offset, pinfo, tree, &status);
+       offset = dissect_nfsstat3(tvb, offset, tree, &status);
        switch (status) {
                case 0:
-                       offset = dissect_wcc_data(tvb, offset, pinfo, tree, "obj_wcc");
+                       offset = dissect_wcc_data(tvb, offset, tree, "obj_wcc");
                break;
                default:
-                       offset = dissect_wcc_data(tvb, offset, pinfo, tree, "obj_wcc");
+                       offset = dissect_wcc_data(tvb, offset, tree, "obj_wcc");
                break;
        }
-               
+
        return offset;
 }
 
 
 /* RFC 1813, Page 37..39 */
-int
-dissect_nfs3_lookup_call(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_nfs3_lookup_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree* tree)
 {
        offset = dissect_diropargs3 (tvb, offset, pinfo, tree, "what");
@@ -3444,129 +3600,129 @@ dissect_nfs3_lookup_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
 
 /* RFC 1813, Page 37..39 */
-int
-dissect_nfs3_lookup_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_nfs3_lookup_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree* tree)
 {
        guint32 status;
 
-       offset = dissect_nfsstat3(tvb, offset, pinfo, tree, &status);
+       offset = dissect_nfsstat3(tvb, offset, tree, &status);
        switch (status) {
                case 0:
                        offset = dissect_nfs_fh3(tvb, offset, pinfo, tree, "object");
-                       offset = dissect_post_op_attr(tvb, offset, pinfo, tree, 
+                       offset = dissect_post_op_attr(tvb, offset, tree,
                                "obj_attributes");
-                       offset = dissect_post_op_attr(tvb, offset, pinfo, tree, 
+                       offset = dissect_post_op_attr(tvb, offset, tree,
                                "dir_attributes");
                break;
                default:
-                       offset = dissect_post_op_attr(tvb, offset, pinfo, tree, 
+                       offset = dissect_post_op_attr(tvb, offset, tree,
                                "dir_attributes");
                break;
        }
-               
+
        return offset;
 }
 
 
 /* RFC 1813, Page 40..43 */
-int
-dissect_nfs3_access_call(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_nfs3_access_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree* tree)
 {
        offset = dissect_nfs_fh3(tvb, offset, pinfo, tree, "object");
-       offset = dissect_access (tvb, offset, pinfo, tree, "access");
+       offset = dissect_access (tvb, offset,        tree, "access");
 
        return offset;
 }
 
 
 /* RFC 1813, Page 40..43 */
-int
-dissect_nfs3_access_reply(tvbuff_t *tvb, int offset, packet_info *pinfo
+static int
+dissect_nfs3_access_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
        proto_tree* tree)
 {
        guint32 status;
 
-       offset = dissect_nfsstat3(tvb, offset, pinfo, tree, &status);
+       offset = dissect_nfsstat3(tvb, offset, tree, &status);
        switch (status) {
                case 0:
-                       offset = dissect_post_op_attr(tvb, offset, pinfo, tree, 
+                       offset = dissect_post_op_attr(tvb, offset, tree,
                                "obj_attributes");
-                       offset = dissect_access(tvb, offset, pinfo, tree, "access");
+                       offset = dissect_access(tvb, offset, tree, "access");
                break;
                default:
-                       offset = dissect_post_op_attr(tvb, offset, pinfo, tree, 
+                       offset = dissect_post_op_attr(tvb, offset, tree,
                                "obj_attributes");
                break;
        }
-               
+
        return offset;
 }
 
 
 /* RFC 1813, Page 44,45 */
-int
-dissect_nfs3_readlink_reply(tvbuff_t *tvb, int offset, packet_info *pinfo
+static int
+dissect_nfs3_readlink_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
        proto_tree* tree)
 {
        guint32 status;
 
-       offset = dissect_nfsstat3(tvb, offset, pinfo, tree, &status);
+       offset = dissect_nfsstat3(tvb, offset, tree, &status);
        switch (status) {
                case 0:
-                       offset = dissect_post_op_attr(tvb, offset, pinfo, tree, 
+                       offset = dissect_post_op_attr(tvb, offset, tree,
                                "symlink_attributes");
-                       offset = dissect_nfspath3(tvb, offset, pinfo, tree, 
+                       offset = dissect_nfspath3(tvb, offset, tree,
                                hf_nfs_readlink_data);
                break;
                default:
-                       offset = dissect_post_op_attr(tvb, offset, pinfo, tree, 
+                       offset = dissect_post_op_attr(tvb, offset, tree,
                                "symlink_attributes");
                break;
        }
-               
+
        return offset;
 }
 
 
 /* RFC 1813, Page 46..48 */
-int
-dissect_nfs3_read_call(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_nfs3_read_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree* tree)
 {
        offset = dissect_nfs_fh3(tvb, offset, pinfo, tree, "file");
-       offset = dissect_rpc_uint64(tvb, pinfo, tree, hf_nfs_offset3, offset);
-       offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nfs_count3, offset);
+       offset = dissect_rpc_uint64(tvb, tree, hf_nfs_offset3, offset);
+       offset = dissect_rpc_uint32(tvb, tree, hf_nfs_count3, offset);
 
        return offset;
 }
 
 
 /* RFC 1813, Page 46..48 */
-int
-dissect_nfs3_read_reply(tvbuff_t *tvb, int offset, packet_info *pinfo
+static int
+dissect_nfs3_read_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
        proto_tree* tree)
 {
        guint32 status;
 
-       offset = dissect_nfsstat3(tvb, offset, pinfo, tree, &status);
+       offset = dissect_nfsstat3(tvb, offset, tree, &status);
        switch (status) {
                case 0:
-                       offset = dissect_post_op_attr(tvb, offset, pinfo, tree, 
+                       offset = dissect_post_op_attr(tvb, offset, tree,
                                "file_attributes");
-                       offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nfs_count3, 
+                       offset = dissect_rpc_uint32(tvb, tree, hf_nfs_count3,
                                offset);
-                       offset = dissect_rpc_bool(tvb, pinfo, tree, hf_nfs_read_eof, 
+                       offset = dissect_rpc_bool(tvb, tree, hf_nfs_read_eof,
                                offset);
-                       offset = dissect_nfsdata(tvb, offset, pinfo, tree, hf_nfs_data);
+                       offset = dissect_nfsdata(tvb, offset, tree, hf_nfs_data);
                break;
                default:
-                       offset = dissect_post_op_attr(tvb, offset, pinfo, tree, 
+                       offset = dissect_post_op_attr(tvb, offset, tree,
                                "file_attributes");
                break;
        }
-               
+
        return offset;
 }
 
@@ -3581,16 +3737,15 @@ static const value_string names_stable_how[] = {
 
 
 /* RFC 1813, Page 49 */
-int
-dissect_stable_how(tvbuff_t *tvb, int offset, packet_info *pinfo, 
-       proto_tree* tree, int hfindex)
+static int
+dissect_stable_how(tvbuff_t *tvb, int offset, proto_tree* tree, int hfindex)
 {
        guint32 stable_how;
 
        stable_how = tvb_get_ntohl(tvb,offset+0);
        if (tree) {
                proto_tree_add_uint(tree, hfindex, tvb,
-                       offset, 4, stable_how); 
+                       offset, 4, stable_how);
        }
        offset += 4;
 
@@ -3599,42 +3754,42 @@ dissect_stable_how(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
 
 /* RFC 1813, Page 49..54 */
-int
-dissect_nfs3_write_call(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_nfs3_write_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree* tree)
 {
        offset = dissect_nfs_fh3   (tvb, offset, pinfo, tree, "file");
-       offset = dissect_rpc_uint64(tvb, pinfo, tree, hf_nfs_offset3, offset);
-       offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nfs_count3, offset);
-       offset = dissect_stable_how(tvb, offset, pinfo, tree, hf_nfs_write_stable);
-       offset = dissect_nfsdata   (tvb, offset, pinfo, tree, hf_nfs_data);
+       offset = dissect_rpc_uint64(tvb, tree, hf_nfs_offset3, offset);
+       offset = dissect_rpc_uint32(tvb, tree, hf_nfs_count3, offset);
+       offset = dissect_stable_how(tvb, offset, tree, hf_nfs_write_stable);
+       offset = dissect_nfsdata   (tvb, offset, tree, hf_nfs_data);
 
        return offset;
 }
 
 
 /* RFC 1813, Page 49..54 */
-int
-dissect_nfs3_write_reply(tvbuff_t *tvb, int offset, packet_info *pinfo
+static int
+dissect_nfs3_write_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
        proto_tree* tree)
 {
        guint32 status;
 
-       offset = dissect_nfsstat3(tvb, offset, pinfo, tree, &status);
+       offset = dissect_nfsstat3(tvb, offset, tree, &status);
        switch (status) {
                case 0:
-                       offset = dissect_wcc_data  (tvb, offset, pinfo, tree, "file_wcc");
-                       offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nfs_count3, 
+                       offset = dissect_wcc_data  (tvb, offset, tree, "file_wcc");
+                       offset = dissect_rpc_uint32(tvb, tree, hf_nfs_count3,
                                offset);
-                       offset = dissect_stable_how(tvb, offset, pinfo, tree,
+                       offset = dissect_stable_how(tvb, offset, tree,
                                hf_nfs_write_committed);
-                       offset = dissect_writeverf3(tvb, offset, pinfo, tree);
+                       offset = dissect_writeverf3(tvb, offset, tree);
                break;
                default:
-                       offset = dissect_wcc_data(tvb, offset, pinfo, tree, "file_wcc");
+                       offset = dissect_wcc_data(tvb, offset, tree, "file_wcc");
                break;
        }
-               
+
        return offset;
 }
 
@@ -3649,12 +3804,11 @@ static const value_string names_createmode3[] = {
 
 
 /* RFC 1813, Page 54 */
-int
-dissect_createmode3(tvbuff_t *tvb, int offset, packet_info *pinfo, 
-       proto_tree* tree, guint32* mode)
+static int
+dissect_createmode3(tvbuff_t *tvb, int offset, proto_tree* tree, guint32* mode)
 {
        guint32 mode_value;
-       
+
        mode_value = tvb_get_ntohl(tvb, offset + 0);
        if (tree) {
                proto_tree_add_uint(tree, hf_nfs_createmode3, tvb,
@@ -3668,215 +3822,216 @@ dissect_createmode3(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
 
 /* RFC 1813, Page 54..58 */
-int
-dissect_nfs3_create_call(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_nfs3_create_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree* tree)
 {
        guint32 mode;
 
        offset = dissect_diropargs3 (tvb, offset, pinfo, tree, "where");
-       offset = dissect_createmode3(tvb, offset, pinfo, tree, &mode);
+       offset = dissect_createmode3(tvb, offset, tree, &mode);
        switch (mode) {
                case UNCHECKED:
                case GUARDED:
-                       offset = dissect_sattr3(tvb, offset, pinfo, tree, "obj_attributes");
+                       offset = dissect_sattr3(tvb, offset, tree, "obj_attributes");
                break;
                case EXCLUSIVE:
-                       offset = dissect_createverf3(tvb, offset, pinfo, tree);
+                       offset = dissect_createverf3(tvb, offset, tree);
                break;
        }
-       
+
        return offset;
 }
 
 
 /* RFC 1813, Page 54..58 */
-int
-dissect_nfs3_create_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_nfs3_create_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree* tree)
 {
        guint32 status;
 
-       offset = dissect_nfsstat3(tvb, offset, pinfo, tree, &status);
+       offset = dissect_nfsstat3(tvb, offset, tree, &status);
        switch (status) {
                case 0:
                        offset = dissect_post_op_fh3 (tvb, offset, pinfo, tree, "obj");
-                       offset = dissect_post_op_attr(tvb, offset, pinfo, tree, 
+                       offset = dissect_post_op_attr(tvb, offset, tree,
                                "obj_attributes");
-                       offset = dissect_wcc_data(tvb, offset, pinfo, tree, "dir_wcc");
+                       offset = dissect_wcc_data(tvb, offset, tree, "dir_wcc");
                break;
                default:
-                       offset = dissect_wcc_data(tvb, offset, pinfo, tree, "dir_wcc");
+                       offset = dissect_wcc_data(tvb, offset, tree, "dir_wcc");
                break;
        }
-               
+
        return offset;
 }
 
 
 /* RFC 1813, Page 58..60 */
-int
-dissect_nfs3_mkdir_call(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_nfs3_mkdir_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree* tree)
 {
        offset = dissect_diropargs3(tvb, offset, pinfo, tree, "where");
-       offset = dissect_sattr3    (tvb, offset, pinfo, tree, "attributes");
-       
+       offset = dissect_sattr3    (tvb, offset, tree, "attributes");
+
        return offset;
 }
 
 
 /* RFC 1813, Page 61..63 */
-int
-dissect_nfs3_symlink_call(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_nfs3_symlink_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree* tree)
 {
        offset = dissect_diropargs3(tvb, offset, pinfo, tree, "where");
-       offset = dissect_sattr3    (tvb, offset, pinfo, tree, "symlink_attributes");
-       offset = dissect_nfspath3  (tvb, offset, pinfo, tree, hf_nfs_symlink_to);
-       
+       offset = dissect_sattr3    (tvb, offset,        tree, "symlink_attributes");
+       offset = dissect_nfspath3  (tvb, offset,        tree, hf_nfs_symlink_to);
+
        return offset;
 }
 
 
 /* RFC 1813, Page 63..66 */
-int
-dissect_nfs3_mknod_call(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_nfs3_mknod_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree* tree)
 {
        guint32 type;
 
        offset = dissect_diropargs3(tvb, offset, pinfo, tree, "where");
-       offset = dissect_ftype3(tvb, offset, pinfo, tree, hf_nfs_ftype3, &type);
+       offset = dissect_ftype3(tvb, offset, tree, hf_nfs_ftype3, &type);
        switch (type) {
                case NF3CHR:
                case NF3BLK:
-                       offset = dissect_sattr3(tvb, offset, pinfo, tree, "dev_attributes");
-                       offset = dissect_specdata3(tvb, offset, pinfo, tree, "spec");
+                       offset = dissect_sattr3(tvb, offset, tree, "dev_attributes");
+                       offset = dissect_specdata3(tvb, offset, tree, "spec");
                break;
                case NF3SOCK:
                case NF3FIFO:
-                       offset = dissect_sattr3(tvb, offset, pinfo, tree, "pipe_attributes");
+                       offset = dissect_sattr3(tvb, offset, tree, "pipe_attributes");
                break;
                default:
                        /* nothing to do */
                break;
        }
-       
+
        return offset;
 }
 
 
 /* RFC 1813, Page 67..69 */
-int
-dissect_nfs3_remove_reply(tvbuff_t *tvb, int offset, packet_info *pinfo
+static int
+dissect_nfs3_remove_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
        proto_tree* tree)
 {
        guint32 status;
 
-       offset = dissect_nfsstat3(tvb, offset, pinfo, tree, &status);
+       offset = dissect_nfsstat3(tvb, offset, tree, &status);
        switch (status) {
                case 0:
-                       offset = dissect_wcc_data    (tvb, offset, pinfo, tree, "dir_wcc");
+                       offset = dissect_wcc_data(tvb, offset, tree, "dir_wcc");
                break;
                default:
-                       offset = dissect_wcc_data    (tvb, offset, pinfo, tree, "dir_wcc");
+                       offset = dissect_wcc_data(tvb, offset, tree, "dir_wcc");
                break;
        }
-               
+
        return offset;
 }
 
 
 /* RFC 1813, Page 71..74 */
-int
-dissect_nfs3_rename_call(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_nfs3_rename_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree* tree)
 {
        offset = dissect_diropargs3(tvb, offset, pinfo, tree, "from");
        offset = dissect_diropargs3(tvb, offset, pinfo, tree, "to");
-       
+
        return offset;
 }
 
 
 /* RFC 1813, Page 71..74 */
-int
-dissect_nfs3_rename_reply(tvbuff_t *tvb, int offset, packet_info *pinfo
+static int
+dissect_nfs3_rename_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
        proto_tree* tree)
 {
        guint32 status;
 
-       offset = dissect_nfsstat3(tvb, offset, pinfo, tree, &status);
+       offset = dissect_nfsstat3(tvb, offset, tree, &status);
        switch (status) {
                case 0:
-                       offset = dissect_wcc_data(tvb, offset, pinfo, tree, "fromdir_wcc");
-                       offset = dissect_wcc_data(tvb, offset, pinfo, tree, "todir_wcc");
+                       offset = dissect_wcc_data(tvb, offset, tree, "fromdir_wcc");
+                       offset = dissect_wcc_data(tvb, offset, tree, "todir_wcc");
                break;
                default:
-                       offset = dissect_wcc_data(tvb, offset, pinfo, tree, "fromdir_wcc");
-                       offset = dissect_wcc_data(tvb, offset, pinfo, tree, "todir_wcc");
+                       offset = dissect_wcc_data(tvb, offset, tree, "fromdir_wcc");
+                       offset = dissect_wcc_data(tvb, offset, tree, "todir_wcc");
                break;
        }
-               
+
        return offset;
 }
 
 
 /* RFC 1813, Page 74..76 */
-int
-dissect_nfs3_link_call(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_nfs3_link_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree* tree)
 {
        offset = dissect_nfs_fh3   (tvb, offset, pinfo, tree, "file");
        offset = dissect_diropargs3(tvb, offset, pinfo, tree, "link");
-       
+
        return offset;
 }
 
 
 /* RFC 1813, Page 74..76 */
-int
-dissect_nfs3_link_reply(tvbuff_t *tvb, int offset, packet_info *pinfo
+static int
+dissect_nfs3_link_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
        proto_tree* tree)
 {
        guint32 status;
 
-       offset = dissect_nfsstat3(tvb, offset, pinfo, tree, &status);
+       offset = dissect_nfsstat3(tvb, offset, tree, &status);
        switch (status) {
                case 0:
-                       offset = dissect_post_op_attr(tvb, offset, pinfo, tree, 
+                       offset = dissect_post_op_attr(tvb, offset, tree,
                                "file_attributes");
-                       offset = dissect_wcc_data(tvb, offset, pinfo, tree, "linkdir_wcc");
+                       offset = dissect_wcc_data(tvb, offset, tree, "linkdir_wcc");
                break;
                default:
-                       offset = dissect_post_op_attr(tvb, offset, pinfo, tree, 
+                       offset = dissect_post_op_attr(tvb, offset, tree,
                                "file_attributes");
-                       offset = dissect_wcc_data(tvb, offset, pinfo, tree, "linkdir_wcc");
+                       offset = dissect_wcc_data(tvb, offset, tree, "linkdir_wcc");
                break;
        }
-               
+
        return offset;
 }
 
 
 /* RFC 1813, Page 76..80 */
-int
-dissect_nfs3_readdir_call(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_nfs3_readdir_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree* tree)
 {
        offset = dissect_nfs_fh3    (tvb, offset, pinfo, tree, "dir");
-       offset = dissect_rpc_uint64(tvb, pinfo, tree, hf_nfs_cookie3, offset);
-       offset = dissect_cookieverf3(tvb, offset, pinfo, tree);
-       offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nfs_count3, offset);
-       
+       offset = dissect_rpc_uint64(tvb, tree, hf_nfs_cookie3, offset);
+       offset = dissect_cookieverf3(tvb, offset, tree);
+       offset = dissect_rpc_uint32(tvb, tree, hf_nfs_count3, offset);
+
        return offset;
 }
 
 
 /* RFC 1813, Page 76..80 */
-int
-dissect_entry3(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree* tree)
+static int
+dissect_entry3(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
+       proto_tree* tree)
 {
        proto_item* entry_item = NULL;
        proto_tree* entry_tree = NULL;
@@ -3885,20 +4040,20 @@ dissect_entry3(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree* tree)
 
        if (tree) {
                entry_item = proto_tree_add_item(tree, hf_nfs_readdir_entry, tvb,
-                       offset+0, tvb_length_remaining(tvb, offset), FALSE);
+                       offset+0, -1, FALSE);
                entry_tree = proto_item_add_subtree(entry_item, ett_nfs_readdir_entry);
        }
 
-       offset = dissect_rpc_uint64(tvb, pinfo, entry_tree, hf_nfs_readdir_entry3_fileid,
+       offset = dissect_rpc_uint64(tvb, entry_tree, hf_nfs_readdir_entry3_fileid,
                offset);
 
-       offset = dissect_filename3(tvb, offset, pinfo, entry_tree,
+       offset = dissect_filename3(tvb, offset, entry_tree,
                hf_nfs_readdir_entry3_name, &name);
        if (entry_item)
                proto_item_set_text(entry_item, "Entry: name %s", name);
        g_free(name);
 
-       offset = dissect_rpc_uint64(tvb, pinfo, entry_tree, hf_nfs_readdir_entry3_cookie, 
+       offset = dissect_rpc_uint64(tvb, entry_tree, hf_nfs_readdir_entry3_cookie,
                offset);
 
        /* now we know, that a readdir entry is shorter */
@@ -3911,20 +4066,20 @@ dissect_entry3(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree* tree)
 
 
 /* RFC 1813, Page 76..80 */
-int
-dissect_nfs3_readdir_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_nfs3_readdir_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree* tree)
 {
        guint32 status;
        guint32 eof_value;
 
-       offset = dissect_stat(tvb, offset, pinfo, tree, &status);
+       offset = dissect_stat(tvb, offset, tree, &status);
        switch (status) {
                case 0:
-                       offset = dissect_post_op_attr(tvb, offset, pinfo, tree, 
+                       offset = dissect_post_op_attr(tvb, offset, tree,
                                "dir_attributes");
-                       offset = dissect_cookieverf3(tvb, offset, pinfo, tree);
-                       offset = dissect_rpc_list(tvb, pinfo, tree, offset, 
+                       offset = dissect_cookieverf3(tvb, offset, tree);
+                       offset = dissect_rpc_list(tvb, pinfo, tree, offset,
                                dissect_entry3);
                        eof_value = tvb_get_ntohl(tvb, offset+0);
                        if (tree)
@@ -3933,7 +4088,7 @@ dissect_nfs3_readdir_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
                        offset += 4;
                break;
                default:
-                       offset = dissect_post_op_attr(tvb, offset, pinfo, tree, 
+                       offset = dissect_post_op_attr(tvb, offset, tree,
                                "dir_attributes");
                break;
        }
@@ -3943,25 +4098,25 @@ dissect_nfs3_readdir_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
 
 /* RFC 1813, Page 80..83 */
-int
-dissect_nfs3_readdirplus_call(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_nfs3_readdirplus_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree* tree)
 {
        offset = dissect_nfs_fh3    (tvb, offset, pinfo, tree, "dir");
-       offset = dissect_rpc_uint64(tvb, pinfo, tree, hf_nfs_cookie3, offset);
-       offset = dissect_cookieverf3(tvb, offset, pinfo, tree);
-       offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nfs_count3_dircount,
+       offset = dissect_rpc_uint64(tvb, tree, hf_nfs_cookie3, offset);
+       offset = dissect_cookieverf3(tvb, offset, tree);
+       offset = dissect_rpc_uint32(tvb, tree, hf_nfs_count3_dircount,
                offset);
-       offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nfs_count3_maxcount,
+       offset = dissect_rpc_uint32(tvb, tree, hf_nfs_count3_maxcount,
                offset);
-       
+
        return offset;
 }
 
 
 /* RFC 1813, Page 80..83 */
-int
-dissect_entryplus3(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_entryplus3(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree* tree)
 {
        proto_item* entry_item = NULL;
@@ -3971,23 +4126,23 @@ dissect_entryplus3(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
        if (tree) {
                entry_item = proto_tree_add_item(tree, hf_nfs_readdir_entry, tvb,
-                       offset+0, tvb_length_remaining(tvb, offset), FALSE);
+                       offset+0, -1, FALSE);
                entry_tree = proto_item_add_subtree(entry_item, ett_nfs_readdir_entry);
        }
 
-       offset = dissect_rpc_uint64(tvb, pinfo, entry_tree,
+       offset = dissect_rpc_uint64(tvb, entry_tree,
                hf_nfs_readdirplus_entry_fileid, offset);
 
-       offset = dissect_filename3(tvb, offset, pinfo, entry_tree,
+       offset = dissect_filename3(tvb, offset, entry_tree,
                hf_nfs_readdirplus_entry_name, &name);
        if (entry_item)
                proto_item_set_text(entry_item, "Entry: name %s", name);
        g_free(name);
 
-       offset = dissect_rpc_uint64(tvb, pinfo, entry_tree, hf_nfs_readdirplus_entry_cookie,
+       offset = dissect_rpc_uint64(tvb, entry_tree, hf_nfs_readdirplus_entry_cookie,
                offset);
 
-       offset = dissect_post_op_attr(tvb, offset, pinfo, entry_tree, 
+       offset = dissect_post_op_attr(tvb, offset, entry_tree,
                "name_attributes");
        offset = dissect_post_op_fh3(tvb, offset, pinfo, entry_tree, "name_handle");
 
@@ -4001,20 +4156,20 @@ dissect_entryplus3(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
 
 /* RFC 1813, Page 80..83 */
-int
-dissect_nfs3_readdirplus_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_nfs3_readdirplus_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree* tree)
 {
        guint32 status;
        guint32 eof_value;
 
-       offset = dissect_stat(tvb, offset, pinfo, tree, &status);
+       offset = dissect_stat(tvb, offset, tree, &status);
        switch (status) {
                case 0:
-                       offset = dissect_post_op_attr(tvb, offset, pinfo, tree, 
+                       offset = dissect_post_op_attr(tvb, offset, tree,
                                "dir_attributes");
-                       offset = dissect_cookieverf3(tvb, offset, pinfo, tree);
-                       offset = dissect_rpc_list(tvb, pinfo, tree, offset, 
+                       offset = dissect_cookieverf3(tvb, offset, tree);
+                       offset = dissect_rpc_list(tvb, pinfo, tree, offset,
                                dissect_entryplus3);
                        eof_value = tvb_get_ntohl(tvb, offset+0);
                        if (tree)
@@ -4023,7 +4178,7 @@ dissect_nfs3_readdirplus_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
                        offset += 4;
                break;
                default:
-                       offset = dissect_post_op_attr(tvb, offset, pinfo, tree, 
+                       offset = dissect_post_op_attr(tvb, offset, tree,
                                "dir_attributes");
                break;
        }
@@ -4033,29 +4188,29 @@ dissect_nfs3_readdirplus_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
 
 /* RFC 1813, Page 84..86 */
-int
-dissect_nfs3_fsstat_reply(tvbuff_t *tvb, int offset, packet_info *pinfo
+static int
+dissect_nfs3_fsstat_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
        proto_tree* tree)
 {
        guint32 status;
        guint32 invarsec;
 
-       offset = dissect_nfsstat3(tvb, offset, pinfo, tree, &status);
+       offset = dissect_nfsstat3(tvb, offset, tree, &status);
        switch (status) {
                case 0:
-                       offset = dissect_post_op_attr(tvb, offset, pinfo, tree, 
+                       offset = dissect_post_op_attr(tvb, offset, tree,
                                "obj_attributes");
-                       offset = dissect_rpc_uint64(tvb, pinfo, tree, hf_nfs_fsstat3_resok_tbytes,
+                       offset = dissect_rpc_uint64(tvb, tree, hf_nfs_fsstat3_resok_tbytes,
                                offset);
-                       offset = dissect_rpc_uint64(tvb, pinfo, tree, hf_nfs_fsstat3_resok_fbytes,
+                       offset = dissect_rpc_uint64(tvb, tree, hf_nfs_fsstat3_resok_fbytes,
                                offset);
-                       offset = dissect_rpc_uint64(tvb, pinfo, tree, hf_nfs_fsstat3_resok_abytes,
+                       offset = dissect_rpc_uint64(tvb, tree, hf_nfs_fsstat3_resok_abytes,
                                offset);
-                       offset = dissect_rpc_uint64(tvb, pinfo, tree, hf_nfs_fsstat3_resok_tfiles,
+                       offset = dissect_rpc_uint64(tvb, tree, hf_nfs_fsstat3_resok_tfiles,
                                offset);
-                       offset = dissect_rpc_uint64(tvb, pinfo, tree, hf_nfs_fsstat3_resok_ffiles,
+                       offset = dissect_rpc_uint64(tvb, tree, hf_nfs_fsstat3_resok_ffiles,
                                offset);
-                       offset = dissect_rpc_uint64(tvb, pinfo, tree, hf_nfs_fsstat3_resok_afiles,
+                       offset = dissect_rpc_uint64(tvb, tree, hf_nfs_fsstat3_resok_afiles,
                                offset);
                        invarsec = tvb_get_ntohl(tvb, offset + 0);
                        if (tree)
@@ -4064,7 +4219,7 @@ dissect_nfs3_fsstat_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
                        offset += 4;
                break;
                default:
-                       offset = dissect_post_op_attr(tvb, offset, pinfo, tree, 
+                       offset = dissect_post_op_attr(tvb, offset, tree,
                                "obj_attributes");
                break;
        }
@@ -4080,8 +4235,8 @@ dissect_nfs3_fsstat_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
 
 /* RFC 1813, Page 86..90 */
-int
-dissect_nfs3_fsinfo_reply(tvbuff_t *tvb, int offset, packet_info *pinfo
+static int
+dissect_nfs3_fsinfo_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
        proto_tree* tree)
 {
        guint32 status;
@@ -4096,10 +4251,10 @@ dissect_nfs3_fsinfo_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_item*     properties_item = NULL;
        proto_tree*     properties_tree = NULL;
 
-       offset = dissect_nfsstat3(tvb, offset, pinfo, tree, &status);
+       offset = dissect_nfsstat3(tvb, offset, tree, &status);
        switch (status) {
                case 0:
-                       offset = dissect_post_op_attr(tvb, offset, pinfo, tree, 
+                       offset = dissect_post_op_attr(tvb, offset, tree,
                                "obj_attributes");
                        rtmax = tvb_get_ntohl(tvb, offset+0);
                        if (tree)
@@ -4137,16 +4292,16 @@ dissect_nfs3_fsinfo_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
                                offset+0, 4, dtpref);
                        offset += 4;
 
-                       offset = dissect_rpc_uint64(tvb, pinfo, tree, 
+                       offset = dissect_rpc_uint64(tvb, tree,
                                hf_nfs_fsinfo_maxfilesize, offset);
-                       offset = dissect_nfstime3(tvb, offset, pinfo, tree, hf_nfs_dtime, hf_nfs_dtime_sec, hf_nfs_dtime_nsec);
+                       offset = dissect_nfstime3(tvb, offset, tree, hf_nfs_dtime, hf_nfs_dtime_sec, hf_nfs_dtime_nsec);
                        properties = tvb_get_ntohl(tvb, offset+0);
                        if (tree) {
                                properties_item = proto_tree_add_uint(tree,
                                hf_nfs_fsinfo_properties,
                                tvb, offset+0, 4, properties);
-                               if (properties_item) 
-                                       properties_tree = proto_item_add_subtree(properties_item, 
+                               if (properties_item)
+                                       properties_tree = proto_item_add_subtree(properties_item,
                                                ett_nfs_fsinfo_properties);
                                if (properties_tree) {
                                        proto_tree_add_text(properties_tree, tvb,
@@ -4181,7 +4336,7 @@ dissect_nfs3_fsinfo_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
                        offset += 4;
                break;
                default:
-                       offset = dissect_post_op_attr(tvb, offset, pinfo, tree, 
+                       offset = dissect_post_op_attr(tvb, offset, tree,
                                "obj_attributes");
                break;
        }
@@ -4191,18 +4346,18 @@ dissect_nfs3_fsinfo_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
 
 /* RFC 1813, Page 90..92 */
-int
-dissect_nfs3_pathconf_reply(tvbuff_t *tvb, int offset, packet_info *pinfo
+static int
+dissect_nfs3_pathconf_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
        proto_tree* tree)
 {
        guint32 status;
        guint32 linkmax;
        guint32 name_max;
 
-       offset = dissect_nfsstat3(tvb, offset, pinfo, tree, &status);
+       offset = dissect_nfsstat3(tvb, offset, tree, &status);
        switch (status) {
                case 0:
-                       offset = dissect_post_op_attr(tvb, offset, pinfo, tree, 
+                       offset = dissect_post_op_attr(tvb, offset, tree,
                                "obj_attributes");
                        linkmax = tvb_get_ntohl(tvb, offset + 0);
                        if (tree)
@@ -4214,17 +4369,17 @@ dissect_nfs3_pathconf_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
                                proto_tree_add_uint(tree, hf_nfs_pathconf_name_max, tvb,
                                offset+0, 4, name_max);
                        offset += 4;
-                       offset = dissect_rpc_bool(tvb, pinfo, tree, 
+                       offset = dissect_rpc_bool(tvb, tree,
                                hf_nfs_pathconf_no_trunc, offset);
-                       offset = dissect_rpc_bool(tvb, pinfo, tree, 
+                       offset = dissect_rpc_bool(tvb, tree,
                                hf_nfs_pathconf_chown_restricted, offset);
-                       offset = dissect_rpc_bool(tvb, pinfo, tree, 
+                       offset = dissect_rpc_bool(tvb, tree,
                                hf_nfs_pathconf_case_insensitive, offset);
-                       offset = dissect_rpc_bool(tvb, pinfo, tree, 
+                       offset = dissect_rpc_bool(tvb, tree,
                                hf_nfs_pathconf_case_preserving, offset);
                break;
                default:
-                       offset = dissect_post_op_attr(tvb, offset, pinfo, tree, 
+                       offset = dissect_post_op_attr(tvb, offset, tree,
                                "obj_attributes");
                break;
        }
@@ -4234,35 +4389,35 @@ dissect_nfs3_pathconf_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
 
 /* RFC 1813, Page 92..95 */
-int
-dissect_nfs3_commit_call(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_nfs3_commit_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree* tree)
 {
        offset = dissect_nfs_fh3(tvb, offset, pinfo, tree, "file");
-       offset = dissect_rpc_uint64(tvb, pinfo, tree, hf_nfs_offset3, offset);
-       offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nfs_count3, offset);
+       offset = dissect_rpc_uint64(tvb, tree, hf_nfs_offset3, offset);
+       offset = dissect_rpc_uint32(tvb, tree, hf_nfs_count3, offset);
        return offset;
 }
 
 
 /* RFC 1813, Page 92..95 */
-int
-dissect_nfs3_commit_reply(tvbuff_t *tvb, int offset, packet_info *pinfo
+static int
+dissect_nfs3_commit_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
        proto_tree* tree)
 {
        guint32 status;
 
-       offset = dissect_nfsstat3(tvb, offset, pinfo, tree, &status);
+       offset = dissect_nfsstat3(tvb, offset, tree, &status);
        switch (status) {
                case 0:
-                       offset = dissect_wcc_data  (tvb, offset, pinfo, tree, "file_wcc");
-                       offset = dissect_writeverf3(tvb, offset, pinfo, tree);
+                       offset = dissect_wcc_data  (tvb, offset, tree, "file_wcc");
+                       offset = dissect_writeverf3(tvb, offset, tree);
                break;
                default:
-                       offset = dissect_wcc_data(tvb, offset, pinfo, tree, "file_wcc");
+                       offset = dissect_wcc_data(tvb, offset, tree, "file_wcc");
                break;
        }
-               
+
        return offset;
 }
 
@@ -4270,37 +4425,19 @@ dissect_nfs3_commit_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
 /* NFS Version 4, RFC 3010 with nfs4_prot.x 1.103 changes */
 /**********************************************************/
 
-int
-dissect_nfs_utf8string(tvbuff_t *tvb, int offset, packet_info *pinfo,
+static int
+dissect_nfs_utf8string(tvbuff_t *tvb, int offset,
        proto_tree *tree, int hf, char **string_ret)
 {
-       /* TODO: this needs to be fixed */
-       return dissect_rpc_string(tvb, pinfo, tree, hf, offset, string_ret);
-}
-
-int
-dissect_nfs_linktext4(tvbuff_t *tvb, int offset, packet_info *pinfo,
-       proto_tree *tree, char *name)
-{
-       return dissect_nfs_utf8string(tvb, offset, pinfo, tree, hf_nfs_linktext4, 
-               NULL);
-}
-
-int
-dissect_nfs_specdata4(tvbuff_t *tvb, int offset, packet_info *pinfo,
-       proto_tree *tree, char *name)
-{
-       offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nfs_specdata1, offset);
-       offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nfs_specdata2, offset);
-
-       return offset;
+       /* TODO: this dissector is subject to change; do not remove */
+       return dissect_rpc_string(tvb, tree, hf, offset, string_ret);
 }
 
-int
-dissect_nfs_clientid4(tvbuff_t *tvb, int offset, packet_info *pinfo,
-       proto_tree *tree)
+static int
+dissect_nfs_specdata4(tvbuff_t *tvb, int offset, proto_tree *tree)
 {
-       offset = dissect_rpc_uint64(tvb, pinfo, tree, hf_nfs_clientid4, offset);
+       offset = dissect_rpc_uint32(tvb, tree, hf_nfs_specdata1, offset);
+       offset = dissect_rpc_uint32(tvb, tree, hf_nfs_specdata2, offset);
 
        return offset;
 }
@@ -4318,97 +4455,61 @@ static const value_string names_ftype4[] = {
        { 0, NULL }
 };
 
-int
-dissect_nfs_component4(tvbuff_t *tvb, int offset, packet_info *pinfo,
-       proto_tree *tree, char *name)
-{
-       return dissect_nfs_utf8string(tvb, offset, pinfo, tree, hf_nfs_component4, 
-               NULL);
-}
-
-int
-dissect_nfs_reclaim4(tvbuff_t *tvb, int offset, packet_info *pinfo,
-       proto_tree *tree, char *name)
-{
-       offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nfs_reclaim4, offset);
-       return offset;
-}
-
-int
-dissect_nfs_length4(tvbuff_t *tvb, int offset, packet_info *pinfo,
-       proto_tree *tree, char *name)
-{
-       offset = dissect_rpc_uint64(tvb, pinfo, tree, hf_nfs_length4, offset);
-       return offset;
-}
-
-int
-dissect_nfs_opaque4(tvbuff_t *tvb, int offset, packet_info *pinfo,
-       proto_tree *tree, char *name);
-
-int
-dissect_nfs_lock_owner4(tvbuff_t *tvb, int offset, packet_info *pinfo,
-       proto_tree *tree, char *name)
+static int
+dissect_nfs_lock_owner4(tvbuff_t *tvb, int offset, proto_tree *tree)
 {
        proto_tree *newftree = NULL;
        proto_item *fitem = NULL;
 
        fitem = proto_tree_add_text(tree, tvb, offset, 4, "Owner");
 
-       if (fitem) {
+       if (fitem)
+       {
                newftree = proto_item_add_subtree(fitem, ett_nfs_lock_owner4);
 
-               if (newftree) {
-                       offset = dissect_rpc_uint64(tvb, pinfo, newftree, hf_nfs_clientid4,
-                               offset);
-                       offset = dissect_nfs_opaque4(tvb, offset, pinfo, newftree, "Owner");
+               if (newftree)
+               {
+                       offset = dissect_rpc_uint64(tvb, newftree, hf_nfs_clientid4, offset);
+                       offset = dissect_nfsdata(tvb, offset, newftree, hf_nfs_data);
                }
        }
 
        return offset;
 }
 
-int
-dissect_nfs_pathname4(tvbuff_t *tvb, int offset, packet_info *pinfo,
-       proto_tree *tree, char *name)
+static int
+dissect_nfs_pathname4(tvbuff_t *tvb, int offset, proto_tree *tree)
 {
-       guint comp_count, i;
+       guint32 comp_count, i;
        proto_item *fitem = NULL;
        proto_tree *newftree = NULL;
 
        comp_count=tvb_get_ntohl(tvb, offset);
-       fitem = proto_tree_add_text(tree, tvb, offset, 4, 
-               "pathname components (%d)", comp_count);
+       fitem = proto_tree_add_text(tree, tvb, offset, 4,
+               "pathname components (%u)", comp_count);
        offset += 4;
 
-       if (fitem) {
+       if (fitem)
+       {
                newftree = proto_item_add_subtree(fitem, ett_nfs_pathname4);
 
-               if (newftree) {
-                       for (i=0; i<comp_count; i++)
-                               offset=dissect_nfs_component4(tvb, offset, pinfo, newftree, "comp");
+               if (newftree)
+               {
+                       for (i = 0; i < comp_count; i++)
+                               offset = dissect_nfs_utf8string(tvb, offset, newftree,
+                                       hf_nfs_component4, NULL);
                }
        }
 
        return offset;
 }
 
-int
-dissect_nfs_changeid4(tvbuff_t *tvb, int offset, packet_info *pinfo,
-       proto_tree *tree, char *name)
+static int
+dissect_nfs_nfstime4(tvbuff_t *tvb, int offset, proto_tree *tree)
 {
-       offset = dissect_rpc_uint64(tvb, pinfo, tree, hf_nfs_changeid4, offset);
-       return offset;
-}
+       offset = dissect_rpc_uint64(tvb, tree, hf_nfs_nfstime4_seconds, offset);
+       offset = dissect_rpc_uint32(tvb, tree, hf_nfs_nfstime4_nseconds, offset);
 
-int
-dissect_nfs_nfstime4(tvbuff_t *tvb, int offset, packet_info *pinfo,
-       proto_tree *tree, char *name)
-{
-       offset = dissect_rpc_uint64(tvb, pinfo, tree, hf_nfs_nfstime4_seconds, 
-               offset);
-       offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nfs_nfstime4_nseconds,
-               offset);
        return offset;
 }
 
@@ -4420,54 +4521,25 @@ static const value_string names_time_how4[] = {
        {       0,      NULL    },
 };
 
-int
-dissect_nfs_settime4(tvbuff_t *tvb, int offset, packet_info *pinfo,
-       proto_tree *tree, char *name)
+static int
+dissect_nfs_settime4(tvbuff_t *tvb, int offset,
+       proto_tree *tree, char *name _U_)
 {
        guint32 set_it;
 
        set_it = tvb_get_ntohl(tvb, offset);
-       proto_tree_add_uint(tree, hf_nfs_time_how4, tvb, offset+0, 
+       proto_tree_add_uint(tree, hf_nfs_time_how4, tvb, offset+0,
                4, set_it);
        offset += 4;
 
        if (set_it == SET_TO_CLIENT_TIME4)
-               offset = dissect_nfs_nfstime4(tvb, offset, pinfo, tree, NULL);
-       
-       return offset;
-}
-
-static const value_string names_fattr4_expire_type[] = {
-#define FH4_PERSISTENT 0x00000000
-       {       FH4_PERSISTENT, "FH4_PERSISTENT"        },
-#define FH4_NOEXPIRE_WITH_OPEN 0x00000001
-       {       FH4_NOEXPIRE_WITH_OPEN, "FH4_NOEXPIRE_WITH_OPEN"        },
-#define FH4_VOLATILE_ANY 0x00000002
-       {       FH4_NOEXPIRE_WITH_OPEN, "FH4_NOEXPIRE_WITH_OPEN"        },
-#define FH4_VOL_MIGRATION 0x00000004
-       {       FH4_VOL_MIGRATION,      "FH4_VOL_MIGRATION"     },
-#define FH4_VOL_RENAME 0x00000008
-       {       FH4_VOL_RENAME, "FH4_VOL_RENAME"        },
-       {       0,      NULL    }
-};
-
-int
-dissect_nfs_fh_expire_type(tvbuff_t *tvb, int offset, packet_info *pinfo,
-       proto_tree *tree)
-{
-       guint32 fattr4_fh_expire_type;
-
-       fattr4_fh_expire_type = tvb_get_ntohl(tvb, offset);
-       proto_tree_add_uint(tree, hf_nfs_fattr4_expire_type, tvb, offset+0, 
-               4, fattr4_fh_expire_type);
-       offset += 4;
+               offset = dissect_nfs_nfstime4(tvb, offset, tree);
 
        return offset;
 }
 
-int
-dissect_nfs_fsid4(tvbuff_t *tvb, int offset, packet_info *pinfo, 
-       proto_tree *tree, char *name)
+static int
+dissect_nfs_fsid4(tvbuff_t *tvb, int offset, proto_tree *tree, char *name)
 {
        proto_tree *newftree = NULL;
        proto_item *fitem = NULL;
@@ -4480,87 +4552,244 @@ dissect_nfs_fsid4(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
        if (newftree == NULL) return offset;
 
-       offset = dissect_rpc_uint64(tvb, pinfo, newftree, hf_nfs_fsid4_major,
+       offset = dissect_rpc_uint64(tvb, newftree, hf_nfs_fsid4_major,
                offset);
-       offset = dissect_rpc_uint64(tvb, pinfo, newftree, hf_nfs_fsid4_minor,
+       offset = dissect_rpc_uint64(tvb, newftree, hf_nfs_fsid4_minor,
                offset);
 
        return offset;
 }
 
-int
-dissect_nfs_acetype4(tvbuff_t *tvb, int offset, packet_info *pinfo,
-       proto_tree *tree, char *name)
-{
-       offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nfs_acetype4, offset);
-       return offset;
-}
+static const value_string names_acetype4[] = {
+#define ACE4_ACCESS_ALLOWED_ACE_TYPE   0x00000000
+       {       ACE4_ACCESS_ALLOWED_ACE_TYPE, "ACE4_ACCESS_ALLOWED_ACE_TYPE"  },
+#define ACE4_ACCESS_DENIED_ACE_TYPE            0x00000001
+       {       ACE4_ACCESS_DENIED_ACE_TYPE, "ACE4_ACCESS_DENIED_ACE_TYPE" },
+#define ACE4_SYSTEM_AUDIT_ACE_TYPE             0x00000002
+       {       ACE4_SYSTEM_AUDIT_ACE_TYPE, "ACE4_SYSTEM_AUDIT_ACE_TYPE" },
+#define ACE4_SYSTEM_ALARM_ACE_TYPE             0x00000003
+       {       ACE4_SYSTEM_ALARM_ACE_TYPE, "ACE4_SYSTEM_ALARM_ACE_TYPE"        },
+       { 0, NULL }
+};
+
+/* ACE mask values */
+#define ACE4_READ_DATA                         0x00000001
+#define ACE4_LIST_DIRECTORY            0x00000001
+#define ACE4_WRITE_DATA                                0x00000002
+#define ACE4_ADD_FILE                          0x00000002
+#define ACE4_APPEND_DATA                       0x00000004
+#define ACE4_ADD_SUBDIRECTORY          0x00000004
+#define ACE4_READ_NAMED_ATTRS          0x00000008
+#define ACE4_WRITE_NAMED_ATTRS 0x00000010
+#define ACE4_EXECUTE                                   0x00000020
+#define ACE4_DELETE_CHILD                      0x00000040
+#define ACE4_READ_ATTRIBUTES           0x00000080
+#define ACE4_WRITE_ATTRIBUTES          0x00000100
+#define ACE4_DELETE                                    0x00010000
+#define ACE4_READ_ACL                          0x00020000
+#define ACE4_WRITE_ACL                         0x00040000
+#define ACE4_WRITE_OWNER                       0x00080000
+#define ACE4_SYNCHRONIZE                       0x00100000
+
+static int
+dissect_nfs_acemask4(tvbuff_t *tvb, int offset, proto_tree *tree)
+{
+       guint32 acemask;
+       proto_item *acemask_item = NULL;
+       proto_tree *acemask_tree = NULL;
+
+       acemask = tvb_get_ntohl(tvb, offset);
+
+       acemask_item = proto_tree_add_text(tree, tvb, offset, 4,
+               "acemask: 0x%08x", acemask);
+
+       if (acemask_item)
+               acemask_tree = proto_item_add_subtree(acemask_item, ett_nfs_acemask4);
+
+       if (acemask_tree)
+       {
+               if (acemask & ACE4_READ_DATA)
+                       proto_tree_add_text(acemask_tree, tvb, offset, 4,
+                               "ACE4_READ_DATA/ACE4_LIST_DIRECTORY (0x%08x)",
+                               ACE4_READ_DATA);
+
+               if (acemask & ACE4_WRITE_DATA)
+                       proto_tree_add_text(acemask_tree, tvb, offset, 4,
+                               "ACE4_WRITE_DATA/ACE4_ADD_FILE (0x%08x)",
+                               ACE4_WRITE_DATA);
+
+               if (acemask & ACE4_APPEND_DATA)
+                       proto_tree_add_text(acemask_tree, tvb, offset, 4,
+                               "ACE4_ADD_FILE/ACE4_ADD_SUBDIRECTORY (0x%08x)",
+                               ACE4_APPEND_DATA);
+
+               if (acemask & ACE4_READ_NAMED_ATTRS)
+                       proto_tree_add_text(acemask_tree, tvb, offset, 4,
+                               "ACE4_READ_NAMED_ATTRS (0x%08x)",
+                               ACE4_READ_NAMED_ATTRS);
+
+               if (acemask & ACE4_WRITE_NAMED_ATTRS)
+                       proto_tree_add_text(acemask_tree, tvb, offset, 4,
+                               "ACE4_WRITE_NAMED_ATTRS (0x%08x)",
+                               ACE4_WRITE_NAMED_ATTRS);
+
+               if (acemask & ACE4_EXECUTE)
+                       proto_tree_add_text(acemask_tree, tvb, offset, 4,
+                               "ACE4_EXECUTE (0x%08x)",
+                               ACE4_EXECUTE);
+
+               if (acemask & ACE4_DELETE_CHILD)
+                       proto_tree_add_text(acemask_tree, tvb, offset, 4,
+                               "ACE4_DELETE_CHILD (0x%08x)",
+                               ACE4_DELETE_CHILD);
+
+               if (acemask & ACE4_READ_ATTRIBUTES)
+                       proto_tree_add_text(acemask_tree, tvb, offset, 4,
+                               "ACE4_READ_ATTRIBUTES (0x%08x)",
+                               ACE4_READ_ATTRIBUTES);
+
+               if (acemask & ACE4_WRITE_ATTRIBUTES)
+                       proto_tree_add_text(acemask_tree, tvb, offset, 4,
+                               "ACE4_WRITE_ATTRIBUTES (0x%08x)",
+                               ACE4_WRITE_ATTRIBUTES);
+
+               if (acemask & ACE4_DELETE)
+                       proto_tree_add_text(acemask_tree, tvb, offset, 4,
+                               "ACE4_DELETE (0x%08x)",
+                               ACE4_DELETE);
+
+               if (acemask & ACE4_READ_ACL)
+                       proto_tree_add_text(acemask_tree, tvb, offset, 4,
+                               "ACE4_READ_ACL (0x%08x)",
+                               ACE4_READ_ACL);
+
+               if (acemask & ACE4_WRITE_ACL)
+                       proto_tree_add_text(acemask_tree, tvb, offset, 4,
+                               "ACE4_WRITE_ACL (0x%08x)",
+                               ACE4_WRITE_ACL);
+
+               if (acemask & ACE4_WRITE_OWNER)
+                       proto_tree_add_text(acemask_tree, tvb, offset, 4,
+                               "ACE4_WRITE_OWNER (0x%08x)",
+                               ACE4_WRITE_OWNER);
+
+               if (acemask & ACE4_SYNCHRONIZE)
+                       proto_tree_add_text(acemask_tree, tvb, offset, 4,
+                               "ACE4_SYNCHRONIZE (0x%08x)",
+                               ACE4_SYNCHRONIZE);
+       }
+
+       offset += 4;
 
-int
-dissect_nfs_aceflag4(tvbuff_t *tvb, int offset, packet_info *pinfo,
-       proto_tree *tree, char *name)
-{
-       offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nfs_aceflag4, offset);
        return offset;
 }
 
-int
-dissect_nfs_acemask4(tvbuff_t *tvb, int offset, packet_info *pinfo,
-       proto_tree *tree, char *name)
-{
-       return dissect_rpc_uint32(tvb, pinfo, tree, hf_nfs_acemask4, offset);
-}
+/* ACE flag values */
+#define ACE4_FILE_INHERIT_ACE                                  0x00000001
+#define ACE4_DIRECTORY_INHERIT_ACE                     0x00000002
+#define ACE4_NO_PROPAGATE_INHERIT_ACE          0x00000004
+#define ACE4_INHERIT_ONLY_ACE                                  0x00000008
+#define ACE4_SUCCESSFUL_ACCESS_ACE_FLAG        0x00000010
+#define ACE4_FAILED_ACCESS_ACE_FLAG                    0x00000020
+#define ACE4_IDENTIFIER_GROUP                                  0x00000040
 
-int
-dissect_nfs_nfsace4(tvbuff_t *tvb, int offset, packet_info *pinfo, 
-       proto_tree *tree, char *name)
+
+static int
+dissect_nfs_ace4(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
+       proto_tree *tree)
 {
-       proto_tree *newftree = NULL;
-       proto_item *fitem = NULL;
-       int nextentry;
+       proto_item* ace_item = NULL;
+       proto_tree* ace_tree = NULL;
+       proto_item *aceflag_item = NULL;
+       proto_tree *aceflag_tree = NULL;
+       guint32 aceflag4;
 
-       fitem = proto_tree_add_text(tree, tvb, offset, 0, "%s", name);
+       if (tree) {
+               ace_item = proto_tree_add_text(tree, tvb, offset, 4,
+                       "ACE");
 
-       if (fitem == NULL) return offset;
+               if (ace_item)
+                       ace_tree = proto_item_add_subtree(ace_item, ett_nfs_ace4);
+       }
 
-       newftree = proto_item_add_subtree(fitem, ett_nfs_fsid4);
+       if (ace_tree) {
+               offset = dissect_rpc_uint32(tvb, ace_tree, hf_nfs_acetype4, offset);
 
-       if (newftree == NULL) return offset;
+               aceflag4 = tvb_get_ntohl(tvb, offset);
 
-       nextentry = tvb_get_ntohl(tvb, offset);
-       offset = dissect_rpc_bool(tvb, pinfo, newftree, hf_nfs_data_follows,
-               offset);
+               aceflag_item = proto_tree_add_text(ace_tree, tvb, offset, 4,
+                       "aceflag: 0x%08x", aceflag4);
+
+               if (aceflag_item)
+               {
+                       aceflag_tree = proto_item_add_subtree(aceflag_item, ett_nfs_aceflag4);
+
+                       if (aceflag_tree)
+                       {
+                               if (aceflag4 & ACE4_FILE_INHERIT_ACE)
+                                       proto_tree_add_text(aceflag_tree, tvb, offset, 4,
+                                               "ACE4_FILE_INHERIT_ACE (0x%08x)", ACE4_FILE_INHERIT_ACE);
+
+                               if (aceflag4 & ACE4_DIRECTORY_INHERIT_ACE)
+                                       proto_tree_add_text(aceflag_tree, tvb, offset, 4,
+                                               "ACE4_DIRECTORY_INHERIT_ACE (0x%08x)",
+                                                ACE4_DIRECTORY_INHERIT_ACE);
+
+                               if (aceflag4 & ACE4_INHERIT_ONLY_ACE)
+                                       proto_tree_add_text(aceflag_tree, tvb, offset, 4,
+                                               "ACE4_INHERIT_ONLY_ACE (0x%08x)",
+                                               ACE4_INHERIT_ONLY_ACE);
+
+                               if (aceflag4 & ACE4_SUCCESSFUL_ACCESS_ACE_FLAG)
+                                       proto_tree_add_text(aceflag_tree, tvb, offset, 4,
+                                               "ACE4_SUCCESSFUL_ACCESS_ACE_FLAG (0x%08x)",
+                                               ACE4_SUCCESSFUL_ACCESS_ACE_FLAG);
+
+                               if (aceflag4 & ACE4_FAILED_ACCESS_ACE_FLAG)
+                                       proto_tree_add_text(aceflag_tree, tvb, offset, 4,
+                                               "ACE4_FAILED_ACCESS_ACE_FLAG (0x%08x)",
+                                               ACE4_FAILED_ACCESS_ACE_FLAG);
+
+                               if (aceflag4 & ACE4_IDENTIFIER_GROUP)
+                                       proto_tree_add_text(aceflag_tree, tvb, offset, 4,
+                                               "ACE4_IDENTIFIER_GROUP (0x%08x)",
+                                               ACE4_IDENTIFIER_GROUP);
+                       }
+               }
 
-       while (nextentry)
-       {
-               offset = dissect_nfs_acetype4(tvb, offset, pinfo, newftree, "type");
-               offset = dissect_nfs_aceflag4(tvb, offset, pinfo, newftree, "flag");
-               offset = dissect_nfs_acemask4(tvb, offset, pinfo, newftree, 
-                       "access_mask");
-               offset = dissect_nfs_utf8string(tvb, offset, pinfo, newftree, 
-                       hf_nfs_who, NULL);
-               nextentry = tvb_get_ntohl(tvb, offset);
                offset += 4;
+
+               offset = dissect_nfs_acemask4(tvb, offset, ace_tree);
+
+               offset = dissect_nfs_utf8string(tvb, offset, ace_tree, hf_nfs_who, NULL);
        }
 
        return offset;
 }
 
-int
+static int
+dissect_nfs_fattr4_acl(tvbuff_t *tvb, int offset, packet_info *pinfo,
+       proto_tree *tree)
+{
+       return dissect_rpc_array(tvb, pinfo, tree, offset, dissect_nfs_ace4,
+               hf_nfs_acl4);
+}
+
+static int
 dissect_nfs_fh4(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree *tree, char *name)
 {
        return dissect_nfs_fh3(tvb, offset, pinfo, tree, name);
 }
 
-int
-dissect_nfs_fs_location4(tvbuff_t *tvb, int offset, packet_info *pinfo,
-       proto_tree *tree, char *name)
+static int
+dissect_nfs_fs_location4(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
+       proto_tree *tree)
 {
        proto_tree *newftree = NULL;
        proto_item *fitem = NULL;
 
-       fitem = proto_tree_add_text(tree, tvb, offset, 0, "%s", name);
+       fitem = proto_tree_add_text(tree, tvb, offset, 0, "rootpath");
 
        if (fitem == NULL) return offset;
 
@@ -4568,19 +4797,17 @@ dissect_nfs_fs_location4(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
        if (newftree == NULL) return offset;
 
-       offset = dissect_nfs_utf8string(tvb, offset, pinfo, tree, hf_nfs_server, 
-               NULL);
+       offset = dissect_nfs_utf8string(tvb, offset, tree, hf_nfs_server, NULL);
 
        return offset;
 }
 
-int
-dissect_nfs_fs_locations4(tvbuff_t *tvb, int offset, packet_info *pinfo,
+static int
+dissect_nfs_fs_locations4(tvbuff_t *tvb, packet_info *pinfo, int offset,
        proto_tree *tree, char *name)
 {
        proto_tree *newftree = NULL;
        proto_item *fitem = NULL;
-       int nextentry;
 
        fitem = proto_tree_add_text(tree, tvb, offset, 0, "%s", name);
 
@@ -4590,28 +4817,85 @@ dissect_nfs_fs_locations4(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
        if (newftree == NULL) return offset;
 
-       offset = dissect_nfs_pathname4(tvb, offset, pinfo, newftree, "fs_root");
+       offset = dissect_nfs_pathname4(tvb, offset, newftree);
 
-       nextentry = tvb_get_ntohl(tvb, offset);
-       offset = dissect_rpc_bool(tvb, pinfo, newftree, hf_nfs_data_follows, 
-               offset);
-
-       while (nextentry)
-       {
-               offset = dissect_nfs_fs_location4(tvb, offset, pinfo, newftree, 
-                       "locations");
-               nextentry = tvb_get_ntohl(tvb, offset);
-               offset += 4;
-       }
+       offset = dissect_rpc_list(tvb, pinfo, tree, offset,
+               dissect_nfs_fs_location4);
 
        return offset;
 }
 
-int
-dissect_nfs_mode4(tvbuff_t *tvb, int offset, packet_info *pinfo,
+static int
+dissect_nfs_mode4(tvbuff_t *tvb, int offset,
        proto_tree *tree, char *name)
 {
-       return dissect_mode(tvb, offset, pinfo, tree, name);
+       return dissect_mode(tvb, offset, tree, name);
+}
+
+static const value_string nfs4_fattr4_fh_expire_type_names[] = {
+#define FH4_PERSISTENT 0x00000000
+       {       FH4_PERSISTENT, "FH4_PERSISTENT"        },
+#define FH4_NOEXPIRE_WITH_OPEN 0x00000001
+       {       FH4_NOEXPIRE_WITH_OPEN, "FH4_NOEXPIRE_WITH_OPEN"        },
+#define FH4_VOLATILE_ANY 0x00000002
+       {       FH4_VOLATILE_ANY,       "FH4_VOLATILE_ANY"      },
+#define FH4_VOL_MIGRATION 0x00000004
+       {       FH4_VOL_MIGRATION,      "FH4_VOL_MIGRATION"     },
+#define FH4_VOL_RENAME 0x00000008
+       {       FH4_VOL_RENAME, "FH4_VOL_RENAME"        },
+       {       0,      NULL    }
+};
+
+
+static int
+dissect_nfs_fattr4_fh_expire_type(tvbuff_t *tvb, int offset, proto_tree *tree)
+{
+       guint32 expire_type;
+       proto_item *expire_type_item = NULL;
+       proto_tree *expire_type_tree = NULL;
+
+       expire_type = tvb_get_ntohl(tvb, offset + 0);
+
+       if (tree)
+       {
+               expire_type_item = proto_tree_add_text(tree, tvb, offset, 4,
+                       "fattr4_fh_expire_type: 0x%08x", expire_type);
+               if (expire_type_item)
+                       expire_type_tree = proto_item_add_subtree(expire_type_item,
+                               ett_nfs_fattr4_fh_expire_type);
+       }
+
+       if (expire_type_tree)
+       {
+               if (expire_type == FH4_PERSISTENT)
+               {
+                       proto_tree_add_text(expire_type_tree, tvb, offset, 4, "%s",
+                               decode_enumerated_bitfield(expire_type, FH4_PERSISTENT, 8,
+                               nfs4_fattr4_fh_expire_type_names, "%s"));
+               }
+               else
+               {
+                       if (expire_type & FH4_NOEXPIRE_WITH_OPEN)
+                               proto_tree_add_text(expire_type_tree, tvb, offset, 4,
+                                               "FH4_NOEXPIRE_WITH_OPEN (0x%08x)", FH4_NOEXPIRE_WITH_OPEN);
+
+                       if (expire_type & FH4_VOLATILE_ANY)
+                               proto_tree_add_text(expire_type_tree, tvb, offset, 4,
+                                               "FH4_VOLATILE_ANY (0x%08x)", FH4_VOLATILE_ANY);
+
+                       if (expire_type & FH4_VOL_MIGRATION)
+                               proto_tree_add_text(expire_type_tree, tvb, offset, 4,
+                                               "FH4_VOL_MIGRATION (0x%08x)", FH4_VOL_MIGRATION);
+
+                       if (expire_type & FH4_VOL_RENAME)
+                               proto_tree_add_text(expire_type_tree, tvb, offset, 4,
+                                               "FH4_VOL_RENAME (0x%08x)", FH4_VOL_RENAME);
+               }
+       }
+
+       offset += 4;
+
+       return offset;
 }
 
 static const value_string names_fattr4[] = {
@@ -4725,23 +5009,26 @@ static const value_string names_fattr4[] = {
        {       FATTR4_TIME_MODIFY, "FATTR4_TIME_MODIFY"        },
 #define FATTR4_TIME_MODIFY_SET     54
        {       FATTR4_TIME_MODIFY_SET, "FATTR4_TIME_MODIFY_SET"        },
+#define FATTR4_MOUNTED_ON_FILEID   55
+       {       FATTR4_MOUNTED_ON_FILEID, "FATTR4_MOUNTED_ON_FILEID"    },
        {       0,      NULL    }
 };
 
 #define FATTR4_BITMAP_ONLY 0
 #define FATTR4_FULL_DISSECT 1
 
-int
+static int
 dissect_nfs_attributes(tvbuff_t *tvb, int offset, packet_info *pinfo,
-       proto_tree *tree, char *name, int type)
+       proto_tree *tree, int type)
 {
        guint32 bitmap_len;
        proto_item *fitem = NULL;
        proto_tree *newftree = NULL;
        proto_item *attr_fitem = NULL;
        proto_tree *attr_newftree = NULL;
-       unsigned int i;
-       int j, fattr;
+       guint32 i;
+       gint j;
+       guint32 fattr;
        guint32 *bitmap;
        guint32 sl;
        int attr_vals_offset;
@@ -4759,7 +5046,7 @@ dissect_nfs_attributes(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
        attr_vals_offset = offset + 4 + bitmap_len * 4;
 
-       bitmap = g_malloc(bitmap_len * sizeof(guint32));        
+       bitmap = g_malloc(bitmap_len * sizeof(guint32));
        if (bitmap == NULL) return offset;
 
        for (i = 0; i < bitmap_len; i++)
@@ -4781,8 +5068,8 @@ dissect_nfs_attributes(tvbuff_t *tvb, int offset, packet_info *pinfo,
                        if (bitmap[i] & sl)
                        {
                                /* switch label if attribute is recommended vs. mandatory */
-                               attr_fitem = proto_tree_add_uint(newftree, 
-                                       (fattr < FATTR4_ACL)? hf_nfs_mand_attr: hf_nfs_recc_attr, 
+                               attr_fitem = proto_tree_add_uint(newftree,
+                                       (fattr < FATTR4_ACL)? hf_nfs_mand_attr: hf_nfs_recc_attr,
                                        tvb, offset, 4, fattr);
 
                                if (attr_fitem == NULL) break;
@@ -4797,118 +5084,118 @@ dissect_nfs_attributes(tvbuff_t *tvb, int offset, packet_info *pinfo,
                                        switch(fattr)
                                        {
                                        case FATTR4_SUPPORTED_ATTRS:
-                                               attr_vals_offset = dissect_nfs_attributes(tvb, 
-                                                       attr_vals_offset, pinfo, attr_newftree, 
-                                                       "fattr4_supported_attrs", FATTR4_BITMAP_ONLY);
+                                               attr_vals_offset = dissect_nfs_attributes(tvb,
+                                                       attr_vals_offset, pinfo, attr_newftree,
+                                                       FATTR4_BITMAP_ONLY);
                                                break;
-                                               
+
                                        case FATTR4_TYPE:
-                                               attr_vals_offset = dissect_rpc_uint32(tvb, pinfo, 
+                                               attr_vals_offset = dissect_rpc_uint32(tvb,
                                                        attr_newftree, hf_nfs_ftype4, attr_vals_offset);
                                                break;
 
                                        case FATTR4_FH_EXPIRE_TYPE:
-                                               attr_vals_offset = dissect_rpc_uint32(tvb, pinfo,
-                                                       attr_newftree, hf_nfs_fattr4_expire_type, 
-                                                       attr_vals_offset);
+                                               attr_vals_offset = dissect_nfs_fattr4_fh_expire_type(tvb,
+                                                       attr_vals_offset, attr_newftree);
                                                break;
 
                                        case FATTR4_CHANGE:
-                                               attr_vals_offset = dissect_nfs_changeid4(tvb, 
-                                                       attr_vals_offset, pinfo, attr_newftree, "fattr4_change");
+                                               attr_vals_offset = dissect_rpc_uint64(tvb, attr_newftree,
+                                                       hf_nfs_changeid4, attr_vals_offset);
                                                break;
 
                                        case FATTR4_SIZE:
-                                               attr_vals_offset = dissect_rpc_uint64(tvb, pinfo, 
+                                               attr_vals_offset = dissect_rpc_uint64(tvb,
                                                        attr_newftree, hf_nfs_fattr4_size, attr_vals_offset);
                                                break;
 
                                        case FATTR4_LINK_SUPPORT:
-                                               attr_vals_offset = dissect_rpc_bool(tvb, pinfo, 
-                                                       attr_newftree, hf_nfs_fattr4_link_support, 
+                                               attr_vals_offset = dissect_rpc_bool(tvb,
+                                                       attr_newftree, hf_nfs_fattr4_link_support,
                                                        attr_vals_offset);
                                                break;
 
                                        case FATTR4_SYMLINK_SUPPORT:
-                                               attr_vals_offset = dissect_rpc_bool(tvb, pinfo, 
-                                                       attr_newftree, hf_nfs_fattr4_symlink_support, 
+                                               attr_vals_offset = dissect_rpc_bool(tvb,
+                                                       attr_newftree, hf_nfs_fattr4_symlink_support,
                                                        attr_vals_offset);
                                                break;
 
                                        case FATTR4_NAMED_ATTR:
-                                               attr_vals_offset = dissect_rpc_bool(tvb, pinfo, 
+                                               attr_vals_offset = dissect_rpc_bool(tvb,
                                                        attr_newftree, hf_nfs_fattr4_named_attr, attr_vals_offset);
                                                break;
 
                                        case FATTR4_FSID:
                                                attr_vals_offset = dissect_nfs_fsid4(tvb, attr_vals_offset,
-                                                       pinfo, attr_newftree, "fattr4_fsid");
+                                                       attr_newftree, "fattr4_fsid");
                                                break;
 
                                        case FATTR4_UNIQUE_HANDLES:
-                                               attr_vals_offset = dissect_rpc_bool(tvb, pinfo, 
-                                                       attr_newftree, hf_nfs_fattr4_unique_handles, 
+                                               attr_vals_offset = dissect_rpc_bool(tvb,
+                                                       attr_newftree, hf_nfs_fattr4_unique_handles,
                                                        attr_vals_offset);
                                                break;
 
                                        case FATTR4_LEASE_TIME:
-                                               attr_vals_offset = dissect_rpc_uint32(tvb, pinfo, 
-                                                       attr_newftree, hf_nfs_fattr4_lease_time, 
+                                               attr_vals_offset = dissect_rpc_uint32(tvb,
+                                                       attr_newftree, hf_nfs_fattr4_lease_time,
                                                        attr_vals_offset);
                                                break;
 
                                        case FATTR4_RDATTR_ERROR:
-                                               attr_vals_offset = dissect_nfs_nfsstat4(tvb, attr_vals_offset,
-                                                       pinfo, attr_newftree, NULL);
+                                               attr_vals_offset = dissect_nfs_nfsstat4(tvb,
+                                                       attr_vals_offset, attr_newftree, NULL);
                                                break;
 
                                        case FATTR4_ACL:
-                                               attr_vals_offset = dissect_nfs_nfsace4(tvb, attr_vals_offset,
-                                                       pinfo, attr_newftree, "fattr4_acl");
+                                               attr_vals_offset = dissect_nfs_fattr4_acl(tvb,
+                                                       attr_vals_offset, pinfo, attr_newftree);
                                                break;
 
                                        case FATTR4_ACLSUPPORT:
-                                               attr_vals_offset = dissect_rpc_uint32(tvb, pinfo, 
-                                                       attr_newftree, hf_nfs_fattr4_aclsupport, offset);
+                                               attr_vals_offset = dissect_rpc_uint32(tvb,
+                                                       attr_newftree, hf_nfs_fattr4_aclsupport,
+                                                       attr_vals_offset);
                                                break;
 
                                        case FATTR4_ARCHIVE:
-                                               attr_vals_offset = dissect_rpc_bool(tvb, 
-                                                       pinfo, attr_newftree, hf_nfs_fattr4_archive, 
+                                               attr_vals_offset = dissect_rpc_bool(tvb,
+                                                       attr_newftree, hf_nfs_fattr4_archive,
                                                        attr_vals_offset);
                                                break;
 
                                        case FATTR4_CANSETTIME:
-                                               attr_vals_offset = dissect_rpc_bool(tvb, pinfo, 
+                                               attr_vals_offset = dissect_rpc_bool(tvb,
                                                        attr_newftree, hf_nfs_fattr4_cansettime, attr_vals_offset);
                                                break;
 
                                        case FATTR4_CASE_INSENSITIVE:
-                                               attr_vals_offset = dissect_rpc_bool(tvb, pinfo, 
-                                                       attr_newftree, hf_nfs_fattr4_case_insensitive, 
+                                               attr_vals_offset = dissect_rpc_bool(tvb,
+                                                       attr_newftree, hf_nfs_fattr4_case_insensitive,
                                                        attr_vals_offset);
                                                break;
 
                                        case FATTR4_CASE_PRESERVING:
-                                               attr_vals_offset = dissect_rpc_bool(tvb, pinfo, 
-                                                       attr_newftree, hf_nfs_fattr4_case_preserving, 
+                                               attr_vals_offset = dissect_rpc_bool(tvb,
+                                                       attr_newftree, hf_nfs_fattr4_case_preserving,
                                                        attr_vals_offset);
                                                break;
 
                                        case FATTR4_CHOWN_RESTRICTED:
-                                               attr_vals_offset = dissect_rpc_bool(tvb, pinfo, 
-                                                       attr_newftree, hf_nfs_fattr4_chown_restricted, 
+                                               attr_vals_offset = dissect_rpc_bool(tvb,
+                                                       attr_newftree, hf_nfs_fattr4_chown_restricted,
                                                        attr_vals_offset);
                                                break;
 
                                        case FATTR4_FILEID:
-                                               attr_vals_offset = dissect_rpc_uint64(tvb, pinfo, 
+                                               attr_vals_offset = dissect_rpc_uint64(tvb,
                                                        attr_newftree, hf_nfs_fattr4_fileid, attr_vals_offset);
                                                break;
 
                                        case FATTR4_FILES_AVAIL:
-                                               attr_vals_offset = dissect_rpc_uint64(tvb, pinfo, 
-                                                       attr_newftree, hf_nfs_fattr4_files_avail, 
+                                               attr_vals_offset = dissect_rpc_uint64(tvb,
+                                                       attr_newftree, hf_nfs_fattr4_files_avail,
                                                        attr_vals_offset);
                                                break;
 
@@ -4918,137 +5205,137 @@ dissect_nfs_attributes(tvbuff_t *tvb, int offset, packet_info *pinfo,
                                                break;
 
                                        case FATTR4_FILES_FREE:
-                                               attr_vals_offset = dissect_rpc_uint64(tvb, pinfo, 
+                                               attr_vals_offset = dissect_rpc_uint64(tvb,
                                                        attr_newftree, hf_nfs_fattr4_files_free, attr_vals_offset);
                                                break;
 
                                        case FATTR4_FILES_TOTAL:
-                                               attr_vals_offset = dissect_rpc_uint64(tvb, pinfo, 
-                                                       attr_newftree, hf_nfs_fattr4_files_total, 
+                                               attr_vals_offset = dissect_rpc_uint64(tvb,
+                                                       attr_newftree, hf_nfs_fattr4_files_total,
                                                        attr_vals_offset);
                                                break;
 
                                        case FATTR4_FS_LOCATIONS:
-                                               attr_vals_offset = dissect_nfs_fs_locations4(tvb, 
-                                                       attr_vals_offset, pinfo, attr_newftree, 
+                                               attr_vals_offset = dissect_nfs_fs_locations4(tvb, pinfo,
+                                                       attr_vals_offset, attr_newftree,
                                                        "fattr4_fs_locations");
                                                break;
 
                                        case FATTR4_HIDDEN:
-                                               attr_vals_offset = dissect_rpc_bool(tvb, pinfo, 
+                                               attr_vals_offset = dissect_rpc_bool(tvb,
                                                        attr_newftree, hf_nfs_fattr4_hidden, attr_vals_offset);
                                                break;
 
                                        case FATTR4_HOMOGENEOUS:
-                                               attr_vals_offset = dissect_rpc_bool(tvb, pinfo, 
-                                                       attr_newftree, hf_nfs_fattr4_homogeneous, 
+                                               attr_vals_offset = dissect_rpc_bool(tvb,
+                                                       attr_newftree, hf_nfs_fattr4_homogeneous,
                                                        attr_vals_offset);
                                                break;
 
                                        case FATTR4_MAXFILESIZE:
-                                               attr_vals_offset = dissect_rpc_uint64(tvb, pinfo, 
-                                                       attr_newftree, hf_nfs_fattr4_maxfilesize, 
+                                               attr_vals_offset = dissect_rpc_uint64(tvb,
+                                                       attr_newftree, hf_nfs_fattr4_maxfilesize,
                                                        attr_vals_offset);
                                                break;
 
                                        case FATTR4_MAXLINK:
-                                               attr_vals_offset = dissect_rpc_uint32(tvb, pinfo, 
+                                               attr_vals_offset = dissect_rpc_uint32(tvb,
                                                        attr_newftree, hf_nfs_fattr4_maxlink, attr_vals_offset);
                                                break;
 
                                        case FATTR4_MAXNAME:
-                                               attr_vals_offset = dissect_rpc_uint32(tvb, pinfo, 
+                                               attr_vals_offset = dissect_rpc_uint32(tvb,
                                                        attr_newftree, hf_nfs_fattr4_maxname, attr_vals_offset);
                                                break;
 
                                        case FATTR4_MAXREAD:
-                                               attr_vals_offset = dissect_rpc_uint64(tvb, pinfo, 
+                                               attr_vals_offset = dissect_rpc_uint64(tvb,
                                                        attr_newftree, hf_nfs_fattr4_maxread, attr_vals_offset);
                                                break;
 
                                        case FATTR4_MAXWRITE:
-                                               attr_vals_offset = dissect_rpc_uint64(tvb, pinfo, 
+                                               attr_vals_offset = dissect_rpc_uint64(tvb,
                                                        attr_newftree, hf_nfs_fattr4_maxwrite, attr_vals_offset);
                                                break;
 
                                        case FATTR4_MIMETYPE:
-                                               attr_vals_offset = dissect_nfs_utf8string(tvb, 
-                                                       attr_vals_offset, pinfo, attr_newftree, 
+                                               attr_vals_offset = dissect_nfs_utf8string(tvb,
+                                                       attr_vals_offset, attr_newftree,
                                                        hf_nfs_fattr4_mimetype, NULL);
                                                break;
-                                       
+
                                        case FATTR4_MODE:
                                                attr_vals_offset = dissect_nfs_mode4(tvb,
-                                                       attr_vals_offset, pinfo, attr_newftree, "fattr4_mode");
+                                                       attr_vals_offset, attr_newftree, "fattr4_mode");
                                                break;
 
                                        case FATTR4_NO_TRUNC:
-                                               attr_vals_offset = dissect_rpc_bool(tvb, pinfo, 
+                                               attr_vals_offset = dissect_rpc_bool(tvb,
                                                        attr_newftree, hf_nfs_fattr4_no_trunc, attr_vals_offset);
                                                break;
 
                                        case FATTR4_NUMLINKS:
-                                               attr_vals_offset = dissect_rpc_uint32(tvb, pinfo, 
+                                               attr_vals_offset = dissect_rpc_uint32(tvb,
                                                        attr_newftree, hf_nfs_fattr4_numlinks, attr_vals_offset);
                                                break;
 
                                        case FATTR4_OWNER:
-                                               attr_vals_offset = dissect_nfs_utf8string(tvb, 
-                                                       attr_vals_offset, pinfo, attr_newftree, 
+                                               attr_vals_offset = dissect_nfs_utf8string(tvb,
+                                                       attr_vals_offset, attr_newftree,
                                                        hf_nfs_fattr4_owner,
                                                        NULL);
                                                break;
 
                                        case FATTR4_OWNER_GROUP:
-                                               attr_vals_offset = dissect_nfs_utf8string(tvb, 
-                                                       attr_vals_offset, pinfo, attr_newftree, 
+                                               attr_vals_offset = dissect_nfs_utf8string(tvb,
+                                                       attr_vals_offset, attr_newftree,
                                                        hf_nfs_fattr4_owner_group, NULL);
                                                break;
 
                                        case FATTR4_QUOTA_AVAIL_HARD:
-                                               attr_vals_offset = dissect_rpc_uint64(tvb, pinfo, 
+                                               attr_vals_offset = dissect_rpc_uint64(tvb,
                                                        attr_newftree, hf_nfs_fattr4_quota_hard, attr_vals_offset);
                                                break;
 
                                        case FATTR4_QUOTA_AVAIL_SOFT:
-                                               attr_vals_offset = dissect_rpc_uint64(tvb, pinfo, 
+                                               attr_vals_offset = dissect_rpc_uint64(tvb,
                                                        attr_newftree, hf_nfs_fattr4_quota_soft, attr_vals_offset);
                                                break;
 
                                        case FATTR4_QUOTA_USED:
-                                               attr_vals_offset = dissect_rpc_uint64(tvb, pinfo, 
+                                               attr_vals_offset = dissect_rpc_uint64(tvb,
                                                        attr_newftree, hf_nfs_fattr4_quota_used, attr_vals_offset);
                                                break;
 
                                        case FATTR4_RAWDEV:
-                                               attr_vals_offset = dissect_nfs_specdata4(tvb, 
-                                                       attr_vals_offset, pinfo, attr_newftree, "fattr4_rawdev");
+                                               attr_vals_offset = dissect_nfs_specdata4(tvb,
+                                                       attr_vals_offset, attr_newftree);
                                                break;
 
                                        case FATTR4_SPACE_AVAIL:
-                                               attr_vals_offset = dissect_rpc_uint64(tvb, pinfo, 
-                                                       attr_newftree, hf_nfs_fattr4_space_avail, 
+                                               attr_vals_offset = dissect_rpc_uint64(tvb,
+                                                       attr_newftree, hf_nfs_fattr4_space_avail,
                                                        attr_vals_offset);
                                                break;
 
                                        case FATTR4_SPACE_FREE:
-                                               attr_vals_offset = dissect_rpc_uint64(tvb, pinfo, 
+                                               attr_vals_offset = dissect_rpc_uint64(tvb,
                                                        attr_newftree, hf_nfs_fattr4_space_free, attr_vals_offset);
                                                break;
 
                                        case FATTR4_SPACE_TOTAL:
-                                               attr_vals_offset = dissect_rpc_uint64(tvb, pinfo, 
-                                                       attr_newftree, hf_nfs_fattr4_space_total, 
+                                               attr_vals_offset = dissect_rpc_uint64(tvb,
+                                                       attr_newftree, hf_nfs_fattr4_space_total,
                                                        attr_vals_offset);
                                                break;
 
                                        case FATTR4_SPACE_USED:
-                                               attr_vals_offset = dissect_rpc_uint64(tvb, pinfo, 
+                                               attr_vals_offset = dissect_rpc_uint64(tvb,
                                                        attr_newftree, hf_nfs_fattr4_space_used, attr_vals_offset);
                                                break;
-                                       
+
                                        case FATTR4_SYSTEM:
-                                               attr_vals_offset = dissect_rpc_bool(tvb, pinfo, 
+                                               attr_vals_offset = dissect_rpc_bool(tvb,
                                                        attr_newftree, hf_nfs_fattr4_system, attr_vals_offset);
                                                break;
 
@@ -5059,13 +5346,13 @@ dissect_nfs_attributes(tvbuff_t *tvb, int offset, packet_info *pinfo,
                                        case FATTR4_TIME_METADATA:
                                        case FATTR4_TIME_MODIFY:
                                                attr_vals_offset = dissect_nfs_nfstime4(tvb, attr_vals_offset,
-                                                       pinfo, attr_newftree, "nfstime4");
+                                                       attr_newftree);
                                                break;
 
                                        case FATTR4_TIME_ACCESS_SET:
                                        case FATTR4_TIME_MODIFY_SET:
-                                               attr_vals_offset = dissect_nfs_settime4(tvb, 
-                                                       attr_vals_offset, pinfo, attr_newftree, "settime4");
+                                               attr_vals_offset = dissect_nfs_settime4(tvb,
+                                                       attr_vals_offset, attr_newftree, "settime4");
                                                break;
 
                                        default:
@@ -5085,9 +5372,9 @@ dissect_nfs_attributes(tvbuff_t *tvb, int offset, packet_info *pinfo,
        return offset;
 }
 
-int
+static int
 dissect_nfs_fattr4(tvbuff_t *tvb, int offset, packet_info *pinfo,
-       proto_tree *tree, char *name)
+       proto_tree *tree)
 {
        proto_tree *newftree = NULL;
        proto_item *fitem = NULL;
@@ -5100,17 +5387,17 @@ dissect_nfs_fattr4(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
        if (newftree == NULL) return offset;
 
-       offset = dissect_nfs_attributes(tvb, offset, pinfo, newftree, name, 
+       offset = dissect_nfs_attributes(tvb, offset, pinfo, newftree,
                FATTR4_FULL_DISSECT);
 
-       offset = dissect_nfsdata(tvb, offset, pinfo, tree, hf_nfs_attrlist4);
+       offset = dissect_nfsdata(tvb, offset, tree, hf_nfs_attrlist4);
 
        return offset;
 }
 
 static const value_string names_open4_share_access[] = {
 #define OPEN4_SHARE_ACCESS_READ 0x00000001
-       { OPEN4_SHARE_ACCESS_READ, "OPEN4_SHARE_ACCESS_READ" }, 
+       { OPEN4_SHARE_ACCESS_READ, "OPEN4_SHARE_ACCESS_READ" },
 #define OPEN4_SHARE_ACCESS_WRITE 0x00000002
        { OPEN4_SHARE_ACCESS_WRITE, "OPEN4_SHARE_ACCESS_WRITE" },
 #define OPEN4_SHARE_ACCESS_BOTH 0x00000003
@@ -5118,14 +5405,14 @@ static const value_string names_open4_share_access[] = {
        { 0, NULL }
 };
 
-int
-dissect_nfs_open4_share_access(tvbuff_t *tvb, int offset, packet_info *pinfo,
+static int
+dissect_nfs_open4_share_access(tvbuff_t *tvb, int offset,
        proto_tree *tree)
 {
        guint share_access;
 
        share_access = tvb_get_ntohl(tvb, offset);
-       proto_tree_add_uint(tree, hf_nfs_open4_share_access, tvb, offset, 4, 
+       proto_tree_add_uint(tree, hf_nfs_open4_share_access, tvb, offset, 4,
                share_access);
        offset += 4;
 
@@ -5144,8 +5431,8 @@ static const value_string names_open4_share_deny[] = {
        { 0, NULL }
 };
 
-int
-dissect_nfs_open4_share_deny(tvbuff_t *tvb, int offset, packet_info *pinfo,
+static int
+dissect_nfs_open4_share_deny(tvbuff_t *tvb, int offset,
        proto_tree *tree)
 {
        guint deny_access;
@@ -5158,23 +5445,23 @@ dissect_nfs_open4_share_deny(tvbuff_t *tvb, int offset, packet_info *pinfo,
        return offset;
 }
 
-int
-dissect_nfs_open_owner4(tvbuff_t *tvb, int offset, packet_info *pinfo, 
-                                        proto_tree *tree)
+static int
+dissect_nfs_open_owner4(tvbuff_t *tvb, int offset, proto_tree *tree)
 {
-       offset = dissect_nfs_clientid4(tvb, offset, pinfo, tree);
-       offset = dissect_nfsdata(tvb, offset, pinfo, tree, hf_nfs_open_owner4);
+       offset = dissect_rpc_uint64(tvb, tree, hf_nfs_clientid4, offset);
+       offset = dissect_nfsdata(tvb, offset, tree, hf_nfs_open_owner4);
 
        return offset;
 }
 
-int
+static int
 dissect_nfs_open_claim_delegate_cur4(tvbuff_t *tvb, int offset,
-       packet_info *pinfo, proto_tree *tree, char *name)
+       proto_tree *tree)
 {
-       offset = dissect_rpc_uint64(tvb, pinfo, tree, 
+       offset = dissect_rpc_uint64(tvb, tree,
                hf_nfs_stateid4_delegate_stateid, offset);
-       offset = dissect_nfs_component4(tvb, offset, pinfo, tree, "file");
+       offset = dissect_nfs_utf8string(tvb, offset, tree, hf_nfs_component4, NULL);
+
        return offset;
 }
 
@@ -5191,9 +5478,9 @@ static const value_string names_claim_type4[] = {
        {       0, NULL }
 };
 
-int
-dissect_nfs_open_claim4(tvbuff_t *tvb, int offset, packet_info *pinfo,
-       proto_tree *tree, char *name)
+static int
+dissect_nfs_open_claim4(tvbuff_t *tvb, int offset,
+       proto_tree *tree)
 {
        guint open_claim_type4;
        proto_item *fitem = NULL;
@@ -5212,23 +5499,21 @@ dissect_nfs_open_claim4(tvbuff_t *tvb, int offset, packet_info *pinfo,
                        switch(open_claim_type4)
                        {
                        case CLAIM_NULL:
-                               offset = dissect_nfs_component4(tvb, offset, pinfo, newftree, 
-                                       "file");
+                               offset = dissect_nfs_utf8string(tvb, offset, newftree, hf_nfs_component4, NULL);
                                break;
 
                        case CLAIM_PREVIOUS:
-                               offset = dissect_rpc_uint32(tvb, pinfo, newftree, 
+                               offset = dissect_rpc_uint32(tvb, newftree,
                                        hf_nfs_delegate_type, offset);
                                break;
 
                        case CLAIM_DELEGATE_CUR:
-                               offset = dissect_nfs_open_claim_delegate_cur4(tvb, offset, pinfo, 
-                                       newftree, "delegate_cur_info");
+                               offset = dissect_nfs_open_claim_delegate_cur4(tvb, offset,
+                                       newftree);
                                break;
 
                        case CLAIM_DELEGATE_PREV:
-                               offset = dissect_nfs_component4(tvb, offset, pinfo, newftree, 
-                                       "file_delegate_prev");
+                               offset = dissect_nfs_utf8string(tvb, offset, newftree, hf_nfs_component4, NULL);
                                break;
 
                        default:
@@ -5240,9 +5525,9 @@ dissect_nfs_open_claim4(tvbuff_t *tvb, int offset, packet_info *pinfo,
        return offset;
 }
 
-int
+static int
 dissect_nfs_createhow4(tvbuff_t *tvb, int offset, packet_info *pinfo,
-       proto_tree *tree, char *name)
+       proto_tree *tree)
 {
        guint mode;
 
@@ -5250,18 +5535,18 @@ dissect_nfs_createhow4(tvbuff_t *tvb, int offset, packet_info *pinfo,
        mode = tvb_get_ntohl(tvb, offset);
        proto_tree_add_uint(tree, hf_nfs_createmode3, tvb, offset, 4, mode);
        offset += 4;
-       
+
        switch(mode)
        {
        case UNCHECKED:         /* UNCHECKED4 */
        case GUARDED:           /* GUARDED4 */
-               offset = dissect_nfs_fattr4(tvb, offset, pinfo, tree, "createattrs");
+               offset = dissect_nfs_fattr4(tvb, offset, pinfo, tree);
                break;
 
        case EXCLUSIVE:         /* EXCLUSIVE4 */
-               offset = dissect_rpc_uint64(tvb, pinfo, tree, hf_nfs_verifier4, offset);
+               offset = dissect_rpc_uint64(tvb, tree, hf_nfs_verifier4, offset);
                break;
-       
+
        default:
                break;
        }
@@ -5277,7 +5562,7 @@ static const value_string names_opentype4[] = {
        { 0, NULL }
 };
 
-int
+static int
 dissect_nfs_openflag4(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree *tree)
 {
@@ -5298,8 +5583,7 @@ dissect_nfs_openflag4(tvbuff_t *tvb, int offset, packet_info *pinfo,
                        switch(opentype4)
                        {
                        case OPEN4_CREATE:
-                               offset = dissect_nfs_createhow4(tvb, offset, pinfo, newftree, 
-                                       "how");
+                               offset = dissect_nfs_createhow4(tvb, offset, pinfo, newftree);
                                break;
 
                        default:
@@ -5311,24 +5595,33 @@ dissect_nfs_openflag4(tvbuff_t *tvb, int offset, packet_info *pinfo,
        return offset;
 }
 
-int
-dissect_nfs_clientaddr4(tvbuff_t *tvb, int offset, packet_info *pinfo,
-       proto_tree *tree, char *name)
+static int
+dissect_nfs_clientaddr4(tvbuff_t *tvb, int offset, proto_tree *tree)
 {
-       offset = dissect_nfs_opaque4(tvb, offset, pinfo, tree, "network id");
-       offset = dissect_nfs_opaque4(tvb, offset, pinfo, tree, "universal address");
+       offset = dissect_nfsdata(tvb, offset, tree, hf_nfs_r_netid);
+       offset = dissect_nfsdata(tvb, offset, tree, hf_nfs_r_addr);
 
        return offset;
 }
-       
 
-int
-dissect_nfs_cb_client4(tvbuff_t *tvb, int offset, packet_info *pinfo,
-       proto_tree *tree, char *name)
+
+static int
+dissect_nfs_cb_client4(tvbuff_t *tvb, int offset, proto_tree *tree)
 {
-       offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nfs_cb_program, 
-               offset);
-       offset = dissect_nfs_clientaddr4(tvb, offset, pinfo, tree, "cb_location");
+       proto_tree *cb_location = NULL;
+       proto_item *fitem = NULL;
+
+       offset = dissect_rpc_uint32(tvb, tree, hf_nfs_cb_program, offset);
+
+       fitem = proto_tree_add_text(tree, tvb, offset, 0, "cb_location");
+
+       if (fitem)
+       {
+               cb_location = proto_item_add_subtree(fitem, ett_nfs_clientaddr4);
+
+               offset = dissect_nfs_clientaddr4(tvb, offset, cb_location);
+       }
+
        return offset;
 }
 
@@ -5342,8 +5635,8 @@ static const value_string names_stable_how4[] = {
        {       0,      NULL    }
 };
 
-int
-dissect_nfs_stable_how4(tvbuff_t *tvb, int offset, packet_info *pinfo,
+static int
+dissect_nfs_stable_how4(tvbuff_t *tvb, int offset,
        proto_tree *tree, char *name)
 {
        guint stable_how4;
@@ -5357,17 +5650,6 @@ dissect_nfs_stable_how4(tvbuff_t *tvb, int offset, packet_info *pinfo,
        return offset;
 }
 
-int
-dissect_nfs_opaque4(tvbuff_t *tvb, int offset, packet_info *pinfo,
-       proto_tree *tree, char *name)
-{
-       return dissect_nfsdata(tvb, offset, pinfo, tree, hf_nfs_data);
-}
-
-/* There is probably a better (built-in?) way to do this, but this works
- * for now.
- */
-
 static const value_string names_nfsv4_operation[] = {
        {       NFS4_OP_ACCESS,                                 "ACCESS"        },
        {       NFS4_OP_CLOSE,                                          "CLOSE" },
@@ -5382,6 +5664,7 @@ static const value_string names_nfsv4_operation[] = {
        {       NFS4_OP_LOCKT,                                          "LOCKT" },
        {       NFS4_OP_LOCKU,                                          "LOCKU" },
        {       NFS4_OP_LOOKUP,                                 "LOOKUP"        },
+       {       NFS4_OP_LOOKUPP,                                        "LOOKUPP" },
        {       NFS4_OP_NVERIFY,                                        "NVERIFY"       },
        {       NFS4_OP_OPEN,                                           "OPEN"  },
        {       NFS4_OP_OPENATTR,                                       "OPENATTR"      },
@@ -5444,42 +5727,37 @@ gint *nfsv4_operation_ett[] =
         &ett_nfs_setclientid4 ,
         &ett_nfs_setclientid_confirm4 ,
         &ett_nfs_verify4 ,
-        &ett_nfs_write4 
+        &ett_nfs_write4
 };
 
-int
+static int
+dissect_nfs_entry4(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
+       proto_tree *tree)
+{
+       offset = dissect_rpc_uint64(tvb, tree, hf_nfs_cookie4, offset);
+       offset = dissect_nfs_utf8string(tvb, offset, tree, hf_nfs_component4, NULL);
+       offset = dissect_nfs_fattr4(tvb, offset, pinfo, tree);
+
+       return offset;
+}
+
+static int
 dissect_nfs_dirlist4(tvbuff_t *tvb, int offset, packet_info *pinfo,
-       proto_tree *tree, char *name)
+       proto_tree *tree)
 {
        proto_tree *newftree = NULL;
-       guint nextentry;
 
        newftree = proto_item_add_subtree(tree, ett_nfs_dirlist4);
        if (newftree==NULL) return offset;
 
-       nextentry = tvb_get_ntohl(tvb, offset);
-
-       offset = dissect_rpc_bool(tvb, pinfo, newftree, hf_nfs_data_follows,
-               offset);
-
-       while (nextentry)
-       {
-               /* offset = dissect_nfs_cookie4(tvb, offset, pinfo, newftree); */
-               offset = dissect_rpc_uint64(tvb, pinfo, newftree, hf_nfs_cookie4, offset);
-               offset = dissect_nfs_component4(tvb, offset, pinfo, newftree, "name");
-               offset = dissect_nfs_fattr4(tvb, offset, pinfo, newftree, "attrs");
-               nextentry = tvb_get_ntohl(tvb, offset);
-               offset += 4;
-       }
-
-       offset = dissect_rpc_bool(tvb, pinfo, newftree, hf_nfs_dirlist4_eof,
-               offset);
+       offset = dissect_rpc_list(tvb, pinfo, tree, offset, dissect_nfs_entry4);
+       offset = dissect_rpc_bool(tvb, newftree, hf_nfs_dirlist4_eof, offset);
 
        return offset;
 }
 
-int
-dissect_nfs_change_info4(tvbuff_t *tvb, int offset, packet_info *pinfo,
+static int
+dissect_nfs_change_info4(tvbuff_t *tvb, int offset,
        proto_tree *tree, char *name)
 {
        proto_tree *newftree = NULL;
@@ -5491,10 +5769,12 @@ dissect_nfs_change_info4(tvbuff_t *tvb, int offset, packet_info *pinfo,
                newftree = proto_item_add_subtree(fitem, ett_nfs_change_info4);
 
                if (newftree) {
-                       offset = dissect_rpc_bool(tvb, pinfo, newftree, 
+                       offset = dissect_rpc_bool(tvb, newftree,
                                hf_nfs_change_info4_atomic, offset);
-                       offset = dissect_nfs_changeid4(tvb, offset, pinfo, newftree, "before");
-                       offset = dissect_nfs_changeid4(tvb, offset, pinfo, newftree, "after");
+                       offset = dissect_rpc_uint64(tvb, tree, hf_nfs_changeid4_before,
+                               offset);
+                       offset = dissect_rpc_uint64(tvb, tree, hf_nfs_changeid4_after,
+                               offset);
                }
        }
 
@@ -5516,38 +5796,28 @@ static const value_string names_nfs_lock_type4[] =
        {       0,      NULL    }
 };
 
-int
-dissect_nfs_lock4denied(tvbuff_t *tvb, int offset, packet_info *pinfo,
-       proto_tree *tree, char *name)
+static int
+dissect_nfs_lock4denied(tvbuff_t *tvb, int offset, proto_tree *tree)
 {
-       offset = dissect_rpc_uint64(tvb, pinfo, tree, hf_nfs_offset4, offset);
-       offset = dissect_nfs_length4(tvb, offset, pinfo, tree, "length");
-       offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nfs_lock_type4, offset);
-       offset = dissect_nfs_lock_owner4(tvb, offset, pinfo, tree, "owner");
+       offset = dissect_rpc_uint64(tvb, tree, hf_nfs_offset4, offset);
+       offset = dissect_rpc_uint64(tvb, tree, hf_nfs_length4, offset);
+       offset = dissect_rpc_uint32(tvb, tree, hf_nfs_lock_type4, offset);
+       offset = dissect_nfs_lock_owner4(tvb, offset, tree);
+
        return offset;
 }
 
 
-int
-dissect_nfs_ace4(tvbuff_t *tvb, int offset, packet_info *pinfo, 
-       proto_tree *tree, char *name)
-{
-       offset = dissect_nfs_acetype4(tvb, offset, pinfo, tree, "type");
-       offset = dissect_nfs_aceflag4(tvb, offset, pinfo, tree, "flag");
-       offset = dissect_nfs_acemask4(tvb, offset, pinfo, tree, "access_mask");
-       return dissect_nfs_utf8string(tvb, offset, pinfo, tree, hf_nfs_ace4, NULL);
-}
-
 static const value_string names_open4_result_flags[] = {
 #define OPEN4_RESULT_MLOCK 0x00000001
-       { OPEN4_RESULT_MLOCK, "OPEN4_RESULT_MLOCK" }, 
+       { OPEN4_RESULT_MLOCK, "OPEN4_RESULT_MLOCK" },
 #define OPEN4_RESULT_CONFIRM 0x00000002
        { OPEN4_RESULT_CONFIRM, "OPEN4_RESULT_CONFIRM" },
        { 0, NULL }
 };
 
-int 
-dissect_nfs_open4_rflags(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_nfs_open4_rflags(tvbuff_t *tvb, int offset,
        proto_tree *tree, char *name)
 {
        guint rflags;
@@ -5563,7 +5833,7 @@ dissect_nfs_open4_rflags(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
                if (rflags_item)
                {
-                       rflags_tree = proto_item_add_subtree(rflags_item, 
+                       rflags_tree = proto_item_add_subtree(rflags_item,
                                ett_nfs_open4_result_flags);
 
                        if (rflags_tree)
@@ -5578,14 +5848,14 @@ dissect_nfs_open4_rflags(tvbuff_t *tvb, int offset, packet_info *pinfo,
                        }
                }
        }
-       
+
        offset += 4;
 
        return offset;
 }
 
-int
-dissect_nfs_stateid4(tvbuff_t *tvb, int offset, packet_info *pinfo,
+static int
+dissect_nfs_stateid4(tvbuff_t *tvb, int offset,
                proto_tree *tree)
 {
        proto_item *fitem = NULL;
@@ -5599,7 +5869,7 @@ dissect_nfs_stateid4(tvbuff_t *tvb, int offset, packet_info *pinfo,
        if (fitem) {
                newftree = proto_item_add_subtree(fitem, ett_nfs_stateid4);
                if (newftree) {
-                       offset = dissect_rpc_uint32(tvb, pinfo, newftree, hf_nfs_seqid4, 
+                       offset = dissect_rpc_uint32(tvb, newftree, hf_nfs_seqid4,
                                offset);
 
                        bytes_left = 12;
@@ -5625,25 +5895,23 @@ dissect_nfs_stateid4(tvbuff_t *tvb, int offset, packet_info *pinfo,
        return offset;
 }
 
-int
-dissect_nfs_open_read_delegation4(tvbuff_t *tvb, int offset, packet_info *pinfo,
-       proto_tree *tree)
+static int
+dissect_nfs_open_read_delegation4(tvbuff_t *tvb, int offset,
+       packet_info *pinfo, proto_tree *tree)
 {
-       offset = dissect_nfs_stateid4(tvb, offset, pinfo, tree);
-       offset = dissect_rpc_bool(tvb, pinfo, tree, hf_nfs_recall4, offset);
-       offset = dissect_nfs_ace4(tvb, offset, pinfo, tree, "permissions");
+       offset = dissect_nfs_stateid4(tvb, offset, tree);
+       offset = dissect_rpc_bool(tvb, tree, hf_nfs_recall4, offset);
+       offset = dissect_nfs_ace4(tvb, offset, pinfo, tree);
 
        return offset;
 }
 
-int
-dissect_nfs_modified_limit4(tvbuff_t *tvb, int offset, packet_info *pinfo,
-       proto_tree *tree, char *name)
+static int
+dissect_nfs_modified_limit4(tvbuff_t *tvb, int offset, proto_tree *tree)
 {
-       offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nfs_num_blocks, 
-               offset);
-       offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nfs_bytes_per_block,
-               offset);
+       offset = dissect_rpc_uint32(tvb, tree, hf_nfs_num_blocks, offset);
+       offset = dissect_rpc_uint32(tvb, tree, hf_nfs_bytes_per_block, offset);
+
        return offset;
 }
 
@@ -5655,9 +5923,9 @@ static const value_string names_limit_by4[] = {
        { 0, NULL }
 };
 
-int
-dissect_nfs_space_limit4(tvbuff_t *tvb, int offset, packet_info *pinfo,
-       proto_tree *tree, char *name)
+static int
+dissect_nfs_space_limit4(tvbuff_t *tvb, int offset,
+       proto_tree *tree)
 {
        guint limitby;
 
@@ -5668,13 +5936,12 @@ dissect_nfs_space_limit4(tvbuff_t *tvb, int offset, packet_info *pinfo,
        switch(limitby)
        {
        case NFS_LIMIT_SIZE:
-               offset = dissect_rpc_uint64(tvb, pinfo, tree, hf_nfs_filesize, 
+               offset = dissect_rpc_uint64(tvb, tree, hf_nfs_filesize,
                        offset);
                break;
 
        case NFS_LIMIT_BLOCKS:
-               offset = dissect_nfs_modified_limit4(tvb, offset, pinfo, tree, 
-                       "mod_blocks");
+               offset = dissect_nfs_modified_limit4(tvb, offset, tree);
                break;
 
        default:
@@ -5684,14 +5951,16 @@ dissect_nfs_space_limit4(tvbuff_t *tvb, int offset, packet_info *pinfo,
        return offset;
 }
 
-int
-dissect_nfs_open_write_delegation4(tvbuff_t *tvb, int offset, 
+static int
+dissect_nfs_open_write_delegation4(tvbuff_t *tvb, int offset,
        packet_info *pinfo, proto_tree *tree)
 {
-       offset = dissect_nfs_stateid4(tvb, offset, pinfo, tree);
-       offset = dissect_rpc_bool(tvb, pinfo, tree, hf_nfs_recall, offset);
-       offset = dissect_nfs_space_limit4(tvb, offset, pinfo, tree, "space_limit");
-       return dissect_nfs_ace4(tvb, offset, pinfo, tree, "permissions");
+       offset = dissect_nfs_stateid4(tvb, offset, tree);
+       offset = dissect_rpc_bool(tvb, tree, hf_nfs_recall, offset);
+       offset = dissect_nfs_space_limit4(tvb, offset, tree);
+       offset = dissect_nfs_ace4(tvb, offset, pinfo, tree);
+
+       return offset;
 }
 
 #define OPEN_DELEGATE_NONE 0
@@ -5704,16 +5973,16 @@ static const value_string names_open_delegation_type4[] = {
        { 0, NULL }
 };
 
-int
+static int
 dissect_nfs_open_delegation4(tvbuff_t *tvb, int offset, packet_info *pinfo,
-       proto_tree *tree, char *name)
+       proto_tree *tree)
 {
        guint delegation_type;
        proto_tree *newftree = NULL;
        proto_item *fitem = NULL;
 
        delegation_type = tvb_get_ntohl(tvb, offset);
-       proto_tree_add_uint(tree, hf_nfs_open_delegation_type4, tvb, offset+0, 
+       proto_tree_add_uint(tree, hf_nfs_open_delegation_type4, tvb, offset+0,
                4, delegation_type);
        offset += 4;
 
@@ -5726,12 +5995,12 @@ dissect_nfs_open_delegation4(tvbuff_t *tvb, int offset, packet_info *pinfo,
                        break;
 
                case OPEN_DELEGATE_READ:
-                       offset = dissect_nfs_open_read_delegation4(tvb, offset, pinfo, 
+                       offset = dissect_nfs_open_read_delegation4(tvb, offset, pinfo,
                                newftree);
                        break;
 
                case OPEN_DELEGATE_WRITE:
-                       offset = dissect_nfs_open_write_delegation4(tvb, offset, pinfo, 
+                       offset = dissect_nfs_open_write_delegation4(tvb, offset, pinfo,
                                newftree);
                        break;
 
@@ -5743,68 +6012,67 @@ dissect_nfs_open_delegation4(tvbuff_t *tvb, int offset, packet_info *pinfo,
        return offset;
 }
 
-int
-dissect_nfs_rpcsec_gss_info(tvbuff_t *tvb, int offset, packet_info *pinfo,
-       proto_tree *tree)
+static int
+dissect_nfs_rpcsec_gss_info(tvbuff_t *tvb, int offset, proto_tree *tree)
 {
-       guint data_follows;
-
-       while ((data_follows = tvb_get_ntohl(tvb, offset)))
-       {
-               offset += 4;
-               offset = dissect_nfsdata(tvb, offset, pinfo, tree, hf_nfs_sec_oid4); 
-               offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nfs_qop4, offset);
-               offset = dissect_rpc_uint32(tvb, pinfo, tree, 
-                               hf_nfs_secinfo_rpcsec_gss_info_service, offset);
-       }
+       offset = dissect_nfsdata(tvb, offset, tree, hf_nfs_sec_oid4);
+       offset = dissect_rpc_uint32(tvb, tree, hf_nfs_qop4, offset);
+       offset = dissect_rpc_uint32(tvb, tree,
+               hf_nfs_secinfo_rpcsec_gss_info_service, offset);
 
        return offset;
 }
 
-int
-dissect_nfs_open_to_lock_owner4(tvbuff_t *tvb, int offset, packet_info *pinfo,
-       proto_tree *tree)
+static int
+dissect_nfs_open_to_lock_owner4(tvbuff_t *tvb, int offset, proto_tree *tree)
 {
-       offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nfs_seqid4, offset);
-       offset = dissect_nfs_stateid4(tvb, offset, pinfo, tree);
-       offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nfs_lock_seqid4, offset);
-       offset = dissect_nfs_lock_owner4(tvb, offset, pinfo, tree, "owner");
+       offset = dissect_rpc_uint32(tvb, tree, hf_nfs_seqid4, offset);
+       offset = dissect_nfs_stateid4(tvb, offset, tree);
+       offset = dissect_rpc_uint32(tvb, tree, hf_nfs_lock_seqid4, offset);
+       offset = dissect_nfs_lock_owner4(tvb, offset, tree);
 
        return offset;
 }
 
-int
-dissect_nfs_exist_lock_owner4(tvbuff_t *tvb, int offset, packet_info *pinfo,
-       proto_tree *tree)
+static int
+dissect_nfs_exist_lock_owner4(tvbuff_t *tvb, int offset, proto_tree *tree)
 {
-       offset = dissect_nfs_stateid4(tvb, offset, pinfo, tree);
-       offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nfs_lock_seqid4, offset);
+       offset = dissect_nfs_stateid4(tvb, offset, tree);
+       offset = dissect_rpc_uint32(tvb, tree, hf_nfs_lock_seqid4, offset);
 
        return offset;
 }
 
-int
-dissect_nfs_locker4(tvbuff_t *tvb, int offset, packet_info *pinfo, 
-       proto_tree *tree)
+static int
+dissect_nfs_locker4(tvbuff_t *tvb, int offset, proto_tree *tree)
 {
        guint new_lock_owner;
 
        new_lock_owner = tvb_get_ntohl(tvb, offset);
-       offset = dissect_rpc_bool(tvb, pinfo, tree, hf_nfs_new_lock_owner, offset);
-       
+       offset = dissect_rpc_bool(tvb, tree, hf_nfs_new_lock_owner, offset);
+
        if (new_lock_owner)
-               offset = dissect_nfs_open_to_lock_owner4(tvb, offset, pinfo, tree);
+               offset = dissect_nfs_open_to_lock_owner4(tvb, offset, tree);
        else
-               offset = dissect_nfs_exist_lock_owner4(tvb, offset, pinfo, tree);
+               offset = dissect_nfs_exist_lock_owner4(tvb, offset, tree);
 
        return offset;
 }
 
-int
-dissect_nfs_argop4(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_nfs_client_id4(tvbuff_t *tvb, int offset, proto_tree *tree)
+{
+       offset = dissect_rpc_uint64(tvb, tree, hf_nfs_verifier4, offset);
+       offset = dissect_rpc_data(tvb, tree, hf_nfs_client_id4_id, offset);
+
+       return offset;
+}
+
+static int
+dissect_nfs_argop4(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree *tree)
 {
-       guint ops, ops_counter;
+       guint32 ops, ops_counter;
        guint opcode;
        proto_item *fitem;
        proto_tree *ftree = NULL;
@@ -5812,8 +6080,8 @@ dissect_nfs_argop4(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
        ops = tvb_get_ntohl(tvb, offset+0);
 
-       fitem = proto_tree_add_text(tree, tvb, offset, 4, 
-               "Operations (count: %d)", ops);
+       fitem = proto_tree_add_text(tree, tvb, offset, 4,
+               "Operations (count: %u)", ops);
        offset += 4;
 
        if (fitem == NULL) return offset;
@@ -5826,9 +6094,7 @@ dissect_nfs_argop4(tvbuff_t *tvb, int offset, packet_info *pinfo,
        {
                opcode = tvb_get_ntohl(tvb, offset);
 
-               printf("Call Opcode: %d\n", opcode);
-               
-               fitem = proto_tree_add_uint(ftree, hf_nfs_argop4, tvb, offset, 4, 
+               fitem = proto_tree_add_uint(ftree, hf_nfs_argop4, tvb, offset, 4,
                        opcode);
                offset += 4;
 
@@ -5843,19 +6109,19 @@ dissect_nfs_argop4(tvbuff_t *tvb, int offset, packet_info *pinfo,
                switch(opcode)
                {
                case NFS4_OP_ACCESS:
-                       offset = dissect_access(tvb, offset, pinfo, newftree, "access");
+                       offset = dissect_access(tvb, offset, newftree, "access");
                        break;
 
                case NFS4_OP_CLOSE:
-                       offset = dissect_rpc_uint32(tvb, pinfo, newftree, hf_nfs_seqid4,
+                       offset = dissect_rpc_uint32(tvb, newftree, hf_nfs_seqid4,
                                offset);
-                       offset = dissect_nfs_stateid4(tvb, offset, pinfo, newftree);
+                       offset = dissect_nfs_stateid4(tvb, offset, newftree);
                        break;
 
                case NFS4_OP_COMMIT:
-                       offset = dissect_rpc_uint64(tvb, pinfo, newftree, hf_nfs_offset4,
+                       offset = dissect_rpc_uint64(tvb, newftree, hf_nfs_offset4,
                                offset);
-                       offset = dissect_rpc_uint32(tvb, pinfo, newftree, hf_nfs_count4,
+                       offset = dissect_rpc_uint32(tvb, newftree, hf_nfs_count4,
                                offset);
                        break;
 
@@ -5864,20 +6130,19 @@ dissect_nfs_argop4(tvbuff_t *tvb, int offset, packet_info *pinfo,
                                guint create_type;
 
                                create_type = tvb_get_ntohl(tvb, offset);
-                               offset = dissect_rpc_uint32(tvb, pinfo, newftree, hf_nfs_ftype4, 
+                               offset = dissect_rpc_uint32(tvb, newftree, hf_nfs_ftype4,
                                        offset);
 
                                switch(create_type)
                                {
                                case NF4LNK:
-                                       offset = dissect_nfs_linktext4(tvb, offset, pinfo, newftree, 
-                                               "linkdata");
+                                       offset = dissect_nfs_utf8string(tvb, offset, newftree,
+                                               hf_nfs_linktext4, NULL);
                                        break;
-                               
+
                                case NF4BLK:
                                case NF4CHR:
-                                       offset = dissect_nfs_specdata4(tvb, offset, pinfo, 
-                                               newftree, "devdata");
+                                       offset = dissect_nfs_specdata4(tvb, offset, newftree);
                                        break;
 
                                case NF4SOCK:
@@ -5889,105 +6154,95 @@ dissect_nfs_argop4(tvbuff_t *tvb, int offset, packet_info *pinfo,
                                        break;
                                }
 
-                               offset = dissect_nfs_component4(tvb, offset, pinfo, newftree, 
-                                       "objname");
+                               offset = dissect_nfs_utf8string(tvb, offset, newftree, hf_nfs_component4, NULL);
 
-                               offset = dissect_nfs_fattr4(tvb, offset, pinfo, newftree, 
-                                       "createattrs");
+                               offset = dissect_nfs_fattr4(tvb, offset, pinfo, newftree);
                        }
                        break;
 
                case NFS4_OP_DELEGPURGE:
-                       offset = dissect_rpc_uint64(tvb, pinfo, newftree, 
-                               hf_nfs_clientid4, offset);
+                       offset = dissect_rpc_uint64(tvb, newftree, hf_nfs_clientid4, offset);
                        break;
 
                case NFS4_OP_DELEGRETURN:
-                       offset = dissect_nfs_stateid4(tvb, offset, pinfo, newftree);
+                       offset = dissect_nfs_stateid4(tvb, offset, newftree);
                        break;
 
                case NFS4_OP_GETATTR:
-                       offset = dissect_nfs_attributes(tvb, offset, pinfo, newftree, 
-                               "attr_request", FATTR4_BITMAP_ONLY);
+                       offset = dissect_nfs_attributes(tvb, offset, pinfo, newftree,
+                               FATTR4_BITMAP_ONLY);
                        break;
 
                case NFS4_OP_GETFH:
                        break;
 
                case NFS4_OP_LINK:
-                       offset = dissect_nfs_component4(tvb, offset, pinfo, newftree, 
-                               "newname");
+                       offset = dissect_nfs_utf8string(tvb, offset, newftree,
+                               hf_nfs_component4, NULL);
                        break;
 
                case NFS4_OP_LOCK:
-                       offset = dissect_rpc_uint32(tvb, pinfo, newftree, hf_nfs_lock_type4,
-                               offset);
-                       offset = dissect_rpc_bool(tvb, pinfo, newftree, hf_nfs_lock4_reclaim,
-                               offset);
-                       offset = dissect_rpc_uint64(tvb, pinfo, newftree, hf_nfs_offset4,
-                               offset);
-                       offset = dissect_nfs_length4(tvb, offset, pinfo, newftree, "length");
-                       offset = dissect_nfs_locker4(tvb, offset, pinfo, newftree);
+                       offset = dissect_rpc_uint32(tvb, newftree, hf_nfs_lock_type4, offset);
+                       offset = dissect_rpc_bool(tvb, newftree, hf_nfs_lock4_reclaim, offset);
+                       offset = dissect_rpc_uint64(tvb, newftree, hf_nfs_offset4, offset);
+                       offset = dissect_rpc_uint64(tvb, newftree, hf_nfs_length4, offset);
+                       offset = dissect_nfs_locker4(tvb, offset, newftree);
                        break;
 
                case NFS4_OP_LOCKT:
-                       offset = dissect_rpc_uint32(tvb, pinfo, newftree, hf_nfs_lock_type4,
-                               offset);
-                       offset = dissect_nfs_lock_owner4(tvb, offset, pinfo, newftree, 
-                               "owner");
-                       offset = dissect_rpc_uint64(tvb, pinfo, newftree, hf_nfs_offset4,
-                               offset);
-                       offset = dissect_nfs_length4(tvb, offset, pinfo, newftree, "length");
+                       offset = dissect_rpc_uint32(tvb, newftree, hf_nfs_lock_type4, offset);
+                       offset = dissect_rpc_uint64(tvb, newftree, hf_nfs_offset4, offset);
+                       offset = dissect_rpc_uint64(tvb, newftree, hf_nfs_length4, offset);
+                       offset = dissect_nfs_lock_owner4(tvb, offset, newftree);
                        break;
 
                case NFS4_OP_LOCKU:
-                       offset = dissect_rpc_uint32(tvb, pinfo, newftree, hf_nfs_lock_type4,
-                               offset);
-                       offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nfs_seqid4, offset);
-                       offset = dissect_nfs_stateid4(tvb, offset, pinfo, newftree);
-                       offset = dissect_rpc_uint64(tvb, pinfo, newftree, hf_nfs_offset4,
-                               offset);
-                       offset = dissect_nfs_length4(tvb, offset, pinfo, newftree, "length");
+                       offset = dissect_rpc_uint32(tvb, newftree, hf_nfs_lock_type4, offset);
+                       offset = dissect_rpc_uint32(tvb, tree, hf_nfs_seqid4, offset);
+                       offset = dissect_nfs_stateid4(tvb, offset, newftree);
+                       offset = dissect_rpc_uint64(tvb, newftree, hf_nfs_offset4, offset);
+                       offset = dissect_rpc_uint64(tvb, newftree, hf_nfs_length4, offset);
                        break;
 
                case NFS4_OP_LOOKUP:
-                       offset = dissect_nfs_component4(tvb, offset, pinfo, newftree, 
-                               "objname");
+                       offset = dissect_nfs_utf8string(tvb, offset, newftree,
+                               hf_nfs_component4, NULL);
                        break;
 
                case NFS4_OP_LOOKUPP:
                        break;
 
                case NFS4_OP_NVERIFY:
-                       offset = dissect_nfs_fattr4(tvb, offset, pinfo, newftree, 
-                               "obj_attributes");
+                       offset = dissect_nfs_fattr4(tvb, offset, pinfo, newftree);
                        break;
 
                case NFS4_OP_OPEN:
-                       offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nfs_seqid4, offset);
-                       offset = dissect_nfs_open4_share_access(tvb, offset, pinfo, newftree);
-                       offset = dissect_nfs_open4_share_deny(tvb, offset, pinfo, newftree);
-                       offset = dissect_nfs_open_owner4(tvb, offset, pinfo, newftree);
+                       offset = dissect_rpc_uint32(tvb, newftree, hf_nfs_seqid4,
+                               offset);
+                       offset = dissect_nfs_open4_share_access(tvb, offset, newftree);
+                       offset = dissect_nfs_open4_share_deny(tvb, offset, newftree);
+                       offset = dissect_nfs_open_owner4(tvb, offset, newftree);
                        offset = dissect_nfs_openflag4(tvb, offset, pinfo, newftree);
-                       offset = dissect_nfs_open_claim4(tvb, offset, pinfo, newftree, 
-                               "claim");
+                       offset = dissect_nfs_open_claim4(tvb, offset, newftree);
                        break;
 
                case NFS4_OP_OPENATTR:
-                       offset = dissect_rpc_bool(tvb, pinfo, newftree, hf_nfs_attrdircreate,
+                       offset = dissect_rpc_bool(tvb, newftree, hf_nfs_attrdircreate,
                                offset);
                        break;
 
                case NFS4_OP_OPEN_CONFIRM:
-                       offset = dissect_nfs_stateid4(tvb, offset, pinfo, newftree);
-                       offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nfs_seqid4, offset);
+                       offset = dissect_nfs_stateid4(tvb, offset, newftree);
+                       offset = dissect_rpc_uint32(tvb, newftree, hf_nfs_seqid4,
+                               offset);
                        break;
 
                case NFS4_OP_OPEN_DOWNGRADE:
-                       offset = dissect_nfs_stateid4(tvb, offset, pinfo, newftree);
-                       offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nfs_seqid4, offset);
-                       offset = dissect_nfs_open4_share_access(tvb, offset, pinfo, newftree);
-                       offset = dissect_nfs_open4_share_deny(tvb, offset, pinfo, newftree);
+                       offset = dissect_nfs_stateid4(tvb, offset, newftree);
+                       offset = dissect_rpc_uint32(tvb, newftree, hf_nfs_seqid4,
+                               offset);
+                       offset = dissect_nfs_open4_share_access(tvb, offset, newftree);
+                       offset = dissect_nfs_open4_share_deny(tvb, offset, newftree);
                        break;
 
                case NFS4_OP_PUTFH:
@@ -5999,23 +6254,23 @@ dissect_nfs_argop4(tvbuff_t *tvb, int offset, packet_info *pinfo,
                        break;
 
                case NFS4_OP_READ:
-                       offset = dissect_nfs_stateid4(tvb, offset, pinfo, newftree);
-                       offset = dissect_rpc_uint64(tvb, pinfo, newftree, hf_nfs_offset4,
+                       offset = dissect_nfs_stateid4(tvb, offset, newftree);
+                       offset = dissect_rpc_uint64(tvb, newftree, hf_nfs_offset4,
                                offset);
-                       offset = dissect_rpc_uint32(tvb, pinfo, newftree, hf_nfs_count4,
+                       offset = dissect_rpc_uint32(tvb, newftree, hf_nfs_count4,
                                offset);
                        break;
 
                case NFS4_OP_READDIR:
-                       offset = dissect_rpc_uint64(tvb, pinfo, newftree, hf_nfs_cookie4,
+                       offset = dissect_rpc_uint64(tvb, newftree, hf_nfs_cookie4,
                                offset);
-                       offset = dissect_rpc_uint64(tvb, pinfo, newftree, hf_nfs_cookieverf4,
+                       offset = dissect_rpc_uint64(tvb, newftree, hf_nfs_cookieverf4,
                                offset);
-                       offset = dissect_rpc_uint32(tvb, pinfo, newftree, 
+                       offset = dissect_rpc_uint32(tvb, newftree,
                                hf_nfs_count4_dircount, offset);
-                       offset = dissect_rpc_uint32(tvb, pinfo, newftree,
+                       offset = dissect_rpc_uint32(tvb, newftree,
                                hf_nfs_count4_maxcount, offset);
-                       offset = dissect_nfs_attributes(tvb, offset, pinfo, newftree, "attr", 
+                       offset = dissect_nfs_attributes(tvb, offset, pinfo, newftree,
                                FATTR4_BITMAP_ONLY);
                        break;
 
@@ -6023,83 +6278,80 @@ dissect_nfs_argop4(tvbuff_t *tvb, int offset, packet_info *pinfo,
                        break;
 
                case NFS4_OP_REMOVE:
-                       offset = dissect_nfs_component4(tvb, offset, pinfo, newftree, 
-                               "target");
+                       offset = dissect_nfs_utf8string(tvb, offset, newftree,
+                               hf_nfs_component4, NULL);
                        break;
 
                case NFS4_OP_RENAME:
-                       offset = dissect_nfs_component4(tvb, offset, pinfo, newftree, 
-                               "oldname");
-                       offset = dissect_nfs_component4(tvb, offset, pinfo, newftree, 
-                               "newname");
+                       offset = dissect_nfs_utf8string(tvb, offset, newftree,
+                               hf_nfs_component4, NULL);
+                       offset = dissect_nfs_utf8string(tvb, offset, newftree,
+                               hf_nfs_component4, NULL);
                        break;
 
                case NFS4_OP_RENEW:
-                       offset = dissect_nfs_clientid4(tvb, offset, pinfo, newftree);
+                       offset = dissect_rpc_uint64(tvb, newftree, hf_nfs_clientid4, offset);
                        break;
-       
+
                case NFS4_OP_RESTOREFH:
                case NFS4_OP_SAVEFH:
                        break;
 
                case NFS4_OP_SECINFO:
-                       offset = dissect_nfs_component4(tvb, offset, pinfo, newftree, "name");
+                       offset = dissect_nfs_utf8string(tvb, offset, newftree,
+                               hf_nfs_component4, NULL);
                        break;
 
                case NFS4_OP_SETATTR:
-                       offset = dissect_nfs_stateid4(tvb, offset, pinfo, newftree);
-                       offset = dissect_nfs_fattr4(tvb, offset, pinfo, newftree, 
-                               "obj_attributes");
+                       offset = dissect_nfs_stateid4(tvb, offset, newftree);
+                       offset = dissect_nfs_fattr4(tvb, offset, pinfo, newftree);
                        break;
 
                case NFS4_OP_SETCLIENTID:
                        {
                                proto_tree *client_tree = NULL;
+                               proto_tree *callback_tree = NULL;
 
                                fitem = proto_tree_add_text(newftree, tvb, offset, 0, "client");
+                               if (fitem)
+                               {
+                                       client_tree = proto_item_add_subtree(fitem, ett_nfs_client_id4);
 
-                               if (fitem) {
-                                       client_tree = proto_item_add_subtree(fitem, 
-                                               ett_nfs_client_id4);
-
-                                       if (newftree)
-                                       {
-                                               offset = dissect_nfs_clientid4(tvb, offset, pinfo, 
-                                                       client_tree);
-
-                                               offset = dissect_nfsdata(tvb, offset, pinfo, client_tree, 
-                                                       hf_nfs_client_id4_id); 
-                                       }
+                                       if (client_tree)
+                                               offset = dissect_nfs_client_id4(tvb, offset, client_tree);
                                }
 
                                fitem = proto_tree_add_text(newftree, tvb, offset, 0, "callback");
-                               if (fitem) {
-                                       newftree = proto_item_add_subtree(fitem, ett_nfs_cb_client4);
-                                       if (newftree)
-                                               offset = dissect_nfs_cb_client4(tvb, offset, pinfo, newftree, 
-                                                       "callback");
+                               if (fitem)
+                               {
+                                       callback_tree = proto_item_add_subtree(fitem,
+                                               ett_nfs_cb_client4);
+
+                                       if (callback_tree)
+                                               offset = dissect_nfs_cb_client4(tvb, offset, callback_tree);
                                }
+
+                               offset = dissect_rpc_uint32(tvb, newftree, hf_nfs_callback_ident,
+                                       offset);
                        }
                        break;
 
                case NFS4_OP_SETCLIENTID_CONFIRM:
-                       offset = dissect_nfs_clientid4(tvb, offset, pinfo, newftree);
+                       offset = dissect_rpc_uint64(tvb, newftree, hf_nfs_clientid4, offset);
+                       offset = dissect_rpc_uint64(tvb, newftree, hf_nfs_verifier4, offset);
                        break;
-               
+
                case NFS4_OP_VERIFY:
-                       offset = dissect_nfs_fattr4(tvb, offset, pinfo, newftree, 
-                               "obj_attributes");
+                       offset = dissect_nfs_fattr4(tvb, offset, pinfo, newftree);
                        break;
 
                case NFS4_OP_WRITE:
-                       offset = dissect_nfs_stateid4(tvb, offset, pinfo, newftree);
-                       offset = dissect_rpc_uint64(tvb, pinfo, newftree, hf_nfs_offset4,
-                               offset);
-                       offset = dissect_nfs_stable_how4(tvb, offset, pinfo, newftree, 
-                               "stable");
-                       offset = dissect_nfs_opaque4(tvb, offset, pinfo, newftree, "data");
+                       offset = dissect_nfs_stateid4(tvb, offset, newftree);
+                       offset = dissect_rpc_uint64(tvb, newftree, hf_nfs_offset4, offset);
+                       offset = dissect_nfs_stable_how4(tvb, offset, newftree, "stable");
+                       offset = dissect_nfsdata(tvb, offset, newftree, hf_nfs_data);
                        break;
-               
+
                default:
                        break;
                }
@@ -6108,32 +6360,63 @@ dissect_nfs_argop4(tvbuff_t *tvb, int offset, packet_info *pinfo,
        return offset;
 }
 
-int
-dissect_nfs4_compound_call(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_nfs4_compound_call(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree* tree)
 {
-       offset = dissect_nfs_utf8string(tvb, offset, pinfo, tree, hf_nfs_tag4, NULL);
-       offset = dissect_rpc_uint32(tvb, pinfo, tree, hf_nfs_minorversion,
-               offset);
+       offset = dissect_nfs_utf8string(tvb, offset, tree, hf_nfs_tag4, NULL);
+       offset = dissect_rpc_uint32(tvb, tree, hf_nfs_minorversion, offset);
        offset = dissect_nfs_argop4(tvb, offset, pinfo, tree);
 
        return offset;
 }
 
-int
-dissect_nfs_resop4(tvbuff_t *tvb, int offset, packet_info *pinfo, 
-       proto_tree *tree, char *name)
+static int
+dissect_nfs_secinfo4_res(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
+       proto_tree *tree)
 {
-       guint ops, ops_counter;
-       guint opcode;
+       guint flavor;
+       proto_item *fitem;
+       proto_tree *secftree;
+
+       flavor = tvb_get_ntohl(tvb, offset);
+       fitem = proto_tree_add_uint(tree, hf_nfs_secinfo_flavor, tvb, offset, 4,
+               flavor);
+       offset += 4;
+
+       if (fitem)
+       {
+               switch(flavor)
+               {
+               case RPCSEC_GSS:
+                       secftree = proto_item_add_subtree(fitem, ett_nfs_secinfo4_flavor_info);
+                       if (secftree)
+                               offset = dissect_nfs_rpcsec_gss_info(tvb, offset, secftree);
+                       break;
+
+               default:
+                       break;
+               }
+       }
+
+       return offset;
+}
+
+static int
+dissect_nfs_resop4(tvbuff_t *tvb, int offset, packet_info *pinfo,
+       proto_tree *tree)
+{
+       guint32 ops, ops_counter;
+       guint32 opcode;
        proto_item *fitem;
        proto_tree *ftree = NULL;
        proto_tree *newftree = NULL;
        guint32 status;
 
        ops = tvb_get_ntohl(tvb, offset+0);
-       fitem = proto_tree_add_text(tree, tvb, offset, 4, 
-               "Operations (count: %d)", ops);
+
+       fitem = proto_tree_add_text(tree, tvb, offset, 4,
+               "Operations (count: %u)", ops);
        offset += 4;
 
        if (fitem == NULL)      return offset;
@@ -6146,12 +6429,10 @@ dissect_nfs_resop4(tvbuff_t *tvb, int offset, packet_info *pinfo,
        {
                opcode = tvb_get_ntohl(tvb, offset);
 
-               printf("Reply opcode: %d\n", opcode);
-
                /* sanity check for bogus packets */
                if (opcode < NFS4_OP_ACCESS || opcode > NFS4_OP_WRITE)  break;
 
-               fitem = proto_tree_add_uint(ftree, hf_nfs_resop4, tvb, offset, 4, 
+               fitem = proto_tree_add_uint(ftree, hf_nfs_resop4, tvb, offset, 4,
                        opcode);
                offset += 4;
 
@@ -6162,10 +6443,10 @@ dissect_nfs_resop4(tvbuff_t *tvb, int offset, packet_info *pinfo,
                if (newftree == NULL)
                        break;          /* error adding new subtree to operation item */
 
-               offset = dissect_nfs_nfsstat4(tvb, offset, pinfo, newftree, &status);
+               offset = dissect_nfs_nfsstat4(tvb, offset, newftree, &status);
 
                /*
-                * With the exception of NFS4_OP_LOCK, NFS4_OP_LOCKT, and 
+                * With the exception of NFS4_OP_LOCK, NFS4_OP_LOCKT, and
                 * NFS4_OP_SETATTR, all other ops do *not* return data with the
                 * failed status code.
                 */
@@ -6178,29 +6459,28 @@ dissect_nfs_resop4(tvbuff_t *tvb, int offset, packet_info *pinfo,
                switch(opcode)
                {
                case NFS4_OP_ACCESS:
-                       offset = dissect_access(tvb, offset, pinfo, newftree, "Supported");
-                       offset = dissect_access(tvb, offset, pinfo, newftree, "Access");
+                       offset = dissect_access(tvb, offset, newftree, "Supported");
+                       offset = dissect_access(tvb, offset, newftree, "Access");
                        break;
 
                case NFS4_OP_CLOSE:
-                       offset = dissect_nfs_stateid4(tvb, offset, pinfo, newftree);
+                       offset = dissect_nfs_stateid4(tvb, offset, newftree);
                        break;
 
                case NFS4_OP_COMMIT:
-                       offset = dissect_rpc_uint64(tvb, pinfo, newftree, hf_nfs_verifier4, 
+                       offset = dissect_rpc_uint64(tvb, newftree, hf_nfs_verifier4,
                                offset);
                        break;
 
                case NFS4_OP_CREATE:
-                       offset = dissect_nfs_change_info4(tvb, offset, pinfo, newftree, 
+                       offset = dissect_nfs_change_info4(tvb, offset, newftree,
                                "change_info");
-                       offset = dissect_nfs_fattr4(tvb, offset, pinfo, newftree, 
-                               "attrsset");
+                       offset = dissect_nfs_attributes(tvb, offset, pinfo, newftree,
+                               FATTR4_BITMAP_ONLY);
                        break;
 
                case NFS4_OP_GETATTR:
-                       offset = dissect_nfs_fattr4(tvb, offset, pinfo, newftree, 
-                               "obj_attributes");
+                       offset = dissect_nfs_fattr4(tvb, offset, pinfo, newftree);
                        break;
 
                case NFS4_OP_GETFH:
@@ -6208,126 +6488,98 @@ dissect_nfs_resop4(tvbuff_t *tvb, int offset, packet_info *pinfo,
                        break;
 
                case NFS4_OP_LINK:
-                       offset = dissect_nfs_change_info4(tvb, offset, pinfo, newftree, 
+                       offset = dissect_nfs_change_info4(tvb, offset, newftree,
                                "change_info");
                        break;
 
                case NFS4_OP_LOCK:
                case NFS4_OP_LOCKT:
                        if (status == NFS4_OK)
-                               offset = dissect_nfs_stateid4(tvb, offset, pinfo, newftree);
+                       {
+                               if (opcode == NFS4_OP_LOCK)
+                                       offset = dissect_nfs_stateid4(tvb, offset, newftree);
+                       }
                        else
                        if (status == NFS4ERR_DENIED)
-                               offset = dissect_nfs_lock4denied(tvb, offset, pinfo, newftree, 
-                                       "denied");
+                               offset = dissect_nfs_lock4denied(tvb, offset, newftree);
                        break;
 
                case NFS4_OP_LOCKU:
-                       offset = dissect_nfs_stateid4(tvb, offset, pinfo, newftree);
+                       offset = dissect_nfs_stateid4(tvb, offset, newftree);
                        break;
 
                case NFS4_OP_OPEN:
-                       offset = dissect_nfs_stateid4(tvb, offset, pinfo, newftree);
-                       offset = dissect_nfs_change_info4(tvb, offset, pinfo, newftree, 
+                       offset = dissect_nfs_stateid4(tvb, offset, newftree);
+                       offset = dissect_nfs_change_info4(tvb, offset, newftree,
                                "change_info");
-                       offset = dissect_nfs_open4_rflags(tvb, offset, pinfo, newftree, 
+                       offset = dissect_nfs_open4_rflags(tvb, offset, newftree,
                                "result_flags");
-                       offset = dissect_nfs_attributes(tvb, offset, pinfo, newftree, 
-                               "attrsset", FATTR4_BITMAP_ONLY);
-                       offset = dissect_nfs_open_delegation4(tvb, offset, pinfo, newftree, 
-                               "delegation");
+                       offset = dissect_nfs_attributes(tvb, offset, pinfo, newftree,
+                               FATTR4_BITMAP_ONLY);
+                       offset = dissect_nfs_open_delegation4(tvb, offset, pinfo, newftree);
                        break;
 
                case NFS4_OP_OPEN_CONFIRM:
                case NFS4_OP_OPEN_DOWNGRADE:
-                       offset = dissect_nfs_stateid4(tvb, offset, pinfo, newftree);
+                       offset = dissect_nfs_stateid4(tvb, offset, newftree);
                        break;
 
                case NFS4_OP_READ:
-                       offset = dissect_rpc_uint32(tvb, pinfo, newftree, hf_nfs_eof, 
-                               offset);
-                       offset = dissect_nfs_opaque4(tvb, offset, pinfo, newftree, "data");
+                       offset = dissect_rpc_uint32(tvb, newftree, hf_nfs_eof, offset);
+                       offset = dissect_nfsdata(tvb, offset, newftree, hf_nfs_data);
                        break;
 
                case NFS4_OP_READDIR:
-                       offset = dissect_rpc_uint64(tvb, pinfo, newftree, hf_nfs_verifier4, 
-                               offset);
-                       offset = dissect_nfs_dirlist4(tvb, offset, pinfo, newftree, "reply");
+                       offset = dissect_rpc_uint64(tvb, newftree, hf_nfs_verifier4, offset);
+                       offset = dissect_nfs_dirlist4(tvb, offset, pinfo, newftree);
                        break;
 
                case NFS4_OP_READLINK:
-                       offset = dissect_nfs_linktext4(tvb, offset, pinfo, newftree, "link");
+                       offset = dissect_nfs_utf8string(tvb, offset, newftree,
+                               hf_nfs_linktext4, NULL);
                        break;
 
                case NFS4_OP_REMOVE:
-                       offset = dissect_nfs_change_info4(tvb, offset, pinfo, newftree, 
+                       offset = dissect_nfs_change_info4(tvb, offset, newftree,
                                "change_info");
                        break;
 
                case NFS4_OP_RENAME:
-                       offset = dissect_nfs_change_info4(tvb, offset, pinfo, newftree, 
+                       offset = dissect_nfs_change_info4(tvb, offset, newftree,
                                "source_cinfo");
-                       offset = dissect_nfs_change_info4(tvb, offset, pinfo, newftree,
+                       offset = dissect_nfs_change_info4(tvb, offset, newftree,
                                "target_cinfo");
                        break;
 
                case NFS4_OP_SECINFO:
-                       {
-                               guint data_follows;
-                               guint flavor;
-                               proto_item *fitem;
-                               proto_tree *secftree;
-
-                               while ((data_follows = tvb_get_ntohl(tvb, offset)))
-                               {
-                                       offset += 4;
-
-                                       flavor = tvb_get_ntohl(tvb, offset);
-                                       fitem = proto_tree_add_uint(tree, hf_nfs_secinfo_flavor, tvb, 
-                                                       offset, 4, flavor);
-                                       offset += 4;
-
-                                       if (fitem) 
-                                       {
-                                               switch(flavor)
-                                               {
-                                                       case RPCSEC_GSS:
-                                                               secftree = proto_item_add_subtree(fitem, 
-                                                                               ett_nfs_secinfo4_flavor_info);
-                                                               if (secftree)
-                                                                       offset = dissect_nfs_rpcsec_gss_info(tvb, offset,
-                                                                                       pinfo, secftree);
-                                                               break;
-
-                                                       default:
-                                                               break;
-                                               }
-                                       }
-                               }
-                       }
+                       offset = dissect_rpc_list(tvb, pinfo, tree, offset,
+                               dissect_nfs_secinfo4_res);
                        break;
 
                case NFS4_OP_SETATTR:
-                       offset = dissect_nfs_attributes(tvb, offset, pinfo, newftree, 
-                               "attrsset", FATTR4_BITMAP_ONLY);
+                       offset = dissect_nfs_attributes(tvb, offset, pinfo, newftree,
+                               FATTR4_BITMAP_ONLY);
                        break;
 
                case NFS4_OP_SETCLIENTID:
                        if (status == NFS4_OK)
-                               offset = dissect_rpc_uint64(tvb, pinfo, newftree,
-                                       hf_nfs_clientid4, offset);
+                       {
+                               offset = dissect_rpc_uint64(tvb, newftree, hf_nfs_clientid4,
+                                       offset);
+                               offset = dissect_rpc_uint64(tvb, newftree, hf_nfs_verifier4,
+                                       offset);
+                       }
                        else
                        if (status == NFS4ERR_CLID_INUSE)
-                               offset = dissect_nfs_clientaddr4(tvb, offset, pinfo, newftree,
-                                       "client_using");
+                               offset = dissect_nfs_clientaddr4(tvb, offset, newftree);
                        break;
 
                case NFS4_OP_WRITE:
-                       offset = dissect_rpc_uint32(tvb, pinfo, newftree, hf_nfs_count4,
+                       offset = dissect_rpc_uint32(tvb, newftree, hf_nfs_count4,
                                offset);
-                       offset = dissect_nfs_stable_how4(tvb, offset, pinfo, newftree, 
+                       offset = dissect_nfs_stable_how4(tvb, offset, newftree,
                                "committed");
-                       offset = dissect_rpc_uint64(tvb, pinfo, newftree, hf_nfs_verifier4, 
+                       offset = dissect_rpc_uint64(tvb, newftree, hf_nfs_verifier4,
                                offset);
                        break;
 
@@ -6339,15 +6591,15 @@ dissect_nfs_resop4(tvbuff_t *tvb, int offset, packet_info *pinfo,
        return offset;
 }
 
-int
-dissect_nfs4_compound_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+static int
+dissect_nfs4_compound_reply(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree* tree)
 {
        guint32 status;
 
-       offset = dissect_nfs_nfsstat4(tvb, offset, pinfo, tree, &status);
-       offset = dissect_nfs_utf8string(tvb, offset, pinfo, tree, hf_nfs_tag4, NULL);
-       offset = dissect_nfs_resop4(tvb, offset, pinfo, tree, "arguments");
+       offset = dissect_nfs_nfsstat4(tvb, offset, tree, &status);
+       offset = dissect_nfs_utf8string(tvb, offset, tree, hf_nfs_tag4, NULL);
+       offset = dissect_nfs_resop4(tvb, offset, pinfo, tree);
 
        return offset;
 }
@@ -6402,6 +6654,33 @@ static const vsff nfs3_proc[] = {
        dissect_nfs3_commit_call,       dissect_nfs3_commit_reply },
        { 0,NULL,NULL,NULL }
 };
+
+static const value_string nfsv3_proc_vals[] = {
+       { 0,    "NULL" },
+       { 1,    "GETATTR" },
+       { 2,    "SETATTR" },
+       { 3,    "LOOKUP" },
+       { 4,    "ACCESS" },
+       { 5,    "READLINK" },
+       { 6,    "READ" },
+       { 7,    "WRITE" },
+       { 8,    "CREATE" },
+       { 9,    "MKDIR" },
+       { 10,   "SYMLINK" },
+       { 11,   "MKNOD" },
+       { 12,   "REMOVE" },
+       { 13,   "RMDIR" },
+       { 14,   "RENAME" },
+       { 15,   "LINK" },
+       { 16,   "READDIR" },
+       { 17,   "READDIRPLUS" },
+       { 18,   "FSSTAT" },
+       { 19,   "FSINFO" },
+       { 20,   "PATHCONF" },
+       { 21,   "COMMIT" },
+       { 0,    NULL }
+};
+
 /* end of NFS Version 3 */
 
 static const vsff nfs4_proc[] = {
@@ -6412,6 +6691,11 @@ static const vsff nfs4_proc[] = {
        { 0, NULL, NULL, NULL }
 };
 
+static const value_string nfsv4_proc_vals[] = {
+       { 0, "NULL" },
+       { 1, "COMPOUND" },
+       { 0, NULL }
+};
 
 static struct true_false_string yesno = { "Yes", "No" };
 
@@ -6420,6 +6704,15 @@ void
 proto_register_nfs(void)
 {
        static hf_register_info hf[] = {
+               { &hf_nfs_procedure_v2, {
+                       "V2 Procedure", "nfs.procedure_v2", FT_UINT32, BASE_DEC,
+                       VALS(nfsv2_proc_vals), 0, "V2 Procedure", HFILL }},
+               { &hf_nfs_procedure_v3, {
+                       "V3 Procedure", "nfs.procedure_v3", FT_UINT32, BASE_DEC,
+                       VALS(nfsv3_proc_vals), 0, "V3 Procedure", HFILL }},
+               { &hf_nfs_procedure_v4, {
+                       "V4 Procedure", "nfs.procedure_v4", FT_UINT32, BASE_DEC,
+                       VALS(nfsv4_proc_vals), 0, "V4 Procedure", HFILL }},
                { &hf_nfs_fh_length, {
                        "length", "nfs.fh.length", FT_UINT32, BASE_DEC,
                        NULL, 0, "file handle length", HFILL }},
@@ -6658,13 +6951,13 @@ proto_register_nfs(void)
                        "no_trunc", "nfs.pathconf.no_trunc", FT_BOOLEAN, BASE_NONE,
                        &yesno, 0, "No long file name truncation", HFILL }},
                { &hf_nfs_pathconf_chown_restricted, {
-                       "chown_restricted", "nfs.pathconf.chown_restricted", FT_BOOLEAN, 
+                       "chown_restricted", "nfs.pathconf.chown_restricted", FT_BOOLEAN,
                        BASE_NONE, &yesno, 0, "chown is restricted to root", HFILL }},
                { &hf_nfs_pathconf_case_insensitive, {
-                       "case_insensitive", "nfs.pathconf.case_insensitive", FT_BOOLEAN, 
+                       "case_insensitive", "nfs.pathconf.case_insensitive", FT_BOOLEAN,
                        BASE_NONE, &yesno, 0, "file names are treated case insensitive", HFILL }},
                { &hf_nfs_pathconf_case_preserving, {
-                       "case_preserving", "nfs.pathconf.case_preserving", FT_BOOLEAN, 
+                       "case_preserving", "nfs.pathconf.case_preserving", FT_BOOLEAN,
                        BASE_NONE, &yesno, 0, "file name cases are preserved", HFILL }},
 
                { &hf_nfs_fattr_type, {
@@ -6826,7 +7119,7 @@ proto_register_nfs(void)
                        NULL, 0, "Tag", HFILL }},
 
                { &hf_nfs_clientid4, {
-                       "clientid", "nfs.clientid", FT_UINT64, BASE_DEC,
+                       "clientid", "nfs.clientid", FT_UINT64, BASE_HEX,
                        NULL, 0, "Client ID", HFILL }},
 
                { &hf_nfs_ace4, {
@@ -6893,16 +7186,12 @@ proto_register_nfs(void)
                        "attr_vals", "nfs.fattr4.attr_vals", FT_BYTES, BASE_DEC,
                        NULL, 0, "attr_vals", HFILL }},
 
-               { &hf_nfs_fattr4_expire_type, {
-                       "fattr4_expire_type", "nfs.fattr4_expire_type", FT_UINT32, BASE_DEC,
-                       VALS(names_fattr4_expire_type), 0, "fattr4_expire_type", HFILL }},
-
                { &hf_nfs_fattr4_link_support, {
-                       "fattr4_link_support", "nfs.fattr4_link_support", FT_BOOLEAN, 
+                       "fattr4_link_support", "nfs.fattr4_link_support", FT_BOOLEAN,
                        BASE_NONE, &yesno, 0, "nfs.fattr4_link_support", HFILL }},
 
                { &hf_nfs_fattr4_symlink_support, {
-                       "fattr4_symlink_support", "nfs.fattr4_symlink_support", FT_BOOLEAN, 
+                       "fattr4_symlink_support", "nfs.fattr4_symlink_support", FT_BOOLEAN,
                        BASE_NONE, &yesno, 0, "nfs.fattr4_symlink_support", HFILL }},
 
                { &hf_nfs_fattr4_named_attr, {
@@ -6910,35 +7199,35 @@ proto_register_nfs(void)
                        &yesno, 0, "nfs.fattr4_named_attr", HFILL }},
 
                { &hf_nfs_fattr4_unique_handles, {
-                       "fattr4_unique_handles", "nfs.fattr4_unique_handles", FT_BOOLEAN, 
+                       "fattr4_unique_handles", "nfs.fattr4_unique_handles", FT_BOOLEAN,
                        BASE_NONE, &yesno, 0, "nfs.fattr4_unique_handles", HFILL }},
 
                { &hf_nfs_fattr4_archive, {
-                       "fattr4_archive", "nfs.fattr4_archive", FT_BOOLEAN, 
+                       "fattr4_archive", "nfs.fattr4_archive", FT_BOOLEAN,
                        BASE_NONE, &yesno, 0, "nfs.fattr4_archive", HFILL }},
 
                { &hf_nfs_fattr4_cansettime, {
-                       "fattr4_cansettime", "nfs.fattr4_cansettime", FT_BOOLEAN, 
+                       "fattr4_cansettime", "nfs.fattr4_cansettime", FT_BOOLEAN,
                        BASE_NONE, &yesno, 0, "nfs.fattr4_cansettime", HFILL }},
 
                { &hf_nfs_fattr4_case_insensitive, {
-                       "fattr4_case_insensitive", "nfs.fattr4_case_insensitive", FT_BOOLEAN, 
+                       "fattr4_case_insensitive", "nfs.fattr4_case_insensitive", FT_BOOLEAN,
                        BASE_NONE, &yesno, 0, "nfs.fattr4_case_insensitive", HFILL }},
 
                { &hf_nfs_fattr4_case_preserving, {
-                       "fattr4_case_preserving", "nfs.fattr4_case_preserving", FT_BOOLEAN, 
+                       "fattr4_case_preserving", "nfs.fattr4_case_preserving", FT_BOOLEAN,
                        BASE_NONE, &yesno, 0, "nfs.fattr4_case_preserving", HFILL }},
 
                { &hf_nfs_fattr4_chown_restricted, {
-                       "fattr4_chown_restricted", "nfs.fattr4_chown_restricted", FT_BOOLEAN, 
+                       "fattr4_chown_restricted", "nfs.fattr4_chown_restricted", FT_BOOLEAN,
                        BASE_NONE, &yesno, 0, "nfs.fattr4_chown_restricted", HFILL }},
 
                { &hf_nfs_fattr4_hidden, {
-                       "fattr4_hidden", "nfs.fattr4_hidden", FT_BOOLEAN, 
+                       "fattr4_hidden", "nfs.fattr4_hidden", FT_BOOLEAN,
                        BASE_NONE, &yesno, 0, "nfs.fattr4_hidden", HFILL }},
 
                { &hf_nfs_fattr4_homogeneous, {
-                       "fattr4_homogeneous", "nfs.fattr4_homogeneous", FT_BOOLEAN, 
+                       "fattr4_homogeneous", "nfs.fattr4_homogeneous", FT_BOOLEAN,
                        BASE_NONE, &yesno, 0, "nfs.fattr4_homogeneous", HFILL }},
 
                { &hf_nfs_fattr4_mimetype, {
@@ -6946,11 +7235,11 @@ proto_register_nfs(void)
                        NULL, 0, "nfs.fattr4_mimetype", HFILL }},
 
                { &hf_nfs_fattr4_no_trunc, {
-                       "fattr4_no_trunc", "nfs.fattr4_no_trunc", FT_BOOLEAN, 
+                       "fattr4_no_trunc", "nfs.fattr4_no_trunc", FT_BOOLEAN,
                        BASE_NONE, &yesno, 0, "nfs.fattr4_no_trunc", HFILL }},
 
                { &hf_nfs_fattr4_system, {
-                       "fattr4_system", "nfs.fattr4_system", FT_BOOLEAN, 
+                       "fattr4_system", "nfs.fattr4_system", FT_BOOLEAN,
                        BASE_NONE, &yesno, 0, "nfs.fattr4_system", HFILL }},
 
                { &hf_nfs_who, {
@@ -6977,10 +7266,6 @@ proto_register_nfs(void)
                        "eof", "nfs.dirlist4.eof", FT_BOOLEAN,
                        BASE_NONE, &yesno, 0, "nfs.dirlist4.eof", HFILL }},
 
-               { &hf_nfs_data_follows, {
-                       "data_follows", "nfs.data_follows", FT_BOOLEAN,
-                       BASE_NONE, &yesno, 0, "nfs.data_follows", HFILL }},
-
                { &hf_nfs_stateid4, {
                        "stateid", "nfs.stateid4", FT_UINT64, BASE_DEC,
                        NULL, 0, "nfs.stateid4", HFILL }},
@@ -7002,8 +7287,8 @@ proto_register_nfs(void)
                        VALS(names_nfs_lock_type4), 0, "nfs.locktype4", HFILL }},
 
                { &hf_nfs_reclaim4, {
-                       "reclaim", "nfs.reclaim4", FT_UINT32, BASE_DEC,
-                       NULL, 0, "nfs.reclaim4", HFILL }},
+                       "reclaim", "nfs.reclaim4", FT_BOOLEAN,
+                       BASE_NONE, &yesno, 0, "Reclaim", HFILL }},
 
                { &hf_nfs_length4, {
                        "length", "nfs.length4", FT_UINT64, BASE_DEC,
@@ -7013,6 +7298,14 @@ proto_register_nfs(void)
                        "changeid", "nfs.changeid4", FT_UINT64, BASE_DEC,
                        NULL, 0, "nfs.changeid4", HFILL }},
 
+               { &hf_nfs_changeid4_before, {
+                       "changeid", "nfs.changeid4.before", FT_UINT64, BASE_DEC,
+                       NULL, 0, "nfs.changeid4.before", HFILL }},
+
+               { &hf_nfs_changeid4_after, {
+                       "changeid", "nfs.changeid4.after", FT_UINT64, BASE_DEC,
+                       NULL, 0, "nfs.changeid4.after", HFILL }},
+
                { &hf_nfs_nfstime4_seconds, {
                        "seconds", "nfs.nfstime4.seconds", FT_UINT64, BASE_DEC,
                        NULL, 0, "nfs.nfstime4.seconds", HFILL }},
@@ -7031,7 +7324,7 @@ proto_register_nfs(void)
 
                { &hf_nfs_acetype4, {
                        "acetype", "nfs.acetype4", FT_UINT32, BASE_DEC,
-                       NULL, 0, "nfs.acetype4", HFILL }},
+                       VALS(names_acetype4), 0, "nfs.acetype4", HFILL }},
 
                { &hf_nfs_aceflag4, {
                        "aceflag", "nfs.aceflag4", FT_UINT32, BASE_DEC,
@@ -7146,7 +7439,7 @@ proto_register_nfs(void)
                        NULL, 0, "nfs.delegate_stateid", HFILL }},
 
                { &hf_nfs_verifier4, {
-                       "verifier", "nfs.verifier4", FT_UINT64, BASE_DEC,
+                       "verifier", "nfs.verifier4", FT_UINT64, BASE_HEX,
                        NULL, 0, "nfs.verifier4", HFILL }},
 
                { &hf_nfs_cookie4, {
@@ -7162,11 +7455,11 @@ proto_register_nfs(void)
                        NULL, 0, "nfs.cb_location", HFILL }},
 
                { &hf_nfs_cb_program, {
-                       "cb_program", "nfs.cb_program", FT_UINT32, BASE_DEC,
+                       "cb_program", "nfs.cb_program", FT_UINT32, BASE_HEX,
                        NULL, 0, "nfs.cb_program", HFILL }},
 
                { &hf_nfs_recall4, {
-                       "recall", "nfs.recall4", FT_BOOLEAN, 
+                       "recall", "nfs.recall4", FT_BOOLEAN,
                        BASE_NONE, &yesno, 0, "nfs.recall4", HFILL }},
 
                { &hf_nfs_filesize, {
@@ -7262,15 +7555,15 @@ proto_register_nfs(void)
                        BASE_DEC, VALS(rpc_authgss_svc), 0, "service", HFILL }},
 
                { &hf_nfs_attrdircreate, {
-                       "attribute dir create", "nfs.openattr4.createdir", FT_BOOLEAN, 
+                       "attribute dir create", "nfs.openattr4.createdir", FT_BOOLEAN,
                        BASE_NONE, &yesno, 0, "nfs.openattr4.createdir", HFILL }},
 
                { &hf_nfs_new_lock_owner, {
-                       "new lock owner?", "nfs.lock.locker.new_lock_owner", FT_BOOLEAN, 
+                       "new lock owner?", "nfs.lock.locker.new_lock_owner", FT_BOOLEAN,
                        BASE_NONE, &yesno, 0, "nfs.lock.locker.new_lock_owner", HFILL }},
 
                { &hf_nfs_lock4_reclaim, {
-                       "reclaim?", "nfs.lock.reclaim", FT_BOOLEAN, 
+                       "reclaim?", "nfs.lock.reclaim", FT_BOOLEAN,
                        BASE_NONE, &yesno, 0, "nfs.lock.reclaim", HFILL }},
 
                { &hf_nfs_sec_oid4, {
@@ -7278,16 +7571,32 @@ proto_register_nfs(void)
                        BASE_DEC, NULL, 0, "oid", HFILL }},
 
                { &hf_nfs_qop4, {
-                       "qop", "nfs.secinfo.flavor_info.rpcsec_gss_info.qop", FT_UINT32, 
+                       "qop", "nfs.secinfo.flavor_info.rpcsec_gss_info.qop", FT_UINT32,
                        BASE_DEC, NULL, 0, "qop", HFILL }},
 
                { &hf_nfs_client_id4_id, {
-                       "Data", "nfs.nfs_client_id4.id", FT_BYTES, BASE_DEC,
-                       NULL, 0, "Data", HFILL }},
+                       "id", "nfs.nfs_client_id4.id", FT_BYTES, BASE_DEC,
+                       NULL, 0, "nfs.nfs_client_id4.id", HFILL }},
 
                { &hf_nfs_stateid4_other, {
                        "Data", "nfs.stateid4.other", FT_BYTES, BASE_DEC,
                        NULL, 0, "Data", HFILL }},
+
+               { &hf_nfs_acl4, {
+                       "ACL", "nfs.acl", FT_NONE, BASE_NONE,
+                       NULL, 0, "Access Control List", HFILL }},
+
+               { &hf_nfs_callback_ident, {
+                       "callback_ident", "nfs.callback.ident", FT_UINT32, BASE_HEX,
+                       NULL, 0, "Callback Identifier", HFILL }},
+
+               { &hf_nfs_r_netid, {
+                       "r_netid", "nfs.r_netid", FT_BYTES, BASE_DEC, NULL, 0,
+                       "r_netid", HFILL }},
+
+               { &hf_nfs_r_addr, {
+                       "r_addr", "nfs.r_addr", FT_BYTES, BASE_DEC, NULL, 0,
+                       "r_addr", HFILL }},
        };
 
        static gint *ett[] = {
@@ -7383,8 +7692,14 @@ proto_register_nfs(void)
                &ett_nfs_fs_locations4,
                &ett_nfs_fs_location4,
                &ett_nfs_open4_result_flags,
+               &ett_nfs_secinfo4,
                &ett_nfs_secinfo4_flavor_info,
-               &ett_nfs_stateid4
+               &ett_nfs_stateid4,
+               &ett_nfs_fattr4_fh_expire_type,
+               &ett_nfs_ace4,
+               &ett_nfs_clientaddr4,
+               &ett_nfs_aceflag4,
+               &ett_nfs_acemask4,
        };
        module_t *nfs_module;
 
@@ -7401,7 +7716,12 @@ proto_register_nfs(void)
                                       "Snoop full path to filenames",
                                       "Whether the dissector should snoop the full pathname for files for matching FH's",
                                       &nfs_file_name_full_snooping);
+       prefs_register_bool_preference(nfs_module, "fhandle_find_both_reqrep",
+                                      "Fhandle filters finds both request/response",
+                                      "With this option display filters for nfs fhandles (nfs.fh.{name|full_name|hash}) will find both the request and response packets for a RPC call, even if the actual fhandle is only present in one of the packets",
+                                       &nfs_fhandle_reqrep_matching);
        register_init_routine(nfs_name_snoop_init);
+       register_init_routine(nfs_fhandle_reqrep_matching_init);
 }
 
 void
@@ -7410,7 +7730,7 @@ proto_reg_handoff_nfs(void)
        /* Register the protocol as RPC */
        rpc_init_prog(proto_nfs, NFS_PROGRAM, ett_nfs);
        /* Register the procedure tables */
-       rpc_init_proc_table(NFS_PROGRAM, 2, nfs2_proc);
-       rpc_init_proc_table(NFS_PROGRAM, 3, nfs3_proc);
-       rpc_init_proc_table(NFS_PROGRAM, 4, nfs4_proc);
+       rpc_init_proc_table(NFS_PROGRAM, 2, nfs2_proc, hf_nfs_procedure_v2);
+       rpc_init_proc_table(NFS_PROGRAM, 3, nfs3_proc, hf_nfs_procedure_v3);
+       rpc_init_proc_table(NFS_PROGRAM, 4, nfs4_proc, hf_nfs_procedure_v4);
 }