* This code is derived from software contributed to Berkeley by
* Rick Macklem at The University of Guelph.
*
- * Redistribution and use in source and binary forms are permitted
- * provided that the above copyright notice and this paragraph are
- * duplicated in all such forms and that any documentation,
- * advertising materials, and other materials related to such
- * distribution and use acknowledge that the software was developed
- * by the University of California, Berkeley. The name of the
- * University may not be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ * %sccs.include.redist.c%
*
- * @(#)nfsproto.h 7.2 (Berkeley) %G%
+ * @(#)nfsproto.h 7.10 (Berkeley) %G%
*/
/*
/*
* Constants as defined in the Sun NFS Version 2 spec.
- * "Network File System Protocol Specification" in the
- * Manual "Networking on the Sun Workstation", Part #800-1324-03, Rev B
+ * "NFS: Network File System Protocol Specification" RFC1094
*/
#define NFS_PORT 2049
#define NFS_PROG 100003
#define NFS_VER2 2
-#define NFS_MAXDATA 8192
+#define NFS_MAXDGRAMDATA 8192
+#define NFS_MAXDATA 32768
#define NFS_MAXPATHLEN 1024
#define NFS_MAXNAMLEN 255
#define NFS_FHSIZE 32
-#define NFS_NPROCS 18
+#define NFS_MAXPKTHDR 404
+#define NFS_MAXPACKET (NFS_MAXPKTHDR+NFS_MAXDATA)
+#define NFS_MINPACKET 20
+#define NFS_FABLKSIZE 512 /* Size in bytes of a block wrt fa_blocks */
/* Stat numbers for rpc returns */
#define NFS_OK 0
#define NFSERR_FBIG 27
#define NFSERR_NOSPC 28
#define NFSERR_ROFS 30
-#define NFSERR_NAMETOOLONG 63
+#define NFSERR_NAMETOL 63
#define NFSERR_NOTEMPTY 66
#define NFSERR_DQUOT 69
#define NFSERR_STALE 70
#define NFSPROC_NULL 0
#define NFSPROC_GETATTR 1
#define NFSPROC_SETATTR 2
-#define NFSPROC_ROOT 3 /* Obsolete */
+#define NFSPROC_NOOP 3
+#define NFSPROC_ROOT NFSPROC_NOOP /* Obsolete */
#define NFSPROC_LOOKUP 4
#define NFSPROC_READLINK 5
#define NFSPROC_READ 6
-#define NFSPROC_WRITECACHE 7 /* Obsolete */
+#define NFSPROC_WRITECACHE NFSPROC_NOOP /* Obsolete */
#define NFSPROC_WRITE 8
#define NFSPROC_CREATE 9
#define NFSPROC_REMOVE 10
#define NFSPROC_READDIR 16
#define NFSPROC_STATFS 17
+/* NQ nfs numbers */
+#define NQNFSPROC_READDIRLOOK 18
+#define NQNFSPROC_GETLEASE 19
+#define NQNFSPROC_VACATED 20
+#define NQNFSPROC_EVICTED 21
+
+#define NFS_NPROCS 22
/* Conversion macros */
-#define vtonfs_mode(t,m) txdr_unsigned(MAKEIMODE(t,m))
+extern int vttoif_tab[];
+#define vtonfs_mode(t,m) \
+ txdr_unsigned(((t) == VFIFO) ? MAKEIMODE(VCHR, (m)) : \
+ MAKEIMODE((t), (m)))
#define nfstov_mode(a) (fxdr_unsigned(u_short, (a))&07777)
#define vtonfs_type(a) txdr_unsigned(nfs_type[((long)(a))])
-#define nfstov_type(a) v_type[fxdr_unsigned(u_long, (a))]
+#define nfstov_type(a) ntov_type[fxdr_unsigned(u_long,(a))&0x7]
/* File types */
typedef enum { NFNON=0, NFREG=1, NFDIR=2, NFBLK=3, NFCHR=4, NFLNK=5 } nfstype;