Commit Graph

810 Commits

Author SHA1 Message Date
Gregory Nutt
0f5c35260b Local sockets: Local stream sockets had problem of double releasing pipes (both server and client attempt release), which causes wrong pipe pair being closed in multi-client case. Solve by adding per connection instance ID to pipe names. From Jussi Kivilinna (2015-05-12). 2015-05-12 07:47:32 -06:00
Gregory Nutt
3c1af2feed Local sockets: Add poll support for Unix stream sockets. From Jussi Kivilinna. 2015-05-12 07:41:12 -06:00
Gregory Nutt
2fcb93d2ca Correct some network lock logic: Two error conditions where the network was not being unlocked and one where it was getting unlocked twice. From Jussi Kivilinna. 2015-05-12 07:28:26 -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
d35926ea4a Fix typo introduced by commit a00f14a60a8ec54fbcf63e44d00f7101ec7cb5a3 2015-05-08 14:19:18 -06:00
Gregory Nutt
00011d4766 Another newly missing semicolon after a debug assertion. Noted by Librae 2015-04-29 15:56:08 -06:00
Gregory Nutt
621eae86b1 Networking: If IPV6 is not enabled, an warning occurs for an unused variable, which is currently used inside the IPV6 block, but declared outside. From ObitalFox. 2015-04-27 11:28:28 -06:00
Gregory Nutt
7a745c3fa4 Use common macro(s) for calculating link layer header length. From Brennan Ashton. 2015-04-13 13:53:13 -06:00
Gregory Nutt
3840c2a14b Fix several typos in comments 2015-04-09 16:13:03 -06:00
Gregory Nutt
3ba9dda227 socket: net_dupsd: Do not call sockfd_socket() twice. From Juha Niskanen 2015-03-12 08:11:08 -06:00
Gregory Nutt
21d6e41032 Add TUN device. From Max Neklyudov 2015-03-11 06:52:56 -06:00
Gregory Nutt
5c13722416 Networking: Improve the network device registration logic. When multiple link types are used, modify how each interface number is assigned to the device name by incrementing the device number individually for each interface link type. From Max Neklyudov. 2015-02-27 08:23:14 -06:00
Gregory Nutt
19f3d46eb0 Fix a list handling error in netdev_unregister(). From Max Neklyudov 2015-02-27 08:01:31 -06:00
Gregory Nutt
cded7ea682 Fix some time value changes; mostly changing greater than 1000000000 to greater than or equal to 1000000000. From Juha Niskanen 2015-02-20 07:07:36 -06:00
Gregory Nutt
63ab39b274 VFS: The inode unlink method should not be support if operations on the root pseudo-filesystem are disabled. 2015-02-18 09:34:58 -06:00
Gregory Nutt
db741dd695 Move some useful internal logic from recvfrom.c and udp_callback.c and put them in ip.h where they can be used more generally 2015-02-17 07:37:44 -06:00
Gregory Nutt
686dcbb79c Move some useful internal macros from udp_send.c and put them in ip.h where they can be used more generally 2015-02-17 07:08:11 -06:00
Gregory Nutt
eb8f5e548f Purely cosmetic changes resulting from last review IPv6 UDP change 2015-02-16 15:23:02 -06:00
Gregory Nutt
3f5ff4b210 IPv4 mapping to IPv6 implementation. Just for UDP. From Macs Neklyudov 2015-02-16 14:33:58 -06:00
Gregory Nutt
d6704a1cd7 Suffer the consequences of moving struct timeval to its correct location 2015-02-15 15:18:35 -06:00
Gregory Nutt
8337710084 Stray semicolon caused compile failure when IPv6 enabled 2015-02-14 09:30:22 -06:00
Gregory Nutt
8840102554 Networking: Divide net_intiialize() into net_setup() and net_initialize() to solve a chicken-and-egg problem. net_setup() must be caleld before up_initialize() is called so that networking data structures are ready to register new network devices.
net_initialize() now does only timer related operations and is called AFTER up_initialize() where the timers are configured.  This is really.
2015-02-14 06:36:53 -06:00
Gregory Nutt
77d8f2f63d Add some inclusions of nuttx/net.h to two files. Without these there can be compilation errors in certain configurations. From Max Neklyudov. 2015-02-13 13:43:19 -06:00
Gregory Nutt
005643de2c Networking: Fix a compilation error recently introduced into the raw packet logic 2015-02-11 09:30:30 -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
8a380a084d IOB Configuration: Default number of IOB changes must be more than zero is UDP read-ahead is enabled. 2015-02-10 06:25:55 -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
559f1ef825 Networking: Clean up and consolidate some clunky stuff by adding new net_timedwait() function 2015-02-09 07:50:10 -06:00
Gregory Nutt
1928feafca Networking: Fix some errors that crept in with IPv6 2015-02-06 13:34:19 -06:00
Gregory Nutt
252802d1cd Remove inclusion of some un-necessary header files. 2015-02-06 08:50:53 -06:00
Gregory Nutt
3e6705b526 IPv6: Separate function that converts prefix lengths to a netmask 2015-02-06 08:11:09 -06:00
Gregory Nutt
10cf7e9634 Make some conditional compilation consistent 2015-02-05 14:26:11 -06:00
Gregory Nutt
3bd6dcf435 IPv6 fixes: Both ICMPv6 autonomous auto-configuration and the ICMPv6 router function appear to be fully functional. 2015-02-05 12:48:02 -06:00
Gregory Nutt
c7f71c99a5 Networking: Changes need to build ICMPv6 'router' configuration on STM32 with network debug enabled 2015-02-05 11:47:56 -06:00
Gregory Nutt
6568d94902 ICMPv6: Add logic to behave like a router (if so configured): NuttX will not send the router advertisement message in response to any router solicitation messages. 2015-02-05 09:43:29 -06:00
Gregory Nutt
111f4a45a3 Forgot to add this file before a previous commit 2015-02-05 09:43:07 -06:00
Gregory Nutt
da1d1d7139 ICMPv6: Add option to send Router Advertisement Messages. 2015-02-05 09:28:00 -06:00
Gregory Nutt
6f3f43d930 IPv6: Add a netmaks for the local link address 2015-02-05 05:43:57 -06:00
Gregory Nutt
453c25cdbb Minor logic simplification 2015-02-04 21:06:11 -06:00
Gregory Nutt
28b89b7a65 ICMPv6 Auto-configuration: If no router reponds to the Router Solicitation, claim the link local address by sending the Neighbor Advertisement and return success 2015-02-04 16:13:27 -06:00
Gregory Nutt
c5ed77120f ICMPv6: Separate out Neighbor Advertise message so that we can reuse it 2015-02-04 15:43:54 -06:00
Gregory Nutt
f558dfbb96 Remove unnecessary, inappropriate inclusion of ARP head file in IPv6 code 2015-02-04 14:52:46 -06:00
Gregory Nutt
24d800398e Networking: Break out Ethernet definitions into a separate file; add IPv6 multicast addresses as common globals, Ethernet drivers need to filter link-local, all nodes Ethernet address 2015-02-04 14:51:20 -06:00
Gregory Nutt
6159d1307d Forgot to add a file from a previous commit 2015-02-03 17:45:24 -06:00
Gregory Nutt
0e38ca9a42 ICMPv6: Fix some multi-cast addresses 2015-02-03 17:26:05 -06:00
Gregory Nutt
f7ace410d1 Minor updates to comments, debug messages, documentation 2015-02-03 17:01:48 -06:00
Gregory Nutt
154d3ce955 ICMPv6: Some initial bugfix from first tests of the ICMPv6 auto-configuration logic. so far so good but a lot more testing is needed 2015-02-03 16:19:08 -06:00
Gregory Nutt
9791e829f5 ICMPv6: This completes coding of the ICMPv6 auto-configuration feature. It is not yet functional 2015-02-03 15:40:56 -06:00
Gregory Nutt
66f0198e3f Networking: Add support for sending ICMPv6 Router Solicitation and receiving Router advertisement. This is a part of the ICMPv6 auto-configuration logic is still still not complete 2015-02-03 13:25:28 -06:00
Gregory Nutt
553b93cd23 Costmetic updates to comments 2015-02-03 11:19:33 -06:00
Gregory Nutt
0e23712db4 Add an ioctal() that can be used to perform ICMPv6 auto-configuration 2015-02-03 08:54:42 -06:00
Gregory Nutt
b427e8288b Add netlib and application hooks for ICMPv6 auto-configuration (still incomplete 2015-02-03 08:01:55 -06:00
Gregory Nutt
d89073ae13 Add some comments to C files 2015-02-03 06:04:54 -06:00
Gregory Nutt
88f6573f31 ICMPv6: Add file/build structure that will eventually support ICMPv6 auto-configuration 2015-02-02 17:54:48 -06:00
Gregory Nutt
f019d11384 Restore 20Msec default 2015-02-02 14:59:49 -06:00
Gregory Nutt
bba3fccd74 Networking: Apply the same ARP fix for the Neighbor Solicitation logic 2015-02-02 14:50:16 -06:00
Gregory Nutt
e4c602747b Networking: Fixes another CONFIG_NET_NOINTS issues. When called sem_timedwait() with the network locked, the network stays logcked while we wait which is not what we want (without CONFIG_NET_NOINTS, interrupts are re-enabled while we wait and all is well). 2015-02-02 14:48:11 -06:00
Gregory Nutt
fb72b1b1b7 Auto neighbor solicitation is no longer EXPERIMENTAL and is the default for the DK-TM4C129X/ipv6 configuration 2015-02-02 14:09:06 -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
4ce94a7e95 IPv6: Eliminate a warning from UDP code 2015-02-02 11:37:22 -06:00
Gregory Nutt
b1b8c0e47d IPv6: More framework for automatic neighbor solicition. I think this also corrects and error in a broadcast/multicast address chedk 2015-02-02 11:34:51 -06:00
Gregory Nutt
3385082b99 IPv6: Remove an unusd file (kruft from original IPv6 develoment); Add inital hooks to support automatic Neighbor Solitication 2015-02-02 10:49:50 -06:00
Gregory Nutt
011ff49685 Cosmetic update to a few comments 2015-02-01 12:23:57 -06:00
Gregory Nutt
6d7891c4de Fix compile issues with configs/sim/nettest 2015-02-01 12:00:30 -06:00
Gregory Nutt
898d511e05 Unix domain: Fix some bugs in logic the frees stream FIFOs 2015-02-01 09:16:55 -06:00
Gregory Nutt
f8bb77365a Unix domain: Enable logic to clean up the FIFOs underlying stream sockets with those sockets are disconnected. Tehre is still no corresponding clean-up logic in place for Unix domain datagram sockets because the life of the FIFO is not as well known in that case 2015-02-01 08:52:26 -06:00
Gregory Nutt
0fc8d2fcc5 Unix domain: Add options to build in stream or datagram support separately 2015-01-31 07:58:51 -06:00
Gregory Nutt
6b8da59df6 Networking: Add fcntl support for Unix domain sockets and UDP sockets with read-ahead enabled 2015-01-30 14:41:09 -06:00
Gregory Nutt
f421723fbd Fix some errors in debug assertions 2015-01-30 13:29:56 -06:00
Gregory Nutt
62b706fa68 If a Unix domain socket is non-blocking, then the underlying FIFO should also be opened non-blocking 2015-01-30 12:43:37 -06:00
Gregory Nutt
e8a74527a0 Fix mimatched #if/#endif 2015-01-30 12:28:29 -06:00
Gregory Nutt
e86d00913e Unix domain/FIFOs: Fix a race condition between FIFO buffer operations and the opening and closing of FIFOs which necessary when the FIFOs are used to support Unix domain, datagram sockets. The default policy is the deallocate FIFO buffering when the last client closes the pipe. When when used for datagram communicatinos, packets left in the FIFO will be lost. Some like UDP read-ahead is needed: The buffered data in the FIFO needs to be retained until the reader gets a chance to re-open the FIFO. Added an ioctl (PIPEIOC_POLICY) to control the buffer policy. Default (0) is the legacy behavior; Unix domain datagram logic sets the alternative policy so that the packet data persists after the FIFO is closed. 2015-01-30 11:14:24 -06:00
Gregory Nutt
4205d68505 Networking: Any linger UDP read-ahead buffers must be freed when UDP socket is closed 2015-01-30 09:44:00 -06:00
Gregory Nutt
2a39105b3f Unix domain: Add logic to release references to the half duplex FIFO after sendto and recvfrom 2015-01-30 09:28:55 -06:00
Gregory Nutt
52f9a2744c Should fix another warning reported by Travis 2015-01-30 08:57:35 -06:00
Gregory Nutt
a76b87305a Networking: Should fix a few compile errors/warnings reported by Travis 2015-01-30 08:54:40 -06:00
Gregory Nutt
f357ba6c80 Fix error just introduces into recvfrom. From Macs N. 2015-01-30 08:22:44 -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
6eda06888a Eliminate a warning 2015-01-30 06:39:23 -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
7e7d228cd7 Update a comment 2015-01-30 05:40:28 -06:00
Gregory Nutt
7f95e4fb2c Networking: Fix a major TCP bug introduced with commit e71c09ce9777ff732cb60bd07fb43d85522f79d6. Some connection logic was reorder -- setting the socket got moved BEFORE the point where the check was made if the socket was already connected. The resulting behavior was odd: Telnet would connect, but then when you exit and reconnect, it would fail to connect. But then if try again, it would connect okay. So the symptom was connect-fail-connect-fail-... 2015-01-29 16:30:47 -06:00
Gregory Nutt
8b9958b7ba Fix two compilation errors that occur when Unix domain occurs an IPv6 are enabled 2015-01-29 12:31:29 -06:00
Gregory Nutt
0deca5b039 Unix domain: Various fixes to get apps/examplex/udgram working 2015-01-29 11:05:04 -06:00
Gregory Nutt
e5f820a2cd Unix domain: Add sendto logic for SOCK_DRAM protocoal 2015-01-29 10:40:10 -06:00
Gregory Nutt
9abd8e2e64 Fix typo in conditional compilation 2015-01-29 10:08:16 -06:00
Gregory Nutt
f6bec26e53 Elminate some warnings with TCP and UDP are disabled 2015-01-29 09:33:45 -06:00
Gregory Nutt
ffb16f658f Unix domain: Add initial cut at redvfrom() for Unix domain datagram sockets 2015-01-29 07:47:09 -06:00
Gregory Nutt
1c8ddae655 Fix a typo in comments 2015-01-28 17:51:59 -06:00
Gregory Nutt
72ac79e7a1 Minor fixes after initial tests with apps/examples/udgram 2015-01-28 15:27:54 -06:00
Gregory Nutt
dfa642601a Merge remote-tracking branch 'origin/master' into afunix 2015-01-28 14:58:49 -06:00
Gregory Nutt
35a814abca net/socket/accept.c: Ooops.. deleted one too many header files 2015-01-28 14:56:06 -06:00
Gregory Nutt
2c7123197c Networking: Move UDP-specifc parts of sendto() out of socket/sendto.c and into udp/udp_sendto.c. Hook in Unix domain sokcet sendto() logic (still just a stub for the moment) 2015-01-28 13:41:24 -06:00
Gregory Nutt
508f8aefa6 Unix domain socket support is no longer EXPERIMENTAL 2015-01-28 13:22:53 -06:00
Gregory Nutt
e4e863e752 Merge remote-tracking branch 'origin/master' into afunix 2015-01-28 12:14:00 -06:00
Gregory Nutt
5c2aad64cd Networking: Missed header file inclusion 2015-01-28 12:09:00 -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