2 * Routines for nfs dissection
3 * Copyright 1999, Uwe Girlich <Uwe.Girlich@philosys.de>
5 * $Id: packet-nfs.c,v 1.20 2000/01/22 05:49:04 guy Exp $
7 * Ethereal - Network traffic analyzer
8 * By Gerald Combs <gerald@zing.org>
9 * Copyright 1998 Gerald Combs
11 * Copied from packet-smb.c
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
33 #ifdef HAVE_SYS_TYPES_H
34 #include <sys/types.h>
38 #include "packet-rpc.h"
39 #include "packet-nfs.h"
42 static int proto_nfs = -1;
45 static int hf_nfs_stat = -1;
46 static int hf_nfs_name = -1;
47 static int hf_nfs_readlink_data = -1;
48 static int hf_nfs_read_offset = -1;
49 static int hf_nfs_read_count = -1;
50 static int hf_nfs_read_totalcount = -1;
51 static int hf_nfs_data = -1;
52 static int hf_nfs_write_beginoffset = -1;
53 static int hf_nfs_write_offset = -1;
54 static int hf_nfs_write_totalcount = -1;
55 static int hf_nfs_symlink_to = -1;
56 static int hf_nfs_readdir_cookie = -1;
57 static int hf_nfs_readdir_count = -1;
58 static int hf_nfs_readdir_value_follows = -1;
59 static int hf_nfs_readdir_entry = -1;
60 static int hf_nfs_readdir_entry_fileid = -1;
61 static int hf_nfs_readdir_entry_name = -1;
62 static int hf_nfs_readdirplus_entry_name = -1;
63 static int hf_nfs_readdir_entry_cookie = -1;
64 static int hf_nfs_readdir_eof = -1;
65 static int hf_nfs_statfs_tsize = -1;
66 static int hf_nfs_statfs_bsize = -1;
67 static int hf_nfs_statfs_blocks = -1;
68 static int hf_nfs_statfs_bfree = -1;
69 static int hf_nfs_statfs_bavail = -1;
70 static int hf_nfs_ftype3 = -1;
71 static int hf_nfs_nfsstat3 = -1;
72 static int hf_nfs_read_eof = -1;
73 static int hf_nfs_write_stable = -1;
74 static int hf_nfs_write_committed = -1;
75 static int hf_nfs_createmode3 = -1;
76 static int hf_nfs_fsstat_invarsec = -1;
77 static int hf_nfs_fsinfo_rtmax = -1;
78 static int hf_nfs_fsinfo_rtpref = -1;
79 static int hf_nfs_fsinfo_rtmult = -1;
80 static int hf_nfs_fsinfo_wtmax = -1;
81 static int hf_nfs_fsinfo_wtpref = -1;
82 static int hf_nfs_fsinfo_wtmult = -1;
83 static int hf_nfs_fsinfo_dtpref = -1;
84 static int hf_nfs_fsinfo_properties = -1;
85 static int hf_nfs_pathconf_linkmax = -1;
86 static int hf_nfs_pathconf_name_max = -1;
87 static int hf_nfs_pathconf_no_trunc = -1;
88 static int hf_nfs_pathconf_chown_restricted = -1;
89 static int hf_nfs_pathconf_case_insensitive = -1;
90 static int hf_nfs_pathconf_case_preserving = -1;
93 static gint ett_nfs = -1;
94 static gint ett_nfs_fhandle = -1;
95 static gint ett_nfs_timeval = -1;
96 static gint ett_nfs_mode = -1;
97 static gint ett_nfs_fattr = -1;
98 static gint ett_nfs_sattr = -1;
99 static gint ett_nfs_diropargs = -1;
100 static gint ett_nfs_readdir_entry = -1;
101 static gint ett_nfs_mode3 = -1;
102 static gint ett_nfs_specdata3 = -1;
103 static gint ett_nfs_fh3 = -1;
104 static gint ett_nfs_nfstime3 = -1;
105 static gint ett_nfs_fattr3 = -1;
106 static gint ett_nfs_post_op_fh3 = -1;
107 static gint ett_nfs_sattr3 = -1;
108 static gint ett_nfs_diropargs3 = -1;
109 static gint ett_nfs_sattrguard3 = -1;
110 static gint ett_nfs_set_mode3 = -1;
111 static gint ett_nfs_set_uid3 = -1;
112 static gint ett_nfs_set_gid3 = -1;
113 static gint ett_nfs_set_size3 = -1;
114 static gint ett_nfs_set_atime = -1;
115 static gint ett_nfs_set_mtime = -1;
116 static gint ett_nfs_pre_op_attr = -1;
117 static gint ett_nfs_post_op_attr = -1;
118 static gint ett_nfs_wcc_attr = -1;
119 static gint ett_nfs_wcc_data = -1;
120 static gint ett_nfs_access = -1;
121 static gint ett_nfs_fsinfo_properties = -1;
124 /***************************/
125 /* NFS Version 2, RFC 1094 */
126 /***************************/
129 /* base 32 bit type for NFS v2 */
131 dissect_unsigned_int(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
134 offset = dissect_rpc_uint32(pd,offset,fd,tree,name,"unsigned int");
139 /* RFC 1094, Page 12..14 */
140 const value_string names_nfs_stat[] =
150 { 20, "ERR_NOTDIR" },
155 { 63, "ERR_NAMETOOLONG" },
156 { 66, "ERR_NOTEMPTY" },
159 { 99, "ERR_WFLUSH" },
164 /* RFC 1094, Page 12..14 */
166 dissect_stat(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
171 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
172 stat = EXTRACT_UINT(pd, offset+0);
175 /* this gives the right NFSv2 number<->message relation */
176 /* and makes it searchable via "nfs.status" */
177 proto_tree_add_item_format(tree, hf_nfs_nfsstat3,
178 offset+0, 4, stat, "Status: %s (%u)",
179 val_to_str(stat,names_nfs_stat,"%u"), stat);
188 /* RFC 1094, Page 12..14 */
190 dissect_nfs2_stat_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
194 offset = dissect_stat(pd, offset, fd, tree, &status);
200 /* RFC 1094, Page 15 */
202 dissect_ftype(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
206 char* ftype_name = NULL;
208 const value_string nfs2_ftype[] =
211 { 1, "Regular File" },
213 { 3, "Block Special Device" },
214 { 4, "Character Special Device" },
215 { 5, "Symbolic Link" },
219 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
220 ftype = EXTRACT_UINT(pd, offset+0);
221 ftype_name = val_to_str(ftype, nfs2_ftype, "%u");
224 proto_tree_add_text(tree, offset, 4,
225 "%s: %s (%u)", name, ftype_name, ftype);
233 /* RFC 1094, Page 15 */
235 dissect_fhandle(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
238 proto_tree* ftree = NULL;
241 fitem = proto_tree_add_text(tree, offset, FHSIZE,
244 ftree = proto_item_add_subtree(fitem, ett_nfs_fhandle);
248 proto_tree_add_text(ftree,offset+0,FHSIZE,
249 "file handle (opaque data)");
257 /* RFC 1094, Page 15 */
259 dissect_nfs2_fhandle_call(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
261 offset = dissect_fhandle(pd, offset, fd, tree, "object");
267 /* RFC 1094, Page 15 */
269 dissect_timeval(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
274 proto_item* time_item;
275 proto_tree* time_tree = NULL;
277 if (!BYTES_ARE_IN_FRAME(offset,8)) return offset;
278 seconds = EXTRACT_UINT(pd, offset+0);
279 mseconds = EXTRACT_UINT(pd, offset+4);
282 time_item = proto_tree_add_text(tree, offset, 8,
283 "%s: %u.%06u", name, seconds, mseconds);
285 time_tree = proto_item_add_subtree(time_item, ett_nfs_timeval);
289 proto_tree_add_text(time_tree,offset+0,4,
290 "seconds: %u", seconds);
291 proto_tree_add_text(time_tree,offset+4,4,
292 "micro seconds: %u", mseconds);
299 /* RFC 1094, Page 16 */
300 const value_string nfs2_mode_names[] = {
301 { 0040000, "Directory" },
302 { 0020000, "Character Special Device" },
303 { 0060000, "Block Special Device" },
304 { 0100000, "Regular File" },
305 { 0120000, "Symbolic Link" },
306 { 0140000, "Named Socket" },
311 dissect_mode(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
315 proto_item* mode_item = NULL;
316 proto_tree* mode_tree = NULL;
318 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
319 mode = EXTRACT_UINT(pd, offset+0);
322 mode_item = proto_tree_add_text(tree, offset, 4,
323 "%s: 0%o", name, mode);
325 mode_tree = proto_item_add_subtree(mode_item, ett_nfs_mode);
329 proto_tree_add_text(mode_tree, offset, 4, "%s",
330 decode_enumerated_bitfield(mode, 0160000, 16,
331 nfs2_mode_names, "%s"));
332 proto_tree_add_text(mode_tree, offset, 4, "%s",
333 decode_boolean_bitfield(mode, 04000, 16, "Set user id on exec", "not SUID"));
334 proto_tree_add_text(mode_tree, offset, 4, "%s",
335 decode_boolean_bitfield(mode, 02000, 16, "Set group id on exec", "not SGID"));
336 proto_tree_add_text(mode_tree, offset, 4, "%s",
337 decode_boolean_bitfield(mode, 01000, 16, "Save swapped text even after use", "not save swapped text"));
338 proto_tree_add_text(mode_tree, offset, 4, "%s",
339 decode_boolean_bitfield(mode, 0400, 16, "Read permission for owner", "no Read permission for owner"));
340 proto_tree_add_text(mode_tree, offset, 4, "%s",
341 decode_boolean_bitfield(mode, 0200, 16, "Write permission for owner", "no Write permission for owner"));
342 proto_tree_add_text(mode_tree, offset, 4, "%s",
343 decode_boolean_bitfield(mode, 0100, 16, "Execute permission for owner", "no Execute permission for owner"));
344 proto_tree_add_text(mode_tree, offset, 4, "%s",
345 decode_boolean_bitfield(mode, 040, 16, "Read permission for group", "no Read permission for group"));
346 proto_tree_add_text(mode_tree, offset, 4, "%s",
347 decode_boolean_bitfield(mode, 020, 16, "Write permission for group", "no Write permission for group"));
348 proto_tree_add_text(mode_tree, offset, 4, "%s",
349 decode_boolean_bitfield(mode, 010, 16, "Execute permission for group", "no Execute permission for group"));
350 proto_tree_add_text(mode_tree, offset, 4, "%s",
351 decode_boolean_bitfield(mode, 04, 16, "Read permission for others", "no Read permission for others"));
352 proto_tree_add_text(mode_tree, offset, 4, "%s",
353 decode_boolean_bitfield(mode, 02, 16, "Write permission for others", "no Write permission for others"));
354 proto_tree_add_text(mode_tree, offset, 4, "%s",
355 decode_boolean_bitfield(mode, 01, 16, "Execute permission for others", "no Execute permission for others"));
363 /* RFC 1094, Page 15 */
365 dissect_fattr(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
367 proto_item* fattr_item = NULL;
368 proto_tree* fattr_tree = NULL;
369 int old_offset = offset;
372 fattr_item = proto_tree_add_text(tree, offset,
373 END_OF_FRAME, "%s", name);
375 fattr_tree = proto_item_add_subtree(fattr_item, ett_nfs_fattr);
378 offset = dissect_ftype (pd,offset,fd,fattr_tree,"type");
379 offset = dissect_mode (pd,offset,fd,fattr_tree,"mode");
380 offset = dissect_unsigned_int (pd,offset,fd,fattr_tree,"nlink");
381 offset = dissect_unsigned_int (pd,offset,fd,fattr_tree,"uid");
382 offset = dissect_unsigned_int (pd,offset,fd,fattr_tree,"gid");
383 offset = dissect_unsigned_int (pd,offset,fd,fattr_tree,"size");
384 offset = dissect_unsigned_int (pd,offset,fd,fattr_tree,"blocksize");
385 offset = dissect_unsigned_int (pd,offset,fd,fattr_tree,"rdev");
386 offset = dissect_unsigned_int (pd,offset,fd,fattr_tree,"blocks");
387 offset = dissect_unsigned_int (pd,offset,fd,fattr_tree,"fsid");
388 offset = dissect_unsigned_int (pd,offset,fd,fattr_tree,"fileid");
389 offset = dissect_timeval (pd,offset,fd,fattr_tree,"atime");
390 offset = dissect_timeval (pd,offset,fd,fattr_tree,"mtime");
391 offset = dissect_timeval (pd,offset,fd,fattr_tree,"ctime");
393 /* now we know, that fattr is shorter */
395 proto_item_set_len(fattr_item, offset - old_offset);
402 /* RFC 1094, Page 17 */
404 dissect_sattr(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
406 proto_item* sattr_item = NULL;
407 proto_tree* sattr_tree = NULL;
408 int old_offset = offset;
411 sattr_item = proto_tree_add_text(tree, offset,
412 END_OF_FRAME, "%s", name);
414 sattr_tree = proto_item_add_subtree(sattr_item, ett_nfs_sattr);
417 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
418 if (EXTRACT_UINT(pd, offset+0) != 0xffffffff)
419 offset = dissect_mode (pd,offset,fd,sattr_tree,"mode");
421 proto_tree_add_text(sattr_tree, offset, 4, "mode: no value");
425 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
426 if (EXTRACT_UINT(pd, offset+0) != 0xffffffff)
427 offset = dissect_unsigned_int (pd,offset,fd,sattr_tree,"uid");
429 proto_tree_add_text(sattr_tree, offset, 4, "uid: no value");
433 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
434 if (EXTRACT_UINT(pd, offset+0) != 0xffffffff)
435 offset = dissect_unsigned_int (pd,offset,fd,sattr_tree,"gid");
437 proto_tree_add_text(sattr_tree, offset, 4, "gid: no value");
441 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
442 if (EXTRACT_UINT(pd, offset+0) != 0xffffffff)
443 offset = dissect_unsigned_int (pd,offset,fd,sattr_tree,"size");
445 proto_tree_add_text(sattr_tree, offset, 4, "size: no value");
449 if (!BYTES_ARE_IN_FRAME(offset,8)) return offset;
450 if (EXTRACT_UINT(pd, offset+0) != 0xffffffff)
451 offset = dissect_timeval (pd,offset,fd,sattr_tree,"atime");
453 proto_tree_add_text(sattr_tree, offset, 8, "atime: no value");
457 if (!BYTES_ARE_IN_FRAME(offset,8)) return offset;
458 if (EXTRACT_UINT(pd, offset+0) != 0xffffffff)
459 offset = dissect_timeval (pd,offset,fd,sattr_tree,"mtime");
461 proto_tree_add_text(sattr_tree, offset, 8, "mtime: no value");
465 /* now we know, that sattr is shorter */
467 proto_item_set_len(sattr_item, offset - old_offset);
474 /* RFC 1094, Page 17 */
476 dissect_filename(const u_char *pd, int offset, frame_data *fd,
477 proto_tree *tree, int hf, char **string_ret)
479 offset = dissect_rpc_string(pd,offset,fd,tree,hf,string_ret);
484 /* RFC 1094, Page 17 */
486 dissect_path(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, int hf)
488 offset = dissect_rpc_string(pd,offset,fd,tree,hf,NULL);
493 /* RFC 1094, Page 17,18 */
495 dissect_attrstat(const u_char *pd, int offset, frame_data *fd, proto_tree *tree){
498 offset = dissect_stat(pd, offset, fd, tree, &status);
501 offset = dissect_fattr(pd, offset, fd, tree, "attributes");
512 /* RFC 1094, Page 17,18 */
514 dissect_nfs2_attrstat_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
516 offset = dissect_attrstat(pd, offset, fd, tree);
522 /* RFC 1094, Page 18 */
524 dissect_diropargs(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
526 proto_item* diropargs_item = NULL;
527 proto_tree* diropargs_tree = NULL;
528 int old_offset = offset;
531 diropargs_item = proto_tree_add_text(tree, offset,
532 END_OF_FRAME, "%s", name);
534 diropargs_tree = proto_item_add_subtree(diropargs_item, ett_nfs_diropargs);
537 offset = dissect_fhandle (pd,offset,fd,diropargs_tree,"dir");
538 offset = dissect_filename(pd,offset,fd,diropargs_tree,hf_nfs_name,NULL);
540 /* now we know, that diropargs is shorter */
541 if (diropargs_item) {
542 proto_item_set_len(diropargs_item, offset - old_offset);
549 /* RFC 1094, Page 18 */
551 dissect_nfs2_diropargs_call(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
553 offset = dissect_diropargs(pd, offset, fd, tree, "where");
559 /* RFC 1094, Page 18 */
561 dissect_diropres(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
565 offset = dissect_stat(pd, offset, fd, tree, &status);
568 offset = dissect_fhandle(pd, offset, fd, tree, "file");
569 offset = dissect_fattr (pd, offset, fd, tree, "attributes");
580 /* nfsdata is simply a RPC string (length, data, fill bytes) */
582 dissect_nfsdata(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
585 offset = dissect_rpc_data(pd,offset,fd,tree,hf);
591 /* RFC 1094, Page 18 */
593 dissect_nfs2_diropres_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
595 offset = dissect_diropres(pd, offset, fd, tree);
601 /* RFC 1094, Page 6 */
603 dissect_nfs2_setattr_call(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
605 offset = dissect_fhandle(pd, offset, fd, tree, "file" );
606 offset = dissect_sattr (pd, offset, fd, tree, "attributes");
612 /* RFC 1094, Page 6 */
614 dissect_nfs2_readlink_reply(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
618 offset = dissect_stat(pd, offset, fd, tree, &status);
621 offset = dissect_path(pd, offset, fd, tree, hf_nfs_readlink_data);
632 /* RFC 1094, Page 7 */
634 dissect_nfs2_read_call(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
636 guint32 offset_value;
640 offset = dissect_fhandle(pd, offset, fd, tree, "file" );
641 if (!BYTES_ARE_IN_FRAME(offset,12)) return offset;
642 offset_value = EXTRACT_UINT(pd, offset+0);
643 count = EXTRACT_UINT(pd, offset+4);
644 totalcount = EXTRACT_UINT(pd, offset+8);
646 proto_tree_add_item(tree, hf_nfs_read_offset,
647 offset+0, 4, offset_value);
648 proto_tree_add_item(tree, hf_nfs_read_count,
650 proto_tree_add_item(tree, hf_nfs_read_totalcount,
651 offset+8, 4, totalcount);
659 /* RFC 1094, Page 7 */
661 dissect_nfs2_read_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
665 offset = dissect_stat(pd, offset, fd, tree, &status);
668 offset = dissect_fattr(pd, offset, fd, tree, "attributes");
669 offset = dissect_nfsdata(pd, offset, fd, tree, hf_nfs_data);
680 /* RFC 1094, Page 8 */
682 dissect_nfs2_write_call(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
685 guint32 offset_value;
688 offset = dissect_fhandle(pd, offset, fd, tree, "file" );
689 if (!BYTES_ARE_IN_FRAME(offset,12)) return offset;
690 beginoffset = EXTRACT_UINT(pd, offset+0);
691 offset_value = EXTRACT_UINT(pd, offset+4);
692 totalcount = EXTRACT_UINT(pd, offset+8);
694 proto_tree_add_item(tree, hf_nfs_write_beginoffset,
695 offset+0, 4, beginoffset);
696 proto_tree_add_item(tree, hf_nfs_write_offset,
697 offset+4, 4, offset_value);
698 proto_tree_add_item(tree, hf_nfs_write_totalcount,
699 offset+8, 4, totalcount);
703 offset = dissect_nfsdata(pd, offset, fd, tree, hf_nfs_data);
709 /* RFC 1094, Page 8 */
711 dissect_nfs2_createargs_call(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
713 offset = dissect_diropargs(pd, offset, fd, tree, "where" );
714 offset = dissect_sattr (pd, offset, fd, tree, "attributes");
720 /* RFC 1094, Page 9 */
722 dissect_nfs2_rename_call(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
724 offset = dissect_diropargs(pd, offset, fd, tree, "from");
725 offset = dissect_diropargs(pd, offset, fd, tree, "to" );
731 /* RFC 1094, Page 9 */
733 dissect_nfs2_link_call(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
735 offset = dissect_fhandle (pd, offset, fd, tree, "from");
736 offset = dissect_diropargs(pd, offset, fd, tree, "to" );
742 /* RFC 1094, Page 10 */
744 dissect_nfs2_symlink_call(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
746 offset = dissect_diropargs(pd, offset, fd, tree, "from" );
747 offset = dissect_path (pd, offset, fd, tree, hf_nfs_symlink_to);
748 offset = dissect_sattr (pd, offset, fd, tree, "attributes" );
754 /* RFC 1094, Page 11 */
756 dissect_nfs2_readdir_call(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
761 offset = dissect_fhandle (pd, offset, fd, tree, "dir");
762 if (!BYTES_ARE_IN_FRAME(offset,8)) return offset;
763 cookie = EXTRACT_UINT(pd, offset+ 0);
764 count = EXTRACT_UINT(pd, offset+ 4);
766 proto_tree_add_item(tree, hf_nfs_readdir_cookie,
767 offset+ 0, 4, cookie);
768 proto_tree_add_item(tree, hf_nfs_readdir_count,
769 offset+ 4, 4, count);
777 /* RFC 1094, Page 11 */
779 dissect_readdir_entry(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
781 proto_item* entry_item = NULL;
782 proto_tree* entry_tree = NULL;
783 int old_offset = offset;
789 entry_item = proto_tree_add_item(tree, hf_nfs_readdir_entry,
790 offset+0, END_OF_FRAME, NULL);
792 entry_tree = proto_item_add_subtree(entry_item, ett_nfs_readdir_entry);
795 if (!BYTES_ARE_IN_FRAME(offset, 4)) {
796 proto_item_set_text(entry_item, "Entry: <TRUNCATED>");
799 fileid = EXTRACT_UINT(pd, offset + 0);
801 proto_tree_add_item(entry_tree, hf_nfs_readdir_entry_fileid,
802 offset+0, 4, fileid);
805 offset = dissect_filename(pd, offset, fd, entry_tree,
806 hf_nfs_readdir_entry_name, &name);
807 proto_item_set_text(entry_item, "Entry: file ID %u, name %s",
811 if (!BYTES_ARE_IN_FRAME(offset, 4)) return offset;
812 cookie = EXTRACT_UINT(pd, offset + 0);
814 proto_tree_add_item(entry_tree, hf_nfs_readdir_entry_cookie,
815 offset+0, 4, cookie);
818 /* now we know, that a readdir entry is shorter */
820 proto_item_set_len(entry_item, offset - old_offset);
826 /* RFC 1094, Page 11 */
828 dissect_nfs2_readdir_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
831 guint32 value_follows;
834 offset = dissect_stat(pd, offset, fd, tree, &status);
838 if (!BYTES_ARE_IN_FRAME(offset,4)) break;
839 value_follows = EXTRACT_UINT(pd, offset+0);
840 proto_tree_add_item(tree,hf_nfs_readdir_value_follows,
841 offset+0, 4, value_follows);
843 if (value_follows == 1) {
844 offset = dissect_readdir_entry(pd, offset, fd, tree);
850 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
851 eof_value = EXTRACT_UINT(pd, offset+0);
853 proto_tree_add_item(tree, hf_nfs_readdir_eof,
854 offset+ 0, 4, eof_value);
866 /* RFC 1094, Page 12 */
868 dissect_nfs2_statfs_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
877 offset = dissect_stat(pd, offset, fd, tree, &status);
880 if (!BYTES_ARE_IN_FRAME(offset,5 * 4)) return offset;
881 tsize = EXTRACT_UINT(pd, offset+ 0);
882 bsize = EXTRACT_UINT(pd, offset+ 4);
883 blocks = EXTRACT_UINT(pd, offset+ 8);
884 bfree = EXTRACT_UINT(pd, offset+12);
885 bavail = EXTRACT_UINT(pd, offset+16);
887 proto_tree_add_item(tree, hf_nfs_statfs_tsize,
888 offset+ 0, 4, tsize);
889 proto_tree_add_item(tree, hf_nfs_statfs_bsize,
890 offset+ 4, 4, bsize);
891 proto_tree_add_item(tree, hf_nfs_statfs_blocks,
892 offset+ 8, 4, blocks);
893 proto_tree_add_item(tree, hf_nfs_statfs_bfree,
894 offset+12, 4, bfree);
895 proto_tree_add_item(tree, hf_nfs_statfs_bavail,
896 offset+16, 4, bavail);
909 /* proc number, "proc name", dissect_request, dissect_reply */
910 /* NULL as function pointer means: take the generic one. */
911 const vsff nfs2_proc[] = {
912 { 0, "NULL", /* OK */
914 { 1, "GETATTR", /* OK */
915 dissect_nfs2_fhandle_call, dissect_nfs2_attrstat_reply },
916 { 2, "SETATTR", /* OK */
917 dissect_nfs2_setattr_call, dissect_nfs2_attrstat_reply },
918 { 3, "ROOT", /* OK */
920 { 4, "LOOKUP", /* OK */
921 dissect_nfs2_diropargs_call, dissect_nfs2_diropres_reply },
922 { 5, "READLINK", /* OK */
923 dissect_nfs2_fhandle_call, dissect_nfs2_readlink_reply },
924 { 6, "READ", /* OK */
925 dissect_nfs2_read_call, dissect_nfs2_read_reply },
926 { 7, "WRITECACHE", /* OK */
928 { 8, "WRITE", /* OK */
929 dissect_nfs2_write_call, dissect_nfs2_attrstat_reply },
930 { 9, "CREATE", /* OK */
931 dissect_nfs2_createargs_call, dissect_nfs2_diropres_reply },
932 { 10, "REMOVE", /* OK */
933 dissect_nfs2_diropargs_call, dissect_nfs2_stat_reply },
934 { 11, "RENAME", /* OK */
935 dissect_nfs2_rename_call, dissect_nfs2_stat_reply },
936 { 12, "LINK", /* OK */
937 dissect_nfs2_link_call, dissect_nfs2_stat_reply },
938 { 13, "SYMLINK", /* OK */
939 dissect_nfs2_symlink_call, dissect_nfs2_stat_reply },
940 { 14, "MKDIR", /* OK */
941 dissect_nfs2_createargs_call, dissect_nfs2_diropres_reply },
942 { 15, "RMDIR", /* OK */
943 dissect_nfs2_diropargs_call, dissect_nfs2_stat_reply },
944 { 16, "READDIR", /* OK */
945 dissect_nfs2_readdir_call, dissect_nfs2_readdir_reply },
946 { 17, "STATFS", /* OK */
947 dissect_nfs2_fhandle_call, dissect_nfs2_statfs_reply },
950 /* end of NFS Version 2 */
953 /***************************/
954 /* NFS Version 3, RFC 1813 */
955 /***************************/
958 /* RFC 1813, Page 15 */
960 dissect_uint64(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
963 offset = dissect_rpc_uint64(pd,offset,fd,tree,name,"uint64");
968 /* RFC 1813, Page 15 */
970 dissect_uint32(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
973 offset = dissect_rpc_uint32(pd,offset,fd,tree,name,"uint32");
978 /* RFC 1813, Page 15 */
980 dissect_filename3(const u_char *pd, int offset, frame_data *fd,
981 proto_tree *tree, int hf, char **string_ret)
983 offset = dissect_rpc_string(pd,offset,fd,tree,hf,string_ret);
988 /* RFC 1813, Page 15 */
990 dissect_nfspath3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, int hf)
992 offset = dissect_rpc_string(pd,offset,fd,tree,hf,NULL);
997 /* RFC 1813, Page 15 */
999 dissect_fileid3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
1002 offset = dissect_rpc_uint64(pd,offset,fd,tree,name,"fileid3");
1007 /* RFC 1813, Page 15 */
1009 dissect_cookie3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
1012 offset = dissect_rpc_uint64(pd,offset,fd,tree,name,"cookie3");
1017 /* RFC 1813, Page 15 */
1019 dissect_cookieverf3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
1021 if (!BYTES_ARE_IN_FRAME(offset,8)) return offset;
1022 proto_tree_add_text(tree, offset, NFS3_COOKIEVERFSIZE,
1023 "Verifier: Opaque Data");
1024 offset += NFS3_COOKIEVERFSIZE;
1029 /* RFC 1813, Page 16 */
1031 dissect_createverf3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
1033 if (!BYTES_ARE_IN_FRAME(offset,8)) return offset;
1034 proto_tree_add_text(tree, offset, NFS3_CREATEVERFSIZE,
1035 "Verifier: Opaque Data");
1036 offset += NFS3_CREATEVERFSIZE;
1041 /* RFC 1813, Page 16 */
1043 dissect_writeverf3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
1045 if (!BYTES_ARE_IN_FRAME(offset,8)) return offset;
1046 proto_tree_add_text(tree, offset, NFS3_WRITEVERFSIZE,
1047 "Verifier: Opaque Data");
1048 offset += NFS3_WRITEVERFSIZE;
1053 /* RFC 1813, Page 16 */
1055 dissect_uid3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
1058 offset = dissect_rpc_uint32(pd,offset,fd,tree,name,"uid3");
1063 /* RFC 1813, Page 16 */
1065 dissect_gid3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
1068 offset = dissect_rpc_uint32(pd,offset,fd,tree,name,"gid3");
1073 /* RFC 1813, Page 16 */
1075 dissect_size3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
1078 offset = dissect_rpc_uint64(pd,offset,fd,tree,name,"size3");
1083 /* RFC 1813, Page 16 */
1085 dissect_offset3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
1088 offset = dissect_rpc_uint64(pd,offset,fd,tree,name,"offset3");
1093 /* RFC 1813, Page 16 */
1095 dissect_mode3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
1099 proto_item* mode3_item = NULL;
1100 proto_tree* mode3_tree = NULL;
1102 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
1103 mode3 = EXTRACT_UINT(pd, offset+0);
1106 mode3_item = proto_tree_add_text(tree, offset, 4,
1107 "%s: 0%o", name, mode3);
1109 mode3_tree = proto_item_add_subtree(mode3_item, ett_nfs_mode3);
1112 /* RFC 1813, Page 23 */
1114 proto_tree_add_text(mode3_tree, offset, 4, "%s",
1115 decode_boolean_bitfield(mode3, 0x800, 12, "Set user id on exec", "not SUID"));
1116 proto_tree_add_text(mode3_tree, offset, 4, "%s",
1117 decode_boolean_bitfield(mode3, 0x400, 12, "Set group id on exec", "not SGID"));
1118 proto_tree_add_text(mode3_tree, offset, 4, "%s",
1119 decode_boolean_bitfield(mode3, 0x200, 12, "Save swapped text even after use", "not save swapped text"));
1120 proto_tree_add_text(mode3_tree, offset, 4, "%s",
1121 decode_boolean_bitfield(mode3, 0x100, 12, "Read permission for owner", "no Read permission for owner"));
1122 proto_tree_add_text(mode3_tree, offset, 4, "%s",
1123 decode_boolean_bitfield(mode3, 0x80, 12, "Write permission for owner", "no Write permission for owner"));
1124 proto_tree_add_text(mode3_tree, offset, 4, "%s",
1125 decode_boolean_bitfield(mode3, 0x40, 12, "Execute permission for owner", "no Execute permission for owner"));
1126 proto_tree_add_text(mode3_tree, offset, 4, "%s",
1127 decode_boolean_bitfield(mode3, 0x20, 12, "Read permission for group", "no Read permission for group"));
1128 proto_tree_add_text(mode3_tree, offset, 4, "%s",
1129 decode_boolean_bitfield(mode3, 0x10, 12, "Write permission for group", "no Write permission for group"));
1130 proto_tree_add_text(mode3_tree, offset, 4, "%s",
1131 decode_boolean_bitfield(mode3, 0x8, 12, "Execute permission for group", "no Execute permission for group"));
1132 proto_tree_add_text(mode3_tree, offset, 4, "%s",
1133 decode_boolean_bitfield(mode3, 0x4, 12, "Read permission for others", "no Read permission for others"));
1134 proto_tree_add_text(mode3_tree, offset, 4, "%s",
1135 decode_boolean_bitfield(mode3, 0x2, 12, "Write permission for others", "no Write permission for others"));
1136 proto_tree_add_text(mode3_tree, offset, 4, "%s",
1137 decode_boolean_bitfield(mode3, 0x1, 12, "Execute permission for others", "no Execute permission for others"));
1145 /* RFC 1813, Page 16 */
1147 dissect_count3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
1150 offset = dissect_rpc_uint32(pd,offset,fd,tree,name,"count3");
1155 /* RFC 1813, Page 16,17 */
1156 const value_string names_nfs_nfsstat3[] =
1163 { 13, "ERR_ACCES" },
1164 { 17, "ERR_EXIST" },
1166 { 19, "ERR_NODEV" },
1167 { 20, "ERR_NOTDIR" },
1168 { 21, "ERR_ISDIR" },
1169 { 22, "ERR_INVAL" },
1171 { 28, "ERR_NOSPC" },
1173 { 31, "ERR_MLINK" },
1174 { 63, "ERR_NAMETOOLONG" },
1175 { 66, "ERR_NOTEMPTY" },
1176 { 69, "ERR_DQUOT" },
1177 { 70, "ERR_STALE" },
1178 { 71, "ERR_REMOTE" },
1179 { 10001, "ERR_BADHANDLE" },
1180 { 10002, "ERR_NOT_SYNC" },
1181 { 10003, "ERR_BAD_COOKIE" },
1182 { 10004, "ERR_NOTSUPP" },
1183 { 10005, "ERR_TOOSMALL" },
1184 { 10006, "ERR_SERVERFAULT" },
1185 { 10007, "ERR_BADTYPE" },
1186 { 10008, "ERR_JUKEBOX" },
1191 /* RFC 1813, Page 16 */
1193 dissect_nfsstat3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,guint32 *status)
1197 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
1198 nfsstat3 = EXTRACT_UINT(pd, offset+0);
1201 proto_tree_add_item(tree, hf_nfs_nfsstat3,
1202 offset, 4, nfsstat3);
1211 const value_string names_nfs_ftype3[] =
1213 { NF3REG, "Regular File" },
1214 { NF3DIR, "Directory" },
1215 { NF3BLK, "Block Special Device" },
1216 { NF3CHR, "Character Special Device" },
1217 { NF3LNK, "Symbolic Link" },
1218 { NF3SOCK,"Socket" },
1219 { NF3FIFO,"Named Pipe" },
1224 /* RFC 1813, Page 20 */
1226 dissect_ftype3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
1227 int hf, guint32* ftype3)
1231 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
1232 type = EXTRACT_UINT(pd, offset+0);
1235 proto_tree_add_item(tree, hf, offset, 4, type);
1244 /* RFC 1813, Page 20 */
1246 dissect_specdata3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
1251 proto_item* specdata3_item;
1252 proto_tree* specdata3_tree = NULL;
1254 if (!BYTES_ARE_IN_FRAME(offset,8)) return offset;
1255 specdata1 = EXTRACT_UINT(pd, offset+0);
1256 specdata2 = EXTRACT_UINT(pd, offset+4);
1259 specdata3_item = proto_tree_add_text(tree, offset, 8,
1260 "%s: %u,%u", name, specdata1, specdata2);
1262 specdata3_tree = proto_item_add_subtree(specdata3_item,
1266 if (specdata3_tree) {
1267 proto_tree_add_text(specdata3_tree,offset+0,4,
1268 "specdata1: %u", specdata1);
1269 proto_tree_add_text(specdata3_tree,offset+4,4,
1270 "specdata2: %u", specdata2);
1278 /* RFC 1813, Page 21 */
1280 dissect_nfs_fh3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
1286 proto_tree* ftree = NULL;
1288 fh3_len = EXTRACT_UINT(pd, offset+0);
1289 fh3_len_full = rpc_roundup(fh3_len);
1290 fh3_fill = fh3_len_full - fh3_len;
1293 fitem = proto_tree_add_text(tree, offset, 4+fh3_len_full,
1296 ftree = proto_item_add_subtree(fitem, ett_nfs_fh3);
1300 proto_tree_add_text(ftree,offset+0,4,
1301 "length: %u", fh3_len);
1302 proto_tree_add_text(ftree,offset+4,fh3_len,
1303 "file handle (opaque data)");
1305 proto_tree_add_text(ftree,offset+4+fh3_len,fh3_fill,
1308 offset += 4 + fh3_len_full;
1313 /* RFC 1813, Page 21 */
1315 dissect_nfstime3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,char* name)
1320 proto_item* time_item;
1321 proto_tree* time_tree = NULL;
1323 if (!BYTES_ARE_IN_FRAME(offset,8)) return offset;
1324 seconds = EXTRACT_UINT(pd, offset+0);
1325 nseconds = EXTRACT_UINT(pd, offset+4);
1328 time_item = proto_tree_add_text(tree, offset, 8,
1329 "%s: %u.%09u", name, seconds, nseconds);
1331 time_tree = proto_item_add_subtree(time_item, ett_nfs_nfstime3);
1335 proto_tree_add_text(time_tree,offset+0,4,
1336 "seconds: %u", seconds);
1337 proto_tree_add_text(time_tree,offset+4,4,
1338 "nano seconds: %u", nseconds);
1345 /* RFC 1813, Page 22 */
1347 dissect_fattr3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
1349 proto_item* fattr3_item = NULL;
1350 proto_tree* fattr3_tree = NULL;
1351 int old_offset = offset;
1355 fattr3_item = proto_tree_add_text(tree, offset,
1356 END_OF_FRAME, "%s", name);
1358 fattr3_tree = proto_item_add_subtree(fattr3_item, ett_nfs_fattr3);
1361 offset = dissect_ftype3 (pd,offset,fd,fattr3_tree,hf_nfs_ftype3,&type);
1362 offset = dissect_mode3 (pd,offset,fd,fattr3_tree,"mode");
1363 offset = dissect_uint32 (pd,offset,fd,fattr3_tree,"nlink");
1364 offset = dissect_uid3 (pd,offset,fd,fattr3_tree,"uid");
1365 offset = dissect_gid3 (pd,offset,fd,fattr3_tree,"gid");
1366 offset = dissect_size3 (pd,offset,fd,fattr3_tree,"size");
1367 offset = dissect_size3 (pd,offset,fd,fattr3_tree,"used");
1368 offset = dissect_specdata3(pd,offset,fd,fattr3_tree,"rdev");
1369 offset = dissect_uint64 (pd,offset,fd,fattr3_tree,"fsid");
1370 offset = dissect_fileid3 (pd,offset,fd,fattr3_tree,"fileid");
1371 offset = dissect_nfstime3 (pd,offset,fd,fattr3_tree,"atime");
1372 offset = dissect_nfstime3 (pd,offset,fd,fattr3_tree,"mtime");
1373 offset = dissect_nfstime3 (pd,offset,fd,fattr3_tree,"ctime");
1375 /* now we know, that fattr3 is shorter */
1377 proto_item_set_len(fattr3_item, offset - old_offset);
1384 const value_string value_follows[] =
1387 { 1, "value follows"},
1392 /* RFC 1813, Page 23 */
1394 dissect_post_op_attr(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
1396 proto_item* post_op_attr_item = NULL;
1397 proto_tree* post_op_attr_tree = NULL;
1398 int old_offset = offset;
1399 guint32 attributes_follow;
1402 post_op_attr_item = proto_tree_add_text(tree, offset,
1403 END_OF_FRAME, "%s", name);
1404 if (post_op_attr_item)
1405 post_op_attr_tree = proto_item_add_subtree(post_op_attr_item, ett_nfs_post_op_attr);
1408 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
1409 attributes_follow = EXTRACT_UINT(pd, offset+0);
1410 proto_tree_add_text(post_op_attr_tree, offset, 4,
1411 "attributes_follow: %s (%u)",
1412 val_to_str(attributes_follow,value_follows,"Unknown"), attributes_follow);
1414 switch (attributes_follow) {
1416 offset = dissect_fattr3(pd, offset, fd, post_op_attr_tree,
1424 /* now we know, that post_op_attr_tree is shorter */
1425 if (post_op_attr_item) {
1426 proto_item_set_len(post_op_attr_item, offset - old_offset);
1433 /* RFC 1813, Page 24 */
1435 dissect_wcc_attr(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
1437 proto_item* wcc_attr_item = NULL;
1438 proto_tree* wcc_attr_tree = NULL;
1439 int old_offset = offset;
1442 wcc_attr_item = proto_tree_add_text(tree, offset,
1443 END_OF_FRAME, "%s", name);
1445 wcc_attr_tree = proto_item_add_subtree(wcc_attr_item, ett_nfs_wcc_attr);
1448 offset = dissect_size3 (pd, offset, fd, wcc_attr_tree, "size" );
1449 offset = dissect_nfstime3(pd, offset, fd, wcc_attr_tree, "mtime");
1450 offset = dissect_nfstime3(pd, offset, fd, wcc_attr_tree, "ctime");
1452 /* now we know, that wcc_attr_tree is shorter */
1453 if (wcc_attr_item) {
1454 proto_item_set_len(wcc_attr_item, offset - old_offset);
1461 /* RFC 1813, Page 24 */
1463 dissect_pre_op_attr(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
1465 proto_item* pre_op_attr_item = NULL;
1466 proto_tree* pre_op_attr_tree = NULL;
1467 int old_offset = offset;
1468 guint32 attributes_follow;
1471 pre_op_attr_item = proto_tree_add_text(tree, offset,
1472 END_OF_FRAME, "%s", name);
1473 if (pre_op_attr_item)
1474 pre_op_attr_tree = proto_item_add_subtree(pre_op_attr_item, ett_nfs_pre_op_attr);
1477 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
1478 attributes_follow = EXTRACT_UINT(pd, offset+0);
1479 proto_tree_add_text(pre_op_attr_tree, offset, 4,
1480 "attributes_follow: %s (%u)",
1481 val_to_str(attributes_follow,value_follows,"Unknown"), attributes_follow);
1483 switch (attributes_follow) {
1485 offset = dissect_wcc_attr(pd, offset, fd, pre_op_attr_tree,
1493 /* now we know, that pre_op_attr_tree is shorter */
1494 if (pre_op_attr_item) {
1495 proto_item_set_len(pre_op_attr_item, offset - old_offset);
1502 /* RFC 1813, Page 24 */
1504 dissect_wcc_data(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
1506 proto_item* wcc_data_item = NULL;
1507 proto_tree* wcc_data_tree = NULL;
1508 int old_offset = offset;
1511 wcc_data_item = proto_tree_add_text(tree, offset,
1512 END_OF_FRAME, "%s", name);
1514 wcc_data_tree = proto_item_add_subtree(wcc_data_item, ett_nfs_wcc_data);
1517 offset = dissect_pre_op_attr (pd, offset, fd, wcc_data_tree, "before");
1518 offset = dissect_post_op_attr(pd, offset, fd, wcc_data_tree, "after" );
1520 /* now we know, that wcc_data is shorter */
1521 if (wcc_data_item) {
1522 proto_item_set_len(wcc_data_item, offset - old_offset);
1529 /* RFC 1813, Page 25 */
1531 dissect_post_op_fh3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
1533 proto_item* post_op_fh3_item = NULL;
1534 proto_tree* post_op_fh3_tree = NULL;
1535 int old_offset = offset;
1536 guint32 handle_follows;
1539 post_op_fh3_item = proto_tree_add_text(tree, offset,
1540 END_OF_FRAME, "%s", name);
1541 if (post_op_fh3_item)
1542 post_op_fh3_tree = proto_item_add_subtree(post_op_fh3_item, ett_nfs_post_op_fh3);
1545 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
1546 handle_follows = EXTRACT_UINT(pd, offset+0);
1547 proto_tree_add_text(post_op_fh3_tree, offset, 4,
1548 "handle_follows: %s (%u)",
1549 val_to_str(handle_follows,value_follows,"Unknown"), handle_follows);
1551 switch (handle_follows) {
1553 offset = dissect_nfs_fh3(pd, offset, fd, post_op_fh3_tree,
1561 /* now we know, that post_op_fh3_tree is shorter */
1562 if (post_op_fh3_item) {
1563 proto_item_set_len(post_op_fh3_item, offset - old_offset);
1570 /* RFC 1813, Page 25 */
1572 dissect_set_mode3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
1574 proto_item* set_mode3_item = NULL;
1575 proto_tree* set_mode3_tree = NULL;
1576 int old_offset = offset;
1580 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
1581 set_it = EXTRACT_UINT(pd, offset+0);
1582 set_it_name = val_to_str(set_it,value_follows,"Unknown");
1585 set_mode3_item = proto_tree_add_text(tree, offset,
1586 END_OF_FRAME, "%s: %s", name, set_it_name);
1588 set_mode3_tree = proto_item_add_subtree(set_mode3_item, ett_nfs_set_mode3);
1592 proto_tree_add_text(set_mode3_tree, offset, 4,
1593 "set_it: %s (%u)", set_it_name, set_it);
1599 offset = dissect_mode3(pd, offset, fd, set_mode3_tree,
1607 /* now we know, that set_mode3 is shorter */
1608 if (set_mode3_item) {
1609 proto_item_set_len(set_mode3_item, offset - old_offset);
1616 /* RFC 1813, Page 26 */
1618 dissect_set_uid3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
1620 proto_item* set_uid3_item = NULL;
1621 proto_tree* set_uid3_tree = NULL;
1622 int old_offset = offset;
1626 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
1627 set_it = EXTRACT_UINT(pd, offset+0);
1628 set_it_name = val_to_str(set_it,value_follows,"Unknown");
1631 set_uid3_item = proto_tree_add_text(tree, offset,
1632 END_OF_FRAME, "%s: %s", name, set_it_name);
1634 set_uid3_tree = proto_item_add_subtree(set_uid3_item, ett_nfs_set_uid3);
1638 proto_tree_add_text(set_uid3_tree, offset, 4,
1639 "set_it: %s (%u)", set_it_name, set_it);
1645 offset = dissect_uid3(pd, offset, fd, set_uid3_tree,
1653 /* now we know, that set_uid3 is shorter */
1654 if (set_uid3_item) {
1655 proto_item_set_len(set_uid3_item, offset - old_offset);
1662 /* RFC 1813, Page 26 */
1664 dissect_set_gid3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
1666 proto_item* set_gid3_item = NULL;
1667 proto_tree* set_gid3_tree = NULL;
1668 int old_offset = offset;
1672 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
1673 set_it = EXTRACT_UINT(pd, offset+0);
1674 set_it_name = val_to_str(set_it,value_follows,"Unknown");
1677 set_gid3_item = proto_tree_add_text(tree, offset,
1678 END_OF_FRAME, "%s: %s", name, set_it_name);
1680 set_gid3_tree = proto_item_add_subtree(set_gid3_item, ett_nfs_set_gid3);
1684 proto_tree_add_text(set_gid3_tree, offset, 4,
1685 "set_it: %s (%u)", set_it_name, set_it);
1691 offset = dissect_gid3(pd, offset, fd, set_gid3_tree,
1699 /* now we know, that set_gid3 is shorter */
1700 if (set_gid3_item) {
1701 proto_item_set_len(set_gid3_item, offset - old_offset);
1708 /* RFC 1813, Page 26 */
1710 dissect_set_size3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
1712 proto_item* set_size3_item = NULL;
1713 proto_tree* set_size3_tree = NULL;
1714 int old_offset = offset;
1718 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
1719 set_it = EXTRACT_UINT(pd, offset+0);
1720 set_it_name = val_to_str(set_it,value_follows,"Unknown");
1723 set_size3_item = proto_tree_add_text(tree, offset,
1724 END_OF_FRAME, "%s: %s", name, set_it_name);
1726 set_size3_tree = proto_item_add_subtree(set_size3_item, ett_nfs_set_size3);
1730 proto_tree_add_text(set_size3_tree, offset, 4,
1731 "set_it: %s (%u)", set_it_name, set_it);
1737 offset = dissect_size3(pd, offset, fd, set_size3_tree,
1745 /* now we know, that set_size3 is shorter */
1746 if (set_size3_item) {
1747 proto_item_set_len(set_size3_item, offset - old_offset);
1754 /* RFC 1813, Page 25 */
1755 #define DONT_CHANGE 0
1756 #define SET_TO_SERVER_TIME 1
1757 #define SET_TO_CLIENT_TIME 2
1759 const value_string time_how[] =
1761 { DONT_CHANGE, "don't change" },
1762 { SET_TO_SERVER_TIME, "set to server time" },
1763 { SET_TO_CLIENT_TIME, "set to client time" },
1768 /* RFC 1813, Page 26 */
1770 dissect_set_atime(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
1772 proto_item* set_atime_item = NULL;
1773 proto_tree* set_atime_tree = NULL;
1774 int old_offset = offset;
1778 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
1779 set_it = EXTRACT_UINT(pd, offset+0);
1780 set_it_name = val_to_str(set_it,time_how,"Unknown");
1783 set_atime_item = proto_tree_add_text(tree, offset,
1784 END_OF_FRAME, "%s: %s",
1785 name, set_it_name, set_it);
1787 set_atime_tree = proto_item_add_subtree(set_atime_item, ett_nfs_set_atime);
1791 proto_tree_add_text(set_atime_tree, offset, 4,
1792 "set_it: %s (%u)", set_it_name, set_it);
1797 case SET_TO_CLIENT_TIME:
1799 offset = dissect_nfstime3(pd, offset, fd, set_atime_tree,
1807 /* now we know, that set_atime is shorter */
1808 if (set_atime_item) {
1809 proto_item_set_len(set_atime_item, offset - old_offset);
1816 /* RFC 1813, Page 26 */
1818 dissect_set_mtime(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
1820 proto_item* set_mtime_item = NULL;
1821 proto_tree* set_mtime_tree = NULL;
1822 int old_offset = offset;
1826 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
1827 set_it = EXTRACT_UINT(pd, offset+0);
1828 set_it_name = val_to_str(set_it,time_how,"Unknown");
1831 set_mtime_item = proto_tree_add_text(tree, offset,
1832 END_OF_FRAME, "%s: %s",
1833 name, set_it_name, set_it);
1835 set_mtime_tree = proto_item_add_subtree(set_mtime_item, ett_nfs_set_mtime);
1839 proto_tree_add_text(set_mtime_tree, offset, 4,
1840 "set_it: %s (%u)", set_it_name, set_it);
1845 case SET_TO_CLIENT_TIME:
1847 offset = dissect_nfstime3(pd, offset, fd, set_mtime_tree,
1855 /* now we know, that set_mtime is shorter */
1856 if (set_mtime_item) {
1857 proto_item_set_len(set_mtime_item, offset - old_offset);
1864 /* RFC 1813, Page 25..27 */
1866 dissect_sattr3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
1868 proto_item* sattr3_item = NULL;
1869 proto_tree* sattr3_tree = NULL;
1870 int old_offset = offset;
1873 sattr3_item = proto_tree_add_text(tree, offset,
1874 END_OF_FRAME, "%s", name);
1876 sattr3_tree = proto_item_add_subtree(sattr3_item, ett_nfs_sattr3);
1879 offset = dissect_set_mode3(pd, offset, fd, sattr3_tree, "mode");
1880 offset = dissect_set_uid3 (pd, offset, fd, sattr3_tree, "uid");
1881 offset = dissect_set_gid3 (pd, offset, fd, sattr3_tree, "gid");
1882 offset = dissect_set_size3(pd, offset, fd, sattr3_tree, "size");
1883 offset = dissect_set_atime(pd, offset, fd, sattr3_tree, "atime");
1884 offset = dissect_set_mtime(pd, offset, fd, sattr3_tree, "mtime");
1886 /* now we know, that sattr3 is shorter */
1888 proto_item_set_len(sattr3_item, offset - old_offset);
1895 /* RFC 1813, Page 27 */
1897 dissect_diropargs3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
1899 proto_item* diropargs3_item = NULL;
1900 proto_tree* diropargs3_tree = NULL;
1901 int old_offset = offset;
1904 diropargs3_item = proto_tree_add_text(tree, offset,
1905 END_OF_FRAME, "%s", name);
1906 if (diropargs3_item)
1907 diropargs3_tree = proto_item_add_subtree(diropargs3_item, ett_nfs_diropargs3);
1910 offset = dissect_nfs_fh3 (pd, offset, fd, diropargs3_tree, "dir");
1911 offset = dissect_filename3(pd, offset, fd, diropargs3_tree, hf_nfs_name,NULL);
1913 /* now we know, that diropargs3 is shorter */
1914 if (diropargs3_item) {
1915 proto_item_set_len(diropargs3_item, offset - old_offset);
1922 /* RFC 1813, Page 27 */
1924 dissect_nfs3_diropargs3_call(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
1926 offset = dissect_diropargs3(pd, offset, fd, tree, "object");
1932 /* RFC 1813, Page 40 */
1934 dissect_access(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
1937 proto_item* access_item = NULL;
1938 proto_tree* access_tree = NULL;
1940 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
1941 access = EXTRACT_UINT(pd, offset+0);
1944 access_item = proto_tree_add_text(tree, offset, 4,
1945 "%s: 0x%02x", name, access);
1947 access_tree = proto_item_add_subtree(access_item, ett_nfs_access);
1951 proto_tree_add_text(access_tree, offset, 4, "%s READ",
1952 decode_boolean_bitfield(access, 0x001, 6, "allow", "not allow"));
1953 proto_tree_add_text(access_tree, offset, 4, "%s LOOKUP",
1954 decode_boolean_bitfield(access, 0x002, 6, "allow", "not allow"));
1955 proto_tree_add_text(access_tree, offset, 4, "%s MODIFY",
1956 decode_boolean_bitfield(access, 0x004, 6, "allowed", "not allow"));
1957 proto_tree_add_text(access_tree, offset, 4, "%s EXTEND",
1958 decode_boolean_bitfield(access, 0x008, 6, "allow", "not allow"));
1959 proto_tree_add_text(access_tree, offset, 4, "%s DELETE",
1960 decode_boolean_bitfield(access, 0x010, 6, "allow", "not allow"));
1961 proto_tree_add_text(access_tree, offset, 4, "%s EXECUTE",
1962 decode_boolean_bitfield(access, 0x020, 6, "allow", "not allow"));
1970 /* NFS3 file handle dissector */
1972 dissect_nfs3_nfs_fh3_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
1974 offset = dissect_nfs_fh3(pd, offset, fd, tree, "object");
1979 /* generic NFS3 reply dissector */
1981 dissect_nfs3_any_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
1985 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
1992 /* RFC 1813, Page 32,33 */
1994 dissect_nfs3_getattr_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
1996 offset = dissect_nfs_fh3(pd, offset, fd, tree, "object");
2001 /* RFC 1813, Page 32,33 */
2003 dissect_nfs3_getattr_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2007 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
2010 offset = dissect_fattr3(pd, offset, fd, tree, "obj_attributes");
2021 /* RFC 1813, Page 33 */
2023 dissect_sattrguard3(const u_char* pd, int offset, frame_data* fd, proto_tree* tree, char *name)
2025 proto_item* sattrguard3_item = NULL;
2026 proto_tree* sattrguard3_tree = NULL;
2027 int old_offset = offset;
2031 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
2032 check = EXTRACT_UINT(pd, offset+0);
2033 check_name = val_to_str(check,value_follows,"Unknown");
2036 sattrguard3_item = proto_tree_add_text(tree, offset,
2037 END_OF_FRAME, "%s: %s", name, check_name);
2038 if (sattrguard3_item)
2039 sattrguard3_tree = proto_item_add_subtree(sattrguard3_item, ett_nfs_sattrguard3);
2042 if (sattrguard3_tree)
2043 proto_tree_add_text(sattrguard3_tree, offset, 4,
2044 "check: %s (%u)", check_name, check);
2050 offset = dissect_nfstime3(pd, offset, fd, sattrguard3_tree,
2058 /* now we know, that sattrguard3 is shorter */
2059 if (sattrguard3_item) {
2060 proto_item_set_len(sattrguard3_item, offset - old_offset);
2067 /* RFC 1813, Page 33..36 */
2069 dissect_nfs3_setattr_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2071 offset = dissect_nfs_fh3 (pd, offset, fd, tree, "object");
2072 offset = dissect_sattr3 (pd, offset, fd, tree, "new_attributes");
2073 offset = dissect_sattrguard3(pd, offset, fd, tree, "guard");
2078 /* RFC 1813, Page 33..36 */
2080 dissect_nfs3_setattr_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2084 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
2087 offset = dissect_wcc_data(pd, offset, fd, tree, "obj_wcc");
2090 offset = dissect_wcc_data(pd, offset, fd, tree, "obj_wcc");
2098 /* RFC 1813, Page 37..39 */
2100 dissect_nfs3_lookup_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2102 offset = dissect_diropargs3 (pd, offset, fd, tree, "what");
2107 /* RFC 1813, Page 37..39 */
2109 dissect_nfs3_lookup_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2113 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
2116 offset = dissect_nfs_fh3 (pd, offset, fd, tree, "object");
2117 offset = dissect_post_op_attr(pd, offset, fd, tree, "obj_attributes");
2118 offset = dissect_post_op_attr(pd, offset, fd, tree, "dir_attributes");
2121 offset = dissect_post_op_attr(pd, offset, fd, tree, "dir_attributes");
2129 /* RFC 1813, Page 40..43 */
2131 dissect_nfs3_access_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2133 offset = dissect_nfs_fh3(pd, offset, fd, tree, "object");
2134 offset = dissect_access (pd, offset, fd, tree, "access");
2140 /* RFC 1813, Page 40..43 */
2142 dissect_nfs3_access_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2146 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
2149 offset = dissect_post_op_attr(pd, offset, fd, tree, "obj_attributes");
2150 offset = dissect_access (pd, offset, fd, tree, "access");
2153 offset = dissect_post_op_attr(pd, offset, fd, tree, "obj_attributes");
2161 /* RFC 1813, Page 44,45 */
2163 dissect_nfs3_readlink_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2167 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
2170 offset = dissect_post_op_attr(pd, offset, fd, tree, "symlink_attributes");
2171 offset = dissect_nfspath3 (pd, offset, fd, tree, hf_nfs_readlink_data);
2174 offset = dissect_post_op_attr(pd, offset, fd, tree, "symlink_attributes");
2182 /* RFC 1813, Page 46..48 */
2184 dissect_nfs3_read_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2186 offset = dissect_nfs_fh3(pd, offset, fd, tree, "file");
2187 offset = dissect_offset3(pd, offset, fd, tree, "offset");
2188 offset = dissect_count3 (pd, offset, fd, tree, "count");
2194 /* RFC 1813, Page 46..48 */
2196 dissect_nfs3_read_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2200 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
2203 offset = dissect_post_op_attr(pd, offset, fd, tree, "file_attributes");
2204 offset = dissect_count3 (pd, offset, fd, tree, "count");
2205 offset = dissect_rpc_bool (pd, offset, fd, tree, hf_nfs_read_eof);
2206 offset = dissect_nfsdata (pd, offset, fd, tree, hf_nfs_data);
2209 offset = dissect_post_op_attr(pd, offset, fd, tree, "file_attributes");
2217 /* RFC 1813, Page 49 */
2218 static const value_string names_stable_how[] = {
2219 { UNSTABLE, "UNSTABLE" },
2220 { DATA_SYNC, "DATA_SYNC" },
2221 { FILE_SYNC, "FILE_SYNC" },
2226 /* RFC 1813, Page 49 */
2228 dissect_stable_how(const u_char* pd, int offset, frame_data* fd, proto_tree* tree, int hfindex)
2232 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
2233 stable_how = EXTRACT_UINT(pd,offset+0);
2235 proto_tree_add_item(tree, hfindex,
2236 offset, 4, stable_how);
2244 /* RFC 1813, Page 49..54 */
2246 dissect_nfs3_write_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2248 offset = dissect_nfs_fh3 (pd, offset, fd, tree, "file");
2249 offset = dissect_offset3 (pd, offset, fd, tree, "offset");
2250 offset = dissect_count3 (pd, offset, fd, tree, "count");
2251 offset = dissect_stable_how(pd, offset, fd, tree, hf_nfs_write_stable);
2252 offset = dissect_nfsdata (pd, offset, fd, tree, hf_nfs_data);
2258 /* RFC 1813, Page 49..54 */
2260 dissect_nfs3_write_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2264 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
2267 offset = dissect_wcc_data (pd, offset, fd, tree, "file_wcc");
2268 offset = dissect_count3 (pd, offset, fd, tree, "count");
2269 offset = dissect_stable_how(pd, offset, fd, tree, hf_nfs_write_committed);
2270 offset = dissect_writeverf3(pd, offset, fd, tree);
2273 offset = dissect_wcc_data(pd, offset, fd, tree, "file_wcc");
2281 /* RFC 1813, Page 54 */
2282 static const value_string names_createmode3[] = {
2283 { UNCHECKED, "UNCHECKED" },
2284 { GUARDED, "GUARDED" },
2285 { EXCLUSIVE, "EXCLUSIVE" },
2290 /* RFC 1813, Page 54 */
2292 dissect_createmode3(const u_char* pd, int offset, frame_data* fd, proto_tree* tree, guint32* mode)
2296 if (!BYTES_ARE_IN_FRAME(offset, 4)) return offset;
2297 mode_value = EXTRACT_UINT(pd, offset + 0);
2299 proto_tree_add_item(tree, hf_nfs_createmode3,
2300 offset+0, 4, mode_value);
2309 /* RFC 1813, Page 54..58 */
2311 dissect_nfs3_create_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2315 offset = dissect_diropargs3 (pd, offset, fd, tree, "where");
2316 offset = dissect_createmode3(pd, offset, fd, tree, &mode);
2320 offset = dissect_sattr3 (pd, offset, fd, tree, "obj_attributes");
2323 offset = dissect_createverf3(pd, offset, fd, tree);
2331 /* RFC 1813, Page 54..58 */
2333 dissect_nfs3_create_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2337 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
2340 offset = dissect_post_op_fh3 (pd, offset, fd, tree, "obj");
2341 offset = dissect_post_op_attr(pd, offset, fd, tree, "obj_attributes");
2342 offset = dissect_wcc_data (pd, offset, fd, tree, "dir_wcc");
2345 offset = dissect_wcc_data (pd, offset, fd, tree, "dir_wcc");
2353 /* RFC 1813, Page 58..60 */
2355 dissect_nfs3_mkdir_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2357 offset = dissect_diropargs3(pd, offset, fd, tree, "where");
2358 offset = dissect_sattr3 (pd, offset, fd, tree, "attributes");
2364 /* RFC 1813, Page 61..63 */
2366 dissect_nfs3_symlink_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2368 offset = dissect_diropargs3(pd, offset, fd, tree, "where");
2369 offset = dissect_sattr3 (pd, offset, fd, tree, "symlink_attributes");
2370 offset = dissect_nfspath3 (pd, offset, fd, tree, hf_nfs_symlink_to);
2376 /* RFC 1813, Page 63..66 */
2378 dissect_nfs3_mknod_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2382 offset = dissect_diropargs3(pd, offset, fd, tree, "where");
2383 offset = dissect_ftype3(pd, offset, fd, tree, hf_nfs_ftype3, &type);
2387 offset = dissect_sattr3(pd, offset, fd, tree, "dev_attributes");
2388 offset = dissect_specdata3(pd, offset, fd, tree, "spec");
2392 offset = dissect_sattr3(pd, offset, fd, tree, "pipe_attributes");
2403 /* RFC 1813, Page 67..69 */
2405 dissect_nfs3_remove_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2409 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
2412 offset = dissect_wcc_data (pd, offset, fd, tree, "dir_wcc");
2415 offset = dissect_wcc_data (pd, offset, fd, tree, "dir_wcc");
2423 /* RFC 1813, Page 71..74 */
2425 dissect_nfs3_rename_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2427 offset = dissect_diropargs3(pd, offset, fd, tree, "from");
2428 offset = dissect_diropargs3(pd, offset, fd, tree, "to");
2434 /* RFC 1813, Page 71..74 */
2436 dissect_nfs3_rename_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2440 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
2443 offset = dissect_wcc_data(pd, offset, fd, tree, "fromdir_wcc");
2444 offset = dissect_wcc_data(pd, offset, fd, tree, "todir_wcc");
2447 offset = dissect_wcc_data(pd, offset, fd, tree, "fromdir_wcc");
2448 offset = dissect_wcc_data(pd, offset, fd, tree, "todir_wcc");
2456 /* RFC 1813, Page 74..76 */
2458 dissect_nfs3_link_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2460 offset = dissect_nfs_fh3 (pd, offset, fd, tree, "file");
2461 offset = dissect_diropargs3(pd, offset, fd, tree, "link");
2467 /* RFC 1813, Page 74..76 */
2469 dissect_nfs3_link_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2473 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
2476 offset = dissect_post_op_attr(pd, offset, fd, tree, "file_attributes");
2477 offset = dissect_wcc_data (pd, offset, fd, tree, "linkdir_wcc");
2480 offset = dissect_post_op_attr(pd, offset, fd, tree, "file_attributes");
2481 offset = dissect_wcc_data (pd, offset, fd, tree, "linkdir_wcc");
2489 /* RFC 1813, Page 76..80 */
2491 dissect_nfs3_readdir_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2493 offset = dissect_nfs_fh3 (pd, offset, fd, tree, "dir");
2494 offset = dissect_cookie3 (pd, offset, fd, tree, "cookie");
2495 offset = dissect_cookieverf3(pd, offset, fd, tree);
2496 offset = dissect_count3 (pd, offset, fd, tree, "count");
2502 /* RFC 1813, Page 76..80 */
2504 dissect_entry3(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2506 proto_item* entry_item = NULL;
2507 proto_tree* entry_tree = NULL;
2508 int old_offset = offset;
2512 entry_item = proto_tree_add_item(tree, hf_nfs_readdir_entry,
2513 offset+0, END_OF_FRAME, NULL);
2515 entry_tree = proto_item_add_subtree(entry_item, ett_nfs_readdir_entry);
2518 offset = dissect_fileid3(pd, offset, fd, entry_tree, "fileid");
2520 offset = dissect_filename3(pd, offset, fd, entry_tree,
2521 hf_nfs_readdir_entry_name, &name);
2522 proto_item_set_text(entry_item, "Entry: name %s", name);
2525 offset = dissect_cookie3(pd, offset, fd, entry_tree, "cookie");
2527 /* now we know, that a readdir entry is shorter */
2529 proto_item_set_len(entry_item, offset - old_offset);
2536 /* RFC 1813, Page 76..80 */
2538 dissect_nfs3_readdir_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2541 guint32 value_follows;
2544 offset = dissect_stat(pd, offset, fd, tree, &status);
2547 offset = dissect_post_op_attr(pd, offset, fd, tree, "dir_attributes");
2548 offset = dissect_cookieverf3(pd, offset, fd, tree);
2550 if (!BYTES_ARE_IN_FRAME(offset,4)) break;
2551 value_follows = EXTRACT_UINT(pd, offset+0);
2552 proto_tree_add_item(tree,hf_nfs_readdir_value_follows,
2553 offset+0, 4, value_follows);
2555 if (value_follows == 1) {
2556 offset = dissect_entry3(pd, offset, fd, tree);
2562 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
2563 eof_value = EXTRACT_UINT(pd, offset+0);
2565 proto_tree_add_item(tree, hf_nfs_readdir_eof,
2566 offset+ 0, 4, eof_value);
2570 offset = dissect_post_op_attr(pd, offset, fd, tree, "dir_attributes");
2578 /* RFC 1813, Page 80..83 */
2580 dissect_nfs3_readdirplus_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2582 offset = dissect_nfs_fh3 (pd, offset, fd, tree, "dir");
2583 offset = dissect_cookie3 (pd, offset, fd, tree, "cookie");
2584 offset = dissect_cookieverf3(pd, offset, fd, tree);
2585 offset = dissect_count3 (pd, offset, fd, tree, "dircount");
2586 offset = dissect_count3 (pd, offset, fd, tree, "maxcount");
2592 /* RFC 1813, Page 80..83 */
2594 dissect_entryplus3(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2596 proto_item* entry_item = NULL;
2597 proto_tree* entry_tree = NULL;
2598 int old_offset = offset;
2602 entry_item = proto_tree_add_item(tree, hf_nfs_readdir_entry,
2603 offset+0, END_OF_FRAME, NULL);
2605 entry_tree = proto_item_add_subtree(entry_item, ett_nfs_readdir_entry);
2608 offset = dissect_fileid3(pd, offset, fd, entry_tree, "fileid");
2610 offset = dissect_filename3(pd, offset, fd, entry_tree,
2611 hf_nfs_readdirplus_entry_name, &name);
2612 proto_item_set_text(entry_item, "Entry: name %s", name);
2615 offset = dissect_cookie3(pd, offset, fd, entry_tree, "cookie");
2617 offset = dissect_post_op_attr(pd, offset, fd, entry_tree, "name_attributes");
2618 offset = dissect_post_op_fh3(pd, offset, fd, entry_tree, "name_handle");
2620 /* now we know, that a readdirplus entry is shorter */
2622 proto_item_set_len(entry_item, offset - old_offset);
2629 /* RFC 1813, Page 80..83 */
2631 dissect_nfs3_readdirplus_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2634 guint32 value_follows;
2637 offset = dissect_stat(pd, offset, fd, tree, &status);
2640 offset = dissect_post_op_attr(pd, offset, fd, tree, "dir_attributes");
2641 offset = dissect_cookieverf3(pd, offset, fd, tree);
2643 if (!BYTES_ARE_IN_FRAME(offset,4)) break;
2644 value_follows = EXTRACT_UINT(pd, offset+0);
2645 proto_tree_add_item(tree,hf_nfs_readdir_value_follows,
2646 offset+0, 4, value_follows);
2648 if (value_follows == 1) {
2649 offset = dissect_entryplus3(pd, offset, fd, tree);
2655 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
2656 eof_value = EXTRACT_UINT(pd, offset+0);
2658 proto_tree_add_item(tree, hf_nfs_readdir_eof,
2659 offset+ 0, 4, eof_value);
2663 offset = dissect_post_op_attr(pd, offset, fd, tree, "dir_attributes");
2671 /* RFC 1813, Page 84..86 */
2673 dissect_nfs3_fsstat_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2678 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
2681 offset = dissect_post_op_attr(pd, offset, fd, tree, "obj_attributes");
2682 offset = dissect_size3 (pd, offset, fd, tree, "tbytes");
2683 offset = dissect_size3 (pd, offset, fd, tree, "fbytes");
2684 offset = dissect_size3 (pd, offset, fd, tree, "abytes");
2685 offset = dissect_size3 (pd, offset, fd, tree, "tfiles");
2686 offset = dissect_size3 (pd, offset, fd, tree, "ffiles");
2687 offset = dissect_size3 (pd, offset, fd, tree, "afiles");
2688 if (!BYTES_ARE_IN_FRAME(offset, 4)) return offset;
2689 invarsec = EXTRACT_UINT(pd, offset + 0);
2691 proto_tree_add_item(tree, hf_nfs_fsstat_invarsec,
2692 offset+0, 4, invarsec);
2696 offset = dissect_post_op_attr(pd, offset, fd, tree, "obj_attributes");
2704 #define FSF3_LINK 0x0001
2705 #define FSF3_SYMLINK 0x0002
2706 #define FSF3_HOMOGENEOUS 0x0008
2707 #define FSF3_CANSETTIME 0x0010
2710 /* RFC 1813, Page 86..90 */
2712 dissect_nfs3_fsinfo_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2723 proto_item* properties_item = NULL;
2724 proto_tree* properties_tree = NULL;
2726 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
2729 offset = dissect_post_op_attr(pd, offset, fd, tree, "obj_attributes");
2730 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
2731 rtmax = EXTRACT_UINT(pd, offset+0);
2733 proto_tree_add_item(tree, hf_nfs_fsinfo_rtmax,
2734 offset+0, 4, rtmax);
2736 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
2737 rtpref = EXTRACT_UINT(pd, offset+0);
2739 proto_tree_add_item(tree, hf_nfs_fsinfo_rtpref,
2740 offset+0, 4, rtpref);
2742 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
2743 rtmult = EXTRACT_UINT(pd, offset+0);
2745 proto_tree_add_item(tree, hf_nfs_fsinfo_rtmult,
2746 offset+0, 4, rtmult);
2748 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
2749 wtmax = EXTRACT_UINT(pd, offset+0);
2751 proto_tree_add_item(tree, hf_nfs_fsinfo_wtmax,
2752 offset+0, 4, wtmax);
2754 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
2755 wtpref = EXTRACT_UINT(pd, offset+0);
2757 proto_tree_add_item(tree, hf_nfs_fsinfo_wtpref,
2758 offset+0, 4, wtpref);
2760 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
2761 wtmult = EXTRACT_UINT(pd, offset+0);
2763 proto_tree_add_item(tree, hf_nfs_fsinfo_wtmult,
2764 offset+0, 4, wtmult);
2766 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
2767 dtpref = EXTRACT_UINT(pd, offset+0);
2769 proto_tree_add_item(tree, hf_nfs_fsinfo_dtpref,
2770 offset+0, 4, dtpref);
2773 offset = dissect_size3 (pd, offset, fd, tree, "maxfilesize");
2774 offset = dissect_nfstime3(pd, offset, fd, tree, "time_delta");
2775 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
2776 properties = EXTRACT_UINT(pd, offset+0);
2778 properties_item = proto_tree_add_item(tree,
2779 hf_nfs_fsinfo_properties,
2780 offset+0, 4, properties);
2781 if (properties_item)
2782 properties_tree = proto_item_add_subtree(properties_item, ett_nfs_fsinfo_properties);
2783 if (properties_tree) {
2784 proto_tree_add_text(properties_tree,
2786 decode_boolean_bitfield(properties,
2788 "SETATTR can set time on server",
2789 "SETATTR can't set time on server"));
2791 proto_tree_add_text(properties_tree,
2793 decode_boolean_bitfield(properties,
2795 "PATHCONF is valid for all files",
2796 "PATHCONF should be get for every single file"));
2798 proto_tree_add_text(properties_tree,
2800 decode_boolean_bitfield(properties,
2802 "File System supports symbolic links",
2803 "File System does not symbolic hard links"));
2805 proto_tree_add_text(properties_tree,
2807 decode_boolean_bitfield(properties,
2809 "File System supports hard links",
2810 "File System does not support hard links"));
2816 offset = dissect_post_op_attr(pd, offset, fd, tree, "obj_attributes");
2824 /* RFC 1813, Page 90..92 */
2826 dissect_nfs3_pathconf_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2832 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
2835 offset = dissect_post_op_attr(pd, offset, fd, tree, "obj_attributes");
2836 if (!BYTES_ARE_IN_FRAME(offset, 4)) return offset;
2837 linkmax = EXTRACT_UINT(pd, offset + 0);
2839 proto_tree_add_item(tree, hf_nfs_pathconf_linkmax,
2840 offset+0, 4, linkmax);
2842 if (!BYTES_ARE_IN_FRAME(offset, 4)) return offset;
2843 name_max = EXTRACT_UINT(pd, offset + 0);
2845 proto_tree_add_item(tree, hf_nfs_pathconf_name_max,
2846 offset+0, 4, name_max);
2848 offset = dissect_rpc_bool(pd, offset, fd, tree, hf_nfs_pathconf_no_trunc);
2849 offset = dissect_rpc_bool(pd, offset, fd, tree, hf_nfs_pathconf_chown_restricted);
2850 offset = dissect_rpc_bool(pd, offset, fd, tree, hf_nfs_pathconf_case_insensitive);
2851 offset = dissect_rpc_bool(pd, offset, fd, tree, hf_nfs_pathconf_case_preserving);
2854 offset = dissect_post_op_attr(pd, offset, fd, tree, "obj_attributes");
2862 /* RFC 1813, Page 92..95 */
2864 dissect_nfs3_commit_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2866 offset = dissect_nfs_fh3(pd, offset, fd, tree, "file");
2867 offset = dissect_offset3(pd, offset, fd, tree, "offset");
2868 offset = dissect_count3 (pd, offset, fd, tree, "count");
2874 /* RFC 1813, Page 92..95 */
2876 dissect_nfs3_commit_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2880 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
2883 offset = dissect_wcc_data (pd, offset, fd, tree, "file_wcc");
2884 offset = dissect_writeverf3(pd, offset, fd, tree);
2887 offset = dissect_wcc_data(pd, offset, fd, tree, "file_wcc");
2895 /* 1 missing functions */
2898 /* proc number, "proc name", dissect_request, dissect_reply */
2899 /* NULL as function pointer means: take the generic one. */
2900 const vsff nfs3_proc[] = {
2901 { 0, "NULL", /* OK */
2903 { 1, "GETATTR", /* OK */
2904 dissect_nfs3_getattr_call, dissect_nfs3_getattr_reply },
2905 { 2, "SETATTR", /* OK */
2906 dissect_nfs3_setattr_call, dissect_nfs3_setattr_reply },
2907 { 3, "LOOKUP", /* OK */
2908 dissect_nfs3_lookup_call, dissect_nfs3_lookup_reply },
2909 { 4, "ACCESS", /* OK */
2910 dissect_nfs3_access_call, dissect_nfs3_access_reply },
2911 { 5, "READLINK", /* OK */
2912 dissect_nfs3_nfs_fh3_call, dissect_nfs3_readlink_reply },
2913 { 6, "READ", /* OK */
2914 dissect_nfs3_read_call, dissect_nfs3_read_reply },
2915 { 7, "WRITE", /* OK */
2916 dissect_nfs3_write_call, dissect_nfs3_write_reply },
2917 { 8, "CREATE", /* OK */
2918 dissect_nfs3_create_call, dissect_nfs3_create_reply },
2919 { 9, "MKDIR", /* OK */
2920 dissect_nfs3_mkdir_call, dissect_nfs3_create_reply },
2921 { 10, "SYMLINK", /* OK */
2922 dissect_nfs3_symlink_call, dissect_nfs3_create_reply },
2923 { 11, "MKNOD", /* OK */
2924 dissect_nfs3_mknod_call, dissect_nfs3_create_reply },
2925 { 12, "REMOVE", /* OK */
2926 dissect_nfs3_diropargs3_call, dissect_nfs3_remove_reply },
2927 { 13, "RMDIR", /* OK */
2928 dissect_nfs3_diropargs3_call, dissect_nfs3_remove_reply },
2929 { 14, "RENAME", /* OK */
2930 dissect_nfs3_rename_call, dissect_nfs3_rename_reply },
2931 { 15, "LINK", /* OK */
2932 dissect_nfs3_link_call, dissect_nfs3_link_reply },
2933 { 16, "READDIR", /* OK */
2934 dissect_nfs3_readdir_call, dissect_nfs3_readdir_reply },
2935 { 17, "READDIRPLUS", /* OK */
2936 dissect_nfs3_readdirplus_call, dissect_nfs3_readdirplus_reply },
2937 { 18, "FSSTAT", /* OK */
2938 dissect_nfs3_nfs_fh3_call, dissect_nfs3_fsstat_reply },
2939 { 19, "FSINFO", /* OK */
2940 dissect_nfs3_nfs_fh3_call, dissect_nfs3_fsinfo_reply },
2941 { 20, "PATHCONF", /* OK */
2942 dissect_nfs3_nfs_fh3_call, dissect_nfs3_pathconf_reply },
2943 { 21, "COMMIT", /* OK */
2944 dissect_nfs3_commit_call, dissect_nfs3_commit_reply },
2945 { 0,NULL,NULL,NULL }
2947 /* end of NFS Version 3 */
2950 static struct true_false_string yesno = { "Yes", "No" };
2954 proto_register_nfs(void)
2956 static hf_register_info hf[] = {
2958 "Status", "nfs.status2", FT_UINT32, BASE_DEC,
2959 VALS(names_nfs_stat), 0, "Reply status" }},
2961 "Name", "nfs.name", FT_STRING, BASE_DEC,
2963 { &hf_nfs_readlink_data, {
2964 "Data", "nfs.readlink.data", FT_STRING, BASE_DEC,
2965 NULL, 0, "Symbolic Link Data" }},
2966 { &hf_nfs_read_offset, {
2967 "Offset", "nfs.read.offset", FT_UINT32, BASE_DEC,
2968 NULL, 0, "Read Offset" }},
2969 { &hf_nfs_read_count, {
2970 "Count", "nfs.read.count", FT_UINT32, BASE_DEC,
2971 NULL, 0, "Read Count" }},
2972 { &hf_nfs_read_totalcount, {
2973 "Total Count", "nfs.read.totalcount", FT_UINT32, BASE_DEC,
2974 NULL, 0, "Total Count (obsolete)" }},
2976 "Data", "nfs.data", FT_STRING, BASE_DEC,
2978 { &hf_nfs_write_beginoffset, {
2979 "Begin Offset", "nfs.write.beginoffset", FT_UINT32, BASE_DEC,
2980 NULL, 0, "Begin offset (obsolete)" }},
2981 { &hf_nfs_write_offset, {
2982 "Offset", "nfs.write.offset", FT_UINT32, BASE_DEC,
2983 NULL, 0, "Offset" }},
2984 { &hf_nfs_write_totalcount, {
2985 "Total Count", "nfs.write.totalcount", FT_UINT32, BASE_DEC,
2986 NULL, 0, "Total Count (obsolete)" }},
2987 { &hf_nfs_symlink_to, {
2988 "To", "nfs.symlink.to", FT_STRING, BASE_DEC,
2989 NULL, 0, "Symbolic link destination name" }},
2990 { &hf_nfs_readdir_cookie, {
2991 "Cookie", "nfs.readdir.cookie", FT_UINT32, BASE_DEC,
2992 NULL, 0, "Directory Cookie" }},
2993 { &hf_nfs_readdir_count, {
2994 "Count", "nfs.readdir.count", FT_UINT32, BASE_DEC,
2995 NULL, 0, "Directory Count" }},
2996 { &hf_nfs_readdir_value_follows, {
2997 "Value Follows", "nfs.readdir.value_follows", FT_BOOLEAN, BASE_NONE,
2998 &yesno, 0, "Value Follows" }},
2999 { &hf_nfs_readdir_entry, {
3000 "Entry", "nfs.readdir.entry", FT_NONE, 0,
3001 NULL, 0, "Directory Entry" }},
3002 { &hf_nfs_readdir_entry_fileid, {
3003 "File ID", "nfs.readdir.entry.fileid", FT_UINT32, BASE_DEC,
3004 NULL, 0, "File ID" }},
3005 { &hf_nfs_readdir_entry_name, {
3006 "Name", "nfs.readdir.entry.name", FT_STRING, BASE_DEC,
3008 { &hf_nfs_readdirplus_entry_name, {
3009 "Name", "nfs.readdirplus.entry.name", FT_STRING, BASE_DEC,
3011 { &hf_nfs_readdir_entry_cookie, {
3012 "Cookie", "nfs.readdir.entry.cookie", FT_UINT32, BASE_DEC,
3013 NULL, 0, "Directory Cookie" }},
3014 { &hf_nfs_readdir_eof, {
3015 "EOF", "nfs.readdir.eof", FT_UINT32, BASE_DEC,
3017 { &hf_nfs_statfs_tsize, {
3018 "Transfer Size", "nfs.statfs.tsize", FT_UINT32, BASE_DEC,
3019 NULL, 0, "Transfer Size" }},
3020 { &hf_nfs_statfs_bsize, {
3021 "Block Size", "nfs.statfs.bsize", FT_UINT32, BASE_DEC,
3022 NULL, 0, "Block Size" }},
3023 { &hf_nfs_statfs_blocks, {
3024 "Total Blocks", "nfs.statfs.blocks", FT_UINT32, BASE_DEC,
3025 NULL, 0, "Total Blocks" }},
3026 { &hf_nfs_statfs_bfree, {
3027 "Free Blocks", "nfs.statfs.bfree", FT_UINT32, BASE_DEC,
3028 NULL, 0, "Free Blocks" }},
3029 { &hf_nfs_statfs_bavail, {
3030 "Available Blocks", "nfs.statfs.bavail", FT_UINT32, BASE_DEC,
3031 NULL, 0, "Available Blocks" }},
3033 "Type", "nfs.type", FT_UINT32, BASE_DEC,
3034 VALS(names_nfs_ftype3), 0, "File Type" }},
3035 { &hf_nfs_nfsstat3, {
3036 "Status", "nfs.status", FT_UINT32, BASE_DEC,
3037 VALS(names_nfs_nfsstat3), 0, "Reply status" }},
3038 { &hf_nfs_read_eof, {
3039 "EOF", "nfs.read.eof", FT_BOOLEAN, BASE_NONE,
3040 &yesno, 0, "EOF" }},
3041 { &hf_nfs_write_stable, {
3042 "Stable", "nfs.write.stable", FT_UINT32, BASE_DEC,
3043 VALS(names_stable_how), 0, "Stable" }},
3044 { &hf_nfs_write_committed, {
3045 "Committed", "nfs.write.committed", FT_UINT32, BASE_DEC,
3046 VALS(names_stable_how), 0, "Committed" }},
3047 { &hf_nfs_createmode3, {
3048 "Create Mode", "nfs.createmode", FT_UINT32, BASE_DEC,
3049 VALS(names_createmode3), 0, "Create Mode" }},
3050 { &hf_nfs_fsstat_invarsec, {
3051 "invarsec", "nfs.fsstat.invarsec", FT_UINT32, BASE_DEC,
3052 NULL, 0, "probable number of seconds of file system invariance" }},
3053 { &hf_nfs_fsinfo_rtmax, {
3054 "rtmax", "nfs.fsinfo.rtmax", FT_UINT32, BASE_DEC,
3055 NULL, 0, "maximum READ request" }},
3056 { &hf_nfs_fsinfo_rtpref, {
3057 "rtpref", "nfs.fsinfo.rtpref", FT_UINT32, BASE_DEC,
3058 NULL, 0, "preferred READ request" }},
3059 { &hf_nfs_fsinfo_rtmult, {
3060 "rtmult", "nfs.fsinfo.rtmult", FT_UINT32, BASE_DEC,
3061 NULL, 0, "suggested READ multiple" }},
3062 { &hf_nfs_fsinfo_wtmax, {
3063 "wtmax", "nfs.fsinfo.rtmax", FT_UINT32, BASE_DEC,
3064 NULL, 0, "maximum WRITE request" }},
3065 { &hf_nfs_fsinfo_wtpref, {
3066 "wtpref", "nfs.fsinfo.rtpref", FT_UINT32, BASE_DEC,
3067 NULL, 0, "preferred WRITE request" }},
3068 { &hf_nfs_fsinfo_wtmult, {
3069 "wtmult", "nfs.fsinfo.rtmult", FT_UINT32, BASE_DEC,
3070 NULL, 0, "suggested WRITE multiple" }},
3071 { &hf_nfs_fsinfo_dtpref, {
3072 "dtpref", "nfs.fsinfo.dtpref", FT_UINT32, BASE_DEC,
3073 NULL, 0, "preferred READDIR request" }},
3074 { &hf_nfs_fsinfo_properties, {
3075 "Properties", "nfs.fsinfo.propeties", FT_UINT32, BASE_HEX,
3076 NULL, 0, "File System Properties" }},
3077 { &hf_nfs_pathconf_linkmax, {
3078 "linkmax", "nfs.pathconf.linkmax", FT_UINT32, BASE_DEC,
3079 NULL, 0, "Maximum number of hard links" }},
3080 { &hf_nfs_pathconf_name_max, {
3081 "name_max", "nfs.pathconf.name_max", FT_UINT32, BASE_DEC,
3082 NULL, 0, "Maximum file name length" }},
3083 { &hf_nfs_pathconf_no_trunc, {
3084 "no_trunc", "nfs.pathconf.no_trunc", FT_BOOLEAN, BASE_NONE,
3085 &yesno, 0, "No long file name truncation" }},
3086 { &hf_nfs_pathconf_chown_restricted, {
3087 "chown_restricted", "nfs.pathconf.chown_restricted", FT_BOOLEAN, BASE_NONE,
3088 &yesno, 0, "chown is restricted to root" }},
3089 { &hf_nfs_pathconf_case_insensitive, {
3090 "case_insensitive", "nfs.pathconf.case_insensitive", FT_BOOLEAN, BASE_NONE,
3091 &yesno, 0, "file names are treated case insensitive" }},
3092 { &hf_nfs_pathconf_case_preserving, {
3093 "case_preserving", "nfs.pathconf.case_preserving", FT_BOOLEAN, BASE_NONE,
3094 &yesno, 0, "file name cases are preserved" }}
3097 static gint *ett[] = {
3105 &ett_nfs_readdir_entry,
3111 &ett_nfs_post_op_fh3,
3113 &ett_nfs_diropargs3,
3114 &ett_nfs_sattrguard3,
3121 &ett_nfs_pre_op_attr,
3122 &ett_nfs_post_op_attr,
3126 &ett_nfs_fsinfo_properties
3128 proto_nfs = proto_register_protocol("Network File System", "nfs");
3129 proto_register_field_array(proto_nfs, hf, array_length(hf));
3130 proto_register_subtree_array(ett, array_length(ett));
3132 /* Register the protocol as RPC */
3133 rpc_init_prog(proto_nfs, NFS_PROGRAM, ett_nfs);
3134 /* Register the procedure tables */
3135 rpc_init_proc_table(NFS_PROGRAM, 2, nfs2_proc);
3136 rpc_init_proc_table(NFS_PROGRAM, 3, nfs3_proc);