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
);
81 * When an operation failed, this function can extract a detailed error string.
83 EXTERN
char *nfs_get_error(struct nfs_context
*nfs
);
87 * Callback for all ASYNC nfs functions
89 typedef void (*nfs_cb
)(int err
, struct nfs_context
*nfs
, void *data
, void *private_data
);
92 * Callback for all ASYNC rpc functions
94 typedef void (*rpc_cb
)(struct rpc_context
*rpc
, int status
, void *data
, void *private_data
);
102 * Create an NFS c, the context.
104 * NULL : Failed to create a context.
105 * *nfs : A pointer to an nfs context.
107 EXTERN
struct nfs_context
*nfs_init_context(void);
109 * Destroy an nfs context.
111 EXTERN
void nfs_destroy_context(struct nfs_context
*nfs
);
115 * Parse a complete NFS URL including, server, path and
116 * filename. Fail if any component is missing.
118 EXTERN
struct nfs_url
*nfs_parse_url_full(struct nfs_context
*nfs
, const char *url
);
121 * Parse an NFS URL, but do not split path and file. File
122 * in the resulting struct remains NULL.
124 EXTERN
struct nfs_url
*nfs_parse_url_dir(struct nfs_context
*nfs
, const char *url
);
127 * Parse an NFS URL, but do not fail if file, path or even server is missing.
128 * Check elements of the resulting struct for NULL.
130 EXTERN
struct nfs_url
*nfs_parse_url_incomplete(struct nfs_context
*nfs
, const char *url
);
134 * Free the URL struct returned by the nfs_parse_url_* functions.
136 EXTERN
void nfs_destroy_url(struct nfs_url
*url
);
142 * Get the maximum supported READ3 size by the server
144 EXTERN
uint64_t nfs_get_readmax(struct nfs_context
*nfs
);
147 * Get the maximum supported WRITE3 size by the server
149 EXTERN
uint64_t nfs_get_writemax(struct nfs_context
*nfs
);
158 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
159 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
161 * When the callback is invoked, status indicates the result:
164 * -errno : An error occured.
165 * data is the error string.
167 EXTERN
int nfs_mount_async(struct nfs_context
*nfs
, const char *server
, const char *exportname
, nfs_cb cb
, void *private_data
);
171 * 0 : The operation was successfull.
172 * -errno : The command failed.
174 EXTERN
int nfs_mount(struct nfs_context
*nfs
, const char *server
, const char *exportname
);
183 * Async stat(<filename>)
185 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
186 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
188 * When the callback is invoked, status indicates the result:
190 * data is struct stat *
191 * -errno : An error occured.
192 * data is the error string.
195 EXTERN
int nfs_stat_async(struct nfs_context
*nfs
, const char *path
, nfs_cb cb
, void *private_data
);
197 * Sync stat(<filename>)
199 * 0 : The operation was successfull.
200 * -errno : The command failed.
202 EXTERN
int nfs_stat(struct nfs_context
*nfs
, const char *path
, struct stat
*st
);
209 * Async fstat(nfsfh *)
211 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
212 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
214 * When the callback is invoked, status indicates the result:
216 * data is struct stat *
217 * -errno : An error occured.
218 * data is the error string.
220 EXTERN
int nfs_fstat_async(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, nfs_cb cb
, void *private_data
);
222 * Sync fstat(nfsfh *)
224 * 0 : The operation was successfull.
225 * -errno : The command failed.
227 EXTERN
int nfs_fstat(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, struct stat
*st
);
235 * Async open(<filename>)
237 * mode is a combination of the flags : O_RDOLNY, O_WRONLY, O_RDWR , O_SYNC
240 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
241 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
243 * When the callback is invoked, status indicates the result:
245 * data is a struct *nfsfh;
246 * The nfsfh is close using nfs_close().
247 * -errno : An error occured.
248 * data is the error string.
250 EXTERN
int nfs_open_async(struct nfs_context
*nfs
, const char *path
, int mode
, nfs_cb cb
, void *private_data
);
252 * Sync stat(<filename>)
254 * 0 : The operation was successfull. *nfsfh is filled in.
255 * -errno : The command failed.
257 EXTERN
int nfs_open(struct nfs_context
*nfs
, const char *path
, int mode
, struct nfsfh
**nfsfh
);
269 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
270 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
272 * When the callback is invoked, status indicates the result:
275 * -errno : An error occured.
276 * data is the error string.
278 EXTERN
int nfs_close_async(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, nfs_cb cb
, void *private_data
);
282 * 0 : The operation was successfull.
283 * -errno : The command failed.
285 EXTERN
int nfs_close(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
);
295 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
296 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
298 * When the callback is invoked, status indicates the result:
300 * status is numer of bytes read.
301 * data is a pointer to the returned data.
302 * -errno : An error occured.
303 * data is the error string.
305 EXTERN
int nfs_pread_async(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, uint64_t offset
, uint64_t count
, nfs_cb cb
, void *private_data
);
309 * >=0 : numer of bytes read.
310 * -errno : An error occured.
312 EXTERN
int nfs_pread(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, uint64_t offset
, uint64_t count
, char *buf
);
323 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
324 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
326 * When the callback is invoked, status indicates the result:
328 * status is numer of bytes read.
329 * data is a pointer to the returned data.
330 * -errno : An error occured.
331 * data is the error string.
333 EXTERN
int nfs_read_async(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, uint64_t count
, nfs_cb cb
, void *private_data
);
337 * >=0 : numer of bytes read.
338 * -errno : An error occured.
340 EXTERN
int nfs_read(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, uint64_t count
, char *buf
);
352 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
353 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
355 * When the callback is invoked, status indicates the result:
357 * status is numer of bytes written.
358 * -errno : An error occured.
359 * data is the error string.
361 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
);
365 * >=0 : numer of bytes written.
366 * -errno : An error occured.
368 EXTERN
int nfs_pwrite(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, uint64_t offset
, uint64_t count
, char *buf
);
378 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
379 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
381 * When the callback is invoked, status indicates the result:
383 * status is numer of bytes written.
384 * -errno : An error occured.
385 * data is the error string.
387 EXTERN
int nfs_write_async(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, uint64_t count
, char *buf
, nfs_cb cb
, void *private_data
);
391 * >=0 : numer of bytes written.
392 * -errno : An error occured.
394 EXTERN
int nfs_write(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, uint64_t count
, char *buf
);
404 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
405 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
407 * When the callback is invoked, status indicates the result:
409 * data is uint64_t * for the current position.
410 * -errno : An error occured.
411 * data is the error string.
413 EXTERN
int nfs_lseek_async(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, uint64_t offset
, int whence
, nfs_cb cb
, void *private_data
);
417 * >=0 : numer of bytes read.
418 * -errno : An error occured.
420 EXTERN
int nfs_lseek(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, uint64_t offset
, int whence
, uint64_t *current_offset
);
430 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
431 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
433 * When the callback is invoked, status indicates the result:
435 * -errno : An error occured.
436 * data is the error string.
438 EXTERN
int nfs_fsync_async(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, nfs_cb cb
, void *private_data
);
443 * -errno : An error occured.
445 EXTERN
int nfs_fsync(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
);
456 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
457 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
459 * When the callback is invoked, status indicates the result:
461 * -errno : An error occured.
462 * data is the error string.
464 EXTERN
int nfs_truncate_async(struct nfs_context
*nfs
, const char *path
, uint64_t length
, nfs_cb cb
, void *private_data
);
469 * -errno : An error occured.
471 EXTERN
int nfs_truncate(struct nfs_context
*nfs
, const char *path
, uint64_t length
);
482 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
483 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
485 * When the callback is invoked, status indicates the result:
487 * -errno : An error occured.
488 * data is the error string.
490 EXTERN
int nfs_ftruncate_async(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, uint64_t length
, nfs_cb cb
, void *private_data
);
495 * -errno : An error occured.
497 EXTERN
int nfs_ftruncate(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, uint64_t length
);
511 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
512 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
514 * When the callback is invoked, status indicates the result:
516 * -errno : An error occured.
517 * data is the error string.
519 EXTERN
int nfs_mkdir_async(struct nfs_context
*nfs
, const char *path
, nfs_cb cb
, void *private_data
);
524 * -errno : An error occured.
526 EXTERN
int nfs_mkdir(struct nfs_context
*nfs
, const char *path
);
537 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
538 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
540 * When the callback is invoked, status indicates the result:
542 * -errno : An error occured.
543 * data is the error string.
545 EXTERN
int nfs_rmdir_async(struct nfs_context
*nfs
, const char *path
, nfs_cb cb
, void *private_data
);
550 * -errno : An error occured.
552 EXTERN
int nfs_rmdir(struct nfs_context
*nfs
, const char *path
);
564 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
565 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
567 * When the callback is invoked, status indicates the result:
569 * data is a struct *nfsfh;
570 * -errno : An error occured.
571 * data is the error string.
573 EXTERN
int nfs_creat_async(struct nfs_context
*nfs
, const char *path
, int mode
, nfs_cb cb
, void *private_data
);
578 * -errno : An error occured.
580 EXTERN
int nfs_creat(struct nfs_context
*nfs
, const char *path
, int mode
, struct nfsfh
**nfsfh
);
590 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
591 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
593 * When the callback is invoked, status indicates the result:
595 * -errno : An error occured.
596 * data is the error string.
598 EXTERN
int nfs_mknod_async(struct nfs_context
*nfs
, const char *path
, int mode
, int dev
, nfs_cb cb
, void *private_data
);
603 * -errno : An error occured.
605 EXTERN
int nfs_mknod(struct nfs_context
*nfs
, const char *path
, int mode
, int dev
);
616 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
617 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
619 * When the callback is invoked, status indicates the result:
622 * -errno : An error occured.
623 * data is the error string.
625 EXTERN
int nfs_unlink_async(struct nfs_context
*nfs
, const char *path
, nfs_cb cb
, void *private_data
);
630 * -errno : An error occured.
632 EXTERN
int nfs_unlink(struct nfs_context
*nfs
, const char *path
);
645 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
646 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
648 * When struct nfsdir * is returned, this resource is closed/freed by calling nfs_closedir()
650 * When the callback is invoked, status indicates the result:
652 * data is struct nfsdir *
653 * -errno : An error occured.
654 * data is the error string.
656 EXTERN
int nfs_opendir_async(struct nfs_context
*nfs
, const char *path
, nfs_cb cb
, void *private_data
);
661 * -errno : An error occured.
663 EXTERN
int nfs_opendir(struct nfs_context
*nfs
, const char *path
, struct nfsdir
**nfsdir
);
671 struct nfsdirent
*next
;
675 /* some extra fields we get for free through the READDIRPLUS3 call. You need libnfs-raw-nfs.h for these */
676 uint32_t type
; /* NF3REG, NF3DIR, NF3BLK, ... */
679 struct timeval atime
;
680 struct timeval mtime
;
681 struct timeval ctime
;
684 * nfs_readdir() never blocks, so no special sync/async versions are available
686 EXTERN
struct nfsdirent
*nfs_readdir(struct nfs_context
*nfs
, struct nfsdir
*nfsdir
);
694 * nfs_closedir() never blocks, so no special sync/async versions are available
696 EXTERN
void nfs_closedir(struct nfs_context
*nfs
, struct nfsdir
*nfsdir
);
704 * Async statvfs(<dirname>)
706 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
707 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
709 * When the callback is invoked, status indicates the result:
711 * data is struct statvfs *
712 * -errno : An error occured.
713 * data is the error string.
716 EXTERN
int nfs_statvfs_async(struct nfs_context
*nfs
, const char *path
, nfs_cb cb
, void *private_data
);
718 * Sync statvfs(<dirname>)
720 * 0 : The operation was successfull.
721 * -errno : The command failed.
723 EXTERN
int nfs_statvfs(struct nfs_context
*nfs
, const char *path
, struct statvfs
*svfs
);
730 * Async readlink(<name>)
732 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
733 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
735 * When the callback is invoked, status indicates the result:
738 * data is only valid during the callback and is automatically freed when the callback returns.
739 * -errno : An error occured.
740 * data is the error string.
743 EXTERN
int nfs_readlink_async(struct nfs_context
*nfs
, const char *path
, nfs_cb cb
, void *private_data
);
745 * Sync readlink(<name>)
747 * 0 : The operation was successfull.
748 * -errno : The command failed.
750 EXTERN
int nfs_readlink(struct nfs_context
*nfs
, const char *path
, char *buf
, int bufsize
);
758 * Async chmod(<name>)
760 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
761 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
763 * When the callback is invoked, status indicates the result:
766 * -errno : An error occured.
767 * data is the error string.
769 EXTERN
int nfs_chmod_async(struct nfs_context
*nfs
, const char *path
, int mode
, nfs_cb cb
, void *private_data
);
773 * 0 : The operation was successfull.
774 * -errno : The command failed.
776 EXTERN
int nfs_chmod(struct nfs_context
*nfs
, const char *path
, int mode
);
784 * Async fchmod(<handle>)
786 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
787 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
789 * When the callback is invoked, status indicates the result:
792 * -errno : An error occured.
793 * data is the error string.
795 EXTERN
int nfs_fchmod_async(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, int mode
, nfs_cb cb
, void *private_data
);
797 * Sync fchmod(<handle>)
799 * 0 : The operation was successfull.
800 * -errno : The command failed.
802 EXTERN
int nfs_fchmod(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, int mode
);
810 * Async chown(<name>)
812 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
813 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
815 * When the callback is invoked, status indicates the result:
818 * -errno : An error occured.
819 * data is the error string.
821 EXTERN
int nfs_chown_async(struct nfs_context
*nfs
, const char *path
, int uid
, int gid
, nfs_cb cb
, void *private_data
);
825 * 0 : The operation was successfull.
826 * -errno : The command failed.
828 EXTERN
int nfs_chown(struct nfs_context
*nfs
, const char *path
, int uid
, int gid
);
836 * Async fchown(<handle>)
838 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
839 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
841 * When the callback is invoked, status indicates the result:
844 * -errno : An error occured.
845 * data is the error string.
847 EXTERN
int nfs_fchown_async(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, int uid
, int gid
, nfs_cb cb
, void *private_data
);
849 * Sync fchown(<handle>)
851 * 0 : The operation was successfull.
852 * -errno : The command failed.
854 EXTERN
int nfs_fchown(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, int uid
, int gid
);
863 * Async utimes(<path>)
865 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
866 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
868 * When the callback is invoked, status indicates the result:
871 * -errno : An error occured.
872 * data is the error string.
874 EXTERN
int nfs_utimes_async(struct nfs_context
*nfs
, const char *path
, struct timeval
*times
, nfs_cb cb
, void *private_data
);
876 * Sync utimes(<path>)
878 * 0 : The operation was successfull.
879 * -errno : The command failed.
881 EXTERN
int nfs_utimes(struct nfs_context
*nfs
, const char *path
, struct timeval
*times
);
888 * Async utime(<path>)
890 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
891 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
893 * When the callback is invoked, status indicates the result:
896 * -errno : An error occured.
897 * data is the error string.
900 EXTERN
int nfs_utime_async(struct nfs_context
*nfs
, const char *path
, struct utimbuf
*times
, nfs_cb cb
, void *private_data
);
904 * 0 : The operation was successfull.
905 * -errno : The command failed.
907 EXTERN
int nfs_utime(struct nfs_context
*nfs
, const char *path
, struct utimbuf
*times
);
916 * Async access(<path>)
918 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
919 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
921 * When the callback is invoked, status indicates the result:
924 * -errno : An error occured.
925 * data is the error string.
927 EXTERN
int nfs_access_async(struct nfs_context
*nfs
, const char *path
, int mode
, nfs_cb cb
, void *private_data
);
929 * Sync access(<path>)
931 * 0 : The operation was successfull.
932 * -errno : The command failed.
934 EXTERN
int nfs_access(struct nfs_context
*nfs
, const char *path
, int mode
);
943 * Async symlink(<path>)
945 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
946 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
948 * When the callback is invoked, status indicates the result:
951 * -errno : An error occured.
952 * data is the error string.
954 EXTERN
int nfs_symlink_async(struct nfs_context
*nfs
, const char *oldpath
, const char *newpath
, nfs_cb cb
, void *private_data
);
956 * Sync symlink(<path>)
958 * 0 : The operation was successfull.
959 * -errno : The command failed.
961 EXTERN
int nfs_symlink(struct nfs_context
*nfs
, const char *oldpath
, const char *newpath
);
968 * Async rename(<oldpath>, <newpath>)
970 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
971 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
973 * When the callback is invoked, status indicates the result:
976 * -errno : An error occured.
977 * data is the error string.
979 EXTERN
int nfs_rename_async(struct nfs_context
*nfs
, const char *oldpath
, const char *newpath
, nfs_cb cb
, void *private_data
);
981 * Sync rename(<oldpath>, <newpath>)
983 * 0 : The operation was successfull.
984 * -errno : The command failed.
986 EXTERN
int nfs_rename(struct nfs_context
*nfs
, const char *oldpath
, const char *newpath
);
994 * Async link(<oldpath>, <newpath>)
996 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
997 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
999 * When the callback is invoked, status indicates the result:
1002 * -errno : An error occured.
1003 * data is the error string.
1005 EXTERN
int nfs_link_async(struct nfs_context
*nfs
, const char *oldpath
, const char *newpath
, nfs_cb cb
, void *private_data
);
1007 * Sync link(<oldpath>, <newpath>)
1009 * 0 : The operation was successfull.
1010 * -errno : The command failed.
1012 EXTERN
int nfs_link(struct nfs_context
*nfs
, const char *oldpath
, const char *newpath
);
1019 * Async getexports()
1020 * NOTE: You must include 'libnfs-raw-mount.h' to get the definitions of the
1021 * returned structures.
1023 * This function will return the list of exports from an NFS server.
1026 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
1027 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
1029 * When the callback is invoked, status indicates the result:
1031 * data is a pointer to an exports pointer:
1032 * exports export = *(exports *)data;
1033 * -errno : An error occured.
1034 * data is the error string.
1036 EXTERN
int mount_getexports_async(struct rpc_context
*rpc
, const char *server
, rpc_cb cb
, void *private_data
);
1038 * Sync getexports(<server>)
1040 * NULL : something failed
1041 * exports export : a linked list of exported directories
1043 * returned data must be freed by calling mount_free_export_list(exportnode);
1045 EXTERN
struct exportnode
*mount_getexports(const char *server
);
1047 EXTERN
void mount_free_export_list(struct exportnode
*exports
);
1050 //qqq replace later with lseek(cur, 0)
1051 uint64_t nfs_get_current_offset(struct nfsfh
*nfsfh
);
1057 struct nfs_server_list
{
1058 struct nfs_server_list
*next
;
1063 * Sync find_local_servers(<server>)
1064 * This function will probe all local networks for NFS server. This function will
1065 * block for one second while awaiting for all nfs servers to respond.
1068 * NULL : something failed
1070 * struct nfs_server_list : a linked list of all discovered servers
1072 * returned data must be freed by nfs_free_srvr_list(srv);
1074 struct nfs_server_list
*nfs_find_local_servers(void);
1075 void free_nfs_srvr_list(struct nfs_server_list
*srv
);