2 Copyright (C) 2010 by Ronnie Sahlberg <ronniesahlberg@gmail.com>
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.
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.
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/>.
18 * This is the highlevel interface to access NFS resources using a posix-like interface
38 #define EXTERN __declspec( dllexport )
67 * Used for interfacing the async version of the api into an external eventsystem
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
);
72 EXTERN
int nfs_queue_length(struct nfs_context
*nfs
);
75 * Used if you need different credentials than the default for the current user.
78 EXTERN
void nfs_set_auth(struct nfs_context
*nfs
, struct AUTH
*auth
);
82 * When an operation failed, this function can extract a detailed error string.
84 EXTERN
char *nfs_get_error(struct nfs_context
*nfs
);
88 * Callback for all ASYNC nfs functions
90 typedef void (*nfs_cb
)(int err
, struct nfs_context
*nfs
, void *data
, void *private_data
);
93 * Callback for all ASYNC rpc functions
95 typedef void (*rpc_cb
)(struct rpc_context
*rpc
, int status
, void *data
, void *private_data
);
103 * Create an NFS c, the context.
105 * NULL : Failed to create a context.
106 * *nfs : A pointer to an nfs context.
108 EXTERN
struct nfs_context
*nfs_init_context(void);
110 * Destroy an nfs context.
112 EXTERN
void nfs_destroy_context(struct nfs_context
*nfs
);
116 * Parse a complete NFS URL including, server, path and
117 * filename. Fail if any component is missing.
119 EXTERN
struct nfs_url
*nfs_parse_url_full(struct nfs_context
*nfs
, const char *url
);
122 * Parse an NFS URL, but do not split path and file. File
123 * in the resulting struct remains NULL.
125 EXTERN
struct nfs_url
*nfs_parse_url_dir(struct nfs_context
*nfs
, const char *url
);
128 * Parse an NFS URL, but do not fail if file, path or even server is missing.
129 * Check elements of the resulting struct for NULL.
131 EXTERN
struct nfs_url
*nfs_parse_url_incomplete(struct nfs_context
*nfs
, const char *url
);
135 * Free the URL struct returned by the nfs_parse_url_* functions.
137 EXTERN
void nfs_destroy_url(struct nfs_url
*url
);
143 * Get the maximum supported READ3 size by the server
145 EXTERN
uint64_t nfs_get_readmax(struct nfs_context
*nfs
);
148 * Get the maximum supported WRITE3 size by the server
150 EXTERN
uint64_t nfs_get_writemax(struct nfs_context
*nfs
);
159 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
160 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
162 * When the callback is invoked, status indicates the result:
165 * -errno : An error occured.
166 * data is the error string.
168 EXTERN
int nfs_mount_async(struct nfs_context
*nfs
, const char *server
, const char *exportname
, nfs_cb cb
, void *private_data
);
172 * 0 : The operation was successfull.
173 * -errno : The command failed.
175 EXTERN
int nfs_mount(struct nfs_context
*nfs
, const char *server
, const char *exportname
);
184 * Async stat(<filename>)
186 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
187 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
189 * When the callback is invoked, status indicates the result:
191 * data is struct stat *
192 * -errno : An error occured.
193 * data is the error string.
196 EXTERN
int nfs_stat_async(struct nfs_context
*nfs
, const char *path
, nfs_cb cb
, void *private_data
);
198 * Sync stat(<filename>)
200 * 0 : The operation was successfull.
201 * -errno : The command failed.
203 EXTERN
int nfs_stat(struct nfs_context
*nfs
, const char *path
, struct stat
*st
);
210 * Async fstat(nfsfh *)
212 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
213 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
215 * When the callback is invoked, status indicates the result:
217 * data is struct stat *
218 * -errno : An error occured.
219 * data is the error string.
221 EXTERN
int nfs_fstat_async(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, nfs_cb cb
, void *private_data
);
223 * Sync fstat(nfsfh *)
225 * 0 : The operation was successfull.
226 * -errno : The command failed.
228 EXTERN
int nfs_fstat(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, struct stat
*st
);
236 * Async open(<filename>)
238 * mode is a combination of the flags : O_RDOLNY, O_WRONLY, O_RDWR , O_SYNC
241 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
242 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
244 * When the callback is invoked, status indicates the result:
246 * data is a struct *nfsfh;
247 * The nfsfh is close using nfs_close().
248 * -errno : An error occured.
249 * data is the error string.
251 EXTERN
int nfs_open_async(struct nfs_context
*nfs
, const char *path
, int mode
, nfs_cb cb
, void *private_data
);
253 * Sync stat(<filename>)
255 * 0 : The operation was successfull. *nfsfh is filled in.
256 * -errno : The command failed.
258 EXTERN
int nfs_open(struct nfs_context
*nfs
, const char *path
, int mode
, struct nfsfh
**nfsfh
);
270 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
271 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
273 * When the callback is invoked, status indicates the result:
276 * -errno : An error occured.
277 * data is the error string.
279 EXTERN
int nfs_close_async(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, nfs_cb cb
, void *private_data
);
283 * 0 : The operation was successfull.
284 * -errno : The command failed.
286 EXTERN
int nfs_close(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
);
296 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
297 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
299 * When the callback is invoked, status indicates the result:
301 * status is numer of bytes read.
302 * data is a pointer to the returned data.
303 * -errno : An error occured.
304 * data is the error string.
306 EXTERN
int nfs_pread_async(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, uint64_t offset
, uint64_t count
, nfs_cb cb
, void *private_data
);
310 * >=0 : numer of bytes read.
311 * -errno : An error occured.
313 EXTERN
int nfs_pread(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, uint64_t offset
, uint64_t count
, char *buf
);
324 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
325 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
327 * When the callback is invoked, status indicates the result:
329 * status is numer of bytes read.
330 * data is a pointer to the returned data.
331 * -errno : An error occured.
332 * data is the error string.
334 EXTERN
int nfs_read_async(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, uint64_t count
, nfs_cb cb
, void *private_data
);
338 * >=0 : numer of bytes read.
339 * -errno : An error occured.
341 EXTERN
int nfs_read(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, uint64_t count
, char *buf
);
353 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
354 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
356 * When the callback is invoked, status indicates the result:
358 * status is numer of bytes written.
359 * -errno : An error occured.
360 * data is the error string.
362 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
);
366 * >=0 : numer of bytes written.
367 * -errno : An error occured.
369 EXTERN
int nfs_pwrite(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, uint64_t offset
, uint64_t count
, char *buf
);
379 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
380 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
382 * When the callback is invoked, status indicates the result:
384 * status is numer of bytes written.
385 * -errno : An error occured.
386 * data is the error string.
388 EXTERN
int nfs_write_async(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, uint64_t count
, char *buf
, nfs_cb cb
, void *private_data
);
392 * >=0 : numer of bytes written.
393 * -errno : An error occured.
395 EXTERN
int nfs_write(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, uint64_t count
, char *buf
);
405 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
406 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
408 * When the callback is invoked, status indicates the result:
410 * data is uint64_t * for the current position.
411 * -errno : An error occured.
412 * data is the error string.
414 EXTERN
int nfs_lseek_async(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, uint64_t offset
, int whence
, nfs_cb cb
, void *private_data
);
418 * >=0 : numer of bytes read.
419 * -errno : An error occured.
421 EXTERN
int nfs_lseek(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, uint64_t offset
, int whence
, uint64_t *current_offset
);
431 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
432 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
434 * When the callback is invoked, status indicates the result:
436 * -errno : An error occured.
437 * data is the error string.
439 EXTERN
int nfs_fsync_async(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, nfs_cb cb
, void *private_data
);
444 * -errno : An error occured.
446 EXTERN
int nfs_fsync(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
);
457 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
458 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
460 * When the callback is invoked, status indicates the result:
462 * -errno : An error occured.
463 * data is the error string.
465 EXTERN
int nfs_truncate_async(struct nfs_context
*nfs
, const char *path
, uint64_t length
, nfs_cb cb
, void *private_data
);
470 * -errno : An error occured.
472 EXTERN
int nfs_truncate(struct nfs_context
*nfs
, const char *path
, uint64_t length
);
483 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
484 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
486 * When the callback is invoked, status indicates the result:
488 * -errno : An error occured.
489 * data is the error string.
491 EXTERN
int nfs_ftruncate_async(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, uint64_t length
, nfs_cb cb
, void *private_data
);
496 * -errno : An error occured.
498 EXTERN
int nfs_ftruncate(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, uint64_t length
);
512 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
513 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
515 * When the callback is invoked, status indicates the result:
517 * -errno : An error occured.
518 * data is the error string.
520 EXTERN
int nfs_mkdir_async(struct nfs_context
*nfs
, const char *path
, nfs_cb cb
, void *private_data
);
525 * -errno : An error occured.
527 EXTERN
int nfs_mkdir(struct nfs_context
*nfs
, const char *path
);
538 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
539 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
541 * When the callback is invoked, status indicates the result:
543 * -errno : An error occured.
544 * data is the error string.
546 EXTERN
int nfs_rmdir_async(struct nfs_context
*nfs
, const char *path
, nfs_cb cb
, void *private_data
);
551 * -errno : An error occured.
553 EXTERN
int nfs_rmdir(struct nfs_context
*nfs
, const char *path
);
565 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
566 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
568 * When the callback is invoked, status indicates the result:
570 * data is a struct *nfsfh;
571 * -errno : An error occured.
572 * data is the error string.
574 EXTERN
int nfs_creat_async(struct nfs_context
*nfs
, const char *path
, int mode
, nfs_cb cb
, void *private_data
);
579 * -errno : An error occured.
581 EXTERN
int nfs_creat(struct nfs_context
*nfs
, const char *path
, int mode
, struct nfsfh
**nfsfh
);
591 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
592 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
594 * When the callback is invoked, status indicates the result:
596 * -errno : An error occured.
597 * data is the error string.
599 EXTERN
int nfs_mknod_async(struct nfs_context
*nfs
, const char *path
, int mode
, int dev
, nfs_cb cb
, void *private_data
);
604 * -errno : An error occured.
606 EXTERN
int nfs_mknod(struct nfs_context
*nfs
, const char *path
, int mode
, int dev
);
617 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
618 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
620 * When the callback is invoked, status indicates the result:
623 * -errno : An error occured.
624 * data is the error string.
626 EXTERN
int nfs_unlink_async(struct nfs_context
*nfs
, const char *path
, nfs_cb cb
, void *private_data
);
631 * -errno : An error occured.
633 EXTERN
int nfs_unlink(struct nfs_context
*nfs
, const char *path
);
646 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
647 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
649 * When struct nfsdir * is returned, this resource is closed/freed by calling nfs_closedir()
651 * When the callback is invoked, status indicates the result:
653 * data is struct nfsdir *
654 * -errno : An error occured.
655 * data is the error string.
657 EXTERN
int nfs_opendir_async(struct nfs_context
*nfs
, const char *path
, nfs_cb cb
, void *private_data
);
662 * -errno : An error occured.
664 EXTERN
int nfs_opendir(struct nfs_context
*nfs
, const char *path
, struct nfsdir
**nfsdir
);
672 struct nfsdirent
*next
;
676 /* some extra fields we get for free through the READDIRPLUS3 call. You need libnfs-raw-nfs.h for these */
677 uint32_t type
; /* NF3REG, NF3DIR, NF3BLK, ... */
680 struct timeval atime
;
681 struct timeval mtime
;
682 struct timeval ctime
;
685 * nfs_readdir() never blocks, so no special sync/async versions are available
687 EXTERN
struct nfsdirent
*nfs_readdir(struct nfs_context
*nfs
, struct nfsdir
*nfsdir
);
695 * nfs_closedir() never blocks, so no special sync/async versions are available
697 EXTERN
void nfs_closedir(struct nfs_context
*nfs
, struct nfsdir
*nfsdir
);
705 * Async statvfs(<dirname>)
707 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
708 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
710 * When the callback is invoked, status indicates the result:
712 * data is struct statvfs *
713 * -errno : An error occured.
714 * data is the error string.
717 EXTERN
int nfs_statvfs_async(struct nfs_context
*nfs
, const char *path
, nfs_cb cb
, void *private_data
);
719 * Sync statvfs(<dirname>)
721 * 0 : The operation was successfull.
722 * -errno : The command failed.
724 EXTERN
int nfs_statvfs(struct nfs_context
*nfs
, const char *path
, struct statvfs
*svfs
);
731 * Async readlink(<name>)
733 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
734 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
736 * When the callback is invoked, status indicates the result:
739 * data is only valid during the callback and is automatically freed when the callback returns.
740 * -errno : An error occured.
741 * data is the error string.
744 EXTERN
int nfs_readlink_async(struct nfs_context
*nfs
, const char *path
, nfs_cb cb
, void *private_data
);
746 * Sync readlink(<name>)
748 * 0 : The operation was successfull.
749 * -errno : The command failed.
751 EXTERN
int nfs_readlink(struct nfs_context
*nfs
, const char *path
, char *buf
, int bufsize
);
759 * Async chmod(<name>)
761 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
762 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
764 * When the callback is invoked, status indicates the result:
767 * -errno : An error occured.
768 * data is the error string.
770 EXTERN
int nfs_chmod_async(struct nfs_context
*nfs
, const char *path
, int mode
, nfs_cb cb
, void *private_data
);
774 * 0 : The operation was successfull.
775 * -errno : The command failed.
777 EXTERN
int nfs_chmod(struct nfs_context
*nfs
, const char *path
, int mode
);
785 * Async fchmod(<handle>)
787 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
788 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
790 * When the callback is invoked, status indicates the result:
793 * -errno : An error occured.
794 * data is the error string.
796 EXTERN
int nfs_fchmod_async(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, int mode
, nfs_cb cb
, void *private_data
);
798 * Sync fchmod(<handle>)
800 * 0 : The operation was successfull.
801 * -errno : The command failed.
803 EXTERN
int nfs_fchmod(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, int mode
);
811 * Async chown(<name>)
813 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
814 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
816 * When the callback is invoked, status indicates the result:
819 * -errno : An error occured.
820 * data is the error string.
822 EXTERN
int nfs_chown_async(struct nfs_context
*nfs
, const char *path
, int uid
, int gid
, nfs_cb cb
, void *private_data
);
826 * 0 : The operation was successfull.
827 * -errno : The command failed.
829 EXTERN
int nfs_chown(struct nfs_context
*nfs
, const char *path
, int uid
, int gid
);
837 * Async fchown(<handle>)
839 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
840 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
842 * When the callback is invoked, status indicates the result:
845 * -errno : An error occured.
846 * data is the error string.
848 EXTERN
int nfs_fchown_async(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, int uid
, int gid
, nfs_cb cb
, void *private_data
);
850 * Sync fchown(<handle>)
852 * 0 : The operation was successfull.
853 * -errno : The command failed.
855 EXTERN
int nfs_fchown(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, int uid
, int gid
);
864 * Async utimes(<path>)
866 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
867 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
869 * When the callback is invoked, status indicates the result:
872 * -errno : An error occured.
873 * data is the error string.
875 EXTERN
int nfs_utimes_async(struct nfs_context
*nfs
, const char *path
, struct timeval
*times
, nfs_cb cb
, void *private_data
);
877 * Sync utimes(<path>)
879 * 0 : The operation was successfull.
880 * -errno : The command failed.
882 EXTERN
int nfs_utimes(struct nfs_context
*nfs
, const char *path
, struct timeval
*times
);
889 * Async utime(<path>)
891 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
892 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
894 * When the callback is invoked, status indicates the result:
897 * -errno : An error occured.
898 * data is the error string.
901 EXTERN
int nfs_utime_async(struct nfs_context
*nfs
, const char *path
, struct utimbuf
*times
, nfs_cb cb
, void *private_data
);
905 * 0 : The operation was successfull.
906 * -errno : The command failed.
908 EXTERN
int nfs_utime(struct nfs_context
*nfs
, const char *path
, struct utimbuf
*times
);
917 * Async access(<path>)
919 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
920 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
922 * When the callback is invoked, status indicates the result:
925 * -errno : An error occured.
926 * data is the error string.
928 EXTERN
int nfs_access_async(struct nfs_context
*nfs
, const char *path
, int mode
, nfs_cb cb
, void *private_data
);
930 * Sync access(<path>)
932 * 0 : The operation was successfull.
933 * -errno : The command failed.
935 EXTERN
int nfs_access(struct nfs_context
*nfs
, const char *path
, int mode
);
944 * Async symlink(<path>)
946 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
947 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
949 * When the callback is invoked, status indicates the result:
952 * -errno : An error occured.
953 * data is the error string.
955 EXTERN
int nfs_symlink_async(struct nfs_context
*nfs
, const char *oldpath
, const char *newpath
, nfs_cb cb
, void *private_data
);
957 * Sync symlink(<path>)
959 * 0 : The operation was successfull.
960 * -errno : The command failed.
962 EXTERN
int nfs_symlink(struct nfs_context
*nfs
, const char *oldpath
, const char *newpath
);
969 * Async rename(<oldpath>, <newpath>)
971 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
972 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
974 * When the callback is invoked, status indicates the result:
977 * -errno : An error occured.
978 * data is the error string.
980 EXTERN
int nfs_rename_async(struct nfs_context
*nfs
, const char *oldpath
, const char *newpath
, nfs_cb cb
, void *private_data
);
982 * Sync rename(<oldpath>, <newpath>)
984 * 0 : The operation was successfull.
985 * -errno : The command failed.
987 EXTERN
int nfs_rename(struct nfs_context
*nfs
, const char *oldpath
, const char *newpath
);
995 * Async link(<oldpath>, <newpath>)
997 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
998 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
1000 * When the callback is invoked, status indicates the result:
1003 * -errno : An error occured.
1004 * data is the error string.
1006 EXTERN
int nfs_link_async(struct nfs_context
*nfs
, const char *oldpath
, const char *newpath
, nfs_cb cb
, void *private_data
);
1008 * Sync link(<oldpath>, <newpath>)
1010 * 0 : The operation was successfull.
1011 * -errno : The command failed.
1013 EXTERN
int nfs_link(struct nfs_context
*nfs
, const char *oldpath
, const char *newpath
);
1020 * Async getexports()
1021 * NOTE: You must include 'libnfs-raw-mount.h' to get the definitions of the
1022 * returned structures.
1024 * This function will return the list of exports from an NFS server.
1027 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
1028 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
1030 * When the callback is invoked, status indicates the result:
1032 * data is a pointer to an exports pointer:
1033 * exports export = *(exports *)data;
1034 * -errno : An error occured.
1035 * data is the error string.
1037 EXTERN
int mount_getexports_async(struct rpc_context
*rpc
, const char *server
, rpc_cb cb
, void *private_data
);
1039 * Sync getexports(<server>)
1041 * NULL : something failed
1042 * exports export : a linked list of exported directories
1044 * returned data must be freed by calling mount_free_export_list(exportnode);
1046 EXTERN
struct exportnode
*mount_getexports(const char *server
);
1048 EXTERN
void mount_free_export_list(struct exportnode
*exports
);
1051 //qqq replace later with lseek(cur, 0)
1052 uint64_t nfs_get_current_offset(struct nfsfh
*nfsfh
);
1058 struct nfs_server_list
{
1059 struct nfs_server_list
*next
;
1064 * Sync find_local_servers(<server>)
1065 * This function will probe all local networks for NFS server. This function will
1066 * block for one second while awaiting for all nfs servers to respond.
1069 * NULL : something failed
1071 * struct nfs_server_list : a linked list of all discovered servers
1073 * returned data must be freed by nfs_free_srvr_list(srv);
1075 struct nfs_server_list
*nfs_find_local_servers(void);
1076 void free_nfs_srvr_list(struct nfs_server_list
*srv
);