Create a new function rpc_set_context_args where we parse and set the context
[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 struct rpc_data {
29 int size;
30 unsigned char *data;
31 };
32
33 struct rpc_context;
34 struct rpc_context *rpc_init_context(void);
35 void rpc_destroy_context(struct rpc_context *rpc);
36
37 void rpc_set_auth(struct rpc_context *rpc, struct AUTH *auth);
38
39 int rpc_get_fd(struct rpc_context *rpc);
40 int rpc_which_events(struct rpc_context *rpc);
41 int rpc_service(struct rpc_context *rpc, int revents);
42 char *rpc_get_error(struct rpc_context *rpc);
43 int rpc_queue_length(struct rpc_context *rpc);
44
45 /* Utility function to get an RPC context from a NFS context. Useful for doing low level NFSACL
46 * calls on a NFS context.
47 */
48 struct rpc_context *nfs_get_rpc_context(struct nfs_context *nfs);
49
50 /* This function returns the nfs_fh3 structure from a nfsfh structure.
51 This allows to use a file onened with nfs_open() together with low-level
52 rpc functions that thake a nfs filehandle
53 */
54 struct nfs_fh3 *nfs_get_fh(struct nfsfh *nfsfh);
55
56 /* Control what the next XID value to be used on the context will be.
57 This can be used when multiple contexts are used to the same server
58 to avoid that the two contexts have xid collissions.
59 */
60 void rpc_set_next_xid(struct rpc_context *rpc, uint32_t xid);
61
62 #define RPC_STATUS_SUCCESS 0
63 #define RPC_STATUS_ERROR 1
64 #define RPC_STATUS_CANCEL 2
65
66 /*
67 * Async connection to the tcp port at server:port.
68 * Function returns
69 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
70 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
71 *
72 * When the callback is invoked, status indicates the result:
73 * RPC_STATUS_SUCCESS : The tcp connection was successfully established.
74 * data is NULL.
75 * RPC_STATUS_ERROR : The connection failed to establish.
76 * data is the erro string.
77 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
78 * : data is NULL.
79 */
80 int rpc_connect_async(struct rpc_context *rpc, const char *server, int port, rpc_cb cb, void *private_data);
81 /*
82 * Async function to connect to a specific RPC program/version
83 * Function returns
84 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
85 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
86 *
87 * When the callback is invoked, status indicates the result:
88 * RPC_STATUS_SUCCESS : The tcp connection was successfully established.
89 * data is NULL.
90 * RPC_STATUS_ERROR : The connection failed to establish.
91 * data is the erro string.
92 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
93 * : data is NULL.
94 */
95 int rpc_connect_program_async(struct rpc_context *rpc, char *server, int program, int version, rpc_cb cb, void *private_data);
96 /*
97 * When disconnecting a connection in flight. All commands in flight will be called with the callback
98 * and status RPC_STATUS_ERROR. Data will be the error string for the disconnection.
99 */
100 int rpc_disconnect(struct rpc_context *rpc, char *error);
101
102
103 /*
104 * PORTMAP FUNCTIONS
105 */
106
107 /*
108 * Call PORTMAPPER/NULL
109 * Function returns
110 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
111 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
112 *
113 * When the callback is invoked, status indicates the result:
114 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
115 * data is NULL.
116 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
117 * data is the error string.
118 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
119 * data is NULL.
120 */
121 EXTERN int rpc_pmap_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
122
123
124 /*
125 * Call PORTMAPPER/GETPORT.
126 * Function returns
127 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
128 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
129 *
130 * When the callback is invoked, status indicates the result:
131 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
132 * data is a (uint32_t *), containing the port returned.
133 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
134 * data is the error string.
135 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
136 * data is NULL.
137 */
138 EXTERN int rpc_pmap_getport_async(struct rpc_context *rpc, int program, int version, int protocol, rpc_cb cb, void *private_data);
139
140 /*
141 * Call PORTMAPPER/SET
142 * Function returns
143 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
144 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
145 *
146 * When the callback is invoked, status indicates the result:
147 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
148 * data is a (uint32_t *), containing status
149 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
150 * data is the error string.
151 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
152 * data is NULL.
153 */
154 EXTERN int rpc_pmap_set_async(struct rpc_context *rpc, int program, int version, int protocol, int port, rpc_cb cb, void *private_data);
155
156 /*
157 * Call PORTMAPPER/UNSET
158 * Function returns
159 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
160 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
161 *
162 * When the callback is invoked, status indicates the result:
163 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
164 * data is a (uint32_t *), containing status
165 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
166 * data is the error string.
167 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
168 * data is NULL.
169 */
170 EXTERN int rpc_pmap_unset_async(struct rpc_context *rpc, int program, int version, int protocol, int port, rpc_cb cb, void *private_data);
171
172 /*
173 * Call PORTMAPPER/CALLIT.
174 * Function returns
175 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
176 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
177 *
178 * When the callback is invoked, status indicates the result:
179 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon
180 * data is a 'pmap_call_result' pointer.
181 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
182 * data is the error string.
183 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
184 * data is NULL.
185 */
186 EXTERN int rpc_pmap_callit_async(struct rpc_context *rpc, int program, int version, int procedure, char *data, int datalen, rpc_cb cb, void *private_data);
187
188 /*
189 * MOUNT v3 FUNCTIONS
190 */
191 char *mountstat3_to_str(int stat);
192 int mountstat3_to_errno(int error);
193
194 /*
195 * Call MOUNT3/NULL
196 * Function returns
197 * 0 : The call was initiated. The callback will be invoked when the call completes.
198 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
199 *
200 * When the callback is invoked, status indicates the result:
201 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
202 * data is NULL.
203 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
204 * data is the error string.
205 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
206 * data is NULL.
207 */
208 EXTERN int rpc_mount3_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
209 EXTERN int rpc_mount_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
210
211 /*
212 * Call MOUNT3/MNT
213 * Function returns
214 * 0 : The call was initiated. The callback will be invoked when the call completes.
215 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
216 *
217 * When the callback is invoked, status indicates the result:
218 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
219 * data is union mountres3.
220 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
221 * data is the error string.
222 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
223 * data is NULL.
224 */
225 EXTERN int rpc_mount3_mnt_async(struct rpc_context *rpc, rpc_cb cb, char *export, void *private_data);
226 EXTERN int rpc_mount_mnt_async(struct rpc_context *rpc, rpc_cb cb, char *export, void *private_data);
227
228 /*
229 * Call MOUNT3/DUMP
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 a mountlist.
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_dump_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
243 EXTERN int rpc_mount_dump_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
244
245 /*
246 * Call MOUNT3/UMNT
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 NULL.
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_umnt_async(struct rpc_context *rpc, rpc_cb cb, char *export, void *private_data);
260 EXTERN int rpc_mount_umnt_async(struct rpc_context *rpc, rpc_cb cb, char *export, void *private_data);
261
262 /*
263 * Call MOUNT3/UMNTALL
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 NULL.
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_umntall_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
277 EXTERN int rpc_mount_umntall_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
278
279 /*
280 * Call MOUNT3/EXPORT
281 * NOTE: You must include 'libnfs-raw-mount.h' to get the definitions of the
282 * returned structures.
283 *
284 * Function returns
285 * 0 : The call was initiated. The callback will be invoked when the call completes.
286 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
287 *
288 * When the callback is invoked, status indicates the result:
289 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
290 * data is a pointer to an exports pointer:
291 * exports export = *(exports *)data;
292 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
293 * data is the error string.
294 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
295 * data is NULL.
296 */
297 EXTERN int rpc_mount3_export_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
298 EXTERN int rpc_mount_export_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
299
300 /*
301 * MOUNT v1 FUNCTIONS (Used with NFSv2)
302 */
303 /*
304 * Call MOUNT1/NULL
305 * Function returns
306 * 0 : The call was initiated. The callback will be invoked when the call completes.
307 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
308 *
309 * When the callback is invoked, status indicates the result:
310 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
311 * data is NULL.
312 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
313 * data is the error string.
314 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
315 * data is NULL.
316 */
317 EXTERN int rpc_mount1_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
318
319 /*
320 * Call MOUNT1/MNT
321 * Function returns
322 * 0 : The call was initiated. The callback will be invoked when the call completes.
323 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
324 *
325 * When the callback is invoked, status indicates the result:
326 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
327 * data is union mountres1.
328 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
329 * data is the error string.
330 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
331 * data is NULL.
332 */
333 EXTERN int rpc_mount1_mnt_async(struct rpc_context *rpc, rpc_cb cb, char *export, void *private_data);
334
335 /*
336 * Call MOUNT1/DUMP
337 * Function returns
338 * 0 : The call was initiated. The callback will be invoked when the call completes.
339 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
340 *
341 * When the callback is invoked, status indicates the result:
342 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
343 * data is a mountlist.
344 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
345 * data is the error string.
346 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
347 * data is NULL.
348 */
349 EXTERN int rpc_mount1_dump_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
350
351 /*
352 * Call MOUNT1/UMNT
353 * Function returns
354 * 0 : The call was initiated. The callback will be invoked when the call completes.
355 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
356 *
357 * When the callback is invoked, status indicates the result:
358 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
359 * data NULL.
360 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
361 * data is the error string.
362 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
363 * data is NULL.
364 */
365 EXTERN int rpc_mount1_umnt_async(struct rpc_context *rpc, rpc_cb cb, char *export, void *private_data);
366
367 /*
368 * Call MOUNT1/UMNTALL
369 * Function returns
370 * 0 : The call was initiated. The callback will be invoked when the call completes.
371 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
372 *
373 * When the callback is invoked, status indicates the result:
374 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
375 * data NULL.
376 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
377 * data is the error string.
378 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
379 * data is NULL.
380 */
381 EXTERN int rpc_mount1_umntall_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
382
383 /*
384 * Call MOUNT1/EXPORT
385 * NOTE: You must include 'libnfs-raw-mount.h' to get the definitions of the
386 * returned structures.
387 *
388 * Function returns
389 * 0 : The call was initiated. The callback will be invoked when the call completes.
390 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
391 *
392 * When the callback is invoked, status indicates the result:
393 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
394 * data is a pointer to an exports pointer:
395 * exports export = *(exports *)data;
396 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
397 * data is the error string.
398 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
399 * data is NULL.
400 */
401 EXTERN int rpc_mount1_export_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
402
403
404 /*
405 * NFS v3 FUNCTIONS
406 */
407 struct nfs_fh3;
408 char *nfsstat3_to_str(int error);
409 int nfsstat3_to_errno(int error);
410
411 /*
412 * Call NFS3/NULL
413 * Function returns
414 * 0 : The call was initiated. The callback will be invoked when the call completes.
415 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
416 *
417 * When the callback is invoked, status indicates the result:
418 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
419 * data is NULL.
420 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
421 * data is the error string.
422 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
423 * data is NULL.
424 */
425 EXTERN int rpc_nfs3_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
426 EXTERN int rpc_nfs_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
427
428 /*
429 * Call NFS3/GETATTR
430 * Function returns
431 * 0 : The call was initiated. The callback will be invoked when the call completes.
432 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
433 *
434 * When the callback is invoked, status indicates the result:
435 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
436 * data is GETATTR3res
437 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
438 * data is the error string.
439 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
440 * data is NULL.
441 */
442 struct GETATTR3args;
443 EXTERN int rpc_nfs3_getattr_async(struct rpc_context *rpc, rpc_cb cb, struct GETATTR3args *args, void *private_data);
444 EXTERN int rpc_nfs_getattr_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
445
446 /*
447 * Call NFS3/PATHCONF
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 PATHCONF3res
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 */
460 struct PATHCONF3args;
461 EXTERN int rpc_nfs3_pathconf_async(struct rpc_context *rpc, rpc_cb cb, struct PATHCONF3args *args, void *private_data);
462 EXTERN int rpc_nfs_pathconf_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
463
464 /*
465 * Call NFS3/LOOKUP
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 LOOKUP3res
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 */
478 struct LOOKUP3args;
479 EXTERN int rpc_nfs3_lookup_async(struct rpc_context *rpc, rpc_cb cb, struct LOOKUP3args *args, void *private_data);
480 EXTERN int rpc_nfs_lookup_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *name, void *private_data);
481
482 /*
483 * Call NFS3/ACCESS
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 ACCESS3res
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 */
496 struct ACCESS3args;
497 EXTERN int rpc_nfs3_access_async(struct rpc_context *rpc, rpc_cb cb, struct ACCESS3args *args, void *private_data);
498 EXTERN int rpc_nfs_access_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, int access, void *private_data);
499
500 /*
501 * Call NFS3/READ
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 READ3res
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 */
514 struct READ3args;
515 EXTERN int rpc_nfs3_read_async(struct rpc_context *rpc, rpc_cb cb, struct READ3args *args, void *private_data);
516 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);
517
518 /*
519 * Call NFS3/WRITE
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 WRITE3res *
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 */
532 struct WRITE3args;
533 EXTERN int rpc_nfs3_write_async(struct rpc_context *rpc, rpc_cb cb, struct WRITE3args *args, void *private_data);
534 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);
535
536 /*
537 * Call NFS3/COMMIT
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 COMMIT3res *
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 */
550 struct COMMIT3args;
551 EXTERN int rpc_nfs3_commit_async(struct rpc_context *rpc, rpc_cb cb, struct COMMIT3args *args, void *private_data);
552 EXTERN int rpc_nfs_commit_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
553
554 /*
555 * Call NFS3/SETATTR
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 SETATTR3res *
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 */
568 struct SETATTR3args;
569 EXTERN int rpc_nfs3_setattr_async(struct rpc_context *rpc, rpc_cb cb, struct SETATTR3args *args, void *private_data);
570 EXTERN int rpc_nfs_setattr_async(struct rpc_context *rpc, rpc_cb cb, struct SETATTR3args *args, void *private_data);
571
572 /*
573 * Call NFS3/MKDIR
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 MKDIR3res *
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 */
586 struct MKDIR3args;
587 EXTERN int rpc_nfs3_mkdir_async(struct rpc_context *rpc, rpc_cb cb, struct MKDIR3args *args, void *private_data);
588 EXTERN int rpc_nfs_mkdir_async(struct rpc_context *rpc, rpc_cb cb, struct MKDIR3args *args, void *private_data);
589
590 /*
591 * Call NFS3/RMDIR
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 RMDIR3res *
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 */
604 struct RMDIR3args;
605 EXTERN int rpc_nfs3_rmdir_async(struct rpc_context *rpc, rpc_cb cb, struct RMDIR3args *args, void *private_data);
606 EXTERN int rpc_nfs_rmdir_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *dir, void *private_data);
607
608 /*
609 * Call NFS3/CREATE
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 CREATE3res *
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 */
622 struct CREATE3args;
623 EXTERN int rpc_nfs3_create_async(struct rpc_context *rpc, rpc_cb cb, struct CREATE3args *args, void *private_data);
624 EXTERN int rpc_nfs_create_async(struct rpc_context *rpc, rpc_cb cb, struct CREATE3args *args, void *private_data);
625
626 /*
627 * Call NFS3/MKNOD
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 MKNOD3res *
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 */
640 struct MKNOD3args;
641 EXTERN int rpc_nfs3_mknod_async(struct rpc_context *rpc, rpc_cb cb, struct MKNOD3args *args, void *private_data);
642 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);
643
644 /*
645 * Call NFS3/REMOVE
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 REMOVE3res *
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 */
658 struct REMOVE3args;
659 EXTERN int rpc_nfs3_remove_async(struct rpc_context *rpc, rpc_cb cb, struct REMOVE3args *args, void *private_data);
660 EXTERN int rpc_nfs_remove_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *name, void *private_data);
661
662 /*
663 * Call NFS3/READDIR
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 READDIR3res *
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 */
676 struct READDIR3args;
677 EXTERN int rpc_nfs3_readdir_async(struct rpc_context *rpc, rpc_cb cb, struct READDIR3args *args, void *private_data);
678 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);
679
680 /*
681 * Call NFS3/READDIRPLUS
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 READDIRPLUS3res *
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 */
694 struct READDIRPLUS3args;
695 EXTERN int rpc_nfs3_readdirplus_async(struct rpc_context *rpc, rpc_cb cb, struct READDIRPLUS3args *args, void *private_data);
696 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);
697
698 /*
699 * Call NFS3/FSSTAT
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 FSSTAT3res
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 */
712 struct FSSTAT3args;
713 EXTERN int rpc_nfs3_fsstat_async(struct rpc_context *rpc, rpc_cb cb, struct FSSTAT3args *args, void *private_data);
714 EXTERN int rpc_nfs_fsstat_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
715
716 /*
717 * Call NFS3/FSINFO
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 FSINFO3res
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 */
730 struct FSINFO3args;
731 EXTERN int rpc_nfs3_fsinfo_async(struct rpc_context *rpc, rpc_cb cb, struct FSINFO3args *args, void *private_data);
732 EXTERN int rpc_nfs_fsinfo_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
733
734 /*
735 * Call NFS3/READLINK
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 READLINK3res *
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 */
748 struct READLINK3args;
749 EXTERN int rpc_nfs3_readlink_async(struct rpc_context *rpc, rpc_cb cb, struct READLINK3args *args, void *private_data);
750 EXTERN int rpc_nfs_readlink_async(struct rpc_context *rpc, rpc_cb cb, struct READLINK3args *args, void *private_data);
751
752 /*
753 * Call NFS3/SYMLINK
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 SYMLINK3res *
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 */
766 struct SYMLINK3args;
767 EXTERN int rpc_nfs3_symlink_async(struct rpc_context *rpc, rpc_cb cb, struct SYMLINK3args *args, void *private_data);
768 EXTERN int rpc_nfs_symlink_async(struct rpc_context *rpc, rpc_cb cb, struct SYMLINK3args *args, void *private_data);
769
770 /*
771 * Call NFS3/RENAME
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 RENAME3res *
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 */
784 struct RENAME3args;
785 EXTERN int rpc_nfs3_rename_async(struct rpc_context *rpc, rpc_cb cb, struct RENAME3args *args, void *private_data);
786 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);
787
788 /*
789 * Call NFS3/LINK
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 LINK3res *
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 */
802 struct LINK3args;
803 EXTERN int rpc_nfs3_link_async(struct rpc_context *rpc, rpc_cb cb, struct LINK3args *args, void *private_data);
804 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);
805
806 /*
807 * NFS v2 FUNCTIONS
808 */
809
810 /*
811 * Call NFS2/NULL
812 * Function returns
813 * 0 : The call was initiated. The callback will be invoked when the call completes.
814 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
815 *
816 * When the callback is invoked, status indicates the result:
817 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
818 * data is NULL.
819 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
820 * data is the error string.
821 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
822 * data is NULL.
823 */
824 EXTERN int rpc_nfs2_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
825
826 /*
827 * Call NFS2/GETATTR
828 * Function returns
829 * 0 : The call was initiated. The callback will be invoked when the call completes.
830 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
831 *
832 * When the callback is invoked, status indicates the result:
833 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
834 * data is GETATTR2res
835 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
836 * data is the error string.
837 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
838 * data is NULL.
839 */
840 struct GETATTR2args;
841 EXTERN int rpc_nfs2_getattr_async(struct rpc_context *rpc, rpc_cb cb, struct GETATTR2args *args, void *private_data);
842
843 /*
844 * Call NFS2/SETATTR
845 * Function returns
846 * 0 : The call was initiated. The callback will be invoked when the call completes.
847 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
848 *
849 * When the callback is invoked, status indicates the result:
850 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
851 * data is SETATTR2res *
852 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
853 * data is the error string.
854 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
855 * data is NULL.
856 */
857 struct SETATTR2args;
858 EXTERN int rpc_nfs2_setattr_async(struct rpc_context *rpc, rpc_cb cb, struct SETATTR2args *args, void *private_data);
859
860 /*
861 * Call NFS2/LOOKUP
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 LOOKUP2res
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 LOOKUP2args;
875 EXTERN int rpc_nfs2_lookup_async(struct rpc_context *rpc, rpc_cb cb, struct LOOKUP2args *args, void *private_data);
876
877 /*
878 * Call NFS2/READLINK
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 READLINK2res *
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 READLINK2args;
892 EXTERN int rpc_nfs32_readlink_async(struct rpc_context *rpc, rpc_cb cb, struct READLINK2args *args, void *private_data);
893
894 /*
895 * Call NFS2/READ
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 READ2res
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 READ2args;
909 EXTERN int rpc_nfs2_read_async(struct rpc_context *rpc, rpc_cb cb, struct READ2args *args, void *private_data);
910
911 /*
912 * Call NFS2/WRITE
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 WRITE2res *
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 WRITE2args;
926 EXTERN int rpc_nfs2_write_async(struct rpc_context *rpc, rpc_cb cb, struct WRITE2args *args, void *private_data);
927
928 /*
929 * Call NFS2/CREATE
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 CREATE2res *
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 CREATE2args;
943 EXTERN int rpc_nfs2_create_async(struct rpc_context *rpc, rpc_cb cb, struct CREATE2args *args, void *private_data);
944
945 /*
946 * Call NFS2/REMOVE
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 REMOVE2res *
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 REMOVE2args;
960 EXTERN int rpc_nfs2_remove_async(struct rpc_context *rpc, rpc_cb cb, struct REMOVE2args *args, void *private_data);
961
962 /*
963 * Call NFS2/RENAME
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 RENAME2res *
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 RENAME2args;
977 EXTERN int rpc_nfs2_rename_async(struct rpc_context *rpc, rpc_cb cb, struct RENAME2args *args, void *private_data);
978
979 /*
980 * Call NFS2/LINK
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 LINK2res *
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 LINK2args;
994 EXTERN int rpc_nfs2_link_async(struct rpc_context *rpc, rpc_cb cb, struct LINK2args *args, void *private_data);
995
996 /*
997 * Call NFS2/SYMLINK
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 SYMLINK2res *
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 SYMLINK2args;
1011 EXTERN int rpc_nfs2_symlink_async(struct rpc_context *rpc, rpc_cb cb, struct SYMLINK2args *args, void *private_data);
1012
1013 /*
1014 * Call NFS2/MKDIR
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 MKDIR2res *
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 MKDIR2args;
1028 EXTERN int rpc_nfs2_mkdir_async(struct rpc_context *rpc, rpc_cb cb, struct MKDIR2args *args, void *private_data);
1029
1030 /*
1031 * Call NFS2/RMDIR
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 RMDIR2res *
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 RMDIR2args;
1045 EXTERN int rpc_nfs2_rmdir_async(struct rpc_context *rpc, rpc_cb cb, struct RMDIR2args *args, void *private_data);
1046
1047 /*
1048 * Call NFS2/READDIR
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 READDIR2res *
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 READDIR2args;
1062 EXTERN int rpc_nfs2_readdir_async(struct rpc_context *rpc, rpc_cb cb, struct READDIR2args *args, void *private_data);
1063
1064 /*
1065 * Call NFS2/STATFS
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 STATFS2res *
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 STATFS2args;
1079 EXTERN int rpc_nfs2_statfs_async(struct rpc_context *rpc, rpc_cb cb, struct STATFS2args *args, void *private_data);
1080
1081 /*
1082 * RQUOTA FUNCTIONS
1083 */
1084 char *rquotastat_to_str(int error);
1085 int rquotastat_to_errno(int error);
1086
1087 /*
1088 * Call RQUOTA1/NULL
1089 * Function returns
1090 * 0 : The call was initiated. The callback will be invoked when the call completes.
1091 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1092 *
1093 * When the callback is invoked, status indicates the result:
1094 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
1095 * data is NULL.
1096 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
1097 * data is the error string.
1098 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1099 * data is NULL.
1100 */
1101 EXTERN int rpc_rquota1_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
1102
1103 /*
1104 * Call RQUOTA1/GETQUOTA
1105 * Function returns
1106 * 0 : The call was initiated. The callback will be invoked when the call completes.
1107 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1108 *
1109 * When the callback is invoked, status indicates the result:
1110 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
1111 * data is a RQUOTA1res structure.
1112 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
1113 * data is the error string.
1114 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1115 * data is NULL.
1116 */
1117 EXTERN int rpc_rquota1_getquota_async(struct rpc_context *rpc, rpc_cb cb, char *export, int uid, void *private_data);
1118
1119 /*
1120 * Call RQUOTA1/GETACTIVEQUOTA
1121 * Function returns
1122 * 0 : The call was initiated. The callback will be invoked when the call completes.
1123 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1124 *
1125 * When the callback is invoked, status indicates the result:
1126 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
1127 * data is a RQUOTA1res structure.
1128 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
1129 * data is the error string.
1130 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1131 * data is NULL.
1132 */
1133 EXTERN int rpc_rquota1_getactivequota_async(struct rpc_context *rpc, rpc_cb cb, char *export, int uid, void *private_data);
1134
1135
1136
1137
1138 /*
1139 * Call RQUOTA2/NULL
1140 * Function returns
1141 * 0 : The call was initiated. The callback will be invoked when the call completes.
1142 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1143 *
1144 * When the callback is invoked, status indicates the result:
1145 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
1146 * data is NULL.
1147 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
1148 * data is the error string.
1149 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1150 * data is NULL.
1151 */
1152 int rpc_rquota2_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
1153
1154 /*
1155 * Call RQUOTA2/GETQUOTA
1156 * Function returns
1157 * 0 : The call was initiated. The callback will be invoked when the call completes.
1158 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1159 *
1160 * When the callback is invoked, status indicates the result:
1161 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
1162 * data is a RQUOTA1res structure.
1163 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
1164 * data is the error string.
1165 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1166 * data is NULL.
1167 */
1168 int rpc_rquota2_getquota_async(struct rpc_context *rpc, rpc_cb cb, char *export, int type, int uid, void *private_data);
1169
1170 /*
1171 * Call RQUOTA2/GETACTIVEQUOTA
1172 * Function returns
1173 * 0 : The call was initiated. The callback will be invoked when the call completes.
1174 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1175 *
1176 * When the callback is invoked, status indicates the result:
1177 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
1178 * data is a RQUOTA1res structure.
1179 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
1180 * data is the error string.
1181 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1182 * data is NULL.
1183 */
1184 int rpc_rquota2_getactivequota_async(struct rpc_context *rpc, rpc_cb cb, char *export, int type, int uid, void *private_data);
1185
1186
1187
1188
1189
1190
1191 /*
1192 * NFSACL functions
1193 */
1194
1195 /*
1196 * Call NFSACL/NULL
1197 * Call the NULL procedure for the NFSACL
1198 *
1199 * Function returns
1200 * 0 : The call was initiated. The callback will be invoked when the call completes.
1201 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1202 *
1203 * When the callback is invoked, status indicates the result:
1204 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
1205 * data is NULL
1206 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
1207 * data is the error string.
1208 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1209 * data is NULL.
1210 */
1211 EXTERN int rpc_nfsacl_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
1212
1213 /*
1214 * Call NFSACL/GETACL
1215 *
1216 * Function returns
1217 * 0 : The call was initiated. The callback will be invoked when the call completes.
1218 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1219 *
1220 * When the callback is invoked, status indicates the result:
1221 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
1222 * data is a GETACL3res pointer
1223 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
1224 * data is the error string.
1225 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1226 * data is NULL.
1227 */
1228 struct GETACL3args;
1229 EXTERN int rpc_nfsacl_getacl_async(struct rpc_context *rpc, rpc_cb cb, struct GETACL3args *args, void *private_data);
1230
1231
1232
1233 /*
1234 * Call NFSACL/SETACL
1235 *
1236 * Function returns
1237 * 0 : The call was initiated. The callback will be invoked when the call completes.
1238 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1239 *
1240 * When the callback is invoked, status indicates the result:
1241 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
1242 * data is a SETACL3res pointer
1243 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
1244 * data is the error string.
1245 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1246 * data is NULL.
1247 */
1248 struct SETACL3args;
1249 EXTERN int rpc_nfsacl_setacl_async(struct rpc_context *rpc, rpc_cb cb, struct SETACL3args *args, void *private_data);
1250
1251
1252
1253
1254 /*
1255 * NLM functions
1256 */
1257 char *nlmstat4_to_str(int stat);
1258
1259 /*
1260 * Call NLM/NULL
1261 * Call the NULL procedure for the NLM protocol
1262 *
1263 * Function returns
1264 * 0 : The call was initiated. The callback will be invoked when the call completes.
1265 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1266 *
1267 * When the callback is invoked, status indicates the result:
1268 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
1269 * data is NULL
1270 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
1271 * data is the error string.
1272 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1273 * data is NULL.
1274 */
1275 EXTERN int rpc_nlm4_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
1276
1277 /*
1278 * Call NLM/TEST
1279 * Call the TEST 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 NLM4_TESTres
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 */
1293 struct NLM4_TESTargs;
1294 EXTERN int rpc_nlm4_test_async(struct rpc_context *rpc, rpc_cb cb, struct NLM4_TESTargs *args, void *private_data);
1295
1296 /*
1297 * Call NLM/LOCK
1298 * Call the LOCK procedure for the NLM protocol
1299 *
1300 * Function returns
1301 * 0 : The call was initiated. The callback will be invoked when the call completes.
1302 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1303 *
1304 * When the callback is invoked, status indicates the result:
1305 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
1306 * data is NLM4_LOCKres
1307 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
1308 * data is the error string.
1309 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1310 * data is NULL.
1311 */
1312 struct NLM4_LOCKargs;
1313 EXTERN int rpc_nlm4_lock_async(struct rpc_context *rpc, rpc_cb cb, struct NLM4_LOCKargs *args, void *private_data);
1314
1315 /*
1316 * Call NLM/CANCEL
1317 * Call the CANCEL procedure for the NLM protocol
1318 *
1319 * Function returns
1320 * 0 : The call was initiated. The callback will be invoked when the call completes.
1321 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1322 *
1323 * When the callback is invoked, status indicates the result:
1324 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
1325 * data is NLM4_CANCres
1326 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
1327 * data is the error string.
1328 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1329 * data is NULL.
1330 */
1331 struct NLM4_CANCargs;
1332 EXTERN int rpc_nlm4_cancel_async(struct rpc_context *rpc, rpc_cb cb, struct NLM4_CANCargs *args, void *private_data);
1333
1334 /*
1335 * Call NLM/UNLOCK
1336 * Call the UNLOCK procedure for the NLM protocol
1337 *
1338 * Function returns
1339 * 0 : The call was initiated. The callback will be invoked when the call completes.
1340 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1341 *
1342 * When the callback is invoked, status indicates the result:
1343 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
1344 * data is NLM4_UNLOCKres
1345 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
1346 * data is the error string.
1347 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1348 * data is NULL.
1349 */
1350 struct NLM4_UNLOCKargs;
1351 EXTERN int rpc_nlm4_unlock_async(struct rpc_context *rpc, rpc_cb cb, struct NLM4_UNLOCKargs *args, void *private_data);
1352
1353 /*
1354 * NSM functions
1355 */
1356 char *nsmstat1_to_str(int stat);
1357
1358 /*
1359 * Call NSM/NULL
1360 * Call the NULL procedure for the NSM protocol
1361 *
1362 * Function returns
1363 * 0 : The call was initiated. The callback will be invoked when the call completes.
1364 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1365 *
1366 * When the callback is invoked, status indicates the result:
1367 * RPC_STATUS_SUCCESS : We got a successful response from the nsm daemon.
1368 * data is NULL
1369 * RPC_STATUS_ERROR : An error occured when trying to contact the nsm daemon.
1370 * data is the error string.
1371 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1372 * data is NULL.
1373 */
1374 EXTERN int rpc_nsm1_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
1375
1376 /*
1377 * Call NSM/STAT
1378 * Call the STAT 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 NSM1_STATres
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 */
1392 struct NSM1_STATargs;
1393 EXTERN int rpc_nsm1_stat_async(struct rpc_context *rpc, rpc_cb cb, struct NSM1_STATargs *args, void *private_data);
1394
1395 /*
1396 * Call NSM/MON
1397 * Call the MON procedure for the NSM protocol
1398 *
1399 * Function returns
1400 * 0 : The call was initiated. The callback will be invoked when the call completes.
1401 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1402 *
1403 * When the callback is invoked, status indicates the result:
1404 * RPC_STATUS_SUCCESS : We got a successful response from the nsm daemon.
1405 * data is NSM1_MONres
1406 * RPC_STATUS_ERROR : An error occured when trying to contact the nsm daemon.
1407 * data is the error string.
1408 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1409 * data is NULL.
1410 */
1411 struct NSM1_MONargs;
1412 EXTERN int rpc_nsm1_mon_async(struct rpc_context *rpc, rpc_cb cb, struct NSM1_MONargs *args, void *private_data);
1413
1414 /*
1415 * Call NSM/UNMON
1416 * Call the UNMON procedure for the NSM protocol
1417 *
1418 * Function returns
1419 * 0 : The call was initiated. The callback will be invoked when the call completes.
1420 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1421 *
1422 * When the callback is invoked, status indicates the result:
1423 * RPC_STATUS_SUCCESS : We got a successful response from the nsm daemon.
1424 * data is NSM1_UNMONres
1425 * RPC_STATUS_ERROR : An error occured when trying to contact the nsm daemon.
1426 * data is the error string.
1427 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1428 * data is NULL.
1429 */
1430 struct NSM1_UNMONargs;
1431 EXTERN int rpc_nsm1_unmon_async(struct rpc_context *rpc, rpc_cb cb, struct NSM1_UNMONargs *args, void *private_data);
1432
1433 /*
1434 * Call NSM/UNMONALL
1435 * Call the UNMONALL procedure for the NSM protocol
1436 *
1437 * Function returns
1438 * 0 : The call was initiated. The callback will be invoked when the call completes.
1439 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1440 *
1441 * When the callback is invoked, status indicates the result:
1442 * RPC_STATUS_SUCCESS : We got a successful response from the nsm daemon.
1443 * data is NSM1_UNMONALLres
1444 * RPC_STATUS_ERROR : An error occured when trying to contact the nsm daemon.
1445 * data is the error string.
1446 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1447 * data is NULL.
1448 */
1449 struct NSM1_UNMONALLargs;
1450 EXTERN int rpc_nsm1_unmonall_async(struct rpc_context *rpc, rpc_cb cb, struct NSM1_UNMONALLargs *args, void *private_data);
1451
1452 /*
1453 * Call NSM/SIMUCRASH
1454 * Call the SIMUCRASH procedure for the NSM protocol
1455 *
1456 * Function returns
1457 * 0 : The call was initiated. The callback will be invoked when the call completes.
1458 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1459 *
1460 * When the callback is invoked, status indicates the result:
1461 * RPC_STATUS_SUCCESS : We got a successful response from the nsm daemon.
1462 * data is NULL
1463 * RPC_STATUS_ERROR : An error occured when trying to contact the nsm daemon.
1464 * data is the error string.
1465 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1466 * data is NULL.
1467 */
1468 EXTERN int rpc_nsm1_simucrash_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
1469
1470 /*
1471 * Call NSM/NOTIFY
1472 * Call the NOTIFY 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 */
1486 struct NSM1_NOTIFYargs;
1487 EXTERN int rpc_nsm1_notify_async(struct rpc_context *rpc, rpc_cb cb, struct NSM1_NOTIFYargs *args, void *private_data);
1488
1489 #endif