The stack requirements were applied to the wrong thread in case of
a shared thread managing medium and lowest priority queues (in other
words: when `event_thread_medium` is not used).
This fixes the implementation and corrects the documentation to which
thread handles which queues.
This fixes the following compilation error when using modern GCC:
RIOT/cpu/native/socket_zep/socket_zep.c: In function '_send_zep_hello':
RIOT/cpu/native/socket_zep/socket_zep.c:244:29: error: initializer-string for array of 'char' truncates NUL terminator but destination lacks 'nonstring' attribute (3 chars into 2 available) [-Werror=unterminated-string-initialization]
244 | .hdr.preamble = "EX",
| ^~~~
cc1: all warnings being treated as errors
Iterate through all parents whose address match `addr`.
In most cases there will only be a single parent, but if
`GNRC_RPL_INSTANCES_NUMOF > 1` then one node can be parent in multiple
DODAGs.
If a new L2 connection was established, the node should be inserted in
the neighbor cache.
For 6LN nodes, NIB will never start the usual neighbor discovery process
because it can directly resolve the link-layer address from the IPv6
address. Thus we have to manually add such nodes to the NC by building
the IPv6 address from the L2 address.
If a L2 connection closed, the node is removed again from the NC.
The netapi notify API enables protocol-independent, cross-layer
notification events.
Lower layers in the network stack can use this to inform upper
layers of network events.
This adds a mechanism for modules to declare requirements on the thread
stack size in their `Makefile.dep` and let the build system then
override the default stack size, if any requirements are declared.
The motivation is to allow multiple modules to have special requirements
without causing conflicts, as just adding the following to their
`Makefile.include` would do:
```Makefile
CFLAGS += -DEVENT_THREAD_MEDIUM_STACKSIZE=<MAGIC_NUMBER>
```
Instead, the new mechanism would work by having them both declare in
their `Makefile.dep`:
```Makefile
EVENT_THREAD_MEDIUM_STACKSIZE_MIN +=
```
The build system then picks the maximum number in
`EVENT_THREAD_MEDIUM_STACKSIZE_MIN` and exposes this as stack size, if
any module did declare a minimum requirement.
Co-authored-by: benpicco <benpicco@googlemail.com>
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