Commit Graph

55 Commits

Author SHA1 Message Date
chao.an
1659513edb net/inet: move socket error into socket_conn_s
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-02-10 15:04:33 -03:00
Alin Jerpelea
91a5f90a7f author: UVC Ingenieure : update licenses to Apache
Gregory Nutt has submitted the SGA
UVC Ingenieure has submitted the SGA
Max Holtzberg has submitted the ICLA

as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-09-15 15:57:55 +08:00
Xiang Xiao
663104a2e9 fs: Simplify sendfile implementation
and avoid call nx_ file API in the kernel space

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Id951ca161df2c2ee267dc4b5a0d7dfa67df4c1e6
2021-07-17 07:39:15 -03:00
Jiuzhu Dong
4d5a964f29 net: unify socket into file descriptor
Change-Id: I9bcd21564e6c97d3edbb38aed1748c114160ea36
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-03-03 19:01:41 -08:00
liuhuahang
ce634578dd This change implements the SO_ERROR socket option that is used to obtain the last error reported by the network.
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()
2019-12-24 08:09:55 -06:00
Xiang Xiao
d2cfd398ba Fix compiler error and warning when CONFIG_NET_SENDFILE=y 2018-11-09 11:17:43 -06:00
Gregory Nutt
b54ffe858a Standardization of some function headers. 2018-03-13 09:52:27 -06:00
Gregory Nutt
e4dd33280d Squashed commit of the following:
psock_close() and net_close() are internal OS functions and should not set the errno variable.

    psock_ioctl() and netdev_ioctl() are internal OS functions and should not set the errno variable.

    net_dupsd() and net_dupsd2() are internal OS functions and should not set the errno variable.

    net/ and fs/: net_vfcntl(), file_fcntl(), file_dup(), and file_dup2() are all internal OS interfaces and should not modify the errno value.
2017-09-30 10:41:21 -06:00
Gregory Nutt
8bf8c3fa86 Socket I/F: Add address family support for poll() and sendfile() 2017-07-14 10:57:38 -06:00
Gregory Nutt
d5207efb5a Be consistent... Use Name: consistent in function headers vs Function: 2017-04-21 16:33:14 -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
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
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
f4fcdcdb4d net/: Change some *err() message to *info() messages if what was a *dbg() message does not indicate and error condition. 2016-06-11 17:37:21 -06:00
Gregory Nutt
a1469a3e95 Add CONFIG_DEBUG_ERROR. Change names of *dbg() * *err() 2016-06-11 15:50:49 -06:00
Gregory Nutt
e99301d7c2 Rename *lldbg to *llerr 2016-06-11 14:55:27 -06:00
Gregory Nutt
86b79b33cf Reserver the name 'err' for other purposes 2016-06-11 14:40:07 -06:00
Gregory Nutt
fc3540cffe Replace all occurrences of vdbg with vinfo 2016-06-11 11:59:51 -06:00
Gregory Nutt
4f208600aa Replace confusing references to uIP with just 'the network' 2016-05-30 09:31:44 -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
Gregory Nutt
f348e68069 Update to use 64-bit timer when available 2016-01-21 11:54:26 -06:00
Gregory Nutt
6209c51206 net/: More clean-up of spacing/alignment issues 2015-10-08 15:10:04 -06:00
Gregory Nutt
0b12dbf95d Fix some spacing problems 2015-10-04 15:04:00 -06:00
Gregory Nutt
b1e09d4847 net/socket and net/tcp: Fix a problem in whent there are multiple network devices. Polls were being sent to all TCP sockets before. This is not good because it means that packets may sometimes be sent out on the wrong device. That is inefficient because it will cause retransmissions and bad performance. But, worse, when one of the devices is not Ethernet, it will have a different MSS and, as a result, incorrect data transfers can cause crashes. The fix is to lock into a single device once the MSS is locked locked down. 2015-08-27 09:06:46 -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
fca919f3d2 Networking: Fix some compilation issues noted with network is build with CONFIG_BUILD_KERNEL 2015-07-05 11:18:56 -06:00
Gregory Nutt
0ad53183e1 Networking: Fix a compile problem introduced in NuttX-7.6 when CONFIG_NET_SENDFILE=y 2015-06-24 14:52:57 -06:00
Gregory Nutt
04a661a97c TCP networking: Add support for network driver events 2015-05-30 09:12:27 -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
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
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
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
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
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
b36dbe1d89 Add logic to netdev_findbyaddr() to return the correct network device for the case where a broadcast address is used. This change caused trivial ripples through other files because additional parameters are required for netdev_findbyaddr() when CONFIG_NET_MULTINIC 2014-11-23 11:00:22 -06:00
Gregory Nutt
2e55db369d Network: All logic will now handle varialbe length link layer protocol headers within incoming packets. This permits use of multiple network interfaces with differing data links. For example, ETHERNET + SLIP 2014-11-15 13:13:23 -06:00
Gregory Nutt
6e04518e4a If CONFIG_NET_ARP_SEND is enabled, then all ICMP, TCP, and UDP send operations will call arp_send() before attempting the real send operation. arp_send() will check if the the IP address mapping is in the ARP table and, if not send ARP requests periodically until it is. This eliminates losing the first outgoing message because there is not mapping in the ARP table. 2014-08-18 16:22:14 -06:00
Gregory Nutt
caba61999a Remove CONFIG_DISABLE_CLOCK 2014-08-07 12:35:24 -06:00
Gregory Nutt
73f3ecf7e2 NET: Rename network interrupt event flags more appropriately: TCP_, UDP_, ICMP_, or PKT_ vs UIP_ 2014-07-06 17:22:02 -06:00
Gregory Nutt
9e87ab90b8 NET: Move private definitions from include/nuttx/net/arp.h to net/arp/arp.h 2014-07-06 11:05:28 -06:00
Gregory Nutt
c5fc24e110 NET: Standardize naming of all protocal header lengths 2014-07-05 13:04:48 -06:00
Gregory Nutt
a6b39d1879 NET: in-progress change... don't use 2014-07-04 16:38:51 -06:00
Gregory Nutt
cce35ce975 NET: More renaming 2014-07-04 15:40:49 -06:00
Gregory Nutt
77330679d4 NET: Rename uip_mss to tcp_mss 2014-06-30 19:09:23 -06:00