1/*	$NetBSD: nfs_prot_sunos5_4.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_sunos5_4.h
39 *
40 */
41
42#ifndef _AMU_NFS_PROT_H
43#define _AMU_NFS_PROT_H
44
45/*
46 * Do not include <nfs/nfs.h> because Solaris 2.4 really does not have NFS
47 * V.3 support, despite what their header files claim.
48 */
49
50#ifdef HAVE_RPCSVC_NFS_PROT_H
51# include <rpcsvc/nfs_prot.h>
52#endif /* HAVE_RPCSVC_NFS_PROT_H */
53
54#define FHSIZE 32
55typedef char fhandle[FHSIZE];
56#define fhandle_t fhandle
57
58#ifdef HAVE_RPCSVC_MOUNT_H
59# include <rpcsvc/mount.h>
60#endif /* HAVE_RPCSVC_MOUNT_H */
61#ifdef HAVE_RPC_RPC_H
62#include <rpc/rpc.h>
63#endif /* HAVE_RPC_RPC_H */
64
65/* missing mntent definition for cachefs */
66#ifndef MNTTYPE_CACHEFS
67# define MNTTYPE_CACHEFS "cachefs"       /* Cache File System */
68#endif /* not MNTTYPE_CACHEFS */
69
70/*
71 * Solaris 2.4 has header definitions for NFS V.3, but does not really
72 * have NFS V.3 support in the kernel.  So I must undefine these.
73 */
74#ifdef MNTTYPE_NFS3
75# undef MNTTYPE_NFS3
76#endif /* MNTTYPE_NFS3 */
77
78
79/*
80 * MACROS
81 */
82
83#define	NFS_PORT 2049
84#define	NFS_MAXDATA 8192
85#define	NFS_MAXPATHLEN 1024
86#define	NFS_MAXNAMLEN 255
87#define	NFS_FHSIZE 32
88#define	NFS_COOKIESIZE 4
89
90#define	NFSMODE_FMT 0170000
91#define	NFSMODE_DIR 0040000
92#define	NFSMODE_CHR 0020000
93#define	NFSMODE_BLK 0060000
94#define	NFSMODE_REG 0100000
95#define	NFSMODE_LNK 0120000
96#define	NFSMODE_SOCK 0140000
97#define	NFSMODE_FIFO 0010000
98
99#define	dr_drok_u	diropres
100#define ca_attributes	attributes
101#define ca_where	where
102#define da_fhandle	dir
103#define da_name		name
104#define dl_entries	entries
105#define dl_eof		eof
106#define dr_status	status
107#define dr_u		diropres_u
108#define drok_attributes	attributes
109#define drok_fhandle	file
110#define fh_data		data
111#define la_fhandle	from
112#define la_to		to
113#define na_atime	atime
114#define na_blocks	blocks
115#define na_blocksize	blocksize
116#define na_ctime	ctime
117#define na_fileid	fileid
118#define na_fsid		fsid
119#define na_gid		gid
120#define na_mode		mode
121#define na_mtime	mtime
122#define na_nlink	nlink
123#define na_rdev		rdev
124#define na_size		size
125#define na_type		type
126#define na_uid		uid
127#define ne_cookie	cookie
128#define ne_fileid	fileid
129#define ne_name		name
130#define ne_nextentry	nextentry
131#define ns_attr_u	attributes
132#define ns_status	status
133#define ns_u		attrstat_u
134#define nt_seconds	seconds
135#define nt_useconds	useconds
136#define ra_count	count
137#define ra_fhandle	file
138#define ra_offset	offset
139#define ra_totalcount	totalcount
140#define raok_attributes	attributes
141#define raok_len_u	data_len
142#define raok_u		data
143#define raok_val_u	data_val
144#define rda_cookie	cookie
145#define rda_count	count
146#define rda_fhandle	dir
147#define rdr_reply_u	reply
148#define rdr_status	status
149#define rdr_u		readdirres_u
150#define rlr_data_u	data
151#define rlr_status	status
152#define rlr_u		readlinkres_u
153#define rna_from	from
154#define rna_to		to
155#define rr_reply_u	reply
156#define rr_status	status
157#define rr_u		readres_u
158#define sa_atime	atime
159#define sa_gid		gid
160#define sa_mode		mode
161#define sa_mtime	mtime
162#define sa_size		size
163#define sa_uid		uid
164#define sag_attributes	attributes
165#define sag_fhandle	file
166#define sfr_reply_u	reply
167#define sfr_status	status
168#define sfr_u		statfsres_u
169#define sfrok_bavail	bavail
170#define sfrok_bfree	bfree
171#define sfrok_blocks	blocks
172#define sfrok_bsize	bsize
173#define sfrok_tsize	tsize
174#define sla_attributes	attributes
175#define sla_from	from
176#define sla_to		to
177#define wra_beginoffset	beginoffset
178#define wra_fhandle	file
179#define wra_len_u	data_len
180#define wra_offset	offset
181#define wra_totalcount	totalcount
182#define wra_u		data
183#define wra_val_u	data_val
184
185/* map field names */
186#define ex_dir		ex_name
187#define gr_name		g_name
188#define gr_next		g_next
189#define ml_directory	ml_path
190#define ml_hostname	ml_name
191#define ml_next		ml_nxt
192
193
194/*
195 * TYPEDEFS:
196 */
197
198typedef char *dirpath;
199typedef char *name;
200typedef enum ftype nfsftype;
201typedef struct attrstat nfsattrstat;
202typedef struct createargs nfscreateargs;
203typedef struct dirlist nfsdirlist;
204typedef struct diropargs nfsdiropargs;
205typedef struct diropokres nfsdiropokres;
206typedef struct diropres nfsdiropres;
207typedef struct entry nfsentry;
208typedef struct exports *exports;
209typedef struct exports exportnode;
210typedef struct fattr nfsfattr;
211typedef struct fhstatus fhstatus;
212typedef struct groups *groups;
213typedef struct groups groupnode;
214typedef struct linkargs nfslinkargs;
215typedef struct mountlist *mountlist;
216typedef struct mountlist mountbody;
217typedef struct readargs nfsreadargs;
218typedef struct readdirargs nfsreaddirargs;
219typedef struct readdirres nfsreaddirres;
220typedef struct readlinkres nfsreadlinkres;
221typedef struct readokres nfsreadokres;
222typedef struct readres nfsreadres;
223typedef struct renameargs nfsrenameargs;
224typedef struct sattr nfssattr;
225typedef struct sattrargs nfssattrargs;
226typedef struct statfsokres nfsstatfsokres;
227typedef struct statfsres nfsstatfsres;
228typedef struct symlinkargs nfssymlinkargs;
229typedef struct writeargs nfswriteargs;
230
231
232/*
233 * EXTERNALS:
234 */
235
236extern bool_t xdr_createargs(XDR *, nfscreateargs *);
237extern bool_t xdr_dirlist(XDR *, nfsdirlist *);
238extern bool_t xdr_diropokres(XDR *, nfsdiropokres *);
239extern bool_t xdr_entry(XDR *, nfsentry *);
240extern bool_t xdr_filename(XDR *, filename *);
241extern bool_t xdr_ftype(XDR *, nfsftype *);
242extern bool_t xdr_nfs_fh(XDR *, nfs_fh *);
243extern bool_t xdr_nfscookie(XDR *, nfscookie);
244extern bool_t xdr_nfspath(XDR *, nfspath *);
245extern bool_t xdr_nfsstat(XDR *, nfsstat *);
246extern bool_t xdr_nfstime(XDR *, nfstime *);
247extern bool_t xdr_readdirargs(XDR *, nfsreaddirargs *);
248extern bool_t xdr_readdirres(XDR *, nfsreaddirres *);
249extern bool_t xdr_readlinkres(XDR *, nfsreadlinkres *);
250extern bool_t xdr_readokres(XDR *, nfsreadokres *);
251extern bool_t xdr_readres(XDR *, nfsreadres *);
252extern bool_t xdr_renameargs(XDR *, nfsrenameargs *);
253extern bool_t xdr_sattrargs(XDR *, nfssattrargs *);
254extern bool_t xdr_statfsokres(XDR *, nfsstatfsokres *);
255extern bool_t xdr_statfsres(XDR *, nfsstatfsres *);
256extern bool_t xdr_symlinkargs(XDR *, nfssymlinkargs *);
257
258
259/*
260 * ENUMS:
261 */
262
263
264/*
265 * STRUCTURES:
266 */
267
268#endif /* not _AMU_NFS_PROT_H */
269