Commit Graph

50 Commits (cb5b8be2eb2d5b6d837e9f1ae20001e186f4aac2)

Author SHA1 Message Date
Ronnie Sahlberg cb5b8be2eb Try making the initial port used a little more random 2013-05-28 17:22:28 -07:00
Ronnie Sahlberg 00748f36c5 more header include cleanups 2013-04-14 10:11:48 -07:00
Ronnie Sahlberg 2142af5d47 WIN32: More ifdef cleanups 2013-04-14 09:02:23 -07:00
Ronnie Sahlberg 622489d36e WIN32: get rid of some ifdefs 2013-04-14 08:50:38 -07:00
Ronnie Sahlberg 099be710b6 SOCKET: Use recv/send for all socket io on all platforms
instead of only on windows and aros  and read/write on the others
2013-04-14 08:43:59 -07:00
Ronnie Sahlberg 9a9126c3d9 AROS: add inet_pton emulation and make sure we use recv/send and not read/write 2013-04-13 07:40:46 -07:00
Ronnie Sahlberg d7c6e9aaa9 Initial AROS support.
The test app doesnt link yet since we are missing a bunch of symbols

but it is a start
2013-04-10 20:28:40 -07:00
Ronnie Sahlberg f816bf4c76 Merge branch 'zdr'
Manually fixyp some merge conflicts in :
	lib/init.c
	lib/pdu.c
	lib/socket.c
	nfs/Makefile.am
	nfs/nfs.x
	nlm/Makefile.am
2012-11-27 18:22:27 -08:00
Ronnie Sahlberg f3a7507806 Add an assert to track if we try to use an rpc_context after it has been destroyed 2012-11-24 08:18:54 -08:00
Ronnie Sahlberg 2811861b96 Dont leak addrinfo in error path 2012-11-24 08:14:12 -08:00
Rudi Ihle 456c0b147a Fixed errno processing for connect() on Windows. 2012-11-24 08:12:45 -08:00
Rudi Ihle 2521374f70 Modified mechanism to assign privileged ports and enable it for Windows as well 2012-11-24 08:12:31 -08:00
Ronnie Sahlberg 4a2b08768a Add an assert to track if we try to use an rpc_context after it has been destroyed 2012-11-21 17:10:05 -08:00
Ronnie Sahlberg be7f59339e Dont leak addrinfo in error path 2012-11-17 10:14:19 -08:00
Rudi Ihle f96b24fada Fixed errno processing for connect() on Windows. 2012-09-18 08:33:41 +02:00
Rudi Ihle ac559609a3 Modified mechanism to assign privileged ports and enable it for Windows as well 2012-09-18 08:32:40 +02:00
Ronnie Sahlberg d14e28387f squelch compiler warnings in socket.c about integer sizes 2012-07-05 07:21:48 +10: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 e6cac86f77 Try to rotate the ports we assign when root better so we dont reuse
a port htat is in time-wait too frequently
2012-01-03 07:25:25 +11:00
Ronnie Sahlberg 59f298f5bf Improve an error message to show the errno value 2012-01-03 07:18:56 +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 b990de23c6 Only call the "connect callback" if the callback is set to non-NULL 2011-10-09 19:00:24 +11:00
Ronnie Sahlberg 1744ef9011 Autoreconnect: autoreconnect was completely broken. Reimplement it so that it reconnects properly on session failure. 2011-10-04 11:25:10 +11:00
Memphiz fcc42bfe85 [win32] - completed win32 port 2011-09-12 19:53:33 +02:00
Ronnie Sahlberg 4e9dcb7665 remove debug message 2011-09-12 22:20:56 +10:00
Ronnie Sahlberg 07fd0cbc65 when creating a socket, spin over a number of low-numbered ports
and try to bind to a system port in case the user is root or the
binary has the CAP_NET_BIND_SERVICE capability

this removes the need to use 'insecure' on the server
2011-09-12 22:14:26 +10:00
Ronnie Sahlberg 83aa785d92 Add a call to find the queue-length so we can see how many I/O we have in flight from the application layer. 2011-09-11 21:32:48 +10:00
unknown 4b0e8df9a9 [fix] - fix connect for win32 - return values are inverted 2011-09-03 15:31:56 +10:00
unknown 99c14c9b81 [add] - implement set_non_blocking for socket 2011-09-03 15:30:01 +10:00
Memphiz a8a1b85846 [win32] - make it compile on win32 2011-09-03 15:08:48 +10:00
Ronnie Sahlberg bb4e9ed6a8 cast to char * to avoid compiler warnings for get/setsockopt 2011-09-03 11:25:50 +10:00
Ronnie Sahlberg 41d82d7d82 Merge branch 'win32' into win32-3 2011-09-03 10:57:42 +10:00
Ronnie Sahlberg 647d2ea11c add support for opensolaris 2011-09-01 19:48:42 +10:00
Ronnie Sahlberg 6874f61e24 Win32: more win32 adaptations 2011-08-28 19:43:33 +10:00
Ronnie Sahlberg b077fdeb65 Add automatic reconnect after TCP session failure for the sync interface.
Once a NFS TCP connection has been idle for a very long time, say
10-15 minutes, it is common that NFS servers will tear down the TCP connection.
So add code to re-connect to the NFS server and re-issue any i/o that might have been in flight (unlikely unless the server has hung)

While it is sufficient to just reconnect to tcp port 2049, it was much simplet to just utilize the nfs_mount() function.
This means that instead of just reconnecting TCP port 2049, we do a full blown
nfs mount via portmapper and mountd protocols.
2011-07-31 10:49:47 +10:00
Ronnie Sahlberg f7f931c7e3 add back a check for sa_len in sockaddr structure. 2011-07-03 07:41:15 +10:00
Ronnie Sahlberg 2e4db0d145 Merge remote branch 't-nelson/automake' 2011-07-02 11:10:36 +10:00
Trent Nelson fc01d2a961 Fix compile error on solaris.
Include sys/filio.h explicitly as solaris doesn't define BSD_COMP and
thus doesn't pull this header via sys/ioctl.h. Needed for FIONREAD.
2011-06-29 14:15:23 -04:00
Ronnie Sahlberg c481da67f2 add function to extract the sockaddr from which we received the current rpc pdu
(useful when parsing replies from broadcast rpc calls)
2011-06-26 18:45:38 +10:00
Ronnie Sahlberg 5bf60dc601 add function to set the target for UDP rpc calls.
including doing broadcast calls
2011-06-26 18:42:53 +10:00
Ronnie Sahlberg 485bc9b9a7 add function to bind a udp rpc context to a local port/address 2011-06-26 18:40:00 +10:00
Ronnie Sahlberg 070287e516 Dont allow a tcp _connect to a UDP context 2011-06-26 18:32:06 +10:00
Ronnie Sahlberg 0268794fe3 add capability to read UDP datagrams from the socket and pass them to the parser 2011-06-26 18:30:26 +10:00
Ronnie Sahlberg 5911f3e8ab for UDP sockets, we ONLY wait for pollin events
since upd sockets are always writeable.
they just silently drop packets when congested
2011-06-26 18:26:34 +10:00
Ronnie Sahlberg cdb19ec164 Redo the buffer handling for input buffers and make sure we only read one PDU at a time 2011-06-20 00:56:47 +10:00
Ronnie Sahlberg 1896d37bfa get rid of all remaining printfs from the library
add a helper function nfs_set_error() to use instead of the printfs
2011-06-19 09:38:20 +10:00
Memphis 98f5fee87d - linux, osx, and ios need rpc/rpc.h includede before rpc/xdr.h
- fixed some missing includes for bzero, malloc and free
2011-06-01 18:06:15 +02:00
Ronnie Sahlberg ea214e4566 Use HAVE_SOCK_SIN_LEN and set ->sin_len
for legacy unixens (AIX)
so that we will compile and run on those systems with a "weird"
sockaddr_in definition.
2011-06-01 21:31:40 +10:00
Ronnie Sahlberg 912f7ad5b0 Use getsockopt to extract better failure condition when tcp layer receives a failure 2011-02-07 22:11:12 +11:00
Ronnie Sahlberg 84004dbf9b initial libnfs checkin 2011-02-06 15:45:09 +11:00