d13aeaa3d21abced087627f79950020fb2f7ea98
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 /* Control what the next XID value to be used on the context will be.
57 This can be used when multiple contexts are used to the same server
58 to avoid that the two contexts have xid collissions.
60 void rpc_set_next_xid(struct rpc_context
*rpc
, uint32_t xid
);
62 #define RPC_STATUS_SUCCESS 0
63 #define RPC_STATUS_ERROR 1
64 #define RPC_STATUS_CANCEL 2
67 * Async connection to the tcp port at server:port.
69 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
70 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
72 * When the callback is invoked, status indicates the result:
73 * RPC_STATUS_SUCCESS : The tcp connection was successfully established.
75 * RPC_STATUS_ERROR : The connection failed to establish.
76 * data is the erro string.
77 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
80 int rpc_connect_async(struct rpc_context
*rpc
, const char *server
, int port
, rpc_cb cb
, void *private_data
);
82 * Async function to connect to a specific RPC program/version
84 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
85 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
87 * When the callback is invoked, status indicates the result:
88 * RPC_STATUS_SUCCESS : The tcp connection was successfully established.
90 * RPC_STATUS_ERROR : The connection failed to establish.
91 * data is the erro string.
92 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
95 int rpc_connect_program_async(struct rpc_context
*rpc
, char *server
, int program
, int version
, rpc_cb cb
, void *private_data
);
97 * When disconnecting a connection in flight. All commands in flight will be called with the callback
98 * and status RPC_STATUS_ERROR. Data will be the error string for the disconnection.
100 int rpc_disconnect(struct rpc_context
*rpc
, char *error
);
108 * Call PORTMAPPER/NULL
110 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
111 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
113 * When the callback is invoked, status indicates the result:
114 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
116 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
117 * data is the error string.
118 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
121 EXTERN
int rpc_pmap_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
125 * Call PORTMAPPER/GETPORT.
127 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
128 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
130 * When the callback is invoked, status indicates the result:
131 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
132 * data is a (uint32_t *), containing the port returned.
133 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
134 * data is the error string.
135 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
138 EXTERN
int rpc_pmap_getport_async(struct rpc_context
*rpc
, int program
, int version
, int protocol
, rpc_cb cb
, void *private_data
);
141 * Call PORTMAPPER/SET
143 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
144 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
146 * When the callback is invoked, status indicates the result:
147 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
148 * data is a (uint32_t *), containing status
149 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
150 * data is the error string.
151 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
154 EXTERN
int rpc_pmap_set_async(struct rpc_context
*rpc
, int program
, int version
, int protocol
, int port
, rpc_cb cb
, void *private_data
);
157 * Call PORTMAPPER/UNSET
159 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
160 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
162 * When the callback is invoked, status indicates the result:
163 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
164 * data is a (uint32_t *), containing status
165 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
166 * data is the error string.
167 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
170 EXTERN
int rpc_pmap_unset_async(struct rpc_context
*rpc
, int program
, int version
, int protocol
, int port
, rpc_cb cb
, void *private_data
);
173 * Call PORTMAPPER/CALLIT.
175 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
176 * <0 : An error occured when trying to set up the connection. 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 portmapper daemon
180 * data is a 'pmap_call_result' pointer.
181 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
182 * data is the error string.
183 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
186 EXTERN
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
);
191 char *mountstat3_to_str(int stat
);
192 int mountstat3_to_errno(int error
);
197 * 0 : The call was initiated. The callback will be invoked when the call completes.
198 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
200 * When the callback is invoked, status indicates the result:
201 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
203 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
204 * data is the error string.
205 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
208 EXTERN
int rpc_mount_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
213 * 0 : The call was initiated. The callback will be invoked when the call completes.
214 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
216 * When the callback is invoked, status indicates the result:
217 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
218 * data is union mountres3.
219 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
220 * data is the error string.
221 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
224 EXTERN
int rpc_mount_mnt_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, void *private_data
);
229 * 0 : The call was initiated. The callback will be invoked when the call completes.
230 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
232 * When the callback is invoked, status indicates the result:
233 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
234 * data is a mountlist.
235 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
236 * data is the error string.
237 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
240 EXTERN
int rpc_mount_dump_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
245 * 0 : The call was initiated. The callback will be invoked when the call completes.
246 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
248 * When the callback is invoked, status indicates the result:
249 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
251 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
252 * data is the error string.
253 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
256 EXTERN
int rpc_mount_umnt_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, void *private_data
);
261 * 0 : The call was initiated. The callback will be invoked when the call completes.
262 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
264 * When the callback is invoked, status indicates the result:
265 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
267 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
268 * data is the error string.
269 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
272 EXTERN
int rpc_mount_umntall_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
276 * NOTE: You must include 'libnfs-raw-mount.h' to get the definitions of the
277 * returned structures.
280 * 0 : The call was initiated. The callback will be invoked when the call completes.
281 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
283 * When the callback is invoked, status indicates the result:
284 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
285 * data is a pointer to an exports pointer:
286 * exports export = *(exports *)data;
287 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
288 * data is the error string.
289 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
292 EXTERN
int rpc_mount_export_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
301 char *nfsstat3_to_str(int error
);
302 int nfsstat3_to_errno(int error
);
307 * 0 : The call was initiated. The callback will be invoked when the call completes.
308 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
310 * When the callback is invoked, status indicates the result:
311 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
313 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
314 * data is the error string.
315 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
318 EXTERN
int rpc_nfs3_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
319 EXTERN
int rpc_nfs_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
324 * 0 : The call was initiated. The callback will be invoked when the call completes.
325 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
327 * When the callback is invoked, status indicates the result:
328 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
329 * data is GETATTR3res
330 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
331 * data is the error string.
332 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
336 EXTERN
int rpc_nfs3_getattr_async(struct rpc_context
*rpc
, rpc_cb cb
, struct GETATTR3args
*args
, void *private_data
);
337 EXTERN
int rpc_nfs_getattr_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, void *private_data
);
342 * 0 : The call was initiated. The callback will be invoked when the call completes.
343 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
345 * When the callback is invoked, status indicates the result:
346 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
347 * data is PATHCONF3res
348 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
349 * data is the error string.
350 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
353 struct PATHCONF3args
;
354 EXTERN
int rpc_nfs3_pathconf_async(struct rpc_context
*rpc
, rpc_cb cb
, struct PATHCONF3args
*args
, void *private_data
);
355 EXTERN
int rpc_nfs_pathconf_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, void *private_data
);
360 * 0 : The call was initiated. The callback will be invoked when the call completes.
361 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
363 * When the callback is invoked, status indicates the result:
364 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
366 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
367 * data is the error string.
368 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
372 EXTERN
int rpc_nfs3_lookup_async(struct rpc_context
*rpc
, rpc_cb cb
, struct LOOKUP3args
*args
, void *private_data
);
373 EXTERN
int rpc_nfs_lookup_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, char *name
, void *private_data
);
378 * 0 : The call was initiated. The callback will be invoked when the call completes.
379 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
381 * When the callback is invoked, status indicates the result:
382 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
384 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
385 * data is the error string.
386 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
390 EXTERN
int rpc_nfs3_access_async(struct rpc_context
*rpc
, rpc_cb cb
, struct ACCESS3args
*args
, void *private_data
);
391 EXTERN
int rpc_nfs_access_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, int access
, void *private_data
);
396 * 0 : The call was initiated. The callback will be invoked when the call completes.
397 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
399 * When the callback is invoked, status indicates the result:
400 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
402 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
403 * data is the error string.
404 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
408 EXTERN
int rpc_nfs3_read_async(struct rpc_context
*rpc
, rpc_cb cb
, struct READ3args
*args
, void *private_data
);
409 EXTERN
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
);
414 * 0 : The call was initiated. The callback will be invoked when the call completes.
415 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
417 * When the callback is invoked, status indicates the result:
418 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
419 * data is WRITE3res *
420 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
421 * data is the error string.
422 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
426 EXTERN
int rpc_nfs3_write_async(struct rpc_context
*rpc
, rpc_cb cb
, struct WRITE3args
*args
, void *private_data
);
427 EXTERN
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
);
432 * 0 : The call was initiated. The callback will be invoked when the call completes.
433 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
435 * When the callback is invoked, status indicates the result:
436 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
437 * data is COMMIT3res *
438 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
439 * data is the error string.
440 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
444 EXTERN
int rpc_nfs3_commit_async(struct rpc_context
*rpc
, rpc_cb cb
, struct COMMIT3args
*args
, void *private_data
);
445 EXTERN
int rpc_nfs_commit_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, void *private_data
);
450 * 0 : The call was initiated. The callback will be invoked when the call completes.
451 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
453 * When the callback is invoked, status indicates the result:
454 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
455 * data is SETATTR3res *
456 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
457 * data is the error string.
458 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
462 EXTERN
int rpc_nfs3_setattr_async(struct rpc_context
*rpc
, rpc_cb cb
, struct SETATTR3args
*args
, void *private_data
);
463 EXTERN
int rpc_nfs_setattr_async(struct rpc_context
*rpc
, rpc_cb cb
, struct SETATTR3args
*args
, void *private_data
);
468 * 0 : The call was initiated. The callback will be invoked when the call completes.
469 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
471 * When the callback is invoked, status indicates the result:
472 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
473 * data is MKDIR3res *
474 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
475 * data is the error string.
476 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
480 EXTERN
int rpc_nfs3_mkdir_async(struct rpc_context
*rpc
, rpc_cb cb
, struct MKDIR3args
*args
, void *private_data
);
481 EXTERN
int rpc_nfs_mkdir_async(struct rpc_context
*rpc
, rpc_cb cb
, struct MKDIR3args
*args
, void *private_data
);
486 * 0 : The call was initiated. The callback will be invoked when the call completes.
487 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
489 * When the callback is invoked, status indicates the result:
490 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
491 * data is RMDIR3res *
492 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
493 * data is the error string.
494 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
498 EXTERN
int rpc_nfs3_rmdir_async(struct rpc_context
*rpc
, rpc_cb cb
, struct RMDIR3args
*args
, void *private_data
);
499 EXTERN
int rpc_nfs_rmdir_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, char *dir
, void *private_data
);
504 * 0 : The call was initiated. The callback will be invoked when the call completes.
505 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
507 * When the callback is invoked, status indicates the result:
508 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
509 * data is CREATE3res *
510 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
511 * data is the error string.
512 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
516 EXTERN
int rpc_nfs3_create_async(struct rpc_context
*rpc
, rpc_cb cb
, struct CREATE3args
*args
, void *private_data
);
517 EXTERN
int rpc_nfs_create_async(struct rpc_context
*rpc
, rpc_cb cb
, struct CREATE3args
*args
, void *private_data
);
522 * 0 : The call was initiated. The callback will be invoked when the call completes.
523 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
525 * When the callback is invoked, status indicates the result:
526 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
527 * data is MKNOD3res *
528 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
529 * data is the error string.
530 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
534 EXTERN
int rpc_nfs3_mknod_async(struct rpc_context
*rpc
, rpc_cb cb
, struct MKNOD3args
*args
, void *private_data
);
535 EXTERN
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
);
540 * 0 : The call was initiated. The callback will be invoked when the call completes.
541 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
543 * When the callback is invoked, status indicates the result:
544 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
545 * data is REMOVE3res *
546 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
547 * data is the error string.
548 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
552 EXTERN
int rpc_nfs3_remove_async(struct rpc_context
*rpc
, rpc_cb cb
, struct REMOVE3args
*args
, void *private_data
);
553 EXTERN
int rpc_nfs_remove_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, char *name
, void *private_data
);
558 * 0 : The call was initiated. The callback will be invoked when the call completes.
559 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
561 * When the callback is invoked, status indicates the result:
562 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
563 * data is READDIR3res *
564 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
565 * data is the error string.
566 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
570 EXTERN
int rpc_nfs3_readdir_async(struct rpc_context
*rpc
, rpc_cb cb
, struct READDIR3args
*args
, void *private_data
);
571 EXTERN
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
);
574 * Call NFS3/READDIRPLUS
576 * 0 : The call was initiated. The callback will be invoked when the call completes.
577 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
579 * When the callback is invoked, status indicates the result:
580 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
581 * data is READDIRPLUS3res *
582 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
583 * data is the error string.
584 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
587 struct READDIRPLUS3args
;
588 EXTERN
int rpc_nfs3_readdirplus_async(struct rpc_context
*rpc
, rpc_cb cb
, struct READDIRPLUS3args
*args
, void *private_data
);
589 EXTERN
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
);
594 * 0 : The call was initiated. The callback will be invoked when the call completes.
595 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
597 * When the callback is invoked, status indicates the result:
598 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
600 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
601 * data is the error string.
602 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
606 EXTERN
int rpc_nfs3_fsstat_async(struct rpc_context
*rpc
, rpc_cb cb
, struct FSSTAT3args
*args
, void *private_data
);
607 EXTERN
int rpc_nfs_fsstat_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, void *private_data
);
612 * 0 : The call was initiated. The callback will be invoked when the call completes.
613 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
615 * When the callback is invoked, status indicates the result:
616 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
618 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
619 * data is the error string.
620 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
624 EXTERN
int rpc_nfs3_fsinfo_async(struct rpc_context
*rpc
, rpc_cb cb
, struct FSINFO3args
*args
, void *private_data
);
625 EXTERN
int rpc_nfs_fsinfo_async(struct rpc_context
*rpc
, rpc_cb cb
, struct nfs_fh3
*fh
, void *private_data
);
630 * 0 : The call was initiated. The callback will be invoked when the call completes.
631 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
633 * When the callback is invoked, status indicates the result:
634 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
635 * data is READLINK3res *
636 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
637 * data is the error string.
638 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
641 struct READLINK3args
;
642 EXTERN
int rpc_nfs3_readlink_async(struct rpc_context
*rpc
, rpc_cb cb
, struct READLINK3args
*args
, void *private_data
);
643 EXTERN
int rpc_nfs_readlink_async(struct rpc_context
*rpc
, rpc_cb cb
, struct READLINK3args
*args
, void *private_data
);
648 * 0 : The call was initiated. The callback will be invoked when the call completes.
649 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
651 * When the callback is invoked, status indicates the result:
652 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
653 * data is SYMLINK3res *
654 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
655 * data is the error string.
656 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
660 EXTERN
int rpc_nfs3_symlink_async(struct rpc_context
*rpc
, rpc_cb cb
, struct SYMLINK3args
*args
, void *private_data
);
661 EXTERN
int rpc_nfs_symlink_async(struct rpc_context
*rpc
, rpc_cb cb
, struct SYMLINK3args
*args
, void *private_data
);
666 * 0 : The call was initiated. The callback will be invoked when the call completes.
667 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
669 * When the callback is invoked, status indicates the result:
670 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
671 * data is RENAME3res *
672 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
673 * data is the error string.
674 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
678 EXTERN
int rpc_nfs3_rename_async(struct rpc_context
*rpc
, rpc_cb cb
, struct RENAME3args
*args
, void *private_data
);
679 EXTERN
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
);
684 * 0 : The call was initiated. The callback will be invoked when the call completes.
685 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
687 * When the callback is invoked, status indicates the result:
688 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
690 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
691 * data is the error string.
692 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
696 EXTERN
int rpc_nfs3_link_async(struct rpc_context
*rpc
, rpc_cb cb
, struct LINK3args
*args
, void *private_data
);
697 EXTERN
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
);
703 char *rquotastat_to_str(int error
);
704 int rquotastat_to_errno(int error
);
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 EXTERN
int rpc_rquota1_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
723 * Call RQUOTA1/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 EXTERN
int rpc_rquota1_getquota_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, int uid
, void *private_data
);
739 * Call RQUOTA1/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 EXTERN
int rpc_rquota1_getactivequota_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, int uid
, void *private_data
);
760 * 0 : The call was initiated. The callback will be invoked when the call completes.
761 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
763 * When the callback is invoked, status indicates the result:
764 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
766 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
767 * data is the error string.
768 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
771 int rpc_rquota2_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
774 * Call RQUOTA2/GETQUOTA
776 * 0 : The call was initiated. The callback will be invoked when the call completes.
777 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
779 * When the callback is invoked, status indicates the result:
780 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
781 * data is a RQUOTA1res structure.
782 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
783 * data is the error string.
784 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
787 int rpc_rquota2_getquota_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, int type
, int uid
, void *private_data
);
790 * Call RQUOTA2/GETACTIVEQUOTA
792 * 0 : The call was initiated. The callback will be invoked when the call completes.
793 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
795 * When the callback is invoked, status indicates the result:
796 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
797 * data is a RQUOTA1res structure.
798 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
799 * data is the error string.
800 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
803 int rpc_rquota2_getactivequota_async(struct rpc_context
*rpc
, rpc_cb cb
, char *export
, int type
, int uid
, void *private_data
);
816 * Call the NULL procedure for the NFSACL
819 * 0 : The call was initiated. The callback will be invoked when the call completes.
820 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
822 * When the callback is invoked, status indicates the result:
823 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
825 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
826 * data is the error string.
827 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
830 EXTERN
int rpc_nfsacl_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
836 * 0 : The call was initiated. The callback will be invoked when the call completes.
837 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
839 * When the callback is invoked, status indicates the result:
840 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
841 * data is a GETACL3res pointer
842 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
843 * data is the error string.
844 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
848 EXTERN
int rpc_nfsacl_getacl_async(struct rpc_context
*rpc
, rpc_cb cb
, struct GETACL3args
*args
, void *private_data
);
856 * 0 : The call was initiated. The callback will be invoked when the call completes.
857 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
859 * When the callback is invoked, status indicates the result:
860 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
861 * data is a SETACL3res pointer
862 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
863 * data is the error string.
864 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
868 EXTERN
int rpc_nfsacl_setacl_async(struct rpc_context
*rpc
, rpc_cb cb
, struct SETACL3args
*args
, void *private_data
);
876 char *nlmstat4_to_str(int stat
);
880 * Call the NULL procedure for the NLM protocol
883 * 0 : The call was initiated. The callback will be invoked when the call completes.
884 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
886 * When the callback is invoked, status indicates the result:
887 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
889 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
890 * data is the error string.
891 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
894 EXTERN
int rpc_nlm4_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
898 * Call the TEST procedure for the NLM protocol
901 * 0 : The call was initiated. The callback will be invoked when the call completes.
902 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
904 * When the callback is invoked, status indicates the result:
905 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
906 * data is NLM4_TESTres
907 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
908 * data is the error string.
909 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
912 struct NLM4_TESTargs
;
913 EXTERN
int rpc_nlm4_test_async(struct rpc_context
*rpc
, rpc_cb cb
, struct NLM4_TESTargs
*args
, void *private_data
);
917 * Call the LOCK procedure for the NLM protocol
920 * 0 : The call was initiated. The callback will be invoked when the call completes.
921 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
923 * When the callback is invoked, status indicates the result:
924 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
925 * data is NLM4_LOCKres
926 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
927 * data is the error string.
928 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
931 struct NLM4_LOCKargs
;
932 EXTERN
int rpc_nlm4_lock_async(struct rpc_context
*rpc
, rpc_cb cb
, struct NLM4_LOCKargs
*args
, void *private_data
);
936 * Call the CANCEL procedure for the NLM protocol
939 * 0 : The call was initiated. The callback will be invoked when the call completes.
940 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
942 * When the callback is invoked, status indicates the result:
943 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
944 * data is NLM4_CANCres
945 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
946 * data is the error string.
947 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
950 struct NLM4_CANCargs
;
951 EXTERN
int rpc_nlm4_cancel_async(struct rpc_context
*rpc
, rpc_cb cb
, struct NLM4_CANCargs
*args
, void *private_data
);
955 * Call the UNLOCK procedure for the NLM protocol
958 * 0 : The call was initiated. The callback will be invoked when the call completes.
959 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
961 * When the callback is invoked, status indicates the result:
962 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
963 * data is NLM4_UNLOCKres
964 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
965 * data is the error string.
966 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
969 struct NLM4_UNLOCKargs
;
970 EXTERN
int rpc_nlm4_unlock_async(struct rpc_context
*rpc
, rpc_cb cb
, struct NLM4_UNLOCKargs
*args
, void *private_data
);
975 char *nsmstat1_to_str(int stat
);
979 * Call the NULL procedure for the NSM protocol
982 * 0 : The call was initiated. The callback will be invoked when the call completes.
983 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
985 * When the callback is invoked, status indicates the result:
986 * RPC_STATUS_SUCCESS : We got a successful response from the nsm daemon.
988 * RPC_STATUS_ERROR : An error occured when trying to contact the nsm daemon.
989 * data is the error string.
990 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
993 EXTERN
int rpc_nsm1_null_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
997 * Call the STAT procedure for the NSM protocol
1000 * 0 : The call was initiated. The callback will be invoked when the call completes.
1001 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1003 * When the callback is invoked, status indicates the result:
1004 * RPC_STATUS_SUCCESS : We got a successful response from the nsm daemon.
1005 * data is NSM1_STATres
1006 * RPC_STATUS_ERROR : An error occured when trying to contact the nsm daemon.
1007 * data is the error string.
1008 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1011 struct NSM1_STATargs
;
1012 EXTERN
int rpc_nsm1_stat_async(struct rpc_context
*rpc
, rpc_cb cb
, struct NSM1_STATargs
*args
, void *private_data
);
1016 * Call the MON procedure for the NSM protocol
1019 * 0 : The call was initiated. The callback will be invoked when the call completes.
1020 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1022 * When the callback is invoked, status indicates the result:
1023 * RPC_STATUS_SUCCESS : We got a successful response from the nsm daemon.
1024 * data is NSM1_MONres
1025 * RPC_STATUS_ERROR : An error occured when trying to contact the nsm daemon.
1026 * data is the error string.
1027 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1030 struct NSM1_MONargs
;
1031 EXTERN
int rpc_nsm1_mon_async(struct rpc_context
*rpc
, rpc_cb cb
, struct NSM1_MONargs
*args
, void *private_data
);
1035 * Call the UNMON procedure for the NSM protocol
1038 * 0 : The call was initiated. The callback will be invoked when the call completes.
1039 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1041 * When the callback is invoked, status indicates the result:
1042 * RPC_STATUS_SUCCESS : We got a successful response from the nsm daemon.
1043 * data is NSM1_UNMONres
1044 * RPC_STATUS_ERROR : An error occured when trying to contact the nsm daemon.
1045 * data is the error string.
1046 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1049 struct NSM1_UNMONargs
;
1050 EXTERN
int rpc_nsm1_unmon_async(struct rpc_context
*rpc
, rpc_cb cb
, struct NSM1_UNMONargs
*args
, void *private_data
);
1054 * Call the UNMONALL procedure for the NSM protocol
1057 * 0 : The call was initiated. The callback will be invoked when the call completes.
1058 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1060 * When the callback is invoked, status indicates the result:
1061 * RPC_STATUS_SUCCESS : We got a successful response from the nsm daemon.
1062 * data is NSM1_UNMONALLres
1063 * RPC_STATUS_ERROR : An error occured when trying to contact the nsm daemon.
1064 * data is the error string.
1065 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1068 struct NSM1_UNMONALLargs
;
1069 EXTERN
int rpc_nsm1_unmonall_async(struct rpc_context
*rpc
, rpc_cb cb
, struct NSM1_UNMONALLargs
*args
, void *private_data
);
1072 * Call NSM/SIMUCRASH
1073 * Call the SIMUCRASH procedure for the NSM protocol
1076 * 0 : The call was initiated. The callback will be invoked when the call completes.
1077 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1079 * When the callback is invoked, status indicates the result:
1080 * RPC_STATUS_SUCCESS : We got a successful response from the nsm daemon.
1082 * RPC_STATUS_ERROR : An error occured when trying to contact the nsm daemon.
1083 * data is the error string.
1084 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1087 EXTERN
int rpc_nsm1_simucrash_async(struct rpc_context
*rpc
, rpc_cb cb
, void *private_data
);
1091 * Call the NOTIFY procedure for the NSM protocol
1094 * 0 : The call was initiated. The callback will be invoked when the call completes.
1095 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1097 * When the callback is invoked, status indicates the result:
1098 * RPC_STATUS_SUCCESS : We got a successful response from the nsm daemon.
1100 * RPC_STATUS_ERROR : An error occured when trying to contact the nsm daemon.
1101 * data is the error string.
1102 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1105 struct NSM1_NOTIFYargs
;
1106 EXTERN
int rpc_nsm1_notify_async(struct rpc_context
*rpc
, rpc_cb cb
, struct NSM1_NOTIFYargs
*args
, void *private_data
);