Skip to content
Open
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
7564665
gnrc/netapi: add notification message type
elenaf9 Jul 15, 2025
0408e39
nimble/netif: notify on BLE connection events
elenaf9 Jul 15, 2025
bf82b94
gnrc/ipv6: modify nib nc on l2 connection event
elenaf9 Jul 15, 2025
fbd2219
gnrc/ipv6: notify L3_ROUTING of discovered/ unreachable nodes
elenaf9 Jul 16, 2025
9715791
gnrc/rpl: iterate through parents that match addr
elenaf9 Jul 8, 2025
9030409
gnrc/rpl: handle L3 routing events from netapi
elenaf9 Jul 16, 2025
6cef5d6
nimble/rpble: don't send DIS on connection event
elenaf9 Jul 16, 2025
b6e19c2
fixup! gnrc/rpl: handle L3 routing events from netapi
elenaf9 Jul 17, 2025
f1b82ec
fixup! gnrc/ipv6: modify nib nc on l2 connection event
elenaf9 Jul 17, 2025
4404817
fixup! gnrc/netapi: add notification message type
elenaf9 Jul 17, 2025
e9d25cb
fixup! gnrc/netapi: add notification message type
elenaf9 Jul 17, 2025
6570d30
fixup! nimble/netif: notify on BLE connection events
elenaf9 Jul 17, 2025
82b5059
fixup! gnrc/ipv6: modify nib nc on l2 connection event
elenaf9 Jul 17, 2025
7e911b8
fixup! gnrc/ipv6: notify L3_ROUTING of discovered/ unreachable nodes
elenaf9 Jul 17, 2025
d8d7c81
fixup! gnrc/ipv6: modify nib nc on l2 connection event
elenaf9 Jul 17, 2025
602e894
fixup! gnrc/netapi: add notification message type
elenaf9 Jul 30, 2025
418825f
fixup! gnrc/netapi: add notification message type
elenaf9 Jul 30, 2025
7755585
fixup! gnrc/ipv6: modify nib nc on l2 connection event
elenaf9 Jul 30, 2025
2447cb8
fixup! gnrc/netapi: add notification message type
elenaf9 Aug 4, 2025
8c53e7a
fixup! fixup! gnrc/netapi: add notification message type
elenaf9 Aug 7, 2025
2c5bf74
gnrc/netapi/netnotify: ACK notify event directly
elenaf9 Aug 7, 2025
ad4c316
fixup! gnrc/netapi/netnotify: ACK notify event directly
elenaf9 Aug 7, 2025
b8ae0f6
Merge branch 'master' of https://github.com/RIOT-OS/RIOT into gnrc/ne…
elenaf9 Aug 18, 2025
abb69a1
fixup! gnrc/netapi/netnotify: ACK notify event directly
elenaf9 Aug 29, 2025
afb04c8
fixup! gnrc/netapi/netnotify: ACK notify event directly
elenaf9 Aug 29, 2025
8c88416
fixup! gnrc/netapi/netnotify: ACK notify event directly
elenaf9 Aug 29, 2025
bee053b
fixup! gnrc/netapi/netnotify: ACK notify event directly
elenaf9 Aug 29, 2025
a7d5ac9
fixup! gnrc/netapi/netnotify: ACK notify event directly
elenaf9 Aug 29, 2025
2079a8f
fixup! gnrc/netapi/netnotify: ACK notify event directly
elenaf9 Sep 3, 2025
30b2b7f
Apply suggestions from code review
elenaf9 Sep 4, 2025
2bfd90d
fixup! gnrc/netapi/netnotify: ACK notify event directly
elenaf9 Sep 4, 2025
7713680
fixup! gnrc/ipv6: modify nib nc on l2 connection event
elenaf9 Sep 4, 2025
f57c38b
fixup! gnrc/netapi/netnotify: ACK notify event directly
elenaf9 Sep 4, 2025
2d5e9c5
fixup! gnrc/netapi/netnotify: ACK notify event directly
elenaf9 Sep 4, 2025
7de5975
fixup! Apply suggestions from code review
elenaf9 Sep 4, 2025
754fe9c
Like 7de59757a6da5b3b7367f1a0a2e87081c3e1887f
elenaf9 Sep 4, 2025
0c8d01d
fixup! gnrc/netapi/netnotify: ACK notify event directly
elenaf9 Sep 8, 2025
97a0422
fixup! gnrc/netapi: add notification message type
elenaf9 Sep 8, 2025
d57474d
fixup! nimble/netif: notify on BLE connection events
elenaf9 Sep 8, 2025
06c3e64
fixup! gnrc/ipv6: modify nib nc on l2 connection event
elenaf9 Sep 8, 2025
5328407
fixup! gnrc/ipv6: notify L3_ROUTING of discovered/ unreachable nodes
elenaf9 Sep 8, 2025
00a8d28
fixup! gnrc/netapi/netnotify: ACK notify event directly
elenaf9 Sep 8, 2025
ed5ac34
fixup! gnrc/netapi/netnotify: ACK notify event directly
elenaf9 Oct 1, 2025
c45fd59
fixup! gnrc/netapi/netnotify: ACK notify event directly
elenaf9 Oct 1, 2025
6e33db2
fixup! gnrc/netapi: add notification message type
elenaf9 Oct 1, 2025
2ab900c
fixup! gnrc/netapi/netnotify: ACK notify event directly
elenaf9 Nov 25, 2025
d0df717
fixup! gnrc/rpl: handle L3 routing events from netapi
elenaf9 Nov 26, 2025
e263d97
fixup! gnrc/netapi/netnotify: ACK notify event directly
elenaf9 Nov 26, 2025
d20a7b5
fixup! fixup! gnrc/netapi/netnotify: ACK notify event directly
elenaf9 Nov 26, 2025
11567f7
fixup! gnrc/ipv6: modify nib nc on l2 connection event
elenaf9 Nov 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions pkg/nimble/netif/nimble_netif.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,24 @@
ble_l2cap_recv_ready(event->receive.chan, rxb);
}

/**
* @brief Sends a netapi notification for a connection event.
*
* @param[in] notify The type of notification event.
* @param[in] addr BLE address of the node that (dis-)connected.
*/
static inline void _dispatch_connection_event(netapi_notify_t notify, uint8_t *addr)
{
netapi_notify_l2_connection_t event = {
.l2addr = addr,
.l2addr_len = BLE_ADDR_LEN,
.if_pid = _netif.pid,
};

gnrc_netapi_notify(GNRC_NETTYPE_L2_DISCOVERY, GNRC_NETREG_DEMUX_CTX_ALL,
notify, &event, sizeof(netapi_notify_l2_connection_t));
}

static int _on_l2cap_client_evt(struct ble_l2cap_event *event, void *arg)
{
int handle = (int)arg;
Expand All @@ -349,6 +367,7 @@
conn->state |= NIMBLE_NETIF_L2CAP_CLIENT;
conn->state &= ~NIMBLE_NETIF_CONNECTING;
_notify(handle, NIMBLE_NETIF_CONNECTED_MASTER, conn->addr);
_dispatch_connection_event(NETAPI_NOTIFY_L2_CONNECTED, conn->addr);
break;
case BLE_L2CAP_EVENT_COC_DISCONNECTED:
assert(conn->state & NIMBLE_NETIF_L2CAP_CLIENT);
Expand Down Expand Up @@ -404,6 +423,7 @@
}

_notify(handle, NIMBLE_NETIF_CONNECTED_SLAVE, conn->addr);
_dispatch_connection_event(NETAPI_NOTIFY_L2_CONNECTED, conn->addr);
break;
case BLE_L2CAP_EVENT_COC_DISCONNECTED:
conn = nimble_netif_conn_from_gaphandle(event->disconnect.conn_handle);
Expand Down Expand Up @@ -450,7 +470,7 @@
{
struct ble_gap_conn_desc desc;
int res = ble_gap_conn_find(conn->gaphandle, &desc);
assert(res == 0) ;

Check warning on line 473 in pkg/nimble/netif/nimble_netif.c

View workflow job for this annotation

GitHub Actions / static-tests

semicolon is isolated from other tokens
(void)res;

conn->itvl = desc.conn_itvl;
Expand Down Expand Up @@ -498,6 +518,7 @@
nimble_netif_conn_free(handle, addr);
thread_flags_set(_netif_thread, FLAG_TX_NOTCONN);
_notify(handle, type, addr);
_dispatch_connection_event(NETAPI_NOTIFY_L2_DISCONNECTED, addr);
break;
}
case BLE_GAP_EVENT_CONN_UPDATE:
Expand Down Expand Up @@ -542,6 +563,7 @@
nimble_netif_conn_free(handle, addr);
thread_flags_set(_netif_thread, FLAG_TX_NOTCONN);
_notify(handle, type, addr);
_dispatch_connection_event(NETAPI_NOTIFY_L2_DISCONNECTED, addr);
break;
}
case BLE_GAP_EVENT_CONN_UPDATE:
Expand Down
3 changes: 0 additions & 3 deletions pkg/nimble/rpble/nimble_rpble.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,6 @@ static void _on_netif_evt(int handle, nimble_netif_event_t event,
case NIMBLE_NETIF_CONNECTED_MASTER:
/* parent selected */
assert(_current_parent == handle);
/* send a DIS once connected to a (new) parent) */
gnrc_rpl_send_DIS(NULL, (ipv6_addr_t *) &ipv6_addr_all_rpl_nodes,
NULL, 0);
break;
case NIMBLE_NETIF_CONNECTED_SLAVE:
/* child added */
Expand Down
1 change: 1 addition & 0 deletions sys/include/net/gnrc.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* @defgroup net_gnrc Generic (GNRC) network stack
* @ingroup net
* @brief RIOT's modular default IP network stack.
* @see [Martine Lenders' master thesis](https://www.riot-os.org/assets/pdfs/mlenders_msc.pdf)

Check warning on line 15 in sys/include/net/gnrc.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
* about GNRC's design and evaluation and the slide set of
* [its defense](https://www.riot-os.org/assets/pdfs/mlenders_msc_def.pdf).
*
Expand Down Expand Up @@ -288,6 +288,7 @@

#include "net/netopt.h"
#include "net/gnrc/netapi.h"
#include "net/gnrc/netapi/notify.h"
#include "net/gnrc/netreg.h"
#include "net/gnrc/nettype.h"
#include "net/gnrc/netif.h"
Expand Down
45 changes: 45 additions & 0 deletions sys/include/net/gnrc/ipv6/nib/nc.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,36 @@ static inline unsigned gnrc_ipv6_nib_nc_get_ar_state(const gnrc_ipv6_nib_nc_t *e
int gnrc_ipv6_nib_nc_set(const ipv6_addr_t *ipv6, unsigned iface,
const uint8_t *l2addr, size_t l2addr_len);

#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_6LN) || defined(DOXYGEN)
/**
* @brief Adds an unmanaged neighbor entry to the NIB if the interface represents a 6LN node
* and the IPv6 address can be constructed from the L2 address @p l2addr.
*
* @param[in] iface The interface to the neighbor.
* @param[in] l2addr The neighbor's layer 2 address.
* @param[in] l2addr_len Length of @p l2addr.
*
* @retval 0 on success.
* @retval -ENOTSUP if the interface does not represent a 6LN or when
* gnrc_netif_t::device_type of the iface does not support IID conversion.
* @retval -EINVAL when @p addr_len is invalid for the
* gnrc_netif_t::device_type of @p netif.
* @retval -ENOMEM if no space is left in neighbor cache.
*/
int gnrc_ipv6_nib_nc_set_6ln(unsigned iface, const uint8_t *l2addr,
size_t l2addr_len);
#else /* CONFIG_GNRC_IPV6_NIB_6LN */
static inline int gnrc_ipv6_nib_nc_set_6ln(unsigned iface, const uint8_t *l2addr,
size_t l2addr_len)
{
(void)iface;
(void)l2addr;
(void)l2addr_len;

return -ENOTSUP;
}
#endif /* CONFIG_GNRC_IPV6_NIB_6LN */

/**
* @brief Deletes neighbor with address @p ipv6 from NIB
*
Expand All @@ -245,6 +275,21 @@ int gnrc_ipv6_nib_nc_set(const ipv6_addr_t *ipv6, unsigned iface,
*/
void gnrc_ipv6_nib_nc_del(const ipv6_addr_t *ipv6, unsigned iface);

/**
* @brief Deletes neighbor with link-layer address @p l2addr from NIB.
*
* @param[in] iface The interface to the neighbor.
* @param[in] l2addr The neighbor's l2addr address.
* @param[in] l2addr_len Length of @p l2addr.
*
*
* If the @p l2addr can't be found for a neighbor in the NIB nothing happens.
*
* @retval True if a neighbor with @p l2addr existed.
* @retval False otherwise.
*/
bool gnrc_ipv6_nib_nc_del_l2(unsigned iface, const uint8_t *l2addr, size_t l2addr_len);

/**
* @brief Mark neighbor with address @p ipv6 as reachable
*
Expand Down
26 changes: 25 additions & 1 deletion sys/include/net/gnrc/netapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@

#include "thread.h"
#include "net/netopt.h"
#include "net/gnrc/netapi/notify.h"
#include "net/gnrc/nettype.h"
#include "net/gnrc/pkt.h"

Expand Down Expand Up @@ -88,10 +89,15 @@ extern "C" {
#define GNRC_NETAPI_MSG_TYPE_GET (0x0204)

/**
* @brief @ref core_msg type for replying to get and set option messages
* @brief @ref core_msg type for replying to get/set option, and notify messages.
*/
#define GNRC_NETAPI_MSG_TYPE_ACK (0x0205)

/**
* @brief @ref core_msg type for sending event notifications to the network stack.
*/
#define GNRC_NETAPI_MSG_TYPE_NOTIFY (0x0207)

/**
* @brief Data structure to be send for setting (@ref GNRC_NETAPI_MSG_TYPE_SET)
* and getting (@ref GNRC_NETAPI_MSG_TYPE_GET) options
Expand Down Expand Up @@ -183,6 +189,24 @@ static inline int gnrc_netapi_dispatch_send(gnrc_nettype_t type, uint32_t demux_
return gnrc_netapi_dispatch(type, demux_ctx, GNRC_NETAPI_MSG_TYPE_SND, pkt);
}

/**
* @brief Sends a @ref GNRC_NETAPI_MSG_TYPE_NOTIFY command to all subscribers to
* (@p type, @p demux_ctx).
*
* @note This blocks the sender until all registered subscribers have ack'ed the notification
* or sending has failed. The @p data can be freed after the function returned.
*
* @param[in] type Type of the targeted network module.
* @param[in] demux_ctx Demultiplexing context for @p type.
* @param[in] event Notification event type.
* @param[in] data Data associated with the event.
* @param[in] data_len Size of @p data.
*
* @return Number of subscribers to (@p type, @p demux_ctx).
*/
int gnrc_netapi_notify(gnrc_nettype_t type, uint32_t demux_ctx, netapi_notify_t event,
void *data, size_t data_len);

/**
* @brief Shortcut function for sending @ref GNRC_NETAPI_MSG_TYPE_RCV messages
*
Expand Down
133 changes: 133 additions & 0 deletions sys/include/net/gnrc/netapi/notify.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
/*
* SPDX-FileCopyrightText: 2025 TU Dresden
* SPDX-License-Identifier: LGPL-2.1-only
*/

#pragma once

/**
* @defgroup net_gnrc_netapi_notify Notification events for network APIs.
* @ingroup net_gnrc_netapi
* @brief Network event notification types.
* @{
*
* @file
* @brief Network event notification type definitions.
*
* @details The purpose of this API is to allow lower layers in the network
* stack to inform higher layers of general, protocol-independent
* network events.
* It can be used through the @ref net_gnrc_netapi to notify any
* other network interfaces that have registered themselves through
* @ref net_gnrc_netreg for the corresponding @ref net_gnrc_nettype.
*
* @note Notification events are associated with type-dependent event data.
* Receivers should not access the data directly, but instead use the
* the dedicated API functions to copy the data from the sender's.
* If the data is read manually, the receiver is responsible for
* calling @ref gnrc_netapi_notify_ack to unblock the sender.
*
* @author Elena Frank <[email protected]>
*/

#ifdef __cplusplus
extern "C" {
#endif

#include "net/ipv6/addr.h"
#include "cond.h"
#include "mutex.h"

/**
* @brief Definition of notification event types in the network stack.
*
* @note Expand at will.
* If event data is associated with the type, a helper function must also
* be added for parsing the data and calling @ref gnrc_netapi_notify_ack.
*/
typedef enum {
NETAPI_NOTIFY_L2_CONNECTED, /**< Connection established on layer 2. */
NETAPI_NOTIFY_L2_DISCONNECTED, /**< Connection closed on layer 2. */
NETAPI_NOTIFY_L3_DISCOVERED, /**< Discovered node on the network layer. */
NETAPI_NOTIFY_L3_UNREACHABLE, /**< Node became unreachable on the network layer. */
} netapi_notify_t;

/**
* @brief Data structure to acknowledge netapi notification events.
*/
typedef struct {
int counter; /**< ACK counter */
cond_t cond; /**< condition variable to signal change in count */
mutex_t lock; /**< lock for counter */
} gnrc_netapi_notify_ack_t;

/**
* @brief Data structure to be sent for netapi notification events.
*/
typedef struct {
netapi_notify_t event; /**< the type of event */
void *_data; /**< associated event data. */
uint16_t _data_len; /**< size of the event data */
gnrc_netapi_notify_ack_t *ack; /**< acknowledge event */
} gnrc_netapi_notify_t;

/**
* @brief L2 connection event data associated with @ref NETAPI_NOTIFY_L2_CONNECTED or
* @ref NETAPI_NOTIFY_L2_DISCONNECTED events.
*/
typedef struct {
uint8_t *l2addr; /**< L2 address of the node */
uint8_t l2addr_len; /**< length of L2 address in byte */
kernel_pid_t if_pid; /**< PID of network interface */
} netapi_notify_l2_connection_t;

/**
* @brief Acknowledge that a notify event was received and its data read.
*
* @param[in] ack Pointer to the event's acknowledgment structure.
*/
static inline void gnrc_netapi_notify_ack(gnrc_netapi_notify_ack_t *ack)
{
mutex_lock(&ack->lock);
ack->counter++;
/* Signal that the counter changed. */
cond_signal(&ack->cond);
mutex_unlock(&ack->lock);
}

/**
* @brief Parse the connection event data associated with @ref NETAPI_NOTIFY_L2_CONNECTED
* and @ref NETAPI_NOTIFY_L2_DISCONNECTED events.
*
* @note This will call @ref gnrc_netapi_notify_ack.
*
* @param[in] notify Pointer to the received notify event.
* @param[out] data Connection data received in the @p notify event.
* data.l2addr_len should be set to the size of the l2addr buffer.
*
* @retval sizeof(netapi_notify_l2_connection_t) on success.
* @retval -EINVAL if @p notify is of a wrong @ref netapi_notify_t type.
* @retval -ENOBUFS if the length of l2addr in @p data is smaller than the
* received l2addr.
*/
uint8_t gnrc_netapi_notify_copy_l2_connection_data(gnrc_netapi_notify_t *notify,
netapi_notify_l2_connection_t *data);
/**
* @brief Parse the ipv6 address associated with @ref NETAPI_NOTIFY_L3_DISCOVERED and
* @ref NETAPI_NOTIFY_L3_UNREACHABLE events.
*
* @note This will call @ref gnrc_netapi_notify_ack.
*
* @param[in] notify Pointer to the received notify event.
* @param[out] addr IPv6 address of the remote.
*
* @retval sizeof(ipv6_addr_t) on success.
* @retval -EINVAL if @p notify is of a wrong @ref netapi_notify_t type.
*/
int gnrc_netapi_notify_copy_l3_address(gnrc_netapi_notify_t *notify, ipv6_addr_t *addr);

#ifdef __cplusplus
}
#endif

/** @} */
3 changes: 2 additions & 1 deletion sys/include/net/gnrc/netreg.h
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,8 @@ static inline void gnrc_netreg_entry_init_cb(gnrc_netreg_entry_t *entry,
* @brief Registers a thread to the registry.
*
* @details The semantics are: Thread gnrc_netreg_entry_t::pid is interested in
* packets of protocol @p type with context gnrc_netreg_entry_t::demux_ctx.
* packets or network events of protocol @p type with context
* gnrc_netreg_entry_t::demux_ctx.
*
* @param[in] type Type of the protocol. Must not be < GNRC_NETTYPE_UNDEF or
* >= GNRC_NETTYPE_NUMOF.
Expand Down
9 changes: 9 additions & 0 deletions sys/include/net/gnrc/nettype.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,15 @@
#endif
/** @} */

/**
* @{
* @name Protocol-independent network events.
* }
*/
GNRC_NETTYPE_L2_DISCOVERY, /**< Layer 2 node discovery */
GNRC_NETTYPE_L3_ROUTING, /**< Layer 3 routing info */
/** @} */

/**
* @{
* @name Testing
Expand All @@ -134,7 +143,7 @@

/**
* @brief Translates an Ether Type number to @ref gnrc_nettype_t
* @see [IANA, ETHER TYPES](http://www.iana.org/assignments/ieee-802-numbers/ieee-802-numbers.xhtml)

Check warning on line 146 in sys/include/net/gnrc/nettype.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
*
* @param[in] type An Ether Type number
*
Expand Down Expand Up @@ -171,7 +180,7 @@

/**
* @brief Translates @ref gnrc_nettype_t to an Ether Type number
* @see [IANA, ETHER TYPES](http://www.iana.org/assignments/ieee-802-numbers/ieee-802-numbers.xhtml)

Check warning on line 183 in sys/include/net/gnrc/nettype.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
*
* @param[in] type A protocol type
*
Expand Down
12 changes: 12 additions & 0 deletions sys/include/net/gnrc/rpl/dodag.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,18 @@ void gnrc_rpl_dodag_remove_all_parents(gnrc_rpl_dodag_t *dodag);
bool gnrc_rpl_parent_add_by_addr(gnrc_rpl_dodag_t *dodag, ipv6_addr_t *addr,
gnrc_rpl_parent_t **parent);

/**
* @brief Iterate over all parents in all DODAGs with @p IPv6 address.
*
* @param[in] idx Index to start searching from.
* @param[in] addr IPV6 address of the parent.
* @param[out] parent Pointer to the parent if one was found. Otherwise NULL.
*
* @retval Index > 0 to continue next search from, if parent was found.
* @retval -ENONENT if not found
*/
int gnrc_rpl_parent_iter_by_addr(ipv6_addr_t *addr, gnrc_rpl_parent_t **parent, int idx);

/**
* @brief Remove the @p parent from its DODAG.
*
Expand Down
3 changes: 3 additions & 0 deletions sys/net/gnrc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ endif
ifneq (,$(filter gnrc_netapi,$(USEMODULE)))
DIRS += netapi
endif
ifneq (,$(filter gnrc_netapi_notify,$(USEMODULE)))
DIRS += netapi/notify
endif
ifneq (,$(filter gnrc_netif gnrc_netif_%,$(USEMODULE)))
DIRS += netif
endif
Expand Down
3 changes: 2 additions & 1 deletion sys/net/gnrc/Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ ifneq (,$(filter gnrc_uhcpc,$(USEMODULE)))
USEMODULE += fmt
endif

ifneq (,$(filter gnrc_%,$(filter-out gnrc_lorawan gnrc_lorawan_1_1 gnrc_netapi gnrc_netreg gnrc_netif% gnrc_pkt%,$(USEMODULE))))
ifneq (,$(filter gnrc_%,$(filter-out gnrc_lorawan gnrc_lorawan_1_1 gnrc_netapi gnrc_netapi_notify gnrc_netreg gnrc_netif% gnrc_pkt%,$(USEMODULE))))
USEMODULE += gnrc
endif

Expand Down Expand Up @@ -442,6 +442,7 @@ endif

ifneq (,$(filter gnrc,$(USEMODULE)))
USEMODULE += gnrc_netapi
USEMODULE += gnrc_netapi_notify
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this only be selected by RPL for now?
Code that doesn't make use of that feature shouldn't need to include it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes good point. However, it's not just for RPL but also to have BLE nodes in the NIB nc if we decided to do #21580 (comment) and CONFIG_GNRC_IPV6_NIB_6LN is enabled. But then also only if we use BLE, ...

I am not sure how to best present these dependencies. Should just check all of these conditions/ combinations in a nested if-USEMODULE check?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also prefer, if it is an optional dependency to gnrc and only in the combination you named mandatory. I would make it a dependency of rplble and gnrc_sixlowpan_6ln combined (not sure these are the correct names of these modules...).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay. Done with 2ab900c. The netnotify module now is included if nimble_netif and gnrc_ipv6 are used.
I noticed that it doesn't depend on gnrc_sixlowpan_6ln after all.

USEMODULE += gnrc_netreg
USEMODULE += gnrc_netif
USEMODULE += gnrc_netif_hdr
Expand Down
Loading
Loading