3ca48e4439e6cdcc0402ae25d00bdda5b33500e7
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. You need libnfs-raw-nfs.h for these */
694 uint32_t type
; /* NF3REG, NF3DIR, NF3BLK, ... */
697 struct timeval atime
;
698 struct timeval mtime
;
699 struct timeval ctime
;
702 * nfs_readdir() never blocks, so no special sync/async versions are available
704 EXTERN
struct nfsdirent
*nfs_readdir(struct nfs_context
*nfs
, struct nfsdir
*nfsdir
);
712 * nfs_closedir() never blocks, so no special sync/async versions are available
714 EXTERN
void nfs_closedir(struct nfs_context
*nfs
, struct nfsdir
*nfsdir
);
722 * Async statvfs(<dirname>)
724 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
725 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
727 * When the callback is invoked, status indicates the result:
729 * data is struct statvfs *
730 * -errno : An error occured.
731 * data is the error string.
734 EXTERN
int nfs_statvfs_async(struct nfs_context
*nfs
, const char *path
, nfs_cb cb
, void *private_data
);
736 * Sync statvfs(<dirname>)
738 * 0 : The operation was successfull.
739 * -errno : The command failed.
741 EXTERN
int nfs_statvfs(struct nfs_context
*nfs
, const char *path
, struct statvfs
*svfs
);
748 * Async readlink(<name>)
750 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
751 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
753 * When the callback is invoked, status indicates the result:
756 * data is only valid during the callback and is automatically freed when the callback returns.
757 * -errno : An error occured.
758 * data is the error string.
761 EXTERN
int nfs_readlink_async(struct nfs_context
*nfs
, const char *path
, nfs_cb cb
, void *private_data
);
763 * Sync readlink(<name>)
765 * 0 : The operation was successfull.
766 * -errno : The command failed.
768 EXTERN
int nfs_readlink(struct nfs_context
*nfs
, const char *path
, char *buf
, int bufsize
);
776 * Async chmod(<name>)
778 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
779 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
781 * When the callback is invoked, status indicates the result:
784 * -errno : An error occured.
785 * data is the error string.
787 EXTERN
int nfs_chmod_async(struct nfs_context
*nfs
, const char *path
, int mode
, nfs_cb cb
, void *private_data
);
791 * 0 : The operation was successfull.
792 * -errno : The command failed.
794 EXTERN
int nfs_chmod(struct nfs_context
*nfs
, const char *path
, int mode
);
802 * Async fchmod(<handle>)
804 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
805 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
807 * When the callback is invoked, status indicates the result:
810 * -errno : An error occured.
811 * data is the error string.
813 EXTERN
int nfs_fchmod_async(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, int mode
, nfs_cb cb
, void *private_data
);
815 * Sync fchmod(<handle>)
817 * 0 : The operation was successfull.
818 * -errno : The command failed.
820 EXTERN
int nfs_fchmod(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, int mode
);
828 * Async chown(<name>)
830 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
831 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
833 * When the callback is invoked, status indicates the result:
836 * -errno : An error occured.
837 * data is the error string.
839 EXTERN
int nfs_chown_async(struct nfs_context
*nfs
, const char *path
, int uid
, int gid
, nfs_cb cb
, void *private_data
);
843 * 0 : The operation was successfull.
844 * -errno : The command failed.
846 EXTERN
int nfs_chown(struct nfs_context
*nfs
, const char *path
, int uid
, int gid
);
854 * Async fchown(<handle>)
856 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
857 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
859 * When the callback is invoked, status indicates the result:
862 * -errno : An error occured.
863 * data is the error string.
865 EXTERN
int nfs_fchown_async(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, int uid
, int gid
, nfs_cb cb
, void *private_data
);
867 * Sync fchown(<handle>)
869 * 0 : The operation was successfull.
870 * -errno : The command failed.
872 EXTERN
int nfs_fchown(struct nfs_context
*nfs
, struct nfsfh
*nfsfh
, int uid
, int gid
);
881 * Async utimes(<path>)
883 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
884 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
886 * When the callback is invoked, status indicates the result:
889 * -errno : An error occured.
890 * data is the error string.
892 EXTERN
int nfs_utimes_async(struct nfs_context
*nfs
, const char *path
, struct timeval
*times
, nfs_cb cb
, void *private_data
);
894 * Sync utimes(<path>)
896 * 0 : The operation was successfull.
897 * -errno : The command failed.
899 EXTERN
int nfs_utimes(struct nfs_context
*nfs
, const char *path
, struct timeval
*times
);
906 * Async utime(<path>)
908 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
909 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
911 * When the callback is invoked, status indicates the result:
914 * -errno : An error occured.
915 * data is the error string.
918 EXTERN
int nfs_utime_async(struct nfs_context
*nfs
, const char *path
, struct utimbuf
*times
, nfs_cb cb
, void *private_data
);
922 * 0 : The operation was successfull.
923 * -errno : The command failed.
925 EXTERN
int nfs_utime(struct nfs_context
*nfs
, const char *path
, struct utimbuf
*times
);
934 * Async access(<path>)
936 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
937 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
939 * When the callback is invoked, status indicates the result:
942 * -errno : An error occured.
943 * data is the error string.
945 EXTERN
int nfs_access_async(struct nfs_context
*nfs
, const char *path
, int mode
, nfs_cb cb
, void *private_data
);
947 * Sync access(<path>)
949 * 0 : The operation was successfull.
950 * -errno : The command failed.
952 EXTERN
int nfs_access(struct nfs_context
*nfs
, const char *path
, int mode
);
961 * Async symlink(<path>)
963 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
964 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
966 * When the callback is invoked, status indicates the result:
969 * -errno : An error occured.
970 * data is the error string.
972 EXTERN
int nfs_symlink_async(struct nfs_context
*nfs
, const char *oldpath
, const char *newpath
, nfs_cb cb
, void *private_data
);
974 * Sync symlink(<path>)
976 * 0 : The operation was successfull.
977 * -errno : The command failed.
979 EXTERN
int nfs_symlink(struct nfs_context
*nfs
, const char *oldpath
, const char *newpath
);
986 * Async rename(<oldpath>, <newpath>)
988 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
989 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
991 * When the callback is invoked, status indicates the result:
994 * -errno : An error occured.
995 * data is the error string.
997 EXTERN
int nfs_rename_async(struct nfs_context
*nfs
, const char *oldpath
, const char *newpath
, nfs_cb cb
, void *private_data
);
999 * Sync rename(<oldpath>, <newpath>)
1001 * 0 : The operation was successfull.
1002 * -errno : The command failed.
1004 EXTERN
int nfs_rename(struct nfs_context
*nfs
, const char *oldpath
, const char *newpath
);
1012 * Async link(<oldpath>, <newpath>)
1014 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
1015 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
1017 * When the callback is invoked, status indicates the result:
1020 * -errno : An error occured.
1021 * data is the error string.
1023 EXTERN
int nfs_link_async(struct nfs_context
*nfs
, const char *oldpath
, const char *newpath
, nfs_cb cb
, void *private_data
);
1025 * Sync link(<oldpath>, <newpath>)
1027 * 0 : The operation was successfull.
1028 * -errno : The command failed.
1030 EXTERN
int nfs_link(struct nfs_context
*nfs
, const char *oldpath
, const char *newpath
);
1037 * Async getexports()
1038 * NOTE: You must include 'libnfs-raw-mount.h' to get the definitions of the
1039 * returned structures.
1041 * This function will return the list of exports from an NFS server.
1044 * 0 : The operation was initiated. Once the operation finishes, the callback will be invoked.
1045 * <0 : An error occured when trying to set up the operation. The callback will not be invoked.
1047 * When the callback is invoked, status indicates the result:
1049 * data is a pointer to an exports pointer:
1050 * exports export = *(exports *)data;
1051 * -errno : An error occured.
1052 * data is the error string.
1054 EXTERN
int mount_getexports_async(struct rpc_context
*rpc
, const char *server
, rpc_cb cb
, void *private_data
);
1056 * Sync getexports(<server>)
1058 * NULL : something failed
1059 * exports export : a linked list of exported directories
1061 * returned data must be freed by calling mount_free_export_list(exportnode);
1063 EXTERN
struct exportnode
*mount_getexports(const char *server
);
1065 EXTERN
void mount_free_export_list(struct exportnode
*exports
);
1068 //qqq replace later with lseek(cur, 0)
1069 uint64_t nfs_get_current_offset(struct nfsfh
*nfsfh
);
1075 struct nfs_server_list
{
1076 struct nfs_server_list
*next
;
1081 * Sync find_local_servers(<server>)
1082 * This function will probe all local networks for NFS server. This function will
1083 * block for one second while awaiting for all nfs servers to respond.
1086 * NULL : something failed
1088 * struct nfs_server_list : a linked list of all discovered servers
1090 * returned data must be freed by nfs_free_srvr_list(srv);
1092 struct nfs_server_list
*nfs_find_local_servers(void);
1093 void free_nfs_srvr_list(struct nfs_server_list
*srv
);