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/conf/nfs_prot/nfs_prot_svr4.h
46 #ifndef _AMU_NFS_PROT_H
47 #define _AMU_NFS_PROT_H
50 * Do NOT include <rpcsvc/nfs_prot.h> to get NFS V2 specs, because
51 * it will result in conflicts with <nfs/nfs.h>. The latter is a must
57 #endif /* HAVE_NFS_NFS_H */
59 #ifdef HAVE_RPCSVC_MOUNT_H
60 # include <rpcsvc/mount.h>
61 #endif /* HAVE_RPCSVC_MOUNT_H */
65 #endif /* HAVE_RPC_RPC_H */
73 #define NFS_MAXDATA 8192
74 #define NFS_MAXPATHLEN 1024
75 #define NFS_MAXNAMLEN 255
77 #define NFS_COOKIESIZE 4
79 #define NFSMODE_FMT 0170000
80 #define NFSMODE_DIR 0040000
81 #define NFSMODE_CHR 0020000
82 #define NFSMODE_BLK 0060000
83 #define NFSMODE_REG 0100000
84 #define NFSMODE_LNK 0120000
85 #define NFSMODE_SOCK 0140000
86 #define NFSMODE_FIFO 0010000
88 #define NFSPROC_NULL ((unsigned long)(0))
89 #define NFSPROC_GETATTR ((unsigned long)(1))
90 #define NFSPROC_SETATTR ((unsigned long)(2))
91 #define NFSPROC_ROOT ((unsigned long)(3))
92 #define NFSPROC_LOOKUP ((unsigned long)(4))
93 #define NFSPROC_READLINK ((unsigned long)(5))
94 #define NFSPROC_READ ((unsigned long)(6))
95 #define NFSPROC_WRITECACHE ((unsigned long)(7))
96 #define NFSPROC_WRITE ((unsigned long)(8))
97 #define NFSPROC_CREATE ((unsigned long)(9))
98 #define NFSPROC_REMOVE ((unsigned long)(10))
99 #define NFSPROC_RENAME ((unsigned long)(11))
100 #define NFSPROC_LINK ((unsigned long)(12))
101 #define NFSPROC_SYMLINK ((unsigned long)(13))
102 #define NFSPROC_MKDIR ((unsigned long)(14))
103 #define NFSPROC_RMDIR ((unsigned long)(15))
104 #define NFSPROC_READDIR ((unsigned long)(16))
105 #define NFSPROC_STATFS ((unsigned long)(17))
107 /* map field names */
108 #define ml_hostname ml_name
109 #define ml_directory ml_path
110 #define ml_next ml_nxt
111 #define gr_next g_next
112 #define gr_name g_name
113 #define ex_dir ex_name
118 typedef char *dirpath
;
119 typedef char *filename
;
120 typedef char *nfspath
;
121 typedef char nfscookie
[NFS_COOKIESIZE
];
122 typedef enum nfsftype nfsftype
;
123 typedef enum nfsstat nfsstat
;
124 typedef struct attrstat nfsattrstat
;
125 typedef struct createargs nfscreateargs
;
126 typedef struct dirlist nfsdirlist
;
127 typedef struct diropargs nfsdiropargs
;
128 typedef struct diropokres nfsdiropokres
;
129 typedef struct diropres nfsdiropres
;
130 typedef struct entry nfsentry
;
131 typedef struct fattr nfsfattr
;
132 typedef struct linkargs nfslinkargs
;
133 typedef struct nfs_fh nfs_fh
;
134 typedef struct nfstime nfstime
;
135 typedef struct readargs nfsreadargs
;
136 typedef struct readdirargs nfsreaddirargs
;
137 typedef struct readdirres nfsreaddirres
;
138 typedef struct readlinkres nfsreadlinkres
;
139 typedef struct readokres nfsreadokres
;
140 typedef struct readres nfsreadres
;
141 typedef struct renameargs nfsrenameargs
;
142 typedef struct sattr nfssattr
;
143 typedef struct sattrargs nfssattrargs
;
144 typedef struct statfsokres nfsstatfsokres
;
145 typedef struct statfsres nfsstatfsres
;
146 typedef struct symlinkargs nfssymlinkargs
;
147 typedef struct writeargs nfswriteargs
;
150 typedef fhandle_t fhandle
;
151 typedef struct exports
*exports
;
152 typedef struct exports exportnode
;
153 typedef struct fhstatus fhstatus
;
154 typedef struct groups
*groups
;
155 typedef struct groups groupnode
;
156 typedef struct mountlist
*mountlist
;
157 typedef struct mountlist mountbody
;
164 extern bool_t
xdr_nfsstat(XDR
*, nfsstat
*);
165 extern bool_t
xdr_ftype(XDR
*, nfsftype
*);
166 extern bool_t
xdr_nfs_fh(XDR
*, nfs_fh
*);
167 extern bool_t
xdr_nfstime(XDR
*, nfstime
*);
168 extern bool_t
xdr_fattr(XDR
*, nfsfattr
*);
169 extern bool_t
xdr_sattr(XDR
*, nfssattr
*);
170 extern bool_t
xdr_filename(XDR
*, filename
*);
171 extern bool_t
xdr_nfspath(XDR
*, nfspath
*);
172 extern bool_t
xdr_attrstat(XDR
*, nfsattrstat
*);
173 extern bool_t
xdr_sattrargs(XDR
*, nfssattrargs
*);
174 extern bool_t
xdr_diropargs(XDR
*, nfsdiropargs
*);
175 extern bool_t
xdr_diropokres(XDR
*, nfsdiropokres
*);
176 extern bool_t
xdr_diropres(XDR
*, nfsdiropres
*);
177 extern bool_t
xdr_readlinkres(XDR
*, nfsreadlinkres
*);
178 extern bool_t
xdr_readargs(XDR
*, nfsreadargs
*);
179 extern bool_t
xdr_readokres(XDR
*, nfsreadokres
*);
180 extern bool_t
xdr_readres(XDR
*, nfsreadres
*);
181 extern bool_t
xdr_writeargs(XDR
*, nfswriteargs
*);
182 extern bool_t
xdr_createargs(XDR
*, nfscreateargs
*);
183 extern bool_t
xdr_renameargs(XDR
*, nfsrenameargs
*);
184 extern bool_t
xdr_linkargs(XDR
*, nfslinkargs
*);
185 extern bool_t
xdr_symlinkargs(XDR
*, nfssymlinkargs
*);
186 extern bool_t
xdr_nfscookie(XDR
*, nfscookie
);
187 extern bool_t
xdr_readdirargs(XDR
*, nfsreaddirargs
*);
188 extern bool_t
xdr_entry(XDR
*, nfsentry
*);
189 extern bool_t
xdr_dirlist(XDR
*, nfsdirlist
*);
190 extern bool_t
xdr_readdirres(XDR
*, nfsreaddirres
*);
191 extern bool_t
xdr_statfsokres(XDR
*, nfsstatfsokres
*);
192 extern bool_t
xdr_statfsres(XDR
*, nfsstatfsres
*);
194 extern nfsattrstat
*nfsproc_getattr_2(nfs_fh
*, CLIENT
*);
195 extern nfsattrstat
*nfsproc_getattr_2_svc(nfs_fh
*, struct svc_req
*);
196 extern nfsattrstat
*nfsproc_setattr_2(nfssattrargs
*, CLIENT
*);
197 extern nfsattrstat
*nfsproc_setattr_2_svc(nfssattrargs
*, struct svc_req
*);
198 extern nfsattrstat
*nfsproc_write_2(nfswriteargs
*, CLIENT
*);
199 extern nfsattrstat
*nfsproc_write_2_svc(nfswriteargs
*, struct svc_req
*);
200 extern nfsdiropres
*nfsproc_create_2(nfscreateargs
*, CLIENT
*);
201 extern nfsdiropres
*nfsproc_create_2_svc(nfscreateargs
*, struct svc_req
*);
202 extern nfsdiropres
*nfsproc_lookup_2(nfsdiropargs
*, CLIENT
*);
203 extern nfsdiropres
*nfsproc_lookup_2_svc(nfsdiropargs
*, struct svc_req
*);
204 extern nfsdiropres
*nfsproc_mkdir_2(nfscreateargs
*, CLIENT
*);
205 extern nfsdiropres
*nfsproc_mkdir_2_svc(nfscreateargs
*, struct svc_req
*);
206 extern nfsstat
*nfsproc_link_2(nfslinkargs
*, CLIENT
*);
207 extern nfsstat
*nfsproc_link_2_svc(nfslinkargs
*, struct svc_req
*);
208 extern nfsstat
*nfsproc_remove_2(nfsdiropargs
*, CLIENT
*);
209 extern nfsstat
*nfsproc_remove_2_svc(nfsdiropargs
*, struct svc_req
*);
210 extern nfsstat
*nfsproc_rename_2(nfsrenameargs
*, CLIENT
*);
211 extern nfsstat
*nfsproc_rename_2_svc(nfsrenameargs
*, struct svc_req
*);
212 extern nfsstat
*nfsproc_rmdir_2(nfsdiropargs
*, CLIENT
*);
213 extern nfsstat
*nfsproc_rmdir_2_svc(nfsdiropargs
*, struct svc_req
*);
214 extern nfsstat
*nfsproc_symlink_2(nfssymlinkargs
*, CLIENT
*);
215 extern nfsstat
*nfsproc_symlink_2_svc(nfssymlinkargs
*, struct svc_req
*);
216 extern nfsreaddirres
*nfsproc_readdir_2(nfsreaddirargs
*, CLIENT
*);
217 extern nfsreaddirres
*nfsproc_readdir_2_svc(nfsreaddirargs
*, struct svc_req
*);
218 extern nfsreadlinkres
*nfsproc_readlink_2(nfs_fh
*, CLIENT
*);
219 extern nfsreadlinkres
*nfsproc_readlink_2_svc(nfs_fh
*, struct svc_req
*);
220 extern nfsreadres
*nfsproc_read_2(nfsreadargs
*, CLIENT
*);
221 extern nfsreadres
*nfsproc_read_2_svc(nfsreadargs
*, struct svc_req
*);
222 extern nfsstatfsres
*nfsproc_statfs_2(nfs_fh
*, CLIENT
*);
223 extern nfsstatfsres
*nfsproc_statfs_2_svc(nfs_fh
*, struct svc_req
*);
224 extern void *nfsproc_null_2(void *, CLIENT
*);
225 extern void *nfsproc_null_2_svc(void *, struct svc_req
*);
226 extern void *nfsproc_root_2(void *, CLIENT
*);
227 extern void *nfsproc_root_2_svc(void *, struct svc_req
*);
228 extern void *nfsproc_writecache_2(void *, CLIENT
*);
229 extern void *nfsproc_writecache_2_svc(void *, struct svc_req
*);
230 extern int nfs_program_2_freeresult(SVCXPRT
*, xdrproc_t
, caddr_t
);
243 char fh_data
[NFS_FHSIZE
];
286 nfssattr sag_attributes
;
290 nfs_fh da_fhandle
; /* was dir */
296 nfsfattr drok_attributes
;
300 nfsstat dr_status
; /* was status */
302 nfsdiropokres dr_drok_u
; /* was diropres */
303 } dr_u
; /* was diropres_u */
321 nfsfattr raok_attributes
;
331 nfsreadokres rr_reply_u
;
337 u_int wra_beginoffset
;
339 u_int wra_totalcount
;
347 nfsdiropargs ca_where
;
348 nfssattr ca_attributes
;
352 nfsdiropargs rna_from
;
362 nfsdiropargs sla_from
;
364 nfssattr sla_attributes
;
369 nfscookie rda_cookie
;
377 nfsentry
*ne_nextentry
;
381 nfsentry
*dl_entries
;
388 nfsdirlist rdr_reply_u
;
403 nfsstatfsokres sfr_reply_u
;
407 #endif /* not _AMU_NFS_PROT_H */