9d6b0ec099e2245fb3c3fcd215a306f91b925eda
[deb_libnfs.git] / include / nfsc / libnfs-raw.h
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
29 extern "C" {
30 #endif
31
32 struct rpc_data {
33 int size;
34 unsigned char *data;
35 };
36
37 struct rpc_context;
38 struct rpc_context *rpc_init_context(void);
39 void rpc_destroy_context(struct rpc_context *rpc);
40
41 void rpc_set_auth(struct rpc_context *rpc, struct AUTH *auth);
42
43 int rpc_get_fd(struct rpc_context *rpc);
44 int rpc_which_events(struct rpc_context *rpc);
45 int rpc_service(struct rpc_context *rpc, int revents);
46 char *rpc_get_error(struct rpc_context *rpc);
47 int 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 */
52 struct 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 */
58 struct 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 */
64 void 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 */
78 void 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 */
98 int 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 */
113 int 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 */
118 int 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 */
139 EXTERN 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 */
156 EXTERN 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 */
172 EXTERN 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 */
188 EXTERN 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/DUMP.
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 struct *pmap_mapping_list.
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 */
204 EXTERN int rpc_pmap_dump_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
205
206 /*
207 * Call PORTMAPPER/CALLIT.
208 * Function returns
209 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
210 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
211 *
212 * When the callback is invoked, status indicates the result:
213 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon
214 * data is a 'pmap_call_result' pointer.
215 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
216 * data is the error string.
217 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
218 * data is NULL.
219 */
220 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);
221
222 /*
223 * MOUNT v3 FUNCTIONS
224 */
225 char *mountstat3_to_str(int stat);
226 int mountstat3_to_errno(int error);
227
228 /*
229 * Call MOUNT3/NULL
230 * Function returns
231 * 0 : The call was initiated. The callback will be invoked when the call completes.
232 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
233 *
234 * When the callback is invoked, status indicates the result:
235 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
236 * data is NULL.
237 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
238 * data is the error string.
239 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
240 * data is NULL.
241 */
242 EXTERN int rpc_mount3_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
243 EXTERN int rpc_mount_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
244
245 /*
246 * Call MOUNT3/MNT
247 * Function returns
248 * 0 : The call was initiated. The callback will be invoked when the call completes.
249 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
250 *
251 * When the callback is invoked, status indicates the result:
252 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
253 * data is union mountres3.
254 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
255 * data is the error string.
256 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
257 * data is NULL.
258 */
259 EXTERN int rpc_mount3_mnt_async(struct rpc_context *rpc, rpc_cb cb, char *exportname, void *private_data);
260 EXTERN int rpc_mount_mnt_async(struct rpc_context *rpc, rpc_cb cb, char *exportname, void *private_data);
261
262 /*
263 * Call MOUNT3/DUMP
264 * Function returns
265 * 0 : The call was initiated. The callback will be invoked when the call completes.
266 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
267 *
268 * When the callback is invoked, status indicates the result:
269 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
270 * data is a mountlist.
271 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
272 * data is the error string.
273 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
274 * data is NULL.
275 */
276 EXTERN int rpc_mount3_dump_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
277 EXTERN int rpc_mount_dump_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
278
279 /*
280 * Call MOUNT3/UMNT
281 * Function returns
282 * 0 : The call was initiated. The callback will be invoked when the call completes.
283 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
284 *
285 * When the callback is invoked, status indicates the result:
286 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
287 * data NULL.
288 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
289 * data is the error string.
290 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
291 * data is NULL.
292 */
293 EXTERN int rpc_mount3_umnt_async(struct rpc_context *rpc, rpc_cb cb, char *exportname, void *private_data);
294 EXTERN int rpc_mount_umnt_async(struct rpc_context *rpc, rpc_cb cb, char *exportname, void *private_data);
295
296 /*
297 * Call MOUNT3/UMNTALL
298 * Function returns
299 * 0 : The call was initiated. The callback will be invoked when the call completes.
300 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
301 *
302 * When the callback is invoked, status indicates the result:
303 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
304 * data NULL.
305 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
306 * data is the error string.
307 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
308 * data is NULL.
309 */
310 EXTERN int rpc_mount3_umntall_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
311 EXTERN int rpc_mount_umntall_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
312
313 /*
314 * Call MOUNT3/EXPORT
315 * NOTE: You must include 'libnfs-raw-mount.h' to get the definitions of the
316 * returned structures.
317 *
318 * Function returns
319 * 0 : The call was initiated. The callback will be invoked when the call completes.
320 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
321 *
322 * When the callback is invoked, status indicates the result:
323 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
324 * data is a pointer to an exports pointer:
325 * exports export = *(exports *)data;
326 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
327 * data is the error string.
328 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
329 * data is NULL.
330 */
331 EXTERN int rpc_mount3_export_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
332 EXTERN int rpc_mount_export_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
333
334 /*
335 * MOUNT v1 FUNCTIONS (Used with NFSv2)
336 */
337 /*
338 * Call MOUNT1/NULL
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 NULL.
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 */
351 EXTERN int rpc_mount1_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
352
353 /*
354 * Call MOUNT1/MNT
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 union mountres1.
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 */
367 EXTERN int rpc_mount1_mnt_async(struct rpc_context *rpc, rpc_cb cb, char *exportname, void *private_data);
368
369 /*
370 * Call MOUNT1/DUMP
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 is a mountlist.
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 */
383 EXTERN int rpc_mount1_dump_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
384
385 /*
386 * Call MOUNT1/UMNT
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 */
399 EXTERN int rpc_mount1_umnt_async(struct rpc_context *rpc, rpc_cb cb, char *exportname, void *private_data);
400
401 /*
402 * Call MOUNT1/UMNTALL
403 * Function returns
404 * 0 : The call was initiated. The callback will be invoked when the call completes.
405 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
406 *
407 * When the callback is invoked, status indicates the result:
408 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
409 * data NULL.
410 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
411 * data is the error string.
412 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
413 * data is NULL.
414 */
415 EXTERN int rpc_mount1_umntall_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
416
417 /*
418 * Call MOUNT1/EXPORT
419 * NOTE: You must include 'libnfs-raw-mount.h' to get the definitions of the
420 * returned structures.
421 *
422 * Function returns
423 * 0 : The call was initiated. The callback will be invoked when the call completes.
424 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
425 *
426 * When the callback is invoked, status indicates the result:
427 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
428 * data is a pointer to an exports pointer:
429 * exports export = *(exports *)data;
430 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
431 * data is the error string.
432 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
433 * data is NULL.
434 */
435 EXTERN int rpc_mount1_export_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
436
437
438 /*
439 * NFS v3 FUNCTIONS
440 */
441 struct nfs_fh3;
442 char *nfsstat3_to_str(int error);
443 int nfsstat3_to_errno(int error);
444
445 /*
446 * Call NFS3/NULL
447 * Function returns
448 * 0 : The call was initiated. The callback will be invoked when the call completes.
449 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
450 *
451 * When the callback is invoked, status indicates the result:
452 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
453 * data is NULL.
454 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
455 * data is the error string.
456 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
457 * data is NULL.
458 */
459 EXTERN int rpc_nfs3_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
460 EXTERN int rpc_nfs_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
461
462 /*
463 * Call NFS3/GETATTR
464 * Function returns
465 * 0 : The call was initiated. The callback will be invoked when the call completes.
466 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
467 *
468 * When the callback is invoked, status indicates the result:
469 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
470 * data is GETATTR3res
471 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
472 * data is the error string.
473 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
474 * data is NULL.
475 */
476 struct GETATTR3args;
477 EXTERN int rpc_nfs3_getattr_async(struct rpc_context *rpc, rpc_cb cb, struct GETATTR3args *args, void *private_data);
478 EXTERN int rpc_nfs_getattr_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
479
480 /*
481 * Call NFS3/PATHCONF
482 * Function returns
483 * 0 : The call was initiated. The callback will be invoked when the call completes.
484 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
485 *
486 * When the callback is invoked, status indicates the result:
487 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
488 * data is PATHCONF3res
489 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
490 * data is the error string.
491 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
492 * data is NULL.
493 */
494 struct PATHCONF3args;
495 EXTERN int rpc_nfs3_pathconf_async(struct rpc_context *rpc, rpc_cb cb, struct PATHCONF3args *args, void *private_data);
496 EXTERN int rpc_nfs_pathconf_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
497
498 /*
499 * Call NFS3/LOOKUP
500 * Function returns
501 * 0 : The call was initiated. The callback will be invoked when the call completes.
502 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
503 *
504 * When the callback is invoked, status indicates the result:
505 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
506 * data is LOOKUP3res
507 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
508 * data is the error string.
509 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
510 * data is NULL.
511 */
512 struct LOOKUP3args;
513 EXTERN int rpc_nfs3_lookup_async(struct rpc_context *rpc, rpc_cb cb, struct LOOKUP3args *args, void *private_data);
514 EXTERN int rpc_nfs_lookup_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *name, void *private_data);
515
516 /*
517 * Call NFS3/ACCESS
518 * Function returns
519 * 0 : The call was initiated. The callback will be invoked when the call completes.
520 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
521 *
522 * When the callback is invoked, status indicates the result:
523 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
524 * data is ACCESS3res
525 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
526 * data is the error string.
527 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
528 * data is NULL.
529 */
530 struct ACCESS3args;
531 EXTERN int rpc_nfs3_access_async(struct rpc_context *rpc, rpc_cb cb, struct ACCESS3args *args, void *private_data);
532 EXTERN int rpc_nfs_access_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, int access, void *private_data);
533
534 /*
535 * Call NFS3/READ
536 * Function returns
537 * 0 : The call was initiated. The callback will be invoked when the call completes.
538 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
539 *
540 * When the callback is invoked, status indicates the result:
541 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
542 * data is READ3res
543 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
544 * data is the error string.
545 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
546 * data is NULL.
547 */
548 struct READ3args;
549 EXTERN int rpc_nfs3_read_async(struct rpc_context *rpc, rpc_cb cb, struct READ3args *args, void *private_data);
550 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);
551
552 /*
553 * Call NFS3/WRITE
554 * Function returns
555 * 0 : The call was initiated. The callback will be invoked when the call completes.
556 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
557 *
558 * When the callback is invoked, status indicates the result:
559 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
560 * data is WRITE3res *
561 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
562 * data is the error string.
563 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
564 * data is NULL.
565 */
566 struct WRITE3args;
567 EXTERN int rpc_nfs3_write_async(struct rpc_context *rpc, rpc_cb cb, struct WRITE3args *args, void *private_data);
568 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);
569
570 /*
571 * Call NFS3/COMMIT
572 * Function returns
573 * 0 : The call was initiated. The callback will be invoked when the call completes.
574 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
575 *
576 * When the callback is invoked, status indicates the result:
577 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
578 * data is COMMIT3res *
579 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
580 * data is the error string.
581 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
582 * data is NULL.
583 */
584 struct COMMIT3args;
585 EXTERN int rpc_nfs3_commit_async(struct rpc_context *rpc, rpc_cb cb, struct COMMIT3args *args, void *private_data);
586 EXTERN int rpc_nfs_commit_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
587
588 /*
589 * Call NFS3/SETATTR
590 * Function returns
591 * 0 : The call was initiated. The callback will be invoked when the call completes.
592 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
593 *
594 * When the callback is invoked, status indicates the result:
595 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
596 * data is SETATTR3res *
597 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
598 * data is the error string.
599 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
600 * data is NULL.
601 */
602 struct SETATTR3args;
603 EXTERN int rpc_nfs3_setattr_async(struct rpc_context *rpc, rpc_cb cb, struct SETATTR3args *args, void *private_data);
604 EXTERN int rpc_nfs_setattr_async(struct rpc_context *rpc, rpc_cb cb, struct SETATTR3args *args, void *private_data);
605
606 /*
607 * Call NFS3/MKDIR
608 * Function returns
609 * 0 : The call was initiated. The callback will be invoked when the call completes.
610 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
611 *
612 * When the callback is invoked, status indicates the result:
613 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
614 * data is MKDIR3res *
615 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
616 * data is the error string.
617 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
618 * data is NULL.
619 */
620 struct MKDIR3args;
621 EXTERN int rpc_nfs3_mkdir_async(struct rpc_context *rpc, rpc_cb cb, struct MKDIR3args *args, void *private_data);
622 EXTERN int rpc_nfs_mkdir_async(struct rpc_context *rpc, rpc_cb cb, struct MKDIR3args *args, void *private_data);
623
624 /*
625 * Call NFS3/RMDIR
626 * Function returns
627 * 0 : The call was initiated. The callback will be invoked when the call completes.
628 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
629 *
630 * When the callback is invoked, status indicates the result:
631 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
632 * data is RMDIR3res *
633 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
634 * data is the error string.
635 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
636 * data is NULL.
637 */
638 struct RMDIR3args;
639 EXTERN int rpc_nfs3_rmdir_async(struct rpc_context *rpc, rpc_cb cb, struct RMDIR3args *args, void *private_data);
640 EXTERN int rpc_nfs_rmdir_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *dir, void *private_data);
641
642 /*
643 * Call NFS3/CREATE
644 * Function returns
645 * 0 : The call was initiated. The callback will be invoked when the call completes.
646 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
647 *
648 * When the callback is invoked, status indicates the result:
649 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
650 * data is CREATE3res *
651 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
652 * data is the error string.
653 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
654 * data is NULL.
655 */
656 struct CREATE3args;
657 EXTERN int rpc_nfs3_create_async(struct rpc_context *rpc, rpc_cb cb, struct CREATE3args *args, void *private_data);
658 EXTERN int rpc_nfs_create_async(struct rpc_context *rpc, rpc_cb cb, struct CREATE3args *args, void *private_data);
659
660 /*
661 * Call NFS3/MKNOD
662 * Function returns
663 * 0 : The call was initiated. The callback will be invoked when the call completes.
664 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
665 *
666 * When the callback is invoked, status indicates the result:
667 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
668 * data is MKNOD3res *
669 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
670 * data is the error string.
671 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
672 * data is NULL.
673 */
674 struct MKNOD3args;
675 EXTERN int rpc_nfs3_mknod_async(struct rpc_context *rpc, rpc_cb cb, struct MKNOD3args *args, void *private_data);
676 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);
677
678 /*
679 * Call NFS3/REMOVE
680 * Function returns
681 * 0 : The call was initiated. The callback will be invoked when the call completes.
682 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
683 *
684 * When the callback is invoked, status indicates the result:
685 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
686 * data is REMOVE3res *
687 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
688 * data is the error string.
689 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
690 * data is NULL.
691 */
692 struct REMOVE3args;
693 EXTERN int rpc_nfs3_remove_async(struct rpc_context *rpc, rpc_cb cb, struct REMOVE3args *args, void *private_data);
694 EXTERN int rpc_nfs_remove_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *name, void *private_data);
695
696 /*
697 * Call NFS3/READDIR
698 * Function returns
699 * 0 : The call was initiated. The callback will be invoked when the call completes.
700 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
701 *
702 * When the callback is invoked, status indicates the result:
703 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
704 * data is READDIR3res *
705 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
706 * data is the error string.
707 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
708 * data is NULL.
709 */
710 struct READDIR3args;
711 EXTERN int rpc_nfs3_readdir_async(struct rpc_context *rpc, rpc_cb cb, struct READDIR3args *args, void *private_data);
712 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);
713
714 /*
715 * Call NFS3/READDIRPLUS
716 * Function returns
717 * 0 : The call was initiated. The callback will be invoked when the call completes.
718 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
719 *
720 * When the callback is invoked, status indicates the result:
721 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
722 * data is READDIRPLUS3res *
723 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
724 * data is the error string.
725 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
726 * data is NULL.
727 */
728 struct READDIRPLUS3args;
729 EXTERN int rpc_nfs3_readdirplus_async(struct rpc_context *rpc, rpc_cb cb, struct READDIRPLUS3args *args, void *private_data);
730 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);
731
732 /*
733 * Call NFS3/FSSTAT
734 * Function returns
735 * 0 : The call was initiated. The callback will be invoked when the call completes.
736 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
737 *
738 * When the callback is invoked, status indicates the result:
739 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
740 * data is FSSTAT3res
741 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
742 * data is the error string.
743 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
744 * data is NULL.
745 */
746 struct FSSTAT3args;
747 EXTERN int rpc_nfs3_fsstat_async(struct rpc_context *rpc, rpc_cb cb, struct FSSTAT3args *args, void *private_data);
748 EXTERN int rpc_nfs_fsstat_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
749
750 /*
751 * Call NFS3/FSINFO
752 * Function returns
753 * 0 : The call was initiated. The callback will be invoked when the call completes.
754 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
755 *
756 * When the callback is invoked, status indicates the result:
757 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
758 * data is FSINFO3res
759 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
760 * data is the error string.
761 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
762 * data is NULL.
763 */
764 struct FSINFO3args;
765 EXTERN int rpc_nfs3_fsinfo_async(struct rpc_context *rpc, rpc_cb cb, struct FSINFO3args *args, void *private_data);
766 EXTERN int rpc_nfs_fsinfo_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
767
768 /*
769 * Call NFS3/READLINK
770 * Function returns
771 * 0 : The call was initiated. The callback will be invoked when the call completes.
772 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
773 *
774 * When the callback is invoked, status indicates the result:
775 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
776 * data is READLINK3res *
777 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
778 * data is the error string.
779 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
780 * data is NULL.
781 */
782 struct READLINK3args;
783 EXTERN int rpc_nfs3_readlink_async(struct rpc_context *rpc, rpc_cb cb, struct READLINK3args *args, void *private_data);
784 EXTERN int rpc_nfs_readlink_async(struct rpc_context *rpc, rpc_cb cb, struct READLINK3args *args, void *private_data);
785
786 /*
787 * Call NFS3/SYMLINK
788 * Function returns
789 * 0 : The call was initiated. The callback will be invoked when the call completes.
790 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
791 *
792 * When the callback is invoked, status indicates the result:
793 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
794 * data is SYMLINK3res *
795 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
796 * data is the error string.
797 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
798 * data is NULL.
799 */
800 struct SYMLINK3args;
801 EXTERN int rpc_nfs3_symlink_async(struct rpc_context *rpc, rpc_cb cb, struct SYMLINK3args *args, void *private_data);
802 EXTERN int rpc_nfs_symlink_async(struct rpc_context *rpc, rpc_cb cb, struct SYMLINK3args *args, void *private_data);
803
804 /*
805 * Call NFS3/RENAME
806 * Function returns
807 * 0 : The call was initiated. The callback will be invoked when the call completes.
808 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
809 *
810 * When the callback is invoked, status indicates the result:
811 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
812 * data is RENAME3res *
813 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
814 * data is the error string.
815 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
816 * data is NULL.
817 */
818 struct RENAME3args;
819 EXTERN int rpc_nfs3_rename_async(struct rpc_context *rpc, rpc_cb cb, struct RENAME3args *args, void *private_data);
820 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);
821
822 /*
823 * Call NFS3/LINK
824 * Function returns
825 * 0 : The call was initiated. The callback will be invoked when the call completes.
826 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
827 *
828 * When the callback is invoked, status indicates the result:
829 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
830 * data is LINK3res *
831 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
832 * data is the error string.
833 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
834 * data is NULL.
835 */
836 struct LINK3args;
837 EXTERN int rpc_nfs3_link_async(struct rpc_context *rpc, rpc_cb cb, struct LINK3args *args, void *private_data);
838 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);
839
840 /*
841 * NFS v2 FUNCTIONS
842 */
843
844 /*
845 * Call NFS2/NULL
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 NULL.
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 */
858 EXTERN int rpc_nfs2_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
859
860 /*
861 * Call NFS2/GETATTR
862 * Function returns
863 * 0 : The call was initiated. The callback will be invoked when the call completes.
864 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
865 *
866 * When the callback is invoked, status indicates the result:
867 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
868 * data is GETATTR2res
869 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
870 * data is the error string.
871 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
872 * data is NULL.
873 */
874 struct GETATTR2args;
875 EXTERN int rpc_nfs2_getattr_async(struct rpc_context *rpc, rpc_cb cb, struct GETATTR2args *args, void *private_data);
876
877 /*
878 * Call NFS2/SETATTR
879 * Function returns
880 * 0 : The call was initiated. The callback will be invoked when the call completes.
881 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
882 *
883 * When the callback is invoked, status indicates the result:
884 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
885 * data is SETATTR2res *
886 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
887 * data is the error string.
888 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
889 * data is NULL.
890 */
891 struct SETATTR2args;
892 EXTERN int rpc_nfs2_setattr_async(struct rpc_context *rpc, rpc_cb cb, struct SETATTR2args *args, void *private_data);
893
894 /*
895 * Call NFS2/LOOKUP
896 * Function returns
897 * 0 : The call was initiated. The callback will be invoked when the call completes.
898 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
899 *
900 * When the callback is invoked, status indicates the result:
901 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
902 * data is LOOKUP2res
903 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
904 * data is the error string.
905 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
906 * data is NULL.
907 */
908 struct LOOKUP2args;
909 EXTERN int rpc_nfs2_lookup_async(struct rpc_context *rpc, rpc_cb cb, struct LOOKUP2args *args, void *private_data);
910
911 /*
912 * Call NFS2/READLINK
913 * Function returns
914 * 0 : The call was initiated. The callback will be invoked when the call completes.
915 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
916 *
917 * When the callback is invoked, status indicates the result:
918 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
919 * data is READLINK2res *
920 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
921 * data is the error string.
922 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
923 * data is NULL.
924 */
925 struct READLINK2args;
926 EXTERN int rpc_nfs32_readlink_async(struct rpc_context *rpc, rpc_cb cb, struct READLINK2args *args, void *private_data);
927
928 /*
929 * Call NFS2/READ
930 * Function returns
931 * 0 : The call was initiated. The callback will be invoked when the call completes.
932 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
933 *
934 * When the callback is invoked, status indicates the result:
935 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
936 * data is READ2res
937 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
938 * data is the error string.
939 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
940 * data is NULL.
941 */
942 struct READ2args;
943 EXTERN int rpc_nfs2_read_async(struct rpc_context *rpc, rpc_cb cb, struct READ2args *args, void *private_data);
944
945 /*
946 * Call NFS2/WRITE
947 * Function returns
948 * 0 : The call was initiated. The callback will be invoked when the call completes.
949 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
950 *
951 * When the callback is invoked, status indicates the result:
952 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
953 * data is WRITE2res *
954 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
955 * data is the error string.
956 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
957 * data is NULL.
958 */
959 struct WRITE2args;
960 EXTERN int rpc_nfs2_write_async(struct rpc_context *rpc, rpc_cb cb, struct WRITE2args *args, void *private_data);
961
962 /*
963 * Call NFS2/CREATE
964 * Function returns
965 * 0 : The call was initiated. The callback will be invoked when the call completes.
966 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
967 *
968 * When the callback is invoked, status indicates the result:
969 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
970 * data is CREATE2res *
971 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
972 * data is the error string.
973 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
974 * data is NULL.
975 */
976 struct CREATE2args;
977 EXTERN int rpc_nfs2_create_async(struct rpc_context *rpc, rpc_cb cb, struct CREATE2args *args, void *private_data);
978
979 /*
980 * Call NFS2/REMOVE
981 * Function returns
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.
984 *
985 * When the callback is invoked, status indicates the result:
986 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
987 * data is REMOVE2res *
988 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
989 * data is the error string.
990 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
991 * data is NULL.
992 */
993 struct REMOVE2args;
994 EXTERN int rpc_nfs2_remove_async(struct rpc_context *rpc, rpc_cb cb, struct REMOVE2args *args, void *private_data);
995
996 /*
997 * Call NFS2/RENAME
998 * Function returns
999 * 0 : The call was initiated. The callback will be invoked when the call completes.
1000 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1001 *
1002 * When the callback is invoked, status indicates the result:
1003 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
1004 * data is RENAME2res *
1005 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
1006 * data is the error string.
1007 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1008 * data is NULL.
1009 */
1010 struct RENAME2args;
1011 EXTERN int rpc_nfs2_rename_async(struct rpc_context *rpc, rpc_cb cb, struct RENAME2args *args, void *private_data);
1012
1013 /*
1014 * Call NFS2/LINK
1015 * Function returns
1016 * 0 : The call was initiated. The callback will be invoked when the call completes.
1017 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1018 *
1019 * When the callback is invoked, status indicates the result:
1020 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
1021 * data is LINK2res *
1022 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
1023 * data is the error string.
1024 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1025 * data is NULL.
1026 */
1027 struct LINK2args;
1028 EXTERN int rpc_nfs2_link_async(struct rpc_context *rpc, rpc_cb cb, struct LINK2args *args, void *private_data);
1029
1030 /*
1031 * Call NFS2/SYMLINK
1032 * Function returns
1033 * 0 : The call was initiated. The callback will be invoked when the call completes.
1034 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1035 *
1036 * When the callback is invoked, status indicates the result:
1037 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
1038 * data is SYMLINK2res *
1039 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
1040 * data is the error string.
1041 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1042 * data is NULL.
1043 */
1044 struct SYMLINK2args;
1045 EXTERN int rpc_nfs2_symlink_async(struct rpc_context *rpc, rpc_cb cb, struct SYMLINK2args *args, void *private_data);
1046
1047 /*
1048 * Call NFS2/MKDIR
1049 * Function returns
1050 * 0 : The call was initiated. The callback will be invoked when the call completes.
1051 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1052 *
1053 * When the callback is invoked, status indicates the result:
1054 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
1055 * data is MKDIR2res *
1056 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
1057 * data is the error string.
1058 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1059 * data is NULL.
1060 */
1061 struct MKDIR2args;
1062 EXTERN int rpc_nfs2_mkdir_async(struct rpc_context *rpc, rpc_cb cb, struct MKDIR2args *args, void *private_data);
1063
1064 /*
1065 * Call NFS2/RMDIR
1066 * Function returns
1067 * 0 : The call was initiated. The callback will be invoked when the call completes.
1068 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1069 *
1070 * When the callback is invoked, status indicates the result:
1071 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
1072 * data is RMDIR2res *
1073 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
1074 * data is the error string.
1075 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1076 * data is NULL.
1077 */
1078 struct RMDIR2args;
1079 EXTERN int rpc_nfs2_rmdir_async(struct rpc_context *rpc, rpc_cb cb, struct RMDIR2args *args, void *private_data);
1080
1081 /*
1082 * Call NFS2/READDIR
1083 * Function returns
1084 * 0 : The call was initiated. The callback will be invoked when the call completes.
1085 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1086 *
1087 * When the callback is invoked, status indicates the result:
1088 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
1089 * data is READDIR2res *
1090 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
1091 * data is the error string.
1092 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1093 * data is NULL.
1094 */
1095 struct READDIR2args;
1096 EXTERN int rpc_nfs2_readdir_async(struct rpc_context *rpc, rpc_cb cb, struct READDIR2args *args, void *private_data);
1097
1098 /*
1099 * Call NFS2/STATFS
1100 * Function returns
1101 * 0 : The call was initiated. The callback will be invoked when the call completes.
1102 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1103 *
1104 * When the callback is invoked, status indicates the result:
1105 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
1106 * data is STATFS2res *
1107 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
1108 * data is the error string.
1109 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1110 * data is NULL.
1111 */
1112 struct STATFS2args;
1113 EXTERN int rpc_nfs2_statfs_async(struct rpc_context *rpc, rpc_cb cb, struct STATFS2args *args, void *private_data);
1114
1115 /*
1116 * RQUOTA FUNCTIONS
1117 */
1118 char *rquotastat_to_str(int error);
1119 int rquotastat_to_errno(int error);
1120
1121 /*
1122 * Call RQUOTA1/NULL
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 NULL.
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 */
1135 EXTERN int rpc_rquota1_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
1136
1137 /*
1138 * Call RQUOTA1/GETQUOTA
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 */
1151 EXTERN int rpc_rquota1_getquota_async(struct rpc_context *rpc, rpc_cb cb, char *exportname, int uid, void *private_data);
1152
1153 /*
1154 * Call RQUOTA1/GETACTIVEQUOTA
1155 * Function returns
1156 * 0 : The call was initiated. The callback will be invoked when the call completes.
1157 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1158 *
1159 * When the callback is invoked, status indicates the result:
1160 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
1161 * data is a RQUOTA1res structure.
1162 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
1163 * data is the error string.
1164 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1165 * data is NULL.
1166 */
1167 EXTERN int rpc_rquota1_getactivequota_async(struct rpc_context *rpc, rpc_cb cb, char *exportname, int uid, void *private_data);
1168
1169
1170
1171
1172 /*
1173 * Call RQUOTA2/NULL
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 NULL.
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 */
1186 int rpc_rquota2_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
1187
1188 /*
1189 * Call RQUOTA2/GETQUOTA
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 */
1202 int rpc_rquota2_getquota_async(struct rpc_context *rpc, rpc_cb cb, char *exportname, int type, int uid, void *private_data);
1203
1204 /*
1205 * Call RQUOTA2/GETACTIVEQUOTA
1206 * Function returns
1207 * 0 : The call was initiated. The callback will be invoked when the call completes.
1208 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1209 *
1210 * When the callback is invoked, status indicates the result:
1211 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
1212 * data is a RQUOTA1res structure.
1213 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
1214 * data is the error string.
1215 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1216 * data is NULL.
1217 */
1218 int rpc_rquota2_getactivequota_async(struct rpc_context *rpc, rpc_cb cb, char *exportname, int type, int uid, void *private_data);
1219
1220
1221
1222
1223
1224
1225 /*
1226 * NFSACL functions
1227 */
1228
1229 /*
1230 * Call NFSACL/NULL
1231 * Call the NULL procedure for the NFSACL
1232 *
1233 * Function returns
1234 * 0 : The call was initiated. The callback will be invoked when the call completes.
1235 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1236 *
1237 * When the callback is invoked, status indicates the result:
1238 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
1239 * data is NULL
1240 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
1241 * data is the error string.
1242 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1243 * data is NULL.
1244 */
1245 EXTERN int rpc_nfsacl_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
1246
1247 /*
1248 * Call NFSACL/GETACL
1249 *
1250 * Function returns
1251 * 0 : The call was initiated. The callback will be invoked when the call completes.
1252 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1253 *
1254 * When the callback is invoked, status indicates the result:
1255 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
1256 * data is a GETACL3res pointer
1257 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
1258 * data is the error string.
1259 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1260 * data is NULL.
1261 */
1262 struct GETACL3args;
1263 EXTERN int rpc_nfsacl_getacl_async(struct rpc_context *rpc, rpc_cb cb, struct GETACL3args *args, void *private_data);
1264
1265
1266
1267 /*
1268 * Call NFSACL/SETACL
1269 *
1270 * Function returns
1271 * 0 : The call was initiated. The callback will be invoked when the call completes.
1272 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1273 *
1274 * When the callback is invoked, status indicates the result:
1275 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
1276 * data is a SETACL3res pointer
1277 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
1278 * data is the error string.
1279 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1280 * data is NULL.
1281 */
1282 struct SETACL3args;
1283 EXTERN int rpc_nfsacl_setacl_async(struct rpc_context *rpc, rpc_cb cb, struct SETACL3args *args, void *private_data);
1284
1285
1286
1287
1288 /*
1289 * NLM functions
1290 */
1291 char *nlmstat4_to_str(int stat);
1292
1293 /*
1294 * Call NLM/NULL
1295 * Call the NULL procedure for the NLM protocol
1296 *
1297 * Function returns
1298 * 0 : The call was initiated. The callback will be invoked when the call completes.
1299 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1300 *
1301 * When the callback is invoked, status indicates the result:
1302 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
1303 * data is NULL
1304 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
1305 * data is the error string.
1306 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1307 * data is NULL.
1308 */
1309 EXTERN int rpc_nlm4_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
1310
1311 /*
1312 * Call NLM/TEST
1313 * Call the TEST procedure for the NLM protocol
1314 *
1315 * Function returns
1316 * 0 : The call was initiated. The callback will be invoked when the call completes.
1317 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1318 *
1319 * When the callback is invoked, status indicates the result:
1320 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
1321 * data is NLM4_TESTres
1322 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
1323 * data is the error string.
1324 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1325 * data is NULL.
1326 */
1327 struct NLM4_TESTargs;
1328 EXTERN int rpc_nlm4_test_async(struct rpc_context *rpc, rpc_cb cb, struct NLM4_TESTargs *args, void *private_data);
1329
1330 /*
1331 * Call NLM/LOCK
1332 * Call the LOCK procedure for the NLM protocol
1333 *
1334 * Function returns
1335 * 0 : The call was initiated. The callback will be invoked when the call completes.
1336 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1337 *
1338 * When the callback is invoked, status indicates the result:
1339 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
1340 * data is NLM4_LOCKres
1341 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
1342 * data is the error string.
1343 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1344 * data is NULL.
1345 */
1346 struct NLM4_LOCKargs;
1347 EXTERN int rpc_nlm4_lock_async(struct rpc_context *rpc, rpc_cb cb, struct NLM4_LOCKargs *args, void *private_data);
1348
1349 /*
1350 * Call NLM/CANCEL
1351 * Call the CANCEL procedure for the NLM protocol
1352 *
1353 * Function returns
1354 * 0 : The call was initiated. The callback will be invoked when the call completes.
1355 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1356 *
1357 * When the callback is invoked, status indicates the result:
1358 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
1359 * data is NLM4_CANCres
1360 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
1361 * data is the error string.
1362 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1363 * data is NULL.
1364 */
1365 struct NLM4_CANCargs;
1366 EXTERN int rpc_nlm4_cancel_async(struct rpc_context *rpc, rpc_cb cb, struct NLM4_CANCargs *args, void *private_data);
1367
1368 /*
1369 * Call NLM/UNLOCK
1370 * Call the UNLOCK procedure for the NLM protocol
1371 *
1372 * Function returns
1373 * 0 : The call was initiated. The callback will be invoked when the call completes.
1374 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1375 *
1376 * When the callback is invoked, status indicates the result:
1377 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
1378 * data is NLM4_UNLOCKres
1379 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
1380 * data is the error string.
1381 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1382 * data is NULL.
1383 */
1384 struct NLM4_UNLOCKargs;
1385 EXTERN int rpc_nlm4_unlock_async(struct rpc_context *rpc, rpc_cb cb, struct NLM4_UNLOCKargs *args, void *private_data);
1386
1387 /*
1388 * NSM functions
1389 */
1390 char *nsmstat1_to_str(int stat);
1391
1392 /*
1393 * Call NSM/NULL
1394 * Call the NULL procedure for the NSM protocol
1395 *
1396 * Function returns
1397 * 0 : The call was initiated. The callback will be invoked when the call completes.
1398 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1399 *
1400 * When the callback is invoked, status indicates the result:
1401 * RPC_STATUS_SUCCESS : We got a successful response from the nsm daemon.
1402 * data is NULL
1403 * RPC_STATUS_ERROR : An error occured when trying to contact the nsm daemon.
1404 * data is the error string.
1405 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1406 * data is NULL.
1407 */
1408 EXTERN int rpc_nsm1_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
1409
1410 /*
1411 * Call NSM/STAT
1412 * Call the STAT procedure for the NSM protocol
1413 *
1414 * Function returns
1415 * 0 : The call was initiated. The callback will be invoked when the call completes.
1416 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1417 *
1418 * When the callback is invoked, status indicates the result:
1419 * RPC_STATUS_SUCCESS : We got a successful response from the nsm daemon.
1420 * data is NSM1_STATres
1421 * RPC_STATUS_ERROR : An error occured when trying to contact the nsm daemon.
1422 * data is the error string.
1423 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1424 * data is NULL.
1425 */
1426 struct NSM1_STATargs;
1427 EXTERN int rpc_nsm1_stat_async(struct rpc_context *rpc, rpc_cb cb, struct NSM1_STATargs *args, void *private_data);
1428
1429 /*
1430 * Call NSM/MON
1431 * Call the MON procedure for the NSM protocol
1432 *
1433 * Function returns
1434 * 0 : The call was initiated. The callback will be invoked when the call completes.
1435 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1436 *
1437 * When the callback is invoked, status indicates the result:
1438 * RPC_STATUS_SUCCESS : We got a successful response from the nsm daemon.
1439 * data is NSM1_MONres
1440 * RPC_STATUS_ERROR : An error occured when trying to contact the nsm daemon.
1441 * data is the error string.
1442 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1443 * data is NULL.
1444 */
1445 struct NSM1_MONargs;
1446 EXTERN int rpc_nsm1_mon_async(struct rpc_context *rpc, rpc_cb cb, struct NSM1_MONargs *args, void *private_data);
1447
1448 /*
1449 * Call NSM/UNMON
1450 * Call the UNMON procedure for the NSM protocol
1451 *
1452 * Function returns
1453 * 0 : The call was initiated. The callback will be invoked when the call completes.
1454 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1455 *
1456 * When the callback is invoked, status indicates the result:
1457 * RPC_STATUS_SUCCESS : We got a successful response from the nsm daemon.
1458 * data is NSM1_UNMONres
1459 * RPC_STATUS_ERROR : An error occured when trying to contact the nsm daemon.
1460 * data is the error string.
1461 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1462 * data is NULL.
1463 */
1464 struct NSM1_UNMONargs;
1465 EXTERN int rpc_nsm1_unmon_async(struct rpc_context *rpc, rpc_cb cb, struct NSM1_UNMONargs *args, void *private_data);
1466
1467 /*
1468 * Call NSM/UNMONALL
1469 * Call the UNMONALL procedure for the NSM protocol
1470 *
1471 * Function returns
1472 * 0 : The call was initiated. The callback will be invoked when the call completes.
1473 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1474 *
1475 * When the callback is invoked, status indicates the result:
1476 * RPC_STATUS_SUCCESS : We got a successful response from the nsm daemon.
1477 * data is NSM1_UNMONALLres
1478 * RPC_STATUS_ERROR : An error occured when trying to contact the nsm daemon.
1479 * data is the error string.
1480 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1481 * data is NULL.
1482 */
1483 struct NSM1_UNMONALLargs;
1484 EXTERN int rpc_nsm1_unmonall_async(struct rpc_context *rpc, rpc_cb cb, struct NSM1_UNMONALLargs *args, void *private_data);
1485
1486 /*
1487 * Call NSM/SIMUCRASH
1488 * Call the SIMUCRASH procedure for the NSM protocol
1489 *
1490 * Function returns
1491 * 0 : The call was initiated. The callback will be invoked when the call completes.
1492 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1493 *
1494 * When the callback is invoked, status indicates the result:
1495 * RPC_STATUS_SUCCESS : We got a successful response from the nsm daemon.
1496 * data is NULL
1497 * RPC_STATUS_ERROR : An error occured when trying to contact the nsm daemon.
1498 * data is the error string.
1499 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1500 * data is NULL.
1501 */
1502 EXTERN int rpc_nsm1_simucrash_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
1503
1504 /*
1505 * Call NSM/NOTIFY
1506 * Call the NOTIFY procedure for the NSM protocol
1507 *
1508 * Function returns
1509 * 0 : The call was initiated. The callback will be invoked when the call completes.
1510 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1511 *
1512 * When the callback is invoked, status indicates the result:
1513 * RPC_STATUS_SUCCESS : We got a successful response from the nsm daemon.
1514 * data is NULL
1515 * RPC_STATUS_ERROR : An error occured when trying to contact the nsm daemon.
1516 * data is the error string.
1517 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1518 * data is NULL.
1519 */
1520 struct NSM1_NOTIFYargs;
1521 EXTERN int rpc_nsm1_notify_async(struct rpc_context *rpc, rpc_cb cb, struct NSM1_NOTIFYargs *args, void *private_data);
1522
1523 #ifdef __cplusplus
1524 }
1525 #endif
1526
1527 #endif