-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sys: net: dhcpv6: consolidate simple_pd code
Reduce code duplication by having the simple PD feature as conditional configuration within the regular DHCPv6 client code.
- Loading branch information
Showing
6 changed files
with
60 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ | |
|
||
#include "byteorder.h" | ||
#include "net/ipv6/addr.h" | ||
#include "net/gnrc/netif.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
|
@@ -349,6 +350,39 @@ typedef struct __attribute__((packed)) { | |
void dhcpv6_client_dns_rns_conf(const dhcpv6_opt_dns_rns_t *opt, | ||
uint16_t netif); | ||
|
||
/** | ||
* @brief Find upstream network interface | ||
* | ||
* Either the one network interface configured at compile-time with @ref | ||
* CONFIG_GNRC_DHCPV6_CLIENT_6LBR_UPSTREAM is picked or the first network | ||
* interface that is not a 6LoWPAN interfaces if | ||
* `CONFIG_GNRC_DHCPV6_CLIENT_6LBR_UPSTREAM` is 0. | ||
* | ||
* @return The upstream network interface. | ||
*/ | ||
gnrc_netif_t *_dhcpv6_client_simple_pd_find_upstream_netif(void); | ||
|
||
/** | ||
* @brief Configure upstream netif to be in line with configuration script | ||
* | ||
* Set route and link-local address in accordance to | ||
* `dist/tools/ethos/setup_network.sh`. | ||
* | ||
* @note This might not be necessary with a properly set-up DHCPv6 server | ||
* (automatically configures a route for the delegated prefix) and | ||
* upstream router (sends periodic router advertisements). | ||
* | ||
* @param[in] upstream_netif The upstream netif | ||
*/ | ||
void _dhcpv6_client_simple_pd_configure_upstream_netif(gnrc_netif_t *upstream_netif); | ||
|
||
/** | ||
* @brief Configures all 6LoWPAN interfaces to request a 64-bit prefix | ||
* | ||
* @param[in] upstream_netif The upstream netif | ||
Check failure on line 382 in sys/net/application_layer/dhcpv6/_dhcpv6.h
|
||
*/ | ||
void _dhcpv6_client_simple_pd_request_prefixes(gnrc_netif_t *upstream); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters