make mkdir_async take a full MKDIR3args argument
[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, int protocol, rpc_cb cb, void *private_data);
106
107 /*
108 * Call PORTMAPPER/SET
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 (uint32_t *), containing status
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_set_async(struct rpc_context *rpc, int program, int version, int protocol, int port, rpc_cb cb, void *private_data);
122
123 /*
124 * Call PORTMAPPER/UNSET
125 * Function returns
126 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
127 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
128 *
129 * When the callback is invoked, status indicates the result:
130 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
131 * data is a (uint32_t *), containing status
132 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
133 * data is the error string.
134 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
135 * data is NULL.
136 */
137 int rpc_pmap_unset_async(struct rpc_context *rpc, int program, int version, int protocol, int port, rpc_cb cb, void *private_data);
138
139 /*
140 * Call PORTMAPPER/CALLIT.
141 * Function returns
142 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
143 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
144 *
145 * When the callback is invoked, status indicates the result:
146 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon
147 * data is a 'pmap_call_result' pointer.
148 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
149 * data is the error string.
150 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
151 * data is NULL.
152 */
153 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);
154
155 /*
156 * MOUNT FUNCTIONS
157 */
158 char *mountstat3_to_str(int stat);
159 int mountstat3_to_errno(int error);
160
161 /*
162 * Call MOUNT/NULL
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 NULL.
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_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
176
177 /*
178 * Call MOUNT/MNT
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 is union mountres3.
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_mnt_async(struct rpc_context *rpc, rpc_cb cb, char *export, void *private_data);
192
193 /*
194 * Call MOUNT/DUMP
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 is a mountlist.
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_dump_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
208
209 /*
210 * Call MOUNT/UMNT
211 * Function returns
212 * 0 : The call was initiated. The callback will be invoked when the call completes.
213 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
214 *
215 * When the callback is invoked, status indicates the result:
216 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
217 * data NULL.
218 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
219 * data is the error string.
220 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
221 * data is NULL.
222 */
223 int rpc_mount_umnt_async(struct rpc_context *rpc, rpc_cb cb, char *export, void *private_data);
224
225 /*
226 * Call MOUNT/UMNTALL
227 * Function returns
228 * 0 : The call was initiated. The callback will be invoked when the call completes.
229 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
230 *
231 * When the callback is invoked, status indicates the result:
232 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
233 * data NULL.
234 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
235 * data is the error string.
236 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
237 * data is NULL.
238 */
239 int rpc_mount_umntall_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
240
241 /*
242 * Call MOUNT/EXPORT
243 * NOTE: You must include 'libnfs-raw-mount.h' to get the definitions of the
244 * returned structures.
245 *
246 * Function returns
247 * 0 : The call was initiated. The callback will be invoked when the call completes.
248 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
249 *
250 * When the callback is invoked, status indicates the result:
251 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
252 * data is a pointer to an exports pointer:
253 * exports export = *(exports *)data;
254 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
255 * data is the error string.
256 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
257 * data is NULL.
258 */
259 int rpc_mount_export_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
260
261
262
263
264 /*
265 * NFS FUNCTIONS
266 */
267 struct nfs_fh3;
268 char *nfsstat3_to_str(int error);
269 int nfsstat3_to_errno(int error);
270
271 /*
272 * Call NFS/NULL
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 NULL.
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_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
286
287 /*
288 * Call NFS/GETATTR
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 GETATTR3res
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_getattr_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
302
303 /*
304 * Call NFS/LOOKUP
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 LOOKUP3res
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_lookup_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *name, void *private_data);
318
319 /*
320 * Call NFS/ACCESS
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 ACCESS3res
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_access_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, int access, void *private_data);
334
335 /*
336 * Call NFS/READ
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 READ3res
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_read_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, uint64_t offset, uint64_t count, void *private_data);
350
351 /*
352 * Call NFS/WRITE
353 * Function returns
354 * 0 : The call was initiated. The callback will be invoked when the call completes.
355 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
356 *
357 * When the callback is invoked, status indicates the result:
358 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
359 * data is WRITE3res *
360 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
361 * data is the error string.
362 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
363 * data is NULL.
364 */
365 int rpc_nfs_write_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *buf, uint64_t offset, uint64_t count, int stable_how, void *private_data);
366
367 /*
368 * Call NFS/COMMIT
369 * Function returns
370 * 0 : The call was initiated. The callback will be invoked when the call completes.
371 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
372 *
373 * When the callback is invoked, status indicates the result:
374 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
375 * data is COMMIT3res *
376 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
377 * data is the error string.
378 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
379 * data is NULL.
380 */
381 int rpc_nfs_commit_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
382
383
384 /*
385 * Call NFS/SETATTR
386 * Function returns
387 * 0 : The call was initiated. The callback will be invoked when the call completes.
388 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
389 *
390 * When the callback is invoked, status indicates the result:
391 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
392 * data is SETATTR3res *
393 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
394 * data is the error string.
395 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
396 * data is NULL.
397 */
398 struct SETATTR3args;
399 int rpc_nfs_setattr_async(struct rpc_context *rpc, rpc_cb cb, struct SETATTR3args *args, void *private_data);
400
401
402
403 /*
404 * Call NFS/MKDIR
405 * Function returns
406 * 0 : The call was initiated. The callback will be invoked when the call completes.
407 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
408 *
409 * When the callback is invoked, status indicates the result:
410 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
411 * data is MKDIR3res *
412 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
413 * data is the error string.
414 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
415 * data is NULL.
416 */
417 struct MKDIR3args;
418 int rpc_nfs_mkdir_async(struct rpc_context *rpc, rpc_cb cb, struct MKDIR3args *args, void *private_data);
419
420
421
422
423
424 /*
425 * Call NFS/RMDIR
426 * Function returns
427 * 0 : The call was initiated. The callback will be invoked when the call completes.
428 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
429 *
430 * When the callback is invoked, status indicates the result:
431 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
432 * data is RMDIR3res *
433 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
434 * data is the error string.
435 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
436 * data is NULL.
437 */
438 int rpc_nfs_rmdir_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *dir, void *private_data);
439
440
441
442
443 /*
444 * Call NFS/CREATE
445 * Function returns
446 * 0 : The call was initiated. The callback will be invoked when the call completes.
447 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
448 *
449 * When the callback is invoked, status indicates the result:
450 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
451 * data is CREATE3res *
452 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
453 * data is the error string.
454 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
455 * data is NULL.
456 */
457 struct CREATE3args;
458 int rpc_nfs_create_async(struct rpc_context *rpc, rpc_cb cb, struct CREATE3args *args, void *private_data);
459
460
461 /*
462 * Call NFS/MKNOD
463 * Function returns
464 * 0 : The call was initiated. The callback will be invoked when the call completes.
465 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
466 *
467 * When the callback is invoked, status indicates the result:
468 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
469 * data is MKNOD3res *
470 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
471 * data is the error string.
472 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
473 * data is NULL.
474 */
475 int rpc_nfs_mknod_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *file, int mode, int major, int minor, void *private_data);
476
477
478 /*
479 * Call NFS/REMOVE
480 * Function returns
481 * 0 : The call was initiated. The callback will be invoked when the call completes.
482 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
483 *
484 * When the callback is invoked, status indicates the result:
485 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
486 * data is REMOVE3res *
487 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
488 * data is the error string.
489 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
490 * data is NULL.
491 */
492 int rpc_nfs_remove_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *name, void *private_data);
493
494
495
496 /*
497 * Call NFS/READDIR
498 * Function returns
499 * 0 : The call was initiated. The callback will be invoked when the call completes.
500 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
501 *
502 * When the callback is invoked, status indicates the result:
503 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
504 * data is READDIR3res *
505 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
506 * data is the error string.
507 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
508 * data is NULL.
509 */
510 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);
511
512 /*
513 * Call NFS/READDIRPLUS
514 * Function returns
515 * 0 : The call was initiated. The callback will be invoked when the call completes.
516 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
517 *
518 * When the callback is invoked, status indicates the result:
519 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
520 * data is READDIRPLUS3res *
521 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
522 * data is the error string.
523 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
524 * data is NULL.
525 */
526 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);
527
528 /*
529 * Call NFS/FSSTAT
530 * Function returns
531 * 0 : The call was initiated. The callback will be invoked when the call completes.
532 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
533 *
534 * When the callback is invoked, status indicates the result:
535 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
536 * data is FSSTAT3res
537 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
538 * data is the error string.
539 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
540 * data is NULL.
541 */
542 int rpc_nfs_fsstat_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
543
544
545
546 /*
547 * Call NFS/FSINFO
548 * Function returns
549 * 0 : The call was initiated. The callback will be invoked when the call completes.
550 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
551 *
552 * When the callback is invoked, status indicates the result:
553 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
554 * data is FSINFO3res
555 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
556 * data is the error string.
557 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
558 * data is NULL.
559 */
560 int rpc_nfs_fsinfo_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
561
562
563
564 /*
565 * Call NFS/READLINK
566 * Function returns
567 * 0 : The call was initiated. The callback will be invoked when the call completes.
568 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
569 *
570 * When the callback is invoked, status indicates the result:
571 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
572 * data is READLINK3res *
573 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
574 * data is the error string.
575 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
576 * data is NULL.
577 */
578 int rpc_nfs_readlink_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
579
580
581
582 /*
583 * Call NFS/SYMLINK
584 * Function returns
585 * 0 : The call was initiated. The callback will be invoked when the call completes.
586 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
587 *
588 * When the callback is invoked, status indicates the result:
589 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
590 * data is SYMLINK3res *
591 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
592 * data is the error string.
593 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
594 * data is NULL.
595 */
596 int rpc_nfs_symlink_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *newname, char *oldpath, void *private_data);
597
598
599 /*
600 * Call NFS/RENAME
601 * Function returns
602 * 0 : The call was initiated. The callback will be invoked when the call completes.
603 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
604 *
605 * When the callback is invoked, status indicates the result:
606 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
607 * data is RENAME3res *
608 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
609 * data is the error string.
610 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
611 * data is NULL.
612 */
613 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);
614
615
616
617 /*
618 * Call NFS/LINK
619 * Function returns
620 * 0 : The call was initiated. The callback will be invoked when the call completes.
621 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
622 *
623 * When the callback is invoked, status indicates the result:
624 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
625 * data is LINK3res *
626 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
627 * data is the error string.
628 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
629 * data is NULL.
630 */
631 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);
632
633
634
635
636 /*
637 * RQUOTA FUNCTIONS
638 */
639 char *rquotastat_to_str(int error);
640 int rquotastat_to_errno(int error);
641
642 /*
643 * Call RQUOTA1/NULL
644 * Function returns
645 * 0 : The call was initiated. The callback will be invoked when the call completes.
646 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
647 *
648 * When the callback is invoked, status indicates the result:
649 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
650 * data is NULL.
651 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
652 * data is the error string.
653 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
654 * data is NULL.
655 */
656 int rpc_rquota1_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
657
658 /*
659 * Call RQUOTA1/GETQUOTA
660 * Function returns
661 * 0 : The call was initiated. The callback will be invoked when the call completes.
662 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
663 *
664 * When the callback is invoked, status indicates the result:
665 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
666 * data is a RQUOTA1res structure.
667 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
668 * data is the error string.
669 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
670 * data is NULL.
671 */
672 int rpc_rquota1_getquota_async(struct rpc_context *rpc, rpc_cb cb, char *export, int uid, void *private_data);
673
674 /*
675 * Call RQUOTA1/GETACTIVEQUOTA
676 * Function returns
677 * 0 : The call was initiated. The callback will be invoked when the call completes.
678 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
679 *
680 * When the callback is invoked, status indicates the result:
681 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
682 * data is a RQUOTA1res structure.
683 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
684 * data is the error string.
685 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
686 * data is NULL.
687 */
688 int rpc_rquota1_getactivequota_async(struct rpc_context *rpc, rpc_cb cb, char *export, int uid, void *private_data);
689
690
691
692
693 /*
694 * Call RQUOTA2/NULL
695 * Function returns
696 * 0 : The call was initiated. The callback will be invoked when the call completes.
697 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
698 *
699 * When the callback is invoked, status indicates the result:
700 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
701 * data is NULL.
702 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
703 * data is the error string.
704 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
705 * data is NULL.
706 */
707 int rpc_rquota2_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
708
709 /*
710 * Call RQUOTA2/GETQUOTA
711 * Function returns
712 * 0 : The call was initiated. The callback will be invoked when the call completes.
713 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
714 *
715 * When the callback is invoked, status indicates the result:
716 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
717 * data is a RQUOTA1res structure.
718 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
719 * data is the error string.
720 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
721 * data is NULL.
722 */
723 int rpc_rquota2_getquota_async(struct rpc_context *rpc, rpc_cb cb, char *export, int type, int uid, void *private_data);
724
725 /*
726 * Call RQUOTA2/GETACTIVEQUOTA
727 * Function returns
728 * 0 : The call was initiated. The callback will be invoked when the call completes.
729 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
730 *
731 * When the callback is invoked, status indicates the result:
732 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
733 * data is a RQUOTA1res structure.
734 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
735 * data is the error string.
736 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
737 * data is NULL.
738 */
739 int rpc_rquota2_getactivequota_async(struct rpc_context *rpc, rpc_cb cb, char *export, int type, int uid, void *private_data);
740
741
742
743 /*
744 * Call NFSACL/NULL
745 * Call the NULL procedure for the NFSACL
746 *
747 * Function returns
748 * 0 : The call was initiated. The callback will be invoked when the call completes.
749 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
750 *
751 * When the callback is invoked, status indicates the result:
752 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
753 * data is NULL
754 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
755 * data is the error string.
756 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
757 * data is NULL.
758 */
759 int rpc_nfsacl_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
760
761 /*
762 * Call NFSACL/GETACL
763 *
764 * Function returns
765 * 0 : The call was initiated. The callback will be invoked when the call completes.
766 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
767 *
768 * When the callback is invoked, status indicates the result:
769 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
770 * data is a GETACL3res pointer
771 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
772 * data is the error string.
773 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
774 * data is NULL.
775 */
776 int rpc_nfsacl_getacl_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, uint32_t mask, void *private_data);
777