Rename shadow variables found by -Wshadow, as the ones in
the macros have a tendency to conflict with outer scope ones
when used. So they need to be more descriptive.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
There are a few structs, unions, and enums where -Wshadow would
complain. Since names being the same are intentional, we need
to tell compiler to ignore -Wshadow for those names.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Add test to verify that
1) A peripheral role cannot initiate an encryption pause
2) A peripheral role rejects a LL_PAUSE_ENC_REQ while a CIS is
established
Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
Changes the lvgl filesystem `tell()` wrapper to check for errors returned
by zephyr filesystem subsystem.
Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
Changes the memory management for the lvgl filesystem wrapper to use the
memory management strategy selected by kconfig. Additionally fixes memory
leaks if fs_{file,dir}_t initialization failed.
Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
For some weird reasons, if the sections in linker script are not
in memory address order, there are lots of padding involved in
zephyr_pre0.elf. This moves the .intList section to its memory
ordered location. When building hello_world, this shrinks
zephyr_pre0.elf from 512MB to 339KB.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Implemented testcase to check if the retransmitted FIN packet
from the FIN1 state has the correct sequence number.
Also fix the endianness conversion of sequence numbers in the
tests to use 32-bit as it should instead of 16-bit.
Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
After the TCP socket has been closed, it should not accept any new data
and send a RST packet if it does receive some.
Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
When the application closes the connection, it enters the FIN1 state.
Restructure this sequence to RST on data received after the application
has closed the socket.
Next to that deal with packets that contain both data and a FIN flag.
Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
As the metadata has to be validated anyway, let the initial vaidation of
metadata to be done in ASCS. The application can still reject the
metadata, but the length validation and supported type validation can be
performed by the stack.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
For some reason, tests/net/socket/tcp/net.socket.tcp.preempt
was failing to link for vmu_rt1170 with these changes, and
for some reason reducing CONFIG_POSIX_MAX_FDS from 20 to 10
resolves that issue.
ld.bfd: scripts/build/gen_kobject_placeholders.py \
did not reserve enough space for kobject rodata.
Memory region Used Size Region Size %age Used
FLASH: 287860 B 64 MB 0.43%
RAM: 86460 B 512 KB 16.49%
OCRAM: 0 GB 256 KB 0.00%
OCRAM1: 0 GB 512 KB 0.00%
OCRAM2: 0 GB 512 KB 0.00%
ITCM: 0 GB 256 KB 0.00%
DTCM: 13908 B 256 KB 5.31%
IDT_LIST: 0 GB 2 KB 0.00%
collect2: error: ld returned 1 exit status
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
The FIONREAD ioctl (or rather ZFD_IOCTL_FIONREAD) returns the
number of bytes available on the socket that can be read
immediately.
Test that the ioctl behaves according to the expectation.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
Add an `after()` function that is executed after each test in
the testsuite.
Previously, even if one one test failed, it would calls almost
all subsequent tests to fail. This way, other tests can still
succeed.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
Add an `after()` function that is executed after each test in
the testsuite.
Previously, even if one one test failed, it would calls almost
all subsequent tests to fail. This way, other tests can still
succeed.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
The FIONREAD ioctl (or rather ZFD_IOCTL_FIONREAD) returns the
number of bytes available on the socket that can be read
immediately.
Test that the ioctl behaves according to the expectation.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
A fair bit of setup / teardown code was being duplicated in many
test cases in the socketpair testsuite.
Take advantage of the `setup()`, `before()`, and `after()`
functions in the new ZTest API.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
The `ioctl()` interface is already supported by the network
subsystem but there was no `zsock_` interface available for it.
Add the `zsock_ioctl()` syscall.
Implement two somewhat commont ioctl requests for socket
file descriptors; namely
- `FIONBIO` set non-blocking I/O mode
- `FIONREAD` get the number of available bytes
In the process, added `net_pkt_ip_proto_hdr_len()`
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
In order to get a semi-accurate assessment of how many
bytes are available on a socket prior to performing a read,
BSD and POSIX systems have typically used
`ioctl(fd, FIONREAD, &avail)`
We can support this in Zephyr as well with little effort, so
add support for `socketpair()` sockets as an example.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
Rather than defining FIONBIO and FIONREAD at the POSIX layer,
define them at the Zephyr layer, in the Zephyr namespace, and
make the POSIX layer a simple wrapper.
This facilitates having a common dependency between POSIX and
networking rather than a cyclic one.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
Rather than defining these constants in the POSIX layer,
define them in the Zephyr layer, and make the POSIX layer a
simple wrapper.
This will allow the POSIX layer and networking to have a
common dependency rather than a cyclic one.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
Previously, if a net_context had multiple packets already in
the receive queue, and a call to zsock_recvfrom() was made with
a buffer large enough to receive content from multiple packets,
only the content from a single receive buffer would be received.
Since zsock_recvfrom() is a system call, which has a
non-negligible overhead, it makes sense to receive as many bytes
as possible per system call.
Add zsock_recv_stream_immediate() as a shorthand for
"fill this receive buffer with as many bytes as possible without
blocking". Allow nullable buffer parameters so that we can also
have a shorthand for "count how many bytes are immediately
available".
With minor refactoring, zsock_recv_stream_timed() is a simple
wrapper around zsock_recv_stream_immediate() that handles timing
and error conditions.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
Add shell commands to setup, disable, install timeout and feed a
watchdog device.
These commands reflect watchdog API.
Signed-off-by: Benjamin Lemouzy <blemouzy@centralp.fr>