]> git.decadent.org.uk Git - nfs-utils.git/blob - utils/mount/nfs_mount.h
50ce2a8300f9d5085130e0b41dc64f1ce7f43ef5
[nfs-utils.git] / utils / mount / nfs_mount.h
1 /*
2  * We want to be able to compile mount on old kernels in such a way
3  * that the binary will work well on more recent kernels.
4  * Thus, if necessary we teach nfsmount.c the structure of new fields
5  * that will come later.
6  *
7  * Moreover, the new kernel includes conflict with glibc includes
8  * so it is easiest to ignore the kernel altogether (at compile time).
9  */
10
11 #ifndef _NFS_MOUNT_H
12 #define _NFS_MOUNT_H
13
14 #include <netinet/in.h>
15 #include <arpa/inet.h>
16
17 #define NFS_MOUNT_VERSION       6
18 #define NFS_MAX_CONTEXT_LEN     256
19
20 struct nfs2_fh {
21         char                    data[32];
22 };
23 struct nfs3_fh {
24         unsigned short          size;
25         unsigned char           data[64];
26 };
27
28 struct nfs_mount_data {
29         int             version;                /* 1 */
30         int             fd;                     /* 1 */
31         struct nfs2_fh  old_root;               /* 1 */
32         int             flags;                  /* 1 */
33         int             rsize;                  /* 1 */
34         int             wsize;                  /* 1 */
35         int             timeo;                  /* 1 */
36         int             retrans;                /* 1 */
37         int             acregmin;               /* 1 */
38         int             acregmax;               /* 1 */
39         int             acdirmin;               /* 1 */
40         int             acdirmax;               /* 1 */
41         struct sockaddr_in addr;                /* 1 */
42         char            hostname[256];          /* 1 */
43         int             namlen;                 /* 2 */
44         unsigned int    bsize;                  /* 3 */
45         struct nfs3_fh  root;                   /* 4 */
46         int             pseudoflavor;           /* 5 */
47         char    context[NFS_MAX_CONTEXT_LEN + 1]; /* 6 */
48
49 };
50
51 /* bits in the flags field */
52
53 #define NFS_MOUNT_SOFT          0x0001  /* 1 */
54 #define NFS_MOUNT_INTR          0x0002  /* 1 */
55 #define NFS_MOUNT_SECURE        0x0004  /* 1 */
56 #define NFS_MOUNT_POSIX         0x0008  /* 1 */
57 #define NFS_MOUNT_NOCTO         0x0010  /* 1 */
58 #define NFS_MOUNT_NOAC          0x0020  /* 1 */
59 #define NFS_MOUNT_TCP           0x0040  /* 2 */
60 #define NFS_MOUNT_VER3          0x0080  /* 3 */
61 #define NFS_MOUNT_KERBEROS      0x0100  /* 3 */
62 #define NFS_MOUNT_NONLM         0x0200  /* 3 */
63 #define NFS_MOUNT_BROKEN_SUID   0x0400  /* 4 */
64 #define NFS_MOUNT_NOACL     0x0800  /* 4 */
65 #define NFS_MOUNT_SECFLAVOUR    0x2000  /* 5 */
66 #define NFS_MOUNT_NORDIRPLUS    0x4000  /* 5 */
67 #define NFS_MOUNT_UNSHARED      0x8000  /* 5 */
68
69 /* security pseudoflavors */
70
71 #ifndef AUTH_GSS_KRB5
72 #define AUTH_GSS_KRB5           390003
73 #define AUTH_GSS_KRB5I          390004
74 #define AUTH_GSS_KRB5P          390005
75 #define AUTH_GSS_LKEY           390006
76 #define AUTH_GSS_LKEYI          390007
77 #define AUTH_GSS_LKEYP          390008
78 #define AUTH_GSS_SPKM           390009
79 #define AUTH_GSS_SPKMI          390010
80 #define AUTH_GSS_SPKMP          390011
81 #endif
82
83 int nfsmount(const char *, const char *, int *, char **, char **,
84              int, int *);
85 void mount_errors(char *, int, int);
86
87 #endif /* _NFS_MOUNT_H */