Expand PMF_FN_* macros.
[netbsd-mini2440.git] / external / bsd / am-utils / dist / conf / nfs_prot / nfs_prot_sunos5_5.h
blob80ff4ff8967b6cd5ce608503f60bd699352f00a7
1 /* $NetBSD$ */
3 /*
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.
8 * All rights reserved.
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
15 * are met:
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
39 * SUCH DAMAGE.
42 * File: am-utils/conf/nfs_prot/nfs_prot_sunos5_5.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
52 * for NFS V3 specs.
55 #ifdef HAVE_NFS_NFS_H
56 # include <nfs/nfs.h>
57 #endif /* HAVE_NFS_NFS_H */
59 #ifdef HAVE_RPCSVC_MOUNT_H
60 # include <rpcsvc/mount.h>
61 #endif /* HAVE_RPCSVC_MOUNT_H */
64 * MACROS
67 #define NFS_PORT 2049
68 #define NFS_MAXDATA 8192
69 #define NFS_MAXPATHLEN 1024
70 #define NFS_MAXNAMLEN 255
71 #define NFS_FHSIZE 32
72 #define NFS_COOKIESIZE 4
74 #define NFSMODE_FMT 0170000
75 #define NFSMODE_DIR 0040000
76 #define NFSMODE_CHR 0020000
77 #define NFSMODE_BLK 0060000
78 #define NFSMODE_REG 0100000
79 #define NFSMODE_LNK 0120000
80 #define NFSMODE_SOCK 0140000
81 #define NFSMODE_FIFO 0010000
83 #define NFSPROC_NULL ((unsigned long)(0))
84 #define NFSPROC_GETATTR ((unsigned long)(1))
85 #define NFSPROC_SETATTR ((unsigned long)(2))
86 #define NFSPROC_ROOT ((unsigned long)(3))
87 #define NFSPROC_LOOKUP ((unsigned long)(4))
88 #define NFSPROC_READLINK ((unsigned long)(5))
89 #define NFSPROC_READ ((unsigned long)(6))
90 #define NFSPROC_WRITECACHE ((unsigned long)(7))
91 #define NFSPROC_WRITE ((unsigned long)(8))
92 #define NFSPROC_CREATE ((unsigned long)(9))
93 #define NFSPROC_REMOVE ((unsigned long)(10))
94 #define NFSPROC_RENAME ((unsigned long)(11))
95 #define NFSPROC_LINK ((unsigned long)(12))
96 #define NFSPROC_SYMLINK ((unsigned long)(13))
97 #define NFSPROC_MKDIR ((unsigned long)(14))
98 #define NFSPROC_RMDIR ((unsigned long)(15))
99 #define NFSPROC_READDIR ((unsigned long)(16))
100 #define NFSPROC_STATFS ((unsigned long)(17))
102 #define AUTOFS_CONFTYPE "ticlts"
106 * TYPEDEFS:
109 typedef char *filename;
110 typedef char *nfspath;
111 typedef char nfscookie[NFS_COOKIESIZE];
112 typedef enum nfsftype nfsftype;
113 typedef enum nfsstat nfsstat;
114 typedef struct attrstat nfsattrstat;
115 typedef struct createargs nfscreateargs;
116 typedef struct dirlist nfsdirlist;
117 typedef struct diropargs nfsdiropargs;
118 typedef struct diropokres nfsdiropokres;
119 typedef struct diropres nfsdiropres;
120 typedef struct entry nfsentry;
121 typedef struct fattr nfsfattr;
122 typedef struct linkargs nfslinkargs;
123 typedef struct nfs_fh nfs_fh;
124 typedef struct nfstime nfstime;
125 typedef struct readargs nfsreadargs;
126 typedef struct readdirargs nfsreaddirargs;
127 typedef struct readdirres nfsreaddirres;
128 typedef struct readlinkres nfsreadlinkres;
129 typedef struct readokres nfsreadokres;
130 typedef struct readres nfsreadres;
131 typedef struct renameargs nfsrenameargs;
132 typedef struct sattr nfssattr;
133 typedef struct sattrargs nfssattrargs;
134 typedef struct statfsokres nfsstatfsokres;
135 typedef struct statfsres nfsstatfsres;
136 typedef struct symlinkargs nfssymlinkargs;
137 typedef struct writeargs nfswriteargs;
141 * EXTERNALS:
144 extern bool_t xdr_nfsstat(XDR *, nfsstat *);
145 extern bool_t xdr_ftype(XDR *, nfsftype *);
146 extern bool_t xdr_nfs_fh(XDR *, nfs_fh *);
147 extern bool_t xdr_nfstime(XDR *, nfstime *);
148 extern bool_t xdr_fattr(XDR *, nfsfattr *);
149 extern bool_t xdr_sattr(XDR *, nfssattr *);
150 extern bool_t xdr_filename(XDR *, filename *);
151 extern bool_t xdr_nfspath(XDR *, nfspath *);
152 extern bool_t xdr_attrstat(XDR *, nfsattrstat *);
153 extern bool_t xdr_sattrargs(XDR *, nfssattrargs *);
154 extern bool_t xdr_diropargs(XDR *, nfsdiropargs *);
155 extern bool_t xdr_diropokres(XDR *, nfsdiropokres *);
156 extern bool_t xdr_diropres(XDR *, nfsdiropres *);
157 extern bool_t xdr_readlinkres(XDR *, nfsreadlinkres *);
158 extern bool_t xdr_readargs(XDR *, nfsreadargs *);
159 extern bool_t xdr_readokres(XDR *, nfsreadokres *);
160 extern bool_t xdr_readres(XDR *, nfsreadres *);
161 extern bool_t xdr_writeargs(XDR *, nfswriteargs *);
162 extern bool_t xdr_createargs(XDR *, nfscreateargs *);
163 extern bool_t xdr_renameargs(XDR *, nfsrenameargs *);
164 extern bool_t xdr_linkargs(XDR *, nfslinkargs *);
165 extern bool_t xdr_symlinkargs(XDR *, nfssymlinkargs *);
166 extern bool_t xdr_nfscookie(XDR *, nfscookie);
167 extern bool_t xdr_readdirargs(XDR *, nfsreaddirargs *);
168 extern bool_t xdr_entry(XDR *, nfsentry *);
169 extern bool_t xdr_dirlist(XDR *, nfsdirlist *);
170 extern bool_t xdr_readdirres(XDR *, nfsreaddirres *);
171 extern bool_t xdr_statfsokres(XDR *, nfsstatfsokres *);
172 extern bool_t xdr_statfsres(XDR *, nfsstatfsres *);
174 extern nfsattrstat *nfsproc_getattr_2(nfs_fh *, CLIENT *);
175 extern nfsattrstat *nfsproc_getattr_2_svc(nfs_fh *, struct svc_req *);
176 extern nfsattrstat *nfsproc_setattr_2(nfssattrargs *, CLIENT *);
177 extern nfsattrstat *nfsproc_setattr_2_svc(nfssattrargs *, struct svc_req *);
178 extern nfsattrstat *nfsproc_write_2(nfswriteargs *, CLIENT *);
179 extern nfsattrstat *nfsproc_write_2_svc(nfswriteargs *, struct svc_req *);
180 extern nfsdiropres *nfsproc_create_2(nfscreateargs *, CLIENT *);
181 extern nfsdiropres *nfsproc_create_2_svc(nfscreateargs *, struct svc_req *);
182 extern nfsdiropres *nfsproc_lookup_2(nfsdiropargs *, CLIENT *);
183 extern nfsdiropres *nfsproc_lookup_2_svc(nfsdiropargs *, struct svc_req *);
184 extern nfsdiropres *nfsproc_mkdir_2(nfscreateargs *, CLIENT *);
185 extern nfsdiropres *nfsproc_mkdir_2_svc(nfscreateargs *, struct svc_req *);
186 extern nfsstat *nfsproc_link_2(nfslinkargs *, CLIENT *);
187 extern nfsstat *nfsproc_link_2_svc(nfslinkargs *, struct svc_req *);
188 extern nfsstat *nfsproc_remove_2(nfsdiropargs *, CLIENT *);
189 extern nfsstat *nfsproc_remove_2_svc(nfsdiropargs *, struct svc_req *);
190 extern nfsstat *nfsproc_rename_2(nfsrenameargs *, CLIENT *);
191 extern nfsstat *nfsproc_rename_2_svc(nfsrenameargs *, struct svc_req *);
192 extern nfsstat *nfsproc_rmdir_2(nfsdiropargs *, CLIENT *);
193 extern nfsstat *nfsproc_rmdir_2_svc(nfsdiropargs *, struct svc_req *);
194 extern nfsstat *nfsproc_symlink_2(nfssymlinkargs *, CLIENT *);
195 extern nfsstat *nfsproc_symlink_2_svc(nfssymlinkargs *, struct svc_req *);
196 extern nfsreaddirres *nfsproc_readdir_2(nfsreaddirargs *, CLIENT *);
197 extern nfsreaddirres *nfsproc_readdir_2_svc(nfsreaddirargs *, struct svc_req *);
198 extern nfsreadlinkres *nfsproc_readlink_2(nfs_fh *, CLIENT *);
199 extern nfsreadlinkres *nfsproc_readlink_2_svc(nfs_fh *, struct svc_req *);
200 extern nfsreadres *nfsproc_read_2(nfsreadargs *, CLIENT *);
201 extern nfsreadres *nfsproc_read_2_svc(nfsreadargs *, struct svc_req *);
202 extern nfsstatfsres *nfsproc_statfs_2(nfs_fh *, CLIENT *);
203 extern nfsstatfsres *nfsproc_statfs_2_svc(nfs_fh *, struct svc_req *);
204 extern void *nfsproc_null_2(void *, CLIENT *);
205 extern void *nfsproc_null_2_svc(void *, struct svc_req *);
206 extern void *nfsproc_root_2(void *, CLIENT *);
207 extern void *nfsproc_root_2_svc(void *, struct svc_req *);
208 extern void *nfsproc_writecache_2(void *, CLIENT *);
209 extern void *nfsproc_writecache_2_svc(void *, struct svc_req *);
210 extern int nfs_program_2_freeresult(SVCXPRT *, xdrproc_t, caddr_t);
214 * ENUMS:
219 * STRUCTURES:
222 struct nfs_fh {
223 char fh_data[NFS_FHSIZE];
226 struct nfstime {
227 u_int nt_seconds;
228 u_int nt_useconds;
231 struct fattr {
232 nfsftype na_type;
233 u_int na_mode;
234 u_int na_nlink;
235 u_int na_uid;
236 u_int na_gid;
237 u_int na_size;
238 u_int na_blocksize;
239 u_int na_rdev;
240 u_int na_blocks;
241 u_int na_fsid;
242 u_int na_fileid;
243 nfstime na_atime;
244 nfstime na_mtime;
245 nfstime na_ctime;
248 struct sattr {
249 u_int sa_mode;
250 u_int sa_uid;
251 u_int sa_gid;
252 u_int sa_size;
253 nfstime sa_atime;
254 nfstime sa_mtime;
257 struct attrstat {
258 nfsstat ns_status;
259 union {
260 nfsfattr ns_attr_u;
261 } ns_u;
264 struct sattrargs {
265 nfs_fh sag_fhandle;
266 nfssattr sag_attributes;
269 struct diropargs {
270 nfs_fh da_fhandle; /* was dir */
271 filename da_name;
274 struct diropokres {
275 nfs_fh drok_fhandle;
276 nfsfattr drok_attributes;
279 struct diropres {
280 nfsstat dr_status; /* was status */
281 union {
282 nfsdiropokres dr_drok_u; /* was diropres */
283 } dr_u; /* was diropres_u */
286 struct readlinkres {
287 nfsstat rlr_status;
288 union {
289 nfspath rlr_data_u;
290 } rlr_u;
293 struct readargs {
294 nfs_fh ra_fhandle;
295 u_int ra_offset;
296 u_int ra_count;
297 u_int ra_totalcount;
300 struct readokres {
301 nfsfattr raok_attributes;
302 struct {
303 u_int raok_len_u;
304 char *raok_val_u;
305 } raok_u;
308 struct readres {
309 nfsstat rr_status;
310 union {
311 nfsreadokres rr_reply_u;
312 } rr_u;
315 struct writeargs {
316 nfs_fh wra_fhandle;
317 u_int wra_beginoffset;
318 u_int wra_offset;
319 u_int wra_totalcount;
320 struct {
321 u_int wra_len_u;
322 char *wra_val_u;
323 } wra_u;
326 struct createargs {
327 nfsdiropargs ca_where;
328 nfssattr ca_attributes;
331 struct renameargs {
332 nfsdiropargs rna_from;
333 nfsdiropargs rna_to;
336 struct linkargs {
337 nfs_fh la_fhandle;
338 nfsdiropargs la_to;
341 struct symlinkargs {
342 nfsdiropargs sla_from;
343 nfspath sla_to;
344 nfssattr sla_attributes;
347 struct readdirargs {
348 nfs_fh rda_fhandle;
349 nfscookie rda_cookie;
350 u_int rda_count;
353 struct entry {
354 u_int ne_fileid;
355 filename ne_name;
356 nfscookie ne_cookie;
357 nfsentry *ne_nextentry;
360 struct dirlist {
361 nfsentry *dl_entries;
362 bool_t dl_eof;
365 struct readdirres {
366 nfsstat rdr_status;
367 union {
368 nfsdirlist rdr_reply_u;
369 } rdr_u;
372 struct statfsokres {
373 u_int sfrok_tsize;
374 u_int sfrok_bsize;
375 u_int sfrok_blocks;
376 u_int sfrok_bfree;
377 u_int sfrok_bavail;
380 struct statfsres {
381 nfsstat sfr_status;
382 union {
383 nfsstatfsokres sfr_reply_u;
384 } sfr_u;
387 #endif /* not _AMU_NFS_PROT_H */