fallback to usrsock if the features are not implemented locally
Change-Id: I46e2d6452d7edd3fa5b3d508945511cd48f22ebb
Signed-off-by: chao.an <anchao@xiaomi.com>
SO_ERROR is used to report asynchronous errors that are the result
of events within the network stack and not synchronous errors that
are the result of a library call(send/recv/connect)
Synchronous results are reported via errno.
Linux Programmer's Manual
...
NAME
getsockopt, setsockopt - get and set options on sockets
...
RETURN VALUE
...
On error, -1 is returned, and errno is set appropriately
Change-Id: I1a1a05a684dff8672aaf47eabee157ac0d275c2d
Signed-off-by: chao.an <anchao@xiaomi.com>
Squashed commit of the following:
Author: Gregory Nutt <gnutt@nuttx.org>
net/: Trivial changes to PR from review. Biggest difference: type of s_error changed to int16_t to save a byte or two.
Author: liuhuahang <liuhuahang@xiaomi.com>
Implement SO_ERROR for getsockopt()
net/tcp: Add logic to send probes when SO_KEEPALIVE is enabled.
net/tcp: TCP socket should not have to be connected to configure KeepAlive.
net/: Add a separate configuration to enable/disable KEEPALIVE socket options.
net/tcp: Arguments to TCP keep-alive timing functions probably should be struct timeval as are the times for other time-related socket options.
net/tcp: Fix a backward conditional
net/tcp: Add some more checks and debug output to TCP-protocol socket options.
net/tcp: Cosmetic changes to some alignment.
net/: Adds socket options needed to manage TCP-keepalive and TCP state machine logic to detect if that the remote peer is alive. Still missing the timer poll logic to send the keep-alive probes and the state machine logic to respond to probes.
net/: psock_recvfrom() is an internal interface and should not set the errno nor should it be a cancellation point.
net/: psock_accept() is not a cancellation point.
net/: psock_getsockopt() and psock_socket*9 are an internal interfaces and should not set the errno.
net/: psock_getsockopt() is an internal interface and should not set the errno.
net/: psock_listen() is an internal interface and should not set the errno.
net/: psock_connect(( is an internal interface and should not set the errno nor should it be a cancellation point.
net/: psock_bind() is an internal interface and should not set the errno.
net/: psock_accept() is an internal interface and should not set the errno.
User-space networking stack API allows user-space daemon to
provide TCP/IP stack implementation for NuttX network.
Main use for this is to allow use and seamless integration of
HW-provided TCP/IP stacks to NuttX.
For example, user-space daemon can translate /dev/usrsock
API requests to HW TCP/IP API requests while rest of the
user-space can access standard socket API, with socket
descriptors that can be used with NuttX system calls.