23ca6ba85190314030a6771d445a2b992c185820
[deb_libnfs.git] / mount / libnfs-raw-mount.h
1 /*
2 Copyright (c) 2014, Ronnie Sahlberg
3 All rights reserved.
4
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
7
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.
13
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.
24
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.
28 */
29
30 /*
31 * Please do not edit this file.
32 * It was generated using rpcgen.
33 */
34
35 #ifndef _MOUNT_H_RPCGEN
36 #define _MOUNT_H_RPCGEN
37
38 #include <nfsc/libnfs-zdr.h>
39
40
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44
45 #define MNTPATHLEN 1024
46 #define MNTNAMLEN 255
47 #define FHSIZE3 64
48
49 typedef struct {
50 u_int fhandle3_len;
51 char *fhandle3_val;
52 } fhandle3;
53
54 typedef char *dirpath;
55
56 typedef char *name;
57
58 enum mountstat3 {
59 MNT3_OK = 0,
60 MNT3ERR_PERM = 1,
61 MNT3ERR_NOENT = 2,
62 MNT3ERR_IO = 5,
63 MNT3ERR_ACCES = 13,
64 MNT3ERR_NOTDIR = 20,
65 MNT3ERR_INVAL = 22,
66 MNT3ERR_NAMETOOLONG = 63,
67 MNT3ERR_NOTSUPP = 10004,
68 MNT3ERR_SERVERFAULT = 10006,
69 };
70 typedef enum mountstat3 mountstat3;
71
72 typedef struct mountbody *mountlist;
73
74 struct mountbody {
75 name ml_hostname;
76 dirpath ml_directory;
77 mountlist ml_next;
78 };
79 typedef struct mountbody mountbody;
80
81 typedef struct groupnode *groups;
82
83 struct groupnode {
84 name gr_name;
85 groups gr_next;
86 };
87 typedef struct groupnode groupnode;
88
89 typedef struct exportnode *exports;
90
91 struct exportnode {
92 dirpath ex_dir;
93 groups ex_groups;
94 exports ex_next;
95 };
96 typedef struct exportnode exportnode;
97
98 struct mountres3_ok {
99 fhandle3 fhandle;
100 struct {
101 u_int auth_flavors_len;
102 int *auth_flavors_val;
103 } auth_flavors;
104 };
105 typedef struct mountres3_ok mountres3_ok;
106
107 struct mountres3 {
108 mountstat3 fhs_status;
109 union {
110 mountres3_ok mountinfo;
111 } mountres3_u;
112 };
113 typedef struct mountres3 mountres3;
114
115 enum mountstat1 {
116 MNT1_OK = 0,
117 MNT1ERR_PERM = 1,
118 MNT1ERR_NOENT = 2,
119 MNT1ERR_IO = 5,
120 MNT1ERR_ACCES = 13,
121 MNT1ERR_NOTDIR = 20,
122 MNT1ERR_INVAL = 22,
123 MNT1ERR_NAMETOOLONG = 63,
124 MNT1ERR_NOTSUPP = 10004,
125 MNT1ERR_SERVERFAULT = 10006,
126 };
127 typedef enum mountstat1 mountstat1;
128 #define FHSIZE 32
129
130 typedef char fhandle1[FHSIZE];
131
132 struct mountres1_ok {
133 fhandle1 fhandle;
134 };
135 typedef struct mountres1_ok mountres1_ok;
136
137 struct mountres1 {
138 mountstat1 fhs_status;
139 union {
140 mountres1_ok mountinfo;
141 } mountres1_u;
142 };
143 typedef struct mountres1 mountres1;
144
145 #define MOUNT_PROGRAM 100005
146 #define MOUNT_V1 1
147
148 #if defined(__STDC__) || defined(__cplusplus)
149 #define MOUNT1_NULL 0
150 extern void * mount1_null_1(void *, void *);
151 extern void * mount1_null_1_svc(void *, struct svc_req *);
152 #define MOUNT1_MNT 1
153 extern mountres1 * mount1_mnt_1(dirpath *, void *);
154 extern mountres1 * mount1_mnt_1_svc(dirpath *, struct svc_req *);
155 #define MOUNT1_DUMP 2
156 extern mountlist * mount1_dump_1(void *, void *);
157 extern mountlist * mount1_dump_1_svc(void *, struct svc_req *);
158 #define MOUNT1_UMNT 3
159 extern void * mount1_umnt_1(dirpath *, void *);
160 extern void * mount1_umnt_1_svc(dirpath *, struct svc_req *);
161 #define MOUNT1_UMNTALL 4
162 extern void * mount1_umntall_1(void *, void *);
163 extern void * mount1_umntall_1_svc(void *, struct svc_req *);
164 #define MOUNT1_EXPORT 5
165 extern exports * mount1_export_1(void *, void *);
166 extern exports * mount1_export_1_svc(void *, struct svc_req *);
167 extern int mount_program_1_freeresult (void *, zdrproc_t, caddr_t);
168
169 #else /* K&R C */
170 #define MOUNT1_NULL 0
171 extern void * mount1_null_1();
172 extern void * mount1_null_1_svc();
173 #define MOUNT1_MNT 1
174 extern mountres1 * mount1_mnt_1();
175 extern mountres1 * mount1_mnt_1_svc();
176 #define MOUNT1_DUMP 2
177 extern mountlist * mount1_dump_1();
178 extern mountlist * mount1_dump_1_svc();
179 #define MOUNT1_UMNT 3
180 extern void * mount1_umnt_1();
181 extern void * mount1_umnt_1_svc();
182 #define MOUNT1_UMNTALL 4
183 extern void * mount1_umntall_1();
184 extern void * mount1_umntall_1_svc();
185 #define MOUNT1_EXPORT 5
186 extern exports * mount1_export_1();
187 extern exports * mount1_export_1_svc();
188 extern int mount_program_1_freeresult ();
189 #endif /* K&R C */
190 #define MOUNT_V3 3
191
192 #if defined(__STDC__) || defined(__cplusplus)
193 #define MOUNT3_NULL 0
194 extern void * mount3_null_3(void *, void *);
195 extern void * mount3_null_3_svc(void *, struct svc_req *);
196 #define MOUNT3_MNT 1
197 extern mountres3 * mount3_mnt_3(dirpath *, void *);
198 extern mountres3 * mount3_mnt_3_svc(dirpath *, struct svc_req *);
199 #define MOUNT3_DUMP 2
200 extern mountlist * mount3_dump_3(void *, void *);
201 extern mountlist * mount3_dump_3_svc(void *, struct svc_req *);
202 #define MOUNT3_UMNT 3
203 extern void * mount3_umnt_3(dirpath *, void *);
204 extern void * mount3_umnt_3_svc(dirpath *, struct svc_req *);
205 #define MOUNT3_UMNTALL 4
206 extern void * mount3_umntall_3(void *, void *);
207 extern void * mount3_umntall_3_svc(void *, struct svc_req *);
208 #define MOUNT3_EXPORT 5
209 extern exports * mount3_export_3(void *, void *);
210 extern exports * mount3_export_3_svc(void *, struct svc_req *);
211 extern int mount_program_3_freeresult (void *, zdrproc_t, caddr_t);
212
213 #else /* K&R C */
214 #define MOUNT3_NULL 0
215 extern void * mount3_null_3();
216 extern void * mount3_null_3_svc();
217 #define MOUNT3_MNT 1
218 extern mountres3 * mount3_mnt_3();
219 extern mountres3 * mount3_mnt_3_svc();
220 #define MOUNT3_DUMP 2
221 extern mountlist * mount3_dump_3();
222 extern mountlist * mount3_dump_3_svc();
223 #define MOUNT3_UMNT 3
224 extern void * mount3_umnt_3();
225 extern void * mount3_umnt_3_svc();
226 #define MOUNT3_UMNTALL 4
227 extern void * mount3_umntall_3();
228 extern void * mount3_umntall_3_svc();
229 #define MOUNT3_EXPORT 5
230 extern exports * mount3_export_3();
231 extern exports * mount3_export_3_svc();
232 extern int mount_program_3_freeresult ();
233 #endif /* K&R C */
234
235 /* the zdr functions */
236
237 #if defined(__STDC__) || defined(__cplusplus)
238 extern uint32_t zdr_fhandle3 (ZDR *, fhandle3*);
239 extern uint32_t zdr_dirpath (ZDR *, dirpath*);
240 extern uint32_t zdr_name (ZDR *, name*);
241 extern uint32_t zdr_mountstat3 (ZDR *, mountstat3*);
242 extern uint32_t zdr_mountlist (ZDR *, mountlist*);
243 extern uint32_t zdr_mountbody (ZDR *, mountbody*);
244 extern uint32_t zdr_groups (ZDR *, groups*);
245 extern uint32_t zdr_groupnode (ZDR *, groupnode*);
246 extern uint32_t zdr_exports (ZDR *, exports*);
247 extern uint32_t zdr_exportnode (ZDR *, exportnode*);
248 extern uint32_t zdr_mountres3_ok (ZDR *, mountres3_ok*);
249 extern uint32_t zdr_mountres3 (ZDR *, mountres3*);
250 extern uint32_t zdr_mountstat1 (ZDR *, mountstat1*);
251 extern uint32_t zdr_fhandle1 (ZDR *, fhandle1);
252 extern uint32_t zdr_mountres1_ok (ZDR *, mountres1_ok*);
253 extern uint32_t zdr_mountres1 (ZDR *, mountres1*);
254
255 #else /* K&R C */
256 extern uint32_t zdr_fhandle3 ();
257 extern uint32_t zdr_dirpath ();
258 extern uint32_t zdr_name ();
259 extern uint32_t zdr_mountstat3 ();
260 extern uint32_t zdr_mountlist ();
261 extern uint32_t zdr_mountbody ();
262 extern uint32_t zdr_groups ();
263 extern uint32_t zdr_groupnode ();
264 extern uint32_t zdr_exports ();
265 extern uint32_t zdr_exportnode ();
266 extern uint32_t zdr_mountres3_ok ();
267 extern uint32_t zdr_mountres3 ();
268 extern uint32_t zdr_mountstat1 ();
269 extern uint32_t zdr_fhandle1 ();
270 extern uint32_t zdr_mountres1_ok ();
271 extern uint32_t zdr_mountres1 ();
272
273 #endif /* K&R C */
274
275 #ifdef __cplusplus
276 }
277 #endif
278
279 #endif /* !_MOUNT_H_RPCGEN */