iPXE
mount.h
Go to the documentation of this file.
1 #ifndef _IPXE_MOUNT_H
2 #define _IPXE_MOUNT_H
3 
4 #include <ipxe/nfs.h>
5 
6 /** @file
7  *
8  * NFS MOUNT protocol.
9  *
10  */
11 
12 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
13 
14 /** NFS MOUNT protocol number */
15 #define ONCRPC_MOUNT 100005
16 /** NFS MOUNT protocol version */
17 #define MOUNT_VERS 3
18 
19 
20 /** No error */
21 #define MNT3_OK 0
22 /** Not owner */
23 #define MNT3ERR_PERM 1
24 /** No such file or directory */
25 #define MNT3ERR_NOENT 2
26 /** I/O error */
27 #define MNT3ERR_IO 5
28 /** Permission denied */
29 #define MNT3ERR_ACCES 13
30 /** Not a directory */
31 #define MNT3ERR_NOTDIR 20
32 /** Invalid argument */
33 #define MNT3ERR_INVAL 22
34 /** Filename too long */
35 #define MNT3ERR_NAMETOOLONG 63
36 /** Operation not supported */
37 #define MNT3ERR_NOTSUPP 10004
38 /** A failure on the server */
39 #define MNT3ERR_SERVERFAULT 10006
40 
41 
42 /**
43  * A MOUNT MNT reply
44  *
45  */
47  /** Reply status */
49  /** Root file handle */
50  struct nfs_fh fh;
51 };
52 
53 /**
54  * Prepare an ONC RPC session to be used as a MOUNT session
55  *
56  * @v session ONC RPC session
57  * @v credential ONC RPC credential
58  *
59  * The credential parameter must not be NULL, use 'oncrpc_auth_none' if you
60  * don't want a particular scheme to be used.
61  */
62 static inline void mount_init_session ( struct oncrpc_session *session,
63  struct oncrpc_cred *credential ) {
66 }
67 
68 int mount_mnt ( struct interface *intf, struct oncrpc_session *session,
69  const char *mountpoint );
70 int mount_umnt ( struct interface *intf, struct oncrpc_session *session,
71  const char *mountpoint );
72 
73 int mount_get_mnt_reply ( struct mount_mnt_reply *mnt_reply,
74  struct oncrpc_reply *reply );
75 
76 #endif /* _IPXE_MOUNT_H */
A NFS file handle.
Definition: nfs.h:74
void oncrpc_init_session(struct oncrpc_session *session, struct oncrpc_cred *credential, struct oncrpc_cred *verifier, uint32_t prog_name, uint32_t prog_vers)
Prepare an ONC RPC session structure to be used by the ONC RPC layer.
Definition: oncrpc.c:115
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
#define ONCRPC_MOUNT
NFS MOUNT protocol number.
Definition: mount.h:15
int mount_mnt(struct interface *intf, struct oncrpc_session *session, const char *mountpoint)
Send a MNT request.
Definition: mount.c:56
int mount_umnt(struct interface *intf, struct oncrpc_session *session, const char *mountpoint)
Send a UMNT request.
Definition: mount.c:74
struct nfs_fh fh
Root file handle.
Definition: mount.h:50
An object interface.
Definition: interface.h:124
struct ntlm_data session
Session key.
Definition: ntlm.h:24
#define MOUNT_VERS
NFS MOUNT protocol version.
Definition: mount.h:17
struct oncrpc_cred oncrpc_auth_none
AUTH NONE authentication flavor.
Definition: oncrpc.c:56
uint32_t status
Reply status.
Definition: mount.h:48
int mount_get_mnt_reply(struct mount_mnt_reply *mnt_reply, struct oncrpc_reply *reply)
Parse an MNT reply.
Definition: mount.c:91
unsigned int uint32_t
Definition: stdint.h:12
static void mount_init_session(struct oncrpc_session *session, struct oncrpc_cred *credential)
Prepare an ONC RPC session to be used as a MOUNT session.
Definition: mount.h:62
Network File System protocol.
A MOUNT MNT reply.
Definition: mount.h:46