-
Notifications
You must be signed in to change notification settings - Fork 2.1k
gnrc, nimble/ble: notify network layer of BLE connection events #21608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 7 commits
7564665
0408e39
bf82b94
fbd2219
9715791
9030409
6cef5d6
b6e19c2
f1b82ec
4404817
e9d25cb
6570d30
82b5059
7e911b8
d8d7c81
602e894
418825f
7755585
2447cb8
8c53e7a
2c5bf74
ad4c316
b8ae0f6
abb69a1
afb04c8
8c88416
bee053b
a7d5ac9
2079a8f
30b2b7f
2bfd90d
7713680
f57c38b
2d5e9c5
7de5975
754fe9c
0c8d01d
97a0422
d57474d
06c3e64
5328407
00a8d28
ed5ac34
c45fd59
6e33db2
2ab900c
d0df717
e263d97
d20a7b5
11567f7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -233,6 +233,29 @@ 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. | ||
| * | ||
| * @return 0 on success. | ||
| * @return -ENOTSUP, if the interface does not represent a 6LN or when | ||
| * gnrc_netif_t::device_type of the iface does not support IID conversion. | ||
| * @return -EINVAL, when @p addr_len is invalid for the | ||
| * gnrc_netif_t::device_type of @p netif. | ||
| * @return -ENOMEM, if no space is left in neighbor cache. | ||
elenaf9 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| */ | ||
| int gnrc_ipv6_nib_nc_try_set_6ln(unsigned iface, const uint8_t *l2addr, | ||
| size_t l2addr_len); | ||
|
||
| #else /* CONFIG_GNRC_IPV6_NIB_6LN */ | ||
| #define gnrc_ipv6_nib_nc_try_set_6ln(unsigned iface, const uint8_t *l2addr, | ||
| size_t l2addr_len) (-ENOTSUP) | ||
| #endif /* CONFIG_GNRC_IPV6_NIB_6LN */ | ||
|
|
||
| /** | ||
| * @brief Deletes neighbor with address @p ipv6 from NIB | ||
| * | ||
|
|
@@ -245,6 +268,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. | ||
| * | ||
| * @return True, if a neighbor with @p l2addr existed. | ||
| * @return False, otherwise. | ||
elenaf9 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| */ | ||
| 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 | ||
| * | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| /* | ||
| * Copyright (C) 2025 Elena Frank <[email protected]> | ||
| * | ||
| * This file is subject to the terms and conditions of the GNU Lesser | ||
| * General Public License v2.1. See the file LICENSE in the top level | ||
| * directory for more details. | ||
| */ | ||
|
|
||
| #pragma once | ||
|
|
||
| #ifdef __cplusplus | ||
| extern "C" { | ||
| #endif | ||
|
|
||
| #include "sched.h" | ||
|
|
||
| /** | ||
| * @brief Definition of notification event types in the network stack. | ||
| * | ||
| * @note Expand at will. | ||
| */ | ||
| typedef enum { | ||
| NETNOTIFY_L2_CONNECTED, | ||
| NETNOTIFY_L2_DISCONNECTED, | ||
| NETNOTIFY_L3_DISCOVERED, | ||
| NETNOTIFY_L3_UNREACHABLE, | ||
| } netnotify_t; | ||
|
|
||
| /** | ||
| * @brief L2 (dis-)connection event data. | ||
| */ | ||
| typedef struct netnotify_l2_connec { | ||
elenaf9 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 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 */ | ||
| } netnotify_l2_connec_t; | ||
|
|
||
|
|
||
| #ifdef __cplusplus | ||
| } | ||
| #endif | ||
|
|
||
| /** @} */ | ||
elenaf9 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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. | ||
| * | ||
| * @return Index > 0 to continue next search from, if parent was found. | ||
| * @return -ENONENT if not found | ||
elenaf9 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| */ | ||
| int gnrc_rpl_parent_iter_by_addr(ipv6_addr_t *addr, gnrc_rpl_parent_t **parent, int idx); | ||
|
|
||
|
Comment on lines
132
to
143
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See #21586 (comment).
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Quoting from there for reviewer's convenience:
I'm not knowledgeable enough with RPL to comment on this. |
||
| /** | ||
| * @brief Remove the @p parent from its DODAG. | ||
| * | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.