Commit Graph

74 Commits (206a2ff644dc30bedda747d53dee2659f7dc634f)

Author SHA1 Message Date
Ronnie Sahlberg d84d168f0f Change license for the ld preload hack to gplv3 2014-02-11 18:36:24 -08:00
Ronnie Sahlberg b8c28d541e Add a simple LD_PRELOAD toy to make cat and cp nfs-aware 2014-02-02 18:03:50 -08:00
Maxim Koltsov 5581436f5f Adjust Makefile.am's to support out-of-source builds 2014-01-08 12:36:09 +04:00
Ronnie Sahlberg c4ba61c51c Change all calls to rpc_nfs_fsinfo to rpc_nfs3_fsinfo 2013-12-31 15:06:25 -08:00
Ronnie Sahlberg 8aab33e33c Merge pull request #44 from plieven/master
fix 3 flaws detected by valgrind and bump version to intermediate version
2013-12-26 11:00:04 -08:00
Ronnie Sahlberg dc3ed8c3ab Fix some compiler warnings and bugs
Add missing %s to two example programs and fix incorrect argument to
rpc_nfs3_fsinfo_async()
2013-12-26 10:40:37 -08:00
Peter Lieven 22fbc5dad8 nfs-cp: don't leave file_context->url unitialized
Signed-off-by: Peter Lieven <pl@kamp.de>
2013-12-26 14:03:57 +01:00
Ronnie Sahlberg 6d89ace041 Merge pull request #43 from plieven/master
URL parsing functions and minor fixes + enhancements
2013-12-25 16:11:29 -08:00
Ronnie Sahlberg 767a479c37 Write the total number of bytes copied by nfs-cp, not just the last block written. 2013-12-24 13:05:04 -08:00
Peter Lieven 17d3cbb136 examples/nfs-ls: add discovery mode
this adds the ability for nfs-ls to discover

a) local NFS servers

examples/nfs-ls -D nfs://

b) NFS shares on a server

examples/nfs-ls -D nfs://10.0.0.1

c) all shares on local NFS servers

examples/nfs-ls -D -R nfs://

Enjoy!

Signed-off-by: Peter Lieven <pl@kamp.de>
2013-12-23 15:12:50 +01:00
Peter Lieven 6bdcd5b676 examples: add nfs-io example
this simple example tool allows to
- creat and unlink files
- mkdir and rmdir directories
- stat

Signed-off-by: Peter Lieven <pl@kamp.de>
2013-12-23 14:50:09 +01:00
Peter Lieven 82f5df21eb examples/nfs-cp: use nfs_parse_url_full
Signed-off-by: Peter Lieven <pl@kamp.de>
2013-12-23 14:07:01 +01:00
Peter Lieven d2ec73c75a add URL parsing functions
this adds the following 4 functions. see libnfs.h for details.

struct nfs_url *nfs_parse_url_full(struct nfs_context *nfs, char *url);
struct nfs_url *nfs_parse_url_dir(struct nfs_context *nfs, char *url);
struct nfs_url *nfs_parse_url_incomplete(struct nfs_context *nfs, char *url);
void nfs_destroy_url(struct nfs_url *url);

Signed-off-by: Peter Lieven <pl@kamp.de>
2013-12-23 14:03:00 +01:00
Peter Lieven 1dc9ea0d52 examples/nfs-ls: recursion and summary support
this adds recusrion and summary support, fixes some compiler warnings,
fixes exit codes and avoids a possible sprintf buffer overflow.

Signed-off-by: Peter Lieven <pl@kamp.de>
2013-12-23 12:46:26 +01:00
Ronnie Sahlberg b4598f416f Remove some debug residuals from fuse_nfs 2013-11-04 06:36:50 -08:00
Ronnie Sahlberg 8ca7b275f8 We don't need -odebug for the fuse nfs client anymore 2013-11-03 21:01:11 -08:00
Ronnie Sahlberg c6bd90a235 Add a simple FUSE filesystem based on libnfs. 2013-11-03 19:36:57 -08:00
Memphiz 292e2d9097 [win32] - add projects for examples to the solution and make them compile (all compile but nfsclient-bcast) 2013-05-29 18:41:31 +02:00
Ronnie Sahlberg 2384420387 Configure check for sys/time.h 2013-05-28 18:08:02 -07:00
Ronnie Sahlberg bff8fe460d Some more configure checks for headers 2013-05-28 17:54:12 -07:00
Ronnie Sahlberg 7057e733c1 Add configure checks for sys/socket.h 2013-05-28 17:43:47 -07:00
Ronnie Sahlberg 728970051c Add configure checks for whether netinet/in.h is available or not 2013-05-28 17:38:37 -07:00
Ronnie Sahlberg 67a9f57e67 WIN32 fixes 2013-05-28 16:15:16 -07:00
Ronnie Sahlberg 3d574b1eab Change nfs-cp.c example to use lseek+read/write instead of pread/pwrite since some platforms (==amiga) dont have pread/pwrite
Build nfs-ls and nfs-cp for amiga/aros
2013-04-16 18:28:50 -07:00
Ronnie Sahlberg a6bc1707f7 Add two more examples: nfs-ls and nfs-cp 2013-04-15 21:41:38 -07:00
Ronnie Sahlberg 108c622a95 more include cleanups it starts to look almost decent now 2013-04-14 10:32:01 -07:00
Ronnie Sahlberg 00748f36c5 more header include cleanups 2013-04-14 10:11:48 -07:00
Ronnie Sahlberg a41dbfe25a AROS: Add an example for using the SYNC API to AROS
While the ASYNC API is probably always preferable, the SYNC API is easier
to use.  The SYNC API is probably what most users want.
2013-04-13 08:01:05 -07:00
Ronnie Sahlberg 2cdf4fcb07 AROS: it is called IoctlSocket/CloseSocket and WaitSelect on AROS.
Additionally add a aros_init_socket() function to open the bsd socket library and set up networking
2013-04-12 06:12:58 -07:00
Ronnie Sahlberg e803ae5760 Rearrange the header files.
Move the headers we install to ./include/nfsc
and start including nfsc/libnfs-zdr.h  from all the other header files.
2012-11-28 20:21:53 -08:00
Ronnie Sahlberg 09d8500e23 We must link the examples with popt 2012-11-24 08:26:26 -08:00
Ronnie Sahlberg 31a2602e3d NFSCLIENT-SYNC: remove some debug output 2012-11-24 08:15:20 -08:00
Ronnie Sahlberg 67336940cd Change the sync example to perform a 'ls -l' on an NFS URL 2012-11-21 16:49:30 -08:00
Ronnie Sahlberg 763cd6e3e2 ZDR: New builtin replacement for RPC/XDR called ZDR
This patch switches libnfs over to use precompiled rpcgen files
and using ZDR.  ZDR is a trivial reimplementation of XDR that is built in
into libnfs.

This removes the dependencies of rpc/xdr completely and allow us to build on any
system, even systems where rpcgen and librpc/libxdr are not generally available.
2012-07-04 16:53:12 +10:00
Ronnie Sahlberg 0118a5f0de GETACL: change the signature for the raw getacl3 function to take GETACL3args pointer instead of a discrete arguments 2012-03-08 22:52:20 +11:00
Ronnie Sahlberg 5c6b1176c2 PMAP: allow to ask for tcp/udp port, dont assume users only ever want the tcp port 2011-12-31 14:24:20 +11:00
Ronnie Sahlberg 183451cff5 Remove all [s]size_t / off_t and replace with [u]int64_t making libnfs 64-bit pure 2011-11-27 14:49:08 +11:00
Ronnie Sahlberg 584108f43e Merge remote branch 'memphiz/listservers' 2011-09-13 15:06:21 +10:00
unknown e078d276f7 [add] - list nfs servers nfsclient-sync 2011-09-12 20:01:42 +02:00
Memphiz dba24f1079 [fix] - fixed example - don't exit on read failure during dirent (it could be a directory - non fatal if read fails on that)
- fixed sprintf pointer
2011-09-12 18:49:28 +02:00
Memphiz a8a1b85846 [win32] - make it compile on win32 2011-09-03 15:08:48 +10:00
Ronnie Sahlberg eecdc4f3cd Win32 changes, include files we need when compiling under win32
and some socket ops are slightly different
2011-08-28 19:24:18 +10:00
Memphiz 41a6209bef [fix] - fix allocation of if list for osx
- removed one unneeded header in examples/nfsclient-bcast.c which was breaking build under osx
2011-07-11 19:16:13 +02:00
Ronnie Sahlberg 9a96dd46d2 We have to include config.h when testing for precense of sockaddr sa_len 2011-07-10 08:50:36 +10:00
Ronnie Sahlberg 1be803ce7f On OSX and other systems where we have sockaddr_in, SIOCGIFCONF returns a packed list of ifreq structures, so we can not just index them as (struct ifreq *)[i]
Instead we have to compute the offset into the buffer for where the next record starts (this offset might or might not be sizeof(struct ifreq)
2011-07-10 08:39:54 +10:00
Trent Nelson 56320c681f Fix out-of-tree (VPATH) builds 2011-07-06 16:38:38 -04:00
Trent Nelson b7e444c6cf Simplify examples Makefile 2011-07-06 16:38:23 -04:00
Ronnie Sahlberg 1ad6f93185 when ioctl() for getting the broadcast address fails, continue the loop to the next entry instead of exiting out 2011-07-04 08:46:19 +10:00
Ronnie Sahlberg 3847f8f6ae add support got NFSACL protocol and NULL and GETACL procedures.
add example of raw interface for NFSACL
2011-07-03 15:30:18 +10:00
Ronnie Sahlberg fb0cf38eda remove some headers we dont need from the listservers example 2011-07-02 11:23:50 +10:00