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.
32 struct rpc_context
*rpc_init_context(void);
33 void rpc_destroy_context(struct rpc_context
*rpc
);
35 void rpc_set_auth(struct rpc_context
*rpc
, AUTH
*auth
);
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
);
43 /* Utility function to get an RPC context from a NFS context. Useful for doing low level NFSACL
44 * calls on a NFS context.
46 struct rpc_context
*nfs_get_rpc_context(struct nfs_context
*nfs
);
48 /* This function returns the nfs_fh3 structure from a nfsfh structure.
49 This allows to use a file onened with nfs_open() together with low-level
50 rpc functions that thake a nfs filehandle
52 struct nfs_fh3
*nfs_get_fh(struct nfsfh
*nfsfh
);
54 #define RPC_STATUS_SUCCESS 0
55 #define RPC_STATUS_ERROR 1
56 #define RPC_STATUS_CANCEL 2
59 * Async connection to the tcp port at server:port.
61 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
62 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
64 * When the callback is invoked, status indicates the result:
65 * RPC_STATUS_SUCCESS : The tcp connection was successfully established.
67 * RPC_STATUS_ERROR : The connection failed to establish.
68 * data is the erro string.
69 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
72 int rpc_connect_async(struct rpc_context
*rpc
, const char *server
, int port
, rpc_cb cb
, void *private_data
);
74 * When disconnecting a connection in flight. All commands in flight will be called with the callback
75 * and status RPC_STATUS_ERROR. Data will be the error string for the disconnection.
77 int rpc_disconnect(struct rpc_context
*rpc
, char *error
);
85 * Call PORTMAPPER/NULL
87 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
88 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
90 * When the callback is invoked, status indicates the result:
91 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
93 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
94 * data is the error string.
95 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
98 int rpc_pmap_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
102 * Call PORTMAPPER/GETPORT.
104 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
105 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
107 * When the callback is invoked, status indicates the result:
108 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
109 * data is a (uint32_t *), containing the port returned.
110 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
111 * data is the error string.
112 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
115 int rpc_pmap_getport_async(struct rpc_context
*rpc
, int program
, int version
, int protocol
, rpc_cb cb
, void *private_data
);
118 * Call PORTMAPPER/SET
120 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
121 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
123 * When the callback is invoked, status indicates the result:
124 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
125 * data is a (uint32_t *), containing status
126 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
127 * data is the error string.
128 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
131 int rpc_pmap_set_async(struct rpc_context
*rpc
, int program
, int version
, int protocol
, int port
, rpc_cb cb
, void *private_data
);
134 * Call PORTMAPPER/UNSET
136 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
137 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
139 * When the callback is invoked, status indicates the result:
140 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
141 * data is a (uint32_t *), containing status
142 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
143 * data is the error string.
144 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
147 int rpc_pmap_unset_async(struct rpc_context
*rpc
, int program
, int version
, int protocol
, int port
, rpc_cb cb
, void *private_data
);
150 * Call PORTMAPPER/CALLIT.
152 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
153 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
155 * When the callback is invoked, status indicates the result:
156 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon
157 * data is a 'pmap_call_result' pointer.
158 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
159 * data is the error string.
160 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
163 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
);
168 char *mountstat3_to_str(int stat
);
169 int mountstat3_to_errno(int error
);
174 * 0 : The call was initiated. The callback will be invoked when the call completes.
175 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
177 * When the callback is invoked, status indicates the result:
178 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
180 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
181 * data is the error string.
182 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
185 int rpc_mount_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
190 * 0 : The call was initiated. The callback will be invoked when the call completes.
191 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
193 * When the callback is invoked, status indicates the result:
194 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
195 * data is union mountres3.
196 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
197 * data is the error string.
198 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
201 int rpc_mount_mnt_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, void *private_data
);
206 * 0 : The call was initiated. The callback will be invoked when the call completes.
207 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
209 * When the callback is invoked, status indicates the result:
210 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
211 * data is a mountlist.
212 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
213 * data is the error string.
214 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
217 int rpc_mount_dump_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
222 * 0 : The call was initiated. The callback will be invoked when the call completes.
223 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
225 * When the callback is invoked, status indicates the result:
226 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
228 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
229 * data is the error string.
230 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
233 int rpc_mount_umnt_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, void *private_data
);
238 * 0 : The call was initiated. The callback will be invoked when the call completes.
239 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
241 * When the callback is invoked, status indicates the result:
242 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
244 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
245 * data is the error string.
246 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
249 int rpc_mount_umntall_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
253 * NOTE: You must include 'libnfs-raw-mount.h' to get the definitions of the
254 * returned structures.
257 * 0 : The call was initiated. The callback will be invoked when the call completes.
258 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
260 * When the callback is invoked, status indicates the result:
261 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
262 * data is a pointer to an exports pointer:
263 * exports export = *(exports *)data;
264 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
265 * data is the error string.
266 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
269 int rpc_mount_export_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
278 char *nfsstat3_to_str(int error
);
279 int nfsstat3_to_errno(int error
);
284 * 0 : The call was initiated. The callback will be invoked when the call completes.
285 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
287 * When the callback is invoked, status indicates the result:
288 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
290 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
291 * data is the error string.
292 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
295 int rpc_nfs_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
300 * 0 : The call was initiated. The callback will be invoked when the call completes.
301 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
303 * When the callback is invoked, status indicates the result:
304 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
305 * data is GETATTR3res
306 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
307 * data is the error string.
308 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
311 int rpc_nfs_getattr_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, void *private_data
);
316 * 0 : The call was initiated. The callback will be invoked when the call completes.
317 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
319 * When the callback is invoked, status indicates the result:
320 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
322 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
323 * data is the error string.
324 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
327 int rpc_nfs_lookup_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, char *name
, void *private_data
);
332 * 0 : The call was initiated. The callback will be invoked when the call completes.
333 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
335 * When the callback is invoked, status indicates the result:
336 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
338 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
339 * data is the error string.
340 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
343 int rpc_nfs_access_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, int access
, void *private_data
);
348 * 0 : The call was initiated. The callback will be invoked when the call completes.
349 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
351 * When the callback is invoked, status indicates the result:
352 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
354 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
355 * data is the error string.
356 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
359 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
);
364 * 0 : The call was initiated. The callback will be invoked when the call completes.
365 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
367 * When the callback is invoked, status indicates the result:
368 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
369 * data is WRITE3res *
370 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
371 * data is the error string.
372 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
375 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
);
380 * 0 : The call was initiated. The callback will be invoked when the call completes.
381 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
383 * When the callback is invoked, status indicates the result:
384 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
385 * data is COMMIT3res *
386 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
387 * data is the error string.
388 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
391 int rpc_nfs_commit_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, void *private_data
);
397 * 0 : The call was initiated. The callback will be invoked when the call completes.
398 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
400 * When the callback is invoked, status indicates the result:
401 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
402 * data is SETATTR3res *
403 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
404 * data is the error string.
405 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
409 int rpc_nfs_setattr_async(struct rpc_context
*rpc
, rpc_cb cb
, struct SETATTR3args
*args
, void *private_data
);
416 * 0 : The call was initiated. The callback will be invoked when the call completes.
417 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
419 * When the callback is invoked, status indicates the result:
420 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
421 * data is MKDIR3res *
422 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
423 * data is the error string.
424 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
428 int rpc_nfs_mkdir_async(struct rpc_context
*rpc
, rpc_cb cb
, struct MKDIR3args
*args
, void *private_data
);
437 * 0 : The call was initiated. The callback will be invoked when the call completes.
438 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
440 * When the callback is invoked, status indicates the result:
441 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
442 * data is RMDIR3res *
443 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
444 * data is the error string.
445 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
448 int rpc_nfs_rmdir_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, char *dir
, void *private_data
);
456 * 0 : The call was initiated. The callback will be invoked when the call completes.
457 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
459 * When the callback is invoked, status indicates the result:
460 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
461 * data is CREATE3res *
462 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
463 * data is the error string.
464 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
468 int rpc_nfs_create_async(struct rpc_context
*rpc
, rpc_cb cb
, struct CREATE3args
*args
, void *private_data
);
474 * 0 : The call was initiated. The callback will be invoked when the call completes.
475 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
477 * When the callback is invoked, status indicates the result:
478 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
479 * data is MKNOD3res *
480 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
481 * data is the error string.
482 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
485 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
);
491 * 0 : The call was initiated. The callback will be invoked when the call completes.
492 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
494 * When the callback is invoked, status indicates the result:
495 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
496 * data is REMOVE3res *
497 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
498 * data is the error string.
499 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
502 int rpc_nfs_remove_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, char *name
, void *private_data
);
509 * 0 : The call was initiated. The callback will be invoked when the call completes.
510 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
512 * When the callback is invoked, status indicates the result:
513 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
514 * data is READDIR3res *
515 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
516 * data is the error string.
517 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
520 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
);
523 * Call NFS/READDIRPLUS
525 * 0 : The call was initiated. The callback will be invoked when the call completes.
526 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
528 * When the callback is invoked, status indicates the result:
529 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
530 * data is READDIRPLUS3res *
531 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
532 * data is the error string.
533 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
536 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
);
541 * 0 : The call was initiated. The callback will be invoked when the call completes.
542 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
544 * When the callback is invoked, status indicates the result:
545 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
547 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
548 * data is the error string.
549 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
552 int rpc_nfs_fsstat_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, void *private_data
);
559 * 0 : The call was initiated. The callback will be invoked when the call completes.
560 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
562 * When the callback is invoked, status indicates the result:
563 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
565 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
566 * data is the error string.
567 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
570 int rpc_nfs_fsinfo_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, void *private_data
);
577 * 0 : The call was initiated. The callback will be invoked when the call completes.
578 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
580 * When the callback is invoked, status indicates the result:
581 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
582 * data is READLINK3res *
583 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
584 * data is the error string.
585 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
588 struct READLINK3args
;
589 int rpc_nfs_readlink_async(struct rpc_context
*rpc
, rpc_cb cb
, struct READLINK3args
*args
, void *private_data
);
596 * 0 : The call was initiated. The callback will be invoked when the call completes.
597 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
599 * When the callback is invoked, status indicates the result:
600 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
601 * data is SYMLINK3res *
602 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
603 * data is the error string.
604 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
608 int rpc_nfs_symlink_async(struct rpc_context
*rpc
, rpc_cb cb
, struct SYMLINK3args
*args
, void *private_data
);
614 * 0 : The call was initiated. The callback will be invoked when the call completes.
615 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
617 * When the callback is invoked, status indicates the result:
618 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
619 * data is RENAME3res *
620 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
621 * data is the error string.
622 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
625 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
);
632 * 0 : The call was initiated. The callback will be invoked when the call completes.
633 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
635 * When the callback is invoked, status indicates the result:
636 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
638 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
639 * data is the error string.
640 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
643 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
);
651 char *rquotastat_to_str(int error
);
652 int rquotastat_to_errno(int error
);
657 * 0 : The call was initiated. The callback will be invoked when the call completes.
658 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
660 * When the callback is invoked, status indicates the result:
661 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
663 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
664 * data is the error string.
665 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
668 int rpc_rquota1_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
671 * Call RQUOTA1/GETQUOTA
673 * 0 : The call was initiated. The callback will be invoked when the call completes.
674 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
676 * When the callback is invoked, status indicates the result:
677 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
678 * data is a RQUOTA1res structure.
679 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
680 * data is the error string.
681 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
684 int rpc_rquota1_getquota_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, int uid
, void *private_data
);
687 * Call RQUOTA1/GETACTIVEQUOTA
689 * 0 : The call was initiated. The callback will be invoked when the call completes.
690 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
692 * When the callback is invoked, status indicates the result:
693 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
694 * data is a RQUOTA1res structure.
695 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
696 * data is the error string.
697 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
700 int rpc_rquota1_getactivequota_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, int uid
, void *private_data
);
708 * 0 : The call was initiated. The callback will be invoked when the call completes.
709 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
711 * When the callback is invoked, status indicates the result:
712 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
714 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
715 * data is the error string.
716 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
719 int rpc_rquota2_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
722 * Call RQUOTA2/GETQUOTA
724 * 0 : The call was initiated. The callback will be invoked when the call completes.
725 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
727 * When the callback is invoked, status indicates the result:
728 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
729 * data is a RQUOTA1res structure.
730 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
731 * data is the error string.
732 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
735 int rpc_rquota2_getquota_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, int type
, int uid
, void *private_data
);
738 * Call RQUOTA2/GETACTIVEQUOTA
740 * 0 : The call was initiated. The callback will be invoked when the call completes.
741 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
743 * When the callback is invoked, status indicates the result:
744 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
745 * data is a RQUOTA1res structure.
746 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
747 * data is the error string.
748 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
751 int rpc_rquota2_getactivequota_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, int type
, int uid
, void *private_data
);
764 * Call the NULL procedure for the NFSACL
767 * 0 : The call was initiated. The callback will be invoked when the call completes.
768 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
770 * When the callback is invoked, status indicates the result:
771 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
773 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
774 * data is the error string.
775 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
778 int rpc_nfsacl_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
784 * 0 : The call was initiated. The callback will be invoked when the call completes.
785 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
787 * When the callback is invoked, status indicates the result:
788 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
789 * data is a GETACL3res pointer
790 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
791 * data is the error string.
792 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
796 int rpc_nfsacl_getacl_async(struct rpc_context
*rpc
, rpc_cb cb
, struct GETACL3args
*args
, void *private_data
);
804 * 0 : The call was initiated. The callback will be invoked when the call completes.
805 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
807 * When the callback is invoked, status indicates the result:
808 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
809 * data is a SETACL3res pointer
810 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
811 * data is the error string.
812 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
816 int rpc_nfsacl_setacl_async(struct rpc_context
*rpc
, rpc_cb cb
, struct SETACL3args
*args
, void *private_data
);
824 char *nlmstat4_to_str(int stat
);
828 * Call the NULL procedure for the NLM protocol
831 * 0 : The call was initiated. The callback will be invoked when the call completes.
832 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
834 * When the callback is invoked, status indicates the result:
835 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
837 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
838 * data is the error string.
839 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
842 int rpc_nlm4_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
846 * Call the TEST procedure for the NLM protocol
849 * 0 : The call was initiated. The callback will be invoked when the call completes.
850 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
852 * When the callback is invoked, status indicates the result:
853 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
854 * data is NLM4_TESTres
855 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
856 * data is the error string.
857 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
860 struct NLM4_TESTargs
;
861 int rpc_nlm4_test_async(struct rpc_context
*rpc
, rpc_cb cb
, struct NLM4_TESTargs
*args
, void *private_data
);
865 * Call the LOCK procedure for the NLM protocol
868 * 0 : The call was initiated. The callback will be invoked when the call completes.
869 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
871 * When the callback is invoked, status indicates the result:
872 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
873 * data is NLM4_LOCKres
874 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
875 * data is the error string.
876 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
879 struct NLM4_LOCKargs
;
880 int rpc_nlm4_lock_async(struct rpc_context
*rpc
, rpc_cb cb
, struct NLM4_LOCKargs
*args
, void *private_data
);
884 * Call the CANCEL procedure for the NLM protocol
887 * 0 : The call was initiated. The callback will be invoked when the call completes.
888 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
890 * When the callback is invoked, status indicates the result:
891 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
892 * data is NLM4_CANCres
893 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
894 * data is the error string.
895 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
898 struct NLM4_CANCargs
;
899 int rpc_nlm4_cancel_async(struct rpc_context
*rpc
, rpc_cb cb
, struct NLM4_CANCargs
*args
, void *private_data
);
903 * Call the UNLOCK procedure for the NLM protocol
906 * 0 : The call was initiated. The callback will be invoked when the call completes.
907 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
909 * When the callback is invoked, status indicates the result:
910 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
911 * data is NLM4_UNLOCKres
912 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
913 * data is the error string.
914 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
917 struct NLM4_UNLOCKargs
;
918 int rpc_nlm4_unlock_async(struct rpc_context
*rpc
, rpc_cb cb
, struct NLM4_UNLOCKargs
*args
, void *private_data
);