4 * Copyright (c) 1997-2009 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.
10 * This code is derived from software contributed to Berkeley by
11 * Jan-Simon Pendry at Imperial College, London.
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions
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. All advertising materials mentioning features or use of this software
22 * must display the following acknowledgment:
23 * This product includes software developed by the University of
24 * California, Berkeley and its contributors.
25 * 4. Neither the name of the University nor the names of its contributors
26 * may be used to endorse or promote products derived from this software
27 * without specific prior written permission.
29 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
30 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
31 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
32 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
33 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
34 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
35 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
38 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
42 * File: am-utils/conf/nfs_prot/nfs_prot_hpux.h
46 #ifndef _AMU_NFS_PROT_H
47 #define _AMU_NFS_PROT_H
49 #ifdef HAVE_NFS_EXPORT_H_not
50 /* don't include this b/c it'll get included twice */
51 # include <nfs/export.h>
52 #endif /* HAVE_NFS_EXPORT_H */
53 #ifdef HAVE_NFS_NFSV2_H
54 # include <nfs/nfsv2.h>
55 #endif /* HAVE_NFS_NFSV2_H */
56 #ifdef HAVE_NFS_RPCV2_H
57 # include <nfs/rpcv2.h>
58 #endif /* HAVE_NFS_RPCV2_H */
61 #endif /* HAVE_NFS_NFS_H */
62 #ifdef HAVE_SYS_FS_NFS_H
63 # include <sys/fs/nfs.h>
64 #endif /* HAVE_SYS_FS_NFS_H */
65 #ifdef HAVE_RPCSVC_MOUNT_H
66 # include <rpcsvc/mount.h>
67 #endif /* HAVE_RPCSVC_MOUNT_H */
70 extern int h_errno
; /* missing from older hpux10 systems */
71 #endif /* HAVE_NETDB_H */
75 * Turn off NFS V.3 support to avoid confusing am-utils.
76 * 10.20 with some patches has incomplete support.
79 #undef MNTTAB_TYPE_NFS3
88 #define NFS_MAXDATA 8192
89 #define NFS_MAXPATHLEN 1024
90 #define NFS_MAXNAMLEN 255
92 #define NFS_COOKIESIZE 4
93 #define MNTPATHLEN 1024
96 #define NFSMODE_FMT 0170000
97 #define NFSMODE_DIR 0040000
98 #define NFSMODE_CHR 0020000
99 #define NFSMODE_BLK 0060000
100 #define NFSMODE_REG 0100000
101 #define NFSMODE_LNK 0120000
102 #define NFSMODE_SOCK 0140000
103 #define NFSMODE_FIFO 0010000
106 # define NFS_PROGRAM ((u_long)100003)
107 #endif /* not NFS_PROGRAM */
109 # define NFS_VERSION ((u_long)2)
110 #endif /* not NFS_VERSION */
112 #define NFSPROC_NULL ((u_long)0)
113 #define NFSPROC_GETATTR ((u_long)1)
114 #define NFSPROC_SETATTR ((u_long)2)
115 #define NFSPROC_ROOT ((u_long)3)
116 #define NFSPROC_LOOKUP ((u_long)4)
117 #define NFSPROC_READLINK ((u_long)5)
118 #define NFSPROC_READ ((u_long)6)
119 #define NFSPROC_WRITECACHE ((u_long)7)
120 #define NFSPROC_WRITE ((u_long)8)
121 #define NFSPROC_CREATE ((u_long)9)
122 #define NFSPROC_REMOVE ((u_long)10)
123 #define NFSPROC_RENAME ((u_long)11)
124 #define NFSPROC_LINK ((u_long)12)
125 #define NFSPROC_SYMLINK ((u_long)13)
126 #define NFSPROC_MKDIR ((u_long)14)
127 #define NFSPROC_RMDIR ((u_long)15)
128 #define NFSPROC_READDIR ((u_long)16)
129 #define NFSPROC_STATFS ((u_long)17)
131 /* map field names */
132 #define ml_hostname ml_name
133 #define ml_directory ml_path
134 #define ml_next ml_nxt
135 #define gr_next g_next
136 #define gr_name g_name
137 #define ex_dir ex_name
143 typedef char *dirpath
;
144 typedef char *filename
;
146 typedef char *nfspath
;
147 typedef char nfscookie
[NFS_COOKIESIZE
];
148 typedef enum nfsftype nfsftype
;
149 typedef enum nfsstat nfsstat
;
151 typedef fhandle_t fhandle
;
152 #endif /* not HAVE_FHANDLE */
153 typedef struct attrstat nfsattrstat
;
154 typedef struct createargs nfscreateargs
;
155 typedef struct dirlist nfsdirlist
;
156 typedef struct diropargs nfsdiropargs
;
157 typedef struct diropokres nfsdiropokres
;
158 typedef struct diropres nfsdiropres
;
159 typedef struct entry nfsentry
;
160 typedef struct exports
*exports
;
161 typedef struct exports exportnode
;
162 typedef struct fattr nfsfattr
;
163 typedef struct fhstatus fhstatus
;
164 typedef struct groups
*groups
;
165 typedef struct groups groupnode
;
166 typedef struct linkargs nfslinkargs
;
167 typedef struct mountlist
*mountlist
;
168 typedef struct mountlist mountbody
;
169 typedef struct nfstime nfstime
;
170 typedef struct readargs nfsreadargs
;
171 typedef struct readdirargs nfsreaddirargs
;
172 typedef struct readdirres nfsreaddirres
;
173 typedef struct readlinkres nfsreadlinkres
;
174 typedef struct readokres nfsreadokres
;
175 typedef struct readres nfsreadres
;
176 typedef struct renameargs nfsrenameargs
;
177 typedef struct sattr nfssattr
;
178 typedef struct sattrargs nfssattrargs
;
179 typedef struct statfsokres nfsstatfsokres
;
180 typedef struct statfsres nfsstatfsres
;
181 typedef struct symlinkargs nfssymlinkargs
;
182 typedef struct writeargs nfswriteargs
;
189 extern void *nfsproc_null_2_svc(void *, struct svc_req
*);
190 extern nfsattrstat
*nfsproc_getattr_2_svc(fhandle_t
*, struct svc_req
*);
191 extern nfsattrstat
*nfsproc_setattr_2_svc(nfssattrargs
*, struct svc_req
*);
192 extern void *nfsproc_root_2_svc(void *, struct svc_req
*);
193 extern nfsdiropres
*nfsproc_lookup_2_svc(nfsdiropargs
*, struct svc_req
*);
194 extern nfsreadlinkres
*nfsproc_readlink_2_svc(fhandle_t
*, struct svc_req
*);
195 extern nfsreadres
*nfsproc_read_2_svc(nfsreadargs
*, struct svc_req
*);
196 extern void *nfsproc_writecache_2_svc(void *, struct svc_req
*);
197 extern nfsattrstat
*nfsproc_write_2_svc(nfswriteargs
*, struct svc_req
*);
198 extern nfsdiropres
*nfsproc_create_2_svc(nfscreateargs
*, struct svc_req
*);
199 extern nfsstat
*nfsproc_remove_2_svc(nfsdiropargs
*, struct svc_req
*);
200 extern nfsstat
*nfsproc_rename_2_svc(nfsrenameargs
*, struct svc_req
*);
201 extern nfsstat
*nfsproc_link_2_svc(nfslinkargs
*, struct svc_req
*);
202 extern nfsstat
*nfsproc_symlink_2_svc(nfssymlinkargs
*, struct svc_req
*);
203 extern nfsdiropres
*nfsproc_mkdir_2_svc(nfscreateargs
*, struct svc_req
*);
204 extern nfsstat
*nfsproc_rmdir_2_svc(nfsdiropargs
*, struct svc_req
*);
205 extern nfsreaddirres
*nfsproc_readdir_2_svc(nfsreaddirargs
*, struct svc_req
*);
206 extern nfsstatfsres
*nfsproc_statfs_2_svc(fhandle_t
*, struct svc_req
*);
208 extern bool_t
xdr_nfsstat(XDR
*, nfsstat
*);
209 extern bool_t
xdr_ftype(XDR
*, nfsftype
*);
210 extern bool_t
xdr_nfs_fh(XDR
*, fhandle_t
*);
211 extern bool_t
xdr_nfstime(XDR
*, nfstime
*);
212 extern bool_t
xdr_fattr(XDR
*, nfsfattr
*);
213 extern bool_t
xdr_sattr(XDR
*, nfssattr
*);
214 extern bool_t
xdr_filename(XDR
*, filename
*);
215 extern bool_t
xdr_nfspath(XDR
*, nfspath
*);
216 extern bool_t
xdr_attrstat(XDR
*, nfsattrstat
*);
217 extern bool_t
xdr_sattrargs(XDR
*, nfssattrargs
*);
218 extern bool_t
xdr_diropargs(XDR
*, nfsdiropargs
*);
219 extern bool_t
xdr_diropokres(XDR
*, nfsdiropokres
*);
220 extern bool_t
xdr_diropres(XDR
*, nfsdiropres
*);
221 extern bool_t
xdr_readlinkres(XDR
*, nfsreadlinkres
*);
222 extern bool_t
xdr_readargs(XDR
*, nfsreadargs
*);
223 extern bool_t
xdr_readokres(XDR
*, nfsreadokres
*);
224 extern bool_t
xdr_readres(XDR
*, nfsreadres
*);
225 extern bool_t
xdr_writeargs(XDR
*, nfswriteargs
*);
226 extern bool_t
xdr_createargs(XDR
*, nfscreateargs
*);
227 extern bool_t
xdr_renameargs(XDR
*, nfsrenameargs
*);
228 extern bool_t
xdr_linkargs(XDR
*, nfslinkargs
*);
229 extern bool_t
xdr_symlinkargs(XDR
*, nfssymlinkargs
*);
230 extern bool_t
xdr_nfscookie(XDR
*, nfscookie
);
231 extern bool_t
xdr_readdirargs(XDR
*, nfsreaddirargs
*);
232 extern bool_t
xdr_entry(XDR
*, nfsentry
*);
233 extern bool_t
xdr_dirlist(XDR
*, nfsdirlist
*);
234 extern bool_t
xdr_readdirres(XDR
*, nfsreaddirres
*);
235 extern bool_t
xdr_statfsokres(XDR
*, nfsstatfsokres
*);
236 extern bool_t
xdr_statfsres(XDR
*, nfsstatfsres
*);
282 fhandle_t sag_fhandle
;
283 nfssattr sag_attributes
;
287 fhandle_t da_fhandle
; /* was dir */
292 fhandle_t drok_fhandle
;
293 nfsfattr drok_attributes
;
297 nfsstat dr_status
; /* was status */
299 nfsdiropokres dr_drok_u
; /* was diropres */
300 } dr_u
; /* was diropres_u */
311 fhandle_t ra_fhandle
;
318 nfsfattr raok_attributes
;
328 nfsreadokres rr_reply_u
;
333 fhandle_t wra_fhandle
;
334 u_int wra_beginoffset
;
336 u_int wra_totalcount
;
344 nfsdiropargs ca_where
;
345 nfssattr ca_attributes
;
349 nfsdiropargs rna_from
;
354 fhandle_t la_fhandle
;
359 nfsdiropargs sla_from
;
361 nfssattr sla_attributes
;
365 fhandle_t rda_fhandle
;
366 nfscookie rda_cookie
;
374 nfsentry
*ne_nextentry
;
378 nfsentry
*dl_entries
;
385 nfsdirlist rdr_reply_u
;
400 nfsstatfsokres sfr_reply_u
;
404 #endif /* not _AMU_NFS_PROT_H */