Marian Buschsieweke
4de5e9f413
sys/net/gcoap_dns: update use of deprecated nanocoap APIs
2025-11-10 17:28:43 +01:00
Marian Buschsieweke
9b18061719
sys/net/gcoap_forward_proxy: update users of deprecated nanocoap APIs
2025-11-10 17:28:43 +01:00
Marian Buschsieweke
5b3d111237
sys/net/gcoap: update users of deprecated nanocoap APIs
2025-11-10 17:28:43 +01:00
Marian Buschsieweke
cac44edec7
tree-wide: replace multiple empty lines with one
...
For each C source/header `$file`: `sed -e '/^$/N;/^\n$/D' -i $file`.
2025-05-21 22:51:04 +02:00
KSKNico
e6b17fa5cb
sys: replace header guards with #pragma once
2025-05-16 19:40:06 +02:00
Marian Buschsieweke
1ff982a664
tree wide: various doc fixes
...
This fixes a batch of incorrect Doxygen comments that building with
LLVM/clang and `-Wdocumentation` uncovered.
2025-04-04 11:44:53 +02:00
Marian Buschsieweke
590ca5d7ff
sys/net/gcoap: get rid of API abuse
...
Calling `coap_get_token()` and `coap_get_token_length()` on an
(mostly) uninitialized `coap_pkt_t` did work so far due to
implementation details matching the expectations, but this is not
backed up by any API contract.
This fixes the API abuse by introducing and using a new API that does
read a token and token length from a CoAP over UDP packet out of a
buffer. This now provides the behavior expected by the caller and
commits to it via API contract.
Co-authored-by: mguetschow <mikolai.guetschow@tu-dresden.de>
Co-authored-by: benpicco <benpicco@googlemail.com>
2025-01-10 21:31:08 +01:00
Marian Buschsieweke
765dc3a299
sys/net/gcoap: reduce insanity of hack
...
gcoap contains a hack where a `coap_pkt_t` is pulled out of thin air,
parts of the members are left uninitialized and a function is called on
that mostly uninitialized data while crossing fingers hard that the
result will be correct. (With the current implementation of the used
function this hack does actually work.)
Estimated level of insanity: 😱 😱 😱 😱 😱
This adds to insane functions to get the length of a token and the
length of a header of a CoAP packet while crossing fingers hard that
the packet is valid and that the functions do not overread.
Estimated level of insanity: 😱 😱 😱
The newly introduced insane functions are used to replace the old
insane hack, resulting in an estimated reduction of insanity of 😱 😱 .
Side note: This actually does fix a bug, as the old code did not take
into account the length of the extended TKL field in case of
RFC 8974 being used. But that is a bug in the abused API,
and not in the caller abusing the API.
2024-11-01 16:32:59 +01:00
Teufelchen
b376bec667
Merge pull request #20847 from benpicco/event_assert
...
sys/event: add assertion that event has a handler
2024-10-25 08:11:51 +00:00
mguetschow
fbde0209d1
Merge pull request #20933 from benpicco/sys/net/application_layer/gcoap-ipv4
...
gcoap: fix build with IPv4
2024-10-24 09:28:23 +00:00
benpicco
87c825dd82
Merge pull request #20915 from fabian18/pr/gcoap_forward_proxy_timeout
...
gcoap/forward_proxy: handle timeout case
2024-10-23 21:58:57 +00:00
Benjamin Valentin
ce6d753aa1
gcoap: fix build with IPv4
2024-10-22 14:04:20 +02:00
Marian Buschsieweke
f16875b6ec
sys/nanocoap: add coap_pkt_set_code()
...
This adds a small convenience function to set the CoAP code of a packet
and converts users of coap_hdr_set_code() where applicable.
2024-10-17 14:56:54 +02:00
Fabian Hüßler
224fdb2294
gcoap/farward_proxy: handle timeout case
2024-10-16 16:10:28 +02:00
Marian Buschsieweke
71b91a1d0e
sys/net/gcoap_forward_proxy: fix compilation issues
2024-10-14 14:30:20 +02:00
Benjamin Valentin
97128eef48
treewide: clean up remnants of THREAD_CREATE_STACKTEST
2024-10-07 17:31:31 +02:00
Benjamin Valentin
16c447afb1
gcoap: make use of event_callback_post()
2024-08-29 17:35:54 +02:00
benpicco
022630c043
Merge pull request #20836 from benpicco/sys/gcoap-thread_name
...
gcoap: the name of the gcoap thread should be gcoap
2024-08-27 08:56:50 +00:00
Benjamin Valentin
f95dc978fa
gcoap: the name of the gcoap thread should be gcoap
2024-08-26 15:44:26 +02:00
Fabian Hüßler
a181c7b543
sys/gcoap: add public function to find a resource by path
2024-08-21 17:49:48 +02:00
Fabian Hüßler
08f6ec49c4
gcoap: lock CoAP state mutex in observe API
2024-08-21 17:49:48 +02:00
Fabian Hüßler
a2a7f41a59
gcoap: send Observe notifications from request address
2024-08-21 17:34:18 +02:00
Fabian Hüßler
04d95ab0e8
gcoap: debug for _find_req_memo_by_token()
2024-08-21 17:34:18 +02:00
Fabian Hüßler
0614db9cd5
sys/net/application_layer/gcoap: fix Observe notifications correlation
2024-07-31 23:01:17 +02:00
Teufelchen
1e6164fd68
Merge pull request #20549 from chrysn-pull-requests/gcoap-asan
...
gcoap: Avoid reading beyond defined input buffer
2024-07-30 10:13:41 +00:00
Benjamin Valentin
312a550f1a
treewide: remove THREAD_CREATE_STACKTEST from thread creation
2024-07-29 11:45:58 +02:00
Fabian Hüßler
f50dd7dade
gcoap/forward_proxy: set payload length in forwarded PDU
2024-05-31 12:04:48 +02:00
Fabian Hüßler
c12375eec4
gcoap/forward_proxy: reply from request destination address
2024-05-31 12:04:48 +02:00
Fabian Hüßler
f4b1306460
gcoap: pass aux local to _handle_req()
2024-05-31 12:04:48 +02:00
Fabian Hüßler
40fb250ae4
treewide: adapt to gcoap_req_send aux local API change
2024-05-31 12:04:48 +02:00
Fabian Hüßler
3973e4bb9d
gcoap: add aux local to gcoap_req_send
2024-05-29 16:37:13 +02:00
Fabian Hüßler
a5b6c4c051
gcoap/forward_proxy: minor fix and cleanup
2024-05-14 08:46:00 +02:00
mariemC
768ce5e443
sys/net/application_layer/gcoap/include: add internal proxy header
2024-04-25 13:36:11 +02:00
mariemC
a07a21b3de
sys/net/application_layer/gcoap: include header in path
2024-04-25 13:30:16 +02:00
mariemC
6454816676
sys/net/application_layer/gcoap: add proxy thread
2024-04-25 13:30:16 +02:00
mariemC
557f3c7bc8
sys/net/application_layer/gcoap: adjust proxy source file
2024-04-25 13:30:16 +02:00
chrysn
2f7cbd3e1f
gcoap: Avoid lockup from error paths
2024-04-24 13:18:01 +02:00
chrysn
502406dbbb
gcoap: Avoid reading beyond defined input buffer
2024-04-24 13:18:01 +02:00
Martine Lenders
3bbb7c35a7
Merge pull request #20579 from maribu/coap/etag
...
sys/net/gcoap/forward_proxy: clean up code
2024-04-16 08:43:53 +00:00
Marian Buschsieweke
bb79f3e550
sys/net/gcoap/forward_proxy: clean up code
...
Introduce an _cep_set_req_etag() helper function and drop the
_cep_set_req_etag_len() helper to avoid use of preprocessor
conditionals in the code.
2024-04-15 18:31:24 +02:00
Teufelchen1
b05ae93e4b
net/gcoap: Fix typo, replacing _uri with _proxy
2024-04-15 12:56:27 +02:00
Teufelchen
b5f9772292
Merge pull request #20434 from benpicco/DTLS_MAX_BUF-fix
...
coap: ensure DTLS buffer is at least 200 bytes
2024-04-05 08:22:11 +00:00
Benjamin Valentin
11b4564462
sys/net/gcoap: ensure DTLS buffer is at least 200 bytes
2024-04-03 21:12:45 +02:00
Martine Lenders
a2e3ca07cb
Merge pull request #20514 from miri64/gcoap/cleanup/gcoap_req_send_aliasing
...
gcoap: make gcoap_req_send_tl() an alias of gcoap_req_send()
2024-03-27 17:00:50 +00:00
Martine Lenders
27308585c3
gcoap: make gcoap_req_send_tl() an alias of gcoap_req_send()
...
As per the deprecation notice from July 2021 ;-).
2024-03-27 12:21:57 +01:00
MrKevinWeiss
e0fdc3c16c
*Kconfig*: Modify Kconfig to remove dep model
2024-03-27 10:28:12 +01:00
MrKevinWeiss
575ab684fe
sys/net/coap: cast in non-config define
...
If we try to set the compile-time config we need to always remember casting, instead, just cast in the places that are not exposed to users
2024-03-21 14:26:45 +01:00
Michel Rottleuthner
45a84af346
gcoap: clear observe state on RST response to notification
...
In order to properly handle an observe cancellation of a client, the server has to keep track of the notification MIDs (to be able to match an RST to a notification), see [RFC7641, 3.6 Cancellation](https://www.rfc-editor.org/rfc/rfc7641.html#section-3.6 ) for mor details. An alternative to this would be to make either the client send an explicit observe deregister request, or make the server send the next notification via CON (which hten allows matching of the RST due to the CON state).
2024-02-08 15:48:32 +01:00
Michel Rottleuthner
94e8786715
gcoap: issue RST on unknown observe notifications
2024-02-08 15:48:32 +01:00
Michel Rottleuthner
ab821a1dda
gcoap: add api to forget a client-side observe request
2024-02-08 15:48:32 +01:00