fix compiler warnings
[deb_libnfs.git] / include / 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 #include <stdint.h>
23
24 struct rpc_data {
25 int size;
26 unsigned char *data;
27 };
28
29 struct rpc_context;
30 struct rpc_context *rpc_init_context(void);
31 void rpc_destroy_context(struct rpc_context *rpc);
32
33 void rpc_set_auth(struct rpc_context *rpc, AUTH *auth);
34
35 int rpc_get_fd(struct rpc_context *rpc);
36 int rpc_which_events(struct rpc_context *rpc);
37 int rpc_service(struct rpc_context *rpc, int revents);
38 char *rpc_get_error(struct rpc_context *rpc);
39 int rpc_queue_length(struct rpc_context *rpc);
40
41 /* Utility function to get an RPC context from a NFS context. Useful for doing low level NFSACL
42 * calls on a NFS context.
43 */
44 struct rpc_context *nfs_get_rpc_context(struct nfs_context *nfs);
45
46 /* This function returns the nfs_fh3 structure from a nfsfh structure.
47 This allows to use a file onened with nfs_open() together with low-level
48 rpc functions that thake a nfs filehandle
49 */
50 struct nfs_fh3 *nfs_get_fh(struct nfsfh *nfsfh);
51
52 #define RPC_STATUS_SUCCESS 0
53 #define RPC_STATUS_ERROR 1
54 #define RPC_STATUS_CANCEL 2
55
56 /*
57 * Async connection to the tcp port at server:port.
58 * Function returns
59 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
60 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
61 *
62 * When the callback is invoked, status indicates the result:
63 * RPC_STATUS_SUCCESS : The tcp connection was successfully established.
64 * data is NULL.
65 * RPC_STATUS_ERROR : The connection failed to establish.
66 * data is the erro string.
67 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
68 * : data is NULL.
69 */
70 int rpc_connect_async(struct rpc_context *rpc, const char *server, int port, rpc_cb cb, void *private_data);
71 /*
72 * When disconnecting a connection in flight. All commands in flight will be called with the callback
73 * and status RPC_STATUS_ERROR. Data will be the error string for the disconnection.
74 */
75 int rpc_disconnect(struct rpc_context *rpc, char *error);
76
77
78 /*
79 * PORTMAP FUNCTIONS
80 */
81
82 /*
83 * Call PORTMAPPER/NULL
84 * Function returns
85 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
86 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
87 *
88 * When the callback is invoked, status indicates the result:
89 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
90 * data is NULL.
91 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
92 * data is the error string.
93 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
94 * data is NULL.
95 */
96 int rpc_pmap_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
97
98
99 /*
100 * Call PORTMAPPER/GETPORT.
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 : We got a successful response from the portmapper daemon.
107 * data is a (uint32_t *), containing the port returned.
108 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
109 * data is the error string.
110 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
111 * data is NULL.
112 */
113 int rpc_pmap_getport_async(struct rpc_context *rpc, int program, int version, int protocol, rpc_cb cb, void *private_data);
114
115 /*
116 * Call PORTMAPPER/SET
117 * Function returns
118 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
119 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
120 *
121 * When the callback is invoked, status indicates the result:
122 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
123 * data is a (uint32_t *), containing status
124 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
125 * data is the error string.
126 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
127 * data is NULL.
128 */
129 int rpc_pmap_set_async(struct rpc_context *rpc, int program, int version, int protocol, int port, rpc_cb cb, void *private_data);
130
131 /*
132 * Call PORTMAPPER/UNSET
133 * Function returns
134 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
135 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
136 *
137 * When the callback is invoked, status indicates the result:
138 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
139 * data is a (uint32_t *), containing status
140 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
141 * data is the error string.
142 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
143 * data is NULL.
144 */
145 int rpc_pmap_unset_async(struct rpc_context *rpc, int program, int version, int protocol, int port, rpc_cb cb, void *private_data);
146
147 /*
148 * Call PORTMAPPER/CALLIT.
149 * Function returns
150 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
151 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
152 *
153 * When the callback is invoked, status indicates the result:
154 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon
155 * data is a 'pmap_call_result' pointer.
156 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
157 * data is the error string.
158 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
159 * data is NULL.
160 */
161 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);
162
163 /*
164 * MOUNT FUNCTIONS
165 */
166 char *mountstat3_to_str(int stat);
167 int mountstat3_to_errno(int error);
168
169 /*
170 * Call MOUNT/NULL
171 * Function returns
172 * 0 : The call was initiated. The callback will be invoked when the call completes.
173 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
174 *
175 * When the callback is invoked, status indicates the result:
176 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
177 * data is NULL.
178 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
179 * data is the error string.
180 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
181 * data is NULL.
182 */
183 int rpc_mount_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
184
185 /*
186 * Call MOUNT/MNT
187 * Function returns
188 * 0 : The call was initiated. The callback will be invoked when the call completes.
189 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
190 *
191 * When the callback is invoked, status indicates the result:
192 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
193 * data is union mountres3.
194 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
195 * data is the error string.
196 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
197 * data is NULL.
198 */
199 int rpc_mount_mnt_async(struct rpc_context *rpc, rpc_cb cb, char *export, void *private_data);
200
201 /*
202 * Call MOUNT/DUMP
203 * Function returns
204 * 0 : The call was initiated. The callback will be invoked when the call completes.
205 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
206 *
207 * When the callback is invoked, status indicates the result:
208 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
209 * data is a mountlist.
210 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
211 * data is the error string.
212 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
213 * data is NULL.
214 */
215 int rpc_mount_dump_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
216
217 /*
218 * Call MOUNT/UMNT
219 * Function returns
220 * 0 : The call was initiated. The callback will be invoked when the call completes.
221 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
222 *
223 * When the callback is invoked, status indicates the result:
224 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
225 * data NULL.
226 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
227 * data is the error string.
228 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
229 * data is NULL.
230 */
231 int rpc_mount_umnt_async(struct rpc_context *rpc, rpc_cb cb, char *export, void *private_data);
232
233 /*
234 * Call MOUNT/UMNTALL
235 * Function returns
236 * 0 : The call was initiated. The callback will be invoked when the call completes.
237 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
238 *
239 * When the callback is invoked, status indicates the result:
240 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
241 * data NULL.
242 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
243 * data is the error string.
244 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
245 * data is NULL.
246 */
247 int rpc_mount_umntall_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
248
249 /*
250 * Call MOUNT/EXPORT
251 * NOTE: You must include 'libnfs-raw-mount.h' to get the definitions of the
252 * returned structures.
253 *
254 * Function returns
255 * 0 : The call was initiated. The callback will be invoked when the call completes.
256 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
257 *
258 * When the callback is invoked, status indicates the result:
259 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
260 * data is a pointer to an exports pointer:
261 * exports export = *(exports *)data;
262 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
263 * data is the error string.
264 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
265 * data is NULL.
266 */
267 int rpc_mount_export_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
268
269
270
271
272 /*
273 * NFS FUNCTIONS
274 */
275 struct nfs_fh3;
276 char *nfsstat3_to_str(int error);
277 int nfsstat3_to_errno(int error);
278
279 /*
280 * Call NFS/NULL
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 nfs daemon.
287 * data is NULL.
288 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs 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 int rpc_nfs_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
294
295 /*
296 * Call NFS/GETATTR
297 * Function returns
298 * 0 : The call was initiated. The callback will be invoked when the call completes.
299 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
300 *
301 * When the callback is invoked, status indicates the result:
302 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
303 * data is GETATTR3res
304 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
305 * data is the error string.
306 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
307 * data is NULL.
308 */
309 int rpc_nfs_getattr_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
310
311 /*
312 * Call NFS/LOOKUP
313 * Function returns
314 * 0 : The call was initiated. The callback will be invoked when the call completes.
315 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
316 *
317 * When the callback is invoked, status indicates the result:
318 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
319 * data is LOOKUP3res
320 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
321 * data is the error string.
322 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
323 * data is NULL.
324 */
325 int rpc_nfs_lookup_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *name, void *private_data);
326
327 /*
328 * Call NFS/ACCESS
329 * Function returns
330 * 0 : The call was initiated. The callback will be invoked when the call completes.
331 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
332 *
333 * When the callback is invoked, status indicates the result:
334 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
335 * data is ACCESS3res
336 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
337 * data is the error string.
338 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
339 * data is NULL.
340 */
341 int rpc_nfs_access_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, int access, void *private_data);
342
343 /*
344 * Call NFS/READ
345 * Function returns
346 * 0 : The call was initiated. The callback will be invoked when the call completes.
347 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
348 *
349 * When the callback is invoked, status indicates the result:
350 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
351 * data is READ3res
352 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
353 * data is the error string.
354 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
355 * data is NULL.
356 */
357 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);
358
359 /*
360 * Call NFS/WRITE
361 * Function returns
362 * 0 : The call was initiated. The callback will be invoked when the call completes.
363 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
364 *
365 * When the callback is invoked, status indicates the result:
366 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
367 * data is WRITE3res *
368 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
369 * data is the error string.
370 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
371 * data is NULL.
372 */
373 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);
374
375 /*
376 * Call NFS/COMMIT
377 * Function returns
378 * 0 : The call was initiated. The callback will be invoked when the call completes.
379 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
380 *
381 * When the callback is invoked, status indicates the result:
382 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
383 * data is COMMIT3res *
384 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
385 * data is the error string.
386 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
387 * data is NULL.
388 */
389 int rpc_nfs_commit_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
390
391
392 /*
393 * Call NFS/SETATTR
394 * Function returns
395 * 0 : The call was initiated. The callback will be invoked when the call completes.
396 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
397 *
398 * When the callback is invoked, status indicates the result:
399 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
400 * data is SETATTR3res *
401 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
402 * data is the error string.
403 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
404 * data is NULL.
405 */
406 struct SETATTR3args;
407 int rpc_nfs_setattr_async(struct rpc_context *rpc, rpc_cb cb, struct SETATTR3args *args, void *private_data);
408
409
410
411 /*
412 * Call NFS/MKDIR
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 MKDIR3res *
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 struct MKDIR3args;
426 int rpc_nfs_mkdir_async(struct rpc_context *rpc, rpc_cb cb, struct MKDIR3args *args, void *private_data);
427
428
429
430
431
432 /*
433 * Call NFS/RMDIR
434 * Function returns
435 * 0 : The call was initiated. The callback will be invoked when the call completes.
436 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
437 *
438 * When the callback is invoked, status indicates the result:
439 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
440 * data is RMDIR3res *
441 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
442 * data is the error string.
443 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
444 * data is NULL.
445 */
446 int rpc_nfs_rmdir_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *dir, void *private_data);
447
448
449
450
451 /*
452 * Call NFS/CREATE
453 * Function returns
454 * 0 : The call was initiated. The callback will be invoked when the call completes.
455 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
456 *
457 * When the callback is invoked, status indicates the result:
458 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
459 * data is CREATE3res *
460 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
461 * data is the error string.
462 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
463 * data is NULL.
464 */
465 struct CREATE3args;
466 int rpc_nfs_create_async(struct rpc_context *rpc, rpc_cb cb, struct CREATE3args *args, void *private_data);
467
468
469 /*
470 * Call NFS/MKNOD
471 * Function returns
472 * 0 : The call was initiated. The callback will be invoked when the call completes.
473 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
474 *
475 * When the callback is invoked, status indicates the result:
476 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
477 * data is MKNOD3res *
478 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
479 * data is the error string.
480 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
481 * data is NULL.
482 */
483 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);
484
485
486 /*
487 * Call NFS/REMOVE
488 * Function returns
489 * 0 : The call was initiated. The callback will be invoked when the call completes.
490 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
491 *
492 * When the callback is invoked, status indicates the result:
493 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
494 * data is REMOVE3res *
495 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
496 * data is the error string.
497 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
498 * data is NULL.
499 */
500 int rpc_nfs_remove_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *name, void *private_data);
501
502
503
504 /*
505 * Call NFS/READDIR
506 * Function returns
507 * 0 : The call was initiated. The callback will be invoked when the call completes.
508 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
509 *
510 * When the callback is invoked, status indicates the result:
511 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
512 * data is READDIR3res *
513 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
514 * data is the error string.
515 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
516 * data is NULL.
517 */
518 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);
519
520 /*
521 * Call NFS/READDIRPLUS
522 * Function returns
523 * 0 : The call was initiated. The callback will be invoked when the call completes.
524 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
525 *
526 * When the callback is invoked, status indicates the result:
527 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
528 * data is READDIRPLUS3res *
529 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
530 * data is the error string.
531 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
532 * data is NULL.
533 */
534 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);
535
536 /*
537 * Call NFS/FSSTAT
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 FSSTAT3res
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 int rpc_nfs_fsstat_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
551
552
553
554 /*
555 * Call NFS/FSINFO
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 FSINFO3res
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 int rpc_nfs_fsinfo_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
569
570
571
572 /*
573 * Call NFS/READLINK
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 READLINK3res *
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 READLINK3args;
587 int rpc_nfs_readlink_async(struct rpc_context *rpc, rpc_cb cb, struct READLINK3args *args, void *private_data);
588
589
590
591 /*
592 * Call NFS/SYMLINK
593 * Function returns
594 * 0 : The call was initiated. The callback will be invoked when the call completes.
595 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
596 *
597 * When the callback is invoked, status indicates the result:
598 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
599 * data is SYMLINK3res *
600 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
601 * data is the error string.
602 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
603 * data is NULL.
604 */
605 struct SYMLINK3args;
606 int rpc_nfs_symlink_async(struct rpc_context *rpc, rpc_cb cb, struct SYMLINK3args *args, void *private_data);
607
608
609 /*
610 * Call NFS/RENAME
611 * Function returns
612 * 0 : The call was initiated. The callback will be invoked when the call completes.
613 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
614 *
615 * When the callback is invoked, status indicates the result:
616 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
617 * data is RENAME3res *
618 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
619 * data is the error string.
620 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
621 * data is NULL.
622 */
623 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);
624
625
626
627 /*
628 * Call NFS/LINK
629 * Function returns
630 * 0 : The call was initiated. The callback will be invoked when the call completes.
631 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
632 *
633 * When the callback is invoked, status indicates the result:
634 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
635 * data is LINK3res *
636 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
637 * data is the error string.
638 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
639 * data is NULL.
640 */
641 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);
642
643
644
645
646 /*
647 * RQUOTA FUNCTIONS
648 */
649 char *rquotastat_to_str(int error);
650 int rquotastat_to_errno(int error);
651
652 /*
653 * Call RQUOTA1/NULL
654 * Function returns
655 * 0 : The call was initiated. The callback will be invoked when the call completes.
656 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
657 *
658 * When the callback is invoked, status indicates the result:
659 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
660 * data is NULL.
661 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
662 * data is the error string.
663 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
664 * data is NULL.
665 */
666 int rpc_rquota1_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
667
668 /*
669 * Call RQUOTA1/GETQUOTA
670 * Function returns
671 * 0 : The call was initiated. The callback will be invoked when the call completes.
672 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
673 *
674 * When the callback is invoked, status indicates the result:
675 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
676 * data is a RQUOTA1res structure.
677 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
678 * data is the error string.
679 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
680 * data is NULL.
681 */
682 int rpc_rquota1_getquota_async(struct rpc_context *rpc, rpc_cb cb, char *export, int uid, void *private_data);
683
684 /*
685 * Call RQUOTA1/GETACTIVEQUOTA
686 * Function returns
687 * 0 : The call was initiated. The callback will be invoked when the call completes.
688 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
689 *
690 * When the callback is invoked, status indicates the result:
691 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
692 * data is a RQUOTA1res structure.
693 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
694 * data is the error string.
695 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
696 * data is NULL.
697 */
698 int rpc_rquota1_getactivequota_async(struct rpc_context *rpc, rpc_cb cb, char *export, int uid, void *private_data);
699
700
701
702
703 /*
704 * Call RQUOTA2/NULL
705 * Function returns
706 * 0 : The call was initiated. The callback will be invoked when the call completes.
707 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
708 *
709 * When the callback is invoked, status indicates the result:
710 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
711 * data is NULL.
712 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
713 * data is the error string.
714 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
715 * data is NULL.
716 */
717 int rpc_rquota2_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
718
719 /*
720 * Call RQUOTA2/GETQUOTA
721 * Function returns
722 * 0 : The call was initiated. The callback will be invoked when the call completes.
723 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
724 *
725 * When the callback is invoked, status indicates the result:
726 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
727 * data is a RQUOTA1res structure.
728 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
729 * data is the error string.
730 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
731 * data is NULL.
732 */
733 int rpc_rquota2_getquota_async(struct rpc_context *rpc, rpc_cb cb, char *export, int type, int uid, void *private_data);
734
735 /*
736 * Call RQUOTA2/GETACTIVEQUOTA
737 * Function returns
738 * 0 : The call was initiated. The callback will be invoked when the call completes.
739 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
740 *
741 * When the callback is invoked, status indicates the result:
742 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
743 * data is a RQUOTA1res structure.
744 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
745 * data is the error string.
746 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
747 * data is NULL.
748 */
749 int rpc_rquota2_getactivequota_async(struct rpc_context *rpc, rpc_cb cb, char *export, int type, int uid, void *private_data);
750
751
752
753
754
755
756 /*
757 * NFSACL functions
758 */
759
760 /*
761 * Call NFSACL/NULL
762 * Call the NULL procedure for the NFSACL
763 *
764 * Function returns
765 * 0 : The call was initiated. The callback will be invoked when the call completes.
766 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
767 *
768 * When the callback is invoked, status indicates the result:
769 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
770 * data is NULL
771 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
772 * data is the error string.
773 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
774 * data is NULL.
775 */
776 int rpc_nfsacl_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
777
778 /*
779 * Call NFSACL/GETACL
780 *
781 * Function returns
782 * 0 : The call was initiated. The callback will be invoked when the call completes.
783 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
784 *
785 * When the callback is invoked, status indicates the result:
786 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
787 * data is a GETACL3res pointer
788 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
789 * data is the error string.
790 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
791 * data is NULL.
792 */
793 struct GETACL3args;
794 int rpc_nfsacl_getacl_async(struct rpc_context *rpc, rpc_cb cb, struct GETACL3args *args, void *private_data);
795
796
797
798 /*
799 * Call NFSACL/SETACL
800 *
801 * Function returns
802 * 0 : The call was initiated. The callback will be invoked when the call completes.
803 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
804 *
805 * When the callback is invoked, status indicates the result:
806 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
807 * data is a SETACL3res pointer
808 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
809 * data is the error string.
810 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
811 * data is NULL.
812 */
813 struct SETACL3args;
814 int rpc_nfsacl_setacl_async(struct rpc_context *rpc, rpc_cb cb, struct SETACL3args *args, void *private_data);
815
816
817
818
819 /*
820 * NLM functions
821 */
822 char *nlmstat4_to_str(int stat);
823
824 /*
825 * Call NLM/NULL
826 * Call the NULL procedure for the NLM protocol
827 *
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 nlm daemon.
834 * data is NULL
835 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm 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 int rpc_nlm4_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
841
842 /*
843 * Call NLM/TEST
844 * Call the TEST procedure for the NLM protocol
845 *
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 nlm daemon.
852 * data is NLM4_TESTres
853 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm 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 struct NLM4_TESTargs;
859 int rpc_nlm4_test_async(struct rpc_context *rpc, rpc_cb cb, struct NLM4_TESTargs *args, void *private_data);
860
861 /*
862 * Call NLM/LOCK
863 * Call the LOCK procedure for the NLM protocol
864 *
865 * Function returns
866 * 0 : The call was initiated. The callback will be invoked when the call completes.
867 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
868 *
869 * When the callback is invoked, status indicates the result:
870 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
871 * data is NLM4_LOCKres
872 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
873 * data is the error string.
874 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
875 * data is NULL.
876 */
877 struct NLM4_LOCKargs;
878 int rpc_nlm4_lock_async(struct rpc_context *rpc, rpc_cb cb, struct NLM4_LOCKargs *args, void *private_data);
879
880 /*
881 * Call NLM/CANCEL
882 * Call the CANCEL procedure for the NLM protocol
883 *
884 * Function returns
885 * 0 : The call was initiated. The callback will be invoked when the call completes.
886 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
887 *
888 * When the callback is invoked, status indicates the result:
889 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
890 * data is NLM4_CANCres
891 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
892 * data is the error string.
893 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
894 * data is NULL.
895 */
896 struct NLM4_CANCargs;
897 int rpc_nlm4_cancel_async(struct rpc_context *rpc, rpc_cb cb, struct NLM4_CANCargs *args, void *private_data);
898
899 /*
900 * Call NLM/UNLOCK
901 * Call the UNLOCK procedure for the NLM protocol
902 *
903 * Function returns
904 * 0 : The call was initiated. The callback will be invoked when the call completes.
905 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
906 *
907 * When the callback is invoked, status indicates the result:
908 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
909 * data is NLM4_UNLOCKres
910 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
911 * data is the error string.
912 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
913 * data is NULL.
914 */
915 struct NLM4_UNLOCKargs;
916 int rpc_nlm4_unlock_async(struct rpc_context *rpc, rpc_cb cb, struct NLM4_UNLOCKargs *args, void *private_data);