Commit Graph

157 Commits

Author SHA1 Message Date
Gregory Nutt b54ffe858a Standardization of some function headers. 2018-03-13 09:52:27 -06:00
Dmitriy Linikov a8c58607e9 Merged in hardlulz/modem-3.0-nuttx/fix-sem-EINTR (pull request #603)
Added ECANCELED condition to DEBUGASSERT-s checking sem_wait result

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2018-02-20 18:24:53 +00: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 82cb799bb6 net/udp: Fix memory leak with UDP + write buffer is closed. Also update TODO and comments and refresh a configuration. 2018-01-23 11:54:03 -06:00
Gregory Nutt f2017bded8 net/udp: UDP write buffering is basically functional but needs a lot more verification. 2018-01-23 07:32:17 -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 2d4fa19a54 net/udp: Resolves final design issues with UDP write buffering. 100% code complete but also 100% untested. 2018-01-22 19:27:05 -06:00
Gregory Nutt fa3ad46897 net/udp: In sendto(), return EHOSTUNREACH if if the network is down. 2018-01-22 18:46:58 -06:00
Gregory Nutt fef255e5be This commit adds an as-of-yet untested implemented of UDP write buffering.
Squashed commit of the following:

    net/udp:  Address most of the issues with UDP write buffering.  There is a remaining issue with handling one network going down in a multi-network environment.  None of this has been test but it is certainly ready for test.  Hence, the feature is marked EXPERIMENTAL.
    net/udp:  Some baby steps toward a corrected write buffering design.
    net/udp:  Remove pesky write buffer macros.
    Eliminate trailing space at the end of lines.
    net/udp:  A little more UDP write buffering logic.  Still at least on big gaping hole in the design.
    net/udp:  Undefined CONFIG_NET_SENDTO_TIMEOUT.
    net/udp:  Crude, naive port of the TCP write buffering logic into UDP.  This commit is certainly non-functional and is simply a starting point for the implementatin of UDP write buffering.
    net/udp:  Rename udp/udp_psock_sendto.c udp/udp_psock_sendto_unbuffered.c.
2018-01-22 18:32:02 -06:00
Gregory Nutt 0406fff888 net/udp: Remove some conditional logic that was true if there is only a single network device, but not true in the multi-device context. 2018-01-22 14:14:32 -06:00
Gregory Nutt cccc86da09 This change adds support for semi-standard IPPROTO_ICMP AF_INET datagram sockets. This replaces the old ad hoc, nonstandard way of implementing ping with a more standard, socket interface.
Squashed commit of the following:

    net/icmp:  Finishes off icmp_recvfrom().
    net/icmp:  Add readahead support for IPPROTO_ICMP sockets.
    net/icmp:  Add poll() support for IPPROTO_ICMP sockets.
    net/icmp:  Add a connection structure for IPPROTO_ICMP sockets.
    net/icmp:  Implements sendto for the IPPROTO_ICMP socket.
    net/icmp:  Move icmp_sendto() and icmp_recvfrom() to separate files.  They are likely to be complex (when they are implemented).
    net/icmp:  Hook IPPROTO_ICMP sockets into network.  Fix some naming collisions.  Still missing basic ICMP send/receive logic.
    configs: apps/system/ping current need poll() enabled.
    configs: All defconfig files that use to enable low-level support must now enabled CONFIG_SYSTEM_PING.
    net/icmp:  Adds basic build framework to support IPPROTO_ICMP sockets.
2017-10-23 08:45:12 -06:00
Gregory Nutt cf5cba953d There was a possible recursion that could eventually overflow the stack. The error occurred when closing the socket with inet_close() while a socket callback was still queued. When the socket callback was executed by devif_conn_event(), this resulted in a call to psock_send_eventhandler() with TCP_CLOSE flag set which then called tcp_lost_connection(). tcp_shutdown_monitor() then called tcp_callback() again, which again called psock_send_eventhandler(), and so on.... Noted by Pascal Speck. Solution is also similar to a solution proposed by Pascal Speck. 2017-10-19 11:55:51 -06:00
Gregory Nutt 9568600ab1 Squashed commit of the following:
This commit backs out most of commit b4747286b1.  That change was added because sem_wait() would sometimes cause cancellation points inappropriated.  But with these recent changes, nxsem_wait() is used instead and it is not a cancellation point.

    In the OS, all calls to sem_wait() changed to nxsem_wait().  nxsem_wait() does not return errors via errno so each place where nxsem_wait() is now called must not examine the errno variable.

    In all OS functions (not libraries), change sem_wait() to nxsem_wait().  This will prevent the OS from creating bogus cancellation points and from modifying the per-task errno variable.

    sched/semaphore:  Add the function nxsem_wait().  This is a new internal OS interface.  It is functionally equivalent to sem_wait() except that (1) it is not a cancellation point, and (2) it does not set the per-thread errno value on return.
2017-10-04 15:22:27 -06:00
Gregory Nutt 42a0796615 Squashed commit of the following:
sched/semaphore:  Add nxsem_post() which is identical to sem_post() except that it never modifies the errno variable.  Changed all references to sem_post in the OS to nxsem_post().

    sched/semaphore:  Add nxsem_destroy() which is identical to sem_destroy() except that it never modifies the errno variable.  Changed all references to sem_destroy() in the OS to nxsem_destroy().

    libc/semaphore and sched/semaphore:  Add nxsem_getprotocol() and nxsem_setprotocola which are identical to sem_getprotocol() and set_setprotocol() except that they never modifies the errno variable.  Changed all references to sem_setprotocol in the OS to nxsem_setprotocol().  sem_getprotocol() was not used in the OS
2017-10-03 15:35:24 -06:00
Gregory Nutt 83cdb0c552 Squashed commit of the following:
libc/semaphore:  Add nxsem_getvalue() which is identical to sem_getvalue() except that it never modifies the errno variable.  Changed all references to sem_getvalue in the OS to nxsem_getvalue().

    sched/semaphore:  Rename all internal private functions from sem_xyz to nxsem_xyz.  The sem_ prefix is (will be) reserved only for the application semaphore interfaces.

    libc/semaphore:  Add nxsem_init() which is identical to sem_init() except that it never modifies the errno variable.  Changed all references to sem_init in the OS to nxsem_init().

    sched/semaphore:  Rename sem_tickwait() to nxsem_tickwait() so that it is clear this is an internal OS function.

    sched/semaphoate:  Rename sem_reset() to nxsem_reset() so that it is clear this is an internal OS function.
2017-10-03 12:52:31 -06:00
Gregory Nutt 80412df0b1 UDP Networking: Fix unitialized variable problem found by Coverity 2017-09-13 12:12:57 -06:00
Jussi Kivilinna 547733cbb0 Update net_timedwait() and net_lockedwait() call sites to handle negated errno in return value 2017-09-04 07:56:51 -06:00
Gregory Nutt 8ffb103adb networking: IGMP: Remove special support for interrupt level processing (there is none) and fix some timer cancellation logic. In many files, correct comments. There is no interrupt level processing in the networking layer. 2017-09-02 10:27:03 -06:00
Gregory Nutt 0b2a4eb4bd Networking: A little more wording changes related to interrupts vs. events 2017-08-29 15:08:38 -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 969d7c5814 Networking: Remove driver based backlog support. This affects the entire network, but is used by only one driver. The only supported with of supported RX backlog is via common read-ahead buffering. 2017-08-21 06:28:59 -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 572cf51fa4 Networking: Rethink IPv6 all-nodes packet routing. 2017-08-08 07:48:07 -06:00
Gregory Nutt 835ae2999d networking: Move a little more to the inet/ subdirectory. 2017-08-07 13:03:23 -06:00
Gregory Nutt 2ada7d5892 IPv6: Remove comparisons to the address with all ones set. IPv6 does not support broadcast addresses and certainly not in that form. Replace with multicast addresses beginning with 0xff02. 2017-08-07 11:50:50 -06:00
Gregory Nutt 799b2d5671 Update comments. 2017-07-17 07:14:12 -06:00
Gregory Nutt d9a2a3c3f1 Networking: When upd_input() cannot process a packet, it returns ERROR so that network drivers may try calling ipv4_input() later. In this case, it must also set d_len to zero. Otherwise, all network drivers will assume tht there is also an outgoing packet. This results in a gratuitous ARP. 2017-07-17 06:50:39 -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 803235ad4b IP forwaring: Rename some files to get closer to other naming conventions. 2017-07-07 18:45:58 -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 b5d7187df6 IP forwarding design simplication; might save some memory. Also fix some compile issues introduce with last commit in MULTINIC configration. 2017-07-06 16:19:10 -06:00
Gregory Nutt b297066eb9 IP Forwarding: Add IPv4 packet forwarding logic. Initial commit is an untested clone of the IPv6 forwarding logic with a few minor logic changes for IPv4. 2017-07-05 15:12:29 -06:00
Gregory Nutt edf16c5805 IP forwarding: In check it the Ethernet MAC address is in the ARP/Neighbor table, add an additional check to skip in the case of CONFIG_NET_MULTILINK and the devices is not an Ethernet device. 2017-07-05 12:40:26 -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 65c3fa6375 net/udp: Fix a copy-paste error that could effect networking when both IPv4 and IPv6 are enabled. 2017-07-05 07:27:17 -06:00
Gregory Nutt 5e617f8410 UDP networking: The TTL (time to live) was not being set in the IPv4 or IPv6 header unless the UDP socket was bound. 2017-07-04 12:05:21 -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 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 bfb93338f6 Move net/iob to drivers/iob so that the I/O buffering feature can be available to other drivers when networking is disabled. 2017-04-20 16:08:49 -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
Pascal Speck 8f91c73304 - fixed wrong assert on udp dgram send 2017-03-17 15:13:03 +01:00
Gregory Nutt 7467329a98 Eliminate CONFIG_NO_NOINTS. Lots of files changed -> lots of testing needed. 2016-12-03 16:28:19 -06:00
Gregory Nutt 2d057c28c8 net: Disable priority inheritance on all semaphores used for signaling 2016-11-03 12:17:02 -06:00
Gregory Nutt 2a751068e6 Without lowsyslog() *llerr() is not useful. Eliminate and replace with *err(). 2016-06-20 12:44:38 -06:00
Gregory Nutt 43eb04bb8f Without lowsyslog() *llinfo() is not useful. Eliminate and replace with *info(). 2016-06-20 11:59:15 -06:00
Gregory Nutt d40a473f72 Without lowsyslog() *llwarn() is not useful. Eliminate and replace with *warn(). 2016-06-20 09:37:08 -06:00
Gregory Nutt 7d0950bb22 net/: Change some nerr() ERRORS to nwarn() WARNINGS. Anomolous network events are not errors. 2016-06-12 07:09:37 -06:00