nfs.h 1.8 KB

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