iPXE
mount.h
Go to the documentation of this file.
00001 #ifndef _IPXE_MOUNT_H
00002 #define _IPXE_MOUNT_H
00003 
00004 #include <ipxe/nfs.h>
00005 
00006 /** @file
00007  *
00008  * NFS MOUNT protocol.
00009  *
00010  */
00011 
00012 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
00013 
00014 /** NFS MOUNT protocol number */
00015 #define ONCRPC_MOUNT 100005
00016 /** NFS MOUNT protocol version */
00017 #define MOUNT_VERS   3
00018 
00019 
00020 /** No error */
00021 #define MNT3_OK                 0
00022 /** Not owner */
00023 #define MNT3ERR_PERM            1
00024 /** No such file or directory */
00025 #define MNT3ERR_NOENT           2
00026 /** I/O error */
00027 #define MNT3ERR_IO              5
00028 /** Permission denied */
00029 #define MNT3ERR_ACCES           13
00030 /** Not a directory */
00031 #define MNT3ERR_NOTDIR          20
00032 /** Invalid argument */
00033 #define MNT3ERR_INVAL           22
00034 /** Filename too long */
00035 #define MNT3ERR_NAMETOOLONG     63
00036 /** Operation not supported */
00037 #define MNT3ERR_NOTSUPP         10004
00038 /** A failure on the server */
00039 #define MNT3ERR_SERVERFAULT     10006
00040 
00041 
00042 /**
00043  * A MOUNT MNT reply
00044  *
00045  */
00046 struct mount_mnt_reply {
00047         /** Reply status */
00048         uint32_t        status;
00049         /** Root file handle */
00050         struct nfs_fh   fh;
00051 };
00052 
00053 /**
00054  * Prepare an ONC RPC session to be used as a MOUNT session
00055  *
00056  * @v session           ONC RPC session
00057  * @v credential        ONC RPC credential
00058  *
00059  * The credential parameter must not be NULL, use 'oncrpc_auth_none' if you
00060  * don't want a particular scheme to be used.
00061  */
00062 static inline void mount_init_session ( struct oncrpc_session *session,
00063                                         struct oncrpc_cred *credential ) {
00064         oncrpc_init_session ( session, credential, &oncrpc_auth_none,
00065                               ONCRPC_MOUNT, MOUNT_VERS );
00066 }
00067 
00068 int mount_mnt ( struct interface *intf, struct oncrpc_session *session,
00069                 const char *mountpoint );
00070 int mount_umnt ( struct interface *intf, struct oncrpc_session *session,
00071                  const char *mountpoint );
00072 
00073 int mount_get_mnt_reply ( struct mount_mnt_reply *mnt_reply,
00074                           struct oncrpc_reply *reply );
00075 
00076 #endif /* _IPXE_MOUNT_H */