During socket setup, if one of the setsockopt() calls failed, the
function would return an error w/o closing the socket. That's wrong, as
in case of errors the function should clean up any resources it
allocated, the socket file descriptor is lost otherwise and resources
are leaked.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
We should return the errno value in such case, as ret will always be -1
on failure, which might misleading, as it does not give any hint on what
failed.
Also bump the log level of the error message, so the failure is visible
w/o needing to enable debug logs. Such a failure is fatal for the DNS
subsystem, so error level is justified here.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The `dns_data` buffer, allocated by the DNS dispatcher was dereferenced
twice - once in registered DNS handler, second time in the dispatcher
itself.
Since the buffer was allocated by the dispatcher, and it's not really
guaranteed that the buffer will be freed in the registered handler (this
depends on the processing outcome, the function may return early w/o
freeing the net buf in case of errors), it makes most sense for the
dispatcher to keep ownership of the buffer. Hence, the registered
handlers will no longer release the buffer provided in any case, and the
dispatcher will free it on exit.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Generally, we should avoid using reserved names in global
contexts.
subsys/net/lib/ptp/clock.c:58:25: \
error: 'clock' redeclared as different kind of symbol
58 | static struct ptp_clock clock = { 0 };
/opt/toolchains/zephyr-sdk-0.16.8/arm-zephyr-eabi/picolibc/ \
include/time.h💯12: \
note: previous declaration of 'clock' with type 'clock_t(void)' \
{aka 'long unsigned int(void)'}
100 | clock_t clock (void);
subsys/net/lib/ptp/clock.c:58:25: \
error: 'clock' defined but not used [-Werror=unused-variable]
58 | static struct ptp_clock clock = { 0 };
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
`lwm2m_engine_get_resource()` has been mark for deprecation for
more than 2 releases, but we are still using it in tree now,
because the `__deprecated` marker was probably forgotten in the
initial deprecation commit.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
For station and internal AP coexist case, station connected to
external AP, ping from station to external AP cause cpu hang.
Internal AP dhcpv4 server register handler echo_reply_handler
on icmp handler by net_icmp_init_ctx for dhcp server snoop
feature. Ping also register handler handle_ipv4_echo_reply on
icmp handler for ping cmd. If no external station connect to
internal AP, input parameter ‘user_data’ of function
echo_reply_handler is NULL. When we trigger ping process,
icmp_call_handlers fetch all handlers from icmp handler
if receive any ICMP packet, so echo_reply_handler be called,
but input parameter is NULL, cause CPU hang.
Add input parameters check to fix this issue.
Signed-off-by: Rex Chen <rex.chen_1@nxp.com>
Fill-in the mode field of the fd_entry so that the
implementation can be made aware that the specific file
descriptors created are sockets.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Allow DTLS handshake to be retried before the engine
drops into bootstrap. Otherwise any termporary failure,
for example DNS failure might drop us into bootstrap
without retrying.
Now all the retry logic should be in sm_do_network_error().
sm_do_registration() should only fall back to bootstrap
if there is configuration error.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
In case no Renewal/Rebinding times have been provided the server via
DHCP options, we should reset their values on ACK, so that the client
can recalculate the defaults. This is important, as the lease time may
change, so we should recalculate default T1/T2 timeout based on the new
lease time value.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
DHCP Request retransmission in RENEW and REBIND states was not
compliant with RFC2131.
The retransmission interval should not be calculated as in REQUESTING
state in such case, but rather calculated based on the remaining T2
or lease time (depending on current state).
RFC doesn't also mention any retransmission count limit for those
states. The client should retransmit the REQUEST until T2 or lease
expiry time are reached.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Adding network interface status monitor function. Depending
on the interface operation state and change of the state
events are generated and handled by the function.
Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
This commit adds implementation of the PTP thread that will
poll sockets descriptors and PTP Port's timeres for timeouts,
generate events and handle them and trigger STATE_DECISION_EVENT
handling when needed.
Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
The STATE_DECISION_EVENT in PTP is a pivotal mechanism that
facilitates dynamic state management within the protocol,
allowing devices to adapt their operational states based on the BTCA's
recommendations and the health of the network.
Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
Introduction of PTP stack's core functions responsible for
event generation and handling of these events. Events are generated
base on timeouts and/or PTP messages received via BSD sockets
assigned to a specific PTP Port. These function will be used
in PTP thread.
Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
The commit adds functions that enable and disable PTP Port.
This is going to be used by event handling routine.
Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
Timers are used to trigger message transmission and detect
inactivity of other PTP Clocks what should result in an action
of the PTP Port.
Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
This commit introduces routines for PTP message transmission.
It includes transmission of three types of messages (Announce,
Sync, Delay_Req) that should be send periodically depending
on the PTP Port's state.
Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
Introduction of routines processing received PTP Management messages.
The processing is split into clock-oriented and port-oriented parts.
Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
Add handler for STATE_DECISION_EVENT it consists of following routines:
- state decision algorithm
- best timeTransmitter clock algorithm
- data sets comparison algorithm
Based on IEEE 1588-2019 section 9.3.3
Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
This commit adds routines for handling incoming messages
needed for correct operation of the PTP stack in end to end
mode with multicast operation mode.
Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
Initial implementation of the clock adjustment and delay calculation.
Timestamp values used for calculations will be obtained from
proper PTP messages (Sync, Follow_Up, Delay_Req, and Delay_Resp)
Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
Foreign timeTransmitters are other PTP Clocks in a domain. They announce
their parameters via announce messages. PTP Ports should record
these foreign timeTransmitters.
Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
This commit introduces module responsible for sending and receiving
messages. It is based on BSD Sockets API.
Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
Add allocation of container used for TLVs and dummy functions for
preparing correct byte order of data. TLV stands for Type, Length,
Value, and it is extension of PTP messages that's used to transmit
extra information. This data is attached at the end of PTP message.
Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
Add functions preparing messages to network byte order before sending
and changing to host byte order after reception and before processing
by PTP stack.
Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
Add dynamic memory allocation for PTP messages. Memory allocation
is done with Zephyr's memory slab. It's size can be configured
with `PTP_MSG_POLL_SIZE` Kconfig symbol.
Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
Introduces definition of structures for all types of PTP messages
defined in the IEEE 1588-2019 standard.
Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
Based on IEEE 1588-2019 some of PTP Port states might not be used
if the option of 17.7 is implemented. This patch prepares state
machine implementation for such scenario.
Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
Implement possibility to configure PTP stack in TIME_RECEIVER_ONLY mode.
This restrics stack behaviour and doesn't allow for any PTP Port
of the PTP Clock become a TimeTransmitter Clock.
The change includes:
- Kconfig option
- Additional field in `struct ptp_port` structure
- New state machine function for a timeReceiver-only PTP Port.
- Extra steps in PTP Clock and PTP Port initialization.
New finite state machine is based on the figure 31
in section 9.2.5 of the IEEE 1588-2019.
Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
This commit introduces PTP Clock and PTP Port structures
and API for initializing PTP Clock and PTP Ports. Configuration
options has been added as Kconfig symbols to configure parameters
of the Clock and Ports at compile time.
Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
Datasets defined in the header file are going to be used
in PTP Clock's structure and PTP Port's structure. They
gather data into structures defined in IEEE 1588-2019.
Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
The patch brings implementationof a state machine for full
PTP implementation. It returns new PTP Port's state based
on event that occured and previous state.
Based on the figure 30 in section 9.2.5 of the IEEE 1588-2019.
Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
The header's file content is based on 5.3 section of
the IEEE 1588-2019 standard describing Precise Time Protocol (PTP)
used to synchronize devices in the network.
Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
This is an initial commit that introduces PTP library in the Zephyr.
It adds basic Kconfig symbols for enabling library, CMakeLists.txt
for compiling it, public header file, and initial PTP thread definition
and library initialization. Implementation of the functional PTP stack
will be introduced in following commits.
Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
Add returning timestamp of received packet in ancillary data buffer
in `msghdr` structure. This commit enables getting timestamp of
the received packet by calling `recvmsg()` function. The function
returns in the `msg_control` field timestamp if following criteria
are met:
- `CONFIG_NET_CONTEXT_TIMESTAMPING` is set
- `SO_TIMESTAMPING` socket option has `SOF_TIMESTAMPING_RX_HARDWARE`
option enabled for that socket
- driver used by sockets supports packet timestamping
Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
This is the last commit of the set of patches that introduces
`SO_TIMESTAMPING` socket level optino in Zephyr. The patch
adds `SOF_TIMESTAMPING_RX_HARDWARE` and `SOF_TIMESTAMPING_TX_HARDWARE`
bitmasks. It can be extedned in the future to cover more timestamping
features. Currently the feature can be used with ptp_clock driver.
Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
Add proper PSA_WANT kconfigs for TLS sockets and RSA key exchanges
when CONFIG_PSA_CRYPTO_CLIENT is set.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
In case we want to immediately send empty Ack to server,
we should bypass all send queues.
This is required when we try to send Ack from callbacks
that happen from socket-loop context. On those cases
the Ack would have not been send because the callback
might be blocking the socket-loop while processing
a request (like write callbacks).
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
If network socket tracing is enabled, then the system will track
various socket API calls for usage.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add descriptions for recently introduced IPv4 and IPv6
connectivity events to the net event monitor.
Signed-off-by: Georges Oates_Larsen <georges.larsen@nordicsemi.no>
In case a conflict was detected on a DHCP-assigned address, send a
Decline message to the server and start over.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
In case IPv4 conflict detection is enabled, monitor network events to
determine whether IPv4 address is ready to use or not, so that the
library returns only after the network setup is fully complete.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
When we receive CoAP packets, it is in input buffer
that is size of NET_IPV6_MTU.
So in reality, we can handle bigger Block-Wise writes
than CONFIG_LWM2M_COAP_BLOCK_SIZE.
So if parsing of CoAP packet has passed, continue
with the same block-size instead of going to default.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Until recently, the posix api was purely a consumer of the
network subsystem. However, a dependency cycle was added as
a stop-gap solution for challenges with the native platform.
Specifically,
1. eventfd symbols conflict with those of the host
2. eventfd was excluded from native libc builds via cmake
If any part of the posix were then to select the network
subsystem (which is a legitimate use case, given that networking
is a part of the posix api), we would get a build error due to
the Kconfig dependency cycle.
As usual, with dependency cycles, the cycle can be broken
via a third, mutual dependency.
What is the third mutual dependency? Naturally, it is ZVFS
which was planned some time ago. ZVFS will be where we
collect file-descriptor and FILE-pointer APIs so that we can
ensure consistency for Zephyr users.
This change deprecates EVENTFD_MAX in favour of
ZVFS_EVENTFD_MAX.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
The POSIX_MAX_FDS option does not correspond to any standard
POSIX option. It was used to define the size of the file
descriptor table, which is by no means exclusively used by
POSIX (also net, fs, ...).
POSIX_MAX_FDS is being deprecated in order to ensure that
Zephyr's POSIX Kconfig variables correspond to those defined in
the specification, as of IEEE 1003.1-2017. Namely,
POSIX_OPEN_MAX. CONFIG_POSIX_MAX_OPEN_FILES is being deprecated
for the same reason.
To mitigate any possible layering violations, that option is
not user selectable. It tracks the newly added
CONFIG_ZVFS_OPEN_MAX option, which is native to Zephyr.
With this deprecation, we introduce the following Kconfig
options that map directly to standard POSIX Option Groups by
simply removing "CONFIG_":
* CONFIG_POSIX_DEVICE_IO
Similarly, with this deprecation, we introduce the following
Kconfig options that map directly to standard POSIX Options by
simply removing "CONFIG":
* CONFIG_POSIX_OPEN_MAX
In order to maintain parity with the current feature set, we
introduce the following Kconfig options.
* CONFIG_POSIX_DEVICE_IO_ALIAS_CLOSE
* CONFIG_POSIX_DEVICE_IO_ALIAS_OPEN
* CONFIG_POSIX_DEVICE_IO_ALIAS_READ
* CONFIG_POSIX_DEVICE_IO_ALIAS_WRITE
Gate open(), close(), read(), and write() via the
CONFIG_POSIX_DEVICE_IO Kconfig option and move
implementations into device_io.c, to be conformant with the
spec.
Lastly, stage function names for upcoming ZVFS work, to be
completed as part of the LTSv3 Roadmap (e.g. zvfs_open(), ..).
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
The POSIX_CLOCK option does not correspond to any standard
option. It was used to active features of several distinct
POSIX Options and Option Groups, which complicated API and
application configuration as a result.
POSIX_CLOCK is being deprecated in order to ensure that Zephyr's
POSIX Kconfig variables correspond to those defined in the
specification, as of IEEE 1003.1-2017.
Additionally, CONFIG_TIMER is being deprecated because it does
not match the corresponding POSIX Option (_POSIX_TIMERS).
With this deprecation, we introduce the following Kconfig
options that map directly to standard POSIX Option Groups by
simply removing "CONFIG_":
* CONFIG_POSIX_TIMERS
Similarly, we introduce the following Kconfig options that
map directly to standard POSIX Options by simply removing
"CONFIG":
* CONFIG_POSIX_CLOCK_SELECTION
* CONFIG_POSIX_CPUTIME
* CONFIG_POSIX_DELAYTIMER_MAX
* CONFIG_POSIX_MONOTONIC_CLOCK
* CONFIG_POSIX_TIMEOUTS
* CONFIG_POSIX_TIMER_MAX
In order to maintain parity with the current feature set, we
introduce the following Kconfig options that map directly to
standard POSIX Option Groups by simply removing "CONFIG_":
* CONFIG_POSIX_MULTI_PROCESS - sleep()
Similarly, in order to maintain parity with the current feature
set, we introduce the following additional Kconfig options that
map directly to standard POSIX Options by simply removing
"CONFIG":
* CONFIG_XSI_SINGLE_PROCESS - gettimeofday()
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
The chunked response was not sent properly. There were extra
"\r\n" before the chunk lenght and the length of the string
to be sent was calculated incorrectly.
Fixes#72887
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
When calculating the offset for blockwise writes,
we should not advance the block_ctx->current field
past the block boundary.
It causes CoAP layer to reply with the next NUM field
instead of the current one being processed.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Instead of printing either A or AAAA resource query type,
print the correct query type value.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Do not depend on init level but start the socket service
already in net core init because DNS init code depends on
socket service API to be ready to serve. And we call DNS
init at the net core init.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Allow mDNS resolver and responder to to be used at the same
time so that both can use the port 5353. This requires
a DNS traffic dispatcher which affects also the normal DNS
resolver.
Fixes#72553
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
In an effort to shave off code size, remove out-of-the-box
enabling of crypto features (except SHA-256).
Configurations are adjusted to enable what they need.
Bonuses:
- When enabled, AES now defaults to using a smaller version
(`CONFIG_MBEDTLS_AES_ROM_TABLES` isn't default enabled anymore,
and if enabled, `CONFIG_MBEDTLS_AES_FEWER_TABLES` defaults to y).
- Conditions around Mbed TLS Kconfig options have been improved
to reflect the reality of the dependencies.
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
Allow user to specify resource string using wildcard characters
so that multiple URL paths can be served with just one handler.
Fixes#73367
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add option for setting a random MAC address to
the net iface set_mac command. With random option
a random MAC address can be assigned to an interface.
Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
In order to be compatible with Linux AF_PACKET socket calls, the
protocol field needs to be in network byte order.
So for example, if user wants to receive all packets, then the
protocol field needs to be set as "htons(ETH_P_ALL)".
See Linux manual page at
https://www.man7.org/linux/man-pages/man7/packet.7.html
for details.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
When tests control the LwM2M client entirely through
shell, we should be able to set the RD client context
from the application without causing RD client to
start registration.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Remove the `_MAC` part because those Kconfig options enable only hash
algorithms, nothing MAC-related, and the `_ENABLED` part to align the
naming to the Mbed TLS defines (plus we don't need such a part).
As a bonus, enabling SHA-256 does not automatically enable SHA-224
anymore.
See the migration guide entries for more details on the practical
changes.
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
Namespaced the generated headers with `zephyr` to prevent
potential conflict with other headers.
Introduce a temporary Kconfig `LEGACY_GENERATED_INCLUDE_PATH`
that is enabled by default. This allows the developers to
continue the use of the old include paths for the time being
until it is deprecated and eventually removed. The Kconfig will
generate a build-time warning message, similar to the
`CONFIG_TIMER_RANDOM_GENERATOR`.
Updated the includes path of in-tree sources accordingly.
Most of the changes here are scripted, check the PR for more
info.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
When opaque resources have post-write callback set, but
the write is not a Block-Wise write, there is no block_ctx
and the code causes null pointer dereference when calculating
the offset of the data.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Add checks to make sure that we are not trying to use the socket
service library with eventfd if CONFIG_POSIX_API is not set and if
using native_sim based board. The reason is that we should always
use zephyr libc based eventfd implementation instead of host libc one.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This reverts commit b56297bf16
because it is causing problems when using native_sim and not
having CONFIG_POSIX_API set.
The proper fix is to set CONFIG_POSIX_API when using eventfd
and native_sim so that picolibc is used instead of host libc.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The socket allocation count was incorrectly calculated as
we have only one socket per listened port.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
If DNS_EAI_ALLDONE is returned, it indicates that the request
was done and should not be considered an error.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
When the interface goes down, the safest thing to do is to return to
the INIT state, as there is no guarantee that any state is preserved
upon the interface coming back up again.
This is particularly the case with WiFi.
Signed-off-by: Jordan Yates <jordan@embeint.com>
An earlier pull request implementing observe support was merged too
hastily. It had a few issues:
1. The predicate for whether a request should be marked not ongoing was
wrong (it checked ret != 0 instead of ret < 0)
2. Without observes in mind, MID-based deduplication is not a required
feature. Deduplication was handled implicitly - the exchange would get
dropped after the first response anyway, so duplicate responses would
not get matched to anything. But with observes, there are several
responses in an exchange. This commit adds this.
3. Using coap_request_is_observe(&internal_req->request) in the response
handler requires the whole request to stay in scope for the lifetime of
the observation, which I observed was not always the case. Adding an
is_observe bool to the internal struct improved stability significantly.
With these fixes, GETs with observe option works very well.
Signed-off-by: Benjamin Lindqvist <benjamin@eub.se>
With native_sim, this error is seen a lot when socket
service API is used.
<dbg> net_sock: get_sock_vtable: (net_socket_service):
Invalid access on sock 3 by thread 0x807a8e0 (net_socket_service)
If we just ignore the error, then we might get into forever
loop which is not good. So if this happens, mark the eventfd
fd as not pollable to basically ignore the eventfd support in
this case.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Print also thread name when printing socket access error.
This helps debugging what thread caused it.
Lowering the Error to Debug as we could be missing vtable
for example for eventfd descriptors, this is easily seen when using
socket service API.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Instead of using net_context API directly, the LLMNR responder is
changed to use the socket service API. This allows DNS access
for offloaded sockets and can lower overall memory consumption.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Instead of using net_context API directly, the mDNS responder is
changed to use the socket service API. This allows DNS access
for offloaded sockets and can lower overall memory consumption.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Instead of using net_context API directly, the DNS resolver is
changed to use the socket service API. This allows DNS access
for offloaded sockets and can lower overall memory consumption.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Improve coap_client_cancel_requests(). Ensure it can be
called from a callback. Report error to waiting callbacks.
Clear active flag.
This is useful when the network becomes unavailable
or prior to disconnecting in order to save power.
Signed-off-by: Pete Skeggs <peter.skeggs@nordicsemi.no>
Fixes remote address for ping before upload. This caused the ping in zperf
upload to timeout as shown in the following output:
```
uart:~$ zperf udp upload 2001:db8::2 5001 10 50 1M
Remote port is 5001
Connecting to 2001:db8::2
Duration: 10.00 s
Packet size: 50 bytes
Rate: 1000 kbps
Starting...
ping 2001:db8::2 timeout
Rate: 1.00 Mbps
Packet duration 390 us
```
Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/68674
Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
Allow Block-Wise writes to resources that have enough buffer for
the whole content. Calculate the offset before calling the
content specific write handlers when callback is not set.
Previously only resources with post-write callback were able to
assemble the content.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
When Block-Wise transfer restarts, the post-write callback should
receive some indication that the block is actually a beginning of new,
instead of part of previous transfer.
Fixes#71351
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
The new command is "net http" which shows all services and
related resources defined in the system.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Doing a normal close for a websocket does not close the underlying
real socket. If we do not have fd for the real socket, then it is
not possible to fully close a websocket connection. As we are allocating
a websocket using websocket_register() in HTTP server use case,
create a websocket_unregister() that will close both the real
socket and the websocket socket.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add option for zperf tcp upload that will enable periodic result reporting.
This is useful for monitoring performance swings during a longer session.
Signed-off-by: Adam Matus <adam.matus@nxp.com>
TCP nodelay option is part of zperf upload params, but was not being
set in common zperf_prepare_upload_sock function. Move it there
to align with how other options are set.
Signed-off-by: Adam Matus <adam.matus@nxp.com>
TLS socket have now been in Zephyr for a few years already and are
widely adopted across the codebase. Given above, they should no longer
be considered an experimental feature.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Moving toward the adoption of PSA crypto APIs, TinyCrypt is going
to be deprecated so we can remove it in favor of newer APIs.
Moreover tls_credentials is mostly meant to store data in the
protected storage meaning that there is a TFM implementation
providing this service. The same TFM can of course be used to
compute sha256 hashing thus saving memory footprint on the NS
side by removing TC.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
When using the TLS_CREDENTIALS_BACKEND_PROTECTED_STORAGE there is
BUILD_WITH_TFM enabled which means that we can take advantage of
TFM (thorugh PSA interface) to compute the SHA256 hash.
This removes the need for the built-in implementation of
mbedtls_sha256() on the non-secure image (unless it's used somewhere
else, of course) and therefore it helps in reducing the memory
footprint.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>