1 /*	$NetBSD: nfs_prot_aix5_1.h,v 1.1.1.2 2009/03/20 20:26:51 christos Exp $	*/
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_aix5_1.h
43  *
44  */
45 
46 #ifndef _AMU_NFS_PROT_H
47 #define _AMU_NFS_PROT_H
48 
49 
50 /*
51  * AIX 5.1 has a different aix5_nfs_args structure, 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  */
180 typedef char *dirpath;
181 typedef char *name;
182 typedef struct exports *exports;
183 typedef struct exports exportnode;
184 typedef struct groups *groups;
185 typedef struct groups groupnode;
186 typedef struct mountlist *mountlist;
187 
188 typedef attrstat	nfsattrstat;
189 typedef createargs	nfscreateargs;
190 typedef dirlist		nfsdirlist;
191 typedef diropargs	nfsdiropargs;
192 typedef diropokres	nfsdiropokres;
193 typedef diropres	nfsdiropres;
194 typedef entry		nfsentry;
195 typedef fattr		nfsfattr;
196 typedef ftype		nfsftype;
197 typedef linkargs	nfslinkargs;
198 typedef readargs	nfsreadargs;
199 typedef readdirargs	nfsreaddirargs;
200 typedef readdirres	nfsreaddirres;
201 typedef readlinkres	nfsreadlinkres;
202 typedef readokres	nfsreadokres;
203 typedef readres		nfsreadres;
204 typedef renameargs	nfsrenameargs;
205 typedef sattr		nfssattr;
206 typedef sattrargs	nfssattrargs;
207 typedef statfsokres	nfsstatfsokres;
208 typedef statfsres	nfsstatfsres;
209 typedef symlinkargs	nfssymlinkargs;
210 typedef writeargs	nfswriteargs;
211 
212 
213 /*
214  * EXTERNALS:
215  */
216 
217 
218 /*
219  * STRUCTURES:
220  */
221 
222 /*
223  * AIX 5.1 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 
228 struct aix5_nfs_args {
229   struct sockaddr_in addr;	/* server address and port */
230   caddr_t u0;			/* ??? UNKNOWN ??? */
231   unsigned long proto;		/* IPPROTO_TCP/IPPROTO_UDP */
232   char *hostname;		/* pointer to hostname? */
233   char *netname;		/* pointer to netname? */
234   caddr_t fh;			/* pointer to NFS v3 fh? */
235   unsigned long u5;		/* IBM sux, IBM sux, IBM sux... */
236   unsigned long flags;		/* flags */
237   unsigned long wsize;		/* wsize */
238   unsigned long rsize;		/* rsize */
239   unsigned long timeo;		/* timeo */
240   unsigned long retrans;	/* retrans */
241   unsigned long acregmin;	/* acregmin */
242   unsigned long acregmax;	/* acregmax */
243   unsigned long acdirmin;	/* acdirmin */
244   unsigned long acdirmax;	/* acdirmax */
245   unsigned long u15;		/* ??? UNKNOWN ??? */
246   struct pathcnf *pathconf;	/* pathconf */
247 };
248 
249 #endif /* MNT_NFS3 */
250 
251 #ifdef MNT_AUTOFS
252 #define A_MAXNAME 255
253 #define A_MAXOPTS 255
254 #define A_MAXPATH 1024
255 
256 struct mntrequest {
257   char *name;
258   char *map;
259   char *opts;
260   char *path;
261 };
262 typedef struct mntrequest mntrequest;
263 
264 struct mntres {
265   int status;
266 };
267 typedef struct mntres mntres;
268 
269 struct umntrequest {
270   int isdirect;
271   u_int devid;
272   u_long rdevid;
273   struct umntrequest *next;
274 };
275 typedef struct umntrequest umntrequest;
276 
277 struct umntres {
278   int status;
279 };
280 typedef struct umntres umntres;
281 
282 #define AUTOFS_PROG ((unsigned long)(100099))
283 #define AUTOFS_VERS ((unsigned long)(1))
284 
285 #endif /* MNT_AUTOFS */
286 
287 /*
288  **************************************************************************
289  * AIX 5.1's autofs is not ported or tested yet...
290  * For now, undefine it or define dummy entries.
291  **************************************************************************
292  */
293 #ifdef MNT_AUTOFS
294 # undef MNT_AUTOFS
295 #endif /* MNT_AUTOFS */
296 #ifdef HAVE_FS_AUTOFS
297 # undef HAVE_FS_AUTOFS
298 #endif /* HAVE_FS_AUTOFS */
299 
300 /*
301  * EXTERNALS:
302  */
303 extern bool_t xdr_groups(XDR *xdrs, groups *objp);
304 extern char *yperr_string (int incode);
305 
306 #endif /* not _AMU_NFS_PROT_H */
307