1 /* NFSv4.1 client for Windows
2 * Copyright © 2012 The Regents of the University of Michigan
4 * Olga Kornievskaia <aglo@umich.edu>
5 * Casey Bodley <cbodley@umich.edu>
7 * This library is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as published by
9 * the Free Software Foundation; either version 2.1 of the License, or (at
10 * your option) any later version.
12 * This library is distributed in the hope that it will be useful, but
13 * without any warranty; without even the implied warranty of merchantability
14 * or fitness for a particular purpose. See the GNU Lesser General Public
15 * License for more details.
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this library; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22 #ifndef __NFS41_DAEMON_TYPES_H__
23 #define __NFS41_DAEMON_TYPES_H__
27 #include "nfs41_const.h"
29 typedef char* caddr_t
;
31 static const int64_t NFS4_INT64_MAX
= 0x7fffffffffffffff;
32 static const uint64_t NFS4_UINT64_MAX
= 0xffffffffffffffff;
33 static const int32_t NFS4_INT32_MAX
= 0x7fffffff;
34 static const uint32_t NFS4_UINT32_MAX
= 0xffffffff;
36 static const uint64_t NFS4_MAXFILELEN
= 0xffffffffffffffff;
37 static const uint64_t NFS4_MAXFILEOFF
= 0xfffffffffffffffe;
40 /* common nfs types */
41 typedef struct __nfs41_abs_path
{
42 char path
[NFS41_MAX_PATH_LEN
];
47 typedef struct __nfs41_component
{
52 typedef struct __nfs41_fh
{
53 unsigned char fh
[NFS4_FHSIZE
];
56 struct __nfs41_superblock
*superblock
;
59 typedef struct __nfs41_path_fh
{
65 typedef struct __nfs41_fsid
{
70 typedef struct __nfs41_readdir_cookie
{
72 unsigned char verf
[NFS4_VERIFIER_SIZE
];
73 } nfs41_readdir_cookie
;
75 typedef struct __nfs41_write_verf
{
76 unsigned char verf
[NFS4_VERIFIER_SIZE
];
77 unsigned char expected
[NFS4_VERIFIER_SIZE
];
81 enum stable_how4 committed
;
85 typedef struct __netaddr4
{
86 char netid
[NFS41_NETWORK_ID_LEN
+1];
87 char uaddr
[NFS41_UNIVERSAL_ADDR_LEN
+1];
90 typedef struct __multi_addr4
{
91 netaddr4 arr
[NFS41_ADDRS_PER_SERVER
];
95 typedef struct __bitmap4
{
100 typedef struct __nfstime4
{
105 typedef struct __client_owner4
{
106 unsigned char co_verifier
[NFS4_VERIFIER_SIZE
];
107 uint32_t co_ownerid_len
;
108 unsigned char co_ownerid
[NFS4_OPAQUE_LIMIT
];
111 typedef struct __server_owner4
{
112 uint64_t so_minor_id
;
113 uint32_t so_major_id_len
;
114 char so_major_id
[NFS4_OPAQUE_LIMIT
];
117 typedef struct __state_owner4
{
119 unsigned char owner
[NFS4_OPAQUE_LIMIT
];
122 typedef struct __nfs_impl_id4
{
123 uint32_t nii_domain_len
;
124 unsigned char *nii_domain
;
125 uint32_t nii_name_len
;
126 unsigned char *nii_name
;
130 typedef struct __nfsace4
{
134 char who
[NFS4_OPAQUE_LIMIT
];
137 typedef struct __nfsacl41
{
143 typedef struct __stateid4
{
145 unsigned char other
[NFS4_STATEID_OTHER
];
148 typedef struct __open_delegation4
{
154 enum open_delegation_type4 type
;
159 typedef struct __fattr4
{
161 uint32_t attr_vals_len
;
162 unsigned char attr_vals
[NFS4_OPAQUE_LIMIT
];
165 typedef struct __change_info4
{
171 typedef struct __fs_location_server
{
172 /* 'address' represents one of a traditional DNS host name,
173 * IPv4 address, IPv6 address, or a zero-length string */
174 char address
[NFS41_HOSTNAME_LEN
+1];
175 } fs_location_server
;
177 typedef struct __fs_location4
{
178 nfs41_abs_path path
; /* path to fs from referred server's root */
179 fs_location_server
*servers
;
180 uint32_t server_count
;
183 typedef struct __fs_locations4
{
184 nfs41_abs_path path
; /* path to fs from referring server's root */
185 fs_location4
*locations
;
186 uint32_t location_count
;
197 typedef struct __threshold_item4
{
199 uint64_t hints
[MAX_MDSTHRESH_HINTS
];
202 #define MAX_MDSTHRESHOLD_ITEMS 1
203 typedef struct __mdsthreshold4
{
205 threshold_item4 items
[MAX_MDSTHRESHOLD_ITEMS
];
208 typedef struct __nfs41_file_info
{
210 mdsthreshold4 mdsthreshold
;
211 nfstime4 time_access
;
212 nfstime4 time_create
;
213 nfstime4 time_modify
;
215 nfstime4
*time_delta
; /* XXX: per-fs */
217 bitmap4
*supported_attrs
; /* XXX: per-fs */
218 bitmap4
*suppattr_exclcreat
; /* XXX: per-fs */
219 uint64_t maxread
; /* XXX: per-fs */
220 uint64_t maxwrite
; /* XXX: per-fs */
224 uint64_t space_avail
; /* XXX: per-fs */
225 uint64_t space_free
; /* XXX: per-fs */
226 uint64_t space_total
; /* XXX: per-fs */
229 uint32_t rdattr_error
;
232 fs_locations4
*fs_locations
; /* XXX: per-fs */
233 uint32_t lease_time
; /* XXX: per-server */
234 uint32_t fs_layout_types
; /* pnfs, XXX: per-fs */
238 bool_t cansettime
; /* XXX: per-fs */
239 bool_t case_insensitive
;
240 bool_t case_preserving
;
242 bool_t symlink_support
;
249 #endif /* !__NFS41_DAEMON_TYPES_H__ */