1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-27 07:21:18 +01:00

2720 Commits

Author SHA1 Message Date
Marian Buschsieweke
5387c20dde
sys/net/nanocoap: Make APIs (more) transport agnostic
This changes the API of nanocoap with the goal to reduce the expose of
UDP specifics in the API. The plan is to eventually support transports
such as CoAP over TCP and CoAP over WebSocket directly in nanocoap
while sharing most of the code, as e.g. the CoAP Option processing
remains identical. Specifically, the plan is to unlock a transport with
modules and introduce overhead for dispatching to specific transport
only when multiple transports are actually in use.

Support for OSCORE directly in nanocoap is probably not sensible, as
the serialization is very much unlike the other transports. A unified
CoAP API for multiple transports including OSCORE is probably best
implemented on top. But when limited to the boring set of CoAP
transports, we probably can support them well with nanocoap with less
overhead.

Breaking API Changes:
=====================

- `coap_parse()` now returns `ssize_t` instead of `int`
    - This function is not really user facing, so the impact should
      be limited
    - This is useful for stream transports where the buffer may
      contain data of more than one packet. The return value contains
      the number of bytes actually consumed, which will match the
      buffer size for non-stream transports.

API Changes:
============

- `coap_pkt_t` now contains a `uint8_t *buf` pointer instead of a
  `coap_hdr_t *hdr` pointer to the beginning of the buffer
    - This will also work when the buffer is used by non-UDP
      transports
    - A deprecated `coap_udp_hdr_t *hdr` has been crammed into
      an unnamed `union` with `uint8_t *buf`. For architectures
      where pointers have the same memory layout regardless of type
      (e.g. all of the supported ones), this will make `hdr` an
      alias for `buf`.
    - The alias will only be provided if no transport besides UDP is
      used in nanocoap. So existing apps will continue to work, new
      apps that want to support other transports need to move to
      adapt.
- `coap_hdr_t` has been renamed to `coap_udp_hdr_t`
    - A deprecated alias was created for deprecation
- `coap_hdr*()` functions have been deprecated
    - Equivalent `coap_pkt*()` functions have been created that work
      on `coap_pkt_t *` instead of `coap_hdr_t *`
    - If non-UDP transports are used, the deprecated `coap_hdr*()`
      will probably not be exposed to avoid footguns.
- `coap_build_hdr()` has been renamed to `coap_build_udp_hdr()` and
  that works on an `uint8_t *` buffer with a given length, rather than
  on a `coap_hdr_t *` with a *figers crossed* length
    - a deprecated `coap_build_hdr()` function was added that calls
      to `coap_build_udp_hdr()` and has the same signature, so that
      users have time to update
2025-11-10 17:28:41 +01:00
Mikolai Gütschow
59446cf1e8
sys/net/sock_dtls: document SOCK_DTLS_HANDSHAKE in user guide 2025-10-30 09:22:17 +01:00
Elena Frank
ba1895cb20 gnrc/rpl/dodag: add gnrc_rpl_dodag_remove 2025-10-22 21:34:41 +02:00
Elena Frank
b025edc726 gnrc/rpl/dodag: ret void for gnrc_rpl_instance_remove
`gnrc_rpl_instance_remove` can't fail, so it was already always
returning `true`.
2025-10-22 21:34:41 +02:00
Elena Frank
5139847376 gnrc/rpl/of0: compare dodags 2025-10-22 21:34:37 +02:00
fabian18
e3fa62f38f
Merge pull request #21533 from fabian18/pr/submac_ack_transmission
ieee802154/submac: add automatic ACK transmission when AUTO_ACK is not supported by driver
2025-10-06 11:05:40 +00:00
Teufelchen
0d5e3f056a
Merge pull request #21397 from benpicco/hostnames
net/hosts: add module for static hostname definitions
2025-10-06 09:29:28 +00:00
Fabian Hüßler
fccb0eac92 ieee802154: use retval in struct ieee802154_radio_ops 2025-10-06 10:38:55 +02:00
Fabian Hüßler
c7dd44583f ieee02154: add IEEE802154_CAP_AUTO_ACK 2025-10-05 21:42:32 +02:00
Fabian Hüßler
f7f8a571a2 ieee802154: add ieee802154_radio_has_capability 2025-10-05 21:42:32 +02:00
Fabian Hüßler
85c61b293d ieee802154: add ieee802154_radio_get_frame_filter_mode 2025-10-05 21:42:32 +02:00
AnnsAnn
4a3f6d5859 sys/include/net/sock: update guide references
Co-authored-by: crasbe <crasbe@gmail.com>
2025-09-18 15:37:50 +02:00
Benjamin Valentin
af8faa0257 net/dns: make file safe to include regardless of modules used 2025-09-11 20:05:20 +02:00
Benjamin Valentin
9c4ee37acc sys/dns: use hostnames in DNS lookup 2025-09-11 19:16:03 +02:00
Benjamin Valentin
48273ef736 net/hosts: add module for static hostname definitions 2025-09-11 19:16:03 +02:00
Benjamin Valentin
23c956e508 sys/net/ipv4: add IPV4_ADDR_LOOPBACK definition 2025-09-11 19:16:02 +02:00
crasbe
7c44b06e5c
Merge pull request #21652 from benpicco/nanocoap_server/buf
nanocoap_server: use zero-copy network buffer for parsing request
2025-09-04 14:43:05 +00:00
Marian Buschsieweke
c0cc617c7f
Merge pull request #21633 from crasbe/pr/sntp
sys/net/sntp: migrate from xtimer to ztimer
2025-08-21 16:23:56 +00:00
crasbe
acf10d91b9 sys/net/ntp_packet: add ref to SNTP, fix time 2025-08-21 14:27:28 +02:00
crasbe
8ab9956ae5 sys/net/sntp: migrate from xtimer to ztimer 2025-08-21 14:27:28 +02:00
Benjamin Valentin
d48eaf15aa nanocoap_server: use zero-copy network buffer for parsing request 2025-08-07 17:26:57 +02:00
mguetschow
f572bbeef9
Merge pull request #21610 from mguetschow/unicoap-test-stack-overflow
unittests/unicoap: statically allocate option buffers
2025-07-24 16:05:06 +00:00
benpicco
4f9f755f99
Merge pull request #20197 from benpicco/coap_iterate_uri_query
nanocoap: add coap_iterate_uri_query()
2025-07-24 11:35:51 +00:00
Benjamin Valentin
824d3ea71d nanocoap: add coap_iterate_uri_query() 2025-07-24 13:18:06 +02:00
Mikolai Gütschow
50a5d17f50
sys/net/unicoap: add UNICOAP_OPTIONS_ALLOC_STATIC 2025-07-24 11:18:10 +02:00
Marian Buschsieweke
091acb39f6
Merge pull request #21002 from benpicco/netstats_nb-new_api
gnrc_netif: fix neighbor statistics with netdev_new_api
2025-07-23 16:14:32 +00:00
Benjamin Valentin
5e18262ad7 sys/include/net/netstats: re-order result codes 2025-07-23 17:21:27 +02:00
Teufelchen1
944eb05727 net/mac: Remove deprecated 802.15.4 module 2025-07-21 12:57:15 +02:00
Teufelchen
1345452bbe
Merge pull request #21603 from Teufelchen1/deprecate/lwmac
net/lwmac: Remove deprecated lwmac module
2025-07-18 08:34:57 +00:00
Marian Buschsieweke
40e5627981
Merge pull request #21602 from Teufelchen1/fix/l2filter
net/l2filter: fix incorrect length check
2025-07-15 11:28:12 +00:00
Teufelchen1
f6f7de4ccc net/l2filter: fix incorrect length check
Co-authored-by: namberino <namnb2402@gmail.com>
2025-07-15 12:10:44 +02:00
Teufelchen1
8970d751c4 net/lwmac: Remove deprecated lwmac module 2025-07-15 11:38:37 +02:00
Teufelchen1
f027626f3c net/gomach: Remove deprecated GoMach module 2025-07-14 13:18:20 +02:00
Carl Seifert
531c0971bd net/unicoap: add typed accessors for IANA-defined options 2025-07-07 17:27:40 +02:00
Carl Seifert
d184a1af0f net/unicoap: implement option accessors 2025-07-07 17:27:39 +02:00
Carl Seifert
70350216ba net/unicoap: add base config 2025-07-07 17:27:39 +02:00
Carl Seifert
12c7e07839 net/unicoap: add CoAP constants 2025-07-07 17:27:39 +02:00
Carl Seifert
3a71d2271e net/unicoap: add message interface 2025-07-07 17:27:39 +02:00
Carl Seifert
6b9e5433e6 net/unicoap: add module basics 2025-07-07 17:27:39 +02: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
Benjamin Valentin
a08a0814f9 sys/net/sockutil: Do not use undefined structs
sock_tcp_ep_t may not be defined if sock_tcp is not used.
2025-05-06 15:05:02 +02:00
benpicco
c937969224
Merge pull request #21419 from maribu/sys/net/sock_util
sys/net/sock_util: Do not depend on network stack
2025-05-05 17:18:46 +00:00
Marian Buschsieweke
41c8f5112b
sys/net/sockutil: use #pragma once
Co-authored-by: benpicco <benpicco@googlemail.com>
2025-05-05 18:09:29 +02:00
Marian Buschsieweke
62e553ad6c
sys/net/sock_util: Do not depend on network stack
This allows using and compiling the URL handling functions of sock_util
without a network stack used.

Co-authored-by: benpicco <benpicco@googlemail.com>
2025-05-05 18:09:22 +02:00
Benjamin Valentin
989d8485de gnrc/ipv6/nib: convert conf.h to new indentation style 2025-04-28 14:12:49 +02:00
Benjamin Valentin
ba23c77a4d gnrc/ipv6/nib: add option to disable router solicitations 2025-04-25 00:23:00 +02:00
Marian Buschsieweke
4ce7ab2133
tree-wide: fix documentation issues
This should fix compilation with -Wdocumentation on LLVM.
2025-04-10 13:37:13 +02:00
Mikolai Gütschow
1e74114c7b
sys/net/gcoap: remove deprecated gcoap_req_send_tl()
Use alias `gcoap_req_send()` instead

Deprecated in https://github.com/RIOT-OS/RIOT/pull/20514
2025-04-08 14:59:38 +02:00
Marian Buschsieweke
db0be36345
tree-wide: mixed back of documentation fixes
This fixes a number of documentation issues that LLVM/clang would flag
with `-Wdocumentation`.
2025-04-07 15:59:13 +02:00