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.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #ifndef _IPXE_MOUNT_H
  2. #define _IPXE_MOUNT_H
  3. #include <ipxe/nfs.h>
  4. /** @file
  5. *
  6. * NFS MOUNT protocol.
  7. *
  8. */
  9. FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
  10. /** NFS MOUNT protocol number */
  11. #define ONCRPC_MOUNT 100005
  12. /** NFS MOUNT protocol version */
  13. #define MOUNT_VERS 3
  14. /** No error */
  15. #define MNT3_OK 0
  16. /** Not owner */
  17. #define MNT3ERR_PERM 1
  18. /** No such file or directory */
  19. #define MNT3ERR_NOENT 2
  20. /** I/O error */
  21. #define MNT3ERR_IO 5
  22. /** Permission denied */
  23. #define MNT3ERR_ACCES 13
  24. /** Not a directory */
  25. #define MNT3ERR_NOTDIR 20
  26. /** Invalid argument */
  27. #define MNT3ERR_INVAL 22
  28. /** Filename too long */
  29. #define MNT3ERR_NAMETOOLONG 63
  30. /** Operation not supported */
  31. #define MNT3ERR_NOTSUPP 10004
  32. /** A failure on the server */
  33. #define MNT3ERR_SERVERFAULT 10006
  34. /**
  35. * A MOUNT MNT reply
  36. *
  37. */
  38. struct mount_mnt_reply {
  39. /** Reply status */
  40. uint32_t status;
  41. /** Root file handle */
  42. struct nfs_fh fh;
  43. };
  44. /**
  45. * Prepare an ONC RPC session to be used as a MOUNT session
  46. *
  47. * @v session ONC RPC session
  48. * @v credential ONC RPC credential
  49. *
  50. * The credential parameter must not be NULL, use 'oncrpc_auth_none' if you
  51. * don't want a particular scheme to be used.
  52. */
  53. static inline void mount_init_session ( struct oncrpc_session *session,
  54. struct oncrpc_cred *credential ) {
  55. oncrpc_init_session ( session, credential, &oncrpc_auth_none,
  56. ONCRPC_MOUNT, MOUNT_VERS );
  57. }
  58. int mount_mnt ( struct interface *intf, struct oncrpc_session *session,
  59. const char *mountpoint );
  60. int mount_umnt ( struct interface *intf, struct oncrpc_session *session,
  61. const char *mountpoint );
  62. int mount_get_mnt_reply ( struct mount_mnt_reply *mnt_reply,
  63. struct oncrpc_reply *reply );
  64. #endif /* _IPXE_MOUNT_H */