1 /* $NetBSD: nfs_prot_openbsd.h,v 1.1.1.2 2009/03/20 20:26:51 christos Exp $ */ 2 3 /* 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. 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. 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. 28 * 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 39 * SUCH DAMAGE. 40 * 41 * 42 * File: am-utils/conf/nfs_prot/nfs_prot_openbsd.h 43 * 44 */ 45 46 #ifndef _AMU_NFS_PROT_H 47 #define _AMU_NFS_PROT_H 48 49 #ifdef HAVE_RPCSVC_NFS_PROT_H 50 # include <rpcsvc/nfs_prot.h> 51 #endif /* HAVE_RPCSVC_NFS_PROT_H */ 52 #ifdef HAVE_NFS_RPCV2_H 53 # include <nfs/rpcv2.h> 54 #endif /* HAVE_NFS_RPCV2_H */ 55 56 #ifndef NFS_NPROCS 57 # define NFS_NPROCS 26 58 #endif /* not NFS_NPROCS */ 59 #ifdef HAVE_NFS_NFS_H 60 # include <nfs/nfs.h> 61 #endif /* HAVE_NFS_NFS_H */ 62 63 #ifdef HAVE_UFS_UFS_UFSMOUNT_H 64 # ifdef HAVE_UFS_UFS_EXTATTR_H 65 /* 66 * Need to define _KERNEL to include protected definition of struct 67 * ufs_extattr_per_mount, which is used in struct ufsmount in 68 * <ufs/ufs/ufsmount.h>, but is NOT protected by _KERNEL there. 69 */ 70 # define _KERNEL 71 # include <ufs/ufs/extattr.h> 72 # undef _KERNEL 73 # endif /* HAVE_UFS_UFS_EXTATTR_H */ 74 # ifndef MAXQUOTAS 75 # define MAXQUOTAS 2 76 # endif /* not MAXQUOTAS */ 77 /* 78 * XXX: fake struct nextexport: trying to include proper headers here is too 79 * difficult: those headers drag many other headers, etc. 80 */ 81 struct netexport { int this_is_SO_wrong; }; 82 # include <ufs/ufs/ufsmount.h> 83 #endif /* HAVE_UFS_UFS_UFSMOUNT_H */ 84 85 86 /* 87 * MACROS: 88 */ 89 #define dr_drok_u diropres 90 #define ca_where where 91 #define da_fhandle dir 92 #define da_name name 93 #define dl_entries entries 94 #define dl_eof eof 95 #define dr_status status 96 #define dr_u diropres_u 97 #define drok_attributes attributes 98 #define drok_fhandle file 99 #define fh_data data 100 #define la_fhandle from 101 #define la_to to 102 #define na_atime atime 103 #define na_ctime ctime 104 #define na_fileid fileid 105 #define na_fsid fsid 106 #define na_mode mode 107 #define na_mtime mtime 108 #define na_nlink nlink 109 #define na_size size 110 #define na_type type 111 #define na_uid uid 112 #define na_gid gid 113 #define ne_cookie cookie 114 #define ne_fileid fileid 115 #define ne_name name 116 #define ne_nextentry nextentry 117 #define ns_attr_u attributes 118 #define ns_status status 119 #define ns_u attrstat_u 120 #define nt_seconds seconds 121 #define nt_useconds useconds 122 #define rda_cookie cookie 123 #define rda_count count 124 #define rda_fhandle dir 125 #define rdr_reply_u reply 126 #define rdr_status status 127 #define rdr_u readdirres_u 128 #define rlr_data_u data 129 #define rlr_status status 130 #define rlr_u readlinkres_u 131 #define rna_from from 132 #define rna_to to 133 #define rr_status status 134 #define sag_fhandle file 135 #define sfr_reply_u reply 136 #define sfr_status status 137 #define sfr_u statfsres_u 138 #define sfrok_bavail bavail 139 #define sfrok_bfree bfree 140 #define sfrok_blocks blocks 141 #define sfrok_bsize bsize 142 #define sfrok_tsize tsize 143 #define sla_from from 144 #define wra_fhandle file 145 146 147 /* 148 * TYPEDEFS: 149 */ 150 typedef attrstat nfsattrstat; 151 typedef createargs nfscreateargs; 152 typedef dirlist nfsdirlist; 153 typedef diropargs nfsdiropargs; 154 typedef diropres nfsdiropres; 155 typedef entry nfsentry; 156 typedef fattr nfsfattr; 157 typedef ftype nfsftype; 158 typedef linkargs nfslinkargs; 159 typedef readargs nfsreadargs; 160 typedef readdirargs nfsreaddirargs; 161 typedef readdirres nfsreaddirres; 162 typedef readlinkres nfsreadlinkres; 163 typedef readres nfsreadres; 164 typedef renameargs nfsrenameargs; 165 typedef sattrargs nfssattrargs; 166 typedef statfsokres nfsstatfsokres; 167 typedef statfsres nfsstatfsres; 168 typedef symlinkargs nfssymlinkargs; 169 typedef writeargs nfswriteargs; 170 171 172 /* 173 * OpenBSD 2.2 has NFS V3, but it is undefined in the header files. 174 * so I define everything that's needed for NFS V3 here. 175 */ 176 #ifdef NFSMNT_NFSV3 177 178 /* 179 * turn of this function so it cannot be used! OpenBSD seems to 180 * require that NFS sockets be connected. 181 * See m4/macros/check_nfs_socket_connection.m4. 182 */ 183 184 # define MOUNT_NFS3 MOUNT_NFS 185 # define MNTOPT_NFS3 "nfs" 186 187 #endif /* NFSMNT_NFSV3 */ 188 189 #endif /* not _AMU_NFS_PROT_H */ 190