Commit | Line | Data |
---|---|---|
84004dbf RS |
1 | /* |
2 | Copyright (C) 2010 by Ronnie Sahlberg <ronniesahlberg@gmail.com> | |
3 | ||
4 | This program is free software; you can redistribute it and/or modify | |
5 | it under the terms of the GNU Lesser General Public License as published by | |
6 | the Free Software Foundation; either version 2.1 of the License, or | |
7 | (at your option) any later version. | |
8 | ||
9 | This program is distributed in the hope that it will be useful, | |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | GNU Lesser General Public License for more details. | |
13 | ||
14 | You should have received a copy of the GNU Lesser General Public License | |
15 | along with this program; if not, see <http://www.gnu.org/licenses/>. | |
16 | */ | |
17 | /* | |
18 | * This is the lowlevel interface to access NFS resources. | |
19 | * Through this interface you have access to the full gamut of nfs and nfs related | |
20 | * protocol as well as the XDR encoded/decoded structures. | |
21 | */ | |
22 | #include <stdint.h> | |
23 | ||
24 | struct rpc_data { | |
25 | int size; | |
26 | unsigned char *data; | |
27 | }; | |
28 | ||
29 | struct rpc_context; | |
30 | struct rpc_context *rpc_init_context(void); | |
31 | void rpc_destroy_context(struct rpc_context *rpc); | |
32 | ||
33 | struct AUTH; | |
34 | void rpc_set_auth(struct rpc_context *rpc, struct AUTH *auth); | |
35 | ||
36 | int rpc_get_fd(struct rpc_context *rpc); | |
37 | int rpc_which_events(struct rpc_context *rpc); | |
38 | int rpc_service(struct rpc_context *rpc, int revents); | |
39 | char *rpc_get_error(struct rpc_context *rpc); | |
83aa785d | 40 | int rpc_queue_length(struct rpc_context *rpc); |
84004dbf RS |
41 | |
42 | ||
43 | #define RPC_STATUS_SUCCESS 0 | |
44 | #define RPC_STATUS_ERROR 1 | |
45 | #define RPC_STATUS_CANCEL 2 | |
46 | ||
84004dbf RS |
47 | /* |
48 | * Async connection to the tcp port at server:port. | |
49 | * Function returns | |
50 | * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked. | |
51 | * <0 : An error occured when trying to set up the connection. The callback will not be invoked. | |
52 | * | |
53 | * When the callback is invoked, status indicates the result: | |
54 | * RPC_STATUS_SUCCESS : The tcp connection was successfully established. | |
55 | * data is NULL. | |
56 | * RPC_STATUS_ERROR : The connection failed to establish. | |
57 | * data is the erro string. | |
58 | * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. | |
59 | * : data is NULL. | |
60 | */ | |
61 | int rpc_connect_async(struct rpc_context *rpc, const char *server, int port, rpc_cb cb, void *private_data); | |
62 | /* | |
63 | * When disconnecting a connection in flight. All commands in flight will be called with the callback | |
64 | * and status RPC_STATUS_ERROR. Data will be the error string for the disconnection. | |
65 | */ | |
66 | int rpc_disconnect(struct rpc_context *rpc, char *error); | |
67 | ||
84004dbf RS |
68 | |
69 | /* | |
70 | * PORTMAP FUNCTIONS | |
71 | */ | |
72 | ||
73 | /* | |
74 | * Call PORTMAPPER/NULL | |
75 | * Function returns | |
76 | * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked. | |
77 | * <0 : An error occured when trying to set up the connection. The callback will not be invoked. | |
78 | * | |
79 | * When the callback is invoked, status indicates the result: | |
80 | * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon. | |
81 | * data is NULL. | |
82 | * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper. | |
83 | * data is the error string. | |
84 | * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. | |
85 | * data is NULL. | |
86 | */ | |
87 | int rpc_pmap_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data); | |
88 | ||
89 | ||
90 | /* | |
91 | * Call PORTMAPPER/GETPORT. | |
92 | * Function returns | |
93 | * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked. | |
94 | * <0 : An error occured when trying to set up the connection. The callback will not be invoked. | |
95 | * | |
96 | * When the callback is invoked, status indicates the result: | |
97 | * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon. | |
98 | * data is a (uint32_t *), containing the port returned. | |
99 | * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper. | |
100 | * data is the error string. | |
101 | * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. | |
102 | * data is NULL. | |
103 | */ | |
104 | int rpc_pmap_getport_async(struct rpc_context *rpc, int program, int version, rpc_cb cb, void *private_data); | |
105 | ||
106 | ||
fd59fd0d RS |
107 | /* |
108 | * Call PORTMAPPER/CALLIT. | |
109 | * Function returns | |
110 | * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked. | |
111 | * <0 : An error occured when trying to set up the connection. The callback will not be invoked. | |
112 | * | |
113 | * When the callback is invoked, status indicates the result: | |
114 | * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon | |
115 | * data is a 'pmap_call_result' pointer. | |
116 | * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper. | |
117 | * data is the error string. | |
118 | * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. | |
119 | * data is NULL. | |
120 | */ | |
121 | int rpc_pmap_callit_async(struct rpc_context *rpc, int program, int version, int procedure, const char *data, int datalen, rpc_cb cb, void *private_data); | |
84004dbf RS |
122 | |
123 | /* | |
124 | * MOUNT FUNCTIONS | |
125 | */ | |
126 | char *mountstat3_to_str(int stat); | |
127 | int mountstat3_to_errno(int error); | |
128 | ||
129 | /* | |
130 | * Call MOUNT/NULL | |
131 | * Function returns | |
132 | * 0 : The call was initiated. The callback will be invoked when the call completes. | |
133 | * <0 : An error occured when trying to set up the call. The callback will not be invoked. | |
134 | * | |
135 | * When the callback is invoked, status indicates the result: | |
136 | * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon. | |
137 | * data is NULL. | |
138 | * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon. | |
139 | * data is the error string. | |
140 | * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. | |
141 | * data is NULL. | |
142 | */ | |
143 | int rpc_mount_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data); | |
144 | ||
145 | /* | |
146 | * Call MOUNT/MNT | |
147 | * Function returns | |
148 | * 0 : The call was initiated. The callback will be invoked when the call completes. | |
149 | * <0 : An error occured when trying to set up the call. The callback will not be invoked. | |
150 | * | |
151 | * When the callback is invoked, status indicates the result: | |
152 | * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon. | |
153 | * data is union mountres3. | |
154 | * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon. | |
155 | * data is the error string. | |
156 | * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. | |
157 | * data is NULL. | |
158 | */ | |
159 | int rpc_mount_mnt_async(struct rpc_context *rpc, rpc_cb cb, char *export, void *private_data); | |
160 | ||
161 | /* | |
162 | * Call MOUNT/DUMP | |
163 | * Function returns | |
164 | * 0 : The call was initiated. The callback will be invoked when the call completes. | |
165 | * <0 : An error occured when trying to set up the call. The callback will not be invoked. | |
166 | * | |
167 | * When the callback is invoked, status indicates the result: | |
168 | * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon. | |
169 | * data is a mountlist. | |
170 | * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon. | |
171 | * data is the error string. | |
172 | * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. | |
173 | * data is NULL. | |
174 | */ | |
175 | int rpc_mount_dump_async(struct rpc_context *rpc, rpc_cb cb, void *private_data); | |
176 | ||
177 | /* | |
178 | * Call MOUNT/UMNT | |
179 | * Function returns | |
180 | * 0 : The call was initiated. The callback will be invoked when the call completes. | |
181 | * <0 : An error occured when trying to set up the call. The callback will not be invoked. | |
182 | * | |
183 | * When the callback is invoked, status indicates the result: | |
184 | * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon. | |
185 | * data NULL. | |
186 | * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon. | |
187 | * data is the error string. | |
188 | * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. | |
189 | * data is NULL. | |
190 | */ | |
191 | int rpc_mount_umnt_async(struct rpc_context *rpc, rpc_cb cb, char *export, void *private_data); | |
192 | ||
193 | /* | |
194 | * Call MOUNT/UMNTALL | |
195 | * Function returns | |
196 | * 0 : The call was initiated. The callback will be invoked when the call completes. | |
197 | * <0 : An error occured when trying to set up the call. The callback will not be invoked. | |
198 | * | |
199 | * When the callback is invoked, status indicates the result: | |
200 | * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon. | |
201 | * data NULL. | |
202 | * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon. | |
203 | * data is the error string. | |
204 | * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. | |
205 | * data is NULL. | |
206 | */ | |
207 | int rpc_mount_umntall_async(struct rpc_context *rpc, rpc_cb cb, void *private_data); | |
208 | ||
209 | /* | |
210 | * Call MOUNT/EXPORT | |
7f0242ca RS |
211 | * NOTE: You must include 'libnfs-raw-mount.h' to get the definitions of the |
212 | * returned structures. | |
213 | * | |
84004dbf RS |
214 | * Function returns |
215 | * 0 : The call was initiated. The callback will be invoked when the call completes. | |
216 | * <0 : An error occured when trying to set up the call. The callback will not be invoked. | |
217 | * | |
218 | * When the callback is invoked, status indicates the result: | |
219 | * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon. | |
7f0242ca RS |
220 | * data is a pointer to an exports pointer: |
221 | * exports export = *(exports *)data; | |
84004dbf RS |
222 | * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon. |
223 | * data is the error string. | |
224 | * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. | |
225 | * data is NULL. | |
226 | */ | |
227 | int rpc_mount_export_async(struct rpc_context *rpc, rpc_cb cb, void *private_data); | |
228 | ||
229 | ||
230 | ||
231 | ||
232 | /* | |
233 | * NFS FUNCTIONS | |
234 | */ | |
235 | struct nfs_fh3; | |
236 | char *nfsstat3_to_str(int error); | |
237 | int nfsstat3_to_errno(int error); | |
238 | ||
239 | /* | |
240 | * Call NFS/NULL | |
241 | * Function returns | |
242 | * 0 : The call was initiated. The callback will be invoked when the call completes. | |
243 | * <0 : An error occured when trying to set up the call. The callback will not be invoked. | |
244 | * | |
245 | * When the callback is invoked, status indicates the result: | |
246 | * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon. | |
247 | * data is NULL. | |
248 | * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon. | |
249 | * data is the error string. | |
250 | * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. | |
251 | * data is NULL. | |
252 | */ | |
253 | int rpc_nfs_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data); | |
254 | ||
255 | /* | |
256 | * Call NFS/GETATTR | |
257 | * Function returns | |
258 | * 0 : The call was initiated. The callback will be invoked when the call completes. | |
259 | * <0 : An error occured when trying to set up the call. The callback will not be invoked. | |
260 | * | |
261 | * When the callback is invoked, status indicates the result: | |
262 | * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon. | |
263 | * data is GETATTR3res | |
264 | * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon. | |
265 | * data is the error string. | |
266 | * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. | |
267 | * data is NULL. | |
268 | */ | |
269 | int rpc_nfs_getattr_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data); | |
270 | ||
271 | /* | |
272 | * Call NFS/LOOKUP | |
273 | * Function returns | |
274 | * 0 : The call was initiated. The callback will be invoked when the call completes. | |
275 | * <0 : An error occured when trying to set up the call. The callback will not be invoked. | |
276 | * | |
277 | * When the callback is invoked, status indicates the result: | |
278 | * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon. | |
279 | * data is LOOKUP3res | |
280 | * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon. | |
281 | * data is the error string. | |
282 | * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. | |
283 | * data is NULL. | |
284 | */ | |
285 | int rpc_nfs_lookup_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *name, void *private_data); | |
286 | ||
287 | /* | |
288 | * Call NFS/ACCESS | |
289 | * Function returns | |
290 | * 0 : The call was initiated. The callback will be invoked when the call completes. | |
291 | * <0 : An error occured when trying to set up the call. The callback will not be invoked. | |
292 | * | |
293 | * When the callback is invoked, status indicates the result: | |
294 | * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon. | |
295 | * data is ACCESS3res | |
296 | * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon. | |
297 | * data is the error string. | |
298 | * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. | |
299 | * data is NULL. | |
300 | */ | |
301 | int rpc_nfs_access_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, int access, void *private_data); | |
302 | ||
303 | /* | |
304 | * Call NFS/READ | |
305 | * Function returns | |
306 | * 0 : The call was initiated. The callback will be invoked when the call completes. | |
307 | * <0 : An error occured when trying to set up the call. The callback will not be invoked. | |
308 | * | |
309 | * When the callback is invoked, status indicates the result: | |
310 | * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon. | |
311 | * data is ACCESS3res | |
312 | * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon. | |
313 | * data is the error string. | |
314 | * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. | |
315 | * data is NULL. | |
316 | */ | |
317 | int rpc_nfs_read_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, off_t offset, size_t count, void *private_data); | |
318 | ||
319 | /* | |
320 | * Call NFS/WRITE | |
321 | * Function returns | |
322 | * 0 : The call was initiated. The callback will be invoked when the call completes. | |
323 | * <0 : An error occured when trying to set up the call. The callback will not be invoked. | |
324 | * | |
325 | * When the callback is invoked, status indicates the result: | |
326 | * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon. | |
327 | * data is WRITE3res * | |
328 | * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon. | |
329 | * data is the error string. | |
330 | * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. | |
331 | * data is NULL. | |
332 | */ | |
333 | int rpc_nfs_write_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *buf, off_t offset, size_t count, int stable_how, void *private_data); | |
334 | ||
335 | /* | |
336 | * Call NFS/COMMIT | |
337 | * Function returns | |
338 | * 0 : The call was initiated. The callback will be invoked when the call completes. | |
339 | * <0 : An error occured when trying to set up the call. The callback will not be invoked. | |
340 | * | |
341 | * When the callback is invoked, status indicates the result: | |
342 | * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon. | |
343 | * data is COMMIT3res * | |
344 | * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon. | |
345 | * data is the error string. | |
346 | * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. | |
347 | * data is NULL. | |
348 | */ | |
349 | int rpc_nfs_commit_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data); | |
350 | ||
351 | ||
352 | /* | |
353 | * Call NFS/SETATTR | |
354 | * Function returns | |
355 | * 0 : The call was initiated. The callback will be invoked when the call completes. | |
356 | * <0 : An error occured when trying to set up the call. The callback will not be invoked. | |
357 | * | |
358 | * When the callback is invoked, status indicates the result: | |
359 | * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon. | |
360 | * data is SETATTR3res * | |
361 | * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon. | |
362 | * data is the error string. | |
363 | * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. | |
364 | * data is NULL. | |
365 | */ | |
366 | struct SETATTR3args; | |
367 | int rpc_nfs_setattr_async(struct rpc_context *rpc, rpc_cb cb, struct SETATTR3args *args, void *private_data); | |
368 | ||
369 | ||
370 | ||
371 | /* | |
372 | * Call NFS/MKDIR | |
373 | * Function returns | |
374 | * 0 : The call was initiated. The callback will be invoked when the call completes. | |
375 | * <0 : An error occured when trying to set up the call. The callback will not be invoked. | |
376 | * | |
377 | * When the callback is invoked, status indicates the result: | |
378 | * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon. | |
379 | * data is MKDIR3res * | |
380 | * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon. | |
381 | * data is the error string. | |
382 | * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. | |
383 | * data is NULL. | |
384 | */ | |
385 | int rpc_nfs_mkdir_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *dir, void *private_data); | |
386 | ||
387 | ||
388 | ||
389 | ||
390 | ||
391 | /* | |
392 | * Call NFS/RMDIR | |
393 | * Function returns | |
394 | * 0 : The call was initiated. The callback will be invoked when the call completes. | |
395 | * <0 : An error occured when trying to set up the call. The callback will not be invoked. | |
396 | * | |
397 | * When the callback is invoked, status indicates the result: | |
398 | * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon. | |
399 | * data is RMDIR3res * | |
400 | * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon. | |
401 | * data is the error string. | |
402 | * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. | |
403 | * data is NULL. | |
404 | */ | |
405 | int rpc_nfs_rmdir_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *dir, void *private_data); | |
406 | ||
407 | ||
408 | ||
409 | ||
410 | /* | |
411 | * Call NFS/CREATE | |
412 | * Function returns | |
413 | * 0 : The call was initiated. The callback will be invoked when the call completes. | |
414 | * <0 : An error occured when trying to set up the call. The callback will not be invoked. | |
415 | * | |
416 | * When the callback is invoked, status indicates the result: | |
417 | * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon. | |
418 | * data is CREATE3res * | |
419 | * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon. | |
420 | * data is the error string. | |
421 | * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. | |
422 | * data is NULL. | |
423 | */ | |
424 | int rpc_nfs_create_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *name, int mode, void *private_data); | |
425 | ||
426 | ||
427 | ||
428 | ||
429 | /* | |
430 | * Call NFS/REMOVE | |
431 | * Function returns | |
432 | * 0 : The call was initiated. The callback will be invoked when the call completes. | |
433 | * <0 : An error occured when trying to set up the call. The callback will not be invoked. | |
434 | * | |
435 | * When the callback is invoked, status indicates the result: | |
436 | * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon. | |
437 | * data is REMOVE3res * | |
438 | * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon. | |
439 | * data is the error string. | |
440 | * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. | |
441 | * data is NULL. | |
442 | */ | |
443 | int rpc_nfs_remove_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *name, void *private_data); | |
444 | ||
445 | ||
446 | ||
447 | /* | |
f390f181 | 448 | * Call NFS/READDIR |
84004dbf RS |
449 | * Function returns |
450 | * 0 : The call was initiated. The callback will be invoked when the call completes. | |
451 | * <0 : An error occured when trying to set up the call. The callback will not be invoked. | |
452 | * | |
453 | * When the callback is invoked, status indicates the result: | |
454 | * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon. | |
455 | * data is READDIR3res * | |
456 | * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon. | |
457 | * data is the error string. | |
458 | * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. | |
459 | * data is NULL. | |
460 | */ | |
461 | int rpc_nfs_readdir_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, uint64_t cookie, char *cookieverf, int count, void *private_data); | |
462 | ||
f390f181 RS |
463 | /* |
464 | * Call NFS/READDIRPLUS | |
465 | * Function returns | |
466 | * 0 : The call was initiated. The callback will be invoked when the call completes. | |
467 | * <0 : An error occured when trying to set up the call. The callback will not be invoked. | |
468 | * | |
469 | * When the callback is invoked, status indicates the result: | |
470 | * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon. | |
471 | * data is READDIRPLUS3res * | |
472 | * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon. | |
473 | * data is the error string. | |
474 | * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. | |
475 | * data is NULL. | |
476 | */ | |
477 | int rpc_nfs_readdirplus_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, uint64_t cookie, char *cookieverf, int count, void *private_data); | |
478 | ||
84004dbf RS |
479 | /* |
480 | * Call NFS/FSSTAT | |
481 | * Function returns | |
482 | * 0 : The call was initiated. The callback will be invoked when the call completes. | |
483 | * <0 : An error occured when trying to set up the call. The callback will not be invoked. | |
484 | * | |
485 | * When the callback is invoked, status indicates the result: | |
486 | * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon. | |
487 | * data is FSSTAT3res | |
488 | * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon. | |
489 | * data is the error string. | |
490 | * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. | |
491 | * data is NULL. | |
492 | */ | |
493 | int rpc_nfs_fsstat_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data); | |
494 | ||
495 | ||
496 | ||
1058201e RS |
497 | /* |
498 | * Call NFS/FSINFO | |
499 | * Function returns | |
500 | * 0 : The call was initiated. The callback will be invoked when the call completes. | |
501 | * <0 : An error occured when trying to set up the call. The callback will not be invoked. | |
502 | * | |
503 | * When the callback is invoked, status indicates the result: | |
504 | * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon. | |
505 | * data is FSINFO3res | |
506 | * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon. | |
507 | * data is the error string. | |
508 | * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. | |
509 | * data is NULL. | |
510 | */ | |
511 | int rpc_nfs_fsinfo_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data); | |
512 | ||
513 | ||
84004dbf RS |
514 | |
515 | /* | |
516 | * Call NFS/READLINK | |
517 | * Function returns | |
518 | * 0 : The call was initiated. The callback will be invoked when the call completes. | |
519 | * <0 : An error occured when trying to set up the call. The callback will not be invoked. | |
520 | * | |
521 | * When the callback is invoked, status indicates the result: | |
522 | * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon. | |
523 | * data is READLINK3res * | |
524 | * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon. | |
525 | * data is the error string. | |
526 | * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. | |
527 | * data is NULL. | |
528 | */ | |
529 | int rpc_nfs_readlink_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data); | |
530 | ||
531 | ||
532 | ||
533 | /* | |
534 | * Call NFS/SYMLINK | |
535 | * Function returns | |
536 | * 0 : The call was initiated. The callback will be invoked when the call completes. | |
537 | * <0 : An error occured when trying to set up the call. The callback will not be invoked. | |
538 | * | |
539 | * When the callback is invoked, status indicates the result: | |
540 | * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon. | |
541 | * data is SYMLINK3res * | |
542 | * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon. | |
543 | * data is the error string. | |
544 | * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. | |
545 | * data is NULL. | |
546 | */ | |
547 | int rpc_nfs_symlink_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *newname, char *oldpath, void *private_data); | |
548 | ||
549 | ||
550 | /* | |
551 | * Call NFS/RENAME | |
552 | * Function returns | |
553 | * 0 : The call was initiated. The callback will be invoked when the call completes. | |
554 | * <0 : An error occured when trying to set up the call. The callback will not be invoked. | |
555 | * | |
556 | * When the callback is invoked, status indicates the result: | |
557 | * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon. | |
558 | * data is RENAME3res * | |
559 | * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon. | |
560 | * data is the error string. | |
561 | * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. | |
562 | * data is NULL. | |
563 | */ | |
564 | int rpc_nfs_rename_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *olddir, char *oldname, struct nfs_fh3 *newdir, char *newname, void *private_data); | |
565 | ||
566 | ||
567 | ||
568 | /* | |
569 | * Call NFS/LINK | |
570 | * Function returns | |
571 | * 0 : The call was initiated. The callback will be invoked when the call completes. | |
572 | * <0 : An error occured when trying to set up the call. The callback will not be invoked. | |
573 | * | |
574 | * When the callback is invoked, status indicates the result: | |
575 | * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon. | |
576 | * data is LINK3res * | |
577 | * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon. | |
578 | * data is the error string. | |
579 | * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. | |
580 | * data is NULL. | |
581 | */ | |
582 | int rpc_nfs_link_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *file, struct nfs_fh3 *newdir, char *newname, void *private_data); | |
583 | ||
584 | ||
585 | ||
05a777d9 RS |
586 | |
587 | /* | |
588 | * RQUOTA FUNCTIONS | |
589 | */ | |
590 | char *rquotastat_to_str(int error); | |
591 | int rquotastat_to_errno(int error); | |
592 | ||
593 | /* | |
594 | * Call RQUOTA1/NULL | |
595 | * Function returns | |
596 | * 0 : The call was initiated. The callback will be invoked when the call completes. | |
597 | * <0 : An error occured when trying to set up the call. The callback will not be invoked. | |
598 | * | |
599 | * When the callback is invoked, status indicates the result: | |
600 | * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon. | |
601 | * data is NULL. | |
602 | * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon. | |
603 | * data is the error string. | |
604 | * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. | |
605 | * data is NULL. | |
606 | */ | |
607 | int rpc_rquota1_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data); | |
608 | ||
609 | /* | |
610 | * Call RQUOTA1/GETQUOTA | |
611 | * Function returns | |
612 | * 0 : The call was initiated. The callback will be invoked when the call completes. | |
613 | * <0 : An error occured when trying to set up the call. The callback will not be invoked. | |
614 | * | |
615 | * When the callback is invoked, status indicates the result: | |
616 | * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon. | |
617 | * data is a RQUOTA1res structure. | |
618 | * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon. | |
619 | * data is the error string. | |
620 | * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. | |
621 | * data is NULL. | |
622 | */ | |
623 | int rpc_rquota1_getquota_async(struct rpc_context *rpc, rpc_cb cb, char *export, int uid, void *private_data); | |
19e74f5a RS |
624 | |
625 | /* | |
626 | * Call RQUOTA1/GETACTIVEQUOTA | |
627 | * Function returns | |
628 | * 0 : The call was initiated. The callback will be invoked when the call completes. | |
629 | * <0 : An error occured when trying to set up the call. The callback will not be invoked. | |
630 | * | |
631 | * When the callback is invoked, status indicates the result: | |
632 | * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon. | |
633 | * data is a RQUOTA1res structure. | |
634 | * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon. | |
635 | * data is the error string. | |
636 | * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. | |
637 | * data is NULL. | |
638 | */ | |
639 | int rpc_rquota1_getactivequota_async(struct rpc_context *rpc, rpc_cb cb, char *export, int uid, void *private_data); | |
77c23b46 RS |
640 | |
641 | ||
642 | ||
643 | ||
644 | /* | |
645 | * Call RQUOTA2/NULL | |
646 | * Function returns | |
647 | * 0 : The call was initiated. The callback will be invoked when the call completes. | |
648 | * <0 : An error occured when trying to set up the call. The callback will not be invoked. | |
649 | * | |
650 | * When the callback is invoked, status indicates the result: | |
651 | * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon. | |
652 | * data is NULL. | |
653 | * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon. | |
654 | * data is the error string. | |
655 | * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. | |
656 | * data is NULL. | |
657 | */ | |
658 | int rpc_rquota2_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data); | |
659 | ||
660 | /* | |
661 | * Call RQUOTA2/GETQUOTA | |
662 | * Function returns | |
663 | * 0 : The call was initiated. The callback will be invoked when the call completes. | |
664 | * <0 : An error occured when trying to set up the call. The callback will not be invoked. | |
665 | * | |
666 | * When the callback is invoked, status indicates the result: | |
667 | * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon. | |
668 | * data is a RQUOTA1res structure. | |
669 | * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon. | |
670 | * data is the error string. | |
671 | * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. | |
672 | * data is NULL. | |
673 | */ | |
674 | int rpc_rquota2_getquota_async(struct rpc_context *rpc, rpc_cb cb, char *export, int type, int uid, void *private_data); | |
675 | ||
676 | /* | |
677 | * Call RQUOTA2/GETACTIVEQUOTA | |
678 | * Function returns | |
679 | * 0 : The call was initiated. The callback will be invoked when the call completes. | |
680 | * <0 : An error occured when trying to set up the call. The callback will not be invoked. | |
681 | * | |
682 | * When the callback is invoked, status indicates the result: | |
683 | * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon. | |
684 | * data is a RQUOTA1res structure. | |
685 | * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon. | |
686 | * data is the error string. | |
687 | * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. | |
688 | * data is NULL. | |
689 | */ | |
690 | int rpc_rquota2_getactivequota_async(struct rpc_context *rpc, rpc_cb cb, char *export, int type, int uid, void *private_data); | |
3847f8f6 RS |
691 | |
692 | ||
693 | ||
694 | /* | |
695 | * Call NFSACL/NULL | |
696 | * Call the NULL procedure for the NFSACL | |
697 | * | |
698 | * Function returns | |
699 | * 0 : The call was initiated. The callback will be invoked when the call completes. | |
700 | * <0 : An error occured when trying to set up the call. The callback will not be invoked. | |
701 | * | |
702 | * When the callback is invoked, status indicates the result: | |
703 | * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon. | |
704 | * data is NULL | |
705 | * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon. | |
706 | * data is the error string. | |
707 | * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. | |
708 | * data is NULL. | |
709 | */ | |
710 | int rpc_nfsacl_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data); | |
711 | ||
712 | /* | |
713 | * Call NFSACL/GETACL | |
714 | * | |
715 | * Function returns | |
716 | * 0 : The call was initiated. The callback will be invoked when the call completes. | |
717 | * <0 : An error occured when trying to set up the call. The callback will not be invoked. | |
718 | * | |
719 | * When the callback is invoked, status indicates the result: | |
720 | * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon. | |
721 | * data is a GETACL3res pointer | |
722 | * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon. | |
723 | * data is the error string. | |
724 | * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete. | |
725 | * data is NULL. | |
726 | */ | |
727 | int rpc_nfsacl_getacl_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, uint32_t mask, void *private_data); | |
728 |