Add tests that verify that sendmsg() for DTLS works fine if provided
with multiple buffers.
Modify existing sendmsg() tests, so that we still tests the old
behavior if the feature is disabled.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
To make the content of the sample packets more more
understandable, comments describing it are added.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Add tests for the encapsulated vendor specific option callback API.
These test cases are focused on correct parsing of encapsulated
vendor specific options.
The sample DHCP messages have been extended accordingly.
Signed-off-by: Matthias Breithaupt <m.breithaupt@vogl-electronic.com>
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Co-authored-by: Fin Maaß <f.mass@vogl-electronic.com>
- Added a test to the CoAP testsuite for age wrap around
- Added test for `coap_age_is_newer`
Signed-off-by: Sibert Declercq <sibert.declercq@basalte.be>
Make sure that the tests work properly when each IPv4 address
in the network interface gets its own netmask.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This is not used by anyone, and is unlikely to be useful actually.
Helps to save 4 bytes for each instance of struct net_nbr also (removing
a 2 bytes attributes, which was anyway generating a 4bytes loss due to
structure misalignment).
Removing relevant useless functions related to it as well.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Add test cases for IPv4/IPv6 foreach functions that iterate all
multicast addresses assigned to an interface.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Add test case verifying that send() returns an error when called after
TLS session has been closed.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Verify that declined addresses are not permanently blocked - i. e.
expire after configured timeout and in case of free address shortage,
can be reused.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit introduces two changes:
- veryfing fixed buffer's size and length after allocation to existing
test case
- new test veryfing appending bytes to a network buffer from a fixed
size pool
Signed-off-by: Konrad Derda <konrad.derda@nordicsemi.no>
From change 47eb592c28b9e7dfbdd25fedbf07a528ad240084 net_buf structures
allocated from pools defined with NET_BUF_POOL_FIXED_DEFINE() will keep
their `size` member set to the actual fixed size and not requested
size like before.
For this set of tests NET_BUF_POOL_FIXED_DEFINE() for several test
cases. These tests check the several values based on a fact that the
network buffer's size was set to the requested size.
This commit changes definition of the buffer pool to
NET_BUF_POOL_FIXED_DEFINE() in order to satisfy these expectations.
This change does not impact the tests themselves.
Signed-off-by: Konrad Derda <konrad.derda@nordicsemi.no>
Building with Zephyr SDK 0.16.5 revealed a minor bug with the buffer
size provided to snprintk():
specified bound 38 exceeds destination size 20 [-Wstringop-overflow=]
As we provide the buffer to snprintk() with an offset, the actual
buffer size should be reduced by that offset value.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Add test case which verifies that ICMP probing work as expected for the
DHCPv4 server. Make sure we build tests with both, probing enabled
(default) and disabled (enforced in testcase.yml) to make sure the
server is functional regardless of the probing feature.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
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>
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>
Move DHCPv4 client tests to subdirectory, to make room for DHCPv4 server
tests.
Rename test project to dhcpv4_client to better reflect its purpose.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This test uses functions and types which are extensions to
the C library. Let's explicity select one of the extensions
which includes it instead of relaying on somebody having
set it for this file somewhere else.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Instead of seeding the random generator from the test
itself calling into a host API, let's use the
entropy generator option to be seeded from /dev/urandom
This avoids trouble with the srandom() and time() calls
not existing depending on the chosen C library.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@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>
"engine" directory contained tests for observation
so rename it.
There is separate "lwm2m_engine" directory that contains
tests for the engine itself.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
A growing number of CAN controllers do not have support for individual RX
hardware filters based on the Remote Transmission Request (RTR) bit. This
leads to various work-arounds on the driver level mixing hardware and
software filtering.
As the use of RTR frames is discouraged by CAN in Automation (CiA) - and
not even supported by newer standards, e.g. CAN FD - this often leads to
unnecessary overhead, added complexity, and worst-case to non-portable
behavior between various CAN controller drivers.
Instead, move to a simpler approach where the ability to accept/reject RTR
frames is globally configured via Kconfig. By default, all incoming RTR
frames are rejected at the driver level, a setting which can be supported
in hardware by most in-tree CAN controllers drivers.
Legacy applications or protocol implementations, where RTR reception is
required, can now select CONFIG_CAN_ACCEPT_RTR to accept incoming RTR
frames matching added CAN filters. These applications or protocols will
need to distinguish between RTR and data frames in their respective CAN RX
frame handling routines.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Increase stack size on all test platforms, not just
qemu_x86.
Stack overflow was seen on HW tests as well, so
it might happen on many platforms.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Make sure that the SO_DOMAIN is a read only value and it
returns correct socket domain (AF_INET or AF_INET6) in the
tests.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
If CONFIG_POSIX_API is enabled, then the socket.h is found under
zephyr/posix/sys/socket.h etc. This allows one to compile the
socket test applications without error prints.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
When running on qemu_x86, the test test_socket_state failed on
stack overflow. Setting CONFIG_TEST_EXTRA_STACK_SIZE to 1024
seems to fix the issue. So add a board specific config for
qemu_x86 so this test would pass.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Make the retransmission timer much shorter so that the test
is run faster (about 50% faster test run in qemu_x86).
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Make sure the connection is closed by the timer if the final
ack is lost in closing state.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
One of the tests closed the underlying TCP connection right after
establishing one. This caused a certain race between incoming TLS
handshake data and entering FIN1 state (experienced on nrF52840), where
the TLS handshake data could be received after the FIN1 state was
entered, causing the server side to send RST packet. This disrupted the
test flow, as graceful TCP connection teardown was expected.
Fix this, by adding a small delay for such case to avoid the race.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
We would drop the received packet if the source address is our
address so tweak the test and make source address different.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
We would drop the received packet if the source address is our
address so tweak the test and make source address different.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add after() function for the test suite, which does cleanup on still
open sockets. Otherwise, an individual test case failure affects all
other test cases, blurring the test suite results.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Deprecate lwm2m_set_u64() and lwm2m_get_u64 as only
LWM2M_RES_TYPE_S64 exist. Unsigned variant is not defined.
Technically these might have worked OK, but it is undefined
what happens to large unsigned values when those are
converted to various payload formats (like CBOR) that might
decode numbers differently depending of their signedness.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
If we receive a packet from non localhost interface, then
drop it if either source or destination address is a localhost
address.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Allow engine to give hints about ongoing CoAP transmissions.
This information can be used to control various power saving
modes for network interfaces. For example cellular networks might
support release assist indicator.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Due to unresolved bug (see #61129 for details) building TLS tests fails
on vmu_rt1170 platform. Therefore disable this platform for this test
suite.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
A first batch of tests for TLS sockets, covering expected socket
behaviors:
* Verify that blocking/non-blocking tx/rx work as expected
* Verify that timeouts on tx/rx are calculated properly
* Verify proper behaviors when interacting with a socket from
different threads (close/shutodown/send).
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Move the code responsible for TLS connection establishment to a helper
function, as it'll be needed as well in other test cases.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
SO_TYPE and SO_PROTOCOL test cases does not really establish connection,
so teardown delay at the end is not needed.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Fix build for nrf5340dk_nrf5340_cpuapp_ns.
Test takes up almost all of the flash, leaving no room for the image
to be signed. Disable the bootloader to free up flash-usage.
Fixes: #66469
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Replace function parameter 'retries' with pointer to structure
holding coap transmission parameters. This allows setting the
retransmission parameters individually for each pending request.
Add coap transmission parameters to coap_pending structure.
Update migration guide and release notes.
Signed-off-by: Juha Ylinen <juha.ylinen@nordicsemi.no>
Add tests that check if device is ready or not, and
then verify the functionality of net_if_up() in that case.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add new functions to the public CoAP API to configure CoAP packet
retransmission settings. Application may need to re-configure the
settings for example when cellular modem changes connection from
LTE-M to NB-IoT or vice versa.
Signed-off-by: Juha Ylinen <juha.ylinen@nordicsemi.no>
Verify that TCP keep alive options can be set properly and that TCP
connections time out correctly when keep-alive probes fail to get
replies.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The default ztest stack size was too small to run new UDP tests on
certain platforms (nrf52840 in this particular case), therefore increase
teh stack size in prj.conf.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
In fallback refactoring to the LwM2M engine, some changes
to the server object are visible in hard-coded test
values.
Also, add Endpoint wrapper class that ensures the registration
state of the returned endpoint.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
If server registration fails, allow fallback to secondary server,
or fallback to bootstrap.
Also allow fallback to different bootstrap server.
Add API to tell RD client when server have been disabled by
executable command.
Changes to RD state machine:
* All retry logic should be handled in NETWORK_ERROR state.
* New state SERVER_DISABLED.
* Internally disable servers that reject registration
* Temporary disable server on network error.
* Clean up all "disable timers" on start.
* Select server first, then find security object for it.
* State functions return void, error handling is done using states.
* DISCONNECT event will only come when client is requested to stop.
* NETWORK_ERROR will stop engine. This is generic error for all kinds
of registration or network failures.
* BOOTSTRAP_REG_FAILURE also stops engine. This is fatal, and we cannot
recover.
Refactoring:
* Server selection logic is inside server object.
* sm_handle_timeout_state() does not require msg parameter. Unused.
* When bootstrap fail, we should NOT back off to registration.
This is a fatal error, and it stops the engine and informs application.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Make sure that statistics is properly update for dropped
packets when IPv4 TTL is 0 or IPv6 hop limit is 0.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
A warning is printed in start of the test about this.
Increase CONFIG_NET_IF_MAX_IPV6_COUNT=2 and
CONFIG_NET_IF_MAX_IPV4_COUNT=2 so that the tests pass
in frdm_k64f and some other boards.
Fixes#66020
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
A race condition for the test occurs as the service might have started
when booting.
Do not autostart the service to verify the port stays 0.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Add extra checks that make sure that msg_iov is set
as we cannot receive anything if receive buffers are
not set.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Since the TCP context (and thus net_context) is not dereferenced
directly from the test thread anymore, add a small delay so that TCP
work queue have a chance to run, before checking net_context count or
reusing the port on new allocation.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
If the rdclient is suspended or deregistered any network errors caused
by lwm2m_engine and forwarded by socket_fault handler should not change
the rd client state.
Signed-off-by: Andreas Chmielewski <andreas.chmielewski@grandcentrix.net>
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Set separate option getters for bool, uint8_t and uint16_t
values. Use those generic getters when fetching the desired
option value.
Noticed mixed usage (bool vs int) for txtime option. Changed
the code to use int type like in other options.
The uint16_t option getter gets the value from uint16_t variable
but returns int value to the caller, and also expects that user
supplies int value.
For uint8_t value, it is expected that uint8_t value is supplied
instead of int.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add test case to ensure that NET_EVENT_IF_HOSTNAME_CHANGED event is
triggered properly when the hostname changes.
Signed-off-by: Konrad Derda <konrad.derda@nordicsemi.no>
Make sure recvmsg() is able to return IPv4 IP_PKTINFO and
IPv6 IPV6_RECVPKTINFO ancillary data to the caller.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Implement test cases:
LightweightM2M-1.1-int-303 - Cancel observations using Observe with
Cancel parameter
LightweightM2M-1.1-int-305 - Cancel Observation-Composite Operation
Modify existing Leshan API to passive_cancel().
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Test case:
LightweightM2M-1.1-int-235 - Read-Composite Operation on root path
is now working as Leshan added a support for reading the root path.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Implement write and remove attributes command for Leshan.
Remove all written attributes at the end of test, so it won't
affect the next test case.
Remove skip marks from testcase that is fixed on Leshan side.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Added igmpv3 support based on the already existing structure for igmpv2.
The already existing api is not modified to prevent breaking exisiting
applications.
Signed-off-by: Ibe Van de Veire <ibe.vandeveire@basalte.be>
Enable these tests for native_sim and switch from
native_posix to native_sim as default test platform
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Enable these tests for native_sim and switch from
native_posix to native_sim as default test platform
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Enable these tests in native_sim
and switch from native_posix to native_sim as default
test platform
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Further reduce code duplication by moving test code for similar test
cases into a helper function, parametrized based on the test case.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Move code responsible for net context initialization, repeated over
multiple test cases, to a helper function to reduce code duplication.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Modify internal L4 protocols APIs, to allow to enforce checksum
calculation, regardless of the checksum HW offloading capability.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Implement testcases for Information Reporting Interface [300-399]:
* LightweightM2M-1.1-int-301 - Observation and Notification of parameter
values
* LightweightM2M-1.1-int-302 - Cancel Observations using Reset
* LightweightM2M-1.1-int-304 - Observe-Composite Operation
* LightweightM2M-1.1-int-306 – Send Operation
* LightweightM2M-1.1-int-307 – Muting Send
* LightweightM2M-1.1-int-308 - Observe-Composite and Creating
Object Instance
* LightweightM2M-1.1-int-309 - Observe-Composite and Deleting
Object Instance
* LightweightM2M-1.1-int-310 - Observe-Composite and modification of
parameter values
* LightweightM2M-1.1-int-311 - Send command
303 and 305 cannot be implemented using Leshan as it only support
passive cancelling of observation.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
When testcases share one DUT per module, we save the time
from running bootstrap on each testcase.
Each testcase start with DUT that is registered.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Implement support for reading stream of events from Leshan.
This allows testing the LwM2M SEND/Notify/Update operations
and reading content of those.
Also convert the whole Leshan class to use requests.session() so
it pools up connections and uses keep-alive.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Add remaining test cases from
Device management & Service Enablement Interface
* LightweightM2M-1.1-int-222 – Read on Object
* LightweightM2M-1.1-int-223 – Read on Object Instance
* LightweightM2M-1.1-int-224 – Read on Resource
* LightweightM2M-1.1-int-225 – Read on Resource Instance
* LightweightM2M-1.1-int-226 – Write (Partial Update) on
Object Instance
* LightweightM2M-1.1-int-227 - Write (replace) on Resource
* LightweightM2M-1.1-int-228 - Write on Resource Instance
* LightweightM2M-1.1-int-229 - Read-Composite Operation
* LightweightM2M-1.1-int-230 - Write-Composite Operation
* LightweightM2M-1.1-int-231 - Querying basic information
in SenML JSON format
* LightweightM2M-1.1-int-232 - Querying basic information
in SenML CBOR format
* LightweightM2M-1.1-int-233 - Setting basic information
in SenML CBOR format
* LightweightM2M-1.1-int-234 - Setting basic information
in SenML JSON format
* LightweightM2M-1.1-int-235 - Read-Composite Operation on root path
* LightweightM2M-1.1-int-236 - Read-Composite - Partial Presence
* LightweightM2M-1.1-int-237 - Read on Object without specifying
Content-Type
* LightweightM2M-1.1-int-241 - Executable Resource: Rebooting the device
* LightweightM2M-1.1-int-256 - Write Operation Failure
* LightweightM2M-1.1-int-257 - Write-Composite Operation
* LightweightM2M-1.1-int-260 - Discover Command
* LightweightM2M-1.1-int-261 - Write-Attribute Operation on a multiple
resource
* LightweightM2M-1.1-int-280 - Successful Read-Composite Operation
* LightweightM2M-1.1-int-281 - Partially Successful Read-Composite
Operation
Modify tests binary
* Allow CoAP payload of 1211 bytes.
* Allow outgoing messages to use block-wise if they are bigger.
* Use 4kB encode buffer for outgoing messages.
* Check configured heap and stack sizes.
* Limit number of interface addresses, sockets and contexts
Qemu-cortex-m3 platform ran out of RAM, so reconfigure it to use
* packet size of 256 bytes.
* encode buffer of 2kB
This exercises the block-transferring on some of the test cases.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
* Add support for running interoperability tests with
Qemu X86.
* Remove some debugging messages to allow binary to
fix Qemu Cortex-M3 board.
* Tune buffer and stack sizes to fit all boards.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Do not include the resource type (rt=) in the registration message when
using the OMA JSON format. This was a workaround specifically for the
Wakaama LwM2M server which is no longer needed since the latest master
branch.
Signed-off-by: Marc Lasch <marc.lasch@husqvarnagroup.com>
When working on new test cases for checksum_offload test suite it turned
out that some existing test cases were already broken and not testing
what expected. This commit fixes the broken functionality:
* Despite having two separate interfaces for offloaded and
non-offloaded checksum scenario, all packets ended up in a single
interface anyway due to src address matching. Therefore use
different destination address, depending on tests.
* Add separate semaphores for offloaded and non-offloaded case, to
ensure that the packet ended up on the correct interface.
* The packet loopback in RX cases was broken, the LL address, IP
address and UDP port swap written data in wrong places.
* The receive path was not tested in the offloaded case.
Additionally, do a small cleanup before adding more tests:
* Fix net_context leak.
* Configure IPv6 neighbor once, during setup.
* Add before function to cleanup the flags before tests execute.
* Split tests into separate test cases, as they're not really
dependent on each other.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The optlen parameter passed to getsockopt() should be of (socklen_t *)
type. Using int produced build errors on 64 bit platforms.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Recently added tests require more stack on certain platforms
(nrf52840dk_nrf52840 in this case), hence increase the ZTEST stack size.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Add case 'test_resend_request' to test that coap_client resends
the message if no response received.
Add response code check to case 'test_no_response'.
Initialize messages_needing_response[] in test setup.
Lower CONFIG_COAP_INIT_ACK_TIMEOUT_MS and decrease delays.
Signed-off-by: Juha Ylinen <juha.ylinen@nordicsemi.no>
Instead of forcing use of NEWLIB_LIBC, select any available complete C
library implementation. Add CONFIG_REQUIRES_FLOAT_PRINTF where needed.
Signed-off-by: Keith Packard <keithp@keithp.com>
This checks that if connect() timeouts, we check TCP pointer
properly in select() and poll() in order to catch the situation.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
If the first Ethernet interface is not the first network
interface, then there might be two interfaces with the same name.
The test does not like that.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The sent pkt must be removed after we have cloned it
in the simulated driver otherwise there is a memory leak.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The IPV6_V6ONLY option is only checked if
CONFIG_NET_IPV4_MAPPED_TO_IPV6 option is set.
By default the IPV6_V6ONLY option is set.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
When resource instances are initialized, we must calculate
beginning of the data buffer using the index and maximum
data length. Otherwise buffers would overlap with previous.
Fixes#64011
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Resend the request with Echo option and the received Echo
option value when receiving a 4.01 (Unauthorized) response
with the Echo option.
Add missing header file kernel.h to coap_client.h.
Signed-off-by: Juha Ylinen <juha.ylinen@nordicsemi.no>
Add new configuration value CONFIG_LWM2M_UPDATE_PERIOD
that allows calculating update period from last update,
instead of calculating it from the lifetime.
In runtime, server is allowed to change the lifetime of the
registration which causes update perdiod to be effected.
When fixed update period is preferred, UPDATE_PERIOD
config is then used.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Split the conversion of the RTR frame flags from the data contents test as
RTR frames do not carry any data.
Replace a couple of direct DLC assignments with proper use of
can_bytes_to_dlc().
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
rand32.h does not make much sense, since the random subsystem
provides more APIs than just getting a random 32 bits value.
Rename it to random.h and get consistently with other
subsystems.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Only confirmable messages need pending tracking. Non-confirmable
messages are released after sending.
Match incoming packets with token, not message ID.
Ignore responses with non-matching tokens.
Remove unused function send_reset().
Signed-off-by: Juha Ylinen <juha.ylinen@nordicsemi.no>
In case observation token changes (the LwM2M server re-sends
observation request to the client), the LwM2M engine should cancel any
ongoing notifications based on the old token. Otherwise, it will be
impossible to match the pending notification reply (ACK) with the
observer context anymore, causing new notifications for this
observation to stall.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Always clone net_pkt to pass to promiscuous queue.
Previously, net_pkt was passed to L2 before conditionally cloning.
But L2 would in some cases strip ethernet headers, so cloned
net_pkt received through promiscuous interface would be missing headers.
Signed-off-by: Kieran Tyrrell <kieran@sienda.com>
Rearranges the k_mem_slab fields so that information that describes
how much of the memory slab is used is co-located. This will allow
easier of its statistics into the object core statistics reporting
framework.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
A minor overlook from the recent ICMP rework, the registered handlers
should no longer unref the processed packet as it's now the
responsibility of the ICMP module.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
A little refactoring that simplifies dealing with nanosecond timestamp
values in packets and further decouples calling code from PTP:
Benefits:
- simplifies calling code by removing redundant conversions.
- prepares for removing PTP dependencies from net_pkt.
Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Added a new event for LWM2M_RD_CLIENT_EVENT_DEREGISTER for
indicate LwM2M client dereistartion.
Updated unit test and sample for new event type
Signed-off-by: Juha Heiskanen <juha.heiskanen@nordicsemi.no>