1 /* $NetBSD: nfs_prot_sunos5_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_sunos5_3.h 39 * 40 */ 41 42 #ifndef _AMU_NFS_PROT_H 43 #define _AMU_NFS_PROT_H 44 45 /* 46 * Do not include <nfs/nfs.h> because Solaris 2.3 really does not have NFS 47 * V.3 support, despite what their header files claim. 48 */ 49 50 #ifdef HAVE_RPCSVC_NFS_PROT_H 51 # include <rpcsvc/nfs_prot.h> 52 #endif /* HAVE_RPCSVC_NFS_PROT_H */ 53 54 #ifndef fhandle_t 55 # define fhandle_t nfs_fh 56 #endif /* not fhandle_t */ 57 58 #ifdef HAVE_RPCSVC_MOUNT_H 59 # include <rpcsvc/mount.h> 60 #endif /* HAVE_RPCSVC_MOUNT_H */ 61 #ifdef HAVE_RPC_RPC_H 62 #include <rpc/rpc.h> 63 #endif /* HAVE_RPC_RPC_H */ 64 65 /* missing mntent definition for cachefs */ 66 #ifndef MNTTYPE_CACHEFS 67 # define MNTTYPE_CACHEFS "cachefs" /* Cache File System */ 68 #endif /* not MNTTYPE_CACHEFS */ 69 70 /* 71 * MACROS 72 */ 73 74 #define NFS_PORT 2049 75 #define NFS_MAXDATA 8192 76 #define NFS_MAXPATHLEN 1024 77 #define NFS_MAXNAMLEN 255 78 #define NFS_FHSIZE 32 79 #define FHSIZE 32 80 #define NFS_COOKIESIZE 4 81 82 #define NFSMODE_FMT 0170000 83 #define NFSMODE_DIR 0040000 84 #define NFSMODE_CHR 0020000 85 #define NFSMODE_BLK 0060000 86 #define NFSMODE_REG 0100000 87 #define NFSMODE_LNK 0120000 88 #define NFSMODE_SOCK 0140000 89 #define NFSMODE_FIFO 0010000 90 91 #define dr_drok_u diropres 92 #define ca_attributes attributes 93 #define ca_where where 94 #define da_fhandle dir 95 #define da_name name 96 #define dl_entries entries 97 #define dl_eof eof 98 #define dr_status status 99 #define dr_u diropres_u 100 #define drok_attributes attributes 101 #define drok_fhandle file 102 #define fh_data data 103 #define la_fhandle from 104 #define la_to to 105 #define na_atime atime 106 #define na_blocks blocks 107 #define na_blocksize blocksize 108 #define na_ctime ctime 109 #define na_fileid fileid 110 #define na_fsid fsid 111 #define na_gid gid 112 #define na_mode mode 113 #define na_mtime mtime 114 #define na_nlink nlink 115 #define na_rdev rdev 116 #define na_size size 117 #define na_type type 118 #define na_uid uid 119 #define ne_cookie cookie 120 #define ne_fileid fileid 121 #define ne_name name 122 #define ne_nextentry nextentry 123 #define ns_attr_u attributes 124 #define ns_status status 125 #define ns_u attrstat_u 126 #define nt_seconds seconds 127 #define nt_useconds useconds 128 #define ra_count count 129 #define ra_fhandle file 130 #define ra_offset offset 131 #define ra_totalcount totalcount 132 #define raok_attributes attributes 133 #define raok_len_u data_len 134 #define raok_u data 135 #define raok_val_u data_val 136 #define rda_cookie cookie 137 #define rda_count count 138 #define rda_fhandle dir 139 #define rdr_reply_u reply 140 #define rdr_status status 141 #define rdr_u readdirres_u 142 #define rlr_data_u data 143 #define rlr_status status 144 #define rlr_u readlinkres_u 145 #define rna_from from 146 #define rna_to to 147 #define rr_reply_u reply 148 #define rr_status status 149 #define rr_u readres_u 150 #define sa_atime atime 151 #define sa_gid gid 152 #define sa_mode mode 153 #define sa_mtime mtime 154 #define sa_size size 155 #define sa_uid uid 156 #define sag_attributes attributes 157 #define sag_fhandle file 158 #define sfr_reply_u reply 159 #define sfr_status status 160 #define sfr_u statfsres_u 161 #define sfrok_bavail bavail 162 #define sfrok_bfree bfree 163 #define sfrok_blocks blocks 164 #define sfrok_bsize bsize 165 #define sfrok_tsize tsize 166 #define sla_attributes attributes 167 #define sla_from from 168 #define sla_to to 169 #define wra_beginoffset beginoffset 170 #define wra_fhandle file 171 #define wra_len_u data_len 172 #define wra_offset offset 173 #define wra_totalcount totalcount 174 #define wra_u data 175 #define wra_val_u data_val 176 177 /* map field names */ 178 #define ex_dir ex_name 179 #define gr_name g_name 180 #define gr_next g_next 181 #define ml_directory ml_path 182 #define ml_hostname ml_name 183 #define ml_next ml_nxt 184 185 186 /* 187 * TYPEDEFS: 188 */ 189 190 typedef char *dirpath; 191 typedef char *name; 192 typedef char fhandle[FHSIZE]; 193 typedef enum ftype nfsftype; 194 typedef struct attrstat nfsattrstat; 195 typedef struct createargs nfscreateargs; 196 typedef struct dirlist nfsdirlist; 197 typedef struct diropargs nfsdiropargs; 198 typedef struct diropokres nfsdiropokres; 199 typedef struct diropres nfsdiropres; 200 typedef struct entry nfsentry; 201 typedef struct exports *exports; 202 typedef struct exports exportnode; 203 typedef struct fattr nfsfattr; 204 typedef struct nfsfhstatus fhstatus; 205 typedef struct groups *groups; 206 typedef struct groups groupnode; 207 typedef struct linkargs nfslinkargs; 208 typedef struct mountlist *mountlist; 209 typedef struct mountlist mountbody; 210 typedef struct readargs nfsreadargs; 211 typedef struct readdirargs nfsreaddirargs; 212 typedef struct readdirres nfsreaddirres; 213 typedef struct readlinkres nfsreadlinkres; 214 typedef struct readokres nfsreadokres; 215 typedef struct readres nfsreadres; 216 typedef struct renameargs nfsrenameargs; 217 typedef struct sattr nfssattr; 218 typedef struct sattrargs nfssattrargs; 219 typedef struct statfsokres nfsstatfsokres; 220 typedef struct statfsres nfsstatfsres; 221 typedef struct symlinkargs nfssymlinkargs; 222 typedef struct writeargs nfswriteargs; 223 224 225 /* 226 * EXTERNALS: 227 */ 228 229 extern bool_t xdr_createargs(XDR *, nfscreateargs *); 230 extern bool_t xdr_dirlist(XDR *, nfsdirlist *); 231 extern bool_t xdr_diropokres(XDR *, nfsdiropokres *); 232 extern bool_t xdr_entry(XDR *, nfsentry *); 233 extern bool_t xdr_filename(XDR *, filename *); 234 extern bool_t xdr_ftype(XDR *, nfsftype *); 235 extern bool_t xdr_nfs_fh(XDR *, nfs_fh *); 236 extern bool_t xdr_nfscookie(XDR *, nfscookie); 237 extern bool_t xdr_nfspath(XDR *, nfspath *); 238 extern bool_t xdr_nfsstat(XDR *, nfsstat *); 239 extern bool_t xdr_nfstime(XDR *, nfstime *); 240 extern bool_t xdr_readdirargs(XDR *, nfsreaddirargs *); 241 extern bool_t xdr_readdirres(XDR *, nfsreaddirres *); 242 extern bool_t xdr_readlinkres(XDR *, nfsreadlinkres *); 243 extern bool_t xdr_readokres(XDR *, nfsreadokres *); 244 extern bool_t xdr_readres(XDR *, nfsreadres *); 245 extern bool_t xdr_renameargs(XDR *, nfsrenameargs *); 246 extern bool_t xdr_sattrargs(XDR *, nfssattrargs *); 247 extern bool_t xdr_statfsokres(XDR *, nfsstatfsokres *); 248 extern bool_t xdr_statfsres(XDR *, nfsstatfsres *); 249 extern bool_t xdr_symlinkargs(XDR *, nfssymlinkargs *); 250 251 252 /* 253 * ENUMS: 254 */ 255 256 257 /* 258 * STRUCTURES: 259 */ 260 261 struct nfsfhstatus { 262 int fhs_status; 263 fhandle fhs_fh; 264 }; 265 266 #endif /* not _AMU_NFS_PROT_H */ 267