1/*	$NetBSD$	*/
2
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.
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. 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.
28 *
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.
40 *
41 *
42 * File: am-utils/conf/nfs_prot/nfs_prot_aix4_3.h
43 *
44 */
45
46#ifndef _AMU_NFS_PROT_H
47#define _AMU_NFS_PROT_H
48
49
50/*
51 * AIX 4.3 and newer support NFS V.3, hence the separate header.
52 */
53
54#ifdef HAVE_RPCSVC_NFS_PROT_H
55# include <rpcsvc/nfs_prot.h>
56#endif /* HAVE_RPCSVC_NFS_PROT_H */
57#ifdef HAVE_NFS_NFSV2_H
58# include <nfs/nfsv2.h>
59#endif /* HAVE_NFS_NFSV2_H */
60#ifdef HAVE_NFS_RPCV2_H
61# include <nfs/rpcv2.h>
62#endif /* HAVE_NFS_RPCV2_H */
63#ifdef HAVE_SYS_FS_NFS_H
64# include <sys/fs/nfs.h>
65#endif /* HAVE_SYS_FS_NFS_H */
66#ifdef HAVE_RPCSVC_MOUNT_H
67# include <rpcsvc/mount.h>
68#endif /* HAVE_RPCSVC_MOUNT_H */
69
70
71/*
72 * MACROS
73 */
74
75#ifndef MNTPATHLEN
76# define MNTPATHLEN 1024
77#endif /* not MNTPATHLEN */
78#ifndef MNTNAMLEN
79# define MNTNAMLEN 255
80#endif /* not MNTNAMLEN */
81
82/* map field names */
83#define ex_dir ex_name
84#define gr_name g_name
85#define gr_next g_next
86#define ml_directory ml_path
87#define ml_hostname ml_name
88#define ml_next ml_nxt
89
90#define	dr_drok_u	diropres
91#define ca_attributes	attributes
92#define ca_where	where
93#define da_fhandle	dir
94#define da_name		name
95#define dl_entries	entries
96#define dl_eof		eof
97#define dr_status	status
98#define dr_u		diropres_u
99#define drok_attributes	attributes
100#define drok_fhandle	file
101#define fh_data		data
102#define la_fhandle	from
103#define la_to		to
104#define na_atime	atime
105#define na_blocks	blocks
106#define na_blocksize	blocksize
107#define na_ctime	ctime
108#define na_fileid	fileid
109#define na_fsid		fsid
110#define na_gid		gid
111#define na_mode		mode
112#define na_mtime	mtime
113#define na_nlink	nlink
114#define na_rdev		rdev
115#define na_size		size
116#define na_type		type
117#define na_uid		uid
118#define ne_cookie	cookie
119#define ne_fileid	fileid
120#define ne_name		name
121#define ne_nextentry	nextentry
122#define ns_attr_u	attributes
123#define ns_status	status
124#define ns_u		attrstat_u
125#define nt_seconds	seconds
126#define nt_useconds	useconds
127#define ra_count	count
128#define ra_fhandle	file
129#define ra_offset	offset
130#define ra_totalcount	totalcount
131#define raok_attributes	attributes
132#define raok_len_u	data_len
133#define raok_u		data
134#define raok_val_u	data_val
135#define rda_cookie	cookie
136#define rda_count	count
137#define rda_fhandle	dir
138#define rdr_reply_u	reply
139#define rdr_status	status
140#define rdr_u		readdirres_u
141#define rlr_data_u	data
142#define rlr_status	status
143#define rlr_u		readlinkres_u
144#define rna_from	from
145#define rna_to		to
146#define rr_reply_u	reply
147#define rr_status	status
148#define rr_u		readres_u
149#define sa_atime	atime
150#define sa_gid		gid
151#define sa_mode		mode
152#define sa_mtime	mtime
153#define sa_size		size
154#define sa_uid		uid
155#define sag_attributes	attributes
156#define sag_fhandle	file
157#define sfr_reply_u	reply
158#define sfr_status	status
159#define sfr_u		statfsres_u
160#define sfrok_bavail	bavail
161#define sfrok_bfree	bfree
162#define sfrok_blocks	blocks
163#define sfrok_bsize	bsize
164#define sfrok_tsize	tsize
165#define sla_attributes	attributes
166#define sla_from	from
167#define sla_to		to
168#define wra_beginoffset	beginoffset
169#define wra_fhandle	file
170#define wra_len_u	data_len
171#define wra_offset	offset
172#define wra_totalcount	totalcount
173#define wra_u		data
174#define wra_val_u	data_val
175
176
177/*
178 * TYPEDEFS:
179 */
180typedef char *dirpath;
181typedef char *name;
182typedef struct exports *exports;
183typedef struct exports exportnode;
184typedef struct groups *groups;
185typedef struct groups groupnode;
186typedef struct mountlist *mountlist;
187
188typedef attrstat	nfsattrstat;
189typedef createargs	nfscreateargs;
190typedef dirlist		nfsdirlist;
191typedef diropargs	nfsdiropargs;
192typedef diropokres	nfsdiropokres;
193typedef diropres	nfsdiropres;
194typedef entry		nfsentry;
195typedef fattr		nfsfattr;
196typedef ftype		nfsftype;
197typedef linkargs	nfslinkargs;
198typedef readargs	nfsreadargs;
199typedef readdirargs	nfsreaddirargs;
200typedef readdirres	nfsreaddirres;
201typedef readlinkres	nfsreadlinkres;
202typedef readokres	nfsreadokres;
203typedef readres		nfsreadres;
204typedef renameargs	nfsrenameargs;
205typedef sattr		nfssattr;
206typedef sattrargs	nfssattrargs;
207typedef statfsokres	nfsstatfsokres;
208typedef statfsres	nfsstatfsres;
209typedef symlinkargs	nfssymlinkargs;
210typedef writeargs	nfswriteargs;
211
212
213/*
214 * EXTERNALS:
215 */
216
217
218/*
219 * STRUCTURES:
220 */
221
222/*
223 * AIX 4.3 has NFS V3, but it is undefined in the header files.
224 * so I define everything that's needed for NFS V3 here.
225 */
226#ifdef MNT_NFS3
227
228struct aix4_nfs_args {
229  struct sockaddr_in addr;	/* file server address */
230  struct sockaddr_in *syncaddr;	/* secure NFS time sync addr */
231  int proto;			/* IPPROTO_TCP/IPPROTO_UDP ??? */
232  char *hostname;		/* server's hostname */
233  char *netname;		/* server's netname */
234  caddr_t fh;			/* File handle to be mounted */
235  int flags;			/* flags */
236  int wsize;			/* write size in bytes */
237  int rsize;			/* read size in bytes */
238  int timeo;			/* initial timeout in .1 secs */
239  int retrans;			/* times to retry send */
240  int acregmin;			/* attr cache file min secs */
241  int acregmax;			/* attr cache file max secs */
242  int acdirmin;			/* attr cache dir min secs */
243  int acdirmax;			/* attr cache dir max secs */
244  struct ppathcnf *pathconf;	/* static pathconf kludge */
245  int biods;			/* biods per mount */
246  int numclust;			/* numclust per mount */
247};
248
249#if 0
250/* old structure we hand crafted. no longer needed */
251struct aix4_nfs_args {
252  struct sockaddr_in addr;	/* server address and port */
253  caddr_t u0;			/* ??? UNKNOWN ??? */
254  unsigned long proto;		/* IPPROTO_TCP/IPPROTO_UDP */
255  char *hostname;		/* pointer to hostname? */
256  char *netname;		/* pointer to netname? */
257  caddr_t fh;			/* pointer to NFS v3 fh? */
258  unsigned long flags;		/* flags */
259  unsigned long wsize;		/* wsize */
260  unsigned long rsize;		/* rsize */
261  unsigned long timeo;		/* timeo */
262  unsigned long retrans;	/* retrans */
263  unsigned long acregmin;	/* acregmin */
264  unsigned long acregmax;	/* acregmax */
265  unsigned long acdirmin;	/* acdirmin */
266  unsigned long acdirmax;	/* acdirmax */
267  unsigned long u14;		/* ??? UNKNOWN ??? */
268  struct pathcnf *pathconf;	/* pathconf */
269};
270#endif /* 0 */
271
272/*
273 * IBM is in dire need of taking a soft-eng class.
274 * They changed the API/ABI (namely the nfs3_args structure)
275 * in a service pack...
276 *
277 * All the following *_bis junk is here to try and deal with this idiocy.
278 */
279#define MOUNT_TYPE_NFS3_BIS 0x12344321
280struct aix4_nfs_args_bis {
281  struct sockaddr_in addr;	/* server address and port */
282  struct sockaddr_in *syncaddr;	/* secure NFS time sync addr */
283  int proto;			/* IPPROTO_TCP/IPPROTO_UDP ??? */
284  char *hostname;		/* pointer to hostname? */
285  char *netname;		/* pointer to netname? */
286  caddr_t fh;			/* pointer to NFS v3 fh? */
287  unsigned long flags;		/* flags */
288  unsigned long wsize;		/* wsize */
289  unsigned long rsize;		/* rsize */
290  unsigned long timeo;		/* timeo */
291  unsigned long retrans;	/* retrans */
292  unsigned long acregmin;	/* acregmin */
293  unsigned long acregmax;	/* acregmax */
294  unsigned long acdirmin;	/* acdirmin */
295  unsigned long acdirmax;	/* acdirmax */
296  unsigned long u14;		/* ??? UNKNOWN ??? */
297  struct ppathcnf *pathconf;	/* static pathconf kludge */
298  int biods;			/* biods per mount */
299  int numclust;			/* numclust per mount */
300};
301
302#endif /* MNT_NFS3 */
303
304/*
305 **************************************************************************
306 * AIX 4.3's autofs is not ported or tested yet...
307 * For now, undefine it or define dummy entries.
308 **************************************************************************
309 */
310#ifdef MNT_AUTOFS
311# undef MNT_AUTOFS
312#endif /* MNT_AUTOFS */
313#ifdef HAVE_FS_AUTOFS
314# undef HAVE_FS_AUTOFS
315#endif /* HAVE_FS_AUTOFS */
316
317/*
318 * EXTERNALS:
319 */
320extern bool_t xdr_groups(XDR *xdrs, groups *objp);
321extern char *yperr_string (int incode);
322
323#endif /* not _AMU_NFS_PROT_H */
324