2 * Routines for nfs dissection
3 * Copyright 1999, Uwe Girlich <Uwe.Girlich@philosys.de>
4 * Copyright 2000, Mike Frisch <frisch@hummingbird.com> (NFSv4 decoding)
6 * $Id: packet-nfs.c,v 1.41 2001/01/03 16:41:06 gram Exp $
8 * Ethereal - Network traffic analyzer
9 * By Gerald Combs <gerald@zing.org>
10 * Copyright 1998 Gerald Combs
12 * Copied from packet-smb.c
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
34 #ifdef HAVE_SYS_TYPES_H
35 #include <sys/types.h>
41 #include "packet-rpc.h"
42 #include "packet-nfs.h"
45 static int proto_nfs = -1;
47 static int hf_nfs_fh_fsid_major = -1;
48 static int hf_nfs_fh_fsid_minor = -1;
49 static int hf_nfs_fh_xfsid_major = -1;
50 static int hf_nfs_fh_xfsid_minor = -1;
51 static int hf_nfs_fh_fstype = -1;
52 static int hf_nfs_fh_fn = -1;
53 static int hf_nfs_fh_fn_len = -1;
54 static int hf_nfs_fh_fn_inode = -1;
55 static int hf_nfs_fh_fn_generation = -1;
56 static int hf_nfs_fh_xfn = -1;
57 static int hf_nfs_fh_xfn_len = -1;
58 static int hf_nfs_fh_xfn_inode = -1;
59 static int hf_nfs_fh_xfn_generation = -1;
60 static int hf_nfs_fh_dentry = -1;
61 static int hf_nfs_fh_dev = -1;
62 static int hf_nfs_fh_xdev = -1;
63 static int hf_nfs_fh_dirinode = -1;
64 static int hf_nfs_fh_pinode = -1;
65 static int hf_nfs_fh_hp_len = -1;
66 static int hf_nfs_stat = -1;
67 static int hf_nfs_name = -1;
68 static int hf_nfs_readlink_data = -1;
69 static int hf_nfs_read_offset = -1;
70 static int hf_nfs_read_count = -1;
71 static int hf_nfs_read_totalcount = -1;
72 static int hf_nfs_data = -1;
73 static int hf_nfs_write_beginoffset = -1;
74 static int hf_nfs_write_offset = -1;
75 static int hf_nfs_write_totalcount = -1;
76 static int hf_nfs_symlink_to = -1;
77 static int hf_nfs_readdir_cookie = -1;
78 static int hf_nfs_readdir_count = -1;
79 static int hf_nfs_readdir_entry = -1;
80 static int hf_nfs_readdir_entry_fileid = -1;
81 static int hf_nfs_readdir_entry_name = -1;
82 static int hf_nfs_readdirplus_entry_name = -1;
83 static int hf_nfs_readdir_entry_cookie = -1;
84 static int hf_nfs_readdir_eof = -1;
85 static int hf_nfs_statfs_tsize = -1;
86 static int hf_nfs_statfs_bsize = -1;
87 static int hf_nfs_statfs_blocks = -1;
88 static int hf_nfs_statfs_bfree = -1;
89 static int hf_nfs_statfs_bavail = -1;
90 static int hf_nfs_ftype3 = -1;
91 static int hf_nfs_nfsstat3 = -1;
92 static int hf_nfs_read_eof = -1;
93 static int hf_nfs_write_stable = -1;
94 static int hf_nfs_write_committed = -1;
95 static int hf_nfs_createmode3 = -1;
96 static int hf_nfs_fsstat_invarsec = -1;
97 static int hf_nfs_fsinfo_rtmax = -1;
98 static int hf_nfs_fsinfo_rtpref = -1;
99 static int hf_nfs_fsinfo_rtmult = -1;
100 static int hf_nfs_fsinfo_wtmax = -1;
101 static int hf_nfs_fsinfo_wtpref = -1;
102 static int hf_nfs_fsinfo_wtmult = -1;
103 static int hf_nfs_fsinfo_dtpref = -1;
104 static int hf_nfs_fsinfo_properties = -1;
105 static int hf_nfs_pathconf_linkmax = -1;
106 static int hf_nfs_pathconf_name_max = -1;
107 static int hf_nfs_pathconf_no_trunc = -1;
108 static int hf_nfs_pathconf_chown_restricted = -1;
109 static int hf_nfs_pathconf_case_insensitive = -1;
110 static int hf_nfs_pathconf_case_preserving = -1;
113 static int hf_nfs_argop4 = -1;
114 static int hf_nfs_resop4 = -1;
115 static int hf_nfs_linktext4 = -1;
116 static int hf_nfs_tag4 = -1;
117 static int hf_nfs_component4 = -1;
118 static int hf_nfs_clientid4 = -1;
119 static int hf_nfs_ace4 = -1;
120 static int hf_nfs_recall = -1;
121 static int hf_nfs_open_claim_type4 = -1;
122 static int hf_nfs_opentype4 = -1;
123 static int hf_nfs_limit_by4 = -1;
124 static int hf_nfs_open_delegation_type4 = -1;
125 static int hf_nfs_ftype4 = -1;
126 static int hf_nfs_nfsstat4 = -1;
128 static gint ett_nfs = -1;
129 static gint ett_nfs_fh_fsid = -1;
130 static gint ett_nfs_fh_xfsid = -1;
131 static gint ett_nfs_fh_fn = -1;
132 static gint ett_nfs_fh_xfn = -1;
133 static gint ett_nfs_fh_hp = -1;
134 static gint ett_nfs_fhandle = -1;
135 static gint ett_nfs_timeval = -1;
136 static gint ett_nfs_mode = -1;
137 static gint ett_nfs_fattr = -1;
138 static gint ett_nfs_sattr = -1;
139 static gint ett_nfs_diropargs = -1;
140 static gint ett_nfs_readdir_entry = -1;
141 static gint ett_nfs_mode3 = -1;
142 static gint ett_nfs_specdata3 = -1;
143 static gint ett_nfs_fh3 = -1;
144 static gint ett_nfs_nfstime3 = -1;
145 static gint ett_nfs_fattr3 = -1;
146 static gint ett_nfs_post_op_fh3 = -1;
147 static gint ett_nfs_sattr3 = -1;
148 static gint ett_nfs_diropargs3 = -1;
149 static gint ett_nfs_sattrguard3 = -1;
150 static gint ett_nfs_set_mode3 = -1;
151 static gint ett_nfs_set_uid3 = -1;
152 static gint ett_nfs_set_gid3 = -1;
153 static gint ett_nfs_set_size3 = -1;
154 static gint ett_nfs_set_atime = -1;
155 static gint ett_nfs_set_mtime = -1;
156 static gint ett_nfs_pre_op_attr = -1;
157 static gint ett_nfs_post_op_attr = -1;
158 static gint ett_nfs_wcc_attr = -1;
159 static gint ett_nfs_wcc_data = -1;
160 static gint ett_nfs_access = -1;
161 static gint ett_nfs_fsinfo_properties = -1;
164 static gint ett_nfs_compound_call4 = -1;
165 static gint ett_nfs_utf8string = -1;
166 static gint ett_nfs_argop4 = -1;
167 static gint ett_nfs_resop4 = -1;
168 static gint ett_nfs_access4 = -1;
169 static gint ett_nfs_close4 = -1;
170 static gint ett_nfs_commit4 = -1;
171 static gint ett_nfs_create4 = -1;
172 static gint ett_nfs_delegpurge4 = -1;
173 static gint ett_nfs_delegreturn4 = -1;
174 static gint ett_nfs_getattr4 = -1;
175 static gint ett_nfs_getfh4 = -1;
176 static gint ett_nfs_link4 = -1;
177 static gint ett_nfs_lock4 = -1;
178 static gint ett_nfs_lockt4 = -1;
179 static gint ett_nfs_locku4 = -1;
180 static gint ett_nfs_lookup4 = -1;
181 static gint ett_nfs_lookupp4 = -1;
182 static gint ett_nfs_nverify4 = -1;
183 static gint ett_nfs_open4 = -1;
184 static gint ett_nfs_openattr4 = -1;
185 static gint ett_nfs_open_confirm4 = -1;
186 static gint ett_nfs_open_downgrade4 = -1;
187 static gint ett_nfs_putfh4 = -1;
188 static gint ett_nfs_putpubfh4 = -1;
189 static gint ett_nfs_putrootfh4 = -1;
190 static gint ett_nfs_read4 = -1;
191 static gint ett_nfs_readdir4 = -1;
192 static gint ett_nfs_readlink4 = -1;
193 static gint ett_nfs_remove4 = -1;
194 static gint ett_nfs_rename4 = -1;
195 static gint ett_nfs_renew4 = -1;
196 static gint ett_nfs_restorefh4 = -1;
197 static gint ett_nfs_savefh4 = -1;
198 static gint ett_nfs_secinfo4 = -1;
199 static gint ett_nfs_setattr4 = -1;
200 static gint ett_nfs_setclientid4 = -1;
201 static gint ett_nfs_setclientid_confirm4 = -1;
202 static gint ett_nfs_verify4 = -1;
203 static gint ett_nfs_write4 = -1;
204 static gint ett_nfs_verifier4 = -1;
205 static gint ett_nfs_opaque = -1;
206 static gint ett_nfs_dirlist4 = -1;
207 static gint ett_nfs_pathname4 = -1;
208 static gint ett_nfs_change_info4 = -1;
209 static gint ett_nfs_open_delegation4 = -1;
210 static gint ett_nfs_open_claim4 = -1;
211 static gint ett_nfs_opentype4 = -1;
212 static gint ett_nfs_lockowner4 = -1;
213 static gint ett_nfs_cb_client4 = -1;
214 static gint ett_nfs_client_id4 = -1;
215 static gint ett_nfs_bitmap4 = -1;
217 /* file handle dissection */
219 #define FHT_UNKNOWN 0
221 #define FHT_LINUX_KNFSD_LE 2
222 #define FHT_LINUX_NFSD_LE 3
224 const value_string names_fhtype[] =
226 { FHT_UNKNOWN, "unknown" },
227 { FHT_SVR4, "System V R4" },
228 { FHT_LINUX_KNFSD_LE, "Linux knfsd (little-endian)" },
229 { FHT_LINUX_NFSD_LE, "Linux user-land nfsd (little-endian)" },
234 /* SVR4: checked with ReliantUNIX (5.43, 5.44, 5.45) */
237 dissect_fhandle_data_SVR4(tvbuff_t* tvb, proto_tree *tree, int fhlen)
251 temp = tvb_get_ntohl(tvb, fsid_O);
252 fsid_major = ( temp>>18 ) & 0x3fff; /* 14 bits */
253 fsid_minor = ( temp ) & 0x3ffff; /* 18 bits */
255 proto_item* fsid_item = NULL;
256 proto_tree* fsid_tree = NULL;
258 fsid_item = proto_tree_add_text(tree, tvb,
260 "file system ID: %d,%d", fsid_major, fsid_minor);
262 fsid_tree = proto_item_add_subtree(fsid_item,
264 proto_tree_add_uint(fsid_tree, hf_nfs_fh_fsid_major,
265 tvb, fsid_O, 2, fsid_major);
266 proto_tree_add_uint(fsid_tree, hf_nfs_fh_fsid_minor,
267 tvb, fsid_O+1, 3, fsid_minor);
270 nof = fsid_O + fsid_L;
273 /* file system type */
281 fstype = tvb_get_ntohl(tvb, fstype_O);
283 proto_tree_add_uint(tree, hf_nfs_fh_fstype, tvb,
284 fstype_O, fstype_L, fstype);
286 nof = fstype_O + fstype_L;
296 guint32 fn_data_inode_O;
297 guint32 fn_data_inode_L;
299 guint32 fn_data_gen_O;
300 guint32 fn_data_gen_L;
307 fn_len = tvb_get_ntohs(tvb, fn_len_O);
308 fn_data_O = fn_O + fn_len_L;
309 fn_data_inode_O = fn_data_O + 2;
311 inode = tvb_get_ntohl(tvb, fn_data_inode_O);
312 fn_data_gen_O = fn_data_inode_O + fn_data_inode_L;
314 gen = tvb_get_ntohl(tvb, fn_data_gen_O);
315 fn_L = fn_len_L + fn_len;
317 proto_item* fn_item = NULL;
318 proto_tree* fn_tree = NULL;
320 fn_item = proto_tree_add_uint(tree, hf_nfs_fh_fn, tvb,
323 fn_tree = proto_item_add_subtree(fn_item,
325 proto_tree_add_uint(fn_tree, hf_nfs_fh_fn_len,
326 tvb, fn_len_O, fn_len_L, fn_len);
327 proto_tree_add_uint(fn_tree, hf_nfs_fh_fn_inode,
328 tvb, fn_data_inode_O, fn_data_inode_L, inode);
329 proto_tree_add_uint(fn_tree, hf_nfs_fh_fn_generation,
330 tvb, fn_data_gen_O, fn_data_gen_L, gen);
333 nof = fn_O + fn_len_L + fn_len;
336 /* exported file number */
343 guint32 xfn_data_inode_O;
344 guint32 xfn_data_inode_L;
346 guint32 xfn_data_gen_O;
347 guint32 xfn_data_gen_L;
354 xfn_len = tvb_get_ntohs(tvb, xfn_len_O);
355 xfn_data_O = xfn_O + xfn_len_L;
356 xfn_data_inode_O = xfn_data_O + 2;
357 xfn_data_inode_L = 4;
358 xinode = tvb_get_ntohl(tvb, xfn_data_inode_O);
359 xfn_data_gen_O = xfn_data_inode_O + xfn_data_inode_L;
361 xgen = tvb_get_ntohl(tvb, xfn_data_gen_O);
362 xfn_L = xfn_len_L + xfn_len;
364 proto_item* xfn_item = NULL;
365 proto_tree* xfn_tree = NULL;
367 xfn_item = proto_tree_add_uint(tree, hf_nfs_fh_xfn, tvb,
368 xfn_O, xfn_L, xinode);
370 xfn_tree = proto_item_add_subtree(xfn_item,
372 proto_tree_add_uint(xfn_tree, hf_nfs_fh_xfn_len,
373 tvb, xfn_len_O, xfn_len_L, xfn_len);
374 proto_tree_add_uint(xfn_tree, hf_nfs_fh_xfn_inode,
375 tvb, xfn_data_inode_O, xfn_data_inode_L, xinode);
376 proto_tree_add_uint(xfn_tree, hf_nfs_fh_xfn_generation,
377 tvb, xfn_data_gen_O, xfn_data_gen_L, xgen);
384 /* Checked with RedHat Linux 6.2 (kernel 2.2.14 knfsd) */
387 dissect_fhandle_data_LINUX_KNFSD_LE(tvbuff_t* tvb, proto_tree *tree, int fhlen)
400 dentry = tvb_get_letohl(tvb, 0);
401 inode = tvb_get_letohl(tvb, 4);
402 dirinode = tvb_get_letohl(tvb, 8);
403 temp = tvb_get_letohs (tvb,12);
404 fsid_major = (temp >> 8) & 0xff;
405 fsid_minor = (temp ) & 0xff;
406 temp = tvb_get_letohs(tvb,16);
407 xfsid_major = (temp >> 8) & 0xff;
408 xfsid_minor = (temp ) & 0xff;
409 xinode = tvb_get_letohl(tvb,20);
410 gen = tvb_get_letohl(tvb,24);
413 proto_tree_add_uint(tree, hf_nfs_fh_dentry,
415 proto_tree_add_uint(tree, hf_nfs_fh_fn_inode,
417 proto_tree_add_uint(tree, hf_nfs_fh_dirinode,
418 tvb, 8, 4, dirinode);
420 /* file system id (device) */
422 proto_item* fsid_item = NULL;
423 proto_tree* fsid_tree = NULL;
425 fsid_item = proto_tree_add_text(tree, tvb,
427 "file system ID: %d,%d", fsid_major, fsid_minor);
429 fsid_tree = proto_item_add_subtree(fsid_item,
431 proto_tree_add_uint(fsid_tree, hf_nfs_fh_fsid_major,
432 tvb, 13, 1, fsid_major);
433 proto_tree_add_uint(fsid_tree, hf_nfs_fh_fsid_minor,
434 tvb, 12, 1, fsid_minor);
438 /* exported file system id (device) */
440 proto_item* xfsid_item = NULL;
441 proto_tree* xfsid_tree = NULL;
443 xfsid_item = proto_tree_add_text(tree, tvb,
445 "exported file system ID: %d,%d", xfsid_major, xfsid_minor);
447 xfsid_tree = proto_item_add_subtree(xfsid_item,
449 proto_tree_add_uint(xfsid_tree, hf_nfs_fh_xfsid_major,
450 tvb, 17, 1, xfsid_major);
451 proto_tree_add_uint(xfsid_tree, hf_nfs_fh_xfsid_minor,
452 tvb, 16, 1, xfsid_minor);
456 proto_tree_add_uint(tree, hf_nfs_fh_xfn_inode,
458 proto_tree_add_uint(tree, hf_nfs_fh_fn_generation,
464 /* Checked with RedHat Linux 5.2 (nfs-server 2.2beta47 user-land nfsd) */
467 dissect_fhandle_data_LINUX_NFSD_LE(tvbuff_t* tvb, proto_tree *tree, int fhlen)
472 pinode = tvb_get_letohl(tvb, 0);
474 proto_tree_add_uint(tree, hf_nfs_fh_pinode,
483 hashlen = tvb_get_guint8(tvb, 4);
485 proto_item* hash_item = NULL;
486 proto_tree* hash_tree = NULL;
488 hash_item = proto_tree_add_text(tree, tvb, 4, hashlen + 1,
490 tvb_bytes_to_str(tvb,5,hashlen));
492 hash_tree = proto_item_add_subtree(hash_item,
495 proto_tree_add_uint(hash_tree,
496 hf_nfs_fh_hp_len, tvb, 4, 1, hashlen);
497 proto_tree_add_text(hash_tree, tvb, 5, hashlen,
499 tvb_bytes_to_str(tvb,5,hashlen));
508 dissect_fhandle_data_unknown(tvbuff_t *tvb, proto_tree *tree, int fhlen)
520 while (bytes_left != 0) {
522 if (sublen > bytes_left)
524 proto_tree_add_text(tree, tvb, offset, sublen,
526 first_line ? "data: " :
528 tvb_bytes_to_str(tvb,offset,sublen));
529 bytes_left -= sublen;
537 dissect_fhandle_data(const u_char *pd, int offset, frame_data* fd, proto_tree *tree, int fhlen)
539 tvbuff_t *tvb = tvb_create_from_top(offset);
540 int fhtype = FHT_UNKNOWN;
542 /* filehandle too long */
543 if (fhlen>64) goto type_ready;
544 /* Not all bytes there. Any attempt to deduce the type would be
546 if (!tvb_bytes_exist(tvb,0,fhlen)) goto type_ready;
548 /* calculate (heuristically) fhtype */
553 if (tvb_get_ntohs(tvb,4) == 0) {
554 len1= tvb_get_ntohs(tvb,8);
555 if (tvb_bytes_exist(tvb,10+len1,2)) {
556 len2 = tvb_get_ntohs(tvb,10+len1);
557 if (fhlen==12+len1+len2) {
563 len1 = tvb_get_guint8(tvb,4);
564 if (len1<28 && tvb_bytes_exist(tvb,5,len1)) {
566 for (len2=5+len1;len2<32;len2++) {
567 if (tvb_get_guint8(tvb,len2)) {
573 fhtype=FHT_LINUX_NFSD_LE;
577 if (tvb_get_ntohl(tvb,28) == 0) {
578 if (tvb_get_ntohs(tvb,14) == 0) {
579 if (tvb_get_ntohs(tvb,18) == 0) {
580 fhtype=FHT_LINUX_KNFSD_LE;
590 proto_tree_add_text(tree, tvb, 0, 0,
591 "type: %s", val_to_str(fhtype, names_fhtype, "Unknown"));
595 dissect_fhandle_data_SVR4 (tvb, tree, fhlen);
597 case FHT_LINUX_KNFSD_LE:
598 dissect_fhandle_data_LINUX_KNFSD_LE(tvb, tree, fhlen);
600 case FHT_LINUX_NFSD_LE:
601 dissect_fhandle_data_LINUX_NFSD_LE (tvb, tree, fhlen);
605 dissect_fhandle_data_unknown(tvb, tree, fhlen);
611 /***************************/
612 /* NFS Version 2, RFC 1094 */
613 /***************************/
616 /* base 32 bit type for NFS v2 */
618 dissect_unsigned_int(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
621 offset = dissect_rpc_uint32(pd,offset,fd,tree,name);
626 /* RFC 1094, Page 12..14 */
627 const value_string names_nfs_stat[] =
636 { 18, "ERR_XDEV" }, /* not in spec, but can happen */
638 { 20, "ERR_NOTDIR" },
640 { 22, "ERR_INVAL" }, /* not in spec, but I think it can happen */
641 { 26, "ERR_TXTBSY" }, /* not in spec, but I think it can happen */
645 { 31, "ERR_MLINK" }, /* not in spec, but can happen */
646 { 45, "ERR_OPNOTSUPP" }, /* not in spec, but I think it can happen */
647 { 63, "ERR_NAMETOOLONG" },
648 { 66, "ERR_NOTEMPTY" },
651 { 99, "ERR_WFLUSH" },
656 /* RFC 1094, Page 12..14 */
658 dissect_stat(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
663 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
664 stat = EXTRACT_UINT(pd, offset+0);
667 /* this gives the right NFSv2 number<->message relation */
668 /* and makes it searchable via "nfs.status" */
669 proto_tree_add_uint_format(tree, hf_nfs_nfsstat3, NullTVB,
670 offset+0, 4, stat, "Status: %s (%u)",
671 val_to_str(stat,names_nfs_stat,"%u"), stat);
680 /* RFC 1094, Page 12..14 */
682 dissect_nfs2_stat_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
686 offset = dissect_stat(pd, offset, fd, tree, &status);
692 /* RFC 1094, Page 15 */
694 dissect_ftype(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
698 char* ftype_name = NULL;
700 const value_string nfs2_ftype[] =
703 { 1, "Regular File" },
705 { 3, "Block Special Device" },
706 { 4, "Character Special Device" },
707 { 5, "Symbolic Link" },
711 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
712 ftype = EXTRACT_UINT(pd, offset+0);
713 ftype_name = val_to_str(ftype, nfs2_ftype, "%u");
716 proto_tree_add_text(tree, NullTVB, offset, 4,
717 "%s: %s (%u)", name, ftype_name, ftype);
725 /* RFC 1094, Page 15 */
727 dissect_fhandle(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
730 proto_tree* ftree = NULL;
733 fitem = proto_tree_add_text(tree, NullTVB, offset, FHSIZE,
736 ftree = proto_item_add_subtree(fitem, ett_nfs_fhandle);
740 dissect_fhandle_data(pd, offset, fd, ftree, FHSIZE);
746 /* RFC 1094, Page 15 */
748 dissect_nfs2_fhandle_call(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
750 offset = dissect_fhandle(pd, offset, fd, tree, "object");
756 /* RFC 1094, Page 15 */
758 dissect_timeval(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
763 proto_item* time_item;
764 proto_tree* time_tree = NULL;
766 if (!BYTES_ARE_IN_FRAME(offset,8)) return offset;
767 seconds = EXTRACT_UINT(pd, offset+0);
768 mseconds = EXTRACT_UINT(pd, offset+4);
771 time_item = proto_tree_add_text(tree, NullTVB, offset, 8,
772 "%s: %u.%06u", name, seconds, mseconds);
774 time_tree = proto_item_add_subtree(time_item, ett_nfs_timeval);
778 proto_tree_add_text(time_tree, NullTVB,offset+0,4,
779 "seconds: %u", seconds);
780 proto_tree_add_text(time_tree, NullTVB,offset+4,4,
781 "micro seconds: %u", mseconds);
788 /* RFC 1094, Page 16 */
789 const value_string nfs2_mode_names[] = {
790 { 0040000, "Directory" },
791 { 0020000, "Character Special Device" },
792 { 0060000, "Block Special Device" },
793 { 0100000, "Regular File" },
794 { 0120000, "Symbolic Link" },
795 { 0140000, "Named Socket" },
800 dissect_mode(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
804 proto_item* mode_item = NULL;
805 proto_tree* mode_tree = NULL;
807 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
808 mode = EXTRACT_UINT(pd, offset+0);
811 mode_item = proto_tree_add_text(tree, NullTVB, offset, 4,
812 "%s: 0%o", name, mode);
814 mode_tree = proto_item_add_subtree(mode_item, ett_nfs_mode);
818 proto_tree_add_text(mode_tree, NullTVB, offset, 4, "%s",
819 decode_enumerated_bitfield(mode, 0160000, 16,
820 nfs2_mode_names, "%s"));
821 proto_tree_add_text(mode_tree, NullTVB, offset, 4, "%s",
822 decode_boolean_bitfield(mode, 04000, 16, "Set user id on exec", "not SUID"));
823 proto_tree_add_text(mode_tree, NullTVB, offset, 4, "%s",
824 decode_boolean_bitfield(mode, 02000, 16, "Set group id on exec", "not SGID"));
825 proto_tree_add_text(mode_tree, NullTVB, offset, 4, "%s",
826 decode_boolean_bitfield(mode, 01000, 16, "Save swapped text even after use", "not save swapped text"));
827 proto_tree_add_text(mode_tree, NullTVB, offset, 4, "%s",
828 decode_boolean_bitfield(mode, 0400, 16, "Read permission for owner", "no Read permission for owner"));
829 proto_tree_add_text(mode_tree, NullTVB, offset, 4, "%s",
830 decode_boolean_bitfield(mode, 0200, 16, "Write permission for owner", "no Write permission for owner"));
831 proto_tree_add_text(mode_tree, NullTVB, offset, 4, "%s",
832 decode_boolean_bitfield(mode, 0100, 16, "Execute permission for owner", "no Execute permission for owner"));
833 proto_tree_add_text(mode_tree, NullTVB, offset, 4, "%s",
834 decode_boolean_bitfield(mode, 040, 16, "Read permission for group", "no Read permission for group"));
835 proto_tree_add_text(mode_tree, NullTVB, offset, 4, "%s",
836 decode_boolean_bitfield(mode, 020, 16, "Write permission for group", "no Write permission for group"));
837 proto_tree_add_text(mode_tree, NullTVB, offset, 4, "%s",
838 decode_boolean_bitfield(mode, 010, 16, "Execute permission for group", "no Execute permission for group"));
839 proto_tree_add_text(mode_tree, NullTVB, offset, 4, "%s",
840 decode_boolean_bitfield(mode, 04, 16, "Read permission for others", "no Read permission for others"));
841 proto_tree_add_text(mode_tree, NullTVB, offset, 4, "%s",
842 decode_boolean_bitfield(mode, 02, 16, "Write permission for others", "no Write permission for others"));
843 proto_tree_add_text(mode_tree, NullTVB, offset, 4, "%s",
844 decode_boolean_bitfield(mode, 01, 16, "Execute permission for others", "no Execute permission for others"));
852 /* RFC 1094, Page 15 */
854 dissect_fattr(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
856 proto_item* fattr_item = NULL;
857 proto_tree* fattr_tree = NULL;
858 int old_offset = offset;
861 fattr_item = proto_tree_add_text(tree, NullTVB, offset,
862 END_OF_FRAME, "%s", name);
864 fattr_tree = proto_item_add_subtree(fattr_item, ett_nfs_fattr);
867 offset = dissect_ftype (pd,offset,fd,fattr_tree,"type");
868 offset = dissect_mode (pd,offset,fd,fattr_tree,"mode");
869 offset = dissect_unsigned_int (pd,offset,fd,fattr_tree,"nlink");
870 offset = dissect_unsigned_int (pd,offset,fd,fattr_tree,"uid");
871 offset = dissect_unsigned_int (pd,offset,fd,fattr_tree,"gid");
872 offset = dissect_unsigned_int (pd,offset,fd,fattr_tree,"size");
873 offset = dissect_unsigned_int (pd,offset,fd,fattr_tree,"blocksize");
874 offset = dissect_unsigned_int (pd,offset,fd,fattr_tree,"rdev");
875 offset = dissect_unsigned_int (pd,offset,fd,fattr_tree,"blocks");
876 offset = dissect_unsigned_int (pd,offset,fd,fattr_tree,"fsid");
877 offset = dissect_unsigned_int (pd,offset,fd,fattr_tree,"fileid");
878 offset = dissect_timeval (pd,offset,fd,fattr_tree,"atime");
879 offset = dissect_timeval (pd,offset,fd,fattr_tree,"mtime");
880 offset = dissect_timeval (pd,offset,fd,fattr_tree,"ctime");
882 /* now we know, that fattr is shorter */
884 proto_item_set_len(fattr_item, offset - old_offset);
891 /* RFC 1094, Page 17 */
893 dissect_sattr(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
895 proto_item* sattr_item = NULL;
896 proto_tree* sattr_tree = NULL;
897 int old_offset = offset;
900 sattr_item = proto_tree_add_text(tree, NullTVB, offset,
901 END_OF_FRAME, "%s", name);
903 sattr_tree = proto_item_add_subtree(sattr_item, ett_nfs_sattr);
906 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
907 if (EXTRACT_UINT(pd, offset+0) != 0xffffffff)
908 offset = dissect_mode (pd,offset,fd,sattr_tree,"mode");
910 proto_tree_add_text(sattr_tree, NullTVB, offset, 4, "mode: no value");
914 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
915 if (EXTRACT_UINT(pd, offset+0) != 0xffffffff)
916 offset = dissect_unsigned_int (pd,offset,fd,sattr_tree,"uid");
918 proto_tree_add_text(sattr_tree, NullTVB, offset, 4, "uid: no value");
922 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
923 if (EXTRACT_UINT(pd, offset+0) != 0xffffffff)
924 offset = dissect_unsigned_int (pd,offset,fd,sattr_tree,"gid");
926 proto_tree_add_text(sattr_tree, NullTVB, offset, 4, "gid: no value");
930 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
931 if (EXTRACT_UINT(pd, offset+0) != 0xffffffff)
932 offset = dissect_unsigned_int (pd,offset,fd,sattr_tree,"size");
934 proto_tree_add_text(sattr_tree, NullTVB, offset, 4, "size: no value");
938 if (!BYTES_ARE_IN_FRAME(offset,8)) return offset;
939 if (EXTRACT_UINT(pd, offset+0) != 0xffffffff)
940 offset = dissect_timeval (pd,offset,fd,sattr_tree,"atime");
942 proto_tree_add_text(sattr_tree, NullTVB, offset, 8, "atime: no value");
946 if (!BYTES_ARE_IN_FRAME(offset,8)) return offset;
947 if (EXTRACT_UINT(pd, offset+0) != 0xffffffff)
948 offset = dissect_timeval (pd,offset,fd,sattr_tree,"mtime");
950 proto_tree_add_text(sattr_tree, NullTVB, offset, 8, "mtime: no value");
954 /* now we know, that sattr is shorter */
956 proto_item_set_len(sattr_item, offset - old_offset);
963 /* RFC 1094, Page 17 */
965 dissect_filename(const u_char *pd, int offset, frame_data *fd,
966 proto_tree *tree, int hf, char **string_ret)
968 offset = dissect_rpc_string(pd,offset,fd,tree,hf,string_ret);
973 /* RFC 1094, Page 17 */
975 dissect_path(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, int hf)
977 offset = dissect_rpc_string(pd,offset,fd,tree,hf,NULL);
982 /* RFC 1094, Page 17,18 */
984 dissect_attrstat(const u_char *pd, int offset, frame_data *fd, proto_tree *tree){
987 offset = dissect_stat(pd, offset, fd, tree, &status);
990 offset = dissect_fattr(pd, offset, fd, tree, "attributes");
1001 /* RFC 1094, Page 17,18 */
1003 dissect_nfs2_attrstat_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
1005 offset = dissect_attrstat(pd, offset, fd, tree);
1011 /* RFC 1094, Page 18 */
1013 dissect_diropargs(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
1015 proto_item* diropargs_item = NULL;
1016 proto_tree* diropargs_tree = NULL;
1017 int old_offset = offset;
1020 diropargs_item = proto_tree_add_text(tree, NullTVB, offset,
1021 END_OF_FRAME, "%s", name);
1023 diropargs_tree = proto_item_add_subtree(diropargs_item, ett_nfs_diropargs);
1026 offset = dissect_fhandle (pd,offset,fd,diropargs_tree,"dir");
1027 offset = dissect_filename(pd,offset,fd,diropargs_tree,hf_nfs_name,NULL);
1029 /* now we know, that diropargs is shorter */
1030 if (diropargs_item) {
1031 proto_item_set_len(diropargs_item, offset - old_offset);
1038 /* RFC 1094, Page 18 */
1040 dissect_nfs2_diropargs_call(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
1042 offset = dissect_diropargs(pd, offset, fd, tree, "where");
1048 /* RFC 1094, Page 18 */
1050 dissect_diropres(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
1054 offset = dissect_stat(pd, offset, fd, tree, &status);
1057 offset = dissect_fhandle(pd, offset, fd, tree, "file");
1058 offset = dissect_fattr (pd, offset, fd, tree, "attributes");
1069 /* nfsdata is simply a RPC string (length, data, fill bytes) */
1071 dissect_nfsdata(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
1074 offset = dissect_rpc_data(pd,offset,fd,tree,hf);
1080 /* RFC 1094, Page 18 */
1082 dissect_nfs2_diropres_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
1084 offset = dissect_diropres(pd, offset, fd, tree);
1090 /* RFC 1094, Page 6 */
1092 dissect_nfs2_setattr_call(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
1094 offset = dissect_fhandle(pd, offset, fd, tree, "file" );
1095 offset = dissect_sattr (pd, offset, fd, tree, "attributes");
1101 /* RFC 1094, Page 6 */
1103 dissect_nfs2_readlink_reply(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
1107 offset = dissect_stat(pd, offset, fd, tree, &status);
1110 offset = dissect_path(pd, offset, fd, tree, hf_nfs_readlink_data);
1121 /* RFC 1094, Page 7 */
1123 dissect_nfs2_read_call(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
1125 guint32 offset_value;
1129 offset = dissect_fhandle(pd, offset, fd, tree, "file" );
1130 if (!BYTES_ARE_IN_FRAME(offset,12)) return offset;
1131 offset_value = EXTRACT_UINT(pd, offset+0);
1132 count = EXTRACT_UINT(pd, offset+4);
1133 totalcount = EXTRACT_UINT(pd, offset+8);
1135 proto_tree_add_uint(tree, hf_nfs_read_offset, NullTVB,
1136 offset+0, 4, offset_value);
1137 proto_tree_add_uint(tree, hf_nfs_read_count, NullTVB,
1138 offset+4, 4, count);
1139 proto_tree_add_uint(tree, hf_nfs_read_totalcount, NullTVB,
1140 offset+8, 4, totalcount);
1148 /* RFC 1094, Page 7 */
1150 dissect_nfs2_read_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
1154 offset = dissect_stat(pd, offset, fd, tree, &status);
1157 offset = dissect_fattr(pd, offset, fd, tree, "attributes");
1158 offset = dissect_nfsdata(pd, offset, fd, tree, hf_nfs_data);
1169 /* RFC 1094, Page 8 */
1171 dissect_nfs2_write_call(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
1173 guint32 beginoffset;
1174 guint32 offset_value;
1177 offset = dissect_fhandle(pd, offset, fd, tree, "file" );
1178 if (!BYTES_ARE_IN_FRAME(offset,12)) return offset;
1179 beginoffset = EXTRACT_UINT(pd, offset+0);
1180 offset_value = EXTRACT_UINT(pd, offset+4);
1181 totalcount = EXTRACT_UINT(pd, offset+8);
1183 proto_tree_add_uint(tree, hf_nfs_write_beginoffset, NullTVB,
1184 offset+0, 4, beginoffset);
1185 proto_tree_add_uint(tree, hf_nfs_write_offset, NullTVB,
1186 offset+4, 4, offset_value);
1187 proto_tree_add_uint(tree, hf_nfs_write_totalcount, NullTVB,
1188 offset+8, 4, totalcount);
1192 offset = dissect_nfsdata(pd, offset, fd, tree, hf_nfs_data);
1198 /* RFC 1094, Page 8 */
1200 dissect_nfs2_createargs_call(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
1202 offset = dissect_diropargs(pd, offset, fd, tree, "where" );
1203 offset = dissect_sattr (pd, offset, fd, tree, "attributes");
1209 /* RFC 1094, Page 9 */
1211 dissect_nfs2_rename_call(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
1213 offset = dissect_diropargs(pd, offset, fd, tree, "from");
1214 offset = dissect_diropargs(pd, offset, fd, tree, "to" );
1220 /* RFC 1094, Page 9 */
1222 dissect_nfs2_link_call(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
1224 offset = dissect_fhandle (pd, offset, fd, tree, "from");
1225 offset = dissect_diropargs(pd, offset, fd, tree, "to" );
1231 /* RFC 1094, Page 10 */
1233 dissect_nfs2_symlink_call(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
1235 offset = dissect_diropargs(pd, offset, fd, tree, "from" );
1236 offset = dissect_path (pd, offset, fd, tree, hf_nfs_symlink_to);
1237 offset = dissect_sattr (pd, offset, fd, tree, "attributes" );
1243 /* RFC 1094, Page 11 */
1245 dissect_nfs2_readdir_call(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
1250 offset = dissect_fhandle (pd, offset, fd, tree, "dir");
1251 if (!BYTES_ARE_IN_FRAME(offset,8)) return offset;
1252 cookie = EXTRACT_UINT(pd, offset+ 0);
1253 count = EXTRACT_UINT(pd, offset+ 4);
1255 proto_tree_add_uint(tree, hf_nfs_readdir_cookie, NullTVB,
1256 offset+ 0, 4, cookie);
1257 proto_tree_add_uint(tree, hf_nfs_readdir_count, NullTVB,
1258 offset+ 4, 4, count);
1266 /* RFC 1094, Page 11 */
1268 dissect_readdir_entry(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
1270 proto_item* entry_item = NULL;
1271 proto_tree* entry_tree = NULL;
1272 int old_offset = offset;
1278 entry_item = proto_tree_add_item(tree, hf_nfs_readdir_entry, NullTVB,
1279 offset+0, END_OF_FRAME, FALSE);
1281 entry_tree = proto_item_add_subtree(entry_item, ett_nfs_readdir_entry);
1284 if (!BYTES_ARE_IN_FRAME(offset, 4)) {
1286 proto_item_set_text(entry_item, "Entry: <TRUNCATED>");
1289 fileid = EXTRACT_UINT(pd, offset + 0);
1291 proto_tree_add_uint(entry_tree, hf_nfs_readdir_entry_fileid, NullTVB,
1292 offset+0, 4, fileid);
1295 offset = dissect_filename(pd, offset, fd, entry_tree,
1296 hf_nfs_readdir_entry_name, &name);
1298 proto_item_set_text(entry_item, "Entry: file ID %u, name %s",
1302 if (!BYTES_ARE_IN_FRAME(offset, 4)) return offset;
1303 cookie = EXTRACT_UINT(pd, offset + 0);
1305 proto_tree_add_uint(entry_tree, hf_nfs_readdir_entry_cookie, NullTVB,
1306 offset+0, 4, cookie);
1309 /* now we know, that a readdir entry is shorter */
1311 proto_item_set_len(entry_item, offset - old_offset);
1317 /* RFC 1094, Page 11 */
1319 dissect_nfs2_readdir_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
1324 offset = dissect_stat(pd, offset, fd, tree, &status);
1327 offset = dissect_rpc_list(pd, offset, fd, tree,
1328 dissect_readdir_entry);
1329 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
1330 eof_value = EXTRACT_UINT(pd, offset+0);
1332 proto_tree_add_uint(tree, hf_nfs_readdir_eof, NullTVB,
1333 offset+ 0, 4, eof_value);
1345 /* RFC 1094, Page 12 */
1347 dissect_nfs2_statfs_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
1356 offset = dissect_stat(pd, offset, fd, tree, &status);
1359 if (!BYTES_ARE_IN_FRAME(offset,5 * 4)) return offset;
1360 tsize = EXTRACT_UINT(pd, offset+ 0);
1361 bsize = EXTRACT_UINT(pd, offset+ 4);
1362 blocks = EXTRACT_UINT(pd, offset+ 8);
1363 bfree = EXTRACT_UINT(pd, offset+12);
1364 bavail = EXTRACT_UINT(pd, offset+16);
1366 proto_tree_add_uint(tree, hf_nfs_statfs_tsize, NullTVB,
1367 offset+ 0, 4, tsize);
1368 proto_tree_add_uint(tree, hf_nfs_statfs_bsize, NullTVB,
1369 offset+ 4, 4, bsize);
1370 proto_tree_add_uint(tree, hf_nfs_statfs_blocks, NullTVB,
1371 offset+ 8, 4, blocks);
1372 proto_tree_add_uint(tree, hf_nfs_statfs_bfree, NullTVB,
1373 offset+12, 4, bfree);
1374 proto_tree_add_uint(tree, hf_nfs_statfs_bavail, NullTVB,
1375 offset+16, 4, bavail);
1388 /* proc number, "proc name", dissect_request, dissect_reply */
1389 /* NULL as function pointer means: take the generic one. */
1390 const vsff nfs2_proc[] = {
1391 { 0, "NULL", /* OK */
1393 { 1, "GETATTR", /* OK */
1394 dissect_nfs2_fhandle_call, dissect_nfs2_attrstat_reply },
1395 { 2, "SETATTR", /* OK */
1396 dissect_nfs2_setattr_call, dissect_nfs2_attrstat_reply },
1397 { 3, "ROOT", /* OK */
1399 { 4, "LOOKUP", /* OK */
1400 dissect_nfs2_diropargs_call, dissect_nfs2_diropres_reply },
1401 { 5, "READLINK", /* OK */
1402 dissect_nfs2_fhandle_call, dissect_nfs2_readlink_reply },
1403 { 6, "READ", /* OK */
1404 dissect_nfs2_read_call, dissect_nfs2_read_reply },
1405 { 7, "WRITECACHE", /* OK */
1407 { 8, "WRITE", /* OK */
1408 dissect_nfs2_write_call, dissect_nfs2_attrstat_reply },
1409 { 9, "CREATE", /* OK */
1410 dissect_nfs2_createargs_call, dissect_nfs2_diropres_reply },
1411 { 10, "REMOVE", /* OK */
1412 dissect_nfs2_diropargs_call, dissect_nfs2_stat_reply },
1413 { 11, "RENAME", /* OK */
1414 dissect_nfs2_rename_call, dissect_nfs2_stat_reply },
1415 { 12, "LINK", /* OK */
1416 dissect_nfs2_link_call, dissect_nfs2_stat_reply },
1417 { 13, "SYMLINK", /* OK */
1418 dissect_nfs2_symlink_call, dissect_nfs2_stat_reply },
1419 { 14, "MKDIR", /* OK */
1420 dissect_nfs2_createargs_call, dissect_nfs2_diropres_reply },
1421 { 15, "RMDIR", /* OK */
1422 dissect_nfs2_diropargs_call, dissect_nfs2_stat_reply },
1423 { 16, "READDIR", /* OK */
1424 dissect_nfs2_readdir_call, dissect_nfs2_readdir_reply },
1425 { 17, "STATFS", /* OK */
1426 dissect_nfs2_fhandle_call, dissect_nfs2_statfs_reply },
1427 { 0,NULL,NULL,NULL }
1429 /* end of NFS Version 2 */
1432 /***************************/
1433 /* NFS Version 3, RFC 1813 */
1434 /***************************/
1437 /* RFC 1813, Page 15 */
1439 dissect_uint64(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
1442 offset = dissect_rpc_uint64(pd,offset,fd,tree,name);
1447 /* RFC 1813, Page 15 */
1449 dissect_uint32(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
1452 offset = dissect_rpc_uint32(pd,offset,fd,tree,name);
1457 /* RFC 1813, Page 15 */
1459 dissect_filename3(const u_char *pd, int offset, frame_data *fd,
1460 proto_tree *tree, int hf, char **string_ret)
1462 offset = dissect_rpc_string(pd,offset,fd,tree,hf,string_ret);
1467 /* RFC 1813, Page 15 */
1469 dissect_nfspath3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, int hf)
1471 offset = dissect_rpc_string(pd,offset,fd,tree,hf,NULL);
1476 /* RFC 1813, Page 15 */
1478 dissect_fileid3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
1481 offset = dissect_rpc_uint64(pd,offset,fd,tree,name);
1486 /* RFC 1813, Page 15 */
1488 dissect_cookie3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
1491 offset = dissect_rpc_uint64(pd,offset,fd,tree,name);
1496 /* RFC 1813, Page 15 */
1498 dissect_cookieverf3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
1500 if (!BYTES_ARE_IN_FRAME(offset,8)) return offset;
1501 proto_tree_add_text(tree, NullTVB, offset, NFS3_COOKIEVERFSIZE,
1502 "Verifier: Opaque Data");
1503 offset += NFS3_COOKIEVERFSIZE;
1508 /* RFC 1813, Page 16 */
1510 dissect_createverf3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
1512 if (!BYTES_ARE_IN_FRAME(offset,8)) return offset;
1513 proto_tree_add_text(tree, NullTVB, offset, NFS3_CREATEVERFSIZE,
1514 "Verifier: Opaque Data");
1515 offset += NFS3_CREATEVERFSIZE;
1520 /* RFC 1813, Page 16 */
1522 dissect_writeverf3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
1524 if (!BYTES_ARE_IN_FRAME(offset,8)) return offset;
1525 proto_tree_add_text(tree, NullTVB, offset, NFS3_WRITEVERFSIZE,
1526 "Verifier: Opaque Data");
1527 offset += NFS3_WRITEVERFSIZE;
1532 /* RFC 1813, Page 16 */
1534 dissect_uid3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
1537 offset = dissect_rpc_uint32(pd,offset,fd,tree,name);
1542 /* RFC 1813, Page 16 */
1544 dissect_gid3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
1547 offset = dissect_rpc_uint32(pd,offset,fd,tree,name);
1552 /* RFC 1813, Page 16 */
1554 dissect_size3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
1557 offset = dissect_rpc_uint64(pd,offset,fd,tree,name);
1562 /* RFC 1813, Page 16 */
1564 dissect_offset3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
1567 offset = dissect_rpc_uint64(pd,offset,fd,tree,name);
1572 /* RFC 1813, Page 16 */
1574 dissect_mode3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
1578 proto_item* mode3_item = NULL;
1579 proto_tree* mode3_tree = NULL;
1581 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
1582 mode3 = EXTRACT_UINT(pd, offset+0);
1585 mode3_item = proto_tree_add_text(tree, NullTVB, offset, 4,
1586 "%s: 0%o", name, mode3);
1588 mode3_tree = proto_item_add_subtree(mode3_item, ett_nfs_mode3);
1591 /* RFC 1813, Page 23 */
1593 proto_tree_add_text(mode3_tree, NullTVB, offset, 4, "%s",
1594 decode_boolean_bitfield(mode3, 0x800, 12, "Set user id on exec", "not SUID"));
1595 proto_tree_add_text(mode3_tree, NullTVB, offset, 4, "%s",
1596 decode_boolean_bitfield(mode3, 0x400, 12, "Set group id on exec", "not SGID"));
1597 proto_tree_add_text(mode3_tree, NullTVB, offset, 4, "%s",
1598 decode_boolean_bitfield(mode3, 0x200, 12, "Save swapped text even after use", "not save swapped text"));
1599 proto_tree_add_text(mode3_tree, NullTVB, offset, 4, "%s",
1600 decode_boolean_bitfield(mode3, 0x100, 12, "Read permission for owner", "no Read permission for owner"));
1601 proto_tree_add_text(mode3_tree, NullTVB, offset, 4, "%s",
1602 decode_boolean_bitfield(mode3, 0x80, 12, "Write permission for owner", "no Write permission for owner"));
1603 proto_tree_add_text(mode3_tree, NullTVB, offset, 4, "%s",
1604 decode_boolean_bitfield(mode3, 0x40, 12, "Execute permission for owner", "no Execute permission for owner"));
1605 proto_tree_add_text(mode3_tree, NullTVB, offset, 4, "%s",
1606 decode_boolean_bitfield(mode3, 0x20, 12, "Read permission for group", "no Read permission for group"));
1607 proto_tree_add_text(mode3_tree, NullTVB, offset, 4, "%s",
1608 decode_boolean_bitfield(mode3, 0x10, 12, "Write permission for group", "no Write permission for group"));
1609 proto_tree_add_text(mode3_tree, NullTVB, offset, 4, "%s",
1610 decode_boolean_bitfield(mode3, 0x8, 12, "Execute permission for group", "no Execute permission for group"));
1611 proto_tree_add_text(mode3_tree, NullTVB, offset, 4, "%s",
1612 decode_boolean_bitfield(mode3, 0x4, 12, "Read permission for others", "no Read permission for others"));
1613 proto_tree_add_text(mode3_tree, NullTVB, offset, 4, "%s",
1614 decode_boolean_bitfield(mode3, 0x2, 12, "Write permission for others", "no Write permission for others"));
1615 proto_tree_add_text(mode3_tree, NullTVB, offset, 4, "%s",
1616 decode_boolean_bitfield(mode3, 0x1, 12, "Execute permission for others", "no Execute permission for others"));
1624 /* RFC 1813, Page 16 */
1626 dissect_count3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
1629 offset = dissect_rpc_uint32(pd,offset,fd,tree,name);
1634 /* RFC 1813, Page 16,17 */
1635 const value_string names_nfs_nfsstat3[] =
1642 { 13, "ERR_ACCES" },
1643 { 17, "ERR_EXIST" },
1645 { 19, "ERR_NODEV" },
1646 { 20, "ERR_NOTDIR" },
1647 { 21, "ERR_ISDIR" },
1648 { 22, "ERR_INVAL" },
1650 { 28, "ERR_NOSPC" },
1652 { 31, "ERR_MLINK" },
1653 { 63, "ERR_NAMETOOLONG" },
1654 { 66, "ERR_NOTEMPTY" },
1655 { 69, "ERR_DQUOT" },
1656 { 70, "ERR_STALE" },
1657 { 71, "ERR_REMOTE" },
1658 { 10001, "ERR_BADHANDLE" },
1659 { 10002, "ERR_NOT_SYNC" },
1660 { 10003, "ERR_BAD_COOKIE" },
1661 { 10004, "ERR_NOTSUPP" },
1662 { 10005, "ERR_TOOSMALL" },
1663 { 10006, "ERR_SERVERFAULT" },
1664 { 10007, "ERR_BADTYPE" },
1665 { 10008, "ERR_JUKEBOX" },
1670 /* RFC 1813, Page 16 */
1672 dissect_nfsstat3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,guint32 *status)
1676 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
1677 nfsstat3 = EXTRACT_UINT(pd, offset+0);
1680 proto_tree_add_uint(tree, hf_nfs_nfsstat3, NullTVB,
1681 offset, 4, nfsstat3);
1690 const value_string names_nfs_ftype3[] =
1692 { NF3REG, "Regular File" },
1693 { NF3DIR, "Directory" },
1694 { NF3BLK, "Block Special Device" },
1695 { NF3CHR, "Character Special Device" },
1696 { NF3LNK, "Symbolic Link" },
1697 { NF3SOCK,"Socket" },
1698 { NF3FIFO,"Named Pipe" },
1703 /* RFC 1813, Page 20 */
1705 dissect_ftype3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
1706 int hf, guint32* ftype3)
1710 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
1711 type = EXTRACT_UINT(pd, offset+0);
1714 proto_tree_add_uint(tree, hf, NullTVB, offset, 4, type);
1723 /* RFC 1813, Page 20 */
1725 dissect_specdata3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
1730 proto_item* specdata3_item;
1731 proto_tree* specdata3_tree = NULL;
1733 if (!BYTES_ARE_IN_FRAME(offset,8)) return offset;
1734 specdata1 = EXTRACT_UINT(pd, offset+0);
1735 specdata2 = EXTRACT_UINT(pd, offset+4);
1738 specdata3_item = proto_tree_add_text(tree, NullTVB, offset, 8,
1739 "%s: %u,%u", name, specdata1, specdata2);
1741 specdata3_tree = proto_item_add_subtree(specdata3_item,
1745 if (specdata3_tree) {
1746 proto_tree_add_text(specdata3_tree, NullTVB,offset+0,4,
1747 "specdata1: %u", specdata1);
1748 proto_tree_add_text(specdata3_tree, NullTVB,offset+4,4,
1749 "specdata2: %u", specdata2);
1757 /* RFC 1813, Page 21 */
1759 dissect_nfs_fh3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
1765 proto_tree* ftree = NULL;
1767 fh3_len = EXTRACT_UINT(pd, offset+0);
1768 fh3_len_full = rpc_roundup(fh3_len);
1769 fh3_fill = fh3_len_full - fh3_len;
1772 fitem = proto_tree_add_text(tree, NullTVB, offset, 4+fh3_len_full,
1775 ftree = proto_item_add_subtree(fitem, ett_nfs_fh3);
1779 proto_tree_add_text(ftree, NullTVB,offset+0,4,
1780 "length: %u", fh3_len);
1781 dissect_fhandle_data(pd, offset+4, fd, ftree, fh3_len);
1783 offset += 4 + fh3_len_full;
1788 /* RFC 1813, Page 21 */
1790 dissect_nfstime3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,char* name)
1795 proto_item* time_item;
1796 proto_tree* time_tree = NULL;
1798 if (!BYTES_ARE_IN_FRAME(offset,8)) return offset;
1799 seconds = EXTRACT_UINT(pd, offset+0);
1800 nseconds = EXTRACT_UINT(pd, offset+4);
1803 time_item = proto_tree_add_text(tree, NullTVB, offset, 8,
1804 "%s: %u.%09u", name, seconds, nseconds);
1806 time_tree = proto_item_add_subtree(time_item, ett_nfs_nfstime3);
1810 proto_tree_add_text(time_tree, NullTVB,offset+0,4,
1811 "seconds: %u", seconds);
1812 proto_tree_add_text(time_tree, NullTVB,offset+4,4,
1813 "nano seconds: %u", nseconds);
1820 /* RFC 1813, Page 22 */
1822 dissect_fattr3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
1824 proto_item* fattr3_item = NULL;
1825 proto_tree* fattr3_tree = NULL;
1826 int old_offset = offset;
1830 fattr3_item = proto_tree_add_text(tree, NullTVB, offset,
1831 END_OF_FRAME, "%s", name);
1833 fattr3_tree = proto_item_add_subtree(fattr3_item, ett_nfs_fattr3);
1836 offset = dissect_ftype3 (pd,offset,fd,fattr3_tree,hf_nfs_ftype3,&type);
1837 offset = dissect_mode3 (pd,offset,fd,fattr3_tree,"mode");
1838 offset = dissect_uint32 (pd,offset,fd,fattr3_tree,"nlink");
1839 offset = dissect_uid3 (pd,offset,fd,fattr3_tree,"uid");
1840 offset = dissect_gid3 (pd,offset,fd,fattr3_tree,"gid");
1841 offset = dissect_size3 (pd,offset,fd,fattr3_tree,"size");
1842 offset = dissect_size3 (pd,offset,fd,fattr3_tree,"used");
1843 offset = dissect_specdata3(pd,offset,fd,fattr3_tree,"rdev");
1844 offset = dissect_uint64 (pd,offset,fd,fattr3_tree,"fsid");
1845 offset = dissect_fileid3 (pd,offset,fd,fattr3_tree,"fileid");
1846 offset = dissect_nfstime3 (pd,offset,fd,fattr3_tree,"atime");
1847 offset = dissect_nfstime3 (pd,offset,fd,fattr3_tree,"mtime");
1848 offset = dissect_nfstime3 (pd,offset,fd,fattr3_tree,"ctime");
1850 /* now we know, that fattr3 is shorter */
1852 proto_item_set_len(fattr3_item, offset - old_offset);
1859 const value_string value_follows[] =
1862 { 1, "value follows"},
1867 /* RFC 1813, Page 23 */
1869 dissect_post_op_attr(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
1871 proto_item* post_op_attr_item = NULL;
1872 proto_tree* post_op_attr_tree = NULL;
1873 int old_offset = offset;
1874 guint32 attributes_follow;
1877 post_op_attr_item = proto_tree_add_text(tree, NullTVB, offset,
1878 END_OF_FRAME, "%s", name);
1879 if (post_op_attr_item)
1880 post_op_attr_tree = proto_item_add_subtree(post_op_attr_item, ett_nfs_post_op_attr);
1883 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
1884 attributes_follow = EXTRACT_UINT(pd, offset+0);
1885 proto_tree_add_text(post_op_attr_tree, NullTVB, offset, 4,
1886 "attributes_follow: %s (%u)",
1887 val_to_str(attributes_follow,value_follows,"Unknown"), attributes_follow);
1889 switch (attributes_follow) {
1891 offset = dissect_fattr3(pd, offset, fd, post_op_attr_tree,
1899 /* now we know, that post_op_attr_tree is shorter */
1900 if (post_op_attr_item) {
1901 proto_item_set_len(post_op_attr_item, offset - old_offset);
1908 /* RFC 1813, Page 24 */
1910 dissect_wcc_attr(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
1912 proto_item* wcc_attr_item = NULL;
1913 proto_tree* wcc_attr_tree = NULL;
1914 int old_offset = offset;
1917 wcc_attr_item = proto_tree_add_text(tree, NullTVB, offset,
1918 END_OF_FRAME, "%s", name);
1920 wcc_attr_tree = proto_item_add_subtree(wcc_attr_item, ett_nfs_wcc_attr);
1923 offset = dissect_size3 (pd, offset, fd, wcc_attr_tree, "size" );
1924 offset = dissect_nfstime3(pd, offset, fd, wcc_attr_tree, "mtime");
1925 offset = dissect_nfstime3(pd, offset, fd, wcc_attr_tree, "ctime");
1927 /* now we know, that wcc_attr_tree is shorter */
1928 if (wcc_attr_item) {
1929 proto_item_set_len(wcc_attr_item, offset - old_offset);
1936 /* RFC 1813, Page 24 */
1938 dissect_pre_op_attr(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
1940 proto_item* pre_op_attr_item = NULL;
1941 proto_tree* pre_op_attr_tree = NULL;
1942 int old_offset = offset;
1943 guint32 attributes_follow;
1946 pre_op_attr_item = proto_tree_add_text(tree, NullTVB, offset,
1947 END_OF_FRAME, "%s", name);
1948 if (pre_op_attr_item)
1949 pre_op_attr_tree = proto_item_add_subtree(pre_op_attr_item, ett_nfs_pre_op_attr);
1952 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
1953 attributes_follow = EXTRACT_UINT(pd, offset+0);
1954 proto_tree_add_text(pre_op_attr_tree, NullTVB, offset, 4,
1955 "attributes_follow: %s (%u)",
1956 val_to_str(attributes_follow,value_follows,"Unknown"), attributes_follow);
1958 switch (attributes_follow) {
1960 offset = dissect_wcc_attr(pd, offset, fd, pre_op_attr_tree,
1968 /* now we know, that pre_op_attr_tree is shorter */
1969 if (pre_op_attr_item) {
1970 proto_item_set_len(pre_op_attr_item, offset - old_offset);
1977 /* RFC 1813, Page 24 */
1979 dissect_wcc_data(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
1981 proto_item* wcc_data_item = NULL;
1982 proto_tree* wcc_data_tree = NULL;
1983 int old_offset = offset;
1986 wcc_data_item = proto_tree_add_text(tree, NullTVB, offset,
1987 END_OF_FRAME, "%s", name);
1989 wcc_data_tree = proto_item_add_subtree(wcc_data_item, ett_nfs_wcc_data);
1992 offset = dissect_pre_op_attr (pd, offset, fd, wcc_data_tree, "before");
1993 offset = dissect_post_op_attr(pd, offset, fd, wcc_data_tree, "after" );
1995 /* now we know, that wcc_data is shorter */
1996 if (wcc_data_item) {
1997 proto_item_set_len(wcc_data_item, offset - old_offset);
2004 /* RFC 1813, Page 25 */
2006 dissect_post_op_fh3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
2008 proto_item* post_op_fh3_item = NULL;
2009 proto_tree* post_op_fh3_tree = NULL;
2010 int old_offset = offset;
2011 guint32 handle_follows;
2014 post_op_fh3_item = proto_tree_add_text(tree, NullTVB, offset,
2015 END_OF_FRAME, "%s", name);
2016 if (post_op_fh3_item)
2017 post_op_fh3_tree = proto_item_add_subtree(post_op_fh3_item, ett_nfs_post_op_fh3);
2020 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
2021 handle_follows = EXTRACT_UINT(pd, offset+0);
2022 proto_tree_add_text(post_op_fh3_tree, NullTVB, offset, 4,
2023 "handle_follows: %s (%u)",
2024 val_to_str(handle_follows,value_follows,"Unknown"), handle_follows);
2026 switch (handle_follows) {
2028 offset = dissect_nfs_fh3(pd, offset, fd, post_op_fh3_tree,
2036 /* now we know, that post_op_fh3_tree is shorter */
2037 if (post_op_fh3_item) {
2038 proto_item_set_len(post_op_fh3_item, offset - old_offset);
2045 /* RFC 1813, Page 25 */
2047 dissect_set_mode3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
2049 proto_item* set_mode3_item = NULL;
2050 proto_tree* set_mode3_tree = NULL;
2051 int old_offset = offset;
2055 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
2056 set_it = EXTRACT_UINT(pd, offset+0);
2057 set_it_name = val_to_str(set_it,value_follows,"Unknown");
2060 set_mode3_item = proto_tree_add_text(tree, NullTVB, offset,
2061 END_OF_FRAME, "%s: %s", name, set_it_name);
2063 set_mode3_tree = proto_item_add_subtree(set_mode3_item, ett_nfs_set_mode3);
2067 proto_tree_add_text(set_mode3_tree, NullTVB, offset, 4,
2068 "set_it: %s (%u)", set_it_name, set_it);
2074 offset = dissect_mode3(pd, offset, fd, set_mode3_tree,
2082 /* now we know, that set_mode3 is shorter */
2083 if (set_mode3_item) {
2084 proto_item_set_len(set_mode3_item, offset - old_offset);
2091 /* RFC 1813, Page 26 */
2093 dissect_set_uid3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
2095 proto_item* set_uid3_item = NULL;
2096 proto_tree* set_uid3_tree = NULL;
2097 int old_offset = offset;
2101 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
2102 set_it = EXTRACT_UINT(pd, offset+0);
2103 set_it_name = val_to_str(set_it,value_follows,"Unknown");
2106 set_uid3_item = proto_tree_add_text(tree, NullTVB, offset,
2107 END_OF_FRAME, "%s: %s", name, set_it_name);
2109 set_uid3_tree = proto_item_add_subtree(set_uid3_item, ett_nfs_set_uid3);
2113 proto_tree_add_text(set_uid3_tree, NullTVB, offset, 4,
2114 "set_it: %s (%u)", set_it_name, set_it);
2120 offset = dissect_uid3(pd, offset, fd, set_uid3_tree,
2128 /* now we know, that set_uid3 is shorter */
2129 if (set_uid3_item) {
2130 proto_item_set_len(set_uid3_item, offset - old_offset);
2137 /* RFC 1813, Page 26 */
2139 dissect_set_gid3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
2141 proto_item* set_gid3_item = NULL;
2142 proto_tree* set_gid3_tree = NULL;
2143 int old_offset = offset;
2147 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
2148 set_it = EXTRACT_UINT(pd, offset+0);
2149 set_it_name = val_to_str(set_it,value_follows,"Unknown");
2152 set_gid3_item = proto_tree_add_text(tree, NullTVB, offset,
2153 END_OF_FRAME, "%s: %s", name, set_it_name);
2155 set_gid3_tree = proto_item_add_subtree(set_gid3_item, ett_nfs_set_gid3);
2159 proto_tree_add_text(set_gid3_tree, NullTVB, offset, 4,
2160 "set_it: %s (%u)", set_it_name, set_it);
2166 offset = dissect_gid3(pd, offset, fd, set_gid3_tree,
2174 /* now we know, that set_gid3 is shorter */
2175 if (set_gid3_item) {
2176 proto_item_set_len(set_gid3_item, offset - old_offset);
2183 /* RFC 1813, Page 26 */
2185 dissect_set_size3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
2187 proto_item* set_size3_item = NULL;
2188 proto_tree* set_size3_tree = NULL;
2189 int old_offset = offset;
2193 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
2194 set_it = EXTRACT_UINT(pd, offset+0);
2195 set_it_name = val_to_str(set_it,value_follows,"Unknown");
2198 set_size3_item = proto_tree_add_text(tree, NullTVB, offset,
2199 END_OF_FRAME, "%s: %s", name, set_it_name);
2201 set_size3_tree = proto_item_add_subtree(set_size3_item, ett_nfs_set_size3);
2205 proto_tree_add_text(set_size3_tree, NullTVB, offset, 4,
2206 "set_it: %s (%u)", set_it_name, set_it);
2212 offset = dissect_size3(pd, offset, fd, set_size3_tree,
2220 /* now we know, that set_size3 is shorter */
2221 if (set_size3_item) {
2222 proto_item_set_len(set_size3_item, offset - old_offset);
2229 /* RFC 1813, Page 25 */
2230 #define DONT_CHANGE 0
2231 #define SET_TO_SERVER_TIME 1
2232 #define SET_TO_CLIENT_TIME 2
2234 const value_string time_how[] =
2236 { DONT_CHANGE, "don't change" },
2237 { SET_TO_SERVER_TIME, "set to server time" },
2238 { SET_TO_CLIENT_TIME, "set to client time" },
2243 /* RFC 1813, Page 26 */
2245 dissect_set_atime(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
2247 proto_item* set_atime_item = NULL;
2248 proto_tree* set_atime_tree = NULL;
2249 int old_offset = offset;
2253 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
2254 set_it = EXTRACT_UINT(pd, offset+0);
2255 set_it_name = val_to_str(set_it,time_how,"Unknown");
2258 set_atime_item = proto_tree_add_text(tree, NullTVB, offset,
2259 END_OF_FRAME, "%s: %s",
2262 set_atime_tree = proto_item_add_subtree(set_atime_item, ett_nfs_set_atime);
2266 proto_tree_add_text(set_atime_tree, NullTVB, offset, 4,
2267 "set_it: %s (%u)", set_it_name, set_it);
2272 case SET_TO_CLIENT_TIME:
2274 offset = dissect_nfstime3(pd, offset, fd, set_atime_tree,
2282 /* now we know, that set_atime is shorter */
2283 if (set_atime_item) {
2284 proto_item_set_len(set_atime_item, offset - old_offset);
2291 /* RFC 1813, Page 26 */
2293 dissect_set_mtime(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
2295 proto_item* set_mtime_item = NULL;
2296 proto_tree* set_mtime_tree = NULL;
2297 int old_offset = offset;
2301 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
2302 set_it = EXTRACT_UINT(pd, offset+0);
2303 set_it_name = val_to_str(set_it,time_how,"Unknown");
2306 set_mtime_item = proto_tree_add_text(tree, NullTVB, offset,
2307 END_OF_FRAME, "%s: %s",
2310 set_mtime_tree = proto_item_add_subtree(set_mtime_item, ett_nfs_set_mtime);
2314 proto_tree_add_text(set_mtime_tree, NullTVB, offset, 4,
2315 "set_it: %s (%u)", set_it_name, set_it);
2320 case SET_TO_CLIENT_TIME:
2322 offset = dissect_nfstime3(pd, offset, fd, set_mtime_tree,
2330 /* now we know, that set_mtime is shorter */
2331 if (set_mtime_item) {
2332 proto_item_set_len(set_mtime_item, offset - old_offset);
2339 /* RFC 1813, Page 25..27 */
2341 dissect_sattr3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
2343 proto_item* sattr3_item = NULL;
2344 proto_tree* sattr3_tree = NULL;
2345 int old_offset = offset;
2348 sattr3_item = proto_tree_add_text(tree, NullTVB, offset,
2349 END_OF_FRAME, "%s", name);
2351 sattr3_tree = proto_item_add_subtree(sattr3_item, ett_nfs_sattr3);
2354 offset = dissect_set_mode3(pd, offset, fd, sattr3_tree, "mode");
2355 offset = dissect_set_uid3 (pd, offset, fd, sattr3_tree, "uid");
2356 offset = dissect_set_gid3 (pd, offset, fd, sattr3_tree, "gid");
2357 offset = dissect_set_size3(pd, offset, fd, sattr3_tree, "size");
2358 offset = dissect_set_atime(pd, offset, fd, sattr3_tree, "atime");
2359 offset = dissect_set_mtime(pd, offset, fd, sattr3_tree, "mtime");
2361 /* now we know, that sattr3 is shorter */
2363 proto_item_set_len(sattr3_item, offset - old_offset);
2370 /* RFC 1813, Page 27 */
2372 dissect_diropargs3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
2374 proto_item* diropargs3_item = NULL;
2375 proto_tree* diropargs3_tree = NULL;
2376 int old_offset = offset;
2379 diropargs3_item = proto_tree_add_text(tree, NullTVB, offset,
2380 END_OF_FRAME, "%s", name);
2381 if (diropargs3_item)
2382 diropargs3_tree = proto_item_add_subtree(diropargs3_item, ett_nfs_diropargs3);
2385 offset = dissect_nfs_fh3 (pd, offset, fd, diropargs3_tree, "dir");
2386 offset = dissect_filename3(pd, offset, fd, diropargs3_tree, hf_nfs_name,NULL);
2388 /* now we know, that diropargs3 is shorter */
2389 if (diropargs3_item) {
2390 proto_item_set_len(diropargs3_item, offset - old_offset);
2397 /* RFC 1813, Page 27 */
2399 dissect_nfs3_diropargs3_call(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
2401 offset = dissect_diropargs3(pd, offset, fd, tree, "object");
2407 /* RFC 1813, Page 40 */
2409 dissect_access(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
2412 proto_item* access_item = NULL;
2413 proto_tree* access_tree = NULL;
2415 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
2416 access = EXTRACT_UINT(pd, offset+0);
2419 access_item = proto_tree_add_text(tree, NullTVB, offset, 4,
2420 "%s: 0x%02x", name, access);
2422 access_tree = proto_item_add_subtree(access_item, ett_nfs_access);
2426 proto_tree_add_text(access_tree, NullTVB, offset, 4, "%s READ",
2427 decode_boolean_bitfield(access, 0x001, 6, "allow", "not allow"));
2428 proto_tree_add_text(access_tree, NullTVB, offset, 4, "%s LOOKUP",
2429 decode_boolean_bitfield(access, 0x002, 6, "allow", "not allow"));
2430 proto_tree_add_text(access_tree, NullTVB, offset, 4, "%s MODIFY",
2431 decode_boolean_bitfield(access, 0x004, 6, "allow", "not allow"));
2432 proto_tree_add_text(access_tree, NullTVB, offset, 4, "%s EXTEND",
2433 decode_boolean_bitfield(access, 0x008, 6, "allow", "not allow"));
2434 proto_tree_add_text(access_tree, NullTVB, offset, 4, "%s DELETE",
2435 decode_boolean_bitfield(access, 0x010, 6, "allow", "not allow"));
2436 proto_tree_add_text(access_tree, NullTVB, offset, 4, "%s EXECUTE",
2437 decode_boolean_bitfield(access, 0x020, 6, "allow", "not allow"));
2445 /* NFS3 file handle dissector */
2447 dissect_nfs3_nfs_fh3_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2449 offset = dissect_nfs_fh3(pd, offset, fd, tree, "object");
2454 /* generic NFS3 reply dissector */
2456 dissect_nfs3_any_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2460 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
2467 /* RFC 1813, Page 32,33 */
2469 dissect_nfs3_getattr_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2471 offset = dissect_nfs_fh3(pd, offset, fd, tree, "object");
2476 /* RFC 1813, Page 32,33 */
2478 dissect_nfs3_getattr_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2482 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
2485 offset = dissect_fattr3(pd, offset, fd, tree, "obj_attributes");
2496 /* RFC 1813, Page 33 */
2498 dissect_sattrguard3(const u_char* pd, int offset, frame_data* fd, proto_tree* tree, char *name)
2500 proto_item* sattrguard3_item = NULL;
2501 proto_tree* sattrguard3_tree = NULL;
2502 int old_offset = offset;
2506 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
2507 check = EXTRACT_UINT(pd, offset+0);
2508 check_name = val_to_str(check,value_follows,"Unknown");
2511 sattrguard3_item = proto_tree_add_text(tree, NullTVB, offset,
2512 END_OF_FRAME, "%s: %s", name, check_name);
2513 if (sattrguard3_item)
2514 sattrguard3_tree = proto_item_add_subtree(sattrguard3_item, ett_nfs_sattrguard3);
2517 if (sattrguard3_tree)
2518 proto_tree_add_text(sattrguard3_tree, NullTVB, offset, 4,
2519 "check: %s (%u)", check_name, check);
2525 offset = dissect_nfstime3(pd, offset, fd, sattrguard3_tree,
2533 /* now we know, that sattrguard3 is shorter */
2534 if (sattrguard3_item) {
2535 proto_item_set_len(sattrguard3_item, offset - old_offset);
2542 /* RFC 1813, Page 33..36 */
2544 dissect_nfs3_setattr_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2546 offset = dissect_nfs_fh3 (pd, offset, fd, tree, "object");
2547 offset = dissect_sattr3 (pd, offset, fd, tree, "new_attributes");
2548 offset = dissect_sattrguard3(pd, offset, fd, tree, "guard");
2553 /* RFC 1813, Page 33..36 */
2555 dissect_nfs3_setattr_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2559 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
2562 offset = dissect_wcc_data(pd, offset, fd, tree, "obj_wcc");
2565 offset = dissect_wcc_data(pd, offset, fd, tree, "obj_wcc");
2573 /* RFC 1813, Page 37..39 */
2575 dissect_nfs3_lookup_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2577 offset = dissect_diropargs3 (pd, offset, fd, tree, "what");
2582 /* RFC 1813, Page 37..39 */
2584 dissect_nfs3_lookup_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2588 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
2591 offset = dissect_nfs_fh3 (pd, offset, fd, tree, "object");
2592 offset = dissect_post_op_attr(pd, offset, fd, tree, "obj_attributes");
2593 offset = dissect_post_op_attr(pd, offset, fd, tree, "dir_attributes");
2596 offset = dissect_post_op_attr(pd, offset, fd, tree, "dir_attributes");
2604 /* RFC 1813, Page 40..43 */
2606 dissect_nfs3_access_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2608 offset = dissect_nfs_fh3(pd, offset, fd, tree, "object");
2609 offset = dissect_access (pd, offset, fd, tree, "access");
2615 /* RFC 1813, Page 40..43 */
2617 dissect_nfs3_access_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2621 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
2624 offset = dissect_post_op_attr(pd, offset, fd, tree, "obj_attributes");
2625 offset = dissect_access (pd, offset, fd, tree, "access");
2628 offset = dissect_post_op_attr(pd, offset, fd, tree, "obj_attributes");
2636 /* RFC 1813, Page 44,45 */
2638 dissect_nfs3_readlink_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2642 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
2645 offset = dissect_post_op_attr(pd, offset, fd, tree, "symlink_attributes");
2646 offset = dissect_nfspath3 (pd, offset, fd, tree, hf_nfs_readlink_data);
2649 offset = dissect_post_op_attr(pd, offset, fd, tree, "symlink_attributes");
2657 /* RFC 1813, Page 46..48 */
2659 dissect_nfs3_read_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2661 offset = dissect_nfs_fh3(pd, offset, fd, tree, "file");
2662 offset = dissect_offset3(pd, offset, fd, tree, "offset");
2663 offset = dissect_count3 (pd, offset, fd, tree, "count");
2669 /* RFC 1813, Page 46..48 */
2671 dissect_nfs3_read_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2675 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
2678 offset = dissect_post_op_attr(pd, offset, fd, tree, "file_attributes");
2679 offset = dissect_count3 (pd, offset, fd, tree, "count");
2680 offset = dissect_rpc_bool (pd, offset, fd, tree, hf_nfs_read_eof);
2681 offset = dissect_nfsdata (pd, offset, fd, tree, hf_nfs_data);
2684 offset = dissect_post_op_attr(pd, offset, fd, tree, "file_attributes");
2692 /* RFC 1813, Page 49 */
2693 static const value_string names_stable_how[] = {
2694 { UNSTABLE, "UNSTABLE" },
2695 { DATA_SYNC, "DATA_SYNC" },
2696 { FILE_SYNC, "FILE_SYNC" },
2701 /* RFC 1813, Page 49 */
2703 dissect_stable_how(const u_char* pd, int offset, frame_data* fd, proto_tree* tree, int hfindex)
2707 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
2708 stable_how = EXTRACT_UINT(pd,offset+0);
2710 proto_tree_add_uint(tree, hfindex, NullTVB,
2711 offset, 4, stable_how);
2719 /* RFC 1813, Page 49..54 */
2721 dissect_nfs3_write_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2723 offset = dissect_nfs_fh3 (pd, offset, fd, tree, "file");
2724 offset = dissect_offset3 (pd, offset, fd, tree, "offset");
2725 offset = dissect_count3 (pd, offset, fd, tree, "count");
2726 offset = dissect_stable_how(pd, offset, fd, tree, hf_nfs_write_stable);
2727 offset = dissect_nfsdata (pd, offset, fd, tree, hf_nfs_data);
2733 /* RFC 1813, Page 49..54 */
2735 dissect_nfs3_write_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2739 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
2742 offset = dissect_wcc_data (pd, offset, fd, tree, "file_wcc");
2743 offset = dissect_count3 (pd, offset, fd, tree, "count");
2744 offset = dissect_stable_how(pd, offset, fd, tree, hf_nfs_write_committed);
2745 offset = dissect_writeverf3(pd, offset, fd, tree);
2748 offset = dissect_wcc_data(pd, offset, fd, tree, "file_wcc");
2756 /* RFC 1813, Page 54 */
2757 static const value_string names_createmode3[] = {
2758 { UNCHECKED, "UNCHECKED" },
2759 { GUARDED, "GUARDED" },
2760 { EXCLUSIVE, "EXCLUSIVE" },
2765 /* RFC 1813, Page 54 */
2767 dissect_createmode3(const u_char* pd, int offset, frame_data* fd, proto_tree* tree, guint32* mode)
2771 if (!BYTES_ARE_IN_FRAME(offset, 4)) return offset;
2772 mode_value = EXTRACT_UINT(pd, offset + 0);
2774 proto_tree_add_uint(tree, hf_nfs_createmode3, NullTVB,
2775 offset+0, 4, mode_value);
2784 /* RFC 1813, Page 54..58 */
2786 dissect_nfs3_create_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2790 offset = dissect_diropargs3 (pd, offset, fd, tree, "where");
2791 offset = dissect_createmode3(pd, offset, fd, tree, &mode);
2795 offset = dissect_sattr3 (pd, offset, fd, tree, "obj_attributes");
2798 offset = dissect_createverf3(pd, offset, fd, tree);
2806 /* RFC 1813, Page 54..58 */
2808 dissect_nfs3_create_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2812 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
2815 offset = dissect_post_op_fh3 (pd, offset, fd, tree, "obj");
2816 offset = dissect_post_op_attr(pd, offset, fd, tree, "obj_attributes");
2817 offset = dissect_wcc_data (pd, offset, fd, tree, "dir_wcc");
2820 offset = dissect_wcc_data (pd, offset, fd, tree, "dir_wcc");
2828 /* RFC 1813, Page 58..60 */
2830 dissect_nfs3_mkdir_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2832 offset = dissect_diropargs3(pd, offset, fd, tree, "where");
2833 offset = dissect_sattr3 (pd, offset, fd, tree, "attributes");
2839 /* RFC 1813, Page 61..63 */
2841 dissect_nfs3_symlink_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2843 offset = dissect_diropargs3(pd, offset, fd, tree, "where");
2844 offset = dissect_sattr3 (pd, offset, fd, tree, "symlink_attributes");
2845 offset = dissect_nfspath3 (pd, offset, fd, tree, hf_nfs_symlink_to);
2851 /* RFC 1813, Page 63..66 */
2853 dissect_nfs3_mknod_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2857 offset = dissect_diropargs3(pd, offset, fd, tree, "where");
2858 offset = dissect_ftype3(pd, offset, fd, tree, hf_nfs_ftype3, &type);
2862 offset = dissect_sattr3(pd, offset, fd, tree, "dev_attributes");
2863 offset = dissect_specdata3(pd, offset, fd, tree, "spec");
2867 offset = dissect_sattr3(pd, offset, fd, tree, "pipe_attributes");
2878 /* RFC 1813, Page 67..69 */
2880 dissect_nfs3_remove_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2884 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
2887 offset = dissect_wcc_data (pd, offset, fd, tree, "dir_wcc");
2890 offset = dissect_wcc_data (pd, offset, fd, tree, "dir_wcc");
2898 /* RFC 1813, Page 71..74 */
2900 dissect_nfs3_rename_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2902 offset = dissect_diropargs3(pd, offset, fd, tree, "from");
2903 offset = dissect_diropargs3(pd, offset, fd, tree, "to");
2909 /* RFC 1813, Page 71..74 */
2911 dissect_nfs3_rename_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2915 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
2918 offset = dissect_wcc_data(pd, offset, fd, tree, "fromdir_wcc");
2919 offset = dissect_wcc_data(pd, offset, fd, tree, "todir_wcc");
2922 offset = dissect_wcc_data(pd, offset, fd, tree, "fromdir_wcc");
2923 offset = dissect_wcc_data(pd, offset, fd, tree, "todir_wcc");
2931 /* RFC 1813, Page 74..76 */
2933 dissect_nfs3_link_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2935 offset = dissect_nfs_fh3 (pd, offset, fd, tree, "file");
2936 offset = dissect_diropargs3(pd, offset, fd, tree, "link");
2942 /* RFC 1813, Page 74..76 */
2944 dissect_nfs3_link_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2948 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
2951 offset = dissect_post_op_attr(pd, offset, fd, tree, "file_attributes");
2952 offset = dissect_wcc_data (pd, offset, fd, tree, "linkdir_wcc");
2955 offset = dissect_post_op_attr(pd, offset, fd, tree, "file_attributes");
2956 offset = dissect_wcc_data (pd, offset, fd, tree, "linkdir_wcc");
2964 /* RFC 1813, Page 76..80 */
2966 dissect_nfs3_readdir_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2968 offset = dissect_nfs_fh3 (pd, offset, fd, tree, "dir");
2969 offset = dissect_cookie3 (pd, offset, fd, tree, "cookie");
2970 offset = dissect_cookieverf3(pd, offset, fd, tree);
2971 offset = dissect_count3 (pd, offset, fd, tree, "count");
2977 /* RFC 1813, Page 76..80 */
2979 dissect_entry3(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2981 proto_item* entry_item = NULL;
2982 proto_tree* entry_tree = NULL;
2983 int old_offset = offset;
2987 entry_item = proto_tree_add_item(tree, hf_nfs_readdir_entry, NullTVB,
2988 offset+0, END_OF_FRAME, FALSE);
2990 entry_tree = proto_item_add_subtree(entry_item, ett_nfs_readdir_entry);
2993 offset = dissect_fileid3(pd, offset, fd, entry_tree, "fileid");
2995 offset = dissect_filename3(pd, offset, fd, entry_tree,
2996 hf_nfs_readdir_entry_name, &name);
2998 proto_item_set_text(entry_item, "Entry: name %s", name);
3001 offset = dissect_cookie3(pd, offset, fd, entry_tree, "cookie");
3003 /* now we know, that a readdir entry is shorter */
3005 proto_item_set_len(entry_item, offset - old_offset);
3012 /* RFC 1813, Page 76..80 */
3014 dissect_nfs3_readdir_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
3019 offset = dissect_stat(pd, offset, fd, tree, &status);
3022 offset = dissect_post_op_attr(pd, offset, fd, tree, "dir_attributes");
3023 offset = dissect_cookieverf3(pd, offset, fd, tree);
3024 offset = dissect_rpc_list(pd, offset, fd, tree,
3026 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
3027 eof_value = EXTRACT_UINT(pd, offset+0);
3029 proto_tree_add_uint(tree, hf_nfs_readdir_eof, NullTVB,
3030 offset+ 0, 4, eof_value);
3034 offset = dissect_post_op_attr(pd, offset, fd, tree, "dir_attributes");
3042 /* RFC 1813, Page 80..83 */
3044 dissect_nfs3_readdirplus_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
3046 offset = dissect_nfs_fh3 (pd, offset, fd, tree, "dir");
3047 offset = dissect_cookie3 (pd, offset, fd, tree, "cookie");
3048 offset = dissect_cookieverf3(pd, offset, fd, tree);
3049 offset = dissect_count3 (pd, offset, fd, tree, "dircount");
3050 offset = dissect_count3 (pd, offset, fd, tree, "maxcount");
3056 /* RFC 1813, Page 80..83 */
3058 dissect_entryplus3(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
3060 proto_item* entry_item = NULL;
3061 proto_tree* entry_tree = NULL;
3062 int old_offset = offset;
3066 entry_item = proto_tree_add_item(tree, hf_nfs_readdir_entry, NullTVB,
3067 offset+0, END_OF_FRAME, FALSE);
3069 entry_tree = proto_item_add_subtree(entry_item, ett_nfs_readdir_entry);
3072 offset = dissect_fileid3(pd, offset, fd, entry_tree, "fileid");
3074 offset = dissect_filename3(pd, offset, fd, entry_tree,
3075 hf_nfs_readdirplus_entry_name, &name);
3077 proto_item_set_text(entry_item, "Entry: name %s", name);
3080 offset = dissect_cookie3(pd, offset, fd, entry_tree, "cookie");
3082 offset = dissect_post_op_attr(pd, offset, fd, entry_tree, "name_attributes");
3083 offset = dissect_post_op_fh3(pd, offset, fd, entry_tree, "name_handle");
3085 /* now we know, that a readdirplus entry is shorter */
3087 proto_item_set_len(entry_item, offset - old_offset);
3094 /* RFC 1813, Page 80..83 */
3096 dissect_nfs3_readdirplus_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
3101 offset = dissect_stat(pd, offset, fd, tree, &status);
3104 offset = dissect_post_op_attr(pd, offset, fd, tree, "dir_attributes");
3105 offset = dissect_cookieverf3(pd, offset, fd, tree);
3106 offset = dissect_rpc_list(pd, offset, fd, tree,
3107 dissect_entryplus3);
3108 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
3109 eof_value = EXTRACT_UINT(pd, offset+0);
3111 proto_tree_add_uint(tree, hf_nfs_readdir_eof, NullTVB,
3112 offset+ 0, 4, eof_value);
3116 offset = dissect_post_op_attr(pd, offset, fd, tree, "dir_attributes");
3124 /* RFC 1813, Page 84..86 */
3126 dissect_nfs3_fsstat_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
3131 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
3134 offset = dissect_post_op_attr(pd, offset, fd, tree, "obj_attributes");
3135 offset = dissect_size3 (pd, offset, fd, tree, "tbytes");
3136 offset = dissect_size3 (pd, offset, fd, tree, "fbytes");
3137 offset = dissect_size3 (pd, offset, fd, tree, "abytes");
3138 offset = dissect_size3 (pd, offset, fd, tree, "tfiles");
3139 offset = dissect_size3 (pd, offset, fd, tree, "ffiles");
3140 offset = dissect_size3 (pd, offset, fd, tree, "afiles");
3141 if (!BYTES_ARE_IN_FRAME(offset, 4)) return offset;
3142 invarsec = EXTRACT_UINT(pd, offset + 0);
3144 proto_tree_add_uint(tree, hf_nfs_fsstat_invarsec, NullTVB,
3145 offset+0, 4, invarsec);
3149 offset = dissect_post_op_attr(pd, offset, fd, tree, "obj_attributes");
3157 #define FSF3_LINK 0x0001
3158 #define FSF3_SYMLINK 0x0002
3159 #define FSF3_HOMOGENEOUS 0x0008
3160 #define FSF3_CANSETTIME 0x0010
3163 /* RFC 1813, Page 86..90 */
3165 dissect_nfs3_fsinfo_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
3176 proto_item* properties_item = NULL;
3177 proto_tree* properties_tree = NULL;
3179 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
3182 offset = dissect_post_op_attr(pd, offset, fd, tree, "obj_attributes");
3183 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
3184 rtmax = EXTRACT_UINT(pd, offset+0);
3186 proto_tree_add_uint(tree, hf_nfs_fsinfo_rtmax, NullTVB,
3187 offset+0, 4, rtmax);
3189 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
3190 rtpref = EXTRACT_UINT(pd, offset+0);
3192 proto_tree_add_uint(tree, hf_nfs_fsinfo_rtpref, NullTVB,
3193 offset+0, 4, rtpref);
3195 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
3196 rtmult = EXTRACT_UINT(pd, offset+0);
3198 proto_tree_add_uint(tree, hf_nfs_fsinfo_rtmult, NullTVB,
3199 offset+0, 4, rtmult);
3201 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
3202 wtmax = EXTRACT_UINT(pd, offset+0);
3204 proto_tree_add_uint(tree, hf_nfs_fsinfo_wtmax, NullTVB,
3205 offset+0, 4, wtmax);
3207 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
3208 wtpref = EXTRACT_UINT(pd, offset+0);
3210 proto_tree_add_uint(tree, hf_nfs_fsinfo_wtpref, NullTVB,
3211 offset+0, 4, wtpref);
3213 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
3214 wtmult = EXTRACT_UINT(pd, offset+0);
3216 proto_tree_add_uint(tree, hf_nfs_fsinfo_wtmult, NullTVB,
3217 offset+0, 4, wtmult);
3219 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
3220 dtpref = EXTRACT_UINT(pd, offset+0);
3222 proto_tree_add_uint(tree, hf_nfs_fsinfo_dtpref, NullTVB,
3223 offset+0, 4, dtpref);
3226 offset = dissect_size3 (pd, offset, fd, tree, "maxfilesize");
3227 offset = dissect_nfstime3(pd, offset, fd, tree, "time_delta");
3228 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
3229 properties = EXTRACT_UINT(pd, offset+0);
3231 properties_item = proto_tree_add_uint(tree,
3232 hf_nfs_fsinfo_properties,
3233 NullTVB, offset+0, 4, properties);
3234 if (properties_item)
3235 properties_tree = proto_item_add_subtree(properties_item, ett_nfs_fsinfo_properties);
3236 if (properties_tree) {
3237 proto_tree_add_text(properties_tree, NullTVB,
3239 decode_boolean_bitfield(properties,
3241 "SETATTR can set time on server",
3242 "SETATTR can't set time on server"));
3244 proto_tree_add_text(properties_tree, NullTVB,
3246 decode_boolean_bitfield(properties,
3248 "PATHCONF is valid for all files",
3249 "PATHCONF should be get for every single file"));
3251 proto_tree_add_text(properties_tree, NullTVB,
3253 decode_boolean_bitfield(properties,
3255 "File System supports symbolic links",
3256 "File System does not symbolic hard links"));
3258 proto_tree_add_text(properties_tree, NullTVB,
3260 decode_boolean_bitfield(properties,
3262 "File System supports hard links",
3263 "File System does not support hard links"));
3269 offset = dissect_post_op_attr(pd, offset, fd, tree, "obj_attributes");
3277 /* RFC 1813, Page 90..92 */
3279 dissect_nfs3_pathconf_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
3285 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
3288 offset = dissect_post_op_attr(pd, offset, fd, tree, "obj_attributes");
3289 if (!BYTES_ARE_IN_FRAME(offset, 4)) return offset;
3290 linkmax = EXTRACT_UINT(pd, offset + 0);
3292 proto_tree_add_uint(tree, hf_nfs_pathconf_linkmax, NullTVB,
3293 offset+0, 4, linkmax);
3295 if (!BYTES_ARE_IN_FRAME(offset, 4)) return offset;
3296 name_max = EXTRACT_UINT(pd, offset + 0);
3298 proto_tree_add_uint(tree, hf_nfs_pathconf_name_max, NullTVB,
3299 offset+0, 4, name_max);
3301 offset = dissect_rpc_bool(pd, offset, fd, tree, hf_nfs_pathconf_no_trunc);
3302 offset = dissect_rpc_bool(pd, offset, fd, tree, hf_nfs_pathconf_chown_restricted);
3303 offset = dissect_rpc_bool(pd, offset, fd, tree, hf_nfs_pathconf_case_insensitive);
3304 offset = dissect_rpc_bool(pd, offset, fd, tree, hf_nfs_pathconf_case_preserving);
3307 offset = dissect_post_op_attr(pd, offset, fd, tree, "obj_attributes");
3315 /* RFC 1813, Page 92..95 */
3317 dissect_nfs3_commit_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
3319 offset = dissect_nfs_fh3(pd, offset, fd, tree, "file");
3320 offset = dissect_offset3(pd, offset, fd, tree, "offset");
3321 offset = dissect_count3 (pd, offset, fd, tree, "count");
3327 /* RFC 1813, Page 92..95 */
3329 dissect_nfs3_commit_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
3333 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
3336 offset = dissect_wcc_data (pd, offset, fd, tree, "file_wcc");
3337 offset = dissect_writeverf3(pd, offset, fd, tree);
3340 offset = dissect_wcc_data(pd, offset, fd, tree, "file_wcc");
3347 /* 1 missing functions */
3349 /* NFS Version 4 Protocol Draft Specification 07 */
3352 dissect_nfs_utf8string(const u_char *pd, int offset, frame_data *fd,
3353 proto_tree *tree, int hf, char **string_ret)
3355 /* TODO: this needs to be fixed */
3356 return dissect_rpc_string(pd, offset, fd, tree, hf, string_ret);
3360 dissect_nfs_seqid4(const u_char *pd, int offset, frame_data *fd,
3361 proto_tree *tree, char *name)
3363 return dissect_rpc_uint32(pd, offset, fd, tree, name);
3367 dissect_nfs_stateid4(const u_char *pd, int offset, frame_data *fd,
3368 proto_tree *tree, char *name)
3370 return dissect_rpc_uint64(pd, offset, fd, tree, name);
3374 dissect_nfs_offset4(const u_char *pd, int offset, frame_data *fd,
3375 proto_tree *tree, char *name)
3377 return dissect_rpc_uint64(pd, offset, fd, tree, name);
3381 dissect_nfs_count4(const u_char *pd, int offset, frame_data *fd,
3382 proto_tree *tree, char *name)
3384 return dissect_rpc_uint32(pd, offset, fd, tree, name);
3388 dissect_nfs_type4(const u_char *pd, int offset, frame_data *fd,
3389 proto_tree *tree, char *name)
3391 return dissect_rpc_uint32(pd, offset, fd, tree, name);
3395 dissect_nfs_linktext4(const u_char *pd, int offset, frame_data *fd,
3396 proto_tree *tree, char *name)
3398 return dissect_nfs_utf8string(pd, offset, fd, tree, hf_nfs_linktext4, NULL);
3402 dissect_nfs_specdata4(const u_char *pd, int offset, frame_data *fd,
3403 proto_tree *tree, char *name)
3405 offset = dissect_rpc_uint32(pd, offset, fd, tree, "specdata1");
3406 offset = dissect_rpc_uint32(pd, offset, fd, tree, "specdata2");
3412 dissect_nfs_clientid4(const u_char *pd, int offset, frame_data *fd,
3413 proto_tree *tree, char *name)
3415 return dissect_rpc_uint64(pd, offset, fd, tree, name);
3419 dissect_nfs_client_id4(const u_char *pd, int offset, frame_data *fd,
3420 proto_tree *tree, char *name)
3422 offset = dissect_nfs_clientid4(pd, offset, fd, tree, "Verifier");
3423 offset = dissect_nfsdata(pd, offset, fd, tree, hf_nfs_data);
3428 static const value_string names_ftype4[] = {
3429 { NF4LNK, "NF4LNK" },
3430 { NF4BLK, "NF4BLK" },
3431 { NF4CHR, "NF4CHR" },
3432 { NF4SOCK, "NF4SOCK" },
3433 { NF4FIFO, "NF4FIFO" },
3434 { NF4DIR, "NF4DIR" },
3439 dissect_nfs_ftype4(const u_char *pd, int offset, frame_data *fd,
3440 proto_tree *tree, char *name)
3444 ftype4 = EXTRACT_UINT(pd, offset);
3445 proto_tree_add_uint(tree, hf_nfs_ftype4, NullTVB, offset, 4, ftype4);
3452 dissect_nfs_component4(const u_char *pd, int offset, frame_data *fd,
3453 proto_tree *tree, char *name)
3455 return dissect_nfs_utf8string(pd, offset, fd, tree, hf_nfs_component4,
3460 dissect_nfs_lock_type4(const u_char *pd, int offset, frame_data *fd,
3461 proto_tree *tree, char *name)
3463 return dissect_rpc_uint32(pd, offset, fd, tree, name);
3467 dissect_nfs_reclaim4(const u_char *pd, int offset, frame_data *fd,
3468 proto_tree *tree, char *name)
3470 return dissect_rpc_uint32(pd, offset, fd, tree, name);
3474 dissect_nfs_length4(const u_char *pd, int offset, frame_data *fd,
3475 proto_tree *tree, char *name)
3477 return dissect_rpc_uint64(pd, offset, fd, tree, name);
3481 dissect_nfs_opaque4(const u_char *pd, int offset, frame_data *fd,
3482 proto_tree *tree, char *name);
3485 dissect_nfs_lockowner4(const u_char *pd, int offset, frame_data *fd,
3486 proto_tree *tree, char *name)
3488 proto_tree *newftree = NULL;
3489 proto_item *fitem = NULL;
3491 fitem = proto_tree_add_text(tree, NullTVB, offset, 4, "Owner");
3494 newftree = proto_item_add_subtree(fitem, ett_nfs_lockowner4);
3497 offset = dissect_rpc_uint64(pd, offset, fd, newftree, "Client ID");
3498 offset = dissect_nfs_opaque4(pd, offset, fd, newftree, "Owner");
3506 dissect_nfs_pathname4(const u_char *pd, int offset, frame_data *fd,
3507 proto_tree *tree, char *name)
3509 guint comp_count, i;
3510 proto_item *fitem = NULL;
3511 proto_tree *newftree = NULL;
3513 comp_count=EXTRACT_UINT(pd, offset);
3514 fitem = proto_tree_add_text(tree, NullTVB, offset, 4,
3515 "pathname components (%d)", comp_count);
3519 newftree = proto_item_add_subtree(fitem, ett_nfs_pathname4);
3522 for (i=0; i<comp_count; i++)
3523 offset=dissect_nfs_component4(pd, offset, fd, newftree, "comp");
3531 dissect_nfs_bitmap4(const u_char *pd, int offset, frame_data *fd,
3532 proto_tree *tree, char *name);
3535 dissect_nfs_fattr4(const u_char *pd, int offset, frame_data *fd,
3536 proto_tree *tree, char *name)
3538 offset = dissect_nfs_bitmap4(pd, offset, fd, tree, "attrmask");
3539 offset = dissect_nfs_opaque4(pd, offset, fd, tree, "attr_vals");
3545 dissect_nfs_open_claim_delegate_cur4(const u_char *pd, int offset,
3546 frame_data *fd, proto_tree *tree, char *name)
3548 offset = dissect_nfs_pathname4(pd, offset, fd, tree, "file");
3549 offset = dissect_nfs_stateid4(pd, offset, fd, tree, "delegate_stateid");
3553 #define CLAIM_NULL 0
3554 #define CLAIM_PREVIOUS 1
3555 #define CLAIM_DELEGATE_CUR 2
3556 #define CLAIM_DELEGATE_PREV 3
3558 static const value_string names_claim_type4[] = {
3559 { CLAIM_NULL, "CLAIM_NULL" },
3560 { CLAIM_PREVIOUS, "CLAIM_PREVIOUS" },
3561 { CLAIM_DELEGATE_CUR, "CLAIM_DELEGATE_CUR" },
3562 { CLAIM_DELEGATE_PREV, "CLAIM_DELEGATE_PREV" },
3567 dissect_nfs_open_claim4(const u_char *pd, int offset, frame_data *fd,
3568 proto_tree *tree, char *name)
3570 guint open_claim_type4;
3571 proto_item *fitem = NULL;
3572 proto_tree *newftree = NULL;
3574 open_claim_type4 = EXTRACT_UINT(pd, offset);
3575 fitem = proto_tree_add_uint(tree, hf_nfs_open_claim_type4, NullTVB,
3576 offset+0, 4, open_claim_type4);
3580 newftree = proto_item_add_subtree(fitem, ett_nfs_open_claim4);
3584 switch(open_claim_type4)
3587 offset = dissect_nfs_pathname4(pd, offset, fd, newftree, "file");
3590 case CLAIM_PREVIOUS:
3591 offset = dissect_rpc_uint32(pd, offset, fd, newftree,
3595 case CLAIM_DELEGATE_CUR:
3596 offset = dissect_nfs_open_claim_delegate_cur4(pd, offset, fd,
3597 newftree, "delegate_cur_info");
3600 case CLAIM_DELEGATE_PREV:
3601 offset = dissect_nfs_pathname4(pd, offset, fd, newftree,
3602 "file_delegate_prev");
3615 dissect_nfs_verifier4(const u_char *pd, int offset, frame_data *fd,
3616 proto_tree *tree, char *name);
3619 dissect_nfs_createhow4(const u_char *pd, int offset, frame_data *fd,
3620 proto_tree *tree, char *name)
3624 /* This is intentional; we're using the same flags as NFSv3 */
3625 mode = EXTRACT_UINT(pd, offset);
3626 proto_tree_add_uint(tree, hf_nfs_createmode3, NullTVB, offset, 4, mode);
3631 case UNCHECKED: /* UNCHECKED4 */
3632 case GUARDED: /* GUARDED4 */
3633 offset = dissect_nfs_fattr4(pd, offset, fd, tree, "createattrs");
3636 case EXCLUSIVE: /* EXCLUSIVE4 */
3637 offset = dissect_nfs_verifier4(pd, offset, fd, tree, "createverf");
3647 #define OPEN4_NOCREATE 0
3648 #define OPEN4_CREATE 1
3649 static const value_string names_opentype4[] = {
3650 { OPEN4_NOCREATE, "OPEN4_NOCREATE" },
3651 { OPEN4_CREATE, "OPEN4_CREATE" },
3656 dissect_nfs_openflag4(const u_char *pd, int offset, frame_data *fd,
3660 proto_item *fitem = NULL;
3661 proto_tree *newftree = NULL;
3663 opentype4 = EXTRACT_UINT(pd, offset);
3664 fitem = proto_tree_add_uint(tree, hf_nfs_opentype4, NullTVB,
3665 offset+0, 4, opentype4);
3669 newftree = proto_item_add_subtree(fitem, ett_nfs_opentype4);
3676 offset = dissect_nfs_createhow4(pd, offset, fd, newftree, "how");
3689 dissect_nfs_verifier4(const u_char *pd, int offset, frame_data *fd,
3690 proto_tree *tree, char *name)
3692 return dissect_rpc_uint64(pd, offset, fd, tree, name);
3696 dissect_nfs_fh4(const u_char *pd, int offset, frame_data *fd,
3697 proto_tree *tree, char *name)
3699 return dissect_nfs_fh3(pd, offset, fd, tree, name);
3703 dissect_nfs_cookie4(const u_char *pd, int offset, frame_data *fd,
3704 proto_tree *tree, char *name)
3706 return dissect_rpc_uint64(pd, offset, fd, tree, name);
3710 dissect_nfs_cookieverf4(const u_char *pd, int offset, frame_data *fd,
3711 proto_tree *tree, char *name)
3713 return dissect_rpc_uint64(pd, offset, fd, tree, name);
3716 /* this function is terribly ugly */
3718 dissect_nfs_bitmap4(const u_char *pd, int offset, frame_data *fd,
3719 proto_tree *tree, char *name)
3721 guint bitmap_len, bitmap;
3723 proto_item *fitem = NULL;
3724 proto_tree *newftree = NULL;
3726 bitmap_len = EXTRACT_UINT(pd, offset);
3728 fitem = proto_tree_add_text(tree, NullTVB, offset, 4 + bitmap_len*4,
3733 if (fitem == NULL) return offset;
3735 newftree = proto_item_add_subtree(fitem, ett_nfs_bitmap4);
3737 if (newftree == NULL) return offset;
3739 bitmap = EXTRACT_UINT(pd, offset);
3744 if (bitmap & (1 << 0))
3745 strcat(flagtxt, "supp_attr ");
3747 if (bitmap & (1 << 1))
3748 strcat(flagtxt, "type ");
3750 if (bitmap & (1 << 2))
3751 strcat(flagtxt, "fh_expire_type ");
3753 if (bitmap & (1 << 3))
3754 strcat(flagtxt, "change ");
3756 if (flagtxt[0] == '\0')
3757 strcpy(flagtxt, "<none>");
3758 proto_tree_add_text(newftree, NullTVB, offset, 0, "Bits 0-3: %s", flagtxt);
3761 if (bitmap & (1 << 4))
3762 strcat(flagtxt, "size ");
3764 if (bitmap & (1 << 5))
3765 strcat(flagtxt, "link_support ");
3767 if (bitmap & (1 << 6))
3768 strcat(flagtxt, "symlink_support ");
3770 if (bitmap & (1 << 7))
3771 strcat(flagtxt, "named_attr ");
3773 if (flagtxt[0] == '\0')
3774 strcpy(flagtxt, "<none>");
3775 proto_tree_add_text(newftree, NullTVB, offset, 0, "Bits 4-7: %s", flagtxt);
3779 if (bitmap & (1 << 8))
3780 strcat(flagtxt, "fsid ");
3782 if (bitmap & (1 << 9))
3783 strcat(flagtxt, "unique_handles ");
3785 if (bitmap & (1 << 10))
3786 strcat(flagtxt, "lease_time ");
3788 if (bitmap & (1 << 11))
3789 strcat(flagtxt, "rdattr_error ");
3791 if (flagtxt[0] == '\0')
3792 strcpy(flagtxt, "<none>");
3793 proto_tree_add_text(newftree, NullTVB, offset, 0, "Bits 8-11: %s", flagtxt);
3796 if (bitmap & (1 << 12))
3797 strcat(flagtxt, "ACL ");
3799 if (bitmap & (1 << 13))
3800 strcat(flagtxt, "aclsupport ");
3802 if (bitmap & (1 << 14))
3803 strcat(flagtxt, "archive ");
3805 if (bitmap & (1 << 15))
3806 strcat(flagtxt, "cansettime ");
3808 if (flagtxt[0] == '\0')
3809 strcpy(flagtxt, "<none>");
3810 proto_tree_add_text(newftree, NullTVB, offset, 0, "Bits 12-15: %s", flagtxt);
3813 if (bitmap & (1 << 16))
3814 strcat(flagtxt, "case_insensitive ");
3816 if (bitmap & (1 << 17))
3817 strcat(flagtxt, "case_preserving ");
3819 if (bitmap & (1 << 18))
3820 strcat(flagtxt, "chown_restricted ");
3822 if (bitmap & (1 << 19))
3823 strcat(flagtxt, "filehandle ");
3825 if (flagtxt[0] == '\0')
3826 strcpy(flagtxt, "<none>");
3827 proto_tree_add_text(newftree, NullTVB, offset, 0, "Bits 16-19: %s", flagtxt);
3830 if (bitmap & (1 << 20))
3831 strcat(flagtxt, "fileid ");
3833 if (bitmap & (1 << 21))
3834 strcat(flagtxt, "files_avail ");
3836 if (bitmap & (1 << 22))
3837 strcat(flagtxt, "files_free ");
3839 if (bitmap & (1 << 23))
3840 strcat(flagtxt, "files_total ");
3842 if (flagtxt[0] == '\0')
3843 strcpy(flagtxt, "<none>");
3844 proto_tree_add_text(newftree, NullTVB, offset, 0, "Bits 20-23: %s", flagtxt);
3847 if (bitmap & (1 << 24))
3848 strcat(flagtxt, "fs_locations ");
3850 if (bitmap & (1 << 25))
3851 strcat(flagtxt, "hidden ");
3853 if (bitmap & (1 << 26))
3854 strcat(flagtxt, "homegeneous ");
3856 if (bitmap & (1 << 27))
3857 strcat(flagtxt, "maxfilesize ");
3859 if (flagtxt[0] == '\0')
3860 strcpy(flagtxt, "<none>");
3861 proto_tree_add_text(newftree, NullTVB, offset, 0, "Bits 24-27: %s", flagtxt);
3864 if (bitmap & (1 << 28))
3865 strcat(flagtxt, "maxlink ");
3867 if (bitmap & (1 << 29))
3868 strcat(flagtxt, "maxname ");
3870 if (bitmap & (1 << 30))
3871 strcat(flagtxt, "maxread ");
3873 if (bitmap & (1 << 31))
3874 strcat(flagtxt, "maxwrite ");
3876 if (flagtxt[0] == '\0')
3877 strcpy(flagtxt, "<none>");
3878 proto_tree_add_text(newftree, NullTVB, offset, 0, "Bits 28-31: %s", flagtxt);
3881 bitmap = EXTRACT_UINT(pd, offset);
3884 if (bitmap & (1 << 0))
3885 strcat(flagtxt, "mimetype ");
3887 if (bitmap & (1 << 1))
3888 strcat(flagtxt, "mode ");
3890 if (bitmap & (1 << 2))
3891 strcat(flagtxt, "no_trunc ");
3893 if (bitmap & (1 << 3))
3894 strcat(flagtxt, "numlinks ");
3896 if (flagtxt[0] == '\0')
3897 strcpy(flagtxt, "<none>");
3898 proto_tree_add_text(newftree, NullTVB, offset, 0, "Bits 32-35: %s", flagtxt);
3901 if (bitmap & (1 << 4))
3902 strcat(flagtxt, "owner ");
3904 if (bitmap & (1 << 5))
3905 strcat(flagtxt, "owner_group ");
3907 if (bitmap & (1 << 6))
3908 strcat(flagtxt, "quota_hard ");
3910 if (bitmap & (1 << 7))
3911 strcat(flagtxt, "quota_soft ");
3913 if (flagtxt[0] == '\0')
3914 strcpy(flagtxt, "<none>");
3915 proto_tree_add_text(newftree, NullTVB, offset, 0, "Bits 36-39: %s", flagtxt);
3918 if (bitmap & (1 << 8))
3919 strcat(flagtxt, "quota_used ");
3921 if (bitmap & (1 << 9))
3922 strcat(flagtxt, "rawdev ");
3924 if (bitmap & (1 << 10))
3925 strcat(flagtxt, "space_avail ");
3927 if (bitmap & (1 << 11))
3928 strcat(flagtxt, "space_free ");
3930 if (flagtxt[0] == '\0')
3931 strcpy(flagtxt, "<none>");
3932 proto_tree_add_text(newftree, NullTVB, offset, 0, "Bits 40-43: %s", flagtxt);
3935 if (bitmap & (1 << 12))
3936 strcat(flagtxt, "space_total ");
3938 if (bitmap & (1 << 13))
3939 strcat(flagtxt, "space_used ");
3941 if (bitmap & (1 << 14))
3942 strcat(flagtxt, "system ");
3944 if (flagtxt[0] == '\0')
3945 strcpy(flagtxt, "<none>");
3946 proto_tree_add_text(newftree, NullTVB, offset, 0, "Bits 44-47: %s", flagtxt);
3949 if (bitmap & (1 << 15))
3950 strcat(flagtxt, "time_access ");
3952 if (bitmap & (1 << 16))
3953 strcat(flagtxt, "time_access_set ");
3955 if (bitmap & (1 << 17))
3956 strcat(flagtxt, "time_backup ");
3958 if (bitmap & (1 << 18))
3959 strcat(flagtxt, "time_create ");
3961 if (flagtxt[0] == '\0')
3962 strcpy(flagtxt, "<none>");
3963 proto_tree_add_text(newftree, NullTVB, offset, 0, "Bits 48-51: %s", flagtxt);
3966 if (bitmap & (1 << 19))
3967 strcat(flagtxt, "time_delta ");
3969 if (bitmap & (1 << 20))
3970 strcat(flagtxt, "time_metadata ");
3972 if (bitmap & (1 << 21))
3973 strcat(flagtxt, "time_modify ");
3975 if (bitmap & (1 << 22))
3976 strcat(flagtxt, "time_modify_set ");
3978 if (flagtxt[0] == '\0')
3979 strcpy(flagtxt, "<none>");
3980 proto_tree_add_text(newftree, NullTVB, offset, 0, "Bits 52-55: %s", flagtxt);
3983 * If there are any more bits in this bitfield, we don't know how to
3984 * handle them as per the NFSv4 draft spec 07
3990 for (i = 0; i < (bitmap_len-2); i++)
3998 dissect_nfs_clientaddr4(const u_char *pd, int offset, frame_data *fd,
3999 proto_tree *tree, char *name)
4001 offset = dissect_nfs_opaque4(pd, offset, fd, tree, "network id");
4002 offset = dissect_nfs_opaque4(pd, offset, fd, tree, "universal address");
4009 dissect_nfs_cb_client4(const u_char *pd, int offset, frame_data *fd,
4010 proto_tree *tree, char *name)
4012 offset = dissect_rpc_uint32(pd, offset, fd, tree, "cb_program");
4013 offset = dissect_nfs_clientaddr4(pd, offset, fd, tree, "cb_location");
4019 dissect_nfs_stable_how4(const u_char *pd, int offset, frame_data *fd,
4020 proto_tree *tree, char *name)
4022 return dissect_rpc_uint32(pd, offset, fd, tree, "stable_how4");
4026 dissect_nfs_opaque4(const u_char *pd, int offset, frame_data *fd,
4027 proto_tree *tree, char *name)
4029 return dissect_nfsdata(pd, offset, fd, tree, hf_nfs_data);
4032 /* There is probably a better (built-in?) way to do this, but this works
4036 static const value_string names_nfsv4_operation[] = {
4037 { NFS4_OP_ACCESS, "ACCESS" },
4038 { NFS4_OP_CLOSE, "CLOSE" },
4039 { NFS4_OP_COMMIT, "COMMIT" },
4040 { NFS4_OP_CREATE, "CREATE" },
4041 { NFS4_OP_DELEGPURGE, "DELEGPURGE" },
4042 { NFS4_OP_DELEGRETURN, "DELEGRETURN" },
4043 { NFS4_OP_GETATTR, "GETATTR" },
4044 { NFS4_OP_GETFH, "GETFH" },
4045 { NFS4_OP_LINK, "LINK" },
4046 { NFS4_OP_LOCK, "LOCK" },
4047 { NFS4_OP_LOCKT, "LOCKT" },
4048 { NFS4_OP_LOCKU, "LOCKU" },
4049 { NFS4_OP_LOOKUP, "LOOKUP" },
4050 { NFS4_OP_NVERIFY, "NVERIFY" },
4051 { NFS4_OP_OPEN, "OPEN" },
4052 { NFS4_OP_OPENATTR, "OPENATTR" },
4053 { NFS4_OP_OPEN_CONFIRM, "OPEN_CONFIRM" },
4054 { NFS4_OP_OPEN_DOWNGRADE, "OPEN_DOWNGRADE" },
4055 { NFS4_OP_PUTFH, "PUTFH" },
4056 { NFS4_OP_PUTPUBFH, "PUTPUBFH" },
4057 { NFS4_OP_PUTROOTFH, "PUTROOTFH" },
4058 { NFS4_OP_READ, "READ" },
4059 { NFS4_OP_READDIR, "READDIR" },
4060 { NFS4_OP_READLINK, "READLINK" },
4061 { NFS4_OP_REMOVE, "REMOVE" },
4062 { NFS4_OP_RENAME, "RENAME" },
4063 { NFS4_OP_RENEW, "RENEW" },
4064 { NFS4_OP_RESTOREFH, "RESTOREFH" },
4065 { NFS4_OP_SAVEFH, "SAVEFH" },
4066 { NFS4_OP_SECINFO, "SECINFO" },
4067 { NFS4_OP_SETATTR, "SETATTR" },
4068 { NFS4_OP_SETCLIENTID, "SETCLIENTID" },
4069 { NFS4_OP_SETCLIENTID_CONFIRM, "SETCLIENTID_CONFIRM" },
4070 { NFS4_OP_VERIFY, "VERIFY" },
4071 { NFS4_OP_WRITE, "WRITE" },
4075 guint *nfsv4_operation_ett[] =
4081 &ett_nfs_delegpurge4 ,
4082 &ett_nfs_delegreturn4 ,
4093 &ett_nfs_openattr4 ,
4094 &ett_nfs_open_confirm4 ,
4095 &ett_nfs_open_downgrade4 ,
4097 &ett_nfs_putpubfh4 ,
4098 &ett_nfs_putrootfh4 ,
4101 &ett_nfs_readlink4 ,
4105 &ett_nfs_restorefh4 ,
4109 &ett_nfs_setclientid4 ,
4110 &ett_nfs_setclientid_confirm4 ,
4117 dissect_nfs_stat4(const u_char *pd, int offset, frame_data *fd,
4118 proto_tree *tree, char *name)
4120 return dissect_rpc_uint32(pd, offset, fd, tree, name);
4124 dissect_nfs_dirlist4(const u_char *pd, int offset, frame_data *fd,
4125 proto_tree *tree, char *name)
4127 proto_tree *newftree = NULL;
4130 newftree = proto_item_add_subtree(tree, ett_nfs_dirlist4);
4131 if (newftree==NULL) return offset;
4133 nextentry = EXTRACT_UINT(pd, offset);
4134 offset = dissect_rpc_uint32(pd, offset, fd, newftree, "data follows?");
4138 offset = dissect_nfs_cookie4(pd, offset, fd, newftree, "cookie");
4139 offset = dissect_nfs_component4(pd, offset, fd, newftree, "name");
4140 offset = dissect_nfs_fattr4(pd, offset, fd, newftree, "attrs");
4141 nextentry = EXTRACT_UINT(pd, offset);
4145 return dissect_rpc_uint32(pd, offset, fd, newftree, "eof");
4149 dissect_nfs_changeid4(const u_char *pd, int offset, frame_data *fd,
4150 proto_tree *tree, char *name)
4152 return dissect_rpc_uint64(pd, offset, fd, tree, name);
4156 dissect_nfs_change_info4(const u_char *pd, int offset, frame_data *fd,
4157 proto_tree *tree, char *name)
4159 proto_tree *newftree = NULL;
4160 proto_tree *fitem = NULL;
4162 fitem = proto_tree_add_text(tree, NullTVB, offset, 0, "%s", name);
4165 newftree=proto_item_add_subtree(fitem, ett_nfs_change_info4);
4168 offset = dissect_rpc_uint32(pd, offset, fd, newftree, "atomic? ");
4169 offset = dissect_nfs_changeid4(pd, offset, fd, newftree, "before");
4170 offset = dissect_nfs_changeid4(pd, offset, fd, newftree, "after");
4178 dissect_nfs_lock4denied(const u_char *pd, int offset, frame_data *fd,
4179 proto_tree *tree, char *name)
4181 offset = dissect_nfs_lockowner4(pd, offset, fd, tree, "owner");
4182 offset = dissect_nfs_offset4(pd, offset, fd, tree, "offset");
4183 return dissect_nfs_length4(pd, offset, fd, tree, "length");
4187 dissect_nfs_acetype4(const u_char *pd, int offset, frame_data *fd,
4188 proto_tree *tree, char *name)
4190 return dissect_rpc_uint32(pd, offset, fd, tree, name);
4194 dissect_nfs_aceflag4(const u_char *pd, int offset, frame_data *fd,
4195 proto_tree *tree, char *name)
4197 return dissect_rpc_uint32(pd, offset, fd, tree, name);
4201 dissect_nfs_acemask4(const u_char *pd, int offset, frame_data *fd,
4202 proto_tree *tree, char *name)
4204 return dissect_rpc_uint32(pd, offset, fd, tree, name);
4208 dissect_nfs_ace4(const u_char *pd, int offset, frame_data *fd,
4209 proto_tree *tree, char *name)
4211 offset = dissect_nfs_acetype4(pd, offset, fd, tree, "type");
4212 offset = dissect_nfs_aceflag4(pd, offset, fd, tree, "flag");
4213 offset = dissect_nfs_acemask4(pd, offset, fd, tree, "access_mask");
4214 return dissect_nfs_utf8string(pd, offset, fd, tree, hf_nfs_ace4, NULL);
4218 dissect_nfs_open_read_delegation4(const u_char *pd, int offset, frame_data *fd,
4221 offset = dissect_nfs_stateid4(pd, offset, fd, tree, "State ID");
4222 offset = dissect_rpc_uint32(pd, offset, fd, tree, "recall?");
4223 return dissect_nfs_ace4(pd, offset, fd, tree, "permissions");
4227 dissect_nfs_modified_limit4(const u_char *pd, int offset, frame_data *fd,
4228 proto_tree *tree, char *name)
4230 offset = dissect_rpc_uint32(pd, offset, fd, tree, "num_blocks");
4231 return dissect_rpc_uint32(pd, offset, fd, tree, "bytes_per_block");
4234 #define NFS_LIMIT_SIZE 1
4235 #define NFS_LIMIT_BLOCKS 2
4236 static const value_string names_limit_by4[] = {
4237 { NFS_LIMIT_SIZE, "NFS_LIMIT_SIZE" },
4238 { NFS_LIMIT_BLOCKS, "NFS_LIMIT_BLOCKS" },
4243 dissect_nfs_space_limit4(const u_char *pd, int offset, frame_data *fd,
4244 proto_tree *tree, char *name)
4248 limitby = EXTRACT_UINT(pd, offset);
4249 proto_tree_add_uint(tree, hf_nfs_limit_by4, NullTVB, offset+0, 4, limitby);
4254 case NFS_LIMIT_SIZE:
4255 offset = dissect_rpc_uint64(pd, offset, fd, tree, "filesize");
4258 case NFS_LIMIT_BLOCKS:
4259 offset = dissect_nfs_modified_limit4(pd, offset, fd, tree, "mod_blocks");
4270 dissect_nfs_open_write_delegation4(const u_char *pd, int offset,
4271 frame_data *fd, proto_tree *tree)
4273 offset = dissect_nfs_stateid4(pd, offset, fd, tree, "State ID");
4274 offset = dissect_rpc_bool(pd, offset, fd, tree, hf_nfs_recall);
4275 offset = dissect_nfs_space_limit4(pd, offset, fd, tree, "space_limit");
4276 return dissect_nfs_ace4(pd, offset, fd, tree, "permissions");
4279 #define OPEN_DELEGATE_NONE 0
4280 #define OPEN_DELEGATE_READ 1
4281 #define OPEN_DELEGATE_WRITE 2
4282 static const value_string names_open_delegation_type4[] = {
4283 { OPEN_DELEGATE_NONE, "OPEN_DELEGATE_NONE" },
4284 { OPEN_DELEGATE_READ, "OPEN_DELEGATE_READ" },
4285 { OPEN_DELEGATE_WRITE, "OPEN_DELEGATE_WRITE" },
4290 dissect_nfs_open_delegation4(const u_char *pd, int offset, frame_data *fd,
4291 proto_tree *tree, char *name)
4293 guint delegation_type;
4294 proto_tree *newftree = NULL;
4295 proto_item *fitem = NULL;
4297 delegation_type = EXTRACT_UINT(pd, offset);
4298 proto_tree_add_uint(tree, hf_nfs_open_delegation_type4, NullTVB, offset+0,
4299 4, delegation_type);
4303 newftree = proto_item_add_subtree(fitem, ett_nfs_open_delegation4);
4305 switch(delegation_type)
4307 case OPEN_DELEGATE_NONE:
4310 case OPEN_DELEGATE_READ:
4311 offset = dissect_nfs_open_read_delegation4(pd, offset, fd, newftree);
4314 case OPEN_DELEGATE_WRITE:
4315 offset = dissect_nfs_open_write_delegation4(pd, offset, fd, newftree);
4328 dissect_nfs_argop4(const u_char *pd, int offset, frame_data *fd,
4329 proto_tree *tree, char *name)
4331 guint ops, ops_counter;
4334 proto_tree *ftree = NULL;
4335 proto_tree *newftree = NULL;
4337 if (!BYTES_ARE_IN_FRAME(offset, 4)) return offset;
4339 ops = EXTRACT_UINT(pd, offset+0);
4341 fitem = proto_tree_add_text(tree, NullTVB, offset, 4,
4342 "Operations (count: %d)", ops);
4345 if (fitem == NULL) return offset;
4347 ftree = proto_item_add_subtree(fitem, ett_nfs_argop4);
4349 if (ftree == NULL) return offset;
4351 for (ops_counter=0; ops_counter<ops; ops_counter++)
4353 if (!BYTES_ARE_IN_FRAME(offset, 4)) return offset;
4355 opcode = EXTRACT_UINT(pd, offset);
4356 fitem = proto_tree_add_uint(ftree, hf_nfs_argop4, NullTVB, offset, 4,
4360 if (fitem == NULL) break;
4362 newftree = proto_item_add_subtree(fitem, *nfsv4_operation_ett[opcode-3]);
4364 if (newftree == NULL) break;
4368 case NFS4_OP_ACCESS:
4369 offset = dissect_access(pd, offset, fd, newftree, "access");
4373 offset = dissect_nfs_seqid4(pd, offset, fd, newftree, "Sequence ID");
4374 offset = dissect_nfs_stateid4(pd, offset, fd, newftree, "State ID");
4377 case NFS4_OP_COMMIT:
4378 offset = dissect_nfs_offset4(pd, offset, fd, newftree, "offset");
4379 offset = dissect_nfs_count4(pd, offset, fd, newftree, "count");
4382 case NFS4_OP_CREATE:
4386 offset = dissect_nfs_component4(pd, offset, fd, newftree,
4389 create_type = EXTRACT_UINT(pd, offset);
4390 offset = dissect_nfs_ftype4(pd, offset, fd, newftree, "type");
4395 offset = dissect_nfs_linktext4(pd, offset, fd, newftree,
4401 offset = dissect_nfs_specdata4(pd, offset, fd,
4402 newftree, "devdata");
4416 case NFS4_OP_DELEGPURGE:
4417 offset = dissect_nfs_clientid4(pd, offset, fd, newftree, "Client ID");
4420 case NFS4_OP_DELEGRETURN:
4421 offset = dissect_nfs_stateid4(pd, offset, fd, newftree, "State ID");
4424 case NFS4_OP_GETATTR:
4425 offset = dissect_nfs_bitmap4(pd, offset, fd, newftree, "attr_request");
4432 offset = dissect_nfs_component4(pd, offset, fd, newftree, "newname");
4436 offset = dissect_nfs_lock_type4(pd, offset, fd, newftree, "locktype");
4437 offset = dissect_nfs_seqid4(pd, offset, fd, newftree, "Sequence ID");
4438 offset = dissect_nfs_reclaim4(pd, offset, fd, newftree, "reclaim");
4439 offset = dissect_nfs_stateid4(pd, offset, fd, newftree, "State ID");
4440 offset = dissect_nfs_offset4(pd, offset, fd, newftree, "offset");
4441 offset = dissect_nfs_length4(pd, offset, fd, newftree, "length");
4445 offset = dissect_nfs_lock_type4(pd, offset, fd, newftree, "locktype");
4446 offset = dissect_nfs_lockowner4(pd, offset, fd, newftree, "owner");
4447 offset = dissect_nfs_offset4(pd, offset, fd, newftree, "offset");
4448 offset = dissect_nfs_length4(pd, offset, fd, newftree, "length");
4452 offset = dissect_nfs_lock_type4(pd, offset, fd, newftree, "type");
4453 offset = dissect_nfs_seqid4(pd, offset, fd, newftree, "Sequence ID");
4454 offset = dissect_nfs_stateid4(pd, offset, fd, newftree, "State ID");
4455 offset = dissect_nfs_offset4(pd, offset, fd, newftree, "offset");
4456 offset = dissect_nfs_length4(pd, offset, fd, newftree, "length");
4459 case NFS4_OP_LOOKUP:
4460 offset = dissect_nfs_pathname4(pd, offset, fd, newftree, "path");
4463 case NFS4_OP_LOOKUPP:
4466 case NFS4_OP_NVERIFY:
4467 offset = dissect_nfs_fattr4(pd, offset, fd, newftree,
4472 offset = dissect_nfs_open_claim4(pd, offset, fd, newftree, "claim");
4473 offset = dissect_nfs_openflag4(pd, offset, fd, newftree);
4474 offset = dissect_nfs_lockowner4(pd, offset, fd, newftree, "Owner");
4475 offset = dissect_nfs_seqid4(pd, offset, fd, newftree, "Sequence ID");
4476 offset = dissect_rpc_uint32(pd, offset, fd, newftree, "Share Access");
4477 offset = dissect_rpc_uint32(pd, offset, fd, newftree, "Share Deny");
4480 case NFS4_OP_OPENATTR:
4483 case NFS4_OP_OPEN_CONFIRM:
4484 offset = dissect_nfs_seqid4(pd, offset, fd, newftree, "Sequence ID");
4485 offset = dissect_nfs_verifier4(pd, offset, fd, newftree,
4489 case NFS4_OP_OPEN_DOWNGRADE:
4490 offset = dissect_nfs_stateid4(pd, offset, fd, newftree, "State ID");
4491 offset = dissect_nfs_seqid4(pd, offset, fd, newftree, "Sequence ID");
4492 offset = dissect_rpc_uint32(pd, offset, fd, newftree, "Share Access");
4493 offset = dissect_rpc_uint32(pd, offset, fd, newftree, "Share Deny");
4497 offset = dissect_nfs_fh4(pd, offset, fd, newftree, "filehandle");
4500 case NFS4_OP_PUTPUBFH:
4501 case NFS4_OP_PUTROOTFH:
4505 offset = dissect_nfs_stateid4(pd, offset, fd, newftree, "State ID");
4506 offset = dissect_nfs_offset4(pd, offset, fd, newftree, "offset");
4507 offset = dissect_nfs_count4(pd, offset, fd, newftree, "count");
4510 case NFS4_OP_READDIR:
4511 offset = dissect_nfs_cookie4(pd, offset, fd, newftree, "cookie");
4512 offset = dissect_nfs_cookieverf4(pd, offset, fd, newftree,
4514 offset = dissect_nfs_count4(pd, offset, fd, newftree, "dircount");
4515 offset = dissect_nfs_count4(pd, offset, fd, newftree, "maxcount");
4516 offset = dissect_nfs_bitmap4(pd, offset, fd, newftree, "attr");
4519 case NFS4_OP_READLINK:
4522 case NFS4_OP_REMOVE:
4523 offset = dissect_nfs_component4(pd, offset, fd, newftree, "target");
4526 case NFS4_OP_RENAME:
4527 offset = dissect_nfs_component4(pd, offset, fd, newftree, "oldname");
4528 offset = dissect_nfs_component4(pd, offset, fd, newftree, "newname");
4532 offset = dissect_nfs_stateid4(pd, offset, fd, newftree, "State ID");
4535 case NFS4_OP_RESTOREFH:
4536 case NFS4_OP_SAVEFH:
4539 case NFS4_OP_SECINFO:
4540 offset = dissect_nfs_component4(pd, offset, fd, newftree, "name");
4543 case NFS4_OP_SETATTR:
4544 offset = dissect_nfs_stateid4(pd, offset, fd, newftree, "State ID");
4545 offset = dissect_nfs_fattr4(pd, offset, fd, newftree,
4549 case NFS4_OP_SETCLIENTID:
4551 proto_tree *client_tree = NULL;
4553 fitem = proto_tree_add_text(newftree, NullTVB, offset, 0, "Client");
4556 client_tree = proto_item_add_subtree(fitem,
4557 ett_nfs_client_id4);
4560 offset = dissect_nfs_client_id4(pd, offset, fd,
4561 client_tree, "client");
4564 fitem = proto_tree_add_text(newftree, NullTVB, offset, 0,
4567 newftree = proto_item_add_subtree(fitem, ett_nfs_cb_client4);
4569 offset = dissect_nfs_cb_client4(pd, offset, fd, newftree,
4575 case NFS4_OP_SETCLIENTID_CONFIRM:
4576 offset = dissect_nfs_verifier4(pd, offset, fd, newftree,
4577 "setclientid_confirm");
4580 case NFS4_OP_VERIFY:
4581 offset = dissect_nfs_fattr4(pd, offset, fd, newftree,
4586 offset = dissect_nfs_stateid4(pd, offset, fd, newftree, "State ID");
4587 offset = dissect_nfs_offset4(pd, offset, fd, newftree, "offset");
4588 offset = dissect_nfs_stable_how4(pd, offset, fd, newftree, "stable");
4589 offset = dissect_nfs_opaque4(pd, offset, fd, newftree, "data");
4601 dissect_nfs4_compound_call(const u_char* pd, int offset, frame_data* fd,
4604 offset = dissect_nfs_utf8string(pd, offset, fd, tree, hf_nfs_tag4, NULL);
4605 offset = dissect_rpc_uint32(pd, offset, fd, tree, "minorversion");
4606 offset = dissect_nfs_argop4(pd, offset, fd, tree, "arguments");
4611 static const value_string names_nfsstat4[] = {
4613 { 1, "NFS4ERR_PERM" },
4614 { 2, "NFS4ERR_NOENT" },
4615 { 5, "NFS4ERR_IO" },
4616 { 6, "NFS4ERR_NXIO" },
4617 { 13, "NFS4ERR_ACCES" },
4618 { 17, "NFS4ERR_EXIST" },
4619 { 18, "NFS4ERR_XDEV" },
4620 { 19, "NFS4ERR_NODEV" },
4621 { 20, "NFS4ERR_NOTDIR" },
4622 { 21, "NFS4ERR_ISDIR" },
4623 { 22, "NFS4ERR_INVAL" },
4624 { 27, "NFS4ERR_FBIG" },
4625 { 28, "NFS4ERR_NOSPC" },
4626 { 30, "NFS4ERR_ROFS" },
4627 { 31, "NFS4ERR_MLINK" },
4628 { 63, "NFS4ERR_NAMETOOLONG" },
4629 { 66, "NFS4ERR_NOTEMPTY" },
4630 { 69, "NFS4ERR_DQUOT" },
4631 { 70, "NFS4ERR_STALE" },
4632 { 10001, "NFS4ERR_BADHANDLE" },
4633 { 10003, "NFS4ERR_BAD_COOKIE" },
4634 { 10004, "NFS4ERR_NOTSUPP" },
4635 { 10005, "NFS4ERR_TOOSMALL" },
4636 { 10006, "NFS4ERR_SERVERFAULT" },
4637 { 10007, "NFS4ERR_BADTYPE" },
4638 { 10008, "NFS4ERR_DELAY" },
4639 { 10009, "NFS4ERR_SAME" },
4640 { 10010, "NFS4ERR_DENIED" },
4641 { 10011, "NFS4ERR_EXPIRED" },
4642 { 10012, "NFS4ERR_LOCKED" },
4643 { 10013, "NFS4ERR_GRACE" },
4644 { 10014, "NFS4ERR_FHEXPIRED" },
4645 { 10015, "NFS4ERR_SHARE_DENIED" },
4646 { 10016, "NFS4ERR_WRONGSEC" },
4647 { 10017, "NFS4ERR_CLID_INUSE" },
4648 { 10018, "NFS4ERR_RESOURCE" },
4649 { 10019, "NFS4ERR_MOVED" },
4650 { 10020, "NFS4ERR_NOFILEHANDLE" },
4651 { 10021, "NFS4ERR_MINOR_VERS_MISMATCH" },
4652 { 10022, "NFS4ERR_STALE_CLIENTID" },
4653 { 10023, "NFS4ERR_STALE_STATEID" },
4654 { 10024, "NFS4ERR_OLD_STATEID" },
4655 { 10025, "NFS4ERR_BAD_STATEID" },
4656 { 10026, "NFS4ERR_BAD_SEQID" },
4657 { 10027, "NFS4ERR_NOT_SAME" },
4658 { 10028, "NFS4ERR_LOCK_RANGE" },
4659 { 10029, "NFS4ERR_SYMLINK" },
4660 { 10030, "NFS4ERR_READDIR_NOSPC" },
4661 { 10031, "NFS4ERR_LEASE_MOVED" },
4666 dissect_nfs_nfsstat4(const u_char *pd, int offset, frame_data *fd,
4671 status = EXTRACT_UINT(pd, offset);
4672 proto_tree_add_uint(tree, hf_nfs_nfsstat4, NullTVB, offset, 4, status);
4679 dissect_nfs_resop4(const u_char *pd, int offset, frame_data *fd,
4680 proto_tree *tree, char *name)
4682 guint ops, ops_counter;
4685 proto_tree *ftree = NULL;
4686 proto_tree *newftree = NULL;
4689 ops = EXTRACT_UINT(pd, offset+0);
4691 fitem = proto_tree_add_text(tree, NullTVB, offset, 4,
4692 "Operations (count: %d)", ops);
4695 if (fitem == NULL) return offset;
4697 ftree = proto_item_add_subtree(fitem, ett_nfs_resop4);
4699 if (ftree == NULL) return offset; /* error adding new subtree */
4701 for (ops_counter = 0; ops_counter < ops; ops_counter++)
4703 if (!BYTES_ARE_IN_FRAME(offset, 4)) return offset;
4705 opcode = EXTRACT_UINT(pd, offset);
4707 if (opcode < NFS4_OP_ACCESS || opcode > NFS4_OP_WRITE) break;
4709 if (!BYTES_ARE_IN_FRAME(offset, 4)) return offset;
4711 fitem = proto_tree_add_uint(ftree, hf_nfs_resop4, NullTVB, offset, 4,
4715 if (fitem == NULL) break; /* error adding new item to tree */
4717 newftree = proto_item_add_subtree(fitem, *nfsv4_operation_ett[opcode-3]);
4719 if (newftree == NULL)
4720 break; /* error adding new subtree to operation item */
4722 status = EXTRACT_UINT(pd, offset);
4723 offset = dissect_nfs_nfsstat4(pd, offset, fd, newftree);
4725 if (status != NFS4_OK &&
4726 (opcode != NFS4_OP_LOCK || opcode != NFS4_OP_LOCKT))
4729 /* These parsing routines are only executed if the status is NFS4_OK */
4732 case NFS4_OP_ACCESS:
4733 offset = dissect_access(pd, offset, fd, newftree, "Supported");
4734 offset = dissect_access(pd, offset, fd, newftree, "Access");
4738 offset = dissect_nfs_stateid4(pd, offset, fd, newftree, "State ID");
4741 case NFS4_OP_COMMIT:
4742 offset = dissect_nfs_verifier4(pd, offset, fd, newftree, "writeverf");
4745 case NFS4_OP_CREATE:
4746 offset = dissect_nfs_change_info4(pd, offset, fd, newftree, "cinfo");
4749 case NFS4_OP_DELEGPURGE:
4753 case NFS4_OP_DELEGRETURN:
4757 case NFS4_OP_GETATTR:
4758 offset = dissect_nfs_fattr4(pd, offset, fd, newftree,
4763 offset = dissect_nfs_fh4(pd, offset, fd, newftree, "Filehandle");
4767 offset = dissect_nfs_change_info4(pd, offset, fd, newftree, "cinfo");
4772 if (status==NFS4_OK)
4773 offset = dissect_nfs_stateid4(pd, offset, fd, newftree,
4776 if (status==NFS4ERR_DENIED)
4777 offset = dissect_nfs_lock4denied(pd, offset, fd, newftree,
4782 offset = dissect_nfs_stateid4(pd, offset, fd, newftree, "State ID");
4785 case NFS4_OP_LOOKUP:
4789 case NFS4_OP_LOOKUPP:
4793 case NFS4_OP_NVERIFY:
4798 offset = dissect_nfs_stateid4(pd, offset, fd, tree, "State ID");
4799 offset = dissect_nfs_change_info4(pd, offset, fd, tree, "cinfo");
4800 offset = dissect_rpc_uint32(pd, offset, fd, tree, "rflags");
4801 offset = dissect_nfs_verifier4(pd, offset, fd, tree, "open_confirm");
4802 offset = dissect_nfs_open_delegation4(pd, offset, fd, tree,
4806 case NFS4_OP_OPENATTR:
4810 case NFS4_OP_OPEN_CONFIRM:
4811 case NFS4_OP_OPEN_DOWNGRADE:
4812 offset = dissect_nfs_stateid4(pd, offset, fd, tree, "State ID");
4819 case NFS4_OP_PUTPUBFH:
4823 case NFS4_OP_PUTROOTFH:
4828 offset = dissect_rpc_uint32(pd, offset, fd, newftree, "eof?");
4829 offset = dissect_nfs_opaque4(pd, offset, fd, newftree, "data");
4832 case NFS4_OP_READDIR:
4833 offset = dissect_nfs_verifier4(pd, offset, fd, newftree,
4835 offset = dissect_nfs_dirlist4(pd, offset, fd, newftree, "reply");
4838 case NFS4_OP_READLINK:
4839 offset = dissect_nfs_linktext4(pd, offset, fd, newftree, "link");
4842 case NFS4_OP_REMOVE:
4843 offset = dissect_nfs_change_info4(pd, offset, fd, newftree, "cinfo");
4846 case NFS4_OP_RENAME:
4847 offset = dissect_nfs_change_info4(pd, offset, fd, newftree,
4849 offset = dissect_nfs_change_info4(pd, offset, fd, newftree,
4857 case NFS4_OP_RESTOREFH:
4861 case NFS4_OP_SAVEFH:
4865 case NFS4_OP_SECINFO:
4866 offset = dissect_rpc_uint32(pd, offset, fd, newftree, "flavor");
4867 offset = dissect_nfs_opaque4(pd, offset, fd, newftree, "flavor_info");
4870 case NFS4_OP_SETATTR:
4871 offset = dissect_nfs_bitmap4(pd, offset, fd, newftree, "attrsset");
4874 case NFS4_OP_SETCLIENTID:
4875 if (status == NFS4_OK)
4877 offset = dissect_nfs_clientid4(pd, offset, fd, newftree,
4879 offset = dissect_nfs_verifier4(pd, offset, fd, newftree,
4880 "setclientid_confirm");
4883 if (status == NFS4ERR_CLID_INUSE)
4885 offset = dissect_nfs_clientaddr4(pd, offset, fd, newftree,
4890 case NFS4_OP_SETCLIENTID_CONFIRM:
4894 case NFS4_OP_VERIFY:
4899 offset = dissect_nfs_count4(pd, offset, fd, newftree, "count");
4900 offset = dissect_nfs_stable_how4(pd, offset, fd, newftree,
4902 offset = dissect_nfs_verifier4(pd, offset, fd, newftree,
4915 dissect_nfs4_compound_reply(const u_char* pd, int offset, frame_data* fd,
4918 offset = dissect_nfs_nfsstat4(pd, offset, fd, tree);
4919 offset = dissect_nfs_utf8string(pd, offset, fd, tree, hf_nfs_tag4, NULL);
4920 offset = dissect_nfs_resop4(pd, offset, fd, tree, "arguments");
4926 /* proc number, "proc name", dissect_request, dissect_reply */
4927 /* NULL as function pointer means: take the generic one. */
4928 const vsff nfs3_proc[] = {
4929 { 0, "NULL", /* OK */
4931 { 1, "GETATTR", /* OK */
4932 dissect_nfs3_getattr_call, dissect_nfs3_getattr_reply },
4933 { 2, "SETATTR", /* OK */
4934 dissect_nfs3_setattr_call, dissect_nfs3_setattr_reply },
4935 { 3, "LOOKUP", /* OK */
4936 dissect_nfs3_lookup_call, dissect_nfs3_lookup_reply },
4937 { 4, "ACCESS", /* OK */
4938 dissect_nfs3_access_call, dissect_nfs3_access_reply },
4939 { 5, "READLINK", /* OK */
4940 dissect_nfs3_nfs_fh3_call, dissect_nfs3_readlink_reply },
4941 { 6, "READ", /* OK */
4942 dissect_nfs3_read_call, dissect_nfs3_read_reply },
4943 { 7, "WRITE", /* OK */
4944 dissect_nfs3_write_call, dissect_nfs3_write_reply },
4945 { 8, "CREATE", /* OK */
4946 dissect_nfs3_create_call, dissect_nfs3_create_reply },
4947 { 9, "MKDIR", /* OK */
4948 dissect_nfs3_mkdir_call, dissect_nfs3_create_reply },
4949 { 10, "SYMLINK", /* OK */
4950 dissect_nfs3_symlink_call, dissect_nfs3_create_reply },
4951 { 11, "MKNOD", /* OK */
4952 dissect_nfs3_mknod_call, dissect_nfs3_create_reply },
4953 { 12, "REMOVE", /* OK */
4954 dissect_nfs3_diropargs3_call, dissect_nfs3_remove_reply },
4955 { 13, "RMDIR", /* OK */
4956 dissect_nfs3_diropargs3_call, dissect_nfs3_remove_reply },
4957 { 14, "RENAME", /* OK */
4958 dissect_nfs3_rename_call, dissect_nfs3_rename_reply },
4959 { 15, "LINK", /* OK */
4960 dissect_nfs3_link_call, dissect_nfs3_link_reply },
4961 { 16, "READDIR", /* OK */
4962 dissect_nfs3_readdir_call, dissect_nfs3_readdir_reply },
4963 { 17, "READDIRPLUS", /* OK */
4964 dissect_nfs3_readdirplus_call, dissect_nfs3_readdirplus_reply },
4965 { 18, "FSSTAT", /* OK */
4966 dissect_nfs3_nfs_fh3_call, dissect_nfs3_fsstat_reply },
4967 { 19, "FSINFO", /* OK */
4968 dissect_nfs3_nfs_fh3_call, dissect_nfs3_fsinfo_reply },
4969 { 20, "PATHCONF", /* OK */
4970 dissect_nfs3_nfs_fh3_call, dissect_nfs3_pathconf_reply },
4971 { 21, "COMMIT", /* OK */
4972 dissect_nfs3_commit_call, dissect_nfs3_commit_reply },
4973 { 0,NULL,NULL,NULL }
4975 /* end of NFS Version 3 */
4977 const vsff nfs4_proc[] = {
4981 dissect_nfs4_compound_call, dissect_nfs4_compound_reply },
4982 { 0, NULL, NULL, NULL }
4986 static struct true_false_string yesno = { "Yes", "No" };
4990 proto_register_nfs(void)
4992 static hf_register_info hf[] = {
4993 { &hf_nfs_fh_fsid_major, {
4994 "major", "nfs.fh.fsid.major", FT_UINT32, BASE_DEC,
4995 NULL, 0, "major file system ID" }},
4996 { &hf_nfs_fh_fsid_minor, {
4997 "minor", "nfs.fh.fsid.minor", FT_UINT32, BASE_DEC,
4998 NULL, 0, "minor file system ID" }},
4999 { &hf_nfs_fh_xfsid_major, {
5000 "exported major", "nfs.fh.xfsid.major", FT_UINT32, BASE_DEC,
5001 NULL, 0, "exported major file system ID" }},
5002 { &hf_nfs_fh_xfsid_minor, {
5003 "exported minor", "nfs.fh.xfsid.minor", FT_UINT32, BASE_DEC,
5004 NULL, 0, "exported minor file system ID" }},
5005 { &hf_nfs_fh_fstype, {
5006 "file system type", "nfs.fh.fstype", FT_UINT32, BASE_DEC,
5007 NULL, 0, "file system type" }},
5009 "file number", "nfs.fh.fn", FT_UINT32, BASE_DEC,
5010 NULL, 0, "file number" }},
5011 { &hf_nfs_fh_fn_len, {
5012 "length", "nfs.fh.fn.len", FT_UINT32, BASE_DEC,
5013 NULL, 0, "file number length" }},
5014 { &hf_nfs_fh_fn_inode, {
5015 "inode", "nfs.fh.fn.inode", FT_UINT32, BASE_DEC,
5016 NULL, 0, "file number inode" }},
5017 { &hf_nfs_fh_fn_generation, {
5018 "generation", "nfs.fh.fn.generation", FT_UINT32, BASE_DEC,
5019 NULL, 0, "file number generation" }},
5021 "exported file number", "nfs.fh.xfn", FT_UINT32, BASE_DEC,
5022 NULL, 0, "exported file number" }},
5023 { &hf_nfs_fh_xfn_len, {
5024 "length", "nfs.fh.xfn.len", FT_UINT32, BASE_DEC,
5025 NULL, 0, "exported file number length" }},
5026 { &hf_nfs_fh_xfn_inode, {
5027 "exported inode", "nfs.fh.xfn.inode", FT_UINT32, BASE_DEC,
5028 NULL, 0, "exported file number inode" }},
5029 { &hf_nfs_fh_xfn_generation, {
5030 "generation", "nfs.fh.xfn.generation", FT_UINT32, BASE_DEC,
5031 NULL, 0, "exported file number generation" }},
5032 { &hf_nfs_fh_dentry, {
5033 "dentry", "nfs.fh.dentry", FT_UINT32, BASE_HEX,
5034 NULL, 0, "dentry (cookie)" }},
5036 "device", "nfs.fh.dev", FT_UINT32, BASE_DEC,
5037 NULL, 0, "device" }},
5038 { &hf_nfs_fh_xdev, {
5039 "exported device", "nfs.fh.xdev", FT_UINT32, BASE_DEC,
5040 NULL, 0, "exported device" }},
5041 { &hf_nfs_fh_dirinode, {
5042 "directory inode", "nfs.fh.dirinode", FT_UINT32, BASE_DEC,
5043 NULL, 0, "directory inode" }},
5044 { &hf_nfs_fh_pinode, {
5045 "pseudo inode", "nfs.fh.pinode", FT_UINT32, BASE_HEX,
5046 NULL, 0, "pseudo inode" }},
5047 { &hf_nfs_fh_hp_len, {
5048 "length", "nfs.fh.hp.len", FT_UINT32, BASE_DEC,
5049 NULL, 0, "hash path length" }},
5051 "Status", "nfs.status2", FT_UINT32, BASE_DEC,
5052 VALS(names_nfs_stat), 0, "Reply status" }},
5054 "Name", "nfs.name", FT_STRING, BASE_DEC,
5056 { &hf_nfs_readlink_data, {
5057 "Data", "nfs.readlink.data", FT_STRING, BASE_DEC,
5058 NULL, 0, "Symbolic Link Data" }},
5059 { &hf_nfs_read_offset, {
5060 "Offset", "nfs.read.offset", FT_UINT32, BASE_DEC,
5061 NULL, 0, "Read Offset" }},
5062 { &hf_nfs_read_count, {
5063 "Count", "nfs.read.count", FT_UINT32, BASE_DEC,
5064 NULL, 0, "Read Count" }},
5065 { &hf_nfs_read_totalcount, {
5066 "Total Count", "nfs.read.totalcount", FT_UINT32, BASE_DEC,
5067 NULL, 0, "Total Count (obsolete)" }},
5069 "Data", "nfs.data", FT_STRING, BASE_DEC,
5071 { &hf_nfs_write_beginoffset, {
5072 "Begin Offset", "nfs.write.beginoffset", FT_UINT32, BASE_DEC,
5073 NULL, 0, "Begin offset (obsolete)" }},
5074 { &hf_nfs_write_offset, {
5075 "Offset", "nfs.write.offset", FT_UINT32, BASE_DEC,
5076 NULL, 0, "Offset" }},
5077 { &hf_nfs_write_totalcount, {
5078 "Total Count", "nfs.write.totalcount", FT_UINT32, BASE_DEC,
5079 NULL, 0, "Total Count (obsolete)" }},
5080 { &hf_nfs_symlink_to, {
5081 "To", "nfs.symlink.to", FT_STRING, BASE_DEC,
5082 NULL, 0, "Symbolic link destination name" }},
5083 { &hf_nfs_readdir_cookie, {
5084 "Cookie", "nfs.readdir.cookie", FT_UINT32, BASE_DEC,
5085 NULL, 0, "Directory Cookie" }},
5086 { &hf_nfs_readdir_count, {
5087 "Count", "nfs.readdir.count", FT_UINT32, BASE_DEC,
5088 NULL, 0, "Directory Count" }},
5089 { &hf_nfs_readdir_entry, {
5090 "Entry", "nfs.readdir.entry", FT_NONE, 0,
5091 NULL, 0, "Directory Entry" }},
5092 { &hf_nfs_readdir_entry_fileid, {
5093 "File ID", "nfs.readdir.entry.fileid", FT_UINT32, BASE_DEC,
5094 NULL, 0, "File ID" }},
5095 { &hf_nfs_readdir_entry_name, {
5096 "Name", "nfs.readdir.entry.name", FT_STRING, BASE_DEC,
5098 { &hf_nfs_readdirplus_entry_name, {
5099 "Name", "nfs.readdirplus.entry.name", FT_STRING, BASE_DEC,
5101 { &hf_nfs_readdir_entry_cookie, {
5102 "Cookie", "nfs.readdir.entry.cookie", FT_UINT32, BASE_DEC,
5103 NULL, 0, "Directory Cookie" }},
5104 { &hf_nfs_readdir_eof, {
5105 "EOF", "nfs.readdir.eof", FT_UINT32, BASE_DEC,
5107 { &hf_nfs_statfs_tsize, {
5108 "Transfer Size", "nfs.statfs.tsize", FT_UINT32, BASE_DEC,
5109 NULL, 0, "Transfer Size" }},
5110 { &hf_nfs_statfs_bsize, {
5111 "Block Size", "nfs.statfs.bsize", FT_UINT32, BASE_DEC,
5112 NULL, 0, "Block Size" }},
5113 { &hf_nfs_statfs_blocks, {
5114 "Total Blocks", "nfs.statfs.blocks", FT_UINT32, BASE_DEC,
5115 NULL, 0, "Total Blocks" }},
5116 { &hf_nfs_statfs_bfree, {
5117 "Free Blocks", "nfs.statfs.bfree", FT_UINT32, BASE_DEC,
5118 NULL, 0, "Free Blocks" }},
5119 { &hf_nfs_statfs_bavail, {
5120 "Available Blocks", "nfs.statfs.bavail", FT_UINT32, BASE_DEC,
5121 NULL, 0, "Available Blocks" }},
5123 "Type", "nfs.type", FT_UINT32, BASE_DEC,
5124 VALS(names_nfs_ftype3), 0, "File Type" }},
5125 { &hf_nfs_nfsstat3, {
5126 "Status", "nfs.status", FT_UINT32, BASE_DEC,
5127 VALS(names_nfs_nfsstat3), 0, "Reply status" }},
5128 { &hf_nfs_read_eof, {
5129 "EOF", "nfs.read.eof", FT_BOOLEAN, BASE_NONE,
5130 &yesno, 0, "EOF" }},
5131 { &hf_nfs_write_stable, {
5132 "Stable", "nfs.write.stable", FT_UINT32, BASE_DEC,
5133 VALS(names_stable_how), 0, "Stable" }},
5134 { &hf_nfs_write_committed, {
5135 "Committed", "nfs.write.committed", FT_UINT32, BASE_DEC,
5136 VALS(names_stable_how), 0, "Committed" }},
5137 { &hf_nfs_createmode3, {
5138 "Create Mode", "nfs.createmode", FT_UINT32, BASE_DEC,
5139 VALS(names_createmode3), 0, "Create Mode" }},
5140 { &hf_nfs_fsstat_invarsec, {
5141 "invarsec", "nfs.fsstat.invarsec", FT_UINT32, BASE_DEC,
5142 NULL, 0, "probable number of seconds of file system invariance" }},
5143 { &hf_nfs_fsinfo_rtmax, {
5144 "rtmax", "nfs.fsinfo.rtmax", FT_UINT32, BASE_DEC,
5145 NULL, 0, "maximum READ request" }},
5146 { &hf_nfs_fsinfo_rtpref, {
5147 "rtpref", "nfs.fsinfo.rtpref", FT_UINT32, BASE_DEC,
5148 NULL, 0, "preferred READ request" }},
5149 { &hf_nfs_fsinfo_rtmult, {
5150 "rtmult", "nfs.fsinfo.rtmult", FT_UINT32, BASE_DEC,
5151 NULL, 0, "suggested READ multiple" }},
5152 { &hf_nfs_fsinfo_wtmax, {
5153 "wtmax", "nfs.fsinfo.wtmax", FT_UINT32, BASE_DEC,
5154 NULL, 0, "maximum WRITE request" }},
5155 { &hf_nfs_fsinfo_wtpref, {
5156 "wtpref", "nfs.fsinfo.wtpref", FT_UINT32, BASE_DEC,
5157 NULL, 0, "preferred WRITE request" }},
5158 { &hf_nfs_fsinfo_wtmult, {
5159 "wtmult", "nfs.fsinfo.wtmult", FT_UINT32, BASE_DEC,
5160 NULL, 0, "suggested WRITE multiple" }},
5161 { &hf_nfs_fsinfo_dtpref, {
5162 "dtpref", "nfs.fsinfo.dtpref", FT_UINT32, BASE_DEC,
5163 NULL, 0, "preferred READDIR request" }},
5164 { &hf_nfs_fsinfo_properties, {
5165 "Properties", "nfs.fsinfo.propeties", FT_UINT32, BASE_HEX,
5166 NULL, 0, "File System Properties" }},
5167 { &hf_nfs_pathconf_linkmax, {
5168 "linkmax", "nfs.pathconf.linkmax", FT_UINT32, BASE_DEC,
5169 NULL, 0, "Maximum number of hard links" }},
5170 { &hf_nfs_pathconf_name_max, {
5171 "name_max", "nfs.pathconf.name_max", FT_UINT32, BASE_DEC,
5172 NULL, 0, "Maximum file name length" }},
5173 { &hf_nfs_pathconf_no_trunc, {
5174 "no_trunc", "nfs.pathconf.no_trunc", FT_BOOLEAN, BASE_NONE,
5175 &yesno, 0, "No long file name truncation" }},
5176 { &hf_nfs_pathconf_chown_restricted, {
5177 "chown_restricted", "nfs.pathconf.chown_restricted", FT_BOOLEAN, BASE_NONE,
5178 &yesno, 0, "chown is restricted to root" }},
5179 { &hf_nfs_pathconf_case_insensitive, {
5180 "case_insensitive", "nfs.pathconf.case_insensitive", FT_BOOLEAN, BASE_NONE,
5181 &yesno, 0, "file names are treated case insensitive" }},
5182 { &hf_nfs_pathconf_case_preserving, {
5183 "case_preserving", "nfs.pathconf.case_preserving", FT_BOOLEAN, BASE_NONE,
5184 &yesno, 0, "file name cases are preserved" }},
5189 "Opcode", "nfs.call.operation", FT_UINT32, BASE_DEC,
5190 VALS(names_nfsv4_operation), 0, "Opcode" }},
5193 "Opcode", "nfs.reply.operation", FT_UINT32, BASE_DEC,
5194 VALS(names_nfsv4_operation), 0, "Opcode" }},
5196 { &hf_nfs_linktext4, {
5197 "Name", "nfs.symlink.linktext", FT_STRING, BASE_DEC,
5198 NULL, 0, "Symbolic link contents" }},
5200 { &hf_nfs_component4, {
5201 "Filename", "nfs.pathname.component", FT_STRING, BASE_DEC,
5202 NULL, 0, "Pathname component" }},
5205 "Tag", "nfs.tag", FT_STRING, BASE_DEC,
5208 { &hf_nfs_clientid4, {
5209 "Client ID", "nfs.clientid", FT_STRING, BASE_DEC,
5213 "ace", "nfs.ace", FT_STRING, BASE_DEC,
5214 NULL, 0, "Access Control Entry" }},
5217 "EOF", "nfs.recall", FT_BOOLEAN, BASE_NONE,
5218 &yesno, 0, "Recall" }},
5220 { &hf_nfs_open_claim_type4, {
5221 "Claim Type", "nfs.open.claim_type", FT_UINT32, BASE_DEC,
5222 VALS(names_claim_type4), 0, "Claim Type" }},
5224 { &hf_nfs_opentype4, {
5225 "Open Type", "nfs.open.opentype", FT_UINT32, BASE_DEC,
5226 VALS(names_opentype4), 0, "Open Type" }},
5228 { &hf_nfs_limit_by4, {
5229 "Space Limit", "nfs.open.limit_by", FT_UINT32, BASE_DEC,
5230 VALS(names_limit_by4), 0, "Limit By" }},
5232 { &hf_nfs_open_delegation_type4, {
5233 "Delegation Type", "nfs.open.delegation_type", FT_UINT32, BASE_DEC,
5234 VALS(names_open_delegation_type4), 0, "Delegation Type" }},
5237 "File Type", "nfs.ftype4", FT_UINT32, BASE_DEC,
5238 VALS(names_ftype4), 0, "File Type" }},
5240 { &hf_nfs_nfsstat4, {
5241 "Status", "nfs.nfsstat4", FT_UINT32, BASE_DEC,
5242 VALS(names_nfsstat4), 0, "Status" }}
5245 static gint *ett[] = {
5258 &ett_nfs_readdir_entry,
5264 &ett_nfs_post_op_fh3,
5266 &ett_nfs_diropargs3,
5267 &ett_nfs_sattrguard3,
5274 &ett_nfs_pre_op_attr,
5275 &ett_nfs_post_op_attr,
5279 &ett_nfs_fsinfo_properties,
5280 &ett_nfs_compound_call4,
5281 &ett_nfs_utf8string,
5288 &ett_nfs_delegpurge4,
5289 &ett_nfs_delegreturn4,
5301 &ett_nfs_open_confirm4,
5302 &ett_nfs_open_downgrade4,
5305 &ett_nfs_putrootfh4,
5312 &ett_nfs_restorefh4,
5316 &ett_nfs_setclientid4,
5317 &ett_nfs_setclientid_confirm4,
5324 &ett_nfs_change_info4,
5325 &ett_nfs_open_delegation4,
5326 &ett_nfs_open_claim4,
5328 &ett_nfs_lockowner4,
5329 &ett_nfs_cb_client4,
5330 &ett_nfs_client_id4,
5333 proto_nfs = proto_register_protocol("Network File System", "NFS", "nfs");
5334 proto_register_field_array(proto_nfs, hf, array_length(hf));
5335 proto_register_subtree_array(ett, array_length(ett));
5339 proto_reg_handoff_nfs(void)
5341 /* Register the protocol as RPC */
5342 rpc_init_prog(proto_nfs, NFS_PROGRAM, ett_nfs);
5343 /* Register the procedure tables */
5344 rpc_init_proc_table(NFS_PROGRAM, 2, nfs2_proc);
5345 rpc_init_proc_table(NFS_PROGRAM, 3, nfs3_proc);
5346 rpc_init_proc_table(NFS_PROGRAM, 4, nfs4_proc);