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