libnfs-raw.h: wrap in extern "C" for C++ compatibility
[deb_libnfs.git] / include / nfsc / libnfs-raw.h
... / ...
CommitLineData
1/*
2 Copyright (C) 2010 by Ronnie Sahlberg <ronniesahlberg@gmail.com>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as published by
6 the Free Software Foundation; either version 2.1 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public License
15 along with this program; if not, see <http://www.gnu.org/licenses/>.
16*/
17/*
18 * This is the lowlevel interface to access NFS resources.
19 * Through this interface you have access to the full gamut of nfs and nfs related
20 * protocol as well as the XDR encoded/decoded structures.
21 */
22#ifndef _LIBNFS_RAW_H_
23#define _LIBNFS_RAW_H_
24
25#include <stdint.h>
26#include <nfsc/libnfs-zdr.h>
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32struct rpc_data {
33 int size;
34 unsigned char *data;
35};
36
37struct rpc_context;
38struct rpc_context *rpc_init_context(void);
39void rpc_destroy_context(struct rpc_context *rpc);
40
41void rpc_set_auth(struct rpc_context *rpc, struct AUTH *auth);
42
43int rpc_get_fd(struct rpc_context *rpc);
44int rpc_which_events(struct rpc_context *rpc);
45int rpc_service(struct rpc_context *rpc, int revents);
46char *rpc_get_error(struct rpc_context *rpc);
47int rpc_queue_length(struct rpc_context *rpc);
48
49/* Utility function to get an RPC context from a NFS context. Useful for doing low level NFSACL
50 * calls on a NFS context.
51 */
52struct rpc_context *nfs_get_rpc_context(struct nfs_context *nfs);
53
54/* This function returns the nfs_fh3 structure from a nfsfh structure.
55 This allows to use a file onened with nfs_open() together with low-level
56 rpc functions that thake a nfs filehandle
57*/
58struct nfs_fh3 *nfs_get_fh(struct nfsfh *nfsfh);
59
60/* Control what the next XID value to be used on the context will be.
61 This can be used when multiple contexts are used to the same server
62 to avoid that the two contexts have xid collissions.
63 */
64void rpc_set_next_xid(struct rpc_context *rpc, uint32_t xid);
65
66/* This function can be used to set the file descriptor used for
67 * the RPC context. It is primarily useful when emulating dup2()
68 * and similar or where you want full control of the filedescriptor numbers
69 * used by the rpc socket.
70 *
71 * ...
72 * oldfd = rpc_get_fd(rpc);
73 * dup2(oldfd, newfd);
74 * rpc_set_fd(rpc, newfd);
75 * close(oldfd);
76 * ...
77 */
78void rpc_set_fd(struct rpc_context *rpc, int fd);
79
80#define RPC_STATUS_SUCCESS 0
81#define RPC_STATUS_ERROR 1
82#define RPC_STATUS_CANCEL 2
83
84/*
85 * Async connection to the tcp port at server:port.
86 * Function returns
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.
89 *
90 * When the callback is invoked, status indicates the result:
91 * RPC_STATUS_SUCCESS : The tcp connection was successfully established.
92 * data is NULL.
93 * RPC_STATUS_ERROR : The connection failed to establish.
94 * data is the erro string.
95 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
96 * : data is NULL.
97 */
98int rpc_connect_async(struct rpc_context *rpc, const char *server, int port, rpc_cb cb, void *private_data);
99/*
100 * Async function to connect to a specific RPC program/version
101 * Function returns
102 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
103 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
104 *
105 * When the callback is invoked, status indicates the result:
106 * RPC_STATUS_SUCCESS : The tcp connection was successfully established.
107 * data is NULL.
108 * RPC_STATUS_ERROR : The connection failed to establish.
109 * data is the erro string.
110 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
111 * : data is NULL.
112 */
113int rpc_connect_program_async(struct rpc_context *rpc, char *server, int program, int version, rpc_cb cb, void *private_data);
114/*
115 * When disconnecting a connection in flight. All commands in flight will be called with the callback
116 * and status RPC_STATUS_ERROR. Data will be the error string for the disconnection.
117 */
118int rpc_disconnect(struct rpc_context *rpc, char *error);
119
120
121/*
122 * PORTMAP FUNCTIONS
123 */
124
125/*
126 * Call PORTMAPPER/NULL
127 * Function returns
128 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
129 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
130 *
131 * When the callback is invoked, status indicates the result:
132 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
133 * data is NULL.
134 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
135 * data is the error string.
136 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
137 * data is NULL.
138 */
139EXTERN int rpc_pmap_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
140
141
142/*
143 * Call PORTMAPPER/GETPORT.
144 * Function returns
145 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
146 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
147 *
148 * When the callback is invoked, status indicates the result:
149 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
150 * data is a (uint32_t *), containing the port returned.
151 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
152 * data is the error string.
153 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
154 * data is NULL.
155 */
156EXTERN int rpc_pmap_getport_async(struct rpc_context *rpc, int program, int version, int protocol, rpc_cb cb, void *private_data);
157
158/*
159 * Call PORTMAPPER/SET
160 * Function returns
161 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
162 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
163 *
164 * When the callback is invoked, status indicates the result:
165 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
166 * data is a (uint32_t *), containing status
167 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
168 * data is the error string.
169 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
170 * data is NULL.
171 */
172EXTERN int rpc_pmap_set_async(struct rpc_context *rpc, int program, int version, int protocol, int port, rpc_cb cb, void *private_data);
173
174/*
175 * Call PORTMAPPER/UNSET
176 * Function returns
177 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
178 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
179 *
180 * When the callback is invoked, status indicates the result:
181 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
182 * data is a (uint32_t *), containing status
183 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
184 * data is the error string.
185 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
186 * data is NULL.
187 */
188EXTERN int rpc_pmap_unset_async(struct rpc_context *rpc, int program, int version, int protocol, int port, rpc_cb cb, void *private_data);
189
190/*
191 * Call PORTMAPPER/CALLIT.
192 * Function returns
193 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
194 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
195 *
196 * When the callback is invoked, status indicates the result:
197 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon
198 * data is a 'pmap_call_result' pointer.
199 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
200 * data is the error string.
201 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
202 * data is NULL.
203 */
204EXTERN 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);
205
206/*
207 * MOUNT v3 FUNCTIONS
208 */
209char *mountstat3_to_str(int stat);
210int mountstat3_to_errno(int error);
211
212/*
213 * Call MOUNT3/NULL
214 * Function returns
215 * 0 : The call was initiated. The callback will be invoked when the call completes.
216 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
217 *
218 * When the callback is invoked, status indicates the result:
219 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
220 * data is NULL.
221 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
222 * data is the error string.
223 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
224 * data is NULL.
225 */
226EXTERN int rpc_mount3_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
227EXTERN int rpc_mount_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
228
229/*
230 * Call MOUNT3/MNT
231 * Function returns
232 * 0 : The call was initiated. The callback will be invoked when the call completes.
233 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
234 *
235 * When the callback is invoked, status indicates the result:
236 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
237 * data is union mountres3.
238 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
239 * data is the error string.
240 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
241 * data is NULL.
242 */
243EXTERN int rpc_mount3_mnt_async(struct rpc_context *rpc, rpc_cb cb, char *export, void *private_data);
244EXTERN int rpc_mount_mnt_async(struct rpc_context *rpc, rpc_cb cb, char *export, void *private_data);
245
246/*
247 * Call MOUNT3/DUMP
248 * Function returns
249 * 0 : The call was initiated. The callback will be invoked when the call completes.
250 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
251 *
252 * When the callback is invoked, status indicates the result:
253 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
254 * data is a mountlist.
255 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
256 * data is the error string.
257 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
258 * data is NULL.
259 */
260EXTERN int rpc_mount3_dump_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
261EXTERN int rpc_mount_dump_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
262
263/*
264 * Call MOUNT3/UMNT
265 * Function returns
266 * 0 : The call was initiated. The callback will be invoked when the call completes.
267 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
268 *
269 * When the callback is invoked, status indicates the result:
270 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
271 * data NULL.
272 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
273 * data is the error string.
274 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
275 * data is NULL.
276 */
277EXTERN int rpc_mount3_umnt_async(struct rpc_context *rpc, rpc_cb cb, char *export, void *private_data);
278EXTERN int rpc_mount_umnt_async(struct rpc_context *rpc, rpc_cb cb, char *export, void *private_data);
279
280/*
281 * Call MOUNT3/UMNTALL
282 * Function returns
283 * 0 : The call was initiated. The callback will be invoked when the call completes.
284 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
285 *
286 * When the callback is invoked, status indicates the result:
287 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
288 * data NULL.
289 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
290 * data is the error string.
291 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
292 * data is NULL.
293 */
294EXTERN int rpc_mount3_umntall_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
295EXTERN int rpc_mount_umntall_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
296
297/*
298 * Call MOUNT3/EXPORT
299 * NOTE: You must include 'libnfs-raw-mount.h' to get the definitions of the
300 * returned structures.
301 *
302 * Function returns
303 * 0 : The call was initiated. The callback will be invoked when the call completes.
304 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
305 *
306 * When the callback is invoked, status indicates the result:
307 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
308 * data is a pointer to an exports pointer:
309 * exports export = *(exports *)data;
310 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
311 * data is the error string.
312 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
313 * data is NULL.
314 */
315EXTERN int rpc_mount3_export_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
316EXTERN int rpc_mount_export_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
317
318/*
319 * MOUNT v1 FUNCTIONS (Used with NFSv2)
320 */
321/*
322 * Call MOUNT1/NULL
323 * Function returns
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.
326 *
327 * When the callback is invoked, status indicates the result:
328 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
329 * data is NULL.
330 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
331 * data is the error string.
332 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
333 * data is NULL.
334 */
335EXTERN int rpc_mount1_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
336
337/*
338 * Call MOUNT1/MNT
339 * Function returns
340 * 0 : The call was initiated. The callback will be invoked when the call completes.
341 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
342 *
343 * When the callback is invoked, status indicates the result:
344 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
345 * data is union mountres1.
346 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
347 * data is the error string.
348 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
349 * data is NULL.
350 */
351EXTERN int rpc_mount1_mnt_async(struct rpc_context *rpc, rpc_cb cb, char *export, void *private_data);
352
353/*
354 * Call MOUNT1/DUMP
355 * Function returns
356 * 0 : The call was initiated. The callback will be invoked when the call completes.
357 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
358 *
359 * When the callback is invoked, status indicates the result:
360 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
361 * data is a mountlist.
362 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
363 * data is the error string.
364 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
365 * data is NULL.
366 */
367EXTERN int rpc_mount1_dump_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
368
369/*
370 * Call MOUNT1/UMNT
371 * Function returns
372 * 0 : The call was initiated. The callback will be invoked when the call completes.
373 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
374 *
375 * When the callback is invoked, status indicates the result:
376 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
377 * data NULL.
378 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
379 * data is the error string.
380 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
381 * data is NULL.
382 */
383EXTERN int rpc_mount1_umnt_async(struct rpc_context *rpc, rpc_cb cb, char *export, void *private_data);
384
385/*
386 * Call MOUNT1/UMNTALL
387 * Function returns
388 * 0 : The call was initiated. The callback will be invoked when the call completes.
389 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
390 *
391 * When the callback is invoked, status indicates the result:
392 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
393 * data NULL.
394 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
395 * data is the error string.
396 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
397 * data is NULL.
398 */
399EXTERN int rpc_mount1_umntall_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
400
401/*
402 * Call MOUNT1/EXPORT
403 * NOTE: You must include 'libnfs-raw-mount.h' to get the definitions of the
404 * returned structures.
405 *
406 * Function returns
407 * 0 : The call was initiated. The callback will be invoked when the call completes.
408 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
409 *
410 * When the callback is invoked, status indicates the result:
411 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
412 * data is a pointer to an exports pointer:
413 * exports export = *(exports *)data;
414 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
415 * data is the error string.
416 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
417 * data is NULL.
418 */
419EXTERN int rpc_mount1_export_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
420
421
422/*
423 * NFS v3 FUNCTIONS
424 */
425struct nfs_fh3;
426char *nfsstat3_to_str(int error);
427int nfsstat3_to_errno(int error);
428
429/*
430 * Call NFS3/NULL
431 * Function returns
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.
434 *
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 NULL.
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.
441 * data is NULL.
442 */
443EXTERN int rpc_nfs3_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
444EXTERN int rpc_nfs_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
445
446/*
447 * Call NFS3/GETATTR
448 * Function returns
449 * 0 : The call was initiated. The callback will be invoked when the call completes.
450 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
451 *
452 * When the callback is invoked, status indicates the result:
453 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
454 * data is GETATTR3res
455 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
456 * data is the error string.
457 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
458 * data is NULL.
459 */
460struct GETATTR3args;
461EXTERN int rpc_nfs3_getattr_async(struct rpc_context *rpc, rpc_cb cb, struct GETATTR3args *args, void *private_data);
462EXTERN int rpc_nfs_getattr_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
463
464/*
465 * Call NFS3/PATHCONF
466 * Function returns
467 * 0 : The call was initiated. The callback will be invoked when the call completes.
468 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
469 *
470 * When the callback is invoked, status indicates the result:
471 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
472 * data is PATHCONF3res
473 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
474 * data is the error string.
475 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
476 * data is NULL.
477 */
478struct PATHCONF3args;
479EXTERN int rpc_nfs3_pathconf_async(struct rpc_context *rpc, rpc_cb cb, struct PATHCONF3args *args, void *private_data);
480EXTERN int rpc_nfs_pathconf_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
481
482/*
483 * Call NFS3/LOOKUP
484 * Function returns
485 * 0 : The call was initiated. The callback will be invoked when the call completes.
486 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
487 *
488 * When the callback is invoked, status indicates the result:
489 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
490 * data is LOOKUP3res
491 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
492 * data is the error string.
493 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
494 * data is NULL.
495 */
496struct LOOKUP3args;
497EXTERN int rpc_nfs3_lookup_async(struct rpc_context *rpc, rpc_cb cb, struct LOOKUP3args *args, void *private_data);
498EXTERN int rpc_nfs_lookup_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *name, void *private_data);
499
500/*
501 * Call NFS3/ACCESS
502 * Function returns
503 * 0 : The call was initiated. The callback will be invoked when the call completes.
504 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
505 *
506 * When the callback is invoked, status indicates the result:
507 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
508 * data is ACCESS3res
509 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
510 * data is the error string.
511 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
512 * data is NULL.
513 */
514struct ACCESS3args;
515EXTERN int rpc_nfs3_access_async(struct rpc_context *rpc, rpc_cb cb, struct ACCESS3args *args, void *private_data);
516EXTERN int rpc_nfs_access_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, int access, void *private_data);
517
518/*
519 * Call NFS3/READ
520 * Function returns
521 * 0 : The call was initiated. The callback will be invoked when the call completes.
522 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
523 *
524 * When the callback is invoked, status indicates the result:
525 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
526 * data is READ3res
527 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
528 * data is the error string.
529 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
530 * data is NULL.
531 */
532struct READ3args;
533EXTERN int rpc_nfs3_read_async(struct rpc_context *rpc, rpc_cb cb, struct READ3args *args, void *private_data);
534EXTERN 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);
535
536/*
537 * Call NFS3/WRITE
538 * Function returns
539 * 0 : The call was initiated. The callback will be invoked when the call completes.
540 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
541 *
542 * When the callback is invoked, status indicates the result:
543 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
544 * data is WRITE3res *
545 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
546 * data is the error string.
547 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
548 * data is NULL.
549 */
550struct WRITE3args;
551EXTERN int rpc_nfs3_write_async(struct rpc_context *rpc, rpc_cb cb, struct WRITE3args *args, void *private_data);
552EXTERN 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);
553
554/*
555 * Call NFS3/COMMIT
556 * Function returns
557 * 0 : The call was initiated. The callback will be invoked when the call completes.
558 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
559 *
560 * When the callback is invoked, status indicates the result:
561 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
562 * data is COMMIT3res *
563 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
564 * data is the error string.
565 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
566 * data is NULL.
567 */
568struct COMMIT3args;
569EXTERN int rpc_nfs3_commit_async(struct rpc_context *rpc, rpc_cb cb, struct COMMIT3args *args, void *private_data);
570EXTERN int rpc_nfs_commit_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
571
572/*
573 * Call NFS3/SETATTR
574 * Function returns
575 * 0 : The call was initiated. The callback will be invoked when the call completes.
576 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
577 *
578 * When the callback is invoked, status indicates the result:
579 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
580 * data is SETATTR3res *
581 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
582 * data is the error string.
583 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
584 * data is NULL.
585 */
586struct SETATTR3args;
587EXTERN int rpc_nfs3_setattr_async(struct rpc_context *rpc, rpc_cb cb, struct SETATTR3args *args, void *private_data);
588EXTERN int rpc_nfs_setattr_async(struct rpc_context *rpc, rpc_cb cb, struct SETATTR3args *args, void *private_data);
589
590/*
591 * Call NFS3/MKDIR
592 * Function returns
593 * 0 : The call was initiated. The callback will be invoked when the call completes.
594 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
595 *
596 * When the callback is invoked, status indicates the result:
597 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
598 * data is MKDIR3res *
599 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
600 * data is the error string.
601 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
602 * data is NULL.
603 */
604struct MKDIR3args;
605EXTERN int rpc_nfs3_mkdir_async(struct rpc_context *rpc, rpc_cb cb, struct MKDIR3args *args, void *private_data);
606EXTERN int rpc_nfs_mkdir_async(struct rpc_context *rpc, rpc_cb cb, struct MKDIR3args *args, void *private_data);
607
608/*
609 * Call NFS3/RMDIR
610 * Function returns
611 * 0 : The call was initiated. The callback will be invoked when the call completes.
612 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
613 *
614 * When the callback is invoked, status indicates the result:
615 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
616 * data is RMDIR3res *
617 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
618 * data is the error string.
619 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
620 * data is NULL.
621 */
622struct RMDIR3args;
623EXTERN int rpc_nfs3_rmdir_async(struct rpc_context *rpc, rpc_cb cb, struct RMDIR3args *args, void *private_data);
624EXTERN int rpc_nfs_rmdir_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *dir, void *private_data);
625
626/*
627 * Call NFS3/CREATE
628 * Function returns
629 * 0 : The call was initiated. The callback will be invoked when the call completes.
630 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
631 *
632 * When the callback is invoked, status indicates the result:
633 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
634 * data is CREATE3res *
635 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
636 * data is the error string.
637 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
638 * data is NULL.
639 */
640struct CREATE3args;
641EXTERN int rpc_nfs3_create_async(struct rpc_context *rpc, rpc_cb cb, struct CREATE3args *args, void *private_data);
642EXTERN int rpc_nfs_create_async(struct rpc_context *rpc, rpc_cb cb, struct CREATE3args *args, void *private_data);
643
644/*
645 * Call NFS3/MKNOD
646 * Function returns
647 * 0 : The call was initiated. The callback will be invoked when the call completes.
648 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
649 *
650 * When the callback is invoked, status indicates the result:
651 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
652 * data is MKNOD3res *
653 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
654 * data is the error string.
655 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
656 * data is NULL.
657 */
658struct MKNOD3args;
659EXTERN int rpc_nfs3_mknod_async(struct rpc_context *rpc, rpc_cb cb, struct MKNOD3args *args, void *private_data);
660EXTERN 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);
661
662/*
663 * Call NFS3/REMOVE
664 * Function returns
665 * 0 : The call was initiated. The callback will be invoked when the call completes.
666 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
667 *
668 * When the callback is invoked, status indicates the result:
669 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
670 * data is REMOVE3res *
671 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
672 * data is the error string.
673 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
674 * data is NULL.
675 */
676struct REMOVE3args;
677EXTERN int rpc_nfs3_remove_async(struct rpc_context *rpc, rpc_cb cb, struct REMOVE3args *args, void *private_data);
678EXTERN int rpc_nfs_remove_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *name, void *private_data);
679
680/*
681 * Call NFS3/READDIR
682 * Function returns
683 * 0 : The call was initiated. The callback will be invoked when the call completes.
684 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
685 *
686 * When the callback is invoked, status indicates the result:
687 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
688 * data is READDIR3res *
689 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
690 * data is the error string.
691 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
692 * data is NULL.
693 */
694struct READDIR3args;
695EXTERN int rpc_nfs3_readdir_async(struct rpc_context *rpc, rpc_cb cb, struct READDIR3args *args, void *private_data);
696EXTERN 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);
697
698/*
699 * Call NFS3/READDIRPLUS
700 * Function returns
701 * 0 : The call was initiated. The callback will be invoked when the call completes.
702 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
703 *
704 * When the callback is invoked, status indicates the result:
705 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
706 * data is READDIRPLUS3res *
707 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
708 * data is the error string.
709 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
710 * data is NULL.
711 */
712struct READDIRPLUS3args;
713EXTERN int rpc_nfs3_readdirplus_async(struct rpc_context *rpc, rpc_cb cb, struct READDIRPLUS3args *args, void *private_data);
714EXTERN 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);
715
716/*
717 * Call NFS3/FSSTAT
718 * Function returns
719 * 0 : The call was initiated. The callback will be invoked when the call completes.
720 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
721 *
722 * When the callback is invoked, status indicates the result:
723 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
724 * data is FSSTAT3res
725 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
726 * data is the error string.
727 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
728 * data is NULL.
729 */
730struct FSSTAT3args;
731EXTERN int rpc_nfs3_fsstat_async(struct rpc_context *rpc, rpc_cb cb, struct FSSTAT3args *args, void *private_data);
732EXTERN int rpc_nfs_fsstat_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
733
734/*
735 * Call NFS3/FSINFO
736 * Function returns
737 * 0 : The call was initiated. The callback will be invoked when the call completes.
738 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
739 *
740 * When the callback is invoked, status indicates the result:
741 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
742 * data is FSINFO3res
743 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
744 * data is the error string.
745 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
746 * data is NULL.
747 */
748struct FSINFO3args;
749EXTERN int rpc_nfs3_fsinfo_async(struct rpc_context *rpc, rpc_cb cb, struct FSINFO3args *args, void *private_data);
750EXTERN int rpc_nfs_fsinfo_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
751
752/*
753 * Call NFS3/READLINK
754 * Function returns
755 * 0 : The call was initiated. The callback will be invoked when the call completes.
756 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
757 *
758 * When the callback is invoked, status indicates the result:
759 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
760 * data is READLINK3res *
761 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
762 * data is the error string.
763 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
764 * data is NULL.
765 */
766struct READLINK3args;
767EXTERN int rpc_nfs3_readlink_async(struct rpc_context *rpc, rpc_cb cb, struct READLINK3args *args, void *private_data);
768EXTERN int rpc_nfs_readlink_async(struct rpc_context *rpc, rpc_cb cb, struct READLINK3args *args, void *private_data);
769
770/*
771 * Call NFS3/SYMLINK
772 * Function returns
773 * 0 : The call was initiated. The callback will be invoked when the call completes.
774 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
775 *
776 * When the callback is invoked, status indicates the result:
777 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
778 * data is SYMLINK3res *
779 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
780 * data is the error string.
781 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
782 * data is NULL.
783 */
784struct SYMLINK3args;
785EXTERN int rpc_nfs3_symlink_async(struct rpc_context *rpc, rpc_cb cb, struct SYMLINK3args *args, void *private_data);
786EXTERN int rpc_nfs_symlink_async(struct rpc_context *rpc, rpc_cb cb, struct SYMLINK3args *args, void *private_data);
787
788/*
789 * Call NFS3/RENAME
790 * Function returns
791 * 0 : The call was initiated. The callback will be invoked when the call completes.
792 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
793 *
794 * When the callback is invoked, status indicates the result:
795 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
796 * data is RENAME3res *
797 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
798 * data is the error string.
799 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
800 * data is NULL.
801 */
802struct RENAME3args;
803EXTERN int rpc_nfs3_rename_async(struct rpc_context *rpc, rpc_cb cb, struct RENAME3args *args, void *private_data);
804EXTERN 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);
805
806/*
807 * Call NFS3/LINK
808 * Function returns
809 * 0 : The call was initiated. The callback will be invoked when the call completes.
810 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
811 *
812 * When the callback is invoked, status indicates the result:
813 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
814 * data is LINK3res *
815 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
816 * data is the error string.
817 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
818 * data is NULL.
819 */
820struct LINK3args;
821EXTERN int rpc_nfs3_link_async(struct rpc_context *rpc, rpc_cb cb, struct LINK3args *args, void *private_data);
822EXTERN 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);
823
824/*
825 * NFS v2 FUNCTIONS
826 */
827
828/*
829 * Call NFS2/NULL
830 * Function returns
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.
833 *
834 * When the callback is invoked, status indicates the result:
835 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
836 * data is NULL.
837 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
838 * data is the error string.
839 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
840 * data is NULL.
841 */
842EXTERN int rpc_nfs2_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
843
844/*
845 * Call NFS2/GETATTR
846 * Function returns
847 * 0 : The call was initiated. The callback will be invoked when the call completes.
848 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
849 *
850 * When the callback is invoked, status indicates the result:
851 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
852 * data is GETATTR2res
853 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
854 * data is the error string.
855 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
856 * data is NULL.
857 */
858struct GETATTR2args;
859EXTERN int rpc_nfs2_getattr_async(struct rpc_context *rpc, rpc_cb cb, struct GETATTR2args *args, void *private_data);
860
861/*
862 * Call NFS2/SETATTR
863 * Function returns
864 * 0 : The call was initiated. The callback will be invoked when the call completes.
865 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
866 *
867 * When the callback is invoked, status indicates the result:
868 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
869 * data is SETATTR2res *
870 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
871 * data is the error string.
872 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
873 * data is NULL.
874 */
875struct SETATTR2args;
876EXTERN int rpc_nfs2_setattr_async(struct rpc_context *rpc, rpc_cb cb, struct SETATTR2args *args, void *private_data);
877
878/*
879 * Call NFS2/LOOKUP
880 * Function returns
881 * 0 : The call was initiated. The callback will be invoked when the call completes.
882 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
883 *
884 * When the callback is invoked, status indicates the result:
885 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
886 * data is LOOKUP2res
887 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
888 * data is the error string.
889 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
890 * data is NULL.
891 */
892struct LOOKUP2args;
893EXTERN int rpc_nfs2_lookup_async(struct rpc_context *rpc, rpc_cb cb, struct LOOKUP2args *args, void *private_data);
894
895/*
896 * Call NFS2/READLINK
897 * Function returns
898 * 0 : The call was initiated. The callback will be invoked when the call completes.
899 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
900 *
901 * When the callback is invoked, status indicates the result:
902 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
903 * data is READLINK2res *
904 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
905 * data is the error string.
906 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
907 * data is NULL.
908 */
909struct READLINK2args;
910EXTERN int rpc_nfs32_readlink_async(struct rpc_context *rpc, rpc_cb cb, struct READLINK2args *args, void *private_data);
911
912/*
913 * Call NFS2/READ
914 * Function returns
915 * 0 : The call was initiated. The callback will be invoked when the call completes.
916 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
917 *
918 * When the callback is invoked, status indicates the result:
919 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
920 * data is READ2res
921 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
922 * data is the error string.
923 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
924 * data is NULL.
925 */
926struct READ2args;
927EXTERN int rpc_nfs2_read_async(struct rpc_context *rpc, rpc_cb cb, struct READ2args *args, void *private_data);
928
929/*
930 * Call NFS2/WRITE
931 * Function returns
932 * 0 : The call was initiated. The callback will be invoked when the call completes.
933 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
934 *
935 * When the callback is invoked, status indicates the result:
936 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
937 * data is WRITE2res *
938 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
939 * data is the error string.
940 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
941 * data is NULL.
942 */
943struct WRITE2args;
944EXTERN int rpc_nfs2_write_async(struct rpc_context *rpc, rpc_cb cb, struct WRITE2args *args, void *private_data);
945
946/*
947 * Call NFS2/CREATE
948 * Function returns
949 * 0 : The call was initiated. The callback will be invoked when the call completes.
950 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
951 *
952 * When the callback is invoked, status indicates the result:
953 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
954 * data is CREATE2res *
955 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
956 * data is the error string.
957 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
958 * data is NULL.
959 */
960struct CREATE2args;
961EXTERN int rpc_nfs2_create_async(struct rpc_context *rpc, rpc_cb cb, struct CREATE2args *args, void *private_data);
962
963/*
964 * Call NFS2/REMOVE
965 * Function returns
966 * 0 : The call was initiated. The callback will be invoked when the call completes.
967 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
968 *
969 * When the callback is invoked, status indicates the result:
970 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
971 * data is REMOVE2res *
972 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
973 * data is the error string.
974 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
975 * data is NULL.
976 */
977struct REMOVE2args;
978EXTERN int rpc_nfs2_remove_async(struct rpc_context *rpc, rpc_cb cb, struct REMOVE2args *args, void *private_data);
979
980/*
981 * Call NFS2/RENAME
982 * Function returns
983 * 0 : The call was initiated. The callback will be invoked when the call completes.
984 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
985 *
986 * When the callback is invoked, status indicates the result:
987 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
988 * data is RENAME2res *
989 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
990 * data is the error string.
991 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
992 * data is NULL.
993 */
994struct RENAME2args;
995EXTERN int rpc_nfs2_rename_async(struct rpc_context *rpc, rpc_cb cb, struct RENAME2args *args, void *private_data);
996
997/*
998 * Call NFS2/LINK
999 * Function returns
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.
1002 *
1003 * When the callback is invoked, status indicates the result:
1004 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
1005 * data is LINK2res *
1006 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
1007 * data is the error string.
1008 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1009 * data is NULL.
1010 */
1011struct LINK2args;
1012EXTERN int rpc_nfs2_link_async(struct rpc_context *rpc, rpc_cb cb, struct LINK2args *args, void *private_data);
1013
1014/*
1015 * Call NFS2/SYMLINK
1016 * Function returns
1017 * 0 : The call was initiated. The callback will be invoked when the call completes.
1018 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1019 *
1020 * When the callback is invoked, status indicates the result:
1021 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
1022 * data is SYMLINK2res *
1023 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
1024 * data is the error string.
1025 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1026 * data is NULL.
1027 */
1028struct SYMLINK2args;
1029EXTERN int rpc_nfs2_symlink_async(struct rpc_context *rpc, rpc_cb cb, struct SYMLINK2args *args, void *private_data);
1030
1031/*
1032 * Call NFS2/MKDIR
1033 * Function returns
1034 * 0 : The call was initiated. The callback will be invoked when the call completes.
1035 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1036 *
1037 * When the callback is invoked, status indicates the result:
1038 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
1039 * data is MKDIR2res *
1040 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
1041 * data is the error string.
1042 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1043 * data is NULL.
1044 */
1045struct MKDIR2args;
1046EXTERN int rpc_nfs2_mkdir_async(struct rpc_context *rpc, rpc_cb cb, struct MKDIR2args *args, void *private_data);
1047
1048/*
1049 * Call NFS2/RMDIR
1050 * Function returns
1051 * 0 : The call was initiated. The callback will be invoked when the call completes.
1052 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1053 *
1054 * When the callback is invoked, status indicates the result:
1055 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
1056 * data is RMDIR2res *
1057 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
1058 * data is the error string.
1059 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1060 * data is NULL.
1061 */
1062struct RMDIR2args;
1063EXTERN int rpc_nfs2_rmdir_async(struct rpc_context *rpc, rpc_cb cb, struct RMDIR2args *args, void *private_data);
1064
1065/*
1066 * Call NFS2/READDIR
1067 * Function returns
1068 * 0 : The call was initiated. The callback will be invoked when the call completes.
1069 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1070 *
1071 * When the callback is invoked, status indicates the result:
1072 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
1073 * data is READDIR2res *
1074 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
1075 * data is the error string.
1076 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1077 * data is NULL.
1078 */
1079struct READDIR2args;
1080EXTERN int rpc_nfs2_readdir_async(struct rpc_context *rpc, rpc_cb cb, struct READDIR2args *args, void *private_data);
1081
1082/*
1083 * Call NFS2/STATFS
1084 * Function returns
1085 * 0 : The call was initiated. The callback will be invoked when the call completes.
1086 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1087 *
1088 * When the callback is invoked, status indicates the result:
1089 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
1090 * data is STATFS2res *
1091 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
1092 * data is the error string.
1093 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1094 * data is NULL.
1095 */
1096struct STATFS2args;
1097EXTERN int rpc_nfs2_statfs_async(struct rpc_context *rpc, rpc_cb cb, struct STATFS2args *args, void *private_data);
1098
1099/*
1100 * RQUOTA FUNCTIONS
1101 */
1102char *rquotastat_to_str(int error);
1103int rquotastat_to_errno(int error);
1104
1105/*
1106 * Call RQUOTA1/NULL
1107 * Function returns
1108 * 0 : The call was initiated. The callback will be invoked when the call completes.
1109 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1110 *
1111 * When the callback is invoked, status indicates the result:
1112 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
1113 * data is NULL.
1114 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
1115 * data is the error string.
1116 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1117 * data is NULL.
1118 */
1119EXTERN int rpc_rquota1_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
1120
1121/*
1122 * Call RQUOTA1/GETQUOTA
1123 * Function returns
1124 * 0 : The call was initiated. The callback will be invoked when the call completes.
1125 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1126 *
1127 * When the callback is invoked, status indicates the result:
1128 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
1129 * data is a RQUOTA1res structure.
1130 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
1131 * data is the error string.
1132 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1133 * data is NULL.
1134 */
1135EXTERN int rpc_rquota1_getquota_async(struct rpc_context *rpc, rpc_cb cb, char *export, int uid, void *private_data);
1136
1137/*
1138 * Call RQUOTA1/GETACTIVEQUOTA
1139 * Function returns
1140 * 0 : The call was initiated. The callback will be invoked when the call completes.
1141 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1142 *
1143 * When the callback is invoked, status indicates the result:
1144 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
1145 * data is a RQUOTA1res structure.
1146 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
1147 * data is the error string.
1148 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1149 * data is NULL.
1150 */
1151EXTERN int rpc_rquota1_getactivequota_async(struct rpc_context *rpc, rpc_cb cb, char *export, int uid, void *private_data);
1152
1153
1154
1155
1156/*
1157 * Call RQUOTA2/NULL
1158 * Function returns
1159 * 0 : The call was initiated. The callback will be invoked when the call completes.
1160 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1161 *
1162 * When the callback is invoked, status indicates the result:
1163 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
1164 * data is NULL.
1165 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
1166 * data is the error string.
1167 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1168 * data is NULL.
1169 */
1170int rpc_rquota2_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
1171
1172/*
1173 * Call RQUOTA2/GETQUOTA
1174 * Function returns
1175 * 0 : The call was initiated. The callback will be invoked when the call completes.
1176 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1177 *
1178 * When the callback is invoked, status indicates the result:
1179 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
1180 * data is a RQUOTA1res structure.
1181 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
1182 * data is the error string.
1183 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1184 * data is NULL.
1185 */
1186int rpc_rquota2_getquota_async(struct rpc_context *rpc, rpc_cb cb, char *export, int type, int uid, void *private_data);
1187
1188/*
1189 * Call RQUOTA2/GETACTIVEQUOTA
1190 * Function returns
1191 * 0 : The call was initiated. The callback will be invoked when the call completes.
1192 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1193 *
1194 * When the callback is invoked, status indicates the result:
1195 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
1196 * data is a RQUOTA1res structure.
1197 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
1198 * data is the error string.
1199 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1200 * data is NULL.
1201 */
1202int rpc_rquota2_getactivequota_async(struct rpc_context *rpc, rpc_cb cb, char *export, int type, int uid, void *private_data);
1203
1204
1205
1206
1207
1208
1209/*
1210 * NFSACL functions
1211 */
1212
1213/*
1214 * Call NFSACL/NULL
1215 * Call the NULL procedure for the NFSACL
1216 *
1217 * Function returns
1218 * 0 : The call was initiated. The callback will be invoked when the call completes.
1219 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1220 *
1221 * When the callback is invoked, status indicates the result:
1222 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
1223 * data is NULL
1224 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
1225 * data is the error string.
1226 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1227 * data is NULL.
1228 */
1229EXTERN int rpc_nfsacl_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
1230
1231/*
1232 * Call NFSACL/GETACL
1233 *
1234 * Function returns
1235 * 0 : The call was initiated. The callback will be invoked when the call completes.
1236 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1237 *
1238 * When the callback is invoked, status indicates the result:
1239 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
1240 * data is a GETACL3res pointer
1241 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
1242 * data is the error string.
1243 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1244 * data is NULL.
1245 */
1246struct GETACL3args;
1247EXTERN int rpc_nfsacl_getacl_async(struct rpc_context *rpc, rpc_cb cb, struct GETACL3args *args, void *private_data);
1248
1249
1250
1251/*
1252 * Call NFSACL/SETACL
1253 *
1254 * Function returns
1255 * 0 : The call was initiated. The callback will be invoked when the call completes.
1256 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1257 *
1258 * When the callback is invoked, status indicates the result:
1259 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
1260 * data is a SETACL3res pointer
1261 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
1262 * data is the error string.
1263 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1264 * data is NULL.
1265 */
1266struct SETACL3args;
1267EXTERN int rpc_nfsacl_setacl_async(struct rpc_context *rpc, rpc_cb cb, struct SETACL3args *args, void *private_data);
1268
1269
1270
1271
1272/*
1273 * NLM functions
1274 */
1275char *nlmstat4_to_str(int stat);
1276
1277/*
1278 * Call NLM/NULL
1279 * Call the NULL procedure for the NLM protocol
1280 *
1281 * Function returns
1282 * 0 : The call was initiated. The callback will be invoked when the call completes.
1283 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1284 *
1285 * When the callback is invoked, status indicates the result:
1286 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
1287 * data is NULL
1288 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
1289 * data is the error string.
1290 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1291 * data is NULL.
1292 */
1293EXTERN int rpc_nlm4_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
1294
1295/*
1296 * Call NLM/TEST
1297 * Call the TEST procedure for the NLM protocol
1298 *
1299 * Function returns
1300 * 0 : The call was initiated. The callback will be invoked when the call completes.
1301 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1302 *
1303 * When the callback is invoked, status indicates the result:
1304 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
1305 * data is NLM4_TESTres
1306 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
1307 * data is the error string.
1308 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1309 * data is NULL.
1310 */
1311struct NLM4_TESTargs;
1312EXTERN int rpc_nlm4_test_async(struct rpc_context *rpc, rpc_cb cb, struct NLM4_TESTargs *args, void *private_data);
1313
1314/*
1315 * Call NLM/LOCK
1316 * Call the LOCK procedure for the NLM protocol
1317 *
1318 * Function returns
1319 * 0 : The call was initiated. The callback will be invoked when the call completes.
1320 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1321 *
1322 * When the callback is invoked, status indicates the result:
1323 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
1324 * data is NLM4_LOCKres
1325 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
1326 * data is the error string.
1327 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1328 * data is NULL.
1329 */
1330struct NLM4_LOCKargs;
1331EXTERN int rpc_nlm4_lock_async(struct rpc_context *rpc, rpc_cb cb, struct NLM4_LOCKargs *args, void *private_data);
1332
1333/*
1334 * Call NLM/CANCEL
1335 * Call the CANCEL procedure for the NLM protocol
1336 *
1337 * Function returns
1338 * 0 : The call was initiated. The callback will be invoked when the call completes.
1339 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1340 *
1341 * When the callback is invoked, status indicates the result:
1342 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
1343 * data is NLM4_CANCres
1344 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
1345 * data is the error string.
1346 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1347 * data is NULL.
1348 */
1349struct NLM4_CANCargs;
1350EXTERN int rpc_nlm4_cancel_async(struct rpc_context *rpc, rpc_cb cb, struct NLM4_CANCargs *args, void *private_data);
1351
1352/*
1353 * Call NLM/UNLOCK
1354 * Call the UNLOCK procedure for the NLM protocol
1355 *
1356 * Function returns
1357 * 0 : The call was initiated. The callback will be invoked when the call completes.
1358 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1359 *
1360 * When the callback is invoked, status indicates the result:
1361 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
1362 * data is NLM4_UNLOCKres
1363 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
1364 * data is the error string.
1365 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1366 * data is NULL.
1367 */
1368struct NLM4_UNLOCKargs;
1369EXTERN int rpc_nlm4_unlock_async(struct rpc_context *rpc, rpc_cb cb, struct NLM4_UNLOCKargs *args, void *private_data);
1370
1371/*
1372 * NSM functions
1373 */
1374char *nsmstat1_to_str(int stat);
1375
1376/*
1377 * Call NSM/NULL
1378 * Call the NULL procedure for the NSM protocol
1379 *
1380 * Function returns
1381 * 0 : The call was initiated. The callback will be invoked when the call completes.
1382 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1383 *
1384 * When the callback is invoked, status indicates the result:
1385 * RPC_STATUS_SUCCESS : We got a successful response from the nsm daemon.
1386 * data is NULL
1387 * RPC_STATUS_ERROR : An error occured when trying to contact the nsm daemon.
1388 * data is the error string.
1389 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1390 * data is NULL.
1391 */
1392EXTERN int rpc_nsm1_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
1393
1394/*
1395 * Call NSM/STAT
1396 * Call the STAT procedure for the NSM protocol
1397 *
1398 * Function returns
1399 * 0 : The call was initiated. The callback will be invoked when the call completes.
1400 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1401 *
1402 * When the callback is invoked, status indicates the result:
1403 * RPC_STATUS_SUCCESS : We got a successful response from the nsm daemon.
1404 * data is NSM1_STATres
1405 * RPC_STATUS_ERROR : An error occured when trying to contact the nsm daemon.
1406 * data is the error string.
1407 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1408 * data is NULL.
1409 */
1410struct NSM1_STATargs;
1411EXTERN int rpc_nsm1_stat_async(struct rpc_context *rpc, rpc_cb cb, struct NSM1_STATargs *args, void *private_data);
1412
1413/*
1414 * Call NSM/MON
1415 * Call the MON procedure for the NSM protocol
1416 *
1417 * Function returns
1418 * 0 : The call was initiated. The callback will be invoked when the call completes.
1419 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1420 *
1421 * When the callback is invoked, status indicates the result:
1422 * RPC_STATUS_SUCCESS : We got a successful response from the nsm daemon.
1423 * data is NSM1_MONres
1424 * RPC_STATUS_ERROR : An error occured when trying to contact the nsm daemon.
1425 * data is the error string.
1426 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1427 * data is NULL.
1428 */
1429struct NSM1_MONargs;
1430EXTERN int rpc_nsm1_mon_async(struct rpc_context *rpc, rpc_cb cb, struct NSM1_MONargs *args, void *private_data);
1431
1432/*
1433 * Call NSM/UNMON
1434 * Call the UNMON procedure for the NSM protocol
1435 *
1436 * Function returns
1437 * 0 : The call was initiated. The callback will be invoked when the call completes.
1438 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1439 *
1440 * When the callback is invoked, status indicates the result:
1441 * RPC_STATUS_SUCCESS : We got a successful response from the nsm daemon.
1442 * data is NSM1_UNMONres
1443 * RPC_STATUS_ERROR : An error occured when trying to contact the nsm daemon.
1444 * data is the error string.
1445 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1446 * data is NULL.
1447 */
1448struct NSM1_UNMONargs;
1449EXTERN int rpc_nsm1_unmon_async(struct rpc_context *rpc, rpc_cb cb, struct NSM1_UNMONargs *args, void *private_data);
1450
1451/*
1452 * Call NSM/UNMONALL
1453 * Call the UNMONALL procedure for the NSM protocol
1454 *
1455 * Function returns
1456 * 0 : The call was initiated. The callback will be invoked when the call completes.
1457 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1458 *
1459 * When the callback is invoked, status indicates the result:
1460 * RPC_STATUS_SUCCESS : We got a successful response from the nsm daemon.
1461 * data is NSM1_UNMONALLres
1462 * RPC_STATUS_ERROR : An error occured when trying to contact the nsm daemon.
1463 * data is the error string.
1464 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1465 * data is NULL.
1466 */
1467struct NSM1_UNMONALLargs;
1468EXTERN int rpc_nsm1_unmonall_async(struct rpc_context *rpc, rpc_cb cb, struct NSM1_UNMONALLargs *args, void *private_data);
1469
1470/*
1471 * Call NSM/SIMUCRASH
1472 * Call the SIMUCRASH procedure for the NSM protocol
1473 *
1474 * Function returns
1475 * 0 : The call was initiated. The callback will be invoked when the call completes.
1476 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1477 *
1478 * When the callback is invoked, status indicates the result:
1479 * RPC_STATUS_SUCCESS : We got a successful response from the nsm daemon.
1480 * data is NULL
1481 * RPC_STATUS_ERROR : An error occured when trying to contact the nsm daemon.
1482 * data is the error string.
1483 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1484 * data is NULL.
1485 */
1486EXTERN int rpc_nsm1_simucrash_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
1487
1488/*
1489 * Call NSM/NOTIFY
1490 * Call the NOTIFY procedure for the NSM protocol
1491 *
1492 * Function returns
1493 * 0 : The call was initiated. The callback will be invoked when the call completes.
1494 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1495 *
1496 * When the callback is invoked, status indicates the result:
1497 * RPC_STATUS_SUCCESS : We got a successful response from the nsm daemon.
1498 * data is NULL
1499 * RPC_STATUS_ERROR : An error occured when trying to contact the nsm daemon.
1500 * data is the error string.
1501 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1502 * data is NULL.
1503 */
1504struct NSM1_NOTIFYargs;
1505EXTERN int rpc_nsm1_notify_async(struct rpc_context *rpc, rpc_cb cb, struct NSM1_NOTIFYargs *args, void *private_data);
1506
1507#ifdef __cplusplus
1508}
1509#endif
1510
1511#endif