1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2026-01-01 01:41:18 +01:00

gnrc/nib: Move GNRC_IPV6_NIB_CONF_DC to 'CONFIG_' namespace

Also evaluate using IS_ACTIVE macro.
This commit is contained in:
Leandro Lanzieri 2020-03-12 16:09:12 +01:00
parent 219d5a1de2
commit 3ec296400d
No known key found for this signature in database
GPG Key ID: 39607DE6080007A3
5 changed files with 13 additions and 12 deletions

View File

@ -173,11 +173,11 @@ extern "C" {
/**
* @brief (de-)activate destination cache
*/
#ifndef GNRC_IPV6_NIB_CONF_DC
#ifndef CONFIG_GNRC_IPV6_NIB_DC
#if CONFIG_GNRC_IPV6_NIB_REDIRECT
#define GNRC_IPV6_NIB_CONF_DC 1
#define CONFIG_GNRC_IPV6_NIB_DC 1
#else
#define GNRC_IPV6_NIB_CONF_DC 0
#define CONFIG_GNRC_IPV6_NIB_DC 0
#endif
#endif

View File

@ -585,7 +585,7 @@ static inline void _nib_offl_remove(_nib_offl_entry_t *nib_offl, uint8_t mode)
_nib_offl_clear(nib_offl);
}
#if GNRC_IPV6_NIB_CONF_DC || DOXYGEN
#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_DC) || DOXYGEN
/**
* @brief Creates or gets an existing destination cache entry by its addresses
*
@ -596,7 +596,7 @@ static inline void _nib_offl_remove(_nib_offl_entry_t *nib_offl, uint8_t mode)
* *May also be a global address!*
* @param[in] iface The interface to the destination.
*
* @note Only available if @ref GNRC_IPV6_NIB_CONF_DC.
* @note Only available if @ref CONFIG_GNRC_IPV6_NIB_DC.
*
* @return A new or existing off-link entry with _nib_offl_entry_t::pfx set to
* @p pfx.
@ -617,13 +617,13 @@ static inline _nib_offl_entry_t *_nib_dc_add(const ipv6_addr_t *next_hop,
*
* Corresponding on-link entry is removed, too.
*
* @note Only available if @ref GNRC_IPV6_NIB_CONF_DC.
* @note Only available if @ref CONFIG_GNRC_IPV6_NIB_DC.
*/
static inline void _nib_dc_remove(_nib_offl_entry_t *nib_offl)
{
_nib_offl_remove(nib_offl, _DC);
}
#endif /* GNRC_IPV6_NIB_CONF_DC */
#endif /* CONFIG_GNRC_IPV6_NIB_DC */
/**
* @brief Creates or gets an existing prefix list entry by its prefix

View File

@ -269,9 +269,9 @@ int gnrc_ipv6_nib_get_next_hop_l2addr(const ipv6_addr_t *dst,
GNRC_IPV6_NIB_ROUTE_INFO_TYPE_RN,
&route.dst,
(void *)((intptr_t)route.dst_len));
#if GNRC_IPV6_NIB_CONF_DC
#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_DC)
_nib_dc_add(&route.next_hop, netif->pid, dst);
#endif /* GNRC_IPV6_NIB_CONF_DC */
#endif /* CONFIG_GNRC_IPV6_NIB_DC */
}
else {
/* _resolve_addr releases pkt if not queued (in which case

View File

@ -8,6 +8,6 @@ CFLAGS += -DGNRC_IPV6_NIB_DEFAULT_ROUTER_NUMOF=4
CFLAGS += -DGNRC_IPV6_NIB_ABR_NUMOF=4
CFLAGS += -DCONFIG_GNRC_IPV6_NIB_6LBR=1
CFLAGS += -DGNRC_IPV6_NIB_CONF_MULTIHOP_P6C=1
CFLAGS += -DGNRC_IPV6_NIB_CONF_DC=1
CFLAGS += -DCONFIG_GNRC_IPV6_NIB_DC=1
INCLUDES += -I$(RIOTBASE)/sys/net/gnrc/network_layer/ipv6/nib

View File

@ -13,6 +13,7 @@
* @author Martine Lenders <m.lenders@fu-berlin.de>
*/
#include <kernel_defines.h>
#include <inttypes.h>
#include "net/ipv6/addr.h"
@ -1634,7 +1635,7 @@ static void test_nib_offl_iter__three_elem_middle_removed(void)
TEST_ASSERT_NULL(_nib_offl_iter(res));
}
#if GNRC_IPV6_NIB_CONF_DC
#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_DC)
/*
* Creates a destination cache entry.
* Expected result: new entry should contain the given address and interface
@ -2077,7 +2078,7 @@ Test *tests_gnrc_ipv6_nib_internal_tests(void)
new_TestFixture(test_nib_offl_iter__one_elem),
new_TestFixture(test_nib_offl_iter__three_elem),
new_TestFixture(test_nib_offl_iter__three_elem_middle_removed),
#if GNRC_IPV6_NIB_CONF_DC
#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_DC)
new_TestFixture(test_nib_dc_add__success),
new_TestFixture(test_nib_dc_remove),
#endif