nfs_prot_freebsd3.h revision 42659
138494Sobrien/*
238494Sobrien * Copyright (c) 1997-1998 Erez Zadok
338494Sobrien * Copyright (c) 1990 Jan-Simon Pendry
438494Sobrien * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
538494Sobrien * Copyright (c) 1990 The Regents of the University of California.
638494Sobrien * All rights reserved.
738494Sobrien *
838494Sobrien * This code is derived from software contributed to Berkeley by
938494Sobrien * Jan-Simon Pendry at Imperial College, London.
1038494Sobrien *
1138494Sobrien * Redistribution and use in source and binary forms, with or without
1238494Sobrien * modification, are permitted provided that the following conditions
1338494Sobrien * are met:
1438494Sobrien * 1. Redistributions of source code must retain the above copyright
1538494Sobrien *    notice, this list of conditions and the following disclaimer.
1638494Sobrien * 2. Redistributions in binary form must reproduce the above copyright
1738494Sobrien *    notice, this list of conditions and the following disclaimer in the
1838494Sobrien *    documentation and/or other materials provided with the distribution.
1938494Sobrien * 3. All advertising materials mentioning features or use of this software
2042633Sobrien *    must display the following acknowledgment:
2138494Sobrien *      This product includes software developed by the University of
2238494Sobrien *      California, Berkeley and its contributors.
2338494Sobrien * 4. Neither the name of the University nor the names of its contributors
2438494Sobrien *    may be used to endorse or promote products derived from this software
2538494Sobrien *    without specific prior written permission.
2638494Sobrien *
2738494Sobrien * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2838494Sobrien * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2938494Sobrien * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
3038494Sobrien * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
3138494Sobrien * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
3238494Sobrien * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
3338494Sobrien * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3438494Sobrien * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3538494Sobrien * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3638494Sobrien * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3738494Sobrien * SUCH DAMAGE.
3838494Sobrien *
3938494Sobrien *      %W% (Berkeley) %G%
4038494Sobrien *
4142659Sobrien * $Id: nfs_prot_freebsd3.h,v 1.5 1999/01/13 20:03:57 obrien Exp $
4238494Sobrien *
4338494Sobrien */
4438494Sobrien
4538494Sobrien#ifndef _AMU_NFS_PROT_H
4638494Sobrien#define _AMU_NFS_PROT_H
4738494Sobrien
4838578Sobrien#ifdef COMMENT_OUT
4938494Sobrien#ifdef HAVE_RPCSVC_NFS_PROT_H
5038494Sobrien# include <rpcsvc/nfs_prot.h>
5138494Sobrien#endif /* HAVE_RPCSVC_NFS_PROT_H */
5238578Sobrien#endif	/* COMMENT_OUT */
5339007Sobrien/* nfs_prot.h defines struct `nfs_fh3', but it is a ``dmr "unwarranted
5439007Sobrien * chumminess with the C implementation".  We need the more complete
5539007Sobrien * structure, which is defined below.  So get the stock `nfs_fh3'
5639007Sobrien * out of the way.
5739007Sobrien */
5839007Sobrienstruct nfs_fh3;
5939007Sobrien#define nfs_fh3 nfs_fh3_fbsd_
6038578Sobrien# include "nfs_prot.h"
6139007Sobrien#undef nfs_fh3
6238578Sobrien
6338494Sobrien#ifdef HAVE_NFS_RPCV2_H
6438494Sobrien# include <nfs/rpcv2.h>
6538494Sobrien#endif /* HAVE_NFS_RPCV2_H */
6638494Sobrien#ifdef HAVE_NFS_NFS_H
6738494Sobrien# include <nfs/nfs.h>
6838494Sobrien#endif /* HAVE_NFS_NFS_H */
6938494Sobrien
7038494Sobrien/*
7138494Sobrien * MACROS:
7238494Sobrien */
7338494Sobrien#define	dr_drok_u	diropres
7438494Sobrien#define ca_where	where
7538494Sobrien#define da_fhandle	dir
7638494Sobrien#define da_name		name
7738494Sobrien#define dl_entries	entries
7838494Sobrien#define dl_eof		eof
7938494Sobrien#define dr_status	status
8038494Sobrien#define dr_u		diropres_u
8138494Sobrien#define drok_attributes	attributes
8238494Sobrien#define drok_fhandle	file
8338494Sobrien#define fh_data		data
8438494Sobrien#define la_fhandle	from
8538494Sobrien#define la_to		to
8638494Sobrien#define na_atime	atime
8738494Sobrien#define na_ctime	ctime
8838494Sobrien#define na_fileid	fileid
8938494Sobrien#define na_fsid		fsid
9038494Sobrien#define na_mode		mode
9138494Sobrien#define na_mtime	mtime
9238494Sobrien#define na_nlink	nlink
9338494Sobrien#define na_size		size
9438494Sobrien#define na_type		type
9538494Sobrien#define ne_cookie	cookie
9638494Sobrien#define ne_fileid	fileid
9738494Sobrien#define ne_name		name
9838494Sobrien#define ne_nextentry	nextentry
9938494Sobrien#define ns_attr_u	attributes
10038494Sobrien#define ns_status	status
10138494Sobrien#define ns_u		attrstat_u
10238494Sobrien#define nt_seconds	seconds
10338494Sobrien#define nt_useconds	useconds
10438494Sobrien#define rda_cookie	cookie
10538494Sobrien#define rda_count	count
10638494Sobrien#define rda_fhandle	dir
10738494Sobrien#define rdr_reply_u	reply
10838494Sobrien#define rdr_status	status
10938494Sobrien#define rdr_u		readdirres_u
11038494Sobrien#define rlr_data_u	data
11138494Sobrien#define rlr_status	status
11238494Sobrien#define rlr_u		readlinkres_u
11338494Sobrien#define rna_from	from
11438494Sobrien#define rna_to		to
11538494Sobrien#define rr_status	status
11638494Sobrien#define sag_fhandle	file
11738494Sobrien#define sfr_reply_u	reply
11838494Sobrien#define sfr_status	status
11938494Sobrien#define sfr_u		statfsres_u
12038494Sobrien#define sfrok_bavail	bavail
12138494Sobrien#define sfrok_bfree	bfree
12238494Sobrien#define sfrok_blocks	blocks
12338494Sobrien#define sfrok_bsize	bsize
12438494Sobrien#define sfrok_tsize	tsize
12538494Sobrien#define sla_from	from
12638494Sobrien#define wra_fhandle	file
12738494Sobrien
12838494Sobrien
12938494Sobrien/*
13038494Sobrien * TYPEDEFS:
13138494Sobrien */
13238494Sobrientypedef attrstat nfsattrstat;
13338494Sobrientypedef createargs nfscreateargs;
13438494Sobrientypedef dirlist nfsdirlist;
13538494Sobrientypedef diropargs nfsdiropargs;
13638494Sobrientypedef diropres nfsdiropres;
13738494Sobrientypedef entry nfsentry;
13838494Sobrientypedef fattr nfsfattr;
13938494Sobrientypedef ftype nfsftype;
14038494Sobrientypedef linkargs nfslinkargs;
14138494Sobrientypedef readargs nfsreadargs;
14238494Sobrientypedef readdirargs nfsreaddirargs;
14338494Sobrientypedef readdirres nfsreaddirres;
14438494Sobrientypedef readlinkres nfsreadlinkres;
14538494Sobrientypedef readres nfsreadres;
14638494Sobrientypedef renameargs nfsrenameargs;
14738494Sobrientypedef sattrargs nfssattrargs;
14838494Sobrientypedef statfsokres nfsstatfsokres;
14938494Sobrientypedef statfsres nfsstatfsres;
15038494Sobrientypedef symlinkargs nfssymlinkargs;
15138494Sobrientypedef writeargs nfswriteargs;
15238494Sobrien
15338494Sobrien
15438494Sobrien/*
15538494Sobrien *
15642633Sobrien * FreeBSD-3.0-RELEASE has NFS V3.  Older versions had it only defined
15742633Sobrien * in the rpcgen source file.  If you are on an older system, and you
15842633Sobrien * want NFSv3 support, you need to regenerate the rpcsvc header files as
15942633Sobrien * follows:
16042633Sobrien *	cd /usr/include/rpcsvc
16142633Sobrien *	rpcgen -h -C -DWANT_NFS3 mount.x
16242633Sobrien *	rpcgen -h -C -DWANT_NFS3 nfs_prot.x
16342633Sobrien * If you don't want NFSv3, then you will have to turn off the NFSMNT_NFSV3
16442633Sobrien * macro below.  If the code doesn't compile, upgrade to the latest 3.0
16542633Sobrien * version...
16638494Sobrien */
16738494Sobrien#ifdef NFSMNT_NFSV3
16838494Sobrien
16938494Sobrien# define MOUNT_NFS3 MOUNT_NFS
17038494Sobrien# define MNTOPT_NFS3 "nfs"
17138494Sobrien
17242633Sobrien/*
17342633Sobrien * as of 3.0-RELEASE the nfs_fh3 that is defined in the system headers
17442633Sobrien * (or the one generated by rpcgen) lacks the proper full definition,
17542633Sobrien * listed below.  A special macro (aux/macros/struct_nfs_fh3.m4) searches
17642633Sobrien * for this special name before other names.
17742633Sobrien */
17842633Sobrienstruct nfs_fh3_freebsd3 {
17938494Sobrien  u_int fh3_length;
18038494Sobrien  union nfs_fh3_u {
18138494Sobrien    struct nfs_fh3_i {
18238494Sobrien      fhandle_t fh3_i;
18338494Sobrien    } nfs_fh3_i;
18438494Sobrien    char data[NFS3_FHSIZE];
18538494Sobrien  } fh3_u;
18638494Sobrien};
18742633Sobrientypedef struct nfs_fh3_freebsd3 nfs_fh3_freebsd3;
18838494Sobrien
18942659Sobrien/* since we don't use Am-utils's aux/macros/struct_nfs_fh3.m4, we don't get
19042659Sobrien   their special searching.  So restore the standard name. */
19142659Sobrientypedef struct nfs_fh3_freebsd3 nfs_fh3;
19242659Sobrien
19338494Sobrien#endif /* NFSMNT_NFSV3 */
19438494Sobrien
19538494Sobrien#endif /* not _AMU_NFS_PROT_H */
196