bd23dc11665ac74fb26b3c3f1d60d448a72dba0d
[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 struct AUTH;
34 void rpc_set_auth(struct rpc_context *rpc, struct AUTH *auth);
35
36 int rpc_get_fd(struct rpc_context *rpc);
37 int rpc_which_events(struct rpc_context *rpc);
38 int rpc_service(struct rpc_context *rpc, int revents);
39 char *rpc_get_error(struct rpc_context *rpc);
40
41
42 #define RPC_STATUS_SUCCESS 0
43 #define RPC_STATUS_ERROR 1
44 #define RPC_STATUS_CANCEL 2
45
46 /*
47 * Async connection to the tcp port at server:port.
48 * Function returns
49 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
50 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
51 *
52 * When the callback is invoked, status indicates the result:
53 * RPC_STATUS_SUCCESS : The tcp connection was successfully established.
54 * data is NULL.
55 * RPC_STATUS_ERROR : The connection failed to establish.
56 * data is the erro string.
57 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
58 * : data is NULL.
59 */
60 int rpc_connect_async(struct rpc_context *rpc, const char *server, int port, rpc_cb cb, void *private_data);
61 /*
62 * When disconnecting a connection in flight. All commands in flight will be called with the callback
63 * and status RPC_STATUS_ERROR. Data will be the error string for the disconnection.
64 */
65 int rpc_disconnect(struct rpc_context *rpc, char *error);
66
67
68 /*
69 * PORTMAP FUNCTIONS
70 */
71
72 /*
73 * Call PORTMAPPER/NULL
74 * Function returns
75 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
76 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
77 *
78 * When the callback is invoked, status indicates the result:
79 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
80 * data is NULL.
81 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
82 * data is the error string.
83 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
84 * data is NULL.
85 */
86 int rpc_pmap_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
87
88
89 /*
90 * Call PORTMAPPER/GETPORT.
91 * Function returns
92 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
93 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
94 *
95 * When the callback is invoked, status indicates the result:
96 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
97 * data is a (uint32_t *), containing the port returned.
98 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
99 * data is the error string.
100 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
101 * data is NULL.
102 */
103 int rpc_pmap_getport_async(struct rpc_context *rpc, int program, int version, rpc_cb cb, void *private_data);
104
105
106
107 /*
108 * MOUNT FUNCTIONS
109 */
110 char *mountstat3_to_str(int stat);
111 int mountstat3_to_errno(int error);
112
113 /*
114 * Call MOUNT/NULL
115 * Function returns
116 * 0 : The call was initiated. The callback will be invoked when the call completes.
117 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
118 *
119 * When the callback is invoked, status indicates the result:
120 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
121 * data is NULL.
122 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
123 * data is the error string.
124 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
125 * data is NULL.
126 */
127 int rpc_mount_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
128
129 /*
130 * Call MOUNT/MNT
131 * Function returns
132 * 0 : The call was initiated. The callback will be invoked when the call completes.
133 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
134 *
135 * When the callback is invoked, status indicates the result:
136 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
137 * data is union mountres3.
138 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
139 * data is the error string.
140 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
141 * data is NULL.
142 */
143 int rpc_mount_mnt_async(struct rpc_context *rpc, rpc_cb cb, char *export, void *private_data);
144
145 /*
146 * Call MOUNT/DUMP
147 * Function returns
148 * 0 : The call was initiated. The callback will be invoked when the call completes.
149 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
150 *
151 * When the callback is invoked, status indicates the result:
152 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
153 * data is a mountlist.
154 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
155 * data is the error string.
156 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
157 * data is NULL.
158 */
159 int rpc_mount_dump_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
160
161 /*
162 * Call MOUNT/UMNT
163 * Function returns
164 * 0 : The call was initiated. The callback will be invoked when the call completes.
165 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
166 *
167 * When the callback is invoked, status indicates the result:
168 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
169 * data NULL.
170 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
171 * data is the error string.
172 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
173 * data is NULL.
174 */
175 int rpc_mount_umnt_async(struct rpc_context *rpc, rpc_cb cb, char *export, void *private_data);
176
177 /*
178 * Call MOUNT/UMNTALL
179 * Function returns
180 * 0 : The call was initiated. The callback will be invoked when the call completes.
181 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
182 *
183 * When the callback is invoked, status indicates the result:
184 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
185 * data NULL.
186 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
187 * data is the error string.
188 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
189 * data is NULL.
190 */
191 int rpc_mount_umntall_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
192
193 /*
194 * Call MOUNT/EXPORT
195 * NOTE: You must include 'libnfs-raw-mount.h' to get the definitions of the
196 * returned structures.
197 *
198 * Function returns
199 * 0 : The call was initiated. The callback will be invoked when the call completes.
200 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
201 *
202 * When the callback is invoked, status indicates the result:
203 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
204 * data is a pointer to an exports pointer:
205 * exports export = *(exports *)data;
206 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
207 * data is the error string.
208 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
209 * data is NULL.
210 */
211 int rpc_mount_export_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
212
213
214
215
216 /*
217 * NFS FUNCTIONS
218 */
219 struct nfs_fh3;
220 char *nfsstat3_to_str(int error);
221 int nfsstat3_to_errno(int error);
222
223 /*
224 * Call NFS/NULL
225 * Function returns
226 * 0 : The call was initiated. The callback will be invoked when the call completes.
227 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
228 *
229 * When the callback is invoked, status indicates the result:
230 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
231 * data is NULL.
232 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
233 * data is the error string.
234 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
235 * data is NULL.
236 */
237 int rpc_nfs_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
238
239 /*
240 * Call NFS/GETATTR
241 * Function returns
242 * 0 : The call was initiated. The callback will be invoked when the call completes.
243 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
244 *
245 * When the callback is invoked, status indicates the result:
246 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
247 * data is GETATTR3res
248 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
249 * data is the error string.
250 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
251 * data is NULL.
252 */
253 int rpc_nfs_getattr_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
254
255 /*
256 * Call NFS/LOOKUP
257 * Function returns
258 * 0 : The call was initiated. The callback will be invoked when the call completes.
259 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
260 *
261 * When the callback is invoked, status indicates the result:
262 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
263 * data is LOOKUP3res
264 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
265 * data is the error string.
266 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
267 * data is NULL.
268 */
269 int rpc_nfs_lookup_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *name, void *private_data);
270
271 /*
272 * Call NFS/ACCESS
273 * Function returns
274 * 0 : The call was initiated. The callback will be invoked when the call completes.
275 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
276 *
277 * When the callback is invoked, status indicates the result:
278 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
279 * data is ACCESS3res
280 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
281 * data is the error string.
282 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
283 * data is NULL.
284 */
285 int rpc_nfs_access_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, int access, void *private_data);
286
287 /*
288 * Call NFS/READ
289 * Function returns
290 * 0 : The call was initiated. The callback will be invoked when the call completes.
291 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
292 *
293 * When the callback is invoked, status indicates the result:
294 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
295 * data is ACCESS3res
296 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
297 * data is the error string.
298 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
299 * data is NULL.
300 */
301 int rpc_nfs_read_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, off_t offset, size_t count, void *private_data);
302
303 /*
304 * Call NFS/WRITE
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 nfs daemon.
311 * data is WRITE3res *
312 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs 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 int rpc_nfs_write_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *buf, off_t offset, size_t count, int stable_how, void *private_data);
318
319 /*
320 * Call NFS/COMMIT
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 nfs daemon.
327 * data is COMMIT3res *
328 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs 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 int rpc_nfs_commit_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
334
335
336 /*
337 * Call NFS/SETATTR
338 * Function returns
339 * 0 : The call was initiated. The callback will be invoked when the call completes.
340 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
341 *
342 * When the callback is invoked, status indicates the result:
343 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
344 * data is SETATTR3res *
345 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
346 * data is the error string.
347 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
348 * data is NULL.
349 */
350 struct SETATTR3args;
351 int rpc_nfs_setattr_async(struct rpc_context *rpc, rpc_cb cb, struct SETATTR3args *args, void *private_data);
352
353
354
355 /*
356 * Call NFS/MKDIR
357 * Function returns
358 * 0 : The call was initiated. The callback will be invoked when the call completes.
359 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
360 *
361 * When the callback is invoked, status indicates the result:
362 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
363 * data is MKDIR3res *
364 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
365 * data is the error string.
366 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
367 * data is NULL.
368 */
369 int rpc_nfs_mkdir_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *dir, void *private_data);
370
371
372
373
374
375 /*
376 * Call NFS/RMDIR
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 RMDIR3res *
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_rmdir_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *dir, void *private_data);
390
391
392
393
394 /*
395 * Call NFS/CREATE
396 * Function returns
397 * 0 : The call was initiated. The callback will be invoked when the call completes.
398 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
399 *
400 * When the callback is invoked, status indicates the result:
401 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
402 * data is CREATE3res *
403 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
404 * data is the error string.
405 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
406 * data is NULL.
407 */
408 int rpc_nfs_create_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *name, int mode, void *private_data);
409
410
411
412
413 /*
414 * Call NFS/REMOVE
415 * Function returns
416 * 0 : The call was initiated. The callback will be invoked when the call completes.
417 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
418 *
419 * When the callback is invoked, status indicates the result:
420 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
421 * data is REMOVE3res *
422 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
423 * data is the error string.
424 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
425 * data is NULL.
426 */
427 int rpc_nfs_remove_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *name, void *private_data);
428
429
430
431 /*
432 * Call NFS/REMOVE
433 * Function returns
434 * 0 : The call was initiated. The callback will be invoked when the call completes.
435 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
436 *
437 * When the callback is invoked, status indicates the result:
438 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
439 * data is READDIR3res *
440 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
441 * data is the error string.
442 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
443 * data is NULL.
444 */
445 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);
446
447 /*
448 * Call NFS/FSSTAT
449 * Function returns
450 * 0 : The call was initiated. The callback will be invoked when the call completes.
451 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
452 *
453 * When the callback is invoked, status indicates the result:
454 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
455 * data is FSSTAT3res
456 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
457 * data is the error string.
458 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
459 * data is NULL.
460 */
461 int rpc_nfs_fsstat_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
462
463
464
465 /*
466 * Call NFS/FSINFO
467 * Function returns
468 * 0 : The call was initiated. The callback will be invoked when the call completes.
469 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
470 *
471 * When the callback is invoked, status indicates the result:
472 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
473 * data is FSINFO3res
474 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
475 * data is the error string.
476 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
477 * data is NULL.
478 */
479 int rpc_nfs_fsinfo_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
480
481
482
483 /*
484 * Call NFS/READLINK
485 * Function returns
486 * 0 : The call was initiated. The callback will be invoked when the call completes.
487 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
488 *
489 * When the callback is invoked, status indicates the result:
490 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
491 * data is READLINK3res *
492 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
493 * data is the error string.
494 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
495 * data is NULL.
496 */
497 int rpc_nfs_readlink_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
498
499
500
501 /*
502 * Call NFS/SYMLINK
503 * Function returns
504 * 0 : The call was initiated. The callback will be invoked when the call completes.
505 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
506 *
507 * When the callback is invoked, status indicates the result:
508 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
509 * data is SYMLINK3res *
510 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
511 * data is the error string.
512 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
513 * data is NULL.
514 */
515 int rpc_nfs_symlink_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *newname, char *oldpath, void *private_data);
516
517
518 /*
519 * Call NFS/RENAME
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 RENAME3res *
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 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);
533
534
535
536 /*
537 * Call NFS/LINK
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 LINK3res *
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_link_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *file, struct nfs_fh3 *newdir, char *newname, void *private_data);
551
552
553
554
555 /*
556 * RQUOTA FUNCTIONS
557 */
558 char *rquotastat_to_str(int error);
559 int rquotastat_to_errno(int error);
560
561 /*
562 * Call RQUOTA1/NULL
563 * Function returns
564 * 0 : The call was initiated. The callback will be invoked when the call completes.
565 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
566 *
567 * When the callback is invoked, status indicates the result:
568 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
569 * data is NULL.
570 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
571 * data is the error string.
572 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
573 * data is NULL.
574 */
575 int rpc_rquota1_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
576
577 /*
578 * Call RQUOTA1/GETQUOTA
579 * Function returns
580 * 0 : The call was initiated. The callback will be invoked when the call completes.
581 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
582 *
583 * When the callback is invoked, status indicates the result:
584 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
585 * data is a RQUOTA1res structure.
586 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
587 * data is the error string.
588 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
589 * data is NULL.
590 */
591 int rpc_rquota1_getquota_async(struct rpc_context *rpc, rpc_cb cb, char *export, int uid, void *private_data);
592
593 /*
594 * Call RQUOTA1/GETACTIVEQUOTA
595 * Function returns
596 * 0 : The call was initiated. The callback will be invoked when the call completes.
597 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
598 *
599 * When the callback is invoked, status indicates the result:
600 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
601 * data is a RQUOTA1res structure.
602 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
603 * data is the error string.
604 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
605 * data is NULL.
606 */
607 int rpc_rquota1_getactivequota_async(struct rpc_context *rpc, rpc_cb cb, char *export, int uid, void *private_data);
608
609
610
611
612 /*
613 * Call RQUOTA2/NULL
614 * Function returns
615 * 0 : The call was initiated. The callback will be invoked when the call completes.
616 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
617 *
618 * When the callback is invoked, status indicates the result:
619 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
620 * data is NULL.
621 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
622 * data is the error string.
623 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
624 * data is NULL.
625 */
626 int rpc_rquota2_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
627
628 /*
629 * Call RQUOTA2/GETQUOTA
630 * Function returns
631 * 0 : The call was initiated. The callback will be invoked when the call completes.
632 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
633 *
634 * When the callback is invoked, status indicates the result:
635 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
636 * data is a RQUOTA1res structure.
637 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
638 * data is the error string.
639 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
640 * data is NULL.
641 */
642 int rpc_rquota2_getquota_async(struct rpc_context *rpc, rpc_cb cb, char *export, int type, int uid, void *private_data);
643
644 /*
645 * Call RQUOTA2/GETACTIVEQUOTA
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 rquota daemon.
652 * data is a RQUOTA1res structure.
653 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota 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 int rpc_rquota2_getactivequota_async(struct rpc_context *rpc, rpc_cb cb, char *export, int type, int uid, void *private_data);