Jiuzhu Dong
d64d558adb
get/setsockopt: change break to return OK to fix bug
...
N/A
Change-Id: Ie5ecf640bcba6137904fcf3a0a465b2bc5d1cb92
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-04-09 23:17:48 +08:00
Xu Xingliang
f8c5fe24fb
net: Forward socket option only when the socket type is usrsock
...
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
Change-Id: I5e102c4c648936f96834120e2c508f7072436246
2021-04-09 16:58:55 +08:00
chao.an
2919001e3e
net/tcp: do not start the tcp monitor if unestablished
...
Change-Id: Iace9ccfc73086db442db04b95bc508dd48827b82
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-03-19 11:11:40 +08:00
Jiuzhu Dong
7a6a1c1f42
fs: allocate file/socket dynamically
...
MIRTOS-273
Change-Id: I8aea63eaf0275f47f21fc8d5482b51ffecd5c906
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-03-17 21:15:26 +08:00
dongjiuzhu1
bb65de6cae
net: unify socket info file descriptor
...
MIRTOS-255
Change-Id: Iee680c8ac07fe87fb6e7900b4f792e0f1ff5036d
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-03-03 22:23:44 +08:00
Peter Bee
a2a31c735e
net/socket: move si_send/recv into sendmsg/recvmsg
...
MIRTOS-272
Implement si_send/sendto/recvfrom with si_sendmsg/recvmsg, instead of
the other way round.
Change-Id: I7b858556996e0862df22807a6edf6d7cfe6518fc
Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2021-03-02 17:33:01 +08:00
ligd
df76063a35
Revert "net: unify socket info file descriptor"
...
This reverts commit 27b332283e .
2021-02-26 10:21:02 +08:00
Jiuzhu Dong
27b332283e
net: unify socket info file descriptor
...
N/A
Change-Id: I9bcd21564e6c97d3edbb38aed1748c114160ea36
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-02-25 16:53:58 +08:00
ligd
fe996fc69c
socket_rpmsg: add socket rpmsg support
...
N/A
Change-Id: I1e18a0b3d643e5b74b86624ef245f19ef616bc61
Signed-off-by: ligd <liguiding1@xiaomi.com>
2020-12-04 20:36:24 +08:00
chao.an
d45b4324ab
net/sockopt: Try usrsock further if the protocol not available
...
fallback to usrsock if the features are not implemented locally
Change-Id: I46e2d6452d7edd3fa5b3d508945511cd48f22ebb
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-01 20:08:40 +08:00
chao.an
753ecb6ae1
net/sockopt: fix invalid option set
...
fix invalid option set if enable UDP without TCP
Change-Id: I732893501a9b28749706d6f860c77ae9e14b358c
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-01 20:08:35 +08:00
YAMAMOTO Takashi
3297c09d58
net/socket/send.c: Fix a syslog format error
2020-11-20 22:22:53 -08:00
Matias N
5386f972fa
bluetooth: Add support for HCI RAW channel; make host layer optional
2020-10-25 17:04:25 -07:00
Brennan Ashton
1080d3f411
Bluetooth: Start implementing BTPROTO_HCI socket support
...
Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
2020-10-25 17:04:25 -07:00
Xiang Xiao
b0797263ca
libc/stdio: Allocate file_struct dynamically
...
1.Reduce the default size of task_group_s(~512B each task)
2.Scale better between simple and complex application
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ia872137504fddcf64d89c48d6f0593d76d582710
2020-09-11 17:58:17 +08:00
Xiang Xiao
ae356001cf
Change all files come from Xiaomi/Pinecone to Apache License 2.0
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-22 17:37:21 -06:00
chao.an
e5f6dafe1f
net/socket: add SOCK_CLOEXEC/SOCK_NONBLOCK support
...
Reference here:
https://github.com/torvalds/linux/blob/master/include/linux/net.h
Change-Id: I9fd0170bcd1ae7e778e951d454ada76f63854de5
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-08-17 23:38:18 -05:00
SPRESENSE
76c87d2f85
net/socket: Fix nxstyle issue
2020-07-22 11:41:53 +01:00
SPRESENSE
5ee0432d6f
net/socket: Fix sanity checking of socket interface
...
No error occurs even if NULL is set in the input argument
of socket API. So added an argument check process.
2020-07-22 11:41:53 +01:00
chao.an
e7f2dc8173
net/sockopt: change the socket option style from Linux to BSD
...
Linux Programmer's Manual
...
IP(7)
...
NOTES
...
Using the SOL_IP socket options level isn't portable;
BSD-based stacks use the IPPROTO_IP level.
Change-Id: I63ea5ec7714481b5201608ec4449e522e2be3da2
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-06-30 18:49:58 -03:00
chao.an
d6a0da41d5
net/vfcntl: fix nxstyle warning
...
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-06-24 13:48:41 +01:00
chao.an
f56e0e004b
fs/setfd: correct the return value
...
Change-Id: I766f3760e7167a579b73673c44b70847ee06850b
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-06-24 13:48:41 +01:00
Ouss4
155903fc54
net/can/can.h: Add can_setsockopt and can_getsockopt prototypes.
2020-06-15 12:20:32 -06:00
Gregory Nutt
5e6d9944d7
net/socket/getsockopt.c: Eliminate warning
...
##[error]socket/getsockopt.c:362:7: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized]
int ret;
^~~
2020-06-15 16:10:47 +01:00
Peter van der Perk
55d9e5f7af
net: Add SocketCAN support
2020-06-15 08:07:19 -06:00
Gregory Nutt
154a87993f
fs/vfs/fd_open.c: fs_fdopen() must not set errno
...
Functions within the OS must never set the errno value. fs_fdopen() was setting the errno value. Now, after some parameter changes, it reports errors via a negated errno integer return value as do most all other internal OS functions.
2020-05-23 15:22:09 +08:00
chao.an
03f462c5cd
net/sockopt: fix nxstyle warning
...
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-05-14 07:53:15 -06:00
chao.an
608436a75f
net/sockopt: do not set the errno to SO_ERROR
...
SO_ERROR is used to report asynchronous errors that are the result
of events within the network stack and not synchronous errors that
are the result of a library call(send/recv/connect)
Synchronous results are reported via errno.
Linux Programmer's Manual
...
NAME
getsockopt, setsockopt - get and set options on sockets
...
RETURN VALUE
...
On error, -1 is returned, and errno is set appropriately
Change-Id: I1a1a05a684dff8672aaf47eabee157ac0d275c2d
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-05-14 07:53:15 -06:00
Xiang Xiao
517974787f
Rename clock_systime[r|spec] to clock_systime_[ticks|timespec]
...
follow up the new naming convention:
https://cwiki.apache.org/confluence/display/NUTTX/Naming+of+OS+Internal+Functions
2020-05-10 14:35:50 -06:00
Gregory Nutt
4b44b628ea
Run nxstyle against all .c and .h files modified by this PR.
...
All complaints fixed except for those that were not possible to fix:
- Used of Mixed case identifier in ESP32 files. These are references to Expressif ROM functions which are outside of the scope of NuttX.
2020-05-09 14:19:08 -03:00
Gregory Nutt
a4218e2144
include/nuttx/sched.h: Make naming of all internal names consistent:
...
1. Add internal scheduler functions should begin with nxsched_, not sched_
2. Follow the consistent naming patter of https://cwiki.apache.org/confluence/display/NUTTX/Naming+of+OS+Internal+Functions
2020-05-09 14:19:08 -03:00
Xiang Xiao
b7d922960f
Fix nxstyle issue
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-08 07:20:49 -06:00
Xiang Xiao
390f9a5fb7
fs/vfs: Add nx_dup and nx_dup2 function
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-04 07:20:02 -06:00
Gregory Nutt
9400cf2cd1
sched/group: On task creation, do not clone uninitialized descriptors.
...
Sockets are created in two steps:
1. The socket is allocated, then
2. The socket is initialized.
In SMP mode, there is a possibility that a pthread executing one CPU may create a new task while a pthread on another CPU has allocated the socket but not yet initialized it. This commit updates the socket clone test to assure that the socket is both allocated and initailized.
Without the change, it is possible that uninitialized sockets could be cloned, leading to errors later in the newly started task.
2020-04-28 21:27:05 +01:00
chao.an
0376cddd6d
net: move the _SF*/_SS* definitions to net.h
...
Build break caused by 23b8b39799
2020-03-04 21:37:34 -06:00
Xiang Xiao
cde88cabcc
Run codespell -w with the latest dictonary again
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-02-23 22:27:46 +01:00
Xiang Xiao
8c8771a29d
net/socket: Don't skip return -ENETDOWN in usrsock case
...
Fix the below error in usrsocktest:
Testing group "WakeWithSignal" =>
[TEST ASSERT FAILED!]
In function "do_usrsock_blocking_socket_thread":
line 122: Assertion `(ssize_t)((*get_errno_ptr())) == (ssize_t)((115))' failed.
got value: 123
should be: 115
[TEST ASSERT FAILED!]
In function "do_wake_test":
line 567: Assertion `(bool)((usrsocktest_test_failed)) == (bool)(false)' failed.
got value: 1
should be: 0
Group "WakeWithSignal": [FAILED]
2020-02-22 07:30:58 -06:00
Masayuki Ishikawa
e9fe1f84af
net: socket: Enable parameter check (addr and addrlen) in getsockname.c
...
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-02-21 01:43:12 -06:00
chao.an
d07afc934e
fcntl: add O_CLOEXEC/FD_CLOEXEC support
2020-02-20 08:20:38 -06:00
Xiang Xiao
c1b0aa118c
Remove psock_send and sockfd_socket from net/socket/socket.h
...
Since both is already declared in include/nuttx/net/net.h and fix other minor issue in network socket layer.
2020-01-31 13:45:15 -06:00
Xiang Xiao
0fc7668d65
sendto should always call send if to == NULL || tolen <= 0
...
Since UDP socket may bind the target with connect call
2020-01-31 13:45:15 -06:00
Xiang Xiao
7e67add999
Implment SO_ACCEPTCONN
2020-01-31 13:45:15 -06:00
Xiang Xiao
cf2ddbb2b1
Replace set_errno to _SO_SETERRNO
...
Missed in a previous commit
2020-01-31 13:45:14 -06:00
Xiang Xiao
6e6c670190
Move _SF_BOUND and _SF_CONNECTED modification to common place
2020-01-31 13:45:14 -06:00
Xiang Xiao
709dc19350
Move the lock from psock_release to sockfd_release
...
Since the kernel psock doesn't bind to any socketlist
2020-01-31 13:45:14 -06:00
Xiang Xiao
0b860726db
Ensure psock_socket and psock_accept initialize s_crefs to 1
...
This simplifies the caller usage
2020-01-31 13:45:14 -06:00
Xiang Xiao
9f9566c0eb
Rename net_clone/net_dupsd[2] to psock_dup2/net_dup[2] like vfs
2020-01-31 13:45:14 -06:00
Xiang Xiao
68951e8d72
Remove exra whitespace from files ( #189 )
...
* Remove multiple newlines at the end of files
* Remove the whitespace from the end of lines
2020-01-31 09:24:49 -06:00
Juha Niskanen
a762c06ed9
Fix typos and some incorrect comments
...
Author: Alan Carvalho de Assis <acassis@gmail.com>
Run nxstyle against .c and .h files and fix it
Author: Juha Niskanen <juha.niskanen@haltian.com>
Fix typos and some incorrect comments
2020-01-20 09:32:36 -03:00
patacongo
51cbc85535
net/: Run current nxstyle against all .c files under net/. Correct new problems identified by nxstyle. This is primarily a verification of the nxstyle changes (which all look good). ( #89 )
...
Co-authored-by: Gregory Nutt <gnutt@nuttx.org>
2020-01-12 21:17:29 +01:00