Merge pull request #82 from plieven/readahead
[deb_libnfs.git] / mount / mount.x
CommitLineData
2f5c161b
RS
1/*
2Copyright (c) 2014, Ronnie Sahlberg
3All rights reserved.
4
5Redistribution and use in source and binary forms, with or without
6modification, are permitted provided that the following conditions are met:
7
81. Redistributions of source code must retain the above copyright notice, this
9 list of conditions and the following disclaimer.
102. Redistributions in binary form must reproduce the above copyright notice,
11 this list of conditions and the following disclaimer in the documentation
12 and/or other materials provided with the distribution.
13
14THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
25The views and conclusions contained in the software and documentation are those
26of the authors and should not be interpreted as representing official policies,
27either expressed or implied, of the FreeBSD Project.
28*/
84004dbf
RS
29
30const MNTPATHLEN = 1024; /* Maximum bytes in a path name */
31const MNTNAMLEN = 255; /* Maximum bytes in a name */
32const FHSIZE3 = 64; /* Maximum bytes in a V3 file handle */
33
34
35typedef opaque fhandle3<FHSIZE3>;
36typedef string dirpath<MNTPATHLEN>;
37typedef string name<MNTNAMLEN>;
38
39enum mountstat3 {
40 MNT3_OK = 0, /* no error */
41 MNT3ERR_PERM = 1, /* Not owner */
42 MNT3ERR_NOENT = 2, /* No such file or directory */
43 MNT3ERR_IO = 5, /* I/O error */
44 MNT3ERR_ACCES = 13, /* Permission denied */
45 MNT3ERR_NOTDIR = 20, /* Not a directory */
46 MNT3ERR_INVAL = 22, /* Invalid argument */
47 MNT3ERR_NAMETOOLONG = 63, /* Filename too long */
48 MNT3ERR_NOTSUPP = 10004, /* Operation not supported */
49 MNT3ERR_SERVERFAULT = 10006 /* A failure on the server */
50};
51
52
53typedef struct mountbody *mountlist;
54
55struct mountbody {
56 name ml_hostname;
57 dirpath ml_directory;
58 mountlist ml_next;
59};
60
61typedef struct groupnode *groups;
62
63struct groupnode {
64 name gr_name;
65 groups gr_next;
66};
67
68
69typedef struct exportnode *exports;
70
71struct exportnode {
72 dirpath ex_dir;
73 groups ex_groups;
74 exports ex_next;
75};
76
77struct mountres3_ok {
78 fhandle3 fhandle;
79 int auth_flavors<>;
80};
81
82union mountres3 switch (mountstat3 fhs_status) {
83 case MNT3_OK:
84 mountres3_ok mountinfo;
85 default:
86 void;
87};
88
8e9d7dde
RS
89
90enum mountstat1 {
91 MNT1_OK = 0, /* no error */
92 MNT1ERR_PERM = 1, /* Not owner */
93 MNT1ERR_NOENT = 2, /* No such file or directory */
94 MNT1ERR_IO = 5, /* I/O error */
95 MNT1ERR_ACCES = 13, /* Permission denied */
96 MNT1ERR_NOTDIR = 20, /* Not a directory */
97 MNT1ERR_INVAL = 22, /* Invalid argument */
98 MNT1ERR_NAMETOOLONG = 63, /* Filename too long */
99 MNT1ERR_NOTSUPP = 10004, /* Operation not supported */
100 MNT1ERR_SERVERFAULT = 10006 /* A failure on the server */
101};
102
103const FHSIZE = 32;
104typedef opaque fhandle1[FHSIZE];
105
106struct mountres1_ok {
107 fhandle1 fhandle;
108};
109
110union mountres1 switch (mountstat1 fhs_status) {
111 case MNT1_OK:
112 mountres1_ok mountinfo;
113 default:
114 void;
115};
116
84004dbf 117program MOUNT_PROGRAM {
8e9d7dde
RS
118 version MOUNT_V1 {
119 void MOUNT1_NULL(void) = 0;
120 mountres1 MOUNT1_MNT(dirpath) = 1;
121 mountlist MOUNT1_DUMP(void) = 2;
122 void MOUNT1_UMNT(dirpath) = 3;
123 void MOUNT1_UMNTALL(void) = 4;
124 exports MOUNT1_EXPORT(void) = 5;
125 } = 1;
84004dbf
RS
126 version MOUNT_V3 {
127 void MOUNT3_NULL(void) = 0;
128 mountres3 MOUNT3_MNT(dirpath) = 1;
129 mountlist MOUNT3_DUMP(void) = 2;
130 void MOUNT3_UMNT(dirpath) = 3;
131 void MOUNT3_UMNTALL(void) = 4;
132 exports MOUNT3_EXPORT(void) = 5;
133 } = 3;
134} = 100005;