xref: /netbsd-src/external/bsd/am-utils/dist/conf/nfs_prot/nfs_prot_aix5_1.h (revision 8bae5d409deb915cf7c8f0539fae22ff2cb8a313)
1 /*	$NetBSD: nfs_prot_aix5_1.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_1.h
39  *
40  */
41 
42 #ifndef _AMU_NFS_PROT_H
43 #define _AMU_NFS_PROT_H
44 
45 
46 /*
47  * AIX 5.1 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 # include <rpcsvc/mount.h>
64 #endif /* HAVE_RPCSVC_MOUNT_H */
65 
66 
67 /*
68  * MACROS
69  */
70 
71 #ifndef MNTPATHLEN
72 # define MNTPATHLEN 1024
73 #endif /* not MNTPATHLEN */
74 #ifndef MNTNAMLEN
75 # define MNTNAMLEN 255
76 #endif /* not MNTNAMLEN */
77 
78 /* map field names */
79 #define ex_dir ex_name
80 #define gr_name g_name
81 #define gr_next g_next
82 #define ml_directory ml_path
83 #define ml_hostname ml_name
84 #define ml_next ml_nxt
85 
86 #define	dr_drok_u	diropres
87 #define ca_attributes	attributes
88 #define ca_where	where
89 #define da_fhandle	dir
90 #define da_name		name
91 #define dl_entries	entries
92 #define dl_eof		eof
93 #define dr_status	status
94 #define dr_u		diropres_u
95 #define drok_attributes	attributes
96 #define drok_fhandle	file
97 #define fh_data		data
98 #define la_fhandle	from
99 #define la_to		to
100 #define na_atime	atime
101 #define na_blocks	blocks
102 #define na_blocksize	blocksize
103 #define na_ctime	ctime
104 #define na_fileid	fileid
105 #define na_fsid		fsid
106 #define na_gid		gid
107 #define na_mode		mode
108 #define na_mtime	mtime
109 #define na_nlink	nlink
110 #define na_rdev		rdev
111 #define na_size		size
112 #define na_type		type
113 #define na_uid		uid
114 #define ne_cookie	cookie
115 #define ne_fileid	fileid
116 #define ne_name		name
117 #define ne_nextentry	nextentry
118 #define ns_attr_u	attributes
119 #define ns_status	status
120 #define ns_u		attrstat_u
121 #define nt_seconds	seconds
122 #define nt_useconds	useconds
123 #define ra_count	count
124 #define ra_fhandle	file
125 #define ra_offset	offset
126 #define ra_totalcount	totalcount
127 #define raok_attributes	attributes
128 #define raok_len_u	data_len
129 #define raok_u		data
130 #define raok_val_u	data_val
131 #define rda_cookie	cookie
132 #define rda_count	count
133 #define rda_fhandle	dir
134 #define rdr_reply_u	reply
135 #define rdr_status	status
136 #define rdr_u		readdirres_u
137 #define rlr_data_u	data
138 #define rlr_status	status
139 #define rlr_u		readlinkres_u
140 #define rna_from	from
141 #define rna_to		to
142 #define rr_reply_u	reply
143 #define rr_status	status
144 #define rr_u		readres_u
145 #define sa_atime	atime
146 #define sa_gid		gid
147 #define sa_mode		mode
148 #define sa_mtime	mtime
149 #define sa_size		size
150 #define sa_uid		uid
151 #define sag_attributes	attributes
152 #define sag_fhandle	file
153 #define sfr_reply_u	reply
154 #define sfr_status	status
155 #define sfr_u		statfsres_u
156 #define sfrok_bavail	bavail
157 #define sfrok_bfree	bfree
158 #define sfrok_blocks	blocks
159 #define sfrok_bsize	bsize
160 #define sfrok_tsize	tsize
161 #define sla_attributes	attributes
162 #define sla_from	from
163 #define sla_to		to
164 #define wra_beginoffset	beginoffset
165 #define wra_fhandle	file
166 #define wra_len_u	data_len
167 #define wra_offset	offset
168 #define wra_totalcount	totalcount
169 #define wra_u		data
170 #define wra_val_u	data_val
171 
172 
173 /*
174  * TYPEDEFS:
175  */
176 typedef char *dirpath;
177 typedef char *name;
178 typedef struct exports *exports;
179 typedef struct exports exportnode;
180 typedef struct groups *groups;
181 typedef struct groups groupnode;
182 typedef struct mountlist *mountlist;
183 
184 typedef attrstat	nfsattrstat;
185 typedef createargs	nfscreateargs;
186 typedef dirlist		nfsdirlist;
187 typedef diropargs	nfsdiropargs;
188 typedef diropokres	nfsdiropokres;
189 typedef diropres	nfsdiropres;
190 typedef entry		nfsentry;
191 typedef fattr		nfsfattr;
192 typedef ftype		nfsftype;
193 typedef linkargs	nfslinkargs;
194 typedef readargs	nfsreadargs;
195 typedef readdirargs	nfsreaddirargs;
196 typedef readdirres	nfsreaddirres;
197 typedef readlinkres	nfsreadlinkres;
198 typedef readokres	nfsreadokres;
199 typedef readres		nfsreadres;
200 typedef renameargs	nfsrenameargs;
201 typedef sattr		nfssattr;
202 typedef sattrargs	nfssattrargs;
203 typedef statfsokres	nfsstatfsokres;
204 typedef statfsres	nfsstatfsres;
205 typedef symlinkargs	nfssymlinkargs;
206 typedef writeargs	nfswriteargs;
207 
208 
209 /*
210  * EXTERNALS:
211  */
212 
213 
214 /*
215  * STRUCTURES:
216  */
217 
218 /*
219  * AIX 5.1 has NFS V3, but it is undefined in the header files.
220  * so I define everything that's needed for NFS V3 here.
221  */
222 #ifdef MNT_NFS3
223 
224 struct aix5_nfs_args {
225   struct sockaddr_in addr;	/* server address and port */
226   caddr_t u0;			/* ??? UNKNOWN ??? */
227   unsigned long proto;		/* IPPROTO_TCP/IPPROTO_UDP */
228   char *hostname;		/* pointer to hostname? */
229   char *netname;		/* pointer to netname? */
230   caddr_t fh;			/* pointer to NFS v3 fh? */
231   unsigned long u5;		/* IBM sux, IBM sux, IBM sux... */
232   unsigned long flags;		/* flags */
233   unsigned long wsize;		/* wsize */
234   unsigned long rsize;		/* rsize */
235   unsigned long timeo;		/* timeo */
236   unsigned long retrans;	/* retrans */
237   unsigned long acregmin;	/* acregmin */
238   unsigned long acregmax;	/* acregmax */
239   unsigned long acdirmin;	/* acdirmin */
240   unsigned long acdirmax;	/* acdirmax */
241   unsigned long u15;		/* ??? UNKNOWN ??? */
242   struct pathcnf *pathconf;	/* pathconf */
243 };
244 
245 #endif /* MNT_NFS3 */
246 
247 #ifdef MNT_AUTOFS
248 #define A_MAXNAME 255
249 #define A_MAXOPTS 255
250 #define A_MAXPATH 1024
251 
252 struct mntrequest {
253   char *name;
254   char *map;
255   char *opts;
256   char *path;
257 };
258 typedef struct mntrequest mntrequest;
259 
260 struct mntres {
261   int status;
262 };
263 typedef struct mntres mntres;
264 
265 struct umntrequest {
266   int isdirect;
267   u_int devid;
268   u_long rdevid;
269   struct umntrequest *next;
270 };
271 typedef struct umntrequest umntrequest;
272 
273 struct umntres {
274   int status;
275 };
276 typedef struct umntres umntres;
277 
278 #define AUTOFS_PROG ((unsigned long)(100099))
279 #define AUTOFS_VERS ((unsigned long)(1))
280 
281 #endif /* MNT_AUTOFS */
282 
283 /*
284  **************************************************************************
285  * AIX 5.1's autofs is not ported or tested yet...
286  * For now, undefine it or define dummy entries.
287  **************************************************************************
288  */
289 #ifdef MNT_AUTOFS
290 # undef MNT_AUTOFS
291 #endif /* MNT_AUTOFS */
292 #ifdef HAVE_FS_AUTOFS
293 # undef HAVE_FS_AUTOFS
294 #endif /* HAVE_FS_AUTOFS */
295 
296 /*
297  * EXTERNALS:
298  */
299 extern bool_t xdr_groups(XDR *xdrs, groups *objp);
300 extern char *yperr_string (int incode);
301 
302 #endif /* not _AMU_NFS_PROT_H */
303