1 /* $NetBSD: nfs_prot_aix4_3.h,v 1.1.1.3 2015/01/17 16:34:16 christos Exp $ */ 2 3 /* 4 * Copyright (c) 1997-2014 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. 8 * All rights reserved. 9 * 10 * This code is derived from software contributed to Berkeley by 11 * Jan-Simon Pendry at Imperial College, London. 12 * 13 * Redistribution and use in source and binary forms, with or without 14 * modification, are permitted provided that the following conditions 15 * are met: 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. Neither the name of the University nor the names of its contributors 22 * may be used to endorse or promote products derived from this software 23 * without specific prior written permission. 24 * 25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 * 37 * 38 * File: am-utils/conf/nfs_prot/nfs_prot_aix4_3.h 39 * 40 */ 41 42 #ifndef _AMU_NFS_PROT_H 43 #define _AMU_NFS_PROT_H 44 45 46 /* 47 * AIX 4.3 and newer support NFS V.3, hence the separate header. 48 */ 49 50 #ifdef HAVE_RPCSVC_NFS_PROT_H 51 # include <rpcsvc/nfs_prot.h> 52 #endif /* HAVE_RPCSVC_NFS_PROT_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 */ 59 #ifdef HAVE_SYS_FS_NFS_H 60 # include <sys/fs/nfs.h> 61 #endif /* HAVE_SYS_FS_NFS_H */ 62 #ifdef HAVE_RPCSVC_MOUNT_H 63 # include <rpcsvc/mount.h> 64 #endif /* HAVE_RPCSVC_MOUNT_H */ 65 66 67 /* 68 * MACROS 69 */ 70 71 #ifndef MNTPATHLEN 72 # define MNTPATHLEN 1024 73 #endif /* not MNTPATHLEN */ 74 #ifndef MNTNAMLEN 75 # define MNTNAMLEN 255 76 #endif /* not MNTNAMLEN */ 77 78 /* map field names */ 79 #define ex_dir ex_name 80 #define gr_name g_name 81 #define gr_next g_next 82 #define ml_directory ml_path 83 #define ml_hostname ml_name 84 #define ml_next ml_nxt 85 86 #define dr_drok_u diropres 87 #define ca_attributes attributes 88 #define ca_where where 89 #define da_fhandle dir 90 #define da_name name 91 #define dl_entries entries 92 #define dl_eof eof 93 #define dr_status status 94 #define dr_u diropres_u 95 #define drok_attributes attributes 96 #define drok_fhandle file 97 #define fh_data data 98 #define la_fhandle from 99 #define la_to to 100 #define na_atime atime 101 #define na_blocks blocks 102 #define na_blocksize blocksize 103 #define na_ctime ctime 104 #define na_fileid fileid 105 #define na_fsid fsid 106 #define na_gid gid 107 #define na_mode mode 108 #define na_mtime mtime 109 #define na_nlink nlink 110 #define na_rdev rdev 111 #define na_size size 112 #define na_type type 113 #define na_uid uid 114 #define ne_cookie cookie 115 #define ne_fileid fileid 116 #define ne_name name 117 #define ne_nextentry nextentry 118 #define ns_attr_u attributes 119 #define ns_status status 120 #define ns_u attrstat_u 121 #define nt_seconds seconds 122 #define nt_useconds useconds 123 #define ra_count count 124 #define ra_fhandle file 125 #define ra_offset offset 126 #define ra_totalcount totalcount 127 #define raok_attributes attributes 128 #define raok_len_u data_len 129 #define raok_u data 130 #define raok_val_u data_val 131 #define rda_cookie cookie 132 #define rda_count count 133 #define rda_fhandle dir 134 #define rdr_reply_u reply 135 #define rdr_status status 136 #define rdr_u readdirres_u 137 #define rlr_data_u data 138 #define rlr_status status 139 #define rlr_u readlinkres_u 140 #define rna_from from 141 #define rna_to to 142 #define rr_reply_u reply 143 #define rr_status status 144 #define rr_u readres_u 145 #define sa_atime atime 146 #define sa_gid gid 147 #define sa_mode mode 148 #define sa_mtime mtime 149 #define sa_size size 150 #define sa_uid uid 151 #define sag_attributes attributes 152 #define sag_fhandle file 153 #define sfr_reply_u reply 154 #define sfr_status status 155 #define sfr_u statfsres_u 156 #define sfrok_bavail bavail 157 #define sfrok_bfree bfree 158 #define sfrok_blocks blocks 159 #define sfrok_bsize bsize 160 #define sfrok_tsize tsize 161 #define sla_attributes attributes 162 #define sla_from from 163 #define sla_to to 164 #define wra_beginoffset beginoffset 165 #define wra_fhandle file 166 #define wra_len_u data_len 167 #define wra_offset offset 168 #define wra_totalcount totalcount 169 #define wra_u data 170 #define wra_val_u data_val 171 172 173 /* 174 * TYPEDEFS: 175 */ 176 typedef char *dirpath; 177 typedef char *name; 178 typedef struct exports *exports; 179 typedef struct exports exportnode; 180 typedef struct groups *groups; 181 typedef struct groups groupnode; 182 typedef struct mountlist *mountlist; 183 184 typedef attrstat nfsattrstat; 185 typedef createargs nfscreateargs; 186 typedef dirlist nfsdirlist; 187 typedef diropargs nfsdiropargs; 188 typedef diropokres nfsdiropokres; 189 typedef diropres nfsdiropres; 190 typedef entry nfsentry; 191 typedef fattr nfsfattr; 192 typedef ftype nfsftype; 193 typedef linkargs nfslinkargs; 194 typedef readargs nfsreadargs; 195 typedef readdirargs nfsreaddirargs; 196 typedef readdirres nfsreaddirres; 197 typedef readlinkres nfsreadlinkres; 198 typedef readokres nfsreadokres; 199 typedef readres nfsreadres; 200 typedef renameargs nfsrenameargs; 201 typedef sattr nfssattr; 202 typedef sattrargs nfssattrargs; 203 typedef statfsokres nfsstatfsokres; 204 typedef statfsres nfsstatfsres; 205 typedef symlinkargs nfssymlinkargs; 206 typedef writeargs nfswriteargs; 207 208 209 /* 210 * EXTERNALS: 211 */ 212 213 214 /* 215 * STRUCTURES: 216 */ 217 218 /* 219 * AIX 4.3 has NFS V3, but it is undefined in the header files. 220 * so I define everything that's needed for NFS V3 here. 221 */ 222 #ifdef MNT_NFS3 223 224 struct aix4_nfs_args { 225 struct sockaddr_in addr; /* file server address */ 226 struct sockaddr_in *syncaddr; /* secure NFS time sync addr */ 227 int proto; /* IPPROTO_TCP/IPPROTO_UDP ??? */ 228 char *hostname; /* server's hostname */ 229 char *netname; /* server's netname */ 230 caddr_t fh; /* File handle to be mounted */ 231 int flags; /* flags */ 232 int wsize; /* write size in bytes */ 233 int rsize; /* read size in bytes */ 234 int timeo; /* initial timeout in .1 secs */ 235 int retrans; /* times to retry send */ 236 int acregmin; /* attr cache file min secs */ 237 int acregmax; /* attr cache file max secs */ 238 int acdirmin; /* attr cache dir min secs */ 239 int acdirmax; /* attr cache dir max secs */ 240 struct ppathcnf *pathconf; /* static pathconf kludge */ 241 int biods; /* biods per mount */ 242 int numclust; /* numclust per mount */ 243 }; 244 245 #if 0 246 /* old structure we hand crafted. no longer needed */ 247 struct aix4_nfs_args { 248 struct sockaddr_in addr; /* server address and port */ 249 caddr_t u0; /* ??? UNKNOWN ??? */ 250 unsigned long proto; /* IPPROTO_TCP/IPPROTO_UDP */ 251 char *hostname; /* pointer to hostname? */ 252 char *netname; /* pointer to netname? */ 253 caddr_t fh; /* pointer to NFS v3 fh? */ 254 unsigned long flags; /* flags */ 255 unsigned long wsize; /* wsize */ 256 unsigned long rsize; /* rsize */ 257 unsigned long timeo; /* timeo */ 258 unsigned long retrans; /* retrans */ 259 unsigned long acregmin; /* acregmin */ 260 unsigned long acregmax; /* acregmax */ 261 unsigned long acdirmin; /* acdirmin */ 262 unsigned long acdirmax; /* acdirmax */ 263 unsigned long u14; /* ??? UNKNOWN ??? */ 264 struct pathcnf *pathconf; /* pathconf */ 265 }; 266 #endif /* 0 */ 267 268 /* 269 * IBM is in dire need of taking a soft-eng class. 270 * They changed the API/ABI (namely the nfs3_args structure) 271 * in a service pack... 272 * 273 * All the following *_bis junk is here to try and deal with this idiocy. 274 */ 275 #define MOUNT_TYPE_NFS3_BIS 0x12344321 276 struct aix4_nfs_args_bis { 277 struct sockaddr_in addr; /* server address and port */ 278 struct sockaddr_in *syncaddr; /* secure NFS time sync addr */ 279 int proto; /* IPPROTO_TCP/IPPROTO_UDP ??? */ 280 char *hostname; /* pointer to hostname? */ 281 char *netname; /* pointer to netname? */ 282 caddr_t fh; /* pointer to NFS v3 fh? */ 283 unsigned long flags; /* flags */ 284 unsigned long wsize; /* wsize */ 285 unsigned long rsize; /* rsize */ 286 unsigned long timeo; /* timeo */ 287 unsigned long retrans; /* retrans */ 288 unsigned long acregmin; /* acregmin */ 289 unsigned long acregmax; /* acregmax */ 290 unsigned long acdirmin; /* acdirmin */ 291 unsigned long acdirmax; /* acdirmax */ 292 unsigned long u14; /* ??? UNKNOWN ??? */ 293 struct ppathcnf *pathconf; /* static pathconf kludge */ 294 int biods; /* biods per mount */ 295 int numclust; /* numclust per mount */ 296 }; 297 298 #endif /* MNT_NFS3 */ 299 300 /* 301 ************************************************************************** 302 * AIX 4.3's autofs is not ported or tested yet... 303 * For now, undefine it or define dummy entries. 304 ************************************************************************** 305 */ 306 #ifdef MNT_AUTOFS 307 # undef MNT_AUTOFS 308 #endif /* MNT_AUTOFS */ 309 #ifdef HAVE_FS_AUTOFS 310 # undef HAVE_FS_AUTOFS 311 #endif /* HAVE_FS_AUTOFS */ 312 313 /* 314 * EXTERNALS: 315 */ 316 extern bool_t xdr_groups(XDR *xdrs, groups *objp); 317 extern char *yperr_string (int incode); 318 319 #endif /* not _AMU_NFS_PROT_H */ 320