nfs.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * (C) Masami Komiya <mkomiya@sonare.it> 2004
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #ifndef __NFS_H__
  7. #define __NFS_H__
  8. #define SUNRPC_PORT 111
  9. #define PROG_PORTMAP 100000
  10. #define PROG_NFS 100003
  11. #define PROG_MOUNT 100005
  12. #define MSG_CALL 0
  13. #define MSG_REPLY 1
  14. #define PORTMAP_GETPORT 3
  15. #define MOUNT_ADDENTRY 1
  16. #define MOUNT_UMOUNTALL 4
  17. #define NFS_LOOKUP 4
  18. #define NFS_READLINK 5
  19. #define NFS_READ 6
  20. #define NFS_FHSIZE 32
  21. #define NFSERR_PERM 1
  22. #define NFSERR_NOENT 2
  23. #define NFSERR_ACCES 13
  24. #define NFSERR_ISDIR 21
  25. #define NFSERR_INVAL 22
  26. /* Block size used for NFS read accesses. A RPC reply packet (including all
  27. * headers) must fit within a single Ethernet frame to avoid fragmentation.
  28. * However, if CONFIG_IP_DEFRAG is set, the config file may want to use a
  29. * bigger value. In any case, most NFS servers are optimized for a power of 2.
  30. */
  31. #ifdef CONFIG_NFS_READ_SIZE
  32. #define NFS_READ_SIZE CONFIG_NFS_READ_SIZE
  33. #else
  34. #define NFS_READ_SIZE 1024 /* biggest power of two that fits Ether frame */
  35. #endif
  36. #define NFS_MAXLINKDEPTH 16
  37. struct rpc_t {
  38. union {
  39. uint8_t data[2048];
  40. struct {
  41. uint32_t id;
  42. uint32_t type;
  43. uint32_t rpcvers;
  44. uint32_t prog;
  45. uint32_t vers;
  46. uint32_t proc;
  47. uint32_t data[1];
  48. } call;
  49. struct {
  50. uint32_t id;
  51. uint32_t type;
  52. uint32_t rstatus;
  53. uint32_t verifier;
  54. uint32_t v2;
  55. uint32_t astatus;
  56. uint32_t data[19];
  57. } reply;
  58. } u;
  59. };
  60. extern void NfsStart(void); /* Begin NFS */
  61. /**********************************************************************/
  62. #endif /* __NFS_H__ */