Commit Graph

117 Commits

Author SHA1 Message Date
Gregory Nutt e672bcebfd UDP Networking: Add support for device event notification for UDP transfers. 2015-05-29 10:21:06 -06:00
Gregory Nutt b5c005d5a4 Merge remote-tracking branch 'origin/master' into multinic
Conflicts:
	nuttx/ChangeLog
2015-05-28 19:30:48 -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 01d176af76 net_startmonitor.c always returned zero. In the case where a socket has already been closed, it correctly handled the disconnetion event but still returned OK. Returning OK causes the callers of net_startmonitor to assume that the connection was okay, undoing the good things that net_startmonitor did and causing the socket to be marked as connected. This behavior was noted by Pelle Windestam. 2015-05-28 08:23:51 -06:00
Gregory Nutt d6c3ed1c6f Networking: Fixes an important TCP bug: 16-bit flags was being converted to 8-bits in a few locations, causing loss of status indications 2015-05-27 17:17:42 -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 a82b8fd71f Networking: Fix several build errors/warning with IPv4 + IPv6 + multiple networks are enabled. 2015-02-10 06:54:10 -06:00
Gregory Nutt b756df982d net/: Lots of build problems introduced into multiple NIC support. Many places where conditional logic based on CONFIG_NETDEV_MULTINIC is confused with CONFIG_NET_MULTILINK. Lots of code changed with IPv6 that was never compiled with MULTINIC enabled. Still some problem with parameter passing. 2015-02-09 18:15:34 -06:00
Gregory Nutt a07a764d42 ICMPv6: Adds basic logic to support verification that we have the IPv6 address in the Neighbor Table. This feature is important because otherwise the first packet sent to a remote peer will fail (it will be replaced with a Neighbor Solicitation). 2015-02-02 13:44:31 -06:00
Gregory Nutt 6d7891c4de Fix compile issues with configs/sim/nettest 2015-02-01 12:00:30 -06:00
Gregory Nutt 52f9a2744c Should fix another warning reported by Travis 2015-01-30 08:57:35 -06:00
Gregory Nutt a438784054 Forgot to add a file in the last commit 2015-01-30 07:28:30 -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 ccc72edc0b Networking: Add UDP read-ahead support and support for poll/select on UDP sockets. From Macs N. 2015-01-30 06:08:26 -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 5f9837dcc8 Merge remote-tracking branch 'origin/master' into afunix
Conflicts:
	nuttx/ChangeLog
2015-01-27 21:47:12 -06:00
Gregory Nutt c4bd6f52b5 Networking: The are issues with the TCP write-ahead buffering if CONFIG_NET_NOINTS is enabled: There is a possibility of deadlocks in certain timing conditions. I have not seen this with the Tiva driver that I have been users but other people claim to see the issue on other platforms. Certainly it is a logic error: The network should never wait for TCP read-ahead buffering space to be available. It should drop the packets immediately.
This was fixed by duplicating most of the IOB interfaces:  The versions that waited are still present (like iob_alloc()), but now there are non-waiting verisons of the same interfaces (like iob_tryalloc()).  The TCP read-ahead logic now uses only these non-waiting interfaces.
2015-01-27 21:23:42 -06:00
Gregory Nutt f756545eb0 Networking: Add local Unix domain socket accept logic 2015-01-25 16:27:25 -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 0def771c8d 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:45:51 -06:00
Gregory Nutt f4bb7f14e1 Networking: Clean up network status collection and presentation for IPv6 2015-01-24 08:26:12 -06:00
Gregory Nutt c77426e550 Cosmetic changes to comments; refresh configuration 2015-01-22 14:46:36 -06:00
Gregory Nutt eac4ea7ae5 Networking: Back out a previous change. It is incorrect 2015-01-22 12:10:16 -06:00
Gregory Nutt 46fc574f0f Forgot to remove some debug instrumentation in the last commit 2015-01-22 10:35:11 -06:00
Gregory Nutt 7106469191 Armv7-M: Remove Px4-only setting of stack to 0xff. This is incompatible with standard NuttX stack montitoring logic 2015-01-22 10:09:10 -06:00
Gregory Nutt 5e23a855ec More typos in debug statements 2015-01-21 10:32:59 -06:00
Gregory Nutt 354bc626ab Fix a typo introduced in the last commit 2015-01-21 10:31:18 -06:00
Gregory Nutt 3202819328 IPv6 -- various fixed from problems found in testing 2015-01-21 10:29:18 -06:00
Gregory Nutt 5d31687e75 Correct name of fields in struct sockaddr_in6: sin6_port and sin6_family, not sin_port and sin_family 2015-01-20 18:14:09 -06:00
Gregory Nutt 2842b5c5d6 Networking: Fix some problems with debug is enabled; fix a warning 2015-01-19 10:16:37 -06:00
Gregory Nutt eb3c6e8390 Networking: Some fixes for compilation when both IPv4 and IPv6 are enabled 2015-01-18 09:23:22 -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 ea52bda8f9 Networking: Add IPv6 suppport to TCP application level sending logic 2015-01-17 18:18:19 -06:00
Gregory Nutt d8b046f2fb Networking: Fix a simple IPv6 compile error 2015-01-17 17:48:15 -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
Gregory Nutt 94f9312150 Networking: Save the IP domain in the connection structure 2015-01-17 13:07:48 -06:00
Gregory Nutt e2933ca4cc Networking: Oops. Forgot to add a couple of files that were part of an earlier commit 2015-01-17 09:35:27 -06:00
Gregory Nutt 820509eadc Networking: Fix accept() so that it returns the correct IP address for the selected socket IP domain. 2015-01-17 09:27:05 -06:00
Gregory Nutt 4ad5998db3 net/socket and net/tcp: When we are ready to receive data or when we have outgoing data ready to be sent, we need to the notify the appropriate device driver of this condition. The notifying socket will be configured as either PF_INET or PF_INET6 and must look up the correct driver using the correct IP domain. 2015-01-17 08:33:14 -06:00
Gregory Nutt 2c251d845c include/net/if.h: Add a bit to the device flags to indicate if the device packet buffer holds an IPv4 or an IPv6 domain packet. Set/clear the flag along with the correct offset to the application payload data as each packet is received.
net/socket, net/tcp, net/udp:  Add logic to select the domain of the outputgoing packet before sending any UDP or TCP packet.  This sets the bit to indicate the IPv4 or IPv6 domain and the correct offset to the output going payload data.
2015-01-17 07:42:09 -06:00
Gregory Nutt 88a0e82934 Networking: Remove field d_sndata from the device structure. It is the same as d_appdata and unnecessary 2015-01-17 05:59:13 -06:00
Gregory Nutt 8f8259a0d6 Networking: UDP and TCP MSS depends on the IP header size (as well as the link layer header size) and cannot be represented with a single value. 2015-01-16 15:03:10 -06:00
Gregory Nutt 2663538b0a Networking: Replace all references to the macros net_ipaddr_copy, net_ipaddr_hdrcopy, net_ipaddr_cmp, net_ipaddr_hdrcmp, and net_ipaddr_maskcmp with the appropriate IPv4 or IPv6 version of the macro (such as net_ipv4addr_copy). The goal is to support both IPv4 and IPv6 simultaneously. This requires that the macros be distinct and not conditionally defined to one on or the other. 2015-01-16 13:01:08 -06:00
Gregory Nutt 5e938941a6 Networking: Replace all references to net_ipaddr_t with either in_addr_t on net_ipv6addr_t. The goal is to support both IPv4 and IPv6 simultaneously. This requires that the two types be distinct and not conditionally typedef'ed to net_ipaddr_t. 2015-01-16 12:30:18 -06:00
Gregory Nutt bee89be4f4 Networking: Drivers can have both IPv4 and IPv6 addesses, but a socket can only only one or the other; The socket connnection structures need to include a union of IPv4 and IPv6 addresses for the local address binding and for the remote address connections 2015-01-16 10:01:54 -06:00
Gregory Nutt 5b45605991 Clean a few more IPv6 compilation issues; Add implementation of net_ipv6_maskcmp() 2015-01-15 15:55:52 -06:00