1173 Commits

Author SHA1 Message Date
ashishmac7
d9f3866574 Fix: Check memory allocation before memset operation
- Moved the NULL check after memory allocation to occur before the memset call.
  This prevents potential undefined behavior if the allocation fails.
- Ensures safe memory handling and avoids crashes due to dereferencing NULL.

Signed-off-by: CMT-Ashish <ashish.macwan@comminent.com>
Signed-off-by: ashishmac7 <ashishmac777@gmail.com>
2025-04-14 22:10:42 +02:00
Sebastian Schoch
a30c1e688c coap: Allow to set WAKAAMA_COAP_SEPARATE_TIMEOUT via CMake
The timeout for separate ack can be configured with CMake variable.

Signed-off-by: Sebastian Schoch <sebastian.schoch@husqvarnagroup.com>
2025-04-03 15:13:07 +02:00
Sebastian Schoch
16158b4aa8 coap: Fix timeout for separate response
When an empty ACK is received set the timeout for the separate response
to COAP_SEPARATE_TIMEOUT.

Signed-off-by: Sebastian Schoch <sebastian.schoch@husqvarnagroup.com>
2025-04-03 15:13:07 +02:00
Sebastian Schoch
ba5625528c coap: Fix received message not correct processed
A received message was not processed if the mid does not
match a pending operation.
Now check token instead of only mid.

Signed-off-by: Sebastian Schoch <sebastian.schoch@husqvarnagroup.com>
2025-04-03 15:13:07 +02:00
Reto Schneider
4f6917ef9c ci: Update OpenSSF actions
This hopefully resolves the problem with failing artifact upload.

Source of the changes: https://github.com/ossf/scorecard/, file
.github/workflows/scorecard-analysis.yml
2025-03-27 11:36:10 +01:00
Lukas Woodtli
ee0ec95d3e Allow bigger packets if no block transfer is active
In CoAP it's possible that a packets payload is bigger than the block
size.
Usually the complete message size must fit into the configured max.
packet size.
In case of block-transfer the payload (without header and options) needs
to fit into the block size.
2025-03-19 15:51:51 +01:00
Lukas Woodtli
36e6a53636 cmake: Introduce configuration option for max message size
The message size needs to be bigger than the block size as it also needs
to hold the CoAP header and options.
2025-03-19 15:51:51 +01:00
Pascal Brogle
975b5a29b7 Add send callback to lwm2mserver example
The send callback has been added to the server example to demonstrate
its use.
2025-03-11 16:16:58 +01:00
Marc Lasch
7761974462 server: Make client context available in de-registration callback
Remove the client context from server only after calling the monitoring
callback when handling a de-registration. A as result, the client
information is still available in the server context during the callback.

Signed-off-by: Marc Lasch <marc.lasch@husqvarnagroup.com>
2025-03-03 10:56:39 +01:00
Lukas Woodtli
aae24677f0 cmake: Make max retransmit configurable with CMake
The CMake variable `WAKAAMA_COAP_DEFAULT_MAX_RETRANSMIT` can be used to
configure the max number of retransmissions.
2025-03-03 09:03:32 +01:00
Marc Lasch
57f3cc7668 cmake: Make max retransmit configurable at build time
Make CoAP max retransmit setting configurable at build time.
2025-03-03 09:03:32 +01:00
Pascal Brogle
9f7ec5bf01 Allow writing multiple object instances
It's now possible to write multiple instances of the same object.
2025-03-03 09:02:03 +01:00
Marc Lasch
9ae3189aa8 coap: Cleanup transactions when client is unregistered
All pending transactions of a just unregistered client must be removed
2025-02-27 08:39:46 +01:00
Lukas Woodtli
b377a138ac cmake: Add option for disabling unit tests
Building the unit tests can now be disabled with a CMake cache variable.
This is useful on platforms where `CUnit` is not available or when
working on an embedded platform.
2025-02-24 09:00:08 +01:00
Lukas Woodtli
535230ce78 ci: Remove defunct foreign architectures from actions
The compiler produces a segfault on the emulated architectures. To be
able to continue the work on Wakaama we disable testing on these
architectures for the time being.
2025-02-11 16:26:06 +01:00
Lukas Woodtli
84935823bf test: Build and unit test examples with sanitizers
This way the Wakaama library is built and tested with the configurations
that the examples use.
2024-12-17 16:32:13 +01:00
Lukas Woodtli
1cc77834c6 test: Add action dedicated to integration tests
This way it's easier to handle the different kind of tests.
2024-12-17 16:32:13 +01:00
Lukas Woodtli
e5d7daba36 cmake: Remove presets
Presets never worked very well. Especially IDE's had troubles with them.
2024-12-17 16:32:13 +01:00
Lukas Woodtli
76e8aed679 cmake: Enable all modes by default
Working on the project is easier, when all modes and most other features
are enabled by default.

The baseline for CodeChecker needs to be adjusted, because more code is
now analyzed. It just reports more findings of issues that were already
around before.
2024-12-17 16:32:13 +01:00
Lukas Woodtli
306744a5a0 fix: Remove memory leak
Deleting block data in any case.
2024-12-17 16:32:13 +01:00
Lukas Woodtli
c6092f160d ci: Remove clang static analyzer action
Static analysis is done with `CodeChecker` now. It integrates the clang
static analyzer and `cppcheck`.
2024-12-10 15:12:41 +01:00
Lukas Woodtli
10e8365728 ci: Use CodeChecker as static analysis tool
CodeChecker combines multiple static code analysis tools including
`clang-sa`. It also provides the possibility to check against a baseline
to report only newly introduced issues.
Moreover it is simpler to use.
It could eventually replace `clang-sa` completely in the pipeline.
2024-12-10 15:12:41 +01:00
Reto Schneider
e7f4678595 doc: Fix LwM2M spelling
The proper spelling is LwM2M.

Changes generated using the following commands:
$ sed -i 's| LWM2M | LwM2M |' $(rg -lw LWM2M)
2024-12-05 08:34:15 +01:00
Reto Schneider
c13e0f94be doc: Prepare for actual change
This ensures that the next commit is really just about changing LWM2M to
LwM2M.
2024-12-05 08:34:15 +01:00
Lukas Woodtli
9c66532a71 cmake: Remove unneeded function for shared sources
This function is not needed anymore as Wakaama is now a proper library.
Additional functions can be added to the library at configure time.
2024-12-04 15:52:34 +01:00
Lukas Woodtli
158bced470 cmake: Remove option for examples
The examples are now individual projects, which use Wakaama as external
dependency. There is no need anymore to enable the examples in the CMake
project.
2024-12-04 15:52:34 +01:00
Lukas Woodtli
9ee63a22ca make: Client examples as individual projects
The client example projects now use Wakaama as a direct dependency. They
have also been split into three different projects (udp, tinydtls and
raw_block1). The CI and integration tests were adjusted for the new
project.
2024-12-03 15:21:29 +01:00
Reto Schneider
1f57c8ea54 doc: Fix repository name
While https://github.com/eclipse/wakaama redirects to
https://github.com/eclipse-wakaama/wakaama, the later is what should be
used nowadays.
2024-11-27 11:06:37 +01:00
Reto Schneider
ec4458bae7 ci: Cancel outdated runs
Canceling builds of commits which are no longer (really) relevant seems
like a sensible thing to do.
2024-11-26 10:24:45 +01:00
Reto Schneider
dc9acdb2c2 ci: Move to clang-format version 18
This makes use of the fact that we have moved CI to Ubuntu 24.04, and
are no longer constrained to the old versions offered by Ubuntu 20.04.

Please note: clang-format-18 does return an non-zero exit code when
changes have been found. For this reason, it gets now run in a subshell
which has the pipefail option disabled.
2024-11-25 09:22:56 +01:00
Reto Schneider
d28bd14114 ci: Enforce pinned pip dependencies
This should give us a 10/10 OpenSSF rating for pinned dependencies.
2024-11-18 09:14:48 +01:00
Reto Schneider
097686cf4c ci: scorecard: Remove non-main branch
This branch name has been accidentally committed in
220362caf725e9c540c071eca289185fc4c056f5 (ci: Add OSSF Scorecard
action).
2024-11-18 09:14:15 +01:00
Reto Schneider
d723815b73 ci: Remove pip upgrade
OpenSSF scorecard does not want us to upgrade to unspecified versions.

Removing the update seems like the simplest solution, as the version
contained in the ubuntu-20.04 base image is recent enough.
2024-11-15 17:28:23 +01:00
Reto Schneider
a1655b913e ci: Pin GitHub actions versions
One step to improve our OpenSSF score card result.
2024-11-15 17:28:23 +01:00
Reto Schneider
bd1080eb83 pip: Pin dependencies
This improves security and reproducibility.
2024-11-15 14:49:04 +01:00
Lukas Woodtli
e2472938c4 ci: Update run-on-arch-action
The action failed with:

"ERROR: failed to solve: arm32v7/debian:bookworm: failed to resolve
source metadata for docker.io/arm32v7/debian:bookworm"
2024-11-14 19:45:52 +01:00
Reto Schneider
e2ce38bd52 readme: Add OpenSSF Best Practices badge
While we are not perfect, this gives us a clear list of tasks to do in
order to become better.

While I am listed as owner of the badge, everyone with write access to
the repository should be able to update its data.
2024-11-13 09:33:58 +01:00
Reto Schneider
04b826af77 readme: Add OSSF Scorecard badge
While we are not perfect, this gives us a concrete TODO list.
2024-11-11 10:00:44 +01:00
Reto Schneider
220362caf7 ci: Add OSSF Scorecard action
This gives use a quick overview of our security.
2024-11-11 10:00:44 +01:00
Lukas Woodtli
5dfefeaab8 doc: Update tables with Wakaama features
We added CBOR and SenML CBOR support to Wakaama.
2024-11-06 08:52:16 +01:00
Lukas Woodtli
24c4be1eed doc: Split big table with Wakaama features
The table had too many columns. It's now split into two tables.
2024-11-06 08:52:16 +01:00
Lukas Woodtli
990f436934 doc: Add features list for Wakaama
The table is taken from #729.
2024-11-06 08:52:16 +01:00
Lukas Woodtli
7b517347a3 cmake: Light client as individual project
The light client project now uses Wakaama as a direct dependency. The
CI and integration tests were adjusted for the new project.
2024-10-31 17:34:17 +01:00
Lukas Woodtli
d638712749 cmake: Bootstrap server as individual project
The bootstrap server project now uses Wakaama as a direct dependent
project. The CI and integration tests were adjusted for the new project.
2024-10-31 09:36:53 +01:00
Lukas Woodtli
7e1d606d9c cmake: Server as individual project
The server project now uses Wakaama as a direct dependent project. The
CI and integration tests were adjusted for the new project.
2024-10-30 16:50:21 +01:00
Lukas Woodtli
cc0b92644d doc: Build doxygen documentation
The Doxygen documentation is generated and uploaded with GitHub actions.

Currently the code is not yet thoroughly documented.
2024-10-29 14:50:18 +01:00
Lukas Woodtli
1623d69eda ci: Use Ubuntu 24.04 on GH actions
Use the latest LTS version of Ubuntu.
2024-10-21 15:54:51 +02:00
Lukas Woodtli
ee0c98da74 cmake: Add Wakaama static library
The static library can be configured with CMake variables and then be
linked to user applications.

Wakaama became difficult to build and to maintain. Among other things,
there are defines and compiler flags that have to be set, the right set
of source files need to be selected and the correct include directories
have to be provided.

Therefore we rely on CMake and provide the users of Wakaama a static
library, which is relatively simple to build with a given set of
requested features.

This also helps with modularizing Wakaama to improve maintainability.
2024-10-03 14:36:14 +02:00
Lukas Woodtli
e73ff3ddd5 ci: Allow to build in different directory
The CI build script now supports a flag to provide a custom build
directory.
2024-10-03 14:36:14 +02:00
Lukas Woodtli
f8e4068c42 cmake: Use server mode as default
Server mode is enabled, if no mode (client, server or bootstrap-server)
is selected. A warning is submitted to inform the user of Wakaama about
the default. This simplifies testing and CI.
2024-10-03 14:36:14 +02:00