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.50 2001/03/09 04:35:22 guy 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;
111 static int hf_nfs_data_follows = -1;
114 static int hf_nfs_argop4 = -1;
115 static int hf_nfs_resop4 = -1;
116 static int hf_nfs_linktext4 = -1;
117 static int hf_nfs_tag4 = -1;
118 static int hf_nfs_component4 = -1;
119 static int hf_nfs_clientid4 = -1;
120 static int hf_nfs_ace4 = -1;
121 static int hf_nfs_recall = -1;
122 static int hf_nfs_open_claim_type4 = -1;
123 static int hf_nfs_opentype4 = -1;
124 static int hf_nfs_limit_by4 = -1;
125 static int hf_nfs_open_delegation_type4 = -1;
126 static int hf_nfs_ftype4 = -1;
127 static int hf_nfs_change_info4_atomic = -1;
128 static int hf_nfs_open4_share_access = -1;
129 static int hf_nfs_open4_share_deny = -1;
130 static int hf_nfs_seqid4 = -1;
131 static int hf_nfs_mand_attr = -1;
132 static int hf_nfs_recc_attr = -1;
133 static int hf_nfs_time_how4 = -1;
134 static int hf_nfs_attrlist4 = -1;
135 static int hf_nfs_fattr4_expire_type = -1;
136 static int hf_nfs_fattr4_link_support = -1;
137 static int hf_nfs_fattr4_symlink_support = -1;
138 static int hf_nfs_fattr4_named_attr = -1;
139 static int hf_nfs_fattr4_unique_handles = -1;
140 static int hf_nfs_fattr4_archive = -1;
141 static int hf_nfs_fattr4_cansettime = -1;
142 static int hf_nfs_fattr4_case_insensitive = -1;
143 static int hf_nfs_fattr4_case_preserving = -1;
144 static int hf_nfs_fattr4_chown_restricted = -1;
145 static int hf_nfs_fattr4_hidden = -1;
146 static int hf_nfs_fattr4_homogeneous = -1;
147 static int hf_nfs_fattr4_mimetype = -1;
148 static int hf_nfs_fattr4_no_trunc = -1;
149 static int hf_nfs_fattr4_system = -1;
150 static int hf_nfs_who = -1;
151 static int hf_nfs_server = -1;
152 static int hf_nfs_fattr4_owner = -1;
153 static int hf_nfs_fattr4_owner_group = -1;
154 static int hf_nfs_stable_how4 = -1;
155 static int hf_nfs_dirlist4_eof = -1;
157 static gint ett_nfs = -1;
158 static gint ett_nfs_fh_fsid = -1;
159 static gint ett_nfs_fh_xfsid = -1;
160 static gint ett_nfs_fh_fn = -1;
161 static gint ett_nfs_fh_xfn = -1;
162 static gint ett_nfs_fh_hp = -1;
163 static gint ett_nfs_fhandle = -1;
164 static gint ett_nfs_timeval = -1;
165 static gint ett_nfs_mode = -1;
166 static gint ett_nfs_fattr = -1;
167 static gint ett_nfs_sattr = -1;
168 static gint ett_nfs_diropargs = -1;
169 static gint ett_nfs_readdir_entry = -1;
170 static gint ett_nfs_mode3 = -1;
171 static gint ett_nfs_specdata3 = -1;
172 static gint ett_nfs_fh3 = -1;
173 static gint ett_nfs_nfstime3 = -1;
174 static gint ett_nfs_fattr3 = -1;
175 static gint ett_nfs_post_op_fh3 = -1;
176 static gint ett_nfs_sattr3 = -1;
177 static gint ett_nfs_diropargs3 = -1;
178 static gint ett_nfs_sattrguard3 = -1;
179 static gint ett_nfs_set_mode3 = -1;
180 static gint ett_nfs_set_uid3 = -1;
181 static gint ett_nfs_set_gid3 = -1;
182 static gint ett_nfs_set_size3 = -1;
183 static gint ett_nfs_set_atime = -1;
184 static gint ett_nfs_set_mtime = -1;
185 static gint ett_nfs_pre_op_attr = -1;
186 static gint ett_nfs_post_op_attr = -1;
187 static gint ett_nfs_wcc_attr = -1;
188 static gint ett_nfs_wcc_data = -1;
189 static gint ett_nfs_access = -1;
190 static gint ett_nfs_fsinfo_properties = -1;
193 static gint ett_nfs_compound_call4 = -1;
194 static gint ett_nfs_utf8string = -1;
195 static gint ett_nfs_argop4 = -1;
196 static gint ett_nfs_resop4 = -1;
197 static gint ett_nfs_access4 = -1;
198 static gint ett_nfs_close4 = -1;
199 static gint ett_nfs_commit4 = -1;
200 static gint ett_nfs_create4 = -1;
201 static gint ett_nfs_delegpurge4 = -1;
202 static gint ett_nfs_delegreturn4 = -1;
203 static gint ett_nfs_getattr4 = -1;
204 static gint ett_nfs_getfh4 = -1;
205 static gint ett_nfs_link4 = -1;
206 static gint ett_nfs_lock4 = -1;
207 static gint ett_nfs_lockt4 = -1;
208 static gint ett_nfs_locku4 = -1;
209 static gint ett_nfs_lookup4 = -1;
210 static gint ett_nfs_lookupp4 = -1;
211 static gint ett_nfs_nverify4 = -1;
212 static gint ett_nfs_open4 = -1;
213 static gint ett_nfs_openattr4 = -1;
214 static gint ett_nfs_open_confirm4 = -1;
215 static gint ett_nfs_open_downgrade4 = -1;
216 static gint ett_nfs_putfh4 = -1;
217 static gint ett_nfs_putpubfh4 = -1;
218 static gint ett_nfs_putrootfh4 = -1;
219 static gint ett_nfs_read4 = -1;
220 static gint ett_nfs_readdir4 = -1;
221 static gint ett_nfs_readlink4 = -1;
222 static gint ett_nfs_remove4 = -1;
223 static gint ett_nfs_rename4 = -1;
224 static gint ett_nfs_renew4 = -1;
225 static gint ett_nfs_restorefh4 = -1;
226 static gint ett_nfs_savefh4 = -1;
227 static gint ett_nfs_secinfo4 = -1;
228 static gint ett_nfs_setattr4 = -1;
229 static gint ett_nfs_setclientid4 = -1;
230 static gint ett_nfs_setclientid_confirm4 = -1;
231 static gint ett_nfs_verify4 = -1;
232 static gint ett_nfs_write4 = -1;
233 static gint ett_nfs_verifier4 = -1;
234 static gint ett_nfs_opaque = -1;
235 static gint ett_nfs_dirlist4 = -1;
236 static gint ett_nfs_pathname4 = -1;
237 static gint ett_nfs_change_info4 = -1;
238 static gint ett_nfs_open_delegation4 = -1;
239 static gint ett_nfs_open_claim4 = -1;
240 static gint ett_nfs_opentype4 = -1;
241 static gint ett_nfs_lockowner4 = -1;
242 static gint ett_nfs_cb_client4 = -1;
243 static gint ett_nfs_client_id4 = -1;
244 static gint ett_nfs_bitmap4 = -1;
245 static gint ett_nfs_fattr4 = -1;
246 static gint ett_nfs_fsid4 = -1;
247 static gint ett_nfs_fs_locations4 = -1;
248 static gint ett_nfs_fs_location4 = -1;
249 static gint ett_nfs_open4_result_flags = -1;
251 /* file handle dissection */
253 #define FHT_UNKNOWN 0
255 #define FHT_LINUX_KNFSD_LE 2
256 #define FHT_LINUX_NFSD_LE 3
258 const value_string names_fhtype[] =
260 { FHT_UNKNOWN, "unknown" },
261 { FHT_SVR4, "System V R4" },
262 { FHT_LINUX_KNFSD_LE, "Linux knfsd (little-endian)" },
263 { FHT_LINUX_NFSD_LE, "Linux user-land nfsd (little-endian)" },
268 /* SVR4: checked with ReliantUNIX (5.43, 5.44, 5.45) */
271 dissect_fhandle_data_SVR4(tvbuff_t* tvb, int offset, proto_tree *tree,
274 guint32 nof = offset;
286 temp = tvb_get_ntohl(tvb, fsid_O);
287 fsid_major = ( temp>>18 ) & 0x3fff; /* 14 bits */
288 fsid_minor = ( temp ) & 0x3ffff; /* 18 bits */
290 proto_item* fsid_item = NULL;
291 proto_tree* fsid_tree = NULL;
293 fsid_item = proto_tree_add_text(tree, tvb,
295 "file system ID: %d,%d", fsid_major, fsid_minor);
297 fsid_tree = proto_item_add_subtree(fsid_item,
299 proto_tree_add_uint(fsid_tree, hf_nfs_fh_fsid_major,
300 tvb, fsid_O, 2, fsid_major);
301 proto_tree_add_uint(fsid_tree, hf_nfs_fh_fsid_minor,
302 tvb, fsid_O+1, 3, fsid_minor);
305 nof = fsid_O + fsid_L;
308 /* file system type */
316 fstype = tvb_get_ntohl(tvb, fstype_O);
318 proto_tree_add_uint(tree, hf_nfs_fh_fstype, tvb,
319 fstype_O, fstype_L, fstype);
321 nof = fstype_O + fstype_L;
331 guint32 fn_data_inode_O;
332 guint32 fn_data_inode_L;
334 guint32 fn_data_gen_O;
335 guint32 fn_data_gen_L;
342 fn_len = tvb_get_ntohs(tvb, fn_len_O);
343 fn_data_O = fn_O + fn_len_L;
344 fn_data_inode_O = fn_data_O + 2;
346 inode = tvb_get_ntohl(tvb, fn_data_inode_O);
347 fn_data_gen_O = fn_data_inode_O + fn_data_inode_L;
349 gen = tvb_get_ntohl(tvb, fn_data_gen_O);
350 fn_L = fn_len_L + fn_len;
352 proto_item* fn_item = NULL;
353 proto_tree* fn_tree = NULL;
355 fn_item = proto_tree_add_uint(tree, hf_nfs_fh_fn, tvb,
358 fn_tree = proto_item_add_subtree(fn_item,
360 proto_tree_add_uint(fn_tree, hf_nfs_fh_fn_len,
361 tvb, fn_len_O, fn_len_L, fn_len);
362 proto_tree_add_uint(fn_tree, hf_nfs_fh_fn_inode,
363 tvb, fn_data_inode_O, fn_data_inode_L, inode);
364 proto_tree_add_uint(fn_tree, hf_nfs_fh_fn_generation,
365 tvb, fn_data_gen_O, fn_data_gen_L, gen);
368 nof = fn_O + fn_len_L + fn_len;
371 /* exported file number */
378 guint32 xfn_data_inode_O;
379 guint32 xfn_data_inode_L;
381 guint32 xfn_data_gen_O;
382 guint32 xfn_data_gen_L;
389 xfn_len = tvb_get_ntohs(tvb, xfn_len_O);
390 xfn_data_O = xfn_O + xfn_len_L;
391 xfn_data_inode_O = xfn_data_O + 2;
392 xfn_data_inode_L = 4;
393 xinode = tvb_get_ntohl(tvb, xfn_data_inode_O);
394 xfn_data_gen_O = xfn_data_inode_O + xfn_data_inode_L;
396 xgen = tvb_get_ntohl(tvb, xfn_data_gen_O);
397 xfn_L = xfn_len_L + xfn_len;
399 proto_item* xfn_item = NULL;
400 proto_tree* xfn_tree = NULL;
402 xfn_item = proto_tree_add_uint(tree, hf_nfs_fh_xfn, tvb,
403 xfn_O, xfn_L, xinode);
405 xfn_tree = proto_item_add_subtree(xfn_item,
407 proto_tree_add_uint(xfn_tree, hf_nfs_fh_xfn_len,
408 tvb, xfn_len_O, xfn_len_L, xfn_len);
409 proto_tree_add_uint(xfn_tree, hf_nfs_fh_xfn_inode,
410 tvb, xfn_data_inode_O, xfn_data_inode_L, xinode);
411 proto_tree_add_uint(xfn_tree, hf_nfs_fh_xfn_generation,
412 tvb, xfn_data_gen_O, xfn_data_gen_L, xgen);
419 /* Checked with RedHat Linux 6.2 (kernel 2.2.14 knfsd) */
422 dissect_fhandle_data_LINUX_KNFSD_LE(tvbuff_t* tvb, int offset, proto_tree *tree,
436 dentry = tvb_get_letohl(tvb, offset+0);
437 inode = tvb_get_letohl(tvb, offset+4);
438 dirinode = tvb_get_letohl(tvb, offset+8);
439 temp = tvb_get_letohs (tvb,offset+12);
440 fsid_major = (temp >> 8) & 0xff;
441 fsid_minor = (temp ) & 0xff;
442 temp = tvb_get_letohs(tvb,offset+16);
443 xfsid_major = (temp >> 8) & 0xff;
444 xfsid_minor = (temp ) & 0xff;
445 xinode = tvb_get_letohl(tvb,offset+20);
446 gen = tvb_get_letohl(tvb,offset+24);
449 proto_tree_add_uint(tree, hf_nfs_fh_dentry,
450 tvb, offset+0, 4, dentry);
451 proto_tree_add_uint(tree, hf_nfs_fh_fn_inode,
452 tvb, offset+4, 4, inode);
453 proto_tree_add_uint(tree, hf_nfs_fh_dirinode,
454 tvb, offset+8, 4, dirinode);
456 /* file system id (device) */
458 proto_item* fsid_item = NULL;
459 proto_tree* fsid_tree = NULL;
461 fsid_item = proto_tree_add_text(tree, tvb,
463 "file system ID: %d,%d", fsid_major, fsid_minor);
465 fsid_tree = proto_item_add_subtree(fsid_item,
467 proto_tree_add_uint(fsid_tree, hf_nfs_fh_fsid_major,
468 tvb, offset+13, 1, fsid_major);
469 proto_tree_add_uint(fsid_tree, hf_nfs_fh_fsid_minor,
470 tvb, offset+12, 1, fsid_minor);
474 /* exported file system id (device) */
476 proto_item* xfsid_item = NULL;
477 proto_tree* xfsid_tree = NULL;
479 xfsid_item = proto_tree_add_text(tree, tvb,
481 "exported file system ID: %d,%d", xfsid_major, xfsid_minor);
483 xfsid_tree = proto_item_add_subtree(xfsid_item,
485 proto_tree_add_uint(xfsid_tree, hf_nfs_fh_xfsid_major,
486 tvb, offset+17, 1, xfsid_major);
487 proto_tree_add_uint(xfsid_tree, hf_nfs_fh_xfsid_minor,
488 tvb, offset+16, 1, xfsid_minor);
492 proto_tree_add_uint(tree, hf_nfs_fh_xfn_inode,
493 tvb, offset+20, 4, xinode);
494 proto_tree_add_uint(tree, hf_nfs_fh_fn_generation,
495 tvb, offset+24, 4, gen);
500 /* Checked with RedHat Linux 5.2 (nfs-server 2.2beta47 user-land nfsd) */
503 dissect_fhandle_data_LINUX_NFSD_LE(tvbuff_t* tvb, int offset, proto_tree *tree,
509 pinode = tvb_get_letohl(tvb, offset+0);
511 proto_tree_add_uint(tree, hf_nfs_fh_pinode,
512 tvb, offset+0, 4, pinode);
520 hashlen = tvb_get_guint8(tvb, offset+4);
522 proto_item* hash_item = NULL;
523 proto_tree* hash_tree = NULL;
525 hash_item = proto_tree_add_text(tree, tvb, offset+4,
528 tvb_bytes_to_str(tvb,offset+5,hashlen));
530 hash_tree = proto_item_add_subtree(hash_item,
533 proto_tree_add_uint(hash_tree,
534 hf_nfs_fh_hp_len, tvb, offset+4, 1,
536 proto_tree_add_text(hash_tree, tvb, offset+5,
539 tvb_bytes_to_str(tvb,offset+5,hashlen));
548 dissect_fhandle_data_unknown(tvbuff_t *tvb, int offset, proto_tree *tree,
557 while (bytes_left != 0) {
559 if (sublen > bytes_left)
561 proto_tree_add_text(tree, tvb, offset, sublen,
563 first_line ? "data: " :
565 tvb_bytes_to_str(tvb,offset,sublen));
566 bytes_left -= sublen;
574 dissect_fhandle_data(tvbuff_t *tvb, int offset, packet_info *pinfo,
575 proto_tree *tree, int fhlen)
577 int fhtype = FHT_UNKNOWN;
579 /* filehandle too long */
580 if (fhlen>64) goto type_ready;
581 /* Not all bytes there. Any attempt to deduce the type would be
583 if (!tvb_bytes_exist(tvb,offset,fhlen)) goto type_ready;
585 /* calculate (heuristically) fhtype */
590 if (tvb_get_ntohs(tvb,offset+4) == 0) {
591 len1=tvb_get_ntohs(tvb,offset+8);
592 if (tvb_bytes_exist(tvb,offset+10+len1,2)) {
593 len2=tvb_get_ntohs(tvb,
595 if (fhlen==12+len1+len2) {
601 len1 = tvb_get_guint8(tvb,offset+4);
602 if (len1<28 && tvb_bytes_exist(tvb,offset+5,len1)) {
604 for (len2=5+len1;len2<32;len2++) {
605 if (tvb_get_guint8(tvb,offset+len2)) {
611 fhtype=FHT_LINUX_NFSD_LE;
615 if (tvb_get_ntohl(tvb,offset+28) == 0) {
616 if (tvb_get_ntohs(tvb,offset+14) == 0) {
617 if (tvb_get_ntohs(tvb,offset+18) == 0) {
618 fhtype=FHT_LINUX_KNFSD_LE;
628 proto_tree_add_text(tree, tvb, offset, 0,
629 "type: %s", val_to_str(fhtype, names_fhtype, "Unknown"));
633 dissect_fhandle_data_SVR4 (tvb, offset, tree,
636 case FHT_LINUX_KNFSD_LE:
637 dissect_fhandle_data_LINUX_KNFSD_LE(tvb, offset, tree,
640 case FHT_LINUX_NFSD_LE:
641 dissect_fhandle_data_LINUX_NFSD_LE (tvb, offset, tree,
646 dissect_fhandle_data_unknown(tvb, offset, tree, fhlen);
652 /***************************/
653 /* NFS Version 2, RFC 1094 */
654 /***************************/
657 /* base 32 bit type for NFS v2 */
659 dissect_unsigned_int(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
662 offset = dissect_rpc_uint32(pd,offset,fd,tree,name);
667 /* RFC 1094, Page 12..14 */
668 const value_string names_nfs_stat[] =
677 { 18, "ERR_XDEV" }, /* not in spec, but can happen */
679 { 20, "ERR_NOTDIR" },
681 { 22, "ERR_INVAL" }, /* not in spec, but I think it can happen */
682 { 26, "ERR_TXTBSY" }, /* not in spec, but I think it can happen */
686 { 31, "ERR_MLINK" }, /* not in spec, but can happen */
687 { 45, "ERR_OPNOTSUPP" }, /* not in spec, but I think it can happen */
688 { 63, "ERR_NAMETOOLONG" },
689 { 66, "ERR_NOTEMPTY" },
692 { 99, "ERR_WFLUSH" },
696 /* NFSv4 Draft Specification, Page 198-199 */
697 const value_string names_nfs_stat4[] = {
699 { 1, "NFS4ERR_PERM" },
700 { 2, "NFS4ERR_NOENT" },
702 { 6, "NFS4ERR_NXIO" },
703 { 13, "NFS4ERR_ACCES" },
704 { 17, "NFS4ERR_EXIST" },
705 { 18, "NFS4ERR_XDEV" },
706 { 19, "NFS4ERR_NODEV" },
707 { 20, "NFS4ERR_NOTDIR" },
708 { 21, "NFS4ERR_ISDIR" },
709 { 22, "NFS4ERR_INVAL" },
710 { 27, "NFS4ERR_FBIG" },
711 { 28, "NFS4ERR_NOSPC" },
712 { 30, "NFS4ERR_ROFS" },
713 { 31, "NFS4ERR_MLINK" },
714 { 63, "NFS4ERR_NAMETOOLONG" },
715 { 66, "NFS4ERR_NOTEMPTY" },
716 { 69, "NFS4ERR_DQUOT" },
717 { 70, "NFS4ERR_STALE" },
718 { 10001, "NFS4ERR_BADHANDLE" },
719 { 10003, "NFS4ERR_BAD_COOKIE" },
720 { 10004, "NFS4ERR_NOTSUPP" },
721 { 10005, "NFS4ERR_TOOSMALL" },
722 { 10006, "NFS4ERR_SERVERFAULT" },
723 { 10007, "NFS4ERR_BADTYPE" },
724 { 10008, "NFS4ERR_DELAY" },
725 { 10009, "NFS4ERR_SAME" },
726 { 10010, "NFS4ERR_DENIED" },
727 { 10011, "NFS4ERR_EXPIRED" },
728 { 10012, "NFS4ERR_LOCKED" },
729 { 10013, "NFS4ERR_GRACE" },
730 { 10014, "NFS4ERR_FHEXPIRED" },
731 { 10015, "NFS4ERR_SHARE_DENIED" },
732 { 10016, "NFS4ERR_WRONGSEC" },
733 { 10017, "NFS4ERR_CLID_INUSE" },
734 { 10018, "NFS4ERR_RESOURCE" },
735 { 10019, "NFS4ERR_MOVED" },
736 { 10020, "NFS4ERR_NOFILEHANDLE" },
737 { 10021, "NFS4ERR_MINOR_VERS_MISMATCH" },
738 { 10022, "NFS4ERR_STALE_CLIENTID" },
739 { 10023, "NFS4ERR_STALE_STATEID" },
740 { 10024, "NFS4ERR_OLD_STATEID" },
741 { 10025, "NFS4ERR_BAD_STATEID" },
742 { 10026, "NFS4ERR_BAD_SEQID" },
743 { 10027, "NFS4ERR_NOT_SAME" },
744 { 10028, "NFS4ERR_LOCK_RANGE" },
745 { 10029, "NFS4ERR_SYMLINK" },
746 { 10030, "NFS4ERR_READDIR_NOSPC" },
747 { 10031, "NFS4ERR_LEASE_MOVED" },
752 /* This function has been modified to support NFSv4 style error codes as
753 * well as being backwards compatible with NFSv2 and NFSv3.
756 dissect_stat_internal(const u_char *pd, int offset, frame_data *fd,
757 proto_tree *tree, guint32* status, int nfsvers)
761 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
762 stat = EXTRACT_UINT(pd, offset+0);
765 /* this gives the right NFSv2 number<->message relation */
766 /* and makes it searchable via "nfs.status" */
767 proto_tree_add_uint_format(tree, hf_nfs_nfsstat3, NullTVB,
768 offset+0, 4, stat, "Status: %s (%u)",
770 (nfsvers != 4)? names_nfs_stat: names_nfs_stat4,"%u"), stat);
779 /* RFC 1094, Page 12..14 */
781 dissect_stat(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
784 return dissect_stat_internal(pd, offset, fd, tree, status, !4);
788 /* RFC 1094, Page 12..14 */
790 dissect_nfs2_stat_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
794 offset = dissect_stat(pd, offset, fd, tree, &status);
801 dissect_nfs_nfsstat4(const u_char *pd, int offset, frame_data *fd,
802 proto_tree *tree, guint32 *status)
804 return dissect_stat_internal(pd, offset, fd, tree, status, 4);
808 /* RFC 1094, Page 15 */
810 dissect_ftype(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
814 char* ftype_name = NULL;
816 const value_string nfs2_ftype[] =
819 { 1, "Regular File" },
821 { 3, "Block Special Device" },
822 { 4, "Character Special Device" },
823 { 5, "Symbolic Link" },
827 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
828 ftype = EXTRACT_UINT(pd, offset+0);
829 ftype_name = val_to_str(ftype, nfs2_ftype, "%u");
832 proto_tree_add_text(tree, NullTVB, offset, 4,
833 "%s: %s (%u)", name, ftype_name, ftype);
841 /* RFC 1094, Page 15 */
843 old_dissect_fhandle(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
845 tvbuff_t *tvb = tvb_create_from_top(offset);
847 offset = dissect_fhandle(tvb, 0, &pi, tree, name);
848 return tvb_raw_offset(tvb) + offset;
852 dissect_fhandle(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
856 proto_tree* ftree = NULL;
859 fitem = proto_tree_add_text(tree, tvb, offset, FHSIZE,
862 ftree = proto_item_add_subtree(fitem, ett_nfs_fhandle);
866 dissect_fhandle_data(tvb, offset, pinfo, ftree, FHSIZE);
872 /* RFC 1094, Page 15 */
874 dissect_nfs2_fhandle_call(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
876 offset = old_dissect_fhandle(pd, offset, fd, tree, "object");
882 /* RFC 1094, Page 15 */
884 dissect_timeval(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
889 proto_item* time_item;
890 proto_tree* time_tree = NULL;
892 if (!BYTES_ARE_IN_FRAME(offset,8)) return offset;
893 seconds = EXTRACT_UINT(pd, offset+0);
894 mseconds = EXTRACT_UINT(pd, offset+4);
897 time_item = proto_tree_add_text(tree, NullTVB, offset, 8,
898 "%s: %u.%06u", name, seconds, mseconds);
900 time_tree = proto_item_add_subtree(time_item, ett_nfs_timeval);
904 proto_tree_add_text(time_tree, NullTVB,offset+0,4,
905 "seconds: %u", seconds);
906 proto_tree_add_text(time_tree, NullTVB,offset+4,4,
907 "micro seconds: %u", mseconds);
914 /* RFC 1094, Page 16 */
915 const value_string nfs2_mode_names[] = {
916 { 0040000, "Directory" },
917 { 0020000, "Character Special Device" },
918 { 0060000, "Block Special Device" },
919 { 0100000, "Regular File" },
920 { 0120000, "Symbolic Link" },
921 { 0140000, "Named Socket" },
926 dissect_mode(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
930 proto_item* mode_item = NULL;
931 proto_tree* mode_tree = NULL;
933 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
934 mode = EXTRACT_UINT(pd, offset+0);
937 mode_item = proto_tree_add_text(tree, NullTVB, offset, 4,
938 "%s: 0%o", name, mode);
940 mode_tree = proto_item_add_subtree(mode_item, ett_nfs_mode);
944 proto_tree_add_text(mode_tree, NullTVB, offset, 4, "%s",
945 decode_enumerated_bitfield(mode, 0160000, 16,
946 nfs2_mode_names, "%s"));
947 proto_tree_add_text(mode_tree, NullTVB, offset, 4, "%s",
948 decode_boolean_bitfield(mode, 04000, 16, "Set user id on exec", "not SUID"));
949 proto_tree_add_text(mode_tree, NullTVB, offset, 4, "%s",
950 decode_boolean_bitfield(mode, 02000, 16, "Set group id on exec", "not SGID"));
951 proto_tree_add_text(mode_tree, NullTVB, offset, 4, "%s",
952 decode_boolean_bitfield(mode, 01000, 16, "Save swapped text even after use", "not save swapped text"));
953 proto_tree_add_text(mode_tree, NullTVB, offset, 4, "%s",
954 decode_boolean_bitfield(mode, 0400, 16, "Read permission for owner", "no Read permission for owner"));
955 proto_tree_add_text(mode_tree, NullTVB, offset, 4, "%s",
956 decode_boolean_bitfield(mode, 0200, 16, "Write permission for owner", "no Write permission for owner"));
957 proto_tree_add_text(mode_tree, NullTVB, offset, 4, "%s",
958 decode_boolean_bitfield(mode, 0100, 16, "Execute permission for owner", "no Execute permission for owner"));
959 proto_tree_add_text(mode_tree, NullTVB, offset, 4, "%s",
960 decode_boolean_bitfield(mode, 040, 16, "Read permission for group", "no Read permission for group"));
961 proto_tree_add_text(mode_tree, NullTVB, offset, 4, "%s",
962 decode_boolean_bitfield(mode, 020, 16, "Write permission for group", "no Write permission for group"));
963 proto_tree_add_text(mode_tree, NullTVB, offset, 4, "%s",
964 decode_boolean_bitfield(mode, 010, 16, "Execute permission for group", "no Execute permission for group"));
965 proto_tree_add_text(mode_tree, NullTVB, offset, 4, "%s",
966 decode_boolean_bitfield(mode, 04, 16, "Read permission for others", "no Read permission for others"));
967 proto_tree_add_text(mode_tree, NullTVB, offset, 4, "%s",
968 decode_boolean_bitfield(mode, 02, 16, "Write permission for others", "no Write permission for others"));
969 proto_tree_add_text(mode_tree, NullTVB, offset, 4, "%s",
970 decode_boolean_bitfield(mode, 01, 16, "Execute permission for others", "no Execute permission for others"));
978 /* RFC 1094, Page 15 */
980 dissect_fattr(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
982 proto_item* fattr_item = NULL;
983 proto_tree* fattr_tree = NULL;
984 int old_offset = offset;
987 fattr_item = proto_tree_add_text(tree, NullTVB, offset,
988 END_OF_FRAME, "%s", name);
990 fattr_tree = proto_item_add_subtree(fattr_item, ett_nfs_fattr);
993 offset = dissect_ftype (pd,offset,fd,fattr_tree,"type");
994 offset = dissect_mode (pd,offset,fd,fattr_tree,"mode");
995 offset = dissect_unsigned_int (pd,offset,fd,fattr_tree,"nlink");
996 offset = dissect_unsigned_int (pd,offset,fd,fattr_tree,"uid");
997 offset = dissect_unsigned_int (pd,offset,fd,fattr_tree,"gid");
998 offset = dissect_unsigned_int (pd,offset,fd,fattr_tree,"size");
999 offset = dissect_unsigned_int (pd,offset,fd,fattr_tree,"blocksize");
1000 offset = dissect_unsigned_int (pd,offset,fd,fattr_tree,"rdev");
1001 offset = dissect_unsigned_int (pd,offset,fd,fattr_tree,"blocks");
1002 offset = dissect_unsigned_int (pd,offset,fd,fattr_tree,"fsid");
1003 offset = dissect_unsigned_int (pd,offset,fd,fattr_tree,"fileid");
1004 offset = dissect_timeval (pd,offset,fd,fattr_tree,"atime");
1005 offset = dissect_timeval (pd,offset,fd,fattr_tree,"mtime");
1006 offset = dissect_timeval (pd,offset,fd,fattr_tree,"ctime");
1008 /* now we know, that fattr is shorter */
1010 proto_item_set_len(fattr_item, offset - old_offset);
1017 /* RFC 1094, Page 17 */
1019 dissect_sattr(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
1021 proto_item* sattr_item = NULL;
1022 proto_tree* sattr_tree = NULL;
1023 int old_offset = offset;
1026 sattr_item = proto_tree_add_text(tree, NullTVB, offset,
1027 END_OF_FRAME, "%s", name);
1029 sattr_tree = proto_item_add_subtree(sattr_item, ett_nfs_sattr);
1032 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
1033 if (EXTRACT_UINT(pd, offset+0) != 0xffffffff)
1034 offset = dissect_mode (pd,offset,fd,sattr_tree,"mode");
1036 proto_tree_add_text(sattr_tree, NullTVB, offset, 4, "mode: no value");
1040 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
1041 if (EXTRACT_UINT(pd, offset+0) != 0xffffffff)
1042 offset = dissect_unsigned_int (pd,offset,fd,sattr_tree,"uid");
1044 proto_tree_add_text(sattr_tree, NullTVB, offset, 4, "uid: no value");
1048 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
1049 if (EXTRACT_UINT(pd, offset+0) != 0xffffffff)
1050 offset = dissect_unsigned_int (pd,offset,fd,sattr_tree,"gid");
1052 proto_tree_add_text(sattr_tree, NullTVB, offset, 4, "gid: no value");
1056 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
1057 if (EXTRACT_UINT(pd, offset+0) != 0xffffffff)
1058 offset = dissect_unsigned_int (pd,offset,fd,sattr_tree,"size");
1060 proto_tree_add_text(sattr_tree, NullTVB, offset, 4, "size: no value");
1064 if (!BYTES_ARE_IN_FRAME(offset,8)) return offset;
1065 if (EXTRACT_UINT(pd, offset+0) != 0xffffffff)
1066 offset = dissect_timeval (pd,offset,fd,sattr_tree,"atime");
1068 proto_tree_add_text(sattr_tree, NullTVB, offset, 8, "atime: no value");
1072 if (!BYTES_ARE_IN_FRAME(offset,8)) return offset;
1073 if (EXTRACT_UINT(pd, offset+0) != 0xffffffff)
1074 offset = dissect_timeval (pd,offset,fd,sattr_tree,"mtime");
1076 proto_tree_add_text(sattr_tree, NullTVB, offset, 8, "mtime: no value");
1080 /* now we know, that sattr is shorter */
1082 proto_item_set_len(sattr_item, offset - old_offset);
1089 /* RFC 1094, Page 17 */
1091 dissect_filename(const u_char *pd, int offset, frame_data *fd,
1092 proto_tree *tree, int hf, char **string_ret)
1094 offset = dissect_rpc_string(pd,offset,fd,tree,hf,string_ret);
1099 /* RFC 1094, Page 17 */
1101 dissect_path(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, int hf)
1103 offset = dissect_rpc_string(pd,offset,fd,tree,hf,NULL);
1108 /* RFC 1094, Page 17,18 */
1110 dissect_attrstat(const u_char *pd, int offset, frame_data *fd, proto_tree *tree){
1113 offset = dissect_stat(pd, offset, fd, tree, &status);
1116 offset = dissect_fattr(pd, offset, fd, tree, "attributes");
1127 /* RFC 1094, Page 17,18 */
1129 dissect_nfs2_attrstat_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
1131 offset = dissect_attrstat(pd, offset, fd, tree);
1137 /* RFC 1094, Page 18 */
1139 dissect_diropargs(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
1141 proto_item* diropargs_item = NULL;
1142 proto_tree* diropargs_tree = NULL;
1143 int old_offset = offset;
1146 diropargs_item = proto_tree_add_text(tree, NullTVB, offset,
1147 END_OF_FRAME, "%s", name);
1149 diropargs_tree = proto_item_add_subtree(diropargs_item, ett_nfs_diropargs);
1152 offset = old_dissect_fhandle (pd,offset,fd,diropargs_tree,"dir");
1153 offset = dissect_filename(pd,offset,fd,diropargs_tree,hf_nfs_name,NULL);
1155 /* now we know, that diropargs is shorter */
1156 if (diropargs_item) {
1157 proto_item_set_len(diropargs_item, offset - old_offset);
1164 /* RFC 1094, Page 18 */
1166 dissect_nfs2_diropargs_call(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
1168 offset = dissect_diropargs(pd, offset, fd, tree, "where");
1174 /* RFC 1094, Page 18 */
1176 dissect_diropres(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
1180 offset = dissect_stat(pd, offset, fd, tree, &status);
1183 offset = old_dissect_fhandle(pd, offset, fd, tree, "file");
1184 offset = dissect_fattr (pd, offset, fd, tree, "attributes");
1195 /* nfsdata is simply a RPC string (length, data, fill bytes) */
1197 dissect_nfsdata(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
1200 offset = dissect_rpc_data(pd,offset,fd,tree,hf);
1206 /* RFC 1094, Page 18 */
1208 dissect_nfs2_diropres_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
1210 offset = dissect_diropres(pd, offset, fd, tree);
1216 /* RFC 1094, Page 6 */
1218 dissect_nfs2_setattr_call(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
1220 offset = old_dissect_fhandle(pd, offset, fd, tree, "file" );
1221 offset = dissect_sattr (pd, offset, fd, tree, "attributes");
1227 /* RFC 1094, Page 6 */
1229 dissect_nfs2_readlink_reply(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
1233 offset = dissect_stat(pd, offset, fd, tree, &status);
1236 offset = dissect_path(pd, offset, fd, tree, hf_nfs_readlink_data);
1247 /* RFC 1094, Page 7 */
1249 dissect_nfs2_read_call(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
1251 guint32 offset_value;
1255 offset = old_dissect_fhandle(pd, offset, fd, tree, "file" );
1256 if (!BYTES_ARE_IN_FRAME(offset,12)) return offset;
1257 offset_value = EXTRACT_UINT(pd, offset+0);
1258 count = EXTRACT_UINT(pd, offset+4);
1259 totalcount = EXTRACT_UINT(pd, offset+8);
1261 proto_tree_add_uint(tree, hf_nfs_read_offset, NullTVB,
1262 offset+0, 4, offset_value);
1263 proto_tree_add_uint(tree, hf_nfs_read_count, NullTVB,
1264 offset+4, 4, count);
1265 proto_tree_add_uint(tree, hf_nfs_read_totalcount, NullTVB,
1266 offset+8, 4, totalcount);
1274 /* RFC 1094, Page 7 */
1276 dissect_nfs2_read_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
1280 offset = dissect_stat(pd, offset, fd, tree, &status);
1283 offset = dissect_fattr(pd, offset, fd, tree, "attributes");
1284 offset = dissect_nfsdata(pd, offset, fd, tree, hf_nfs_data);
1295 /* RFC 1094, Page 8 */
1297 dissect_nfs2_write_call(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
1299 guint32 beginoffset;
1300 guint32 offset_value;
1303 offset = old_dissect_fhandle(pd, offset, fd, tree, "file" );
1304 if (!BYTES_ARE_IN_FRAME(offset,12)) return offset;
1305 beginoffset = EXTRACT_UINT(pd, offset+0);
1306 offset_value = EXTRACT_UINT(pd, offset+4);
1307 totalcount = EXTRACT_UINT(pd, offset+8);
1309 proto_tree_add_uint(tree, hf_nfs_write_beginoffset, NullTVB,
1310 offset+0, 4, beginoffset);
1311 proto_tree_add_uint(tree, hf_nfs_write_offset, NullTVB,
1312 offset+4, 4, offset_value);
1313 proto_tree_add_uint(tree, hf_nfs_write_totalcount, NullTVB,
1314 offset+8, 4, totalcount);
1318 offset = dissect_nfsdata(pd, offset, fd, tree, hf_nfs_data);
1324 /* RFC 1094, Page 8 */
1326 dissect_nfs2_createargs_call(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
1328 offset = dissect_diropargs(pd, offset, fd, tree, "where" );
1329 offset = dissect_sattr (pd, offset, fd, tree, "attributes");
1335 /* RFC 1094, Page 9 */
1337 dissect_nfs2_rename_call(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
1339 offset = dissect_diropargs(pd, offset, fd, tree, "from");
1340 offset = dissect_diropargs(pd, offset, fd, tree, "to" );
1346 /* RFC 1094, Page 9 */
1348 dissect_nfs2_link_call(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
1350 offset = old_dissect_fhandle (pd, offset, fd, tree, "from");
1351 offset = dissect_diropargs(pd, offset, fd, tree, "to" );
1357 /* RFC 1094, Page 10 */
1359 dissect_nfs2_symlink_call(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
1361 offset = dissect_diropargs(pd, offset, fd, tree, "from" );
1362 offset = dissect_path (pd, offset, fd, tree, hf_nfs_symlink_to);
1363 offset = dissect_sattr (pd, offset, fd, tree, "attributes" );
1369 /* RFC 1094, Page 11 */
1371 dissect_nfs2_readdir_call(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
1376 offset = old_dissect_fhandle (pd, offset, fd, tree, "dir");
1377 if (!BYTES_ARE_IN_FRAME(offset,8)) return offset;
1378 cookie = EXTRACT_UINT(pd, offset+ 0);
1379 count = EXTRACT_UINT(pd, offset+ 4);
1381 proto_tree_add_uint(tree, hf_nfs_readdir_cookie, NullTVB,
1382 offset+ 0, 4, cookie);
1383 proto_tree_add_uint(tree, hf_nfs_readdir_count, NullTVB,
1384 offset+ 4, 4, count);
1392 /* RFC 1094, Page 11 */
1394 dissect_readdir_entry(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
1396 proto_item* entry_item = NULL;
1397 proto_tree* entry_tree = NULL;
1398 int old_offset = offset;
1404 entry_item = proto_tree_add_item(tree, hf_nfs_readdir_entry, NullTVB,
1405 offset+0, END_OF_FRAME, FALSE);
1407 entry_tree = proto_item_add_subtree(entry_item, ett_nfs_readdir_entry);
1410 if (!BYTES_ARE_IN_FRAME(offset, 4)) {
1412 proto_item_set_text(entry_item, "Entry: <TRUNCATED>");
1415 fileid = EXTRACT_UINT(pd, offset + 0);
1417 proto_tree_add_uint(entry_tree, hf_nfs_readdir_entry_fileid, NullTVB,
1418 offset+0, 4, fileid);
1421 offset = dissect_filename(pd, offset, fd, entry_tree,
1422 hf_nfs_readdir_entry_name, &name);
1424 proto_item_set_text(entry_item, "Entry: file ID %u, name %s",
1428 if (!BYTES_ARE_IN_FRAME(offset, 4)) return offset;
1429 cookie = EXTRACT_UINT(pd, offset + 0);
1431 proto_tree_add_uint(entry_tree, hf_nfs_readdir_entry_cookie, NullTVB,
1432 offset+0, 4, cookie);
1435 /* now we know, that a readdir entry is shorter */
1437 proto_item_set_len(entry_item, offset - old_offset);
1443 /* RFC 1094, Page 11 */
1445 dissect_nfs2_readdir_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
1450 offset = dissect_stat(pd, offset, fd, tree, &status);
1453 offset = dissect_rpc_list(pd, offset, fd, tree,
1454 dissect_readdir_entry);
1455 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
1456 eof_value = EXTRACT_UINT(pd, offset+0);
1458 proto_tree_add_uint(tree, hf_nfs_readdir_eof, NullTVB,
1459 offset+ 0, 4, eof_value);
1471 /* RFC 1094, Page 12 */
1473 dissect_nfs2_statfs_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
1482 offset = dissect_stat(pd, offset, fd, tree, &status);
1485 if (!BYTES_ARE_IN_FRAME(offset,5 * 4)) return offset;
1486 tsize = EXTRACT_UINT(pd, offset+ 0);
1487 bsize = EXTRACT_UINT(pd, offset+ 4);
1488 blocks = EXTRACT_UINT(pd, offset+ 8);
1489 bfree = EXTRACT_UINT(pd, offset+12);
1490 bavail = EXTRACT_UINT(pd, offset+16);
1492 proto_tree_add_uint(tree, hf_nfs_statfs_tsize, NullTVB,
1493 offset+ 0, 4, tsize);
1494 proto_tree_add_uint(tree, hf_nfs_statfs_bsize, NullTVB,
1495 offset+ 4, 4, bsize);
1496 proto_tree_add_uint(tree, hf_nfs_statfs_blocks, NullTVB,
1497 offset+ 8, 4, blocks);
1498 proto_tree_add_uint(tree, hf_nfs_statfs_bfree, NullTVB,
1499 offset+12, 4, bfree);
1500 proto_tree_add_uint(tree, hf_nfs_statfs_bavail, NullTVB,
1501 offset+16, 4, bavail);
1514 /* proc number, "proc name", dissect_request, dissect_reply */
1515 /* NULL as function pointer means: type of arguments is "void". */
1516 static const old_vsff nfs2_proc[] = {
1517 { 0, "NULL", /* OK */
1519 { 1, "GETATTR", /* OK */
1520 dissect_nfs2_fhandle_call, dissect_nfs2_attrstat_reply },
1521 { 2, "SETATTR", /* OK */
1522 dissect_nfs2_setattr_call, dissect_nfs2_attrstat_reply },
1523 { 3, "ROOT", /* OK */
1525 { 4, "LOOKUP", /* OK */
1526 dissect_nfs2_diropargs_call, dissect_nfs2_diropres_reply },
1527 { 5, "READLINK", /* OK */
1528 dissect_nfs2_fhandle_call, dissect_nfs2_readlink_reply },
1529 { 6, "READ", /* OK */
1530 dissect_nfs2_read_call, dissect_nfs2_read_reply },
1531 { 7, "WRITECACHE", /* OK */
1533 { 8, "WRITE", /* OK */
1534 dissect_nfs2_write_call, dissect_nfs2_attrstat_reply },
1535 { 9, "CREATE", /* OK */
1536 dissect_nfs2_createargs_call, dissect_nfs2_diropres_reply },
1537 { 10, "REMOVE", /* OK */
1538 dissect_nfs2_diropargs_call, dissect_nfs2_stat_reply },
1539 { 11, "RENAME", /* OK */
1540 dissect_nfs2_rename_call, dissect_nfs2_stat_reply },
1541 { 12, "LINK", /* OK */
1542 dissect_nfs2_link_call, dissect_nfs2_stat_reply },
1543 { 13, "SYMLINK", /* OK */
1544 dissect_nfs2_symlink_call, dissect_nfs2_stat_reply },
1545 { 14, "MKDIR", /* OK */
1546 dissect_nfs2_createargs_call, dissect_nfs2_diropres_reply },
1547 { 15, "RMDIR", /* OK */
1548 dissect_nfs2_diropargs_call, dissect_nfs2_stat_reply },
1549 { 16, "READDIR", /* OK */
1550 dissect_nfs2_readdir_call, dissect_nfs2_readdir_reply },
1551 { 17, "STATFS", /* OK */
1552 dissect_nfs2_fhandle_call, dissect_nfs2_statfs_reply },
1553 { 0,NULL,NULL,NULL }
1555 /* end of NFS Version 2 */
1558 /***************************/
1559 /* NFS Version 3, RFC 1813 */
1560 /***************************/
1563 /* RFC 1813, Page 15 */
1565 dissect_uint64(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
1568 offset = dissect_rpc_uint64(pd,offset,fd,tree,name);
1573 /* RFC 1813, Page 15 */
1575 dissect_uint32(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
1578 offset = dissect_rpc_uint32(pd,offset,fd,tree,name);
1583 /* RFC 1813, Page 15 */
1585 dissect_filename3(const u_char *pd, int offset, frame_data *fd,
1586 proto_tree *tree, int hf, char **string_ret)
1588 offset = dissect_rpc_string(pd,offset,fd,tree,hf,string_ret);
1593 /* RFC 1813, Page 15 */
1595 dissect_nfspath3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, int hf)
1597 offset = dissect_rpc_string(pd,offset,fd,tree,hf,NULL);
1602 /* RFC 1813, Page 15 */
1604 dissect_fileid3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
1607 offset = dissect_rpc_uint64(pd,offset,fd,tree,name);
1612 /* RFC 1813, Page 15 */
1614 dissect_cookie3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
1617 offset = dissect_rpc_uint64(pd,offset,fd,tree,name);
1622 /* RFC 1813, Page 15 */
1624 dissect_cookieverf3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
1626 if (!BYTES_ARE_IN_FRAME(offset,8)) return offset;
1627 proto_tree_add_text(tree, NullTVB, offset, NFS3_COOKIEVERFSIZE,
1628 "Verifier: Opaque Data");
1629 offset += NFS3_COOKIEVERFSIZE;
1634 /* RFC 1813, Page 16 */
1636 dissect_createverf3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
1638 if (!BYTES_ARE_IN_FRAME(offset,8)) return offset;
1639 proto_tree_add_text(tree, NullTVB, offset, NFS3_CREATEVERFSIZE,
1640 "Verifier: Opaque Data");
1641 offset += NFS3_CREATEVERFSIZE;
1646 /* RFC 1813, Page 16 */
1648 dissect_writeverf3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
1650 if (!BYTES_ARE_IN_FRAME(offset,8)) return offset;
1651 proto_tree_add_text(tree, NullTVB, offset, NFS3_WRITEVERFSIZE,
1652 "Verifier: Opaque Data");
1653 offset += NFS3_WRITEVERFSIZE;
1658 /* RFC 1813, Page 16 */
1660 dissect_uid3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
1663 offset = dissect_rpc_uint32(pd,offset,fd,tree,name);
1668 /* RFC 1813, Page 16 */
1670 dissect_gid3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
1673 offset = dissect_rpc_uint32(pd,offset,fd,tree,name);
1678 /* RFC 1813, Page 16 */
1680 dissect_size3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
1683 offset = dissect_rpc_uint64(pd,offset,fd,tree,name);
1688 /* RFC 1813, Page 16 */
1690 dissect_offset3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
1693 offset = dissect_rpc_uint64(pd,offset,fd,tree,name);
1698 /* RFC 1813, Page 16 */
1700 dissect_mode3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
1704 proto_item* mode3_item = NULL;
1705 proto_tree* mode3_tree = NULL;
1707 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
1708 mode3 = EXTRACT_UINT(pd, offset+0);
1711 mode3_item = proto_tree_add_text(tree, NullTVB, offset, 4,
1712 "%s: 0%o", name, mode3);
1714 mode3_tree = proto_item_add_subtree(mode3_item, ett_nfs_mode3);
1717 /* RFC 1813, Page 23 */
1719 proto_tree_add_text(mode3_tree, NullTVB, offset, 4, "%s",
1720 decode_boolean_bitfield(mode3, 0x800, 12, "Set user id on exec", "not SUID"));
1721 proto_tree_add_text(mode3_tree, NullTVB, offset, 4, "%s",
1722 decode_boolean_bitfield(mode3, 0x400, 12, "Set group id on exec", "not SGID"));
1723 proto_tree_add_text(mode3_tree, NullTVB, offset, 4, "%s",
1724 decode_boolean_bitfield(mode3, 0x200, 12, "Save swapped text even after use", "not save swapped text"));
1725 proto_tree_add_text(mode3_tree, NullTVB, offset, 4, "%s",
1726 decode_boolean_bitfield(mode3, 0x100, 12, "Read permission for owner", "no Read permission for owner"));
1727 proto_tree_add_text(mode3_tree, NullTVB, offset, 4, "%s",
1728 decode_boolean_bitfield(mode3, 0x80, 12, "Write permission for owner", "no Write permission for owner"));
1729 proto_tree_add_text(mode3_tree, NullTVB, offset, 4, "%s",
1730 decode_boolean_bitfield(mode3, 0x40, 12, "Execute permission for owner", "no Execute permission for owner"));
1731 proto_tree_add_text(mode3_tree, NullTVB, offset, 4, "%s",
1732 decode_boolean_bitfield(mode3, 0x20, 12, "Read permission for group", "no Read permission for group"));
1733 proto_tree_add_text(mode3_tree, NullTVB, offset, 4, "%s",
1734 decode_boolean_bitfield(mode3, 0x10, 12, "Write permission for group", "no Write permission for group"));
1735 proto_tree_add_text(mode3_tree, NullTVB, offset, 4, "%s",
1736 decode_boolean_bitfield(mode3, 0x8, 12, "Execute permission for group", "no Execute permission for group"));
1737 proto_tree_add_text(mode3_tree, NullTVB, offset, 4, "%s",
1738 decode_boolean_bitfield(mode3, 0x4, 12, "Read permission for others", "no Read permission for others"));
1739 proto_tree_add_text(mode3_tree, NullTVB, offset, 4, "%s",
1740 decode_boolean_bitfield(mode3, 0x2, 12, "Write permission for others", "no Write permission for others"));
1741 proto_tree_add_text(mode3_tree, NullTVB, offset, 4, "%s",
1742 decode_boolean_bitfield(mode3, 0x1, 12, "Execute permission for others", "no Execute permission for others"));
1750 /* RFC 1813, Page 16 */
1752 dissect_count3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
1755 offset = dissect_rpc_uint32(pd,offset,fd,tree,name);
1760 /* RFC 1813, Page 16,17 */
1761 const value_string names_nfs_nfsstat3[] =
1768 { 13, "ERR_ACCES" },
1769 { 17, "ERR_EXIST" },
1771 { 19, "ERR_NODEV" },
1772 { 20, "ERR_NOTDIR" },
1773 { 21, "ERR_ISDIR" },
1774 { 22, "ERR_INVAL" },
1776 { 28, "ERR_NOSPC" },
1778 { 31, "ERR_MLINK" },
1779 { 63, "ERR_NAMETOOLONG" },
1780 { 66, "ERR_NOTEMPTY" },
1781 { 69, "ERR_DQUOT" },
1782 { 70, "ERR_STALE" },
1783 { 71, "ERR_REMOTE" },
1784 { 10001, "ERR_BADHANDLE" },
1785 { 10002, "ERR_NOT_SYNC" },
1786 { 10003, "ERR_BAD_COOKIE" },
1787 { 10004, "ERR_NOTSUPP" },
1788 { 10005, "ERR_TOOSMALL" },
1789 { 10006, "ERR_SERVERFAULT" },
1790 { 10007, "ERR_BADTYPE" },
1791 { 10008, "ERR_JUKEBOX" },
1796 /* RFC 1813, Page 16 */
1798 dissect_nfsstat3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,guint32 *status)
1802 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
1803 nfsstat3 = EXTRACT_UINT(pd, offset+0);
1806 proto_tree_add_uint(tree, hf_nfs_nfsstat3, NullTVB,
1807 offset, 4, nfsstat3);
1816 const value_string names_nfs_ftype3[] =
1818 { NF3REG, "Regular File" },
1819 { NF3DIR, "Directory" },
1820 { NF3BLK, "Block Special Device" },
1821 { NF3CHR, "Character Special Device" },
1822 { NF3LNK, "Symbolic Link" },
1823 { NF3SOCK,"Socket" },
1824 { NF3FIFO,"Named Pipe" },
1829 /* RFC 1813, Page 20 */
1831 dissect_ftype3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
1832 int hf, guint32* ftype3)
1836 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
1837 type = EXTRACT_UINT(pd, offset+0);
1840 proto_tree_add_uint(tree, hf, NullTVB, offset, 4, type);
1849 /* RFC 1813, Page 20 */
1851 dissect_specdata3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
1856 proto_item* specdata3_item;
1857 proto_tree* specdata3_tree = NULL;
1859 if (!BYTES_ARE_IN_FRAME(offset,8)) return offset;
1860 specdata1 = EXTRACT_UINT(pd, offset+0);
1861 specdata2 = EXTRACT_UINT(pd, offset+4);
1864 specdata3_item = proto_tree_add_text(tree, NullTVB, offset, 8,
1865 "%s: %u,%u", name, specdata1, specdata2);
1867 specdata3_tree = proto_item_add_subtree(specdata3_item,
1871 if (specdata3_tree) {
1872 proto_tree_add_text(specdata3_tree, NullTVB,offset+0,4,
1873 "specdata1: %u", specdata1);
1874 proto_tree_add_text(specdata3_tree, NullTVB,offset+4,4,
1875 "specdata2: %u", specdata2);
1883 /* RFC 1813, Page 21 */
1885 old_dissect_nfs_fh3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
1887 tvbuff_t *tvb = tvb_create_from_top(offset);
1889 offset = dissect_nfs_fh3(tvb, 0, &pi, tree, name);
1890 return tvb_raw_offset(tvb) + offset;
1894 dissect_nfs_fh3(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
1901 proto_tree* ftree = NULL;
1903 fh3_len = tvb_get_ntohl(tvb, offset+0);
1904 fh3_len_full = rpc_roundup(fh3_len);
1905 fh3_fill = fh3_len_full - fh3_len;
1908 fitem = proto_tree_add_text(tree, tvb, offset, 4+fh3_len_full,
1911 ftree = proto_item_add_subtree(fitem, ett_nfs_fh3);
1915 proto_tree_add_text(ftree, tvb, offset+0, 4,
1916 "length: %u", fh3_len);
1917 dissect_fhandle_data(tvb, offset+4, pinfo, ftree, fh3_len);
1919 offset += 4 + fh3_len_full;
1924 /* RFC 1813, Page 21 */
1926 dissect_nfstime3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,char* name)
1931 proto_item* time_item;
1932 proto_tree* time_tree = NULL;
1934 if (!BYTES_ARE_IN_FRAME(offset,8)) return offset;
1935 seconds = EXTRACT_UINT(pd, offset+0);
1936 nseconds = EXTRACT_UINT(pd, offset+4);
1939 time_item = proto_tree_add_text(tree, NullTVB, offset, 8,
1940 "%s: %u.%09u", name, seconds, nseconds);
1942 time_tree = proto_item_add_subtree(time_item, ett_nfs_nfstime3);
1946 proto_tree_add_text(time_tree, NullTVB,offset+0,4,
1947 "seconds: %u", seconds);
1948 proto_tree_add_text(time_tree, NullTVB,offset+4,4,
1949 "nano seconds: %u", nseconds);
1956 /* RFC 1813, Page 22 */
1958 dissect_fattr3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
1960 proto_item* fattr3_item = NULL;
1961 proto_tree* fattr3_tree = NULL;
1962 int old_offset = offset;
1966 fattr3_item = proto_tree_add_text(tree, NullTVB, offset,
1967 END_OF_FRAME, "%s", name);
1969 fattr3_tree = proto_item_add_subtree(fattr3_item, ett_nfs_fattr3);
1972 offset = dissect_ftype3 (pd,offset,fd,fattr3_tree,hf_nfs_ftype3,&type);
1973 offset = dissect_mode3 (pd,offset,fd,fattr3_tree,"mode");
1974 offset = dissect_uint32 (pd,offset,fd,fattr3_tree,"nlink");
1975 offset = dissect_uid3 (pd,offset,fd,fattr3_tree,"uid");
1976 offset = dissect_gid3 (pd,offset,fd,fattr3_tree,"gid");
1977 offset = dissect_size3 (pd,offset,fd,fattr3_tree,"size");
1978 offset = dissect_size3 (pd,offset,fd,fattr3_tree,"used");
1979 offset = dissect_specdata3(pd,offset,fd,fattr3_tree,"rdev");
1980 offset = dissect_uint64 (pd,offset,fd,fattr3_tree,"fsid");
1981 offset = dissect_fileid3 (pd,offset,fd,fattr3_tree,"fileid");
1982 offset = dissect_nfstime3 (pd,offset,fd,fattr3_tree,"atime");
1983 offset = dissect_nfstime3 (pd,offset,fd,fattr3_tree,"mtime");
1984 offset = dissect_nfstime3 (pd,offset,fd,fattr3_tree,"ctime");
1986 /* now we know, that fattr3 is shorter */
1988 proto_item_set_len(fattr3_item, offset - old_offset);
1995 const value_string value_follows[] =
1998 { 1, "value follows"},
2003 /* RFC 1813, Page 23 */
2005 dissect_post_op_attr(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
2007 proto_item* post_op_attr_item = NULL;
2008 proto_tree* post_op_attr_tree = NULL;
2009 int old_offset = offset;
2010 guint32 attributes_follow;
2013 post_op_attr_item = proto_tree_add_text(tree, NullTVB, offset,
2014 END_OF_FRAME, "%s", name);
2015 if (post_op_attr_item)
2016 post_op_attr_tree = proto_item_add_subtree(post_op_attr_item, ett_nfs_post_op_attr);
2019 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
2020 attributes_follow = EXTRACT_UINT(pd, offset+0);
2021 proto_tree_add_text(post_op_attr_tree, NullTVB, offset, 4,
2022 "attributes_follow: %s (%u)",
2023 val_to_str(attributes_follow,value_follows,"Unknown"), attributes_follow);
2025 switch (attributes_follow) {
2027 offset = dissect_fattr3(pd, offset, fd, post_op_attr_tree,
2035 /* now we know, that post_op_attr_tree is shorter */
2036 if (post_op_attr_item) {
2037 proto_item_set_len(post_op_attr_item, offset - old_offset);
2044 /* RFC 1813, Page 24 */
2046 dissect_wcc_attr(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
2048 proto_item* wcc_attr_item = NULL;
2049 proto_tree* wcc_attr_tree = NULL;
2050 int old_offset = offset;
2053 wcc_attr_item = proto_tree_add_text(tree, NullTVB, offset,
2054 END_OF_FRAME, "%s", name);
2056 wcc_attr_tree = proto_item_add_subtree(wcc_attr_item, ett_nfs_wcc_attr);
2059 offset = dissect_size3 (pd, offset, fd, wcc_attr_tree, "size" );
2060 offset = dissect_nfstime3(pd, offset, fd, wcc_attr_tree, "mtime");
2061 offset = dissect_nfstime3(pd, offset, fd, wcc_attr_tree, "ctime");
2063 /* now we know, that wcc_attr_tree is shorter */
2064 if (wcc_attr_item) {
2065 proto_item_set_len(wcc_attr_item, offset - old_offset);
2072 /* RFC 1813, Page 24 */
2074 dissect_pre_op_attr(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
2076 proto_item* pre_op_attr_item = NULL;
2077 proto_tree* pre_op_attr_tree = NULL;
2078 int old_offset = offset;
2079 guint32 attributes_follow;
2082 pre_op_attr_item = proto_tree_add_text(tree, NullTVB, offset,
2083 END_OF_FRAME, "%s", name);
2084 if (pre_op_attr_item)
2085 pre_op_attr_tree = proto_item_add_subtree(pre_op_attr_item, ett_nfs_pre_op_attr);
2088 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
2089 attributes_follow = EXTRACT_UINT(pd, offset+0);
2090 proto_tree_add_text(pre_op_attr_tree, NullTVB, offset, 4,
2091 "attributes_follow: %s (%u)",
2092 val_to_str(attributes_follow,value_follows,"Unknown"), attributes_follow);
2094 switch (attributes_follow) {
2096 offset = dissect_wcc_attr(pd, offset, fd, pre_op_attr_tree,
2104 /* now we know, that pre_op_attr_tree is shorter */
2105 if (pre_op_attr_item) {
2106 proto_item_set_len(pre_op_attr_item, offset - old_offset);
2113 /* RFC 1813, Page 24 */
2115 dissect_wcc_data(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
2117 proto_item* wcc_data_item = NULL;
2118 proto_tree* wcc_data_tree = NULL;
2119 int old_offset = offset;
2122 wcc_data_item = proto_tree_add_text(tree, NullTVB, offset,
2123 END_OF_FRAME, "%s", name);
2125 wcc_data_tree = proto_item_add_subtree(wcc_data_item, ett_nfs_wcc_data);
2128 offset = dissect_pre_op_attr (pd, offset, fd, wcc_data_tree, "before");
2129 offset = dissect_post_op_attr(pd, offset, fd, wcc_data_tree, "after" );
2131 /* now we know, that wcc_data is shorter */
2132 if (wcc_data_item) {
2133 proto_item_set_len(wcc_data_item, offset - old_offset);
2140 /* RFC 1813, Page 25 */
2142 dissect_post_op_fh3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
2144 proto_item* post_op_fh3_item = NULL;
2145 proto_tree* post_op_fh3_tree = NULL;
2146 int old_offset = offset;
2147 guint32 handle_follows;
2150 post_op_fh3_item = proto_tree_add_text(tree, NullTVB, offset,
2151 END_OF_FRAME, "%s", name);
2152 if (post_op_fh3_item)
2153 post_op_fh3_tree = proto_item_add_subtree(post_op_fh3_item, ett_nfs_post_op_fh3);
2156 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
2157 handle_follows = EXTRACT_UINT(pd, offset+0);
2158 proto_tree_add_text(post_op_fh3_tree, NullTVB, offset, 4,
2159 "handle_follows: %s (%u)",
2160 val_to_str(handle_follows,value_follows,"Unknown"), handle_follows);
2162 switch (handle_follows) {
2164 offset = old_dissect_nfs_fh3(pd, offset, fd, post_op_fh3_tree,
2172 /* now we know, that post_op_fh3_tree is shorter */
2173 if (post_op_fh3_item) {
2174 proto_item_set_len(post_op_fh3_item, offset - old_offset);
2181 /* RFC 1813, Page 25 */
2183 dissect_set_mode3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
2185 proto_item* set_mode3_item = NULL;
2186 proto_tree* set_mode3_tree = NULL;
2187 int old_offset = offset;
2191 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
2192 set_it = EXTRACT_UINT(pd, offset+0);
2193 set_it_name = val_to_str(set_it,value_follows,"Unknown");
2196 set_mode3_item = proto_tree_add_text(tree, NullTVB, offset,
2197 END_OF_FRAME, "%s: %s", name, set_it_name);
2199 set_mode3_tree = proto_item_add_subtree(set_mode3_item, ett_nfs_set_mode3);
2203 proto_tree_add_text(set_mode3_tree, NullTVB, offset, 4,
2204 "set_it: %s (%u)", set_it_name, set_it);
2210 offset = dissect_mode3(pd, offset, fd, set_mode3_tree,
2218 /* now we know, that set_mode3 is shorter */
2219 if (set_mode3_item) {
2220 proto_item_set_len(set_mode3_item, offset - old_offset);
2227 /* RFC 1813, Page 26 */
2229 dissect_set_uid3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
2231 proto_item* set_uid3_item = NULL;
2232 proto_tree* set_uid3_tree = NULL;
2233 int old_offset = offset;
2237 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
2238 set_it = EXTRACT_UINT(pd, offset+0);
2239 set_it_name = val_to_str(set_it,value_follows,"Unknown");
2242 set_uid3_item = proto_tree_add_text(tree, NullTVB, offset,
2243 END_OF_FRAME, "%s: %s", name, set_it_name);
2245 set_uid3_tree = proto_item_add_subtree(set_uid3_item, ett_nfs_set_uid3);
2249 proto_tree_add_text(set_uid3_tree, NullTVB, offset, 4,
2250 "set_it: %s (%u)", set_it_name, set_it);
2256 offset = dissect_uid3(pd, offset, fd, set_uid3_tree,
2264 /* now we know, that set_uid3 is shorter */
2265 if (set_uid3_item) {
2266 proto_item_set_len(set_uid3_item, offset - old_offset);
2273 /* RFC 1813, Page 26 */
2275 dissect_set_gid3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
2277 proto_item* set_gid3_item = NULL;
2278 proto_tree* set_gid3_tree = NULL;
2279 int old_offset = offset;
2283 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
2284 set_it = EXTRACT_UINT(pd, offset+0);
2285 set_it_name = val_to_str(set_it,value_follows,"Unknown");
2288 set_gid3_item = proto_tree_add_text(tree, NullTVB, offset,
2289 END_OF_FRAME, "%s: %s", name, set_it_name);
2291 set_gid3_tree = proto_item_add_subtree(set_gid3_item, ett_nfs_set_gid3);
2295 proto_tree_add_text(set_gid3_tree, NullTVB, offset, 4,
2296 "set_it: %s (%u)", set_it_name, set_it);
2302 offset = dissect_gid3(pd, offset, fd, set_gid3_tree,
2310 /* now we know, that set_gid3 is shorter */
2311 if (set_gid3_item) {
2312 proto_item_set_len(set_gid3_item, offset - old_offset);
2319 /* RFC 1813, Page 26 */
2321 dissect_set_size3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
2323 proto_item* set_size3_item = NULL;
2324 proto_tree* set_size3_tree = NULL;
2325 int old_offset = offset;
2329 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
2330 set_it = EXTRACT_UINT(pd, offset+0);
2331 set_it_name = val_to_str(set_it,value_follows,"Unknown");
2334 set_size3_item = proto_tree_add_text(tree, NullTVB, offset,
2335 END_OF_FRAME, "%s: %s", name, set_it_name);
2337 set_size3_tree = proto_item_add_subtree(set_size3_item, ett_nfs_set_size3);
2341 proto_tree_add_text(set_size3_tree, NullTVB, offset, 4,
2342 "set_it: %s (%u)", set_it_name, set_it);
2348 offset = dissect_size3(pd, offset, fd, set_size3_tree,
2356 /* now we know, that set_size3 is shorter */
2357 if (set_size3_item) {
2358 proto_item_set_len(set_size3_item, offset - old_offset);
2365 /* RFC 1813, Page 25 */
2366 #define DONT_CHANGE 0
2367 #define SET_TO_SERVER_TIME 1
2368 #define SET_TO_CLIENT_TIME 2
2370 const value_string time_how[] =
2372 { DONT_CHANGE, "don't change" },
2373 { SET_TO_SERVER_TIME, "set to server time" },
2374 { SET_TO_CLIENT_TIME, "set to client time" },
2379 /* RFC 1813, Page 26 */
2381 dissect_set_atime(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
2383 proto_item* set_atime_item = NULL;
2384 proto_tree* set_atime_tree = NULL;
2385 int old_offset = offset;
2389 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
2390 set_it = EXTRACT_UINT(pd, offset+0);
2391 set_it_name = val_to_str(set_it,time_how,"Unknown");
2394 set_atime_item = proto_tree_add_text(tree, NullTVB, offset,
2395 END_OF_FRAME, "%s: %s",
2398 set_atime_tree = proto_item_add_subtree(set_atime_item, ett_nfs_set_atime);
2402 proto_tree_add_text(set_atime_tree, NullTVB, offset, 4,
2403 "set_it: %s (%u)", set_it_name, set_it);
2408 case SET_TO_CLIENT_TIME:
2410 offset = dissect_nfstime3(pd, offset, fd, set_atime_tree,
2418 /* now we know, that set_atime is shorter */
2419 if (set_atime_item) {
2420 proto_item_set_len(set_atime_item, offset - old_offset);
2427 /* RFC 1813, Page 26 */
2429 dissect_set_mtime(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
2431 proto_item* set_mtime_item = NULL;
2432 proto_tree* set_mtime_tree = NULL;
2433 int old_offset = offset;
2437 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
2438 set_it = EXTRACT_UINT(pd, offset+0);
2439 set_it_name = val_to_str(set_it,time_how,"Unknown");
2442 set_mtime_item = proto_tree_add_text(tree, NullTVB, offset,
2443 END_OF_FRAME, "%s: %s",
2446 set_mtime_tree = proto_item_add_subtree(set_mtime_item, ett_nfs_set_mtime);
2450 proto_tree_add_text(set_mtime_tree, NullTVB, offset, 4,
2451 "set_it: %s (%u)", set_it_name, set_it);
2456 case SET_TO_CLIENT_TIME:
2458 offset = dissect_nfstime3(pd, offset, fd, set_mtime_tree,
2466 /* now we know, that set_mtime is shorter */
2467 if (set_mtime_item) {
2468 proto_item_set_len(set_mtime_item, offset - old_offset);
2475 /* RFC 1813, Page 25..27 */
2477 dissect_sattr3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
2479 proto_item* sattr3_item = NULL;
2480 proto_tree* sattr3_tree = NULL;
2481 int old_offset = offset;
2484 sattr3_item = proto_tree_add_text(tree, NullTVB, offset,
2485 END_OF_FRAME, "%s", name);
2487 sattr3_tree = proto_item_add_subtree(sattr3_item, ett_nfs_sattr3);
2490 offset = dissect_set_mode3(pd, offset, fd, sattr3_tree, "mode");
2491 offset = dissect_set_uid3 (pd, offset, fd, sattr3_tree, "uid");
2492 offset = dissect_set_gid3 (pd, offset, fd, sattr3_tree, "gid");
2493 offset = dissect_set_size3(pd, offset, fd, sattr3_tree, "size");
2494 offset = dissect_set_atime(pd, offset, fd, sattr3_tree, "atime");
2495 offset = dissect_set_mtime(pd, offset, fd, sattr3_tree, "mtime");
2497 /* now we know, that sattr3 is shorter */
2499 proto_item_set_len(sattr3_item, offset - old_offset);
2506 /* RFC 1813, Page 27 */
2508 dissect_diropargs3(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
2510 proto_item* diropargs3_item = NULL;
2511 proto_tree* diropargs3_tree = NULL;
2512 int old_offset = offset;
2515 diropargs3_item = proto_tree_add_text(tree, NullTVB, offset,
2516 END_OF_FRAME, "%s", name);
2517 if (diropargs3_item)
2518 diropargs3_tree = proto_item_add_subtree(diropargs3_item, ett_nfs_diropargs3);
2521 offset = old_dissect_nfs_fh3 (pd, offset, fd, diropargs3_tree, "dir");
2522 offset = dissect_filename3(pd, offset, fd, diropargs3_tree, hf_nfs_name,NULL);
2524 /* now we know, that diropargs3 is shorter */
2525 if (diropargs3_item) {
2526 proto_item_set_len(diropargs3_item, offset - old_offset);
2533 /* RFC 1813, Page 27 */
2535 dissect_nfs3_diropargs3_call(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
2537 offset = dissect_diropargs3(pd, offset, fd, tree, "object");
2543 /* RFC 1813, Page 40 */
2545 dissect_access(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, char* name)
2548 proto_item* access_item = NULL;
2549 proto_tree* access_tree = NULL;
2551 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
2552 access = EXTRACT_UINT(pd, offset+0);
2555 access_item = proto_tree_add_text(tree, NullTVB, offset, 4,
2556 "%s: 0x%02x", name, access);
2558 access_tree = proto_item_add_subtree(access_item, ett_nfs_access);
2562 proto_tree_add_text(access_tree, NullTVB, offset, 4, "%s READ",
2563 decode_boolean_bitfield(access, 0x001, 6, "allow", "not allow"));
2564 proto_tree_add_text(access_tree, NullTVB, offset, 4, "%s LOOKUP",
2565 decode_boolean_bitfield(access, 0x002, 6, "allow", "not allow"));
2566 proto_tree_add_text(access_tree, NullTVB, offset, 4, "%s MODIFY",
2567 decode_boolean_bitfield(access, 0x004, 6, "allow", "not allow"));
2568 proto_tree_add_text(access_tree, NullTVB, offset, 4, "%s EXTEND",
2569 decode_boolean_bitfield(access, 0x008, 6, "allow", "not allow"));
2570 proto_tree_add_text(access_tree, NullTVB, offset, 4, "%s DELETE",
2571 decode_boolean_bitfield(access, 0x010, 6, "allow", "not allow"));
2572 proto_tree_add_text(access_tree, NullTVB, offset, 4, "%s EXECUTE",
2573 decode_boolean_bitfield(access, 0x020, 6, "allow", "not allow"));
2581 /* NFS3 file handle dissector */
2583 dissect_nfs3_nfs_fh3_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2585 offset = old_dissect_nfs_fh3(pd, offset, fd, tree, "object");
2590 /* generic NFS3 reply dissector */
2592 dissect_nfs3_any_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2596 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
2603 /* RFC 1813, Page 32,33 */
2605 dissect_nfs3_getattr_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2607 offset = old_dissect_nfs_fh3(pd, offset, fd, tree, "object");
2612 /* RFC 1813, Page 32,33 */
2614 dissect_nfs3_getattr_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2618 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
2621 offset = dissect_fattr3(pd, offset, fd, tree, "obj_attributes");
2632 /* RFC 1813, Page 33 */
2634 dissect_sattrguard3(const u_char* pd, int offset, frame_data* fd, proto_tree* tree, char *name)
2636 proto_item* sattrguard3_item = NULL;
2637 proto_tree* sattrguard3_tree = NULL;
2638 int old_offset = offset;
2642 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
2643 check = EXTRACT_UINT(pd, offset+0);
2644 check_name = val_to_str(check,value_follows,"Unknown");
2647 sattrguard3_item = proto_tree_add_text(tree, NullTVB, offset,
2648 END_OF_FRAME, "%s: %s", name, check_name);
2649 if (sattrguard3_item)
2650 sattrguard3_tree = proto_item_add_subtree(sattrguard3_item, ett_nfs_sattrguard3);
2653 if (sattrguard3_tree)
2654 proto_tree_add_text(sattrguard3_tree, NullTVB, offset, 4,
2655 "check: %s (%u)", check_name, check);
2661 offset = dissect_nfstime3(pd, offset, fd, sattrguard3_tree,
2669 /* now we know, that sattrguard3 is shorter */
2670 if (sattrguard3_item) {
2671 proto_item_set_len(sattrguard3_item, offset - old_offset);
2678 /* RFC 1813, Page 33..36 */
2680 dissect_nfs3_setattr_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2682 offset = old_dissect_nfs_fh3 (pd, offset, fd, tree, "object");
2683 offset = dissect_sattr3 (pd, offset, fd, tree, "new_attributes");
2684 offset = dissect_sattrguard3(pd, offset, fd, tree, "guard");
2689 /* RFC 1813, Page 33..36 */
2691 dissect_nfs3_setattr_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2695 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
2698 offset = dissect_wcc_data(pd, offset, fd, tree, "obj_wcc");
2701 offset = dissect_wcc_data(pd, offset, fd, tree, "obj_wcc");
2709 /* RFC 1813, Page 37..39 */
2711 dissect_nfs3_lookup_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2713 offset = dissect_diropargs3 (pd, offset, fd, tree, "what");
2718 /* RFC 1813, Page 37..39 */
2720 dissect_nfs3_lookup_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2724 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
2727 offset = old_dissect_nfs_fh3 (pd, offset, fd, tree, "object");
2728 offset = dissect_post_op_attr(pd, offset, fd, tree, "obj_attributes");
2729 offset = dissect_post_op_attr(pd, offset, fd, tree, "dir_attributes");
2732 offset = dissect_post_op_attr(pd, offset, fd, tree, "dir_attributes");
2740 /* RFC 1813, Page 40..43 */
2742 dissect_nfs3_access_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2744 offset = old_dissect_nfs_fh3(pd, offset, fd, tree, "object");
2745 offset = dissect_access (pd, offset, fd, tree, "access");
2751 /* RFC 1813, Page 40..43 */
2753 dissect_nfs3_access_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2757 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
2760 offset = dissect_post_op_attr(pd, offset, fd, tree, "obj_attributes");
2761 offset = dissect_access (pd, offset, fd, tree, "access");
2764 offset = dissect_post_op_attr(pd, offset, fd, tree, "obj_attributes");
2772 /* RFC 1813, Page 44,45 */
2774 dissect_nfs3_readlink_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2778 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
2781 offset = dissect_post_op_attr(pd, offset, fd, tree, "symlink_attributes");
2782 offset = dissect_nfspath3 (pd, offset, fd, tree, hf_nfs_readlink_data);
2785 offset = dissect_post_op_attr(pd, offset, fd, tree, "symlink_attributes");
2793 /* RFC 1813, Page 46..48 */
2795 dissect_nfs3_read_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2797 offset = old_dissect_nfs_fh3(pd, offset, fd, tree, "file");
2798 offset = dissect_offset3(pd, offset, fd, tree, "offset");
2799 offset = dissect_count3 (pd, offset, fd, tree, "count");
2805 /* RFC 1813, Page 46..48 */
2807 dissect_nfs3_read_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2811 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
2814 offset = dissect_post_op_attr(pd, offset, fd, tree, "file_attributes");
2815 offset = dissect_count3 (pd, offset, fd, tree, "count");
2816 offset = dissect_rpc_bool (pd, offset, fd, tree, hf_nfs_read_eof);
2817 offset = dissect_nfsdata (pd, offset, fd, tree, hf_nfs_data);
2820 offset = dissect_post_op_attr(pd, offset, fd, tree, "file_attributes");
2828 /* RFC 1813, Page 49 */
2829 static const value_string names_stable_how[] = {
2830 { UNSTABLE, "UNSTABLE" },
2831 { DATA_SYNC, "DATA_SYNC" },
2832 { FILE_SYNC, "FILE_SYNC" },
2837 /* RFC 1813, Page 49 */
2839 dissect_stable_how(const u_char* pd, int offset, frame_data* fd, proto_tree* tree, int hfindex)
2843 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
2844 stable_how = EXTRACT_UINT(pd,offset+0);
2846 proto_tree_add_uint(tree, hfindex, NullTVB,
2847 offset, 4, stable_how);
2855 /* RFC 1813, Page 49..54 */
2857 dissect_nfs3_write_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2859 offset = old_dissect_nfs_fh3 (pd, offset, fd, tree, "file");
2860 offset = dissect_offset3 (pd, offset, fd, tree, "offset");
2861 offset = dissect_count3 (pd, offset, fd, tree, "count");
2862 offset = dissect_stable_how(pd, offset, fd, tree, hf_nfs_write_stable);
2863 offset = dissect_nfsdata (pd, offset, fd, tree, hf_nfs_data);
2869 /* RFC 1813, Page 49..54 */
2871 dissect_nfs3_write_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2875 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
2878 offset = dissect_wcc_data (pd, offset, fd, tree, "file_wcc");
2879 offset = dissect_count3 (pd, offset, fd, tree, "count");
2880 offset = dissect_stable_how(pd, offset, fd, tree, hf_nfs_write_committed);
2881 offset = dissect_writeverf3(pd, offset, fd, tree);
2884 offset = dissect_wcc_data(pd, offset, fd, tree, "file_wcc");
2892 /* RFC 1813, Page 54 */
2893 static const value_string names_createmode3[] = {
2894 { UNCHECKED, "UNCHECKED" },
2895 { GUARDED, "GUARDED" },
2896 { EXCLUSIVE, "EXCLUSIVE" },
2901 /* RFC 1813, Page 54 */
2903 dissect_createmode3(const u_char* pd, int offset, frame_data* fd, proto_tree* tree, guint32* mode)
2907 if (!BYTES_ARE_IN_FRAME(offset, 4)) return offset;
2908 mode_value = EXTRACT_UINT(pd, offset + 0);
2910 proto_tree_add_uint(tree, hf_nfs_createmode3, NullTVB,
2911 offset+0, 4, mode_value);
2920 /* RFC 1813, Page 54..58 */
2922 dissect_nfs3_create_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2926 offset = dissect_diropargs3 (pd, offset, fd, tree, "where");
2927 offset = dissect_createmode3(pd, offset, fd, tree, &mode);
2931 offset = dissect_sattr3 (pd, offset, fd, tree, "obj_attributes");
2934 offset = dissect_createverf3(pd, offset, fd, tree);
2942 /* RFC 1813, Page 54..58 */
2944 dissect_nfs3_create_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_fh3 (pd, offset, fd, tree, "obj");
2952 offset = dissect_post_op_attr(pd, offset, fd, tree, "obj_attributes");
2953 offset = dissect_wcc_data (pd, offset, fd, tree, "dir_wcc");
2956 offset = dissect_wcc_data (pd, offset, fd, tree, "dir_wcc");
2964 /* RFC 1813, Page 58..60 */
2966 dissect_nfs3_mkdir_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2968 offset = dissect_diropargs3(pd, offset, fd, tree, "where");
2969 offset = dissect_sattr3 (pd, offset, fd, tree, "attributes");
2975 /* RFC 1813, Page 61..63 */
2977 dissect_nfs3_symlink_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2979 offset = dissect_diropargs3(pd, offset, fd, tree, "where");
2980 offset = dissect_sattr3 (pd, offset, fd, tree, "symlink_attributes");
2981 offset = dissect_nfspath3 (pd, offset, fd, tree, hf_nfs_symlink_to);
2987 /* RFC 1813, Page 63..66 */
2989 dissect_nfs3_mknod_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
2993 offset = dissect_diropargs3(pd, offset, fd, tree, "where");
2994 offset = dissect_ftype3(pd, offset, fd, tree, hf_nfs_ftype3, &type);
2998 offset = dissect_sattr3(pd, offset, fd, tree, "dev_attributes");
2999 offset = dissect_specdata3(pd, offset, fd, tree, "spec");
3003 offset = dissect_sattr3(pd, offset, fd, tree, "pipe_attributes");
3014 /* RFC 1813, Page 67..69 */
3016 dissect_nfs3_remove_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
3020 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
3023 offset = dissect_wcc_data (pd, offset, fd, tree, "dir_wcc");
3026 offset = dissect_wcc_data (pd, offset, fd, tree, "dir_wcc");
3034 /* RFC 1813, Page 71..74 */
3036 dissect_nfs3_rename_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
3038 offset = dissect_diropargs3(pd, offset, fd, tree, "from");
3039 offset = dissect_diropargs3(pd, offset, fd, tree, "to");
3045 /* RFC 1813, Page 71..74 */
3047 dissect_nfs3_rename_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
3051 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
3054 offset = dissect_wcc_data(pd, offset, fd, tree, "fromdir_wcc");
3055 offset = dissect_wcc_data(pd, offset, fd, tree, "todir_wcc");
3058 offset = dissect_wcc_data(pd, offset, fd, tree, "fromdir_wcc");
3059 offset = dissect_wcc_data(pd, offset, fd, tree, "todir_wcc");
3067 /* RFC 1813, Page 74..76 */
3069 dissect_nfs3_link_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
3071 offset = old_dissect_nfs_fh3 (pd, offset, fd, tree, "file");
3072 offset = dissect_diropargs3(pd, offset, fd, tree, "link");
3078 /* RFC 1813, Page 74..76 */
3080 dissect_nfs3_link_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
3084 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
3087 offset = dissect_post_op_attr(pd, offset, fd, tree, "file_attributes");
3088 offset = dissect_wcc_data (pd, offset, fd, tree, "linkdir_wcc");
3091 offset = dissect_post_op_attr(pd, offset, fd, tree, "file_attributes");
3092 offset = dissect_wcc_data (pd, offset, fd, tree, "linkdir_wcc");
3100 /* RFC 1813, Page 76..80 */
3102 dissect_nfs3_readdir_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
3104 offset = old_dissect_nfs_fh3 (pd, offset, fd, tree, "dir");
3105 offset = dissect_cookie3 (pd, offset, fd, tree, "cookie");
3106 offset = dissect_cookieverf3(pd, offset, fd, tree);
3107 offset = dissect_count3 (pd, offset, fd, tree, "count");
3113 /* RFC 1813, Page 76..80 */
3115 dissect_entry3(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
3117 proto_item* entry_item = NULL;
3118 proto_tree* entry_tree = NULL;
3119 int old_offset = offset;
3123 entry_item = proto_tree_add_item(tree, hf_nfs_readdir_entry, NullTVB,
3124 offset+0, END_OF_FRAME, FALSE);
3126 entry_tree = proto_item_add_subtree(entry_item, ett_nfs_readdir_entry);
3129 offset = dissect_fileid3(pd, offset, fd, entry_tree, "fileid");
3131 offset = dissect_filename3(pd, offset, fd, entry_tree,
3132 hf_nfs_readdir_entry_name, &name);
3134 proto_item_set_text(entry_item, "Entry: name %s", name);
3137 offset = dissect_cookie3(pd, offset, fd, entry_tree, "cookie");
3139 /* now we know, that a readdir entry is shorter */
3141 proto_item_set_len(entry_item, offset - old_offset);
3148 /* RFC 1813, Page 76..80 */
3150 dissect_nfs3_readdir_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
3155 offset = dissect_stat(pd, offset, fd, tree, &status);
3158 offset = dissect_post_op_attr(pd, offset, fd, tree, "dir_attributes");
3159 offset = dissect_cookieverf3(pd, offset, fd, tree);
3160 offset = dissect_rpc_list(pd, offset, fd, tree,
3162 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
3163 eof_value = EXTRACT_UINT(pd, offset+0);
3165 proto_tree_add_uint(tree, hf_nfs_readdir_eof, NullTVB,
3166 offset+ 0, 4, eof_value);
3170 offset = dissect_post_op_attr(pd, offset, fd, tree, "dir_attributes");
3178 /* RFC 1813, Page 80..83 */
3180 dissect_nfs3_readdirplus_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
3182 offset = old_dissect_nfs_fh3 (pd, offset, fd, tree, "dir");
3183 offset = dissect_cookie3 (pd, offset, fd, tree, "cookie");
3184 offset = dissect_cookieverf3(pd, offset, fd, tree);
3185 offset = dissect_count3 (pd, offset, fd, tree, "dircount");
3186 offset = dissect_count3 (pd, offset, fd, tree, "maxcount");
3192 /* RFC 1813, Page 80..83 */
3194 dissect_entryplus3(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
3196 proto_item* entry_item = NULL;
3197 proto_tree* entry_tree = NULL;
3198 int old_offset = offset;
3202 entry_item = proto_tree_add_item(tree, hf_nfs_readdir_entry, NullTVB,
3203 offset+0, END_OF_FRAME, FALSE);
3205 entry_tree = proto_item_add_subtree(entry_item, ett_nfs_readdir_entry);
3208 offset = dissect_fileid3(pd, offset, fd, entry_tree, "fileid");
3210 offset = dissect_filename3(pd, offset, fd, entry_tree,
3211 hf_nfs_readdirplus_entry_name, &name);
3213 proto_item_set_text(entry_item, "Entry: name %s", name);
3216 offset = dissect_cookie3(pd, offset, fd, entry_tree, "cookie");
3218 offset = dissect_post_op_attr(pd, offset, fd, entry_tree, "name_attributes");
3219 offset = dissect_post_op_fh3(pd, offset, fd, entry_tree, "name_handle");
3221 /* now we know, that a readdirplus entry is shorter */
3223 proto_item_set_len(entry_item, offset - old_offset);
3230 /* RFC 1813, Page 80..83 */
3232 dissect_nfs3_readdirplus_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
3237 offset = dissect_stat(pd, offset, fd, tree, &status);
3240 offset = dissect_post_op_attr(pd, offset, fd, tree, "dir_attributes");
3241 offset = dissect_cookieverf3(pd, offset, fd, tree);
3242 offset = dissect_rpc_list(pd, offset, fd, tree,
3243 dissect_entryplus3);
3244 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
3245 eof_value = EXTRACT_UINT(pd, offset+0);
3247 proto_tree_add_uint(tree, hf_nfs_readdir_eof, NullTVB,
3248 offset+ 0, 4, eof_value);
3252 offset = dissect_post_op_attr(pd, offset, fd, tree, "dir_attributes");
3260 /* RFC 1813, Page 84..86 */
3262 dissect_nfs3_fsstat_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
3267 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
3270 offset = dissect_post_op_attr(pd, offset, fd, tree, "obj_attributes");
3271 offset = dissect_size3 (pd, offset, fd, tree, "tbytes");
3272 offset = dissect_size3 (pd, offset, fd, tree, "fbytes");
3273 offset = dissect_size3 (pd, offset, fd, tree, "abytes");
3274 offset = dissect_size3 (pd, offset, fd, tree, "tfiles");
3275 offset = dissect_size3 (pd, offset, fd, tree, "ffiles");
3276 offset = dissect_size3 (pd, offset, fd, tree, "afiles");
3277 if (!BYTES_ARE_IN_FRAME(offset, 4)) return offset;
3278 invarsec = EXTRACT_UINT(pd, offset + 0);
3280 proto_tree_add_uint(tree, hf_nfs_fsstat_invarsec, NullTVB,
3281 offset+0, 4, invarsec);
3285 offset = dissect_post_op_attr(pd, offset, fd, tree, "obj_attributes");
3293 #define FSF3_LINK 0x0001
3294 #define FSF3_SYMLINK 0x0002
3295 #define FSF3_HOMOGENEOUS 0x0008
3296 #define FSF3_CANSETTIME 0x0010
3299 /* RFC 1813, Page 86..90 */
3301 dissect_nfs3_fsinfo_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
3312 proto_item* properties_item = NULL;
3313 proto_tree* properties_tree = NULL;
3315 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
3318 offset = dissect_post_op_attr(pd, offset, fd, tree, "obj_attributes");
3319 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
3320 rtmax = EXTRACT_UINT(pd, offset+0);
3322 proto_tree_add_uint(tree, hf_nfs_fsinfo_rtmax, NullTVB,
3323 offset+0, 4, rtmax);
3325 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
3326 rtpref = EXTRACT_UINT(pd, offset+0);
3328 proto_tree_add_uint(tree, hf_nfs_fsinfo_rtpref, NullTVB,
3329 offset+0, 4, rtpref);
3331 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
3332 rtmult = EXTRACT_UINT(pd, offset+0);
3334 proto_tree_add_uint(tree, hf_nfs_fsinfo_rtmult, NullTVB,
3335 offset+0, 4, rtmult);
3337 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
3338 wtmax = EXTRACT_UINT(pd, offset+0);
3340 proto_tree_add_uint(tree, hf_nfs_fsinfo_wtmax, NullTVB,
3341 offset+0, 4, wtmax);
3343 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
3344 wtpref = EXTRACT_UINT(pd, offset+0);
3346 proto_tree_add_uint(tree, hf_nfs_fsinfo_wtpref, NullTVB,
3347 offset+0, 4, wtpref);
3349 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
3350 wtmult = EXTRACT_UINT(pd, offset+0);
3352 proto_tree_add_uint(tree, hf_nfs_fsinfo_wtmult, NullTVB,
3353 offset+0, 4, wtmult);
3355 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
3356 dtpref = EXTRACT_UINT(pd, offset+0);
3358 proto_tree_add_uint(tree, hf_nfs_fsinfo_dtpref, NullTVB,
3359 offset+0, 4, dtpref);
3362 offset = dissect_size3 (pd, offset, fd, tree, "maxfilesize");
3363 offset = dissect_nfstime3(pd, offset, fd, tree, "time_delta");
3364 if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
3365 properties = EXTRACT_UINT(pd, offset+0);
3367 properties_item = proto_tree_add_uint(tree,
3368 hf_nfs_fsinfo_properties,
3369 NullTVB, offset+0, 4, properties);
3370 if (properties_item)
3371 properties_tree = proto_item_add_subtree(properties_item, ett_nfs_fsinfo_properties);
3372 if (properties_tree) {
3373 proto_tree_add_text(properties_tree, NullTVB,
3375 decode_boolean_bitfield(properties,
3377 "SETATTR can set time on server",
3378 "SETATTR can't set time on server"));
3380 proto_tree_add_text(properties_tree, NullTVB,
3382 decode_boolean_bitfield(properties,
3384 "PATHCONF is valid for all files",
3385 "PATHCONF should be get for every single file"));
3387 proto_tree_add_text(properties_tree, NullTVB,
3389 decode_boolean_bitfield(properties,
3391 "File System supports symbolic links",
3392 "File System does not symbolic hard links"));
3394 proto_tree_add_text(properties_tree, NullTVB,
3396 decode_boolean_bitfield(properties,
3398 "File System supports hard links",
3399 "File System does not support hard links"));
3405 offset = dissect_post_op_attr(pd, offset, fd, tree, "obj_attributes");
3413 /* RFC 1813, Page 90..92 */
3415 dissect_nfs3_pathconf_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
3421 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
3424 offset = dissect_post_op_attr(pd, offset, fd, tree, "obj_attributes");
3425 if (!BYTES_ARE_IN_FRAME(offset, 4)) return offset;
3426 linkmax = EXTRACT_UINT(pd, offset + 0);
3428 proto_tree_add_uint(tree, hf_nfs_pathconf_linkmax, NullTVB,
3429 offset+0, 4, linkmax);
3431 if (!BYTES_ARE_IN_FRAME(offset, 4)) return offset;
3432 name_max = EXTRACT_UINT(pd, offset + 0);
3434 proto_tree_add_uint(tree, hf_nfs_pathconf_name_max, NullTVB,
3435 offset+0, 4, name_max);
3437 offset = dissect_rpc_bool(pd, offset, fd, tree, hf_nfs_pathconf_no_trunc);
3438 offset = dissect_rpc_bool(pd, offset, fd, tree, hf_nfs_pathconf_chown_restricted);
3439 offset = dissect_rpc_bool(pd, offset, fd, tree, hf_nfs_pathconf_case_insensitive);
3440 offset = dissect_rpc_bool(pd, offset, fd, tree, hf_nfs_pathconf_case_preserving);
3443 offset = dissect_post_op_attr(pd, offset, fd, tree, "obj_attributes");
3451 /* RFC 1813, Page 92..95 */
3453 dissect_nfs3_commit_call(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
3455 offset = old_dissect_nfs_fh3(pd, offset, fd, tree, "file");
3456 offset = dissect_offset3(pd, offset, fd, tree, "offset");
3457 offset = dissect_count3 (pd, offset, fd, tree, "count");
3463 /* RFC 1813, Page 92..95 */
3465 dissect_nfs3_commit_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* tree)
3469 offset = dissect_nfsstat3(pd, offset, fd, tree, &status);
3472 offset = dissect_wcc_data (pd, offset, fd, tree, "file_wcc");
3473 offset = dissect_writeverf3(pd, offset, fd, tree);
3476 offset = dissect_wcc_data(pd, offset, fd, tree, "file_wcc");
3483 /* 1 missing functions */
3485 /* NFS Version 4 Protocol Draft Specification 07 */
3488 dissect_nfs_utf8string(const u_char *pd, int offset, frame_data *fd,
3489 proto_tree *tree, int hf, char **string_ret)
3491 /* TODO: this needs to be fixed */
3492 return dissect_rpc_string(pd, offset, fd, tree, hf, string_ret);
3496 dissect_nfs_seqid4(const u_char *pd, int offset, frame_data *fd,
3501 seqid = EXTRACT_UINT(pd, offset);
3502 proto_tree_add_uint(tree, hf_nfs_seqid4, NullTVB, offset, 4, seqid);
3509 dissect_nfs_stateid4(const u_char *pd, int offset, frame_data *fd,
3510 proto_tree *tree, char *name)
3512 return dissect_rpc_uint64(pd, offset, fd, tree, name);
3516 dissect_nfs_offset4(const u_char *pd, int offset, frame_data *fd,
3517 proto_tree *tree, char *name)
3519 return dissect_rpc_uint64(pd, offset, fd, tree, name);
3523 dissect_nfs_count4(const u_char *pd, int offset, frame_data *fd,
3524 proto_tree *tree, char *name)
3526 return dissect_rpc_uint32(pd, offset, fd, tree, name);
3530 dissect_nfs_type4(const u_char *pd, int offset, frame_data *fd,
3531 proto_tree *tree, char *name)
3533 return dissect_rpc_uint32(pd, offset, fd, tree, name);
3537 dissect_nfs_linktext4(const u_char *pd, int offset, frame_data *fd,
3538 proto_tree *tree, char *name)
3540 return dissect_nfs_utf8string(pd, offset, fd, tree, hf_nfs_linktext4, NULL);
3544 dissect_nfs_specdata4(const u_char *pd, int offset, frame_data *fd,
3545 proto_tree *tree, char *name)
3547 offset = dissect_rpc_uint32(pd, offset, fd, tree, "specdata1");
3548 offset = dissect_rpc_uint32(pd, offset, fd, tree, "specdata2");
3554 dissect_nfs_clientid4(const u_char *pd, int offset, frame_data *fd,
3555 proto_tree *tree, char *name)
3557 return dissect_rpc_uint64(pd, offset, fd, tree, name);
3561 dissect_nfs_client_id4(const u_char *pd, int offset, frame_data *fd,
3562 proto_tree *tree, char *name)
3564 offset = dissect_nfs_clientid4(pd, offset, fd, tree, "Verifier");
3565 offset = dissect_nfsdata(pd, offset, fd, tree, hf_nfs_data);
3570 static const value_string names_ftype4[] = {
3571 { NF4REG, "NF4REG" },
3572 { NF4DIR, "NF4DIR" },
3573 { NF4BLK, "NF4BLK" },
3574 { NF4CHR, "NF4CHR" },
3575 { NF4LNK, "NF4LNK" },
3576 { NF4SOCK, "NF4SOCK" },
3577 { NF4FIFO, "NF4FIFO" },
3578 { NF4ATTRDIR, "NF4ATTRDIR" },
3579 { NF4NAMEDATTR, "NF4NAMEDATTR" },
3584 dissect_nfs_ftype4(const u_char *pd, int offset, frame_data *fd,
3585 proto_tree *tree, char *name)
3589 ftype4 = EXTRACT_UINT(pd, offset);
3590 proto_tree_add_uint(tree, hf_nfs_ftype4, NullTVB, offset, 4, ftype4);
3597 dissect_nfs_component4(const u_char *pd, int offset, frame_data *fd,
3598 proto_tree *tree, char *name)
3600 return dissect_nfs_utf8string(pd, offset, fd, tree, hf_nfs_component4,
3605 dissect_nfs_lock_type4(const u_char *pd, int offset, frame_data *fd,
3606 proto_tree *tree, char *name)
3608 return dissect_rpc_uint32(pd, offset, fd, tree, name);
3612 dissect_nfs_reclaim4(const u_char *pd, int offset, frame_data *fd,
3613 proto_tree *tree, char *name)
3615 return dissect_rpc_uint32(pd, offset, fd, tree, name);
3619 dissect_nfs_length4(const u_char *pd, int offset, frame_data *fd,
3620 proto_tree *tree, char *name)
3622 return dissect_rpc_uint64(pd, offset, fd, tree, name);
3626 dissect_nfs_opaque4(const u_char *pd, int offset, frame_data *fd,
3627 proto_tree *tree, char *name);
3630 dissect_nfs_lockowner4(const u_char *pd, int offset, frame_data *fd,
3631 proto_tree *tree, char *name)
3633 proto_tree *newftree = NULL;
3634 proto_item *fitem = NULL;
3636 fitem = proto_tree_add_text(tree, NullTVB, offset, 4, "Owner");
3639 newftree = proto_item_add_subtree(fitem, ett_nfs_lockowner4);
3642 offset = dissect_rpc_uint64(pd, offset, fd, newftree, "Client ID");
3643 offset = dissect_nfs_opaque4(pd, offset, fd, newftree, "Owner");
3651 dissect_nfs_pathname4(const u_char *pd, int offset, frame_data *fd,
3652 proto_tree *tree, char *name)
3654 guint comp_count, i;
3655 proto_item *fitem = NULL;
3656 proto_tree *newftree = NULL;
3658 comp_count=EXTRACT_UINT(pd, offset);
3659 fitem = proto_tree_add_text(tree, NullTVB, offset, 4,
3660 "pathname components (%d)", comp_count);
3664 newftree = proto_item_add_subtree(fitem, ett_nfs_pathname4);
3667 for (i=0; i<comp_count; i++)
3668 offset=dissect_nfs_component4(pd, offset, fd, newftree, "comp");
3676 dissect_nfs_changeid4(const u_char *pd, int offset, frame_data *fd,
3677 proto_tree *tree, char *name)
3679 return dissect_rpc_uint64(pd, offset, fd, tree, name);
3683 dissect_nfs_nfstime4(const u_char *pd, int offset, frame_data *fd,
3684 proto_tree *tree, char *name)
3686 offset = dissect_rpc_uint64(pd, offset, fd, tree, "seconds");
3687 offset = dissect_rpc_uint32(pd, offset, fd, tree, "nseconds");
3691 static const value_string names_time_how4[] = {
3692 #define SET_TO_SERVER_TIME4 0
3693 { SET_TO_SERVER_TIME4, "SET_TO_SERVER_TIME4" },
3694 #define SET_TO_CLIENT_TIME4 1
3695 { SET_TO_CLIENT_TIME4, "SET_TO_CLIENT_TIME4" },
3700 dissect_nfs_settime4(const u_char *pd, int offset, frame_data *fd,
3701 proto_tree *tree, char *name)
3705 if (!BYTES_ARE_IN_FRAME(offset, 4)) return offset;
3707 set_it = EXTRACT_UINT(pd, offset);
3708 proto_tree_add_uint(tree, hf_nfs_time_how4, NullTVB, offset+0,
3712 if (set_it == SET_TO_CLIENT_TIME4)
3713 offset = dissect_nfs_nfstime4(pd, offset, fd, tree, NULL);
3718 static const value_string names_fattr4_expire_type[] = {
3719 #define FH4_PERSISTENT 0x00000000
3720 { FH4_PERSISTENT, "FH4_PERSISTENT" },
3721 #define FH4_NOEXPIRE_WITH_OPEN 0x00000001
3722 { FH4_NOEXPIRE_WITH_OPEN, "FH4_NOEXPIRE_WITH_OPEN" },
3723 #define FH4_VOLATILE_ANY 0x00000002
3724 { FH4_NOEXPIRE_WITH_OPEN, "FH4_NOEXPIRE_WITH_OPEN" },
3725 #define FH4_VOL_MIGRATION 0x00000004
3726 { FH4_VOL_MIGRATION, "FH4_VOL_MIGRATION" },
3727 #define FH4_VOL_RENAME 0x00000008
3728 { FH4_VOL_RENAME, "FH4_VOL_RENAME" },
3733 dissect_nfs_fh_expire_type(const u_char *pd, int offset, frame_data *fd,
3736 guint32 fattr4_fh_expire_type;
3738 if (!BYTES_ARE_IN_FRAME(offset, 4)) return offset;
3740 fattr4_fh_expire_type = EXTRACT_UINT(pd, offset);
3741 proto_tree_add_uint(tree, hf_nfs_fattr4_expire_type, NullTVB, offset+0,
3742 4, fattr4_fh_expire_type);
3749 dissect_nfs_fsid4(const u_char *pd, int offset, frame_data *fd,
3750 proto_tree *tree, char *name)
3752 proto_tree *newftree = NULL;
3753 proto_item *fitem = NULL;
3755 if (!BYTES_ARE_IN_FRAME(offset, 8)) return offset;
3757 fitem = proto_tree_add_text(tree, NullTVB, offset, 0, "%s", name);
3759 if (fitem == NULL) return offset;
3761 newftree = proto_item_add_subtree(fitem, ett_nfs_fsid4);
3763 if (newftree == NULL) return offset;
3765 offset = dissect_rpc_uint64(pd, offset, fd, newftree, "major");
3766 offset = dissect_rpc_uint64(pd, offset, fd, newftree, "minor");
3772 dissect_nfs_acetype4(const u_char *pd, int offset, frame_data *fd,
3773 proto_tree *tree, char *name)
3775 return dissect_rpc_uint32(pd, offset, fd, tree, name);
3779 dissect_nfs_aceflag4(const u_char *pd, int offset, frame_data *fd,
3780 proto_tree *tree, char *name)
3782 return dissect_rpc_uint32(pd, offset, fd, tree, name);
3786 dissect_nfs_acemask4(const u_char *pd, int offset, frame_data *fd,
3787 proto_tree *tree, char *name)
3789 return dissect_rpc_uint32(pd, offset, fd, tree, name);
3793 dissect_nfs_nfsace4(const u_char *pd, int offset, frame_data *fd,
3794 proto_tree *tree, char *name)
3796 proto_tree *newftree = NULL;
3797 proto_item *fitem = NULL;
3800 if (!BYTES_ARE_IN_FRAME(offset, 4)) return offset;
3802 fitem = proto_tree_add_text(tree, NullTVB, offset, 0, "%s", name);
3804 if (fitem == NULL) return offset;
3806 newftree = proto_item_add_subtree(fitem, ett_nfs_fsid4);
3808 if (newftree == NULL) return offset;
3810 nextentry = EXTRACT_UINT(pd, offset);
3811 offset = dissect_rpc_bool(pd, offset, fd, newftree, hf_nfs_data_follows);
3815 offset = dissect_nfs_acetype4(pd, offset, fd, newftree, "type");
3816 offset = dissect_nfs_aceflag4(pd, offset, fd, newftree, "flag");
3817 offset = dissect_nfs_acemask4(pd, offset, fd, newftree, "access_mask");
3818 offset = dissect_nfs_utf8string(pd, offset, fd, newftree,
3820 nextentry = EXTRACT_UINT(pd, offset);
3828 dissect_nfs_fh4(const u_char *pd, int offset, frame_data *fd,
3829 proto_tree *tree, char *name)
3831 return old_dissect_nfs_fh3(pd, offset, fd, tree, name);
3835 dissect_nfs_fs_location4(const u_char *pd, int offset, frame_data *fd,
3836 proto_tree *tree, char *name)
3838 proto_tree *newftree = NULL;
3839 proto_item *fitem = NULL;
3841 fitem = proto_tree_add_text(tree, NullTVB, offset, 0, "%s", name);
3843 if (fitem == NULL) return offset;
3845 newftree = proto_item_add_subtree(fitem, ett_nfs_fs_location4);
3847 if (newftree == NULL) return offset;
3849 offset = dissect_nfs_utf8string(pd, offset, fd, tree, hf_nfs_server, NULL);
3855 dissect_nfs_fs_locations4(const u_char *pd, int offset, frame_data *fd,
3856 proto_tree *tree, char *name)
3858 proto_tree *newftree = NULL;
3859 proto_item *fitem = NULL;
3862 if (!BYTES_ARE_IN_FRAME(offset, 4)) return offset;
3864 fitem = proto_tree_add_text(tree, NullTVB, offset, 0, "%s", name);
3866 if (fitem == NULL) return offset;
3868 newftree = proto_item_add_subtree(fitem, ett_nfs_fs_locations4);
3870 if (newftree == NULL) return offset;
3872 offset = dissect_nfs_pathname4(pd, offset, fd, newftree, "fs_root");
3874 nextentry = EXTRACT_UINT(pd, offset);
3875 offset = dissect_rpc_bool(pd, offset, fd, newftree, hf_nfs_data_follows);
3879 offset = dissect_nfs_fs_location4(pd, offset, fd, newftree, "locations");
3880 nextentry = EXTRACT_UINT(pd, offset);
3888 dissect_nfs_mode4(const u_char *pd, int offset, frame_data *fd,
3889 proto_tree *tree, char *name)
3891 return dissect_mode(pd, offset, fd, tree, name);
3894 static const value_string names_fattr4[] = {
3895 #define FATTR4_SUPPORTED_ATTRS 0
3896 { FATTR4_SUPPORTED_ATTRS, "FATTR4_SUPPORTED_ATTRS" },
3897 #define FATTR4_TYPE 1
3898 { FATTR4_TYPE, "FATTR4_TYPE" },
3899 #define FATTR4_FH_EXPIRE_TYPE 2
3900 { FATTR4_FH_EXPIRE_TYPE, "FATTR4_FH_EXPIRE_TYPE" },
3901 #define FATTR4_CHANGE 3
3902 { FATTR4_CHANGE, "FATTR4_CHANGE" },
3903 #define FATTR4_SIZE 4
3904 { FATTR4_SIZE, "FATTR4_SIZE" },
3905 #define FATTR4_LINK_SUPPORT 5
3906 { FATTR4_LINK_SUPPORT, "FATTR4_LINK_SUPPORT" },
3907 #define FATTR4_SYMLINK_SUPPORT 6
3908 { FATTR4_SYMLINK_SUPPORT, "FATTR4_SYMLINK_SUPPORT" },
3909 #define FATTR4_NAMED_ATTR 7
3910 { FATTR4_NAMED_ATTR, "FATTR4_NAMED_ATTR" },
3911 #define FATTR4_FSID 8
3912 { FATTR4_FSID, "FATTR4_FSID" },
3913 #define FATTR4_UNIQUE_HANDLES 9
3914 { FATTR4_UNIQUE_HANDLES, "FATTR4_UNIQUE_HANDLES" },
3915 #define FATTR4_LEASE_TIME 10
3916 { FATTR4_LEASE_TIME, "FATTR4_LEASE_TIME" },
3917 #define FATTR4_RDATTR_ERROR 11
3918 { FATTR4_RDATTR_ERROR, "FATTR4_RDATTR_ERROR" },
3919 #define FATTR4_ACL 12
3920 { FATTR4_ACL, "FATTR4_ACL" },
3921 #define FATTR4_ACLSUPPORT 13
3922 { FATTR4_ACLSUPPORT, "FATTR4_ACLSUPPORT" },
3923 #define FATTR4_ARCHIVE 14
3924 { FATTR4_ARCHIVE, "FATTR4_ARCHIVE" },
3925 #define FATTR4_CANSETTIME 15
3926 { FATTR4_CANSETTIME, "FATTR4_CANSETTIME" },
3927 #define FATTR4_CASE_INSENSITIVE 16
3928 { FATTR4_CASE_INSENSITIVE, "FATTR4_CASE_INSENSITIVE" },
3929 #define FATTR4_CASE_PRESERVING 17
3930 { FATTR4_CASE_PRESERVING, "FATTR4_CASE_PRESERVING" },
3931 #define FATTR4_CHOWN_RESTRICTED 18
3932 { FATTR4_CHOWN_RESTRICTED, "FATTR4_CHOWN_RESTRICTED" },
3933 #define FATTR4_FILEHANDLE 19
3934 { FATTR4_FILEHANDLE, "FATTR4_FILEHANDLE" },
3935 #define FATTR4_FILEID 20
3936 { FATTR4_FILEID, "FATTR4_FILEID" },
3937 #define FATTR4_FILES_AVAIL 21
3938 { FATTR4_FILES_AVAIL, "FATTR4_FILES_AVAIL" },
3939 #define FATTR4_FILES_FREE 22
3940 { FATTR4_FILES_FREE, "FATTR4_FILES_FREE" },
3941 #define FATTR4_FILES_TOTAL 23
3942 { FATTR4_FILES_TOTAL, "FATTR4_FILES_TOTAL" },
3943 #define FATTR4_FS_LOCATIONS 24
3944 { FATTR4_FS_LOCATIONS, "FATTR4_FS_LOCATIONS" },
3945 #define FATTR4_HIDDEN 25
3946 { FATTR4_HIDDEN, "FATTR4_HIDDEN" },
3947 #define FATTR4_HOMOGENEOUS 26
3948 { FATTR4_HOMOGENEOUS, "FATTR4_HOMOGENEOUS" },
3949 #define FATTR4_MAXFILESIZE 27
3950 { FATTR4_MAXFILESIZE, "FATTR4_MAXFILESIZE" },
3951 #define FATTR4_MAXLINK 28
3952 { FATTR4_MAXLINK, "FATTR4_MAXLINK" },
3953 #define FATTR4_MAXNAME 29
3954 { FATTR4_MAXNAME, "FATTR4_MAXNAME" },
3955 #define FATTR4_MAXREAD 30
3956 { FATTR4_MAXREAD, "FATTR4_MAXREAD" },
3957 #define FATTR4_MAXWRITE 31
3958 { FATTR4_MAXWRITE, "FATTR4_MAXWRITE" },
3959 #define FATTR4_MIMETYPE 32
3960 { FATTR4_MIMETYPE, "FATTR4_MIMETYPE" },
3961 #define FATTR4_MODE 33
3962 { FATTR4_MODE, "FATTR4_MODE" },
3963 #define FATTR4_NO_TRUNC 34
3964 { FATTR4_NO_TRUNC, "FATTR4_NO_TRUNC" },
3965 #define FATTR4_NUMLINKS 35
3966 { FATTR4_NUMLINKS, "FATTR4_NUMLINKS" },
3967 #define FATTR4_OWNER 36
3968 { FATTR4_OWNER, "FATTR4_OWNER" },
3969 #define FATTR4_OWNER_GROUP 37
3970 { FATTR4_OWNER_GROUP, "FATTR4_OWNER_GROUP" },
3971 #define FATTR4_QUOTA_AVAIL_HARD 38
3972 { FATTR4_QUOTA_AVAIL_HARD, "FATTR4_QUOTA_AVAIL_HARD" },
3973 #define FATTR4_QUOTA_AVAIL_SOFT 39
3974 { FATTR4_QUOTA_AVAIL_SOFT, "FATTR4_QUOTA_AVAIL_SOFT" },
3975 #define FATTR4_QUOTA_USED 40
3976 { FATTR4_QUOTA_USED, "FATTR4_QUOTA_USED" },
3977 #define FATTR4_RAWDEV 41
3978 { FATTR4_RAWDEV, "FATTR4_RAWDEV" },
3979 #define FATTR4_SPACE_AVAIL 42
3980 { FATTR4_SPACE_AVAIL, "FATTR4_SPACE_AVAIL" },
3981 #define FATTR4_SPACE_FREE 43
3982 { FATTR4_SPACE_FREE, "FATTR4_SPACE_FREE" },
3983 #define FATTR4_SPACE_TOTAL 44
3984 { FATTR4_SPACE_TOTAL, "FATTR4_SPACE_TOTAL" },
3985 #define FATTR4_SPACE_USED 45
3986 { FATTR4_SPACE_USED, "FATTR4_SPACE_USED" },
3987 #define FATTR4_SYSTEM 46
3988 { FATTR4_SYSTEM, "FATTR4_SYSTEM" },
3989 #define FATTR4_TIME_ACCESS 47
3990 { FATTR4_TIME_ACCESS, "FATTR4_TIME_ACCESS" },
3991 #define FATTR4_TIME_ACCESS_SET 48
3992 { FATTR4_TIME_ACCESS_SET, "FATTR4_TIME_ACCESS_SET" },
3993 #define FATTR4_TIME_BACKUP 49
3994 { FATTR4_TIME_BACKUP, "FATTR4_TIME_BACKUP" },
3995 #define FATTR4_TIME_CREATE 50
3996 { FATTR4_TIME_CREATE, "FATTR4_TIME_CREATE" },
3997 #define FATTR4_TIME_DELTA 51
3998 { FATTR4_TIME_DELTA, "FATTR4_TIME_DELTA" },
3999 #define FATTR4_TIME_METADATA 52
4000 { FATTR4_TIME_METADATA, "FATTR4_TIME_METADATA" },
4001 #define FATTR4_TIME_MODIFY 53
4002 { FATTR4_TIME_MODIFY, "FATTR4_TIME_MODIFY" },
4003 #define FATTR4_TIME_MODIFY_SET 54
4004 { FATTR4_TIME_MODIFY_SET, "FATTR4_TIME_MODIFY_SET" },
4010 dissect_nfs_attributes(const u_char *pd, int offset, frame_data *fd,
4011 proto_tree *tree, char *name, int type)
4014 proto_item *fitem = NULL;
4015 proto_tree *newftree = NULL;
4016 proto_item *attr_fitem = NULL;
4017 proto_tree *attr_newftree = NULL;
4021 int attr_vals_offset;
4023 if (!BYTES_ARE_IN_FRAME(offset, 4)) return offset;
4025 bitmap_len = EXTRACT_UINT(pd, offset);
4026 fitem = proto_tree_add_text(tree, NullTVB, offset, 4 + bitmap_len * 4,
4030 if (fitem == NULL) return offset;
4032 newftree = proto_item_add_subtree(fitem, ett_nfs_bitmap4);
4034 if (newftree == NULL) return offset;
4036 attr_vals_offset = offset + 4 + bitmap_len * 4;
4038 bitmap = g_malloc(bitmap_len * sizeof(guint32));
4039 if (bitmap == NULL) return offset;
4041 for (i = 0; i < bitmap_len; i++)
4043 if (!BYTES_ARE_IN_FRAME(offset, 4))
4049 bitmap[i] = EXTRACT_UINT(pd, offset);
4053 for (j = 0; j < 32; j++)
4059 /* switch label if attribute is recommended vs. mandatory */
4060 attr_fitem = proto_tree_add_uint(newftree,
4061 (fattr < FATTR4_ACL)? hf_nfs_mand_attr: hf_nfs_recc_attr,
4062 NullTVB, offset, 4, fattr);
4064 if (attr_fitem == NULL)
4067 attr_newftree = proto_item_add_subtree(attr_fitem, ett_nfs_bitmap4);
4069 if (attr_newftree == NULL)
4074 /* do a full decode of the arguments for the set flag */
4077 case FATTR4_SUPPORTED_ATTRS:
4078 attr_vals_offset = dissect_nfs_attributes(pd,
4079 attr_vals_offset, fd, attr_newftree,
4080 "fattr4_supported_attrs", 0);
4084 attr_vals_offset = dissect_nfs_ftype4(pd, attr_vals_offset,
4085 fd, attr_newftree, "fattr4_type");
4088 case FATTR4_FH_EXPIRE_TYPE:
4089 attr_vals_offset = dissect_nfs_fh_expire_type(pd,
4090 attr_vals_offset, fd, attr_newftree);
4094 attr_vals_offset = dissect_nfs_changeid4(pd, attr_vals_offset,
4095 fd, attr_newftree, "fattr4_change");
4099 attr_vals_offset = dissect_rpc_uint64(pd, attr_vals_offset,
4100 fd, attr_newftree, "size");
4103 case FATTR4_LINK_SUPPORT:
4104 attr_vals_offset = dissect_rpc_bool(pd, attr_vals_offset,
4105 fd, attr_newftree, hf_nfs_fattr4_link_support);
4108 case FATTR4_SYMLINK_SUPPORT:
4109 attr_vals_offset = dissect_rpc_bool(pd, attr_vals_offset,
4110 fd, attr_newftree, hf_nfs_fattr4_symlink_support);
4113 case FATTR4_NAMED_ATTR:
4114 attr_vals_offset = dissect_rpc_bool(pd, attr_vals_offset,
4115 fd, attr_newftree, hf_nfs_fattr4_named_attr);
4119 attr_vals_offset = dissect_nfs_fsid4(pd, attr_vals_offset,
4120 fd, attr_newftree, "fattr4_fsid");
4123 case FATTR4_UNIQUE_HANDLES:
4124 attr_vals_offset = dissect_rpc_bool(pd, attr_vals_offset,
4125 fd, attr_newftree, hf_nfs_fattr4_unique_handles);
4128 case FATTR4_LEASE_TIME:
4129 attr_vals_offset = dissect_rpc_uint32(pd, attr_vals_offset,
4130 fd, attr_newftree, "fattr4_lease_time");
4133 case FATTR4_RDATTR_ERROR:
4134 attr_vals_offset = dissect_nfs_nfsstat4(pd, attr_vals_offset,
4135 fd, attr_newftree, NULL);
4139 attr_vals_offset = dissect_nfs_nfsace4(pd, attr_vals_offset,
4140 fd, attr_newftree, "fattr4_acl");
4143 case FATTR4_ACLSUPPORT:
4144 attr_vals_offset = dissect_rpc_uint32(pd, attr_vals_offset,
4145 fd, attr_newftree, "fattr4_aclsupport");
4148 case FATTR4_ARCHIVE:
4149 attr_vals_offset = dissect_rpc_bool(pd, attr_vals_offset,
4150 fd, attr_newftree, hf_nfs_fattr4_archive);
4153 case FATTR4_CANSETTIME:
4154 attr_vals_offset = dissect_rpc_bool(pd, attr_vals_offset,
4155 fd, attr_newftree, hf_nfs_fattr4_cansettime);
4158 case FATTR4_CASE_INSENSITIVE:
4159 attr_vals_offset = dissect_rpc_bool(pd, attr_vals_offset,
4160 fd, attr_newftree, hf_nfs_fattr4_case_insensitive);
4163 case FATTR4_CASE_PRESERVING:
4164 attr_vals_offset = dissect_rpc_bool(pd, attr_vals_offset,
4165 fd, attr_newftree, hf_nfs_fattr4_case_preserving);
4168 case FATTR4_CHOWN_RESTRICTED:
4169 attr_vals_offset = dissect_rpc_bool(pd, attr_vals_offset,
4170 fd, attr_newftree, hf_nfs_fattr4_chown_restricted);
4174 attr_vals_offset = dissect_rpc_uint64(pd, attr_vals_offset,
4175 fd, attr_newftree, "fattr4_fileid");
4178 case FATTR4_FILES_AVAIL:
4179 attr_vals_offset = dissect_rpc_uint64(pd, attr_vals_offset,
4180 fd, attr_newftree, "fattr4_files_avail");
4183 case FATTR4_FILEHANDLE:
4184 attr_vals_offset = dissect_nfs_fh4(pd, attr_vals_offset,
4185 fd, attr_newftree, "fattr4_filehandle");
4188 case FATTR4_FILES_FREE:
4189 attr_vals_offset = dissect_rpc_uint64(pd, attr_vals_offset,
4190 fd, attr_newftree, "fattr4_files_free");
4193 case FATTR4_FILES_TOTAL:
4194 attr_vals_offset = dissect_rpc_uint64(pd, attr_vals_offset,
4195 fd, attr_newftree, "fattr4_files_total");
4198 case FATTR4_FS_LOCATIONS:
4199 attr_vals_offset = dissect_nfs_fs_locations4(pd,
4200 attr_vals_offset, fd, attr_newftree,
4201 "fattr4_fs_locations");
4205 attr_vals_offset = dissect_rpc_bool(pd, attr_vals_offset,
4206 fd, attr_newftree, hf_nfs_fattr4_hidden);
4209 case FATTR4_HOMOGENEOUS:
4210 attr_vals_offset = dissect_rpc_bool(pd, attr_vals_offset,
4211 fd, attr_newftree, hf_nfs_fattr4_homogeneous);
4214 case FATTR4_MAXFILESIZE:
4215 attr_vals_offset = dissect_rpc_uint64(pd, attr_vals_offset,
4216 fd, attr_newftree, "fattr4_maxfilesize");
4219 case FATTR4_MAXLINK:
4220 attr_vals_offset = dissect_rpc_uint32(pd, attr_vals_offset,
4221 fd, attr_newftree, "fattr4_maxlink");
4224 case FATTR4_MAXNAME:
4225 attr_vals_offset = dissect_rpc_uint32(pd, attr_vals_offset,
4226 fd, attr_newftree, "fattr4_maxname");
4229 case FATTR4_MAXREAD:
4230 attr_vals_offset = dissect_rpc_uint64(pd, attr_vals_offset,
4231 fd, attr_newftree, "fattr4_maxread");
4234 case FATTR4_MAXWRITE:
4235 attr_vals_offset = dissect_rpc_uint64(pd, attr_vals_offset,
4236 fd, attr_newftree, "fattr4_maxwrite");
4239 case FATTR4_MIMETYPE:
4240 attr_vals_offset = dissect_nfs_utf8string(pd,
4241 attr_vals_offset, fd, attr_newftree,
4242 hf_nfs_fattr4_mimetype, NULL);
4246 attr_vals_offset = dissect_nfs_mode4(pd,
4247 attr_vals_offset, fd, attr_newftree, "fattr4_mode");
4250 case FATTR4_NO_TRUNC:
4251 attr_vals_offset = dissect_rpc_bool(pd, attr_vals_offset,
4252 fd, attr_newftree, hf_nfs_fattr4_no_trunc);
4255 case FATTR4_NUMLINKS:
4256 attr_vals_offset = dissect_rpc_uint32(pd, attr_vals_offset,
4257 fd, attr_newftree, "fattr4_numlinks");
4261 attr_vals_offset = dissect_nfs_utf8string(pd,
4262 attr_vals_offset, fd, attr_newftree, hf_nfs_fattr4_owner,
4266 case FATTR4_OWNER_GROUP:
4267 attr_vals_offset = dissect_nfs_utf8string(pd,
4268 attr_vals_offset, fd, attr_newftree,
4269 hf_nfs_fattr4_owner_group, NULL);
4272 case FATTR4_QUOTA_AVAIL_HARD:
4273 attr_vals_offset = dissect_rpc_uint64(pd, attr_vals_offset,
4274 fd, attr_newftree, "fattr4_quota_hard");
4277 case FATTR4_QUOTA_AVAIL_SOFT:
4278 attr_vals_offset = dissect_rpc_uint64(pd, attr_vals_offset,
4279 fd, attr_newftree, "fattr4_quota_soft");
4282 case FATTR4_QUOTA_USED:
4283 attr_vals_offset = dissect_rpc_uint64(pd, attr_vals_offset,
4284 fd, attr_newftree, "fattr4_quota_used");
4288 attr_vals_offset = dissect_nfs_specdata4(pd, attr_vals_offset,
4289 fd, attr_newftree, "fattr4_rawdev");
4292 case FATTR4_SPACE_AVAIL:
4293 attr_vals_offset = dissect_rpc_uint64(pd, attr_vals_offset,
4294 fd, attr_newftree, "fattr4_space_avail");
4297 case FATTR4_SPACE_FREE:
4298 attr_vals_offset = dissect_rpc_uint64(pd, attr_vals_offset,
4299 fd, attr_newftree, "fattr4_space_free");
4302 case FATTR4_SPACE_TOTAL:
4303 attr_vals_offset = dissect_rpc_uint64(pd, attr_vals_offset,
4304 fd, attr_newftree, "fattr4_space_total");
4307 case FATTR4_SPACE_USED:
4308 attr_vals_offset = dissect_rpc_uint64(pd, attr_vals_offset,
4309 fd, attr_newftree, "fattr4_space_used");
4313 attr_vals_offset = dissect_rpc_bool(pd, attr_vals_offset,
4314 fd, attr_newftree, hf_nfs_fattr4_system);
4317 case FATTR4_TIME_ACCESS:
4318 case FATTR4_TIME_BACKUP:
4319 case FATTR4_TIME_CREATE:
4320 case FATTR4_TIME_DELTA:
4321 case FATTR4_TIME_METADATA:
4322 case FATTR4_TIME_MODIFY:
4323 attr_vals_offset = dissect_nfs_nfstime4(pd, attr_vals_offset,
4324 fd, attr_newftree, "nfstime4");
4327 case FATTR4_TIME_ACCESS_SET:
4328 case FATTR4_TIME_MODIFY_SET:
4329 attr_vals_offset = dissect_nfs_settime4(pd, attr_vals_offset,
4330 fd, attr_newftree, "settime4");
4351 dissect_nfs_attrlist4(const u_char *pd, int offset, frame_data *fd,
4354 return dissect_nfsdata(pd, offset, fd, tree, hf_nfs_attrlist4);
4358 dissect_nfs_fattr4(const u_char *pd, int offset, frame_data *fd,
4359 proto_tree *tree, char *name)
4361 proto_tree *newftree = NULL;
4362 proto_item *fitem = NULL;
4364 fitem = proto_tree_add_text(tree, NullTVB, offset, 4, "obj_attributes");
4366 if (fitem == NULL) return offset;
4368 newftree = proto_item_add_subtree(fitem, ett_nfs_fattr4);
4370 if (newftree == NULL) return offset;
4372 offset = dissect_nfs_attributes(pd, offset, fd, newftree, name, 1);
4373 offset = dissect_nfs_attrlist4(pd, offset, fd, newftree);
4378 static const value_string names_open4_share_access[] = {
4379 #define OPEN4_SHARE_ACCESS_READ 0x00000001
4380 { OPEN4_SHARE_ACCESS_READ, "OPEN4_SHARE_ACCESS_READ" },
4381 #define OPEN4_SHARE_ACCESS_WRITE 0x00000002
4382 { OPEN4_SHARE_ACCESS_WRITE, "OPEN4_SHARE_ACCESS_WRITE" },
4383 #define OPEN4_SHARE_ACCESS_BOTH 0x00000003
4384 { OPEN4_SHARE_ACCESS_BOTH, "OPEN4_SHARE_ACCESS_BOTH" },
4389 dissect_nfs_open4_share_access(const u_char *pd, int offset, frame_data *fd,
4394 share_access = EXTRACT_UINT(pd, offset);
4395 proto_tree_add_uint(tree, hf_nfs_open4_share_access, NullTVB, offset, 4,
4402 static const value_string names_open4_share_deny[] = {
4403 #define OPEN4_SHARE_DENY_NONE 0x00000000
4404 { OPEN4_SHARE_DENY_NONE, "OPEN4_SHARE_DENY_NONE" },
4405 #define OPEN4_SHARE_DENY_READ 0x00000001
4406 { OPEN4_SHARE_DENY_READ, "OPEN4_SHARE_DENY_READ" },
4407 #define OPEN4_SHARE_DENY_WRITE 0x00000002
4408 { OPEN4_SHARE_DENY_WRITE, "OPEN4_SHARE_DENY_WRITE" },
4409 #define OPEN4_SHARE_DENY_BOTH 0x00000003
4410 { OPEN4_SHARE_DENY_BOTH, "OPEN4_SHARE_DENY_BOTH" },
4415 dissect_nfs_open4_share_deny(const u_char *pd, int offset, frame_data *fd,
4420 deny_access = EXTRACT_UINT(pd, offset);
4421 proto_tree_add_uint(tree, hf_nfs_open4_share_deny, NullTVB, offset, 4,
4429 dissect_nfs_open_claim_delegate_cur4(const u_char *pd, int offset,
4430 frame_data *fd, proto_tree *tree, char *name)
4432 offset = dissect_nfs_pathname4(pd, offset, fd, tree, "file");
4433 offset = dissect_nfs_stateid4(pd, offset, fd, tree, "delegate_stateid");
4437 #define CLAIM_NULL 0
4438 #define CLAIM_PREVIOUS 1
4439 #define CLAIM_DELEGATE_CUR 2
4440 #define CLAIM_DELEGATE_PREV 3
4442 static const value_string names_claim_type4[] = {
4443 { CLAIM_NULL, "CLAIM_NULL" },
4444 { CLAIM_PREVIOUS, "CLAIM_PREVIOUS" },
4445 { CLAIM_DELEGATE_CUR, "CLAIM_DELEGATE_CUR" },
4446 { CLAIM_DELEGATE_PREV, "CLAIM_DELEGATE_PREV" },
4451 dissect_nfs_open_claim4(const u_char *pd, int offset, frame_data *fd,
4452 proto_tree *tree, char *name)
4454 guint open_claim_type4;
4455 proto_item *fitem = NULL;
4456 proto_tree *newftree = NULL;
4458 open_claim_type4 = EXTRACT_UINT(pd, offset);
4459 fitem = proto_tree_add_uint(tree, hf_nfs_open_claim_type4, NullTVB,
4460 offset+0, 4, open_claim_type4);
4464 newftree = proto_item_add_subtree(fitem, ett_nfs_open_claim4);
4468 switch(open_claim_type4)
4471 offset = dissect_nfs_pathname4(pd, offset, fd, newftree, "file");
4474 case CLAIM_PREVIOUS:
4475 offset = dissect_rpc_uint32(pd, offset, fd, newftree,
4479 case CLAIM_DELEGATE_CUR:
4480 offset = dissect_nfs_open_claim_delegate_cur4(pd, offset, fd,
4481 newftree, "delegate_cur_info");
4484 case CLAIM_DELEGATE_PREV:
4485 offset = dissect_nfs_pathname4(pd, offset, fd, newftree,
4486 "file_delegate_prev");
4499 dissect_nfs_verifier4(const u_char *pd, int offset, frame_data *fd,
4500 proto_tree *tree, char *name);
4503 dissect_nfs_createhow4(const u_char *pd, int offset, frame_data *fd,
4504 proto_tree *tree, char *name)
4508 /* This is intentional; we're using the same flags as NFSv3 */
4509 mode = EXTRACT_UINT(pd, offset);
4510 proto_tree_add_uint(tree, hf_nfs_createmode3, NullTVB, offset, 4, mode);
4515 case UNCHECKED: /* UNCHECKED4 */
4516 case GUARDED: /* GUARDED4 */
4517 offset = dissect_nfs_fattr4(pd, offset, fd, tree, "createattrs");
4520 case EXCLUSIVE: /* EXCLUSIVE4 */
4521 offset = dissect_nfs_verifier4(pd, offset, fd, tree, "createverf");
4531 #define OPEN4_NOCREATE 0
4532 #define OPEN4_CREATE 1
4533 static const value_string names_opentype4[] = {
4534 { OPEN4_NOCREATE, "OPEN4_NOCREATE" },
4535 { OPEN4_CREATE, "OPEN4_CREATE" },
4540 dissect_nfs_openflag4(const u_char *pd, int offset, frame_data *fd,
4544 proto_item *fitem = NULL;
4545 proto_tree *newftree = NULL;
4547 opentype4 = EXTRACT_UINT(pd, offset);
4548 fitem = proto_tree_add_uint(tree, hf_nfs_opentype4, NullTVB,
4549 offset+0, 4, opentype4);
4553 newftree = proto_item_add_subtree(fitem, ett_nfs_opentype4);
4560 offset = dissect_nfs_createhow4(pd, offset, fd, newftree, "how");
4573 dissect_nfs_verifier4(const u_char *pd, int offset, frame_data *fd,
4574 proto_tree *tree, char *name)
4576 return dissect_rpc_uint64(pd, offset, fd, tree, name);
4581 dissect_nfs_cookie4(const u_char *pd, int offset, frame_data *fd,
4582 proto_tree *tree, char *name)
4584 return dissect_rpc_uint64(pd, offset, fd, tree, name);
4588 dissect_nfs_cookieverf4(const u_char *pd, int offset, frame_data *fd,
4589 proto_tree *tree, char *name)
4591 return dissect_rpc_uint64(pd, offset, fd, tree, name);
4596 dissect_nfs_clientaddr4(const u_char *pd, int offset, frame_data *fd,
4597 proto_tree *tree, char *name)
4599 offset = dissect_nfs_opaque4(pd, offset, fd, tree, "network id");
4600 offset = dissect_nfs_opaque4(pd, offset, fd, tree, "universal address");
4607 dissect_nfs_cb_client4(const u_char *pd, int offset, frame_data *fd,
4608 proto_tree *tree, char *name)
4610 offset = dissect_rpc_uint32(pd, offset, fd, tree, "cb_program");
4611 offset = dissect_nfs_clientaddr4(pd, offset, fd, tree, "cb_location");
4616 static const value_string names_stable_how4[] = {
4618 { UNSTABLE4, "UNSTABLE4" },
4619 #define DATA_SYNC4 1
4620 { DATA_SYNC4, "DATA_SYNC4" },
4621 #define FILE_SYNC4 2
4622 { FILE_SYNC4, "FILE_SYNC4" },
4627 dissect_nfs_stable_how4(const u_char *pd, int offset, frame_data *fd,
4628 proto_tree *tree, char *name)
4632 stable_how4 = EXTRACT_UINT(pd, offset);
4633 proto_tree_add_uint_format(tree, hf_nfs_stable_how4, NullTVB,
4634 offset+0, 4, stable_how4, "%s: %s (%u)", name,
4635 val_to_str(stable_how4, names_stable_how4, "%u"), stable_how4);
4642 dissect_nfs_opaque4(const u_char *pd, int offset, frame_data *fd,
4643 proto_tree *tree, char *name)
4645 return dissect_nfsdata(pd, offset, fd, tree, hf_nfs_data);
4648 /* There is probably a better (built-in?) way to do this, but this works
4652 static const value_string names_nfsv4_operation[] = {
4653 { NFS4_OP_ACCESS, "ACCESS" },
4654 { NFS4_OP_CLOSE, "CLOSE" },
4655 { NFS4_OP_COMMIT, "COMMIT" },
4656 { NFS4_OP_CREATE, "CREATE" },
4657 { NFS4_OP_DELEGPURGE, "DELEGPURGE" },
4658 { NFS4_OP_DELEGRETURN, "DELEGRETURN" },
4659 { NFS4_OP_GETATTR, "GETATTR" },
4660 { NFS4_OP_GETFH, "GETFH" },
4661 { NFS4_OP_LINK, "LINK" },
4662 { NFS4_OP_LOCK, "LOCK" },
4663 { NFS4_OP_LOCKT, "LOCKT" },
4664 { NFS4_OP_LOCKU, "LOCKU" },
4665 { NFS4_OP_LOOKUP, "LOOKUP" },
4666 { NFS4_OP_NVERIFY, "NVERIFY" },
4667 { NFS4_OP_OPEN, "OPEN" },
4668 { NFS4_OP_OPENATTR, "OPENATTR" },
4669 { NFS4_OP_OPEN_CONFIRM, "OPEN_CONFIRM" },
4670 { NFS4_OP_OPEN_DOWNGRADE, "OPEN_DOWNGRADE" },
4671 { NFS4_OP_PUTFH, "PUTFH" },
4672 { NFS4_OP_PUTPUBFH, "PUTPUBFH" },
4673 { NFS4_OP_PUTROOTFH, "PUTROOTFH" },
4674 { NFS4_OP_READ, "READ" },
4675 { NFS4_OP_READDIR, "READDIR" },
4676 { NFS4_OP_READLINK, "READLINK" },
4677 { NFS4_OP_REMOVE, "REMOVE" },
4678 { NFS4_OP_RENAME, "RENAME" },
4679 { NFS4_OP_RENEW, "RENEW" },
4680 { NFS4_OP_RESTOREFH, "RESTOREFH" },
4681 { NFS4_OP_SAVEFH, "SAVEFH" },
4682 { NFS4_OP_SECINFO, "SECINFO" },
4683 { NFS4_OP_SETATTR, "SETATTR" },
4684 { NFS4_OP_SETCLIENTID, "SETCLIENTID" },
4685 { NFS4_OP_SETCLIENTID_CONFIRM, "SETCLIENTID_CONFIRM" },
4686 { NFS4_OP_VERIFY, "VERIFY" },
4687 { NFS4_OP_WRITE, "WRITE" },
4691 gint *nfsv4_operation_ett[] =
4697 &ett_nfs_delegpurge4 ,
4698 &ett_nfs_delegreturn4 ,
4709 &ett_nfs_openattr4 ,
4710 &ett_nfs_open_confirm4 ,
4711 &ett_nfs_open_downgrade4 ,
4713 &ett_nfs_putpubfh4 ,
4714 &ett_nfs_putrootfh4 ,
4717 &ett_nfs_readlink4 ,
4721 &ett_nfs_restorefh4 ,
4725 &ett_nfs_setclientid4 ,
4726 &ett_nfs_setclientid_confirm4 ,
4732 dissect_nfs_dirlist4(const u_char *pd, int offset, frame_data *fd,
4733 proto_tree *tree, char *name)
4735 proto_tree *newftree = NULL;
4738 newftree = proto_item_add_subtree(tree, ett_nfs_dirlist4);
4739 if (newftree==NULL) return offset;
4741 nextentry = EXTRACT_UINT(pd, offset);
4743 offset = dissect_rpc_bool(pd, offset, fd, newftree, hf_nfs_data_follows);
4747 offset = dissect_nfs_cookie4(pd, offset, fd, newftree, "cookie");
4748 offset = dissect_nfs_component4(pd, offset, fd, newftree, "name");
4749 offset = dissect_nfs_fattr4(pd, offset, fd, newftree, "attrs");
4750 nextentry = EXTRACT_UINT(pd, offset);
4754 offset = dissect_rpc_bool(pd, offset, fd, newftree, hf_nfs_dirlist4_eof);
4760 dissect_nfs_change_info4(const u_char *pd, int offset, frame_data *fd,
4761 proto_tree *tree, char *name)
4763 proto_tree *newftree = NULL;
4764 proto_tree *fitem = NULL;
4766 fitem = proto_tree_add_text(tree, NullTVB, offset, 0, "%s", name);
4769 newftree=proto_item_add_subtree(fitem, ett_nfs_change_info4);
4772 offset = dissect_rpc_bool(pd, offset, fd, newftree,
4773 hf_nfs_change_info4_atomic);
4774 offset = dissect_nfs_changeid4(pd, offset, fd, newftree, "before");
4775 offset = dissect_nfs_changeid4(pd, offset, fd, newftree, "after");
4783 dissect_nfs_lock4denied(const u_char *pd, int offset, frame_data *fd,
4784 proto_tree *tree, char *name)
4786 offset = dissect_nfs_lockowner4(pd, offset, fd, tree, "owner");
4787 offset = dissect_nfs_offset4(pd, offset, fd, tree, "offset");
4788 return dissect_nfs_length4(pd, offset, fd, tree, "length");
4793 dissect_nfs_ace4(const u_char *pd, int offset, frame_data *fd,
4794 proto_tree *tree, char *name)
4796 offset = dissect_nfs_acetype4(pd, offset, fd, tree, "type");
4797 offset = dissect_nfs_aceflag4(pd, offset, fd, tree, "flag");
4798 offset = dissect_nfs_acemask4(pd, offset, fd, tree, "access_mask");
4799 return dissect_nfs_utf8string(pd, offset, fd, tree, hf_nfs_ace4, NULL);
4802 static const value_string names_open4_result_flags[] = {
4803 #define OPEN4_RESULT_MLOCK 0x00000001
4804 { OPEN4_RESULT_MLOCK, "OPEN4_RESULT_MLOCK" },
4805 #define OPEN4_RESULT_CONFIRM 0x00000002
4806 { OPEN4_RESULT_CONFIRM, "OPEN4_RESULT_CONFIRM" },
4811 dissect_nfs_open4_rflags(const u_char *pd, int offset, frame_data *fd,
4812 proto_tree *tree, char *name)
4815 proto_item *rflags_item = NULL;
4816 proto_item *rflags_tree = NULL;
4818 if (!BYTES_ARE_IN_FRAME(offset, 4)) return offset;
4819 rflags = EXTRACT_UINT(pd, offset);
4823 rflags_item = proto_tree_add_text(tree, NullTVB, offset, 4,
4824 "%s: 0x%08x", name, rflags);
4827 rflags_tree = proto_item_add_subtree(rflags_item,
4828 ett_nfs_open4_result_flags);
4833 proto_tree_add_text(rflags_tree, NullTVB, offset, 4, "%s",
4834 decode_enumerated_bitfield(rflags, OPEN4_RESULT_MLOCK, 2,
4835 names_open4_result_flags, "%s"));
4837 proto_tree_add_text(rflags_tree, NullTVB, offset, 4, "%s",
4838 decode_enumerated_bitfield(rflags, OPEN4_RESULT_CONFIRM, 2,
4839 names_open4_result_flags, "%s"));
4848 dissect_nfs_open_read_delegation4(const u_char *pd, int offset, frame_data *fd,
4851 offset = dissect_nfs_stateid4(pd, offset, fd, tree, "stateid");
4852 offset = dissect_rpc_uint32(pd, offset, fd, tree, "recall?");
4853 return dissect_nfs_ace4(pd, offset, fd, tree, "permissions");
4857 dissect_nfs_modified_limit4(const u_char *pd, int offset, frame_data *fd,
4858 proto_tree *tree, char *name)
4860 offset = dissect_rpc_uint32(pd, offset, fd, tree, "num_blocks");
4861 return dissect_rpc_uint32(pd, offset, fd, tree, "bytes_per_block");
4864 #define NFS_LIMIT_SIZE 1
4865 #define NFS_LIMIT_BLOCKS 2
4866 static const value_string names_limit_by4[] = {
4867 { NFS_LIMIT_SIZE, "NFS_LIMIT_SIZE" },
4868 { NFS_LIMIT_BLOCKS, "NFS_LIMIT_BLOCKS" },
4873 dissect_nfs_space_limit4(const u_char *pd, int offset, frame_data *fd,
4874 proto_tree *tree, char *name)
4878 limitby = EXTRACT_UINT(pd, offset);
4879 proto_tree_add_uint(tree, hf_nfs_limit_by4, NullTVB, offset+0, 4, limitby);
4884 case NFS_LIMIT_SIZE:
4885 offset = dissect_rpc_uint64(pd, offset, fd, tree, "filesize");
4888 case NFS_LIMIT_BLOCKS:
4889 offset = dissect_nfs_modified_limit4(pd, offset, fd, tree, "mod_blocks");
4900 dissect_nfs_open_write_delegation4(const u_char *pd, int offset,
4901 frame_data *fd, proto_tree *tree)
4903 offset = dissect_nfs_stateid4(pd, offset, fd, tree, "stateid");
4904 offset = dissect_rpc_bool(pd, offset, fd, tree, hf_nfs_recall);
4905 offset = dissect_nfs_space_limit4(pd, offset, fd, tree, "space_limit");
4906 return dissect_nfs_ace4(pd, offset, fd, tree, "permissions");
4909 #define OPEN_DELEGATE_NONE 0
4910 #define OPEN_DELEGATE_READ 1
4911 #define OPEN_DELEGATE_WRITE 2
4912 static const value_string names_open_delegation_type4[] = {
4913 { OPEN_DELEGATE_NONE, "OPEN_DELEGATE_NONE" },
4914 { OPEN_DELEGATE_READ, "OPEN_DELEGATE_READ" },
4915 { OPEN_DELEGATE_WRITE, "OPEN_DELEGATE_WRITE" },
4920 dissect_nfs_open_delegation4(const u_char *pd, int offset, frame_data *fd,
4921 proto_tree *tree, char *name)
4923 guint delegation_type;
4924 proto_tree *newftree = NULL;
4925 proto_item *fitem = NULL;
4927 delegation_type = EXTRACT_UINT(pd, offset);
4928 proto_tree_add_uint(tree, hf_nfs_open_delegation_type4, NullTVB, offset+0,
4929 4, delegation_type);
4933 newftree = proto_item_add_subtree(fitem, ett_nfs_open_delegation4);
4935 switch(delegation_type)
4937 case OPEN_DELEGATE_NONE:
4940 case OPEN_DELEGATE_READ:
4941 offset = dissect_nfs_open_read_delegation4(pd, offset, fd, newftree);
4944 case OPEN_DELEGATE_WRITE:
4945 offset = dissect_nfs_open_write_delegation4(pd, offset, fd, newftree);
4958 dissect_nfs_argop4(const u_char *pd, int offset, frame_data *fd,
4959 proto_tree *tree, char *name)
4961 guint ops, ops_counter;
4964 proto_tree *ftree = NULL;
4965 proto_tree *newftree = NULL;
4967 if (!BYTES_ARE_IN_FRAME(offset, 4)) return offset;
4969 ops = EXTRACT_UINT(pd, offset+0);
4971 fitem = proto_tree_add_text(tree, NullTVB, offset, 4,
4972 "Operations (count: %d)", ops);
4975 if (fitem == NULL) return offset;
4977 ftree = proto_item_add_subtree(fitem, ett_nfs_argop4);
4979 if (ftree == NULL) return offset;
4981 for (ops_counter=0; ops_counter<ops; ops_counter++)
4983 if (!BYTES_ARE_IN_FRAME(offset, 4)) return offset;
4985 opcode = EXTRACT_UINT(pd, offset);
4986 fitem = proto_tree_add_uint(ftree, hf_nfs_argop4, NullTVB, offset, 4,
4990 if (opcode < NFS4_OP_ACCESS || opcode >NFS4_OP_WRITE)
4993 if (fitem == NULL) break;
4995 newftree = proto_item_add_subtree(fitem, *nfsv4_operation_ett[opcode-3]);
4997 if (newftree == NULL) break;
5002 case NFS4_OP_ACCESS:
5003 offset = dissect_access(pd, offset, fd, newftree, "access");
5007 offset = dissect_nfs_seqid4(pd, offset, fd, newftree);
5008 offset = dissect_nfs_stateid4(pd, offset, fd, newftree, "stateid");
5011 case NFS4_OP_COMMIT:
5012 offset = dissect_nfs_offset4(pd, offset, fd, newftree, "offset");
5013 offset = dissect_nfs_count4(pd, offset, fd, newftree, "count");
5016 case NFS4_OP_CREATE:
5020 offset = dissect_nfs_component4(pd, offset, fd, newftree,
5023 create_type = EXTRACT_UINT(pd, offset);
5024 offset = dissect_nfs_ftype4(pd, offset, fd, newftree, "type");
5029 offset = dissect_nfs_linktext4(pd, offset, fd, newftree,
5035 offset = dissect_nfs_specdata4(pd, offset, fd,
5036 newftree, "devdata");
5050 case NFS4_OP_DELEGPURGE:
5051 offset = dissect_nfs_clientid4(pd, offset, fd, newftree, "Client ID");
5054 case NFS4_OP_DELEGRETURN:
5055 offset = dissect_nfs_stateid4(pd, offset, fd, newftree, "stateid");
5058 case NFS4_OP_GETATTR:
5059 offset = dissect_nfs_attributes(pd, offset, fd, newftree, "attr_request", 0);
5066 offset = dissect_nfs_component4(pd, offset, fd, newftree, "newname");
5070 offset = dissect_nfs_lock_type4(pd, offset, fd, newftree, "locktype");
5071 offset = dissect_nfs_seqid4(pd, offset, fd, newftree);
5072 offset = dissect_nfs_reclaim4(pd, offset, fd, newftree, "reclaim");
5073 offset = dissect_nfs_stateid4(pd, offset, fd, newftree, "stateid");
5074 offset = dissect_nfs_offset4(pd, offset, fd, newftree, "offset");
5075 offset = dissect_nfs_length4(pd, offset, fd, newftree, "length");
5079 offset = dissect_nfs_lock_type4(pd, offset, fd, newftree, "locktype");
5080 offset = dissect_nfs_lockowner4(pd, offset, fd, newftree, "owner");
5081 offset = dissect_nfs_offset4(pd, offset, fd, newftree, "offset");
5082 offset = dissect_nfs_length4(pd, offset, fd, newftree, "length");
5086 offset = dissect_nfs_lock_type4(pd, offset, fd, newftree, "type");
5087 offset = dissect_nfs_seqid4(pd, offset, fd, newftree);
5088 offset = dissect_nfs_stateid4(pd, offset, fd, newftree, "stateid");
5089 offset = dissect_nfs_offset4(pd, offset, fd, newftree, "offset");
5090 offset = dissect_nfs_length4(pd, offset, fd, newftree, "length");
5093 case NFS4_OP_LOOKUP:
5094 offset = dissect_nfs_pathname4(pd, offset, fd, newftree, "path");
5097 case NFS4_OP_LOOKUPP:
5100 case NFS4_OP_NVERIFY:
5101 offset = dissect_nfs_fattr4(pd, offset, fd, newftree,
5106 offset = dissect_nfs_open_claim4(pd, offset, fd, newftree, "claim");
5107 offset = dissect_nfs_openflag4(pd, offset, fd, newftree);
5108 offset = dissect_nfs_lockowner4(pd, offset, fd, newftree, "Owner");
5109 offset = dissect_nfs_seqid4(pd, offset, fd, newftree);
5110 offset = dissect_nfs_open4_share_access(pd, offset, fd, newftree);
5111 offset = dissect_nfs_open4_share_deny(pd, offset, fd, newftree);
5114 case NFS4_OP_OPENATTR:
5117 case NFS4_OP_OPEN_CONFIRM:
5118 offset = dissect_nfs_seqid4(pd, offset, fd, newftree);
5119 offset = dissect_nfs_verifier4(pd, offset, fd, newftree,
5123 case NFS4_OP_OPEN_DOWNGRADE:
5124 offset = dissect_nfs_stateid4(pd, offset, fd, newftree, "stateid");
5125 offset = dissect_nfs_seqid4(pd, offset, fd, newftree);
5126 offset = dissect_nfs_open4_share_access(pd, offset, fd, newftree);
5127 offset = dissect_nfs_open4_share_deny(pd, offset, fd, newftree);
5131 offset = dissect_nfs_fh4(pd, offset, fd, newftree, "filehandle");
5134 case NFS4_OP_PUTPUBFH:
5135 case NFS4_OP_PUTROOTFH:
5139 offset = dissect_nfs_stateid4(pd, offset, fd, newftree, "stateid");
5140 offset = dissect_nfs_offset4(pd, offset, fd, newftree, "offset");
5141 offset = dissect_nfs_count4(pd, offset, fd, newftree, "count");
5144 case NFS4_OP_READDIR:
5145 offset = dissect_nfs_cookie4(pd, offset, fd, newftree, "cookie");
5146 offset = dissect_nfs_cookieverf4(pd, offset, fd, newftree,
5148 offset = dissect_nfs_count4(pd, offset, fd, newftree, "dircount");
5149 offset = dissect_nfs_count4(pd, offset, fd, newftree, "maxcount");
5150 offset = dissect_nfs_attributes(pd, offset, fd, newftree, "attr", 0);
5153 case NFS4_OP_READLINK:
5156 case NFS4_OP_REMOVE:
5157 offset = dissect_nfs_component4(pd, offset, fd, newftree, "target");
5160 case NFS4_OP_RENAME:
5161 offset = dissect_nfs_component4(pd, offset, fd, newftree, "oldname");
5162 offset = dissect_nfs_component4(pd, offset, fd, newftree, "newname");
5166 offset = dissect_nfs_stateid4(pd, offset, fd, newftree, "stateid");
5169 case NFS4_OP_RESTOREFH:
5170 case NFS4_OP_SAVEFH:
5173 case NFS4_OP_SECINFO:
5174 offset = dissect_nfs_component4(pd, offset, fd, newftree, "name");
5177 case NFS4_OP_SETATTR:
5178 offset = dissect_nfs_stateid4(pd, offset, fd, newftree, "stateid");
5179 offset = dissect_nfs_fattr4(pd, offset, fd, newftree,
5183 case NFS4_OP_SETCLIENTID:
5185 proto_tree *client_tree = NULL;
5187 fitem = proto_tree_add_text(newftree, NullTVB, offset, 0, "Client");
5190 client_tree = proto_item_add_subtree(fitem,
5191 ett_nfs_client_id4);
5194 offset = dissect_nfs_client_id4(pd, offset, fd,
5195 client_tree, "client");
5198 fitem = proto_tree_add_text(newftree, NullTVB, offset, 0,
5201 newftree = proto_item_add_subtree(fitem, ett_nfs_cb_client4);
5203 offset = dissect_nfs_cb_client4(pd, offset, fd, newftree,
5209 case NFS4_OP_SETCLIENTID_CONFIRM:
5210 offset = dissect_nfs_verifier4(pd, offset, fd, newftree,
5211 "setclientid_confirm");
5214 case NFS4_OP_VERIFY:
5215 offset = dissect_nfs_fattr4(pd, offset, fd, newftree,
5220 offset = dissect_nfs_stateid4(pd, offset, fd, newftree, "stateid");
5221 offset = dissect_nfs_offset4(pd, offset, fd, newftree, "offset");
5222 offset = dissect_nfs_stable_how4(pd, offset, fd, newftree, "stable");
5223 offset = dissect_nfs_opaque4(pd, offset, fd, newftree, "data");
5235 dissect_nfs4_compound_call(const u_char* pd, int offset, frame_data* fd,
5238 offset = dissect_nfs_utf8string(pd, offset, fd, tree, hf_nfs_tag4, NULL);
5239 offset = dissect_rpc_uint32(pd, offset, fd, tree, "minorversion");
5240 offset = dissect_nfs_argop4(pd, offset, fd, tree, "arguments");
5246 dissect_nfs_resop4(const u_char *pd, int offset, frame_data *fd,
5247 proto_tree *tree, char *name)
5249 guint ops, ops_counter;
5252 proto_tree *ftree = NULL;
5253 proto_tree *newftree = NULL;
5256 ops = EXTRACT_UINT(pd, offset+0);
5258 fitem = proto_tree_add_text(tree, NullTVB, offset, 4,
5259 "Operations (count: %d)", ops);
5262 if (fitem == NULL) return offset;
5264 ftree = proto_item_add_subtree(fitem, ett_nfs_resop4);
5266 if (ftree == NULL) return offset; /* error adding new subtree */
5268 for (ops_counter = 0; ops_counter < ops; ops_counter++)
5270 if (!BYTES_ARE_IN_FRAME(offset, 4)) return offset;
5272 opcode = EXTRACT_UINT(pd, offset);
5274 if (opcode < NFS4_OP_ACCESS || opcode > NFS4_OP_WRITE) break;
5276 if (!BYTES_ARE_IN_FRAME(offset, 4)) return offset;
5278 fitem = proto_tree_add_uint(ftree, hf_nfs_resop4, NullTVB, offset, 4,
5282 if (fitem == NULL) break; /* error adding new item to tree */
5284 newftree = proto_item_add_subtree(fitem, *nfsv4_operation_ett[opcode-3]);
5286 if (newftree == NULL)
5287 break; /* error adding new subtree to operation item */
5289 offset = dissect_nfs_nfsstat4(pd, offset, fd, newftree, &status);
5292 * With the exception of NFS4_OP_LOCK, NFS4_OP_LOCKT, and
5293 * NFS4_OP_SETATTR, all other ops do *not* return data with the
5294 * failed status code.
5296 if ((status != NFS4_OK) &&
5297 ((opcode != NFS4_OP_LOCK) && (opcode != NFS4_OP_LOCKT) &&
5298 (opcode != NFS4_OP_SETATTR)))
5301 /* These parsing routines are only executed if the status is NFS4_OK */
5304 case NFS4_OP_ACCESS:
5305 offset = dissect_access(pd, offset, fd, newftree, "Supported");
5306 offset = dissect_access(pd, offset, fd, newftree, "Access");
5310 offset = dissect_nfs_stateid4(pd, offset, fd, newftree, "stateid");
5313 case NFS4_OP_COMMIT:
5314 offset = dissect_nfs_verifier4(pd, offset, fd, newftree, "writeverf");
5317 case NFS4_OP_CREATE:
5318 offset = dissect_nfs_change_info4(pd, offset, fd, newftree,
5322 case NFS4_OP_DELEGPURGE:
5326 case NFS4_OP_DELEGRETURN:
5330 case NFS4_OP_GETATTR:
5331 offset = dissect_nfs_fattr4(pd, offset, fd, newftree,
5336 offset = dissect_nfs_fh4(pd, offset, fd, newftree, "Filehandle");
5340 offset = dissect_nfs_change_info4(pd, offset, fd, newftree,
5346 if (status==NFS4_OK)
5347 offset = dissect_nfs_stateid4(pd, offset, fd, newftree,
5350 if (status==NFS4ERR_DENIED)
5351 offset = dissect_nfs_lock4denied(pd, offset, fd, newftree,
5356 offset = dissect_nfs_stateid4(pd, offset, fd, newftree, "stateid");
5359 case NFS4_OP_LOOKUP:
5363 case NFS4_OP_LOOKUPP:
5367 case NFS4_OP_NVERIFY:
5372 offset = dissect_nfs_stateid4(pd, offset, fd, newftree, "stateid");
5373 offset = dissect_nfs_change_info4(pd, offset, fd, newftree,
5375 offset = dissect_nfs_open4_rflags(pd, offset, fd, newftree,
5377 offset = dissect_nfs_verifier4(pd, offset, fd, newftree,
5379 offset = dissect_nfs_open_delegation4(pd, offset, fd, newftree,
5383 case NFS4_OP_OPENATTR:
5387 case NFS4_OP_OPEN_CONFIRM:
5388 case NFS4_OP_OPEN_DOWNGRADE:
5389 offset = dissect_nfs_stateid4(pd, offset, fd, newftree, "stateid");
5396 case NFS4_OP_PUTPUBFH:
5400 case NFS4_OP_PUTROOTFH:
5405 offset = dissect_rpc_uint32(pd, offset, fd, newftree, "eof?");
5406 offset = dissect_nfs_opaque4(pd, offset, fd, newftree, "data");
5409 case NFS4_OP_READDIR:
5410 offset = dissect_nfs_verifier4(pd, offset, fd, newftree,
5412 offset = dissect_nfs_dirlist4(pd, offset, fd, newftree, "reply");
5415 case NFS4_OP_READLINK:
5416 offset = dissect_nfs_linktext4(pd, offset, fd, newftree, "link");
5419 case NFS4_OP_REMOVE:
5420 offset = dissect_nfs_change_info4(pd, offset, fd, newftree,
5424 case NFS4_OP_RENAME:
5425 offset = dissect_nfs_change_info4(pd, offset, fd, newftree,
5427 offset = dissect_nfs_change_info4(pd, offset, fd, newftree,
5435 case NFS4_OP_RESTOREFH:
5439 case NFS4_OP_SAVEFH:
5443 case NFS4_OP_SECINFO:
5444 offset = dissect_rpc_uint32(pd, offset, fd, newftree, "flavor");
5445 offset = dissect_nfs_opaque4(pd, offset, fd, newftree, "flavor_info");
5448 case NFS4_OP_SETATTR:
5449 offset = dissect_nfs_attributes(pd, offset, fd, newftree, "attrsset",
5453 case NFS4_OP_SETCLIENTID:
5454 if (status == NFS4_OK)
5456 offset = dissect_nfs_clientid4(pd, offset, fd, newftree,
5458 offset = dissect_nfs_verifier4(pd, offset, fd, newftree,
5459 "setclientid_confirm");
5462 if (status == NFS4ERR_CLID_INUSE)
5464 offset = dissect_nfs_clientaddr4(pd, offset, fd, newftree,
5469 case NFS4_OP_SETCLIENTID_CONFIRM:
5473 case NFS4_OP_VERIFY:
5478 offset = dissect_nfs_count4(pd, offset, fd, newftree, "count");
5479 offset = dissect_nfs_stable_how4(pd, offset, fd, newftree,
5481 offset = dissect_nfs_verifier4(pd, offset, fd, newftree,
5494 dissect_nfs4_compound_reply(const u_char* pd, int offset, frame_data* fd,
5499 offset = dissect_nfs_nfsstat4(pd, offset, fd, tree, &status);
5500 offset = dissect_nfs_utf8string(pd, offset, fd, tree, hf_nfs_tag4, NULL);
5501 offset = dissect_nfs_resop4(pd, offset, fd, tree, "arguments");
5507 /* proc number, "proc name", dissect_request, dissect_reply */
5508 /* NULL as function pointer means: type of arguments is "void". */
5509 static const old_vsff nfs3_proc[] = {
5510 { 0, "NULL", /* OK */
5512 { 1, "GETATTR", /* OK */
5513 dissect_nfs3_getattr_call, dissect_nfs3_getattr_reply },
5514 { 2, "SETATTR", /* OK */
5515 dissect_nfs3_setattr_call, dissect_nfs3_setattr_reply },
5516 { 3, "LOOKUP", /* OK */
5517 dissect_nfs3_lookup_call, dissect_nfs3_lookup_reply },
5518 { 4, "ACCESS", /* OK */
5519 dissect_nfs3_access_call, dissect_nfs3_access_reply },
5520 { 5, "READLINK", /* OK */
5521 dissect_nfs3_nfs_fh3_call, dissect_nfs3_readlink_reply },
5522 { 6, "READ", /* OK */
5523 dissect_nfs3_read_call, dissect_nfs3_read_reply },
5524 { 7, "WRITE", /* OK */
5525 dissect_nfs3_write_call, dissect_nfs3_write_reply },
5526 { 8, "CREATE", /* OK */
5527 dissect_nfs3_create_call, dissect_nfs3_create_reply },
5528 { 9, "MKDIR", /* OK */
5529 dissect_nfs3_mkdir_call, dissect_nfs3_create_reply },
5530 { 10, "SYMLINK", /* OK */
5531 dissect_nfs3_symlink_call, dissect_nfs3_create_reply },
5532 { 11, "MKNOD", /* OK */
5533 dissect_nfs3_mknod_call, dissect_nfs3_create_reply },
5534 { 12, "REMOVE", /* OK */
5535 dissect_nfs3_diropargs3_call, dissect_nfs3_remove_reply },
5536 { 13, "RMDIR", /* OK */
5537 dissect_nfs3_diropargs3_call, dissect_nfs3_remove_reply },
5538 { 14, "RENAME", /* OK */
5539 dissect_nfs3_rename_call, dissect_nfs3_rename_reply },
5540 { 15, "LINK", /* OK */
5541 dissect_nfs3_link_call, dissect_nfs3_link_reply },
5542 { 16, "READDIR", /* OK */
5543 dissect_nfs3_readdir_call, dissect_nfs3_readdir_reply },
5544 { 17, "READDIRPLUS", /* OK */
5545 dissect_nfs3_readdirplus_call, dissect_nfs3_readdirplus_reply },
5546 { 18, "FSSTAT", /* OK */
5547 dissect_nfs3_nfs_fh3_call, dissect_nfs3_fsstat_reply },
5548 { 19, "FSINFO", /* OK */
5549 dissect_nfs3_nfs_fh3_call, dissect_nfs3_fsinfo_reply },
5550 { 20, "PATHCONF", /* OK */
5551 dissect_nfs3_nfs_fh3_call, dissect_nfs3_pathconf_reply },
5552 { 21, "COMMIT", /* OK */
5553 dissect_nfs3_commit_call, dissect_nfs3_commit_reply },
5554 { 0,NULL,NULL,NULL }
5556 /* end of NFS Version 3 */
5558 static const old_vsff nfs4_proc[] = {
5562 dissect_nfs4_compound_call, dissect_nfs4_compound_reply },
5563 { 0, NULL, NULL, NULL }
5567 static struct true_false_string yesno = { "Yes", "No" };
5571 proto_register_nfs(void)
5573 static hf_register_info hf[] = {
5574 { &hf_nfs_fh_fsid_major, {
5575 "major", "nfs.fh.fsid.major", FT_UINT32, BASE_DEC,
5576 NULL, 0, "major file system ID" }},
5577 { &hf_nfs_fh_fsid_minor, {
5578 "minor", "nfs.fh.fsid.minor", FT_UINT32, BASE_DEC,
5579 NULL, 0, "minor file system ID" }},
5580 { &hf_nfs_fh_xfsid_major, {
5581 "exported major", "nfs.fh.xfsid.major", FT_UINT32, BASE_DEC,
5582 NULL, 0, "exported major file system ID" }},
5583 { &hf_nfs_fh_xfsid_minor, {
5584 "exported minor", "nfs.fh.xfsid.minor", FT_UINT32, BASE_DEC,
5585 NULL, 0, "exported minor file system ID" }},
5586 { &hf_nfs_fh_fstype, {
5587 "file system type", "nfs.fh.fstype", FT_UINT32, BASE_DEC,
5588 NULL, 0, "file system type" }},
5590 "file number", "nfs.fh.fn", FT_UINT32, BASE_DEC,
5591 NULL, 0, "file number" }},
5592 { &hf_nfs_fh_fn_len, {
5593 "length", "nfs.fh.fn.len", FT_UINT32, BASE_DEC,
5594 NULL, 0, "file number length" }},
5595 { &hf_nfs_fh_fn_inode, {
5596 "inode", "nfs.fh.fn.inode", FT_UINT32, BASE_DEC,
5597 NULL, 0, "file number inode" }},
5598 { &hf_nfs_fh_fn_generation, {
5599 "generation", "nfs.fh.fn.generation", FT_UINT32, BASE_DEC,
5600 NULL, 0, "file number generation" }},
5602 "exported file number", "nfs.fh.xfn", FT_UINT32, BASE_DEC,
5603 NULL, 0, "exported file number" }},
5604 { &hf_nfs_fh_xfn_len, {
5605 "length", "nfs.fh.xfn.len", FT_UINT32, BASE_DEC,
5606 NULL, 0, "exported file number length" }},
5607 { &hf_nfs_fh_xfn_inode, {
5608 "exported inode", "nfs.fh.xfn.inode", FT_UINT32, BASE_DEC,
5609 NULL, 0, "exported file number inode" }},
5610 { &hf_nfs_fh_xfn_generation, {
5611 "generation", "nfs.fh.xfn.generation", FT_UINT32, BASE_DEC,
5612 NULL, 0, "exported file number generation" }},
5613 { &hf_nfs_fh_dentry, {
5614 "dentry", "nfs.fh.dentry", FT_UINT32, BASE_HEX,
5615 NULL, 0, "dentry (cookie)" }},
5617 "device", "nfs.fh.dev", FT_UINT32, BASE_DEC,
5618 NULL, 0, "device" }},
5619 { &hf_nfs_fh_xdev, {
5620 "exported device", "nfs.fh.xdev", FT_UINT32, BASE_DEC,
5621 NULL, 0, "exported device" }},
5622 { &hf_nfs_fh_dirinode, {
5623 "directory inode", "nfs.fh.dirinode", FT_UINT32, BASE_DEC,
5624 NULL, 0, "directory inode" }},
5625 { &hf_nfs_fh_pinode, {
5626 "pseudo inode", "nfs.fh.pinode", FT_UINT32, BASE_HEX,
5627 NULL, 0, "pseudo inode" }},
5628 { &hf_nfs_fh_hp_len, {
5629 "length", "nfs.fh.hp.len", FT_UINT32, BASE_DEC,
5630 NULL, 0, "hash path length" }},
5632 "Status", "nfs.status2", FT_UINT32, BASE_DEC,
5633 VALS(names_nfs_stat), 0, "Reply status" }},
5635 "Name", "nfs.name", FT_STRING, BASE_DEC,
5637 { &hf_nfs_readlink_data, {
5638 "Data", "nfs.readlink.data", FT_STRING, BASE_DEC,
5639 NULL, 0, "Symbolic Link Data" }},
5640 { &hf_nfs_read_offset, {
5641 "Offset", "nfs.read.offset", FT_UINT32, BASE_DEC,
5642 NULL, 0, "Read Offset" }},
5643 { &hf_nfs_read_count, {
5644 "Count", "nfs.read.count", FT_UINT32, BASE_DEC,
5645 NULL, 0, "Read Count" }},
5646 { &hf_nfs_read_totalcount, {
5647 "Total Count", "nfs.read.totalcount", FT_UINT32, BASE_DEC,
5648 NULL, 0, "Total Count (obsolete)" }},
5650 "Data", "nfs.data", FT_STRING, BASE_DEC,
5652 { &hf_nfs_write_beginoffset, {
5653 "Begin Offset", "nfs.write.beginoffset", FT_UINT32, BASE_DEC,
5654 NULL, 0, "Begin offset (obsolete)" }},
5655 { &hf_nfs_write_offset, {
5656 "Offset", "nfs.write.offset", FT_UINT32, BASE_DEC,
5657 NULL, 0, "Offset" }},
5658 { &hf_nfs_write_totalcount, {
5659 "Total Count", "nfs.write.totalcount", FT_UINT32, BASE_DEC,
5660 NULL, 0, "Total Count (obsolete)" }},
5661 { &hf_nfs_symlink_to, {
5662 "To", "nfs.symlink.to", FT_STRING, BASE_DEC,
5663 NULL, 0, "Symbolic link destination name" }},
5664 { &hf_nfs_readdir_cookie, {
5665 "Cookie", "nfs.readdir.cookie", FT_UINT32, BASE_DEC,
5666 NULL, 0, "Directory Cookie" }},
5667 { &hf_nfs_readdir_count, {
5668 "Count", "nfs.readdir.count", FT_UINT32, BASE_DEC,
5669 NULL, 0, "Directory Count" }},
5670 { &hf_nfs_readdir_entry, {
5671 "Entry", "nfs.readdir.entry", FT_NONE, 0,
5672 NULL, 0, "Directory Entry" }},
5673 { &hf_nfs_readdir_entry_fileid, {
5674 "File ID", "nfs.readdir.entry.fileid", FT_UINT32, BASE_DEC,
5675 NULL, 0, "File ID" }},
5676 { &hf_nfs_readdir_entry_name, {
5677 "Name", "nfs.readdir.entry.name", FT_STRING, BASE_DEC,
5679 { &hf_nfs_readdirplus_entry_name, {
5680 "Name", "nfs.readdirplus.entry.name", FT_STRING, BASE_DEC,
5682 { &hf_nfs_readdir_entry_cookie, {
5683 "Cookie", "nfs.readdir.entry.cookie", FT_UINT32, BASE_DEC,
5684 NULL, 0, "Directory Cookie" }},
5685 { &hf_nfs_readdir_eof, {
5686 "EOF", "nfs.readdir.eof", FT_UINT32, BASE_DEC,
5688 { &hf_nfs_statfs_tsize, {
5689 "Transfer Size", "nfs.statfs.tsize", FT_UINT32, BASE_DEC,
5690 NULL, 0, "Transfer Size" }},
5691 { &hf_nfs_statfs_bsize, {
5692 "Block Size", "nfs.statfs.bsize", FT_UINT32, BASE_DEC,
5693 NULL, 0, "Block Size" }},
5694 { &hf_nfs_statfs_blocks, {
5695 "Total Blocks", "nfs.statfs.blocks", FT_UINT32, BASE_DEC,
5696 NULL, 0, "Total Blocks" }},
5697 { &hf_nfs_statfs_bfree, {
5698 "Free Blocks", "nfs.statfs.bfree", FT_UINT32, BASE_DEC,
5699 NULL, 0, "Free Blocks" }},
5700 { &hf_nfs_statfs_bavail, {
5701 "Available Blocks", "nfs.statfs.bavail", FT_UINT32, BASE_DEC,
5702 NULL, 0, "Available Blocks" }},
5704 "Type", "nfs.type", FT_UINT32, BASE_DEC,
5705 VALS(names_nfs_ftype3), 0, "File Type" }},
5706 { &hf_nfs_nfsstat3, {
5707 "Status", "nfs.status", FT_UINT32, BASE_DEC,
5708 VALS(names_nfs_nfsstat3), 0, "Reply status" }},
5709 { &hf_nfs_read_eof, {
5710 "EOF", "nfs.read.eof", FT_BOOLEAN, BASE_NONE,
5711 &yesno, 0, "EOF" }},
5712 { &hf_nfs_write_stable, {
5713 "Stable", "nfs.write.stable", FT_UINT32, BASE_DEC,
5714 VALS(names_stable_how), 0, "Stable" }},
5715 { &hf_nfs_write_committed, {
5716 "Committed", "nfs.write.committed", FT_UINT32, BASE_DEC,
5717 VALS(names_stable_how), 0, "Committed" }},
5718 { &hf_nfs_createmode3, {
5719 "Create Mode", "nfs.createmode", FT_UINT32, BASE_DEC,
5720 VALS(names_createmode3), 0, "Create Mode" }},
5721 { &hf_nfs_fsstat_invarsec, {
5722 "invarsec", "nfs.fsstat.invarsec", FT_UINT32, BASE_DEC,
5723 NULL, 0, "probable number of seconds of file system invariance" }},
5724 { &hf_nfs_fsinfo_rtmax, {
5725 "rtmax", "nfs.fsinfo.rtmax", FT_UINT32, BASE_DEC,
5726 NULL, 0, "maximum READ request" }},
5727 { &hf_nfs_fsinfo_rtpref, {
5728 "rtpref", "nfs.fsinfo.rtpref", FT_UINT32, BASE_DEC,
5729 NULL, 0, "preferred READ request" }},
5730 { &hf_nfs_fsinfo_rtmult, {
5731 "rtmult", "nfs.fsinfo.rtmult", FT_UINT32, BASE_DEC,
5732 NULL, 0, "suggested READ multiple" }},
5733 { &hf_nfs_fsinfo_wtmax, {
5734 "wtmax", "nfs.fsinfo.wtmax", FT_UINT32, BASE_DEC,
5735 NULL, 0, "maximum WRITE request" }},
5736 { &hf_nfs_fsinfo_wtpref, {
5737 "wtpref", "nfs.fsinfo.wtpref", FT_UINT32, BASE_DEC,
5738 NULL, 0, "preferred WRITE request" }},
5739 { &hf_nfs_fsinfo_wtmult, {
5740 "wtmult", "nfs.fsinfo.wtmult", FT_UINT32, BASE_DEC,
5741 NULL, 0, "suggested WRITE multiple" }},
5742 { &hf_nfs_fsinfo_dtpref, {
5743 "dtpref", "nfs.fsinfo.dtpref", FT_UINT32, BASE_DEC,
5744 NULL, 0, "preferred READDIR request" }},
5745 { &hf_nfs_fsinfo_properties, {
5746 "Properties", "nfs.fsinfo.propeties", FT_UINT32, BASE_HEX,
5747 NULL, 0, "File System Properties" }},
5748 { &hf_nfs_pathconf_linkmax, {
5749 "linkmax", "nfs.pathconf.linkmax", FT_UINT32, BASE_DEC,
5750 NULL, 0, "Maximum number of hard links" }},
5751 { &hf_nfs_pathconf_name_max, {
5752 "name_max", "nfs.pathconf.name_max", FT_UINT32, BASE_DEC,
5753 NULL, 0, "Maximum file name length" }},
5754 { &hf_nfs_pathconf_no_trunc, {
5755 "no_trunc", "nfs.pathconf.no_trunc", FT_BOOLEAN, BASE_NONE,
5756 &yesno, 0, "No long file name truncation" }},
5757 { &hf_nfs_pathconf_chown_restricted, {
5758 "chown_restricted", "nfs.pathconf.chown_restricted", FT_BOOLEAN, BASE_NONE,
5759 &yesno, 0, "chown is restricted to root" }},
5760 { &hf_nfs_pathconf_case_insensitive, {
5761 "case_insensitive", "nfs.pathconf.case_insensitive", FT_BOOLEAN, BASE_NONE,
5762 &yesno, 0, "file names are treated case insensitive" }},
5763 { &hf_nfs_pathconf_case_preserving, {
5764 "case_preserving", "nfs.pathconf.case_preserving", FT_BOOLEAN, BASE_NONE,
5765 &yesno, 0, "file name cases are preserved" }},
5770 "Opcode", "nfs.call.operation", FT_UINT32, BASE_DEC,
5771 VALS(names_nfsv4_operation), 0, "Opcode" }},
5774 "Opcode", "nfs.reply.operation", FT_UINT32, BASE_DEC,
5775 VALS(names_nfsv4_operation), 0, "Opcode" }},
5777 { &hf_nfs_linktext4, {
5778 "Name", "nfs.symlink.linktext", FT_STRING, BASE_DEC,
5779 NULL, 0, "Symbolic link contents" }},
5781 { &hf_nfs_component4, {
5782 "Filename", "nfs.pathname.component", FT_STRING, BASE_DEC,
5783 NULL, 0, "Pathname component" }},
5786 "Tag", "nfs.tag", FT_STRING, BASE_DEC,
5789 { &hf_nfs_clientid4, {
5790 "Client ID", "nfs.clientid", FT_STRING, BASE_DEC,
5794 "ace", "nfs.ace", FT_STRING, BASE_DEC,
5795 NULL, 0, "Access Control Entry" }},
5798 "EOF", "nfs.recall", FT_BOOLEAN, BASE_NONE,
5799 &yesno, 0, "Recall" }},
5801 { &hf_nfs_open_claim_type4, {
5802 "Claim Type", "nfs.open.claim_type", FT_UINT32, BASE_DEC,
5803 VALS(names_claim_type4), 0, "Claim Type" }},
5805 { &hf_nfs_opentype4, {
5806 "Open Type", "nfs.open.opentype", FT_UINT32, BASE_DEC,
5807 VALS(names_opentype4), 0, "Open Type" }},
5809 { &hf_nfs_limit_by4, {
5810 "Space Limit", "nfs.open.limit_by", FT_UINT32, BASE_DEC,
5811 VALS(names_limit_by4), 0, "Limit By" }},
5813 { &hf_nfs_open_delegation_type4, {
5814 "Delegation Type", "nfs.open.delegation_type", FT_UINT32, BASE_DEC,
5815 VALS(names_open_delegation_type4), 0, "Delegation Type" }},
5818 "nfs_ftype4", "nfs.nfs_ftype4", FT_UINT32, BASE_DEC,
5819 VALS(names_ftype4), 0, "nfs.nfs_ftype4" }},
5821 { &hf_nfs_change_info4_atomic, {
5822 "Atomic", "nfs.change_info.atomic", FT_BOOLEAN, BASE_NONE,
5823 &yesno, 0, "Atomic" }},
5825 { &hf_nfs_open4_share_access, {
5826 "share_access", "nfs.open4.share_access", FT_UINT32, BASE_DEC,
5827 VALS(names_open4_share_access), 0, "Share Access" }},
5829 { &hf_nfs_open4_share_deny, {
5830 "share_deny", "nfs.open4.share_deny", FT_UINT32, BASE_DEC,
5831 VALS(names_open4_share_deny), 0, "Share Deny" }},
5834 { &hf_nfs_open4_result_flags, {
5835 "result_flags", "nfs.open4.rflags", FT_UINT32, BASE_HEX,
5836 VALS(names_open4_result_flags), 0, "Result Flags" }},
5840 "seqid", "nfs.seqid", FT_UINT32, BASE_HEX,
5841 NULL, 0, "Sequence ID" }},
5843 { &hf_nfs_mand_attr, {
5844 "mand_attr", "nfs.attr", FT_UINT32, BASE_DEC,
5845 VALS(names_fattr4), 0, "Mandatory Attribute" }},
5847 { &hf_nfs_recc_attr, {
5848 "recc_attr", "nfs.attr", FT_UINT32, BASE_DEC,
5849 VALS(names_fattr4), 0, "Recommended Attribute" }},
5851 { &hf_nfs_time_how4, {
5852 "set_it", "nfs.set_it", FT_UINT32, BASE_DEC,
5853 VALS(names_time_how4), 0, "How To Set Time" }},
5855 { &hf_nfs_attrlist4, {
5856 "attr_vals", "nfs.fattr4.attr_vals", FT_STRING, BASE_DEC,
5857 NULL, 0, "attr_vals" }},
5859 { &hf_nfs_fattr4_expire_type, {
5860 "fattr4_expire_type", "nfs.fattr4_expire_type", FT_UINT32, BASE_DEC,
5861 VALS(names_fattr4_expire_type), 0, "fattr4_expire_type" }},
5863 { &hf_nfs_fattr4_link_support, {
5864 "fattr4_link_support", "nfs.fattr4_link_support", FT_BOOLEAN,
5865 BASE_NONE, &yesno, 0, "nfs.fattr4_link_support" }},
5867 { &hf_nfs_fattr4_symlink_support, {
5868 "fattr4_symlink_support", "nfs.fattr4_symlink_support", FT_BOOLEAN,
5869 BASE_NONE, &yesno, 0, "nfs.fattr4_symlink_support" }},
5871 { &hf_nfs_fattr4_named_attr, {
5872 "fattr4_named_attr", "nfs.fattr4_named_attr", FT_BOOLEAN, BASE_NONE,
5873 &yesno, 0, "nfs.fattr4_named_attr" }},
5875 { &hf_nfs_fattr4_unique_handles, {
5876 "fattr4_unique_handles", "nfs.fattr4_unique_handles", FT_BOOLEAN,
5877 BASE_NONE, &yesno, 0, "nfs.fattr4_unique_handles" }},
5879 { &hf_nfs_fattr4_archive, {
5880 "fattr4_archive", "nfs.fattr4_archive", FT_BOOLEAN,
5881 BASE_NONE, &yesno, 0, "nfs.fattr4_archive" }},
5883 { &hf_nfs_fattr4_cansettime, {
5884 "fattr4_cansettime", "nfs.fattr4_cansettime", FT_BOOLEAN,
5885 BASE_NONE, &yesno, 0, "nfs.fattr4_cansettime" }},
5887 { &hf_nfs_fattr4_case_insensitive, {
5888 "fattr4_case_insensitive", "nfs.fattr4_case_insensitive", FT_BOOLEAN,
5889 BASE_NONE, &yesno, 0, "nfs.fattr4_case_insensitive" }},
5891 { &hf_nfs_fattr4_case_preserving, {
5892 "fattr4_case_preserving", "nfs.fattr4_case_preserving", FT_BOOLEAN,
5893 BASE_NONE, &yesno, 0, "nfs.fattr4_case_preserving" }},
5895 { &hf_nfs_fattr4_chown_restricted, {
5896 "fattr4_chown_restricted", "nfs.fattr4_chown_restricted", FT_BOOLEAN,
5897 BASE_NONE, &yesno, 0, "nfs.fattr4_chown_restricted" }},
5899 { &hf_nfs_fattr4_hidden, {
5900 "fattr4_hidden", "nfs.fattr4_hidden", FT_BOOLEAN,
5901 BASE_NONE, &yesno, 0, "nfs.fattr4_hidden" }},
5903 { &hf_nfs_fattr4_homogeneous, {
5904 "fattr4_homogeneous", "nfs.fattr4_homogeneous", FT_BOOLEAN,
5905 BASE_NONE, &yesno, 0, "nfs.fattr4_homogeneous" }},
5907 { &hf_nfs_fattr4_mimetype, {
5908 "fattr4_mimetype", "nfs.fattr4_mimetype", FT_STRING, BASE_DEC,
5909 NULL, 0, "nfs.fattr4_mimetype" }},
5911 { &hf_nfs_fattr4_no_trunc, {
5912 "fattr4_no_trunc", "nfs.fattr4_no_trunc", FT_BOOLEAN,
5913 BASE_NONE, &yesno, 0, "nfs.fattr4_no_trunc" }},
5915 { &hf_nfs_fattr4_system, {
5916 "fattr4_system", "nfs.fattr4_system", FT_BOOLEAN,
5917 BASE_NONE, &yesno, 0, "nfs.fattr4_system" }},
5920 "who", "nfs.who", FT_STRING, BASE_DEC,
5921 NULL, 0, "nfs.who" }},
5924 "server", "nfs.server", FT_STRING, BASE_DEC,
5925 NULL, 0, "nfs.server" }},
5927 { &hf_nfs_fattr4_owner, {
5928 "fattr4_owner", "nfs.fattr4_owner", FT_STRING, BASE_DEC,
5929 NULL, 0, "nfs.fattr4_owner" }},
5931 { &hf_nfs_fattr4_owner_group, {
5932 "fattr4_owner_group", "nfs.fattr4_owner_group", FT_STRING, BASE_DEC,
5933 NULL, 0, "nfs.fattr4_owner_group" }},
5935 { &hf_nfs_stable_how4, {
5936 "stable_how4", "nfs.stable_how4", FT_UINT32, BASE_DEC,
5937 VALS(names_stable_how4), 0, "nfs.stable_how4" }},
5939 { &hf_nfs_dirlist4_eof, {
5940 "eof", "nfs.dirlist4.eof", FT_BOOLEAN,
5941 BASE_NONE, &yesno, 0, "nfs.dirlist4.eof" }},
5943 { &hf_nfs_data_follows, {
5944 "data_follows", "nfs.data_follows", FT_BOOLEAN,
5945 BASE_NONE, &yesno, 0, "nfs.data_follows" }},
5948 static gint *ett[] = {
5961 &ett_nfs_readdir_entry,
5967 &ett_nfs_post_op_fh3,
5969 &ett_nfs_diropargs3,
5970 &ett_nfs_sattrguard3,
5977 &ett_nfs_pre_op_attr,
5978 &ett_nfs_post_op_attr,
5982 &ett_nfs_fsinfo_properties,
5983 &ett_nfs_compound_call4,
5984 &ett_nfs_utf8string,
5991 &ett_nfs_delegpurge4,
5992 &ett_nfs_delegreturn4,
6004 &ett_nfs_open_confirm4,
6005 &ett_nfs_open_downgrade4,
6008 &ett_nfs_putrootfh4,
6015 &ett_nfs_restorefh4,
6019 &ett_nfs_setclientid4,
6020 &ett_nfs_setclientid_confirm4,
6027 &ett_nfs_change_info4,
6028 &ett_nfs_open_delegation4,
6029 &ett_nfs_open_claim4,
6031 &ett_nfs_lockowner4,
6032 &ett_nfs_cb_client4,
6033 &ett_nfs_client_id4,
6037 &ett_nfs_fs_locations4,
6038 &ett_nfs_fs_location4,
6039 &ett_nfs_open4_result_flags
6041 proto_nfs = proto_register_protocol("Network File System", "NFS", "nfs");
6042 proto_register_field_array(proto_nfs, hf, array_length(hf));
6043 proto_register_subtree_array(ett, array_length(ett));
6047 proto_reg_handoff_nfs(void)
6049 /* Register the protocol as RPC */
6050 rpc_init_prog(proto_nfs, NFS_PROGRAM, ett_nfs);
6051 /* Register the procedure tables */
6052 old_rpc_init_proc_table(NFS_PROGRAM, 2, nfs2_proc);
6053 old_rpc_init_proc_table(NFS_PROGRAM, 3, nfs3_proc);
6054 old_rpc_init_proc_table(NFS_PROGRAM, 4, nfs4_proc);