Commit | Line | Data |
---|---|---|
84004dbf RS |
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 highlevel interface to access NFS resources using a posix-like interface | |
19 | */ | |
20 | #include <stdint.h> | |
252aa90d CF |
21 | #if defined(ANDROID) |
22 | #include <sys/time.h> | |
23 | #endif | |
d7c6e9aa RS |
24 | #if defined(AROS) |
25 | #include <sys/time.h> | |
26 | #endif | |
84004dbf RS |
27 | |
28 | struct nfs_context; | |
7f0242ca | 29 | struct rpc_context; |
84004dbf | 30 | |
d2ec73c7 PL |
31 | struct nfs_url { |
32 | char *server; | |
33 | char *path; | |
34 | char *file; | |
35 | }; | |
36 | ||
66ad6d84 RS |
37 | #if defined(WIN32) |
38 | #define EXTERN __declspec( dllexport ) | |
39 | #else | |
40 | #define EXTERN | |
41 | #endif | |
42 | ||
eecdc4f3 RS |
43 | #if defined(WIN32) |
44 | struct statvfs { | |
45 | uint32_t f_bsize; | |
46 | uint32_t f_frsize; | |
47 | uint64_t f_blocks; | |
48 | uint64_t f_bfree; | |
49 | uint64_t f_bavail; | |
50 | uint32_t f_files; | |
51 | uint32_t f_ffree; | |
52 | uint32_t f_favail; | |
53 | uint32_t f_fsid; | |
54 | uint32_t f_flag; | |
55 | uint32_t f_namemax; | |
56 | }; | |
57 | struct utimbuf { | |
58 | time_t actime; | |
59 | time_t modtime; | |
60 | }; | |
61 | #define R_OK 4 | |
62 | #define W_OK 2 | |
63 | #define X_OK 1 | |
64 | #endif | |
65 | ||
84004dbf RS |
66 | /* |
67 | * Used for interfacing the async version of the api into an external eventsystem | |
68 | */ | |
66ad6d84 RS |
69 | EXTERN int nfs_get_fd(struct nfs_context *nfs); |
70 | EXTERN int nfs_which_events(struct nfs_context *nfs); | |
71 | EXTERN int nfs_service(struct nfs_context *nfs, int revents); | |
83aa785d | 72 | EXTERN int nfs_queue_length(struct nfs_context *nfs); |
84004dbf RS |
73 | |
74 | /* | |
75 | * Used if you need different credentials than the default for the current user. | |
76 | */ | |
67ba2239 RS |
77 | struct AUTH; |
78 | EXTERN void nfs_set_auth(struct nfs_context *nfs, struct AUTH *auth); | |
84004dbf | 79 | |
84004dbf RS |
80 | /* |
81 | * When an operation failed, this function can extract a detailed error string. | |
82 | */ | |
66ad6d84 | 83 | EXTERN char *nfs_get_error(struct nfs_context *nfs); |
84004dbf RS |
84 | |
85 | ||
86 | /* | |
87 | * Callback for all ASYNC nfs functions | |
88 | */ | |
89 | typedef void (*nfs_cb)(int err, struct nfs_context *nfs, void *data, void *private_data); | |
90 | ||
7f0242ca RS |
91 | /* |
92 | * Callback for all ASYNC rpc functions | |
93 | */ | |
94 | typedef void (*rpc_cb)(struct rpc_context *rpc, int status, void *data, void *private_data); | |
84004dbf RS |
95 | |
96 | ||
97 | ||
98 | /* | |
99 | * NFS CONTEXT. | |
100 | */ | |
101 | /* | |
102 | * Create an NFS c, the context. | |
103 | * Function returns | |
104 | * NULL : Failed to create a context. | |
105 | * *nfs : A pointer to an nfs context. | |
106 | */ | |
66ad6d84 | 107 | EXTERN struct nfs_context *nfs_init_context(void); |
84004dbf RS |
108 | /* |
109 | * Destroy an nfs context. | |
110 | */ | |
66ad6d84 | 111 | EXTERN void nfs_destroy_context(struct nfs_context *nfs); |
84004dbf RS |
112 | |
113 | ||
0961765a RS |
114 | /* |
115 | * URL parsing functions. | |
116 | * These functions all parse a URL of the form | |
117 | * nfs://server/path/file?argv=val[&arg=val]* | |
118 | * and returns a nfs_url. | |
119 | * | |
120 | * Apart from parsing the URL the functions will also update | |
121 | * the nfs context to reflect settings controlled via url arguments. | |
122 | * | |
123 | * Current URL arguments are : | |
124 | * tcp-syncnt=<int> : Number of SYNs to send during the seccion establish | |
125 | * before failing settin up the tcp connection to the | |
126 | * server. | |
127 | * uid=<int> : UID value to use when talking to the server. | |
128 | * default it 65534 on Windows and getuid() on unixen. | |
129 | * gid=<int> : GID value to use when talking to the server. | |
130 | * default it 65534 on Windows and getgid() on unixen. | |
131 | */ | |
d2ec73c7 PL |
132 | /* |
133 | * Parse a complete NFS URL including, server, path and | |
134 | * filename. Fail if any component is missing. | |
135 | */ | |
136 | EXTERN struct nfs_url *nfs_parse_url_full(struct nfs_context *nfs, const char *url); | |
137 | ||
138 | /* | |
139 | * Parse an NFS URL, but do not split path and file. File | |
140 | * in the resulting struct remains NULL. | |
141 | */ | |
142 | EXTERN struct nfs_url *nfs_parse_url_dir(struct nfs_context *nfs, const char *url); | |
143 | ||
144 | /* | |
145 | * Parse an NFS URL, but do not fail if file, path or even server is missing. | |
146 | * Check elements of the resulting struct for NULL. | |
147 | */ | |
148 | EXTERN struct nfs_url *nfs_parse_url_incomplete(struct nfs_context *nfs, const char *url); | |
149 | ||
150 | ||
151 | /* | |
152 | * Free the URL struct returned by the nfs_parse_url_* functions. | |
153 | */ | |
154 | EXTERN void nfs_destroy_url(struct nfs_url *url); | |
155 | ||
156 | ||
84004dbf RS |
157 | struct nfsfh; |
158 | ||
17ef62fa RS |
159 | /* |
160 | * Get the maximum supported READ3 size by the server | |
161 | */ | |
183451cf | 162 | EXTERN uint64_t nfs_get_readmax(struct nfs_context *nfs); |
17ef62fa RS |
163 | |
164 | /* | |
165 | * Get the maximum supported WRITE3 size by the server | |
166 | */ | |
183451cf | 167 | EXTERN uint64_t nfs_get_writemax(struct nfs_context *nfs); |
17ef62fa | 168 | |
d43a8953 PL |
169 | /* |
170 | * MODIFY CONNECT PARAMTERS | |
171 | */ | |
172 | ||
173 | EXTERN void nfs_set_tcp_syncnt(struct nfs_context *nfs, int v); | |
174 | EXTERN void nfs_set_uid(struct nfs_context *nfs, int uid); | |
175 | EXTERN void nfs_set_gid(struct nfs_context *nfs, int gid); | |
84004dbf RS |
176 | |
177 | /* | |
178 | * MOUNT THE EXPORT | |
179 | */ | |
180 | /* | |
181 | * Async nfs mount. | |
182 | * Function returns | |
183 | * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked. | |
184 | * <0 : An error occured when trying to set up the operation. The callback will not be invoked. | |
185 | * | |
186 | * When the callback is invoked, status indicates the result: | |
187 | * 0 : Success. | |
188 | * data is NULL | |
189 | * -errno : An error occured. | |
190 | * data is the error string. | |
191 | */ | |
66ad6d84 | 192 | EXTERN int nfs_mount_async(struct nfs_context *nfs, const char *server, const char *exportname, nfs_cb cb, void *private_data); |
84004dbf RS |
193 | /* |
194 | * Sync nfs mount. | |
195 | * Function returns | |
196 | * 0 : The operation was successfull. | |
197 | * -errno : The command failed. | |
198 | */ | |
66ad6d84 | 199 | EXTERN int nfs_mount(struct nfs_context *nfs, const char *server, const char *exportname); |
84004dbf RS |
200 | |
201 | ||
202 | ||
203 | ||
204 | /* | |
205 | * STAT() | |
206 | */ | |
207 | /* | |
208 | * Async stat(<filename>) | |
209 | * Function returns | |
210 | * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked. | |
211 | * <0 : An error occured when trying to set up the operation. The callback will not be invoked. | |
212 | * | |
213 | * When the callback is invoked, status indicates the result: | |
214 | * 0 : Success. | |
215 | * data is struct stat * | |
216 | * -errno : An error occured. | |
217 | * data is the error string. | |
218 | */ | |
219 | struct stat; | |
66ad6d84 | 220 | EXTERN int nfs_stat_async(struct nfs_context *nfs, const char *path, nfs_cb cb, void *private_data); |
84004dbf RS |
221 | /* |
222 | * Sync stat(<filename>) | |
223 | * Function returns | |
224 | * 0 : The operation was successfull. | |
225 | * -errno : The command failed. | |
226 | */ | |
be184101 M |
227 | #ifdef WIN32 |
228 | EXTERN int nfs_stat(struct nfs_context *nfs, const char *path, struct __stat64 *st); | |
229 | #else | |
66ad6d84 | 230 | EXTERN int nfs_stat(struct nfs_context *nfs, const char *path, struct stat *st); |
be184101 | 231 | #endif |
84004dbf RS |
232 | |
233 | /* | |
234 | * FSTAT() | |
235 | */ | |
236 | /* | |
237 | * Async fstat(nfsfh *) | |
238 | * Function returns | |
239 | * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked. | |
240 | * <0 : An error occured when trying to set up the operation. The callback will not be invoked. | |
241 | * | |
242 | * When the callback is invoked, status indicates the result: | |
243 | * 0 : Success. | |
244 | * data is struct stat * | |
245 | * -errno : An error occured. | |
246 | * data is the error string. | |
247 | */ | |
66ad6d84 | 248 | EXTERN int nfs_fstat_async(struct nfs_context *nfs, struct nfsfh *nfsfh, nfs_cb cb, void *private_data); |
84004dbf RS |
249 | /* |
250 | * Sync fstat(nfsfh *) | |
251 | * Function returns | |
252 | * 0 : The operation was successfull. | |
253 | * -errno : The command failed. | |
254 | */ | |
be184101 M |
255 | #ifdef WIN32 |
256 | EXTERN int nfs_fstat(struct nfs_context *nfs, struct nfsfh *nfsfh, struct __stat64 *st); | |
257 | #else | |
66ad6d84 | 258 | EXTERN int nfs_fstat(struct nfs_context *nfs, struct nfsfh *nfsfh, struct stat *st); |
be184101 | 259 | #endif |
84004dbf RS |
260 | |
261 | ||
262 | ||
263 | /* | |
264 | * OPEN() | |
265 | */ | |
266 | /* | |
267 | * Async open(<filename>) | |
268 | * | |
269 | * mode is a combination of the flags : O_RDOLNY, O_WRONLY, O_RDWR , O_SYNC | |
270 | * | |
271 | * Function returns | |
272 | * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked. | |
273 | * <0 : An error occured when trying to set up the operation. The callback will not be invoked. | |
274 | * | |
3cea44dc RS |
275 | * Supported flags are |
276 | * O_RDONLY | |
277 | * O_WRONLY | |
278 | * O_RDWR | |
22a0f15b | 279 | * O_TRUNC (Only valid with O_RDWR or O_WRONLY. Ignored otherwise.) |
3cea44dc | 280 | * |
84004dbf RS |
281 | * When the callback is invoked, status indicates the result: |
282 | * 0 : Success. | |
283 | * data is a struct *nfsfh; | |
284 | * The nfsfh is close using nfs_close(). | |
285 | * -errno : An error occured. | |
286 | * data is the error string. | |
287 | */ | |
3cea44dc | 288 | EXTERN int nfs_open_async(struct nfs_context *nfs, const char *path, int flags, nfs_cb cb, void *private_data); |
84004dbf | 289 | /* |
f893b680 | 290 | * Sync open(<filename>) |
84004dbf RS |
291 | * Function returns |
292 | * 0 : The operation was successfull. *nfsfh is filled in. | |
293 | * -errno : The command failed. | |
294 | */ | |
3cea44dc | 295 | EXTERN int nfs_open(struct nfs_context *nfs, const char *path, int flags, struct nfsfh **nfsfh); |
84004dbf RS |
296 | |
297 | ||
298 | ||
299 | ||
300 | /* | |
301 | * CLOSE | |
302 | */ | |
303 | /* | |
304 | * Async close(nfsfh) | |
305 | * | |
306 | * Function returns | |
307 | * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked. | |
308 | * <0 : An error occured when trying to set up the operation. The callback will not be invoked. | |
309 | * | |
310 | * When the callback is invoked, status indicates the result: | |
311 | * 0 : Success. | |
312 | * data is NULL. | |
313 | * -errno : An error occured. | |
314 | * data is the error string. | |
315 | */ | |
66ad6d84 | 316 | EXTERN int nfs_close_async(struct nfs_context *nfs, struct nfsfh *nfsfh, nfs_cb cb, void *private_data); |
84004dbf RS |
317 | /* |
318 | * Sync close(nfsfh) | |
319 | * Function returns | |
320 | * 0 : The operation was successfull. | |
321 | * -errno : The command failed. | |
322 | */ | |
66ad6d84 | 323 | EXTERN int nfs_close(struct nfs_context *nfs, struct nfsfh *nfsfh); |
84004dbf RS |
324 | |
325 | ||
326 | /* | |
327 | * PREAD() | |
328 | */ | |
329 | /* | |
330 | * Async pread() | |
331 | * | |
332 | * Function returns | |
333 | * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked. | |
334 | * <0 : An error occured when trying to set up the operation. The callback will not be invoked. | |
335 | * | |
336 | * When the callback is invoked, status indicates the result: | |
337 | * >=0 : Success. | |
338 | * status is numer of bytes read. | |
339 | * data is a pointer to the returned data. | |
340 | * -errno : An error occured. | |
341 | * data is the error string. | |
342 | */ | |
183451cf | 343 | EXTERN int nfs_pread_async(struct nfs_context *nfs, struct nfsfh *nfsfh, uint64_t offset, uint64_t count, nfs_cb cb, void *private_data); |
84004dbf RS |
344 | /* |
345 | * Sync pread() | |
346 | * Function returns | |
347 | * >=0 : numer of bytes read. | |
348 | * -errno : An error occured. | |
349 | */ | |
183451cf | 350 | EXTERN int nfs_pread(struct nfs_context *nfs, struct nfsfh *nfsfh, uint64_t offset, uint64_t count, char *buf); |
84004dbf RS |
351 | |
352 | ||
353 | ||
354 | /* | |
355 | * READ() | |
356 | */ | |
357 | /* | |
358 | * Async read() | |
359 | * | |
360 | * Function returns | |
361 | * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked. | |
362 | * <0 : An error occured when trying to set up the operation. The callback will not be invoked. | |
363 | * | |
364 | * When the callback is invoked, status indicates the result: | |
365 | * >=0 : Success. | |
366 | * status is numer of bytes read. | |
367 | * data is a pointer to the returned data. | |
368 | * -errno : An error occured. | |
369 | * data is the error string. | |
370 | */ | |
183451cf | 371 | EXTERN int nfs_read_async(struct nfs_context *nfs, struct nfsfh *nfsfh, uint64_t count, nfs_cb cb, void *private_data); |
84004dbf RS |
372 | /* |
373 | * Sync read() | |
374 | * Function returns | |
375 | * >=0 : numer of bytes read. | |
376 | * -errno : An error occured. | |
377 | */ | |
183451cf | 378 | EXTERN int nfs_read(struct nfs_context *nfs, struct nfsfh *nfsfh, uint64_t count, char *buf); |
84004dbf RS |
379 | |
380 | ||
381 | ||
382 | ||
383 | /* | |
384 | * PWRITE() | |
385 | */ | |
386 | /* | |
387 | * Async pwrite() | |
388 | * | |
389 | * Function returns | |
390 | * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked. | |
391 | * <0 : An error occured when trying to set up the operation. The callback will not be invoked. | |
392 | * | |
393 | * When the callback is invoked, status indicates the result: | |
394 | * >=0 : Success. | |
395 | * status is numer of bytes written. | |
396 | * -errno : An error occured. | |
397 | * data is the error string. | |
398 | */ | |
183451cf | 399 | EXTERN int nfs_pwrite_async(struct nfs_context *nfs, struct nfsfh *nfsfh, uint64_t offset, uint64_t count, char *buf, nfs_cb cb, void *private_data); |
84004dbf RS |
400 | /* |
401 | * Sync pwrite() | |
402 | * Function returns | |
403 | * >=0 : numer of bytes written. | |
404 | * -errno : An error occured. | |
405 | */ | |
183451cf | 406 | EXTERN int nfs_pwrite(struct nfs_context *nfs, struct nfsfh *nfsfh, uint64_t offset, uint64_t count, char *buf); |
84004dbf RS |
407 | |
408 | ||
409 | /* | |
410 | * WRITE() | |
411 | */ | |
412 | /* | |
413 | * Async write() | |
414 | * | |
415 | * Function returns | |
416 | * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked. | |
417 | * <0 : An error occured when trying to set up the operation. The callback will not be invoked. | |
418 | * | |
419 | * When the callback is invoked, status indicates the result: | |
420 | * >=0 : Success. | |
421 | * status is numer of bytes written. | |
422 | * -errno : An error occured. | |
423 | * data is the error string. | |
424 | */ | |
183451cf | 425 | EXTERN int nfs_write_async(struct nfs_context *nfs, struct nfsfh *nfsfh, uint64_t count, char *buf, nfs_cb cb, void *private_data); |
84004dbf RS |
426 | /* |
427 | * Sync write() | |
428 | * Function returns | |
429 | * >=0 : numer of bytes written. | |
430 | * -errno : An error occured. | |
431 | */ | |
183451cf | 432 | EXTERN int nfs_write(struct nfs_context *nfs, struct nfsfh *nfsfh, uint64_t count, char *buf); |
84004dbf RS |
433 | |
434 | ||
435 | /* | |
436 | * LSEEK() | |
437 | */ | |
438 | /* | |
439 | * Async lseek() | |
440 | * | |
441 | * Function returns | |
442 | * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked. | |
443 | * <0 : An error occured when trying to set up the operation. The callback will not be invoked. | |
444 | * | |
445 | * When the callback is invoked, status indicates the result: | |
446 | * >=0 : Success. | |
183451cf | 447 | * data is uint64_t * for the current position. |
84004dbf RS |
448 | * -errno : An error occured. |
449 | * data is the error string. | |
450 | */ | |
183451cf | 451 | EXTERN int nfs_lseek_async(struct nfs_context *nfs, struct nfsfh *nfsfh, uint64_t offset, int whence, nfs_cb cb, void *private_data); |
84004dbf RS |
452 | /* |
453 | * Sync lseek() | |
454 | * Function returns | |
455 | * >=0 : numer of bytes read. | |
456 | * -errno : An error occured. | |
457 | */ | |
183451cf | 458 | EXTERN int nfs_lseek(struct nfs_context *nfs, struct nfsfh *nfsfh, uint64_t offset, int whence, uint64_t *current_offset); |
84004dbf RS |
459 | |
460 | ||
461 | /* | |
462 | * FSYNC() | |
463 | */ | |
464 | /* | |
465 | * Async fsync() | |
466 | * | |
467 | * Function returns | |
468 | * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked. | |
469 | * <0 : An error occured when trying to set up the operation. The callback will not be invoked. | |
470 | * | |
471 | * When the callback is invoked, status indicates the result: | |
472 | * 0 : Success. | |
473 | * -errno : An error occured. | |
474 | * data is the error string. | |
475 | */ | |
66ad6d84 | 476 | EXTERN int nfs_fsync_async(struct nfs_context *nfs, struct nfsfh *nfsfh, nfs_cb cb, void *private_data); |
84004dbf RS |
477 | /* |
478 | * Sync fsync() | |
479 | * Function returns | |
480 | * 0 : Success | |
481 | * -errno : An error occured. | |
482 | */ | |
66ad6d84 | 483 | EXTERN int nfs_fsync(struct nfs_context *nfs, struct nfsfh *nfsfh); |
84004dbf RS |
484 | |
485 | ||
486 | ||
487 | /* | |
488 | * TRUNCATE() | |
489 | */ | |
490 | /* | |
491 | * Async truncate() | |
492 | * | |
493 | * Function returns | |
494 | * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked. | |
495 | * <0 : An error occured when trying to set up the operation. The callback will not be invoked. | |
496 | * | |
497 | * When the callback is invoked, status indicates the result: | |
498 | * 0 : Success. | |
499 | * -errno : An error occured. | |
500 | * data is the error string. | |
501 | */ | |
183451cf | 502 | EXTERN int nfs_truncate_async(struct nfs_context *nfs, const char *path, uint64_t length, nfs_cb cb, void *private_data); |
84004dbf RS |
503 | /* |
504 | * Sync truncate() | |
505 | * Function returns | |
506 | * 0 : Success | |
507 | * -errno : An error occured. | |
508 | */ | |
183451cf | 509 | EXTERN int nfs_truncate(struct nfs_context *nfs, const char *path, uint64_t length); |
84004dbf RS |
510 | |
511 | ||
512 | ||
513 | /* | |
514 | * FTRUNCATE() | |
515 | */ | |
516 | /* | |
517 | * Async ftruncate() | |
518 | * | |
519 | * Function returns | |
520 | * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked. | |
521 | * <0 : An error occured when trying to set up the operation. The callback will not be invoked. | |
522 | * | |
523 | * When the callback is invoked, status indicates the result: | |
524 | * 0 : Success. | |
525 | * -errno : An error occured. | |
526 | * data is the error string. | |
527 | */ | |
183451cf | 528 | EXTERN int nfs_ftruncate_async(struct nfs_context *nfs, struct nfsfh *nfsfh, uint64_t length, nfs_cb cb, void *private_data); |
84004dbf RS |
529 | /* |
530 | * Sync ftruncate() | |
531 | * Function returns | |
532 | * 0 : Success | |
533 | * -errno : An error occured. | |
534 | */ | |
183451cf | 535 | EXTERN int nfs_ftruncate(struct nfs_context *nfs, struct nfsfh *nfsfh, uint64_t length); |
84004dbf RS |
536 | |
537 | ||
538 | ||
539 | ||
540 | ||
541 | ||
542 | /* | |
543 | * MKDIR() | |
544 | */ | |
545 | /* | |
546 | * Async mkdir() | |
547 | * | |
548 | * Function returns | |
549 | * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked. | |
550 | * <0 : An error occured when trying to set up the operation. The callback will not be invoked. | |
551 | * | |
552 | * When the callback is invoked, status indicates the result: | |
553 | * 0 : Success. | |
554 | * -errno : An error occured. | |
555 | * data is the error string. | |
556 | */ | |
66ad6d84 | 557 | EXTERN int nfs_mkdir_async(struct nfs_context *nfs, const char *path, nfs_cb cb, void *private_data); |
84004dbf RS |
558 | /* |
559 | * Sync mkdir() | |
560 | * Function returns | |
561 | * 0 : Success | |
562 | * -errno : An error occured. | |
563 | */ | |
66ad6d84 | 564 | EXTERN int nfs_mkdir(struct nfs_context *nfs, const char *path); |
84004dbf RS |
565 | |
566 | ||
567 | ||
568 | /* | |
569 | * RMDIR() | |
570 | */ | |
571 | /* | |
572 | * Async rmdir() | |
573 | * | |
574 | * Function returns | |
575 | * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked. | |
576 | * <0 : An error occured when trying to set up the operation. The callback will not be invoked. | |
577 | * | |
578 | * When the callback is invoked, status indicates the result: | |
579 | * 0 : Success. | |
580 | * -errno : An error occured. | |
581 | * data is the error string. | |
582 | */ | |
66ad6d84 | 583 | EXTERN int nfs_rmdir_async(struct nfs_context *nfs, const char *path, nfs_cb cb, void *private_data); |
84004dbf RS |
584 | /* |
585 | * Sync rmdir() | |
586 | * Function returns | |
587 | * 0 : Success | |
588 | * -errno : An error occured. | |
589 | */ | |
66ad6d84 | 590 | EXTERN int nfs_rmdir(struct nfs_context *nfs, const char *path); |
84004dbf RS |
591 | |
592 | ||
593 | ||
594 | ||
595 | /* | |
596 | * CREAT() | |
597 | */ | |
598 | /* | |
599 | * Async creat() | |
600 | * | |
601 | * Function returns | |
602 | * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked. | |
603 | * <0 : An error occured when trying to set up the operation. The callback will not be invoked. | |
604 | * | |
605 | * When the callback is invoked, status indicates the result: | |
606 | * 0 : Success. | |
607 | * data is a struct *nfsfh; | |
608 | * -errno : An error occured. | |
609 | * data is the error string. | |
610 | */ | |
66ad6d84 | 611 | EXTERN int nfs_creat_async(struct nfs_context *nfs, const char *path, int mode, nfs_cb cb, void *private_data); |
84004dbf RS |
612 | /* |
613 | * Sync creat() | |
614 | * Function returns | |
615 | * 0 : Success | |
616 | * -errno : An error occured. | |
617 | */ | |
66ad6d84 | 618 | EXTERN int nfs_creat(struct nfs_context *nfs, const char *path, int mode, struct nfsfh **nfsfh); |
84004dbf RS |
619 | |
620 | ||
1ec6b50a RS |
621 | /* |
622 | * MKNOD() | |
623 | */ | |
624 | /* | |
625 | * Async mknod() | |
626 | * | |
627 | * Function returns | |
628 | * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked. | |
629 | * <0 : An error occured when trying to set up the operation. The callback will not be invoked. | |
630 | * | |
631 | * When the callback is invoked, status indicates the result: | |
632 | * 0 : Success. | |
633 | * -errno : An error occured. | |
634 | * data is the error string. | |
635 | */ | |
636 | EXTERN int nfs_mknod_async(struct nfs_context *nfs, const char *path, int mode, int dev, nfs_cb cb, void *private_data); | |
637 | /* | |
638 | * Sync mknod() | |
639 | * Function returns | |
640 | * 0 : Success | |
641 | * -errno : An error occured. | |
642 | */ | |
643 | EXTERN int nfs_mknod(struct nfs_context *nfs, const char *path, int mode, int dev); | |
84004dbf RS |
644 | |
645 | ||
646 | ||
647 | /* | |
648 | * UNLINK() | |
649 | */ | |
650 | /* | |
651 | * Async unlink() | |
652 | * | |
653 | * Function returns | |
654 | * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked. | |
655 | * <0 : An error occured when trying to set up the operation. The callback will not be invoked. | |
656 | * | |
657 | * When the callback is invoked, status indicates the result: | |
658 | * 0 : Success. | |
659 | * data is NULL | |
660 | * -errno : An error occured. | |
661 | * data is the error string. | |
662 | */ | |
66ad6d84 | 663 | EXTERN int nfs_unlink_async(struct nfs_context *nfs, const char *path, nfs_cb cb, void *private_data); |
84004dbf RS |
664 | /* |
665 | * Sync unlink() | |
666 | * Function returns | |
667 | * 0 : Success | |
668 | * -errno : An error occured. | |
669 | */ | |
66ad6d84 | 670 | EXTERN int nfs_unlink(struct nfs_context *nfs, const char *path); |
84004dbf RS |
671 | |
672 | ||
673 | ||
674 | ||
675 | /* | |
676 | * OPENDIR() | |
677 | */ | |
678 | struct nfsdir; | |
679 | /* | |
680 | * Async opendir() | |
681 | * | |
682 | * Function returns | |
683 | * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked. | |
684 | * <0 : An error occured when trying to set up the operation. The callback will not be invoked. | |
685 | * | |
686 | * When struct nfsdir * is returned, this resource is closed/freed by calling nfs_closedir() | |
687 | * | |
688 | * When the callback is invoked, status indicates the result: | |
689 | * 0 : Success. | |
690 | * data is struct nfsdir * | |
691 | * -errno : An error occured. | |
692 | * data is the error string. | |
693 | */ | |
66ad6d84 | 694 | EXTERN int nfs_opendir_async(struct nfs_context *nfs, const char *path, nfs_cb cb, void *private_data); |
84004dbf RS |
695 | /* |
696 | * Sync opendir() | |
697 | * Function returns | |
698 | * 0 : Success | |
699 | * -errno : An error occured. | |
700 | */ | |
66ad6d84 | 701 | EXTERN int nfs_opendir(struct nfs_context *nfs, const char *path, struct nfsdir **nfsdir); |
84004dbf RS |
702 | |
703 | ||
704 | ||
705 | /* | |
706 | * READDIR() | |
707 | */ | |
708 | struct nfsdirent { | |
709 | struct nfsdirent *next; | |
710 | char *name; | |
711 | uint64_t inode; | |
0804e67d | 712 | |
7bda8bad RS |
713 | /* Some extra fields we get for free through the READDIRPLUS3 call. |
714 | You need libnfs-raw-nfs.h for type/mode constants */ | |
0804e67d RS |
715 | uint32_t type; /* NF3REG, NF3DIR, NF3BLK, ... */ |
716 | uint32_t mode; | |
717 | uint64_t size; | |
718 | struct timeval atime; | |
719 | struct timeval mtime; | |
720 | struct timeval ctime; | |
7bda8bad RS |
721 | uint32_t uid; |
722 | uint32_t gid; | |
84004dbf RS |
723 | }; |
724 | /* | |
725 | * nfs_readdir() never blocks, so no special sync/async versions are available | |
726 | */ | |
66ad6d84 | 727 | EXTERN struct nfsdirent *nfs_readdir(struct nfs_context *nfs, struct nfsdir *nfsdir); |
84004dbf RS |
728 | |
729 | ||
730 | ||
731 | /* | |
f893b680 | 732 | * CLOSEDIR() |
84004dbf RS |
733 | */ |
734 | /* | |
735 | * nfs_closedir() never blocks, so no special sync/async versions are available | |
736 | */ | |
66ad6d84 | 737 | EXTERN void nfs_closedir(struct nfs_context *nfs, struct nfsdir *nfsdir); |
84004dbf RS |
738 | |
739 | ||
f893b680 RS |
740 | /* |
741 | * CHDIR() | |
742 | */ | |
743 | /* | |
744 | * Async chdir(<path>) | |
745 | * | |
746 | * Function returns | |
747 | * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked. | |
748 | * <0 : An error occured when trying to set up the operation. The callback will not be invoked. | |
749 | * | |
750 | * When the callback is invoked, status indicates the result: | |
751 | * 0 : Success. | |
752 | * data is NULL; | |
753 | * -errno : An error occured. | |
754 | * data is the error string. | |
755 | */ | |
756 | EXTERN int nfs_chdir_async(struct nfs_context *nfs, const char *path, nfs_cb cb, void *private_data); | |
757 | /* | |
758 | * Sync chdir(<path>) | |
759 | * Function returns | |
760 | * 0 : The operation was successfull. | |
761 | * -errno : The command failed. | |
762 | */ | |
763 | EXTERN int nfs_chdir(struct nfs_context *nfs, const char *path); | |
764 | ||
765 | /* | |
766 | * GETCWD() | |
767 | */ | |
768 | /* | |
769 | * nfs_getcwd() never blocks, so no special sync/async versions are available | |
770 | */ | |
771 | /* | |
772 | * Sync getcwd() | |
773 | * This function returns a pointer to the current working directory. | |
774 | * This pointer is only stable until the next [f]chdir or when the | |
775 | * context is destroyed. | |
776 | * | |
777 | * Function returns | |
778 | * 0 : The operation was successfull and *cwd is filled in. | |
779 | * -errno : The command failed. | |
780 | */ | |
781 | EXTERN void nfs_getcwd(struct nfs_context *nfs, const char **cwd); | |
782 | ||
84004dbf RS |
783 | |
784 | /* | |
785 | * STATVFS() | |
786 | */ | |
787 | /* | |
788 | * Async statvfs(<dirname>) | |
789 | * Function returns | |
790 | * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked. | |
791 | * <0 : An error occured when trying to set up the operation. The callback will not be invoked. | |
792 | * | |
793 | * When the callback is invoked, status indicates the result: | |
794 | * 0 : Success. | |
795 | * data is struct statvfs * | |
796 | * -errno : An error occured. | |
797 | * data is the error string. | |
798 | */ | |
799 | struct statvfs; | |
66ad6d84 | 800 | EXTERN int nfs_statvfs_async(struct nfs_context *nfs, const char *path, nfs_cb cb, void *private_data); |
84004dbf RS |
801 | /* |
802 | * Sync statvfs(<dirname>) | |
803 | * Function returns | |
804 | * 0 : The operation was successfull. | |
805 | * -errno : The command failed. | |
806 | */ | |
66ad6d84 | 807 | EXTERN int nfs_statvfs(struct nfs_context *nfs, const char *path, struct statvfs *svfs); |
84004dbf RS |
808 | |
809 | ||
810 | /* | |
811 | * READLINK() | |
812 | */ | |
813 | /* | |
814 | * Async readlink(<name>) | |
815 | * Function returns | |
816 | * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked. | |
817 | * <0 : An error occured when trying to set up the operation. The callback will not be invoked. | |
818 | * | |
819 | * When the callback is invoked, status indicates the result: | |
820 | * 0 : Success. | |
821 | * data is a char * | |
822 | * data is only valid during the callback and is automatically freed when the callback returns. | |
823 | * -errno : An error occured. | |
824 | * data is the error string. | |
825 | */ | |
826 | struct statvfs; | |
66ad6d84 | 827 | EXTERN int nfs_readlink_async(struct nfs_context *nfs, const char *path, nfs_cb cb, void *private_data); |
84004dbf RS |
828 | /* |
829 | * Sync readlink(<name>) | |
830 | * Function returns | |
831 | * 0 : The operation was successfull. | |
832 | * -errno : The command failed. | |
833 | */ | |
66ad6d84 | 834 | EXTERN int nfs_readlink(struct nfs_context *nfs, const char *path, char *buf, int bufsize); |
84004dbf RS |
835 | |
836 | ||
837 | ||
838 | /* | |
839 | * CHMOD() | |
840 | */ | |
841 | /* | |
842 | * Async chmod(<name>) | |
843 | * Function returns | |
844 | * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked. | |
845 | * <0 : An error occured when trying to set up the operation. The callback will not be invoked. | |
846 | * | |
847 | * When the callback is invoked, status indicates the result: | |
848 | * 0 : Success. | |
849 | * data is NULL | |
850 | * -errno : An error occured. | |
851 | * data is the error string. | |
852 | */ | |
66ad6d84 | 853 | EXTERN int nfs_chmod_async(struct nfs_context *nfs, const char *path, int mode, nfs_cb cb, void *private_data); |
84004dbf RS |
854 | /* |
855 | * Sync chmod(<name>) | |
856 | * Function returns | |
857 | * 0 : The operation was successfull. | |
858 | * -errno : The command failed. | |
859 | */ | |
66ad6d84 | 860 | EXTERN int nfs_chmod(struct nfs_context *nfs, const char *path, int mode); |
84004dbf RS |
861 | |
862 | ||
863 | ||
864 | /* | |
865 | * FCHMOD() | |
866 | */ | |
867 | /* | |
868 | * Async fchmod(<handle>) | |
869 | * Function returns | |
870 | * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked. | |
871 | * <0 : An error occured when trying to set up the operation. The callback will not be invoked. | |
872 | * | |
873 | * When the callback is invoked, status indicates the result: | |
874 | * 0 : Success. | |
875 | * data is NULL | |
876 | * -errno : An error occured. | |
877 | * data is the error string. | |
878 | */ | |
66ad6d84 | 879 | EXTERN int nfs_fchmod_async(struct nfs_context *nfs, struct nfsfh *nfsfh, int mode, nfs_cb cb, void *private_data); |
84004dbf RS |
880 | /* |
881 | * Sync fchmod(<handle>) | |
882 | * Function returns | |
883 | * 0 : The operation was successfull. | |
884 | * -errno : The command failed. | |
885 | */ | |
66ad6d84 | 886 | EXTERN int nfs_fchmod(struct nfs_context *nfs, struct nfsfh *nfsfh, int mode); |
84004dbf RS |
887 | |
888 | ||
889 | ||
890 | /* | |
891 | * CHOWN() | |
892 | */ | |
893 | /* | |
894 | * Async chown(<name>) | |
895 | * Function returns | |
896 | * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked. | |
897 | * <0 : An error occured when trying to set up the operation. The callback will not be invoked. | |
898 | * | |
899 | * When the callback is invoked, status indicates the result: | |
900 | * 0 : Success. | |
901 | * data is NULL | |
902 | * -errno : An error occured. | |
903 | * data is the error string. | |
904 | */ | |
66ad6d84 | 905 | EXTERN int nfs_chown_async(struct nfs_context *nfs, const char *path, int uid, int gid, nfs_cb cb, void *private_data); |
84004dbf RS |
906 | /* |
907 | * Sync chown(<name>) | |
908 | * Function returns | |
909 | * 0 : The operation was successfull. | |
910 | * -errno : The command failed. | |
911 | */ | |
66ad6d84 | 912 | EXTERN int nfs_chown(struct nfs_context *nfs, const char *path, int uid, int gid); |
84004dbf RS |
913 | |
914 | ||
915 | ||
916 | /* | |
917 | * FCHOWN() | |
918 | */ | |
919 | /* | |
920 | * Async fchown(<handle>) | |
921 | * Function returns | |
922 | * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked. | |
923 | * <0 : An error occured when trying to set up the operation. The callback will not be invoked. | |
924 | * | |
925 | * When the callback is invoked, status indicates the result: | |
926 | * 0 : Success. | |
927 | * data is NULL | |
928 | * -errno : An error occured. | |
929 | * data is the error string. | |
930 | */ | |
66ad6d84 | 931 | EXTERN int nfs_fchown_async(struct nfs_context *nfs, struct nfsfh *nfsfh, int uid, int gid, nfs_cb cb, void *private_data); |
84004dbf RS |
932 | /* |
933 | * Sync fchown(<handle>) | |
934 | * Function returns | |
935 | * 0 : The operation was successfull. | |
936 | * -errno : The command failed. | |
937 | */ | |
66ad6d84 | 938 | EXTERN int nfs_fchown(struct nfs_context *nfs, struct nfsfh *nfsfh, int uid, int gid); |
84004dbf RS |
939 | |
940 | ||
941 | ||
942 | ||
943 | /* | |
944 | * UTIMES() | |
945 | */ | |
946 | /* | |
947 | * Async utimes(<path>) | |
948 | * Function returns | |
949 | * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked. | |
950 | * <0 : An error occured when trying to set up the operation. The callback will not be invoked. | |
951 | * | |
952 | * When the callback is invoked, status indicates the result: | |
953 | * 0 : Success. | |
954 | * data is NULL | |
955 | * -errno : An error occured. | |
956 | * data is the error string. | |
957 | */ | |
66ad6d84 | 958 | EXTERN int nfs_utimes_async(struct nfs_context *nfs, const char *path, struct timeval *times, nfs_cb cb, void *private_data); |
84004dbf RS |
959 | /* |
960 | * Sync utimes(<path>) | |
961 | * Function returns | |
962 | * 0 : The operation was successfull. | |
963 | * -errno : The command failed. | |
964 | */ | |
66ad6d84 | 965 | EXTERN int nfs_utimes(struct nfs_context *nfs, const char *path, struct timeval *times); |
84004dbf RS |
966 | |
967 | ||
968 | /* | |
969 | * UTIME() | |
970 | */ | |
971 | /* | |
972 | * Async utime(<path>) | |
973 | * Function returns | |
974 | * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked. | |
975 | * <0 : An error occured when trying to set up the operation. The callback will not be invoked. | |
976 | * | |
977 | * When the callback is invoked, status indicates the result: | |
978 | * 0 : Success. | |
979 | * data is NULL | |
980 | * -errno : An error occured. | |
981 | * data is the error string. | |
982 | */ | |
983 | struct utimbuf; | |
66ad6d84 | 984 | EXTERN int nfs_utime_async(struct nfs_context *nfs, const char *path, struct utimbuf *times, nfs_cb cb, void *private_data); |
84004dbf RS |
985 | /* |
986 | * Sync utime(<path>) | |
987 | * Function returns | |
988 | * 0 : The operation was successfull. | |
989 | * -errno : The command failed. | |
990 | */ | |
66ad6d84 | 991 | EXTERN int nfs_utime(struct nfs_context *nfs, const char *path, struct utimbuf *times); |
84004dbf RS |
992 | |
993 | ||
994 | ||
995 | ||
996 | /* | |
997 | * ACCESS() | |
998 | */ | |
999 | /* | |
1000 | * Async access(<path>) | |
1001 | * Function returns | |
1002 | * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked. | |
1003 | * <0 : An error occured when trying to set up the operation. The callback will not be invoked. | |
1004 | * | |
1005 | * When the callback is invoked, status indicates the result: | |
1006 | * 0 : Success. | |
1007 | * data is NULL | |
1008 | * -errno : An error occured. | |
1009 | * data is the error string. | |
1010 | */ | |
66ad6d84 | 1011 | EXTERN int nfs_access_async(struct nfs_context *nfs, const char *path, int mode, nfs_cb cb, void *private_data); |
84004dbf RS |
1012 | /* |
1013 | * Sync access(<path>) | |
1014 | * Function returns | |
1015 | * 0 : The operation was successfull. | |
1016 | * -errno : The command failed. | |
1017 | */ | |
66ad6d84 | 1018 | EXTERN int nfs_access(struct nfs_context *nfs, const char *path, int mode); |
84004dbf RS |
1019 | |
1020 | ||
1021 | ||
1022 | ||
1023 | /* | |
1024 | * SYMLINK() | |
1025 | */ | |
1026 | /* | |
1027 | * Async symlink(<path>) | |
1028 | * Function returns | |
1029 | * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked. | |
1030 | * <0 : An error occured when trying to set up the operation. The callback will not be invoked. | |
1031 | * | |
1032 | * When the callback is invoked, status indicates the result: | |
1033 | * 0 : Success. | |
1034 | * data is NULL | |
1035 | * -errno : An error occured. | |
1036 | * data is the error string. | |
1037 | */ | |
66ad6d84 | 1038 | EXTERN int nfs_symlink_async(struct nfs_context *nfs, const char *oldpath, const char *newpath, nfs_cb cb, void *private_data); |
84004dbf RS |
1039 | /* |
1040 | * Sync symlink(<path>) | |
1041 | * Function returns | |
1042 | * 0 : The operation was successfull. | |
1043 | * -errno : The command failed. | |
1044 | */ | |
66ad6d84 | 1045 | EXTERN int nfs_symlink(struct nfs_context *nfs, const char *oldpath, const char *newpath); |
84004dbf RS |
1046 | |
1047 | ||
1048 | /* | |
1049 | * RENAME() | |
1050 | */ | |
1051 | /* | |
1052 | * Async rename(<oldpath>, <newpath>) | |
1053 | * Function returns | |
1054 | * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked. | |
1055 | * <0 : An error occured when trying to set up the operation. The callback will not be invoked. | |
1056 | * | |
1057 | * When the callback is invoked, status indicates the result: | |
1058 | * 0 : Success. | |
1059 | * data is NULL | |
1060 | * -errno : An error occured. | |
1061 | * data is the error string. | |
1062 | */ | |
66ad6d84 | 1063 | EXTERN int nfs_rename_async(struct nfs_context *nfs, const char *oldpath, const char *newpath, nfs_cb cb, void *private_data); |
84004dbf RS |
1064 | /* |
1065 | * Sync rename(<oldpath>, <newpath>) | |
1066 | * Function returns | |
1067 | * 0 : The operation was successfull. | |
1068 | * -errno : The command failed. | |
1069 | */ | |
66ad6d84 | 1070 | EXTERN int nfs_rename(struct nfs_context *nfs, const char *oldpath, const char *newpath); |
84004dbf RS |
1071 | |
1072 | ||
1073 | ||
1074 | /* | |
1075 | * LINK() | |
1076 | */ | |
1077 | /* | |
1078 | * Async link(<oldpath>, <newpath>) | |
1079 | * Function returns | |
1080 | * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked. | |
1081 | * <0 : An error occured when trying to set up the operation. The callback will not be invoked. | |
1082 | * | |
1083 | * When the callback is invoked, status indicates the result: | |
1084 | * 0 : Success. | |
1085 | * data is NULL | |
1086 | * -errno : An error occured. | |
1087 | * data is the error string. | |
1088 | */ | |
66ad6d84 | 1089 | EXTERN int nfs_link_async(struct nfs_context *nfs, const char *oldpath, const char *newpath, nfs_cb cb, void *private_data); |
84004dbf RS |
1090 | /* |
1091 | * Sync link(<oldpath>, <newpath>) | |
1092 | * Function returns | |
1093 | * 0 : The operation was successfull. | |
1094 | * -errno : The command failed. | |
1095 | */ | |
66ad6d84 | 1096 | EXTERN int nfs_link(struct nfs_context *nfs, const char *oldpath, const char *newpath); |
84004dbf RS |
1097 | |
1098 | ||
7f0242ca RS |
1099 | /* |
1100 | * GETEXPORTS() | |
1101 | */ | |
1102 | /* | |
1103 | * Async getexports() | |
1104 | * NOTE: You must include 'libnfs-raw-mount.h' to get the definitions of the | |
1105 | * returned structures. | |
1106 | * | |
1107 | * This function will return the list of exports from an NFS server. | |
1108 | * | |
1109 | * Function returns | |
1110 | * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked. | |
1111 | * <0 : An error occured when trying to set up the operation. The callback will not be invoked. | |
1112 | * | |
1113 | * When the callback is invoked, status indicates the result: | |
1114 | * 0 : Success. | |
1115 | * data is a pointer to an exports pointer: | |
1116 | * exports export = *(exports *)data; | |
1117 | * -errno : An error occured. | |
1118 | * data is the error string. | |
1119 | */ | |
66ad6d84 | 1120 | EXTERN int mount_getexports_async(struct rpc_context *rpc, const char *server, rpc_cb cb, void *private_data); |
df5af25f RS |
1121 | /* |
1122 | * Sync getexports(<server>) | |
1123 | * Function returns | |
1124 | * NULL : something failed | |
1125 | * exports export : a linked list of exported directories | |
1126 | * | |
1127 | * returned data must be freed by calling mount_free_export_list(exportnode); | |
1128 | */ | |
66ad6d84 | 1129 | EXTERN struct exportnode *mount_getexports(const char *server); |
7f0242ca | 1130 | |
66ad6d84 | 1131 | EXTERN void mount_free_export_list(struct exportnode *exports); |
7f0242ca | 1132 | |
84004dbf RS |
1133 | |
1134 | //qqq replace later with lseek(cur, 0) | |
183451cf | 1135 | uint64_t nfs_get_current_offset(struct nfsfh *nfsfh); |
552c7665 RS |
1136 | |
1137 | ||
1138 | ||
9c4212bf RS |
1139 | |
1140 | ||
552c7665 RS |
1141 | struct nfs_server_list { |
1142 | struct nfs_server_list *next; | |
1143 | char *addr; | |
1144 | }; | |
1145 | ||
9c4212bf RS |
1146 | /* |
1147 | * Sync find_local_servers(<server>) | |
1148 | * This function will probe all local networks for NFS server. This function will | |
1149 | * block for one second while awaiting for all nfs servers to respond. | |
1150 | * | |
1151 | * Function returns | |
1152 | * NULL : something failed | |
1153 | * | |
1154 | * struct nfs_server_list : a linked list of all discovered servers | |
1155 | * | |
1156 | * returned data must be freed by nfs_free_srvr_list(srv); | |
1157 | */ | |
552c7665 RS |
1158 | struct nfs_server_list *nfs_find_local_servers(void); |
1159 | void free_nfs_srvr_list(struct nfs_server_list *srv); |