4 * Copyright (c) 1997-2009 Erez Zadok
5 * Copyright (c) 1990 Jan-Simon Pendry
6 * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
7 * Copyright (c) 1990 The Regents of the University of California.
10 * This code is derived from software contributed to Berkeley by
11 * Jan-Simon Pendry at Imperial College, London.
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions
16 * 1. Redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer.
18 * 2. Redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in the
20 * documentation and/or other materials provided with the distribution.
21 * 3. All advertising materials mentioning features or use of this software
22 * must display the following acknowledgment:
23 * This product includes software developed by the University of
24 * California, Berkeley and its contributors.
25 * 4. Neither the name of the University nor the names of its contributors
26 * may be used to endorse or promote products derived from this software
27 * without specific prior written permission.
29 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
30 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
31 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
32 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
33 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
34 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
35 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
38 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
42 * File: am-utils/include/am_xdr_func.h
48 #define AM_FHSIZE3 64 /* size in bytes of a file handle (v3) */
49 #define AM_MOUNTVERS3 ((unsigned long)(3))
54 char am_fh3_data
[AM_FHSIZE3
];
56 typedef struct am_nfs_fh3 am_nfs_fh3
;
58 #define AM_NFSPROC3_LOOKUP ((u_long) 3)
65 AM_NFS3ERR_ACCES
= 13,
66 AM_NFS3ERR_EXIST
= 17,
68 AM_NFS3ERR_NODEV
= 19,
69 AM_NFS3ERR_NOTDIR
= 20,
70 AM_NFS3ERR_ISDIR
= 21,
71 AM_NFS3ERR_INVAL
= 22,
73 AM_NFS3ERR_NOSPC
= 28,
75 AM_NFS3ERR_MLINK
= 31,
76 AM_NFS3ERR_NAMETOOLONG
= 63,
77 AM_NFS3ERR_NOTEMPTY
= 66,
78 AM_NFS3ERR_DQUOT
= 69,
79 AM_NFS3ERR_STALE
= 70,
80 AM_NFS3ERR_REMOTE
= 71,
81 AM_NFS3ERR_BADHANDLE
= 10001,
82 AM_NFS3ERR_NOT_SYNC
= 10002,
83 AM_NFS3ERR_BAD_COOKIE
= 10003,
84 AM_NFS3ERR_NOTSUPP
= 10004,
85 AM_NFS3ERR_TOOSMALL
= 10005,
86 AM_NFS3ERR_SERVERFAULT
= 10006,
87 AM_NFS3ERR_BADTYPE
= 10007,
88 AM_NFS3ERR_JUKEBOX
= 10008
90 typedef enum am_nfsstat3 am_nfsstat3
;
100 AM_MNT3ERR_NOENT
= 2,
102 AM_MNT3ERR_ACCES
= 13,
103 AM_MNT3ERR_NOTDIR
= 20,
104 AM_MNT3ERR_INVAL
= 22,
105 AM_MNT3ERR_NAMETOOLONG
= 63,
106 AM_MNT3ERR_NOTSUPP
= 10004,
107 AM_MNT3ERR_SERVERFAULT
= 10006
109 typedef enum am_mountstat3 am_mountstat3
;
111 struct am_mountres3_ok
{
114 u_int auth_flavors_len
;
115 int *auth_flavors_val
;
118 typedef struct am_mountres3_ok am_mountres3_ok
;
120 struct am_mountres3
{
121 am_mountstat3 fhs_status
;
123 am_mountres3_ok mountinfo
;
126 typedef struct am_mountres3 am_mountres3
;
128 typedef char *am_filename3
;
130 struct am_diropargs3
{
134 typedef struct am_diropargs3 am_diropargs3
;
136 struct am_LOOKUP3args
{
139 typedef struct am_LOOKUP3args am_LOOKUP3args
;
141 struct am_LOOKUP3resok
{
144 post_op_attr obj_attributes
;
145 post_op_attr dir_attributes
;
148 typedef struct am_LOOKUP3resok am_LOOKUP3resok
;
150 struct am_LOOKUP3resfail
{
152 post_op_attr dir_attributes
;
154 char dummy
; /* cannot have an empty declaration */
157 typedef struct am_LOOKUP3resfail am_LOOKUP3resfail
;
159 struct am_LOOKUP3res
{
163 am_LOOKUP3resfail fail
;
166 typedef struct am_LOOKUP3res am_LOOKUP3res
;
167 #endif /* HAVE_FS_NFS3 */
170 * Multi-protocol NFS file handle
172 union am_nfs_handle
{
173 /* placeholder for V4 file handle */
175 am_nfs_fh3 v3
; /* NFS version 3 handle */
176 #endif /* HAVE_FS_NFS3 */
177 am_nfs_fh v2
; /* NFS version 2 handle */
179 typedef union am_nfs_handle am_nfs_handle_t
;
183 * Definitions of all possible xdr functions that are otherwise
184 * not defined elsewhere.
187 #ifndef _AM_XDR_FUNC_H
188 #define _AM_XDR_FUNC_H
190 #ifndef HAVE_XDR_ATTRSTAT
191 bool_t
xdr_attrstat(XDR
*xdrs
, nfsattrstat
*objp
);
192 #endif /* not HAVE_XDR_ATTRSTAT */
193 #ifndef HAVE_XDR_CREATEARGS
194 bool_t
xdr_createargs(XDR
*xdrs
, nfscreateargs
*objp
);
195 #endif /* not HAVE_XDR_CREATEARGS */
196 #ifndef HAVE_XDR_DIRLIST
197 bool_t
xdr_dirlist(XDR
*xdrs
, nfsdirlist
*objp
);
198 #endif /* not HAVE_XDR_DIRLIST */
199 #ifndef HAVE_XDR_DIROPARGS
200 bool_t
xdr_diropargs(XDR
*xdrs
, nfsdiropargs
*objp
);
201 #endif /* not HAVE_XDR_DIROPARGS */
202 #ifndef HAVE_XDR_DIROPOKRES
203 bool_t
xdr_diropokres(XDR
*xdrs
, nfsdiropokres
*objp
);
204 #endif /* not HAVE_XDR_DIROPOKRES */
205 #ifndef HAVE_XDR_DIROPRES
206 bool_t
xdr_diropres(XDR
*xdrs
, nfsdiropres
*objp
);
207 #endif /* not HAVE_XDR_DIROPRES */
208 #ifndef HAVE_XDR_DIRPATH
209 bool_t
xdr_dirpath(XDR
*xdrs
, dirpath
*objp
);
210 #endif /* not HAVE_XDR_DIRPATH */
211 #ifndef HAVE_XDR_ENTRY
212 bool_t
xdr_entry(XDR
*xdrs
, nfsentry
*objp
);
213 #endif /* not HAVE_XDR_ENTRY */
214 #ifndef HAVE_XDR_EXPORTNODE
215 bool_t
xdr_exportnode(XDR
*xdrs
, exportnode
*objp
);
216 #endif /* not HAVE_XDR_EXPORTNODE */
217 #ifndef HAVE_XDR_EXPORTS
218 bool_t
xdr_exports(XDR
*xdrs
, exports
*objp
);
219 #endif /* not HAVE_XDR_EXPORTS */
220 #ifndef HAVE_XDR_FATTR
221 bool_t
xdr_fattr(XDR
*xdrs
, nfsfattr
*objp
);
222 #endif /* not HAVE_XDR_FATTR */
223 #ifndef HAVE_XDR_FHANDLE
224 bool_t
xdr_fhandle(XDR
*xdrs
, fhandle objp
);
225 #endif /* not HAVE_XDR_FHANDLE */
226 #ifndef HAVE_XDR_FHSTATUS
227 bool_t
xdr_fhstatus(XDR
*xdrs
, fhstatus
*objp
);
228 #endif /* not HAVE_XDR_FHSTATUS */
229 #ifndef HAVE_XDR_FILENAME
230 bool_t
xdr_filename(XDR
*xdrs
, filename
*objp
);
231 #endif /* not HAVE_XDR_FILENAME */
232 #ifndef HAVE_XDR_FTYPE
233 bool_t
xdr_ftype(XDR
*xdrs
, nfsftype
*objp
);
234 #endif /* not HAVE_XDR_FTYPE */
235 #ifndef HAVE_XDR_GROUPNODE
236 bool_t
xdr_groupnode(XDR
*xdrs
, groupnode
*objp
);
237 #endif /* not HAVE_XDR_GROUPNODE */
238 #ifndef HAVE_XDR_GROUPS
239 bool_t
xdr_groups(XDR
*xdrs
, groups
*objp
);
240 #endif /* not HAVE_XDR_GROUPS */
241 #ifndef HAVE_XDR_LINKARGS
242 bool_t
xdr_linkargs(XDR
*xdrs
, nfslinkargs
*objp
);
243 #endif /* not HAVE_XDR_LINKARGS */
244 #ifndef HAVE_XDR_MOUNTBODY
245 bool_t
xdr_mountbody(XDR
*xdrs
, mountbody
*objp
);
246 #endif /* not HAVE_XDR_MOUNTBODY */
247 #ifndef HAVE_XDR_MOUNTLIST
248 bool_t
xdr_mountlist(XDR
*xdrs
, mountlist
*objp
);
249 #endif /* not HAVE_XDR_MOUNTLIST */
250 #ifndef HAVE_XDR_NAME
251 bool_t
xdr_name(XDR
*xdrs
, name
*objp
);
252 #endif /* not HAVE_XDR_NAME */
253 #ifndef HAVE_XDR_NFS_FH
254 bool_t
xdr_nfs_fh(XDR
*xdrs
, am_nfs_fh
*objp
);
255 #endif /* not HAVE_XDR_NFS_FH */
256 #ifndef HAVE_XDR_NFSCOOKIE
257 bool_t
xdr_nfscookie(XDR
*xdrs
, nfscookie objp
);
258 #endif /* not HAVE_XDR_NFSCOOKIE */
259 #ifndef HAVE_XDR_NFSPATH
260 bool_t
xdr_nfspath(XDR
*xdrs
, nfspath
*objp
);
261 #endif /* not HAVE_XDR_NFSPATH */
262 #ifndef HAVE_XDR_NFSSTAT
263 bool_t
xdr_nfsstat(XDR
*xdrs
, nfsstat
*objp
);
264 #endif /* not HAVE_XDR_NFSSTAT */
265 #ifndef HAVE_XDR_NFSTIME
266 bool_t
xdr_nfstime(XDR
*xdrs
, nfstime
*objp
);
267 #endif /* not HAVE_XDR_NFSTIME */
268 #ifndef HAVE_XDR_POINTER
269 bool_t
xdr_pointer(register XDR
*xdrs
, char **objpp
, u_int obj_size
, XDRPROC_T_TYPE xdr_obj
);
270 #endif /* not HAVE_XDR_POINTER */
271 #ifndef HAVE_XDR_READARGS
272 bool_t
xdr_readargs(XDR
*xdrs
, nfsreadargs
*objp
);
273 #endif /* not HAVE_XDR_READARGS */
274 #ifndef HAVE_XDR_READDIRARGS
275 bool_t
xdr_readdirargs(XDR
*xdrs
, nfsreaddirargs
*objp
);
276 #endif /* not HAVE_XDR_READDIRARGS */
277 #ifndef HAVE_XDR_READDIRRES
278 bool_t
xdr_readdirres(XDR
*xdrs
, nfsreaddirres
*objp
);
279 #endif /* not HAVE_XDR_READDIRRES */
280 #ifndef HAVE_XDR_READLINKRES
281 bool_t
xdr_readlinkres(XDR
*xdrs
, nfsreadlinkres
*objp
);
282 #endif /* not HAVE_XDR_READLINKRES */
283 #ifndef HAVE_XDR_READOKRES
284 bool_t
xdr_readokres(XDR
*xdrs
, nfsreadokres
*objp
);
285 #endif /* not HAVE_XDR_READOKRES */
286 #ifndef HAVE_XDR_READRES
287 bool_t
xdr_readres(XDR
*xdrs
, nfsreadres
*objp
);
288 #endif /* not HAVE_XDR_READRES */
289 #ifndef HAVE_XDR_RENAMEARGS
290 bool_t
xdr_renameargs(XDR
*xdrs
, nfsrenameargs
*objp
);
291 #endif /* not HAVE_XDR_RENAMEARGS */
292 #ifndef HAVE_XDR_SATTR
293 bool_t
xdr_sattr(XDR
*xdrs
, nfssattr
*objp
);
294 #endif /* not HAVE_XDR_SATTR */
295 #ifndef HAVE_XDR_SATTRARGS
296 bool_t
xdr_sattrargs(XDR
*xdrs
, nfssattrargs
*objp
);
297 #endif /* not HAVE_XDR_SATTRARGS */
298 #ifndef HAVE_XDR_STATFSOKRES
299 bool_t
xdr_statfsokres(XDR
*xdrs
, nfsstatfsokres
*objp
);
300 #endif /* not HAVE_XDR_STATFSOKRES */
301 #ifndef HAVE_XDR_STATFSRES
302 bool_t
xdr_statfsres(XDR
*xdrs
, nfsstatfsres
*objp
);
303 #endif /* not HAVE_XDR_STATFSRES */
304 #ifndef HAVE_XDR_SYMLINKARGS
305 bool_t
xdr_symlinkargs(XDR
*xdrs
, nfssymlinkargs
*objp
);
306 #endif /* not HAVE_XDR_SYMLINKARGS */
307 #ifndef HAVE_XDR_WRITEARGS
308 bool_t
xdr_writeargs(XDR
*xdrs
, nfswriteargs
*objp
);
309 #endif /* not HAVE_XDR_WRITEARGS */
312 * NFS3 XDR FUNCTIONS:
315 bool_t
xdr_am_fhandle3(XDR
*xdrs
, am_fhandle3
*objp
);
316 bool_t
xdr_am_mountstat3(XDR
*xdrs
, am_mountstat3
*objp
);
317 bool_t
xdr_am_mountres3_ok(XDR
*xdrs
, am_mountres3_ok
*objp
);
318 bool_t
xdr_am_mountres3(XDR
*xdrs
, am_mountres3
*objp
);
319 bool_t
xdr_am_diropargs3(XDR
*xdrs
, am_diropargs3
*objp
);
320 bool_t
xdr_am_filename3(XDR
*xdrs
, am_filename3
*objp
);
321 bool_t
xdr_am_LOOKUP3args(XDR
*xdrs
, am_LOOKUP3args
*objp
);
322 bool_t
xdr_am_LOOKUP3res(XDR
*xdrs
, am_LOOKUP3res
*objp
);
323 bool_t
xdr_am_LOOKUP3resfail(XDR
*xdrs
, am_LOOKUP3resfail
*objp
);
324 bool_t
xdr_am_LOOKUP3resok(XDR
*xdrs
, am_LOOKUP3resok
*objp
);
325 bool_t
xdr_am_nfsstat3(XDR
*xdrs
, am_nfsstat3
*objp
);
326 bool_t
xdr_am_nfs_fh3(XDR
*xdrs
, am_nfs_fh3
*objp
);
327 #endif /* HAVE_FS_NFS3 */
329 #endif /* not _AM_XDR_FUNC_H */