This commit introduces a new IPv6 API for positive reachability
confirmation, as specified in RFC 4861, Section 7.3.1. This feature aims
to enhance the effectiveness of the Neighbor Discovery mechanism, by
enabling upper-layer protocols to signal that the connection makes a
"forward progress".
The implementation within TCP serves as a reference. Compliance with
RFC 4861, especially Appendix E.1, was ensured by focusing on reliable
handshake and acknowledgment of new data transmissions.
Though initially integrated with TCP, the API is designed for broader
applicability. For example, it might be used by some UDP-based protocols
that can indicate two-way communication progress.
Signed-off-by: Łukasz Duda <lukasz.duda@nordicsemi.no>
We cannot always start the service monitor thread statically
because the static threads are started after the application
level. This means that when config library wants to start
dhcpv4 server which uses socket services, there would be a
deadlock. Simplest solution is to start the service thread
directly from socket service init function.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Not only check if the address pool belongs to the same subnet as the
server, but also that it does not overlap with the server address -
otherwise the server might end up assigning its own address.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
As connectivity backends need to be bound in the same file that the
`net_if` is created in, define a common backend type for WiFi modems.
All WiFi modems should be controllable through the `wifi_mgmt` API, so
there should be no need for dedicated context.
When enabled, the particular implementation to be used is chosen through
`CONNECTIVITY_WIFI_MGMT_IMPL`. For now, the only choice is an
application defined backend.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
For a Wi-Fi station the connect API supports both band and channel
configuration, but for a shell command either channel or band makes
sense, so, overload the channel field to support band.
Rejig the band and channel validation to support all modes.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Adds an option to disable the automatic initialization of the default
dns_context. This lets applications use the default context, while also
managing the `init` and `close` functions.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
ICMPv4/6 modules print error when ICMP message handling fails, which
includes no message handler registered. This is a bit problematic, as
there are many ICMP messages that Zephyr does not process, and every
time such a message is received, an error log is printed (which wasn't
the case before ICMP rework).
Restore the old behavior (no log on unrecognized ICMP message) by
explicitly filtering out ENOENT error code from printing error. That
way, log will only be printed if an error occured within the actual
message handler.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
As discussed during DHCPv4 server integration, group DHCPv4 client files
with DHCPv4 server in a single lib directory.
Renamed internal "dhcpv4.h" header to "dhcpv4_internal.h" so that it's
not confused with the public "dhcpv4.h" header.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The net-shell printed virtual interface name so that it got
the impression it was the network interface name which is not
correct. Now the name is printed as "Virtual name" which is
unambiguous.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
If IPv6 is not enabled for the interface, then do not try to
join the IPv6 solicited multicast address.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The ratio between mbps and kbps, kbps and bps should be 1000, instead of
1024, as common sense.
The wrong ratio will decrease the Zperf throughput result.
Signed-off-by: Fengming Ye <frank.ye@nxp.com>
Make sure that scan band string is properly terminated when
parsing user supplied string.
Fixes: #67944
Coverity-CID: 342930
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
When ENABLED flag is used, we generate 32 byte DTLS
Connection Identifier and include that in our
DTLS Client HELO. This has no benefit as client only
has one connection toward the server, it does not need
any identification.
When SUPPORTED flag is used, we just include
zero length Connection Identifier in the handshake,
which tell server that we support Connection Identifier
and server can generate one for it.
We then use the CID in the packets that we send towards
server, but response packets don't contain any CID.
This gives all the benefit of CID as server is able to
identify us even when NAT mapping have changed.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Add command to query to WiFi driver/firmware revision. The API is expected
to return the firmware revision and driver version as a string, and can be
used by the user to determine what revision of the WiFi driver is in use.
Signed-off-by: Sandip Dalvi <sandip.dalvi@nxp.com>
Instead of relaying on those macros having been defined
somewhere else let's define them for this file.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Now that we are using the shell macro to enforce argument count check,
both mandatory and optional arguments, these additions checks are
unnecessary.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Add macro that allows registration of initialization functions that
are called when LwM2M engine starts.
On LwM2M engine starts up, it first executes all initialization
functions in following priority order:
1. LWM2M_PRIO_ENGINE
2. LWM2M_PRIO_CORE, this is where all LwM2M core objects are initialized
3. LWM2M_PRIO_OBJ, this is where all other objects are initialized
4. LwM2M_PRIO_APP, application initialization.
Now on the initialization phase, we could rely that certain objects have
already been registered.
For example custom objects can register callbacks to core objects.
On application phase, we can initialize sensor objects and register
their callbacks because objects have already been initialized.
This LWM2M_ON_INIT() should replace all use of SYS_INIT()
with the default CONFIG_KERNEL_INIT_PRIORITY_DEFAULT.
Priority order is actually just alphabetical order of names, so
the order is set on a linkin phase, and we don't need any
runtime checking for it.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Remove TX-Injection and Promiscuous mode setting from Wi-Fi mode shell
command. These commands are being moved to ethernet l2 layer
Signed-off-by: Vivekananda Uppunda <vivekananda.uppunda@nordicsemi.no>
This set of changes brings in raw packet tx injection mode
feature to ethernet and removes it from being a Wi-Fi only feature.
It was earlier envisaged as Wi-Fi net management feature only.
Signed-off-by: Vivekananda Uppunda <vivekananda.uppunda@nordicsemi.no>
If bootstrap fails, RD client will call lwm2m_engine_stop()
which will close the context.
The socket loop, however still contains a call to
hint_socket_state(context, NULL) which has a null pointer now.
Fix the segfault by allowing nullpointer on hint_socket_state().
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Implement DHCPv4 shell module, which allows to start/stop DHCPv4 server
operation, and print server status (address leases).
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Increase socket services thread default stack size when DHCPv4 server is
enabled, as it uses synchronous processing.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
So that it's possible to register ARP entries manually. Needed for DHCP
server implementation, which in unicast mode needs to reply to an IP
address that is not registered on the peer interface yet (hence no ARP
reply will be sent). It's needed to add an ARP entry manually in that
case, as hardware address is already known at that point.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Add new kconfig CONFIG_LWM2M_QUEUE_MODE_NO_MSG_BUFFERING.
When enabled and device is sleeping, Reqistration Update
message is skipped and messages from send operation and
notifications are sent right away.
Reqistration update message is also skipped when
lwm2m_engine resumes from pause state.
Signed-off-by: Juha Ylinen <juha.ylinen@nordicsemi.no>
L2 PPP is not able to handle the carrier being lost gracefully,
nor is it able to gracefully close the PPP connection when
net_if_down() is called.
This patch refactors the L2 PPP module to use the carrier state
to either properly close or simply terminate the PPP connection.
Additionally, it ensures that the PPP session is closed properly
before calling ppp->stop().
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
Get TLS_DTLS_CID_STATUS and TLS_DTLS_PEER_CID_VALUE utilize
mbedtls_ssl_get_peer_cid, which expects that mbedtls_ssl_setup
has been done.
Signed-off-by: Markus Lassila <markus.lassila@nordicsemi.no>
User is able to tweak the socket service dispatcher thread
priority in order to get better performance from the system
if needed. By default the dispatcher thread runs in lowest
application thread priority (K_LOWEST_APPLICATION_THREAD_PRIO).
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The thread name output field was a bit too short in "net sockets"
command, so make it 25 char long.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The "net sockets" command was not checking if there is any
sockets in the system before trying to access them.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The channel extraction from string directly uses the end variable with
limited data type, this causes issue if an invalid channel that exceeds
the data is given as an input e.g., 300, which would end up as a valid
channel 44.
Use an intermediate variable with type that can hold all possible
combinations (valid and invalid) and only after validation assign that
to the end type.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
For none and WPA-PSK MFP isn't applicable, it was only introduced in
WPA2-PSK (RSN) and later.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Various network shell commands like ping need floating
point support from libc so select the CONFIG_REQUIRES_FLOAT_PRINTF
option for it.
Fixes#67601
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>