You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #ifndef _NFS_H
  2. #define _NFS_H
  3. #define SUNRPC_PORT 111
  4. #define PROG_PORTMAP 100000
  5. #define PROG_NFS 100003
  6. #define PROG_MOUNT 100005
  7. #define MSG_CALL 0
  8. #define MSG_REPLY 1
  9. #define PORTMAP_GETPORT 3
  10. #define MOUNT_ADDENTRY 1
  11. #define MOUNT_UMOUNTALL 4
  12. #define NFS_LOOKUP 4
  13. #define NFS_READLINK 5
  14. #define NFS_READ 6
  15. #define NFS_FHSIZE 32
  16. #define NFSERR_PERM 1
  17. #define NFSERR_NOENT 2
  18. #define NFSERR_ACCES 13
  19. #define NFSERR_ISDIR 21
  20. #define NFSERR_INVAL 22
  21. /* Block size used for NFS read accesses. A RPC reply packet (including all
  22. * headers) must fit within a single Ethernet frame to avoid fragmentation.
  23. * Chosen to be a power of two, as most NFS servers are optimized for this. */
  24. #define NFS_READ_SIZE 1024
  25. #define NFS_MAXLINKDEPTH 16
  26. struct rpc_t {
  27. struct iphdr ip;
  28. struct udphdr udp;
  29. union {
  30. uint8_t data[300]; /* longest RPC call must fit!!!! */
  31. struct {
  32. uint32_t id;
  33. uint32_t type;
  34. uint32_t rpcvers;
  35. uint32_t prog;
  36. uint32_t vers;
  37. uint32_t proc;
  38. uint32_t data[1];
  39. } call;
  40. struct {
  41. uint32_t id;
  42. uint32_t type;
  43. uint32_t rstatus;
  44. uint32_t verifier;
  45. uint32_t v2;
  46. uint32_t astatus;
  47. uint32_t data[1];
  48. } reply;
  49. } u;
  50. } PACKED;
  51. #endif /* _NFS_H */