nfs.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. * Chosen to be a power of two, as most NFS servers are optimized for this. */
  32. #define NFS_READ_SIZE 1024
  33. #define NFS_MAXLINKDEPTH 16
  34. struct rpc_t {
  35. union {
  36. uint8_t data[2048];
  37. struct {
  38. uint32_t id;
  39. uint32_t type;
  40. uint32_t rpcvers;
  41. uint32_t prog;
  42. uint32_t vers;
  43. uint32_t proc;
  44. uint32_t data[1];
  45. } call;
  46. struct {
  47. uint32_t id;
  48. uint32_t type;
  49. uint32_t rstatus;
  50. uint32_t verifier;
  51. uint32_t v2;
  52. uint32_t astatus;
  53. uint32_t data[19];
  54. } reply;
  55. } u;
  56. };
  57. extern void NfsStart (void); /* Begin NFS */
  58. /**********************************************************************/
  59. #endif /* __NFS_H__ */