mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-25 14:33:52 +01:00
sys/net/gnrc/netif: Make aac_mode a flag field
This commit is contained in:
parent
08f1f9768d
commit
672a86d58e
@ -27,9 +27,9 @@ extern "C" {
|
||||
* @anchor net_gnrc_netif_aac
|
||||
*/
|
||||
enum {
|
||||
GNRC_NETIF_AAC_NONE = 0, /**< no configuration */
|
||||
GNRC_NETIF_AAC_AUTO, /**< Use some automatic bootstrapping (e.g. SLAAC with IPv6) */
|
||||
GNRC_NETIF_AAC_DHCP, /**< Use DHCP(v6) */
|
||||
GNRC_NETIF_AAC_NONE = 0x00, /**< no configuration */
|
||||
GNRC_NETIF_AAC_AUTO = 0x01, /**< Use some automatic bootstrapping (e.g. SLAAC with IPv6) */
|
||||
GNRC_NETIF_AAC_DHCP = 0x02, /**< Use DHCP(v6) */
|
||||
/* extend if needed */
|
||||
};
|
||||
|
||||
@ -82,7 +82,7 @@ enum {
|
||||
#define GNRC_NETIF_FLAGS_IPV6_ADV_RETRANS_TIMER (0x00000040U)
|
||||
|
||||
/**
|
||||
* @brief If gnrc_netif_t::ipv6::aac_mode == GNRC_NETIF_AAC_DHCP then this
|
||||
* @brief If gnrc_netif_t::ipv6::aac_mode & GNRC_NETIF_AAC_DHCP then this
|
||||
* flag indicates that other configuration information is available via
|
||||
* DHCPv6 (e.g. DNS-related information)
|
||||
*
|
||||
|
||||
@ -243,7 +243,7 @@ typedef struct {
|
||||
#endif /* MODULE_GNRC_IPV6_NIB */
|
||||
|
||||
/**
|
||||
* @brief IPv6 auto-address configuration mode
|
||||
* @brief IPv6 auto-address configuration mode flags
|
||||
*
|
||||
* @note Only available with module @ref net_gnrc_ipv6 "gnrc_ipv6"
|
||||
*/
|
||||
|
||||
@ -163,7 +163,7 @@ void _remove_tentative_addr(gnrc_netif_t *netif, const ipv6_addr_t *addr)
|
||||
* not change hardware address to retry SLAAC => use purely
|
||||
* DHCPv6 instead */
|
||||
/* TODO: implement IA_NA for DHCPv6 */
|
||||
/* then => tgt_netif->aac_mode = GNRC_NETIF_AAC_DHCP; */
|
||||
/* then => tgt_netif->aac_mode |= GNRC_NETIF_AAC_DHCP; */
|
||||
DEBUG("nib: would set interface %i to DHCPv6, "
|
||||
"but is not implemented yet", netif->pid);
|
||||
}
|
||||
|
||||
@ -133,7 +133,7 @@ void gnrc_ipv6_nib_init_iface(gnrc_netif_t *netif)
|
||||
#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_SLAAC) || IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_6LN)
|
||||
/* TODO: set differently dependent on CONFIG_GNRC_IPV6_NIB_SLAAC if
|
||||
* alternatives exist */
|
||||
netif->ipv6.aac_mode = GNRC_NETIF_AAC_AUTO;
|
||||
netif->ipv6.aac_mode |= GNRC_NETIF_AAC_AUTO;
|
||||
#endif /* CONFIG_GNRC_IPV6_NIB_SLAAC || CONFIG_GNRC_IPV6_NIB_6LN */
|
||||
_init_iface_router(netif);
|
||||
gnrc_netif_init_6ln(netif);
|
||||
|
||||
@ -69,7 +69,7 @@ int gnrc_ipv6_nib_pl_set(unsigned iface,
|
||||
(ipv6_addr_match_prefix(&netif->ipv6.addrs[idx], pfx) >= pfx_len)) {
|
||||
dst->flags |= _PFX_ON_LINK;
|
||||
}
|
||||
if (netif->ipv6.aac_mode == GNRC_NETIF_AAC_AUTO) {
|
||||
if (netif->ipv6.aac_mode & GNRC_NETIF_AAC_AUTO) {
|
||||
dst->flags |= _PFX_SLAAC;
|
||||
}
|
||||
#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_6LBR) && IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_MULTIHOP_P6C)
|
||||
|
||||
@ -538,7 +538,7 @@ void gnrc_ndp_rtr_adv_send(gnrc_netif_t *netif, const ipv6_addr_t *src,
|
||||
if (!fin) {
|
||||
adv_ltime = netif->ipv6.rtr_ltime;
|
||||
}
|
||||
if (netif->ipv6.aac_mode == GNRC_NETIF_AAC_DHCP) {
|
||||
if (netif->ipv6.aac_mode & GNRC_NETIF_AAC_DHCP) {
|
||||
flags |= NDP_RTR_ADV_FLAGS_M;
|
||||
if (netif->flags & GNRC_NETIF_FLAGS_IPV6_ADV_O_FLAG) {
|
||||
flags |= NDP_RTR_ADV_FLAGS_O;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user