nfs_prot_freebsd3.h revision 51300
138494Sobrien/*
251300Sobrien * Copyright (c) 1997-1999 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 *
4151300Sobrien * $Id: nfs_prot_freebsd3.h,v 1.4 1999/03/30 17:22:54 ezk Exp $
4251300Sobrien * $FreeBSD: head/contrib/amd/conf/nfs_prot/nfs_prot_freebsd3.h 51300 1999-09-15 05:45:17Z obrien $
4338494Sobrien *
4438494Sobrien */
4538494Sobrien
4638494Sobrien#ifndef _AMU_NFS_PROT_H
4738494Sobrien#define _AMU_NFS_PROT_H
4838494Sobrien
4938578Sobrien#ifdef COMMENT_OUT
5038494Sobrien#ifdef HAVE_RPCSVC_NFS_PROT_H
5138494Sobrien# include <rpcsvc/nfs_prot.h>
5238494Sobrien#endif /* HAVE_RPCSVC_NFS_PROT_H */
5338578Sobrien#endif	/* COMMENT_OUT */
5439007Sobrien/* nfs_prot.h defines struct `nfs_fh3', but it is a ``dmr "unwarranted
5539007Sobrien * chumminess with the C implementation".  We need the more complete
5639007Sobrien * structure, which is defined below.  So get the stock `nfs_fh3'
5739007Sobrien * out of the way.
5839007Sobrien */
5939007Sobrienstruct nfs_fh3;
6039007Sobrien#define nfs_fh3 nfs_fh3_fbsd_
6138578Sobrien# include "nfs_prot.h"
6239007Sobrien#undef nfs_fh3
6338578Sobrien
6438494Sobrien#ifdef HAVE_NFS_RPCV2_H
6538494Sobrien# include <nfs/rpcv2.h>
6638494Sobrien#endif /* HAVE_NFS_RPCV2_H */
6738494Sobrien#ifdef HAVE_NFS_NFS_H
6838494Sobrien# include <nfs/nfs.h>
6938494Sobrien#endif /* HAVE_NFS_NFS_H */
7051300Sobrien#ifdef	HAVE_UFS_UFS_UFSMOUNT_H
7151300Sobrien# include <ufs/ufs/ufsmount.h>
7251300Sobrien#endif	/* HAVE_UFS_UFS_UFSMOUNT_H */
7338494Sobrien
7438494Sobrien/*
7538494Sobrien * MACROS:
7638494Sobrien */
7738494Sobrien#define	dr_drok_u	diropres
7838494Sobrien#define ca_where	where
7938494Sobrien#define da_fhandle	dir
8038494Sobrien#define da_name		name
8138494Sobrien#define dl_entries	entries
8238494Sobrien#define dl_eof		eof
8338494Sobrien#define dr_status	status
8438494Sobrien#define dr_u		diropres_u
8538494Sobrien#define drok_attributes	attributes
8638494Sobrien#define drok_fhandle	file
8738494Sobrien#define fh_data		data
8838494Sobrien#define la_fhandle	from
8938494Sobrien#define la_to		to
9038494Sobrien#define na_atime	atime
9138494Sobrien#define na_ctime	ctime
9238494Sobrien#define na_fileid	fileid
9338494Sobrien#define na_fsid		fsid
9438494Sobrien#define na_mode		mode
9538494Sobrien#define na_mtime	mtime
9638494Sobrien#define na_nlink	nlink
9738494Sobrien#define na_size		size
9838494Sobrien#define na_type		type
9938494Sobrien#define ne_cookie	cookie
10038494Sobrien#define ne_fileid	fileid
10138494Sobrien#define ne_name		name
10238494Sobrien#define ne_nextentry	nextentry
10338494Sobrien#define ns_attr_u	attributes
10438494Sobrien#define ns_status	status
10538494Sobrien#define ns_u		attrstat_u
10638494Sobrien#define nt_seconds	seconds
10738494Sobrien#define nt_useconds	useconds
10838494Sobrien#define rda_cookie	cookie
10938494Sobrien#define rda_count	count
11038494Sobrien#define rda_fhandle	dir
11138494Sobrien#define rdr_reply_u	reply
11238494Sobrien#define rdr_status	status
11338494Sobrien#define rdr_u		readdirres_u
11438494Sobrien#define rlr_data_u	data
11538494Sobrien#define rlr_status	status
11638494Sobrien#define rlr_u		readlinkres_u
11738494Sobrien#define rna_from	from
11838494Sobrien#define rna_to		to
11938494Sobrien#define rr_status	status
12038494Sobrien#define sag_fhandle	file
12138494Sobrien#define sfr_reply_u	reply
12238494Sobrien#define sfr_status	status
12338494Sobrien#define sfr_u		statfsres_u
12438494Sobrien#define sfrok_bavail	bavail
12538494Sobrien#define sfrok_bfree	bfree
12638494Sobrien#define sfrok_blocks	blocks
12738494Sobrien#define sfrok_bsize	bsize
12838494Sobrien#define sfrok_tsize	tsize
12938494Sobrien#define sla_from	from
13038494Sobrien#define wra_fhandle	file
13138494Sobrien
13238494Sobrien
13338494Sobrien/*
13438494Sobrien * TYPEDEFS:
13538494Sobrien */
13638494Sobrientypedef attrstat nfsattrstat;
13738494Sobrientypedef createargs nfscreateargs;
13838494Sobrientypedef dirlist nfsdirlist;
13938494Sobrientypedef diropargs nfsdiropargs;
14038494Sobrientypedef diropres nfsdiropres;
14138494Sobrientypedef entry nfsentry;
14238494Sobrientypedef fattr nfsfattr;
14338494Sobrientypedef ftype nfsftype;
14438494Sobrientypedef linkargs nfslinkargs;
14538494Sobrientypedef readargs nfsreadargs;
14638494Sobrientypedef readdirargs nfsreaddirargs;
14738494Sobrientypedef readdirres nfsreaddirres;
14838494Sobrientypedef readlinkres nfsreadlinkres;
14938494Sobrientypedef readres nfsreadres;
15038494Sobrientypedef renameargs nfsrenameargs;
15138494Sobrientypedef sattrargs nfssattrargs;
15238494Sobrientypedef statfsokres nfsstatfsokres;
15338494Sobrientypedef statfsres nfsstatfsres;
15438494Sobrientypedef symlinkargs nfssymlinkargs;
15538494Sobrientypedef writeargs nfswriteargs;
15638494Sobrien
15738494Sobrien
15838494Sobrien/*
15938494Sobrien *
16042633Sobrien * FreeBSD-3.0-RELEASE has NFS V3.  Older versions had it only defined
16142633Sobrien * in the rpcgen source file.  If you are on an older system, and you
16242633Sobrien * want NFSv3 support, you need to regenerate the rpcsvc header files as
16342633Sobrien * follows:
16442633Sobrien *	cd /usr/include/rpcsvc
16542633Sobrien *	rpcgen -h -C -DWANT_NFS3 mount.x
16642633Sobrien *	rpcgen -h -C -DWANT_NFS3 nfs_prot.x
16742633Sobrien * If you don't want NFSv3, then you will have to turn off the NFSMNT_NFSV3
16842633Sobrien * macro below.  If the code doesn't compile, upgrade to the latest 3.0
16942633Sobrien * version...
17038494Sobrien */
17138494Sobrien#ifdef NFSMNT_NFSV3
17238494Sobrien
17338494Sobrien# define MOUNT_NFS3 MOUNT_NFS
17438494Sobrien# define MNTOPT_NFS3 "nfs"
17538494Sobrien
17642633Sobrien/*
17742633Sobrien * as of 3.0-RELEASE the nfs_fh3 that is defined in the system headers
17842633Sobrien * (or the one generated by rpcgen) lacks the proper full definition,
17942633Sobrien * listed below.  A special macro (aux/macros/struct_nfs_fh3.m4) searches
18042633Sobrien * for this special name before other names.
18142633Sobrien */
18242633Sobrienstruct nfs_fh3_freebsd3 {
18338494Sobrien  u_int fh3_length;
18438494Sobrien  union nfs_fh3_u {
18538494Sobrien    struct nfs_fh3_i {
18638494Sobrien      fhandle_t fh3_i;
18738494Sobrien    } nfs_fh3_i;
18838494Sobrien    char data[NFS3_FHSIZE];
18938494Sobrien  } fh3_u;
19038494Sobrien};
19142633Sobrientypedef struct nfs_fh3_freebsd3 nfs_fh3_freebsd3;
19238494Sobrien
19342659Sobrien/* since we don't use Am-utils's aux/macros/struct_nfs_fh3.m4, we don't get
19442659Sobrien   their special searching.  So restore the standard name. */
19542659Sobrientypedef struct nfs_fh3_freebsd3 nfs_fh3;
19642659Sobrien
19738494Sobrien#endif /* NFSMNT_NFSV3 */
19838494Sobrien
19938494Sobrien#endif /* not _AMU_NFS_PROT_H */
200