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 * 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.
120 * Apart from parsing the URL the functions will also update
121 * the nfs context to reflect settings controlled via url arguments.
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
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.
133 * Parse a complete NFS URL including, server, path and
134 * filename. Fail if any component is missing.
136 EXTERN
struct nfs_url
*nfs_parse_url_full(struct nfs_context
*nfs
, const char *url
);
139 * Parse an NFS URL, but do not split path and file. File
140 * in the resulting struct remains NULL.
142 EXTERN
struct nfs_url
*nfs_parse_url_dir(struct nfs_context
*nfs
, const char *url
);
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.
148 EXTERN
struct nfs_url
*nfs_parse_url_incomplete(struct nfs_context
*nfs
, const char *url
);
152 * Free the URL struct returned by the nfs_parse_url_* functions.
154 EXTERN
void nfs_destroy_url(struct nfs_url
*url
);
160 * Get the maximum supported READ3 size by the server
162 EXTERN
uint64_t nfs_get_readmax(struct nfs_context
*nfs
);
165 * Get the maximum supported WRITE3 size by the server
167 EXTERN
uint64_t nfs_get_writemax(struct nfs_context
*nfs
);
176 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
177 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
179 * When the callback is invoked, status indicates the result:
182 * -errno : An error occured.
183 * data is the error string.
185 EXTERN
int nfs_mount_async(struct nfs_context
*nfs
, const char *server
, const char *exportname
, nfs_cb cb
, void *private_data
);
189 * 0 : The operation was successfull.
190 * -errno : The command failed.
192 EXTERN
int nfs_mount(struct nfs_context
*nfs
, const char *server
, const char *exportname
);
201 * Async stat(<filename>)
203 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
204 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
206 * When the callback is invoked, status indicates the result:
208 * data is struct stat *
209 * -errno : An error occured.
210 * data is the error string.
213 EXTERN
int nfs_stat_async(struct nfs_context
*nfs
, const char *path
, nfs_cb cb
, void *private_data
);
215 * Sync stat(<filename>)
217 * 0 : The operation was successfull.
218 * -errno : The command failed.
220 EXTERN
int nfs_stat(struct nfs_context
*nfs
, const char *path
, struct stat
*st
);
227 * Async fstat(nfsfh *)
229 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
230 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
232 * When the callback is invoked, status indicates the result:
234 * data is struct stat *
235 * -errno : An error occured.
236 * data is the error string.
238 EXTERN
int nfs_fstat_async(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, nfs_cb cb
, void *private_data
);
240 * Sync fstat(nfsfh *)
242 * 0 : The operation was successfull.
243 * -errno : The command failed.
245 EXTERN
int nfs_fstat(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, struct stat
*st
);
253 * Async open(<filename>)
255 * mode is a combination of the flags : O_RDOLNY, O_WRONLY, O_RDWR , O_SYNC
258 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
259 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
261 * When the callback is invoked, status indicates the result:
263 * data is a struct *nfsfh;
264 * The nfsfh is close using nfs_close().
265 * -errno : An error occured.
266 * data is the error string.
268 EXTERN
int nfs_open_async(struct nfs_context
*nfs
, const char *path
, int mode
, nfs_cb cb
, void *private_data
);
270 * Sync stat(<filename>)
272 * 0 : The operation was successfull. *nfsfh is filled in.
273 * -errno : The command failed.
275 EXTERN
int nfs_open(struct nfs_context
*nfs
, const char *path
, int mode
, struct nfsfh
**nfsfh
);
287 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
288 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
290 * When the callback is invoked, status indicates the result:
293 * -errno : An error occured.
294 * data is the error string.
296 EXTERN
int nfs_close_async(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, nfs_cb cb
, void *private_data
);
300 * 0 : The operation was successfull.
301 * -errno : The command failed.
303 EXTERN
int nfs_close(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
);
313 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
314 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
316 * When the callback is invoked, status indicates the result:
318 * status is numer of bytes read.
319 * data is a pointer to the returned data.
320 * -errno : An error occured.
321 * data is the error string.
323 EXTERN
int nfs_pread_async(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, uint64_t offset
, uint64_t count
, nfs_cb cb
, void *private_data
);
327 * >=0 : numer of bytes read.
328 * -errno : An error occured.
330 EXTERN
int nfs_pread(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, uint64_t offset
, uint64_t count
, char *buf
);
341 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
342 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
344 * When the callback is invoked, status indicates the result:
346 * status is numer of bytes read.
347 * data is a pointer to the returned data.
348 * -errno : An error occured.
349 * data is the error string.
351 EXTERN
int nfs_read_async(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, uint64_t count
, nfs_cb cb
, void *private_data
);
355 * >=0 : numer of bytes read.
356 * -errno : An error occured.
358 EXTERN
int nfs_read(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, uint64_t count
, char *buf
);
370 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
371 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
373 * When the callback is invoked, status indicates the result:
375 * status is numer of bytes written.
376 * -errno : An error occured.
377 * data is the error string.
379 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
);
383 * >=0 : numer of bytes written.
384 * -errno : An error occured.
386 EXTERN
int nfs_pwrite(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, uint64_t offset
, uint64_t count
, char *buf
);
396 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
397 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
399 * When the callback is invoked, status indicates the result:
401 * status is numer of bytes written.
402 * -errno : An error occured.
403 * data is the error string.
405 EXTERN
int nfs_write_async(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, uint64_t count
, char *buf
, nfs_cb cb
, void *private_data
);
409 * >=0 : numer of bytes written.
410 * -errno : An error occured.
412 EXTERN
int nfs_write(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, uint64_t count
, char *buf
);
422 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
423 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
425 * When the callback is invoked, status indicates the result:
427 * data is uint64_t * for the current position.
428 * -errno : An error occured.
429 * data is the error string.
431 EXTERN
int nfs_lseek_async(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, uint64_t offset
, int whence
, nfs_cb cb
, void *private_data
);
435 * >=0 : numer of bytes read.
436 * -errno : An error occured.
438 EXTERN
int nfs_lseek(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, uint64_t offset
, int whence
, uint64_t *current_offset
);
448 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
449 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
451 * When the callback is invoked, status indicates the result:
453 * -errno : An error occured.
454 * data is the error string.
456 EXTERN
int nfs_fsync_async(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, nfs_cb cb
, void *private_data
);
461 * -errno : An error occured.
463 EXTERN
int nfs_fsync(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
);
474 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
475 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
477 * When the callback is invoked, status indicates the result:
479 * -errno : An error occured.
480 * data is the error string.
482 EXTERN
int nfs_truncate_async(struct nfs_context
*nfs
, const char *path
, uint64_t length
, nfs_cb cb
, void *private_data
);
487 * -errno : An error occured.
489 EXTERN
int nfs_truncate(struct nfs_context
*nfs
, const char *path
, uint64_t length
);
500 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
501 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
503 * When the callback is invoked, status indicates the result:
505 * -errno : An error occured.
506 * data is the error string.
508 EXTERN
int nfs_ftruncate_async(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, uint64_t length
, nfs_cb cb
, void *private_data
);
513 * -errno : An error occured.
515 EXTERN
int nfs_ftruncate(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, uint64_t length
);
529 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
530 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
532 * When the callback is invoked, status indicates the result:
534 * -errno : An error occured.
535 * data is the error string.
537 EXTERN
int nfs_mkdir_async(struct nfs_context
*nfs
, const char *path
, nfs_cb cb
, void *private_data
);
542 * -errno : An error occured.
544 EXTERN
int nfs_mkdir(struct nfs_context
*nfs
, const char *path
);
555 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
556 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
558 * When the callback is invoked, status indicates the result:
560 * -errno : An error occured.
561 * data is the error string.
563 EXTERN
int nfs_rmdir_async(struct nfs_context
*nfs
, const char *path
, nfs_cb cb
, void *private_data
);
568 * -errno : An error occured.
570 EXTERN
int nfs_rmdir(struct nfs_context
*nfs
, const char *path
);
582 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
583 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
585 * When the callback is invoked, status indicates the result:
587 * data is a struct *nfsfh;
588 * -errno : An error occured.
589 * data is the error string.
591 EXTERN
int nfs_creat_async(struct nfs_context
*nfs
, const char *path
, int mode
, nfs_cb cb
, void *private_data
);
596 * -errno : An error occured.
598 EXTERN
int nfs_creat(struct nfs_context
*nfs
, const char *path
, int mode
, struct nfsfh
**nfsfh
);
608 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
609 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
611 * When the callback is invoked, status indicates the result:
613 * -errno : An error occured.
614 * data is the error string.
616 EXTERN
int nfs_mknod_async(struct nfs_context
*nfs
, const char *path
, int mode
, int dev
, nfs_cb cb
, void *private_data
);
621 * -errno : An error occured.
623 EXTERN
int nfs_mknod(struct nfs_context
*nfs
, const char *path
, int mode
, int dev
);
634 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
635 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
637 * When the callback is invoked, status indicates the result:
640 * -errno : An error occured.
641 * data is the error string.
643 EXTERN
int nfs_unlink_async(struct nfs_context
*nfs
, const char *path
, nfs_cb cb
, void *private_data
);
648 * -errno : An error occured.
650 EXTERN
int nfs_unlink(struct nfs_context
*nfs
, const char *path
);
663 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
664 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
666 * When struct nfsdir * is returned, this resource is closed/freed by calling nfs_closedir()
668 * When the callback is invoked, status indicates the result:
670 * data is struct nfsdir *
671 * -errno : An error occured.
672 * data is the error string.
674 EXTERN
int nfs_opendir_async(struct nfs_context
*nfs
, const char *path
, nfs_cb cb
, void *private_data
);
679 * -errno : An error occured.
681 EXTERN
int nfs_opendir(struct nfs_context
*nfs
, const char *path
, struct nfsdir
**nfsdir
);
689 struct nfsdirent
*next
;
693 /* Some extra fields we get for free through the READDIRPLUS3 call.
694 You need libnfs-raw-nfs.h for type/mode constants */
695 uint32_t type
; /* NF3REG, NF3DIR, NF3BLK, ... */
698 struct timeval atime
;
699 struct timeval mtime
;
700 struct timeval ctime
;
705 * nfs_readdir() never blocks, so no special sync/async versions are available
707 EXTERN
struct nfsdirent
*nfs_readdir(struct nfs_context
*nfs
, struct nfsdir
*nfsdir
);
715 * nfs_closedir() never blocks, so no special sync/async versions are available
717 EXTERN
void nfs_closedir(struct nfs_context
*nfs
, struct nfsdir
*nfsdir
);
725 * Async statvfs(<dirname>)
727 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
728 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
730 * When the callback is invoked, status indicates the result:
732 * data is struct statvfs *
733 * -errno : An error occured.
734 * data is the error string.
737 EXTERN
int nfs_statvfs_async(struct nfs_context
*nfs
, const char *path
, nfs_cb cb
, void *private_data
);
739 * Sync statvfs(<dirname>)
741 * 0 : The operation was successfull.
742 * -errno : The command failed.
744 EXTERN
int nfs_statvfs(struct nfs_context
*nfs
, const char *path
, struct statvfs
*svfs
);
751 * Async readlink(<name>)
753 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
754 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
756 * When the callback is invoked, status indicates the result:
759 * data is only valid during the callback and is automatically freed when the callback returns.
760 * -errno : An error occured.
761 * data is the error string.
764 EXTERN
int nfs_readlink_async(struct nfs_context
*nfs
, const char *path
, nfs_cb cb
, void *private_data
);
766 * Sync readlink(<name>)
768 * 0 : The operation was successfull.
769 * -errno : The command failed.
771 EXTERN
int nfs_readlink(struct nfs_context
*nfs
, const char *path
, char *buf
, int bufsize
);
779 * Async chmod(<name>)
781 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
782 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
784 * When the callback is invoked, status indicates the result:
787 * -errno : An error occured.
788 * data is the error string.
790 EXTERN
int nfs_chmod_async(struct nfs_context
*nfs
, const char *path
, int mode
, nfs_cb cb
, void *private_data
);
794 * 0 : The operation was successfull.
795 * -errno : The command failed.
797 EXTERN
int nfs_chmod(struct nfs_context
*nfs
, const char *path
, int mode
);
805 * Async fchmod(<handle>)
807 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
808 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
810 * When the callback is invoked, status indicates the result:
813 * -errno : An error occured.
814 * data is the error string.
816 EXTERN
int nfs_fchmod_async(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, int mode
, nfs_cb cb
, void *private_data
);
818 * Sync fchmod(<handle>)
820 * 0 : The operation was successfull.
821 * -errno : The command failed.
823 EXTERN
int nfs_fchmod(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, int mode
);
831 * Async chown(<name>)
833 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
834 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
836 * When the callback is invoked, status indicates the result:
839 * -errno : An error occured.
840 * data is the error string.
842 EXTERN
int nfs_chown_async(struct nfs_context
*nfs
, const char *path
, int uid
, int gid
, nfs_cb cb
, void *private_data
);
846 * 0 : The operation was successfull.
847 * -errno : The command failed.
849 EXTERN
int nfs_chown(struct nfs_context
*nfs
, const char *path
, int uid
, int gid
);
857 * Async fchown(<handle>)
859 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
860 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
862 * When the callback is invoked, status indicates the result:
865 * -errno : An error occured.
866 * data is the error string.
868 EXTERN
int nfs_fchown_async(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, int uid
, int gid
, nfs_cb cb
, void *private_data
);
870 * Sync fchown(<handle>)
872 * 0 : The operation was successfull.
873 * -errno : The command failed.
875 EXTERN
int nfs_fchown(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, int uid
, int gid
);
884 * Async utimes(<path>)
886 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
887 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
889 * When the callback is invoked, status indicates the result:
892 * -errno : An error occured.
893 * data is the error string.
895 EXTERN
int nfs_utimes_async(struct nfs_context
*nfs
, const char *path
, struct timeval
*times
, nfs_cb cb
, void *private_data
);
897 * Sync utimes(<path>)
899 * 0 : The operation was successfull.
900 * -errno : The command failed.
902 EXTERN
int nfs_utimes(struct nfs_context
*nfs
, const char *path
, struct timeval
*times
);
909 * Async utime(<path>)
911 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
912 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
914 * When the callback is invoked, status indicates the result:
917 * -errno : An error occured.
918 * data is the error string.
921 EXTERN
int nfs_utime_async(struct nfs_context
*nfs
, const char *path
, struct utimbuf
*times
, nfs_cb cb
, void *private_data
);
925 * 0 : The operation was successfull.
926 * -errno : The command failed.
928 EXTERN
int nfs_utime(struct nfs_context
*nfs
, const char *path
, struct utimbuf
*times
);
937 * Async access(<path>)
939 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
940 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
942 * When the callback is invoked, status indicates the result:
945 * -errno : An error occured.
946 * data is the error string.
948 EXTERN
int nfs_access_async(struct nfs_context
*nfs
, const char *path
, int mode
, nfs_cb cb
, void *private_data
);
950 * Sync access(<path>)
952 * 0 : The operation was successfull.
953 * -errno : The command failed.
955 EXTERN
int nfs_access(struct nfs_context
*nfs
, const char *path
, int mode
);
964 * Async symlink(<path>)
966 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
967 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
969 * When the callback is invoked, status indicates the result:
972 * -errno : An error occured.
973 * data is the error string.
975 EXTERN
int nfs_symlink_async(struct nfs_context
*nfs
, const char *oldpath
, const char *newpath
, nfs_cb cb
, void *private_data
);
977 * Sync symlink(<path>)
979 * 0 : The operation was successfull.
980 * -errno : The command failed.
982 EXTERN
int nfs_symlink(struct nfs_context
*nfs
, const char *oldpath
, const char *newpath
);
989 * Async rename(<oldpath>, <newpath>)
991 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
992 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
994 * When the callback is invoked, status indicates the result:
997 * -errno : An error occured.
998 * data is the error string.
1000 EXTERN
int nfs_rename_async(struct nfs_context
*nfs
, const char *oldpath
, const char *newpath
, nfs_cb cb
, void *private_data
);
1002 * Sync rename(<oldpath>, <newpath>)
1004 * 0 : The operation was successfull.
1005 * -errno : The command failed.
1007 EXTERN
int nfs_rename(struct nfs_context
*nfs
, const char *oldpath
, const char *newpath
);
1015 * Async link(<oldpath>, <newpath>)
1017 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
1018 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
1020 * When the callback is invoked, status indicates the result:
1023 * -errno : An error occured.
1024 * data is the error string.
1026 EXTERN
int nfs_link_async(struct nfs_context
*nfs
, const char *oldpath
, const char *newpath
, nfs_cb cb
, void *private_data
);
1028 * Sync link(<oldpath>, <newpath>)
1030 * 0 : The operation was successfull.
1031 * -errno : The command failed.
1033 EXTERN
int nfs_link(struct nfs_context
*nfs
, const char *oldpath
, const char *newpath
);
1040 * Async getexports()
1041 * NOTE: You must include 'libnfs-raw-mount.h' to get the definitions of the
1042 * returned structures.
1044 * This function will return the list of exports from an NFS server.
1047 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
1048 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
1050 * When the callback is invoked, status indicates the result:
1052 * data is a pointer to an exports pointer:
1053 * exports export = *(exports *)data;
1054 * -errno : An error occured.
1055 * data is the error string.
1057 EXTERN
int mount_getexports_async(struct rpc_context
*rpc
, const char *server
, rpc_cb cb
, void *private_data
);
1059 * Sync getexports(<server>)
1061 * NULL : something failed
1062 * exports export : a linked list of exported directories
1064 * returned data must be freed by calling mount_free_export_list(exportnode);
1066 EXTERN
struct exportnode
*mount_getexports(const char *server
);
1068 EXTERN
void mount_free_export_list(struct exportnode
*exports
);
1071 //qqq replace later with lseek(cur, 0)
1072 uint64_t nfs_get_current_offset(struct nfsfh
*nfsfh
);
1078 struct nfs_server_list
{
1079 struct nfs_server_list
*next
;
1084 * Sync find_local_servers(<server>)
1085 * This function will probe all local networks for NFS server. This function will
1086 * block for one second while awaiting for all nfs servers to respond.
1089 * NULL : something failed
1091 * struct nfs_server_list : a linked list of all discovered servers
1093 * returned data must be freed by nfs_free_srvr_list(srv);
1095 struct nfs_server_list
*nfs_find_local_servers(void);
1096 void free_nfs_srvr_list(struct nfs_server_list
*srv
);