Deleted Added
full compact
nfs_prot_freebsd3.h (83653) nfs_prot_freebsd3.h (119682)
1/*
1/*
2 * Copyright (c) 1997-2001 Erez Zadok
2 * Copyright (c) 1997-2003 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.
6 * All rights reserved.
7 *
8 * This code is derived from software contributed to Berkeley by
9 * Jan-Simon Pendry at Imperial College, London.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
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.
26 *
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
37 * SUCH DAMAGE.
38 *
39 * %W% (Berkeley) %G%
40 *
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.
6 * All rights reserved.
7 *
8 * This code is derived from software contributed to Berkeley by
9 * Jan-Simon Pendry at Imperial College, London.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
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.
26 *
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
37 * SUCH DAMAGE.
38 *
39 * %W% (Berkeley) %G%
40 *
41 * $Id: nfs_prot_freebsd3.h,v 1.5.2.1 2001/01/10 03:23:22 ezk Exp $
42 * $FreeBSD: head/contrib/amd/conf/nfs_prot/nfs_prot_freebsd3.h 83653 2001-09-18 23:34:44Z peter $
41 * $Id: nfs_prot_freebsd3.h,v 1.5.2.6 2003/08/27 19:35:16 ib42 Exp $
42 * $FreeBSD: head/contrib/amd/conf/nfs_prot/nfs_prot_freebsd3.h 119682 2003-09-02 15:42:57Z mbr $
43 *
44 */
45
46#ifndef _AMU_NFS_PROT_H
47#define _AMU_NFS_PROT_H
48
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'
52 * out of the way.
53 */
54struct nfs_fh3;
55#define nfs_fh3 nfs_fh3_fbsd_
56
57#ifdef HAVE_RPCSVC_NFS_PROT_H
58# include <rpcsvc/nfs_prot.h>
59#endif /* HAVE_RPCSVC_NFS_PROT_H */
60
61#undef nfs_fh3
62
63#ifdef HAVE_NFS_RPCV2_H
64# include <nfs/rpcv2.h>
65#endif /* HAVE_NFS_RPCV2_H */
66#ifdef HAVE_NFS_NFS_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# include <ufs/ufs/ufsmount.h>
72#endif /* HAVE_UFS_UFS_UFSMOUNT_H */
73
43 *
44 */
45
46#ifndef _AMU_NFS_PROT_H
47#define _AMU_NFS_PROT_H
48
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'
52 * out of the way.
53 */
54struct nfs_fh3;
55#define nfs_fh3 nfs_fh3_fbsd_
56
57#ifdef HAVE_RPCSVC_NFS_PROT_H
58# include <rpcsvc/nfs_prot.h>
59#endif /* HAVE_RPCSVC_NFS_PROT_H */
60
61#undef nfs_fh3
62
63#ifdef HAVE_NFS_RPCV2_H
64# include <nfs/rpcv2.h>
65#endif /* HAVE_NFS_RPCV2_H */
66#ifdef HAVE_NFS_NFS_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# include <ufs/ufs/ufsmount.h>
72#endif /* HAVE_UFS_UFS_UFSMOUNT_H */
73
74/* nfsclient/nfsargs.h was introduced in FreeBSD 5.0, and is needed */
75#ifdef HAVE_NFSCLIENT_NFSARGS_H
76# include <nfsclient/nfsargs.h>
77#endif /* HAVE_NFSCLIENT_NFSARGS_H */
78
74/*
75 * MACROS:
76 */
77#define dr_drok_u diropres
78#define ca_where where
79#define da_fhandle dir
80#define da_name name
81#define dl_entries entries
82#define dl_eof eof
83#define dr_status status
84#define dr_u diropres_u
85#define drok_attributes attributes
86#define drok_fhandle file
87#define fh_data data
88#define la_fhandle from
89#define la_to to
90#define na_atime atime
91#define na_ctime ctime
92#define na_fileid fileid
93#define na_fsid fsid
94#define na_mode mode
95#define na_mtime mtime
96#define na_nlink nlink
97#define na_size size
98#define na_type type
79/*
80 * MACROS:
81 */
82#define dr_drok_u diropres
83#define ca_where where
84#define da_fhandle dir
85#define da_name name
86#define dl_entries entries
87#define dl_eof eof
88#define dr_status status
89#define dr_u diropres_u
90#define drok_attributes attributes
91#define drok_fhandle file
92#define fh_data data
93#define la_fhandle from
94#define la_to to
95#define na_atime atime
96#define na_ctime ctime
97#define na_fileid fileid
98#define na_fsid fsid
99#define na_mode mode
100#define na_mtime mtime
101#define na_nlink nlink
102#define na_size size
103#define na_type type
104#define na_uid uid
99#define ne_cookie cookie
100#define ne_fileid fileid
101#define ne_name name
102#define ne_nextentry nextentry
103#define ns_attr_u attributes
104#define ns_status status
105#define ns_u attrstat_u
106#define nt_seconds seconds
107#define nt_useconds useconds
108#define rda_cookie cookie
109#define rda_count count
110#define rda_fhandle dir
111#define rdr_reply_u reply
112#define rdr_status status
113#define rdr_u readdirres_u
114#define rlr_data_u data
115#define rlr_status status
116#define rlr_u readlinkres_u
117#define rna_from from
118#define rna_to to
119#define rr_status status
120#define sag_fhandle file
121#define sfr_reply_u reply
122#define sfr_status status
123#define sfr_u statfsres_u
124#define sfrok_bavail bavail
125#define sfrok_bfree bfree
126#define sfrok_blocks blocks
127#define sfrok_bsize bsize
128#define sfrok_tsize tsize
129#define sla_from from
130#define wra_fhandle file
131
132
133/*
134 * TYPEDEFS:
135 */
136typedef attrstat nfsattrstat;
137typedef createargs nfscreateargs;
138typedef dirlist nfsdirlist;
139typedef diropargs nfsdiropargs;
140typedef diropres nfsdiropres;
141typedef entry nfsentry;
142typedef fattr nfsfattr;
143typedef ftype nfsftype;
144typedef linkargs nfslinkargs;
145typedef readargs nfsreadargs;
146typedef readdirargs nfsreaddirargs;
147typedef readdirres nfsreaddirres;
148typedef readlinkres nfsreadlinkres;
149typedef readres nfsreadres;
150typedef renameargs nfsrenameargs;
151typedef sattrargs nfssattrargs;
152typedef statfsokres nfsstatfsokres;
153typedef statfsres nfsstatfsres;
154typedef symlinkargs nfssymlinkargs;
155typedef writeargs nfswriteargs;
156
157
158/*
159 *
160 * FreeBSD-3.0-RELEASE has NFS V3. Older versions had it only defined
161 * in the rpcgen source file. If you are on an older system, and you
162 * want NFSv3 support, you need to regenerate the rpcsvc header files as
163 * follows:
164 * cd /usr/include/rpcsvc
165 * rpcgen -h -C -DWANT_NFS3 mount.x
166 * rpcgen -h -C -DWANT_NFS3 nfs_prot.x
167 * If you don't want NFSv3, then you will have to turn off the NFSMNT_NFSV3
168 * macro below. If the code doesn't compile, upgrade to the latest 3.0
169 * version...
170 */
171#ifdef NFSMNT_NFSV3
172
173# define MOUNT_NFS3 "nfs" /* is this right? */
174# define MNTOPT_NFS3 "nfs"
175
176/*
177 * as of 3.0-RELEASE the nfs_fh3 that is defined in the system headers
178 * (or the one generated by rpcgen) lacks the proper full definition,
105#define ne_cookie cookie
106#define ne_fileid fileid
107#define ne_name name
108#define ne_nextentry nextentry
109#define ns_attr_u attributes
110#define ns_status status
111#define ns_u attrstat_u
112#define nt_seconds seconds
113#define nt_useconds useconds
114#define rda_cookie cookie
115#define rda_count count
116#define rda_fhandle dir
117#define rdr_reply_u reply
118#define rdr_status status
119#define rdr_u readdirres_u
120#define rlr_data_u data
121#define rlr_status status
122#define rlr_u readlinkres_u
123#define rna_from from
124#define rna_to to
125#define rr_status status
126#define sag_fhandle file
127#define sfr_reply_u reply
128#define sfr_status status
129#define sfr_u statfsres_u
130#define sfrok_bavail bavail
131#define sfrok_bfree bfree
132#define sfrok_blocks blocks
133#define sfrok_bsize bsize
134#define sfrok_tsize tsize
135#define sla_from from
136#define wra_fhandle file
137
138
139/*
140 * TYPEDEFS:
141 */
142typedef attrstat nfsattrstat;
143typedef createargs nfscreateargs;
144typedef dirlist nfsdirlist;
145typedef diropargs nfsdiropargs;
146typedef diropres nfsdiropres;
147typedef entry nfsentry;
148typedef fattr nfsfattr;
149typedef ftype nfsftype;
150typedef linkargs nfslinkargs;
151typedef readargs nfsreadargs;
152typedef readdirargs nfsreaddirargs;
153typedef readdirres nfsreaddirres;
154typedef readlinkres nfsreadlinkres;
155typedef readres nfsreadres;
156typedef renameargs nfsrenameargs;
157typedef sattrargs nfssattrargs;
158typedef statfsokres nfsstatfsokres;
159typedef statfsres nfsstatfsres;
160typedef symlinkargs nfssymlinkargs;
161typedef writeargs nfswriteargs;
162
163
164/*
165 *
166 * FreeBSD-3.0-RELEASE has NFS V3. Older versions had it only defined
167 * in the rpcgen source file. If you are on an older system, and you
168 * want NFSv3 support, you need to regenerate the rpcsvc header files as
169 * follows:
170 * cd /usr/include/rpcsvc
171 * rpcgen -h -C -DWANT_NFS3 mount.x
172 * rpcgen -h -C -DWANT_NFS3 nfs_prot.x
173 * If you don't want NFSv3, then you will have to turn off the NFSMNT_NFSV3
174 * macro below. If the code doesn't compile, upgrade to the latest 3.0
175 * version...
176 */
177#ifdef NFSMNT_NFSV3
178
179# define MOUNT_NFS3 "nfs" /* is this right? */
180# define MNTOPT_NFS3 "nfs"
181
182/*
183 * as of 3.0-RELEASE the nfs_fh3 that is defined in the system headers
184 * (or the one generated by rpcgen) lacks the proper full definition,
179 * listed below. A special macro (aux/macros/struct_nfs_fh3.m4) searches
185 * listed below. A special macro (m4/macros/struct_nfs_fh3.m4) searches
180 * for this special name before other names.
181 */
182struct nfs_fh3_freebsd3 {
183 u_int fh3_length;
184 union nfs_fh3_u {
185 struct nfs_fh3_i {
186 fhandle_t fh3_i;
187 } nfs_fh3_i;
188 char data[NFS3_FHSIZE];
189 } fh3_u;
190};
191typedef struct nfs_fh3_freebsd3 nfs_fh3_freebsd3;
192
193/* since we don't use Am-utils's aux/macros/struct_nfs_fh3.m4, we don't get
194 their special searching. So restore the standard name. */
195typedef struct nfs_fh3_freebsd3 nfs_fh3;
196
197#endif /* NFSMNT_NFSV3 */
198
199#endif /* not _AMU_NFS_PROT_H */
186 * for this special name before other names.
187 */
188struct nfs_fh3_freebsd3 {
189 u_int fh3_length;
190 union nfs_fh3_u {
191 struct nfs_fh3_i {
192 fhandle_t fh3_i;
193 } nfs_fh3_i;
194 char data[NFS3_FHSIZE];
195 } fh3_u;
196};
197typedef struct nfs_fh3_freebsd3 nfs_fh3_freebsd3;
198
199/* since we don't use Am-utils's aux/macros/struct_nfs_fh3.m4, we don't get
200 their special searching. So restore the standard name. */
201typedef struct nfs_fh3_freebsd3 nfs_fh3;
202
203#endif /* NFSMNT_NFSV3 */
204
205#endif /* not _AMU_NFS_PROT_H */