2 * Copyright (c) 1997-2006 Erez Zadok
3 * Copyright (c) 1990 Jan-Simon Pendry
4 * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
5 * Copyright (c) 1990 The Regents of the University of California.
8 * This code is derived from software contributed to Berkeley by
9 * Jan-Simon Pendry at Imperial College, London.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 * 3. All advertising materials mentioning features or use of this software
20 * must display the following acknowledgment:
21 * This product includes software developed by the University of
22 * California, Berkeley and its contributors.
23 * 4. Neither the name of the University nor the names of its contributors
24 * may be used to endorse or promote products derived from this software
25 * without specific prior written permission.
27 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
28 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
31 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
40 * File: am-utils/conf/nfs_prot/nfs_prot_freebsd3.h
41 * $Id: nfs_prot_freebsd3.h,v 1.5.2.7 2004/01/06 03:15:19 ezk Exp $
46 #ifndef _AMU_NFS_PROT_H
47 #define _AMU_NFS_PROT_H
49 /* nfs_prot.h defines struct `nfs_fh3', but it is a ``dmr "unwarranted
50 * chumminess with the C implementation". We need the more complete
51 * structure, which is defined below. So get the stock `nfs_fh3'
55 #define nfs_fh3 nfs_fh3_fbsd_
57 #ifdef HAVE_RPCSVC_NFS_PROT_H
58 # include <rpcsvc/nfs_prot.h>
59 #endif /* HAVE_RPCSVC_NFS_PROT_H */
63 #ifdef HAVE_NFS_RPCV2_H
64 # include <nfs/rpcv2.h>
65 #endif /* HAVE_NFS_RPCV2_H */
67 # include <nfsclient/nfs.h>
68 # include <nfsserver/nfs.h>
69 #endif /* HAVE_NFS_NFS_H */
70 #ifdef HAVE_UFS_UFS_UFSMOUNT_H
71 # ifdef HAVE_UFS_UFS_EXTATTR_H
73 * Define a dummy struct ufs_extattr_per_mount, which is used in struct
74 * ufsmount in <ufs/ufs/ufsmount.h>.
76 struct ufs_extattr_per_mount;
77 # endif /* HAVE_UFS_UFS_EXTATTR_H */
78 # include <ufs/ufs/ufsmount.h>
79 #endif /* HAVE_UFS_UFS_UFSMOUNT_H */
81 /* nfsclient/nfsargs.h was introduced in FreeBSD 5.0, and is needed */
82 #ifdef HAVE_NFSCLIENT_NFSARGS_H
83 # include <nfsclient/nfsargs.h>
84 #endif /* HAVE_NFSCLIENT_NFSARGS_H */
89 #define dr_drok_u diropres
90 #define ca_where where
91 #define da_fhandle dir
93 #define dl_entries entries
95 #define dr_status status
96 #define dr_u diropres_u
97 #define drok_attributes attributes
98 #define drok_fhandle file
100 #define la_fhandle from
102 #define na_atime atime
103 #define na_ctime ctime
104 #define na_fileid fileid
107 #define na_mtime mtime
108 #define na_nlink nlink
112 #define ne_cookie cookie
113 #define ne_fileid fileid
115 #define ne_nextentry nextentry
116 #define ns_attr_u attributes
117 #define ns_status status
118 #define ns_u attrstat_u
119 #define nt_seconds seconds
120 #define nt_useconds useconds
121 #define rda_cookie cookie
122 #define rda_count count
123 #define rda_fhandle dir
124 #define rdr_reply_u reply
125 #define rdr_status status
126 #define rdr_u readdirres_u
127 #define rlr_data_u data
128 #define rlr_status status
129 #define rlr_u readlinkres_u
130 #define rna_from from
132 #define rr_status status
133 #define sag_fhandle file
134 #define sfr_reply_u reply
135 #define sfr_status status
136 #define sfr_u statfsres_u
137 #define sfrok_bavail bavail
138 #define sfrok_bfree bfree
139 #define sfrok_blocks blocks
140 #define sfrok_bsize bsize
141 #define sfrok_tsize tsize
142 #define sla_from from
143 #define wra_fhandle file
149 typedef attrstat nfsattrstat;
150 typedef createargs nfscreateargs;
151 typedef dirlist nfsdirlist;
152 typedef diropargs nfsdiropargs;
153 typedef diropres nfsdiropres;
154 typedef entry nfsentry;
155 typedef fattr nfsfattr;
156 typedef ftype nfsftype;
157 typedef linkargs nfslinkargs;
158 typedef readargs nfsreadargs;
159 typedef readdirargs nfsreaddirargs;
160 typedef readdirres nfsreaddirres;
161 typedef readlinkres nfsreadlinkres;
162 typedef readres nfsreadres;
163 typedef renameargs nfsrenameargs;
164 typedef sattrargs nfssattrargs;
165 typedef statfsokres nfsstatfsokres;
166 typedef statfsres nfsstatfsres;
167 typedef symlinkargs nfssymlinkargs;
168 typedef writeargs nfswriteargs;
173 * FreeBSD-3.0-RELEASE has NFS V3. Older versions had it only defined
174 * in the rpcgen source file. If you are on an older system, and you
175 * want NFSv3 support, you need to regenerate the rpcsvc header files as
177 * cd /usr/include/rpcsvc
178 * rpcgen -h -C -DWANT_NFS3 mount.x
179 * rpcgen -h -C -DWANT_NFS3 nfs_prot.x
180 * If you don't want NFSv3, then you will have to turn off the NFSMNT_NFSV3
181 * macro below. If the code doesn't compile, upgrade to the latest 3.0
186 # define MOUNT_NFS3 "nfs" /* is this right? */
187 # define MNTOPT_NFS3 "nfs"
189 # ifndef HAVE_XDR_LOOKUP3RES
191 * FreeBSD uses different field names than are defined on most other
194 # define AMU_LOOKUP3RES_OK(x) ((x)->LOOKUP3res_u.resok)
195 # define AMU_LOOKUP3RES_FAIL(x) ((x)->LOOKUP3res_u.resfail)
196 # define AMU_LOOKUP3RES_FH_LEN(x) (AMU_LOOKUP3RES_OK(x).object.data.data_len)
197 # define AMU_LOOKUP3RES_FH_DATA(x) (AMU_LOOKUP3RES_OK(x).object.data.data_val)
198 # endif /* not HAVE_XDR_LOOKUP3RES */
200 /* since we don't use Am-utils's aux/macros/struct_nfs_fh3.m4, we don't get
201 their special searching. So restore the standard name. */
202 typedef struct nfs_fh3_freebsd3 nfs_fh3;
204 #endif /* NFSMNT_NFSV3 */
206 #endif /* not _AMU_NFS_PROT_H */