2 Copyright (c) 2014, Ronnie Sahlberg
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
8 1. Redistributions of source code must retain the above copyright notice, this
9 list of conditions and the following disclaimer.
10 2. 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.
14 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 ON 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
23 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 The views and conclusions contained in the software and documentation are those
26 of the authors and should not be interpreted as representing official policies,
27 either expressed or implied, of the FreeBSD Project.
30 const MNTPATHLEN = 1024; /* Maximum bytes in a path name */
31 const MNTNAMLEN = 255; /* Maximum bytes in a name */
32 const FHSIZE3 = 64; /* Maximum bytes in a V3 file handle */
35 typedef opaque fhandle3<FHSIZE3>;
36 typedef string dirpath<MNTPATHLEN>;
37 typedef string name<MNTNAMLEN>;
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 */
53 typedef struct mountbody *mountlist;
61 typedef struct groupnode *groups;
69 typedef struct exportnode *exports;
82 union mountres3 switch (mountstat3 fhs_status) {
84 mountres3_ok mountinfo;
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 */
104 typedef opaque fhandle1[FHSIZE];
106 struct mountres1_ok {
110 union mountres1 switch (mountstat1 fhs_status) {
112 mountres1_ok mountinfo;
117 program MOUNT_PROGRAM {
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;
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;