get rid of all remaining printfs from the library
[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 typedef void (*rpc_cb)(struct rpc_context *rpc, int status, void *data, void *private_data);
47
48 /*
49 * Async connection to the tcp port at server:port.
50 * Function returns
51 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
52 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
53 *
54 * When the callback is invoked, status indicates the result:
55 * RPC_STATUS_SUCCESS : The tcp connection was successfully established.
56 * data is NULL.
57 * RPC_STATUS_ERROR : The connection failed to establish.
58 * data is the erro string.
59 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
60 * : data is NULL.
61 */
62 int rpc_connect_async(struct rpc_context *rpc, const char *server, int port, rpc_cb cb, void *private_data);
63 /*
64 * When disconnecting a connection in flight. All commands in flight will be called with the callback
65 * and status RPC_STATUS_ERROR. Data will be the error string for the disconnection.
66 */
67 int rpc_disconnect(struct rpc_context *rpc, char *error);
68
69
70 /*
71 * PORTMAP FUNCTIONS
72 */
73
74 /*
75 * Call PORTMAPPER/NULL
76 * Function returns
77 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
78 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
79 *
80 * When the callback is invoked, status indicates the result:
81 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
82 * data is NULL.
83 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
84 * data is the error string.
85 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
86 * data is NULL.
87 */
88 int rpc_pmap_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
89
90
91 /*
92 * Call PORTMAPPER/GETPORT.
93 * Function returns
94 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
95 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
96 *
97 * When the callback is invoked, status indicates the result:
98 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
99 * data is a (uint32_t *), containing the port returned.
100 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
101 * data is the error string.
102 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
103 * data is NULL.
104 */
105 int rpc_pmap_getport_async(struct rpc_context *rpc, int program, int version, rpc_cb cb, void *private_data);
106
107
108
109 /*
110 * MOUNT FUNCTIONS
111 */
112 char *mountstat3_to_str(int stat);
113 int mountstat3_to_errno(int error);
114
115 /*
116 * Call MOUNT/NULL
117 * Function returns
118 * 0 : The call was initiated. The callback will be invoked when the call completes.
119 * <0 : An error occured when trying to set up the call. 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 mount daemon.
123 * data is NULL.
124 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
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_mount_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
130
131 /*
132 * Call MOUNT/MNT
133 * Function returns
134 * 0 : The call was initiated. The callback will be invoked when the call completes.
135 * <0 : An error occured when trying to set up the call. 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 mount daemon.
139 * data is union mountres3.
140 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
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_mount_mnt_async(struct rpc_context *rpc, rpc_cb cb, char *export, void *private_data);
146
147 /*
148 * Call MOUNT/DUMP
149 * Function returns
150 * 0 : The call was initiated. The callback will be invoked when the call completes.
151 * <0 : An error occured when trying to set up the call. 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 mount daemon.
155 * data is a mountlist.
156 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
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_mount_dump_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
162
163 /*
164 * Call MOUNT/UMNT
165 * Function returns
166 * 0 : The call was initiated. The callback will be invoked when the call completes.
167 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
168 *
169 * When the callback is invoked, status indicates the result:
170 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
171 * data NULL.
172 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
173 * data is the error string.
174 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
175 * data is NULL.
176 */
177 int rpc_mount_umnt_async(struct rpc_context *rpc, rpc_cb cb, char *export, void *private_data);
178
179 /*
180 * Call MOUNT/UMNTALL
181 * Function returns
182 * 0 : The call was initiated. The callback will be invoked when the call completes.
183 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
184 *
185 * When the callback is invoked, status indicates the result:
186 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
187 * data NULL.
188 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
189 * data is the error string.
190 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
191 * data is NULL.
192 */
193 int rpc_mount_umntall_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
194
195 /*
196 * Call MOUNT/EXPORT
197 * Function returns
198 * 0 : The call was initiated. The callback will be invoked when the call completes.
199 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
200 *
201 * When the callback is invoked, status indicates the result:
202 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
203 * data is an exports.
204 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
205 * data is the error string.
206 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
207 * data is NULL.
208 */
209 int rpc_mount_export_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
210
211
212
213
214 /*
215 * NFS FUNCTIONS
216 */
217 struct nfs_fh3;
218 char *nfsstat3_to_str(int error);
219 int nfsstat3_to_errno(int error);
220
221 /*
222 * Call NFS/NULL
223 * Function returns
224 * 0 : The call was initiated. The callback will be invoked when the call completes.
225 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
226 *
227 * When the callback is invoked, status indicates the result:
228 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
229 * data is NULL.
230 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
231 * data is the error string.
232 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
233 * data is NULL.
234 */
235 int rpc_nfs_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
236
237 /*
238 * Call NFS/GETATTR
239 * Function returns
240 * 0 : The call was initiated. The callback will be invoked when the call completes.
241 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
242 *
243 * When the callback is invoked, status indicates the result:
244 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
245 * data is GETATTR3res
246 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
247 * data is the error string.
248 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
249 * data is NULL.
250 */
251 int rpc_nfs_getattr_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
252
253 /*
254 * Call NFS/LOOKUP
255 * Function returns
256 * 0 : The call was initiated. The callback will be invoked when the call completes.
257 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
258 *
259 * When the callback is invoked, status indicates the result:
260 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
261 * data is LOOKUP3res
262 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs 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_nfs_lookup_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *name, void *private_data);
268
269 /*
270 * Call NFS/ACCESS
271 * Function returns
272 * 0 : The call was initiated. The callback will be invoked when the call completes.
273 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
274 *
275 * When the callback is invoked, status indicates the result:
276 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
277 * data is ACCESS3res
278 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
279 * data is the error string.
280 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
281 * data is NULL.
282 */
283 int rpc_nfs_access_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, int access, void *private_data);
284
285 /*
286 * Call NFS/READ
287 * Function returns
288 * 0 : The call was initiated. The callback will be invoked when the call completes.
289 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
290 *
291 * When the callback is invoked, status indicates the result:
292 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
293 * data is ACCESS3res
294 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
295 * data is the error string.
296 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
297 * data is NULL.
298 */
299 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);
300
301 /*
302 * Call NFS/WRITE
303 * Function returns
304 * 0 : The call was initiated. The callback will be invoked when the call completes.
305 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
306 *
307 * When the callback is invoked, status indicates the result:
308 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
309 * data is WRITE3res *
310 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
311 * data is the error string.
312 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
313 * data is NULL.
314 */
315 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);
316
317 /*
318 * Call NFS/COMMIT
319 * Function returns
320 * 0 : The call was initiated. The callback will be invoked when the call completes.
321 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
322 *
323 * When the callback is invoked, status indicates the result:
324 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
325 * data is COMMIT3res *
326 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
327 * data is the error string.
328 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
329 * data is NULL.
330 */
331 int rpc_nfs_commit_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
332
333
334 /*
335 * Call NFS/SETATTR
336 * Function returns
337 * 0 : The call was initiated. The callback will be invoked when the call completes.
338 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
339 *
340 * When the callback is invoked, status indicates the result:
341 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
342 * data is SETATTR3res *
343 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
344 * data is the error string.
345 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
346 * data is NULL.
347 */
348 struct SETATTR3args;
349 int rpc_nfs_setattr_async(struct rpc_context *rpc, rpc_cb cb, struct SETATTR3args *args, void *private_data);
350
351
352
353 /*
354 * Call NFS/MKDIR
355 * Function returns
356 * 0 : The call was initiated. The callback will be invoked when the call completes.
357 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
358 *
359 * When the callback is invoked, status indicates the result:
360 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
361 * data is MKDIR3res *
362 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
363 * data is the error string.
364 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
365 * data is NULL.
366 */
367 int rpc_nfs_mkdir_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *dir, void *private_data);
368
369
370
371
372
373 /*
374 * Call NFS/RMDIR
375 * Function returns
376 * 0 : The call was initiated. The callback will be invoked when the call completes.
377 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
378 *
379 * When the callback is invoked, status indicates the result:
380 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
381 * data is RMDIR3res *
382 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
383 * data is the error string.
384 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
385 * data is NULL.
386 */
387 int rpc_nfs_rmdir_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *dir, void *private_data);
388
389
390
391
392 /*
393 * Call NFS/CREATE
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 CREATE3res *
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 int rpc_nfs_create_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *name, int mode, void *private_data);
407
408
409
410
411 /*
412 * Call NFS/REMOVE
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 REMOVE3res *
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 int rpc_nfs_remove_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *name, void *private_data);
426
427
428
429 /*
430 * Call NFS/REMOVE
431 * Function returns
432 * 0 : The call was initiated. The callback will be invoked when the call completes.
433 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
434 *
435 * When the callback is invoked, status indicates the result:
436 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
437 * data is READDIR3res *
438 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
439 * data is the error string.
440 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
441 * data is NULL.
442 */
443 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);
444
445 /*
446 * Call NFS/FSSTAT
447 * Function returns
448 * 0 : The call was initiated. The callback will be invoked when the call completes.
449 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
450 *
451 * When the callback is invoked, status indicates the result:
452 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
453 * data is FSSTAT3res
454 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
455 * data is the error string.
456 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
457 * data is NULL.
458 */
459 int rpc_nfs_fsstat_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
460
461
462
463 /*
464 * Call NFS/FSINFO
465 * Function returns
466 * 0 : The call was initiated. The callback will be invoked when the call completes.
467 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
468 *
469 * When the callback is invoked, status indicates the result:
470 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
471 * data is FSINFO3res
472 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
473 * data is the error string.
474 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
475 * data is NULL.
476 */
477 int rpc_nfs_fsinfo_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
478
479
480
481 /*
482 * Call NFS/READLINK
483 * Function returns
484 * 0 : The call was initiated. The callback will be invoked when the call completes.
485 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
486 *
487 * When the callback is invoked, status indicates the result:
488 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
489 * data is READLINK3res *
490 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
491 * data is the error string.
492 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
493 * data is NULL.
494 */
495 int rpc_nfs_readlink_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
496
497
498
499 /*
500 * Call NFS/SYMLINK
501 * Function returns
502 * 0 : The call was initiated. The callback will be invoked when the call completes.
503 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
504 *
505 * When the callback is invoked, status indicates the result:
506 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
507 * data is SYMLINK3res *
508 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
509 * data is the error string.
510 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
511 * data is NULL.
512 */
513 int rpc_nfs_symlink_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *newname, char *oldpath, void *private_data);
514
515
516 /*
517 * Call NFS/RENAME
518 * Function returns
519 * 0 : The call was initiated. The callback will be invoked when the call completes.
520 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
521 *
522 * When the callback is invoked, status indicates the result:
523 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
524 * data is RENAME3res *
525 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
526 * data is the error string.
527 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
528 * data is NULL.
529 */
530 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);
531
532
533
534 /*
535 * Call NFS/LINK
536 * Function returns
537 * 0 : The call was initiated. The callback will be invoked when the call completes.
538 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
539 *
540 * When the callback is invoked, status indicates the result:
541 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
542 * data is LINK3res *
543 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
544 * data is the error string.
545 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
546 * data is NULL.
547 */
548 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);
549
550
551
552
553 /*
554 * RQUOTA FUNCTIONS
555 */
556 char *rquotastat_to_str(int error);
557 int rquotastat_to_errno(int error);
558
559 /*
560 * Call RQUOTA1/NULL
561 * Function returns
562 * 0 : The call was initiated. The callback will be invoked when the call completes.
563 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
564 *
565 * When the callback is invoked, status indicates the result:
566 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
567 * data is NULL.
568 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
569 * data is the error string.
570 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
571 * data is NULL.
572 */
573 int rpc_rquota1_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
574
575 /*
576 * Call RQUOTA1/GETQUOTA
577 * Function returns
578 * 0 : The call was initiated. The callback will be invoked when the call completes.
579 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
580 *
581 * When the callback is invoked, status indicates the result:
582 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
583 * data is a RQUOTA1res structure.
584 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
585 * data is the error string.
586 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
587 * data is NULL.
588 */
589 int rpc_rquota1_getquota_async(struct rpc_context *rpc, rpc_cb cb, char *export, int uid, void *private_data);
590
591 /*
592 * Call RQUOTA1/GETACTIVEQUOTA
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 rquota daemon.
599 * data is a RQUOTA1res structure.
600 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota 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 int rpc_rquota1_getactivequota_async(struct rpc_context *rpc, rpc_cb cb, char *export, int uid, void *private_data);
606
607
608
609
610 /*
611 * Call RQUOTA2/NULL
612 * Function returns
613 * 0 : The call was initiated. The callback will be invoked when the call completes.
614 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
615 *
616 * When the callback is invoked, status indicates the result:
617 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
618 * data is NULL.
619 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
620 * data is the error string.
621 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
622 * data is NULL.
623 */
624 int rpc_rquota2_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
625
626 /*
627 * Call RQUOTA2/GETQUOTA
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 rquota daemon.
634 * data is a RQUOTA1res structure.
635 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota 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 int rpc_rquota2_getquota_async(struct rpc_context *rpc, rpc_cb cb, char *export, int type, int uid, void *private_data);
641
642 /*
643 * Call RQUOTA2/GETACTIVEQUOTA
644 * Function returns
645 * 0 : The call was initiated. The callback will be invoked when the call completes.
646 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
647 *
648 * When the callback is invoked, status indicates the result:
649 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
650 * data is a RQUOTA1res structure.
651 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
652 * data is the error string.
653 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
654 * data is NULL.
655 */
656 int rpc_rquota2_getactivequota_async(struct rpc_context *rpc, rpc_cb cb, char *export, int type, int uid, void *private_data);