1*ca987d46SWarner Losh /* $NetBSD: nfsv2.h,v 1.2 1996/02/26 23:05:23 gwr Exp $ */ 2*ca987d46SWarner Losh 3*ca987d46SWarner Losh /* 4*ca987d46SWarner Losh * Copyright (c) 1989, 1993 5*ca987d46SWarner Losh * The Regents of the University of California. All rights reserved. 6*ca987d46SWarner Losh * 7*ca987d46SWarner Losh * This code is derived from software contributed to Berkeley by 8*ca987d46SWarner Losh * Rick Macklem at The University of Guelph. 9*ca987d46SWarner Losh * 10*ca987d46SWarner Losh * Redistribution and use in source and binary forms, with or without 11*ca987d46SWarner Losh * modification, are permitted provided that the following conditions 12*ca987d46SWarner Losh * are met: 13*ca987d46SWarner Losh * 1. Redistributions of source code must retain the above copyright 14*ca987d46SWarner Losh * notice, this list of conditions and the following disclaimer. 15*ca987d46SWarner Losh * 2. Redistributions in binary form must reproduce the above copyright 16*ca987d46SWarner Losh * notice, this list of conditions and the following disclaimer in the 17*ca987d46SWarner Losh * documentation and/or other materials provided with the distribution. 18*ca987d46SWarner Losh * 3. Neither the name of the University nor the names of its contributors 19*ca987d46SWarner Losh * may be used to endorse or promote products derived from this software 20*ca987d46SWarner Losh * without specific prior written permission. 21*ca987d46SWarner Losh * 22*ca987d46SWarner Losh * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 23*ca987d46SWarner Losh * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24*ca987d46SWarner Losh * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25*ca987d46SWarner Losh * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 26*ca987d46SWarner Losh * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27*ca987d46SWarner Losh * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28*ca987d46SWarner Losh * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29*ca987d46SWarner Losh * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30*ca987d46SWarner Losh * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31*ca987d46SWarner Losh * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32*ca987d46SWarner Losh * SUCH DAMAGE. 33*ca987d46SWarner Losh */ 34*ca987d46SWarner Losh 35*ca987d46SWarner Losh /* 36*ca987d46SWarner Losh * nfs definitions as per the version 2 specs 37*ca987d46SWarner Losh */ 38*ca987d46SWarner Losh 39*ca987d46SWarner Losh /* 40*ca987d46SWarner Losh * Constants as defined in the Sun NFS Version 2 spec. 41*ca987d46SWarner Losh * "NFS: Network File System Protocol Specification" RFC1094 42*ca987d46SWarner Losh */ 43*ca987d46SWarner Losh 44*ca987d46SWarner Losh #define NFS_PORT 2049 45*ca987d46SWarner Losh #define NFS_PROG 100003 46*ca987d46SWarner Losh #define NFS_VER2 2 47*ca987d46SWarner Losh #define NFS_MAXDGRAMDATA 8192 48*ca987d46SWarner Losh #define NFS_MAXDATA 32768 49*ca987d46SWarner Losh #define NFS_MAXPATHLEN 1024 50*ca987d46SWarner Losh #define NFS_MAXNAMLEN 255 51*ca987d46SWarner Losh #define NFS_FHSIZE 32 52*ca987d46SWarner Losh #define NFS_MAXPKTHDR 404 53*ca987d46SWarner Losh #define NFS_MAXPACKET (NFS_MAXPKTHDR+NFS_MAXDATA) 54*ca987d46SWarner Losh #define NFS_MINPACKET 20 55*ca987d46SWarner Losh #define NFS_FABLKSIZE 512 /* Size in bytes of a block wrt fa_blocks */ 56*ca987d46SWarner Losh #define NFS_READDIRSIZE 1024 57*ca987d46SWarner Losh 58*ca987d46SWarner Losh /* Stat numbers for rpc returns */ 59*ca987d46SWarner Losh #define NFS_OK 0 60*ca987d46SWarner Losh #define NFSERR_PERM 1 61*ca987d46SWarner Losh #define NFSERR_NOENT 2 62*ca987d46SWarner Losh #define NFSERR_IO 5 63*ca987d46SWarner Losh #define NFSERR_NXIO 6 64*ca987d46SWarner Losh #define NFSERR_ACCES 13 65*ca987d46SWarner Losh #define NFSERR_EXIST 17 66*ca987d46SWarner Losh #define NFSERR_NODEV 19 67*ca987d46SWarner Losh #define NFSERR_NOTDIR 20 68*ca987d46SWarner Losh #define NFSERR_ISDIR 21 69*ca987d46SWarner Losh #define NFSERR_FBIG 27 70*ca987d46SWarner Losh #define NFSERR_NOSPC 28 71*ca987d46SWarner Losh #define NFSERR_ROFS 30 72*ca987d46SWarner Losh #define NFSERR_NAMETOL 63 73*ca987d46SWarner Losh #define NFSERR_NOTEMPTY 66 74*ca987d46SWarner Losh #define NFSERR_DQUOT 69 75*ca987d46SWarner Losh #define NFSERR_STALE 70 76*ca987d46SWarner Losh #define NFSERR_WFLUSH 99 77*ca987d46SWarner Losh 78*ca987d46SWarner Losh /* Sizes in bytes of various nfs rpc components */ 79*ca987d46SWarner Losh #define NFSX_FH 32 80*ca987d46SWarner Losh #define NFSX_UNSIGNED 4 81*ca987d46SWarner Losh #define NFSX_FATTR 68 82*ca987d46SWarner Losh #define NFSX_SATTR 32 83*ca987d46SWarner Losh #define NFSX_STATFS 20 84*ca987d46SWarner Losh #define NFSX_COOKIE 4 85*ca987d46SWarner Losh 86*ca987d46SWarner Losh /* nfs rpc procedure numbers */ 87*ca987d46SWarner Losh #define NFSPROC_NULL 0 88*ca987d46SWarner Losh #define NFSPROC_GETATTR 1 89*ca987d46SWarner Losh #define NFSPROC_SETATTR 2 90*ca987d46SWarner Losh #define NFSPROC_NOOP 3 91*ca987d46SWarner Losh #define NFSPROC_ROOT NFSPROC_NOOP /* Obsolete */ 92*ca987d46SWarner Losh #define NFSPROC_LOOKUP 4 93*ca987d46SWarner Losh #define NFSPROC_READLINK 5 94*ca987d46SWarner Losh #define NFSPROC_READ 6 95*ca987d46SWarner Losh #define NFSPROC_WRITECACHE NFSPROC_NOOP /* Obsolete */ 96*ca987d46SWarner Losh #define NFSPROC_WRITE 8 97*ca987d46SWarner Losh #define NFSPROC_CREATE 9 98*ca987d46SWarner Losh #define NFSPROC_REMOVE 10 99*ca987d46SWarner Losh #define NFSPROC_RENAME 11 100*ca987d46SWarner Losh #define NFSPROC_LINK 12 101*ca987d46SWarner Losh #define NFSPROC_SYMLINK 13 102*ca987d46SWarner Losh #define NFSPROC_MKDIR 14 103*ca987d46SWarner Losh #define NFSPROC_RMDIR 15 104*ca987d46SWarner Losh #define NFSPROC_READDIR 16 105*ca987d46SWarner Losh #define NFSPROC_STATFS 17 106*ca987d46SWarner Losh 107*ca987d46SWarner Losh #define NFS_NPROCS 18 108*ca987d46SWarner Losh 109*ca987d46SWarner Losh 110*ca987d46SWarner Losh /* File types */ 111*ca987d46SWarner Losh typedef enum { 112*ca987d46SWarner Losh NFNON=0, 113*ca987d46SWarner Losh NFREG=1, 114*ca987d46SWarner Losh NFDIR=2, 115*ca987d46SWarner Losh NFBLK=3, 116*ca987d46SWarner Losh NFCHR=4, 117*ca987d46SWarner Losh NFLNK=5 118*ca987d46SWarner Losh } nfstype; 119