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>
libnfs_zdr_opaque: make valgrind happy

valgrind complains about unitialized memory

Signed-off-by: Peter Lieven <pl@kamp.de>
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>
add tcp-syncnt URL param to adjust TCP_SYNCNT sockopt

This allows indirect support for a configurable connect timeout.

Linux uses a exponential backoff for SYN retries starting
with 1 second.

This means for a value n for TCP_SYNCNT, the connect will
effectively timeout after 2^(n+1)-1 seconds.

Example:
 examples/nfs-ls nfs://10.0.0.1/export?tcp-syncnt=1

Signed-off-by: Peter Lieven <pl@kamp.de>
add uid and gid URL param to specify alternate uid and/or gid

This allows to connect with an alternate uid or gid than that
of the current user.

Example:
 examples/nfs-ls nfs://10.0.0.1/export?uid=1000&gid=33

Signed-off-by: Peter Lieven <pl@kamp.de>
examples/nfs-cp: use nfs_parse_url_full

Signed-off-by: Peter Lieven <pl@kamp.de>
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>
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>
Merge pull request #43 from plieven/master

URL parsing functions and minor fixes + enhancements