home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga 13 / MA_Cover_13.bin / source / c / nfsd / src / nfs_prot.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-11-24  |  2.7 KB  |  98 lines

  1. /*  Constants defined by the NFS protocol
  2.  
  3.     ©1999 Joseph Walton
  4.  
  5.     This software is distributed under the terms of the GNU General Public
  6.     License; either version 2 of the License, or (at your option) any
  7.     later version.
  8. */
  9.  
  10. #ifndef NFSD_NFS_PROT_H
  11. #define NFSD_NFS_PROT_H
  12.  
  13. #define NFS_PORT 2049
  14.  
  15. #define NFS_PROGRAM 100003
  16. #define NFS_VERSION 2
  17.  
  18. #define NFS_FHSIZE 32
  19.  
  20. #define NFS_MAXDATA 8192
  21. #define NFS_MAXPATHLEN 1024
  22. #define NFS_MAXNAMELEN 255
  23. #define NFS_COOKIESIZE 4
  24.  
  25. /*
  26.  * Error status
  27.  */
  28. enum nfsstat {
  29.         NFS_OK = 0,               /* no error */
  30.         NFSERR_PERM = 1,          /* Not owner */
  31.         NFSERR_NOENT = 2,         /* No such file or directory */
  32.         NFSERR_IO = 5,            /* I/O error */
  33.         NFSERR_NXIO = 6,          /* No such device or address */
  34.         NFSERR_ACCES = 13,        /* Permission denied */
  35.         NFSERR_EXIST = 17,        /* File exists */
  36.         NFSERR_NODEV = 19,        /* No such device */
  37.         NFSERR_NOTDIR = 20,       /* Not a directory*/
  38.         NFSERR_ISDIR = 21,        /* Is a directory */
  39.         NFSERR_INVAL = 22,        /* invalid argument */
  40.         NFSERR_FBIG = 27,         /* File too large */
  41.         NFSERR_NOSPC = 28,        /* No space left on device */
  42.         NFSERR_ROFS = 30,         /* Read-only file system */
  43.         NFSERR_NAMETOOLONG = 63,  /* File name too long */
  44.         NFSERR_NOTEMPTY = 66,     /* Directory not empty */
  45.         NFSERR_DQUOT = 69,        /* Disc quota exceeded */
  46.         NFSERR_STALE = 70,        /* Stale NFS file handle */
  47.         NFSERR_WFLUSH = 99        /* write cache flushed */
  48. };
  49.  
  50. typedef enum nfsstat nfsstat;
  51.  
  52. /*
  53.  * File types
  54.  */
  55. enum ftype {
  56.         NFNON = 0,      /* non-file */
  57.         NFREG = 1,      /* regular file */
  58.         NFDIR = 2,      /* directory */
  59.         NFBLK = 3,      /* block special */
  60.         NFCHR = 4,      /* character special */
  61.         NFLNK = 5,      /* symbolic link */
  62.         NFSOCK = 6,     /* unix domain sockets */
  63.         NFBAD = 7,      /* unused */
  64.         NFFIFO = 8      /* named pipe */
  65. };
  66.  
  67. typedef enum ftype ftype;
  68.  
  69. /*
  70.  * File types
  71.  */
  72. #define NFSMODE_DIR 0040000   /* directory */
  73. #define NFSMODE_REG 0100000   /* regular */
  74. #define NFSMODE_LNK 0120000   /* symbolic link */
  75.  
  76. /* Procedure IDs */
  77. #define NFS_PROC_NULL 0
  78. #define NFS_PROC_GETATTR 1
  79. #define NFS_PROC_SETATTR 2
  80. #define NFS_PROC_ROOT 3
  81. #define NFS_PROC_LOOKUP 4
  82. #define NFS_PROC_READLINK 5
  83. #define NFS_PROC_READ 6
  84. #define NFS_PROC_WRITECACHE 7
  85. #define NFS_PROC_WRITE 8
  86. #define NFS_PROC_CREATE 9
  87. #define NFS_PROC_REMOVE 10
  88. #define NFS_PROC_RENAME 11
  89. #define NFS_PROC_LINK 12
  90. #define NFS_PROC_SYMLINK 13
  91. #define NFS_PROC_MKDIR 14
  92. #define NFS_PROC_RMDIR 15
  93. #define NFS_PROC_READDIR 16
  94. #define NFS_PROC_STATFS 17
  95.  
  96. #endif
  97.  
  98.