xref: /netbsd-src/external/bsd/am-utils/dist/conf/nfs_prot/nfs_prot_aix5_2.h (revision 8bae5d409deb915cf7c8f0539fae22ff2cb8a313)
1 /*	$NetBSD: nfs_prot_aix5_2.h,v 1.1.1.3 2015/01/17 16:34:16 christos Exp $	*/
2 
3 /*
4  * Copyright (c) 1997-2014 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.
9  *
10  * This code is derived from software contributed to Berkeley by
11  * Jan-Simon Pendry at Imperial College, London.
12  *
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. Neither the name of the University nor the names of its contributors
22  *    may be used to endorse or promote products derived from this software
23  *    without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35  * SUCH DAMAGE.
36  *
37  *
38  * File: am-utils/conf/nfs_prot/nfs_prot_aix5_2.h
39  *
40  */
41 
42 #ifndef _AMU_NFS_PROT_H
43 #define _AMU_NFS_PROT_H
44 
45 
46 /*
47  * AIX 5.2 has a different aix5_nfs_args structure, hence the separate header.
48  */
49 
50 #ifdef HAVE_RPCSVC_NFS_PROT_H
51 # include <rpcsvc/nfs_prot.h>
52 #endif /* HAVE_RPCSVC_NFS_PROT_H */
53 #ifdef HAVE_NFS_NFSV2_H
54 # include <nfs/nfsv2.h>
55 #endif /* HAVE_NFS_NFSV2_H */
56 #ifdef HAVE_NFS_RPCV2_H
57 # include <nfs/rpcv2.h>
58 #endif /* HAVE_NFS_RPCV2_H */
59 #ifdef HAVE_SYS_FS_NFS_H
60 # include <sys/fs/nfs.h>
61 #endif /* HAVE_SYS_FS_NFS_H */
62 #ifdef HAVE_RPCSVC_MOUNT_H
63 /*
64  * AIX 5.2 wants 'struct pathcnf', but I couldn't find its definition
65  * anywhere.  Luckily, amd doesn't need the size of this structure in
66  * any other structure that it uses.  So we sidestep it for now.
67  */
68 struct pathcnf;
69 # include <rpcsvc/mount.h>
70 #endif /* HAVE_RPCSVC_MOUNT_H */
71 #ifdef HAVE_SYS_VFS_H
72 /* AIX 5.3 (ppc) wants definition of kernel-specific structure */
73 struct thread_credentials;
74 #endif /* HAVE_SYS_VFS_H */
75 
76 /*
77  * MACROS
78  */
79 
80 #ifndef MNTPATHLEN
81 # define MNTPATHLEN 1024
82 #endif /* not MNTPATHLEN */
83 #ifndef MNTNAMLEN
84 # define MNTNAMLEN 255
85 #endif /* not MNTNAMLEN */
86 
87 /* compatible macro name with other OSs */
88 #ifdef UVMNT_FORCE
89 # define MS_FORCE UVMNT_FORCE
90 #endif /* UVMNT_FORCE */
91 
92 /********************************************************************************/
93 /*
94  * NFS mount option flags (out of mount.h)
95  * Maybe one day IBM will include them in system headers.
96  */
97 #ifndef MNTOPT_ACDIRMAX
98 # define MNTOPT_ACDIRMAX "acdirmax" /* max ac timeout for dirs (sec) */
99 # define MNTOPT_ACDIRMIN "acdirmin" /* min ac timeout for dirs (sec) */
100 # define MNTOPT_ACREGMAX "acregmax" /* max ac timeout for reg files (sec) */
101 # define MNTOPT_ACREGMIN "acregmin" /* min ac timeout for reg files (sec) */
102 # define MNTOPT_ACTIMEO  "actimeo" /* attr cache timeout (sec) */
103 # define MNTOPT_BG       "bg" /* mount op in background if 1st attempt fails */
104 # define MNTOPT_FASTATTR "fastattr" /* no sync_vp in nfs3_getattr */
105 # define MNTOPT_FG       "fg" /* mount op in fg if 1st attempt fails, default */
106 # define MNTOPT_GRPID    "grpid" /* SysV-compatible group-id on create */
107 # define MNTOPT_HARD     "hard"  /* hard mount (default) */
108 # define MNTOPT_INTR     "intr"  /* allow interrupts on hard mount */
109 # define MNTOPT_NOAC     "noac"  /* don't cache file attributes */
110 # define MNTOPT_NOACL	"noacl"  /* don't read acl's from server - default */
111 # define MNTOPT_ACL	"acl"  /* read acl's from server means we load ksec */
112 # define MNTOPT_NOAUTO   "noauto"/* hide entry from mount -a */
113 # define MNTOPT_NOCTO    "nocto" /* no "close to open" attr consistency */
114 # define MNTOPT_NODEV    "nodev" /*don't allow opening of devices accross mount*/
115 # define MNTOPT_NOINTR   "nointr" /* don't allow interrupts on hard mounts */
116 # define MNTOPT_NOQUOTA  "noquota" /* don't check quotas */
117 # define MNTOPT_NOSUID   "nosuid" /* no set uid allowed */
118 # define MNTOPT_BSY	"bsy"
119 # define MNTOPT_PORT     "port"  /* server IP port number */
120 # define MNTOPT_POSIX    "posix" /* ask for static pathconf values from mountd */
121 # define MNTOPT_QUOTA    "quota" /* quotas */
122 # define MNTOPT_RETRANS  "retrans" /* set number of request retries */
123 # define MNTOPT_RETRYS   "retry" /* # of times mount is attempted, def=10000*/
124 # define MNTOPT_RMNT     "remount" /* remount to rw if mode ro */
125 # define MNTOPT_RO       "ro"    /* read only */
126 # define MNTOPT_RSIZE    "rsize" /* set read size (bytes) */
127 # define MNTOPT_RW       "rw"    /* read/write */
128 # define MNTOPT_SECURE   "secure"/* use secure RPC for NFS */
129 # define MNTOPT_SHORTDEV "shortdev" /* server dev */
130 # define MNTOPT_SOFT     "soft"  /* soft mount */
131 # define MNTOPT_TIMEO    "timeo" /* set initial timeout (1/10 sec) */
132 # define MNTOPT_WSIZE    "wsize" /* set write size (bytes) */
133 # define MNTOPT_VERS "vers"      /* protocol version number indicator */
134 # define MNTOPT_PROTO    "proto"     /* protocol network_id indicator */
135 # define MNTOPT_LLOCK    "llock"     /* Local locking (no lock manager) */
136 # define MNTOPT_BIODS    "biods"     /* max biods per mount */
137 # define MNTOPT_EXTATTR  "extraattr" /* extended attribute usage */
138 # define MNTOPT_COMBEHND "combehind" /* extended attribute usage */
139 # define MNTOPT_NUMCLUST "numclust"  /* max numclust per mount */
140 # define MNTOPT_NODIRCACHE   "nodircache"    /* No readdir cache */
141 
142 # define NFSMNT_NOACL    0x0     /* turn off acl support (not supported) */
143 # define NFSMNT_SHORTDEV 0x0     /* server does not support 32-bit device no.
144                                    (not supported) */
145 # define NFSMNT_SOFT	0x001	/* soft mount (hard is default) */
146 # define NFSMNT_WSIZE	0x002	/* set write size */
147 # define NFSMNT_RSIZE	0x004	/* set read size */
148 # define NFSMNT_TIMEO	0x008	/* set initial timeout */
149 # define NFSMNT_RETRANS	0x010	/* set number of request retrys */
150 # define NFSMNT_HOSTNAME	0x020	/* set hostname for error printf */
151 # define NFSMNT_INT	0x040	/* allow interrupts on hard mount */
152 # define NFSMNT_NOAC	0x080	/* don't cache attributes */
153 # define NFSMNT_ACREGMIN	0x0100	/* set min secs for file attr cache */
154 # define NFSMNT_ACREGMAX	0x0200	/* set max secs for file attr cache */
155 # define NFSMNT_ACDIRMIN	0x0400	/* set min secs for dir attr cache */
156 # define NFSMNT_ACDIRMAX	0x0800	/* set max secs for dir attr cache */
157 # define NFSMNT_SECURE	0x1000	/* secure mount */
158 # define NFSMNT_NOCTO	0x2000	/* no close-to-open consistency */
159 # define NFSMNT_KNCONF       0x4000  /* transport's knetconfig structure */
160 # define NFSMNT_GRPID        0x8000  /* System V-style gid inheritance */
161 # define NFSMNT_RPCTIMESYNC  0x10000 /* use RPC to do secure NFS time sync */
162 # define NFSMNT_KERBEROS     0x20000 /* use kerberos credentials */
163 # define NFSMNT_POSIX        0x40000 /* static pathconf kludge info */
164 # define NFSMNT_LLOCK    0x80000 /* Local locking (no lock manager) */
165 # define NFSMNT_ACL	0x100000	/* turn on acl support */
166 # define NFSMNT_BIODS        0x200000 /* number of biods per mount */
167 # define NFSMNT_EXTATTR      0x400000 /* extended attribute usage */
168 # define NFSMNT_FASTATTR     0x800000 /* no sync_vp in nfs3_getattr */
169 # define NFSMNT_COMBEHND     0x1000000 /* allow commit behind */
170 # define NFSMNT_NUMCLUST     0x2000000 /* number of cluster per mount */
171 # define NFSMNT_NODIRCACHE   0x4000000 /* No readdir cache */
172 #endif /* not MNTOPT_ACDIRMAX */
173 /********************************************************************************/
174 
175 /* map field names */
176 #define ex_dir ex_name
177 #define gr_name g_name
178 #define gr_next g_next
179 #define ml_directory ml_path
180 #define ml_hostname ml_name
181 #define ml_next ml_nxt
182 
183 #define	dr_drok_u	diropres
184 #define ca_attributes	attributes
185 #define ca_where	where
186 #define da_fhandle	dir
187 #define da_name		name
188 #define dl_entries	entries
189 #define dl_eof		eof
190 #define dr_status	status
191 #define dr_u		diropres_u
192 #define drok_attributes	attributes
193 #define drok_fhandle	file
194 #define fh_data		data
195 #define la_fhandle	from
196 #define la_to		to
197 #define na_atime	atime
198 #define na_blocks	blocks
199 #define na_blocksize	blocksize
200 #define na_ctime	ctime
201 #define na_fileid	fileid
202 #define na_fsid		fsid
203 #define na_gid		gid
204 #define na_mode		mode
205 #define na_mtime	mtime
206 #define na_nlink	nlink
207 #define na_rdev		rdev
208 #define na_size		size
209 #define na_type		type
210 #define na_uid		uid
211 #define ne_cookie	cookie
212 #define ne_fileid	fileid
213 #define ne_name		name
214 #define ne_nextentry	nextentry
215 #define ns_attr_u	attributes
216 #define ns_status	status
217 #define ns_u		attrstat_u
218 #define nt_seconds	seconds
219 #define nt_useconds	useconds
220 #define ra_count	count
221 #define ra_fhandle	file
222 #define ra_offset	offset
223 #define ra_totalcount	totalcount
224 #define raok_attributes	attributes
225 #define raok_len_u	data_len
226 #define raok_u		data
227 #define raok_val_u	data_val
228 #define rda_cookie	cookie
229 #define rda_count	count
230 #define rda_fhandle	dir
231 #define rdr_reply_u	reply
232 #define rdr_status	status
233 #define rdr_u		readdirres_u
234 #define rlr_data_u	data
235 #define rlr_status	status
236 #define rlr_u		readlinkres_u
237 #define rna_from	from
238 #define rna_to		to
239 #define rr_reply_u	reply
240 #define rr_status	status
241 #define rr_u		readres_u
242 #define sa_atime	atime
243 #define sa_gid		gid
244 #define sa_mode		mode
245 #define sa_mtime	mtime
246 #define sa_size		size
247 #define sa_uid		uid
248 #define sag_attributes	attributes
249 #define sag_fhandle	file
250 #define sfr_reply_u	reply
251 #define sfr_status	status
252 #define sfr_u		statfsres_u
253 #define sfrok_bavail	bavail
254 #define sfrok_bfree	bfree
255 #define sfrok_blocks	blocks
256 #define sfrok_bsize	bsize
257 #define sfrok_tsize	tsize
258 #define sla_attributes	attributes
259 #define sla_from	from
260 #define sla_to		to
261 #define wra_beginoffset	beginoffset
262 #define wra_fhandle	file
263 #define wra_len_u	data_len
264 #define wra_offset	offset
265 #define wra_totalcount	totalcount
266 #define wra_u		data
267 #define wra_val_u	data_val
268 
269 
270 /*
271  * TYPEDEFS:
272  */
273 typedef char *dirpath;
274 typedef char *name;
275 typedef struct exports *exports;
276 typedef struct exports exportnode;
277 typedef struct groups *groups;
278 typedef struct groups groupnode;
279 typedef struct mountlist *mountlist;
280 
281 /*
282  * If these definitions fail to compile on your AIX 5.2 system, be
283  * sure you install all of the necessary header files.
284  */
285 typedef attrstat	nfsattrstat;
286 typedef createargs	nfscreateargs;
287 typedef dirlist		nfsdirlist;
288 typedef diropargs	nfsdiropargs;
289 typedef diropokres	nfsdiropokres;
290 typedef diropres	nfsdiropres;
291 typedef entry		nfsentry;
292 typedef fattr		nfsfattr;
293 typedef ftype		nfsftype;
294 typedef linkargs	nfslinkargs;
295 typedef readargs	nfsreadargs;
296 typedef readdirargs	nfsreaddirargs;
297 typedef readdirres	nfsreaddirres;
298 typedef readlinkres	nfsreadlinkres;
299 typedef readokres	nfsreadokres;
300 typedef readres		nfsreadres;
301 typedef renameargs	nfsrenameargs;
302 typedef sattr		nfssattr;
303 typedef sattrargs	nfssattrargs;
304 typedef statfsokres	nfsstatfsokres;
305 typedef statfsres	nfsstatfsres;
306 typedef symlinkargs	nfssymlinkargs;
307 typedef writeargs	nfswriteargs;
308 
309 
310 /*
311  * EXTERNALS:
312  */
313 
314 
315 /*
316  * STRUCTURES:
317  */
318 
319 /*
320  * AIX 5.2 has NFS V3, but it is undefined in the header files.
321  * so I define everything that's needed for NFS V3 here.
322  */
323 #ifdef MNT_NFS3
324 
325 struct aix5_nfs_args {
326   struct sockaddr_in addr;	/* file server address */
327   struct sockaddr_in *syncaddr;	/* secure NFS time sync addr */
328   int proto;
329   char *hostname;		/* server's hostname */
330   char *netname;		/* server's netname */
331   caddr_t fh;			/* File handle to be mounted */
332   int flags;			/* flags */
333   int wsize;			/* write size in bytes */
334   int rsize;			/* read size in bytes */
335   int timeo;			/* initial timeout in .1 secs */
336   int retrans;			/* times to retry send */
337   int acregmin;			/* attr cache file min secs */
338   int acregmax;			/* attr cache file max secs */
339   int acdirmin;			/* attr cache dir min secs */
340   int acdirmax;			/* attr cache dir max secs */
341   struct ppathcnf *pathconf;	/* static pathconf kludge */
342   int biods;			/* biods per mount */
343   int numclust;			/* numclust per mount */
344 };
345 
346 #endif /* MNT_NFS3 */
347 
348 /*
349  **************************************************************************
350  * AIX 5.2's autofs is not ported or tested yet...
351  * For now, undefine it or define dummy entries.
352  **************************************************************************
353  */
354 #ifdef MNT_AUTOFS
355 # undef MNT_AUTOFS
356 #endif /* MNT_AUTOFS */
357 #ifdef HAVE_FS_AUTOFS
358 # undef HAVE_FS_AUTOFS
359 #endif /* HAVE_FS_AUTOFS */
360 
361 /*
362  * EXTERNALS:
363  */
364 extern bool_t xdr_groups(XDR *xdrs, groups *objp);
365 extern char *yperr_string (int incode);
366 
367 #endif /* not _AMU_NFS_PROT_H */
368