diff options
Diffstat (limited to 'epan/dissectors/packet-nfs.c')
-rw-r--r-- | epan/dissectors/packet-nfs.c | 3169 |
1 files changed, 1741 insertions, 1428 deletions
diff --git a/epan/dissectors/packet-nfs.c b/epan/dissectors/packet-nfs.c index e01f1abc..8a6b25ec 100644 --- a/epan/dissectors/packet-nfs.c +++ b/epan/dissectors/packet-nfs.c @@ -25,6 +25,8 @@ #include <epan/decode_as.h> #include <epan/crc16-tvb.h> #include <epan/crc32-tvb.h> +#include <epan/srt_table.h> +#include <epan/tap.h> #include <wsutil/str_util.h> #include "packet-nfs.h" #include "packet-rpcrdma.h" @@ -33,908 +35,922 @@ void proto_register_nfs(void); void proto_reg_handoff_nfs(void); /* NON-NFS-version-specific hf variables */ -static int proto_nfs = -1; -static int proto_nfs_unknown = -1; -static int proto_nfs_svr4 = -1; -static int proto_nfs_knfsd_le = -1; -static int proto_nfs_nfsd_le = -1; -static int proto_nfs_knfsd_new = -1; -static int proto_nfs_ontap_v3 = -1; -static int proto_nfs_ontap_v4 = -1; -static int proto_nfs_ontap_gx_v3 = -1; -static int proto_nfs_celerra_vnx = -1; -static int proto_nfs_gluster = -1; -static int proto_nfs_dcache = -1; -static int proto_nfs_primary_data = -1; -static int proto_nfs_cb = -1; -static int hf_nfs_access_check = -1; -static int hf_nfs_access_supported = -1; -static int hf_nfs_access_rights = -1; -static int hf_nfs_access_supp_read = -1; -static int hf_nfs_access_supp_lookup = -1; -static int hf_nfs_access_supp_modify = -1; -static int hf_nfs_access_supp_extend = -1; -static int hf_nfs_access_supp_delete = -1; -static int hf_nfs_access_supp_execute = -1; -static int hf_nfs_access_supp_xattr_read = -1; -static int hf_nfs_access_supp_xattr_write = -1; -static int hf_nfs_access_supp_xattr_list = -1; -static int hf_nfs_access_read = -1; -static int hf_nfs_access_lookup = -1; -static int hf_nfs_access_modify = -1; -static int hf_nfs_access_extend = -1; -static int hf_nfs_access_delete = -1; -static int hf_nfs_access_execute = -1; -static int hf_nfs_access_xattr_read = -1; -static int hf_nfs_access_xattr_write = -1; -static int hf_nfs_access_xattr_list = -1; -static int hf_nfs_access_denied = -1; -static int hf_nfs_fh_length = -1; -static int hf_nfs_fh_hash = -1; -static int hf_nfs_fh_fhandle_data = -1; -static int hf_nfs_fh_mount_fileid = -1; -static int hf_nfs_fh_mount_generation = -1; -static int hf_nfs_fh_snapid = -1; -static int hf_nfs_fh_unused = -1; -static int hf_nfs_fh_flags = -1; -static int hf_nfs_fh_fileid = -1; -static int hf_nfs_fh_generation = -1; -static int hf_nfs_fh_fsid = -1; -static int hf_nfs_fh_export_fileid = -1; -static int hf_nfs_fh_export_generation = -1; -static int hf_nfs_fh_export_snapid = -1; -static int hf_nfs_fh_exportid = -1; -static int hf_nfs_fh_file_flag_mntpoint = -1; -static int hf_nfs_fh_file_flag_snapdir = -1; -static int hf_nfs_fh_file_flag_snapdir_ent = -1; -static int hf_nfs_fh_file_flag_empty = -1; -static int hf_nfs_fh_file_flag_vbn_access = -1; -static int hf_nfs_fh_file_flag_multivolume = -1; -static int hf_nfs_fh_file_flag_metadata = -1; -static int hf_nfs_fh_file_flag_orphan = -1; -static int hf_nfs_fh_file_flag_foster = -1; -static int hf_nfs_fh_file_flag_named_attr = -1; -static int hf_nfs_fh_file_flag_exp_snapdir = -1; -static int hf_nfs_fh_file_flag_vfiler = -1; -static int hf_nfs_fh_file_flag_aggr = -1; -static int hf_nfs_fh_file_flag_striped = -1; -static int hf_nfs_fh_file_flag_private = -1; -static int hf_nfs_fh_file_flag_next_gen = -1; -static int hf_nfs_fh_gfid = -1; -static int hf_nfs_fh_handle_type = -1; -static int hf_nfs_fh_fsid_major16_mask = -1; -static int hf_nfs_fh_fsid_minor16_mask = -1; -static int hf_nfs_fh_fsid_major16 = -1; -static int hf_nfs_fh_fsid_minor16 = -1; -static int hf_nfs_fh_fsid_major32 = -1; -static int hf_nfs_fh_fsid_minor32 = -1; -static int hf_nfs_fh_fsid_inode = -1; -static int hf_nfs_fh_xfsid_major = -1; -static int hf_nfs_fh_xfsid_minor = -1; -static int hf_nfs_fh_fstype = -1; -static int hf_nfs_fh_fn = -1; -static int hf_nfs_fh_fn_len = -1; -static int hf_nfs_fh_fn_inode = -1; -static int hf_nfs_fh_fn_generation = -1; -static int hf_nfs_fh_xfn = -1; -static int hf_nfs_fh_xfn_len = -1; -static int hf_nfs_fh_xfn_inode = -1; -static int hf_nfs_fh_xfn_generation = -1; -static int hf_nfs_fh_dentry = -1; -/* static int hf_nfs_fh_dev = -1; */ -/* static int hf_nfs_fh_xdev = -1; */ -static int hf_nfs_fh_dirinode = -1; -static int hf_nfs_fh_pinode = -1; -static int hf_nfs_fh_hp_len = -1; -static int hf_nfs_fh_hp_key = -1; -static int hf_nfs_fh_version = -1; -static int hf_nfs_fh_auth_type = -1; -static int hf_nfs_fh_fsid_type = -1; -static int hf_nfs_fh_fileid_type = -1; -static int hf_nfs_fh_obj_id = -1; -static int hf_nfs_fh_ro_node = -1; -static int hf_nfs_fh_obj = -1; -static int hf_nfs_fh_obj_fsid = -1; -static int hf_nfs_fh_obj_treeid = -1; -static int hf_nfs_fh_obj_kindid = -1; -static int hf_nfs_fh_obj_inode = -1; -static int hf_nfs_fh_obj_gen = -1; -static int hf_nfs_fh_ex = -1; -static int hf_nfs_fh_ex_fsid = -1; -static int hf_nfs_fh_ex_treeid = -1; -static int hf_nfs_fh_ex_kindid = -1; -static int hf_nfs_fh_ex_inode = -1; -static int hf_nfs_fh_ex_gen = -1; -static int hf_nfs_fh_flag = -1; -static int hf_nfs_fh_endianness = -1; -static int hf_nfs_fh_dc_opaque = -1; -static int hf_nfs_fh_dc_exportid = -1; -static int hf_nfs_fh_dc_handle_type = -1; -static int hf_nfs4_fh_pd_share = -1; -static int hf_nfs4_fh_pd_flags = -1; -static int hf_nfs4_fh_pd_flags_reserved = -1; -static int hf_nfs4_fh_pd_flags_version = -1; -static int hf_nfs4_fh_pd_container = -1; -static int hf_nfs4_fh_pd_inum = -1; -static int hf_nfs4_fh_pd_sites = -1; -static int hf_nfs4_fh_pd_sites_inum = -1; -static int hf_nfs4_fh_pd_sites_siteid = -1; -static int hf_nfs4_fh_pd_spaces = -1; -static int hf_nfs4_fh_pd_spaces_snapid = -1; -static int hf_nfs4_fh_pd_spaces_container = -1; -static int hf_nfs_full_name = -1; -static int hf_nfs_name = -1; -static int hf_nfs_data = -1; -static int hf_nfs_symlink_to = -1; -static int hf_nfs_readdir_eof = -1; -static int hf_nfs_readdir_entry = -1; -static int hf_nfs_atime = -1; -static int hf_nfs_atime_sec = -1; -static int hf_nfs_atime_nsec = -1; -static int hf_nfs_atime_usec = -1; -static int hf_nfs_mtime = -1; -static int hf_nfs_mtime_sec = -1; -static int hf_nfs_mtime_nsec = -1; -static int hf_nfs_mtime_usec = -1; -static int hf_nfs_ctime = -1; -static int hf_nfs_ctime_sec = -1; -static int hf_nfs_ctime_nsec = -1; -static int hf_nfs_ctime_usec = -1; -static int hf_nfs_dtime = -1; -static int hf_nfs_dtime_sec = -1; -static int hf_nfs_dtime_nsec = -1; +static int proto_nfs; +static int proto_nfs_unknown; +static int proto_nfs_svr4; +static int proto_nfs_knfsd_le; +static int proto_nfs_nfsd_le; +static int proto_nfs_knfsd_new; +static int proto_nfs_ontap_v3; +static int proto_nfs_ontap_v4; +static int proto_nfs_ontap_gx_v3; +static int proto_nfs_celerra_vnx; +static int proto_nfs_gluster; +static int proto_nfs_dcache; +static int proto_nfs_primary_data; +static int proto_nfs_cb; +static int proto_nfsv4; +static int hf_nfs_access_check; +static int hf_nfs_access_supported; +static int hf_nfs_access_rights; +static int hf_nfs_access_supp_read; +static int hf_nfs_access_supp_lookup; +static int hf_nfs_access_supp_modify; +static int hf_nfs_access_supp_extend; +static int hf_nfs_access_supp_delete; +static int hf_nfs_access_supp_execute; +static int hf_nfs_access_supp_xattr_read; +static int hf_nfs_access_supp_xattr_write; +static int hf_nfs_access_supp_xattr_list; +static int hf_nfs_access_read; +static int hf_nfs_access_lookup; +static int hf_nfs_access_modify; +static int hf_nfs_access_extend; +static int hf_nfs_access_delete; +static int hf_nfs_access_execute; +static int hf_nfs_access_xattr_read; +static int hf_nfs_access_xattr_write; +static int hf_nfs_access_xattr_list; +static int hf_nfs_access_denied; +static int hf_nfs_fh_length; +static int hf_nfs_fh_hash; +static int hf_nfs_fh_fhandle_data; +static int hf_nfs_fh_mount_fileid; +static int hf_nfs_fh_mount_generation; +static int hf_nfs_fh_snapid; +static int hf_nfs_fh_unused; +static int hf_nfs_fh_flags; +static int hf_nfs_fh_fileid; +static int hf_nfs_fh_generation; +static int hf_nfs_fh_fsid; +static int hf_nfs_fh_export_fileid; +static int hf_nfs_fh_export_generation; +static int hf_nfs_fh_export_snapid; +static int hf_nfs_fh_exportid; +static int hf_nfs_fh_file_flag_mntpoint; +static int hf_nfs_fh_file_flag_snapdir; +static int hf_nfs_fh_file_flag_snapdir_ent; +static int hf_nfs_fh_file_flag_empty; +static int hf_nfs_fh_file_flag_vbn_access; +static int hf_nfs_fh_file_flag_multivolume; +static int hf_nfs_fh_file_flag_metadata; +static int hf_nfs_fh_file_flag_orphan; +static int hf_nfs_fh_file_flag_foster; +static int hf_nfs_fh_file_flag_named_attr; +static int hf_nfs_fh_file_flag_exp_snapdir; +static int hf_nfs_fh_file_flag_vfiler; +static int hf_nfs_fh_file_flag_aggr; +static int hf_nfs_fh_file_flag_striped; +static int hf_nfs_fh_file_flag_private; +static int hf_nfs_fh_file_flag_next_gen; +static int hf_nfs_fh_gfid; +static int hf_nfs_fh_handle_type; +static int hf_nfs_fh_fsid_major16_mask; +static int hf_nfs_fh_fsid_minor16_mask; +static int hf_nfs_fh_fsid_major16; +static int hf_nfs_fh_fsid_minor16; +static int hf_nfs_fh_fsid_major32; +static int hf_nfs_fh_fsid_minor32; +static int hf_nfs_fh_fsid_inode; +static int hf_nfs_fh_xfsid_major; +static int hf_nfs_fh_xfsid_minor; +static int hf_nfs_fh_fstype; +static int hf_nfs_fh_fn; +static int hf_nfs_fh_fn_len; +static int hf_nfs_fh_fn_inode; +static int hf_nfs_fh_fn_generation; +static int hf_nfs_fh_xfn; +static int hf_nfs_fh_xfn_len; +static int hf_nfs_fh_xfn_inode; +static int hf_nfs_fh_xfn_generation; +static int hf_nfs_fh_dentry; +/* static int hf_nfs_fh_dev; */ +/* static int hf_nfs_fh_xdev; */ +static int hf_nfs_fh_dirinode; +static int hf_nfs_fh_pinode; +static int hf_nfs_fh_hp_len; +static int hf_nfs_fh_hp_key; +static int hf_nfs_fh_version; +static int hf_nfs_fh_auth_type; +static int hf_nfs_fh_fsid_type; +static int hf_nfs_fh_fileid_type; +static int hf_nfs_fh_obj_id; +static int hf_nfs_fh_ro_node; +static int hf_nfs_fh_obj; +static int hf_nfs_fh_obj_fsid; +static int hf_nfs_fh_obj_treeid; +static int hf_nfs_fh_obj_kindid; +static int hf_nfs_fh_obj_inode; +static int hf_nfs_fh_obj_gen; +static int hf_nfs_fh_ex; +static int hf_nfs_fh_ex_fsid; +static int hf_nfs_fh_ex_treeid; +static int hf_nfs_fh_ex_kindid; +static int hf_nfs_fh_ex_inode; +static int hf_nfs_fh_ex_gen; +static int hf_nfs_fh_flag; +static int hf_nfs_fh_endianness; +static int hf_nfs_fh_dc_opaque; +static int hf_nfs_fh_dc_exportid; +static int hf_nfs_fh_dc_handle_type; +static int hf_nfs4_fh_pd_share; +static int hf_nfs4_fh_pd_flags; +static int hf_nfs4_fh_pd_flags_reserved; +static int hf_nfs4_fh_pd_flags_version; +static int hf_nfs4_fh_pd_container; +static int hf_nfs4_fh_pd_inum; +static int hf_nfs4_fh_pd_sites; +static int hf_nfs4_fh_pd_sites_inum; +static int hf_nfs4_fh_pd_sites_siteid; +static int hf_nfs4_fh_pd_spaces; +static int hf_nfs4_fh_pd_spaces_snapid; +static int hf_nfs4_fh_pd_spaces_container; +static int hf_nfs_full_name; +static int hf_nfs_name; +static int hf_nfs_data; +static int hf_nfs_symlink_to; +static int hf_nfs_readdir_eof; +static int hf_nfs_readdir_entry; +static int hf_nfs_atime; +static int hf_nfs_atime_sec; +static int hf_nfs_atime_nsec; +static int hf_nfs_atime_usec; +static int hf_nfs_mtime; +static int hf_nfs_mtime_sec; +static int hf_nfs_mtime_nsec; +static int hf_nfs_mtime_usec; +static int hf_nfs_ctime; +static int hf_nfs_ctime_sec; +static int hf_nfs_ctime_nsec; +static int hf_nfs_ctime_usec; +static int hf_nfs_dtime; +static int hf_nfs_dtime_sec; +static int hf_nfs_dtime_nsec; /* Hidden field for v2, v3, and v4 status; also used in dissect-nfsacl.c */ -int hf_nfs_status = -1; +int hf_nfs_status; /* NFSv2 RFC 1094 hf variables */ -static int hf_nfs2_procedure = -1; -static int hf_nfs2_status = -1; -static int hf_nfs2_readlink_data = -1; -/* static int hf_nfs2_fattr_type = -1; */ -static int hf_nfs2_fattr_nlink = -1; -static int hf_nfs2_fattr_uid = -1; -static int hf_nfs2_fattr_gid = -1; -static int hf_nfs2_fattr_size = -1; -static int hf_nfs2_fattr_blocksize = -1; -static int hf_nfs2_fattr_rdev = -1; -static int hf_nfs2_fattr_blocks = -1; -static int hf_nfs2_fattr_fsid = -1; -static int hf_nfs2_fattr_fileid = -1; -static int hf_nfs2_ftype = -1; -static int hf_nfs2_mode = -1; -static int hf_nfs2_mode_name = -1; -static int hf_nfs2_mode_set_user_id = -1; -static int hf_nfs2_mode_set_group_id = -1; -static int hf_nfs2_mode_save_swap_text = -1; -static int hf_nfs2_mode_read_owner = -1; -static int hf_nfs2_mode_write_owner = -1; -static int hf_nfs2_mode_exec_owner = -1; -static int hf_nfs2_mode_read_group = -1; -static int hf_nfs2_mode_write_group = -1; -static int hf_nfs2_mode_exec_group = -1; -static int hf_nfs2_mode_read_other = -1; -static int hf_nfs2_mode_write_other = -1; -static int hf_nfs2_mode_exec_other = -1; -static int hf_nfs2_read_offset = -1; -static int hf_nfs2_read_count = -1; -static int hf_nfs2_read_totalcount = -1; -static int hf_nfs2_write_beginoffset = -1; -static int hf_nfs2_write_offset = -1; -static int hf_nfs2_write_totalcount = -1; -static int hf_nfs2_readdir_cookie = -1; -static int hf_nfs2_readdir_count = -1; -static int hf_nfs2_readdir_entry_fileid = -1; -static int hf_nfs2_readdir_entry_name = -1; -static int hf_nfs2_readdir_entry_cookie = -1; -static int hf_nfs2_statfs_tsize = -1; -static int hf_nfs2_statfs_bsize = -1; -static int hf_nfs2_statfs_blocks = -1; -static int hf_nfs2_statfs_bfree = -1; -static int hf_nfs2_statfs_bavail = -1; +static int hf_nfs2_procedure; +static int hf_nfs2_status; +static int hf_nfs2_readlink_data; +/* static int hf_nfs2_fattr_type; */ +static int hf_nfs2_fattr_nlink; +static int hf_nfs2_fattr_uid; +static int hf_nfs2_fattr_gid; +static int hf_nfs2_fattr_size; +static int hf_nfs2_fattr_blocksize; +static int hf_nfs2_fattr_rdev; +static int hf_nfs2_fattr_blocks; +static int hf_nfs2_fattr_fsid; +static int hf_nfs2_fattr_fileid; +static int hf_nfs2_ftype; +static int hf_nfs2_mode; +static int hf_nfs2_mode_name; +static int hf_nfs2_mode_set_user_id; +static int hf_nfs2_mode_set_group_id; +static int hf_nfs2_mode_save_swap_text; +static int hf_nfs2_mode_read_owner; +static int hf_nfs2_mode_write_owner; +static int hf_nfs2_mode_exec_owner; +static int hf_nfs2_mode_read_group; +static int hf_nfs2_mode_write_group; +static int hf_nfs2_mode_exec_group; +static int hf_nfs2_mode_read_other; +static int hf_nfs2_mode_write_other; +static int hf_nfs2_mode_exec_other; +static int hf_nfs2_read_offset; +static int hf_nfs2_read_count; +static int hf_nfs2_read_totalcount; +static int hf_nfs2_write_beginoffset; +static int hf_nfs2_write_offset; +static int hf_nfs2_write_totalcount; +static int hf_nfs2_readdir_cookie; +static int hf_nfs2_readdir_count; +static int hf_nfs2_readdir_entry_fileid; +static int hf_nfs2_readdir_entry_name; +static int hf_nfs2_readdir_entry_cookie; +static int hf_nfs2_statfs_tsize; +static int hf_nfs2_statfs_bsize; +static int hf_nfs2_statfs_blocks; +static int hf_nfs2_statfs_bfree; +static int hf_nfs2_statfs_bavail; /* NFSv3 RFC 1813 header format variables */ -static int hf_nfs3_procedure = -1; -static int hf_nfs3_fattr_type = -1; -static int hf_nfs3_fattr_nlink = -1; -static int hf_nfs3_fattr_uid = -1; -static int hf_nfs3_fattr_gid = -1; -static int hf_nfs3_fattr_size = -1; -static int hf_nfs3_fattr_used = -1; -/* static int hf_nfs3_fattr_rdev = -1; */ -static int hf_nfs3_fattr_fsid = -1; -static int hf_nfs3_fattr_fileid = -1; -static int hf_nfs3_wcc_attr_size = -1; -static int hf_nfs3_set_size = -1; -static int hf_nfs3_cookie = -1; -static int hf_nfs3_fsstat_resok_tbytes = -1; -static int hf_nfs3_fsstat_resok_fbytes = -1; -static int hf_nfs3_fsstat_resok_abytes = -1; -static int hf_nfs3_fsstat_resok_tfiles = -1; -static int hf_nfs3_fsstat_resok_ffiles = -1; -static int hf_nfs3_fsstat_resok_afiles = -1; -static int hf_nfs3_uid = -1; -static int hf_nfs3_gid = -1; -static int hf_nfs3_offset = -1; -static int hf_nfs3_count = -1; -static int hf_nfs3_count_maxcount = -1; -static int hf_nfs3_count_dircount= -1; -static int hf_nfs3_mode = -1; -static int hf_nfs3_mode_suid = -1; -static int hf_nfs3_mode_sgid = -1; -static int hf_nfs3_mode_sticky = -1; -static int hf_nfs3_mode_rusr = -1; -static int hf_nfs3_mode_wusr = -1; -static int hf_nfs3_mode_xusr = -1; -static int hf_nfs3_mode_rgrp = -1; -static int hf_nfs3_mode_wgrp = -1; -static int hf_nfs3_mode_xgrp = -1; -static int hf_nfs3_mode_roth = -1; -static int hf_nfs3_mode_woth = -1; -static int hf_nfs3_mode_xoth = -1; -static int hf_nfs3_readdir_entry_fileid = -1; -static int hf_nfs3_readdir_entry_name = -1; -static int hf_nfs3_readdir_entry_cookie = -1; -static int hf_nfs3_readdirplus_entry_fileid = -1; -static int hf_nfs3_readdirplus_entry_name = -1; -static int hf_nfs3_readdirplus_entry_cookie = -1; -static int hf_nfs3_ftype = -1; -static int hf_nfs3_status = -1; -static int hf_nfs3_read_eof = -1; -static int hf_nfs3_write_stable = -1; -static int hf_nfs3_write_committed = -1; -static int hf_nfs3_createmode = -1; -static int hf_nfs3_fsstat_invarsec = -1; -static int hf_nfs3_fsinfo_rtmax = -1; -static int hf_nfs3_fsinfo_rtpref = -1; -static int hf_nfs3_fsinfo_rtmult = -1; -static int hf_nfs3_fsinfo_wtmax = -1; -static int hf_nfs3_fsinfo_wtpref = -1; -static int hf_nfs3_fsinfo_wtmult = -1; -static int hf_nfs3_fsinfo_dtpref = -1; -static int hf_nfs3_fsinfo_maxfilesize = -1; -static int hf_nfs3_fsinfo_properties = -1; -static int hf_nfs3_fsinfo_properties_setattr = -1; -static int hf_nfs3_fsinfo_properties_pathconf = -1; -static int hf_nfs3_fsinfo_properties_symlinks = -1; -static int hf_nfs3_fsinfo_properties_hardlinks = -1; -static int hf_nfs3_pathconf_linkmax = -1; -static int hf_nfs3_pathconf_name_max = -1; -static int hf_nfs3_pathconf_no_trunc = -1; -static int hf_nfs3_pathconf_chown_restricted = -1; -static int hf_nfs3_pathconf_case_insensitive = -1; -static int hf_nfs3_pathconf_case_preserving = -1; -static int hf_nfs3_gxfh_utlfield = -1; -static int hf_nfs3_gxfh_utlfield_tree = -1; -static int hf_nfs3_gxfh_utlfield_jun = -1; -static int hf_nfs3_gxfh_utlfield_ver = -1; -static int hf_nfs3_gxfh_volcnt = -1; -static int hf_nfs3_gxfh_epoch = -1; -static int hf_nfs3_gxfh_ldsid = -1; -static int hf_nfs3_gxfh_cid = -1; -static int hf_nfs3_gxfh_resv = -1; -static int hf_nfs3_gxfh_sfhflags = -1; -static int hf_nfs3_gxfh_sfhflags_resv1 = -1; -static int hf_nfs3_gxfh_sfhflags_resv2 = -1; -static int hf_nfs3_gxfh_sfhflags_ontap7G = -1; -static int hf_nfs3_gxfh_sfhflags_ontapGX = -1; -static int hf_nfs3_gxfh_sfhflags_striped = -1; -static int hf_nfs3_gxfh_sfhflags_empty = -1; -static int hf_nfs3_gxfh_sfhflags_snapdirent = -1; -static int hf_nfs3_gxfh_sfhflags_snapdir = -1; -static int hf_nfs3_gxfh_sfhflags_streamdir = -1; -static int hf_nfs3_gxfh_spinfid = -1; -static int hf_nfs3_gxfh_spinfuid = -1; -static int hf_nfs3_gxfh_exportptid = -1; -static int hf_nfs3_gxfh_exportptuid = -1; -static int hf_nfs3_verifier = -1; -static int hf_nfs3_specdata1 = -1; -static int hf_nfs3_specdata2 = -1; -static int hf_nfs3_attributes_follow = -1; -static int hf_nfs3_handle_follow = -1; -static int hf_nfs3_sattrguard3 = -1; +static int hf_nfs3_procedure; +static int hf_nfs3_fattr_type; +static int hf_nfs3_fattr_nlink; +static int hf_nfs3_fattr_uid; +static int hf_nfs3_fattr_gid; +static int hf_nfs3_fattr_size; +static int hf_nfs3_fattr_used; +/* static int hf_nfs3_fattr_rdev; */ +static int hf_nfs3_fattr_fsid; +static int hf_nfs3_fattr_fileid; +static int hf_nfs3_wcc_attr_size; +static int hf_nfs3_set_size; +static int hf_nfs3_cookie; +static int hf_nfs3_fsstat_resok_tbytes; +static int hf_nfs3_fsstat_resok_fbytes; +static int hf_nfs3_fsstat_resok_abytes; +static int hf_nfs3_fsstat_resok_tfiles; +static int hf_nfs3_fsstat_resok_ffiles; +static int hf_nfs3_fsstat_resok_afiles; +static int hf_nfs3_uid; +static int hf_nfs3_gid; +static int hf_nfs3_offset; +static int hf_nfs3_count; +static int hf_nfs3_count_maxcount; +static int hf_nfs3_count_dircount; +static int hf_nfs3_mode; +static int hf_nfs3_mode_suid; +static int hf_nfs3_mode_sgid; +static int hf_nfs3_mode_sticky; +static int hf_nfs3_mode_rusr; +static int hf_nfs3_mode_wusr; +static int hf_nfs3_mode_xusr; +static int hf_nfs3_mode_rgrp; +static int hf_nfs3_mode_wgrp; +static int hf_nfs3_mode_xgrp; +static int hf_nfs3_mode_roth; +static int hf_nfs3_mode_woth; +static int hf_nfs3_mode_xoth; +static int hf_nfs3_readdir_entry_fileid; +static int hf_nfs3_readdir_entry_name; +static int hf_nfs3_readdir_entry_cookie; +static int hf_nfs3_readdirplus_entry_fileid; +static int hf_nfs3_readdirplus_entry_name; +static int hf_nfs3_readdirplus_entry_cookie; +static int hf_nfs3_ftype; +static int hf_nfs3_status; +static int hf_nfs3_read_eof; +static int hf_nfs3_write_stable; +static int hf_nfs3_write_committed; +static int hf_nfs3_createmode; +static int hf_nfs3_fsstat_invarsec; +static int hf_nfs3_fsinfo_rtmax; +static int hf_nfs3_fsinfo_rtpref; +static int hf_nfs3_fsinfo_rtmult; +static int hf_nfs3_fsinfo_wtmax; +static int hf_nfs3_fsinfo_wtpref; +static int hf_nfs3_fsinfo_wtmult; +static int hf_nfs3_fsinfo_dtpref; +static int hf_nfs3_fsinfo_maxfilesize; +static int hf_nfs3_fsinfo_properties; +static int hf_nfs3_fsinfo_properties_setattr; +static int hf_nfs3_fsinfo_properties_pathconf; +static int hf_nfs3_fsinfo_properties_symlinks; +static int hf_nfs3_fsinfo_properties_hardlinks; +static int hf_nfs3_pathconf_linkmax; +static int hf_nfs3_pathconf_name_max; +static int hf_nfs3_pathconf_no_trunc; +static int hf_nfs3_pathconf_chown_restricted; +static int hf_nfs3_pathconf_case_insensitive; +static int hf_nfs3_pathconf_case_preserving; +static int hf_nfs3_gxfh_utlfield; +static int hf_nfs3_gxfh_utlfield_tree; +static int hf_nfs3_gxfh_utlfield_jun; +static int hf_nfs3_gxfh_utlfield_ver; +static int hf_nfs3_gxfh_volcnt; +static int hf_nfs3_gxfh_epoch; +static int hf_nfs3_gxfh_ldsid; +static int hf_nfs3_gxfh_cid; +static int hf_nfs3_gxfh_resv; +static int hf_nfs3_gxfh_sfhflags; +static int hf_nfs3_gxfh_sfhflags_resv1; +static int hf_nfs3_gxfh_sfhflags_resv2; +static int hf_nfs3_gxfh_sfhflags_ontap7G; +static int hf_nfs3_gxfh_sfhflags_ontapGX; +static int hf_nfs3_gxfh_sfhflags_striped; +static int hf_nfs3_gxfh_sfhflags_empty; +static int hf_nfs3_gxfh_sfhflags_snapdirent; +static int hf_nfs3_gxfh_sfhflags_snapdir; +static int hf_nfs3_gxfh_sfhflags_streamdir; +static int hf_nfs3_gxfh_spinfid; +static int hf_nfs3_gxfh_spinfuid; +static int hf_nfs3_gxfh_exportptid; +static int hf_nfs3_gxfh_exportptuid; +static int hf_nfs3_verifier; +static int hf_nfs3_specdata1; +static int hf_nfs3_specdata2; +static int hf_nfs3_attributes_follow; +static int hf_nfs3_handle_follow; +static int hf_nfs3_sattrguard3; /* NFSv4 RFC 5661 header format variables */ -static int hf_nfs4_procedure = -1; -static int hf_nfs4_status = -1; -static int hf_nfs4_op = -1; -static int hf_nfs4_main_opcode = -1; -static int hf_nfs4_linktext = -1; -static int hf_nfs4_tag = -1; -static int hf_nfs4_ops_count = -1; -static int hf_nfs4_pathname_components = -1; -static int hf_nfs4_component = -1; -static int hf_nfs4_clientid = -1; -/* static int hf_nfs4_ace = -1; */ -static int hf_nfs4_recall = -1; -static int hf_nfs4_open_claim_type = -1; -static int hf_nfs4_opentype = -1; -static int hf_nfs4_state_protect_how = -1; -static int hf_nfs4_limit_by = -1; -static int hf_nfs4_open_delegation_type = -1; -static int hf_nfs4_why_no_delegation = -1; -static int hf_nfs4_ftype = -1; -static int hf_nfs4_change_info_atomic = -1; -static int hf_nfs4_open_share_access = -1; -static int hf_nfs4_open_share_deny = -1; -static int hf_nfs4_want_flags = -1; -static int hf_nfs4_want_notify_flags = -1; -static int hf_nfs4_want_signal_deleg_when_resrc_avail = -1; -static int hf_nfs4_want_push_deleg_when_uncontended = -1; -static int hf_nfs4_want_deleg_timestamps = -1; -static int hf_nfs4_seqid = -1; -static int hf_nfs4_lock_seqid = -1; -static int hf_nfs4_reqd_attr = -1; -static int hf_nfs4_reco_attr = -1; -static int hf_nfs4_attr_mask = -1; -static int hf_nfs4_attr_count = -1; -static int hf_nfs4_set_it_value_follows = -1; -static int hf_nfs4_time_how = -1; -static int hf_nfs4_time_how4 = -1; -static int hf_nfs4_fattr_link_support = -1; -static int hf_nfs4_fattr_symlink_support = -1; -static int hf_nfs4_fattr_named_attr = -1; -static int hf_nfs4_fattr_unique_handles = -1; -static int hf_nfs4_fattr_archive = -1; -static int hf_nfs4_fattr_cansettime = -1; -static int hf_nfs4_fattr_case_insensitive = -1; -static int hf_nfs4_fattr_case_preserving = -1; -static int hf_nfs4_fattr_chown_restricted = -1; -static int hf_nfs4_fattr_fh_expire_type = -1; -static int hf_nfs4_fattr_fh_expiry_noexpire_with_open = -1; -static int hf_nfs4_fattr_fh_expiry_volatile_any = -1; -static int hf_nfs4_fattr_fh_expiry_vol_migration = -1; -static int hf_nfs4_fattr_fh_expiry_vol_rename = -1; -static int hf_nfs4_fattr_hidden = -1; -static int hf_nfs4_fattr_homogeneous = -1; -static int hf_nfs4_fattr_mimetype = -1; -static int hf_nfs4_fattr_no_trunc = -1; -static int hf_nfs4_fattr_system = -1; -static int hf_nfs4_fattr_owner = -1; -static int hf_nfs4_fattr_owner_group = -1; -static int hf_nfs4_fattr_size = -1; -static int hf_nfs4_fattr_aclsupport = -1; -static int hf_nfs4_aclsupport_allow_acl = -1; -static int hf_nfs4_aclsupport_deny_acl = -1; -static int hf_nfs4_aclsupport_audit_acl = -1; -static int hf_nfs4_aclsupport_alarm_acl = -1; -static int hf_nfs4_fattr_lease_time = -1; -static int hf_nfs4_fattr_fs_charset_cap = -1; -static int hf_nfs4_fs_charset_cap_nonutf8 = -1; -static int hf_nfs4_fs_charset_cap_utf8 = -1; -static int hf_nfs4_fattr_fileid = -1; -static int hf_nfs4_fattr_files_avail = -1; -static int hf_nfs4_fattr_files_free = -1; -static int hf_nfs4_fattr_files_total = -1; -static int hf_nfs4_fattr_maxfilesize = -1; -static int hf_nfs4_fattr_maxlink = -1; -static int hf_nfs4_fattr_maxname = -1; -static int hf_nfs4_fattr_numlinks = -1; -static int hf_nfs4_fattr_maxread = -1; -static int hf_nfs4_fattr_maxwrite = -1; -static int hf_nfs4_fattr_quota_hard = -1; -static int hf_nfs4_fattr_quota_soft = -1; -static int hf_nfs4_fattr_quota_used = -1; -static int hf_nfs4_fattr_space_avail = -1; -static int hf_nfs4_fattr_space_free = -1; -static int hf_nfs4_fattr_space_total = -1; -static int hf_nfs4_fattr_space_used = -1; -static int hf_nfs4_fattr_mounted_on_fileid = -1; -static int hf_nfs4_fattr_layout_blksize = -1; -static int hf_nfs4_mdsthreshold_item = -1; -static int hf_nfs4_mdsthreshold_hint_mask = -1; -static int hf_nfs4_mdsthreshold_hint_count = -1; -static int hf_nfs4_mdsthreshold_mask_count = -1; -static int hf_nfs4_mdsthreshold_hint_file = -1; -static int hf_nfs4_fattr_security_label_lfs = -1; -static int hf_nfs4_fattr_security_label_pi = -1; -static int hf_nfs4_fattr_security_label_context = -1; -static int hf_nfs4_fattr_umask_mask = -1; -static int hf_nfs4_fattr_xattr_support = -1; -static int hf_nfs4_fattr_offline = -1; -static int hf_nfs4_who = -1; -static int hf_nfs4_server = -1; -static int hf_nfs4_servers = -1; -static int hf_nfs4_fslocation = -1; -static int hf_nfs4_stable_how = -1; -static int hf_nfs4_dirlist_eof = -1; -static int hf_nfs4_offset = -1; -static int hf_nfs4_specdata1 = -1; -static int hf_nfs4_specdata2 = -1; -static int hf_nfs4_lock_type = -1; -static int hf_nfs4_open_rflags = -1; -static int hf_nfs4_open_rflags_confirm = -1; -static int hf_nfs4_open_rflags_locktype_posix = -1; -static int hf_nfs4_open_rflags_preserve_unlinked = -1; -static int hf_nfs4_open_rflags_may_notify_lock = -1; -static int hf_nfs4_reclaim = -1; -static int hf_nfs4_length = -1; -static int hf_nfs4_changeid = -1; -static int hf_nfs4_changeid_before = -1; -static int hf_nfs4_changeid_after = -1; -static int hf_nfs4_time_seconds = -1; -static int hf_nfs4_time_nseconds = -1; -static int hf_nfs4_fsid_major = -1; -static int hf_nfs4_fsid_minor = -1; -static int hf_nfs4_acetype = -1; -static int hf_nfs4_aceflags = -1; -static int hf_nfs4_aceflag_file_inherit = -1; -static int hf_nfs4_aceflag_dir_inherit = -1; -static int hf_nfs4_aceflag_no_prop_inherit = -1; -static int hf_nfs4_aceflag_inherit_only = -1; -static int hf_nfs4_aceflag_successful_access = -1; -static int hf_nfs4_aceflag_failed_access = -1; -static int hf_nfs4_aceflag_id_group = -1; -static int hf_nfs4_aceflag_inherited_ace = -1; -static int hf_nfs4_acemask = -1; -static int hf_nfs4_ace_permission = -1; -static int hf_nfs4_delegate_type = -1; -static int hf_nfs4_secinfo_flavor = -1; -static int hf_nfs4_secinfo_arr = -1; -static int hf_nfs4_num_blocks = -1; -static int hf_nfs4_bytes_per_block = -1; -static int hf_nfs4_eof = -1; -static int hf_nfs4_verifier = -1; -static int hf_nfs4_value_follows = -1; -static int hf_nfs4_cookie = -1; -static int hf_nfs4_dir_entry_name = -1; -static int hf_nfs4_cookie_verf = -1; -static int hf_nfs4_cb_program = -1; -/* static int hf_nfs4_cb_location = -1; */ -static int hf_nfs4_recall4 = -1; -static int hf_nfs4_filesize = -1; -static int hf_nfs4_count = -1; -static int hf_nfs4_count_dircount = -1; -static int hf_nfs4_count_maxcount = -1; -static int hf_nfs4_minorversion = -1; -static int hf_nfs4_open_owner = -1; -static int hf_nfs4_lock_owner = -1; -static int hf_nfs4_new_lock_owner = -1; -static int hf_nfs4_sec_oid = -1; -static int hf_nfs4_qop = -1; -static int hf_nfs4_secinfo_rpcsec_gss_info_service = -1; -static int hf_nfs4_attr_dir_create = -1; -static int hf_nfs4_client_id = -1; -static int hf_nfs4_stateid = -1; -static int hf_nfs4_seqid_stateid = -1; -static int hf_nfs4_stateid_other = -1; -static int hf_nfs4_stateid_hash = -1; -static int hf_nfs4_stateid_other_hash = -1; -static int hf_nfs4_lock_reclaim = -1; -static int hf_nfs4_aclflags = -1; -static int hf_nfs4_aclflag_auto_inherit = -1; -static int hf_nfs4_aclflag_protected = -1; -static int hf_nfs4_aclflag_defaulted = -1; -static int hf_nfs4_num_aces = -1; -static int hf_nfs4_callback_ident = -1; -static int hf_nfs4_r_netid = -1; -static int hf_nfs4_gsshandle = -1; -static int hf_nfs4_r_addr = -1; -static int hf_nfs4_createmode = -1; -static int hf_nfs4_op_mask = -1; -static int hf_nfs4_read_data_length = -1; -static int hf_nfs4_write_data_length = -1; -static int hf_nfs4_length_minlength = -1; -static int hf_nfs4_layout_type = -1; -static int hf_nfs4_layout_return_type = -1; -static int hf_nfs4_iomode = -1; -/* static int hf_nfs4_stripetype = -1; */ -/* static int hf_nfs4_mdscommit = -1; */ -static int hf_nfs4_stripeunit = -1; -static int hf_nfs4_newtime = -1; -static int hf_nfs4_newoffset = -1; -static int hf_nfs4_layout_avail = -1; -static int hf_nfs4_newsize = -1; -static int hf_nfs4_layoutupdate = -1; -static int hf_nfs4_deviceid = -1; -static int hf_nfs4_devicenum = -1; -static int hf_nfs4_deviceidx = -1; -static int hf_nfs4_layout = -1; -/* static int hf_nfs4_stripedevs = -1; */ -/* static int hf_nfs4_devaddr = -1; */ -static int hf_nfs4_devaddr_ssv_start = -1; -static int hf_nfs4_devaddr_ssv_length = -1; -static int hf_nfs4_devaddr_scsi_vol_type = -1; -static int hf_nfs4_devaddr_scsi_vol_index = -1; -static int hf_nfs4_devaddr_scsi_vol_ref_index = -1; -static int hf_nfs4_devaddr_ssv_stripe_unit = -1; -static int hf_nfs4_devaddr_scsi_vpd_code_set = -1; -static int hf_nfs4_devaddr_scsi_vpd_designator_type = -1; -static int hf_nfs4_devaddr_scsi_vpd_designator = -1; -static int hf_nfs4_devaddr_scsi_private_key = -1; -static int hf_nfs4_scsil_ext_file_offset = -1; -static int hf_nfs4_scsil_ext_length = -1; -static int hf_nfs4_scsil_ext_vol_offset = -1; -static int hf_nfs4_scsil_ext_state = -1; -static int hf_nfs4_return_on_close = -1; -static int hf_nfs4_slotid = -1; -static int hf_nfs4_high_slotid = -1; -static int hf_nfs4_target_high_slotid = -1; -static int hf_nfs4_serverscope4 = -1; -static int hf_nfs4_minorid = -1; -static int hf_nfs4_majorid = -1; -static int hf_nfs4_padsize = -1; -/* static int hf_nfs4_cbrenforce = -1; */ -/* static int hf_nfs4_hashalg = -1; */ -/* static int hf_nfs4_ssvlen = -1; */ -static int hf_nfs4_maxreqsize = -1; -static int hf_nfs4_maxrespsize = -1; -static int hf_nfs4_maxrespsizecached = -1; -static int hf_nfs4_maxops = -1; -static int hf_nfs4_maxreqs = -1; -static int hf_nfs4_rdmachanattrs = -1; -static int hf_nfs4_machinename = -1; -static int hf_nfs4_flavor = -1; -static int hf_nfs4_stamp = -1; -static int hf_nfs4_uid = -1; -static int hf_nfs4_gid = -1; -static int hf_nfs4_service = -1; -static int hf_nfs4_sessionid = -1; -static int hf_nfs4_exchid_call_flags = -1; -static int hf_nfs4_exchid_reply_flags = -1; -static int hf_nfs4_exchid_flags_moved_refer = -1; -static int hf_nfs4_exchid_flags_moved_migr = -1; -static int hf_nfs4_exchid_flags_bind_princ = -1; -static int hf_nfs4_exchid_flags_non_pnfs = -1; -static int hf_nfs4_exchid_flags_pnfs_mds = -1; -static int hf_nfs4_exchid_flags_pnfs_ds = -1; -static int hf_nfs4_exchid_flags_upd_conf_rec_a = -1; -static int hf_nfs4_exchid_flags_confirmed_r = -1; -static int hf_nfs4_state_protect_window = -1; -static int hf_nfs4_state_protect_num_gss_handles = -1; -static int hf_nfs4_sp_parms_hash_algs = -1; -static int hf_nfs4_sp_parms_encr_algs = -1; -static int hf_nfs4_prot_info_spi_window = -1; -static int hf_nfs4_prot_info_svv_length = -1; -static int hf_nfs4_prot_info_encr_alg = -1; -static int hf_nfs4_prot_info_hash_alg = -1; -static int hf_nfs4_nii_domain = -1; -static int hf_nfs4_nii_name = -1; -static int hf_nfs4_create_session_flags_csa = -1; -static int hf_nfs4_create_session_flags_csr = -1; -static int hf_nfs4_create_session_flags_persist = -1; -static int hf_nfs4_create_session_flags_conn_back_chan = -1; -static int hf_nfs4_create_session_flags_conn_rdma = -1; -static int hf_nfs4_cachethis = -1; -/* static int hf_nfs4_util = -1; */ -/* static int hf_nfs4_first_stripe_idx = -1; */ -/* static int hf_nfs4_layout_count = -1; */ -/* static int hf_nfs4_pattern_offset = -1; */ -static int hf_nfs4_notification_mask = -1; -static int hf_nfs4_notification_type = -1; -static int hf_nfs4_lrs_present = -1; -static int hf_nfs4_nfl_mirrors = -1; -static int hf_nfs4_nfl_util = -1; -static int hf_nfs4_nfl_util_stripe_size = -1; -static int hf_nfs4_nfl_util_commit_thru_mds = -1; -static int hf_nfs4_nfl_util_dense = -1; -static int hf_nfs4_nfl_fhs = -1; -static int hf_nfs4_mirror_eff = -1; -static int hf_nfs4_nfl_first_stripe_index = -1; -static int hf_nfs4_lrf_body_content = -1; -static int hf_nfs4_reclaim_one_fs = -1; -static int hf_nfs4_bctsa_dir = -1; -static int hf_nfs4_bctsa_use_conn_in_rdma_mode = -1; -static int hf_nfs4_bctsr_dir = -1; -static int hf_nfs4_bctsr_use_conn_in_rdma_mode = -1; -static int hf_nfs4_sequence_status_flags = -1; -static int hf_nfs4_sequence_status_flags_cb_path_down = -1; -static int hf_nfs4_sequence_status_flags_cb_gss_contexts_expiring = -1; -static int hf_nfs4_sequence_status_flags_cb_gss_contexts_expired = -1; -static int hf_nfs4_sequence_status_flags_expired_all_state_revoked = -1; -static int hf_nfs4_sequence_status_flags_expired_some_state_revoked = -1; -static int hf_nfs4_sequence_status_flags_admin_state_revoked = -1; -static int hf_nfs4_sequence_status_flags_recallable_state_revoked = -1; -static int hf_nfs4_sequence_status_flags_lease_moved = -1; -static int hf_nfs4_sequence_status_flags_restart_reclaim_needed = -1; -static int hf_nfs4_sequence_status_flags_cb_path_down_session = -1; -static int hf_nfs4_sequence_status_flags_backchannel_fault = -1; -static int hf_nfs4_sequence_status_flags_devid_changed = -1; -static int hf_nfs4_sequence_status_flags_devid_deleted = -1; -static int hf_nfs4_secinfo_style = -1; -static int hf_nfs4_test_stateid_arg = -1; -static int hf_nfs4_test_stateid_res = -1; -static int hf_nfs4_seek_data_content = -1; -/* static int hf_nfs4_impl_id_len = -1; */ -static int hf_nfs4_bitmap_data = -1; -static int hf_nfs4_huge_bitmap_length = -1; -static int hf_nfs4_universal_address_ipv4 = -1; -static int hf_nfs4_universal_address_ipv6 = -1; -static int hf_nfs4_getdevinfo = -1; -static int hf_nfs4_ff_version = -1; -static int hf_nfs4_ff_minorversion = -1; -static int hf_nfs4_ff_tightly_coupled = -1; -static int hf_nfs4_ff_rsize = -1; -static int hf_nfs4_ff_wsize = -1; -static int hf_nfs4_fattr_clone_blocksize = -1; -static int hf_nfs4_fattr_space_freed = -1; -static int hf_nfs4_fattr_change_attr_type = -1; -static int hf_nfs4_ff_layout_flags = -1; -static int hf_nfs4_ff_layout_flags_no_layoutcommit = -1; -static int hf_nfs4_ff_layout_flags_no_io_thru_mds = -1; -static int hf_nfs4_ff_layout_flags_no_read_io = -1; -static int hf_nfs4_ff_stats_collect_hint = -1; -static int hf_nfs4_ff_synthetic_owner = -1; -static int hf_nfs4_ff_synthetic_owner_group = -1; -static int hf_nfs4_ff_bytes_completed = -1; -static int hf_nfs4_ff_bytes_not_delivered = -1; -static int hf_nfs4_ff_bytes_requested = -1; -static int hf_nfs4_ff_local = -1; -static int hf_nfs4_ff_ops_completed = -1; -static int hf_nfs4_ff_ops_requested = -1; -static int hf_nfs4_io_bytes = -1; -static int hf_nfs4_io_count = -1; -static int hf_nfs4_layoutstats = -1; -static int hf_nfs4_callback_stateids = -1; -static int hf_nfs4_callback_stateids_index = -1; -static int hf_nfs4_num_offload_status = -1; -static int hf_nfs4_offload_status_index = -1; -static int hf_nfs4_consecutive = -1; -static int hf_nfs4_netloc = -1; -static int hf_nfs4_netloc_type = -1; -static int hf_nfs4_nl_name = -1; -static int hf_nfs4_nl_url = -1; -static int hf_nfs4_source_server_index = -1; -static int hf_nfs4_source_servers = -1; -static int hf_nfs4_synchronous = -1; -static int hf_nfs4_device_error_count = -1; -static int hf_nfs4_device_errors_index = -1; -static int hf_nfs4_ff_ioerrs_count = -1; -static int hf_nfs4_ff_ioerrs_index = -1; -static int hf_nfs4_ff_ioerrs_length = -1; -static int hf_nfs4_ff_ioerrs_offset = -1; -static int hf_nfs4_ff_iostats_count = -1; -static int hf_nfs4_ff_iostats_index = -1; -static int hf_nfs4_io_error_op = -1; -static int hf_nfs4_io_hints_mask = -1; -static int hf_nfs4_io_hint_count = -1; -static int hf_nfs4_io_advise_hint = -1; -static int hf_nfs4_cb_recall_any_objs = -1; -static int hf_nfs4_cb_recall_any_count = -1; -static int hf_nfs4_cb_recall_any_mask = -1; -static int hf_nfs4_cb_recall_any_item = -1; -static int hf_nfs4_bytes_copied = -1; -static int hf_nfs4_read_plus_contents = -1; -static int hf_nfs4_read_plus_content_type = -1; -static int hf_nfs4_block_size = -1; -static int hf_nfs4_block_count = -1; -static int hf_nfs4_reloff_blocknum = -1; -static int hf_nfs4_blocknum = -1; -static int hf_nfs4_reloff_pattern = -1; -static int hf_nfs4_pattern_hash = -1; -static int hf_nfs4_setxattr_options = -1; -static int hf_nfs4_listxattr_maxcount = -1; -static int hf_nfs4_listxattr_cookie = -1; -static int hf_nfs4_listxattr_names_len = -1; -static int hf_nfs4_xattrkey = -1; -static int hf_nfs4_listxattr_eof = -1; - -static gint ett_nfs = -1; -static gint ett_nfs_fh_encoding = -1; -static gint ett_nfs_fh_mount = -1; -static gint ett_nfs_fh_file = -1; -static gint ett_nfs_fh_export = -1; -static gint ett_nfs_fh_fsid = -1; -static gint ett_nfs_fh_xfsid = -1; -static gint ett_nfs_fh_fn = -1; -static gint ett_nfs_fh_xfn = -1; -static gint ett_nfs_fh_hp = -1; -static gint ett_nfs_fh_auth = -1; -static gint ett_nfs_fhandle = -1; -static gint ett_nfs_timeval = -1; -static gint ett_nfs_fattr = -1; -static gint ett_nfs_readdir_entry = -1; -static gint ett_nfs_fh_obj = -1; -static gint ett_nfs_fh_ex = -1; -static gint ett_nfs_utf8string = -1; - -static gint ett_nfs2_mode = -1; -static gint ett_nfs2_sattr = -1; -static gint ett_nfs2_diropargs = -1; - -static gint ett_nfs3_mode = -1; -static gint ett_nfs3_specdata = -1; -static gint ett_nfs3_fh = -1; -static gint ett_nfs3_nfstime = -1; -static gint ett_nfs3_fattr = -1; -static gint ett_nfs3_post_op_fh = -1; -static gint ett_nfs3_sattr = -1; -static gint ett_nfs3_diropargs = -1; -static gint ett_nfs3_sattrguard = -1; -static gint ett_nfs3_set_mode = -1; -static gint ett_nfs3_set_uid = -1; -static gint ett_nfs3_set_gid = -1; -static gint ett_nfs3_set_size = -1; -static gint ett_nfs3_set_atime = -1; -static gint ett_nfs3_set_mtime = -1; -static gint ett_nfs3_pre_op_attr = -1; -static gint ett_nfs3_post_op_attr = -1; -static gint ett_nfs3_wcc_attr = -1; -static gint ett_nfs3_wcc_data = -1; -static gint ett_nfs3_access = -1; -static gint ett_nfs3_fsinfo_properties = -1; -static gint ett_nfs3_gxfh_utlfield = -1; -static gint ett_nfs3_gxfh_sfhfield = -1; -static gint ett_nfs3_gxfh_sfhflags = -1; -static gint ett_nfs4_fh_pd_flags = -1; -static gint ett_nfs4_fh_pd_sites = -1; -static gint ett_nfs4_fh_pd_spaces = -1; - -static gint ett_nfs4_compound_call = -1; -static gint ett_nfs4_request_op = -1; -static gint ett_nfs4_response_op = -1; -static gint ett_nfs4_access = -1; -static gint ett_nfs4_access_supp = -1; -static gint ett_nfs4_close = -1; -static gint ett_nfs4_commit = -1; -static gint ett_nfs4_create = -1; -static gint ett_nfs4_delegpurge = -1; -static gint ett_nfs4_delegreturn = -1; -static gint ett_nfs4_getattr = -1; -static gint ett_nfs4_getattr_args = -1; -static gint ett_nfs4_getattr_resp = -1; -static gint ett_nfs4_resok4 = -1; -static gint ett_nfs4_obj_attrs = -1; -static gint ett_nfs4_fattr_new_attr_vals = -1; -static gint ett_nfs4_fattr4_attrmask = -1; -static gint ett_nfs4_attribute = -1; -static gint ett_nfs4_getfh = -1; -static gint ett_nfs4_link = -1; -static gint ett_nfs4_lock = -1; -static gint ett_nfs4_lockt = -1; -static gint ett_nfs4_locku = -1; -static gint ett_nfs4_lookup = -1; -static gint ett_nfs4_lookupp = -1; -static gint ett_nfs4_nverify = -1; -static gint ett_nfs4_open = -1; -static gint ett_nfs4_openattr = -1; -static gint ett_nfs4_open_confirm = -1; -static gint ett_nfs4_open_downgrade = -1; -static gint ett_nfs4_putfh = -1; -static gint ett_nfs4_putpubfh = -1; -static gint ett_nfs4_putrootfh = -1; -static gint ett_nfs4_read = -1; -static gint ett_nfs4_readdir = -1; -static gint ett_nfs4_readlink = -1; -static gint ett_nfs4_remove = -1; -static gint ett_nfs4_rename = -1; -static gint ett_nfs4_renew = -1; -static gint ett_nfs4_restorefh = -1; -static gint ett_nfs4_savefh = -1; -static gint ett_nfs4_secinfo = -1; -static gint ett_nfs4_setattr = -1; -static gint ett_nfs4_setclientid = -1; -static gint ett_nfs4_setclientid_confirm = -1; -static gint ett_nfs4_verify = -1; -static gint ett_nfs4_write = -1; -static gint ett_nfs4_release_lockowner = -1; -static gint ett_nfs4_backchannel_ctl = -1; -static gint ett_nfs4_illegal = -1; -static gint ett_nfs4_verifier = -1; -static gint ett_nfs4_dirlist = -1; -static gint ett_nfs4_dir_entry = -1; -static gint ett_nfs4_pathname = -1; -static gint ett_nfs4_change_info = -1; -static gint ett_nfs4_open_delegation = -1; -static gint ett_nfs4_open_claim = -1; -static gint ett_nfs4_opentype = -1; -static gint ett_nfs4_lock_owner = -1; -static gint ett_nfs4_cb_client = -1; -static gint ett_nfs4_client_id = -1; -static gint ett_nfs4_clientowner = -1; -static gint ett_nfs4_exchangeid_call_flags = -1; -static gint ett_nfs4_exchangeid_reply_flags = -1; -static gint ett_nfs4_server_owner = -1; -static gint ett_nfs4_bitmap = -1; -static gint ett_nfs4_attr_request = -1; -static gint ett_nfs4_fattr = -1; -static gint ett_nfs4_fsid = -1; -static gint ett_nfs4_fs_locations = -1; -static gint ett_nfs4_fs_location = -1; -static gint ett_nfs4_open_result_flags = -1; -static gint ett_nfs4_secinfo_flavor_info = -1; -static gint ett_nfs4_stateid = -1; -static gint ett_nfs4_fattr_fh_expire_type = -1; -static gint ett_nfs4_fattr_fs_charset_cap = -1; -static gint ett_nfs4_fattr_aclsupport = -1; -static gint ett_nfs4_aclflag = -1; -static gint ett_nfs4_ace = -1; -static gint ett_nfs4_clientaddr = -1; -static gint ett_nfs4_aceflag = -1; -static gint ett_nfs4_acemask = -1; -static gint ett_nfs4_create_session_flags = -1; -static gint ett_nfs4_sequence_status_flags = -1; -static gint ett_nfs4_fh_file = -1; -static gint ett_nfs4_fh_file_flags = -1; -static gint ett_nfs4_fh_export = -1; -static gint ett_nfs4_layoutget = -1; -static gint ett_nfs4_layoutcommit = -1; -static gint ett_nfs4_layoutreturn = -1; -static gint ett_nfs4_getdevinfo = -1; -static gint ett_nfs4_getdevlist = -1; -static gint ett_nfs4_bind_conn_to_session = -1; -static gint ett_nfs4_exchange_id = -1; -static gint ett_nfs4_create_session = -1; -static gint ett_nfs4_destroy_session = -1; -static gint ett_nfs4_free_stateid = -1; -static gint ett_nfs4_secinfo_no_name = -1; -static gint ett_nfs4_sequence = -1; -static gint ett_nfs4_slotid = -1; -static gint ett_nfs4_sr_status = -1; -static gint ett_nfs4_serverscope = -1; -static gint ett_nfs4_minorid = -1; -static gint ett_nfs4_majorid = -1; -static gint ett_nfs4_persist = -1; -static gint ett_nfs4_backchan = -1; -static gint ett_nfs4_rdmamode = -1; -static gint ett_nfs4_padsize = -1; -static gint ett_nfs4_cbrenforce = -1; -static gint ett_nfs4_hashalg = -1; -static gint ett_nfs4_ssvlen = -1; -static gint ett_nfs4_maxreqsize = -1; -static gint ett_nfs4_maxrespsize = -1; -static gint ett_nfs4_maxrespsizecached = -1; -static gint ett_nfs4_maxops = -1; -static gint ett_nfs4_maxreqs = -1; -static gint ett_nfs4_streamchanattrs = -1; -static gint ett_nfs4_rdmachanattrs = -1; -static gint ett_nfs4_machinename = -1; -static gint ett_nfs4_flavor = -1; -static gint ett_nfs4_stamp = -1; -static gint ett_nfs4_uid = -1; -static gint ett_nfs4_gid = -1; -static gint ett_nfs4_service = -1; -static gint ett_nfs4_sessionid = -1; -static gint ett_nfs4_layoutseg = -1; -static gint ett_nfs4_layoutseg_sub = -1; -static gint ett_nfs4_nfl_util = -1; -static gint ett_nfs4_test_stateid = -1; -static gint ett_nfs4_destroy_clientid = -1; -static gint ett_nfs4_reclaim_complete = -1; -static gint ett_nfs4_allocate = -1; -static gint ett_nfs4_deallocate = -1; -static gint ett_nfs4_seek = -1; -static gint ett_nfs4_chan_attrs = -1; -static gint ett_nfs4_want_notify_flags = -1; -static gint ett_nfs4_ff_layout_flags = -1; -static gint ett_nfs4_scsi_layout_vol = -1; -static gint ett_nfs4_scsi_layout_vol_indices = -1; -static gint ett_nfs4_layoutstats = -1; -static gint ett_nfs4_io_info = -1; -static gint ett_nfs4_io_latency = -1; -static gint ett_nfs4_io_time = -1; -static gint ett_nfs4_callback_stateids_sub = -1; -static gint ett_nfs4_source_servers_sub = -1; -static gint ett_nfs4_copy = -1; -static gint ett_nfs4_copy_notify = -1; -static gint ett_nfs4_device_errors_sub = -1; -static gint ett_nfs4_layouterror = -1; -static gint ett_nfs4_ff_ioerrs_sub = -1; -static gint ett_nfs4_ff_iostats_sub = -1; -static gint ett_nfs4_clone = -1; -static gint ett_nfs4_getxattr = -1; -static gint ett_nfs4_setxattr = -1; -static gint ett_nfs4_listxattr = -1; -static gint ett_nfs4_removexattr = -1; -static gint ett_nfs4_offload_cancel = -1; -static gint ett_nfs4_offload_status = -1; -static gint ett_nfs4_osr_complete_sub = -1; -static gint ett_nfs4_io_advise = -1; -static gint ett_nfs4_read_plus = -1; -static gint ett_nfs4_read_plus_content_sub = -1; -static gint ett_nfs4_write_same = -1; -static gint ett_nfs4_listxattr_names = -1; - -static expert_field ei_nfs_too_many_ops = EI_INIT; -static expert_field ei_nfs_not_vnx_file = EI_INIT; -static expert_field ei_protocol_violation = EI_INIT; -static expert_field ei_nfs_too_many_bitmaps = EI_INIT; -static expert_field ei_nfs_bitmap_no_dissector = EI_INIT; -static expert_field ei_nfs_bitmap_skip_value = EI_INIT; -static expert_field ei_nfs_bitmap_undissected_data = EI_INIT; -static expert_field ei_nfs4_stateid_deprecated = EI_INIT; -static expert_field ei_nfs_file_system_cycle = EI_INIT; +static int hf_nfs4_procedure; +static int hf_nfs4_status; +static int hf_nfs4_op; +static int hf_nfs4_main_opcode; +static int hf_nfs4_linktext; +static int hf_nfs4_tag; +static int hf_nfs4_ops_count; +static int hf_nfs4_pathname_components; +static int hf_nfs4_component; +static int hf_nfs4_clientid; +/* static int hf_nfs4_ace; */ +static int hf_nfs4_recall; +static int hf_nfs4_open_claim_type; +static int hf_nfs4_opentype; +static int hf_nfs4_state_protect_how; +static int hf_nfs4_limit_by; +static int hf_nfs4_open_delegation_type; +static int hf_nfs4_why_no_delegation; +static int hf_nfs4_ftype; +static int hf_nfs4_change_info_atomic; +static int hf_nfs4_open_share_access; +static int hf_nfs4_open_share_deny; +static int hf_nfs4_want_flags; +static int hf_nfs4_want_notify_flags; +static int hf_nfs4_want_signal_deleg_when_resrc_avail; +static int hf_nfs4_want_push_deleg_when_uncontended; +static int hf_nfs4_want_deleg_timestamps; +static int hf_nfs4_seqid; +static int hf_nfs4_lock_seqid; +static int hf_nfs4_reqd_attr; +static int hf_nfs4_reco_attr; +static int hf_nfs4_attr_mask; +static int hf_nfs4_attr_count; +static int hf_nfs4_set_it_value_follows; +static int hf_nfs4_time_how; +static int hf_nfs4_time_how4; +static int hf_nfs4_fattr_link_support; +static int hf_nfs4_fattr_symlink_support; +static int hf_nfs4_fattr_named_attr; +static int hf_nfs4_fattr_unique_handles; +static int hf_nfs4_fattr_archive; +static int hf_nfs4_fattr_cansettime; +static int hf_nfs4_fattr_case_insensitive; +static int hf_nfs4_fattr_case_preserving; +static int hf_nfs4_fattr_chown_restricted; +static int hf_nfs4_fattr_fh_expire_type; +static int hf_nfs4_fattr_fh_expiry_noexpire_with_open; +static int hf_nfs4_fattr_fh_expiry_volatile_any; +static int hf_nfs4_fattr_fh_expiry_vol_migration; +static int hf_nfs4_fattr_fh_expiry_vol_rename; +static int hf_nfs4_fattr_hidden; +static int hf_nfs4_fattr_homogeneous; +static int hf_nfs4_fattr_mimetype; +static int hf_nfs4_fattr_no_trunc; +static int hf_nfs4_fattr_system; +static int hf_nfs4_fattr_owner; +static int hf_nfs4_fattr_owner_group; +static int hf_nfs4_fattr_size; +static int hf_nfs4_fattr_aclsupport; +static int hf_nfs4_aclsupport_allow_acl; +static int hf_nfs4_aclsupport_deny_acl; +static int hf_nfs4_aclsupport_audit_acl; +static int hf_nfs4_aclsupport_alarm_acl; +static int hf_nfs4_fattr_lease_time; +static int hf_nfs4_fattr_fs_charset_cap; +static int hf_nfs4_fs_charset_cap_nonutf8; +static int hf_nfs4_fs_charset_cap_utf8; +static int hf_nfs4_fattr_fileid; +static int hf_nfs4_fattr_files_avail; +static int hf_nfs4_fattr_files_free; +static int hf_nfs4_fattr_files_total; +static int hf_nfs4_fattr_maxfilesize; +static int hf_nfs4_fattr_maxlink; +static int hf_nfs4_fattr_maxname; +static int hf_nfs4_fattr_numlinks; +static int hf_nfs4_fattr_maxread; +static int hf_nfs4_fattr_maxwrite; +static int hf_nfs4_fattr_quota_hard; +static int hf_nfs4_fattr_quota_soft; +static int hf_nfs4_fattr_quota_used; +static int hf_nfs4_fattr_space_avail; +static int hf_nfs4_fattr_space_free; +static int hf_nfs4_fattr_space_total; +static int hf_nfs4_fattr_space_used; +static int hf_nfs4_fattr_mounted_on_fileid; +static int hf_nfs4_fattr_layout_blksize; +static int hf_nfs4_mdsthreshold_item; +static int hf_nfs4_mdsthreshold_hint_mask; +static int hf_nfs4_mdsthreshold_hint_count; +static int hf_nfs4_mdsthreshold_mask_count; +static int hf_nfs4_mdsthreshold_hint_file; +static int hf_nfs4_fattr_security_label_lfs; +static int hf_nfs4_fattr_security_label_pi; +static int hf_nfs4_fattr_security_label_context; +static int hf_nfs4_fattr_umask_mask; +static int hf_nfs4_fattr_xattr_support; +static int hf_nfs4_fattr_offline; +static int hf_nfs4_who; +static int hf_nfs4_server; +static int hf_nfs4_servers; +static int hf_nfs4_fslocation; +static int hf_nfs4_stable_how; +static int hf_nfs4_dirlist_eof; +static int hf_nfs4_offset; +static int hf_nfs4_specdata1; +static int hf_nfs4_specdata2; +static int hf_nfs4_lock_type; +static int hf_nfs4_open_rflags; +static int hf_nfs4_open_rflags_confirm; +static int hf_nfs4_open_rflags_locktype_posix; +static int hf_nfs4_open_rflags_preserve_unlinked; +static int hf_nfs4_open_rflags_may_notify_lock; +static int hf_nfs4_reclaim; +static int hf_nfs4_length; +static int hf_nfs4_changeid; +static int hf_nfs4_changeid_before; +static int hf_nfs4_changeid_after; +static int hf_nfs4_time_seconds; +static int hf_nfs4_time_nseconds; +static int hf_nfs4_fsid_major; +static int hf_nfs4_fsid_minor; +static int hf_nfs4_acetype; +static int hf_nfs4_aceflags; +static int hf_nfs4_aceflag_file_inherit; +static int hf_nfs4_aceflag_dir_inherit; +static int hf_nfs4_aceflag_no_prop_inherit; +static int hf_nfs4_aceflag_inherit_only; +static int hf_nfs4_aceflag_successful_access; +static int hf_nfs4_aceflag_failed_access; +static int hf_nfs4_aceflag_id_group; +static int hf_nfs4_aceflag_inherited_ace; +static int hf_nfs4_acemask; +static int hf_nfs4_ace_permission; +static int hf_nfs4_delegate_type; +static int hf_nfs4_secinfo_flavor; +static int hf_nfs4_secinfo_arr; +static int hf_nfs4_num_blocks; +static int hf_nfs4_bytes_per_block; +static int hf_nfs4_eof; +static int hf_nfs4_verifier; +static int hf_nfs4_value_follows; +static int hf_nfs4_cookie; +static int hf_nfs4_dir_entry_name; +static int hf_nfs4_cookie_verf; +static int hf_nfs4_cb_program; +/* static int hf_nfs4_cb_location; */ +static int hf_nfs4_recall4; +static int hf_nfs4_filesize; +static int hf_nfs4_count; +static int hf_nfs4_count_dircount; +static int hf_nfs4_count_maxcount; +static int hf_nfs4_minorversion; +static int hf_nfs4_open_owner; +static int hf_nfs4_lock_owner; +static int hf_nfs4_new_lock_owner; +static int hf_nfs4_sec_oid; +static int hf_nfs4_qop; +static int hf_nfs4_secinfo_rpcsec_gss_info_service; +static int hf_nfs4_attr_dir_create; +static int hf_nfs4_client_id; +static int hf_nfs4_stateid; +static int hf_nfs4_seqid_stateid; +static int hf_nfs4_stateid_other; +static int hf_nfs4_stateid_hash; +static int hf_nfs4_stateid_other_hash; +static int hf_nfs4_lock_reclaim; +static int hf_nfs4_aclflags; +static int hf_nfs4_aclflag_auto_inherit; +static int hf_nfs4_aclflag_protected; +static int hf_nfs4_aclflag_defaulted; +static int hf_nfs4_num_aces; +static int hf_nfs4_callback_ident; +static int hf_nfs4_r_netid; +static int hf_nfs4_gsshandle; +static int hf_nfs4_r_addr; +static int hf_nfs4_createmode; +static int hf_nfs4_op_mask; +static int hf_nfs4_read_data_length; +static int hf_nfs4_write_data_length; +static int hf_nfs4_length_minlength; +static int hf_nfs4_layout_type; +static int hf_nfs4_layout_return_type; +static int hf_nfs4_iomode; +/* static int hf_nfs4_stripetype; */ +/* static int hf_nfs4_mdscommit; */ +static int hf_nfs4_stripeunit; +static int hf_nfs4_newtime; +static int hf_nfs4_newoffset; +static int hf_nfs4_layout_avail; +static int hf_nfs4_newsize; +static int hf_nfs4_layoutupdate; +static int hf_nfs4_deviceid; +static int hf_nfs4_devicenum; +static int hf_nfs4_deviceidx; +static int hf_nfs4_layout; +/* static int hf_nfs4_stripedevs; */ +/* static int hf_nfs4_devaddr; */ +static int hf_nfs4_devaddr_ssv_start; +static int hf_nfs4_devaddr_ssv_length; +static int hf_nfs4_devaddr_scsi_vol_type; +static int hf_nfs4_devaddr_scsi_vol_index; +static int hf_nfs4_devaddr_scsi_vol_ref_index; +static int hf_nfs4_devaddr_ssv_stripe_unit; +static int hf_nfs4_devaddr_scsi_vpd_code_set; +static int hf_nfs4_devaddr_scsi_vpd_designator_type; +static int hf_nfs4_devaddr_scsi_vpd_designator; +static int hf_nfs4_devaddr_scsi_private_key; +static int hf_nfs4_scsil_ext_file_offset; +static int hf_nfs4_scsil_ext_length; +static int hf_nfs4_scsil_ext_vol_offset; +static int hf_nfs4_scsil_ext_state; +static int hf_nfs4_return_on_close; +static int hf_nfs4_slotid; +static int hf_nfs4_high_slotid; +static int hf_nfs4_target_high_slotid; +static int hf_nfs4_serverscope4; +static int hf_nfs4_minorid; +static int hf_nfs4_majorid; +static int hf_nfs4_padsize; +/* static int hf_nfs4_cbrenforce; */ +/* static int hf_nfs4_hashalg; */ +/* static int hf_nfs4_ssvlen; */ +static int hf_nfs4_maxreqsize; +static int hf_nfs4_maxrespsize; +static int hf_nfs4_maxrespsizecached; +static int hf_nfs4_maxops; +static int hf_nfs4_maxreqs; +static int hf_nfs4_rdmachanattrs; +static int hf_nfs4_machinename; +static int hf_nfs4_flavor; +static int hf_nfs4_stamp; +static int hf_nfs4_uid; +static int hf_nfs4_gid; +static int hf_nfs4_service; +static int hf_nfs4_sessionid; +static int hf_nfs4_exchid_call_flags; +static int hf_nfs4_exchid_reply_flags; +static int hf_nfs4_exchid_flags_moved_refer; +static int hf_nfs4_exchid_flags_moved_migr; +static int hf_nfs4_exchid_flags_bind_princ; +static int hf_nfs4_exchid_flags_non_pnfs; +static int hf_nfs4_exchid_flags_pnfs_mds; +static int hf_nfs4_exchid_flags_pnfs_ds; +static int hf_nfs4_exchid_flags_upd_conf_rec_a; +static int hf_nfs4_exchid_flags_confirmed_r; +static int hf_nfs4_state_protect_window; +static int hf_nfs4_state_protect_num_gss_handles; +static int hf_nfs4_sp_parms_hash_algs; +static int hf_nfs4_sp_parms_encr_algs; +static int hf_nfs4_prot_info_spi_window; +static int hf_nfs4_prot_info_svv_length; +static int hf_nfs4_prot_info_encr_alg; +static int hf_nfs4_prot_info_hash_alg; +static int hf_nfs4_nii_domain; +static int hf_nfs4_nii_name; +static int hf_nfs4_create_session_flags_csa; +static int hf_nfs4_create_session_flags_csr; +static int hf_nfs4_create_session_flags_persist; +static int hf_nfs4_create_session_flags_conn_back_chan; +static int hf_nfs4_create_session_flags_conn_rdma; +static int hf_nfs4_cachethis; +/* static int hf_nfs4_util; */ +/* static int hf_nfs4_first_stripe_idx; */ +/* static int hf_nfs4_layout_count; */ +/* static int hf_nfs4_pattern_offset; */ +static int hf_nfs4_notify_mask; +static int hf_nfs4_notify_type; +static int hf_nfs4_notify_deviceid_mask; +static int hf_nfs4_notify_deviceid_type; +static int hf_nfs4_lrs_present; +static int hf_nfs4_nfl_mirrors; +static int hf_nfs4_nfl_util; +static int hf_nfs4_nfl_util_stripe_size; +static int hf_nfs4_nfl_util_commit_thru_mds; +static int hf_nfs4_nfl_util_dense; +static int hf_nfs4_nfl_fhs; +static int hf_nfs4_mirror_eff; +static int hf_nfs4_nfl_first_stripe_index; +static int hf_nfs4_lrf_body_content; +static int hf_nfs4_reclaim_one_fs; +static int hf_nfs4_bctsa_dir; +static int hf_nfs4_bctsa_use_conn_in_rdma_mode; +static int hf_nfs4_bctsr_dir; +static int hf_nfs4_bctsr_use_conn_in_rdma_mode; +static int hf_nfs4_sequence_status_flags; +static int hf_nfs4_sequence_status_flags_cb_path_down; +static int hf_nfs4_sequence_status_flags_cb_gss_contexts_expiring; +static int hf_nfs4_sequence_status_flags_cb_gss_contexts_expired; +static int hf_nfs4_sequence_status_flags_expired_all_state_revoked; +static int hf_nfs4_sequence_status_flags_expired_some_state_revoked; +static int hf_nfs4_sequence_status_flags_admin_state_revoked; +static int hf_nfs4_sequence_status_flags_recallable_state_revoked; +static int hf_nfs4_sequence_status_flags_lease_moved; +static int hf_nfs4_sequence_status_flags_restart_reclaim_needed; +static int hf_nfs4_sequence_status_flags_cb_path_down_session; +static int hf_nfs4_sequence_status_flags_backchannel_fault; +static int hf_nfs4_sequence_status_flags_devid_changed; +static int hf_nfs4_sequence_status_flags_devid_deleted; +static int hf_nfs4_secinfo_style; +static int hf_nfs4_test_stateid_arg; +static int hf_nfs4_test_stateid_res; +static int hf_nfs4_seek_data_content; +/* static int hf_nfs4_impl_id_len; */ +static int hf_nfs4_bitmap_data; +static int hf_nfs4_huge_bitmap_length; +static int hf_nfs4_universal_address_ipv4; +static int hf_nfs4_universal_address_ipv6; +static int hf_nfs4_getdevinfo; +static int hf_nfs4_ff_version; +static int hf_nfs4_ff_minorversion; +static int hf_nfs4_ff_tightly_coupled; +static int hf_nfs4_ff_rsize; +static int hf_nfs4_ff_wsize; +static int hf_nfs4_fattr_clone_blocksize; +static int hf_nfs4_fattr_space_freed; +static int hf_nfs4_fattr_change_attr_type; +static int hf_nfs4_ff_layout_flags; +static int hf_nfs4_ff_layout_flags_no_layoutcommit; +static int hf_nfs4_ff_layout_flags_no_io_thru_mds; +static int hf_nfs4_ff_layout_flags_no_read_io; +static int hf_nfs4_ff_stats_collect_hint; +static int hf_nfs4_ff_synthetic_owner; +static int hf_nfs4_ff_synthetic_owner_group; +static int hf_nfs4_ff_bytes_completed; +static int hf_nfs4_ff_bytes_not_delivered; +static int hf_nfs4_ff_bytes_requested; +static int hf_nfs4_ff_local; +static int hf_nfs4_ff_ops_completed; +static int hf_nfs4_ff_ops_requested; +static int hf_nfs4_io_bytes; +static int hf_nfs4_io_count; +static int hf_nfs4_layoutstats; +static int hf_nfs4_callback_stateids; +static int hf_nfs4_callback_stateids_index; +static int hf_nfs4_num_offload_status; +static int hf_nfs4_offload_status_index; +static int hf_nfs4_consecutive; +static int hf_nfs4_netloc; +static int hf_nfs4_netloc_type; +static int hf_nfs4_nl_name; +static int hf_nfs4_nl_url; +static int hf_nfs4_source_server_index; +static int hf_nfs4_source_servers; +static int hf_nfs4_synchronous; +static int hf_nfs4_device_error_count; +static int hf_nfs4_device_errors_index; +static int hf_nfs4_ff_ioerrs_count; +static int hf_nfs4_ff_ioerrs_index; +static int hf_nfs4_ff_ioerrs_length; +static int hf_nfs4_ff_ioerrs_offset; +static int hf_nfs4_ff_iostats_count; +static int hf_nfs4_ff_iostats_index; +static int hf_nfs4_io_error_op; +static int hf_nfs4_io_hints_mask; +static int hf_nfs4_io_hint_count; +static int hf_nfs4_io_advise_hint; +static int hf_nfs4_cb_recall_any_objs; +static int hf_nfs4_cb_recall_any_count; +static int hf_nfs4_cb_recall_any_mask; +static int hf_nfs4_cb_recall_any_item; +static int hf_nfs4_bytes_copied; +static int hf_nfs4_read_plus_contents; +static int hf_nfs4_read_plus_content_type; +static int hf_nfs4_block_size; +static int hf_nfs4_block_count; +static int hf_nfs4_reloff_blocknum; +static int hf_nfs4_blocknum; +static int hf_nfs4_reloff_pattern; +static int hf_nfs4_pattern_hash; +static int hf_nfs4_setxattr_options; +static int hf_nfs4_listxattr_maxcount; +static int hf_nfs4_listxattr_cookie; +static int hf_nfs4_listxattr_names_len; +static int hf_nfs4_xattrkey; +static int hf_nfs4_listxattr_eof; +static int hf_nfs4_gdd_signal_deleg_avail; +static int hf_nfs4_gdd_non_fatal_status; +static int hf_nfs4_gdd_child_attr_delay; +static int hf_nfs4_gdd_dir_attr_delay; +static int hf_nfs4_gdd_child_attrs; +static int hf_nfs4_gdd_dir_attrs; + +static int ett_nfs; +static int ett_nfs_fh_encoding; +static int ett_nfs_fh_mount; +static int ett_nfs_fh_file; +static int ett_nfs_fh_export; +static int ett_nfs_fh_fsid; +static int ett_nfs_fh_xfsid; +static int ett_nfs_fh_fn; +static int ett_nfs_fh_xfn; +static int ett_nfs_fh_hp; +static int ett_nfs_fh_auth; +static int ett_nfs_fhandle; +static int ett_nfs_timeval; +static int ett_nfs_fattr; +static int ett_nfs_readdir_entry; +static int ett_nfs_fh_obj; +static int ett_nfs_fh_ex; +static int ett_nfs_utf8string; + +static int ett_nfs2_mode; +static int ett_nfs2_sattr; +static int ett_nfs2_diropargs; + +static int ett_nfs3_mode; +static int ett_nfs3_specdata; +static int ett_nfs3_fh; +static int ett_nfs3_nfstime; +static int ett_nfs3_fattr; +static int ett_nfs3_post_op_fh; +static int ett_nfs3_sattr; +static int ett_nfs3_diropargs; +static int ett_nfs3_sattrguard; +static int ett_nfs3_set_mode; +static int ett_nfs3_set_uid; +static int ett_nfs3_set_gid; +static int ett_nfs3_set_size; +static int ett_nfs3_set_atime; +static int ett_nfs3_set_mtime; +static int ett_nfs3_pre_op_attr; +static int ett_nfs3_post_op_attr; +static int ett_nfs3_wcc_attr; +static int ett_nfs3_wcc_data; +static int ett_nfs3_access; +static int ett_nfs3_fsinfo_properties; +static int ett_nfs3_gxfh_utlfield; +static int ett_nfs3_gxfh_sfhfield; +static int ett_nfs3_gxfh_sfhflags; +static int ett_nfs4_fh_pd_flags; +static int ett_nfs4_fh_pd_sites; +static int ett_nfs4_fh_pd_spaces; + +static int ett_nfs4_compound_call; +static int ett_nfs4_request_op; +static int ett_nfs4_response_op; +static int ett_nfs4_access; +static int ett_nfs4_access_supp; +static int ett_nfs4_close; +static int ett_nfs4_commit; +static int ett_nfs4_create; +static int ett_nfs4_delegpurge; +static int ett_nfs4_delegreturn; +static int ett_nfs4_getattr; +static int ett_nfs4_getattr_args; +static int ett_nfs4_getattr_resp; +static int ett_nfs4_resok4; +static int ett_nfs4_obj_attrs; +static int ett_nfs4_fattr_new_attr_vals; +static int ett_nfs4_fattr4_attrmask; +static int ett_nfs4_attribute; +static int ett_nfs4_getfh; +static int ett_nfs4_link; +static int ett_nfs4_lock; +static int ett_nfs4_lockt; +static int ett_nfs4_locku; +static int ett_nfs4_lookup; +static int ett_nfs4_lookupp; +static int ett_nfs4_nverify; +static int ett_nfs4_open; +static int ett_nfs4_openattr; +static int ett_nfs4_open_confirm; +static int ett_nfs4_open_downgrade; +static int ett_nfs4_putfh; +static int ett_nfs4_putpubfh; +static int ett_nfs4_putrootfh; +static int ett_nfs4_read; +static int ett_nfs4_readdir; +static int ett_nfs4_readlink; +static int ett_nfs4_remove; +static int ett_nfs4_rename; +static int ett_nfs4_renew; +static int ett_nfs4_restorefh; +static int ett_nfs4_savefh; +static int ett_nfs4_secinfo; +static int ett_nfs4_setattr; +static int ett_nfs4_setclientid; +static int ett_nfs4_setclientid_confirm; +static int ett_nfs4_verify; +static int ett_nfs4_write; +static int ett_nfs4_release_lockowner; +static int ett_nfs4_backchannel_ctl; +static int ett_nfs4_illegal; +static int ett_nfs4_verifier; +static int ett_nfs4_dirlist; +static int ett_nfs4_dir_entry; +static int ett_nfs4_pathname; +static int ett_nfs4_change_info; +static int ett_nfs4_open_delegation; +static int ett_nfs4_open_claim; +static int ett_nfs4_opentype; +static int ett_nfs4_lock_owner; +static int ett_nfs4_cb_client; +static int ett_nfs4_client_id; +static int ett_nfs4_clientowner; +static int ett_nfs4_exchangeid_call_flags; +static int ett_nfs4_exchangeid_reply_flags; +static int ett_nfs4_server_owner; +static int ett_nfs4_bitmap; +static int ett_nfs4_attr_request; +static int ett_nfs4_fattr; +static int ett_nfs4_fsid; +static int ett_nfs4_fs_locations; +static int ett_nfs4_fs_location; +static int ett_nfs4_open_result_flags; +static int ett_nfs4_secinfo_flavor_info; +static int ett_nfs4_stateid; +static int ett_nfs4_fattr_fh_expire_type; +static int ett_nfs4_fattr_fs_charset_cap; +static int ett_nfs4_fattr_aclsupport; +static int ett_nfs4_aclflag; +static int ett_nfs4_ace; +static int ett_nfs4_clientaddr; +static int ett_nfs4_aceflag; +static int ett_nfs4_acemask; +static int ett_nfs4_create_session_flags; +static int ett_nfs4_sequence_status_flags; +static int ett_nfs4_fh_file; +static int ett_nfs4_fh_file_flags; +static int ett_nfs4_fh_export; +static int ett_nfs4_layoutget; +static int ett_nfs4_layoutcommit; +static int ett_nfs4_layoutreturn; +static int ett_nfs4_getdevinfo; +static int ett_nfs4_getdevlist; +static int ett_nfs4_bind_conn_to_session; +static int ett_nfs4_exchange_id; +static int ett_nfs4_create_session; +static int ett_nfs4_destroy_session; +static int ett_nfs4_free_stateid; +static int ett_nfs4_get_dir_delegation; +static int ett_nfs4_secinfo_no_name; +static int ett_nfs4_sequence; +static int ett_nfs4_slotid; +static int ett_nfs4_sr_status; +static int ett_nfs4_serverscope; +static int ett_nfs4_minorid; +static int ett_nfs4_majorid; +static int ett_nfs4_persist; +static int ett_nfs4_backchan; +static int ett_nfs4_rdmamode; +static int ett_nfs4_padsize; +static int ett_nfs4_cbrenforce; +static int ett_nfs4_hashalg; +static int ett_nfs4_ssvlen; +static int ett_nfs4_maxreqsize; +static int ett_nfs4_maxrespsize; +static int ett_nfs4_maxrespsizecached; +static int ett_nfs4_maxops; +static int ett_nfs4_maxreqs; +static int ett_nfs4_streamchanattrs; +static int ett_nfs4_rdmachanattrs; +static int ett_nfs4_machinename; +static int ett_nfs4_flavor; +static int ett_nfs4_stamp; +static int ett_nfs4_uid; +static int ett_nfs4_gid; +static int ett_nfs4_service; +static int ett_nfs4_sessionid; +static int ett_nfs4_layoutseg; +static int ett_nfs4_layoutseg_sub; +static int ett_nfs4_nfl_util; +static int ett_nfs4_test_stateid; +static int ett_nfs4_destroy_clientid; +static int ett_nfs4_reclaim_complete; +static int ett_nfs4_allocate; +static int ett_nfs4_deallocate; +static int ett_nfs4_seek; +static int ett_nfs4_chan_attrs; +static int ett_nfs4_want_notify_flags; +static int ett_nfs4_ff_layout_flags; +static int ett_nfs4_scsi_layout_vol; +static int ett_nfs4_scsi_layout_vol_indices; +static int ett_nfs4_layoutstats; +static int ett_nfs4_io_info; +static int ett_nfs4_io_latency; +static int ett_nfs4_io_time; +static int ett_nfs4_callback_stateids_sub; +static int ett_nfs4_source_servers_sub; +static int ett_nfs4_copy; +static int ett_nfs4_copy_notify; +static int ett_nfs4_device_errors_sub; +static int ett_nfs4_layouterror; +static int ett_nfs4_ff_ioerrs_sub; +static int ett_nfs4_ff_iostats_sub; +static int ett_nfs4_clone; +static int ett_nfs4_getxattr; +static int ett_nfs4_setxattr; +static int ett_nfs4_listxattr; +static int ett_nfs4_removexattr; +static int ett_nfs4_offload_cancel; +static int ett_nfs4_offload_status; +static int ett_nfs4_osr_complete_sub; +static int ett_nfs4_io_advise; +static int ett_nfs4_read_plus; +static int ett_nfs4_read_plus_content_sub; +static int ett_nfs4_write_same; +static int ett_nfs4_listxattr_names; +static int ett_nfs4_notify_delay; +static int ett_nfs4_notify_attrs; + +static expert_field ei_nfs_too_many_ops; +static expert_field ei_nfs_not_vnx_file; +static expert_field ei_protocol_violation; +static expert_field ei_nfs_too_many_bitmaps; +static expert_field ei_nfs_bitmap_no_dissector; +static expert_field ei_nfs_bitmap_skip_value; +static expert_field ei_nfs_bitmap_undissected_data; +static expert_field ei_nfs4_stateid_deprecated; +static expert_field ei_nfs_file_system_cycle; + +static int nfsv4_tap; static const true_false_string tfs_read_write = { "Read", "Write" }; @@ -950,10 +966,10 @@ static const true_false_string tfs_read_write = { "Read", "Write" }; /* Prototype for function to dissect attribute value */ typedef int (dissect_bitmap_item_t)(tvbuff_t *tvb, int offset, packet_info *pinfo, rpc_call_info_value *civ, proto_tree *attr_tree, proto_item *attr_item, - guint32 bit_num, void *battr_data); + uint32_t bit_num, void *battr_data); /* Prototype for function to return the header field for the item label */ -typedef int (get_bitmap_hinfo_t)(guint32 bit_num); +typedef int (get_bitmap_hinfo_t)(uint32_t bit_num); /* Bitmap type */ typedef enum { @@ -1000,13 +1016,13 @@ typedef struct nfs_fhandle_data { /* fhandle displayfilters to match also corresponding request/response packet in addition to the one containing the actual filehandle */ -gboolean nfs_fhandle_reqrep_matching = FALSE; -static wmem_tree_t *nfs_fhandle_frame_table = NULL; +bool nfs_fhandle_reqrep_matching; +static wmem_tree_t *nfs_fhandle_frame_table; /* file name snooping */ -gboolean nfs_file_name_snooping = FALSE; -static gboolean nfs_file_name_full_snooping = FALSE; +bool nfs_file_name_snooping; +static bool nfs_file_name_full_snooping; typedef struct nfs_name_snoop { int fh_length; unsigned char *fh; @@ -1025,15 +1041,15 @@ typedef struct nfs_name_snoop_key { const unsigned char *fh; } nfs_name_snoop_key_t; -static GHashTable *nfs_name_snoop_unmatched = NULL; +static GHashTable *nfs_name_snoop_unmatched; -static GHashTable *nfs_name_snoop_matched = NULL; +static GHashTable *nfs_name_snoop_matched; -static wmem_tree_t *nfs_name_snoop_known = NULL; -static wmem_tree_t *nfs_file_handles = NULL; +static wmem_tree_t *nfs_name_snoop_known; +static wmem_tree_t *nfs_file_handles; -static gboolean nfs_display_v4_tag = TRUE; -static gboolean display_major_nfs4_ops = TRUE; +static bool nfs_display_v4_tag = true; +static bool display_major_nfs4_ops = true; /* Types of RDMA reduced opaque data */ typedef enum { @@ -1046,9 +1062,9 @@ typedef enum { static int dissect_nfsdata_reduced(rdma_reduce_type_t rtype, tvbuff_t *tvb, int offset, proto_tree *tree, int hf, const char **name); -static int dissect_nfs4_stateid(tvbuff_t *tvb, int offset, proto_tree *tree, guint16 *hash); +static int dissect_nfs4_stateid(tvbuff_t *tvb, int offset, proto_tree *tree, uint16_t *hash); -static void nfs_prompt(packet_info *pinfo _U_, gchar* result) +static void nfs_prompt(packet_info *pinfo _U_, char* result) { snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Decode NFS file handles as"); } @@ -1069,14 +1085,14 @@ static void nfs_prompt(packet_info *pinfo _U_, gchar* result) static nfs_fhandle_data_t * store_nfs_file_handle(nfs_fhandle_data_t *nfs_fh) { - guint32 fhlen; - guint32 *fhdata; + uint32_t fhlen; + uint32_t *fhdata; wmem_tree_key_t fhkey[3]; nfs_fhandle_data_t *new_nfs_fh; fhlen = nfs_fh->len/4; /* align the file handle data */ - fhdata = (guint32 *)g_memdup2(nfs_fh->fh, fhlen*4); + fhdata = (uint32_t *)g_memdup2(nfs_fh->fh, fhlen*4); fhkey[0].length = 1; fhkey[0].key = &fhlen; fhkey[1].length = fhlen; @@ -1105,8 +1121,8 @@ store_nfs_file_handle(nfs_fhandle_data_t *nfs_fh) } -static gint -nfs_name_snoop_matched_equal(gconstpointer k1, gconstpointer k2) +static int +nfs_name_snoop_matched_equal(const void *k1, const void *k2) { const nfs_name_snoop_key_t *key1 = (const nfs_name_snoop_key_t *)k1; const nfs_name_snoop_key_t *key2 = (const nfs_name_snoop_key_t *)k2; @@ -1117,12 +1133,12 @@ nfs_name_snoop_matched_equal(gconstpointer k1, gconstpointer k2) } -static guint -nfs_name_snoop_matched_hash(gconstpointer k) +static unsigned +nfs_name_snoop_matched_hash(const void *k) { const nfs_name_snoop_key_t *key = (const nfs_name_snoop_key_t *)k; int i; - guint hash; + unsigned hash; hash = key->key; for (i=0; i<key->fh_length; i++) @@ -1132,32 +1148,32 @@ nfs_name_snoop_matched_hash(gconstpointer k) } -static gint -nfs_name_snoop_unmatched_equal(gconstpointer k1, gconstpointer k2) +static int +nfs_name_snoop_unmatched_equal(const void *k1, const void *k2) { - guint32 key1 = GPOINTER_TO_UINT(k1); - guint32 key2 = GPOINTER_TO_UINT(k2); + uint32_t key1 = GPOINTER_TO_UINT(k1); + uint32_t key2 = GPOINTER_TO_UINT(k2); return key1 == key2; } -static guint -nfs_name_snoop_unmatched_hash(gconstpointer k) +static unsigned +nfs_name_snoop_unmatched_hash(const void *k) { - guint32 key = GPOINTER_TO_UINT(k); + uint32_t key = GPOINTER_TO_UINT(k); return key; } static void -nfs_name_snoop_value_destroy(gpointer value) +nfs_name_snoop_value_destroy(void *value) { nfs_name_snoop_t *nns = (nfs_name_snoop_t *)value; - g_free((gpointer)nns->name); - g_free((gpointer)nns->full_name); + g_free((void *)nns->name); + g_free((void *)nns->full_name); wmem_free(NULL, nns->parent); wmem_free(NULL, nns->fh); g_free(nns); @@ -1284,6 +1300,7 @@ nfs_name_snoop_add_fh(int xid, tvbuff_t *tvb, int fh_offset, int fh_length) #define NFS_MAX_FS_DEPTH 100 static void +// NOLINTNEXTLINE(misc-no-recursion) nfs_full_name_snoop(packet_info *pinfo, nfs_name_snoop_t *nns, int *len, char **name, char **pos) { nfs_name_snoop_t *parent_nns = NULL; @@ -1337,7 +1354,7 @@ nfs_full_name_snoop(packet_info *pinfo, nfs_name_snoop_t *nns, int *len, char ** static void nfs_name_snoop_fh(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int fh_offset, - int fh_length, gboolean hidden) + int fh_length, bool hidden) { nfs_name_snoop_key_t key; nfs_name_snoop_t *nns = NULL; @@ -1350,13 +1367,13 @@ nfs_name_snoop_fh(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int fh_of nns = (nfs_name_snoop_t *)g_hash_table_lookup(nfs_name_snoop_matched, &key); if (nns) { - guint32 fhlen; - guint32 *fhdata; + uint32_t fhlen; + uint32_t *fhdata; wmem_tree_key_t fhkey[3]; fhlen = nns->fh_length; /* align it */ - fhdata = (guint32 *)g_memdup2(nns->fh, fhlen); + fhdata = (uint32_t *)g_memdup2(nns->fh, fhlen); fhkey[0].length = 1; fhkey[0].key = &fhlen; fhkey[1].length = fhlen/4; @@ -1380,13 +1397,13 @@ nfs_name_snoop_fh(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int fh_of /* see if we know this mapping */ if (!nns) { - guint32 fhlen; - guint32 *fhdata; + uint32_t fhlen; + uint32_t *fhdata; wmem_tree_key_t fhkey[3]; fhlen = fh_length; /* align it */ - fhdata = (guint32 *)tvb_memdup(wmem_packet_scope(), tvb, fh_offset, fh_length); + fhdata = (uint32_t *)tvb_memdup(pinfo->pool, tvb, fh_offset, fh_length); fhkey[0].length = 1; fhkey[0].key = &fhlen; fhkey[1].length = fhlen/4; @@ -1434,10 +1451,10 @@ nfs_name_snoop_fh(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int fh_of static const true_false_string tfs_endianness = { "Little Endian", "Big Endian" }; static void -nfs_fmt_fsid( gchar *result, guint32 revision ) +nfs_fmt_fsid( char *result, uint32_t revision ) { - guint32 fsid_major; - guint32 fsid_minor; + uint32_t fsid_major; + uint32_t fsid_minor; fsid_major = ( revision>>18 ) & 0x3fff; /* 14 bits */ fsid_minor = ( revision ) & 0x3ffff; /* 18 bits */ @@ -1449,13 +1466,13 @@ nfs_fmt_fsid( gchar *result, guint32 revision ) static int dissect_fhandle_data_SVR4(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_) { - guint encoding = ENC_BIG_ENDIAN; /* We support little endian and big endian. Default is big endian*/ - gboolean have_flag = FALSE; /* The flag field at the end is optional. Assume no flag is there */ - gboolean found = FALSE; /* Did we really detect the file handle format? */ - guint32 nof = 0; - guint32 len1; - guint32 len2; - guint32 fhlen; /* File handle length. */ + unsigned encoding = ENC_BIG_ENDIAN; /* We support little endian and big endian. Default is big endian*/ + bool have_flag = false; /* The flag field at the end is optional. Assume no flag is there */ + bool found = false; /* Did we really detect the file handle format? */ + uint32_t nof = 0; + uint32_t len1; + uint32_t len2; + uint32_t fhlen; /* File handle length. */ static int * const fsid_fields[] = { &hf_nfs_fh_fsid_major32, @@ -1473,13 +1490,13 @@ dissect_fhandle_data_SVR4(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree *tre if (12+len1+len2 == fhlen) { encoding = ENC_LITTLE_ENDIAN; - have_flag = FALSE; - found = TRUE; + have_flag = false; + found = true; } if (16+len1+len2 == fhlen) { encoding = ENC_LITTLE_ENDIAN; - have_flag = TRUE; - found = TRUE; + have_flag = true; + found = true; } } @@ -1490,17 +1507,17 @@ dissect_fhandle_data_SVR4(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree *tre len2 = tvb_get_ntohs(tvb, 10+len1); if (12+len1+len2 == fhlen) { - have_flag = FALSE; + have_flag = false; } if (16+len1+len2 == fhlen) { - have_flag = TRUE; + have_flag = true; } } } proto_tree_add_boolean(tree, hf_nfs_fh_endianness, tvb, 0, fhlen, (encoding == ENC_LITTLE_ENDIAN)); - /* We are fairly sure, that when found == FALSE, the following code will + /* We are fairly sure, that when found == false, the following code will throw an exception. */ /* file system id */ @@ -1514,30 +1531,30 @@ dissect_fhandle_data_SVR4(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree *tre /* file number */ { - guint32 fn_O; - guint32 fn_len_O; - guint32 fn_len_L; - guint32 fn_len; - guint32 fn_data_O; - guint32 fn_data_inode_O; - guint32 fn_data_inode_L; - guint32 inode; - guint32 fn_data_gen_O; - guint32 fn_data_gen_L; - guint32 gen; - guint32 fn_L; + uint32_t fn_O; + uint32_t fn_len_O; + uint32_t fn_len_L; + uint32_t fn_len; + uint32_t fn_data_O; + uint32_t fn_data_inode_O; + uint32_t fn_data_inode_L; + uint32_t inode; + uint32_t fn_data_gen_O; + uint32_t fn_data_gen_L; + uint32_t gen; + uint32_t fn_L; fn_O = nof; fn_len_O = fn_O; fn_len_L = 2; - fn_len = tvb_get_guint16(tvb, fn_len_O, encoding); + fn_len = tvb_get_uint16(tvb, fn_len_O, encoding); fn_data_O = fn_O + fn_len_L; fn_data_inode_O = fn_data_O + 2; fn_data_inode_L = 4; - inode = tvb_get_guint32(tvb, fn_data_inode_O, encoding); + inode = tvb_get_uint32(tvb, fn_data_inode_O, encoding); fn_data_gen_O = fn_data_inode_O + fn_data_inode_L; fn_data_gen_L = 4; - gen = tvb_get_guint32(tvb, fn_data_gen_O, encoding); + gen = tvb_get_uint32(tvb, fn_data_gen_O, encoding); fn_L = fn_len_L + fn_len; if (tree) { proto_item *fn_item = NULL; @@ -1559,30 +1576,30 @@ dissect_fhandle_data_SVR4(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree *tre /* exported file number */ { - guint32 xfn_O; - guint32 xfn_len_O; - guint32 xfn_len_L; - guint32 xfn_len; - guint32 xfn_data_O; - guint32 xfn_data_inode_O; - guint32 xfn_data_inode_L; - guint32 xinode; - guint32 xfn_data_gen_O; - guint32 xfn_data_gen_L; - guint32 xgen; - guint32 xfn_L; + uint32_t xfn_O; + uint32_t xfn_len_O; + uint32_t xfn_len_L; + uint32_t xfn_len; + uint32_t xfn_data_O; + uint32_t xfn_data_inode_O; + uint32_t xfn_data_inode_L; + uint32_t xinode; + uint32_t xfn_data_gen_O; + uint32_t xfn_data_gen_L; + uint32_t xgen; + uint32_t xfn_L; xfn_O = nof; xfn_len_O = xfn_O; xfn_len_L = 2; - xfn_len = tvb_get_guint16(tvb, xfn_len_O, encoding); + xfn_len = tvb_get_uint16(tvb, xfn_len_O, encoding); xfn_data_O = xfn_O + xfn_len_L; xfn_data_inode_O = xfn_data_O + 2; xfn_data_inode_L = 4; - xinode = tvb_get_guint32(tvb, xfn_data_inode_O, encoding); + xinode = tvb_get_uint32(tvb, xfn_data_inode_O, encoding); xfn_data_gen_O = xfn_data_inode_O + xfn_data_inode_L; xfn_data_gen_L = 4; - xgen = tvb_get_guint32(tvb, xfn_data_gen_O, encoding); + xgen = tvb_get_uint32(tvb, xfn_data_gen_O, encoding); xfn_L = xfn_len_L + xfn_len; if (tree) { @@ -1618,11 +1635,11 @@ dissect_fhandle_data_LINUX_KNFSD_LE(tvbuff_t* tvb, packet_info *pinfo _U_, proto { if (tree) { int offset = 0; - guint32 temp; - guint32 fsid_major; - guint32 fsid_minor; - guint32 xfsid_major; - guint32 xfsid_minor; + uint32_t temp; + uint32_t fsid_major; + uint32_t fsid_minor; + uint32_t xfsid_major; + uint32_t xfsid_minor; temp = tvb_get_letohs (tvb, offset+12); fsid_major = (temp >> 8) & 0xff; @@ -1668,7 +1685,7 @@ dissect_fhandle_data_LINUX_KNFSD_LE(tvbuff_t* tvb, packet_info *pinfo _U_, proto /* Checked with RedHat Linux 5.2 (nfs-server 2.2beta47 user-land nfsd) */ static int -dissect_fhandle_data_LINUX_NFSD_LE(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_) +dissect_fhandle_data_LINUX_NFSD_LE(tvbuff_t* tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { int offset = 0; @@ -1677,14 +1694,14 @@ dissect_fhandle_data_LINUX_NFSD_LE(tvbuff_t* tvb, packet_info *pinfo _U_, proto_ /* hash path */ { - guint32 hashlen; + uint32_t hashlen; - hashlen = tvb_get_guint8(tvb, offset+4); + hashlen = tvb_get_uint8(tvb, offset+4); if (tree) { proto_tree *hash_tree; hash_tree = proto_tree_add_subtree_format(tree, tvb, offset+4, hashlen + 1, ett_nfs_fh_hp, NULL, - "hash path: %s", tvb_bytes_to_str(wmem_packet_scope(), tvb, offset+5, hashlen)); + "hash path: %s", tvb_bytes_to_str(pinfo->pool, tvb, offset+5, hashlen)); proto_tree_add_uint(hash_tree, hf_nfs_fh_hp_len, tvb, offset+4, 1, hashlen); @@ -1711,11 +1728,11 @@ dissect_fhandle_data_NETAPP(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree *t }; if (tree) { - guint32 mount = tvb_get_letohl(tvb, offset + 0); + uint32_t mount = tvb_get_letohl(tvb, offset + 0); - guint32 inum = tvb_get_ntohl( tvb, offset + 12); - guint32 nfsexport = tvb_get_letohl(tvb, offset + 24); - guint32 export_snapgen = tvb_get_letohl(tvb, offset + 28); + uint32_t inum = tvb_get_ntohl( tvb, offset + 12); + uint32_t nfsexport = tvb_get_letohl(tvb, offset + 24); + uint32_t export_snapgen = tvb_get_letohl(tvb, offset + 28); proto_tree *subtree = NULL; @@ -1787,10 +1804,10 @@ dissect_fhandle_data_NETAPP_V4(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree { int offset = 0; proto_tree *subtree; - guint32 fileid; - guint32 handle_type; - guint32 inum; - guint encoding; + uint32_t fileid; + uint32_t handle_type; + uint32_t inum; + unsigned encoding; handle_type = tvb_get_ntohl(tvb, offset + 24); inum = tvb_get_ntohl(tvb, offset + 12); @@ -1800,7 +1817,7 @@ dissect_fhandle_data_NETAPP_V4(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree } else { encoding = ENC_LITTLE_ENDIAN; } - fileid = tvb_get_guint32(tvb, offset, encoding); + fileid = tvb_get_uint32(tvb, offset, encoding); subtree = proto_tree_add_subtree_format(tree, tvb, offset + 0, 8, ett_nfs4_fh_export, NULL, "export (inode %u)", fileid); proto_tree_add_item(subtree, hf_nfs_fh_export_fileid, tvb, offset + 0, 4, encoding); @@ -1837,8 +1854,8 @@ dissect_fhandle_data_NETAPP_GX_v3(tvbuff_t* tvb, packet_info *pinfo _U_, proto_t { if (tree) { proto_tree *field_tree; - guint8 flags; - guint32 offset = 0; + uint8_t flags; + uint32_t offset = 0; static int * const fh_flags[] = { &hf_nfs3_gxfh_sfhflags_resv1, &hf_nfs3_gxfh_sfhflags_resv2, @@ -1878,7 +1895,7 @@ dissect_fhandle_data_NETAPP_GX_v3(tvbuff_t* tvb, packet_info *pinfo _U_, proto_t /* = epoch = */ proto_tree_add_item(tree, hf_nfs3_gxfh_epoch, tvb, offset+2, 2, ENC_LITTLE_ENDIAN); /* = spin file handle = */ - flags = tvb_get_guint8(tvb, offset+11); + flags = tvb_get_uint8(tvb, offset+11); field_tree = proto_tree_add_subtree(tree, tvb, offset+4, 16, ett_nfs3_gxfh_sfhfield, NULL, " spin file handle"); @@ -1898,7 +1915,7 @@ dissect_fhandle_data_NETAPP_GX_v3(tvbuff_t* tvb, packet_info *pinfo _U_, proto_t proto_tree_add_item(field_tree, hf_nfs3_gxfh_spinfuid, tvb, offset+16, 4, ENC_LITTLE_ENDIAN); /* = spin file handle (mount point) = */ - flags = tvb_get_guint8(tvb, offset+27); + flags = tvb_get_uint8(tvb, offset+27); field_tree = proto_tree_add_subtree(tree, tvb, offset+20, 16, ett_nfs3_gxfh_sfhfield, NULL, " spin (mount point) file handle"); @@ -1954,10 +1971,10 @@ static int dissect_fhandle_data_LINUX_KNFSD_NEW(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_) { int offset = 0; - guint32 version; - guint8 auth_type = 0; - guint8 fsid_type; - guint8 fileid_type; + uint32_t version; + uint8_t auth_type = 0; + uint8_t fsid_type; + uint8_t fileid_type; proto_tree *fileid_tree; proto_item *fileid_item; @@ -1965,9 +1982,9 @@ dissect_fhandle_data_LINUX_KNFSD_NEW(tvbuff_t* tvb, packet_info *pinfo _U_, prot switch (version) { case 1: - auth_type = tvb_get_guint8(tvb, offset + 1); - fsid_type = tvb_get_guint8(tvb, offset + 2); - fileid_type = tvb_get_guint8(tvb, offset + 3); + auth_type = tvb_get_uint8(tvb, offset + 1); + fsid_type = tvb_get_uint8(tvb, offset + 2); + fileid_type = tvb_get_uint8(tvb, offset + 3); if (tree) { proto_tree *encoding_tree = proto_tree_add_subtree_format(tree, tvb, offset + 1, 3, @@ -2002,9 +2019,9 @@ dissect_fhandle_data_LINUX_KNFSD_NEW(tvbuff_t* tvb, packet_info *pinfo _U_, prot } { - guint16 fsid_major; - guint16 fsid_minor; - guint32 fsid_inode; + uint16_t fsid_major; + uint16_t fsid_minor; + uint32_t fsid_inode; fsid_major = tvb_get_ntohs(tvb, offset + 0); fsid_minor = tvb_get_ntohs(tvb, offset + 2); @@ -2034,8 +2051,8 @@ dissect_fhandle_data_LINUX_KNFSD_NEW(tvbuff_t* tvb, packet_info *pinfo _U_, prot proto_item_append_text(fileid_item, ": root inode"); } break; case 1: { - guint32 inode; - guint32 generation; + uint32_t inode; + uint32_t generation; inode = tvb_get_letohl(tvb, offset + 0); generation = tvb_get_letohl(tvb, offset + 4); @@ -2053,8 +2070,8 @@ dissect_fhandle_data_LINUX_KNFSD_NEW(tvbuff_t* tvb, packet_info *pinfo _U_, prot /*offset += 8;*/ } break; case 2: { - guint32 inode; - guint32 generation; + uint32_t inode; + uint32_t generation; inode = tvb_get_letohl(tvb, offset + 0); generation = tvb_get_letohl(tvb, offset + 4); @@ -2088,10 +2105,10 @@ dissect_fhandle_data_LINUX_KNFSD_NEW(tvbuff_t* tvb, packet_info *pinfo _U_, prot * The filehandle is always 32 bytes and first 4 bytes of ident ":OGL" */ static int -dissect_fhandle_data_GLUSTER(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_) +dissect_fhandle_data_GLUSTER(tvbuff_t* tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { - guint16 offset=0; - guint16 fhlen; + uint16_t offset=0; + uint16_t fhlen; char *ident; if (!tree) @@ -2101,7 +2118,7 @@ dissect_fhandle_data_GLUSTER(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree * if (fhlen != 36) return tvb_captured_length(tvb); - ident = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, 4, ENC_ASCII); + ident = tvb_get_string_enc(pinfo->pool, tvb, offset, 4, ENC_ASCII); if (strncmp(":OGL", ident, 4)) return 4; offset += 4; @@ -2139,9 +2156,9 @@ static int dissect_fhandle_data_DCACHE(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_) { int offset = 0; - guint32 version; - guint32 magic; - guint8 obj_len; + uint32_t version; + uint32_t magic; + uint8_t obj_len; if (!tree) return tvb_captured_length(tvb); @@ -2158,23 +2175,23 @@ dissect_fhandle_data_DCACHE(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree *t proto_tree_add_item(tree, hf_nfs_fh_generation, tvb, offset+4, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_nfs_fh_dc_exportid, tvb, offset+8, 4, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_nfs_fh_dc_handle_type, tvb, offset+15, 1, ENC_BIG_ENDIAN); - obj_len = tvb_get_guint8(tvb, offset + 16); + obj_len = tvb_get_uint8(tvb, offset + 16); proto_tree_add_item(tree, hf_nfs_fh_dc_opaque, tvb, offset + 17, obj_len, ENC_NA); return tvb_captured_length(tvb); } #define PD_VERSION_MASK 0xf0000000 #define PD_RESERVED_MASK 0x0ffffffF -#define PD_INUM_MASK G_GUINT64_CONSTANT(0x0007ffffffffffff) -#define PD_SITEID_MASK G_GUINT64_CONSTANT(0xfff8000000000000) -#define PD_SNAPID_MASK G_GUINT64_CONSTANT(0x0000000000001fff) -#define PD_CONTAINER_MASK G_GUINT64_CONSTANT(0xffffffffffffe000) +#define PD_INUM_MASK UINT64_C(0x0007ffffffffffff) +#define PD_SITEID_MASK UINT64_C(0xfff8000000000000) +#define PD_SNAPID_MASK UINT64_C(0x0000000000001fff) +#define PD_CONTAINER_MASK UINT64_C(0xffffffffffffe000) static int dissect_fhandle_data_PRIMARY_DATA(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_) { int offset = 0; - guint32 version; + uint32_t version; static int * const fh_flags[] = { &hf_nfs4_fh_pd_flags_version, @@ -2224,9 +2241,9 @@ dissect_fhandle_data_PRIMARY_DATA(tvbuff_t* tvb, packet_info *pinfo _U_, proto_t static int dissect_fhandle_data_CELERRA_VNX(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_) { - guint16 offset = 0; - guint16 fhlen; - guint32 obj_id; + uint16_t offset = 0; + uint16_t fhlen; + uint32_t obj_id; fhlen = tvb_reported_length(tvb); @@ -2325,7 +2342,7 @@ dissect_fhandle_data_CELERRA_VNX(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tr static int dissect_fhandle_data_unknown(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_) { - guint fhlen = tvb_reported_length(tvb); + unsigned fhlen = tvb_reported_length(tvb); proto_tree_add_item(tree, hf_nfs_fh_fhandle_data, tvb, 0, fhlen, ENC_NA); return tvb_captured_length(tvb); @@ -2334,7 +2351,7 @@ dissect_fhandle_data_unknown(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree * static void dissect_fhandle_data(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, - unsigned int fhlen, gboolean hidden, guint32 *hash) + unsigned int fhlen, bool hidden, uint32_t *hash) { /* this is to set up fhandle display filters to find both packets of an RPC call */ @@ -2362,7 +2379,7 @@ dissect_fhandle_data(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree * /* Create a unique hash value for the filehandle using CRC32 */ { - guint32 fhhash; + uint32_t fhhash; proto_item *fh_item = NULL; fhhash = crc32_ccitt_tvb_offset(tvb, offset, fhlen); @@ -2406,7 +2423,7 @@ dissect_fhandle_hidden(packet_info *pinfo, proto_tree *tree, int frame) /* There's no need to call add_new_data_source() since dissect_fhandle(), in the 'hidden' case, never refers to the tvb when displaying a field based on the tvb */ - dissect_fhandle_data(tvb, 0, pinfo, tree, nfd->len, TRUE, NULL); + dissect_fhandle_data(tvb, 0, pinfo, tree, nfd->len, true, NULL); tvb_free(tvb); } } @@ -2499,9 +2516,9 @@ static value_string_ext names_nfs2_stat_ext = VALUE_STRING_EXT_INIT(names_nfs2_s /* NFSv2 RFC 1094, Page 12..14 */ static int -dissect_nfs2_status(tvbuff_t *tvb, int offset, proto_tree *tree, guint32 *status) +dissect_nfs2_status(tvbuff_t *tvb, int offset, proto_tree *tree, uint32_t *status) { - guint32 stat; + uint32_t stat; proto_item *stat_item; proto_tree_add_item_ret_uint(tree, hf_nfs2_status, tvb, offset+0, 4, ENC_BIG_ENDIAN, &stat); @@ -2521,7 +2538,7 @@ dissect_nfs2_status(tvbuff_t *tvb, int offset, proto_tree *tree, guint32 *status static int dissect_nfs2_rmdir_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { - guint32 status; + uint32_t status; const char *err; int offset = 0; @@ -2543,7 +2560,7 @@ dissect_nfs2_rmdir_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree static int dissect_nfs2_symlink_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { - guint32 status; + uint32_t status; const char *err; int offset = 0; @@ -2565,7 +2582,7 @@ dissect_nfs2_symlink_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tr static int dissect_nfs2_link_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { - guint32 status; + uint32_t status; const char *err; int offset = 0; @@ -2587,7 +2604,7 @@ dissect_nfs2_link_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, static int dissect_nfs2_rename_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { - guint32 status; + uint32_t status; const char *err; int offset = 0; @@ -2609,7 +2626,7 @@ dissect_nfs2_rename_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tre static int dissect_nfs2_remove_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { - guint32 status; + uint32_t status; const char *err; int offset = 0; @@ -2653,7 +2670,7 @@ dissect_nfs2_ftype(tvbuff_t *tvb, int offset, proto_tree *tree) /* NFSv2 RFC 1094, Page 15 */ int dissect_fhandle(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, - const char *name, guint32 *hash, rpc_call_info_value *civ) + const char *name, uint32_t *hash, rpc_call_info_value *civ) { proto_tree *ftree; @@ -2685,7 +2702,7 @@ dissect_fhandle(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, } } - dissect_fhandle_data(tvb, offset, pinfo, ftree, FHSIZE, FALSE, hash); + dissect_fhandle_data(tvb, offset, pinfo, ftree, FHSIZE, false, hash); offset += FHSIZE; return offset; @@ -2696,7 +2713,7 @@ dissect_fhandle(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, static int dissect_nfs2_statfs_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 hash; + uint32_t hash; int offset = 0; offset = dissect_fhandle(tvb, offset, pinfo, tree, "object", &hash, (rpc_call_info_value*)data); @@ -2711,7 +2728,7 @@ dissect_nfs2_statfs_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo static int dissect_nfs2_readlink_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 hash; + uint32_t hash; int offset = 0; offset = dissect_fhandle(tvb, offset, pinfo, tree, "object", &hash, (rpc_call_info_value*)data); @@ -2726,7 +2743,7 @@ dissect_nfs2_readlink_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, static int dissect_nfs2_getattr_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 hash; + uint32_t hash; int offset = 0; offset = dissect_fhandle(tvb, offset, pinfo, tree, "object", &hash, (rpc_call_info_value*)data); @@ -2747,8 +2764,8 @@ dissect_timeval(tvbuff_t *tvb, int offset, proto_tree *tree, int hf_time, int hf if (tree) { proto_item *time_item; proto_tree *time_tree; - guint32 seconds; - guint32 useconds; + uint32_t seconds; + uint32_t useconds; nstime_t ts; seconds = tvb_get_ntohl(tvb, offset+0); @@ -2772,12 +2789,12 @@ dissect_timeval(tvbuff_t *tvb, int offset, proto_tree *tree, int hf_time, int hf /* NFSv2 RFC 1094, Page 16 */ static const value_string nfs2_mode_names[] = { - { 0040000, "Directory" }, - { 0020000, "Character Special Device" }, - { 0060000, "Block Special Device" }, - { 0100000, "Regular File" }, - { 0120000, "Symbolic Link" }, - { 0140000, "Named Socket" }, + { 1, "Directory" }, + { 2, "Character Special Device" }, + { 3, "Block Special Device" }, + { 4, "Regular File" }, + { 5, "Symbolic Link" }, + { 6, "Named Socket" }, { 0000000, NULL } }; @@ -2942,7 +2959,7 @@ dissect_path(tvbuff_t *tvb, int offset, proto_tree *tree, int hf, const char **n static int dissect_attrstat(tvbuff_t *tvb, int offset, proto_tree *tree, packet_info *pinfo, const char *funcname) { - guint32 status; + uint32_t status; const char *err; offset = dissect_nfs2_status(tvb, offset, tree, &status); @@ -2989,7 +3006,7 @@ dissect_nfs2_getattr_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tr /* NFSv2 RFC 1094, Page 18 */ static int dissect_diropargs(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, - const char *label, guint32 *hash, const char **name, rpc_call_info_value *civ) + const char *label, uint32_t *hash, const char **name, rpc_call_info_value *civ) { proto_item *diropargs_item; proto_tree *diropargs_tree; @@ -3027,7 +3044,7 @@ dissect_diropargs(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tre static int dissect_nfs2_rmdir_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 hash; + uint32_t hash; const char *name = NULL; int offset = 0; @@ -3044,7 +3061,7 @@ dissect_nfs2_rmdir_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi static int dissect_nfs2_remove_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 hash; + uint32_t hash; const char *name = NULL; int offset = 0; @@ -3061,7 +3078,7 @@ dissect_nfs2_remove_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo static int dissect_nfs2_lookup_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 hash; + uint32_t hash; const char *name = NULL; int offset = 0; @@ -3079,8 +3096,8 @@ static int dissect_diropres(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, const char *funcname, rpc_call_info_value* civ) { - guint32 status; - guint32 hash; + uint32_t status; + uint32_t hash; const char *err; offset = dissect_nfs2_status(tvb, offset, tree, &status); @@ -3141,7 +3158,7 @@ static int dissect_nfs2_setattr_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 hash; + uint32_t hash; int offset = 0; offset = dissect_fhandle(tvb, offset, pinfo, tree, "file", &hash, (rpc_call_info_value*)data); @@ -3158,7 +3175,7 @@ static int dissect_nfs2_readlink_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { - guint32 status; + uint32_t status; const char *err; const char *name = NULL; int offset = 0; @@ -3186,10 +3203,10 @@ static int dissect_nfs2_read_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 offset_value; - guint32 count; - guint32 totalcount; - guint32 hash; + uint32_t offset_value; + uint32_t count; + uint32_t totalcount; + uint32_t hash; int offset = 0; offset = dissect_fhandle(tvb, offset, pinfo, tree, "file", &hash, (rpc_call_info_value*)data); @@ -3215,7 +3232,7 @@ static int dissect_nfs2_read_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { - guint32 status; + uint32_t status; const char *err; int offset = 0; @@ -3242,10 +3259,10 @@ static int dissect_nfs2_write_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 beginoffset; - guint32 offset_value; - guint32 totalcount; - guint32 hash; + uint32_t beginoffset; + uint32_t offset_value; + uint32_t totalcount; + uint32_t hash; int offset = 0; offset = dissect_fhandle(tvb, offset, pinfo, tree, "file", &hash, (rpc_call_info_value*)data); @@ -3274,7 +3291,7 @@ static int dissect_nfs2_mkdir_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 hash; + uint32_t hash; const char *name = NULL; int offset = 0; @@ -3291,7 +3308,7 @@ static int dissect_nfs2_create_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 hash; + uint32_t hash; const char *name = NULL; int offset = 0; @@ -3310,9 +3327,9 @@ static int dissect_nfs2_rename_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 from_hash; + uint32_t from_hash; const char *from_name = NULL; - guint32 to_hash; + uint32_t to_hash; const char *to_name = NULL; int offset = 0; @@ -3333,8 +3350,8 @@ static int dissect_nfs2_link_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 from_hash; - guint32 to_hash; + uint32_t from_hash; + uint32_t to_hash; const char *to_name = NULL; int offset = 0; @@ -3355,7 +3372,7 @@ static int dissect_nfs2_symlink_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 from_hash; + uint32_t from_hash; const char *from_name = NULL; const char *to_name = NULL; int offset = 0; @@ -3378,7 +3395,7 @@ static int dissect_nfs2_readdir_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 hash; + uint32_t hash; int offset = 0; offset = dissect_fhandle(tvb, offset, pinfo, tree, "dir", &hash, (rpc_call_info_value*)data); @@ -3402,7 +3419,7 @@ dissect_readdir_entry(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_item *entry_item = NULL; proto_tree *entry_tree = NULL; int old_offset = offset; - guint32 fileid; + uint32_t fileid; const char *name; if (tree) { @@ -3437,8 +3454,8 @@ static int dissect_nfs2_readdir_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { - guint32 status; - guint32 eof_value; + uint32_t status; + uint32_t eof_value; const char *err; int offset = 0; @@ -3469,7 +3486,7 @@ static int dissect_nfs2_statfs_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { - guint32 status; + uint32_t status; const char *err; int offset = 0; @@ -3616,7 +3633,7 @@ dissect_nfs3_write_verf(tvbuff_t *tvb, int offset, proto_tree *tree) /* RFC 1813, Page 16 */ static int -dissect_nfs3_mode(tvbuff_t *tvb, int offset, proto_tree *tree, guint32 *mode) +dissect_nfs3_mode(tvbuff_t *tvb, int offset, proto_tree *tree, uint32_t *mode) { static int * const mode_bits[] = { &hf_nfs3_mode_suid, @@ -3684,9 +3701,9 @@ static value_string_ext names_nfs3_status_ext = VALUE_STRING_EXT_INIT(names_nfs_ /* NFSv3 RFC 1813, Page 16 */ static int -dissect_nfs3_status(tvbuff_t *tvb, int offset, proto_tree *tree, guint32 *status) +dissect_nfs3_status(tvbuff_t *tvb, int offset, proto_tree *tree, uint32_t *status) { - guint32 nfsstat3; + uint32_t nfsstat3; nfsstat3 = tvb_get_ntohl(tvb, offset+0); @@ -3719,9 +3736,9 @@ static value_string_ext names_nfs_ftype3_ext = VALUE_STRING_EXT_INIT(names_nfs_f /* NFSv3 RFC 1813, Page 20 */ static int dissect_ftype3(tvbuff_t *tvb, int offset, proto_tree *tree, int hf, - guint32* ftype3) + uint32_t* ftype3) { - guint32 type; + uint32_t type; proto_tree_add_item_ret_uint(tree, hf, tvb, offset, 4, ENC_BIG_ENDIAN, &type); @@ -3735,8 +3752,8 @@ dissect_ftype3(tvbuff_t *tvb, int offset, proto_tree *tree, int hf, static int dissect_nfs3_specdata(tvbuff_t *tvb, int offset, proto_tree *tree, const char *name) { - guint32 specdata1; - guint32 specdata2; + uint32_t specdata1; + uint32_t specdata2; specdata1 = tvb_get_ntohl(tvb, offset+0); specdata2 = tvb_get_ntohl(tvb, offset+4); @@ -3759,11 +3776,11 @@ dissect_nfs3_specdata(tvbuff_t *tvb, int offset, proto_tree *tree, const char *n /* NFSv3 RFC 1813, Page 21 */ int dissect_nfs3_fh(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, - const char *name, guint32 *hash, rpc_call_info_value *civ) + const char *name, uint32_t *hash, rpc_call_info_value *civ) { - guint fh3_len; - guint fh3_len_full; - /*guint fh3_fill;*/ + unsigned fh3_len; + unsigned fh3_len_full; + /*unsigned fh3_fill;*/ proto_tree *ftree; int fh_offset, fh_length; @@ -3809,7 +3826,7 @@ dissect_nfs3_fh(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, /* Handle WebNFS requests where filehandle may be 0 length */ if (fh3_len > 0) { - dissect_fhandle_data(tvb, offset+4, pinfo, ftree, fh3_len, FALSE, hash); + dissect_fhandle_data(tvb, offset+4, pinfo, ftree, fh3_len, false, hash); offset += fh3_len_full; } @@ -3830,8 +3847,8 @@ static int dissect_nfstime3(tvbuff_t *tvb, int offset, proto_tree *tree, int hf_time, int hf_time_sec, int hf_time_nsec) { - guint32 seconds; - guint32 nseconds; + uint32_t seconds; + uint32_t nseconds; nstime_t ts; seconds = tvb_get_ntohl(tvb, offset+0); @@ -3866,12 +3883,12 @@ dissect_nfstime3(tvbuff_t *tvb, int offset, proto_tree *tree, int hf_time, */ static int dissect_nfs_fattr3(packet_info *pinfo, tvbuff_t *tvb, int offset, - proto_tree *tree, const char *name, guint32 levels) + proto_tree *tree, const char *name, uint32_t levels) { proto_item *fattr3_item = NULL; proto_tree *fattr3_tree = NULL; int old_offset = offset; - guint32 type, mode, uid, gid; + uint32_t type, mode, uid, gid; fattr3_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_nfs3_fattr, &fattr3_item, name); @@ -3963,7 +3980,7 @@ dissect_nfs3_post_op_attr(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_t proto_item *post_op_attr_item; proto_tree *post_op_attr_tree; int old_offset = offset; - guint32 attributes_follow = 0; + uint32_t attributes_follow = 0; attributes_follow = tvb_get_ntohl(tvb, offset+0); @@ -3974,12 +3991,12 @@ dissect_nfs3_post_op_attr(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_t offset += 4; switch (attributes_follow) { - case TRUE: + case true: offset = dissect_nfs_fattr3(pinfo, tvb, offset, post_op_attr_tree, "attributes", 2); break; - case FALSE: + case false: /* void */ break; } @@ -4022,7 +4039,7 @@ dissect_pre_op_attr(tvbuff_t *tvb, int offset, proto_tree *tree, const char *nam proto_item *pre_op_attr_item; proto_tree *pre_op_attr_tree; int old_offset = offset; - guint32 attributes_follow; + uint32_t attributes_follow; pre_op_attr_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_nfs3_pre_op_attr, &pre_op_attr_item, name); @@ -4030,11 +4047,11 @@ dissect_pre_op_attr(tvbuff_t *tvb, int offset, proto_tree *tree, const char *nam proto_tree_add_item_ret_uint(pre_op_attr_tree, hf_nfs3_attributes_follow, tvb, offset, 4, ENC_BIG_ENDIAN, &attributes_follow); offset += 4; switch (attributes_follow) { - case TRUE: + case true: offset = dissect_wcc_attr(tvb, offset, pre_op_attr_tree, "attributes"); break; - case FALSE: + case false: /* void */ break; } @@ -4075,7 +4092,7 @@ dissect_nfs3_post_op_fh(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_item *post_op_fh3_item; proto_tree *post_op_fh3_tree; int old_offset = offset; - guint32 handle_follows; + uint32_t handle_follows; post_op_fh3_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_nfs3_post_op_fh, &post_op_fh3_item, name); @@ -4083,11 +4100,11 @@ dissect_nfs3_post_op_fh(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree_add_item_ret_uint(post_op_fh3_tree, hf_nfs3_handle_follow, tvb, offset, 4, ENC_BIG_ENDIAN, &handle_follows); offset += 4; switch (handle_follows) { - case TRUE: + case true: offset = dissect_nfs3_fh(tvb, offset, pinfo, post_op_fh3_tree, "handle", NULL, civ); break; - case FALSE: + case false: /* void */ break; } @@ -4108,7 +4125,7 @@ dissect_set_mode3(tvbuff_t *tvb, int offset, proto_tree *tree, const char *name) proto_item *set_mode3_item; proto_tree *set_mode3_tree; int old_offset = offset; - guint32 set_it; + uint32_t set_it; const char *set_it_name; set_it = tvb_get_ntohl(tvb, offset+0); @@ -4145,7 +4162,7 @@ dissect_set_uid3(tvbuff_t *tvb, int offset, proto_tree *tree, const char *name) proto_item *set_uid3_item; proto_tree *set_uid3_tree; int old_offset = offset; - guint32 set_it; + uint32_t set_it; const char *set_it_name; set_it = tvb_get_ntohl(tvb, offset+0); @@ -4181,7 +4198,7 @@ dissect_set_gid3(tvbuff_t *tvb, int offset, proto_tree *tree, const char *name) proto_item *set_gid3_item; proto_tree *set_gid3_tree; int old_offset = offset; - guint32 set_it; + uint32_t set_it; const char *set_it_name; set_it = tvb_get_ntohl(tvb, offset+0); @@ -4218,7 +4235,7 @@ dissect_set_size3(tvbuff_t *tvb, int offset, proto_tree *tree, const char *name) proto_item *set_size3_item; proto_tree *set_size3_tree; int old_offset = offset; - guint32 set_it; + uint32_t set_it; const char *set_it_name; set_it = tvb_get_ntohl(tvb, offset+0); @@ -4269,7 +4286,7 @@ dissect_set_atime(tvbuff_t *tvb, int offset, proto_tree *tree, const char *name) proto_item *set_atime_item; proto_tree *set_atime_tree; int old_offset = offset; - guint32 set_it; + uint32_t set_it; const char *set_it_name; set_it = tvb_get_ntohl(tvb, offset+0); @@ -4306,7 +4323,7 @@ dissect_set_mtime(tvbuff_t *tvb, int offset, proto_tree *tree, const char *name) proto_item *set_mtime_item; proto_tree *set_mtime_tree; int old_offset = offset; - guint32 set_it; + uint32_t set_it; const char *set_it_name; set_it = tvb_get_ntohl(tvb, offset+0); @@ -4364,7 +4381,7 @@ dissect_nfs3_sattr(tvbuff_t *tvb, int offset, proto_tree *tree, const char *name /* NFSv3 RFC 1813, Page 27 */ static int dissect_diropargs3(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, - const char *label, guint32 *hash, const char **name, rpc_call_info_value *civ) + const char *label, uint32_t *hash, const char **name, rpc_call_info_value *civ) { proto_item *diropargs3_item; proto_tree *diropargs3_tree; @@ -4409,7 +4426,7 @@ static int dissect_nfs3_remove_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 hash = 0; + uint32_t hash = 0; const char *name = NULL; int offset = 0; @@ -4446,7 +4463,7 @@ static int dissect_nfs3_rmdir_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 hash = 0; + uint32_t hash = 0; const char *name = NULL; int offset = 0; @@ -4464,7 +4481,7 @@ static int dissect_nfs3_getattr_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 hash = 0; + uint32_t hash = 0; int offset = 0; offset = dissect_nfs3_fh(tvb, offset, pinfo, tree, "object", &hash, (rpc_call_info_value*)data); @@ -4481,7 +4498,7 @@ static int dissect_nfs3_getattr_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { - guint32 status; + uint32_t status; const char *err; int offset = 0; @@ -4510,7 +4527,7 @@ dissect_sattrguard3(tvbuff_t *tvb, int offset, proto_tree *tree, const char *nam proto_item *sattrguard3_item; proto_tree *sattrguard3_tree; int old_offset = offset; - guint32 check; + uint32_t check; const char *check_name; check = tvb_get_ntohl(tvb, offset+0); @@ -4526,11 +4543,11 @@ dissect_sattrguard3(tvbuff_t *tvb, int offset, proto_tree *tree, const char *nam offset += 4; switch (check) { - case TRUE: + case true: offset = dissect_nfstime3(tvb, offset, sattrguard3_tree, hf_nfs_ctime, hf_nfs_ctime_sec, hf_nfs_ctime_nsec); break; - case FALSE: + case false: /* void */ break; } @@ -4547,7 +4564,7 @@ static int dissect_nfs3_setattr_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 hash = 0; + uint32_t hash = 0; int offset = 0; offset = dissect_nfs3_fh (tvb, offset, pinfo, tree, "object", &hash, (rpc_call_info_value*)data); @@ -4566,7 +4583,7 @@ static int dissect_nfs3_setattr_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { - guint32 status; + uint32_t status; const char *err; int offset = 0; @@ -4594,7 +4611,7 @@ static int dissect_nfs3_lookup_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 hash = 0; + uint32_t hash = 0; const char *name = NULL; int offset = 0; @@ -4612,9 +4629,9 @@ static int dissect_nfs3_lookup_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 status; + uint32_t status; const char *err; - guint32 hash = 0; + uint32_t hash = 0; int offset = 0; offset = dissect_nfs3_status(tvb, offset, tree, &status); @@ -4661,13 +4678,13 @@ static const true_false_string tfs_access_rights = {"allowed", "*Access Denied*" proto_tree* display_access_items(tvbuff_t* tvb, int offset, packet_info* pinfo, proto_tree *tree, - guint32 amask, char mtype, int version, wmem_strbuf_t* optext, const char *label) + uint32_t amask, char mtype, int version, wmem_strbuf_t* optext, const char *label) { - gboolean nfsv3 = ((version == 3) ? TRUE : FALSE); + bool nfsv3 = ((version == 3) ? true : false); proto_item *access_item = NULL; proto_tree *access_subtree = NULL; proto_item *access_subitem = NULL; - guint32 itype; + uint32_t itype; /* XXX Legend (delete if desired) @@ -4788,29 +4805,29 @@ int dissect_access_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int version, wmem_strbuf_t *optext, rpc_call_info_value *civ) { - guint32 *acc_req; - guint32 acc_supp; - guint32 acc_rights; - guint32 mask_not_supp; - guint32 mask_denied; - guint32 mask_allowed; - guint32 e_check, e_rights; - gboolean nfsv3 = ((version == 3) ? TRUE : FALSE); - gboolean nfsv4 = ((version == 4) ? TRUE : FALSE); - gboolean have_acc_supp = TRUE; + uint32_t *acc_req; + uint32_t acc_supp; + uint32_t acc_rights; + uint32_t mask_not_supp; + uint32_t mask_denied; + uint32_t mask_allowed; + uint32_t e_check, e_rights; + bool nfsv3 = ((version == 3) ? true : false); + bool nfsv4 = ((version == 4) ? true : false); + bool have_acc_supp = true; proto_tree *access_tree; proto_item *ditem; /* Retrieve the access mask from the call if available. It will not be available if the packet containing the call is missing or truncated. */ - acc_req = (guint32 *)civ->private_data; + acc_req = (uint32_t *)civ->private_data; if (nfsv4) { acc_supp = tvb_get_ntohl(tvb, offset+0); } else if (acc_req) { acc_supp = *acc_req; } else { - have_acc_supp = FALSE; + have_acc_supp = false; } /* V3/V4 - Get access rights mask and create a subtree for it */ acc_rights = tvb_get_ntohl(tvb, (nfsv3 ? offset+0: offset+4)); @@ -4855,7 +4872,7 @@ dissect_access_reply(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree * (mask_allowed | mask_denied), 'R', version, optext, NULL) ; ditem = proto_tree_add_boolean(access_tree, hf_nfs_access_denied, tvb, - offset, 4, (mask_denied > 0 ? TRUE : FALSE )); + offset, 4, (mask_denied > 0 ? true : false )); proto_item_set_generated(ditem); return offset+4; @@ -4867,14 +4884,14 @@ static int dissect_nfs3_access_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { int offset = 0; - guint32 fhhash = 0, *acc_request, amask; + uint32_t fhhash = 0, *acc_request, amask; rpc_call_info_value *civ = (rpc_call_info_value*)data; offset = dissect_nfs3_fh(tvb, offset, pinfo, tree, "object", &fhhash, civ); /* Get access mask to check and save it for comparison to the access reply. */ amask = tvb_get_ntohl(tvb, offset); - acc_request = (guint32 *)wmem_memdup(wmem_file_scope(), &amask, sizeof(guint32)); + acc_request = (uint32_t *)wmem_memdup(wmem_file_scope(), &amask, sizeof(uint32_t)); civ->private_data = acc_request; /* Append filehandle to Info column and main tree header */ @@ -4893,7 +4910,7 @@ static int dissect_nfs3_access_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { - guint32 status; + uint32_t status; const char *err; int offset = 0; @@ -4918,7 +4935,7 @@ static int dissect_nfs3_readlink_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 hash = 0; + uint32_t hash = 0; int offset = 0; offset = dissect_nfs3_fh(tvb, offset, pinfo, tree, "object", &hash, (rpc_call_info_value*)data); @@ -4934,7 +4951,7 @@ static int dissect_nfs3_readlink_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { - guint32 status; + uint32_t status; const char *err; const char *name = NULL; int offset = 0; @@ -4969,9 +4986,9 @@ static int dissect_nfs3_read_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint64 off; - guint32 len; - guint32 hash = 0; + uint64_t off; + uint32_t len; + uint32_t hash = 0; int offset = 0; offset = dissect_nfs3_fh(tvb, offset, pinfo, tree, "file", &hash, (rpc_call_info_value*)data); @@ -4997,8 +5014,8 @@ static int dissect_nfs3_read_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { - guint32 status; - guint32 len; + uint32_t status; + uint32_t len; const char *err; int offset = 0; @@ -5052,10 +5069,10 @@ dissect_stable_how(tvbuff_t *tvb, int offset, proto_tree *tree, int hfindex) static int dissect_nfs3_write_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint64 off; - guint32 len; - guint32 stable; - guint32 hash = 0; + uint64_t off; + uint32_t len; + uint32_t stable; + uint32_t hash = 0; int offset = 0; offset = dissect_nfs3_fh(tvb, offset, pinfo, tree, "file", &hash, (rpc_call_info_value*)data); @@ -5084,9 +5101,9 @@ dissect_nfs3_write_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi static int dissect_nfs3_write_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { - guint32 status; - guint32 len; - guint32 stable; + uint32_t status; + uint32_t len; + uint32_t stable; const char *err; int offset = 0; @@ -5130,9 +5147,9 @@ static const value_string names_createmode3[] = { /* NFSv3 RFC 1813, Page 54 */ static int -dissect_createmode3(tvbuff_t *tvb, int offset, proto_tree *tree, guint32* mode) +dissect_createmode3(tvbuff_t *tvb, int offset, proto_tree *tree, uint32_t* mode) { - guint32 mode_value; + uint32_t mode_value; mode_value = tvb_get_ntohl(tvb, offset + 0); if (tree) @@ -5148,8 +5165,8 @@ dissect_createmode3(tvbuff_t *tvb, int offset, proto_tree *tree, guint32* mode) static int dissect_nfs3_create_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 mode; - guint32 hash = 0; + uint32_t mode; + uint32_t hash = 0; const char *name = NULL; int offset = 0; @@ -5178,7 +5195,7 @@ dissect_nfs3_create_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo static int dissect_nfs3_create_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 status; + uint32_t status; const char *err; int offset = 0; @@ -5208,7 +5225,7 @@ dissect_nfs3_create_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v static int dissect_nfs3_mkdir_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 hash = 0; + uint32_t hash = 0; const char *name = NULL; int offset = 0; @@ -5225,7 +5242,7 @@ dissect_nfs3_mkdir_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi static int dissect_nfs3_mkdir_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 status; + uint32_t status; const char *err; int offset = 0; @@ -5255,7 +5272,7 @@ dissect_nfs3_mkdir_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo static int dissect_nfs3_symlink_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 from_hash = 0; + uint32_t from_hash = 0; const char *from_name = NULL; const char *to_name = NULL; int offset = 0; @@ -5276,7 +5293,7 @@ dissect_nfs3_symlink_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v static int dissect_nfs3_symlink_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 status; + uint32_t status; const char *err; int offset = 0; @@ -5306,8 +5323,8 @@ dissect_nfs3_symlink_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, static int dissect_nfs3_mknod_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 type; - guint32 hash = 0; + uint32_t type; + uint32_t hash = 0; const char *name = NULL; const char *type_str; int offset = 0; @@ -5340,7 +5357,7 @@ dissect_nfs3_mknod_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi static int dissect_nfs3_mknod_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 status; + uint32_t status; const char *err; int offset = 0; @@ -5370,7 +5387,7 @@ dissect_nfs3_mknod_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo static int dissect_nfs3_remove_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { - guint32 status; + uint32_t status; const char *err; int offset = 0; @@ -5395,7 +5412,7 @@ dissect_nfs3_remove_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tre static int dissect_nfs3_rmdir_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { - guint32 status; + uint32_t status; const char *err; int offset = 0; @@ -5421,9 +5438,9 @@ dissect_nfs3_rmdir_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree static int dissect_nfs3_rename_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 from_hash = 0; + uint32_t from_hash = 0; const char *from_name = NULL; - guint32 to_hash = 0; + uint32_t to_hash = 0; const char *to_name = NULL; int offset = 0; @@ -5444,7 +5461,7 @@ static int dissect_nfs3_rename_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { - guint32 status; + uint32_t status; const char *err; int offset = 0; @@ -5473,8 +5490,8 @@ dissect_nfs3_rename_reply(tvbuff_t *tvb, packet_info *pinfo _U_, static int dissect_nfs3_link_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 from_hash = 0; - guint32 to_hash = 0; + uint32_t from_hash = 0; + uint32_t to_hash = 0; const char *to_name = NULL; int offset = 0; @@ -5494,7 +5511,7 @@ dissect_nfs3_link_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void static int dissect_nfs3_link_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { - guint32 status; + uint32_t status; const char *err; int offset = 0; @@ -5525,7 +5542,7 @@ dissect_nfs3_link_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, static int dissect_nfs3_readdir_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 hash = 0; + uint32_t hash = 0; int offset = 0; offset = dissect_nfs3_fh(tvb, offset, pinfo, tree, "dir", &hash, (rpc_call_info_value*)data); @@ -5574,7 +5591,7 @@ static int dissect_nfs3_readdir_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { - guint32 status; + uint32_t status; const char *err; int offset = 0; @@ -5611,7 +5628,7 @@ static int dissect_nfs3_readdirplus_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 hash = 0; + uint32_t hash = 0; int offset = 0; offset = dissect_nfs3_fh(tvb, offset, pinfo, tree, "dir", &hash, (rpc_call_info_value*)data); @@ -5683,7 +5700,7 @@ dissect_nfs3_entryplus(tvbuff_t *tvb, int offset, packet_info *pinfo, static int dissect_nfs3_readdirplus_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 status; + uint32_t status; const char *err; int offset = 0; @@ -5719,7 +5736,7 @@ dissect_nfs3_readdirplus_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr static int dissect_nfs3_fsstat_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 hash = 0; + uint32_t hash = 0; int offset = 0; offset = dissect_nfs3_fh(tvb, offset, pinfo, tree, "object", &hash, (rpc_call_info_value*)data); @@ -5733,8 +5750,8 @@ dissect_nfs3_fsstat_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo static int dissect_nfs3_fsstat_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { - guint32 status; - guint32 invarsec; + uint32_t status; + uint32_t invarsec; const char *err; int offset = 0; @@ -5777,10 +5794,10 @@ dissect_nfs3_fsstat_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tre } -#define FSF3_LINK 0x0001 -#define FSF3_SYMLINK 0x0002 -#define FSF3_HOMOGENEOUS 0x0008 -#define FSF3_CANSETTIME 0x0010 +#define FSF3_LINK 0x00000001 +#define FSF3_SYMLINK 0x00000002 +#define FSF3_HOMOGENEOUS 0x00000008 +#define FSF3_CANSETTIME 0x00000010 static const true_false_string tfs_nfs_pathconf = { "is valid for all files", "should be get for every single file" }; @@ -5790,7 +5807,7 @@ static const true_false_string tfs_nfs_pathconf = static int dissect_nfs3_fsinfo_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 hash = 0; + uint32_t hash = 0; int offset = 0; offset = dissect_nfs3_fh(tvb, offset, pinfo, tree, "object", &hash, (rpc_call_info_value*)data); @@ -5804,7 +5821,7 @@ dissect_nfs3_fsinfo_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo static int dissect_nfs3_fsinfo_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { - guint32 status; + uint32_t status; static int * const properties[] = { &hf_nfs3_fsinfo_properties_setattr, &hf_nfs3_fsinfo_properties_pathconf, @@ -5865,7 +5882,7 @@ dissect_nfs3_fsinfo_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tre static int dissect_nfs3_pathconf_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 hash = 0; + uint32_t hash = 0; int offset = 0; offset = dissect_nfs3_fh(tvb, offset, pinfo, tree, "object", &hash, (rpc_call_info_value*)data); @@ -5879,9 +5896,9 @@ dissect_nfs3_pathconf_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, static int dissect_nfs3_pathconf_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { - guint32 status; - guint32 linkmax; - guint32 name_max; + uint32_t status; + uint32_t linkmax; + uint32_t name_max; const char *err; int offset = 0; @@ -5929,7 +5946,7 @@ dissect_nfs3_pathconf_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *t static int dissect_nfs3_commit_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 hash = 0; + uint32_t hash = 0; int offset = 0; offset = dissect_nfs3_fh(tvb, offset, pinfo, tree, "file", &hash, (rpc_call_info_value*)data); @@ -5947,7 +5964,7 @@ dissect_nfs3_commit_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo static int dissect_nfs3_commit_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { - guint32 status; + uint32_t status; const char *err; int offset = 0; @@ -6274,9 +6291,9 @@ static const value_string fattr4_names[] = { static value_string_ext fattr4_names_ext = VALUE_STRING_EXT_INIT(fattr4_names); static int -dissect_nfs4_status(tvbuff_t *tvb, int offset, proto_tree *tree, guint32 *status) +dissect_nfs4_status(tvbuff_t *tvb, int offset, proto_tree *tree, uint32_t *status) { - guint32 stat; + uint32_t stat; proto_item *stat_item; proto_tree_add_item_ret_uint(tree, hf_nfs4_status, tvb, offset+0, 4, ENC_BIG_ENDIAN, &stat); @@ -6309,21 +6326,21 @@ dissect_nfs4_bitmap(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *t const char *name) { int attr_offset; - int hf_item = -1; - guint32 i, j; - guint32 count; - guint32 bitmap; - guint32 bit_num; - guint32 bit_set; - guint32 num_bitmaps; - guint32 end_offset; - guint32 mask_offset; - guint32 opaque_offset; - guint32 opaque_length = 0; - guint32 opaque_padding = 0; - gboolean no_idx = FALSE; - gboolean first_attr = FALSE; - gboolean skip_attr_values = FALSE; + int hf_item = 0; + uint32_t i, j; + uint32_t count; + uint32_t bitmap; + uint32_t bit_num; + uint32_t bit_set; + uint32_t num_bitmaps; + uint32_t end_offset; + uint32_t mask_offset; + uint32_t opaque_offset; + uint32_t opaque_length = 0; + uint32_t opaque_padding = 0; + bool no_idx = false; + bool first_attr = false; + bool skip_attr_values = false; header_field_info *hfinfo; @@ -6380,7 +6397,7 @@ dissect_nfs4_bitmap(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *t /* If there is only one non-zero bitmap, don't display the bitmap index "[x]". */ if (count <= 1) - no_idx = TRUE; + no_idx = true; /* Set the offset to the first value */ offset = opaque_offset; @@ -6408,7 +6425,7 @@ dissect_nfs4_bitmap(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *t mask_offset, 4, bitmap, "%s[%u]: 0x%08x", hfinfo->name, i, bitmap); } bitmap_tree = proto_item_add_subtree(bitmap_item, ett_nfs4_bitmap); - first_attr = TRUE; + first_attr = true; if (bitmap_info->hf_item_count) { /* Count the number of attribute bits set */ @@ -6431,7 +6448,7 @@ dissect_nfs4_bitmap(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *t /* Append this attribute name to the 'attr mask' header line */ proto_item_append_text(bitmap_tree, (first_attr ? " (%s" : ", %s"), val_to_str_ext(bit_num, bitmap_info->vse_names_ext, "Unknown: %u")); - first_attr = FALSE; + first_attr = false; } /* Get correct item label */ @@ -6440,7 +6457,7 @@ dissect_nfs4_bitmap(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *t else if (bitmap_info->hf_item_label) hf_item = *bitmap_info->hf_item_label; - if (hf_item != -1) { + if (hf_item > 0) { /* Display label */ attr_item = proto_tree_add_uint(bitmap_tree, hf_item, tvb, offset, 0, bit_num); } @@ -6463,7 +6480,7 @@ dissect_nfs4_bitmap(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *t /* No value was dissected, this attribute is most likely not * supported yet so stop dissecting the rest of the bitmap data */ expert_add_info(pinfo, attr_tree, &ei_nfs_bitmap_no_dissector); - skip_attr_values = TRUE; + skip_attr_values = true; } } @@ -6490,7 +6507,7 @@ dissect_nfs4_bitmap(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *t /* There are still bytes remaining from the opaque * just consume the bytes */ expert_add_info(pinfo, name_tree, &ei_nfs_bitmap_undissected_data); - offset = dissect_rpc_bytes(tvb, name_tree, hf_nfs4_bitmap_data, offset, count, FALSE, NULL); + offset = dissect_rpc_bytes(tvb, name_tree, hf_nfs4_bitmap_data, offset, count, false, NULL); } } @@ -6597,7 +6614,7 @@ dissect_nfs4_lock_owner(tvbuff_t *tvb, int offset, proto_tree *tree) static int dissect_nfs4_pathname(tvbuff_t *tvb, int offset, proto_tree *tree) { - guint32 comp_count, i; + uint32_t comp_count, i; proto_item *fitem; proto_tree *newftree; @@ -6621,7 +6638,6 @@ dissect_nfs4_nfstime(tvbuff_t *tvb, int offset, proto_tree *tree) return offset; } - static const value_string names_time_how4[] = { #define SET_TO_SERVER_TIME4 0 { SET_TO_SERVER_TIME4, "SET_TO_SERVER_TIME4" }, @@ -6634,7 +6650,7 @@ static int dissect_nfs4_settime(tvbuff_t *tvb, int offset, proto_tree *tree, const char *name _U_) { - guint32 set_it; + uint32_t set_it; proto_tree_add_item_ret_uint(tree, hf_nfs4_time_how4, tvb, offset+0, 4, ENC_BIG_ENDIAN, &set_it); offset += 4; @@ -6645,7 +6661,6 @@ dissect_nfs4_settime(tvbuff_t *tvb, int offset, return offset; } - static int dissect_nfs4_fsid(tvbuff_t *tvb, int offset, proto_tree *tree, const char *name) { @@ -6805,13 +6820,13 @@ static const value_string acemask4_abbrev_perms_8_and_above[] = { static value_string_ext acemask4_abbrev_perms_8_and_above_ext = VALUE_STRING_EXT_INIT(acemask4_abbrev_perms_8_and_above); static int -dissect_nfs4_acemask(tvbuff_t *tvb, int offset, proto_tree *ace_tree, guint32 acetype4, guint32 obj_type) +dissect_nfs4_acemask(tvbuff_t *tvb, int offset, proto_tree *ace_tree, uint32_t acetype4, uint32_t obj_type) { - const gchar *type = NULL; - const gchar *atype = NULL; - guint32 acemask = tvb_get_ntohl(tvb, offset); - guint32 acemask_bit = 1; - gboolean first_perm = TRUE; + const char *type = NULL; + const char *atype = NULL; + uint32_t acemask = tvb_get_ntohl(tvb, offset); + uint32_t acemask_bit = 1; + bool first_perm = true; proto_item *acemask_item; proto_tree *acemask_tree; @@ -6842,7 +6857,7 @@ dissect_nfs4_acemask(tvbuff_t *tvb, int offset, proto_tree *ace_tree, guint32 ac proto_tree_add_uint_format(acemask_tree, hf_nfs4_ace_permission, tvb, offset, 4, acemask_bit, "%s: %s (0x%08x)", val_to_str(acetype4, names_acetype4, "Unknown: %u"), type, acemask_bit); proto_item_append_text(acemask_item, first_perm ? "%s" : ", %s", atype); - first_perm = FALSE; + first_perm = false; } acemask_bit <<= 1; } @@ -6856,9 +6871,9 @@ dissect_nfs4_acemask(tvbuff_t *tvb, int offset, proto_tree *ace_tree, guint32 ac /* Decode exactly one ACE (type, flags, mask, permissions, and who) */ static int dissect_nfs4_ace(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int ace_number, - guint32 obj_type) + uint32_t obj_type) { - guint32 acetype4 = 0; + uint32_t acetype4 = 0; const char *acetype4_str; proto_tree *ace_tree = NULL; @@ -6916,10 +6931,10 @@ dissect_nfs4_aclflags(tvbuff_t *tvb, int offset, proto_tree *tree) static int dissect_nfs4_fattr_acl(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_item *attr_item, - proto_tree *tree, guint32 obj_type, guint32 attr_num) + proto_tree *tree, uint32_t obj_type, uint32_t attr_num) { - guint32 num_aces; - guint32 ace_number; + uint32_t num_aces; + uint32_t ace_number; if (attr_num != FATTR4_ACL) offset = dissect_nfs4_aclflags(tvb, offset, tree); @@ -6963,7 +6978,7 @@ dissect_nfs4_fattr_aclsupport(tvbuff_t *tvb, int offset, proto_tree *tree) static int dissect_nfs4_fh(tvbuff_t *tvb, int offset, packet_info *pinfo, - proto_tree *tree, const char *name, guint32 *hash, rpc_call_info_value *civ) + proto_tree *tree, const char *name, uint32_t *hash, rpc_call_info_value *civ) { return dissect_nfs3_fh(tvb, offset, pinfo, tree, name, hash, civ); } @@ -7055,7 +7070,7 @@ static int * const nfs4_fattr_fh_expire_type_fields[] = { static int dissect_nfs4_fattr_fh_expire_type(tvbuff_t *tvb, int offset, proto_tree *tree) { - guint32 expire_type; + uint32_t expire_type; expire_type = tvb_get_ntohl(tvb, offset + 0); @@ -7075,7 +7090,7 @@ dissect_nfs4_fattr_fh_expire_type(tvbuff_t *tvb, int offset, proto_tree *tree) static int dissect_nfs_fs_layout_type(tvbuff_t *tvb, proto_tree *tree, int offset) { - guint count, i; + unsigned count, i; count = tvb_get_ntohl(tvb, offset); offset += 4; @@ -7105,9 +7120,9 @@ static value_string_ext th4_names_ext_file = VALUE_STRING_EXT_INIT(th4_names_fil static int dissect_nfs4_threshold_item_file(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, rpc_call_info_value *civ _U_, proto_tree *attr_tree, proto_item *attr_item _U_, - guint32 bit_num, void *battr_data _U_) + uint32_t bit_num, void *battr_data _U_) { - guint64 size; + uint64_t size; switch (bit_num) { case TH4_READ_SIZE: @@ -7128,7 +7143,7 @@ static int dissect_nfs4_threshold_item(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 layout_type; + uint32_t layout_type; static nfs4_bitmap_info_t *bitmap_info_p; /* Bitmap info for the files layout type */ @@ -7223,7 +7238,7 @@ dissect_nfs4_fattrs(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *t /* Display attribute as either required or recommended */ static int -nfs4_fattr_item_label(guint32 attr_num) +nfs4_fattr_item_label(uint32_t attr_num) { return (attr_num <= FATTR4_RDATTR_ERROR || attr_num == FATTR4_FILEHANDLE || @@ -7236,9 +7251,9 @@ nfs4_fattr_item_label(guint32 attr_num) static int dissect_nfs4_fattr_value(tvbuff_t *tvb, int offset, packet_info *pinfo, rpc_call_info_value *civ, proto_tree *attr_tree, - proto_item *attr_item, guint32 attr_num, void *battr_data) + proto_item *attr_item, uint32_t attr_num, void *battr_data) { - guint32 *fattr_obj_type_p = (guint32 *)battr_data; + uint32_t *fattr_obj_type_p = (uint32_t *)battr_data; switch (attr_num) { case FATTR4_SUPPORTED_ATTRS: case FATTR4_SUPPATTR_EXCLCREAT: @@ -7529,7 +7544,7 @@ dissect_nfs4_fattr_value(tvbuff_t *tvb, int offset, packet_info *pinfo, static int dissect_nfs4_fattrs(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int type, rpc_call_info_value *civ) { - static guint32 fattr_obj_type = 0; + static uint32_t fattr_obj_type = 0; nfs4_bitmap_type_t bitmap_type; static nfs4_bitmap_info_t bitmap_info = { .vse_names_ext = &fattr4_names_ext, @@ -7565,13 +7580,13 @@ static const value_string names_open4_share_access[] = { { OPEN4_SHARE_ACCESS_WANT_NO_DELEG, "OPEN4_SHARE_ACCESS_WANT_NO_DELEG" }, #define OPEN4_SHARE_ACCESS_WANT_CANCEL 0x0500 { OPEN4_SHARE_ACCESS_WANT_CANCEL, "OPEN4_SHARE_ACCESS_WANT_CANCEL" }, -#define OPEN4_SHARE_ACCESS_WANT_SIGNAL_DELEG_WHEN_RESRC_AVAIL 0x10000 +#define OPEN4_SHARE_ACCESS_WANT_SIGNAL_DELEG_WHEN_RESRC_AVAIL 0x00010000 { OPEN4_SHARE_ACCESS_WANT_SIGNAL_DELEG_WHEN_RESRC_AVAIL, "OPEN4_SHARE_ACCESS_WANT_SIGNAL_DELEG_WHEN_RESRC_AVAIL"}, -#define OPEN4_SHARE_ACCESS_WANT_PUSH_DELEG_WHEN_UNCONTENDED 0x20000 +#define OPEN4_SHARE_ACCESS_WANT_PUSH_DELEG_WHEN_UNCONTENDED 0x00020000 { OPEN4_SHARE_ACCESS_WANT_PUSH_DELEG_WHEN_UNCONTENDED, "OPEN4_SHARE_ACCESS_WANT_PUSH_DELEG_WHEN_UNCONTENDED"}, -#define OPEN4_SHARE_ACCESS_WANT_DELEG_TIMESTAMPS 0x100000 +#define OPEN4_SHARE_ACCESS_WANT_DELEG_TIMESTAMPS 0x00100000 {OPEN4_SHARE_ACCESS_WANT_DELEG_TIMESTAMPS, "OPEN4_SHARE_ACCESS_WANT_DELEG_TIMESTAMPS"}, { 0, NULL } @@ -7583,9 +7598,9 @@ dissect_nfs4_open_share_access(tvbuff_t *tvb, int offset, proto_tree *tree) { proto_item *notify_item; proto_tree *notify_tree; - guint share_access; - guint want_flags; - guint want_notify_flags; + unsigned share_access; + unsigned want_flags; + unsigned want_notify_flags; want_notify_flags = tvb_get_ntohl(tvb, offset); share_access = want_notify_flags & 0x3; @@ -7673,10 +7688,10 @@ static int dissect_nfs4_open_claim(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, const char **name, rpc_call_info_value *civ) { - guint open_claim_type4; + unsigned open_claim_type4; proto_item *fitem; proto_tree *newftree = NULL; - guint32 name_offset, name_len; + uint32_t name_offset, name_len; open_claim_type4 = tvb_get_ntohl(tvb, offset); fitem = proto_tree_add_uint(tree, hf_nfs4_open_claim_type, tvb, @@ -7735,7 +7750,7 @@ static int dissect_nfs4_createhow(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, rpc_call_info_value *civ) { - guint mode; + unsigned mode; mode = tvb_get_ntohl(tvb, offset); proto_tree_add_uint(tree, hf_nfs4_createmode, tvb, offset, 4, mode); @@ -7777,7 +7792,7 @@ static int dissect_nfs4_openflag(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, rpc_call_info_value *civ) { - guint opentype4; + unsigned opentype4; proto_item *fitem; proto_tree *newftree; @@ -7807,10 +7822,10 @@ dissect_nfs4_clientaddr(tvbuff_t *tvb, int offset, proto_tree *tree) { const char *universal_ip_address = NULL; const char *protocol = NULL; - guint b1, b2, b3, b4, b5, b6, b7, b8, b9, b10; - guint16 port; + unsigned b1, b2, b3, b4, b5, b6, b7, b8, b9, b10; + uint16_t port; int addr_offset; - guint32 ipv4; + uint32_t ipv4; ws_in6_addr ipv6; address addr; proto_item* ti; @@ -7886,7 +7901,7 @@ static const value_string names_stable_how4[] = { static int dissect_nfs4_stable_how(tvbuff_t *tvb, int offset, proto_tree *tree, const char *name) { - guint stable_how4; + unsigned stable_how4; stable_how4 = tvb_get_ntohl(tvb, offset); proto_tree_add_uint_format(tree, hf_nfs4_stable_how, tvb, @@ -7913,7 +7928,7 @@ static const value_string names_setxattr_options[] = { static int dissect_nfs4_listxattr_names(tvbuff_t *tvb, int offset, proto_tree *tree) { - guint32 comp_count, i; + uint32_t comp_count, i; proto_item *fitem; proto_tree *newftree; @@ -7927,6 +7942,32 @@ dissect_nfs4_listxattr_names(tvbuff_t *tvb, int offset, proto_tree *tree) return offset; } +static int +dissect_nfs4_gdd_time(tvbuff_t *tvb, int offset, proto_tree *tree, int hfindex) +{ + proto_item *item; + proto_tree *subtree; + + item = proto_tree_add_item(tree, hfindex, tvb, offset, 12, ENC_NA); + subtree = proto_item_add_subtree(item, ett_nfs4_notify_delay); + return dissect_nfs4_nfstime(tvb, offset, subtree); +} + +static int +dissect_nfs4_gdd_fattrs(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int type, + rpc_call_info_value *civ, int hfindex) +{ + proto_item *item; + proto_tree *subtree; + int len; + + len = tvb_get_ntohl(tvb, offset); + + item = proto_tree_add_item(tree, hfindex, tvb, offset, len * 4, ENC_NA); + subtree = proto_item_add_subtree(item, ett_nfs4_notify_attrs); + return dissect_nfs4_fattrs(tvb, offset, pinfo, subtree, type, civ); +} + /* NFSv4 Operations */ static const value_string names_nfs4_operation[] = { { NFS4_OP_ACCESS, "ACCESS" }, @@ -8010,7 +8051,7 @@ static value_string_ext names_nfs4_operation_ext = VALUE_STRING_EXT_INIT(names_n /* Each subtree number in this array corresponds to the associated item in the above * 'names_nfs4_operation array[]' array. */ -static gint *nfs4_operation_ett[] = +static int *nfs4_operation_ett[] = { &ett_nfs4_access , &ett_nfs4_close , @@ -8055,7 +8096,7 @@ static gint *nfs4_operation_ett[] = &ett_nfs4_create_session, &ett_nfs4_destroy_session, &ett_nfs4_free_stateid, - NULL, /* get dir delegation */ + &ett_nfs4_get_dir_delegation, &ett_nfs4_getdevinfo, &ett_nfs4_getdevlist, &ett_nfs4_layoutcommit, @@ -8092,8 +8133,8 @@ static int dissect_nfs4_dirlist(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, rpc_call_info_value *civ) { - guint32 val_follows; - guint32 name_len; + uint32_t val_follows; + uint32_t name_len; char *name; proto_tree *dirlist_tree; proto_item *eitem; @@ -8113,7 +8154,7 @@ dissect_nfs4_dirlist(tvbuff_t *tvb, int offset, packet_info *pinfo, /* * Get the entry name and create subtree of field nfs.name */ - name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 16, name_len, ENC_UTF_8); + name = tvb_get_string_enc(pinfo->pool, tvb, offset + 16, name_len, ENC_UTF_8); eitem = proto_tree_add_string_format( dirlist_tree, hf_nfs_name, tvb, offset, -1, name, "Entry: %s", name); @@ -8219,10 +8260,10 @@ dissect_nfs4_open_rflags(tvbuff_t *tvb, int offset, proto_tree *tree) static int -dissect_nfs4_stateid(tvbuff_t *tvb, int offset, proto_tree *tree, guint16 *hash) +dissect_nfs4_stateid(tvbuff_t *tvb, int offset, proto_tree *tree, uint16_t *hash) { - guint16 stateid_hash; - guint32 other_hash; + uint16_t stateid_hash; + uint32_t other_hash; proto_item *sitem, *hitem, *oth_item; proto_tree *stateid_tree; int old_offset = offset; @@ -8312,7 +8353,7 @@ dissect_nfs4_sec_oid(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void *data _U_) { return dissect_rpc_opaque_data(tvb, offset, tree, pinfo, - hf_nfs4_sec_oid, FALSE, 0, FALSE, NULL, NULL); + hf_nfs4_sec_oid, false, 0, false, NULL, NULL); } static int @@ -8345,7 +8386,7 @@ static int dissect_nfs4_state_protect_a(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { - guint stateprotect; + unsigned stateprotect; proto_tree_add_item_ret_uint(tree, hf_nfs4_state_protect_how, tvb, offset+0, 4, ENC_BIG_ENDIAN, &stateprotect); offset += 4; @@ -8370,7 +8411,7 @@ static int dissect_nfs4_state_protect_r(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { - guint stateprotect; + unsigned stateprotect; proto_tree_add_item_ret_uint(tree, hf_nfs4_state_protect_how, tvb, offset+0, 4, ENC_BIG_ENDIAN, &stateprotect); @@ -8404,7 +8445,7 @@ static int dissect_nfs4_space_limit(tvbuff_t *tvb, int offset, proto_tree *tree) { - guint limitby; + unsigned limitby; proto_tree_add_item_ret_uint(tree, hf_nfs4_limit_by, tvb, offset+0, 4, ENC_BIG_ENDIAN, &limitby); offset += 4; @@ -8483,7 +8524,7 @@ static int dissect_nfs4_open_delegation(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) { - guint delegation_type; + unsigned delegation_type; proto_tree *newftree; proto_item *fitem; @@ -8555,7 +8596,7 @@ dissect_nfs4_exist_lock_owner(tvbuff_t *tvb, int offset, proto_tree *tree) static int dissect_nfs4_locker(tvbuff_t *tvb, int offset, proto_tree *tree) { - guint new_lock_owner; + unsigned new_lock_owner; new_lock_owner = tvb_get_ntohl(tvb, offset); offset = dissect_rpc_bool(tvb, tree, hf_nfs4_new_lock_owner, offset); @@ -8582,7 +8623,7 @@ dissect_nfs4_read_plus_content(tvbuff_t *tvb, int offset, packet_info *pinfo _U_ { proto_tree *ss_tree; proto_item *ss_fitem; - guint type; + unsigned type; ss_fitem = proto_tree_add_item_ret_uint(tree, hf_nfs4_read_plus_content_type, tvb, offset, 4, ENC_BIG_ENDIAN, &type); @@ -8619,7 +8660,7 @@ dissect_nfs4_client_id(tvbuff_t *tvb, int offset, proto_tree *tree) static int dissect_nfs4_newtime(tvbuff_t *tvb, int offset, proto_tree *tree) { - guint new_time; + unsigned new_time; new_time = tvb_get_ntohl(tvb, offset); offset = dissect_rpc_bool(tvb, tree, hf_nfs4_newtime, offset); @@ -8635,7 +8676,7 @@ dissect_nfs4_newtime(tvbuff_t *tvb, int offset, proto_tree *tree) static int dissect_nfs4_newsize(tvbuff_t *tvb, int offset, proto_tree *tree) { - guint new_size; + unsigned new_size; new_size = tvb_get_ntohl(tvb, offset); offset = dissect_rpc_bool(tvb, tree, hf_nfs4_newsize, offset); @@ -8651,7 +8692,7 @@ dissect_nfs4_newsize(tvbuff_t *tvb, int offset, proto_tree *tree) static int dissect_nfs4_newoffset(tvbuff_t *tvb, int offset, proto_tree *tree) { - guint new_offset; + unsigned new_offset; new_offset = tvb_get_ntohl(tvb, offset); offset = dissect_rpc_bool(tvb, tree, hf_nfs4_newoffset, offset); @@ -8747,12 +8788,12 @@ dissect_nfs4_cb_recall_any_mask(tvbuff_t *tvb, int offset, packet_info *pinfo, p } static int -dissect_nfs4_app_data_block(tvbuff_t *tvb, int offset, proto_tree *tree, guint32 *hash) +dissect_nfs4_app_data_block(tvbuff_t *tvb, int offset, proto_tree *tree, uint32_t *hash) { proto_item *fitem; - guint32 pattern_hash; - guint pattern_len; + uint32_t pattern_hash; + unsigned pattern_len; offset = dissect_rpc_uint64(tvb, tree, hf_nfs4_offset, offset); offset = dissect_rpc_uint32(tvb, tree, hf_nfs4_block_size, offset); @@ -8821,13 +8862,13 @@ dissect_nfs4_io_info(tvbuff_t *tvb, int offset, proto_tree *tree, const char *io } static int -dissect_nfs4_layoutstats(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, rpc_call_info_value *civ, gboolean has_layout_type) +dissect_nfs4_layoutstats(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, rpc_call_info_value *civ, bool has_layout_type) { - guint layout_type = LAYOUT4_NO_LAYOUT_TYPE; + unsigned layout_type = LAYOUT4_NO_LAYOUT_TYPE; proto_tree *netaddr; proto_item *fitem; int old_offset; - guint32 last_fh_hash = 0; + uint32_t last_fh_hash = 0; /* FIXME: Are these here or in the caller? Check for layoutcommit */ offset = dissect_nfs4_io_info(tvb, offset, tree, "Read"); @@ -8882,7 +8923,7 @@ dissect_nfs4_ff_io_stats(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tr offset = dissect_nfs4_stateid(tvb, offset, tree, NULL); /* Note that we've already determined that we are in the Flex File Layout Type */ - offset = dissect_nfs4_layoutstats(tvb, offset, pinfo, tree, civ, FALSE); + offset = dissect_nfs4_layoutstats(tvb, offset, pinfo, tree, civ, false); return offset; } @@ -8894,10 +8935,10 @@ dissect_nfs4_device_errors(tvbuff_t *tvb, int offset, proto_tree *tree) proto_tree *ss_tree; proto_tree *subtree; proto_item *ss_fitem; - guint i; - guint count; + unsigned i; + unsigned count; - guint opcode; + unsigned opcode; count = tvb_get_ntohl(tvb, offset); sub_fitem = proto_tree_add_item(tree, hf_nfs4_device_error_count, @@ -8941,15 +8982,15 @@ dissect_nfs4_ff_io_error(tvbuff_t *tvb, int offset, proto_tree *tree) static int dissect_nfs4_layoutreturn(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, rpc_call_info_value *civ) { - guint returntype; - guint layout_type; + unsigned returntype; + unsigned layout_type; proto_item *sub_fitem; proto_tree *ss_tree; proto_tree *subtree; proto_item *ss_fitem; - guint i; - guint count; + unsigned i; + unsigned count; offset = dissect_rpc_bool(tvb, tree, hf_nfs4_reclaim, offset); @@ -9012,7 +9053,7 @@ dissect_nfs4_layoutreturn(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_t static int dissect_nfs_layoutreturn_stateid(tvbuff_t *tvb, proto_tree *tree, int offset) { - guint lrs_present; + unsigned lrs_present; lrs_present = tvb_get_ntohl(tvb, offset); offset = dissect_rpc_bool(tvb, tree, hf_nfs4_lrs_present, offset); @@ -9024,6 +9065,35 @@ dissect_nfs_layoutreturn_stateid(tvbuff_t *tvb, proto_tree *tree, int offset) return offset; } +static const value_string notify_type4[] = { +#define NOTIFY4_CHANGE_CHILD_ATTRS 0 + { NOTIFY4_CHANGE_CHILD_ATTRS, "Change Child Attrs" }, +#define NOTIFY4_CHANGE_DIR_ATTRS 1 + { NOTIFY4_CHANGE_DIR_ATTRS, "Change Dir Attrs" }, +#define NOTIFY4_REMOVE_ENTRY 2 + { NOTIFY4_REMOVE_ENTRY, "Remove Entry" }, +#define NOTIFY4_ADD_ENTRY 3 + { NOTIFY4_ADD_ENTRY, "Add Entry" }, +#define NOTIFY4_RENAME_ENTRY 4 + { NOTIFY4_RENAME_ENTRY, "Rename Entry" }, +#define NOTIFY4_CHANGE_COOKIE_VERIFIER 5 + { NOTIFY4_CHANGE_COOKIE_VERIFIER, "Change Cookie Verifier" }, + { 0, NULL } +}; +static value_string_ext notify_type4_ext = VALUE_STRING_EXT_INIT(notify_type4); + +static int +dissect_nfs4_notify_type4_bitmap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int offset) +{ + static nfs4_bitmap_info_t bitmap_info = { + .vse_names_ext = ¬ify_type4_ext, + .hf_mask_label = &hf_nfs4_notify_mask, + .hf_item_label = &hf_nfs4_notify_type, + }; + + return dissect_nfs4_bitmap(tvb, offset, pinfo, tree, NULL, &bitmap_info, NFS4_BITMAP_MASK, + NULL); +} static const value_string notify_deviceid_type4[] = { #define NOTIFY_DEVICEID4_CHANGE 1 @@ -9036,12 +9106,12 @@ static value_string_ext notify_deviceid_type4_ext = VALUE_STRING_EXT_INIT(notify static int -dissect_nfs4_notification_bitmap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int offset) +dissect_nfs4_notify_deviceid_bitmap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int offset) { static nfs4_bitmap_info_t bitmap_info = { .vse_names_ext = ¬ify_deviceid_type4_ext, - .hf_mask_label = &hf_nfs4_notification_mask, - .hf_item_label = &hf_nfs4_notification_type, + .hf_mask_label = &hf_nfs4_notify_deviceid_mask, + .hf_item_label = &hf_nfs4_notify_deviceid_type, }; return dissect_nfs4_bitmap(tvb, offset, pinfo, tree, NULL, &bitmap_info, NFS4_BITMAP_MASK, NULL); @@ -9051,8 +9121,8 @@ dissect_nfs4_notification_bitmap(tvbuff_t *tvb, proto_tree *tree, packet_info *p static int dissect_nfs4_devices_file(tvbuff_t *tvb, int offset, proto_tree *tree) { - guint i, j; - guint32 num_indices, num_multipath, num_addr; + unsigned i, j; + uint32_t num_indices, num_multipath, num_addr; /* disect indices */ num_indices = tvb_get_ntohl(tvb, offset); @@ -9078,9 +9148,9 @@ dissect_nfs4_devices_file(tvbuff_t *tvb, int offset, proto_tree *tree) static int dissect_nfs4_devices_flexfile(tvbuff_t *tvb, int offset, proto_tree *tree) { - guint i; - guint32 num_addr; - guint32 num_vers; + unsigned i; + uint32_t num_addr; + uint32_t num_vers; /* disect indices */ num_addr = tvb_get_ntohl(tvb, offset); @@ -9159,7 +9229,7 @@ static const value_string scsi_extent_state_names[] = { static int dissect_nfs4_devices_scsi_base_volume(tvbuff_t *tvb, int offset, proto_tree *tree) { - guint32 desig_len; + uint32_t desig_len; offset = dissect_rpc_uint32(tvb, tree, hf_nfs4_devaddr_scsi_vpd_code_set, offset); offset = dissect_rpc_uint32(tvb, tree, hf_nfs4_devaddr_scsi_vpd_designator_type, offset); @@ -9180,8 +9250,8 @@ dissect_nfs4_devices_scsi_base_volume(tvbuff_t *tvb, int offset, proto_tree *tre static int dissect_nfs4_vol_indices(tvbuff_t *tvb, int offset, proto_tree *tree) { - guint i; - guint32 num_vols; + unsigned i; + uint32_t num_vols; proto_item *indices_item; proto_tree *indices_tree; @@ -9203,12 +9273,12 @@ dissect_nfs4_vol_indices(tvbuff_t *tvb, int offset, proto_tree *tree) static int dissect_nfs4_devices_scsi(tvbuff_t *tvb, int offset, proto_tree *tree) { - guint i; + unsigned i; proto_item *vol_item; proto_tree *vol_tree; int old_offset = offset; - guint32 num_vols; - guint32 vol_type; + uint32_t num_vols; + uint32_t vol_type; num_vols = tvb_get_ntohl(tvb, offset); offset += 4; @@ -9263,7 +9333,7 @@ dissect_nfs4_test_stateid_res(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, static int dissect_nfs4_netloc(tvbuff_t *tvb, int offset, proto_tree *tree) { - guint netloc_type; + unsigned netloc_type; proto_tree *netaddr; int old_offset; proto_item *fitem; @@ -9313,8 +9383,8 @@ dissect_nfs4_write_response(tvbuff_t *tvb, int offset, proto_tree *tree) proto_tree *ss_tree; proto_tree *subtree; proto_item *ss_fitem; - guint i; - guint32 count; + unsigned i; + uint32_t count; /* Number of callback stateids */ sub_fitem = proto_tree_add_item_ret_uint(tree, hf_nfs4_callback_stateids, @@ -9346,8 +9416,8 @@ dissect_nfs4_source_servers(tvbuff_t *tvb, int offset, proto_tree *tree) proto_tree *ss_tree; proto_tree *subtree; proto_item *ss_fitem; - guint i; - guint32 source_servers; + unsigned i; + uint32_t source_servers; /* Number of source servers */ sub_fitem = proto_tree_add_item_ret_uint(tree, hf_nfs4_source_servers, @@ -9372,7 +9442,7 @@ dissect_nfs4_source_servers(tvbuff_t *tvb, int offset, proto_tree *tree) static int dissect_nfs4_deviceaddr(tvbuff_t *tvb, int offset, proto_tree *tree) { - guint layout_type; + unsigned layout_type; /* layout type */ layout_type = tvb_get_ntohl(tvb, offset); @@ -9406,8 +9476,8 @@ dissect_nfs4_deviceaddr(tvbuff_t *tvb, int offset, proto_tree *tree) static int dissect_nfs4_devicelist(tvbuff_t *tvb, int offset, proto_tree *tree) { - guint count; - guint i; + unsigned count; + unsigned i; count = tvb_get_ntohl(tvb, offset); offset = dissect_rpc_uint32(tvb, tree, hf_nfs4_devicenum, offset); @@ -9431,7 +9501,7 @@ static int dissect_rpc_chanattrs4(tvbuff_t *tvb, int offset, proto_tree *tree, const char *name) { proto_tree *chan_attrs_tree; - guint i, count, rdma_ird_len; + unsigned i, count, rdma_ird_len; rdma_ird_len = tvb_get_ntohl(tvb, offset + 24); count = 28 + rdma_ird_len * 4; @@ -9456,7 +9526,7 @@ static int dissect_rpc_nfs_impl_id4(tvbuff_t *tvb, int offset, proto_tree *tree, const char *name) { proto_tree *impl_id_tree; - guint i, count; + unsigned i, count; count = tvb_get_ntohl(tvb, offset); impl_id_tree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_nfs4_clientowner, NULL, name); @@ -9478,18 +9548,18 @@ dissect_rpc_nfs_impl_id4(tvbuff_t *tvb, int offset, proto_tree *tree, const char static int dissect_rpc_secparms4(tvbuff_t *tvb, int offset, proto_tree *tree) { - guint count, i; + unsigned count, i; count = tvb_get_ntohl(tvb, offset); offset += 4; for (i = 0; i < count; i++) { - guint j, flavor = tvb_get_ntohl(tvb, offset); + unsigned j, flavor = tvb_get_ntohl(tvb, offset); offset = dissect_rpc_uint32(tvb, tree, hf_nfs4_flavor, offset); switch (flavor) { case 1: { /* AUTH_SYS */ - guint count2; + unsigned count2; offset = dissect_rpc_uint32(tvb, tree, hf_nfs4_stamp, offset); offset = dissect_nfs_utf8string(tvb, offset, tree, hf_nfs4_machinename, NULL); offset = dissect_rpc_uint32(tvb, tree, hf_nfs4_uid, offset); @@ -9518,11 +9588,11 @@ dissect_rpc_secparms4(tvbuff_t *tvb, int offset, proto_tree *tree) static int dissect_nfs4_layoutget(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, rpc_call_info_value *civ) { - guint layout_type; - guint sub_num; - guint nfl_util; - guint lo_seg_count; - guint i, j, k, lo_seg; + unsigned layout_type; + unsigned sub_num; + unsigned nfl_util; + unsigned lo_seg_count; + unsigned i, j, k, lo_seg; proto_tree *newtree; proto_item *sub_fitem; proto_tree *subtree; @@ -9585,7 +9655,7 @@ dissect_nfs4_layoutget(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree subtree, "lo_filehandle", NULL, civ); } else if (layout_type == LAYOUT4_FLEX_FILES) { - guint ds_count, fh_count; + unsigned ds_count, fh_count; proto_item *ds_item, *mirrors_item, *subitem; proto_tree *ds_tree, *mirrors_tree; int end_offset = offset; @@ -9659,7 +9729,7 @@ dissect_nfs4_layoutget(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree hf_nfs4_ff_stats_collect_hint, offset); } else if (layout_type == LAYOUT4_SCSI) { - guint ext_count; + unsigned ext_count; proto_tree *ext_tree; offset += 4; /* Skip past opaque count */ @@ -9747,8 +9817,8 @@ static const value_string names_secinfo_style4[] = { }; typedef struct _nfs4_operation_summary { - guint32 opcode; - gboolean iserror; + uint32_t opcode; + bool iserror; wmem_strbuf_t *optext; } nfs4_operation_summary; @@ -9870,6 +9940,13 @@ static int * const nfs4_exchid_flags[] = { NULL }; +typedef struct nfs4_tap_data { + + uint32_t ops_counter; + nfs4_operation_summary *op_summary; + unsigned highest_tier; +} nfs4_tap_data_t; + static int dissect_nfs4_request_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, rpc_call_info_value *civ) { @@ -9877,29 +9954,29 @@ dissect_nfs4_request_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tre const char *source_name = NULL; const char *dest_name = NULL; const char *opname = NULL; - guint opcode; - guint highest_tier = 5; - guint current_tier = 5; - guint first_operation = 1; - /*guint name_offset = 0;*/ - guint16 sid_hash; - guint64 clientid = 0; - guint32 ops; - guint32 ops_counter; - guint32 summary_counter; - guint32 string_length; - guint32 last_fh_hash = 0; - guint32 saved_fh_hash = 0; - guint32 length; - guint32 hash; - guint64 length64; - guint64 file_offset; + unsigned opcode; + unsigned highest_tier = 5; + unsigned current_tier = 5; + unsigned first_operation = 1; + /*unsigned name_offset = 0;*/ + uint16_t sid_hash; + uint64_t clientid = 0; + uint32_t ops; + uint32_t ops_counter; + uint32_t summary_counter; + uint32_t string_length; + uint32_t last_fh_hash = 0; + uint32_t saved_fh_hash = 0; + uint32_t length; + uint32_t hash; + uint64_t length64; + uint64_t file_offset; proto_item *fitem; proto_tree *ftree; proto_tree *newftree = NULL; nfs4_operation_summary *op_summary; - guint16 dst_sid_hash; - guint64 dst_file_offset; + uint16_t dst_sid_hash; + uint64_t dst_file_offset; ops = tvb_get_ntohl(tvb, offset+0); @@ -9917,7 +9994,7 @@ dissect_nfs4_request_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tre ops = MAX_NFSV4_OPS; } - op_summary = wmem_alloc0_array(wmem_packet_scope(), nfs4_operation_summary, ops); + op_summary = wmem_alloc0_array(pinfo->pool, nfs4_operation_summary, ops); ftree = proto_item_add_subtree(fitem, ett_nfs4_request_op); @@ -9926,7 +10003,7 @@ dissect_nfs4_request_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tre for (ops_counter=0; ops_counter<ops; ops_counter++) { - op_summary[ops_counter].optext = wmem_strbuf_new(wmem_packet_scope(), ""); + op_summary[ops_counter].optext = wmem_strbuf_new(pinfo->pool, ""); opcode = tvb_get_ntohl(tvb, offset); op_summary[ops_counter].opcode = opcode; @@ -9960,11 +10037,11 @@ dissect_nfs4_request_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tre { case NFS4_OP_ACCESS: { - guint32 *acc_request, amask; + uint32_t *acc_request, amask; /* Get access mask to check and save it for comparison in the reply. */ amask = tvb_get_ntohl(tvb, offset); - acc_request = (guint32 *)wmem_memdup(wmem_file_scope(), &amask, sizeof(guint32)); + acc_request = (uint32_t *)wmem_memdup(wmem_file_scope(), &amask, sizeof(uint32_t)); civ->private_data = acc_request; wmem_strbuf_append_printf (op_summary[ops_counter].optext, " FH: 0x%08x", last_fh_hash); @@ -9993,7 +10070,7 @@ dissect_nfs4_request_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tre case NFS4_OP_CREATE: { - guint create_type; + unsigned create_type; create_type = tvb_get_ntohl(tvb, offset); offset = dissect_rpc_uint32(tvb, newftree, hf_nfs4_ftype, offset); @@ -10056,7 +10133,7 @@ dissect_nfs4_request_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tre length64 = tvb_get_ntoh64(tvb, offset); offset = dissect_rpc_uint64(tvb, newftree, hf_nfs4_length, offset); offset = dissect_nfs4_locker(tvb, offset, newftree); - if (length64 == G_GUINT64_CONSTANT(0xffffffffffffffff)) + if (length64 == UINT64_C(0xffffffffffffffff)) wmem_strbuf_append_printf (op_summary[ops_counter].optext, " FH: 0x%08x Offset: %"PRIu64" Length: <End of File>", last_fh_hash, file_offset); @@ -10081,7 +10158,7 @@ dissect_nfs4_request_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tre offset = dissect_rpc_uint64(tvb, newftree, hf_nfs4_offset, offset); length64 = tvb_get_ntoh64(tvb, offset); offset = dissect_rpc_uint64(tvb, newftree, hf_nfs4_length, offset); - if (length64 == G_GUINT64_CONSTANT(0xffffffffffffffff)) + if (length64 == UINT64_C(0xffffffffffffffff)) wmem_strbuf_append_printf (op_summary[ops_counter].optext, " FH: 0x%08x Offset: %"PRIu64" Length: <End of File>", last_fh_hash, file_offset); @@ -10328,6 +10405,17 @@ dissect_nfs4_request_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tre wmem_strbuf_append_printf(op_summary[ops_counter].optext, " StateID: 0x%04x", sid_hash); break; + case NFS4_OP_GET_DIR_DELEGATION: + offset = dissect_rpc_bool(tvb, newftree, hf_nfs4_gdd_signal_deleg_avail, offset); + offset = dissect_nfs4_notify_type4_bitmap(tvb, newftree, pinfo, offset); + offset = dissect_nfs4_gdd_time(tvb, offset, newftree, hf_nfs4_gdd_child_attr_delay); + offset = dissect_nfs4_gdd_time(tvb, offset, newftree, hf_nfs4_gdd_dir_attr_delay); + offset = dissect_nfs4_gdd_fattrs(tvb, offset, pinfo, newftree, + FATTR4_BITMAP_ONLY, civ, hf_nfs4_gdd_child_attrs); + offset = dissect_nfs4_gdd_fattrs(tvb, offset, pinfo, newftree, + FATTR4_BITMAP_ONLY, civ, hf_nfs4_gdd_dir_attrs); + break; + /* pNFS */ case NFS4_OP_LAYOUTGET: offset = dissect_rpc_bool(tvb, newftree, hf_nfs4_layout_avail, offset); @@ -10360,7 +10448,7 @@ dissect_nfs4_request_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tre offset = dissect_nfs4_deviceid(tvb, offset, newftree); offset = dissect_rpc_uint32(tvb, newftree, hf_nfs4_layout_type, offset); offset = dissect_rpc_uint32(tvb, newftree, hf_nfs4_count_maxcount, offset); - offset = dissect_nfs4_notification_bitmap(tvb, newftree, pinfo, offset); + offset = dissect_nfs4_notify_deviceid_bitmap(tvb, newftree, pinfo, offset); break; case NFS4_OP_GETDEVLIST: @@ -10514,7 +10602,7 @@ dissect_nfs4_request_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tre wmem_strbuf_append_printf (op_summary[ops_counter].optext, " StateID: 0x%04x Offset: %" PRIu64 " Len: %u", sid_hash, file_offset, length); - offset = dissect_nfs4_layoutstats(tvb, offset, pinfo, newftree, civ, TRUE); + offset = dissect_nfs4_layoutstats(tvb, offset, pinfo, newftree, civ, true); break; case NFS4_OP_SEEK: @@ -10602,7 +10690,7 @@ dissect_nfs4_request_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tre /* Display packet summary */ for (summary_counter=0; summary_counter < ops_counter; summary_counter++) { - guint main_opcode; + unsigned main_opcode; proto_item *main_op_item = NULL; main_opcode = op_summary[summary_counter].opcode; @@ -10622,7 +10710,7 @@ dissect_nfs4_request_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tre } if (first_operation == 0) - /* Seperator between operation text */ + /* Separator between operation text */ col_append_str(pinfo->cinfo, COL_INFO, " |"); if (wmem_strbuf_get_len(op_summary[summary_counter].optext) > 0) @@ -10633,6 +10721,18 @@ dissect_nfs4_request_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tre } } + /* Copy the information from the call info and store information about + * the operations here in private data. + */ + rpc_call_info_value *tapdata = wmem_new0(pinfo->pool, rpc_call_info_value); + *tapdata = *civ; + nfs4_tap_data_t *ops_info = wmem_new0(pinfo->pool, nfs4_tap_data_t); + ops_info->op_summary = op_summary; + ops_info->ops_counter = ops_counter; + ops_info->highest_tier = highest_tier; + tapdata->private_data = ops_info; + tap_queue_packet(nfsv4_tap, pinfo, tapdata); + return offset; } @@ -10661,7 +10761,7 @@ static int dissect_nfs4_secinfo_res(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { - guint flavor; + unsigned flavor; proto_item *fitem; proto_tree *secftree; @@ -10691,8 +10791,8 @@ dissect_nfs4_offload_status_res(tvbuff_t *tvb, int offset, proto_tree *tree) proto_tree *ss_tree; proto_tree *subtree; proto_item *ss_fitem; - guint i; - guint32 count; + unsigned i; + uint32_t count; /* Number of osr_complete status */ sub_fitem = proto_tree_add_item_ret_uint(tree, @@ -10718,14 +10818,14 @@ dissect_nfs4_offload_status_res(tvbuff_t *tvb, int offset, proto_tree *tree) static int dissect_nfs4_response_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, rpc_call_info_value *civ) { - guint highest_tier = 5; - guint current_tier = 5; - guint first_operation = 1; - guint16 sid_hash = 0; - guint32 last_fh_hash = 0; - guint32 ops, ops_counter; - guint32 summary_counter; - guint32 opcode, status; + unsigned highest_tier = 5; + unsigned current_tier = 5; + unsigned first_operation = 1; + uint16_t sid_hash = 0; + uint32_t last_fh_hash = 0; + uint32_t ops, ops_counter; + uint32_t summary_counter; + uint32_t opcode, status, nfstatus; const char *opname; proto_item *fitem, *ti; proto_tree *ftree = NULL; @@ -10743,7 +10843,7 @@ dissect_nfs4_response_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tr ops = MAX_NFSV4_OPS; } - op_summary = wmem_alloc0_array(wmem_packet_scope(), nfs4_operation_summary, ops); + op_summary = wmem_alloc0_array(pinfo->pool, nfs4_operation_summary, ops); ftree = proto_item_add_subtree(fitem, ett_nfs4_response_op); @@ -10751,9 +10851,9 @@ dissect_nfs4_response_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tr for (ops_counter = 0; ops_counter < ops; ops_counter++) { - op_summary[ops_counter].optext = wmem_strbuf_new(wmem_packet_scope(), ""); + op_summary[ops_counter].optext = wmem_strbuf_new(pinfo->pool, ""); opcode = tvb_get_ntohl(tvb, offset); - op_summary[ops_counter].iserror = FALSE; + op_summary[ops_counter].iserror = false; op_summary[ops_counter].opcode = opcode; /* sanity check for bogus packets */ @@ -10795,7 +10895,7 @@ dissect_nfs4_response_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tr && opcode != NFS4_OP_SETATTR && opcode != NFS4_OP_SETCLIENTID && opcode != NFS4_OP_COPY) { - op_summary[ops_counter].iserror = TRUE; + op_summary[ops_counter].iserror = true; continue; } @@ -10968,6 +11068,22 @@ dissect_nfs4_response_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tr offset = dissect_rpc_array(tvb, pinfo, newftree, offset, dissect_nfs4_test_stateid_res, hf_nfs4_test_stateid_res); break; + case NFS4_OP_GET_DIR_DELEGATION: + nfstatus = tvb_get_ntohl(tvb, offset); + offset = dissect_rpc_uint32(tvb, newftree, hf_nfs4_gdd_non_fatal_status, offset); + if (nfstatus == GDD4_OK) { + offset = dissect_rpc_uint64(tvb, newftree, hf_nfs4_verifier, offset); + offset = dissect_nfs4_stateid(tvb, offset, newftree, &sid_hash); + offset = dissect_nfs4_notify_type4_bitmap(tvb, newftree, pinfo, offset); + offset = dissect_nfs4_gdd_fattrs(tvb, offset, pinfo, newftree, + FATTR4_BITMAP_ONLY, civ, hf_nfs4_gdd_child_attrs); + offset = dissect_nfs4_gdd_fattrs(tvb, offset, pinfo, newftree, + FATTR4_BITMAP_ONLY, civ, hf_nfs4_gdd_dir_attrs); + } else if (nfstatus == GDD4_UNAVAIL) { + offset = dissect_rpc_uint32(tvb, newftree, hf_nfs4_gdd_signal_deleg_avail, offset); + } + break; + case NFS4_OP_LAYOUTGET: offset = dissect_rpc_bool(tvb, newftree, hf_nfs4_return_on_close, offset); @@ -10985,7 +11101,7 @@ dissect_nfs4_response_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tr case NFS4_OP_GETDEVINFO: offset = dissect_nfs4_deviceaddr(tvb, offset, newftree); - offset = dissect_nfs4_notification_bitmap(tvb, newftree, pinfo, offset); + offset = dissect_nfs4_notify_deviceid_bitmap(tvb, newftree, pinfo, offset); break; case NFS4_OP_GETDEVLIST: @@ -11129,7 +11245,7 @@ dissect_nfs4_response_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tr /* Display packet summary */ for (summary_counter = 0; summary_counter < ops_counter; summary_counter++) { - guint main_opcode; + unsigned main_opcode; proto_item *main_op_item = NULL; main_opcode = op_summary[summary_counter].opcode; @@ -11140,7 +11256,7 @@ dissect_nfs4_response_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tr Display summary info for operations that return an error as well. */ if (current_tier == highest_tier || !display_major_nfs4_ops - || op_summary[summary_counter].iserror == TRUE) + || op_summary[summary_counter].iserror == true) { if (current_tier == highest_tier) { const char *main_opname = NULL; @@ -11153,7 +11269,7 @@ dissect_nfs4_response_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tr } if (first_operation == 0) - /* Seperator between operation text */ + /* Separator between operation text */ col_append_str(pinfo->cinfo, COL_INFO, " |"); if (wmem_strbuf_get_len(op_summary[summary_counter].optext) > 0) @@ -11163,6 +11279,18 @@ dissect_nfs4_response_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tr } } + /* Copy the information from the call info and store information about + * the operations here in private data. + */ + rpc_call_info_value *tapdata = wmem_new0(pinfo->pool, rpc_call_info_value); + *tapdata = *civ; + nfs4_tap_data_t *ops_info = wmem_new0(pinfo->pool, nfs4_tap_data_t); + ops_info->op_summary = op_summary; + ops_info->ops_counter = ops_counter; + ops_info->highest_tier = highest_tier; + tapdata->private_data = ops_info; + tap_queue_packet(nfsv4_tap, pinfo, tapdata); + return offset; } @@ -11171,7 +11299,7 @@ static int dissect_nfs4_compound_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 status; + uint32_t status; const char *tag = NULL; int offset = 0; @@ -11461,6 +11589,12 @@ static const value_string layoutreturn_names[] = { { 0, NULL } }; +static const value_string gdd_non_fatal_status_names[] = { + { 0, "GDD4_OK" }, + { 1, "GDD4_UNAVAIL" }, + { 0, NULL } +}; + static const value_string nfs_fh_obj_id[] = { { 1, "NF4REG" }, { 2, "NF4DIR" }, @@ -11487,29 +11621,29 @@ static const value_string layoutrecall_names[] = { }; /* NFS Callback */ -static int hf_nfs4_cb_procedure = -1; -static int hf_nfs4_cb_op = -1; -static int hf_nfs4_cb_truncate = -1; -static int hf_nfs4_cb_layoutrecall_type = -1; -static int hf_nfs4_cb_clorachanged = -1; - -static gint ett_nfs4_cb_request_op = -1; -static gint ett_nfs4_cb_resop = -1; -static gint ett_nfs4_cb_getattr = -1; -static gint ett_nfs4_cb_recall = -1; -static gint ett_nfs4_cb_layoutrecall = -1; -static gint ett_nfs4_cb_pushdeleg = -1; -static gint ett_nfs4_cb_recallany = -1; -static gint ett_nfs4_cb_recallableobjavail = -1; -static gint ett_nfs4_cb_recallslot = -1; -static gint ett_nfs4_cb_sequence = -1; -static gint ett_nfs4_cb_wantscancelled = -1; -static gint ett_nfs4_cb_notifylock = -1; -static gint ett_nfs4_cb_notifydeviceid = -1; -static gint ett_nfs4_cb_notify = -1; -static gint ett_nfs4_cb_reflists = -1; -static gint ett_nfs4_cb_refcalls = -1; -static gint ett_nfs4_cb_illegal = -1; +static int hf_nfs4_cb_procedure; +static int hf_nfs4_cb_op; +static int hf_nfs4_cb_truncate; +static int hf_nfs4_cb_layoutrecall_type; +static int hf_nfs4_cb_clorachanged; + +static int ett_nfs4_cb_request_op; +static int ett_nfs4_cb_resop; +static int ett_nfs4_cb_getattr; +static int ett_nfs4_cb_recall; +static int ett_nfs4_cb_layoutrecall; +static int ett_nfs4_cb_pushdeleg; +static int ett_nfs4_cb_recallany; +static int ett_nfs4_cb_recallableobjavail; +static int ett_nfs4_cb_recallslot; +static int ett_nfs4_cb_sequence; +static int ett_nfs4_cb_wantscancelled; +static int ett_nfs4_cb_notifylock; +static int ett_nfs4_cb_notifydeviceid; +static int ett_nfs4_cb_notify; +static int ett_nfs4_cb_reflists; +static int ett_nfs4_cb_refcalls; +static int ett_nfs4_cb_illegal; static const value_string names_nfs_cb_operation[] = { { NFS4_OP_CB_GETATTR, "CB_GETATTR" }, @@ -11530,7 +11664,7 @@ static const value_string names_nfs_cb_operation[] = { }; static value_string_ext names_nfs_cb_operation_ext = VALUE_STRING_EXT_INIT(names_nfs_cb_operation); -static gint *nfs4_cb_operation_ett[] = +static int *nfs4_cb_operation_ett[] = { &ett_nfs4_cb_getattr, &ett_nfs4_cb_recall, @@ -11550,7 +11684,7 @@ static gint *nfs4_cb_operation_ett[] = static int dissect_nfs4_cb_referring_calls(tvbuff_t *tvb, int offset, proto_tree *tree) { - guint num_reflists, num_refcalls, i, j; + unsigned num_reflists, num_refcalls, i, j; proto_tree *rl_tree, *rc_tree; num_reflists = tvb_get_ntohl(tvb, offset); @@ -11576,7 +11710,7 @@ dissect_nfs4_cb_referring_calls(tvbuff_t *tvb, int offset, proto_tree *tree) static int dissect_nfs4_cb_layoutrecall(tvbuff_t *tvb, int offset, proto_tree *tree, packet_info *pinfo, rpc_call_info_value *civ) { - guint recall_type; + unsigned recall_type; offset = dissect_rpc_uint32(tvb, tree, hf_nfs4_layout_type, offset); offset = dissect_rpc_uint32(tvb, tree, hf_nfs4_iomode, offset); @@ -11601,21 +11735,31 @@ dissect_nfs4_cb_layoutrecall(tvbuff_t *tvb, int offset, proto_tree *tree, packet static int dissect_nfs4_cb_request(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, rpc_call_info_value *civ) { - guint32 ops, ops_counter; - guint32 status; - guint opcode; + uint32_t ops, ops_counter; + uint32_t status; + unsigned opcode; proto_item *fitem; proto_tree *ftree; proto_tree *newftree = NULL; + nfs4_operation_summary *op_summary; ops = tvb_get_ntohl(tvb, offset+0); ftree = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_nfs4_cb_request_op, NULL, "Operations (count: %u)", ops); offset += 4; + if (ops > MAX_NFSV4_OPS) { + expert_add_info(pinfo, ftree, &ei_nfs_too_many_ops); + ops = MAX_NFSV4_OPS; + } + + op_summary = wmem_alloc0_array(pinfo->pool, nfs4_operation_summary, ops); + for (ops_counter=0; ops_counter<ops; ops_counter++) { opcode = tvb_get_ntohl(tvb, offset); + op_summary[ops_counter].iserror = false; + op_summary[ops_counter].opcode = opcode; col_append_fstr(pinfo->cinfo, COL_INFO, "%c%s", ops_counter == 0?' ':';', val_to_str_ext_const(opcode, &names_nfs_cb_operation_ext, "Unknown")); @@ -11691,6 +11835,18 @@ dissect_nfs4_cb_request(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tre } } + /* Copy the information from the call info and store information about + * the operations here in private data. + */ + rpc_call_info_value *tapdata = wmem_new0(pinfo->pool, rpc_call_info_value); + *tapdata = *civ; + nfs4_tap_data_t *ops_info = wmem_new0(pinfo->pool, nfs4_tap_data_t); + ops_info->op_summary = op_summary; + ops_info->ops_counter = ops_counter; + ops_info->highest_tier = 0; + tapdata->private_data = ops_info; + tap_queue_packet(nfsv4_tap, pinfo, tapdata); + return offset; } @@ -11716,20 +11872,30 @@ dissect_nfs4_cb_compound_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre static int dissect_nfs4_cb_resp_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, rpc_call_info_value *civ) { - guint32 ops, ops_counter; - guint32 opcode; + uint32_t ops, ops_counter; + uint32_t opcode; proto_item *fitem; proto_tree *ftree; proto_tree *newftree = NULL; - guint32 status; + uint32_t status; + nfs4_operation_summary *op_summary; ops = tvb_get_ntohl(tvb, offset+0); ftree = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_nfs4_cb_resop, NULL, "Operations (count: %u)", ops); offset += 4; + if (ops > MAX_NFSV4_OPS) { + expert_add_info(pinfo, ftree, &ei_nfs_too_many_ops); + ops = MAX_NFSV4_OPS; + } + + op_summary = wmem_alloc0_array(pinfo->pool, nfs4_operation_summary, ops); + for (ops_counter = 0; ops_counter < ops; ops_counter++) { opcode = tvb_get_ntohl(tvb, offset); + op_summary[ops_counter].iserror = false; + op_summary[ops_counter].opcode = opcode; /* sanity check for bogus packets */ if ((opcode < NFS4_OP_CB_GETATTR || opcode > NFS4_OP_CB_OFFLOAD) && @@ -11753,8 +11919,10 @@ dissect_nfs4_cb_resp_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tre offset = dissect_nfs4_status(tvb, offset, newftree, &status); /* are there any ops that return data with a failure (?) */ - if (status != NFS4_OK) + if (status != NFS4_OK) { + op_summary[ops_counter].iserror = true; continue; + } /* These parsing routines are only executed if the status is NFS4_OK */ switch (opcode) @@ -11791,6 +11959,18 @@ dissect_nfs4_cb_resp_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tre } } + /* Copy the information from the call info and store information about + * the operations here in private data. + */ + rpc_call_info_value *tapdata = wmem_new0(pinfo->pool, rpc_call_info_value); + *tapdata = *civ; + nfs4_tap_data_t *ops_info = wmem_new0(pinfo->pool, nfs4_tap_data_t); + ops_info->op_summary = op_summary; + ops_info->ops_counter = ops_counter; + ops_info->highest_tier = 0; + tapdata->private_data = ops_info; + tap_queue_packet(nfsv4_tap, pinfo, tapdata); + return offset; } @@ -11799,7 +11979,7 @@ static int dissect_nfs4_cb_compound_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 status; + uint32_t status; const char *tag = NULL; int offset = 0; @@ -11836,6 +12016,96 @@ static const rpc_prog_vers_info nfs_cb_vers_info[] = { { 4, nfs_cb_proc, &hf_nfs4_cb_procedure }, }; +#define NFS4_SRT_TABLE_INDEX 0 +#define NFS4_MAIN_OP_SRT_TABLE_INDEX 1 +#define NFS4_CB_SRT_TABLE_INDEX 2 + +typedef struct nfsv4_tap_data { + + uint32_t ops_counter; + nfs4_operation_summary *op_summary; + uint32_t program; + uint32_t version; + uint32_t operation; + uint32_t xid; + bool request; + nstime_t req_time; +} nfsv4_tap_data_t; + +static void +nfsstat_init(struct register_srt* srt _U_, GArray* srt_array) +{ + srt_stat_table *nfs_srt_table, *nfs_main_op_srt_table; + + nfs_srt_table = init_srt_table("NFSv4 Operations", NULL, srt_array, NFS4_LAST_OP + 1, "Operations", "nfs.opcode", NULL); + nfs_main_op_srt_table = init_srt_table("NFSv4 Main Operation", NULL, srt_array, NFS4_LAST_OP + 1, "Operations", "nfs.main_opcode", NULL); + for (uint32_t i = 0; i <= NFS4_LAST_OP; i++) { + init_srt_table_row(nfs_srt_table, i, + val_to_str_ext_const(i, &names_nfs4_operation_ext, "Unknown")); + init_srt_table_row(nfs_main_op_srt_table, i, + val_to_str_ext_const(i, &names_nfs4_operation_ext, "Unknown")); + } + + nfs_srt_table = init_srt_table("NFSv4 Callback Operations", NULL, srt_array, NFS4_OP_CB_OFFLOAD + 1, "Operations", "nfs.cb.operation", NULL); + + for (uint32_t i = 0; i <= NFS4_OP_CB_OFFLOAD; i++) { + init_srt_table_row(nfs_srt_table, i, + val_to_str_ext_const(i, &names_nfs4_operation_ext, "Unknown")); + } +} + +static tap_packet_status +nfsstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const void *prv, tap_flags_t flags _U_) +{ + srt_stat_table *nfs_srt_table, *nfs_main_op_srt_table; + srt_data_t *data = (srt_data_t *)pss; + const rpc_call_info_value *ri = (const rpc_call_info_value *)prv; + const nfs4_tap_data_t *ops_info = (const nfs4_tap_data_t *)ri->private_data; + uint32_t opcode; + unsigned current_tier; + + /* we are only interested in response packets */ + if (ri->request) { + return TAP_PACKET_DONT_REDRAW; + } + + if (ri->prog == NFS_PROGRAM) { + nfs_srt_table = g_array_index(data->srt_array, srt_stat_table*, NFS4_SRT_TABLE_INDEX); + nfs_main_op_srt_table = g_array_index(data->srt_array, srt_stat_table*, NFS4_MAIN_OP_SRT_TABLE_INDEX); + } else if (ri->prog == NFS_CB_PROGRAM) { + nfs_srt_table = g_array_index(data->srt_array, srt_stat_table*, NFS4_CB_SRT_TABLE_INDEX); + nfs_main_op_srt_table = NULL; + } else { + return TAP_PACKET_DONT_REDRAW; + } + + /* Add each of the operations seen to the table. Add operations + * considered the "main opcode" (in the highest tier in the + * compound procedure) to another table. + */ + for (uint32_t ops = 0; ops < ops_info->ops_counter; ops++) { + opcode = ops_info->op_summary[ops].opcode; + if (opcode == NFS4_OP_ILLEGAL) { + /* Ignore the illegal opcode, it would create + * 10,000 empty SRT rows. + * Note NFS4_OP_CB_ILLEGAL is the same value; + * actually testing for it makes some compilers + * warn about a useless duplicate logical test. + */ + continue; + } + add_srt_table_data(nfs_srt_table, opcode, &ri->req_time, pinfo); + if (nfs_main_op_srt_table) { + current_tier = NFS4_OPERATION_TIER(opcode); + if (current_tier == ops_info->highest_tier) { + add_srt_table_data(nfs_main_op_srt_table, opcode, &ri->req_time, pinfo); + } + } + } + + return TAP_PACKET_REDRAW; +} + void proto_register_nfs(void) { @@ -13410,13 +13680,21 @@ proto_register_nfs(void) NULL, 0, NULL, HFILL }}, #endif - { &hf_nfs4_notification_mask, { + { &hf_nfs4_notify_mask, { "notify_mask", "nfs.notify_mask", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }}, - { &hf_nfs4_notification_type, { - "notify_type", "nfs.notify_type", FT_UINT32, BASE_DEC | BASE_EXT_STRING, - ¬ify_deviceid_type4_ext, 0, NULL, HFILL }}, + { &hf_nfs4_notify_type, { + "notify_type", "nfs.notify_type", FT_UINT32, + BASE_DEC | BASE_EXT_STRING, ¬ify_type4_ext, 0, NULL, HFILL }}, + + { &hf_nfs4_notify_deviceid_mask, { + "notify_deviceid_mask", "nfs.notify_deviceid_mask", FT_UINT32, BASE_HEX, + NULL, 0, NULL, HFILL }}, + + { &hf_nfs4_notify_deviceid_type, { + "notify_deviceid_type", "nfs.notify_deviceid_type", FT_UINT32, + BASE_DEC | BASE_EXT_STRING, ¬ify_deviceid_type4_ext, 0, NULL, HFILL }}, { &hf_nfs4_newtime, { "new time?", "nfs.newtime", FT_BOOLEAN, BASE_NONE, @@ -13666,19 +13944,19 @@ proto_register_nfs(void) { &hf_nfs_access_check, { "Check access", "nfs.access_check", - FT_UINT8, BASE_HEX, + FT_UINT32, BASE_HEX, NULL, 0x0, "Access type(s) to be checked", HFILL } }, { &hf_nfs_access_supported, { "Supported types (of requested)", "nfs.access_supported", - FT_UINT8, BASE_HEX, + FT_UINT32, BASE_HEX, NULL, 0x0, "Access types (of those requested) that the server can reliably verify", HFILL } }, { &hf_nfs_access_rights, { "Access rights (of requested)", "nfs.access_rights", - FT_UINT8, BASE_HEX, + FT_UINT32, BASE_HEX, NULL, 0x0, "Access rights for the types requested", HFILL } }, @@ -14309,6 +14587,31 @@ proto_register_nfs(void) "eof", "nfs.lisxtattr.eof", FT_UINT32, BASE_DEC, NULL, 0, "Lixtxattr eof", HFILL }}, + { &hf_nfs4_gdd_non_fatal_status, { + "Non-fatal status", "nfs.gdd.non_fatal_status", FT_UINT32, BASE_DEC, + VALS(gdd_non_fatal_status_names), 0, + "GET_DIR_DELEGATION non-fatal status code", HFILL }}, + + { &hf_nfs4_gdd_signal_deleg_avail, { + "Signal delegation available", "nfs.gdd.signal_deleg_avail", FT_BOOLEAN, BASE_NONE, + TFS(&tfs_yes_no), 0x0, NULL, HFILL }}, + + { &hf_nfs4_gdd_child_attr_delay, { + "Child attr notification delay", "nfs.gdd.child_attr_delay", + FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL}}, + + { &hf_nfs4_gdd_dir_attr_delay, { + "Dir attr notification delay", "nfs.gdd.dir_attr_delay", + FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL}}, + + { &hf_nfs4_gdd_child_attrs, { + "Child notification attrs", "nfs.gdd.child_attrs", + FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL}}, + + { &hf_nfs4_gdd_dir_attrs, { + "Dir notification attrs", "nfs.gdd.dir_attrs", + FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL}}, + { &hf_nfs4_ff_local, { "client used cache?", "nfs.ff.local", FT_BOOLEAN, BASE_NONE, TFS(&tfs_yes_no), 0x0, NULL, HFILL }}, @@ -14387,7 +14690,7 @@ proto_register_nfs(void) &names_nfs_nfsstat_ext, 0, "Reply status", HFILL }} }; - static gint *ett[] = { + static int *ett[] = { &ett_nfs, &ett_nfs_fh_encoding, &ett_nfs_fh_fsid, @@ -14495,6 +14798,7 @@ proto_register_nfs(void) &ett_nfs4_create_session, &ett_nfs4_destroy_session, &ett_nfs4_free_stateid, + &ett_nfs4_get_dir_delegation, &ett_nfs4_secinfo_no_name, &ett_nfs4_sequence, &ett_nfs4_layoutget, @@ -14619,8 +14923,9 @@ proto_register_nfs(void) &ett_nfs4_fh_pd_flags, &ett_nfs4_fh_pd_sites, &ett_nfs4_fh_pd_spaces, - &ett_nfs4_listxattr_names - + &ett_nfs4_listxattr_names, + &ett_nfs4_notify_delay, + &ett_nfs4_notify_attrs, }; static ei_register_info ei[] = { @@ -14661,6 +14966,10 @@ proto_register_nfs(void) /* "protocols" registered just for ONC-RPC Service Response Time */ proto_nfs_cb = proto_register_protocol_in_name_only("Network File System CB", "NFS CB", "nfs.cb", proto_nfs, FT_PROTOCOL); + /* "protocol" registered just for NFSv4 Service Response Time (the + * protocol short name is used for, e.g. the GUI menu item.) */ + proto_nfsv4 = proto_register_protocol_in_name_only("Network File System v4", "NFSv4", "nfsv4", proto_nfs, FT_PROTOCOL); + proto_register_field_array(proto_nfs, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_nfs = expert_register_protocol(proto_nfs); @@ -14705,6 +15014,10 @@ proto_register_nfs(void) nfs_fhandle_table = register_decode_as_next_proto(proto_nfs, "nfs_fhandle.type", "NFS File Handle types", nfs_prompt); + + nfsv4_tap = register_tap("nfsv4"); + + register_srt_table(proto_nfsv4, "nfsv4", 1, nfsstat_packet, nfsstat_init, NULL); } |