Pelle Windestam
303e6499bd
net/tcp: Extended support for sending to non-blocking tcp sockets.
2018-04-20 07:37:51 -06:00
Gregory Nutt
b54ffe858a
Standardization of some function headers.
2018-03-13 09:52:27 -06:00
Gregory Nutt
251924a734
Squashed commit of the following:
...
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.
2018-03-12 10:59:46 -06:00
Gregory Nutt
7cf88d7dbd
Make sure that labeling is used consistently in all function headers.
2018-02-01 10:00:02 -06:00
Gregory Nutt
289e4dde06
net/udp and tcp: Yet another (cosmetic) change to UDP and TCP write buffer macro naming.
2018-01-22 19:33:14 -06:00
Gregory Nutt
12d7125b75
net/tcp: Write buffering logic should not wait for a free buffer if the socket was opened non-blocking. Also, rename the TCP write buffering macros from WRB_* to TCPWB_* to make room in the namespace for write buffering with other protocols.
2018-01-22 11:11:23 -06:00
Gregory Nutt
7ebef900fb
Networking: Fix a race condition. The accept() operation is performed with the network locked. However, the network is unlocked BEFORE the connected state is set. Therefore, a context switch may occur and the socket may no longer be connected when it is marked so. Noted by Pascal Speck.
2017-08-31 07:23:19 -06:00
Gregory Nutt
04ad162540
Networking: Clean up some naming that has bothered me for a long time... There are no interrupts and no interrupt handlers in the network. There are events and event handler (there used to to be interrupt logic in there years ago but that is long, long gone).
2017-08-29 14:08:04 -06:00
Gregory Nutt
171d183e8e
Networking: A placeholder for some missing logic in the previous change related to monitoring network status for dup'ed sockets. If one of the dup'ed socket's is closed, then network monitor resources associated with that one socket must be recovered. Also, in the event that socket is being used on one thread, but then closed on another, any threads waiting for events from the socket should be informed of the closure. That latter requirement is not implemented because current data structures do not support it.
2017-08-29 13:24:49 -06:00
Gregory Nutt
0f7a52bc28
Networking: Fix a runaway recursion problem introduced the previous fixe for shutting down dup'ed sockets.
2017-08-29 12:27:58 -06:00
Gregory Nutt
9db65dea78
Networking: TCP disconnection callbacks are not retained in a list. This will support mutiple callbacks per lower-level TCP connection structure. That is necessary for the cae where a socket is dup'ed and shares the same lower-level connection structure. NOTE: There still needs to be a call to tcp_start_monitor() when the socket is dup'ed.
2017-08-29 10:38:01 -06:00
Gregory Nutt
ed58536c3a
Networking: Move two more TCP specific files from inet/ to tcp/. There is other TCP-specific logic in inet/ that should be moved sometime, but those are more entangled.
2017-08-29 09:25:22 -06:00
Gregory Nutt
92f44c5607
Networking: Move net/inet/net_monitor.c to net/tcp/tcp_monitor.c in preparation for design change to fix monitoring of duplicated sockets.
2017-08-29 08:40:13 -06:00
Gregory Nutt
bd7c84b23e
Remove CONFIG_NETDEV_MULTINIC. This increases code size by a little, but greatly reduces the complexity of the network code.
2017-08-08 14:24:12 -06:00
Gregory Nutt
aa2e9c15a5
IP forwarding: Major rearchitecting of the outgoing portion of the IP forwarding logic necessary into to properly received device-related forwarding events.
2017-07-07 20:19:26 -06:00
Gregory Nutt
7258f1cbfc
IP forwarding: Move to separate directory. A few fixes from early testing; In TUN driver, do all polling on worker thread. Otherwise, the stack gets very deep.
2017-07-07 18:33:06 -06:00
Gregory Nutt
31f832d8c5
IP forwarding: Flesh out TCP, UDP, and ICMPv6 packet forwarding logic.
2017-07-05 11:01:16 -06:00
Gregory Nutt
c0c275c8fc
IP forwarding. Adds a little more structure to handle passing packets received on one network device to another network device. Logic is still incomplete.
2017-07-04 10:19:52 -06:00
Gregory Nutt
83a875f394
IP forwarding: Add some fragments of TCP forwarding logic.
2017-07-03 15:58:01 -06:00
Masayuki Ishikawa
32a638cdfe
TCP: Fix tcp_findlistner() in dual stack mode
...
Signed-off-by: Masayuki Ishikawa <masayuki.ishikawa@gmail.com>
2017-05-25 16:54:19 +09:00
Gregory Nutt
d339ba9e0e
TCP: Fix some potential error conditions that could result from deferring the connection until the full 3-way handshake has completed.
2017-05-14 10:56:25 -06:00
Gregory Nutt
0de294a586
Fix lots of occurrences of 'the the', 'the there', 'the these', 'the then', 'the they.
2017-05-11 13:35:56 -06:00
Gregory Nutt
2043e1a114
IOBs: Move from driver/iob to a better location in mm/iob
2017-05-09 07:35:30 -06:00
Gregory Nutt
d5207efb5a
Be consistent... Use Name: consistent in function headers vs Function:
2017-04-21 16:33:14 -06:00
Gregory Nutt
bcc6b61fc1
Move include/nuttx/net/iob.h to include/drivers/iob.h; rename CONFIG_NET_IOB to CONFIG_DRIVERS_IOB
2017-04-20 14:53:30 -06:00
Jussi Kivilinna
cd3c9634c8
Add user-space networking stack API (usrsock)
...
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.
2017-03-31 08:58:14 -06:00
Jakub Łągwa
338b915008
While working with version 7.10 I discovered a problem in TCP stack that could be observed on high network load. Generally speaking, the problem is that RST flag is set in unnecessary case, in which between loss of some TCP packet and its proper retransmission, another packets had been successfully sent. The scenario is as follows: NuttX did not receive ACK for some sent packet, so it has been probably lost somewhere. But before its retransmission starts, NuttX is correctly issuing next TCP packets, with sequence numbers increasing properly. When the retransmission of previously lost packet finally succeeds, tcp_input receives the accumulated ACK value, which acknowledges also the packets sent in the meantime (i.e. between unsuccessful sending of lost packet and its proper retransmission). However, variable unackseq is still set to conn->isn + conn->sent, which is truth only if no further packets transmission occurred in the meantime. Because of incorrect (in such specific case) unackseq value, few lines further condition if (ackseq <= unackseq)is not met, and, as a result, we are going to reset label.
2016-06-20 06:55:29 -06:00
Gregory Nutt
1cdc746726
Rename CONFIG_DEBUG to CONFIG_DEBUG_FEATURES
2016-06-11 14:14:08 -06:00
Gregory Nutt
2c95fef501
Remove some empty code section comments
2016-02-26 07:35:55 -06:00
Gregory Nutt
8db55f6493
Back out most of previous commit
2016-02-26 06:45:37 -06:00
Gregory Nutt
0b441ff1f4
net/: Add basic IEEE 802.15-4 socket support
2016-02-25 14:01:22 -06:00
Andrew Webster
df211ee46a
TCP: add writable check during poll
...
When a poll requesting POLLOUT happens, the poll should return
immediately if a write will not block. This change adds that, as
opposed to the old behaviour of blocking until a timer from the
Ethernet driver eventually triggers the poll to complete.
This is only implemented for buffered TCP. Unbuffered TCP should
behave as before.
2016-01-22 15:52:14 -06:00
Gregory Nutt
36f4d0e9fc
Fix a error in some comments
2015-09-02 20:03:28 -06:00
Gregory Nutt
0e2986f131
net/tcp: The logic that binds a specific networkd device to a connection was faulty for the case of multiple network devices. On bind(), the local address should be used to associate a device with the connection (if the local address is not INADDR_ANY); On connect(), the remote address should be used (in case the local address is INADDR_ANY). On accept(), it does not matter but the remote address is the one guarenteed to be available.
2015-09-02 19:48:31 -06:00
Gregory Nutt
3bcdb218ff
Networking: Get rid of the tcp_mss macro. It is confusing and only obfuscates what is really going on
2015-08-27 08:39:17 -06:00
Gregory Nutt
8f7752d956
Networking: Modify how callback structures are stored to avoid another potential use of a stal pointer.
2015-06-03 08:11:57 -06:00
Gregory Nutt
33085cb309
Networking: The network device list was protected by a re-entrant semaphore. With the recent change to support network device callback, the network stack needs to access the network device list too. Some drivers, however, run the network stack from the interrupt level -- this is bad but a fact in the current state. Of course,those drivers are unable to take the semaphore and will assert.
...
The solution here is to eliminate the device devices semaphore altogether. This eliminates netdev_semtake() and netdev_semgive() and replaces them with net_lock() and net_unlock() which have larger scope as needed for this purpose.
2015-05-31 08:34:03 -06:00
Gregory Nutt
8b029fbbee
TCP networking: Hook the network monitor into the device event notification logic
2015-05-30 11:29:47 -06:00
Gregory Nutt
04a661a97c
TCP networking: Add support for network driver events
2015-05-30 09:12:27 -06:00
Gregory Nutt
e81f279315
Networking: Modify event list handling: Now there are two event lists each device structure: (1) One is for ARP and ICMP data related evetns, the other is for device related events. Callback allocation/free routines no accept a device paramter as well as a list: If the device paramter is added, then the callback goes into both the connection-related liast AND the device event list. Thus each socket type can received both custom data-related events as well as common device related events.
2015-05-28 12:01:38 -06:00
Gregory Nutt
1f3ee83134
Increase the size of the number of bytes sent from uint16_t to uint32_t in order to avoid TCP errors with long sessions. For exmple:
...
int hello_main(int argc, char *argv[])
{
uint32_t i;
for(i = 0; i < 65536; i++)
{
printf("Hello, World!!\n");
}
printf("press any key!!\n");
if (getchar()=='t')
return 0;
else
return 1;
}
When ran in a Telnet session, the "press any key" is not displayed because the tcp session closed unexpectedly with:
tcp_input: ERROR: conn->sndseq xx, conn->unacked xx"
This is fixed by increasing the width of conn->sent to 32-bits to prevent overflow.
From Rony XLN
2015-05-11 07:14:25 -06:00
Gregory Nutt
5736cf10af
Networking: Separate TCP poll logic out of net/sockets/net_poll.c and move it into the new net/tcp/tcp_netpoll.c.
2015-01-30 07:25:01 -06:00
Gregory Nutt
de91d34a19
Networking: Separate out UDP poll logic from socket/net_poll.c into a new udp/udp_netpoll.c; Create a skeleton local/local_netpoll.c for future poll support on Unix domain sockets.
2015-01-30 07:09:25 -06:00
Gregory Nutt
9c2af5317f
Merge remote-tracking branch 'origin/master' into afunix
2015-01-28 12:03:43 -06:00
Gregory Nutt
371a9fd84c
Networking: Fix another deadlock condition. tcp_write_buffer_alloc() calls sem_wait() with network locked. That worked if CONFIG_NET_NOINTS was not defined because interrupts are automatically restored when the wait happens. But with CONFIG_NET_NOINTS=y, the wait blocks with the network locked -- bad style and also can lead to a deadlock condition
2015-01-28 11:56:11 -06:00
Gregory Nutt
90e59217c6
Networking: Move TCP specific logic out of net/socket/accept.c to net/tcp/tcp_accept.c; add hooks for local, Unix doamin sockets
2015-01-25 15:46:05 -06:00
Gregory Nutt
f7663ef0ab
Networking: Final detangle off IPv4 and IPv6 TCP/UDP send logic. The Networking subsystem now compiles with IPv6 enabled
2015-01-18 08:56:05 -06:00
Gregory Nutt
86f617cc88
Networking: Straighten up use if IPv6/IPv4 in TCP connection logic
2015-01-17 17:07:54 -06:00
Gregory Nutt
b187b4f381
Networking: Straighten up use if IPv6/IPv4 in TCP connection logic
2015-01-17 15:17:35 -06:00
Gregory Nutt
f7681dbb43
Networking: Detangling IPv6/4 logic in UDP connection structures
2015-01-17 14:13:56 -06:00