8503e0be98805d725c8287e63fa88e491a050e26
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_
33 struct rpc_context
*rpc_init_context(void);
34 void rpc_destroy_context(struct rpc_context
*rpc
);
36 void rpc_set_auth(struct rpc_context
*rpc
, struct AUTH
*auth
);
38 int rpc_get_fd(struct rpc_context
*rpc
);
39 int rpc_which_events(struct rpc_context
*rpc
);
40 int rpc_service(struct rpc_context
*rpc
, int revents
);
41 char *rpc_get_error(struct rpc_context
*rpc
);
42 int rpc_queue_length(struct rpc_context
*rpc
);
44 /* Utility function to get an RPC context from a NFS context. Useful for doing low level NFSACL
45 * calls on a NFS context.
47 struct rpc_context
*nfs_get_rpc_context(struct nfs_context
*nfs
);
49 /* This function returns the nfs_fh3 structure from a nfsfh structure.
50 This allows to use a file onened with nfs_open() together with low-level
51 rpc functions that thake a nfs filehandle
53 struct nfs_fh3
*nfs_get_fh(struct nfsfh
*nfsfh
);
55 #define RPC_STATUS_SUCCESS 0
56 #define RPC_STATUS_ERROR 1
57 #define RPC_STATUS_CANCEL 2
60 * Async connection to the tcp port at server:port.
62 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
63 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
65 * When the callback is invoked, status indicates the result:
66 * RPC_STATUS_SUCCESS : The tcp connection was successfully established.
68 * RPC_STATUS_ERROR : The connection failed to establish.
69 * data is the erro string.
70 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
73 int rpc_connect_async(struct rpc_context
*rpc
, const char *server
, int port
, rpc_cb cb
, void *private_data
);
75 * When disconnecting a connection in flight. All commands in flight will be called with the callback
76 * and status RPC_STATUS_ERROR. Data will be the error string for the disconnection.
78 int rpc_disconnect(struct rpc_context
*rpc
, char *error
);
86 * Call PORTMAPPER/NULL
88 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
89 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
91 * When the callback is invoked, status indicates the result:
92 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
94 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
95 * data is the error string.
96 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
99 int rpc_pmap_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
103 * Call PORTMAPPER/GETPORT.
105 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
106 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
108 * When the callback is invoked, status indicates the result:
109 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
110 * data is a (uint32_t *), containing the port returned.
111 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
112 * data is the error string.
113 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
116 int rpc_pmap_getport_async(struct rpc_context
*rpc
, int program
, int version
, int protocol
, rpc_cb cb
, void *private_data
);
119 * Call PORTMAPPER/SET
121 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
122 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
124 * When the callback is invoked, status indicates the result:
125 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
126 * data is a (uint32_t *), containing status
127 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
128 * data is the error string.
129 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
132 int rpc_pmap_set_async(struct rpc_context
*rpc
, int program
, int version
, int protocol
, int port
, rpc_cb cb
, void *private_data
);
135 * Call PORTMAPPER/UNSET
137 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
138 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
140 * When the callback is invoked, status indicates the result:
141 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
142 * data is a (uint32_t *), containing status
143 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
144 * data is the error string.
145 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
148 int rpc_pmap_unset_async(struct rpc_context
*rpc
, int program
, int version
, int protocol
, int port
, rpc_cb cb
, void *private_data
);
151 * Call PORTMAPPER/CALLIT.
153 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
154 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
156 * When the callback is invoked, status indicates the result:
157 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon
158 * data is a 'pmap_call_result' pointer.
159 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
160 * data is the error string.
161 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
164 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
);
169 char *mountstat3_to_str(int stat
);
170 int mountstat3_to_errno(int error
);
175 * 0 : The call was initiated. The callback will be invoked when the call completes.
176 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
178 * When the callback is invoked, status indicates the result:
179 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
181 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
182 * data is the error string.
183 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
186 int rpc_mount_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
191 * 0 : The call was initiated. The callback will be invoked when the call completes.
192 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
194 * When the callback is invoked, status indicates the result:
195 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
196 * data is union mountres3.
197 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
198 * data is the error string.
199 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
202 int rpc_mount_mnt_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, void *private_data
);
207 * 0 : The call was initiated. The callback will be invoked when the call completes.
208 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
210 * When the callback is invoked, status indicates the result:
211 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
212 * data is a mountlist.
213 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
214 * data is the error string.
215 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
218 int rpc_mount_dump_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
223 * 0 : The call was initiated. The callback will be invoked when the call completes.
224 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
226 * When the callback is invoked, status indicates the result:
227 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
229 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
230 * data is the error string.
231 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
234 int rpc_mount_umnt_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, void *private_data
);
239 * 0 : The call was initiated. The callback will be invoked when the call completes.
240 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
242 * When the callback is invoked, status indicates the result:
243 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
245 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
246 * data is the error string.
247 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
250 int rpc_mount_umntall_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
254 * NOTE: You must include 'libnfs-raw-mount.h' to get the definitions of the
255 * returned structures.
258 * 0 : The call was initiated. The callback will be invoked when the call completes.
259 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
261 * When the callback is invoked, status indicates the result:
262 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
263 * data is a pointer to an exports pointer:
264 * exports export = *(exports *)data;
265 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
266 * data is the error string.
267 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
270 int rpc_mount_export_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
279 char *nfsstat3_to_str(int error
);
280 int nfsstat3_to_errno(int error
);
285 * 0 : The call was initiated. The callback will be invoked when the call completes.
286 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
288 * When the callback is invoked, status indicates the result:
289 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
291 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
292 * data is the error string.
293 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
296 int rpc_nfs_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
301 * 0 : The call was initiated. The callback will be invoked when the call completes.
302 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
304 * When the callback is invoked, status indicates the result:
305 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
306 * data is GETATTR3res
307 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
308 * data is the error string.
309 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
312 int rpc_nfs_getattr_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, void *private_data
);
317 * 0 : The call was initiated. The callback will be invoked when the call completes.
318 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
320 * When the callback is invoked, status indicates the result:
321 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
323 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
324 * data is the error string.
325 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
328 int rpc_nfs_lookup_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, char *name
, void *private_data
);
333 * 0 : The call was initiated. The callback will be invoked when the call completes.
334 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
336 * When the callback is invoked, status indicates the result:
337 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
339 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
340 * data is the error string.
341 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
344 int rpc_nfs_access_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, int access
, void *private_data
);
349 * 0 : The call was initiated. The callback will be invoked when the call completes.
350 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
352 * When the callback is invoked, status indicates the result:
353 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
355 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
356 * data is the error string.
357 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
360 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
);
365 * 0 : The call was initiated. The callback will be invoked when the call completes.
366 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
368 * When the callback is invoked, status indicates the result:
369 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
370 * data is WRITE3res *
371 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
372 * data is the error string.
373 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
376 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
);
381 * 0 : The call was initiated. The callback will be invoked when the call completes.
382 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
384 * When the callback is invoked, status indicates the result:
385 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
386 * data is COMMIT3res *
387 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
388 * data is the error string.
389 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
392 int rpc_nfs_commit_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, void *private_data
);
398 * 0 : The call was initiated. The callback will be invoked when the call completes.
399 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
401 * When the callback is invoked, status indicates the result:
402 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
403 * data is SETATTR3res *
404 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
405 * data is the error string.
406 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
410 int rpc_nfs_setattr_async(struct rpc_context
*rpc
, rpc_cb cb
, struct SETATTR3args
*args
, void *private_data
);
417 * 0 : The call was initiated. The callback will be invoked when the call completes.
418 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
420 * When the callback is invoked, status indicates the result:
421 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
422 * data is MKDIR3res *
423 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
424 * data is the error string.
425 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
429 int rpc_nfs_mkdir_async(struct rpc_context
*rpc
, rpc_cb cb
, struct MKDIR3args
*args
, void *private_data
);
438 * 0 : The call was initiated. The callback will be invoked when the call completes.
439 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
441 * When the callback is invoked, status indicates the result:
442 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
443 * data is RMDIR3res *
444 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
445 * data is the error string.
446 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
449 int rpc_nfs_rmdir_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, char *dir
, void *private_data
);
457 * 0 : The call was initiated. The callback will be invoked when the call completes.
458 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
460 * When the callback is invoked, status indicates the result:
461 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
462 * data is CREATE3res *
463 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
464 * data is the error string.
465 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
469 int rpc_nfs_create_async(struct rpc_context
*rpc
, rpc_cb cb
, struct CREATE3args
*args
, void *private_data
);
475 * 0 : The call was initiated. The callback will be invoked when the call completes.
476 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
478 * When the callback is invoked, status indicates the result:
479 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
480 * data is MKNOD3res *
481 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
482 * data is the error string.
483 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
486 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
);
492 * 0 : The call was initiated. The callback will be invoked when the call completes.
493 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
495 * When the callback is invoked, status indicates the result:
496 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
497 * data is REMOVE3res *
498 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
499 * data is the error string.
500 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
503 int rpc_nfs_remove_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, char *name
, void *private_data
);
510 * 0 : The call was initiated. The callback will be invoked when the call completes.
511 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
513 * When the callback is invoked, status indicates the result:
514 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
515 * data is READDIR3res *
516 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
517 * data is the error string.
518 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
521 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
);
524 * Call NFS/READDIRPLUS
526 * 0 : The call was initiated. The callback will be invoked when the call completes.
527 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
529 * When the callback is invoked, status indicates the result:
530 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
531 * data is READDIRPLUS3res *
532 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
533 * data is the error string.
534 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
537 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
);
542 * 0 : The call was initiated. The callback will be invoked when the call completes.
543 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
545 * When the callback is invoked, status indicates the result:
546 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
548 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
549 * data is the error string.
550 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
553 int rpc_nfs_fsstat_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, void *private_data
);
560 * 0 : The call was initiated. The callback will be invoked when the call completes.
561 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
563 * When the callback is invoked, status indicates the result:
564 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
566 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
567 * data is the error string.
568 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
571 int rpc_nfs_fsinfo_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, void *private_data
);
578 * 0 : The call was initiated. The callback will be invoked when the call completes.
579 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
581 * When the callback is invoked, status indicates the result:
582 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
583 * data is READLINK3res *
584 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
585 * data is the error string.
586 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
589 struct READLINK3args
;
590 int rpc_nfs_readlink_async(struct rpc_context
*rpc
, rpc_cb cb
, struct READLINK3args
*args
, void *private_data
);
597 * 0 : The call was initiated. The callback will be invoked when the call completes.
598 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
600 * When the callback is invoked, status indicates the result:
601 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
602 * data is SYMLINK3res *
603 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
604 * data is the error string.
605 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
609 int rpc_nfs_symlink_async(struct rpc_context
*rpc
, rpc_cb cb
, struct SYMLINK3args
*args
, void *private_data
);
615 * 0 : The call was initiated. The callback will be invoked when the call completes.
616 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
618 * When the callback is invoked, status indicates the result:
619 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
620 * data is RENAME3res *
621 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
622 * data is the error string.
623 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
626 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
);
633 * 0 : The call was initiated. The callback will be invoked when the call completes.
634 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
636 * When the callback is invoked, status indicates the result:
637 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
639 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
640 * data is the error string.
641 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
644 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
);
652 char *rquotastat_to_str(int error
);
653 int rquotastat_to_errno(int error
);
658 * 0 : The call was initiated. The callback will be invoked when the call completes.
659 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
661 * When the callback is invoked, status indicates the result:
662 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
664 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
665 * data is the error string.
666 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
669 int rpc_rquota1_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
672 * Call RQUOTA1/GETQUOTA
674 * 0 : The call was initiated. The callback will be invoked when the call completes.
675 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
677 * When the callback is invoked, status indicates the result:
678 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
679 * data is a RQUOTA1res structure.
680 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
681 * data is the error string.
682 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
685 int rpc_rquota1_getquota_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, int uid
, void *private_data
);
688 * Call RQUOTA1/GETACTIVEQUOTA
690 * 0 : The call was initiated. The callback will be invoked when the call completes.
691 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
693 * When the callback is invoked, status indicates the result:
694 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
695 * data is a RQUOTA1res structure.
696 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
697 * data is the error string.
698 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
701 int rpc_rquota1_getactivequota_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, int uid
, void *private_data
);
709 * 0 : The call was initiated. The callback will be invoked when the call completes.
710 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
712 * When the callback is invoked, status indicates the result:
713 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
715 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
716 * data is the error string.
717 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
720 int rpc_rquota2_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
723 * Call RQUOTA2/GETQUOTA
725 * 0 : The call was initiated. The callback will be invoked when the call completes.
726 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
728 * When the callback is invoked, status indicates the result:
729 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
730 * data is a RQUOTA1res structure.
731 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
732 * data is the error string.
733 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
736 int rpc_rquota2_getquota_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, int type
, int uid
, void *private_data
);
739 * Call RQUOTA2/GETACTIVEQUOTA
741 * 0 : The call was initiated. The callback will be invoked when the call completes.
742 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
744 * When the callback is invoked, status indicates the result:
745 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
746 * data is a RQUOTA1res structure.
747 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
748 * data is the error string.
749 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
752 int rpc_rquota2_getactivequota_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, int type
, int uid
, void *private_data
);
765 * Call the NULL procedure for the NFSACL
768 * 0 : The call was initiated. The callback will be invoked when the call completes.
769 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
771 * When the callback is invoked, status indicates the result:
772 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
774 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
775 * data is the error string.
776 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
779 int rpc_nfsacl_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
785 * 0 : The call was initiated. The callback will be invoked when the call completes.
786 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
788 * When the callback is invoked, status indicates the result:
789 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
790 * data is a GETACL3res pointer
791 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
792 * data is the error string.
793 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
797 int rpc_nfsacl_getacl_async(struct rpc_context
*rpc
, rpc_cb cb
, struct GETACL3args
*args
, void *private_data
);
805 * 0 : The call was initiated. The callback will be invoked when the call completes.
806 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
808 * When the callback is invoked, status indicates the result:
809 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
810 * data is a SETACL3res pointer
811 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
812 * data is the error string.
813 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
817 int rpc_nfsacl_setacl_async(struct rpc_context
*rpc
, rpc_cb cb
, struct SETACL3args
*args
, void *private_data
);
825 char *nlmstat4_to_str(int stat
);
829 * Call the NULL procedure for the NLM protocol
832 * 0 : The call was initiated. The callback will be invoked when the call completes.
833 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
835 * When the callback is invoked, status indicates the result:
836 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
838 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
839 * data is the error string.
840 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
843 int rpc_nlm4_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
847 * Call the TEST procedure for the NLM protocol
850 * 0 : The call was initiated. The callback will be invoked when the call completes.
851 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
853 * When the callback is invoked, status indicates the result:
854 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
855 * data is NLM4_TESTres
856 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
857 * data is the error string.
858 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
861 struct NLM4_TESTargs
;
862 int rpc_nlm4_test_async(struct rpc_context
*rpc
, rpc_cb cb
, struct NLM4_TESTargs
*args
, void *private_data
);
866 * Call the LOCK procedure for the NLM protocol
869 * 0 : The call was initiated. The callback will be invoked when the call completes.
870 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
872 * When the callback is invoked, status indicates the result:
873 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
874 * data is NLM4_LOCKres
875 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
876 * data is the error string.
877 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
880 struct NLM4_LOCKargs
;
881 int rpc_nlm4_lock_async(struct rpc_context
*rpc
, rpc_cb cb
, struct NLM4_LOCKargs
*args
, void *private_data
);
885 * Call the CANCEL procedure for the NLM protocol
888 * 0 : The call was initiated. The callback will be invoked when the call completes.
889 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
891 * When the callback is invoked, status indicates the result:
892 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
893 * data is NLM4_CANCres
894 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
895 * data is the error string.
896 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
899 struct NLM4_CANCargs
;
900 int rpc_nlm4_cancel_async(struct rpc_context
*rpc
, rpc_cb cb
, struct NLM4_CANCargs
*args
, void *private_data
);
904 * Call the UNLOCK procedure for the NLM protocol
907 * 0 : The call was initiated. The callback will be invoked when the call completes.
908 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
910 * When the callback is invoked, status indicates the result:
911 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
912 * data is NLM4_UNLOCKres
913 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
914 * data is the error string.
915 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
918 struct NLM4_UNLOCKargs
;
919 int rpc_nlm4_unlock_async(struct rpc_context
*rpc
, rpc_cb cb
, struct NLM4_UNLOCKargs
*args
, void *private_data
);