f3113a60e67f48381242c3ca4e0e45b54cdd05bb
[deb_libnfs.git] / include / nfsc / libnfs-raw.h
1 /*
2 Copyright (C) 2010 by Ronnie Sahlberg <ronniesahlberg@gmail.com>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as published by
6 the Free Software Foundation; either version 2.1 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public License
15 along with this program; if not, see <http://www.gnu.org/licenses/>.
16 */
17 /*
18 * This is the lowlevel interface to access NFS resources.
19 * Through this interface you have access to the full gamut of nfs and nfs related
20 * protocol as well as the XDR encoded/decoded structures.
21 */
22 #ifndef _LIBNFS_RAW_H_
23 #define _LIBNFS_RAW_H_
24
25 #include <stdint.h>
26 #include <nfsc/libnfs-zdr.h>
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32 struct rpc_data {
33 int size;
34 unsigned char *data;
35 };
36
37 struct rpc_context;
38 struct rpc_context *rpc_init_context(void);
39 void rpc_destroy_context(struct rpc_context *rpc);
40
41 void rpc_set_auth(struct rpc_context *rpc, struct AUTH *auth);
42
43 int rpc_get_fd(struct rpc_context *rpc);
44 int rpc_which_events(struct rpc_context *rpc);
45 int rpc_service(struct rpc_context *rpc, int revents);
46 char *rpc_get_error(struct rpc_context *rpc);
47 int rpc_queue_length(struct rpc_context *rpc);
48
49 /* Utility function to get an RPC context from a NFS context. Useful for doing low level NFSACL
50 * calls on a NFS context.
51 */
52 struct rpc_context *nfs_get_rpc_context(struct nfs_context *nfs);
53
54 /* This function returns the nfs_fh3 structure from a nfsfh structure.
55 This allows to use a file onened with nfs_open() together with low-level
56 rpc functions that thake a nfs filehandle
57 */
58 struct nfs_fh3 *nfs_get_fh(struct nfsfh *nfsfh);
59
60 /* Control what the next XID value to be used on the context will be.
61 This can be used when multiple contexts are used to the same server
62 to avoid that the two contexts have xid collissions.
63 */
64 void rpc_set_next_xid(struct rpc_context *rpc, uint32_t xid);
65
66 /* This function can be used to set the file descriptor used for
67 * the RPC context. It is primarily useful when emulating dup2()
68 * and similar or where you want full control of the filedescriptor numbers
69 * used by the rpc socket.
70 *
71 * ...
72 * oldfd = rpc_get_fd(rpc);
73 * dup2(oldfd, newfd);
74 * rpc_set_fd(rpc, newfd);
75 * close(oldfd);
76 * ...
77 */
78 void rpc_set_fd(struct rpc_context *rpc, int fd);
79
80 #define RPC_STATUS_SUCCESS 0
81 #define RPC_STATUS_ERROR 1
82 #define RPC_STATUS_CANCEL 2
83
84 /*
85 * Async connection to the tcp port at server:port.
86 * Function returns
87 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
88 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
89 *
90 * When the callback is invoked, status indicates the result:
91 * RPC_STATUS_SUCCESS : The tcp connection was successfully established.
92 * data is NULL.
93 * RPC_STATUS_ERROR : The connection failed to establish.
94 * data is the erro string.
95 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
96 * : data is NULL.
97 */
98 int rpc_connect_async(struct rpc_context *rpc, const char *server, int port, rpc_cb cb, void *private_data);
99 /*
100 * Async function to connect to a specific RPC program/version
101 * Function returns
102 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
103 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
104 *
105 * When the callback is invoked, status indicates the result:
106 * RPC_STATUS_SUCCESS : The tcp connection was successfully established.
107 * data is NULL.
108 * RPC_STATUS_ERROR : The connection failed to establish.
109 * data is the erro string.
110 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
111 * : data is NULL.
112 */
113 int rpc_connect_program_async(struct rpc_context *rpc, const char *server, int program, int version, rpc_cb cb, void *private_data);
114 /*
115 * When disconnecting a connection in flight. All commands in flight will be called with the callback
116 * and status RPC_STATUS_ERROR. Data will be the error string for the disconnection.
117 */
118 int rpc_disconnect(struct rpc_context *rpc, char *error);
119
120
121 /*
122 * PORTMAP v2 FUNCTIONS
123 */
124
125 /*
126 * Call PORTMAPPER2/NULL
127 * Function returns
128 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
129 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
130 *
131 * When the callback is invoked, status indicates the result:
132 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
133 * data is NULL.
134 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
135 * data is the error string.
136 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
137 * data is NULL.
138 */
139 EXTERN int rpc_pmap2_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
140
141
142 /*
143 * Call PORTMAPPER2/GETPORT.
144 * Function returns
145 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
146 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
147 *
148 * When the callback is invoked, status indicates the result:
149 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
150 * data is a (uint32_t *), containing the port returned.
151 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
152 * data is the error string.
153 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
154 * data is NULL.
155 */
156 EXTERN int rpc_pmap2_getport_async(struct rpc_context *rpc, int program, int version, int protocol, rpc_cb cb, void *private_data);
157
158 /*
159 * Call PORTMAPPER2/SET
160 * Function returns
161 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
162 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
163 *
164 * When the callback is invoked, status indicates the result:
165 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
166 * data is a (uint32_t *), containing status
167 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
168 * data is the error string.
169 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
170 * data is NULL.
171 */
172 EXTERN int rpc_pmap2_set_async(struct rpc_context *rpc, int program, int version, int protocol, int port, rpc_cb cb, void *private_data);
173
174 /*
175 * Call PORTMAPPER2/UNSET
176 * Function returns
177 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
178 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
179 *
180 * When the callback is invoked, status indicates the result:
181 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
182 * data is a (uint32_t *), containing status
183 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
184 * data is the error string.
185 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
186 * data is NULL.
187 */
188 EXTERN int rpc_pmap2_unset_async(struct rpc_context *rpc, int program, int version, int protocol, int port, rpc_cb cb, void *private_data);
189
190 /*
191 * Call PORTMAPPER2/DUMP.
192 * Function returns
193 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
194 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
195 *
196 * When the callback is invoked, status indicates the result:
197 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
198 * data is struct pmap2_dump_result.
199 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
200 * data is the error string.
201 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
202 * data is NULL.
203 */
204 EXTERN int rpc_pmap2_dump_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
205
206 /*
207 * Call PORTMAPPER2/CALLIT.
208 * Function returns
209 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
210 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
211 *
212 * When the callback is invoked, status indicates the result:
213 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon
214 * data is a 'pmap2_call_result' pointer.
215 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
216 * data is the error string.
217 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
218 * data is NULL.
219 */
220 EXTERN int rpc_pmap2_callit_async(struct rpc_context *rpc, int program, int version, int procedure, char *data, int datalen, rpc_cb cb, void *private_data);
221
222 /*
223 * PORTMAP v3 FUNCTIONS
224 */
225
226 /*
227 * Call PORTMAPPER3/NULL
228 * Function returns
229 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
230 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
231 *
232 * When the callback is invoked, status indicates the result:
233 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
234 * data is NULL.
235 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
236 * data is the error string.
237 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
238 * data is NULL.
239 */
240 EXTERN int rpc_pmap3_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
241
242 /*
243 * Call PORTMAPPER3/SET.
244 * Function returns
245 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
246 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
247 *
248 * When the callback is invoked, status indicates the result:
249 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
250 * data is uint32_t *
251 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
252 * data is the error string.
253 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
254 * data is NULL.
255 */
256 struct pmap3_mapping;
257 EXTERN int rpc_pmap3_set_async(struct rpc_context *rpc, struct pmap3_mapping *map, rpc_cb cb, void *private_data);
258
259 /*
260 * Call PORTMAPPER3/UNSET.
261 * Function returns
262 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
263 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
264 *
265 * When the callback is invoked, status indicates the result:
266 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
267 * data is uint32_t *
268 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
269 * data is the error string.
270 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
271 * data is NULL.
272 */
273 EXTERN int rpc_pmap3_unset_async(struct rpc_context *rpc, struct pmap3_mapping *map, rpc_cb cb, void *private_data);
274
275 /*
276 * Call PORTMAPPER3/GETADDR.
277 * Function returns
278 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
279 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
280 *
281 * When the callback is invoked, status indicates the result:
282 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
283 * data is struct pmap3_getaddr_result.
284 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
285 * data is the error string.
286 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
287 * data is NULL.
288 */
289 EXTERN int rpc_pmap3_getaddr_async(struct rpc_context *rpc, struct pmap3_mapping *map, rpc_cb cb, void *private_data);
290
291 /*
292 * Call PORTMAPPER3/DUMP.
293 * Function returns
294 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
295 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
296 *
297 * When the callback is invoked, status indicates the result:
298 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
299 * data is struct pmap3_dump_result.
300 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
301 * data is the error string.
302 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
303 * data is NULL.
304 */
305 EXTERN int rpc_pmap3_dump_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
306
307 /*
308 * Call PORTMAPPER3/CALLIT.
309 * Function returns
310 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
311 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
312 *
313 * When the callback is invoked, status indicates the result:
314 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon
315 * data is a 'pmap3_call_result' pointer.
316 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
317 * data is the error string.
318 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
319 * data is NULL.
320 */
321 EXTERN int rpc_pmap3_callit_async(struct rpc_context *rpc, int program, int version, int procedure, char *data, int datalen, rpc_cb cb, void *private_data);
322
323 /*
324 * Call PORTMAPPER3/GETTIME.
325 * Function returns
326 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
327 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
328 *
329 * When the callback is invoked, status indicates the result:
330 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
331 * data is a uint32_t *.
332 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
333 * data is the error string.
334 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
335 * data is NULL.
336 */
337 EXTERN int rpc_pmap3_gettime_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
338
339 /*
340 * Call PORTMAPPER3/UADDR2TADDR.
341 * Function returns
342 * 0 : The connection was initiated. Once the connection establish finishes, the callback will be invoked.
343 * <0 : An error occured when trying to set up the connection. The callback will not be invoked.
344 *
345 * When the callback is invoked, status indicates the result:
346 * RPC_STATUS_SUCCESS : We got a successful response from the portmapper daemon.
347 * data is a struct pmap3_netbuf *.
348 * RPC_STATUS_ERROR : An error occured when trying to contact the portmapper.
349 * data is the error string.
350 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
351 * data is NULL.
352 */
353 EXTERN int rpc_pmap3_uaddr2taddr_async(struct rpc_context *rpc, char *uaddr, rpc_cb cb, void *private_data);
354
355 /*
356 * MOUNT v3 FUNCTIONS
357 */
358 char *mountstat3_to_str(int stat);
359 int mountstat3_to_errno(int error);
360
361 /*
362 * Call MOUNT3/NULL
363 * Function returns
364 * 0 : The call was initiated. The callback will be invoked when the call completes.
365 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
366 *
367 * When the callback is invoked, status indicates the result:
368 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
369 * data is NULL.
370 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
371 * data is the error string.
372 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
373 * data is NULL.
374 */
375 EXTERN int rpc_mount3_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
376 EXTERN int rpc_mount_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
377
378 /*
379 * Call MOUNT3/MNT
380 * Function returns
381 * 0 : The call was initiated. The callback will be invoked when the call completes.
382 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
383 *
384 * When the callback is invoked, status indicates the result:
385 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
386 * data is union mountres3.
387 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
388 * data is the error string.
389 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
390 * data is NULL.
391 */
392 EXTERN int rpc_mount3_mnt_async(struct rpc_context *rpc, rpc_cb cb, char *exportname, void *private_data);
393 EXTERN int rpc_mount_mnt_async(struct rpc_context *rpc, rpc_cb cb, char *exportname, void *private_data);
394
395 /*
396 * Call MOUNT3/DUMP
397 * Function returns
398 * 0 : The call was initiated. The callback will be invoked when the call completes.
399 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
400 *
401 * When the callback is invoked, status indicates the result:
402 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
403 * data is a mountlist.
404 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
405 * data is the error string.
406 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
407 * data is NULL.
408 */
409 EXTERN int rpc_mount3_dump_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
410 EXTERN int rpc_mount_dump_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
411
412 /*
413 * Call MOUNT3/UMNT
414 * Function returns
415 * 0 : The call was initiated. The callback will be invoked when the call completes.
416 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
417 *
418 * When the callback is invoked, status indicates the result:
419 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
420 * data NULL.
421 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
422 * data is the error string.
423 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
424 * data is NULL.
425 */
426 EXTERN int rpc_mount3_umnt_async(struct rpc_context *rpc, rpc_cb cb, char *exportname, void *private_data);
427 EXTERN int rpc_mount_umnt_async(struct rpc_context *rpc, rpc_cb cb, char *exportname, void *private_data);
428
429 /*
430 * Call MOUNT3/UMNTALL
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 mount daemon.
437 * data NULL.
438 * RPC_STATUS_ERROR : An error occured when trying to contact the mount 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 EXTERN int rpc_mount3_umntall_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
444 EXTERN int rpc_mount_umntall_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
445
446 /*
447 * Call MOUNT3/EXPORT
448 * NOTE: You must include 'libnfs-raw-mount.h' to get the definitions of the
449 * returned structures.
450 *
451 * Function returns
452 * 0 : The call was initiated. The callback will be invoked when the call completes.
453 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
454 *
455 * When the callback is invoked, status indicates the result:
456 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
457 * data is a pointer to an exports pointer:
458 * exports export = *(exports *)data;
459 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
460 * data is the error string.
461 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
462 * data is NULL.
463 */
464 EXTERN int rpc_mount3_export_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
465 EXTERN int rpc_mount_export_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
466
467 /*
468 * MOUNT v1 FUNCTIONS (Used with NFSv2)
469 */
470 /*
471 * Call MOUNT1/NULL
472 * Function returns
473 * 0 : The call was initiated. The callback will be invoked when the call completes.
474 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
475 *
476 * When the callback is invoked, status indicates the result:
477 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
478 * data is NULL.
479 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
480 * data is the error string.
481 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
482 * data is NULL.
483 */
484 EXTERN int rpc_mount1_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
485
486 /*
487 * Call MOUNT1/MNT
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 mount daemon.
494 * data is union mountres1.
495 * RPC_STATUS_ERROR : An error occured when trying to contact the mount 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 EXTERN int rpc_mount1_mnt_async(struct rpc_context *rpc, rpc_cb cb, char *exportname, void *private_data);
501
502 /*
503 * Call MOUNT1/DUMP
504 * Function returns
505 * 0 : The call was initiated. The callback will be invoked when the call completes.
506 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
507 *
508 * When the callback is invoked, status indicates the result:
509 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
510 * data is a mountlist.
511 * RPC_STATUS_ERROR : An error occured when trying to contact the mount daemon.
512 * data is the error string.
513 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
514 * data is NULL.
515 */
516 EXTERN int rpc_mount1_dump_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
517
518 /*
519 * Call MOUNT1/UMNT
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 mount daemon.
526 * data NULL.
527 * RPC_STATUS_ERROR : An error occured when trying to contact the mount 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 EXTERN int rpc_mount1_umnt_async(struct rpc_context *rpc, rpc_cb cb, char *exportname, void *private_data);
533
534 /*
535 * Call MOUNT1/UMNTALL
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 mount daemon.
542 * data NULL.
543 * RPC_STATUS_ERROR : An error occured when trying to contact the mount 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 EXTERN int rpc_mount1_umntall_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
549
550 /*
551 * Call MOUNT1/EXPORT
552 * NOTE: You must include 'libnfs-raw-mount.h' to get the definitions of the
553 * returned structures.
554 *
555 * Function returns
556 * 0 : The call was initiated. The callback will be invoked when the call completes.
557 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
558 *
559 * When the callback is invoked, status indicates the result:
560 * RPC_STATUS_SUCCESS : We got a successful response from the mount daemon.
561 * data is a pointer to an exports pointer:
562 * exports export = *(exports *)data;
563 * RPC_STATUS_ERROR : An error occured when trying to contact the mount 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 EXTERN int rpc_mount1_export_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
569
570
571 /*
572 * NFS v3 FUNCTIONS
573 */
574 struct nfs_fh3;
575 char *nfsstat3_to_str(int error);
576 int nfsstat3_to_errno(int error);
577
578 /*
579 * Call NFS3/NULL
580 * Function returns
581 * 0 : The call was initiated. The callback will be invoked when the call completes.
582 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
583 *
584 * When the callback is invoked, status indicates the result:
585 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
586 * data is NULL.
587 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
588 * data is the error string.
589 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
590 * data is NULL.
591 */
592 EXTERN int rpc_nfs3_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
593 EXTERN int rpc_nfs_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
594
595 /*
596 * Call NFS3/GETATTR
597 * Function returns
598 * 0 : The call was initiated. The callback will be invoked when the call completes.
599 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
600 *
601 * When the callback is invoked, status indicates the result:
602 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
603 * data is GETATTR3res
604 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
605 * data is the error string.
606 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
607 * data is NULL.
608 */
609 struct GETATTR3args;
610 EXTERN int rpc_nfs3_getattr_async(struct rpc_context *rpc, rpc_cb cb, struct GETATTR3args *args, void *private_data);
611 EXTERN int rpc_nfs_getattr_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
612
613 /*
614 * Call NFS3/PATHCONF
615 * Function returns
616 * 0 : The call was initiated. The callback will be invoked when the call completes.
617 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
618 *
619 * When the callback is invoked, status indicates the result:
620 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
621 * data is PATHCONF3res
622 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
623 * data is the error string.
624 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
625 * data is NULL.
626 */
627 struct PATHCONF3args;
628 EXTERN int rpc_nfs3_pathconf_async(struct rpc_context *rpc, rpc_cb cb, struct PATHCONF3args *args, void *private_data);
629 EXTERN int rpc_nfs_pathconf_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
630
631 /*
632 * Call NFS3/LOOKUP
633 * Function returns
634 * 0 : The call was initiated. The callback will be invoked when the call completes.
635 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
636 *
637 * When the callback is invoked, status indicates the result:
638 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
639 * data is LOOKUP3res
640 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
641 * data is the error string.
642 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
643 * data is NULL.
644 */
645 struct LOOKUP3args;
646 EXTERN int rpc_nfs3_lookup_async(struct rpc_context *rpc, rpc_cb cb, struct LOOKUP3args *args, void *private_data);
647 EXTERN int rpc_nfs_lookup_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *name, void *private_data);
648
649 /*
650 * Call NFS3/ACCESS
651 * Function returns
652 * 0 : The call was initiated. The callback will be invoked when the call completes.
653 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
654 *
655 * When the callback is invoked, status indicates the result:
656 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
657 * data is ACCESS3res
658 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
659 * data is the error string.
660 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
661 * data is NULL.
662 */
663 struct ACCESS3args;
664 EXTERN int rpc_nfs3_access_async(struct rpc_context *rpc, rpc_cb cb, struct ACCESS3args *args, void *private_data);
665 EXTERN int rpc_nfs_access_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, int access, void *private_data);
666
667 /*
668 * Call NFS3/READ
669 * Function returns
670 * 0 : The call was initiated. The callback will be invoked when the call completes.
671 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
672 *
673 * When the callback is invoked, status indicates the result:
674 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
675 * data is READ3res
676 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
677 * data is the error string.
678 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
679 * data is NULL.
680 */
681 struct READ3args;
682 EXTERN int rpc_nfs3_read_async(struct rpc_context *rpc, rpc_cb cb, struct READ3args *args, void *private_data);
683 EXTERN int rpc_nfs_read_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, uint64_t offset, uint64_t count, void *private_data);
684
685 /*
686 * Call NFS3/WRITE
687 * Function returns
688 * 0 : The call was initiated. The callback will be invoked when the call completes.
689 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
690 *
691 * When the callback is invoked, status indicates the result:
692 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
693 * data is WRITE3res *
694 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
695 * data is the error string.
696 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
697 * data is NULL.
698 */
699 struct WRITE3args;
700 EXTERN int rpc_nfs3_write_async(struct rpc_context *rpc, rpc_cb cb, struct WRITE3args *args, void *private_data);
701 EXTERN int rpc_nfs_write_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *buf, uint64_t offset, uint64_t count, int stable_how, void *private_data);
702
703 /*
704 * Call NFS3/COMMIT
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 nfs daemon.
711 * data is COMMIT3res *
712 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs 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 struct COMMIT3args;
718 EXTERN int rpc_nfs3_commit_async(struct rpc_context *rpc, rpc_cb cb, struct COMMIT3args *args, void *private_data);
719 EXTERN int rpc_nfs_commit_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
720
721 /*
722 * Call NFS3/SETATTR
723 * Function returns
724 * 0 : The call was initiated. The callback will be invoked when the call completes.
725 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
726 *
727 * When the callback is invoked, status indicates the result:
728 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
729 * data is SETATTR3res *
730 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
731 * data is the error string.
732 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
733 * data is NULL.
734 */
735 struct SETATTR3args;
736 EXTERN int rpc_nfs3_setattr_async(struct rpc_context *rpc, rpc_cb cb, struct SETATTR3args *args, void *private_data);
737 EXTERN int rpc_nfs_setattr_async(struct rpc_context *rpc, rpc_cb cb, struct SETATTR3args *args, void *private_data);
738
739 /*
740 * Call NFS3/MKDIR
741 * Function returns
742 * 0 : The call was initiated. The callback will be invoked when the call completes.
743 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
744 *
745 * When the callback is invoked, status indicates the result:
746 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
747 * data is MKDIR3res *
748 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
749 * data is the error string.
750 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
751 * data is NULL.
752 */
753 struct MKDIR3args;
754 EXTERN int rpc_nfs3_mkdir_async(struct rpc_context *rpc, rpc_cb cb, struct MKDIR3args *args, void *private_data);
755 EXTERN int rpc_nfs_mkdir_async(struct rpc_context *rpc, rpc_cb cb, struct MKDIR3args *args, void *private_data);
756
757 /*
758 * Call NFS3/RMDIR
759 * Function returns
760 * 0 : The call was initiated. The callback will be invoked when the call completes.
761 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
762 *
763 * When the callback is invoked, status indicates the result:
764 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
765 * data is RMDIR3res *
766 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
767 * data is the error string.
768 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
769 * data is NULL.
770 */
771 struct RMDIR3args;
772 EXTERN int rpc_nfs3_rmdir_async(struct rpc_context *rpc, rpc_cb cb, struct RMDIR3args *args, void *private_data);
773 EXTERN int rpc_nfs_rmdir_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *dir, void *private_data);
774
775 /*
776 * Call NFS3/CREATE
777 * Function returns
778 * 0 : The call was initiated. The callback will be invoked when the call completes.
779 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
780 *
781 * When the callback is invoked, status indicates the result:
782 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
783 * data is CREATE3res *
784 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
785 * data is the error string.
786 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
787 * data is NULL.
788 */
789 struct CREATE3args;
790 EXTERN int rpc_nfs3_create_async(struct rpc_context *rpc, rpc_cb cb, struct CREATE3args *args, void *private_data);
791 EXTERN int rpc_nfs_create_async(struct rpc_context *rpc, rpc_cb cb, struct CREATE3args *args, void *private_data);
792
793 /*
794 * Call NFS3/MKNOD
795 * Function returns
796 * 0 : The call was initiated. The callback will be invoked when the call completes.
797 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
798 *
799 * When the callback is invoked, status indicates the result:
800 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
801 * data is MKNOD3res *
802 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
803 * data is the error string.
804 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
805 * data is NULL.
806 */
807 struct MKNOD3args;
808 EXTERN int rpc_nfs3_mknod_async(struct rpc_context *rpc, rpc_cb cb, struct MKNOD3args *args, void *private_data);
809 EXTERN int rpc_nfs_mknod_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *file, int mode, int major, int minor, void *private_data);
810
811 /*
812 * Call NFS3/REMOVE
813 * Function returns
814 * 0 : The call was initiated. The callback will be invoked when the call completes.
815 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
816 *
817 * When the callback is invoked, status indicates the result:
818 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
819 * data is REMOVE3res *
820 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
821 * data is the error string.
822 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
823 * data is NULL.
824 */
825 struct REMOVE3args;
826 EXTERN int rpc_nfs3_remove_async(struct rpc_context *rpc, rpc_cb cb, struct REMOVE3args *args, void *private_data);
827 EXTERN int rpc_nfs_remove_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, char *name, void *private_data);
828
829 /*
830 * Call NFS3/READDIR
831 * Function returns
832 * 0 : The call was initiated. The callback will be invoked when the call completes.
833 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
834 *
835 * When the callback is invoked, status indicates the result:
836 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
837 * data is READDIR3res *
838 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
839 * data is the error string.
840 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
841 * data is NULL.
842 */
843 struct READDIR3args;
844 EXTERN int rpc_nfs3_readdir_async(struct rpc_context *rpc, rpc_cb cb, struct READDIR3args *args, void *private_data);
845 EXTERN int rpc_nfs_readdir_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, uint64_t cookie, char *cookieverf, int count, void *private_data);
846
847 /*
848 * Call NFS3/READDIRPLUS
849 * Function returns
850 * 0 : The call was initiated. The callback will be invoked when the call completes.
851 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
852 *
853 * When the callback is invoked, status indicates the result:
854 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
855 * data is READDIRPLUS3res *
856 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
857 * data is the error string.
858 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
859 * data is NULL.
860 */
861 struct READDIRPLUS3args;
862 EXTERN int rpc_nfs3_readdirplus_async(struct rpc_context *rpc, rpc_cb cb, struct READDIRPLUS3args *args, void *private_data);
863 EXTERN int rpc_nfs_readdirplus_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, uint64_t cookie, char *cookieverf, int count, void *private_data);
864
865 /*
866 * Call NFS3/FSSTAT
867 * Function returns
868 * 0 : The call was initiated. The callback will be invoked when the call completes.
869 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
870 *
871 * When the callback is invoked, status indicates the result:
872 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
873 * data is FSSTAT3res
874 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
875 * data is the error string.
876 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
877 * data is NULL.
878 */
879 struct FSSTAT3args;
880 EXTERN int rpc_nfs3_fsstat_async(struct rpc_context *rpc, rpc_cb cb, struct FSSTAT3args *args, void *private_data);
881 EXTERN int rpc_nfs_fsstat_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
882
883 /*
884 * Call NFS3/FSINFO
885 * Function returns
886 * 0 : The call was initiated. The callback will be invoked when the call completes.
887 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
888 *
889 * When the callback is invoked, status indicates the result:
890 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
891 * data is FSINFO3res
892 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
893 * data is the error string.
894 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
895 * data is NULL.
896 */
897 struct FSINFO3args;
898 EXTERN int rpc_nfs3_fsinfo_async(struct rpc_context *rpc, rpc_cb cb, struct FSINFO3args *args, void *private_data);
899 EXTERN int rpc_nfs_fsinfo_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *fh, void *private_data);
900
901 /*
902 * Call NFS3/READLINK
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 nfs daemon.
909 * data is READLINK3res *
910 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs 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 READLINK3args;
916 EXTERN int rpc_nfs3_readlink_async(struct rpc_context *rpc, rpc_cb cb, struct READLINK3args *args, void *private_data);
917 EXTERN int rpc_nfs_readlink_async(struct rpc_context *rpc, rpc_cb cb, struct READLINK3args *args, void *private_data);
918
919 /*
920 * Call NFS3/SYMLINK
921 * Function returns
922 * 0 : The call was initiated. The callback will be invoked when the call completes.
923 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
924 *
925 * When the callback is invoked, status indicates the result:
926 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
927 * data is SYMLINK3res *
928 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
929 * data is the error string.
930 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
931 * data is NULL.
932 */
933 struct SYMLINK3args;
934 EXTERN int rpc_nfs3_symlink_async(struct rpc_context *rpc, rpc_cb cb, struct SYMLINK3args *args, void *private_data);
935 EXTERN int rpc_nfs_symlink_async(struct rpc_context *rpc, rpc_cb cb, struct SYMLINK3args *args, void *private_data);
936
937 /*
938 * Call NFS3/RENAME
939 * Function returns
940 * 0 : The call was initiated. The callback will be invoked when the call completes.
941 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
942 *
943 * When the callback is invoked, status indicates the result:
944 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
945 * data is RENAME3res *
946 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
947 * data is the error string.
948 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
949 * data is NULL.
950 */
951 struct RENAME3args;
952 EXTERN int rpc_nfs3_rename_async(struct rpc_context *rpc, rpc_cb cb, struct RENAME3args *args, void *private_data);
953 EXTERN int rpc_nfs_rename_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *olddir, char *oldname, struct nfs_fh3 *newdir, char *newname, void *private_data);
954
955 /*
956 * Call NFS3/LINK
957 * Function returns
958 * 0 : The call was initiated. The callback will be invoked when the call completes.
959 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
960 *
961 * When the callback is invoked, status indicates the result:
962 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
963 * data is LINK3res *
964 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
965 * data is the error string.
966 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
967 * data is NULL.
968 */
969 struct LINK3args;
970 EXTERN int rpc_nfs3_link_async(struct rpc_context *rpc, rpc_cb cb, struct LINK3args *args, void *private_data);
971 EXTERN int rpc_nfs_link_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 *file, struct nfs_fh3 *newdir, char *newname, void *private_data);
972
973 /*
974 * NFS v2 FUNCTIONS
975 */
976
977 /*
978 * Call NFS2/NULL
979 * Function returns
980 * 0 : The call was initiated. The callback will be invoked when the call completes.
981 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
982 *
983 * When the callback is invoked, status indicates the result:
984 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
985 * data is NULL.
986 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
987 * data is the error string.
988 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
989 * data is NULL.
990 */
991 EXTERN int rpc_nfs2_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
992
993 /*
994 * Call NFS2/GETATTR
995 * Function returns
996 * 0 : The call was initiated. The callback will be invoked when the call completes.
997 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
998 *
999 * When the callback is invoked, status indicates the result:
1000 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
1001 * data is GETATTR2res
1002 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
1003 * data is the error string.
1004 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1005 * data is NULL.
1006 */
1007 struct GETATTR2args;
1008 EXTERN int rpc_nfs2_getattr_async(struct rpc_context *rpc, rpc_cb cb, struct GETATTR2args *args, void *private_data);
1009
1010 /*
1011 * Call NFS2/SETATTR
1012 * Function returns
1013 * 0 : The call was initiated. The callback will be invoked when the call completes.
1014 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1015 *
1016 * When the callback is invoked, status indicates the result:
1017 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
1018 * data is SETATTR2res *
1019 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
1020 * data is the error string.
1021 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1022 * data is NULL.
1023 */
1024 struct SETATTR2args;
1025 EXTERN int rpc_nfs2_setattr_async(struct rpc_context *rpc, rpc_cb cb, struct SETATTR2args *args, void *private_data);
1026
1027 /*
1028 * Call NFS2/LOOKUP
1029 * Function returns
1030 * 0 : The call was initiated. The callback will be invoked when the call completes.
1031 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1032 *
1033 * When the callback is invoked, status indicates the result:
1034 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
1035 * data is LOOKUP2res
1036 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
1037 * data is the error string.
1038 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1039 * data is NULL.
1040 */
1041 struct LOOKUP2args;
1042 EXTERN int rpc_nfs2_lookup_async(struct rpc_context *rpc, rpc_cb cb, struct LOOKUP2args *args, void *private_data);
1043
1044 /*
1045 * Call NFS2/READLINK
1046 * Function returns
1047 * 0 : The call was initiated. The callback will be invoked when the call completes.
1048 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1049 *
1050 * When the callback is invoked, status indicates the result:
1051 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
1052 * data is READLINK2res *
1053 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
1054 * data is the error string.
1055 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1056 * data is NULL.
1057 */
1058 struct READLINK2args;
1059 EXTERN int rpc_nfs32_readlink_async(struct rpc_context *rpc, rpc_cb cb, struct READLINK2args *args, void *private_data);
1060
1061 /*
1062 * Call NFS2/READ
1063 * Function returns
1064 * 0 : The call was initiated. The callback will be invoked when the call completes.
1065 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1066 *
1067 * When the callback is invoked, status indicates the result:
1068 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
1069 * data is READ2res
1070 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
1071 * data is the error string.
1072 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1073 * data is NULL.
1074 */
1075 struct READ2args;
1076 EXTERN int rpc_nfs2_read_async(struct rpc_context *rpc, rpc_cb cb, struct READ2args *args, void *private_data);
1077
1078 /*
1079 * Call NFS2/WRITE
1080 * Function returns
1081 * 0 : The call was initiated. The callback will be invoked when the call completes.
1082 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1083 *
1084 * When the callback is invoked, status indicates the result:
1085 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
1086 * data is WRITE2res *
1087 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
1088 * data is the error string.
1089 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1090 * data is NULL.
1091 */
1092 struct WRITE2args;
1093 EXTERN int rpc_nfs2_write_async(struct rpc_context *rpc, rpc_cb cb, struct WRITE2args *args, void *private_data);
1094
1095 /*
1096 * Call NFS2/CREATE
1097 * Function returns
1098 * 0 : The call was initiated. The callback will be invoked when the call completes.
1099 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1100 *
1101 * When the callback is invoked, status indicates the result:
1102 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
1103 * data is CREATE2res *
1104 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
1105 * data is the error string.
1106 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1107 * data is NULL.
1108 */
1109 struct CREATE2args;
1110 EXTERN int rpc_nfs2_create_async(struct rpc_context *rpc, rpc_cb cb, struct CREATE2args *args, void *private_data);
1111
1112 /*
1113 * Call NFS2/REMOVE
1114 * Function returns
1115 * 0 : The call was initiated. The callback will be invoked when the call completes.
1116 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1117 *
1118 * When the callback is invoked, status indicates the result:
1119 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
1120 * data is REMOVE2res *
1121 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
1122 * data is the error string.
1123 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1124 * data is NULL.
1125 */
1126 struct REMOVE2args;
1127 EXTERN int rpc_nfs2_remove_async(struct rpc_context *rpc, rpc_cb cb, struct REMOVE2args *args, void *private_data);
1128
1129 /*
1130 * Call NFS2/RENAME
1131 * Function returns
1132 * 0 : The call was initiated. The callback will be invoked when the call completes.
1133 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1134 *
1135 * When the callback is invoked, status indicates the result:
1136 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
1137 * data is RENAME2res *
1138 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
1139 * data is the error string.
1140 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1141 * data is NULL.
1142 */
1143 struct RENAME2args;
1144 EXTERN int rpc_nfs2_rename_async(struct rpc_context *rpc, rpc_cb cb, struct RENAME2args *args, void *private_data);
1145
1146 /*
1147 * Call NFS2/LINK
1148 * Function returns
1149 * 0 : The call was initiated. The callback will be invoked when the call completes.
1150 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1151 *
1152 * When the callback is invoked, status indicates the result:
1153 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
1154 * data is LINK2res *
1155 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
1156 * data is the error string.
1157 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1158 * data is NULL.
1159 */
1160 struct LINK2args;
1161 EXTERN int rpc_nfs2_link_async(struct rpc_context *rpc, rpc_cb cb, struct LINK2args *args, void *private_data);
1162
1163 /*
1164 * Call NFS2/SYMLINK
1165 * Function returns
1166 * 0 : The call was initiated. The callback will be invoked when the call completes.
1167 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1168 *
1169 * When the callback is invoked, status indicates the result:
1170 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
1171 * data is SYMLINK2res *
1172 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
1173 * data is the error string.
1174 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1175 * data is NULL.
1176 */
1177 struct SYMLINK2args;
1178 EXTERN int rpc_nfs2_symlink_async(struct rpc_context *rpc, rpc_cb cb, struct SYMLINK2args *args, void *private_data);
1179
1180 /*
1181 * Call NFS2/MKDIR
1182 * Function returns
1183 * 0 : The call was initiated. The callback will be invoked when the call completes.
1184 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1185 *
1186 * When the callback is invoked, status indicates the result:
1187 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
1188 * data is MKDIR2res *
1189 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
1190 * data is the error string.
1191 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1192 * data is NULL.
1193 */
1194 struct MKDIR2args;
1195 EXTERN int rpc_nfs2_mkdir_async(struct rpc_context *rpc, rpc_cb cb, struct MKDIR2args *args, void *private_data);
1196
1197 /*
1198 * Call NFS2/RMDIR
1199 * Function returns
1200 * 0 : The call was initiated. The callback will be invoked when the call completes.
1201 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1202 *
1203 * When the callback is invoked, status indicates the result:
1204 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
1205 * data is RMDIR2res *
1206 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
1207 * data is the error string.
1208 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1209 * data is NULL.
1210 */
1211 struct RMDIR2args;
1212 EXTERN int rpc_nfs2_rmdir_async(struct rpc_context *rpc, rpc_cb cb, struct RMDIR2args *args, void *private_data);
1213
1214 /*
1215 * Call NFS2/READDIR
1216 * Function returns
1217 * 0 : The call was initiated. The callback will be invoked when the call completes.
1218 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1219 *
1220 * When the callback is invoked, status indicates the result:
1221 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
1222 * data is READDIR2res *
1223 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
1224 * data is the error string.
1225 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1226 * data is NULL.
1227 */
1228 struct READDIR2args;
1229 EXTERN int rpc_nfs2_readdir_async(struct rpc_context *rpc, rpc_cb cb, struct READDIR2args *args, void *private_data);
1230
1231 /*
1232 * Call NFS2/STATFS
1233 * Function returns
1234 * 0 : The call was initiated. The callback will be invoked when the call completes.
1235 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1236 *
1237 * When the callback is invoked, status indicates the result:
1238 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
1239 * data is STATFS2res *
1240 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
1241 * data is the error string.
1242 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1243 * data is NULL.
1244 */
1245 struct STATFS2args;
1246 EXTERN int rpc_nfs2_statfs_async(struct rpc_context *rpc, rpc_cb cb, struct STATFS2args *args, void *private_data);
1247
1248 /*
1249 * RQUOTA FUNCTIONS
1250 */
1251 char *rquotastat_to_str(int error);
1252 int rquotastat_to_errno(int error);
1253
1254 /*
1255 * Call RQUOTA1/NULL
1256 * Function returns
1257 * 0 : The call was initiated. The callback will be invoked when the call completes.
1258 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1259 *
1260 * When the callback is invoked, status indicates the result:
1261 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
1262 * data is NULL.
1263 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
1264 * data is the error string.
1265 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1266 * data is NULL.
1267 */
1268 EXTERN int rpc_rquota1_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
1269
1270 /*
1271 * Call RQUOTA1/GETQUOTA
1272 * Function returns
1273 * 0 : The call was initiated. The callback will be invoked when the call completes.
1274 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1275 *
1276 * When the callback is invoked, status indicates the result:
1277 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
1278 * data is a RQUOTA1res structure.
1279 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
1280 * data is the error string.
1281 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1282 * data is NULL.
1283 */
1284 EXTERN int rpc_rquota1_getquota_async(struct rpc_context *rpc, rpc_cb cb, char *exportname, int uid, void *private_data);
1285
1286 /*
1287 * Call RQUOTA1/GETACTIVEQUOTA
1288 * Function returns
1289 * 0 : The call was initiated. The callback will be invoked when the call completes.
1290 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1291 *
1292 * When the callback is invoked, status indicates the result:
1293 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
1294 * data is a RQUOTA1res structure.
1295 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
1296 * data is the error string.
1297 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1298 * data is NULL.
1299 */
1300 EXTERN int rpc_rquota1_getactivequota_async(struct rpc_context *rpc, rpc_cb cb, char *exportname, int uid, void *private_data);
1301
1302
1303
1304
1305 /*
1306 * Call RQUOTA2/NULL
1307 * Function returns
1308 * 0 : The call was initiated. The callback will be invoked when the call completes.
1309 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1310 *
1311 * When the callback is invoked, status indicates the result:
1312 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
1313 * data is NULL.
1314 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
1315 * data is the error string.
1316 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1317 * data is NULL.
1318 */
1319 int rpc_rquota2_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
1320
1321 /*
1322 * Call RQUOTA2/GETQUOTA
1323 * Function returns
1324 * 0 : The call was initiated. The callback will be invoked when the call completes.
1325 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1326 *
1327 * When the callback is invoked, status indicates the result:
1328 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
1329 * data is a RQUOTA1res structure.
1330 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
1331 * data is the error string.
1332 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1333 * data is NULL.
1334 */
1335 int rpc_rquota2_getquota_async(struct rpc_context *rpc, rpc_cb cb, char *exportname, int type, int uid, void *private_data);
1336
1337 /*
1338 * Call RQUOTA2/GETACTIVEQUOTA
1339 * Function returns
1340 * 0 : The call was initiated. The callback will be invoked when the call completes.
1341 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1342 *
1343 * When the callback is invoked, status indicates the result:
1344 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
1345 * data is a RQUOTA1res structure.
1346 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
1347 * data is the error string.
1348 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1349 * data is NULL.
1350 */
1351 int rpc_rquota2_getactivequota_async(struct rpc_context *rpc, rpc_cb cb, char *exportname, int type, int uid, void *private_data);
1352
1353
1354
1355
1356
1357
1358 /*
1359 * NFSACL functions
1360 */
1361
1362 /*
1363 * Call NFSACL/NULL
1364 * Call the NULL procedure for the NFSACL
1365 *
1366 * Function returns
1367 * 0 : The call was initiated. The callback will be invoked when the call completes.
1368 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1369 *
1370 * When the callback is invoked, status indicates the result:
1371 * RPC_STATUS_SUCCESS : We got a successful response from the rquota daemon.
1372 * data is NULL
1373 * RPC_STATUS_ERROR : An error occured when trying to contact the rquota daemon.
1374 * data is the error string.
1375 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1376 * data is NULL.
1377 */
1378 EXTERN int rpc_nfsacl_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
1379
1380 /*
1381 * Call NFSACL/GETACL
1382 *
1383 * Function returns
1384 * 0 : The call was initiated. The callback will be invoked when the call completes.
1385 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1386 *
1387 * When the callback is invoked, status indicates the result:
1388 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
1389 * data is a GETACL3res pointer
1390 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
1391 * data is the error string.
1392 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1393 * data is NULL.
1394 */
1395 struct GETACL3args;
1396 EXTERN int rpc_nfsacl_getacl_async(struct rpc_context *rpc, rpc_cb cb, struct GETACL3args *args, void *private_data);
1397
1398
1399
1400 /*
1401 * Call NFSACL/SETACL
1402 *
1403 * Function returns
1404 * 0 : The call was initiated. The callback will be invoked when the call completes.
1405 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1406 *
1407 * When the callback is invoked, status indicates the result:
1408 * RPC_STATUS_SUCCESS : We got a successful response from the nfs daemon.
1409 * data is a SETACL3res pointer
1410 * RPC_STATUS_ERROR : An error occured when trying to contact the nfs daemon.
1411 * data is the error string.
1412 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1413 * data is NULL.
1414 */
1415 struct SETACL3args;
1416 EXTERN int rpc_nfsacl_setacl_async(struct rpc_context *rpc, rpc_cb cb, struct SETACL3args *args, void *private_data);
1417
1418
1419
1420
1421 /*
1422 * NLM functions
1423 */
1424 char *nlmstat4_to_str(int stat);
1425
1426 /*
1427 * Call NLM/NULL
1428 * Call the NULL procedure for the NLM protocol
1429 *
1430 * Function returns
1431 * 0 : The call was initiated. The callback will be invoked when the call completes.
1432 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1433 *
1434 * When the callback is invoked, status indicates the result:
1435 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
1436 * data is NULL
1437 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
1438 * data is the error string.
1439 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1440 * data is NULL.
1441 */
1442 EXTERN int rpc_nlm4_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
1443
1444 /*
1445 * Call NLM/TEST
1446 * Call the TEST procedure for the NLM protocol
1447 *
1448 * Function returns
1449 * 0 : The call was initiated. The callback will be invoked when the call completes.
1450 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1451 *
1452 * When the callback is invoked, status indicates the result:
1453 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
1454 * data is NLM4_TESTres
1455 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
1456 * data is the error string.
1457 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1458 * data is NULL.
1459 */
1460 struct NLM4_TESTargs;
1461 EXTERN int rpc_nlm4_test_async(struct rpc_context *rpc, rpc_cb cb, struct NLM4_TESTargs *args, void *private_data);
1462
1463 /*
1464 * Call NLM/LOCK
1465 * Call the LOCK procedure for the NLM protocol
1466 *
1467 * Function returns
1468 * 0 : The call was initiated. The callback will be invoked when the call completes.
1469 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1470 *
1471 * When the callback is invoked, status indicates the result:
1472 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
1473 * data is NLM4_LOCKres
1474 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
1475 * data is the error string.
1476 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1477 * data is NULL.
1478 */
1479 struct NLM4_LOCKargs;
1480 EXTERN int rpc_nlm4_lock_async(struct rpc_context *rpc, rpc_cb cb, struct NLM4_LOCKargs *args, void *private_data);
1481
1482 /*
1483 * Call NLM/CANCEL
1484 * Call the CANCEL procedure for the NLM protocol
1485 *
1486 * Function returns
1487 * 0 : The call was initiated. The callback will be invoked when the call completes.
1488 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1489 *
1490 * When the callback is invoked, status indicates the result:
1491 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
1492 * data is NLM4_CANCres
1493 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
1494 * data is the error string.
1495 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1496 * data is NULL.
1497 */
1498 struct NLM4_CANCargs;
1499 EXTERN int rpc_nlm4_cancel_async(struct rpc_context *rpc, rpc_cb cb, struct NLM4_CANCargs *args, void *private_data);
1500
1501 /*
1502 * Call NLM/UNLOCK
1503 * Call the UNLOCK procedure for the NLM protocol
1504 *
1505 * Function returns
1506 * 0 : The call was initiated. The callback will be invoked when the call completes.
1507 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1508 *
1509 * When the callback is invoked, status indicates the result:
1510 * RPC_STATUS_SUCCESS : We got a successful response from the nlm daemon.
1511 * data is NLM4_UNLOCKres
1512 * RPC_STATUS_ERROR : An error occured when trying to contact the nlm daemon.
1513 * data is the error string.
1514 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1515 * data is NULL.
1516 */
1517 struct NLM4_UNLOCKargs;
1518 EXTERN int rpc_nlm4_unlock_async(struct rpc_context *rpc, rpc_cb cb, struct NLM4_UNLOCKargs *args, void *private_data);
1519
1520 /*
1521 * NSM functions
1522 */
1523 char *nsmstat1_to_str(int stat);
1524
1525 /*
1526 * Call NSM/NULL
1527 * Call the NULL procedure for the NSM protocol
1528 *
1529 * Function returns
1530 * 0 : The call was initiated. The callback will be invoked when the call completes.
1531 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1532 *
1533 * When the callback is invoked, status indicates the result:
1534 * RPC_STATUS_SUCCESS : We got a successful response from the nsm daemon.
1535 * data is NULL
1536 * RPC_STATUS_ERROR : An error occured when trying to contact the nsm daemon.
1537 * data is the error string.
1538 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1539 * data is NULL.
1540 */
1541 EXTERN int rpc_nsm1_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
1542
1543 /*
1544 * Call NSM/STAT
1545 * Call the STAT procedure for the NSM protocol
1546 *
1547 * Function returns
1548 * 0 : The call was initiated. The callback will be invoked when the call completes.
1549 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1550 *
1551 * When the callback is invoked, status indicates the result:
1552 * RPC_STATUS_SUCCESS : We got a successful response from the nsm daemon.
1553 * data is NSM1_STATres
1554 * RPC_STATUS_ERROR : An error occured when trying to contact the nsm daemon.
1555 * data is the error string.
1556 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1557 * data is NULL.
1558 */
1559 struct NSM1_STATargs;
1560 EXTERN int rpc_nsm1_stat_async(struct rpc_context *rpc, rpc_cb cb, struct NSM1_STATargs *args, void *private_data);
1561
1562 /*
1563 * Call NSM/MON
1564 * Call the MON procedure for the NSM protocol
1565 *
1566 * Function returns
1567 * 0 : The call was initiated. The callback will be invoked when the call completes.
1568 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1569 *
1570 * When the callback is invoked, status indicates the result:
1571 * RPC_STATUS_SUCCESS : We got a successful response from the nsm daemon.
1572 * data is NSM1_MONres
1573 * RPC_STATUS_ERROR : An error occured when trying to contact the nsm daemon.
1574 * data is the error string.
1575 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1576 * data is NULL.
1577 */
1578 struct NSM1_MONargs;
1579 EXTERN int rpc_nsm1_mon_async(struct rpc_context *rpc, rpc_cb cb, struct NSM1_MONargs *args, void *private_data);
1580
1581 /*
1582 * Call NSM/UNMON
1583 * Call the UNMON procedure for the NSM protocol
1584 *
1585 * Function returns
1586 * 0 : The call was initiated. The callback will be invoked when the call completes.
1587 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1588 *
1589 * When the callback is invoked, status indicates the result:
1590 * RPC_STATUS_SUCCESS : We got a successful response from the nsm daemon.
1591 * data is NSM1_UNMONres
1592 * RPC_STATUS_ERROR : An error occured when trying to contact the nsm daemon.
1593 * data is the error string.
1594 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1595 * data is NULL.
1596 */
1597 struct NSM1_UNMONargs;
1598 EXTERN int rpc_nsm1_unmon_async(struct rpc_context *rpc, rpc_cb cb, struct NSM1_UNMONargs *args, void *private_data);
1599
1600 /*
1601 * Call NSM/UNMONALL
1602 * Call the UNMONALL procedure for the NSM protocol
1603 *
1604 * Function returns
1605 * 0 : The call was initiated. The callback will be invoked when the call completes.
1606 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1607 *
1608 * When the callback is invoked, status indicates the result:
1609 * RPC_STATUS_SUCCESS : We got a successful response from the nsm daemon.
1610 * data is NSM1_UNMONALLres
1611 * RPC_STATUS_ERROR : An error occured when trying to contact the nsm daemon.
1612 * data is the error string.
1613 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1614 * data is NULL.
1615 */
1616 struct NSM1_UNMONALLargs;
1617 EXTERN int rpc_nsm1_unmonall_async(struct rpc_context *rpc, rpc_cb cb, struct NSM1_UNMONALLargs *args, void *private_data);
1618
1619 /*
1620 * Call NSM/SIMUCRASH
1621 * Call the SIMUCRASH procedure for the NSM protocol
1622 *
1623 * Function returns
1624 * 0 : The call was initiated. The callback will be invoked when the call completes.
1625 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1626 *
1627 * When the callback is invoked, status indicates the result:
1628 * RPC_STATUS_SUCCESS : We got a successful response from the nsm daemon.
1629 * data is NULL
1630 * RPC_STATUS_ERROR : An error occured when trying to contact the nsm daemon.
1631 * data is the error string.
1632 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1633 * data is NULL.
1634 */
1635 EXTERN int rpc_nsm1_simucrash_async(struct rpc_context *rpc, rpc_cb cb, void *private_data);
1636
1637 /*
1638 * Call NSM/NOTIFY
1639 * Call the NOTIFY procedure for the NSM protocol
1640 *
1641 * Function returns
1642 * 0 : The call was initiated. The callback will be invoked when the call completes.
1643 * <0 : An error occured when trying to set up the call. The callback will not be invoked.
1644 *
1645 * When the callback is invoked, status indicates the result:
1646 * RPC_STATUS_SUCCESS : We got a successful response from the nsm daemon.
1647 * data is NULL
1648 * RPC_STATUS_ERROR : An error occured when trying to contact the nsm daemon.
1649 * data is the error string.
1650 * RPC_STATUS_CANCEL : The connection attempt was aborted before it could complete.
1651 * data is NULL.
1652 */
1653 struct NSM1_NOTIFYargs;
1654 EXTERN int rpc_nsm1_notify_async(struct rpc_context *rpc, rpc_cb cb, struct NSM1_NOTIFYargs *args, void *private_data);
1655
1656 #ifdef __cplusplus
1657 }
1658 #endif
1659
1660 #endif