2 Copyright (C) 2010 by Ronnie Sahlberg <ronniesahlberg@gmail.com>
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.
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.
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/>.
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.
22 #ifndef _LIBNFS_RAW_H_
23 #define _LIBNFS_RAW_H_
26 #include <nfsc/libnfs-zdr.h>
34 struct rpc_context
*rpc_init_context(void);
35 void rpc_destroy_context(struct rpc_context
*rpc
);
37 void rpc_set_auth(struct rpc_context
*rpc
, struct AUTH
*auth
);
39 int rpc_get_fd(struct rpc_context
*rpc
);
40 int rpc_which_events(struct rpc_context
*rpc
);
41 int rpc_service(struct rpc_context
*rpc
, int revents
);
42 char *rpc_get_error(struct rpc_context
*rpc
);
43 int rpc_queue_length(struct rpc_context
*rpc
);
45 /* Utility function to get an RPC context from a NFS context. Useful for doing low level NFSACL
46 * calls on a NFS context.
48 struct rpc_context
*nfs_get_rpc_context(struct nfs_context
*nfs
);
50 /* This function returns the nfs_fh3 structure from a nfsfh structure.
51 This allows to use a file onened with nfs_open() together with low-level
52 rpc functions that thake a nfs filehandle
54 struct nfs_fh3
*nfs_get_fh(struct nfsfh
*nfsfh
);
56 #define RPC_STATUS_SUCCESS 0
57 #define RPC_STATUS_ERROR 1
58 #define RPC_STATUS_CANCEL 2
61 * Async connection to the tcp port at server:port.
63 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
64 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
66 * When the callback is invoked, status indicates the result:
67 * RPC_STATUS_SUCCESS : The tcp connection was successfully established.
69 * RPC_STATUS_ERROR : The connection failed to establish.
70 * data is the erro string.
71 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
74 int rpc_connect_async(struct rpc_context
*rpc
, const char *server
, int port
, rpc_cb cb
, void *private_data
);
76 * When disconnecting a connection in flight. All commands in flight will be called with the callback
77 * and status RPC_STATUS_ERROR. Data will be the error string for the disconnection.
79 int rpc_disconnect(struct rpc_context
*rpc
, char *error
);
87 * Call PORTMAPPER/NULL
89 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
90 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
92 * When the callback is invoked, status indicates the result:
93 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
95 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
96 * data is the error string.
97 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
100 int rpc_pmap_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
104 * Call PORTMAPPER/GETPORT.
106 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
107 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
109 * When the callback is invoked, status indicates the result:
110 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
111 * data is a (uint32_t *), containing the port returned.
112 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
113 * data is the error string.
114 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
117 int rpc_pmap_getport_async(struct rpc_context
*rpc
, int program
, int version
, int protocol
, rpc_cb cb
, void *private_data
);
120 * Call PORTMAPPER/SET
122 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
123 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
125 * When the callback is invoked, status indicates the result:
126 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
127 * data is a (uint32_t *), containing status
128 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
129 * data is the error string.
130 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
133 int rpc_pmap_set_async(struct rpc_context
*rpc
, int program
, int version
, int protocol
, int port
, rpc_cb cb
, void *private_data
);
136 * Call PORTMAPPER/UNSET
138 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
139 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
141 * When the callback is invoked, status indicates the result:
142 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
143 * data is a (uint32_t *), containing status
144 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
145 * data is the error string.
146 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
149 int rpc_pmap_unset_async(struct rpc_context
*rpc
, int program
, int version
, int protocol
, int port
, rpc_cb cb
, void *private_data
);
152 * Call PORTMAPPER/CALLIT.
154 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
155 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
157 * When the callback is invoked, status indicates the result:
158 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon
159 * data is a 'pmap_call_result' pointer.
160 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
161 * data is the error string.
162 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
165 int rpc_pmap_callit_async(struct rpc_context
*rpc
, int program
, int version
, int procedure
, char *data
, int datalen
, rpc_cb cb
, void *private_data
);
170 char *mountstat3_to_str(int stat
);
171 int mountstat3_to_errno(int error
);
176 * 0 : The call was initiated. The callback will be invoked when the call completes.
177 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
179 * When the callback is invoked, status indicates the result:
180 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
182 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
183 * data is the error string.
184 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
187 int rpc_mount_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
192 * 0 : The call was initiated. The callback will be invoked when the call completes.
193 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
195 * When the callback is invoked, status indicates the result:
196 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
197 * data is union mountres3.
198 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
199 * data is the error string.
200 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
203 int rpc_mount_mnt_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, void *private_data
);
208 * 0 : The call was initiated. The callback will be invoked when the call completes.
209 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
211 * When the callback is invoked, status indicates the result:
212 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
213 * data is a mountlist.
214 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
215 * data is the error string.
216 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
219 int rpc_mount_dump_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
224 * 0 : The call was initiated. The callback will be invoked when the call completes.
225 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
227 * When the callback is invoked, status indicates the result:
228 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
230 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
231 * data is the error string.
232 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
235 int rpc_mount_umnt_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, void *private_data
);
240 * 0 : The call was initiated. The callback will be invoked when the call completes.
241 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
243 * When the callback is invoked, status indicates the result:
244 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
246 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
247 * data is the error string.
248 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
251 int rpc_mount_umntall_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
255 * NOTE: You must include 'libnfs-raw-mount.h' to get the definitions of the
256 * returned structures.
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.
262 * When the callback is invoked, status indicates the result:
263 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
264 * data is a pointer to an exports pointer:
265 * exports export = *(exports *)data;
266 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
267 * data is the error string.
268 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
271 int rpc_mount_export_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
280 char *nfsstat3_to_str(int error
);
281 int nfsstat3_to_errno(int error
);
286 * 0 : The call was initiated. The callback will be invoked when the call completes.
287 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
289 * When the callback is invoked, status indicates the result:
290 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
292 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
293 * data is the error string.
294 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
297 int rpc_nfs_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
302 * 0 : The call was initiated. The callback will be invoked when the call completes.
303 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
305 * When the callback is invoked, status indicates the result:
306 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
307 * data is GETATTR3res
308 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
309 * data is the error string.
310 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
313 int rpc_nfs_getattr_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, void *private_data
);
318 * 0 : The call was initiated. The callback will be invoked when the call completes.
319 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
321 * When the callback is invoked, status indicates the result:
322 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
324 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
325 * data is the error string.
326 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
329 int rpc_nfs_lookup_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, char *name
, void *private_data
);
334 * 0 : The call was initiated. The callback will be invoked when the call completes.
335 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
337 * When the callback is invoked, status indicates the result:
338 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
340 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
341 * data is the error string.
342 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
345 int rpc_nfs_access_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, int access
, void *private_data
);
350 * 0 : The call was initiated. The callback will be invoked when the call completes.
351 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
353 * When the callback is invoked, status indicates the result:
354 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
356 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
357 * data is the error string.
358 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
361 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
);
366 * 0 : The call was initiated. The callback will be invoked when the call completes.
367 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
369 * When the callback is invoked, status indicates the result:
370 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
371 * data is WRITE3res *
372 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
373 * data is the error string.
374 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
377 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
);
382 * 0 : The call was initiated. The callback will be invoked when the call completes.
383 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
385 * When the callback is invoked, status indicates the result:
386 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
387 * data is COMMIT3res *
388 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
389 * data is the error string.
390 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
393 int rpc_nfs_commit_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, void *private_data
);
399 * 0 : The call was initiated. The callback will be invoked when the call completes.
400 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
402 * When the callback is invoked, status indicates the result:
403 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
404 * data is SETATTR3res *
405 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
406 * data is the error string.
407 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
411 int rpc_nfs_setattr_async(struct rpc_context
*rpc
, rpc_cb cb
, struct SETATTR3args
*args
, void *private_data
);
418 * 0 : The call was initiated. The callback will be invoked when the call completes.
419 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
421 * When the callback is invoked, status indicates the result:
422 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
423 * data is MKDIR3res *
424 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
425 * data is the error string.
426 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
430 int rpc_nfs_mkdir_async(struct rpc_context
*rpc
, rpc_cb cb
, struct MKDIR3args
*args
, void *private_data
);
439 * 0 : The call was initiated. The callback will be invoked when the call completes.
440 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
442 * When the callback is invoked, status indicates the result:
443 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
444 * data is RMDIR3res *
445 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
446 * data is the error string.
447 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
450 int rpc_nfs_rmdir_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, char *dir
, void *private_data
);
458 * 0 : The call was initiated. The callback will be invoked when the call completes.
459 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
461 * When the callback is invoked, status indicates the result:
462 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
463 * data is CREATE3res *
464 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
465 * data is the error string.
466 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
470 int rpc_nfs_create_async(struct rpc_context
*rpc
, rpc_cb cb
, struct CREATE3args
*args
, void *private_data
);
476 * 0 : The call was initiated. The callback will be invoked when the call completes.
477 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
479 * When the callback is invoked, status indicates the result:
480 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
481 * data is MKNOD3res *
482 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
483 * data is the error string.
484 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
487 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
);
493 * 0 : The call was initiated. The callback will be invoked when the call completes.
494 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
496 * When the callback is invoked, status indicates the result:
497 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
498 * data is REMOVE3res *
499 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
500 * data is the error string.
501 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
504 int rpc_nfs_remove_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, char *name
, void *private_data
);
511 * 0 : The call was initiated. The callback will be invoked when the call completes.
512 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
514 * When the callback is invoked, status indicates the result:
515 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
516 * data is READDIR3res *
517 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
518 * data is the error string.
519 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
522 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
);
525 * Call NFS/READDIRPLUS
527 * 0 : The call was initiated. The callback will be invoked when the call completes.
528 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
530 * When the callback is invoked, status indicates the result:
531 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
532 * data is READDIRPLUS3res *
533 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
534 * data is the error string.
535 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
538 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
);
543 * 0 : The call was initiated. The callback will be invoked when the call completes.
544 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
546 * When the callback is invoked, status indicates the result:
547 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
549 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
550 * data is the error string.
551 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
554 int rpc_nfs_fsstat_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, void *private_data
);
561 * 0 : The call was initiated. The callback will be invoked when the call completes.
562 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
564 * When the callback is invoked, status indicates the result:
565 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
567 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
568 * data is the error string.
569 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
572 int rpc_nfs_fsinfo_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, void *private_data
);
579 * 0 : The call was initiated. The callback will be invoked when the call completes.
580 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
582 * When the callback is invoked, status indicates the result:
583 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
584 * data is READLINK3res *
585 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
586 * data is the error string.
587 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
590 struct READLINK3args
;
591 int rpc_nfs_readlink_async(struct rpc_context
*rpc
, rpc_cb cb
, struct READLINK3args
*args
, void *private_data
);
598 * 0 : The call was initiated. The callback will be invoked when the call completes.
599 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
601 * When the callback is invoked, status indicates the result:
602 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
603 * data is SYMLINK3res *
604 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
605 * data is the error string.
606 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
610 int rpc_nfs_symlink_async(struct rpc_context
*rpc
, rpc_cb cb
, struct SYMLINK3args
*args
, void *private_data
);
616 * 0 : The call was initiated. The callback will be invoked when the call completes.
617 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
619 * When the callback is invoked, status indicates the result:
620 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
621 * data is RENAME3res *
622 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
623 * data is the error string.
624 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
627 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
);
634 * 0 : The call was initiated. The callback will be invoked when the call completes.
635 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
637 * When the callback is invoked, status indicates the result:
638 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
640 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
641 * data is the error string.
642 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
645 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
);
653 char *rquotastat_to_str(int error
);
654 int rquotastat_to_errno(int error
);
659 * 0 : The call was initiated. The callback will be invoked when the call completes.
660 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
662 * When the callback is invoked, status indicates the result:
663 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
665 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
666 * data is the error string.
667 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
670 int rpc_rquota1_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
673 * Call RQUOTA1/GETQUOTA
675 * 0 : The call was initiated. The callback will be invoked when the call completes.
676 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
678 * When the callback is invoked, status indicates the result:
679 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
680 * data is a RQUOTA1res structure.
681 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
682 * data is the error string.
683 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
686 int rpc_rquota1_getquota_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, int uid
, void *private_data
);
689 * Call RQUOTA1/GETACTIVEQUOTA
691 * 0 : The call was initiated. The callback will be invoked when the call completes.
692 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
694 * When the callback is invoked, status indicates the result:
695 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
696 * data is a RQUOTA1res structure.
697 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
698 * data is the error string.
699 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
702 int rpc_rquota1_getactivequota_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, int uid
, void *private_data
);
710 * 0 : The call was initiated. The callback will be invoked when the call completes.
711 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
713 * When the callback is invoked, status indicates the result:
714 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
716 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
717 * data is the error string.
718 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
721 int rpc_rquota2_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
724 * Call RQUOTA2/GETQUOTA
726 * 0 : The call was initiated. The callback will be invoked when the call completes.
727 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
729 * When the callback is invoked, status indicates the result:
730 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
731 * data is a RQUOTA1res structure.
732 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
733 * data is the error string.
734 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
737 int rpc_rquota2_getquota_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, int type
, int uid
, void *private_data
);
740 * Call RQUOTA2/GETACTIVEQUOTA
742 * 0 : The call was initiated. The callback will be invoked when the call completes.
743 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
745 * When the callback is invoked, status indicates the result:
746 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
747 * data is a RQUOTA1res structure.
748 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
749 * data is the error string.
750 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
753 int rpc_rquota2_getactivequota_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, int type
, int uid
, void *private_data
);
766 * Call the NULL procedure for the NFSACL
769 * 0 : The call was initiated. The callback will be invoked when the call completes.
770 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
772 * When the callback is invoked, status indicates the result:
773 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
775 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
776 * data is the error string.
777 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
780 int rpc_nfsacl_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
786 * 0 : The call was initiated. The callback will be invoked when the call completes.
787 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
789 * When the callback is invoked, status indicates the result:
790 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
791 * data is a GETACL3res pointer
792 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
793 * data is the error string.
794 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
798 int rpc_nfsacl_getacl_async(struct rpc_context
*rpc
, rpc_cb cb
, struct GETACL3args
*args
, void *private_data
);
806 * 0 : The call was initiated. The callback will be invoked when the call completes.
807 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
809 * When the callback is invoked, status indicates the result:
810 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
811 * data is a SETACL3res pointer
812 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
813 * data is the error string.
814 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
818 int rpc_nfsacl_setacl_async(struct rpc_context
*rpc
, rpc_cb cb
, struct SETACL3args
*args
, void *private_data
);
826 char *nlmstat4_to_str(int stat
);
830 * Call the NULL procedure for the NLM protocol
833 * 0 : The call was initiated. The callback will be invoked when the call completes.
834 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
836 * When the callback is invoked, status indicates the result:
837 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
839 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
840 * data is the error string.
841 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
844 int rpc_nlm4_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
848 * Call the TEST procedure for the NLM protocol
851 * 0 : The call was initiated. The callback will be invoked when the call completes.
852 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
854 * When the callback is invoked, status indicates the result:
855 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
856 * data is NLM4_TESTres
857 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
858 * data is the error string.
859 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
862 struct NLM4_TESTargs
;
863 int rpc_nlm4_test_async(struct rpc_context
*rpc
, rpc_cb cb
, struct NLM4_TESTargs
*args
, void *private_data
);
867 * Call the LOCK procedure for the NLM protocol
870 * 0 : The call was initiated. The callback will be invoked when the call completes.
871 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
873 * When the callback is invoked, status indicates the result:
874 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
875 * data is NLM4_LOCKres
876 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
877 * data is the error string.
878 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
881 struct NLM4_LOCKargs
;
882 int rpc_nlm4_lock_async(struct rpc_context
*rpc
, rpc_cb cb
, struct NLM4_LOCKargs
*args
, void *private_data
);
886 * Call the CANCEL procedure for the NLM protocol
889 * 0 : The call was initiated. The callback will be invoked when the call completes.
890 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
892 * When the callback is invoked, status indicates the result:
893 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
894 * data is NLM4_CANCres
895 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
896 * data is the error string.
897 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
900 struct NLM4_CANCargs
;
901 int rpc_nlm4_cancel_async(struct rpc_context
*rpc
, rpc_cb cb
, struct NLM4_CANCargs
*args
, void *private_data
);
905 * Call the UNLOCK procedure for the NLM protocol
908 * 0 : The call was initiated. The callback will be invoked when the call completes.
909 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
911 * When the callback is invoked, status indicates the result:
912 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
913 * data is NLM4_UNLOCKres
914 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
915 * data is the error string.
916 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
919 struct NLM4_UNLOCKargs
;
920 int rpc_nlm4_unlock_async(struct rpc_context
*rpc
, rpc_cb cb
, struct NLM4_UNLOCKargs
*args
, void *private_data
);